moi-computer 0.11.0 → 0.11.1-dev.1c52199

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 (405) hide show
  1. package/README.md +2 -2
  2. package/client/AGENTS.md +2 -2
  3. package/client/api/app-config.ts +2 -1
  4. package/client/app/AppRouter.tsx +2 -2
  5. package/client/app/routes/WorkspaceRoute.tsx +33 -27
  6. package/client/app/shell/SidebarLayout.tsx +18 -15
  7. package/client/components/shared/BottomPanel.tsx +26 -14
  8. package/client/components/shared/PanelHeader.tsx +1 -1
  9. package/client/components/shared/ReorderableList.tsx +7 -2
  10. package/client/components/shared/WorkspaceIcon.tsx +92 -0
  11. package/client/components/ui/alert-dialog.tsx +1 -0
  12. package/client/components/ui/button.tsx +1 -53
  13. package/client/components/ui/checkbox.tsx +1 -0
  14. package/client/components/ui/collapsible.tsx +1 -15
  15. package/client/components/ui/dialog.tsx +1 -58
  16. package/client/components/ui/dropdown-menu.tsx +1 -254
  17. package/client/components/ui/hover-card.tsx +1 -44
  18. package/client/components/ui/inline-input.tsx +84 -0
  19. package/client/components/ui/input.tsx +1 -21
  20. package/client/components/ui/popover.tsx +1 -88
  21. package/client/components/ui/resizable.tsx +1 -40
  22. package/client/components/ui/skeleton.tsx +1 -13
  23. package/client/components/ui/slider.tsx +1 -70
  24. package/client/components/ui/spinner.tsx +1 -18
  25. package/client/components/ui/switch.tsx +1 -23
  26. package/client/components/ui/tabs.tsx +1 -0
  27. package/client/components/ui/textarea.tsx +1 -18
  28. package/client/components/ui/toast.tsx +2 -2
  29. package/client/components/ui/tooltip.tsx +1 -51
  30. package/client/features/applets/AppletMount.tsx +5 -2
  31. package/client/features/applets/applet-cache.ts +3 -3
  32. package/client/features/applets/applet-runtime.ts +158 -108
  33. package/client/features/applets/applet-styles.ts +2 -2
  34. package/client/features/applets/applet-thumbnail.ts +6 -8
  35. package/client/features/applets/useApplet.ts +10 -9
  36. package/client/features/chat/ChatPanel.tsx +24 -15
  37. package/client/features/chat/ChatPopup.tsx +9 -5
  38. package/client/features/chat/applet-chat-intents.ts +179 -0
  39. package/client/features/chat/chat-send.ts +116 -64
  40. package/client/features/chat/chat-store.ts +51 -62
  41. package/client/features/chat/composer/ChatComposer.tsx +43 -128
  42. package/client/features/chat/composer/ModelPicker.tsx +47 -60
  43. package/client/features/chat/composer/attachments/AttachmentChip.tsx +99 -0
  44. package/client/features/chat/composer/attachments/DrawingAttachmentChip.tsx +37 -0
  45. package/client/features/chat/composer/attachments/FileAttachmentChip.tsx +22 -0
  46. package/client/features/chat/composer/attachments/TextAttachmentChip.tsx +11 -0
  47. package/client/features/chat/composer/attachments/draft-attachments.ts +168 -0
  48. package/client/features/chat/composer/attachments/types.ts +25 -0
  49. package/client/features/chat/composer/attachments/uploads.ts +26 -0
  50. package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
  51. package/client/features/chat/composer/model-order.ts +15 -0
  52. package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
  53. package/client/features/chat/{chat-connection.ts → connection/chat-connection.ts} +1 -1
  54. package/client/features/chat/{chat-frames.ts → connection/chat-frames.ts} +10 -8
  55. package/client/features/chat/{ChatEmptyState.tsx → messages/ChatEmptyState.tsx} +16 -11
  56. package/client/features/chat/{MarkdownContent.tsx → messages/MarkdownContent.tsx} +16 -1
  57. package/client/features/chat/{TurnView.tsx → messages/TurnView.tsx} +27 -19
  58. package/client/features/chat/{group-turns.ts → messages/group-turns.ts} +12 -0
  59. package/client/features/chat/{interleave-notices.ts → messages/interleave-notices.ts} +7 -11
  60. package/client/features/chat/{tool-group → messages/tool-group}/SubagentCard.tsx +1 -1
  61. package/client/features/chat/{tool-group → messages/tool-group}/TimelineRow.tsx +2 -2
  62. package/client/features/chat/{tool-group → messages/tool-group}/ToolCallGroup.tsx +2 -5
  63. package/client/features/chat/{tool-group → messages/tool-group}/format/codex.ts +4 -1
  64. package/client/features/chat/{ChatSelector.tsx → sessions/ChatSelector.tsx} +3 -3
  65. package/client/features/chat/{api.ts → sessions/api.ts} +5 -14
  66. package/client/features/chat/sessions/session-view.ts +53 -0
  67. package/client/features/chat/{useSelectedSession.ts → sessions/useSelectedSession.ts} +64 -20
  68. package/client/features/chat/useChat.ts +46 -24
  69. package/client/features/collab/DevCollabIdentity.tsx +170 -0
  70. package/client/features/collab/DevCollabKit.tsx +501 -0
  71. package/client/features/collab/DevCollabPage.tsx +25 -0
  72. package/client/features/collab/WorkspaceCollabControls.tsx +313 -0
  73. package/client/features/collab/client.ts +146 -0
  74. package/client/features/collab/components.tsx +307 -0
  75. package/client/features/collab/dev-persona.ts +66 -0
  76. package/client/features/collab/engine.ts +96 -0
  77. package/client/features/collab/entry.tsx +35 -0
  78. package/client/features/collab/facehash-avatar.ts +132 -0
  79. package/client/features/collab/fake-engine.ts +130 -0
  80. package/client/features/collab/hooks.tsx +253 -0
  81. package/client/features/collab/identity.ts +305 -0
  82. package/client/features/collab/index.ts +45 -0
  83. package/client/features/collab/people.ts +102 -0
  84. package/client/features/collab/personal-state.ts +61 -0
  85. package/client/features/collab/presence-publisher.ts +29 -0
  86. package/client/features/collab/presence-target.ts +10 -0
  87. package/client/features/collab/primitives.tsx +398 -0
  88. package/client/features/collab/proxy-identity.ts +24 -0
  89. package/client/features/collab/store.ts +156 -0
  90. package/client/features/dev/ChatStatesPage.tsx +8 -7
  91. package/client/features/dev/DevIndexPage.tsx +10 -0
  92. package/client/features/dev/DevRoutes.tsx +16 -1
  93. package/client/features/dev/HarnessDebugPage.tsx +11 -8
  94. package/client/features/dev/ToolCallsPage.tsx +1 -1
  95. package/client/features/dev/UiComponentPreviews.tsx +855 -0
  96. package/client/features/dev/UiComponentsPage.tsx +60 -0
  97. package/client/features/dev/chat-states-fixtures.ts +13 -2
  98. package/client/features/drawings/useChatAnnotation.ts +17 -17
  99. package/client/features/drawings/useDrawingLayer.ts +7 -9
  100. package/client/features/drawings/useViewBuilderSketch.ts +18 -15
  101. package/client/features/home/HomePage.tsx +8 -7
  102. package/client/features/home/WorkspacePreview.tsx +2 -2
  103. package/client/features/home/workspace-presentation.tsx +1 -11
  104. package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
  105. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
  106. package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +2 -4
  107. package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
  108. package/client/features/overview/HiddenPanel.tsx +109 -0
  109. package/client/features/overview/Overview.tsx +302 -0
  110. package/client/features/overview/WidgetCanvas.tsx +164 -0
  111. package/client/features/{widgets → overview}/WidgetFrame.tsx +25 -17
  112. package/client/features/overview/WorkspaceName.tsx +60 -0
  113. package/client/features/overview/api.ts +30 -0
  114. package/client/features/overview/default/ViewsWidget.tsx +252 -0
  115. package/client/features/overview/default/registry.tsx +36 -0
  116. package/client/features/{widgets → overview}/grid.ts +36 -0
  117. package/client/features/overview/useGridReconcile.ts +94 -0
  118. package/client/features/scratchpad/Scratchpad.tsx +7 -8
  119. package/client/features/scratchpad/ScratchpadControls.tsx +0 -1
  120. package/client/features/scratchpad/useScratchpadSnapshot.tsx +23 -13
  121. package/client/features/settings/GeneralSettings.tsx +55 -58
  122. package/client/features/settings/SettingsLayout.tsx +2 -2
  123. package/client/features/settings/WorkspaceIconPicker.tsx +318 -0
  124. package/client/features/settings/WorkspaceSettingsDialog.tsx +65 -0
  125. package/client/features/settings/api.ts +48 -24
  126. package/client/features/views/ViewBuilder.tsx +5 -4
  127. package/client/features/views/ViewManager.tsx +28 -22
  128. package/client/features/views/api.ts +36 -2
  129. package/client/features/views/useViewBuilderActions.ts +11 -5
  130. package/client/features/views/useViewBuilderDrafts.ts +23 -21
  131. package/client/features/views/view-presentation.ts +13 -0
  132. package/client/features/workspace/{CustomizePanel.tsx → ThemePanel.tsx} +26 -31
  133. package/client/features/workspace/UnavailablePage.tsx +21 -0
  134. package/client/features/workspace/WorkspaceLayoutContext.tsx +22 -10
  135. package/client/features/workspace/WorkspaceScreen.tsx +228 -172
  136. package/client/features/workspace/WorkspaceSplitLayout.tsx +7 -2
  137. package/client/features/workspace/WorkspaceTabs.tsx +2 -0
  138. package/client/features/workspace/api.ts +5 -31
  139. package/client/features/workspace/layout-save.ts +13 -0
  140. package/client/features/workspace/moi-context.ts +15 -11
  141. package/client/features/workspace/tab-resolution.ts +10 -33
  142. package/client/features/workspace/useWorkspaceNavigation.ts +173 -101
  143. package/client/index.css +23 -30
  144. package/client/index.tsx +4 -3
  145. package/client/lib/app-icon-registry.ts +2 -0
  146. package/client/lib/use-latest-ref.ts +11 -0
  147. package/client/main.tsx +1 -1
  148. package/client/runtime/useWorkspaceEvents.ts +59 -14
  149. package/client/theme.css +5 -5
  150. package/dist/chunk-1ftessc8.js +2 -0
  151. package/dist/chunk-3802vh2p.js +2 -0
  152. package/dist/chunk-542a2m9m.js +1 -0
  153. package/dist/chunk-5745d83v.js +2 -0
  154. package/dist/chunk-5zxdsjym.js +1 -0
  155. package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
  156. package/dist/chunk-7r4z77ry.js +2 -0
  157. package/dist/chunk-9cm0wjah.js +79 -0
  158. package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
  159. package/dist/chunk-cvgdm1hq.js +2 -0
  160. package/dist/chunk-gptm4jpd.js +546 -0
  161. package/dist/chunk-nf2wkvf9.js +14 -0
  162. package/dist/chunk-wnmf38ta.js +5 -0
  163. package/dist/chunk-xaehhr1j.css +1 -0
  164. package/dist/chunk-xpt063fx.js +1 -0
  165. package/dist/index.html +1 -1
  166. package/lib/app-icons.ts +1 -0
  167. package/lib/applet-selector.ts +24 -0
  168. package/lib/chat-title.ts +6 -1
  169. package/lib/collab/colors.ts +24 -0
  170. package/lib/collab/protocol.ts +83 -0
  171. package/lib/collab/types.ts +63 -0
  172. package/lib/default-widgets.ts +32 -0
  173. package/lib/experimental.ts +14 -0
  174. package/lib/format.ts +67 -7
  175. package/lib/message-attachments.ts +40 -0
  176. package/lib/moi-attachments.ts +204 -0
  177. package/lib/moi-context.ts +27 -35
  178. package/lib/navigation.ts +84 -0
  179. package/lib/themes.ts +6 -6
  180. package/lib/types.ts +103 -40
  181. package/lib/workspace-icon.ts +20 -0
  182. package/lib/workspace-layout.ts +22 -2
  183. package/lib/workspace-tabs.ts +9 -33
  184. package/package.json +44 -32
  185. package/registry.json +656 -0
  186. package/server/AGENTS.md +2 -0
  187. package/server/agent.ts +1 -1
  188. package/server/api.ts +162 -68
  189. package/server/app-config.ts +127 -34
  190. package/server/applet-typecheck.ts +100 -0
  191. package/server/applets/applet-css.ts +55 -0
  192. package/server/{bundler → applets}/build-applet.ts +21 -240
  193. package/server/applets/build-worker.ts +178 -0
  194. package/server/applets/config.ts +226 -0
  195. package/server/applets/dependencies.ts +206 -0
  196. package/server/{applets.ts → applets/index.ts} +44 -189
  197. package/server/applets/runtime/base.ts +4 -0
  198. package/server/applets/runtime/moi.ts +42 -0
  199. package/server/applets/runtime/rpc.ts +17 -0
  200. package/server/applets/view-source.ts +67 -0
  201. package/server/attachment-message.ts +95 -0
  202. package/server/chat-selection.ts +23 -0
  203. package/server/cli-ui-components.ts +28 -33
  204. package/server/cli.ts +226 -120
  205. package/server/collab/applet-module.ts +50 -0
  206. package/server/collab/cloudflare-access.ts +77 -0
  207. package/server/collab/config.ts +18 -0
  208. package/server/collab/ipc.ts +10 -0
  209. package/server/collab/manager.ts +407 -0
  210. package/server/collab/service.ts +137 -0
  211. package/server/collab/skill/collab-env.d.ts +92 -0
  212. package/server/collab/skill/index.ts +59 -0
  213. package/server/collab/worker.ts +52 -0
  214. package/server/control.ts +63 -42
  215. package/server/data-dir.ts +1 -1
  216. package/server/harness/README.md +45 -50
  217. package/server/harness/acp/NOTES.md +426 -0
  218. package/server/harness/acp/adapter.ts +7 -21
  219. package/server/harness/acp/discovery.ts +27 -30
  220. package/server/harness/acp/model-state.ts +57 -0
  221. package/server/harness/acp/session.ts +49 -56
  222. package/server/harness/claude-code/NOTES.md +54 -13
  223. package/server/harness/claude-code/adapter.ts +8 -25
  224. package/server/harness/claude-code/cli.ts +40 -0
  225. package/server/harness/claude-code/index.ts +13 -5
  226. package/server/harness/claude-code/models.ts +72 -19
  227. package/server/harness/claude-code/session.ts +447 -343
  228. package/server/harness/claude-code/sessions.ts +9 -4
  229. package/server/harness/codex/NOTES.md +222 -350
  230. package/server/harness/codex/adapter.ts +102 -52
  231. package/server/harness/codex/auth.ts +1 -3
  232. package/server/harness/codex/client.ts +169 -249
  233. package/server/harness/codex/discovery.ts +9 -17
  234. package/server/harness/codex/index.ts +3 -1
  235. package/server/harness/codex/pagination.ts +24 -0
  236. package/server/harness/codex/permissions.ts +32 -8
  237. package/server/harness/codex/probe.ts +10 -13
  238. package/server/harness/codex/session.ts +567 -181
  239. package/server/harness/codex/transport.ts +184 -0
  240. package/server/harness/debug.ts +1 -1
  241. package/server/harness/hermes/NOTES.md +19 -1
  242. package/server/harness/hermes/discovery.ts +20 -0
  243. package/server/harness/hermes/index.ts +13 -0
  244. package/server/harness/hermes/models.ts +28 -8
  245. package/server/harness/openclaw/NOTES.md +1 -1
  246. package/server/harness/openclaw/adapter.ts +22 -4
  247. package/server/harness/openclaw/gateway.ts +5 -3
  248. package/server/harness/openclaw/session.ts +27 -27
  249. package/server/harness/types.ts +9 -5
  250. package/server/layout.ts +24 -16
  251. package/server/moi-scaffold.ts +22 -14
  252. package/server/navigation-relay.ts +110 -0
  253. package/server/preview.ts +3 -1
  254. package/server/registry.ts +71 -41
  255. package/server/scratchpad-executor.ts +79 -56
  256. package/server/scratchpad-shape-defaults.ts +82 -0
  257. package/server/selected-session.ts +24 -4
  258. package/server/skill-update.ts +5 -3
  259. package/server/skill-version.ts +4 -7
  260. package/server/skills-template.ts +60 -9
  261. package/server/tabs.ts +19 -33
  262. package/server/tldraw-package.d.ts +4 -0
  263. package/server/ui-components.ts +101 -434
  264. package/server/uploads.ts +0 -0
  265. package/server/view-builders.ts +20 -2
  266. package/server/views.ts +126 -6
  267. package/server/web.ts +108 -30
  268. package/server/widgets.ts +12 -5
  269. package/server/workspace-config.ts +13 -9
  270. package/server/workspace-env.ts +3 -2
  271. package/tsconfig.json +0 -1
  272. package/ui-components/accordion.tsx +71 -0
  273. package/ui-components/alert-dialog.tsx +165 -0
  274. package/ui-components/alert.tsx +68 -0
  275. package/ui-components/attachment.tsx +195 -0
  276. package/ui-components/avatar.tsx +91 -0
  277. package/ui-components/badge.tsx +49 -0
  278. package/ui-components/button-group.tsx +78 -0
  279. package/ui-components/button.tsx +55 -0
  280. package/ui-components/calendar.tsx +180 -0
  281. package/ui-components/card.tsx +84 -0
  282. package/ui-components/carousel.tsx +235 -0
  283. package/ui-components/chart.tsx +338 -0
  284. package/ui-components/checkbox.tsx +28 -0
  285. package/ui-components/collapsible.tsx +15 -0
  286. package/ui-components/combobox.tsx +267 -0
  287. package/ui-components/context-menu.tsx +244 -0
  288. package/ui-components/dialog.tsx +138 -0
  289. package/ui-components/docs/accordion.md +463 -0
  290. package/ui-components/docs/alert-dialog.md +481 -0
  291. package/ui-components/docs/alert.md +301 -0
  292. package/ui-components/docs/attachment.md +689 -0
  293. package/ui-components/docs/avatar.md +495 -0
  294. package/ui-components/docs/badge.md +258 -0
  295. package/ui-components/docs/button-group.md +879 -0
  296. package/ui-components/docs/button.md +26 -0
  297. package/ui-components/docs/calendar.md +862 -0
  298. package/ui-components/docs/card.md +265 -0
  299. package/ui-components/docs/carousel.md +627 -0
  300. package/ui-components/docs/chart.md +1256 -0
  301. package/ui-components/docs/checkbox.md +477 -0
  302. package/ui-components/docs/collapsible.md +446 -0
  303. package/ui-components/docs/combobox.md +1003 -0
  304. package/ui-components/docs/context-menu.md +860 -0
  305. package/ui-components/docs/data-table.md +1580 -0
  306. package/ui-components/docs/date-picker.md +614 -0
  307. package/ui-components/docs/dialog.md +414 -0
  308. package/ui-components/docs/drawer.md +51 -0
  309. package/ui-components/docs/dropdown-menu.md +1000 -0
  310. package/ui-components/docs/field.md +1192 -0
  311. package/ui-components/docs/hover-card.md +275 -0
  312. package/ui-components/docs/input-group.md +866 -0
  313. package/ui-components/docs/input.md +456 -0
  314. package/ui-components/docs/kbd.md +191 -0
  315. package/ui-components/docs/label.md +295 -0
  316. package/ui-components/docs/pagination.md +416 -0
  317. package/ui-components/docs/popover.md +348 -0
  318. package/ui-components/docs/progress.md +214 -0
  319. package/ui-components/docs/radio-group.md +389 -0
  320. package/ui-components/docs/resizable.md +265 -0
  321. package/ui-components/docs/select.md +616 -0
  322. package/ui-components/docs/separator.md +216 -0
  323. package/ui-components/docs/skeleton.md +205 -0
  324. package/ui-components/docs/slider.md +226 -0
  325. package/ui-components/docs/spinner.md +332 -0
  326. package/ui-components/docs/switch.md +236 -0
  327. package/ui-components/docs/table.md +551 -0
  328. package/ui-components/docs/tabs.md +379 -0
  329. package/ui-components/docs/textarea.md +187 -0
  330. package/ui-components/docs/toggle-group.md +370 -0
  331. package/ui-components/docs/toggle.md +91 -0
  332. package/ui-components/docs/tooltip.md +290 -0
  333. package/ui-components/drawer.tsx +213 -0
  334. package/ui-components/dropdown-menu.tsx +263 -0
  335. package/ui-components/field.tsx +224 -0
  336. package/ui-components/hover-card.tsx +46 -0
  337. package/ui-components/input-group.tsx +146 -0
  338. package/ui-components/input.tsx +20 -0
  339. package/ui-components/kbd.tsx +32 -0
  340. package/ui-components/label.tsx +17 -0
  341. package/ui-components/pagination.tsx +124 -0
  342. package/ui-components/popover.tsx +81 -0
  343. package/ui-components/progress.tsx +63 -0
  344. package/ui-components/radio-group.tsx +38 -0
  345. package/ui-components/resizable.tsx +40 -0
  346. package/ui-components/scoped-portal.tsx +31 -0
  347. package/ui-components/select.tsx +195 -0
  348. package/ui-components/separator.tsx +18 -0
  349. package/ui-components/skeleton.tsx +15 -0
  350. package/ui-components/slider.tsx +75 -0
  351. package/ui-components/spinner.tsx +20 -0
  352. package/ui-components/switch.tsx +27 -0
  353. package/ui-components/table.tsx +86 -0
  354. package/ui-components/tabs.tsx +75 -0
  355. package/ui-components/textarea.tsx +17 -0
  356. package/ui-components/toggle-group.tsx +85 -0
  357. package/ui-components/toggle.tsx +42 -0
  358. package/ui-components/tooltip.tsx +61 -0
  359. package/ui-components/utils.ts +8 -0
  360. package/workspace/.claude/skills/moi-workspace/SKILL.md +295 -248
  361. package/workspace/.claude/skills/moi-workspace/references/COLLABORATIVE.md +151 -0
  362. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +100 -152
  363. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +156 -0
  364. package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
  365. package/client/features/chat/attachment-staging.ts +0 -153
  366. package/client/features/chat/uploads.ts +0 -18
  367. package/client/features/chat/useAppletChatMessage.ts +0 -68
  368. package/client/features/settings/IconPicker.tsx +0 -442
  369. package/client/features/settings/WorkspaceSettings.tsx +0 -92
  370. package/client/features/settings/render-icon.ts +0 -173
  371. package/client/features/widgets/HiddenPanel.tsx +0 -80
  372. package/client/features/widgets/WidgetGrid.tsx +0 -123
  373. package/client/features/widgets/Widgets.tsx +0 -264
  374. package/client/features/widgets/useGridReconcile.ts +0 -73
  375. package/dist/chunk-104m57qw.js +0 -2
  376. package/dist/chunk-59zf0m6n.js +0 -1
  377. package/dist/chunk-bj3akjs2.js +0 -1
  378. package/dist/chunk-c9pjqx9m.js +0 -14
  379. package/dist/chunk-j2w2vak4.js +0 -546
  380. package/dist/chunk-k2r9c95m.js +0 -10
  381. package/dist/chunk-kmbxhgwv.js +0 -1
  382. package/dist/chunk-p1yqa71k.js +0 -83
  383. package/dist/chunk-pcnahct1.js +0 -5
  384. package/dist/chunk-r5xrenjy.css +0 -1
  385. package/dist/chunk-tny85yt2.js +0 -2
  386. package/dist/chunk-v7wr1df4.js +0 -2
  387. package/server/bundler/applet-css.ts +0 -155
  388. /package/client/features/chat/{ChatPromptBubbles.tsx → messages/ChatPromptBubbles.tsx} +0 -0
  389. /package/client/features/chat/{ShimmerText.tsx → messages/ShimmerText.tsx} +0 -0
  390. /package/client/features/chat/{preview-turn.ts → messages/preview-turn.ts} +0 -0
  391. /package/client/features/chat/{tool-group → messages/tool-group}/CodeBlock.tsx +0 -0
  392. /package/client/features/chat/{tool-group → messages/tool-group}/Collapse.tsx +0 -0
  393. /package/client/features/chat/{tool-group → messages/tool-group}/ReadImagePreview.tsx +0 -0
  394. /package/client/features/chat/{tool-group → messages/tool-group}/ToolOutput.tsx +0 -0
  395. /package/client/features/chat/{tool-group → messages/tool-group}/detect.ts +0 -0
  396. /package/client/features/chat/{tool-group → messages/tool-group}/fixtures.ts +0 -0
  397. /package/client/features/chat/{tool-group → messages/tool-group}/format/claude.ts +0 -0
  398. /package/client/features/chat/{tool-group → messages/tool-group}/format/hermes.ts +0 -0
  399. /package/client/features/chat/{tool-group → messages/tool-group}/format/index.ts +0 -0
  400. /package/client/features/chat/{tool-group → messages/tool-group}/format/mcp.ts +0 -0
  401. /package/client/features/chat/{tool-group → messages/tool-group}/format/openclaw.ts +0 -0
  402. /package/client/features/chat/{tool-group → messages/tool-group}/format/shared.ts +0 -0
  403. /package/client/features/chat/{tool-group → messages/tool-group}/format/shell.ts +0 -0
  404. /package/client/features/chat/{tool-group → messages/tool-group}/index.ts +0 -0
  405. /package/client/features/chat/{useStickToBottom.ts → messages/useStickToBottom.ts} +0 -0
@@ -1,83 +0,0 @@
1
- import{$ as nK,$a as GR,$b as Mp,A as mP,Aa as Dc,Ab as KT,Ac as tX,B as pP,Ba as vm,Bb as Vj,Bc as QR,C as x6,Ca as gm,Cb as Up,Cc as p_,D as SH,Da as fm,Db as Fq,Dc as u_,E as uP,Ea as mm,Eb as ev,Ec as ZO,F as sK,Fa as pm,Fb as cp,G as cP,Ga as A3,Gb as Yp,Gc as a_,H as dP,Ha as um,Hb as Kp,Hc as H5,I as C4,Ia as hF,Ib as Wp,Ic as Cc,J as W4,Ja as X7,Jb as Np,Jc as HO,K as aS,Ka as cv,Kb as kF,Kc as BO,L as UF,La as Q_,Lc as $4,M as oP,Ma as up,Mb as Lp,Mc as Af,N as t7,Na as cm,Nb as bF,Nc as B5,O as fS,Oa as dm,Ob as Ap,P as $9,Pa as lm,Pb as Pv,Q as TP,Qa as sX,Qb as RV,R as F0,Ra as im,Rb as _v,S as GP,Sa as rm,Sb as Cu,T as XF,Ta as am,Tb as KY,U as u5,Ua as nm,Ub as Vp,V as XX,Va as om,Vb as N4,W as kP,Wa as NO,X as lK,Xa as LR,Xb as Dp,Y as iK,Ya as vw,Yb as qp,Z as rK,Zb as cB,_ as aK,_a as sm,_b as cJ,aa as oK,ab as YZ,ac as Pp,b as d,bb as tm,bc as iB,c as Y4,ca as TD,cb as em,cc as WT,d as WQ0,da as s,db as Eu,dc as _p,e as k1,ea as xu,eb as Aj,ec as Op,f as E0,fa as l6,fb as $p,g as VQ,ga as T0,gb as Zp,gc as jp,h as Y0,ha as vv,hb as Hp,i as U0,ia as Im,ib as Bp,ic as Tp,j as a1,ja as ju,jc as Cp,k as xB,ka as J_,kb as Jp,kc as wp,l as b1,la as YX,lb as Qp,lc as Ep,m as tQ,ma as Rm,mc as pf,n as I2,na as NR,nb as Xp,nc as Sp,o as jP,oa as OE,ob as X_,p as T1,pa as jE,pb as DY,pc as FR,q as O5,qa as Lj,qb as lB,qc as dp,r as wM,ra as wE,rb as qc,rc as Ip,s as RX,sa as pp,sb as zp,t as IP,ta as dB,tb as Mc,tc as UR,u as e7,ua as km,uc as Rp,v as s7,va as bm,vb as I5,vc as kp,w as $X,wa as uB,wb as z_,wc as S5,x as jH,xa as ym,xb as Tu,xc as Mf,y as XW,ya as hm,yb as Gp,yc as NT,z as MK,za as xm,zb as Fp,zc as HR}from"/chunk-k2r9c95m.js";import{Oc as V1,Pc as S4,Qc as n5,Sc as J9}from"/chunk-tny85yt2.js";import{Tc as g,Uc as s_,Vc as QE,Wc as B2}from"/chunk-104m57qw.js";import{Xc as O,Yc as G5,Zc as j4,_c as lN}from"/chunk-v7wr1df4.js";var GQ=G5((Hd)=>{var U8=O(g());function rc($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var ac=typeof Object.is==="function"?Object.is:rc,nc=U8.useState,oc=U8.useEffect,sc=U8.useLayoutEffect,tc=U8.useDebugValue;function ec($,Z){var H=Z(),B=nc({inst:{value:H,getSnapshot:Z}}),J=B[0].inst,Q=B[1];return sc(function(){J.value=H,J.getSnapshot=Z,ZK(J)&&Q({inst:J})},[$,H,Z]),oc(function(){return ZK(J)&&Q({inst:J}),$(function(){ZK(J)&&Q({inst:J})})},[$]),tc(H),H}function ZK($){var Z=$.getSnapshot;$=$.value;try{var H=Z();return!ac($,H)}catch(B){return!0}}function $d($,Z){return Z()}var Zd=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$d:ec;Hd.useSyncExternalStore=U8.useSyncExternalStore!==void 0?U8.useSyncExternalStore:Zd});var RR=G5((co0,IR)=>{var CR=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Y10=/\n/g,K10=/^\s*/,W10=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,N10=/^:\s*/,L10=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,A10=/^[;\s]*/,V10=/^\s+|\s+$/g,D10=`
2
- `,wR="/",ER="*",W7="",q10="comment",M10="declaration";function P10($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var H=1,B=1;function J(N){var L=N.match(Y10);if(L)H+=L.length;var V=N.lastIndexOf(D10);B=~V?N.length-V:B+N.length}function Q(){var N={line:H,column:B};return function(L){return L.position=new X(N),F(),L}}function X(N){this.start=N,this.end={line:H,column:B},this.source=Z.source}X.prototype.content=$;function z(N){var L=Error(Z.source+":"+H+":"+B+": "+N);if(L.reason=N,L.filename=Z.source,L.line=H,L.column=B,L.source=$,Z.silent);else throw L}function G(N){var L=N.exec($);if(!L)return;var V=L[0];return J(V),$=$.slice(V.length),L}function F(){G(K10)}function U(N){var L;N=N||[];while(L=Y())if(L!==!1)N.push(L);return N}function Y(){var N=Q();if(wR!=$.charAt(0)||ER!=$.charAt(1))return;var L=2;while(W7!=$.charAt(L)&&(ER!=$.charAt(L)||wR!=$.charAt(L+1)))++L;if(L+=2,W7===$.charAt(L-1))return z("End of comment missing");var V=$.slice(2,L-2);return B+=2,J(V),$=$.slice(L),B+=2,N({type:q10,comment:V})}function K(){var N=Q(),L=G(W10);if(!L)return;if(Y(),!G(N10))return z("property missing ':'");var V=G(L10),A=N({type:M10,property:SR(L[0].replace(CR,W7)),value:V?SR(V[0].replace(CR,W7)):W7});return G(A10),A}function W(){var N=[];U(N);var L;while(L=K())if(L!==!1)N.push(L),U(N);return N}return F(),W()}function SR($){return $?$.replace(V10,W7):W7}IR.exports=P10});var kR=G5((oB)=>{var _10=oB&&oB.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(oB,"__esModule",{value:!0});oB.default=j10;var O10=_10(RR());function j10($,Z){let H=null;if(!$||typeof $!=="string")return H;let B=(0,O10.default)($),J=typeof Z==="function";return B.forEach((Q)=>{if(Q.type!=="declaration")return;let{property:X,value:z}=Q;if(J)Z(X,z,Q);else if(z)H=H||{},H[X]=z}),H}});var xR=G5((yR)=>{Object.defineProperty(yR,"__esModule",{value:!0});yR.camelCase=void 0;var T10=/^--[a-zA-Z0-9_-]+$/,C10=/-([a-z])/g,w10=/^[^-]+$/,E10=/^-(webkit|moz|ms|o|khtml)-/,S10=/^-(ms)-/,I10=function($){return!$||w10.test($)||T10.test($)},R10=function($,Z){return Z.toUpperCase()},bR=function($,Z){return"".concat(Z,"-")},k10=function($,Z){if(Z===void 0)Z={};if(I10($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(S10,bR);else $=$.replace(E10,bR);return $.replace(C10,R10)};yR.camelCase=k10});var gR=G5((fL,vR)=>{var b10=fL&&fL.__importDefault||function($){return $&&$.__esModule?$:{default:$}},y10=b10(kR()),h10=xR();function gL($,Z){var H={};if(!$||typeof $!=="string")return H;return(0,y10.default)($,function(B,J){if(B&&J)H[(0,h10.camelCase)(B,Z)]=J}),H}gL.default=gL;vR.exports=gL});var Qb=G5((y51,Jb)=>{var KU=Object.prototype.hasOwnProperty,Bb=Object.prototype.toString,sk=Object.defineProperty,tk=Object.getOwnPropertyDescriptor,ek=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return Bb.call(Z)==="[object Array]"},$b=function(Z){if(!Z||Bb.call(Z)!=="[object Object]")return!1;var H=KU.call(Z,"constructor"),B=Z.constructor&&Z.constructor.prototype&&KU.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!H&&!B)return!1;var J;for(J in Z);return typeof J>"u"||KU.call(Z,J)},Zb=function(Z,H){if(sk&&H.name==="__proto__")sk(Z,H.name,{enumerable:!0,configurable:!0,value:H.newValue,writable:!0});else Z[H.name]=H.newValue},Hb=function(Z,H){if(H==="__proto__"){if(!KU.call(Z,H))return;else if(tk)return tk(Z,H).value}return Z[H]};Jb.exports=function $(){var Z,H,B,J,Q,X,z=arguments[0],G=1,F=arguments.length,U=!1;if(typeof z==="boolean")U=z,z=arguments[1]||{},G=2;if(z==null||typeof z!=="object"&&typeof z!=="function")z={};for(;G<F;++G)if(Z=arguments[G],Z!=null){for(H in Z)if(B=Hb(z,H),J=Hb(Z,H),z!==J){if(U&&J&&($b(J)||(Q=ek(J)))){if(Q)Q=!1,X=B&&ek(B)?B:[];else X=B&&$b(B)?B:{};Zb(z,{name:H,newValue:$(U,X,J)})}else if(typeof J<"u")Zb(z,{name:H,newValue:J})}}return z}});var sy=G5((Z81,oy)=>{function hy($){if($ instanceof Map)$.clear=$.delete=$.set=function(){throw Error("map is read-only")};else if($ instanceof Set)$.add=$.clear=$.delete=function(){throw Error("set is read-only")};return Object.freeze($),Object.getOwnPropertyNames($).forEach((Z)=>{let H=$[Z],B=typeof H;if((B==="object"||B==="function")&&!Object.isFrozen(H))hy(H)}),$}class IA{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function xy($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a3($,...Z){let H=Object.create(null);for(let B in $)H[B]=$[B];return Z.forEach(function(B){for(let J in B)H[J]=B[J]}),H}var X80="</span>",Sy=($)=>{return!!$.scope},z80=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let H=$.split(".");return[`${Z}${H.shift()}`,...H.map((B,J)=>`${B}${"_".repeat(J+1)}`)].join(" ")}return`${Z}${$}`};class vy{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=xy($)}openNode($){if(!Sy($))return;let Z=z80($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!Sy($))return;this.buffer+=X80}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var Iy=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class RA{constructor(){this.rootNode=Iy(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){let Z=Iy({scope:$});this.add(Z),this.stack.push(Z)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,Z){if(typeof Z==="string")$.addText(Z);else if(Z.children)$.openNode(Z),Z.children.forEach((H)=>this._walk($,H)),$.closeNode(Z);return $}static _collapse($){if(typeof $==="string")return;if(!$.children)return;if($.children.every((Z)=>typeof Z==="string"))$.children=[$.children.join("")];else $.children.forEach((Z)=>{RA._collapse(Z)})}}class gy extends RA{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let H=$.root;if(Z)H.scope=`language:${Z}`;this.add(H)}toHTML(){return new vy(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function WJ($){if(!$)return null;if(typeof $==="string")return $;return $.source}function fy($){return O7("(?=",$,")")}function G80($){return O7("(?:",$,")*")}function F80($){return O7("(?:",$,")?")}function O7(...$){return $.map((H)=>WJ(H)).join("")}function U80($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function kA(...$){return"("+(U80($).capture?"":"?:")+$.map((B)=>WJ(B)).join("|")+")"}function my($){return new RegExp($.toString()+"|").exec("").length-1}function Y80($,Z){let H=$&&$.exec(Z);return H&&H.index===0}var K80=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function bA($,{joinWith:Z}){let H=0;return $.map((B)=>{H+=1;let J=H,Q=WJ(B),X="";while(Q.length>0){let z=K80.exec(Q);if(!z){X+=Q;break}if(X+=Q.substring(0,z.index),Q=Q.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1])X+="\\"+String(Number(z[1])+J);else if(X+=z[0],z[0]==="(")H++}return X}).map((B)=>`(${B})`).join(Z)}var W80=/\b\B/,py="[a-zA-Z]\\w*",yA="[a-zA-Z_]\\w*",uy="\\b\\d+(\\.\\d+)?",cy="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",dy="\\b(0b[01]+)",N80="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",L80=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=O7(Z,/.*\b/,$.binary,/\b.*/);return a3({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(H,B)=>{if(H.index!==0)B.ignoreMatch()}},$)},NJ={begin:"\\\\[\\s\\S]",relevance:0},A80={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[NJ]},V80={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[NJ]},D80={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},TU=function($,Z,H={}){let B=a3({scope:"comment",begin:$,end:Z,contains:[]},H);B.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let J=kA("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return B.contains.push({begin:O7(/[ ]+/,"(",J,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),B},q80=TU("//","$"),M80=TU("/\\*","\\*/"),P80=TU("#","$"),_80={scope:"number",begin:uy,relevance:0},O80={scope:"number",begin:cy,relevance:0},j80={scope:"number",begin:dy,relevance:0},T80={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[NJ,{begin:/\[/,end:/\]/,relevance:0,contains:[NJ]}]},C80={scope:"title",begin:py,relevance:0},w80={scope:"title",begin:yA,relevance:0},E80={begin:"\\.\\s*"+yA,relevance:0},S80=function($){return Object.assign($,{"on:begin":(Z,H)=>{H.data._beginMatch=Z[1]},"on:end":(Z,H)=>{if(H.data._beginMatch!==Z[1])H.ignoreMatch()}})},OU=Object.freeze({__proto__:null,APOS_STRING_MODE:A80,BACKSLASH_ESCAPE:NJ,BINARY_NUMBER_MODE:j80,BINARY_NUMBER_RE:dy,COMMENT:TU,C_BLOCK_COMMENT_MODE:M80,C_LINE_COMMENT_MODE:q80,C_NUMBER_MODE:O80,C_NUMBER_RE:cy,END_SAME_AS_BEGIN:S80,HASH_COMMENT_MODE:P80,IDENT_RE:py,MATCH_NOTHING_RE:W80,METHOD_GUARD:E80,NUMBER_MODE:_80,NUMBER_RE:uy,PHRASAL_WORDS_MODE:D80,QUOTE_STRING_MODE:V80,REGEXP_MODE:T80,RE_STARTERS_RE:N80,SHEBANG:L80,TITLE_MODE:C80,UNDERSCORE_IDENT_RE:yA,UNDERSCORE_TITLE_MODE:w80});function I80($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function R80($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function k80($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=I80,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function b80($,Z){if(!Array.isArray($.illegal))return;$.illegal=kA(...$.illegal)}function y80($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function h80($,Z){if($.relevance===void 0)$.relevance=1}var x80=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let H=Object.assign({},$);Object.keys($).forEach((B)=>{delete $[B]}),$.keywords=H.keywords,$.begin=O7(H.beforeMatch,fy(H.begin)),$.starts={relevance:0,contains:[Object.assign(H,{endsParent:!0})]},$.relevance=0,delete H.beforeMatch},v80=["of","and","for","in","not","or","if","then","parent","list","value"],g80="keyword";function ly($,Z,H=g80){let B=Object.create(null);if(typeof $==="string")J(H,$.split(" "));else if(Array.isArray($))J(H,$);else Object.keys($).forEach(function(Q){Object.assign(B,ly($[Q],Z,Q))});return B;function J(Q,X){if(Z)X=X.map((z)=>z.toLowerCase());X.forEach(function(z){let G=z.split("|");B[G[0]]=[Q,f80(G[0],G[1])]})}}function f80($,Z){if(Z)return Number(Z);return m80($)?0:1}function m80($){return v80.includes($.toLowerCase())}var Ry={},_7=($)=>{console.error($)},ky=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},jZ=($,Z)=>{if(Ry[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),Ry[`${$}/${Z}`]=!0},jU=Error();function iy($,Z,{key:H}){let B=0,J=$[H],Q={},X={};for(let z=1;z<=Z.length;z++)X[z+B]=J[z],Q[z+B]=!0,B+=my(Z[z-1]);$[H]=X,$[H]._emit=Q,$[H]._multi=!0}function p80($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw _7("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),jU;if(typeof $.beginScope!=="object"||$.beginScope===null)throw _7("beginScope must be object"),jU;iy($,$.begin,{key:"beginScope"}),$.begin=bA($.begin,{joinWith:""})}function u80($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw _7("skip, excludeEnd, returnEnd not compatible with endScope: {}"),jU;if(typeof $.endScope!=="object"||$.endScope===null)throw _7("endScope must be object"),jU;iy($,$.end,{key:"endScope"}),$.end=bA($.end,{joinWith:""})}function c80($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function d80($){if(c80($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};p80($),u80($)}function l80($){function Z(X,z){return new RegExp(WJ(X),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class H{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(X,z){z.position=this.position++,this.matchIndexes[this.matchAt]=z,this.regexes.push([z,X]),this.matchAt+=my(X)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let X=this.regexes.map((z)=>z[1]);this.matcherRe=Z(bA(X,{joinWith:"|"}),!0),this.lastIndex=0}exec(X){this.matcherRe.lastIndex=this.lastIndex;let z=this.matcherRe.exec(X);if(!z)return null;let G=z.findIndex((U,Y)=>Y>0&&U!==void 0),F=this.matchIndexes[G];return z.splice(0,G),Object.assign(z,F)}}class B{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(X){if(this.multiRegexes[X])return this.multiRegexes[X];let z=new H;return this.rules.slice(X).forEach(([G,F])=>z.addRule(G,F)),z.compile(),this.multiRegexes[X]=z,z}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(X,z){if(this.rules.push([X,z]),z.type==="begin")this.count++}exec(X){let z=this.getMatcher(this.regexIndex);z.lastIndex=this.lastIndex;let G=z.exec(X);if(this.resumingScanAtSamePosition())if(G&&G.index===this.lastIndex);else{let F=this.getMatcher(0);F.lastIndex=this.lastIndex+1,G=F.exec(X)}if(G){if(this.regexIndex+=G.position+1,this.regexIndex===this.count)this.considerAll()}return G}}function J(X){let z=new B;if(X.contains.forEach((G)=>z.addRule(G.begin,{rule:G,type:"begin"})),X.terminatorEnd)z.addRule(X.terminatorEnd,{type:"end"});if(X.illegal)z.addRule(X.illegal,{type:"illegal"});return z}function Q(X,z){let G=X;if(X.isCompiled)return G;[R80,y80,d80,x80].forEach((U)=>U(X,z)),$.compilerExtensions.forEach((U)=>U(X,z)),X.__beforeBegin=null,[k80,b80,h80].forEach((U)=>U(X,z)),X.isCompiled=!0;let F=null;if(typeof X.keywords==="object"&&X.keywords.$pattern)X.keywords=Object.assign({},X.keywords),F=X.keywords.$pattern,delete X.keywords.$pattern;if(F=F||/\w+/,X.keywords)X.keywords=ly(X.keywords,$.case_insensitive);if(G.keywordPatternRe=Z(F,!0),z){if(!X.begin)X.begin=/\B|\b/;if(G.beginRe=Z(G.begin),!X.end&&!X.endsWithParent)X.end=/\B|\b/;if(X.end)G.endRe=Z(G.end);if(G.terminatorEnd=WJ(G.end)||"",X.endsWithParent&&z.terminatorEnd)G.terminatorEnd+=(X.end?"|":"")+z.terminatorEnd}if(X.illegal)G.illegalRe=Z(X.illegal);if(!X.contains)X.contains=[];if(X.contains=[].concat(...X.contains.map(function(U){return i80(U==="self"?X:U)})),X.contains.forEach(function(U){Q(U,G)}),X.starts)Q(X.starts,z);return G.matcher=J(G),G}if(!$.compilerExtensions)$.compilerExtensions=[];if($.contains&&$.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=a3($.classNameAliases||{}),Q($)}function ry($){if(!$)return!1;return $.endsWithParent||ry($.starts)}function i80($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return a3($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(ry($))return a3($,{starts:$.starts?a3($.starts):null});if(Object.isFrozen($))return a3($);return $}var r80="11.11.1";class ay extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var SA=xy,by=a3,yy=Symbol("nomatch"),a80=7,ny=function($){let Z=Object.create(null),H=Object.create(null),B=[],J=!0,Q="Could not find the language '{}', did you forget to load/include a language module?",X={disableAutodetect:!0,name:"Plain text",contains:[]},z={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:gy};function G(k){return z.noHighlightRe.test(k)}function F(k){let b=k.className+" ";b+=k.parentNode?k.parentNode.className:"";let v=z.languageDetectRe.exec(b);if(v){let c=R(v[1]);if(!c)ky(Q.replace("{}",v[1])),ky("Falling back to no-highlight mode for this block.",k);return c?v[1]:"no-highlight"}return b.split(/\s+/).find((c)=>G(c)||R(c))}function U(k,b,v){let c="",T="";if(typeof b==="object")c=k,v=b.ignoreIllegals,T=b.language;else jZ("10.7.0","highlight(lang, code, ...args) has been deprecated."),jZ("10.7.0",`Please use highlight(code, options) instead.
3
- https://github.com/highlightjs/highlight.js/issues/2277`),T=k,c=b;if(v===void 0)v=!0;let e={code:c,language:T};j("before:highlight",e);let Z0=e.result?e.result:Y(e.language,e.code,v);return Z0.code=e.code,j("after:highlight",Z0),Z0}function Y(k,b,v,c){let T=Object.create(null);function e(u,r){return u.keywords[r]}function Z0(){if(!l.keywords){a.addText(o);return}let u=0;l.keywordPatternRe.lastIndex=0;let r=l.keywordPatternRe.exec(o),H0="";while(r){H0+=o.substring(u,r.index);let A0=J0.case_insensitive?r[0].toLowerCase():r[0],j0=e(l,A0);if(j0){let[v0,G1]=j0;if(a.addText(H0),H0="",T[A0]=(T[A0]||0)+1,T[A0]<=a80)V0+=G1;if(v0.startsWith("_"))H0+=r[0];else{let K1=J0.classNameAliases[v0]||v0;D0(r[0],K1)}}else H0+=r[0];u=l.keywordPatternRe.lastIndex,r=l.keywordPatternRe.exec(o)}H0+=o.substring(u),a.addText(H0)}function x(){if(o==="")return;let u=null;if(typeof l.subLanguage==="string"){if(!Z[l.subLanguage]){a.addText(o);return}u=Y(l.subLanguage,o,!0,m[l.subLanguage]),m[l.subLanguage]=u._top}else u=W(o,l.subLanguage.length?l.subLanguage:null);if(l.relevance>0)V0+=u.relevance;a.__addSublanguage(u._emitter,u.language)}function t(){if(l.subLanguage!=null)x();else Z0();o=""}function D0(u,r){if(u==="")return;a.startScope(r),a.addText(u),a.endScope()}function p(u,r){let H0=1,A0=r.length-1;while(H0<=A0){if(!u._emit[H0]){H0++;continue}let j0=J0.classNameAliases[u[H0]]||u[H0],v0=r[H0];if(j0)D0(v0,j0);else o=v0,Z0(),o="";H0++}}function X0(u,r){if(u.scope&&typeof u.scope==="string")a.openNode(J0.classNameAliases[u.scope]||u.scope);if(u.beginScope){if(u.beginScope._wrap)D0(o,J0.classNameAliases[u.beginScope._wrap]||u.beginScope._wrap),o="";else if(u.beginScope._multi)p(u.beginScope,r),o=""}return l=Object.create(u,{parent:{value:l}}),l}function K0(u,r,H0){let A0=Y80(u.endRe,H0);if(A0){if(u["on:end"]){let j0=new IA(u);if(u["on:end"](r,j0),j0.isMatchIgnored)A0=!1}if(A0){while(u.endsParent&&u.parent)u=u.parent;return u}}if(u.endsWithParent)return K0(u.parent,r,H0)}function Q0(u){if(l.matcher.regexIndex===0)return o+=u[0],1;else return r0=!0,0}function z0(u){let r=u[0],H0=u.rule,A0=new IA(H0),j0=[H0.__beforeBegin,H0["on:begin"]];for(let v0 of j0){if(!v0)continue;if(v0(u,A0),A0.isMatchIgnored)return Q0(r)}if(H0.skip)o+=r;else{if(H0.excludeBegin)o+=r;if(t(),!H0.returnBegin&&!H0.excludeBegin)o=r}return X0(H0,u),H0.returnBegin?0:r.length}function L0(u){let r=u[0],H0=b.substring(u.index),A0=K0(l,u,H0);if(!A0)return yy;let j0=l;if(l.endScope&&l.endScope._wrap)t(),D0(r,l.endScope._wrap);else if(l.endScope&&l.endScope._multi)t(),p(l.endScope,u);else if(j0.skip)o+=r;else{if(!(j0.returnEnd||j0.excludeEnd))o+=r;if(t(),j0.excludeEnd)o=r}do{if(l.scope)a.closeNode();if(!l.skip&&!l.subLanguage)V0+=l.relevance;l=l.parent}while(l!==A0.parent);if(A0.starts)X0(A0.starts,u);return j0.returnEnd?0:r.length}function i(){let u=[];for(let r=l;r!==J0;r=r.parent)if(r.scope)u.unshift(r.scope);u.forEach((r)=>a.openNode(r))}let B0={};function $0(u,r){let H0=r&&r[0];if(o+=u,H0==null)return t(),0;if(B0.type==="begin"&&r.type==="end"&&B0.index===r.index&&H0===""){if(o+=b.slice(r.index,r.index+1),!J){let A0=Error(`0 width match regex (${k})`);throw A0.languageName=k,A0.badRule=B0.rule,A0}return 1}if(B0=r,r.type==="begin")return z0(r);else if(r.type==="illegal"&&!v){let A0=Error('Illegal lexeme "'+H0+'" for mode "'+(l.scope||"<unnamed>")+'"');throw A0.mode=l,A0}else if(r.type==="end"){let A0=L0(r);if(A0!==yy)return A0}if(r.type==="illegal"&&H0==="")return o+=`
4
- `,1;if(k0>1e5&&k0>r.index*3)throw Error("potential infinite loop, way more iterations than matches");return o+=H0,H0.length}let J0=R(k);if(!J0)throw _7(Q.replace("{}",k)),Error('Unknown language: "'+k+'"');let n=l80(J0),f="",l=c||n,m={},a=new z.__emitter(z);i();let o="",V0=0,O0=0,k0=0,r0=!1;try{if(!J0.__emitTokens){l.matcher.considerAll();for(;;){if(k0++,r0)r0=!1;else l.matcher.considerAll();l.matcher.lastIndex=O0;let u=l.matcher.exec(b);if(!u)break;let r=b.substring(O0,u.index),H0=$0(r,u);O0=u.index+H0}$0(b.substring(O0))}else J0.__emitTokens(b,a);return a.finalize(),f=a.toHTML(),{language:k,value:f,relevance:V0,illegal:!1,_emitter:a,_top:l}}catch(u){if(u.message&&u.message.includes("Illegal"))return{language:k,value:SA(b),illegal:!0,relevance:0,_illegalBy:{message:u.message,index:O0,context:b.slice(O0-100,O0+100),mode:u.mode,resultSoFar:f},_emitter:a};else if(J)return{language:k,value:SA(b),illegal:!1,relevance:0,errorRaised:u,_emitter:a,_top:l};else throw u}}function K(k){let b={value:SA(k),illegal:!1,relevance:0,_top:X,_emitter:new z.__emitter(z)};return b._emitter.addText(k),b}function W(k,b){b=b||z.languages||Object.keys(Z);let v=K(k),c=b.filter(R).filter(w).map((t)=>Y(t,k,!1));c.unshift(v);let T=c.sort((t,D0)=>{if(t.relevance!==D0.relevance)return D0.relevance-t.relevance;if(t.language&&D0.language){if(R(t.language).supersetOf===D0.language)return 1;else if(R(D0.language).supersetOf===t.language)return-1}return 0}),[e,Z0]=T,x=e;return x.secondBest=Z0,x}function N(k,b,v){let c=b&&H[b]||v;k.classList.add("hljs"),k.classList.add(`language-${c}`)}function L(k){let b=null,v=F(k);if(G(v))return;if(j("before:highlightElement",{el:k,language:v}),k.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",k);return}if(k.children.length>0){if(!z.ignoreUnescapedHTML)console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(k);if(z.throwUnescapedHTML)throw new ay("One of your code blocks includes unescaped HTML.",k.innerHTML)}b=k;let c=b.textContent,T=v?U(c,{language:v,ignoreIllegals:!0}):W(c);if(k.innerHTML=T.value,k.dataset.highlighted="yes",N(k,v,T.language),k.result={language:T.language,re:T.relevance,relevance:T.relevance},T.secondBest)k.secondBest={language:T.secondBest.language,relevance:T.secondBest.relevance};j("after:highlightElement",{el:k,result:T,text:c})}function V(k){z=by(z,k)}let A=()=>{_(),jZ("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){_(),jZ("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let q=!1;function _(){function k(){_()}if(document.readyState==="loading"){if(!q)window.addEventListener("DOMContentLoaded",k,!1);q=!0;return}document.querySelectorAll(z.cssSelector).forEach(L)}function M(k,b){let v=null;try{v=b($)}catch(c){if(_7("Language definition for '{}' could not be registered.".replace("{}",k)),!J)throw c;else _7(c);v=X}if(!v.name)v.name=k;if(Z[k]=v,v.rawDefinition=b.bind(null,$),v.aliases)y(v.aliases,{languageName:k})}function P(k){delete Z[k];for(let b of Object.keys(H))if(H[b]===k)delete H[b]}function C(){return Object.keys(Z)}function R(k){return k=(k||"").toLowerCase(),Z[k]||Z[H[k]]}function y(k,{languageName:b}){if(typeof k==="string")k=[k];k.forEach((v)=>{H[v.toLowerCase()]=b})}function w(k){let b=R(k);return b&&!b.disableAutodetect}function h(k){if(k["before:highlightBlock"]&&!k["before:highlightElement"])k["before:highlightElement"]=(b)=>{k["before:highlightBlock"](Object.assign({block:b.el},b))};if(k["after:highlightBlock"]&&!k["after:highlightElement"])k["after:highlightElement"]=(b)=>{k["after:highlightBlock"](Object.assign({block:b.el},b))}}function E(k){h(k),B.push(k)}function I(k){let b=B.indexOf(k);if(b!==-1)B.splice(b,1)}function j(k,b){let v=k;B.forEach(function(c){if(c[v])c[v](b)})}function S(k){return jZ("10.7.0","highlightBlock will be removed entirely in v12.0"),jZ("10.7.0","Please use highlightElement now."),L(k)}Object.assign($,{highlight:U,highlightAuto:W,highlightAll:_,highlightElement:L,highlightBlock:S,configure:V,initHighlighting:A,initHighlightingOnLoad:D,registerLanguage:M,unregisterLanguage:P,listLanguages:C,getLanguage:R,registerAliases:y,autoDetection:w,inherit:by,addPlugin:E,removePlugin:I}),$.debugMode=function(){J=!1},$.safeMode=function(){J=!0},$.versionString=r80,$.regex={concat:O7,lookahead:fy,either:kA,optional:F80,anyNumberOfTimes:G80};for(let k in OU)if(typeof OU[k]==="object")hy(OU[k]);return Object.assign($,OU),$},TZ=ny({});TZ.newInstance=()=>ny({});oy.exports=TZ;TZ.HighlightJS=TZ;TZ.default=TZ});var tx=G5(($Z1,sx)=>{var P60=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],ox=/[\n\r\u2028\u2029]/,_60=/[\s#!"$&'():;<=>@\\^`|]/g;sx.exports=function(Z){return Z.map(function(H){if(H==="")return"''";if(H&&typeof H==="object"){if("op"in H&&H.op==="glob"){if(typeof H.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(ox.test(H.pattern))throw TypeError("glob `pattern` must not contain line terminators");return H.pattern.replace(_60,"\\$&")}if("op"in H&&typeof H.op==="string"){if(P60.indexOf(H.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(H.op));return H.op.replace(/[\s\S]/g,"\\$&")}if("comment"in H&&typeof H.comment==="string"){if(ox.test(H.comment))throw TypeError("`comment` must not contain line terminators");return"#"+H.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(H)&&!/'/.test(H))return"'"+H.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(H))return'"'+H.replace(/(["\\$`!])/g,"\\$1")+'"';return String(H).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var Qv=G5((ZZ1,Jv)=>{var Bv="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",ex=new RegExp("^"+Bv+"$"),$v="|&;()<> \\t",O60="'([^']*?)'",j60='"((\\\\"|[^"])*?)"',T60=/^#$/,Zv="'",Hv='"',hU="$",C7="",C60=4294967296;for(xU=0;xU<4;xU++)C7+=(C60*Math.random()).toString(16);var xU,w60=new RegExp("^"+C7);function E60($,Z){var H=Z.lastIndex,B=[],J;while(J=Z.exec($))if(B[B.length]=J,Z.lastIndex===J.index)Z.lastIndex+=1;return Z.lastIndex=H,B}function S60($,Z,H){var B=typeof $==="function"?$(H):$[H];if(typeof B>"u"&&H!="")B="";else if(typeof B>"u")B="$";if(typeof B==="object")return Z+C7+JSON.stringify(B)+C7;return Z+B}function I60($,Z,H){if(!H)H={};var B=H.escape||"\\",J=H.splitUnquoted===!0?`
5
- `:typeof H.splitUnquoted==="string"?H.splitUnquoted:"",Q="(\\"+B+`['"`+$v+`]|[^\\s'"`+$v+"])+",X=new RegExp(["("+Bv+")","("+Q+"|"+j60+"|"+O60+")+"].join("|"),"g"),z=E60($,X);if(z.length===0)return[];if(!Z)Z={};var G=!1;return z.map(function(F){var U=F[0];if(!U||G)return;if(ex.test(U))return{op:U};var Y=!1,K=!1,W="",N=[],L=!1,V=null,A=!1,D;function q(){D+=1;var h,E,I=U.charAt(D);if(I==="{"){if(D+=1,U.charAt(D)==="}")throw Error("Bad substitution: "+U.slice(D-2,D+1));var j=1;h=D;while(j>0&&h<U.length){if(U.charAt(h)==="{"&&U.charAt(h-1)==="$")j+=1;else if(U.charAt(h)==="}")j-=1;h+=1}if(j!==0)throw Error("Bad substitution: "+U.slice(D));h-=1,E=U.slice(D,h),D=h}else if(/[*@#?$!_-]/.test(I))E=I,D+=1;else{var S=U.slice(D);if(h=S.match(/[^\w\d_]/),!h)E=S,D=U.length;else E=S.slice(0,h.index),D+=h.index-1}return S60(Z,"",E)}function _(){if(V===null)return;if(V===0){if(W!=="")N[N.length]=W,W=""}else{N[N.length]=W,W="";for(var h=1;h<V;h+=1)N[N.length]=""}V=null}for(D=0;D<U.length;D++){var M=U.charAt(D);if(J&&M!==hU)_();if(A=A||!Y&&(M==="*"||M==="?"),K)W+=M,K=!1;else if(Y)if(M===Y)Y=!1;else if(Y==Zv)W+=M;else if(M===B)if(D+=1,M=U.charAt(D),M===Hv||M===B||M===hU)W+=M;else W+=B+M;else if(M===hU)W+=q();else W+=M;else if(M===Hv||M===Zv)Y=M,L=!0;else if(ex.test(M))return{op:U};else if(T60.test(M)){G=!0;var P={comment:$.slice(F.index+D+1)};if(W.length)return[W,P];return[P]}else if(M===B)K=!0;else if(M===hU){var C=q();if(!J)W+=C;else for(var R=0;R<C.length;R+=1){var y=C.charAt(R);if(J.indexOf(y)<0)_(),W+=y;else if(V===null)V=y===" "||y==="\t"||y===`
6
- `?0:1;else if(y!==" "&&y!=="\t"&&y!==`
7
- `)V+=1}}else W+=M}if(A)return{op:"glob",pattern:W};if(J){if(V!==null&&V>0){N[N.length]=W,W="";for(var w=1;w<V;w+=1)N[N.length]=""}if(W!==""||L&&N.length===0)N[N.length]=W;return N}return W}).reduce(function(F,U){if(typeof U>"u")return F;return[].concat(U).forEach(function(Y){F[F.length]=Y}),F},[])}Jv.exports=function(Z,H,B){var J=I60(Z,H,B);if(typeof H!=="function")return J;return J.reduce(function(Q,X){if(typeof X==="object")return Q[Q.length]=X,Q;var z=X.split(RegExp("("+C7+".*?"+C7+")","g"));if(z.length===1)return Q[Q.length]=z[0],Q;return z.filter(Boolean).forEach(function(G){Q[Q.length]=w60.test(G)?JSON.parse(G.split(C7)[1]):G}),Q},[])}});var Lg=G5((eU,Ng)=>{(function($,Z){typeof eU==="object"&&typeof Ng<"u"?Z(eU):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(eU,function($){function Z(p){return function(K0,Q0,z0,L0,i,B0,$0){return p(K0,Q0,$0)}}function H(p){return function(K0,Q0,z0,L0){if(!K0||!Q0||typeof K0!=="object"||typeof Q0!=="object")return p(K0,Q0,z0,L0);var i=L0.get(K0),B0=L0.get(Q0);if(i&&B0)return i===Q0&&B0===K0;L0.set(K0,Q0),L0.set(Q0,K0);var $0=p(K0,Q0,z0,L0);return L0.delete(K0),L0.delete(Q0),$0}}function B(p,X0){var K0={};for(var Q0 in p)K0[Q0]=p[Q0];for(var Q0 in X0)K0[Q0]=X0[Q0];return K0}function J(p){return p.constructor===Object||p.constructor==null}function Q(p){return typeof p.then==="function"}function X(p,X0){return p===X0||p!==p&&X0!==X0}var z="[object Arguments]",G="[object Boolean]",F="[object Date]",U="[object RegExp]",Y="[object Map]",K="[object Number]",W="[object Object]",N="[object Set]",L="[object String]",V=Object.prototype.toString;function A(p){var{areArraysEqual:X0,areDatesEqual:K0,areMapsEqual:Q0,areObjectsEqual:z0,areRegExpsEqual:L0,areSetsEqual:i,createIsNestedEqual:B0}=p,$0=B0(J0);function J0(n,f,l){if(n===f)return!0;if(!n||!f||typeof n!=="object"||typeof f!=="object")return n!==n&&f!==f;if(J(n)&&J(f))return z0(n,f,$0,l);var m=Array.isArray(n),a=Array.isArray(f);if(m||a)return m===a&&X0(n,f,$0,l);var o=V.call(n);if(o!==V.call(f))return!1;if(o===F)return K0(n,f,$0,l);if(o===U)return L0(n,f,$0,l);if(o===Y)return Q0(n,f,$0,l);if(o===N)return i(n,f,$0,l);if(o===W||o===z)return Q(n)||Q(f)?!1:z0(n,f,$0,l);if(o===G||o===K||o===L)return X(n.valueOf(),f.valueOf());return!1}return J0}function D(p,X0,K0,Q0){var z0=p.length;if(X0.length!==z0)return!1;while(z0-- >0)if(!K0(p[z0],X0[z0],z0,z0,p,X0,Q0))return!1;return!0}var q=H(D);function _(p,X0){return X(p.valueOf(),X0.valueOf())}function M(p,X0,K0,Q0){var z0=p.size===X0.size;if(!z0)return!1;if(!p.size)return!0;var L0={},i=0;return p.forEach(function(B0,$0){if(!z0)return;var J0=!1,n=0;X0.forEach(function(f,l){if(!J0&&!L0[n]&&(J0=K0($0,l,i,n,p,X0,Q0)&&K0(B0,f,$0,l,p,X0,Q0)))L0[n]=!0;n++}),i++,z0=J0}),z0}var P=H(M),C="_owner",R=Object.prototype.hasOwnProperty;function y(p,X0,K0,Q0){var z0=Object.keys(p),L0=z0.length;if(Object.keys(X0).length!==L0)return!1;var i;while(L0-- >0){if(i=z0[L0],i===C){var B0=!!p.$$typeof,$0=!!X0.$$typeof;if((B0||$0)&&B0!==$0)return!1}if(!R.call(X0,i)||!K0(p[i],X0[i],i,i,p,X0,Q0))return!1}return!0}var w=H(y);function h(p,X0){return p.source===X0.source&&p.flags===X0.flags}function E(p,X0,K0,Q0){var z0=p.size===X0.size;if(!z0)return!1;if(!p.size)return!0;var L0={};return p.forEach(function(i,B0){if(!z0)return;var $0=!1,J0=0;X0.forEach(function(n,f){if(!$0&&!L0[J0]&&($0=K0(i,n,B0,f,p,X0,Q0)))L0[J0]=!0;J0++}),z0=$0}),z0}var I=H(E),j=Object.freeze({areArraysEqual:D,areDatesEqual:_,areMapsEqual:M,areObjectsEqual:y,areRegExpsEqual:h,areSetsEqual:E,createIsNestedEqual:Z}),S=Object.freeze({areArraysEqual:q,areDatesEqual:_,areMapsEqual:P,areObjectsEqual:w,areRegExpsEqual:h,areSetsEqual:I,createIsNestedEqual:Z}),k=A(j);function b(p,X0){return k(p,X0,void 0)}var v=A(B(j,{createIsNestedEqual:function(){return X}}));function c(p,X0){return v(p,X0,void 0)}var T=A(S);function e(p,X0){return T(p,X0,new WeakMap)}var Z0=A(B(S,{createIsNestedEqual:function(){return X}}));function x(p,X0){return Z0(p,X0,new WeakMap)}function t(p){return A(B(j,p(j)))}function D0(p){var X0=A(B(S,p(S)));return function(K0,Q0,z0){if(z0===void 0)z0=new WeakMap;return X0(K0,Q0,z0)}}$.circularDeepEqual=e,$.circularShallowEqual=x,$.createCustomCircularEqual=D0,$.createCustomEqual=t,$.deepEqual=b,$.sameValueZeroEqual=X,$.shallowEqual=c,Object.defineProperty($,"__esModule",{value:!0})})});var Vg=G5((oB1,Ag)=>{var k$0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ag.exports=k$0});var Pg=G5((sB1,Mg)=>{var b$0=Vg();function Dg(){}function qg(){}qg.resetWarningCache=Dg;Mg.exports=function(){function $(B,J,Q,X,z,G){if(G===b$0)return;var F=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw F.name="Invariant Violation",F}$.isRequired=$;function Z(){return $}var H={array:$,bigint:$,bool:$,func:$,number:$,object:$,string:$,symbol:$,any:$,arrayOf:Z,element:$,elementType:$,instanceOf:Z,node:$,objectOf:Z,oneOf:Z,oneOfType:Z,shape:Z,exact:Z,checkPropTypes:qg,resetWarningCache:Dg};return H.PropTypes=H,H}});var kJ=G5((tB1,_g)=>{_g.exports=Pg()();var y$0,h$0});var Tg=G5((eB1,QD)=>{function jg($){var Z,H,B="";if(typeof $=="string"||typeof $=="number")B+=$;else if(typeof $=="object")if(Array.isArray($)){var J=$.length;for(Z=0;Z<J;Z++)$[Z]&&(H=jg($[Z]))&&(B&&(B+=" "),B+=H)}else for(H in $)$[H]&&(B&&(B+=" "),B+=H);return B}function Og(){for(var $,Z,H=0,B="",J=arguments.length;H<J;H++)($=arguments[H])&&(Z=jg($))&&(B&&(B+=" "),B+=Z);return B}QD.exports=Og,QD.exports.clsx=Og});var bJ=G5((Cg)=>{Object.defineProperty(Cg,"__esModule",{value:!0});Cg.dontSetMe=m$0;Cg.findInArray=x$0;Cg.int=f$0;Cg.isFunction=v$0;Cg.isNum=g$0;function x$0($,Z){for(let H=0,B=$.length;H<B;H++)if(Z.apply(Z,[$[H],H,$]))return $[H]}function v$0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function g$0($){return typeof $==="number"&&!isNaN($)}function f$0($){return parseInt($,10)}function m$0($,Z,H){if($[Z])return Error(`Invalid prop ${Z} passed to ${H} - do not set this, set it on the child.`)}});var Rg=G5((Sg)=>{Object.defineProperty(Sg,"__esModule",{value:!0});Sg.browserPrefixToKey=Eg;Sg.browserPrefixToStyle=i$0;Sg.default=void 0;Sg.getPrefix=wg;var XD=["Moz","Webkit","O","ms"];function wg(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let Z=window.document?.documentElement?.style;if(!Z)return"";if($ in Z)return"";for(let H=0;H<XD.length;H++)if(Eg($,XD[H])in Z)return XD[H];return""}function Eg($,Z){return Z?`${Z}${r$0($)}`:$}function i$0($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function r$0($){let Z="",H=!0;for(let B=0;B<$.length;B++)if(H)Z+=$[B].toUpperCase(),H=!1;else if($[B]==="-")H=!0;else Z+=$[B];return Z}var ZJ1=Sg.default=wg()});var ZY=G5((gg)=>{Object.defineProperty(gg,"__esModule",{value:!0});gg.addClassName=xg;gg.addEvent=t$0;gg.addUserSelectStyles=FZ0;gg.createCSSTransform=QZ0;gg.createSVGTransform=XZ0;gg.getTouch=zZ0;gg.getTouchIdentifier=GZ0;gg.getTranslation=zD;gg.innerHeight=HZ0;gg.innerWidth=BZ0;gg.matchesSelector=hg;gg.matchesSelectorAndParentsTo=s$0;gg.offsetXYFromParent=JZ0;gg.outerHeight=$Z0;gg.outerWidth=ZZ0;gg.removeClassName=vg;gg.removeEvent=e$0;gg.scheduleRemoveUserSelectStyles=UZ0;var v4=bJ(),kg=yg(Rg());function yg($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(yg=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}var $Y="";function hg($,Z){if(!$Y)$Y=(0,v4.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(H){return(0,v4.isFunction)($[H])});if(!(0,v4.isFunction)($[$Y]))return!1;return $[$Y](Z)}function s$0($,Z,H){let B=$;do{if(hg(B,Z))return!0;if(B===H)return!1;B=B.parentNode}while(B);return!1}function t$0($,Z,H,B){if(!$)return;let J={capture:!0,...B};if($.addEventListener)$.addEventListener(Z,H,J);else if($.attachEvent)$.attachEvent("on"+Z,H);else $["on"+Z]=H}function e$0($,Z,H,B){if(!$)return;let J={capture:!0,...B};if($.removeEventListener)$.removeEventListener(Z,H,J);else if($.detachEvent)$.detachEvent("on"+Z,H);else $["on"+Z]=null}function $Z0($){let Z=$.clientHeight,H=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,v4.int)(H.borderTopWidth),Z+=(0,v4.int)(H.borderBottomWidth),Z}function ZZ0($){let Z=$.clientWidth,H=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,v4.int)(H.borderLeftWidth),Z+=(0,v4.int)(H.borderRightWidth),Z}function HZ0($){let Z=$.clientHeight,H=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,v4.int)(H.paddingTop),Z-=(0,v4.int)(H.paddingBottom),Z}function BZ0($){let Z=$.clientWidth,H=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,v4.int)(H.paddingLeft),Z-=(0,v4.int)(H.paddingRight),Z}function JZ0($,Z,H){let J=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),Q=($.clientX+Z.scrollLeft-J.left)/H,X=($.clientY+Z.scrollTop-J.top)/H;return{x:Q,y:X}}function QZ0($,Z){let H=zD($,Z,"px");return{[(0,kg.browserPrefixToKey)("transform",kg.default)]:H}}function XZ0($,Z){return zD($,Z,"")}function zD($,Z,H){let{x:B,y:J}=$,Q=`translate(${B}${H},${J}${H})`;if(Z){let X=`${typeof Z.x==="string"?Z.x:Z.x+H}`,z=`${typeof Z.y==="string"?Z.y:Z.y+H}`;Q=`translate(${X}, ${z})`+Q}return Q}function zZ0($,Z){return $.targetTouches&&(0,v4.findInArray)($.targetTouches,(H)=>Z===H.identifier)||$.changedTouches&&(0,v4.findInArray)($.changedTouches,(H)=>Z===H.identifier)}function GZ0($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function FZ0($){if(!$)return;let Z=$.getElementById("react-draggable-style-el");if(!Z)Z=$.createElement("style"),Z.type="text/css",Z.id="react-draggable-style-el",Z.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
8
- `,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
- `,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)xg($.body,"react-draggable-transparent-selection")}function UZ0($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{bg($)});else bg($)}function bg($){if(!$)return;try{if($.body)vg($.body,"react-draggable-transparent-selection");if($.selection)$.selection.empty();else{let Z=($.defaultView||window).getSelection();if(Z&&Z.type!=="Caret")Z.removeAllRanges()}}catch(Z){}}function xg($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function vg($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var FD=G5((fg)=>{Object.defineProperty(fg,"__esModule",{value:!0});fg.canDragX=RZ0;fg.canDragY=kZ0;fg.createCoreData=yZ0;fg.createDraggableData=hZ0;fg.getBoundPosition=SZ0;fg.getControlPosition=bZ0;fg.snapToGrid=IZ0;var g4=bJ(),uZ=ZY();function SZ0($,Z,H){if(!$.props.bounds)return[Z,H];let{bounds:B}=$.props;B=typeof B==="string"?B:xZ0(B);let J=GD($);if(typeof B==="string"){let{ownerDocument:Q}=J,X=Q.defaultView,z;if(B==="parent")z=J.parentNode;else z=J.getRootNode().querySelector(B);if(!(z instanceof X.HTMLElement))throw Error('Bounds selector "'+B+'" could not find an element.');let G=z,F=X.getComputedStyle(J),U=X.getComputedStyle(G);B={left:-J.offsetLeft+(0,g4.int)(U.paddingLeft)+(0,g4.int)(F.marginLeft),top:-J.offsetTop+(0,g4.int)(U.paddingTop)+(0,g4.int)(F.marginTop),right:(0,uZ.innerWidth)(G)-(0,uZ.outerWidth)(J)-J.offsetLeft+(0,g4.int)(U.paddingRight)-(0,g4.int)(F.marginRight),bottom:(0,uZ.innerHeight)(G)-(0,uZ.outerHeight)(J)-J.offsetTop+(0,g4.int)(U.paddingBottom)-(0,g4.int)(F.marginBottom)}}if((0,g4.isNum)(B.right))Z=Math.min(Z,B.right);if((0,g4.isNum)(B.bottom))H=Math.min(H,B.bottom);if((0,g4.isNum)(B.left))Z=Math.max(Z,B.left);if((0,g4.isNum)(B.top))H=Math.max(H,B.top);return[Z,H]}function IZ0($,Z,H){let B=Math.round(Z/$[0])*$[0],J=Math.round(H/$[1])*$[1];return[B,J]}function RZ0($){return $.props.axis==="both"||$.props.axis==="x"}function kZ0($){return $.props.axis==="both"||$.props.axis==="y"}function bZ0($,Z,H){let B=typeof Z==="number"?(0,uZ.getTouch)($,Z):null;if(typeof Z==="number"&&!B)return null;let J=GD(H),Q=H.props.offsetParent||J.offsetParent||J.ownerDocument.body;return(0,uZ.offsetXYFromParent)(B||$,Q,H.props.scale)}function yZ0($,Z,H){let B=!(0,g4.isNum)($.lastX),J=GD($);if(B)return{node:J,deltaX:0,deltaY:0,lastX:Z,lastY:H,x:Z,y:H};else return{node:J,deltaX:Z-$.lastX,deltaY:H-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:H}}function hZ0($,Z){let H=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/H,y:$.state.y+Z.deltaY/H,deltaX:Z.deltaX/H,deltaY:Z.deltaY/H,lastX:$.state.x,lastY:$.state.y}}function xZ0($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function GD($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var UD=G5((mg)=>{Object.defineProperty(mg,"__esModule",{value:!0});mg.default=dZ0;function dZ0(){}});var dg=G5((ug)=>{var nZ0=O(g()),oZ0=O(Y4());Object.defineProperty(ug,"__esModule",{value:!0});ug.default=void 0;var YD=pg(nZ0),Q4=WD(kJ()),iZ0=WD(oZ0),c2=ZY(),J6=FD(),KD=bJ(),yJ=WD(UD());function WD($){return $&&$.__esModule?$:{default:$}}function pg($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(pg=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}function X4($,Z,H){return(Z=rZ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function rZ0($){var Z=aZ0($,"string");return typeof Z=="symbol"?Z:Z+""}function aZ0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var R8={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Q6=R8.mouse;class hJ extends YD.Component{constructor(){super(...arguments);X4(this,"dragging",!1),X4(this,"lastX",NaN),X4(this,"lastY",NaN),X4(this,"touchIdentifier",null),X4(this,"mounted",!1),X4(this,"handleDragStart",($)=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button==="number"&&$.button!==0)return!1;let Z=this.findDOMNode();if(!Z||!Z.ownerDocument||!Z.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:H}=Z;if(this.props.disabled||!($.target instanceof H.defaultView.Node)||this.props.handle&&!(0,c2.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,c2.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let B=(0,c2.getTouchIdentifier)($);this.touchIdentifier=B;let J=(0,J6.getControlPosition)($,B,this);if(J==null)return;let{x:Q,y:X}=J,z=(0,J6.createCoreData)(this,Q,X);if((0,yJ.default)("DraggableCore: handleDragStart: %j",z),(0,yJ.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,c2.addUserSelectStyles)(H);this.dragging=!0,this.lastX=Q,this.lastY=X,(0,c2.addEvent)(H,Q6.move,this.handleDrag),(0,c2.addEvent)(H,Q6.stop,this.handleDragStop)}),X4(this,"handleDrag",($)=>{let Z=(0,J6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:H,y:B}=Z;if(Array.isArray(this.props.grid)){let X=H-this.lastX,z=B-this.lastY;if([X,z]=(0,J6.snapToGrid)(this.props.grid,X,z),!X&&!z)return;H=this.lastX+X,B=this.lastY+z}let J=(0,J6.createCoreData)(this,H,B);if((0,yJ.default)("DraggableCore: handleDrag: %j",J),this.props.onDrag($,J)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(X){let z=document.createEvent("MouseEvents");z.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(z)}return}this.lastX=H,this.lastY=B}),X4(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,J6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:H,y:B}=Z;if(Array.isArray(this.props.grid)){let z=H-this.lastX||0,G=B-this.lastY||0;[z,G]=(0,J6.snapToGrid)(this.props.grid,z,G),H=this.lastX+z,B=this.lastY+G}let J=(0,J6.createCoreData)(this,H,B);if(this.props.onStop($,J)===!1||this.mounted===!1)return!1;let X=this.findDOMNode();if(X){if(this.props.enableUserSelectHack)(0,c2.scheduleRemoveUserSelectStyles)(X.ownerDocument)}if((0,yJ.default)("DraggableCore: handleDragStop: %j",J),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,X)(0,yJ.default)("DraggableCore: Removing handlers"),(0,c2.removeEvent)(X.ownerDocument,Q6.move,this.handleDrag),(0,c2.removeEvent)(X.ownerDocument,Q6.stop,this.handleDragStop)}),X4(this,"onMouseDown",($)=>{return Q6=R8.mouse,this.handleDragStart($)}),X4(this,"onMouseUp",($)=>{return Q6=R8.mouse,this.handleDragStop($)}),X4(this,"onTouchStart",($)=>{return Q6=R8.touch,this.handleDragStart($)}),X4(this,"onTouchEnd",($)=>{return Q6=R8.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,c2.addEvent)($,R8.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,c2.removeEvent)(Z,R8.mouse.move,this.handleDrag),(0,c2.removeEvent)(Z,R8.touch.move,this.handleDrag),(0,c2.removeEvent)(Z,R8.mouse.stop,this.handleDragStop),(0,c2.removeEvent)(Z,R8.touch.stop,this.handleDragStop),(0,c2.removeEvent)($,R8.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,c2.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:iZ0.default.findDOMNode(this)}render(){return YD.cloneElement(YD.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}ug.default=hJ;X4(hJ,"displayName","DraggableCore");X4(hJ,"propTypes",{allowAnyClick:Q4.default.bool,allowMobileScroll:Q4.default.bool,children:Q4.default.node.isRequired,disabled:Q4.default.bool,enableUserSelectHack:Q4.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:Q4.default.arrayOf(Q4.default.number),handle:Q4.default.string,cancel:Q4.default.string,nodeRef:Q4.default.object,onStart:Q4.default.func,onDrag:Q4.default.func,onStop:Q4.default.func,onMouseDown:Q4.default.func,scale:Q4.default.number,className:KD.dontSetMe,style:KD.dontSetMe,transform:KD.dontSetMe});X4(hJ,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var ag=G5((AD)=>{var ZH0=O(g()),HH0=O(Y4());Object.defineProperty(AD,"__esModule",{value:!0});Object.defineProperty(AD,"DraggableCore",{enumerable:!0,get:function(){return JY.default}});AD.default=void 0;var HY=ig(ZH0),A5=QY(kJ()),sZ0=QY(HH0),tZ0=Tg(),lg=ZY(),cZ=FD(),ND=bJ(),JY=QY(dg()),BY=QY(UD());function QY($){return $&&$.__esModule?$:{default:$}}function ig($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(ig=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}function LD(){return LD=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var B in H)({}).hasOwnProperty.call(H,B)&&($[B]=H[B])}return $},LD.apply(null,arguments)}function dZ($,Z,H){return(Z=eZ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function eZ0($){var Z=$H0($,"string");return typeof Z=="symbol"?Z:Z+""}function $H0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class xJ extends HY.Component{static getDerivedStateFromProps($,Z){let{position:H}=$,{prevPropsPosition:B}=Z;if(H&&(!B||H.x!==B.x||H.y!==B.y))return(0,BY.default)("Draggable: getDerivedStateFromProps %j",{position:H,prevPropsPosition:B}),{x:H.x,y:H.y,prevPropsPosition:{...H}};return null}constructor($){super($);if(dZ(this,"onDragStart",(Z,H)=>{if((0,BY.default)("Draggable: onDragStart: %j",H),this.props.onStart(Z,(0,cZ.createDraggableData)(this,H))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),dZ(this,"onDrag",(Z,H)=>{if(!this.state.dragging)return!1;(0,BY.default)("Draggable: onDrag: %j",H);let B=(0,cZ.createDraggableData)(this,H),J={x:B.x,y:B.y,slackX:0,slackY:0};if(this.props.bounds){let{x:X,y:z}=J;J.x+=this.state.slackX,J.y+=this.state.slackY;let[G,F]=(0,cZ.getBoundPosition)(this,J.x,J.y);J.x=G,J.y=F,J.slackX=this.state.slackX+(X-J.x),J.slackY=this.state.slackY+(z-J.y),B.x=J.x,B.y=J.y,B.deltaX=J.x-this.state.x,B.deltaY=J.y-this.state.y}if(this.props.onDrag(Z,B)===!1)return!1;this.setState(J)}),dZ(this,"onDragStop",(Z,H)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,cZ.createDraggableData)(this,H))===!1)return!1;(0,BY.default)("Draggable: onDragStop: %j",H);let J={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:X,y:z}=this.props.position;J.x=X,J.y=z}this.setState(J)}),this.state={dragging:!1,dragged:!1,x:$.position?$.position.x:$.defaultPosition.x,y:$.position?$.position.y:$.defaultPosition.y,prevPropsPosition:{...$.position},slackX:0,slackY:0,isElementSVG:!1},$.position&&!($.onDrag||$.onStop))console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){if(typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement)this.setState({isElementSVG:!0})}componentWillUnmount(){if(this.state.dragging)this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??sZ0.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:H,defaultPosition:B,defaultClassName:J,defaultClassNameDragging:Q,defaultClassNameDragged:X,position:z,positionOffset:G,scale:F,...U}=this.props,Y={},K=null,N=!Boolean(z)||this.state.dragging,L=z||B,V={x:(0,cZ.canDragX)(this)&&N?this.state.x:L.x,y:(0,cZ.canDragY)(this)&&N?this.state.y:L.y};if(this.state.isElementSVG)K=(0,lg.createSVGTransform)(V,G);else Y=(0,lg.createCSSTransform)(V,G);let A=(0,tZ0.clsx)(H.props.className||"",J,{[Q]:this.state.dragging,[X]:this.state.dragged});return HY.createElement(JY.default,LD({},U,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),HY.cloneElement(HY.Children.only(H),{className:A,style:{...H.props.style,...Y},transform:K}))}}AD.default=xJ;dZ(xJ,"displayName","Draggable");dZ(xJ,"propTypes",{...JY.default.propTypes,axis:A5.default.oneOf(["both","x","y","none"]),bounds:A5.default.oneOfType([A5.default.shape({left:A5.default.number,right:A5.default.number,top:A5.default.number,bottom:A5.default.number}),A5.default.string,A5.default.oneOf([!1])]),defaultClassName:A5.default.string,defaultClassNameDragging:A5.default.string,defaultClassNameDragged:A5.default.string,defaultPosition:A5.default.shape({x:A5.default.number,y:A5.default.number}),positionOffset:A5.default.shape({x:A5.default.oneOfType([A5.default.number,A5.default.string]),y:A5.default.oneOfType([A5.default.number,A5.default.string])}),position:A5.default.shape({x:A5.default.number,y:A5.default.number}),className:ND.dontSetMe,style:ND.dontSetMe,transform:ND.dontSetMe});dZ(xJ,"defaultProps",{...JY.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})});var zY=G5((GJ1,XY)=>{var{default:ng,DraggableCore:BH0}=ag();XY.exports=ng;XY.exports.default=ng;XY.exports.DraggableCore=BH0});var tg=G5((UH0)=>{var WH0=O(g());UH0.__esModule=!0;UH0.cloneElement=FH0;var JH0=QH0(WH0);function QH0($){return $&&$.__esModule?$:{default:$}}function og($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols($);Z&&(B=B.filter(function(J){return Object.getOwnPropertyDescriptor($,J).enumerable})),H.push.apply(H,B)}return H}function sg($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?og(Object(H),!0).forEach(function(B){XH0($,B,H[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):og(Object(H)).forEach(function(B){Object.defineProperty($,B,Object.getOwnPropertyDescriptor(H,B))})}return $}function XH0($,Z,H){return(Z=zH0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function zH0($){var Z=GH0($,"string");return typeof Z=="symbol"?Z:Z+""}function GH0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function FH0($,Z){if(Z.style&&$.props.style)Z.style=sg(sg({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=`${$.props.className} ${Z.className}`;return JH0.default.cloneElement($,Z)}});var VD=G5((LH0)=>{LH0.__esModule=!0;LH0.resizableProps=void 0;var D1=NH0(kJ()),UJ1=zY();function NH0($){return $&&$.__esModule?$:{default:$}}var YJ1=LH0.resizableProps={axis:D1.default.oneOf(["both","x","y","none"]),className:D1.default.string,children:D1.default.element.isRequired,draggableOpts:D1.default.shape({allowAnyClick:D1.default.bool,cancel:D1.default.string,children:D1.default.node,disabled:D1.default.bool,enableUserSelectHack:D1.default.bool,offsetParent:typeof Element<"u"?D1.default.instanceOf(Element):D1.default.any,grid:D1.default.arrayOf(D1.default.number),handle:D1.default.string,nodeRef:D1.default.object,onStart:D1.default.func,onDrag:D1.default.func,onStop:D1.default.func,onMouseDown:D1.default.func,scale:D1.default.number}),height:function(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];let[B]=Z;if(B.axis==="both"||B.axis==="y")return D1.default.number.isRequired(...Z);return D1.default.number(...Z)},handle:D1.default.oneOfType([D1.default.node,D1.default.func]),handleSize:D1.default.arrayOf(D1.default.number),lockAspectRatio:D1.default.bool,maxConstraints:D1.default.arrayOf(D1.default.number),minConstraints:D1.default.arrayOf(D1.default.number),onResizeStop:D1.default.func,onResizeStart:D1.default.func,onResize:D1.default.func,resizeHandles:D1.default.arrayOf(D1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:D1.default.number,width:function(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];let[B]=Z;if(B.axis==="both"||B.axis==="x")return D1.default.number.isRequired(...Z);return D1.default.number(...Z)}}});var MD=G5((CH0)=>{var EH0=O(g());CH0.__esModule=!0;CH0.default=void 0;var lZ=Zf(EH0),VH0=zY(),DH0=tg(),qH0=VD(),MH0=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Zf($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(Zf=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}function qD(){return qD=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var B in H)({}).hasOwnProperty.call(H,B)&&($[B]=H[B])}return $},qD.apply(null,arguments)}function PH0($,Z){if($==null)return{};var H,B,J=_H0($,Z);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);for(B=0;B<Q.length;B++)H=Q[B],Z.indexOf(H)===-1&&{}.propertyIsEnumerable.call($,H)&&(J[H]=$[H])}return J}function _H0($,Z){if($==null)return{};var H={};for(var B in $)if({}.hasOwnProperty.call($,B)){if(Z.indexOf(B)!==-1)continue;H[B]=$[B]}return H}function $f($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols($);Z&&(B=B.filter(function(J){return Object.getOwnPropertyDescriptor($,J).enumerable})),H.push.apply(H,B)}return H}function DD($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?$f(Object(H),!0).forEach(function(B){OH0($,B,H[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):$f(Object(H)).forEach(function(B){Object.defineProperty($,B,Object.getOwnPropertyDescriptor(H,B))})}return $}function OH0($,Z,H){return(Z=jH0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function jH0($){var Z=TH0($,"string");return typeof Z=="symbol"?Z:Z+""}function TH0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class GY extends lZ.Component{constructor(){super(...arguments);this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints($,Z){let{minConstraints:H,maxConstraints:B,lockAspectRatio:J}=this.props;if(!H&&!B&&!J)return[$,Z];if(J){let F=this.props.width/this.props.height,U=$-this.props.width,Y=Z-this.props.height;if(Math.abs(U)>Math.abs(Y*F))Z=$/F;else $=Z*F}let[Q,X]=[$,Z],[z,G]=this.slack||[0,0];if($+=z,Z+=G,H)$=Math.max(H[0],$),Z=Math.max(H[1],Z);if(B)$=Math.min(B[0],$),Z=Math.min(B[1],Z);return this.slack=[z+(Q-$),G+(X-Z)],[$,Z]}resizeHandler($,Z){return(H,B)=>{let{node:J,deltaX:Q,deltaY:X}=B;if($==="onResizeStart")this.resetData();let z=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",G=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!z&&!G)return;let F=Z[0],U=Z[Z.length-1],Y=J.getBoundingClientRect();if(this.lastHandleRect!=null){if(U==="w"){let A=Y.left-this.lastHandleRect.left;Q+=A}if(F==="n"){let A=Y.top-this.lastHandleRect.top;X+=A}}if(this.lastHandleRect=Y,U==="w")Q=-Q;if(F==="n")X=-X;let K=this.props.width+(z?Q/this.props.transformScale:0),W=this.props.height+(G?X/this.props.transformScale:0);if([K,W]=this.runConstraints(K,W),$==="onResizeStop"&&this.lastSize)({width:K,height:W}=this.lastSize);let N=K!==this.props.width||W!==this.props.height;if($!=="onResizeStop")this.lastSize={width:K,height:W};let L=typeof this.props[$]==="function"?this.props[$]:null;if(L&&!($==="onResize"&&!N))H.persist?.(),L(H,{node:J,size:{width:K,height:W},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let{handle:H}=this.props;if(!H)return lZ.createElement("span",{className:`react-resizable-handle react-resizable-handle-${$}`,ref:Z});if(typeof H==="function")return H($,Z);let B=typeof H.type==="string",J=DD({ref:Z},B?{}:{handleAxis:$});return lZ.cloneElement(H,J)}render(){let $=this.props,{children:Z,className:H,draggableOpts:B,width:J,height:Q,handle:X,handleSize:z,lockAspectRatio:G,axis:F,minConstraints:U,maxConstraints:Y,onResize:K,onResizeStop:W,onResizeStart:N,resizeHandles:L,transformScale:V}=$,A=PH0($,MH0);return(0,DH0.cloneElement)(Z,DD(DD({},A),{},{className:`${H?`${H} `:""}react-resizable`,children:[...lZ.Children.toArray(Z.props.children),...L.map((D)=>{let q=this.handleRefs[D]??(this.handleRefs[D]=lZ.createRef());return lZ.createElement(VH0.DraggableCore,qD({},B,{nodeRef:q,key:`resizableHandle-${D}`,onStop:this.resizeHandler("onResizeStop",D),onStart:this.resizeHandler("onResizeStart",D),onDrag:this.resizeHandler("onResize",D)}),this.renderResizeHandle(D,q))})]}))}}CH0.default=GY;GY.propTypes=qH0.resizableProps;GY.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var zf=G5((gH0)=>{var mH0=O(g());gH0.__esModule=!0;gH0.default=void 0;var PD=Qf(mH0),SH0=Jf(kJ()),IH0=Jf(MD()),RH0=VD(),kH0=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Jf($){return $&&$.__esModule?$:{default:$}}function Qf($,Z){if(typeof WeakMap=="function")var H=new WeakMap,B=new WeakMap;return(Qf=function(J,Q){if(!Q&&J&&J.__esModule)return J;var X,z,G={__proto__:null,default:J};if(J===null||typeof J!="object"&&typeof J!="function")return G;if(X=Q?B:H){if(X.has(J))return X.get(J);X.set(J,G)}for(let F in J)F!=="default"&&{}.hasOwnProperty.call(J,F)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(J,F))&&(z.get||z.set)?X(G,F,z):G[F]=J[F]);return G})($,Z)}function _D(){return _D=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var B in H)({}).hasOwnProperty.call(H,B)&&($[B]=H[B])}return $},_D.apply(null,arguments)}function Bf($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols($);Z&&(B=B.filter(function(J){return Object.getOwnPropertyDescriptor($,J).enumerable})),H.push.apply(H,B)}return H}function FY($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?Bf(Object(H),!0).forEach(function(B){bH0($,B,H[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):Bf(Object(H)).forEach(function(B){Object.defineProperty($,B,Object.getOwnPropertyDescriptor(H,B))})}return $}function bH0($,Z,H){return(Z=yH0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function yH0($){var Z=hH0($,"string");return typeof Z=="symbol"?Z:Z+""}function hH0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var B=H.call($,Z||"default");if(typeof B!="object")return B;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function xH0($,Z){if($==null)return{};var H,B,J=vH0($,Z);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);for(B=0;B<Q.length;B++)H=Q[B],Z.indexOf(H)===-1&&{}.propertyIsEnumerable.call($,H)&&(J[H]=$[H])}return J}function vH0($,Z){if($==null)return{};var H={};for(var B in $)if({}.hasOwnProperty.call($,B)){if(Z.indexOf(B)!==-1)continue;H[B]=$[B]}return H}class OD extends PD.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=($,Z)=>{let{size:H}=Z;if(this.props.onResize)$.persist?.(),this.setState(H,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(H)}}static getDerivedStateFromProps($,Z){if(Z.propsWidth!==$.width||Z.propsHeight!==$.height)return{width:$.width,height:$.height,propsWidth:$.width,propsHeight:$.height};return null}render(){let $=this.props,{handle:Z,handleSize:H,onResize:B,onResizeStart:J,onResizeStop:Q,draggableOpts:X,minConstraints:z,maxConstraints:G,lockAspectRatio:F,axis:U,width:Y,height:K,resizeHandles:W,style:N,transformScale:L}=$,V=xH0($,kH0);return PD.createElement(IH0.default,{axis:U,draggableOpts:X,handle:Z,handleSize:H,height:this.state.height,lockAspectRatio:F,maxConstraints:G,minConstraints:z,onResizeStart:J,onResize:this.onResize,onResizeStop:Q,resizeHandles:W,transformScale:L,width:this.state.width},PD.createElement("div",_D({},V,{style:FY(FY({},N),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}gH0.default=OD;OD.propTypes=FY(FY({},RH0.resizableProps),{},{children:SH0.default.element})});var Gf=G5((LJ1,UY)=>{UY.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};UY.exports.Resizable=MD().default;UY.exports.ResizableBox=zf().default});var p4=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe($){return this.listeners.add($),this.onSubscribe(),()=>{this.listeners.delete($),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var yc=class extends p4{#$;#Z;#H;constructor(){super();this.#H=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#H)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#H=$,this.#Z?.(),this.#Z=$((Z)=>{if(typeof Z==="boolean")this.setFocused(Z);else this.onFocus()})}setFocused($){if(this.#$!==$)this.#$=$,this.onFocus()}onFocus(){let $=this.isFocused();this.listeners.forEach((Z)=>{Z($)})}isFocused(){if(typeof this.#$==="boolean")return this.#$;return globalThis.document?.visibilityState!=="hidden"}},g7=new yc;var hc={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},xc=class{#$=hc;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},h8=new xc;function Uq($){setTimeout($,0)}var pY=typeof window>"u"||"Deno"in globalThis;function b5(){}function Wq($,Z){return typeof $==="function"?$(Z):$}function QH($){return typeof $==="number"&&$>=0&&$!==1/0}function eJ($,Z){return Math.max($+(Z||0)-Date.now(),0)}function F8($,Z){return typeof $==="function"?$(Z):$}function a2($,Z){return typeof $==="function"?$(Z):$}function $Q($,Z){let{type:H="all",exact:B,fetchStatus:J,predicate:Q,queryKey:X,stale:z}=$;if(X){if(B){if(Z.queryHash!==XH(X,Z.options))return!1}else if(!L6(Z.queryKey,X))return!1}if(H!=="all"){let G=Z.isActive();if(H==="active"&&!G)return!1;if(H==="inactive"&&G)return!1}if(typeof z==="boolean"&&Z.isStale()!==z)return!1;if(J&&J!==Z.state.fetchStatus)return!1;if(Q&&!Q(Z))return!1;return!0}function ZQ($,Z){let{exact:H,status:B,predicate:J,mutationKey:Q}=$;if(Q){if(!Z.options.mutationKey)return!1;if(H){if(x8(Z.options.mutationKey)!==x8(Q))return!1}else if(!L6(Z.options.mutationKey,Q))return!1}if(B&&Z.state.status!==B)return!1;if(J&&!J(Z))return!1;return!0}function XH($,Z){return(Z?.queryKeyHashFn||x8)($)}function x8($){return JSON.stringify($,(Z,H)=>mY(H)?Object.keys(H).sort().reduce((B,J)=>{return B[J]=H[J],B},{}):H)}function L6($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object")return Object.keys(Z).every((H)=>L6($[H],Z[H]));return!1}var vc=Object.prototype.hasOwnProperty;function zH($,Z,H=0){if($===Z)return $;if(H>500)return Z;let B=Yq($)&&Yq(Z);if(!B&&!(mY($)&&mY(Z)))return Z;let Q=(B?$:Object.keys($)).length,X=B?Z:Object.keys(Z),z=X.length,G=B?Array(z):{},F=0;for(let U=0;U<z;U++){let Y=B?U:X[U],K=$[Y],W=Z[Y];if(K===W){if(G[Y]=K,B?U<Q:vc.call($,Y))F++;continue}if(K===null||W===null||typeof K!=="object"||typeof W!=="object"){G[Y]=W;continue}let N=zH(K,W,H+1);if(G[Y]=N,N===K)F++}return Q===z&&F===Q?$:G}function f7($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if($[H]!==Z[H])return!1;return!0}function Yq($){return Array.isArray($)&&$.length===Object.keys($).length}function mY($){if(!Kq($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let H=Z.prototype;if(!Kq(H))return!1;if(!H.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function Kq($){return Object.prototype.toString.call($)==="[object Object]"}function Nq($){return new Promise((Z)=>{h8.setTimeout(Z,$)})}function GH($,Z,H){if(typeof H.structuralSharing==="function")return H.structuralSharing($,Z);else if(H.structuralSharing!==!1)return zH($,Z);return Z}function Lq($,Z,H=0){let B=[...$,Z];return H&&B.length>H?B.slice(1):B}function Aq($,Z,H=0){let B=[Z,...$];return H&&B.length>H?B.slice(0,-1):B}var m7=Symbol();function HQ($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===m7)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function p7($,Z){if(typeof $==="function")return $(...Z);return!!$}function Vq($,Z,H){let B=!1,J;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(J??=Z(),B)return J;if(B=!0,J.aborted)H();else J.addEventListener("abort",H,{once:!0});return J}}),$}var v8=(()=>{let $=()=>pY;return{isServer(){return $()},setIsServer(Z){$=Z}}})();function FH(){let $,Z,H=new Promise((J,Q)=>{$=J,Z=Q});H.status="pending",H.catch(()=>{});function B(J){Object.assign(H,J),delete H.resolve,delete H.reject}return H.resolve=(J)=>{B({status:"fulfilled",value:J}),$(J)},H.reject=(J)=>{B({status:"rejected",reason:J}),Z(J)},H}var Dq=Uq;function gc(){let $=[],Z=0,H=(z)=>{z()},B=(z)=>{z()},J=Dq,Q=(z)=>{if(Z)$.push(z);else J(()=>{H(z)})},X=()=>{let z=$;if($=[],z.length)J(()=>{B(()=>{z.forEach((G)=>{H(G)})})})};return{batch:(z)=>{let G;Z++;try{G=z()}finally{if(Z--,!Z)X()}return G},batchCalls:(z)=>{return(...G)=>{Q(()=>{z(...G)})}},schedule:Q,setNotifyFunction:(z)=>{H=z},setBatchNotifyFunction:(z)=>{B=z},setScheduler:(z)=>{J=z}}}var l1=gc();var fc=class extends p4{#$=!0;#Z;#H;constructor(){super();this.#H=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),H=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",H,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",H)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#H)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#H=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((H)=>{H($)})}isOnline(){return this.#$}},u7=new fc;function mc($){return Math.min(1000*2**$,30000)}function uY($){return($??"online")==="online"?u7.isOnline():!0}var BQ=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function JQ($){let Z=!1,H=0,B,J=FH(),Q=()=>J.status!=="pending",X=(L)=>{if(!Q()){let V=new BQ(L);K(V),$.onCancel?.(V)}},z=()=>{Z=!0},G=()=>{Z=!1},F=()=>g7.isFocused()&&($.networkMode==="always"||u7.isOnline())&&$.canRun(),U=()=>uY($.networkMode)&&$.canRun(),Y=(L)=>{if(!Q())B?.(),J.resolve(L)},K=(L)=>{if(!Q())B?.(),J.reject(L)},W=()=>{return new Promise((L)=>{B=(V)=>{if(Q()||F())L(V)},$.onPause?.()}).then(()=>{if(B=void 0,!Q())$.onContinue?.()})},N=()=>{if(Q())return;let L,V=H===0?$.initialPromise:void 0;try{L=V??$.fn()}catch(A){L=Promise.reject(A)}Promise.resolve(L).then(Y).catch((A)=>{if(Q())return;let D=$.retry??(v8.isServer()?0:3),q=$.retryDelay??mc,_=typeof q==="function"?q(H,A):q,M=D===!0||typeof D==="number"&&H<D||typeof D==="function"&&D(H,A);if(Z||!M){K(A);return}H++,$.onFail?.(H,A),Nq(_).then(()=>{return F()?void 0:W()}).then(()=>{if(Z)K(A);else N()})})};return{promise:J,status:()=>J.status,cancel:X,continue:()=>{return B?.(),J},cancelRetry:z,continueRetry:G,canStart:U,start:()=>{if(U())N();else W().then(N);return J}}}var QQ=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),QH(this.gcTime))this.#$=h8.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(v8.isServer()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)h8.clearTimeout(this.#$),this.#$=void 0}};var Pq=class extends QQ{#$;#Z;#H;#J;#B;#Q;#X;constructor($){super();this.#X=!1,this.#Q=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#J=$.client,this.#H=this.#J.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#$=Mq(this.options),this.state=$.state??this.#$,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#B?.promise}setOptions($){if(this.options={...this.#Q,...$},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=Mq(this.options);if(Z.data!==void 0)this.setState(qq(Z.data,Z.dataUpdatedAt)),this.#$=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#H.remove(this)}setData($,Z){let H=GH(this.state.data,$,this.options);return this.#G({data:H,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),H}setState($,Z){this.#G({type:"setState",state:$,setStateOptions:Z})}cancel($){let Z=this.#B?.promise;return this.#B?.cancel($),Z?Z.then(b5).catch(b5):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#$}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(($)=>a2($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===m7||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>F8($.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some(($)=>$.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime($=0){if(this.state.data===void 0)return!0;if($==="static")return!1;if(this.state.isInvalidated)return!0;return!eJ(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find((Z)=>Z.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#B?.continue()}onOnline(){this.observers.find((Z)=>Z.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#B?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){if(this.observers.includes($)){if(this.observers=this.observers.filter((Z)=>Z!==$),!this.observers.length){if(this.#B)if(this.#X||this.#z())this.#B.cancel({revert:!0});else this.#B.cancelRetry();this.scheduleGc()}this.#H.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}#z(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){if(!this.state.isInvalidated)this.#G({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#B?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#B)return this.#B.continueRetry(),this.#B.promise}if($)this.setOptions($);if(!this.options.queryFn){let z=this.observers.find((G)=>G.options.queryFn);if(z)this.setOptions(z.options)}let H=new AbortController,B=(z)=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>{return this.#X=!0,H.signal}})},J=()=>{let z=HQ(this.options,Z),F=(()=>{let U={client:this.#J,queryKey:this.queryKey,meta:this.meta};return B(U),U})();if(this.#X=!1,this.options.persister)return this.options.persister(z,F,this);return z(F)},X=(()=>{let z={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#J,state:this.state,fetchFn:J};return B(z),z})();if(this.options.behavior?.onFetch(X,this),this.#Z=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==X.fetchOptions?.meta)this.#G({type:"fetch",meta:X.fetchOptions?.meta});this.#B=JQ({initialPromise:Z?.initialPromise,fn:X.fetchFn,onCancel:(z)=>{if(z instanceof BQ&&z.revert)this.setState({...this.#Z,fetchStatus:"idle"});H.abort()},onFail:(z,G)=>{this.#G({type:"failed",failureCount:z,error:G})},onPause:()=>{this.#G({type:"pause"})},onContinue:()=>{this.#G({type:"continue"})},retry:X.options.retry,retryDelay:X.options.retryDelay,networkMode:X.options.networkMode,canRun:()=>!0});try{let z=await this.#B.start();if(z===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(z),this.#H.config.onSuccess?.(z,this),this.#H.config.onSettled?.(z,this.state.error,this),z}catch(z){if(z instanceof BQ){if(z.silent)return this.#B.promise;else if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw this.#G({type:"error",error:z}),this.#H.config.onError?.(z,this),this.#H.config.onSettled?.(this.state.data,z,this),z}finally{this.scheduleGc()}}#G($){let Z=(H)=>{switch($.type){case"failed":return{...H,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...H,fetchStatus:"paused"};case"continue":return{...H,fetchStatus:"fetching"};case"fetch":return{...H,...cY(H.data,this.options),fetchMeta:$.meta??null};case"success":let B={...H,...qq($.data,$.dataUpdatedAt),dataUpdateCount:H.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#Z=$.manual?B:void 0,B;case"error":let J=$.error;return{...H,error:J,errorUpdateCount:H.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:H.fetchFailureCount+1,fetchFailureReason:J,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...H,isInvalidated:!0};case"setState":return{...H,...$.state}}};this.state=Z(this.state),l1.batch(()=>{this.observers.forEach((H)=>{H.onQueryUpdate()}),this.#H.notify({query:this,type:"updated",action:$})})}};function cY($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uY(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function qq($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Mq($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,H=Z!==void 0,B=H?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:H?B??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:H?"success":"pending",fetchStatus:"idle"}}var lY=class extends p4{constructor($,Z){super();this.options=Z,this.#$=$,this.#z=null,this.#X=FH(),this.bindMethods(),this.setOptions(Z)}#$;#Z=void 0;#H=void 0;#J=void 0;#B;#Q;#X;#z;#G;#W;#N;#U;#Y;#F;#L=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),_q(this.#Z,this.options))this.#K();else this.updateResult();this.#q()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return dY(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dY(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#P(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,H=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof a2(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#_(),this.#Z.setOptions(this.options),Z._defaulted&&!f7(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let B=this.hasListeners();if(B&&Oq(this.#Z,H,this.options,Z))this.#K();if(this.updateResult(),B&&(this.#Z!==H||a2(this.options.enabled,this.#Z)!==a2(Z.enabled,this.#Z)||F8(this.options.staleTime,this.#Z)!==F8(Z.staleTime,this.#Z)))this.#A();let J=this.#V();if(B&&(this.#Z!==H||a2(this.options.enabled,this.#Z)!==a2(Z.enabled,this.#Z)||J!==this.#F))this.#D(J)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),H=this.createResult(Z,$);if(uc(this,H))this.#J=H,this.#Q=this.options,this.#B=this.#Z.state;return H}getCurrentResult(){return this.#J}trackResult($,Z){return new Proxy($,{get:(H,B)=>{if(this.trackProp(B),Z?.(B),B==="promise"){if(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#X.status==="pending")this.#X.reject(Error("experimental_prefetchInRender feature flag is not enabled"))}return Reflect.get(H,B)}})}trackProp($){this.#L.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),H=this.#$.getQueryCache().build(this.#$,Z);return H.fetch().then(()=>this.createResult(H,Z))}fetch($){return this.#K({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#J})}#K($){this.#_();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(b5);return Z}#A(){this.#M();let $=F8(this.options.staleTime,this.#Z);if(v8.isServer()||this.#J.isStale||!QH($))return;let H=eJ(this.#J.dataUpdatedAt,$)+1;this.#U=h8.setTimeout(()=>{if(!this.#J.isStale)this.updateResult()},H)}#V(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#D($){if(this.#P(),this.#F=$,v8.isServer()||a2(this.options.enabled,this.#Z)===!1||!QH(this.#F)||this.#F===0)return;this.#Y=h8.setInterval(()=>{if(this.options.refetchIntervalInBackground||g7.isFocused())this.#K()},this.#F)}#q(){this.#A(),this.#D(this.#V())}#M(){if(this.#U!==void 0)h8.clearTimeout(this.#U),this.#U=void 0}#P(){if(this.#Y!==void 0)h8.clearInterval(this.#Y),this.#Y=void 0}createResult($,Z){let H=this.#Z,B=this.options,J=this.#J,Q=this.#B,X=this.#Q,G=$!==H?$.state:this.#H,{state:F}=$,U={...F},Y=!1,K;if(Z._optimisticResults){let R=this.hasListeners(),y=!R&&_q($,Z),w=R&&Oq($,H,Z,B);if(y||w)U={...U,...cY(F.data,$.options)};if(Z._optimisticResults==="isRestoring")U.fetchStatus="idle"}let{error:W,errorUpdatedAt:N,status:L}=U;K=U.data;let V=!1;if(Z.placeholderData!==void 0&&K===void 0&&L==="pending"){let R;if(J?.isPlaceholderData&&Z.placeholderData===X?.placeholderData)R=J.data,V=!0;else R=typeof Z.placeholderData==="function"?Z.placeholderData(this.#N?.state.data,this.#N):Z.placeholderData;if(R!==void 0)L="success",K=GH(J?.data,R,Z),Y=!0}if(Z.select&&K!==void 0&&!V)if(J&&K===Q?.data&&Z.select===this.#G)K=this.#W;else try{this.#G=Z.select,K=Z.select(K),K=GH(J?.data,K,Z),this.#W=K,this.#z=null}catch(R){this.#z=R}if(this.#z)W=this.#z,K=this.#W,N=Date.now(),L="error";let A=U.fetchStatus==="fetching",D=L==="pending",q=L==="error",_=D&&A,M=K!==void 0,C={status:L,fetchStatus:U.fetchStatus,isPending:D,isSuccess:L==="success",isError:q,isInitialLoading:_,isLoading:_,data:K,dataUpdatedAt:U.dataUpdatedAt,error:W,errorUpdatedAt:N,failureCount:U.fetchFailureCount,failureReason:U.fetchFailureReason,errorUpdateCount:U.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:U.dataUpdateCount>G.dataUpdateCount||U.errorUpdateCount>G.errorUpdateCount,isFetching:A,isRefetching:A&&!D,isLoadingError:q&&!M,isPaused:U.fetchStatus==="paused",isPlaceholderData:Y,isRefetchError:q&&M,isStale:iY($,Z),refetch:this.refetch,promise:this.#X,isEnabled:a2(Z.enabled,$)!==!1};if(this.options.experimental_prefetchInRender){let R=C.data!==void 0,y=C.status==="error"&&!R,w=(I)=>{if(y)I.reject(C.error);else if(R)I.resolve(C.data)},h=()=>{let I=this.#X=C.promise=FH();w(I)},E=this.#X;switch(E.status){case"pending":if($.queryHash===H.queryHash)w(E);break;case"fulfilled":if(y||C.data!==E.value)h();break;case"rejected":if(!y||C.error!==E.reason)h();break}}return C}updateResult(){let $=this.#J,Z=this.createResult(this.#Z,this.options);if(this.#B=this.#Z.state,this.#Q=this.options,this.#B.data!==void 0)this.#N=this.#Z;if(f7(Z,$))return;this.#J=Z;let H=()=>{if(!$)return!0;let{notifyOnChangeProps:B}=this.options,J=typeof B==="function"?B():B;if(J==="all"||!J&&!this.#L.size)return!0;let Q=new Set(J??this.#L);if(this.options.throwOnError)Q.add("error");return Object.keys(this.#J).some((X)=>{let z=X;return this.#J[z]!==$[z]&&Q.has(z)})};this.#O({listeners:H()})}#_(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#H=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#q()}#O($){l1.batch(()=>{if($.listeners)this.listeners.forEach((Z)=>{Z(this.#J)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}};function pc($,Z){return a2(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&a2(Z.retryOnMount,$)===!1)}function _q($,Z){return pc($,Z)||$.state.data!==void 0&&dY($,Z,Z.refetchOnMount)}function dY($,Z,H){if(a2(Z.enabled,$)!==!1&&F8(Z.staleTime,$)!=="static"){let B=typeof H==="function"?H($):H;return B==="always"||B!==!1&&iY($,Z)}return!1}function Oq($,Z,H,B){return($!==Z||a2(B.enabled,$)===!1)&&(!H.suspense||$.state.status!=="error")&&iY($,H)}function iY($,Z){return a2(Z.enabled,$)!==!1&&$.isStaleByTime(F8(Z.staleTime,$))}function uc($,Z){if(!f7($.getCurrentResult(),Z))return!0;return!1}function rY($){return{onFetch:(Z,H)=>{let B=Z.options,J=Z.fetchOptions?.meta?.fetchMore?.direction,Q=Z.state.data?.pages||[],X=Z.state.data?.pageParams||[],z={pages:[],pageParams:[]},G=0,F=async()=>{let U=!1,Y=(N)=>{Vq(N,()=>Z.signal,()=>U=!0)},K=HQ(Z.options,Z.fetchOptions),W=async(N,L,V)=>{if(U)return Promise.reject();if(L==null&&N.pages.length)return Promise.resolve(N);let D=(()=>{let P={client:Z.client,queryKey:Z.queryKey,pageParam:L,direction:V?"backward":"forward",meta:Z.options.meta};return Y(P),P})(),q=await K(D),{maxPages:_}=Z.options,M=V?Aq:Lq;return{pages:M(N.pages,q,_),pageParams:M(N.pageParams,L,_)}};if(J&&Q.length){let N=J==="backward",L=N?cc:jq,V={pages:Q,pageParams:X},A=L(B,V);z=await W(V,A,N)}else{let N=$??Q.length;do{let L=G===0?X[0]??B.initialPageParam:jq(B,z);if(G>0&&L==null)break;z=await W(z,L),G++}while(G<N)}return z};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(F,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},H)};else Z.fetchFn=F}}}function jq($,{pages:Z,pageParams:H}){let B=Z.length-1;return Z.length>0?$.getNextPageParam(Z[B],Z,H[B],H):void 0}function cc($,{pages:Z,pageParams:H}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,H[0],H):void 0}var Tq=class extends QQ{#$;#Z;#H;#J;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#H=$.mutationCache,this.#Z=[],this.state=$.state||aY(),this.setOptions($.options),this.scheduleGc()}setOptions($){this.options=$,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver($){if(!this.#Z.includes($))this.#Z.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#H.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#H.remove(this)}continue(){return this.#J?.continue()??this.execute(this.state.variables)}async execute($){let Z=()=>{this.#B({type:"continue"})},H={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#J=JQ({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,H)},onFail:(Q,X)=>{this.#B({type:"failed",failureCount:Q,error:X})},onPause:()=>{this.#B({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#H.canRun(this)});let B=this.state.status==="pending",J=!this.#J.canStart();try{if(B)Z();else{if(this.#B({type:"pending",variables:$,isPaused:J}),this.#H.config.onMutate)await this.#H.config.onMutate($,this,H);let X=await this.options.onMutate?.($,H);if(X!==this.state.context)this.#B({type:"pending",context:X,variables:$,isPaused:J})}let Q=await this.#J.start();return await this.#H.config.onSuccess?.(Q,$,this.state.context,this,H),await this.options.onSuccess?.(Q,$,this.state.context,H),await this.#H.config.onSettled?.(Q,null,this.state.variables,this.state.context,this,H),await this.options.onSettled?.(Q,null,$,this.state.context,H),this.#B({type:"success",data:Q}),Q}catch(Q){try{await this.#H.config.onError?.(Q,$,this.state.context,this,H)}catch(X){Promise.reject(X)}try{await this.options.onError?.(Q,$,this.state.context,H)}catch(X){Promise.reject(X)}try{await this.#H.config.onSettled?.(void 0,Q,this.state.variables,this.state.context,this,H)}catch(X){Promise.reject(X)}try{await this.options.onSettled?.(void 0,Q,$,this.state.context,H)}catch(X){Promise.reject(X)}throw this.#B({type:"error",error:Q}),Q}finally{this.#H.runNext(this)}}#B($){let Z=(H)=>{switch($.type){case"failed":return{...H,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...H,isPaused:!0};case"continue":return{...H,isPaused:!1};case"pending":return{...H,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...H,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...H,data:void 0,error:$.error,failureCount:H.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),l1.batch(()=>{this.#Z.forEach((H)=>{H.onMutationUpdate($)}),this.#H.notify({mutation:this,type:"updated",action:$})})}};function aY(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cq=class extends p4{constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#H=0}#$;#Z;#H;build($,Z,H){let B=new Tq({client:$,mutationCache:this,mutationId:++this.#H,options:$.defaultMutationOptions(Z),state:H});return this.add(B),B}add($){this.#$.add($);let Z=XQ($);if(typeof Z==="string"){let H=this.#Z.get(Z);if(H)H.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=XQ($);if(typeof Z==="string"){let H=this.#Z.get(Z);if(H){if(H.length>1){let B=H.indexOf($);if(B!==-1)H.splice(B,1)}else if(H[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=XQ($);if(typeof Z==="string"){let B=this.#Z.get(Z)?.find((J)=>J.state.status==="pending");return!B||B===$}else return!0}runNext($){let Z=XQ($);if(typeof Z==="string")return this.#Z.get(Z)?.find((B)=>B!==$&&B.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){l1.batch(()=>{this.#$.forEach(($)=>{this.notify({type:"removed",mutation:$})}),this.#$.clear(),this.#Z.clear()})}getAll(){return Array.from(this.#$)}find($){let Z={exact:!0,...$};return this.getAll().find((H)=>ZQ(Z,H))}findAll($={}){return this.getAll().filter((Z)=>ZQ($,Z))}notify($){l1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return l1.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(b5))))}};function XQ($){return $.options.scope?.id}var nY=class extends p4{#$;#Z=void 0;#H;#J;constructor($,Z){super();this.#$=$,this.setOptions(Z),this.bindMethods(),this.#B()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let Z=this.options;if(this.options=this.#$.defaultMutationOptions($),!f7(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#H,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&x8(Z.mutationKey)!==x8(this.options.mutationKey))this.reset();else if(this.#H?.state.status==="pending")this.#H.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#H?.removeObserver(this)}onMutationUpdate($){this.#B(),this.#Q($)}getCurrentResult(){return this.#Z}reset(){this.#H?.removeObserver(this),this.#H=void 0,this.#B(),this.#Q()}mutate($,Z){return this.#J=Z,this.#H?.removeObserver(this),this.#H=this.#$.getMutationCache().build(this.#$,this.options),this.#H.addObserver(this),this.#H.execute($)}#B(){let $=this.#H?.state??aY();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#Q($){l1.batch(()=>{if(this.#J&&this.hasListeners()){let Z=this.#Z.variables,H=this.#Z.context,B={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#J.onSuccess?.($.data,Z,H,B)}catch(J){Promise.reject(J)}try{this.#J.onSettled?.($.data,null,Z,H,B)}catch(J){Promise.reject(J)}}else if($?.type==="error"){try{this.#J.onError?.($.error,Z,H,B)}catch(J){Promise.reject(J)}try{this.#J.onSettled?.(void 0,$.error,Z,H,B)}catch(J){Promise.reject(J)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var wq=class extends p4{constructor($={}){super();this.config=$,this.#$=new Map}#$;build($,Z,H){let B=Z.queryKey,J=Z.queryHash??XH(B,Z),Q=this.get(J);if(!Q)Q=new Pq({client:$,queryKey:B,queryHash:J,options:$.defaultQueryOptions(Z),state:H,defaultOptions:$.getQueryDefaults(B)}),this.add(Q);return Q}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let Z=this.#$.get($.queryHash);if(Z){if($.destroy(),Z===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){l1.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((H)=>$Q(Z,H))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((H)=>$Q($,H)):Z}notify($){l1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){l1.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){l1.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var oY=class{#$;#Z;#H;#J;#B;#Q;#X;#z;constructor($={}){this.#$=$.queryCache||new wq,this.#Z=$.mutationCache||new Cq,this.#H=$.defaultOptions||{},this.#J=new Map,this.#B=new Map,this.#Q=0}mount(){if(this.#Q++,this.#Q!==1)return;this.#X=g7.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#z=u7.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#Q--,this.#Q!==0)return;this.#X?.(),this.#X=void 0,this.#z?.(),this.#z=void 0}isFetching($){return this.#$.findAll({...$,fetchStatus:"fetching"}).length}isMutating($){return this.#Z.findAll({...$,status:"pending"}).length}getQueryData($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state.data}ensureQueryData($){let Z=this.defaultQueryOptions($),H=this.#$.build(this,Z),B=H.state.data;if(B===void 0)return this.fetchQuery($);if($.revalidateIfStale&&H.isStaleByTime(F8(Z.staleTime,H)))this.prefetchQuery(Z);return Promise.resolve(B)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:H})=>{let B=H.data;return[Z,B]})}setQueryData($,Z,H){let B=this.defaultQueryOptions({queryKey:$}),Q=this.#$.get(B.queryHash)?.state.data,X=Wq(Z,Q);if(X===void 0)return;return this.#$.build(this,B).setData(X,{...H,manual:!0})}setQueriesData($,Z,H){return l1.batch(()=>this.#$.findAll($).map(({queryKey:B})=>[B,this.setQueryData(B,Z,H)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;l1.batch(()=>{Z.findAll($).forEach((H)=>{Z.remove(H)})})}resetQueries($,Z){let H=this.#$;return l1.batch(()=>{return H.findAll($).forEach((B)=>{B.reset()}),this.refetchQueries({type:"active",...$},Z)})}cancelQueries($,Z={}){let H={revert:!0,...Z},B=l1.batch(()=>this.#$.findAll($).map((J)=>J.cancel(H)));return Promise.all(B).then(b5).catch(b5)}invalidateQueries($,Z={}){return l1.batch(()=>{if(this.#$.findAll($).forEach((H)=>{H.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let H={...Z,cancelRefetch:Z.cancelRefetch??!0},B=l1.batch(()=>this.#$.findAll($).filter((J)=>!J.isDisabled()&&!J.isStatic()).map((J)=>{let Q=J.fetch(void 0,H);if(!H.throwOnError)Q=Q.catch(b5);return J.state.fetchStatus==="paused"?Promise.resolve():Q}));return Promise.all(B).then(b5)}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let H=this.#$.build(this,Z);return H.isStaleByTime(F8(Z.staleTime,H))?H.fetch(Z):Promise.resolve(H.state.data)}prefetchQuery($){return this.fetchQuery($).then(b5).catch(b5)}fetchInfiniteQuery($){return $.behavior=rY($.pages),this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(b5).catch(b5)}ensureInfiniteQueryData($){return $.behavior=rY($.pages),this.ensureQueryData($)}resumePausedMutations(){if(u7.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#H}setDefaultOptions($){this.#H=$}setQueryDefaults($,Z){this.#J.set(x8($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#J.values()],H={};return Z.forEach((B)=>{if(L6($,B.queryKey))Object.assign(H,B.defaultOptions)}),H}setMutationDefaults($,Z){this.#B.set(x8($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#B.values()],H={};return Z.forEach((B)=>{if(L6($,B.mutationKey))Object.assign(H,B.defaultOptions)}),H}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#H.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=XH(Z.queryKey,Z);if(Z.refetchOnReconnect===void 0)Z.refetchOnReconnect=Z.networkMode!=="always";if(Z.throwOnError===void 0)Z.throwOnError=!!Z.suspense;if(!Z.networkMode&&Z.persister)Z.networkMode="offlineFirst";if(Z.queryFn===m7)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#H.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var s9=O(g(),1);var c7=O(g(),1),Eq=O(d(),1),sY=c7.createContext(void 0),Z1=($)=>{let Z=c7.useContext(sY);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},tY=({client:$,children:Z})=>{return c7.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),Eq.jsx(sY.Provider,{value:$,children:Z})};var UH=O(g(),1),dc=O(d(),1);function lc(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var ic=UH.createContext(lc()),Sq=()=>UH.useContext(ic);var Iq=O(g(),1);var Rq=($,Z,H)=>{let B=H?.state.error&&typeof $.throwOnError==="function"?p7($.throwOnError,[H.state.error,H]):$.throwOnError;if($.suspense||$.experimental_prefetchInRender||B){if(!Z.isReset())$.retryOnMount=!1}},kq=($)=>{Iq.useEffect(()=>{$.clearReset()},[$])},bq=({result:$,errorResetBoundary:Z,throwOnError:H,query:B,suspense:J})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&B&&(J&&$.data===void 0||p7(H,[$.error,B]))};var zQ=O(g(),1),yq=zQ.createContext(!1),hq=()=>zQ.useContext(yq),tX0=yq.Provider;var xq=($)=>{if($.suspense){let H=(J)=>J==="static"?J:Math.max(J??1000,1000),B=$.staleTime;if($.staleTime=typeof B==="function"?(...J)=>H(B(...J)):H(B),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},vq=($,Z)=>$.isLoading&&$.isFetching&&!Z,gq=($,Z)=>$?.suspense&&Z.isPending,eY=($,Z,H)=>Z.fetchOptimistic($).catch(()=>{H.clearReset()});function fq($,Z,H){let B=hq(),J=Sq(),Q=Z1(H),X=Q.defaultQueryOptions($);Q.getDefaultOptions().queries?._experimental_beforeQuery?.(X);let z=Q.getQueryCache().get(X.queryHash);X._optimisticResults=B?"isRestoring":"optimistic",xq(X),Rq(X,J,z),kq(J);let G=!Q.getQueryCache().get(X.queryHash),[F]=s9.useState(()=>new Z(Q,X)),U=F.getOptimisticResult(X),Y=!B&&$.subscribed!==!1;if(s9.useSyncExternalStore(s9.useCallback((K)=>{let W=Y?F.subscribe(l1.batchCalls(K)):b5;return F.updateResult(),W},[F,Y]),()=>F.getCurrentResult(),()=>F.getCurrentResult()),s9.useEffect(()=>{F.setOptions(X)},[X,F]),gq(X,U))throw eY(X,F,J);if(bq({result:U,errorResetBoundary:J,throwOnError:X.throwOnError,query:z,suspense:X.suspense}))throw U.error;if(Q.getDefaultOptions().queries?._experimental_afterQuery?.(X,U),X.experimental_prefetchInRender&&!v8.isServer()&&vq(U,B))(G?eY(X,F,J):z?.promise)?.catch(b5).finally(()=>{F.updateResult()});return!X.notifyOnChangeProps?F.trackResult(U):U}function o1($,Z){return fq($,lY,Z)}var R9=O(g(),1);function $K($,Z){let H=Z1(Z);return pq({filters:{...$,status:"pending"}},H).length}function mq($,Z){return $.findAll(Z.filters).map((H)=>Z.select?Z.select(H):H.state)}function pq($={},Z){let H=Z1(Z).getMutationCache(),B=R9.useRef($),J=R9.useRef(null);if(J.current===null)J.current=mq(H,$);return R9.useEffect(()=>{B.current=$}),R9.useSyncExternalStore(R9.useCallback((Q)=>H.subscribe(()=>{let X=zH(J.current,mq(H,B.current));if(J.current!==X)J.current=X,l1.schedule(Q)}),[H]),()=>J.current,()=>J.current)}var k9=O(g(),1);function s1($,Z){let H=Z1(Z),[B]=k9.useState(()=>new nY(H,$));k9.useEffect(()=>{B.setOptions($)},[B,$]);let J=k9.useSyncExternalStore(k9.useCallback((X)=>B.subscribe(l1.batchCalls(X)),[B]),()=>B.getCurrentResult(),()=>B.getCurrentResult()),Q=k9.useCallback((X,z)=>{B.mutate(X,z).catch(b5)},[B]);if(J.error&&p7(B.options.throwOnError,[J.error]))throw J.error;return{...J,mutate:Q,mutateAsync:J.mutate}}var Ic=O(WQ0(),1);function uq($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var H,B,J,Q,X=[],z="",G=$.split("/");G[0]||G.shift();while(J=G.shift())if(H=J[0],H==="*")X.push(H),z+=J[1]==="?"?"(?:/(.*))?":"/(.*)";else if(H===":"){if(B=J.indexOf("?",1),Q=J.indexOf(".",1),X.push(J.substring(1,~B?B:~Q?Q:J.length)),z+=!!~B&&!~Q?"(?:/([^/]+?))?":"/([^/]+?)",~Q)z+=(~B?"?":"")+"\\"+J.substring(Q)}else z+="/"+J;return{keys:X,pattern:new RegExp("^"+z+(Z?"(?=$|/)":"/?$"),"i")}}var A6=O(g(),1),w1=O(g(),1);var FQ=O(GQ(),1);var Jd=A6.useInsertionEffect,Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",HK=Qd?A6.useLayoutEffect:A6.useEffect,Xd=Jd||HK,UQ=($)=>{let Z=A6.useRef([$,(...H)=>Z[0](...H)]).current;return Xd(()=>{Z[0]=$}),Z[1]};var zd="popstate",BK="pushState",JK="replaceState",Gd="hashchange",cq=[zd,BK,JK,Gd],Fd=($)=>{for(let Z of cq)addEventListener(Z,$);return()=>{for(let Z of cq)removeEventListener(Z,$)}},QK=($,Z)=>FQ.useSyncExternalStore(Fd,$,Z),dq=()=>location.search,rq=({ssrSearch:$}={})=>QK(dq,$!=null?()=>$:dq),lq=()=>location.pathname,Ud=({ssrPath:$}={})=>QK(lq,$!=null?()=>$:lq),Yd=()=>history.state,aq=()=>QK(Yd,()=>null),Kd=($,{replace:Z=!1,state:H=null}={})=>history[Z?JK:BK](H,"",$),nq=($={})=>[Ud($),Kd],iq=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[iq]>"u"){for(let $ of[BK,JK]){let Z=history[$];history[$]=function(){let H=Z.apply(this,arguments),B=new Event($);return B.arguments=arguments,dispatchEvent(B),H}}Object.defineProperty(window,iq,{value:!0})}var Wd=($,Z)=>!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z,sq=($="")=>$==="/"?"":$,tq=($,Z)=>$[0]==="~"?$.slice(1):sq(Z)+$,eq=($="",Z)=>Wd(oq(sq($)),oq(Z));var oq=($)=>{try{return decodeURI($)}catch(Z){return $}};var ZM={hook:nq,searchHook:rq,parser:uq,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,H)=>$(Z,H)},HM=w1.createContext(ZM),d7=()=>w1.useContext(HM),BM={},JM=w1.createContext(BM),XK=()=>w1.useContext(JM),YH=($)=>{let[Z,H]=$.hook($);return[eq($.base,Z),UQ((B,J)=>$.aroundNav(H,tq(B,$.base),J))]},u4=()=>YH(d7());var QM=($,Z,H,B)=>{let{pattern:J,keys:Q}=Z instanceof RegExp?{keys:!1,pattern:Z}:$(Z||"*",B),X=J.exec(H)||[],[z,...G]=X;return z!==void 0?[!0,(()=>{let F=Q!==!1?Object.fromEntries(Q.map((Y,K)=>[Y,G[K]])):X.groups,U={...G};return F&&Object.assign(U,F),U})(),...B?[z]:[]]:[!1,null]};var zK=({children:$,...Z})=>{let H=d7(),B=Z.hook?ZM:H,J=B,[Q,X=Z.ssrSearch??""]=Z.ssrPath?.split("?")??[];if(Q)Z.ssrSearch=X,Z.ssrPath=Q;Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let z=w1.useRef({}),G=z.current,F=G;for(let U in B){let Y=U==="base"?B[U]+(Z[U]??""):Z[U]??B[U];if(G===F&&Y!==F[U])z.current=F={...F};if(F[U]=Y,Y!==B[U]||Y!==J[U])J=F}return w1.createElement(HM.Provider,{value:J,children:$})},$M=({children:$,component:Z},H)=>{if(Z)return w1.createElement(Z,{params:H});return typeof $==="function"?$(H):$},Nd=($)=>{let Z=w1.useRef(BM),H=Z.current;return Z.current=Object.keys($).length!==Object.keys(H).length||Object.entries($).some(([B,J])=>J!==H[B])?$:H};var YQ=({path:$,nest:Z,match:H,...B})=>{let J=d7(),[Q]=YH(J),[X,z,G]=H??QM(J.parser,$,Q,Z),F=Nd({...XK(),...z});if(!X)return null;let U=G?w1.createElement(zK,{base:G},$M(B,F)):$M(B,F);return w1.createElement(JM.Provider,{value:F,children:U})},V6=w1.forwardRef(($,Z)=>{let H=d7(),[B,J]=YH(H),{to:Q="",href:X=Q,onClick:z,asChild:G,children:F,className:U,replace:Y,state:K,transition:W,...N}=$,L=UQ((A)=>{if(A.ctrlKey||A.metaKey||A.altKey||A.shiftKey||A.button!==0)return;if(z?.(A),!A.defaultPrevented)A.preventDefault(),J(X,$)}),V=H.hrefs(X[0]==="~"?X.slice(1):H.base+X,H);return G&&w1.isValidElement(F)?w1.cloneElement(F,{onClick:L,href:V}):w1.createElement("a",{...N,onClick:L,href:V,className:U?.call?U(B===X):U,children:F,ref:Z})}),XM=($)=>Array.isArray($)?$.flatMap((Z)=>XM(Z&&Z.type===w1.Fragment?Z.props.children:Z)):[$],zM=({children:$,location:Z})=>{let H=d7(),[B]=YH(H);for(let J of XM($)){let Q=0;if(w1.isValidElement(J)&&(Q=QM(H.parser,J.props.path,Z||B,J.props.nest))[0])return w1.cloneElement(J,{match:Q})}return null},GM=($)=>{let{to:Z,href:H=Z}=$,B=d7(),[,J]=YH(B),Q=UQ(()=>J(Z||H,$)),{ssrContext:X}=B;if(HK(()=>{Q()},[]),X)X.redirectTo=Z;return null};var y2={};j4(y2,{useToastManager:()=>H_,createToastManager:()=>B_,Viewport:()=>tM,Title:()=>KP,Root:()=>JP,Provider:()=>rM,Positioner:()=>eP,Portal:()=>fP,Description:()=>UP,Content:()=>QP,Close:()=>WP,Arrow:()=>Z_,Action:()=>LP});var lM=O(g(),1);var FM=O(g(),1),Ld=[];function S2($){FM.useEffect($,Ld)}var KQ=O(g(),1),KH=KQ.createContext(void 0);function t9(){let $=KQ.useContext(KH);if(!$)throw Error(E0(73));return $}var NQ=Symbol("NOT_FOUND");function Ad($,Z=`expected a function, instead received ${typeof $}`){if(typeof $!=="function")throw TypeError(Z)}function Vd($,Z=`expected an object, instead received ${typeof $}`){if(typeof $!=="object")throw TypeError(Z)}function Dd($,Z="expected all items to be functions, instead received the following types: "){if(!$.every((H)=>typeof H==="function")){let H=$.map((B)=>typeof B==="function"?`function ${B.name||"unnamed"}()`:typeof B).join(", ");throw TypeError(`${Z}[${H}]`)}}var UM=($)=>{return Array.isArray($)?$:[$]};function qd($){let Z=Array.isArray($[0])?$[0]:$;return Dd(Z,"createSelector expects all input-selectors to be functions, but received the following types: "),Z}function Md($,Z){let H=[],{length:B}=$;for(let J=0;J<B;J++)H.push($[J].apply(null,Z));return H}var YM=0,Pd=null,WM=class{revision=YM;_value;_lastValue;_isEqual=GK;constructor($,Z=GK){this._value=this._lastValue=$,this._isEqual=Z}get value(){return Pd?.add(this),this._value}set value($){if(this.value===$)return;this._value=$,this.revision=++YM}};function GK($,Z){return $===Z}function FK($){if(!($ instanceof WM))console.warn("Not a valid cell! ",$);return $.value}function _d($,Z=GK){return new WM($,Z)}var Od=($,Z)=>!1;function LQ(){return _d(null,Od)}var NM=($)=>{let Z=$.collectionTag;if(Z===null)Z=$.collectionTag=LQ();FK(Z)};var VG0=Symbol(),LM=0,jd=Object.getPrototypeOf({}),Td=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy(this,WH);tag=LQ();tags={};children={};collectionTag=null;id=LM++},WH={get($,Z){function H(){let{value:J}=$,Q=Reflect.get(J,Z);if(typeof Z==="symbol")return Q;if(Z in jd)return Q;if(typeof Q==="object"&&Q!==null){let X=$.children[Z];if(X===void 0)X=$.children[Z]=Ed(Q);if(X.tag)FK(X.tag);return X.proxy}else{let X=$.tags[Z];if(X===void 0)X=$.tags[Z]=LQ(),X.value=Q;return FK(X),Q}}return H()},ownKeys($){return NM($),Reflect.ownKeys($.value)},getOwnPropertyDescriptor($,Z){return Reflect.getOwnPropertyDescriptor($.value,Z)},has($,Z){return Reflect.has($.value,Z)}},Cd=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy([this],wd);tag=LQ();tags={};children={};collectionTag=null;id=LM++},wd={get([$],Z){if(Z==="length")NM($);return WH.get($,Z)},ownKeys([$]){return WH.ownKeys($)},getOwnPropertyDescriptor([$],Z){return WH.getOwnPropertyDescriptor($,Z)},has([$],Z){return WH.has($,Z)}};function Ed($){if(Array.isArray($))return new Cd($);return new Td($)}function Sd($){let Z;return{get(H){if(Z&&$(Z.key,H))return Z.value;return NQ},put(H,B){Z={key:H,value:B}},getEntries(){return Z?[Z]:[]},clear(){Z=void 0}}}function Id($,Z){let H=[];function B(z){let G=H.findIndex((F)=>Z(z,F.key));if(G>-1){let F=H[G];if(G>0)H.splice(G,1),H.unshift(F);return F.value}return NQ}function J(z,G){if(B(z)===NQ){if(H.unshift({key:z,value:G}),H.length>$)H.pop()}}function Q(){return H}function X(){H=[]}return{get:B,put:J,getEntries:Q,clear:X}}var Rd=($,Z)=>$===Z;function kd($){return function(H,B){if(H===null||B===null||H.length!==B.length)return!1;let{length:J}=H;for(let Q=0;Q<J;Q++)if(!$(H[Q],B[Q]))return!1;return!0}}function AM($,Z){let H=typeof Z==="object"?Z:{equalityCheck:Z},{equalityCheck:B=Rd,maxSize:J=1,resultEqualityCheck:Q}=H,X=kd(B),z=0,G=J<=1?Sd(X):Id(J,X);function F(){let U=G.get(arguments);if(U===NQ){if(U=$.apply(null,arguments),z++,Q){let K=G.getEntries().find((W)=>Q(W.value,U));if(K)U=K.value,z!==0&&z--}G.put(arguments,U)}return U}return F.clearCache=()=>{G.clear(),F.resetResultsCount()},F.resultsCount=()=>z,F.resetResultsCount=()=>{z=0},F}var bd=class{constructor($){this.value=$}deref(){return this.value}},yd=typeof WeakRef<"u"?WeakRef:bd,hd=0,KM=1;function WQ(){return{s:hd,v:void 0,o:null,p:null}}function VM($,Z={}){let H=WQ(),{resultEqualityCheck:B}=Z,J,Q=0;function X(){let z=H,{length:G}=arguments;for(let Y=0,K=G;Y<K;Y++){let W=arguments[Y];if(typeof W==="function"||typeof W==="object"&&W!==null){let N=z.o;if(N===null)z.o=N=new WeakMap;let L=N.get(W);if(L===void 0)z=WQ(),N.set(W,z);else z=L}else{let N=z.p;if(N===null)z.p=N=new Map;let L=N.get(W);if(L===void 0)z=WQ(),N.set(W,z);else z=L}}let F=z,U;if(z.s===KM)U=z.v;else if(U=$.apply(null,arguments),Q++,B){let Y=J?.deref?.()??J;if(Y!=null&&B(Y,U))U=Y,Q!==0&&Q--;J=typeof U==="object"&&U!==null||typeof U==="function"?new yd(U):U}return F.s=KM,F.v=U,U}return X.clearCache=()=>{H=WQ(),X.resetResultsCount()},X.resultsCount=()=>Q,X.resetResultsCount=()=>{Q=0},X}function UK($,...Z){let H=typeof $==="function"?{memoize:$,memoizeOptions:Z}:$,B=(...J)=>{let Q=0,X=0,z,G={},F=J.pop();if(typeof F==="object")G=F,F=J.pop();Ad(F,`createSelector expects an output function after the inputs, but received: [${typeof F}]`);let U={...H,...G},{memoize:Y,memoizeOptions:K=[],argsMemoize:W=VM,argsMemoizeOptions:N=[],devModeChecks:L={}}=U,V=UM(K),A=UM(N),D=qd(J),q=Y(function(){return Q++,F.apply(null,arguments)},...V),_=!0,M=W(function(){X++;let C=Md(D,arguments);return z=q.apply(null,C),z},...A);return Object.assign(M,{resultFunc:F,memoizedResultFunc:q,dependencies:D,dependencyRecomputations:()=>X,resetDependencyRecomputations:()=>{X=0},lastResult:()=>z,recomputations:()=>Q,resetRecomputations:()=>{Q=0},memoize:Y,argsMemoize:W})};return Object.assign(B,{withTypes:()=>B}),B}var xd=UK(VM),vd=Object.assign(($,Z=xd)=>{Vd($,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof $}`);let H=Object.keys($),B=H.map((Q)=>$[Q]);return Z(B,(...Q)=>{return Q.reduce((X,z,G)=>{return X[H[G]]=z,X},{})})},{withTypes:()=>vd});var gd=UK({memoize:AM,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),S0=($,Z,H,B,J,Q,...X)=>{if(X.length>0)throw Error(E0(1));let z;if($&&Z&&H&&B&&J&&Q)z=(G,F,U,Y)=>{let K=$(G,F,U,Y),W=Z(G,F,U,Y),N=H(G,F,U,Y),L=B(G,F,U,Y),V=J(G,F,U,Y);return Q(K,W,N,L,V,F,U,Y)};else if($&&Z&&H&&B&&J)z=(G,F,U,Y)=>{let K=$(G,F,U,Y),W=Z(G,F,U,Y),N=H(G,F,U,Y),L=B(G,F,U,Y);return J(K,W,N,L,F,U,Y)};else if($&&Z&&H&&B)z=(G,F,U,Y)=>{let K=$(G,F,U,Y),W=Z(G,F,U,Y),N=H(G,F,U,Y);return B(K,W,N,F,U,Y)};else if($&&Z&&H)z=(G,F,U,Y)=>{let K=$(G,F,U,Y),W=Z(G,F,U,Y);return H(K,W,F,U,Y)};else if($&&Z)z=(G,F,U,Y)=>{let K=$(G,F,U,Y);return Z(K,F,U,Y)};else if($)z=$;else throw Error("Missing arguments");return z},DM=(...$)=>{let Z=new WeakMap,H=1,B=$[$.length-1],J=$.length-1||1,Q=B.length-J;if(Q>3)throw Error(E0(2));return(z,G,F,U)=>{let Y=z.__cacheKey__;if(!Y)Y={id:H},z.__cacheKey__=Y,H+=1;let K=Z.get(Y);if(!K){let W=$,N=[void 0,void 0,void 0];switch(Q){case 0:break;case 1:{W=[...$.slice(0,-1),()=>N[0],B];break}case 2:{W=[...$.slice(0,-1),()=>N[0],()=>N[1],B];break}case 3:{W=[...$.slice(0,-1),()=>N[0],()=>N[1],()=>N[2],B];break}default:throw Error(E0(2))}K=gd(...W),K.selectorArgs=N,Z.set(Y,K)}switch(K.selectorArgs[0]=G,K.selectorArgs[1]=F,K.selectorArgs[2]=U,Q){case 0:return K(z);case 1:return K(z,G);case 2:return K(z,G,F);case 3:return K(z,G,F,U);default:throw Error("unreachable")}}};var _M=O(g(),1),NK=O(GQ(),1);var e9=O(g(),1),fd=GQ();function md($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var pd=typeof Object.is==="function"?Object.is:md,ud=fd.useSyncExternalStore,cd=e9.useRef,dd=e9.useEffect,ld=e9.useMemo,id=e9.useDebugValue;var YK=function($,Z,H,B,J){var Q=cd(null);if(Q.current===null){var X={hasValue:!1,value:null};Q.current=X}else X=Q.current;Q=ld(function(){function G(W){if(!F){if(F=!0,U=W,W=B(W),J!==void 0&&X.hasValue){var N=X.value;if(J(N,W))return Y=N}return Y=W}if(N=Y,pd(U,W))return N;var L=B(W);if(J!==void 0&&J(N,L))return U=W,N;return U=W,Y=L}var F=!1,U,Y,K=H===void 0?null:H;return[function(){return G(Z())},K===null?void 0:function(){return G(K())}]},[Z,H,B,J]);var z=ud($,Q[0],Q[1]);return dd(function(){X.hasValue=!0,X.value=z},[z]),id(z),z};var qM=O(g(),1);var KK=[],WK=void 0;function MM(){return WK}function PM($){KK.push($)}function NH($){let Z=(H,B)=>{let J=k1(rd).current,Q;try{WK=J;for(let X of KK)X.before(J);Q=$(H,B);for(let X of KK)X.after(J);J.didInitialize=!0}finally{WK=void 0}return Q};return Z.displayName=$.displayName||$.name,Z}function AQ($){return qM.forwardRef(NH($))}function rd(){return{didInitialize:!1}}var ad=VQ(19),nd=ad?sd:td;function DQ($,Z,H,B,J){return nd($,Z,H,B,J)}function od($,Z,H,B,J){let Q=_M.useCallback(()=>Z($.getSnapshot(),H,B,J),[$,Z,H,B,J]);return NK.useSyncExternalStore($.subscribe,Q,Q)}PM({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let H=0;H<$.syncHooks.length;H+=1){let B=$.syncHooks[H],J=B.selector(B.store.state,B.a1,B.a2,B.a3);if(B.didChange||!Object.is(B.value,J))Z=!0,B.value=J,B.didChange=!1}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let H=new Set;for(let J of $.syncHooks)H.add(J.store);let B=[];for(let J of H)B.push(J.subscribe(Z));return()=>{for(let J of B)J()}};NK.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function sd($,Z,H,B,J){let Q=MM();if(!Q)return od($,Z,H,B,J);let X=Q.syncIndex;Q.syncIndex+=1;let z;if(!Q.didInitialize)z={store:$,selector:Z,a1:H,a2:B,a3:J,value:Z($.getSnapshot(),H,B,J),didChange:!1},Q.syncHooks.push(z);else if(z=Q.syncHooks[X],z.store!==$||z.selector!==Z||!Object.is(z.a1,H)||!Object.is(z.a2,B)||!Object.is(z.a3,J)){if(z.store!==$)Q.didChangeStore=!0;z.store=$,z.selector=Z,z.a1=H,z.a2=B,z.a3=J,z.didChange=!0}return z.value}function td($,Z,H,B,J){return YK($.subscribe,$.getSnapshot,$.getSnapshot,(Q)=>Z(Q,H,B,J))}class LK{constructor($){this.state=$,this.listeners=new Set,this.updateTick=0}subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};getSnapshot=()=>{return this.state};setState($){if(this.state===$)return;this.state=$,this.updateTick+=1;let Z=this.updateTick;for(let H of this.listeners){if(Z!==this.updateTick)return;H($)}}update($){for(let Z in $)if(!Object.is(this.state[Z],$[Z])){this.setState({...this.state,...$});return}}set($,Z){if(!Object.is(this.state[$],Z))this.setState({...this.state,[$]:Z})}notifyAll(){let $={...this.state};this.setState($)}use($,Z,H,B){return DQ(this,$,Z,H,B)}}var D6=O(g(),1);class n2 extends LK{constructor($,Z={},H){super($);this.context=Z,this.selectors=H}useSyncedValue($,Z){D6.useDebugValue($),U0(()=>{if(this.state[$]!==Z)this.set($,Z)},[$,Z])}useSyncedValueWithCleanup($,Z){let H=this;U0(()=>{if(H.state[$]!==Z)H.set($,Z);return()=>{H.set($,void 0)}},[H,$,Z])}useSyncedValues($){let Z=this,H=Object.values($);U0(()=>{Z.update($)},[Z,...H])}useControlledProp($,Z){D6.useDebugValue($);let H=Z!==void 0;U0(()=>{if(H&&!Object.is(this.state[$],Z))super.setState({...this.state,[$]:Z})},[$,Z,H])}select($,Z,H,B){let J=this.selectors[$];return J(this.state,Z,H,B)}useState($,Z,H,B){return D6.useDebugValue($),DQ(this,this.selectors[$],Z,H,B)}useContextCallback($,Z){D6.useDebugValue($);let H=Y0(Z??a1);this.context[$]=H}useStateSetter($){let Z=D6.useRef(void 0);if(Z.current===void 0)Z.current=(H)=>{this.set($,H)};return Z.current}observe($,Z){let H;if(typeof $==="function")H=$;else H=this.selectors[$];let B=H(this.state);return Z(B,B,this),this.subscribe((J)=>{let Q=H(J);if(!Object.is(B,Q)){let X=B;B=Q,Z(Q,X,this)}})}}var qQ=null,cG0=globalThis.requestAnimationFrame;class OM{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,H=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,H>0)for(let B=0;B<Z.length;B+=1)Z[B]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let H=!1;if(!this.isScheduled||H)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var MQ=new OM;class N5{static create(){return new N5}static request($){return MQ.request($)}static cancel($){return MQ.cancel($)}currentId=qQ;request($){this.cancel(),this.currentId=MQ.request(()=>{this.currentId=qQ,$()})}cancel=()=>{if(this.currentId!==qQ)MQ.cancel(this.currentId),this.currentId=qQ};disposeEffect=()=>{return this.cancel}}function U4(){let $=k1(N5.create).current;return S2($.disposeEffect),$}var LH=0;class r5{static create(){return new r5}currentId=LH;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=LH,Z()},$)}isStarted(){return this.currentId!==LH}clear=()=>{if(this.currentId!==LH)clearTimeout(this.currentId),this.currentId=LH};disposeEffect=()=>{return this.clear}}function _5(){let $=k1(r5.create).current;return S2($.disposeEffect),$}var jM=0;function PQ($){return jM+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${jM}`}function m0($){return $?.ownerDocument||document}function _Q($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let H=$(Z);return typeof H==="string"?{description:H}:H}return $}var $3=typeof navigator<"u",AK=ed(),TM=Zl(),OQ=$l(),jQ=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),TQ=AK.platform==="MacIntel"&&AK.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(AK.platform),tG0=$3&&/firefox/i.test(OQ),CQ=$3&&/apple/i.test(navigator.vendor),eG0=$3&&/Edg/i.test(OQ),wQ=$3&&/android/i.test(TM)||/android/i.test(OQ),CM=$3&&TM.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,EQ=OQ.includes("jsdom/");function ed(){if(!$3)return{platform:"",maxTouchPoints:-1};let $=navigator.userAgentData;if($?.platform)return{platform:$.platform,maxTouchPoints:navigator.maxTouchPoints};return{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function $l(){if(!$3)return"";let $=navigator.userAgentData;if($&&Array.isArray($.brands))return $.brands.map(({brand:Z,version:H})=>`${Z}/${H}`).join(" ");return navigator.userAgent}function Zl(){if(!$3)return"";let $=navigator.userAgentData;if($?.platform)return $.platform;return navigator.platform??""}var AH="data-base-ui-focusable",VK="active",DK="selected",l7="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",g8="ArrowLeft",f8="ArrowRight",VH="ArrowUp",q6="ArrowDown";function Z5($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function f0($,Z){if(!$||!Z)return!1;let H=Z.getRootNode?.();if($.contains(Z))return!0;if(H&&wM(H)){let B=Z;while(B){if($===B)return!0;B=B.parentNode||B.host}}return!1}function M6($,Z){if(!T1($))return!1;let H=$;if(Z.hasElement(H))return!H.hasAttribute("data-trigger-disabled");for(let[,B]of Z.entries())if(f0(B,H))return!B.hasAttribute("data-trigger-disabled");return!1}function g1($){if("composedPath"in $)return $.composedPath()[0];return $.target}function c4($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let H=$;return H.target!=null&&Z.contains(H.target)}function EM($){return $.matches("html,body")}function P6($){return O5($)&&$.matches(l7)}function DH($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&P6($)}function Z3($){if(!$||EQ)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function _6($){if(!$)return null;return $.hasAttribute(AH)?$:$.querySelector(`[${AH}]`)||$}function m8($,Z,H=!0){return $.filter((J)=>J.parentId===Z&&(!H||J.context?.open)).flatMap((J)=>[J,...m8($,J.id,H)])}function qK($,Z){let H=[],B=$.find((J)=>J.id===Z)?.parentId;while(B){let J=$.find((Q)=>Q.id===B);if(B=J?.parentId,J)H=H.concat(J)}return H}function a5($){$.preventDefault(),$.stopPropagation()}function SM($){return"nativeEvent"in $}function SQ($){if($.pointerType===""&&$.isTrusted)return!0;if(wQ&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function IQ($){if(EQ)return!1;return!wQ&&$.width===0&&$.height===0||wQ&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function d4($,Z){let H=["mouse","pen"];if(!Z)H.push("",void 0);return H.includes($)}function RQ($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}function kQ($,Z,H){return Math.floor($/Z)!==H}function i7($,Z){return Z<0||Z>=$.current.length}function bQ($,Z){return P2($,{disabledIndices:Z})}function PK($,Z){return P2($,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function P2($,{startingIndex:Z=-1,decrement:H=!1,disabledIndices:B,amount:J=1}={}){let Q=Z;do Q+=H?-J:J;while(Q>=0&&Q<=$.current.length-1&&r7($,Q,B));return Q}function IM($,{event:Z,orientation:H,loopFocus:B,rtl:J,cols:Q,disabledIndices:X,minIndex:z,maxIndex:G,prevIndex:F,stopEvent:U=!1}){let Y=F,K=[],W={},N=!1;{let A=null,D=-1;$.current.forEach((q,_)=>{if(q==null)return;let M=q.closest('[role="row"]');if(M)N=!0;if(M!==A||D===-1)A=M,D+=1,K[D]=[];K[D].push(_),W[_]=D})}let L=N&&K.length>0&&K.some((A)=>A.length!==Q);function V(A){if(!L||F===-1)return;let D=W[F];if(D==null)return;let q=K[D].indexOf(F),_=A==="up"?D-1:D+1;if(B){if(_<0)_=K.length-1;else if(_>=K.length)_=0}let M=new Set;while(_>=0&&_<K.length&&!M.has(_)){M.add(_);let P=K[_];if(P.length===0){_=A==="up"?_-1:_+1;continue}let C=Math.min(q,P.length-1);for(let R=C;R>=0;R-=1){let y=P[R];if(!r7($,y,X))return y}if(_=A==="up"?_-1:_+1,B){if(_<0)_=K.length-1;else if(_>=K.length)_=0}}return}if(Z.key===VH){let A=V("up");if(A!==void 0){if(U)a5(Z);Y=A}else{if(U)a5(Z);if(F===-1)Y=G;else if(Y=P2($,{startingIndex:Y,amount:Q,decrement:!0,disabledIndices:X}),B&&(F-Q<z||Y<0)){let D=F%Q,q=G%Q,_=G-(q-D);if(q===D)Y=G;else Y=q>D?_:_-Q}if(i7($,Y))Y=F}}if(Z.key===q6){let A=V("down");if(A!==void 0){if(U)a5(Z);Y=A}else{if(U)a5(Z);if(F===-1)Y=z;else if(Y=P2($,{startingIndex:F,amount:Q,disabledIndices:X}),B&&F+Q>G)Y=P2($,{startingIndex:F%Q-Q,amount:Q,disabledIndices:X});if(i7($,Y))Y=F}}if(H==="both"){let A=MK(F/Q);if(Z.key===(J?g8:f8)){if(U)a5(Z);if(F%Q!==Q-1){if(Y=P2($,{startingIndex:F,disabledIndices:X}),B&&kQ(Y,Q,A))Y=P2($,{startingIndex:F-F%Q-1,disabledIndices:X})}else if(B)Y=P2($,{startingIndex:F-F%Q-1,disabledIndices:X});if(kQ(Y,Q,A))Y=F}if(Z.key===(J?f8:g8)){if(U)a5(Z);if(F%Q!==0){if(Y=P2($,{startingIndex:F,decrement:!0,disabledIndices:X}),B&&kQ(Y,Q,A))Y=P2($,{startingIndex:F+(Q-F%Q),decrement:!0,disabledIndices:X})}else if(B)Y=P2($,{startingIndex:F+(Q-F%Q),decrement:!0,disabledIndices:X});if(kQ(Y,Q,A))Y=F}let D=MK(G/Q)===A;if(i7($,Y))if(B&&D)Y=Z.key===(J?f8:g8)?G:P2($,{startingIndex:F-F%Q-1,disabledIndices:X});else Y=F}return Y}function RM($,Z,H){let B=[],J=0;return $.forEach(({width:Q,height:X},z)=>{if(Q>Z);let G=!1;if(H)J=0;while(!G){let F=[];for(let U=0;U<Q;U+=1)for(let Y=0;Y<X;Y+=1)F.push(J+U+Y*Z);if(J%Z+Q<=Z&&F.every((U)=>B[U]==null))F.forEach((U)=>{B[U]=z}),G=!0;else J+=1}}),[...B]}function kM($,Z,H,B,J){if($===-1)return-1;let Q=H.indexOf($),X=Z[$];switch(J){case"tl":return Q;case"tr":if(!X)return Q;return Q+X.width-1;case"bl":if(!X)return Q;return Q+(X.height-1)*B;case"br":return H.lastIndexOf($);default:return-1}}function bM($,Z){return Z.flatMap((H,B)=>$.includes(H)?[B]:[])}function r7($,Z,H){if(typeof H==="function")return H(Z);if(H)return H.includes(Z);let B=$.current[Z];if(!B)return!1;return B.hasAttribute("disabled")||B.getAttribute("aria-disabled")==="true"}/*!
10
- * tabbable 6.4.0
11
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
12
- */var Hl=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],yQ=Hl.join(","),hM=typeof Element>"u",a7=hM?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,hQ=!hM&&Element.prototype.getRootNode?function($){var Z;return $===null||$===void 0?void 0:(Z=$.getRootNode)===null||Z===void 0?void 0:Z.call($)}:function($){return $===null||$===void 0?void 0:$.ownerDocument},xQ=function(Z,H){var B;if(H===void 0)H=!0;var J=Z===null||Z===void 0?void 0:(B=Z.getAttribute)===null||B===void 0?void 0:B.call(Z,"inert"),Q=J===""||J==="true",X=Q||H&&Z&&(typeof Z.closest==="function"?Z.closest("[inert]"):xQ(Z.parentNode));return X},Bl=function(Z){var H,B=Z===null||Z===void 0?void 0:(H=Z.getAttribute)===null||H===void 0?void 0:H.call(Z,"contenteditable");return B===""||B==="true"},xM=function(Z,H,B){if(xQ(Z))return[];var J=Array.prototype.slice.apply(Z.querySelectorAll(yQ));if(H&&a7.call(Z,yQ))J.unshift(Z);return J=J.filter(B),J},vQ=function(Z,H,B){var J=[],Q=Array.from(Z);while(Q.length){var X=Q.shift();if(xQ(X,!1))continue;if(X.tagName==="SLOT"){var z=X.assignedElements(),G=z.length?z:X.children,F=vQ(G,!0,B);if(B.flatten)J.push.apply(J,F);else J.push({scopeParent:X,candidates:F})}else{var U=a7.call(X,yQ);if(U&&B.filter(X)&&(H||!Z.includes(X)))J.push(X);var Y=X.shadowRoot||typeof B.getShadowRoot==="function"&&B.getShadowRoot(X),K=!xQ(Y,!1)&&(!B.shadowRootFilter||B.shadowRootFilter(X));if(Y&&K){var W=vQ(Y===!0?X.children:Y.children,!0,B);if(B.flatten)J.push.apply(J,W);else J.push({scopeParent:X,candidates:W})}else Q.unshift.apply(Q,X.children)}}return J},vM=function(Z){return!isNaN(parseInt(Z.getAttribute("tabindex"),10))},gM=function(Z){if(!Z)throw Error("No node provided");if(Z.tabIndex<0){if((/^(AUDIO|VIDEO|DETAILS)$/.test(Z.tagName)||Bl(Z))&&!vM(Z))return 0}return Z.tabIndex},Jl=function(Z,H){var B=gM(Z);if(B<0&&H&&!vM(Z))return 0;return B},Ql=function(Z,H){return Z.tabIndex===H.tabIndex?Z.documentOrder-H.documentOrder:Z.tabIndex-H.tabIndex},fM=function(Z){return Z.tagName==="INPUT"},Xl=function(Z){return fM(Z)&&Z.type==="hidden"},zl=function(Z){var H=Z.tagName==="DETAILS"&&Array.prototype.slice.apply(Z.children).some(function(B){return B.tagName==="SUMMARY"});return H},Gl=function(Z,H){for(var B=0;B<Z.length;B++)if(Z[B].checked&&Z[B].form===H)return Z[B]},Fl=function(Z){if(!Z.name)return!0;var H=Z.form||hQ(Z),B=function(z){return H.querySelectorAll('input[type="radio"][name="'+z+'"]')},J;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape==="function")J=B(window.CSS.escape(Z.name));else try{J=B(Z.name)}catch(X){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",X.message),!1}var Q=Gl(J,Z.form);return!Q||Q===Z},Ul=function(Z){return fM(Z)&&Z.type==="radio"},Yl=function(Z){return Ul(Z)&&!Fl(Z)},Kl=function(Z){var H,B=Z&&hQ(Z),J=(H=B)===null||H===void 0?void 0:H.host,Q=!1;if(B&&B!==Z){var X,z,G;Q=!!((X=J)!==null&&X!==void 0&&(z=X.ownerDocument)!==null&&z!==void 0&&z.contains(J)||Z!==null&&Z!==void 0&&(G=Z.ownerDocument)!==null&&G!==void 0&&G.contains(Z));while(!Q&&J){var F,U,Y;B=hQ(J),J=(F=B)===null||F===void 0?void 0:F.host,Q=!!((U=J)!==null&&U!==void 0&&(Y=U.ownerDocument)!==null&&Y!==void 0&&Y.contains(J))}}return Q},yM=function(Z){var H=Z.getBoundingClientRect(),B=H.width,J=H.height;return B===0&&J===0},Wl=function(Z,H){var{displayCheck:B,getShadowRoot:J}=H;if(B==="full-native"){if("checkVisibility"in Z){var Q=Z.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!Q}}if(getComputedStyle(Z).visibility==="hidden")return!0;var X=a7.call(Z,"details>summary:first-of-type"),z=X?Z.parentElement:Z;if(a7.call(z,"details:not([open]) *"))return!0;if(!B||B==="full"||B==="full-native"||B==="legacy-full"){if(typeof J==="function"){var G=Z;while(Z){var F=Z.parentElement,U=hQ(Z);if(F&&!F.shadowRoot&&J(F)===!0)return yM(Z);else if(Z.assignedSlot)Z=Z.assignedSlot;else if(!F&&U!==Z.ownerDocument)Z=U.host;else Z=F}Z=G}if(Kl(Z))return!Z.getClientRects().length;if(B!=="legacy-full")return!0}else if(B==="non-zero-area")return yM(Z);return!1},Nl=function(Z){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(Z.tagName)){var H=Z.parentElement;while(H){if(H.tagName==="FIELDSET"&&H.disabled){for(var B=0;B<H.children.length;B++){var J=H.children.item(B);if(J.tagName==="LEGEND")return a7.call(H,"fieldset[disabled] *")?!0:!J.contains(Z)}return!0}H=H.parentElement}}return!1},_K=function(Z,H){if(H.disabled||Xl(H)||Wl(H,Z)||zl(H)||Nl(H))return!1;return!0},OK=function(Z,H){if(Yl(H)||gM(H)<0||!_K(Z,H))return!1;return!0},Ll=function(Z){var H=parseInt(Z.getAttribute("tabindex"),10);if(isNaN(H)||H>=0)return!0;return!1},mM=function(Z){var H=[],B=[];return Z.forEach(function(J,Q){var X=!!J.scopeParent,z=X?J.scopeParent:J,G=Jl(z,X),F=X?mM(J.candidates):z;if(G===0)X?H.push.apply(H,F):H.push(z);else B.push({documentOrder:Q,tabIndex:G,item:J,isScope:X,content:F})}),B.sort(Ql).reduce(function(J,Q){return Q.isScope?J.push.apply(J,Q.content):J.push(Q.content),J},[]).concat(H)},O6=function(Z,H){H=H||{};var B;if(H.getShadowRoot)B=vQ([Z],H.includeContainer,{filter:OK.bind(null,H),flatten:!1,getShadowRoot:H.getShadowRoot,shadowRootFilter:Ll});else B=xM(Z,H.includeContainer,OK.bind(null,H));return mM(B)},pM=function(Z,H){H=H||{};var B;if(H.getShadowRoot)B=vQ([Z],H.includeContainer,{filter:_K.bind(null,H),flatten:!0,getShadowRoot:H.getShadowRoot});else B=xM(Z,H.includeContainer,_K.bind(null,H));return B},jK=function(Z,H){if(H=H||{},!Z)throw Error("No node provided");if(a7.call(Z,yQ)===!1)return!1;return OK(H,Z)};var j6=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function uM($,Z){let H=O6($,j6()),B=H.length;if(B===0)return;let J=Z5(m0($)),Q=H.indexOf(J),X=Q===-1?Z===1?0:B-1:Q+Z;return H[X]}function H3($){return uM(m0($).body,1)||$}function gQ($){return uM(m0($).body,-1)||$}function cM($,Z){if(!$)return null;let H=O6(m0($).body,j6()),B=H.length;if(B===0)return null;let J=H.indexOf($);if(J===-1)return null;let Q=(J+Z+B)%B;return H[Q]}function fQ($){return cM($,1)}function mQ($){return cM($,-1)}function Y8($,Z){let H=Z||$.currentTarget,B=$.relatedTarget;return!B||!f0(H,B)}function dM($){O6($,j6()).forEach((H)=>{H.dataset.tabindex=H.getAttribute("tabindex")||"",H.setAttribute("tabindex","-1")})}function TK($){$.querySelectorAll("[data-tabindex]").forEach((H)=>{let B=H.dataset.tabindex;if(delete H.dataset.tabindex,B)H.setAttribute("tabindex",B);else H.removeAttribute("tabindex")})}var pQ=DM(($)=>$.toasts,($)=>{let Z=new Map,H=0,B=0;return $.forEach((J,Q)=>{let X=J.transitionStatus==="ending";if(Z.set(J.id,{value:J,domIndex:Q,visibleIndex:X?-1:H,offsetY:B}),B+=J.height||0,!X)H+=1}),Z}),b9={toasts:S0(($)=>$.toasts),isEmpty:S0(($)=>$.toasts.length===0),toast:S0(pQ,($,Z)=>$.get(Z)?.value),toastIndex:S0(pQ,($,Z)=>$.get(Z)?.domIndex??-1),toastOffsetY:S0(pQ,($,Z)=>$.get(Z)?.offsetY??0),toastVisibleIndex:S0(pQ,($,Z)=>$.get(Z)?.visibleIndex??-1),hovering:S0(($)=>$.hovering),focused:S0(($)=>$.focused),expanded:S0(($)=>$.hovering||$.focused),expandedOrOutOfFocus:S0(($)=>$.hovering||$.focused||!$.isWindowFocused),prevFocusElement:S0(($)=>$.prevFocusElement)};class CK extends n2{timers=new Map;areTimersPaused=!1;constructor($){super($,{},b9)}setFocused($){this.set("focused",$)}setHovering($){this.set("hovering",$)}setIsWindowFocused($){this.set("isWindowFocused",$)}setPrevFocusElement($){this.set("prevFocusElement",$)}setViewport=($)=>{this.set("viewport",$)};disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($){let Z=b9.toastIndex(this.state,$);if(Z===-1)return;this.state.toasts[Z]?.onRemove?.();let B=[...this.state.toasts];B.splice(Z,1),this.setToasts(B)}addToast=($)=>{let{toasts:Z,timeout:H,limit:B}=this.state,J=$.id||PQ("toast"),Q={...$,id:J,transitionStatus:"starting"},X=[Q,...Z],z=X.filter((F)=>F.transitionStatus!=="ending");if(z.length>B){let F=z.length-B,U=z.slice(-F),Y=new Set(U.map((K)=>K.id));this.setToasts(X.map((K)=>{let W=Y.has(K.id);if(K.limited!==W)return{...K,limited:W};return K}))}else this.setToasts(X.map((F)=>F.limited?{...F,limited:!1}:F));let G=Q.timeout??H;if(Q.type!=="loading"&&G>0)this.scheduleTimer(J,G,()=>this.closeToast(J));if(b9.expandedOrOutOfFocus(this.state))this.pauseTimers();return J};updateToast=($,Z)=>{this.updateToastInternal($,Z)};updateToastInternal=($,Z)=>{let{timeout:H,toasts:B}=this.state,J=b9.toast(this.state,$)??null;if(!J)return;if(J.transitionStatus==="ending")return;let Q={...J,...Z};this.setToasts(B.map((W)=>W.id===$?{...W,...Z}:W));let X=Q.timeout??H,z=J?.timeout??H,G=Object.hasOwn(Z,"timeout"),F=Q.transitionStatus!=="ending"&&Q.type!=="loading"&&X>0,U=this.timers.has($),Y=z!==X,K=J?.type==="loading";if(!F&&U){this.timers.get($)?.timeout?.clear(),this.timers.delete($);return}if(F&&(!U||Y||G||K)){let W=this.timers.get($);if(W)W.timeout?.clear(),this.timers.delete($);if(this.scheduleTimer($,X,()=>this.closeToast($)),b9.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{b9.toast(this.state,$)?.onClose?.();let{limit:H,toasts:B}=this.state,J=0,Q=B.map((z)=>{if(z.id===$)return{...z,transitionStatus:"ending",height:0};if(z.transitionStatus==="ending")return z;let G=J>=H;return J+=1,z.limited!==G?{...z,limited:G}:z}),X=this.timers.get($);if(X&&X.timeout)X.timeout.clear(),this.timers.delete($);this.handleFocusManagement($),this.setToasts(Q)};promiseToast=($,Z)=>{let H=_Q(Z.loading),B=this.addToast({...H,type:"loading"}),J=$.then((Q)=>{let X=_Q(Z.success,Q);return this.updateToast(B,{...X,type:"success",timeout:X.timeout}),Q}).catch((Q)=>{let X=_Q(Z.error,Q);return this.updateToast(B,{...X,type:"error",timeout:X.timeout}),Promise.reject(Q)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(J);return J};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout){$.timeout.clear();let Z=Date.now()-$.start,H=$.delay-Z;$.remaining=H>0?H:0}})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=r5.create(),$.timeout.start($.remaining,()=>{this.timers.delete(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=g1($);if(f0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,H){let B=Date.now(),J=!b9.expandedOrOutOfFocus(this.state),Q=J?r5.create():void 0;Q?.start(Z,()=>{this.timers.delete($),H()}),this.timers.set($,{timeout:Q,start:J?B:0,delay:Z,remaining:Z,callback:H})}setToasts($){let Z={toasts:$};if($.length===0)Z.hovering=!1,Z.focused=!1;this.update(Z)}handleFocusManagement($){let Z=Z5(m0(this.state.viewport));if(!this.state.viewport||!f0(this.state.viewport,Z)||!Z3(Z))return;let H=b9.toasts(this.state),B=b9.toastIndex(this.state,$),J=null,Q=B+1;while(Q<H.length){if(H[Q].transitionStatus!=="ending"){J=H[Q];break}Q+=1}if(!J){Q=B-1;while(Q>=0){if(H[Q].transitionStatus!=="ending"){J=H[Q];break}Q-=1}}if(J)J.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var iM=O(d(),1),rM=function(Z){let{children:H,timeout:B=5000,limit:J=3,toastManager:Q}=Z,X=k1(()=>new CK({timeout:B,limit:J,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return S2(X.disposeEffect),lM.useEffect(function(){if(!Q)return;return Q[" subscribe"](({action:F,options:U})=>{let Y=U.id;if(F==="promise"&&U.promise)X.promiseToast(U.promise,U);else if(F==="update"&&Y)X.updateToast(Y,U);else if(F==="close"&&Y)X.closeToast(Y);else X.addToast(U)})},[X,B,Q]),X.useSyncedValues({timeout:B,limit:J}),iM.jsx(KH.Provider,{value:X,children:H})};var k2=O(g(),1);var aM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},K8={...aM,position:"fixed",top:0,left:0},nM={...aM,position:"absolute"};var uQ=O(g(),1);var oM=O(d(),1),R2=uQ.forwardRef(function(Z,H){let[B,J]=uQ.useState();return U0(()=>{if(CQ)J("button")},[]),oM.jsx("span",{...Z,ref:H,style:K8,"aria-hidden":B?void 0:!0,...{tabIndex:0,role:B},"data-base-ui-focus-guard":""})});var sM=function($){return $.frontmostHeight="--toast-frontmost-height",$}({});var W8=O(d(),1),tM=k2.forwardRef(function(Z,H){let{render:B,className:J,children:Q,...X}=Z,z=t9(),G=_5(),F=k2.useRef(!1),U=k2.useRef(!1),Y=z.useState("isEmpty"),K=z.useState("toasts"),W=z.useState("focused"),N=z.useState("expanded"),L=z.useState("prevFocusElement"),V=K[0]?.height??0,A=k2.useMemo(()=>K.some((E)=>E.transitionStatus==="ending"),[K]);k2.useEffect(()=>{let E=z.state.viewport;if(!E)return;function I(S){if(Y)return;if(S.key==="F6"&&S.target!==E)S.preventDefault(),z.setPrevFocusElement(Z5(m0(E))),E?.focus({preventScroll:!0}),z.pauseTimers(),z.setFocused(!0)}let j=I2(E);return j.addEventListener("keydown",I),()=>{j.removeEventListener("keydown",I)}},[z,Y]),k2.useEffect(()=>{let E=z.state.viewport;if(!E||Y)return;let I=I2(E);function j(k){if(k.target!==I)return;z.setIsWindowFocused(!1),z.pauseTimers()}function S(k){if(k.relatedTarget||k.target===I)return;let b=g1(k),v=Z5(m0(E));if(!f0(E,b)||!Z3(v))z.resumeTimers();G.start(0,()=>z.setIsWindowFocused(!0))}return I.addEventListener("blur",j,!0),I.addEventListener("focus",S,!0),()=>{I.removeEventListener("blur",j,!0),I.removeEventListener("focus",S,!0)}},[z,G,Y]),k2.useEffect(()=>{let E=z.state.viewport;if(!E||Y)return;let I=m0(E);return I.addEventListener("pointerdown",z.handleDocumentPointerDown,!0),()=>{I.removeEventListener("pointerdown",z.handleDocumentPointerDown,!0)}},[Y,z]);function D(E){let I=z.state.viewport;if(!I)return;if(F.current=!0,E.relatedTarget===I)K[0]?.ref?.current?.focus();else z.restoreFocusToPrevElement()}function q(E){if(E.key==="Tab"&&E.shiftKey&&E.target===z.state.viewport)E.preventDefault(),z.restoreFocusToPrevElement(),z.resumeTimers()}k2.useEffect(()=>{if(!z.state.isWindowFocused||A||!U.current)return;z.resumeTimers(),z.setHovering(!1),U.current=!1},[A,z]);function _(){z.pauseTimers(),z.setHovering(!0),U.current=!1}function M(){if(A)U.current=!0;else z.resumeTimers(),z.setHovering(!1)}function P(){if(F.current){F.current=!1;return}if(W)return;if(Z3(m0(z.state.viewport).activeElement))z.setFocused(!0),z.pauseTimers()}function C(E){if(!W||f0(z.state.viewport,E.relatedTarget))return;z.setFocused(!1),z.resumeTimers()}let R={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:_,onMouseMove:_,onMouseLeave:M,onFocus:P,onBlur:C,onKeyDown:q,onClick:P},y={expanded:N},w=F0("div",Z,{ref:[H,z.setViewport],state:y,props:[R,{style:{[sM.frontmostHeight]:V?`${V}px`:void 0}},X,{children:W8.jsxs(k2.Fragment,{children:[!Y&&L&&W8.jsx(R2,{onFocus:D}),Q,!Y&&L&&W8.jsx(R2,{onFocus:D})]})}]}),h=k2.useMemo(()=>K.filter((E)=>E.priority==="high"),[K]);return W8.jsxs(k2.Fragment,{children:[!Y&&L&&W8.jsx(R2,{onFocus:D}),w,!W&&h.length>0&&W8.jsx("div",{style:K8,children:h.map((E)=>W8.jsxs("div",{role:"alert","aria-atomic":!0,children:[W8.jsx("div",{children:E.title}),W8.jsx("div",{children:E.description})]},E.id))})]})});var L5=O(g(),1),HP=O(Y4(),1);function p8($){if(VQ(19))return $;return $?"true":void 0}var cQ=O(g(),1),wK=cQ.createContext(void 0);function u8(){let $=cQ.useContext(wK);if(!$)throw Error(E0(66));return $}var c8=function($){return $.startingStyle="data-starting-style",$.endingStyle="data-ending-style",$}({}),Al={[c8.startingStyle]:""},Vl={[c8.endingStyle]:""},n1={transitionStatus($){if($==="starting")return Al;if($==="ending")return Vl;return null}};var $P=O(g(),1);var eM=O(Y4(),1);function N8($){if($==null)return $;return"current"in $?$.current:$}function d8($,Z=!1,H=!0){let B=U4();return Y0((J,Q=null)=>{B.cancel();function X(){eM.flushSync(J)}let z=N8($);if(z==null)return;let G=z;if(typeof G.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)J();else{let F=function(){let Y=c8.startingStyle;if(!G.hasAttribute(Y)){B.request(U);return}let K=new MutationObserver(()=>{if(!G.hasAttribute(Y))K.disconnect(),U()});K.observe(G,{attributes:!0,attributeFilter:[Y]}),Q?.addEventListener("abort",()=>K.disconnect(),{once:!0})},U=function(){Promise.all(G.getAnimations().map((Y)=>Y.finished)).then(()=>{if(Q?.aborted)return;X()}).catch(()=>{let Y=G.getAnimations();if(H){if(Q?.aborted)return;X()}else if(Y.length>0&&Y.some((K)=>K.pending||K.playState!=="finished"))U()})};if(Z){F();return}B.request(U)}})}function y5($){let{enabled:Z=!0,open:H,ref:B,onComplete:J}=$,Q=Y0(J),X=d8(B,H,!1);$P.useEffect(()=>{if(!Z)return;let z=new AbortController;return X(Q,z.signal),()=>{z.abort()}},[Z,H,Q,X])}var l8=function($){return $.index="--toast-index",$.offsetY="--toast-offset-y",$.height="--toast-height",$.swipeMovementX="--toast-swipe-movement-x",$.swipeMovementY="--toast-swipe-movement-y",$}({});var BP=O(d(),1),Dl={...n1,swipeDirection($){return $?{"data-swipe-direction":$}:null}},qH=40,ql=10,B3=0.5,Ml=1;function ZP($,Z,H){switch($){case"up":return-H;case"down":return H;case"left":return-Z;case"right":return Z;default:return 0}}function Pl($){let H=window.getComputedStyle($).transform,B=0,J=0,Q=1;if(H&&H!=="none"){let X=H.match(/matrix(?:3d)?\(([^)]+)\)/);if(X){let z=X[1].split(", ").map(parseFloat);if(z.length===6)B=z[4],J=z[5],Q=Math.sqrt(z[0]*z[0]+z[1]*z[1]);else if(z.length===16)B=z[12],J=z[13],Q=z[0]}}return{x:B,y:J,scale:Q}}var JP=L5.forwardRef(function(Z,H){let{toast:B,render:J,className:Q,swipeDirection:X=["down","right"],...z}=Z,G=B.positionerProps?.anchor!==void 0,F=[];if(!G)F=Array.isArray(X)?X:[X];let U=F.length>0,Y=t9(),[K,W]=L5.useState(void 0),[N,L]=L5.useState(!1),[V,A]=L5.useState(!1),[D,q]=L5.useState(!1),[_,M]=L5.useState({x:0,y:0}),[P,C]=L5.useState({x:0,y:0,scale:1}),[R,y]=L5.useState(),[w,h]=L5.useState(),[E,I]=L5.useState(null),j=L5.useRef(null),S=L5.useRef({x:0,y:0}),k=L5.useRef({x:0,y:0,scale:1}),b=L5.useRef(void 0),v=L5.useRef(0),c=L5.useRef(!1),T=L5.useRef({x:0,y:0}),e=L5.useRef(!1),Z0=Y.useState("toastIndex",B.id),x=Y.useState("toastVisibleIndex",B.id),t=Y.useState("toastOffsetY",B.id),D0=Y.useState("focused"),p=Y.useState("expanded");y5({open:B.transitionStatus!=="ending",ref:j,onComplete(){if(B.transitionStatus==="ending")Y.removeToast(B.id)}});let X0=Y0((m=!1)=>{let a=j.current;if(!a)return;let o=a.style.height;a.style.height="auto";let V0=a.offsetHeight;a.style.height=o;function O0(){Y.updateToastInternal(B.id,{ref:j,height:V0,...B.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}if(m)HP.flushSync(O0);else O0()});U0(X0,[X0]);function K0(m,a){let o=m,V0=a;if(!F.includes("left")&&!F.includes("right"))o=m>0?m**B3:-(Math.abs(m)**B3);else{if(!F.includes("right")&&m>0)o=m**B3;if(!F.includes("left")&&m<0)o=-(Math.abs(m)**B3)}if(!F.includes("up")&&!F.includes("down"))V0=a>0?a**B3:-(Math.abs(a)**B3);else{if(!F.includes("down")&&a>0)V0=a**B3;if(!F.includes("up")&&a<0)V0=-(Math.abs(a)**B3)}return{x:o,y:V0}}function Q0(m){if(m.button!==0)return;if(m.pointerType==="touch")Y.pauseTimers();let a=g1(m.nativeEvent);if(a?a.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'):!1)return;if(c.current=!1,b.current=void 0,v.current=0,S.current={x:m.clientX,y:m.clientY},T.current=S.current,j.current){let V0=Pl(j.current);k.current=V0,C(V0),M({x:V0.x,y:V0.y})}Y.setHovering(!0),L(!0),A(!1),I(null),e.current=!0,j.current?.setPointerCapture(m.pointerId)}function z0(m){if(!N)return;if(m.preventDefault(),e.current)S.current={x:m.clientX,y:m.clientY},e.current=!1;let{clientY:a,clientX:o,movementX:V0,movementY:O0}=m;if(O0<0&&a>T.current.y||O0>0&&a<T.current.y)T.current={x:T.current.x,y:a};if(V0<0&&o>T.current.x||V0>0&&o<T.current.x)T.current={x:o,y:T.current.y};let k0=o-S.current.x,r0=a-S.current.y,u=a-T.current.y,r=o-T.current.x;if(!V){if(Math.sqrt(k0*k0+r0*r0)>=Ml){if(A(!0),E===null){let K1=F.includes("left")||F.includes("right"),c0=F.includes("up")||F.includes("down");if(K1&&c0){let R0=Math.abs(k0),d0=Math.abs(r0);I(R0>d0?"horizontal":"vertical")}}}}let H0;if(!b.current){if(E==="vertical"){if(r0>0)H0="down";else if(r0<0)H0="up"}else if(E==="horizontal"){if(k0>0)H0="right";else if(k0<0)H0="left"}else if(Math.abs(k0)>=Math.abs(r0))H0=k0>0?"right":"left";else H0=r0>0?"down":"up";if(H0&&F.includes(H0))b.current=H0,v.current=ZP(H0,k0,r0),W(H0)}else{let G1=b.current,K1=ZP(G1,r,u);if(K1>qH)c.current=!1,W(G1);else if(!(F.includes("left")&&F.includes("right"))&&!(F.includes("up")&&F.includes("down"))&&v.current-K1>=ql)c.current=!0}let A0=K0(k0,r0),j0=k.current.x,v0=k.current.y;if(E==="horizontal"){if(F.includes("left")||F.includes("right"))j0+=A0.x}else if(E==="vertical"){if(F.includes("up")||F.includes("down"))v0+=A0.y}else{if(F.includes("left")||F.includes("right"))j0+=A0.x;if(F.includes("up")||F.includes("down"))v0+=A0.y}M({x:j0,y:v0})}function L0(m){if(!N)return;if(L(!1),A(!1),I(null),j.current?.releasePointerCapture(m.pointerId),c.current){M({x:P.x,y:P.y}),W(void 0);return}let a=!1,o=_.x-P.x,V0=_.y-P.y,O0;for(let k0 of F){switch(k0){case"right":if(o>qH)a=!0,O0="right";break;case"left":if(o<-qH)a=!0,O0="left";break;case"down":if(V0>qH)a=!0,O0="down";break;case"up":if(V0<-qH)a=!0,O0="up";break;default:break}if(a)break}if(a)W(O0),q(!0),Y.closeToast(B.id);else M({x:P.x,y:P.y}),W(void 0)}function i(m){if(m.key==="Escape"){if(!j.current||!f0(j.current,Z5(m0(j.current))))return;Y.closeToast(B.id)}}L5.useEffect(()=>{if(!U)return;let m=j.current;if(!m)return;function a(o){if(f0(m,o.target))o.preventDefault()}return m.addEventListener("touchmove",a,{passive:!1}),()=>{m.removeEventListener("touchmove",a)}},[U]);function B0(){if(!N&&_.x===P.x&&_.y===P.y&&!D)return{[l8.swipeMovementX]:"0px",[l8.swipeMovementY]:"0px"};let m=_.x-P.x,a=_.y-P.y;return{transition:N?"none":void 0,transform:N?`translateX(${_.x}px) translateY(${_.y}px) scale(${P.scale})`:void 0,[l8.swipeMovementX]:`${m}px`,[l8.swipeMovementY]:`${a}px`}}let $0=B.priority==="high",J0={role:$0?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":R,"aria-describedby":w,"aria-hidden":$0&&!D0?!0:void 0,onPointerDown:U?Q0:void 0,onPointerMove:U?z0:void 0,onPointerUp:U?L0:void 0,onKeyDown:i,inert:p8(B.limited),style:{...B0(),[l8.index]:B.transitionStatus==="ending"?Z0:x,[l8.offsetY]:`${t}px`,[l8.height]:B.height?`${B.height}px`:void 0}},n=L5.useMemo(()=>({rootRef:j,toast:B,titleId:R,setTitleId:y,descriptionId:w,setDescriptionId:h,swiping:N,swipeDirection:K,recalculateHeight:X0,index:Z0,visibleIndex:x,expanded:p}),[B,R,w,N,K,X0,Z0,x,p]),f={transitionStatus:B.transitionStatus,expanded:p,limited:B.limited||!1,type:B.type,swiping:n.swiping,swipeDirection:n.swipeDirection},l=F0("div",Z,{ref:[H,n.rootRef],state:f,stateAttributesMapping:Dl,props:[J0,z]});return BP.jsx(wK.Provider,{value:n,children:l})});var dQ=O(g(),1);var QP=dQ.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{visibleIndex:X,expanded:z,recalculateHeight:G}=u8(),F=dQ.useRef(null);U0(()=>{let W=F.current;if(!W)return;if(G(),typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let N=new ResizeObserver(()=>G(!0)),L=new MutationObserver(()=>G(!0));return N.observe(W),L.observe(W,{childList:!0,subtree:!0,characterData:!0}),()=>{N.disconnect(),L.disconnect()}},[G]);let U=X>0;return F0("div",Z,{ref:[H,F],state:{expanded:z,behind:U},props:Q})});var FP=O(g(),1);var lQ=O(g(),1);var XP=0;function _l($,Z="mui"){let[H,B]=lQ.useState($),J=$||H;return lQ.useEffect(()=>{if(H==null)XP+=1,B(`${Z}-${XP}`)},[H,Z]),J}var zP=GP.useId;function Y2($,Z){if(zP!==void 0){let H=zP();return $??(Z?`${Z}-${H}`:H)}return _l($,Z)}var UP=FP.forwardRef(function(Z,H){let{render:B,className:J,id:Q,children:X,...z}=Z,{toast:G,setDescriptionId:F}=u8(),U=X??G.description,Y=Boolean(U),K=Y2(Q);U0(()=>{if(!Y)return;return F(K),()=>{F(void 0)}},[Y,K,F]);let W={type:G.type},N=F0("p",Z,{ref:H,state:W,props:{...z,id:K,children:U}});if(!Y)return null;return N});var YP=O(g(),1);var KP=YP.forwardRef(function(Z,H){let{render:B,className:J,id:Q,children:X,...z}=Z,{toast:G,setTitleId:F}=u8(),U=X??G.title,Y=Boolean(U),K=Y2(Q);U0(()=>{if(!Y)return;return F(K),()=>{F(void 0)}},[Y,K,F]);let W={type:G.type},N=F0("h2",Z,{ref:H,state:W,props:{...z,id:K,children:U}});if(!Y)return null;return N});var iQ=O(g(),1);var WP=iQ.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q,nativeButton:X=!0,...z}=Z,G=t9(),{toast:F}=u8(),U=G.useState("expanded"),[Y,K]=iQ.useState(!1),{getButtonProps:W,buttonRef:N}=u5({disabled:Q,native:X}),L={type:F.type};return F0("button",Z,{ref:[H,N],state:L,props:[{"aria-hidden":!U&&!Y,onClick(){G.closeToast(F.id)},onFocus(){K(!0)},onBlur(){K(!1)}},z,W]})});var NP=O(g(),1);var LP=NP.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q,nativeButton:X=!0,...z}=Z,{toast:G}=u8(),F=G.actionProps?.children??z.children,U=Boolean(F),{getButtonProps:Y,buttonRef:K}=u5({disabled:Q,native:X}),W={type:G.type},N=F0("button",Z,{ref:[H,K],state:W,props:[z,G.actionProps,Y,{children:F}]});if(!U)return null;return N});var zX=O(g(),1),vP=O(Y4(),1);var K4=O(g(),1);var nQ=O(g(),1);function w5($){let Z=k1(Ol,$).current;return Z.next=$,U0(Z.effect),Z}function Ol($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var J3=O(g(),1);function rQ(){let $=new Map;return{emit(Z,H){$.get(Z)?.forEach((B)=>B(H))},on(Z,H){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(H)},off(Z,H){$.get(Z)?.delete(H)}}}class T6{nodesRef={current:[]};events=rQ();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((H)=>H===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var EK=O(d(),1),AP=J3.createContext(null),VP=J3.createContext(null),e5=()=>J3.useContext(AP)?.id||null,b2=($)=>{let Z=J3.useContext(VP);return $??Z};function C6($){let Z=Y2(),H=b2($),B=e5();return U0(()=>{if(!Z)return;let J={id:Z,parentId:B};return H?.addNode(J),()=>{H?.removeNode(J)}},[H,Z,B]),Z}function MH($){let{children:Z,id:H}=$,B=e5();return EK.jsx(AP.Provider,{value:J3.useMemo(()=>({id:H,parentId:B}),[H,B]),children:Z})}function PH($){let{children:Z,externalTree:H}=$,B=k1(()=>H??new T6).current;return EK.jsx(VP.Provider,{value:B,children:Z})}var G0={};j4(G0,{windowResize:()=>Hi,wheel:()=>nl,triggerPress:()=>Tl,triggerHover:()=>Cl,triggerFocus:()=>wl,trackPress:()=>yl,swipe:()=>Zi,siblingOpen:()=>tl,scrub:()=>ol,pointer:()=>rl,outsidePress:()=>El,none:()=>jl,listNavigation:()=>ll,linkPress:()=>Rl,keyboard:()=>il,itemPress:()=>Sl,inputPress:()=>pl,inputPaste:()=>ml,inputClear:()=>gl,inputChange:()=>vl,inputBlur:()=>fl,incrementPress:()=>hl,imperativeAction:()=>$i,focusOut:()=>ul,escapeKey:()=>cl,drag:()=>al,disabled:()=>el,decrementPress:()=>xl,closeWatcher:()=>dl,closePress:()=>Il,clearPress:()=>kl,chipRemovePress:()=>bl,cancelOpen:()=>sl});var jl="none",Tl="trigger-press",Cl="trigger-hover",wl="trigger-focus",El="outside-press",Sl="item-press",Il="close-press",Rl="link-press",kl="clear-press",bl="chip-remove-press",yl="track-press",hl="increment-press",xl="decrement-press",vl="input-change",gl="input-clear",fl="input-blur",ml="input-paste",pl="input-press",ul="focus-out",cl="escape-key",dl="close-watcher",ll="list-navigation",il="keyboard",rl="pointer",al="drag",nl="wheel",ol="scrub",sl="cancel-open",tl="sibling-open",el="disabled",$i="imperative-action",Zi="swipe",Hi="window-resize";function M0($,Z,H,B){let J=!1,Q=!1,X=B??b1;return{reason:$,event:Z??new Event("base-ui"),cancel(){J=!0},allowPropagation(){Q=!0},get isCanceled(){return J},get isPropagationAllowed(){return Q},trigger:H,...X}}function aQ($,Z,H){let B=H??b1;return{reason:$,event:Z??new Event("base-ui"),...B}}function T4($){return`data-base-ui-${$}`}var YY0=T4("safe-polygon"),KY0=`button,[role="button"],select,[tabindex]:not([tabindex="-1"]),${l7}`;function n7($,Z,H){if(H&&!d4(H))return 0;if(typeof $==="number")return $;if(typeof $==="function"){let B=$();if(typeof B==="number")return B;return B?.[Z]}return $?.[Z]}var DP=O(d(),1),qP=K4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new r5,currentIdRef:{current:null},currentContextRef:{current:null}});function SK($){let{children:Z,delay:H,timeoutMs:B=0}=$,J=K4.useRef(H),Q=K4.useRef(H),X=K4.useRef(null),z=K4.useRef(null),G=_5();return DP.jsx(qP.Provider,{value:K4.useMemo(()=>({hasProvider:!0,delayRef:J,initialDelayRef:Q,currentIdRef:X,timeoutMs:B,currentContextRef:z,timeout:G}),[B,G]),children:Z})}function IK($,Z={open:!1}){let H="rootStore"in $?$.rootStore:$,B=H.useState("floatingId"),{open:J}=Z,Q=K4.useContext(qP),{currentIdRef:X,delayRef:z,timeoutMs:G,initialDelayRef:F,currentContextRef:U,hasProvider:Y,timeout:K}=Q,[W,N]=K4.useState(!1);return U0(()=>{function L(){N(!1),U.current?.setIsInstantPhase(!1),X.current=null,U.current=null,z.current=F.current}if(!X.current)return;if(!J&&X.current===B){if(N(!1),G){let V=B;return K.start(G,()=>{if(H.select("open")||X.current&&X.current!==V)return;L()}),()=>{K.clear()}}L()}return},[J,B,X,z,G,F,U,K,H]),U0(()=>{if(!J)return;let L=U.current,V=X.current;if(K.clear(),U.current={onOpenChange:H.setOpen,setIsInstantPhase:N},X.current=B,z.current={open:0,close:n7(F.current,"close")},V!==null&&V!==B)N(!0),L?.setIsInstantPhase(!0),L?.onOpenChange(!1,M0(G0.none));else N(!1),L?.setIsInstantPhase(!1)},[J,B,H,X,z,G,F,U,K]),U0(()=>{return()=>{U.current=null}},[U]),K4.useMemo(()=>({hasProvider:Y,delayRef:z,isInstantPhase:W}),[Y,z,W])}var $2=O(g(),1);var MP=0;function w6($,Z={}){let{preventScroll:H=!1,cancelPrevious:B=!0,sync:J=!1}=Z;if(B)cancelAnimationFrame(MP);let Q=()=>$?.focus({preventScroll:H});if(J)Q();else MP=requestAnimationFrame(Q)}var o7={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function PP($){if($==="inert")return o7.inert;if($==="aria-hidden")return o7["aria-hidden"];return o7.none}var oQ=new WeakSet,sQ={},RK=0;var _P=($)=>$&&($.host||_P($.parentNode)),Bi=($,Z)=>Z.map((H)=>{if($.contains(H))return H;let B=_P(H);if($.contains(B))return B;return null}).filter((H)=>H!=null);function Ji($,Z,H,B){let Q=B?"inert":H?"aria-hidden":null,X=Bi(Z,$),z=new Set,G=new Set(X),F=[];if(!sQ["data-base-ui-inert"])sQ["data-base-ui-inert"]=new WeakMap;let U=sQ["data-base-ui-inert"];X.forEach(Y),K(Z),z.clear();function Y(W){if(!W||z.has(W))return;if(z.add(W),W.parentNode)Y(W.parentNode)}function K(W){if(!W||G.has(W))return;[].forEach.call(W.children,(N)=>{if(tQ(N)==="script")return;if(z.has(N))K(N);else{let L=Q?N.getAttribute(Q):null,V=L!==null&&L!=="false",A=PP(Q),D=(A.get(N)||0)+1,q=(U.get(N)||0)+1;if(A.set(N,D),U.set(N,q),F.push(N),D===1&&V)oQ.add(N);if(q===1)N.setAttribute("data-base-ui-inert","");if(!V&&Q)N.setAttribute(Q,Q==="inert"?"":"true")}})}return RK+=1,()=>{if(F.forEach((W)=>{let N=PP(Q),V=(N.get(W)||0)-1,A=(U.get(W)||0)-1;if(N.set(W,V),U.set(W,A),!V){if(!oQ.has(W)&&Q)W.removeAttribute(Q);oQ.delete(W)}if(!A)W.removeAttribute("data-base-ui-inert")}),RK-=1,!RK)o7.inert=new WeakMap,o7["aria-hidden"]=new WeakMap,o7.none=new WeakMap,oQ=new WeakSet,sQ={}}}function OP($,Z=!1,H=!1){let B=m0($[0]).body;return Ji($.concat(Array.from(B.querySelectorAll("[aria-live]"))),B,Z,H)}var E5=O(g(),1),kK=O(Y4(),1);var E6=O(d(),1),CP=E5.createContext(null),bK=()=>E5.useContext(CP),Qi=T4("portal");function eQ($={}){let{ref:Z,container:H,componentProps:B=b1,elementProps:J}=$,Q=Y2(),z=bK()?.portalNode,[G,F]=E5.useState(null),[U,Y]=E5.useState(null),K=Y0((V)=>{if(V!==null)Y(V)}),W=E5.useRef(null);U0(()=>{if(H===null){if(W.current)W.current=null,Y(null),F(null);return}if(Q==null)return;let V=(H&&(jP(H)?H:H.current))??z??document.body;if(V==null){if(W.current)W.current=null,Y(null),F(null);return}if(W.current!==V)W.current=V,Y(null),F(V)},[H,z,Q]);let N=F0("div",B,{ref:[Z,K],props:[{id:Q,[Qi]:""},J]});return{portalNode:U,portalSubtree:G&&N?kK.createPortal(N,G):null}}var S6=E5.forwardRef(function(Z,H){let{children:B,container:J,className:Q,render:X,renderGuards:z,...G}=Z,{portalNode:F,portalSubtree:U}=eQ({container:J,ref:H,componentProps:Z,elementProps:G}),Y=E5.useRef(null),K=E5.useRef(null),W=E5.useRef(null),N=E5.useRef(null),[L,V]=E5.useState(null),A=L?.modal,D=L?.open,q=typeof z==="boolean"?z:!!L&&!L.modal&&L.open&&!!F;E5.useEffect(()=>{if(!F||A)return;function M(P){if(F&&P.relatedTarget&&Y8(P))(P.type==="focusin"?TK:dM)(F)}return F.addEventListener("focusin",M,!0),F.addEventListener("focusout",M,!0),()=>{F.removeEventListener("focusin",M,!0),F.removeEventListener("focusout",M,!0)}},[F,A]),E5.useEffect(()=>{if(!F||D)return;TK(F)},[D,F]);let _=E5.useMemo(()=>({beforeOutsideRef:Y,afterOutsideRef:K,beforeInsideRef:W,afterInsideRef:N,portalNode:F,setFocusManagerState:V}),[F]);return E6.jsxs(E5.Fragment,{children:[U,E6.jsxs(CP.Provider,{value:_,children:[q&&F&&E6.jsx(R2,{"data-type":"outside",ref:Y,onFocus:(M)=>{if(Y8(M,F))W.current?.focus();else{let P=L?L.domReference:null;gQ(P)?.focus()}}}),q&&F&&E6.jsx("span",{"aria-owns":F.id,style:TP}),F&&kK.createPortal(B,F),q&&F&&E6.jsx(R2,{"data-type":"outside",ref:K,onFocus:(M)=>{if(Y8(M,F))N.current?.focus();else{let P=L?L.domReference:null;if(H3(P)?.focus(),L?.closeOnFocusOut)L?.onOpenChange(!1,M0(G0.focusOut,M.nativeEvent))}}})]})]})});var _H=O(d(),1);function Xi($,Z){let H=I2($.target);if($ instanceof H.KeyboardEvent)return"keyboard";if($ instanceof H.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof H.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var wP=20,Q3=[];function hK(){Q3=Q3.filter(($)=>{return $.deref()?.isConnected})}function zi($){if(hK(),$&&tQ($)!=="body"){if(Q3.push(new WeakRef($)),Q3.length>wP)Q3=Q3.slice(-wP)}}function yK(){return hK(),Q3[Q3.length-1]?.deref()}function Gi($){if(!$)return null;let Z=j6();if(jK($,Z))return $;return O6($,Z)[0]||$}function Fi($){if(!$||!$.isConnected)return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return s7($).display!=="none"}function EP($,Z){if(!Z.current.includes("floating")&&!$.getAttribute("role")?.includes("dialog"))return;let H=j6(),J=pM($,H).filter((X)=>{let z=X.getAttribute("data-tabindex")||"";return jK(X,H)||X.hasAttribute("data-tabindex")&&!z.startsWith("-")}),Q=$.getAttribute("tabindex");if(Z.current.includes("floating")||J.length===0){if(Q!=="0")$.setAttribute("tabindex","0")}else if(Q!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function I6($){let{context:Z,children:H,disabled:B=!1,initialFocus:J=!0,returnFocus:Q=!0,restoreFocus:X=!1,modal:z=!0,closeOnFocusOut:G=!0,openInteractionType:F="",nextFocusableElement:U,previousFocusableElement:Y,beforeContentFocusGuardRef:K,externalTree:W}=$,N="rootStore"in Z?Z.rootStore:Z,L=N.useState("open"),V=N.useState("domReferenceElement"),A=N.useState("floatingElement"),{events:D,dataRef:q}=N.context,_=Y0(()=>q.current.floatingContext?.nodeId),M=J===!1,P=DH(V)&&M,C=$2.useRef(["content"]),R=w5(J),y=w5(Q),w=w5(F),h=b2(W),E=bK(),I=$2.useRef(null),j=$2.useRef(null),S=$2.useRef(!1),k=$2.useRef(!1),b=$2.useRef(!1),v=$2.useRef(-1),c=$2.useRef(""),T=$2.useRef(""),e=$2.useRef(null),Z0=$2.useRef(null),x=C4(e,K,E?.beforeInsideRef),t=C4(Z0,E?.afterInsideRef),D0=_5(),p=_5(),X0=U4(),K0=E!=null,Q0=_6(A),z0=Y0((B0=Q0)=>{return B0?O6(B0,j6()):[]}),L0=Y0((B0)=>{let $0=z0(B0);return C.current.map(()=>$0).filter(Boolean).flat()});$2.useEffect(()=>{if(B||!z)return;function B0(J0){if(J0.key==="Tab"){if(f0(Q0,Z5(m0(Q0)))&&z0().length===0&&!P)a5(J0)}}let $0=m0(Q0);return $0.addEventListener("keydown",B0),()=>{$0.removeEventListener("keydown",B0)}},[B,V,Q0,z,C,P,z0,L0]),$2.useEffect(()=>{if(B||!L)return;let B0=m0(Q0);function $0(){b.current=!1}function J0(f){let l=g1(f),m=f0(A,l)||f0(V,l)||f0(E?.portalNode,l);if(b.current=!m,T.current=f.pointerType||"keyboard",l?.closest(`[${t7}]`))k.current=!0}function n(){T.current="keyboard"}return B0.addEventListener("pointerdown",J0,!0),B0.addEventListener("pointerup",$0,!0),B0.addEventListener("pointercancel",$0,!0),B0.addEventListener("keydown",n,!0),()=>{B0.removeEventListener("pointerdown",J0,!0),B0.removeEventListener("pointerup",$0,!0),B0.removeEventListener("pointercancel",$0,!0),B0.removeEventListener("keydown",n,!0)}},[B,A,V,Q0,L,E]),$2.useEffect(()=>{if(B||!G)return;let B0=m0(Q0);function $0(){k.current=!0,p.start(0,()=>{k.current=!1})}function J0(a){let o=g1(a),O0=z0().indexOf(o);if(O0!==-1)v.current=O0}function n(a){let{relatedTarget:o,currentTarget:V0}=a,O0=g1(a);queueMicrotask(()=>{let k0=_(),r0=N.context.triggerElements,u=o?.hasAttribute(T4("focus-guard"))&&[e.current,Z0.current,E?.beforeInsideRef.current,E?.afterInsideRef.current,E?.beforeOutsideRef.current,E?.afterOutsideRef.current,N8(Y),N8(U)].includes(o),r=!(f0(V,o)||f0(A,o)||f0(o,A)||f0(E?.portalNode,o)||o!=null&&r0.hasElement(o)||r0.hasMatchingElement((H0)=>f0(H0,o))||u||h&&(m8(h.nodesRef.current,k0).find((H0)=>f0(H0.context?.elements.floating,o)||f0(H0.context?.elements.domReference,o))||qK(h.nodesRef.current,k0).find((H0)=>[H0.context?.elements.floating,_6(H0.context?.elements.floating)].includes(o)||H0.context?.elements.domReference===o)));if(V0===V&&Q0)EP(Q0,C);if(X&&V0!==V&&!Fi(O0)&&Z5(B0)===B0.body){if(O5(Q0)){if(Q0.focus(),X==="popup"){X0.request(()=>{Q0.focus()});return}}let H0=v.current,A0=z0(),j0=A0[H0]||A0[A0.length-1]||Q0;if(O5(j0))j0.focus()}if(q.current.insideReactTree){q.current.insideReactTree=!1;return}if((P?!0:!z)&&o&&r&&!k.current&&(P||o!==yK()))S.current=!0,N.setOpen(!1,M0(G0.focusOut,a))})}function f(){if(b.current)return;q.current.insideReactTree=!0,D0.start(0,()=>{q.current.insideReactTree=!1})}let l=O5(V)?V:null,m=[];if(!A&&!l)return;if(l)l.addEventListener("focusout",n),l.addEventListener("pointerdown",$0),m.push(()=>{l.removeEventListener("focusout",n),l.removeEventListener("pointerdown",$0)});if(A){if(A.addEventListener("focusin",J0),A.addEventListener("focusout",n),E)A.addEventListener("focusout",f,!0),m.push(()=>{A.removeEventListener("focusout",f,!0)});m.push(()=>{A.removeEventListener("focusin",J0),A.removeEventListener("focusout",n)})}return()=>{m.forEach((a)=>{a()})}},[B,V,A,Q0,z,h,E,N,G,X,z0,P,_,C,q,D0,p,X0,U,Y]),$2.useEffect(()=>{if(B||!A||!L)return;let B0=Array.from(E?.portalNode?.querySelectorAll(`[${T4("portal")}]`)||[]),J0=(h?qK(h.nodesRef.current,_()):[]).find((f)=>DH(f.context?.elements.domReference||null))?.context?.elements.domReference,n=[A,J0,...B0,I.current,j.current,e.current,Z0.current,E?.beforeOutsideRef.current,E?.afterOutsideRef.current,N8(Y),N8(U),P?V:null].filter((f)=>f!=null);return OP(n,z||P)},[L,B,V,A,z,C,E,P,h,_,U,Y]),U0(()=>{if(!L||B||!O5(Q0))return;let B0=m0(Q0),$0=Z5(B0);queueMicrotask(()=>{let J0=L0(Q0),n=R.current,f=typeof n==="function"?n(w.current||""):n;if(f===void 0||f===!1)return;let l;if(f===!0||f===null)l=J0[0]||Q0;else l=N8(f);if(l=l||J0[0]||Q0,f0(Q0,$0))return;w6(l,{preventScroll:l===Q0})})},[B,L,Q0,M,L0,R,w]),U0(()=>{if(B||!Q0)return;let B0=m0(Q0),$0=Z5(B0);zi($0);function J0(l){if(!l.open)c.current=Xi(l.nativeEvent,T.current);if(l.reason===G0.triggerHover&&l.nativeEvent.type==="mouseleave")S.current=!0;if(l.reason!==G0.outsidePress)return;if(l.nested)S.current=!1;else if(SQ(l.nativeEvent)||IQ(l.nativeEvent))S.current=!1;else{let m=!1;if(document.createElement("div").focus({get preventScroll(){return m=!0,!1}}),m)S.current=!1;else S.current=!0}}D.on("openchange",J0);let n=B0.createElement("span");if(n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Object.assign(n.style,K8),K0&&V)V.insertAdjacentElement("afterend",n);function f(){let l=y.current,m=typeof l==="function"?l(c.current):l;if(m===void 0||m===!1)return null;if(m===null)m=!0;if(typeof m==="boolean"){let o=V||yK();return o&&o.isConnected?o:n}let a=V||yK()||n;return N8(m)||a}return()=>{D.off("openchange",J0);let l=Z5(B0),m=f0(A,l)||h&&m8(h.nodesRef.current,_(),!1).some((o)=>f0(o.context?.elements.floating,l)),a=f();queueMicrotask(()=>{let o=Gi(a),V0=typeof y.current!=="boolean";if(y.current&&!S.current&&O5(o)&&(!V0&&o!==l&&l!==B0.body?m:!0))o.focus({preventScroll:!0});n.remove(),S.current=!1})}},[B,A,Q0,y,q,D,h,K0,V,_]),U0(()=>{if(!jQ||L||!A)return;let B0=Z5(m0(A));if(!O5(B0)||!P6(B0))return;if(f0(A,B0))B0.blur()},[L,A]),U0(()=>{if(B||!E)return;return E.setFocusManagerState({modal:z,closeOnFocusOut:G,open:L,onOpenChange:N.setOpen,domReference:V}),()=>{E.setFocusManagerState(null)}},[B,E,z,L,N,G,V]),U0(()=>{if(B||!Q0)return;return EP(Q0,C),()=>{queueMicrotask(hK)}},[B,Q0,C]);let i=!B&&(z?!P:!0)&&(K0||z);return _H.jsxs($2.Fragment,{children:[i&&_H.jsx(R2,{"data-type":"inside",ref:x,onFocus:(B0)=>{if(z){let $0=L0();w6($0[$0.length-1])}else if(E?.portalNode)if(S.current=!1,Y8(B0,E.portalNode))H3(V)?.focus();else N8(Y??E.beforeOutsideRef)?.focus()}}),H,i&&_H.jsx(R2,{"data-type":"inside",ref:t,onFocus:(B0)=>{if(z)w6(L0()[0]);else if(E?.portalNode){if(G)S.current=!0;if(Y8(B0,E.portalNode))gQ(V)?.focus();else N8(U??E.afterOutsideRef)?.focus()}}})]})}var OH=O(g(),1);function y9($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.context.dataRef,{enabled:J=!0,event:Q="click",toggle:X=!0,ignoreMouse:z=!1,stickIfOpen:G=!0,touchOpenDelay:F=0,reason:U=G0.triggerPress}=Z,Y=OH.useRef(void 0),K=U4(),W=_5(),N=OH.useMemo(()=>({onPointerDown(L){Y.current=L.pointerType},onMouseDown(L){let V=Y.current,A=L.nativeEvent,D=H.select("open");if(L.button!==0||Q==="click"||d4(V,!0)&&z)return;let q=B.current.openEvent,_=q?.type,M=H.select("domReferenceElement")!==L.currentTarget,P=D&&M||!(D&&X&&(q&&G?_==="click"||_==="mousedown":!0));if(P6(A.target)){let R=M0(U,A,A.target);if(P&&V==="touch"&&F>0)W.start(F,()=>{H.setOpen(!0,R)});else H.setOpen(P,R);return}let C=L.currentTarget;K.request(()=>{let R=M0(U,A,C);if(P&&V==="touch"&&F>0)W.start(F,()=>{H.setOpen(!0,R)});else H.setOpen(P,R)})},onClick(L){if(Q==="mousedown-only")return;let V=Y.current;if(Q==="mousedown"&&V){Y.current=void 0;return}if(d4(V,!0)&&z)return;let A=H.select("open"),D=B.current.openEvent,q=H.select("domReferenceElement")!==L.currentTarget,_=A&&q||!(A&&X&&(D&&G?RQ(D):!0)),M=M0(U,L.nativeEvent,L.currentTarget);if(_&&V==="touch"&&F>0)W.start(F,()=>{H.setOpen(!0,M)});else H.setOpen(_,M)},onKeyDown(){Y.current=void 0}}),[B,Q,z,H,G,X,K,W,F,U]);return OH.useMemo(()=>J?{reference:N}:b1,[J,N])}var o2=O(g(),1);function Ui($,Z){let H=null,B=null,J=!1;return{contextElement:$||void 0,getBoundingClientRect(){let Q=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},X=Z.axis==="x"||Z.axis==="both",z=Z.axis==="y"||Z.axis==="both",G=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",F=Q.width,U=Q.height,Y=Q.x,K=Q.y;if(H==null&&Z.x&&X)H=Q.x-Z.x;if(B==null&&Z.y&&z)B=Q.y-Z.y;if(Y-=H||0,K-=B||0,F=0,U=0,!J||G)F=Z.axis==="y"?Q.width:0,U=Z.axis==="x"?Q.height:0,Y=X&&Z.x!=null?Z.x:Y,K=z&&Z.y!=null?Z.y:K;else if(J&&!G)U=Z.axis==="x"?Q.height:U,F=Z.axis==="y"?Q.width:F;return J=!0,{width:F,height:U,x:Y,y:K,top:K,right:Y+F,bottom:K+U,left:Y}}}}function SP($){return $!=null&&$.clientX!=null}function xK($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingElement"),Q=H.useState("domReferenceElement"),X=H.context.dataRef,{enabled:z=!0,axis:G="both"}=Z,F=o2.useRef(!1),U=o2.useRef(null),[Y,K]=o2.useState(),[W,N]=o2.useState([]),L=Y0((_,M,P)=>{if(F.current)return;if(X.current.openEvent&&!SP(X.current.openEvent))return;H.set("positionReference",Ui(P??Q,{x:_,y:M,axis:G,dataRef:X,pointerType:Y}))}),V=Y0((_)=>{if(!B)L(_.clientX,_.clientY,_.currentTarget);else if(!U.current)N([])}),A=d4(Y)?J:B,D=o2.useCallback(()=>{if(!A||!z)return;let _=I2(J);function M(P){let C=g1(P);if(!f0(J,C))L(P.clientX,P.clientY);else _.removeEventListener("mousemove",M),U.current=null}if(!X.current.openEvent||SP(X.current.openEvent)){_.addEventListener("mousemove",M);let P=()=>{_.removeEventListener("mousemove",M),U.current=null};return U.current=P,P}H.set("positionReference",Q);return},[A,z,J,X,Q,H,L]);o2.useEffect(()=>{return D()},[D,W]),o2.useEffect(()=>{if(z&&!J)F.current=!1},[z,J]),o2.useEffect(()=>{if(!z&&B)F.current=!0},[z,B]);let q=o2.useMemo(()=>{function _(M){K(M.pointerType)}return{onPointerDown:_,onPointerEnter:_,onMouseMove:V,onMouseEnter:V}},[V]);return o2.useMemo(()=>z?{reference:q,trigger:q}:{},[z,q])}var l4=O(g(),1);var Yi={intentional:"onClick",sloppy:"onPointerDown"};function Ki($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function L8($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingElement"),Q=H.useState("referenceElement"),X=H.useState("domReferenceElement"),{onOpenChange:z,dataRef:G}=H.context,{enabled:F=!0,escapeKey:U=!0,outsidePress:Y=!0,outsidePressEvent:K="sloppy",referencePress:W=!1,referencePressEvent:N="sloppy",ancestorScroll:L=!1,bubbles:V,externalTree:A}=Z,D=b2(A),q=Y0(typeof Y==="function"?Y:()=>!1),_=typeof Y==="function"?q:Y,M=l4.useRef(!1),{escapeKey:P,outsidePress:C}=Ki(V),R=l4.useRef(null),y=_5(),w=_5(),h=Y0(()=>{w.clear(),G.current.insideReactTree=!1}),E=l4.useRef(!1),I=l4.useRef(""),j=Y0((i)=>{I.current=i.pointerType}),S=Y0(()=>{let i=I.current,B0=i==="pen"||!i?"mouse":i,$0=typeof K==="function"?K():K;if(typeof $0==="string")return $0;return $0[B0]}),k=Y0((i)=>{if(!B||!F||!U||i.key!=="Escape")return;if(E.current)return;let B0=G.current.floatingContext?.nodeId,$0=D?m8(D.nodesRef.current,B0):[];if(!P){if($0.length>0){let f=!0;if($0.forEach((l)=>{if(l.context?.open&&!l.context.dataRef.current.__escapeKeyBubbles)f=!1}),!f)return}}let J0=SM(i)?i.nativeEvent:i,n=M0(G0.escapeKey,J0);if(H.setOpen(!1,n),!P&&!n.isPropagationAllowed)i.stopPropagation()}),b=Y0((i)=>{let B0=S();return B0==="intentional"&&i.type!=="click"||B0==="sloppy"&&i.type==="click"}),v=Y0(()=>{G.current.insideReactTree=!0,w.start(0,h)}),c=Y0((i,B0=!1)=>{if(b(i)){h();return}if(G.current.insideReactTree){h();return}if(S()==="intentional"&&B0)return;if(typeof _==="function"&&!_(i))return;let $0=g1(i),J0=`[${T4("inert")}]`,n=m0(H.select("floatingElement")).querySelectorAll(J0),f=H.context.triggerElements;if($0&&(f.hasElement($0)||f.hasMatchingElement((V0)=>f0(V0,$0))))return;let l=T1($0)?$0:null;while(l&&!e7(l)){let V0=$X(l);if(e7(V0)||!T1(V0))break;l=V0}if(n.length&&T1($0)&&!EM($0)&&!f0($0,H.select("floatingElement"))&&Array.from(n).every((V0)=>!f0(l,V0)))return;if(O5($0)&&!("touches"in i)){let V0=e7($0),O0=s7($0),k0=/auto|scroll/,r0=V0||k0.test(O0.overflowX),u=V0||k0.test(O0.overflowY),r=r0&&$0.clientWidth>0&&$0.scrollWidth>$0.clientWidth,H0=u&&$0.clientHeight>0&&$0.scrollHeight>$0.clientHeight,A0=O0.direction==="rtl",j0=H0&&(A0?i.offsetX<=$0.offsetWidth-$0.clientWidth:i.offsetX>$0.clientWidth),v0=r&&i.offsetY>$0.clientHeight;if(j0||v0)return}let m=G.current.floatingContext?.nodeId,a=D&&m8(D.nodesRef.current,m).some((V0)=>c4(i,V0.context?.elements.floating));if(c4(i,H.select("floatingElement"))||c4(i,H.select("domReferenceElement"))||a)return;let o=D?m8(D.nodesRef.current,m):[];if(o.length>0){let V0=!0;if(o.forEach((O0)=>{if(O0.context?.open&&!O0.context.dataRef.current.__outsidePressBubbles)V0=!1}),!V0)return}H.setOpen(!1,M0(G0.outsidePress,i)),h()}),T=Y0((i)=>{if(S()!=="sloppy"||i.pointerType==="touch"||!H.select("open")||!F||c4(i,H.select("floatingElement"))||c4(i,H.select("domReferenceElement")))return;c(i)}),e=Y0((i)=>{if(S()!=="sloppy"||!H.select("open")||!F||c4(i,H.select("floatingElement"))||c4(i,H.select("domReferenceElement")))return;let B0=i.touches[0];if(B0)R.current={startTime:Date.now(),startX:B0.clientX,startY:B0.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},y.start(1000,()=>{if(R.current)R.current.dismissOnTouchEnd=!1,R.current.dismissOnMouseDown=!1})}),Z0=Y0((i)=>{let B0=g1(i);function $0(){e(i),B0?.removeEventListener(i.type,$0)}B0?.addEventListener(i.type,$0)}),x=Y0((i)=>{let B0=M.current;if(M.current=!1,y.clear(),i.type==="mousedown"&&R.current&&!R.current.dismissOnMouseDown)return;let $0=g1(i);function J0(){if(i.type==="pointerdown")T(i);else c(i,B0);$0?.removeEventListener(i.type,J0)}$0?.addEventListener(i.type,J0)}),t=Y0((i)=>{if(S()!=="sloppy"||!R.current||c4(i,H.select("floatingElement"))||c4(i,H.select("domReferenceElement")))return;let B0=i.touches[0];if(!B0)return;let $0=Math.abs(B0.clientX-R.current.startX),J0=Math.abs(B0.clientY-R.current.startY),n=Math.sqrt($0*$0+J0*J0);if(n>5)R.current.dismissOnTouchEnd=!0;if(n>10)c(i),y.clear(),R.current=null}),D0=Y0((i)=>{let B0=g1(i);function $0(){t(i),B0?.removeEventListener(i.type,$0)}B0?.addEventListener(i.type,$0)}),p=Y0((i)=>{if(S()!=="sloppy"||!R.current||c4(i,H.select("floatingElement"))||c4(i,H.select("domReferenceElement")))return;if(R.current.dismissOnTouchEnd)c(i);y.clear(),R.current=null}),X0=Y0((i)=>{let B0=g1(i);function $0(){p(i),B0?.removeEventListener(i.type,$0)}B0?.addEventListener(i.type,$0)});l4.useEffect(()=>{if(!B||!F)return;G.current.__escapeKeyBubbles=P,G.current.__outsidePressBubbles=C;let i=new r5;function B0(l){H.setOpen(!1,M0(G0.none,l))}function $0(){i.clear(),E.current=!0}function J0(){i.start(IP()?5:0,()=>{E.current=!1})}let n=m0(J);if(n.addEventListener("pointerdown",j,!0),U)n.addEventListener("keydown",k),n.addEventListener("compositionstart",$0),n.addEventListener("compositionend",J0);if(_)n.addEventListener("click",x,!0),n.addEventListener("pointerdown",x,!0),n.addEventListener("touchstart",Z0,!0),n.addEventListener("touchmove",D0,!0),n.addEventListener("touchend",X0,!0),n.addEventListener("mousedown",x,!0);let f=[];if(L){if(T1(X))f=jH(X);if(T1(J))f=f.concat(jH(J));if(!T1(Q)&&Q&&Q.contextElement)f=f.concat(jH(Q.contextElement))}return f=f.filter((l)=>l!==n.defaultView?.visualViewport),f.forEach((l)=>{l.addEventListener("scroll",B0,{passive:!0})}),()=>{if(n.removeEventListener("pointerdown",j,!0),U)n.removeEventListener("keydown",k),n.removeEventListener("compositionstart",$0),n.removeEventListener("compositionend",J0);if(_)n.removeEventListener("click",x,!0),n.removeEventListener("pointerdown",x,!0),n.removeEventListener("touchstart",Z0,!0),n.removeEventListener("touchmove",D0,!0),n.removeEventListener("touchend",X0,!0),n.removeEventListener("mousedown",x,!0);f.forEach((l)=>{l.removeEventListener("scroll",B0)}),i.clear(),M.current=!1}},[G,J,Q,X,U,_,B,z,L,F,P,C,k,c,x,T,Z0,D0,X0,j,H]),l4.useEffect(h,[_,h]);let K0=l4.useMemo(()=>({onKeyDown:k,...W&&{[Yi[N]]:(i)=>{H.setOpen(!1,M0(G0.triggerPress,i.nativeEvent))},...N!=="intentional"&&{onClick(i){H.setOpen(!1,M0(G0.triggerPress,i.nativeEvent))}}}}),[k,H,W,N]),Q0=Y0((i)=>{let B0=g1(i.nativeEvent);if(!f0(H.select("floatingElement"),B0)||i.button!==0)return;M.current=!0}),z0=Y0((i)=>{if(!B||!F||i.button!==0)return;M.current=!0}),L0=l4.useMemo(()=>({onKeyDown:k,onPointerDown:Q0,onMouseDown:Q0,onMouseUp:Q0,onClickCapture:v,onMouseDownCapture(i){v(),z0(i)},onPointerDownCapture(i){v(),z0(i)},onMouseUpCapture:v,onTouchEndCapture:v,onTouchMoveCapture:v}),[k,Q0,v,z0]);return l4.useMemo(()=>F?{reference:K0,floating:L0,trigger:K0}:{},[F,K0,L0])}var t2=O(g(),1);var Wi={open:S0(($)=>$.open),domReferenceElement:S0(($)=>$.domReferenceElement),referenceElement:S0(($)=>$.positionReference??$.referenceElement),floatingElement:S0(($)=>$.floatingElement),floatingId:S0(($)=>$.floatingId)};class R6 extends n2{constructor($){let{nested:Z,noEmit:H,onOpenChange:B,triggerElements:J,...Q}=$;super({...Q,positionReference:Q.referenceElement,domReferenceElement:Q.referenceElement},{onOpenChange:B,dataRef:{current:{}},events:rQ(),nested:Z,noEmit:H,triggerElements:J},Wi)}setOpen=($,Z)=>{if(!$||!this.state.open||RQ(Z.event))this.context.dataRef.current.openEvent=$?Z.event:void 0;if(!this.context.noEmit){let H={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",H)}this.context.onOpenChange?.($,Z)}}var CH=O(g(),1);var TH=O(g(),1);function i4($,Z=!1,H=!1){let[B,J]=TH.useState($&&Z?"idle":void 0),[Q,X]=TH.useState($);if($&&!Q)X(!0),J("starting");if(!$&&Q&&B!=="ending"&&!H)J("ending");if(!$&&!Q&&B==="ending")J(void 0);return U0(()=>{if(!$&&Q&&B!=="ending"&&H){let z=N5.request(()=>{J("ending")});return()=>{N5.cancel(z)}}return},[$,Q,B,H]),U0(()=>{if(!$||Z)return;let z=N5.request(()=>{J(void 0)});return()=>{N5.cancel(z)}},[Z,$]),U0(()=>{if(!$||!Z)return;if($&&Q&&B!=="idle")J("starting");let z=N5.request(()=>{J("idle")});return()=>{N5.cancel(z)}},[Z,$,Q,J,B]),TH.useMemo(()=>({mounted:Q,setMounted:X,transitionStatus:B}),[Q,B])}function vK($,Z){let H=CH.useRef(null),B=CH.useRef(null);return CH.useCallback((J)=>{if($===void 0)return;if(H.current!==null){let Q=H.current,X=B.current,z=Z.context.triggerElements.getById(Q);if(X&&z===X)Z.context.triggerElements.delete(Q);H.current=null,B.current=null}if(J!==null)H.current=$,B.current=J,Z.context.triggerElements.add($,J)},[Z,$])}function i8($,Z,H,B){let J=H.useState("isMountedByTrigger",$),Q=vK($,H),X=Y0((z)=>{if(Q(z),!z||!H.select("open"))return;let G=H.select("activeTriggerId");if(G===$){H.update({activeTriggerElement:z,...B});return}if(G==null)H.update({activeTriggerId:$,activeTriggerElement:z,...B})});return U0(()=>{if(J)H.update({activeTriggerElement:Z.current,...B})},[J,H,Z,...Object.values(B)]),{registerTrigger:X,isMountedByThisTrigger:J}}function r8($){let Z=$.useState("open");U0(()=>{if(Z&&!$.select("activeTriggerId")&&$.context.triggerElements.size===1){let H=$.context.triggerElements.entries().next();if(!H.done){let[B,J]=H.value;$.update({activeTriggerId:B,activeTriggerElement:J})}}},[Z,$])}function a8($,Z,H){let{mounted:B,setMounted:J,transitionStatus:Q}=i4($);Z.useSyncedValues({mounted:B,transitionStatus:Q});let X=Y0(()=>{J(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),H?.(),Z.context.onOpenChangeComplete?.(!1)}),z=Z.useState("preventUnmountingOnClose");return y5({enabled:!z,open:$,ref:Z.context.popupRef,onComplete(){if(!$)X()}}),{forceUnmount:X,transitionStatus:Q}}class s2{constructor(){this.elementsSet=new Set,this.idMap=new Map}add($,Z){let H=this.idMap.get($);if(H===Z)return;if(H!==void 0)this.elementsSet.delete(H);this.elementsSet.add(Z),this.idMap.set($,Z)}delete($){let Z=this.idMap.get($);if(Z)this.elementsSet.delete(Z),this.idMap.delete($)}hasElement($){return this.elementsSet.has($)}hasMatchingElement($){for(let Z of this.elementsSet)if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function RP(){return new R6({open:!1,floatingElement:null,referenceElement:null,triggerElements:new s2,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function n8(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:RP(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:b1,inactiveTriggerProps:b1,popupProps:b1}}var ZX=S0(($)=>$.triggerIdProp??$.activeTriggerId),o8={open:S0(($)=>$.openProp??$.open),mounted:S0(($)=>$.mounted),transitionStatus:S0(($)=>$.transitionStatus),floatingRootContext:S0(($)=>$.floatingRootContext),preventUnmountingOnClose:S0(($)=>$.preventUnmountingOnClose),payload:S0(($)=>$.payload),activeTriggerId:ZX,activeTriggerElement:S0(($)=>$.mounted?$.activeTriggerElement:null),isTriggerActive:S0(($,Z)=>Z!==void 0&&ZX($)===Z),isOpenedByTrigger:S0(($,Z)=>Z!==void 0&&ZX($)===Z&&$.open),isMountedByTrigger:S0(($,Z)=>Z!==void 0&&ZX($)===Z&&$.mounted),triggerProps:S0(($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps),popupProps:S0(($)=>$.popupProps),popupElement:S0(($)=>$.popupElement),positionerElement:S0(($)=>$.positionerElement)};function wH($){let{open:Z=!1,onOpenChange:H,elements:B={}}=$,J=Y2(),Q=e5()!=null,X=k1(()=>new R6({open:Z,onOpenChange:H,referenceElement:B.reference??null,floatingElement:B.floating??null,triggerElements:new s2,floatingId:J,nested:Q,noEmit:!1})).current;return U0(()=>{let z={open:Z,floatingId:J};if(B.reference!==void 0)z.referenceElement=B.reference,z.domReferenceElement=T1(B.reference)?B.reference:null;if(B.floating!==void 0)z.floatingElement=B.floating;X.update(z)},[Z,J,B.reference,B.floating,X]),X.context.onOpenChange=H,X.context.nested=Q,X.context.noEmit=!1,X}function gK($={}){let{nodeId:Z,externalTree:H}=$,B=wH($),J=$.rootContext||B,Q={reference:J.useState("referenceElement"),floating:J.useState("floatingElement"),domReference:J.useState("domReferenceElement")},[X,z]=t2.useState(null),G=t2.useRef(null),F=b2(H);U0(()=>{if(Q.domReference)G.current=Q.domReference},[Q.domReference]);let U=kP({...$,elements:{...Q,...X&&{reference:X}}}),Y=t2.useCallback((C)=>{let R=T1(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;z(R),U.refs.setReference(R)},[U.refs]),[K,W]=t2.useState(null),[N,L]=t2.useState(null);J.useSyncedValue("referenceElement",K),J.useSyncedValue("domReferenceElement",T1(K)?K:null),J.useSyncedValue("floatingElement",N);let V=t2.useCallback((C)=>{if(T1(C)||C===null)G.current=C,W(C);if(T1(U.refs.reference.current)||U.refs.reference.current===null||C!==null&&!T1(C))U.refs.setReference(C)},[U.refs,W]),A=t2.useCallback((C)=>{L(C),U.refs.setFloating(C)},[U.refs]),D=t2.useMemo(()=>({...U.refs,setReference:V,setFloating:A,setPositionReference:Y,domReference:G}),[U.refs,V,A,Y]),q=t2.useMemo(()=>({...U.elements,domReference:Q.domReference}),[U.elements,Q.domReference]),_=J.useState("open"),M=J.useState("floatingId"),P=t2.useMemo(()=>({...U,dataRef:J.context.dataRef,open:_,onOpenChange:J.setOpen,events:J.context.events,floatingId:M,refs:D,elements:q,nodeId:Z,rootStore:J}),[U,D,q,Z,J,_,M]);return U0(()=>{J.context.dataRef.current.floatingContext=P;let C=F?.nodesRef.current.find((R)=>R.id===Z);if(C)C.context=P}),t2.useMemo(()=>({...U,context:P,refs:D,elements:q,rootStore:J}),[U,D,q,P,J])}function A8($){let{popupStore:Z,noEmit:H=!1,treatPopupAsFloatingElement:B=!1,onOpenChange:J}=$,Q=Y2(),X=e5()!=null,z=Z.useState("open"),G=Z.useState("activeTriggerElement"),F=Z.useState(B?"popupElement":"positionerElement"),U=Z.context.triggerElements,Y=k1(()=>new R6({open:z,referenceElement:G,floatingElement:F,triggerElements:U,onOpenChange:J,floatingId:Q,nested:X,noEmit:H})).current;return U0(()=>{let K={open:z,floatingId:Q,referenceElement:G,floatingElement:F};if(T1(G))K.domReferenceElement=G;if(Y.state.positionReference===Y.state.referenceElement)K.positionReference=G;Y.update(K)},[z,Q,G,F,Y]),Y.context.onOpenChange=J,Y.context.nested=X,Y.context.noEmit=H,Y}var s8=O(g(),1);var fK=CM&&CQ;function k6($,Z={}){let H="rootStore"in $?$.rootStore:$,{events:B,dataRef:J}=H.context,{enabled:Q=!0,delay:X}=Z,z=s8.useRef(!1),G=s8.useRef(null),F=_5(),U=s8.useRef(!0);s8.useEffect(()=>{let K=H.select("domReferenceElement");if(!Q)return;let W=I2(K);function N(){let A=H.select("domReferenceElement");if(!H.select("open")&&O5(A)&&A===Z5(m0(A)))z.current=!0}function L(){U.current=!0}function V(){U.current=!1}if(W.addEventListener("blur",N),fK)W.addEventListener("keydown",L,!0),W.addEventListener("pointerdown",V,!0);return()=>{if(W.removeEventListener("blur",N),fK)W.removeEventListener("keydown",L,!0),W.removeEventListener("pointerdown",V,!0)}},[H,Q]),s8.useEffect(()=>{if(!Q)return;function K(W){if(W.reason===G0.triggerPress||W.reason===G0.escapeKey){let N=H.select("domReferenceElement");if(T1(N))G.current=N,z.current=!0}}return B.on("openchange",K),()=>{B.off("openchange",K)}},[B,Q,H]);let Y=s8.useMemo(()=>({onMouseLeave(){z.current=!1,G.current=null},onFocus(K){let W=K.currentTarget;if(z.current){if(G.current===W)return;z.current=!1,G.current=null}let N=g1(K.nativeEvent);if(T1(N)){if(fK&&!K.relatedTarget){if(!U.current&&!P6(N))return}else if(!Z3(N))return}let L=M6(K.relatedTarget,H.context.triggerElements),{nativeEvent:V,currentTarget:A}=K,D=typeof X==="function"?X():X;if(H.select("open")&&L||D===0||D===void 0){H.setOpen(!0,M0(G0.triggerFocus,V,A));return}F.start(D,()=>{if(z.current)return;H.setOpen(!0,M0(G0.triggerFocus,V,A))})},onBlur(K){z.current=!1,G.current=null;let{relatedTarget:W,nativeEvent:N}=K,L=T1(W)&&W.hasAttribute(T4("focus-guard"))&&W.getAttribute("data-type")==="outside";F.start(0,()=>{let V=H.select("domReferenceElement"),A=Z5(V?V.ownerDocument:document);if(!W&&A===V)return;if(f0(J.current.floatingContext?.refs.floating.current,A)||f0(V,A)||L)return;if(M6(W??A,H.context.triggerElements))return;H.setOpen(!1,M0(G0.triggerFocus,N))})}}),[J,H,F,X]);return s8.useMemo(()=>Q?{reference:Y,trigger:Y}:{},[Q,Y])}var $$=O(g(),1);var EH=T4("safe-polygon"),Ni=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${l7}`;function bP($){return $?Boolean($.closest(Ni)):!1}class mK{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new r5,this.restTimeout=new r5,this.handleCloseOptions=void 0}static create(){return new mK}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}function HX($){let Z=k1(mK.create).current,H=$.context.dataRef.current;if(!H.hoverInteractionState)H.hoverInteractionState=Z;return S2(H.hoverInteractionState.disposeEffect),H.hoverInteractionState}var Li=new Set(["click","mousedown"]);function h9($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingElement"),Q=H.useState("domReferenceElement"),{dataRef:X}=H.context,{enabled:z=!0,closeDelay:G=0}=Z,F=HX(H),U=b2(),Y=e5(),K=Y0(()=>{if(F.interactedInside)return!0;return X.current.openEvent?Li.has(X.current.openEvent.type):!1}),W=Y0(()=>{let q=X.current.openEvent?.type;return q?.includes("mouse")&&q!=="mousedown"}),N=Y0((q)=>{return M6(q,H.context.triggerElements)}),L=$$.useCallback((q,_=!0)=>{let M=Ai(G,F.pointerType);if(M&&!F.handler)F.openChangeTimeout.start(M,()=>H.setOpen(!1,M0(G0.triggerHover,q)));else if(_)F.openChangeTimeout.clear(),H.setOpen(!1,M0(G0.triggerHover,q))},[G,H,F]),V=Y0(()=>{F.unbindMouseMove(),F.handler=void 0}),A=Y0(()=>{if(F.performedPointerEventsMutation){let q=m0(J).body;q.style.pointerEvents="",q.removeAttribute(EH),F.performedPointerEventsMutation=!1}}),D=Y0((q)=>{let _=g1(q);if(!bP(_)){F.interactedInside=!1;return}F.interactedInside=!0});U0(()=>{if(!B)F.pointerType=void 0,F.restTimeoutPending=!1,F.interactedInside=!1,V(),A()},[B,F,V,A]),$$.useEffect(()=>{return()=>{V()}},[V]),$$.useEffect(()=>{return A},[A]),U0(()=>{if(!z)return;if(B&&F.handleCloseOptions?.blockPointerEvents&&W()&&T1(Q)&&J){F.performedPointerEventsMutation=!0;let q=m0(J).body;q.setAttribute(EH,"");let _=Q,M=J,P=U?.nodesRef.current.find((C)=>C.id===Y)?.context?.elements.floating;if(P)P.style.pointerEvents="";return q.style.pointerEvents="none",_.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{q.style.pointerEvents="",_.style.pointerEvents="",M.style.pointerEvents=""}}return},[z,B,Q,J,F,W,U,Y]),$$.useEffect(()=>{if(!z)return;function q(C){if(K()||!X.current.floatingContext||!H.select("open"))return;if(N(C.relatedTarget))return;if(A(),V(),!K())L(C)}function _(C){F.openChangeTimeout.clear(),A(),F.handler?.(C),V()}function M(C){if(!K())L(C,!1)}let P=J;if(P)P.addEventListener("mouseleave",q),P.addEventListener("mouseenter",_),P.addEventListener("mouseleave",M),P.addEventListener("pointerdown",D,!0);return()=>{if(P)P.removeEventListener("mouseleave",q),P.removeEventListener("mouseenter",_),P.removeEventListener("mouseleave",M),P.removeEventListener("pointerdown",D,!0)}},[z,J,H,X,K,N,L,A,V,D,F])}function Ai($,Z){if(Z&&!d4(Z))return 0;if(typeof $==="function")return $();return $}var b6=O(g(),1),yP=O(Y4(),1);function pK($){if(typeof $==="function")return $();return $}var Vi={current:null};function V8($,Z={}){let H="rootStore"in $?$.rootStore:$,{dataRef:B,events:J}=H.context,{enabled:Q=!0,delay:X=0,handleClose:z=null,mouseOnly:G=!1,restMs:F=0,move:U=!0,triggerElementRef:Y=Vi,externalTree:K,isActiveTrigger:W=!0}=Z,N=b2(K),L=HX(H),V=w5(z),A=w5(X),D=w5(F),q=w5(Q);if(W)L.handleCloseOptions=V.current?.__options;let _=Y0(()=>{if(L.interactedInside)return!0;return B.current.openEvent?["click","mousedown"].includes(B.current.openEvent.type):!1}),M=Y0((w)=>{return M6(w,H.context.triggerElements)}),P=b6.useCallback((w,h=!0)=>{let E=n7(A.current,"close",L.pointerType);if(E&&!L.handler)L.openChangeTimeout.start(E,()=>H.setOpen(!1,M0(G0.triggerHover,w)));else if(h)L.openChangeTimeout.clear(),H.setOpen(!1,M0(G0.triggerHover,w))},[A,H,L]),C=Y0(()=>{L.unbindMouseMove(),L.handler=void 0}),R=Y0(()=>{if(L.performedPointerEventsMutation){let w=m0(H.select("domReferenceElement")).body;w.style.pointerEvents="",w.removeAttribute(EH),L.performedPointerEventsMutation=!1}});b6.useEffect(()=>{if(!Q)return;function w(h){if(!h.open)L.openChangeTimeout.clear(),L.restTimeout.clear(),L.blockMouseMove=!0,L.restTimeoutPending=!1}return J.on("openchange",w),()=>{J.off("openchange",w)}},[Q,J,L]);let y=Y0((w)=>{if(_())return;if(!B.current.floatingContext)return;if(M(w.relatedTarget))return;let h=Y.current;V.current?.({...B.current.floatingContext,tree:N,x:w.clientX,y:w.clientY,onClose(){if(R(),C(),!_()&&h===H.select("domReferenceElement"))P(w)}})(w)});return b6.useEffect(()=>{if(!Q)return;let w=Y.current??(W?H.select("domReferenceElement"):null);if(!T1(w))return;function h(j){if(L.openChangeTimeout.clear(),L.blockMouseMove=!1,G&&!d4(L.pointerType))return;if(pK(D.current)>0&&!n7(A.current,"open"))return;let S=n7(A.current,"open",L.pointerType),k=H.select("domReferenceElement"),b=H.context.triggerElements,v=(b.hasElement(j.target)||b.hasMatchingElement((Z0)=>f0(Z0,j.target)))&&(!k||!f0(k,j.target)),c=j.currentTarget??null,T=H.select("open"),e=!T||v;if(v&&T)H.setOpen(!0,M0(G0.triggerHover,j,c));else if(S)L.openChangeTimeout.start(S,()=>{if(e)H.setOpen(!0,M0(G0.triggerHover,j,c))});else if(e)H.setOpen(!0,M0(G0.triggerHover,j,c))}function E(j){if(_()){R();return}L.unbindMouseMove();let S=H.select("domReferenceElement"),k=m0(S);if(L.restTimeout.clear(),L.restTimeoutPending=!1,M(j.relatedTarget))return;if(V.current&&B.current.floatingContext){if(!H.select("open"))L.openChangeTimeout.clear();let v=Y.current;L.handler=V.current({...B.current.floatingContext,tree:N,x:j.clientX,y:j.clientY,onClose(){if(R(),C(),q.current&&!_()&&v===H.select("domReferenceElement"))P(j,!0)}});let c=L.handler;c(j),k.addEventListener("mousemove",c),L.unbindMouseMove=()=>{k.removeEventListener("mousemove",c)};return}if(L.pointerType==="touch"?!f0(H.select("floatingElement"),j.relatedTarget):!0)P(j)}function I(j){y(j)}if(H.select("open"))w.addEventListener("mouseleave",I);if(U)w.addEventListener("mousemove",h,{once:!0});return w.addEventListener("mouseenter",h),w.addEventListener("mouseleave",E),()=>{if(w.removeEventListener("mouseleave",I),U)w.removeEventListener("mousemove",h);w.removeEventListener("mouseenter",h),w.removeEventListener("mouseleave",E)}},[C,R,B,A,P,H,Q,V,y,L,W,_,M,G,U,D,Y,N,q]),b6.useMemo(()=>{if(!Q)return;function w(h){L.pointerType=h.pointerType}return{onPointerDown:w,onPointerEnter:w,onMouseMove(h){let{nativeEvent:E}=h,I=h.currentTarget,j=H.select("domReferenceElement"),S=H.context.triggerElements,k=H.select("open"),b=(S.hasElement(h.target)||S.hasMatchingElement((c)=>f0(c,h.target)))&&(!j||!f0(j,h.target));if(G&&!d4(L.pointerType))return;if(k&&!b||pK(D.current)===0)return;if(!b&&L.restTimeoutPending&&h.movementX**2+h.movementY**2<2)return;L.restTimeout.clear();function v(){if(L.restTimeoutPending=!1,_())return;let c=H.select("open");if(!L.blockMouseMove&&(!c||b))H.setOpen(!0,M0(G0.triggerHover,E,I))}if(L.pointerType==="touch")yP.flushSync(()=>{v()});else if(b&&k)v();else L.restTimeoutPending=!0,L.restTimeout.start(pK(D.current),v)}}},[Q,L,_,G,H,D])}var y6=O(g(),1);function Z2($=[]){let Z=$.map((F)=>F?.reference),H=$.map((F)=>F?.floating),B=$.map((F)=>F?.item),J=$.map((F)=>F?.trigger),Q=y6.useCallback((F)=>BX(F,$,"reference"),Z),X=y6.useCallback((F)=>BX(F,$,"floating"),H),z=y6.useCallback((F)=>BX(F,$,"item"),B),G=y6.useCallback((F)=>BX(F,$,"trigger"),J);return y6.useMemo(()=>({getReferenceProps:Q,getFloatingProps:X,getItemProps:z,getTriggerProps:G}),[Q,X,z,G])}function BX($,Z,H){let B=new Map,J=H==="item",Q={};if(H==="floating")Q.tabIndex=-1,Q[AH]="";for(let X in $){if(J&&$){if(X===VK||X===DK)continue}Q[X]=$[X]}for(let X=0;X<Z.length;X+=1){let z,G=Z[X]?.[H];if(typeof G==="function")z=$?G($):null;else z=G;if(!z)continue;hP(Q,z,J,B)}return hP(Q,$,J,B),Q}function hP($,Z,H,B){for(let J in Z){let Q=Z[J];if(H&&(J===VK||J===DK))continue;if(!J.startsWith("on"))$[J]=Q;else{if(!B.has(J))B.set(J,[]);if(typeof Q==="function")B.get(J)?.push(Q),$[J]=(...X)=>{return B.get(J)?.map((z)=>z(...X)).find((z)=>z!==void 0)}}}}var H2=O(g(),1);var Di="Escape";function QX($,Z,H){switch($){case"vertical":return Z;case"horizontal":return H;default:return Z||H}}function JX($,Z){return QX(Z,$===VH||$===q6,$===g8||$===f8)}function uK($,Z,H){return QX(Z,$===q6,H?$===g8:$===f8)||$==="Enter"||$===" "||$===""}function qi($,Z,H){return QX(Z,H?$===g8:$===f8,$===q6)}function Mi($,Z,H,B){let J=H?$===f8:$===g8,Q=$===VH;if(Z==="both"||Z==="horizontal"&&B&&B>1)return $===Di;return QX(Z,J,Q)}function cK($,Z){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingElement"),Q=H.useState("domReferenceElement"),X=H.context.dataRef,{listRef:z,activeIndex:G,onNavigate:F=()=>{},enabled:U=!0,selectedIndex:Y=null,allowEscape:K=!1,loopFocus:W=!1,nested:N=!1,rtl:L=!1,virtual:V=!1,focusItemOnOpen:A="auto",focusItemOnHover:D=!0,openOnArrowKeyDown:q=!0,disabledIndices:_=void 0,orientation:M="vertical",parentOrientation:P,cols:C=1,id:R,resetOnPointerLeave:y=!0,externalTree:w}=Z,h=_6(J),E=w5(h),I=e5(),j=b2(w);U0(()=>{X.current.orientation=M},[X,M]);let S=DH(Q),k=H2.useRef(A),b=H2.useRef(Y??-1),v=H2.useRef(null),c=H2.useRef(!0),T=Y0((m)=>{F(b.current===-1?null:b.current,m)}),e=H2.useRef(T),Z0=H2.useRef(!!J),x=H2.useRef(B),t=H2.useRef(!1),D0=H2.useRef(!1),p=w5(_),X0=w5(B),K0=w5(Y),Q0=w5(y),z0=Y0(()=>{function m(O0){if(V)j?.events.emit("virtualfocus",O0);else w6(O0,{sync:t.current,preventScroll:!0})}let a=z.current[b.current],o=D0.current;if(a)m(a);(t.current?(O0)=>O0():requestAnimationFrame)(()=>{let O0=z.current[b.current]||a;if(!O0)return;if(!a)m(O0);if(i&&(o||!c.current))O0.scrollIntoView?.({block:"nearest",inline:"nearest"})})});U0(()=>{if(!U)return;if(B&&J){if(b.current=Y??-1,k.current&&Y!=null)D0.current=!0,T()}else if(Z0.current)b.current=-1,e.current()},[U,B,J,Y,T]),U0(()=>{if(!U)return;if(!B){t.current=!1;return}if(!J)return;if(G==null){if(t.current=!1,K0.current!=null)return;if(Z0.current)b.current=-1,z0();if((!x.current||!Z0.current)&&k.current&&(v.current!=null||k.current===!0&&v.current==null)){let m=0,a=()=>{if(z.current[0]==null){if(m<2)(m?requestAnimationFrame:queueMicrotask)(a);m+=1}else b.current=v.current==null||uK(v.current,M,L)||N?bQ(z):PK(z),v.current=null,T()};a()}}else if(!i7(z,G))b.current=G,z0(),D0.current=!1},[U,B,J,G,K0,N,z,M,L,T,z0,p]),U0(()=>{if(!U||J||!j||V||!Z0.current)return;let m=j.nodesRef.current,a=m.find((O0)=>O0.id===I)?.context?.elements.floating,o=Z5(m0(J)),V0=m.some((O0)=>O0.context&&f0(O0.context.elements.floating,o));if(a&&!V0&&c.current)a.focus({preventScroll:!0})},[U,J,j,I,V]),U0(()=>{e.current=T,x.current=B,Z0.current=!!J}),U0(()=>{if(!B)v.current=null,k.current=A},[B,A]);let L0=G!=null,i=H2.useMemo(()=>{function m(o){if(!X0.current)return;let V0=z.current.indexOf(o.currentTarget);if(V0!==-1&&b.current!==V0)b.current=V0,T(o)}return{onFocus(o){t.current=!0,m(o)},onClick:({currentTarget:o})=>o.focus({preventScroll:!0}),onMouseMove(o){if(t.current=!0,D0.current=!1,D)m(o)},onPointerLeave(o){if(!X0.current||!c.current||o.pointerType==="touch")return;t.current=!0;let V0=o.relatedTarget;if(!D||z.current.includes(V0))return;if(!Q0.current)return;if(w6(null,{sync:!0}),b.current=-1,T(o),!V)E.current?.focus({preventScroll:!0})}}},[X0,E,D,z,T,Q0,V]),B0=H2.useCallback(()=>{return P??j?.nodesRef.current.find((m)=>m.id===I)?.context?.dataRef?.current.orientation},[I,j,P]),$0=Y0((m)=>{if(c.current=!1,t.current=!0,m.which===229)return;if(!X0.current&&m.currentTarget===E.current)return;if(N&&Mi(m.key,M,L,C)){if(!JX(m.key,B0()))a5(m);if(H.setOpen(!1,M0(G0.listNavigation,m.nativeEvent)),O5(Q))if(V)j?.events.emit("virtualfocus",Q);else Q.focus();return}let a=b.current,o=bQ(z,_),V0=PK(z,_);if(!S){if(m.key==="Home")a5(m),b.current=o,T(m);if(m.key==="End")a5(m),b.current=V0,T(m)}if(C>1){let O0=Array.from({length:z.current.length},()=>({width:1,height:1})),k0=RM(O0,C,!1),r0=k0.findIndex((H0)=>H0!=null&&!r7(z,H0,_)),u=k0.reduce((H0,A0,j0)=>A0!=null&&!r7(z,A0,_)?j0:H0,-1),r=k0[IM({current:k0.map((H0)=>H0!=null?z.current[H0]:null)},{event:m,orientation:M,loopFocus:W,rtl:L,cols:C,disabledIndices:bM([...(typeof _!=="function"?_:null)||z.current.map((H0,A0)=>r7(z,A0,_)?A0:void 0),void 0],k0),minIndex:r0,maxIndex:u,prevIndex:kM(b.current>V0?o:b.current,O0,k0,C,m.key===q6?"bl":m.key===(L?g8:f8)?"tr":"tl"),stopEvent:!0})];if(r!=null)b.current=r,T(m);if(M==="both")return}if(JX(m.key,M)){if(a5(m),B&&!V&&Z5(m.currentTarget.ownerDocument)===m.currentTarget){b.current=uK(m.key,M,L)?o:V0,T(m);return}if(uK(m.key,M,L))if(W)if(a>=V0)if(K&&a!==z.current.length)b.current=-1;else t.current=!1,b.current=o;else b.current=P2(z,{startingIndex:a,disabledIndices:_});else b.current=Math.min(V0,P2(z,{startingIndex:a,disabledIndices:_}));else if(W)if(a<=o)if(K&&a!==-1)b.current=z.current.length;else t.current=!1,b.current=V0;else b.current=P2(z,{startingIndex:a,decrement:!0,disabledIndices:_});else b.current=Math.max(o,P2(z,{startingIndex:a,decrement:!0,disabledIndices:_}));if(i7(z,b.current))b.current=-1;T(m)}}),J0=H2.useMemo(()=>{return V&&B&&L0&&{"aria-activedescendant":`${R}-${G}`}},[V,B,L0,R,G]),n=H2.useMemo(()=>{return{"aria-orientation":M==="both"?void 0:M,...!S?J0:{},onKeyDown(m){if(m.key==="Tab"&&m.shiftKey&&B&&!V){let a=g1(m.nativeEvent);if(a&&!f0(E.current,a))return;if(a5(m),H.setOpen(!1,M0(G0.focusOut,m.nativeEvent)),O5(Q))Q.focus();return}$0(m)},onPointerMove(){c.current=!0}}},[J0,$0,E,M,S,H,B,V,Q]),f=H2.useMemo(()=>{function m(o){if(A==="auto"&&SQ(o.nativeEvent))k.current=!V}function a(o){if(k.current=A,A==="auto"&&IQ(o.nativeEvent))k.current=!0}return{onKeyDown(o){let V0=H.select("open");c.current=!1;let O0=o.key.startsWith("Arrow"),k0=qi(o.key,B0(),L),r0=JX(o.key,M),u=(N?k0:r0)||o.key==="Enter"||o.key.trim()==="";if(V&&V0)return $0(o);if(!V0&&!q&&O0)return;if(u){let r=JX(o.key,B0());v.current=N&&r?null:o.key}if(N){if(k0)if(a5(o),V0)b.current=bQ(z,p.current),T(o);else H.setOpen(!0,M0(G0.listNavigation,o.nativeEvent,o.currentTarget));return}if(r0){if(K0.current!=null)b.current=K0.current;if(a5(o),!V0&&q)H.setOpen(!0,M0(G0.listNavigation,o.nativeEvent,o.currentTarget));else $0(o);if(V0)T(o)}return},onFocus(o){if(H.select("open")&&!V)b.current=-1,T(o)},onPointerDown:a,onPointerEnter:a,onMouseDown:m,onClick:m}},[$0,p,A,z,N,T,H,q,M,B0,L,K0,V]),l=H2.useMemo(()=>{return{...J0,...f}},[J0,f]);return H2.useMemo(()=>U?{reference:l,floating:n,item:i,trigger:f}:{},[U,l,n,f,i])}var X3=O(g(),1);var Pi=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function h6($,Z={}){let H="rootStore"in $?$.rootStore:$,B=H.useState("open"),J=H.useState("floatingId"),Q=H.useState("domReferenceElement"),X=H.useState("floatingElement"),{role:z="dialog"}=Z,G=Y2(),F=Q?.id||G,U=X3.useMemo(()=>_6(X)?.id||J,[X,J]),Y=Pi.get(z)??z,W=e5()!=null,N=X3.useMemo(()=>{if(Y==="tooltip"||z==="label")return b1;return{"aria-haspopup":Y==="alertdialog"?"dialog":Y,"aria-expanded":"false",...Y==="listbox"&&{role:"combobox"},...Y==="menu"&&W&&{role:"menuitem"},...z==="select"&&{"aria-autocomplete":"none"},...z==="combobox"&&{"aria-autocomplete":"list"}}},[Y,W,z]),L=X3.useMemo(()=>{if(Y==="tooltip"||z==="label")return{[`aria-${z==="label"?"labelledby":"describedby"}`]:B?U:void 0};return{...N,"aria-expanded":B?"true":"false","aria-controls":B?U:void 0,...Y==="menu"&&{id:F}}},[Y,U,B,F,z,N]),V=X3.useMemo(()=>{let D={id:U,...Y&&{role:Y}};if(Y==="tooltip"||z==="label")return D;return{...D,...Y==="menu"&&{"aria-labelledby":F}}},[Y,U,F,z]),A=X3.useCallback(({active:D,selected:q})=>{let _={role:"option",...D&&{id:`${U}-fui-option`}};switch(z){case"select":case"combobox":return{..._,"aria-selected":q};default:}return{}},[U,z]);return X3.useMemo(()=>({reference:L,floating:V,item:A,trigger:N}),[L,V,N,A])}var z3=O(g(),1);function dK($,Z){let H="rootStore"in $?$.rootStore:$,B=H.context.dataRef,J=H.useState("open"),{listRef:Q,activeIndex:X,onMatch:z,onTypingChange:G,enabled:F=!0,resetMs:U=750,selectedIndex:Y=null}=Z,K=_5(),W=z3.useRef(""),N=z3.useRef(Y??X??-1),L=z3.useRef(null);U0(()=>{if(!J&&Y!==null)return;if(K.clear(),L.current=null,W.current!=="")W.current=""},[J,Y,K]),U0(()=>{if(J&&W.current==="")N.current=Y??X??-1},[J,Y,X]);let V=Y0((M)=>{if(M){if(!B.current.typing)B.current.typing=M,G?.(M)}else if(B.current.typing)B.current.typing=M,G?.(M)}),A=Y0((M)=>{function P(E,I,j){let S=I.find((k)=>k?.toLocaleLowerCase().indexOf(j.toLocaleLowerCase())===0);return S?E.indexOf(S):-1}let C=Q.current;if(W.current.length>0&&W.current[0]!==" "){if(P(C,C,W.current)===-1)V(!1);else if(M.key===" ")a5(M)}if(C==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;if(J&&M.key!==" ")a5(M),V(!0);let R=W.current==="";if(R)N.current=Y??X??-1;if(C.every((E)=>E?E[0]?.toLocaleLowerCase()!==E[1]?.toLocaleLowerCase():!0)&&W.current===M.key)W.current="",N.current=L.current;W.current+=M.key,K.start(U,()=>{W.current="",N.current=L.current,V(!1)});let w=R?Y??X??-1:N.current,h=P(C,[...C.slice((w||0)+1),...C.slice(0,(w||0)+1)],W.current);if(h!==-1)z?.(h),L.current=h;else if(M.key!==" ")W.current="",V(!1)}),D=Y0((M)=>{let P=M.relatedTarget,C=H.select("domReferenceElement"),R=H.select("floatingElement"),y=f0(C,P),w=f0(R,P);if(y||w)return;K.clear(),W.current="",N.current=L.current,V(!1)}),q=z3.useMemo(()=>({onKeyDown:A,onBlur:D}),[A,D]),_=z3.useMemo(()=>{return{onKeyDown:A,onKeyUp(M){if(M.key===" ")V(!1)},onBlur:D}},[A,D,V]);return z3.useMemo(()=>F?{reference:q,floating:_}:{},[F,q,_])}function xP($,Z){let[H,B]=$,J=!1,Q=Z.length;for(let X=0,z=Q-1;X<Q;z=X++){let[G,F]=Z[X]||[0,0],[U,Y]=Z[z]||[0,0];if(F>=B!==Y>=B&&H<=(U-G)*(B-F)/(Y-F)+G)J=!J}return J}function _i($,Z){return $[0]>=Z.x&&$[0]<=Z.x+Z.width&&$[1]>=Z.y&&$[1]<=Z.y+Z.height}function D8($={}){let{buffer:Z=0.5,blockPointerEvents:H=!1,requireIntent:B=!0}=$,J=new r5,Q=!1,X=null,z=null,G=typeof performance<"u"?performance.now():0;function F(Y,K){let W=performance.now(),N=W-G;if(X===null||z===null||N===0)return X=Y,z=K,G=W,null;let L=Y-X,V=K-z,D=Math.sqrt(L*L+V*V)/N;return X=Y,z=K,G=W,D}let U=({x:Y,y:K,placement:W,elements:N,onClose:L,nodeId:V,tree:A})=>{return function(q){function _(){J.clear(),L()}if(J.clear(),!N.domReference||!N.floating||W==null||Y==null||K==null)return;let{clientX:M,clientY:P}=q,C=[M,P],R=g1(q),y=q.type==="mouseleave",w=f0(N.floating,R),h=f0(N.domReference,R),E=N.domReference.getBoundingClientRect(),I=N.floating.getBoundingClientRect(),j=W.split("-")[0],S=Y>I.right-I.width/2,k=K>I.bottom-I.height/2,b=_i(C,E),v=I.width>E.width,c=I.height>E.height,T=(v?E:I).left,e=(v?E:I).right,Z0=(c?E:I).top,x=(c?E:I).bottom;if(w){if(Q=!0,!y)return}if(h)Q=!1;if(h&&!y){Q=!0;return}if(y&&T1(q.relatedTarget)&&f0(N.floating,q.relatedTarget))return;if(A&&m8(A.nodesRef.current,V).some(({context:p})=>p?.open))return;if(j==="top"&&K>=E.bottom-1||j==="bottom"&&K<=E.top+1||j==="left"&&Y>=E.right-1||j==="right"&&Y<=E.left+1)return _();let t=[];switch(j){case"top":t=[[T,E.top+1],[T,I.bottom-1],[e,I.bottom-1],[e,E.top+1]];break;case"bottom":t=[[T,I.top+1],[T,E.bottom-1],[e,E.bottom-1],[e,I.top+1]];break;case"left":t=[[I.right-1,x],[I.right-1,Z0],[E.left+1,Z0],[E.left+1,x]];break;case"right":t=[[E.right-1,x],[E.right-1,Z0],[I.left+1,Z0],[I.left+1,x]];break;default:}function D0([p,X0]){switch(j){case"top":{let K0=[v?p+Z/2:S?p+Z*4:p-Z*4,X0+Z+1],Q0=[v?p-Z/2:S?p+Z*4:p-Z*4,X0+Z+1],z0=[[I.left,S?I.bottom-Z:v?I.bottom-Z:I.top],[I.right,S?v?I.bottom-Z:I.top:I.bottom-Z]];return[K0,Q0,...z0]}case"bottom":{let K0=[v?p+Z/2:S?p+Z*4:p-Z*4,X0-Z],Q0=[v?p-Z/2:S?p+Z*4:p-Z*4,X0-Z],z0=[[I.left,S?I.top+Z:v?I.top+Z:I.bottom],[I.right,S?v?I.top+Z:I.bottom:I.top+Z]];return[K0,Q0,...z0]}case"left":{let K0=[p+Z+1,c?X0+Z/2:k?X0+Z*4:X0-Z*4],Q0=[p+Z+1,c?X0-Z/2:k?X0+Z*4:X0-Z*4];return[...[[k?I.right-Z:c?I.right-Z:I.left,I.top],[k?c?I.right-Z:I.left:I.right-Z,I.bottom]],K0,Q0]}case"right":{let K0=[p-Z,c?X0+Z/2:k?X0+Z*4:X0-Z*4],Q0=[p-Z,c?X0-Z/2:k?X0+Z*4:X0-Z*4],z0=[[k?I.left+Z:c?I.left+Z:I.right,I.top],[k?c?I.left+Z:I.right:I.left+Z,I.bottom]];return[K0,Q0,...z0]}default:return[]}}if(xP([M,P],t))return;if(Q&&!b)return _();if(!y&&B){let p=F(q.clientX,q.clientY),X0=0.1;if(p!==null&&p<0.1)return _()}if(!xP([M,P],D0([Y,K])))_();else if(!Q&&B)J.start(40,_);return}};return U.__options={blockPointerEvents:H},U}var gP=O(d(),1),Z$=zX.forwardRef(function(Z,H){let{children:B,container:J,className:Q,render:X,...z}=Z,{portalNode:G,portalSubtree:F}=eQ({container:J,ref:H,componentProps:Z,elementProps:z});if(!F&&!G)return null;return gP.jsxs(zX.Fragment,{children:[F,G&&vP.createPortal(B,G)]})});var fP=Z$;var G3=O(g(),1);var w4=O(g(),1);var GX=O(g(),1),Oi=GX.createContext(void 0);function r4(){return GX.useContext(Oi)?.direction??"ltr"}var ji=($)=>({name:"arrow",options:$,async fn(Z){let{x:H,y:B,placement:J,rects:Q,platform:X,elements:z,middlewareData:G}=Z,{element:F,padding:U=0,offsetParent:Y="real"}=pP($,Z)||{};if(F==null)return{};let K=dP(U),W={x:H,y:B},N=cP(J),L=uP(N),V=await X.getDimensions(F),A=N==="y",D=A?"top":"left",q=A?"bottom":"right",_=A?"clientHeight":"clientWidth",M=Q.reference[L]+Q.reference[N]-W[N]-Q.floating[L],P=W[N]-Q.reference[N],C=Y==="real"?await X.getOffsetParent?.(F):z.floating,R=z.floating[_]||Q.floating[L];if(!R||!await X.isElement?.(C))R=z.floating[_]||Q.floating[L];let y=M/2-P/2,w=R/2-V[L]/2-1,h=Math.min(K[D],w),E=Math.min(K[q],w),I=h,j=R-V[L]-E,S=R/2-V[L]/2+y,k=mP(I,S,j),b=!G.arrow&&SH(J)!=null&&S!==k&&Q.reference[L]/2-(S<I?h:E)-V[L]/2<0,v=b?S<I?S-I:S-j:0;return{[N]:W[N]+v,data:{[N]:k,centerOffset:S-k-v,...b&&{alignmentOffset:v}},reset:b}}}),lP=($,Z)=>({...ji($),options:[$,Z]});var iP={name:"hide",async fn($){let{width:Z,height:H,x:B,y:J}=$.rects.reference,Q=Z===0&&H===0&&B===0&&J===0;return{data:{referenceHidden:(await oK().fn($)).data?.referenceHidden||Q}}}};var IH={sideX:"left",sideY:"top"},H$={name:"adaptiveOrigin",async fn($){let{x:Z,y:H,rects:{floating:B},elements:{floating:J},platform:Q,strategy:X,placement:z}=$,G=I2(J),F=G.getComputedStyle(J);if(!(F.transitionDuration!=="0s"&&F.transitionDuration!==""))return{x:Z,y:H,data:IH};let Y=await Q.getOffsetParent?.(J),K={width:0,height:0};if(X==="fixed"&&G?.visualViewport)K={width:G.visualViewport.width,height:G.visualViewport.height};else if(Y===G){let D=m0(J);K={width:D.documentElement.clientWidth,height:D.documentElement.clientHeight}}else if(await Q.isElement?.(Y))K=await Q.getDimensions(Y);let W=x6(z),N=Z,L=H;if(W==="left")N=K.width-(Z+B.width);if(W==="top")L=K.height-(H+B.height);let V=W==="left"?"right":IH.sideX,A=W==="top"?"bottom":IH.sideY;return{x:N,y:L,data:{sideX:V,sideY:A}}}};function nP($,Z,H){let B=$==="inline-start"||$==="inline-end";return{top:"top",right:B?H?"inline-start":"inline-end":"right",bottom:"bottom",left:B?H?"inline-end":"inline-start":"left"}[Z]}function rP($,Z,H){let{rects:B,placement:J}=$;return{side:nP(Z,x6(J),H),align:SH(J)||"center",anchor:{width:B.reference.width,height:B.reference.height},positioner:{width:B.floating.width,height:B.floating.height}}}function t8($){let{anchor:Z,positionMethod:H="absolute",side:B="bottom",sideOffset:J=0,align:Q="center",alignOffset:X=0,collisionBoundary:z,collisionPadding:G=5,sticky:F=!1,arrowPadding:U=5,disableAnchorTracking:Y=!1,keepMounted:K=!1,floatingRootContext:W,mounted:N,collisionAvoidance:L,shiftCrossAxis:V=!1,nodeId:A,adaptiveOrigin:D,lazyFlip:q=!1,externalTree:_}=$,[M,P]=w4.useState(null);if(!N&&M!==null)P(null);let C=L.side||"flip",R=L.align||"flip",y=L.fallbackAxisSide||"end",w=typeof Z==="function"?Z:void 0,h=Y0(w),E=w?h:Z,I=w5(Z),S=r4()==="rtl",k=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":S?"left":"right","inline-start":S?"right":"left"}[B],b=Q==="center"?k:`${k}-${Q}`,v=G,c=1,T=B==="bottom"?c:0,e=B==="top"?c:0,Z0=B==="right"?c:0,x=B==="left"?c:0;if(typeof v==="number")v={top:v+T,right:v+x,bottom:v+e,left:v+Z0};else if(v)v={top:(v.top||0)+T,right:(v.right||0)+x,bottom:(v.bottom||0)+e,left:(v.left||0)+Z0};let t={boundary:z==="clipping-ancestors"?"clippingAncestors":z,padding:v},D0=w4.useRef(null),p=w5(J),X0=w5(X),z0=[lK((p0)=>{let t0=rP(p0,B,S),N0=typeof p.current==="function"?p.current(t0):p.current,b0=typeof X0.current==="function"?X0.current(t0):X0.current;return{mainAxis:N0,crossAxis:b0,alignmentAxis:b0}},[typeof J!=="function"?J:0,typeof X!=="function"?X:0,S,B])],L0=R==="none"&&C!=="shift",i=!L0&&(F||V||C==="shift"),B0=C==="none"?null:aK({...t,padding:{top:v.top+c,right:v.right+c,bottom:v.bottom+c,left:v.left+c},mainAxis:!V&&C==="flip",crossAxis:R==="flip"?"alignment":!1,fallbackAxisSideDirection:y}),$0=L0?null:iK((p0)=>{let t0=m0(p0.elements.floating).documentElement;return{...t,rootBoundary:V?{x:0,y:0,width:t0.clientWidth,height:t0.clientHeight}:void 0,mainAxis:R!=="none",crossAxis:i,limiter:F||V?void 0:rK((N0)=>{if(!D0.current)return{};let{width:b0,height:W1}=D0.current.getBoundingClientRect(),C0=sK(x6(N0.placement)),I0=C0==="y"?b0:W1,g0=C0==="y"?v.left+v.right:v.top+v.bottom;return{offset:I0/2+g0/2}})}},[t,F,V,v,R]);if(C==="shift"||R==="shift"||Q==="center")z0.push($0,B0);else z0.push(B0,$0);z0.push(nK({...t,apply({elements:{floating:p0},rects:{reference:t0},availableWidth:N0,availableHeight:b0}){let W1=p0.style;W1.setProperty("--available-width",`${N0}px`),W1.setProperty("--available-height",`${b0}px`),W1.setProperty("--anchor-width",`${t0.width}px`),W1.setProperty("--anchor-height",`${t0.height}px`)}}),lP(()=>({element:D0.current||document.createElement("div"),padding:U,offsetParent:"floating"}),[U]),{name:"transformOrigin",fn(p0){let{elements:t0,middlewareData:N0,placement:b0,rects:W1,y:C0}=p0,I0=x6(b0),g0=sK(I0),$1=D0.current,l0=N0.arrow?.x||0,L1=N0.arrow?.y||0,u1=$1?.clientWidth||0,c1=$1?.clientHeight||0,M1=l0+u1/2,q5=L1+c1/2,p5=Math.abs(N0.shift?.y||0),i5=W1.reference.height/2,x0=typeof J==="function"?J(rP(p0,B,S)):J,z1=p5>x0,u0={top:`${M1}px calc(100% + ${x0}px)`,bottom:`${M1}px ${-x0}px`,left:`calc(100% + ${x0}px) ${q5}px`,right:`${-x0}px ${q5}px`}[I0],A1=`${M1}px ${W1.reference.y+i5-C0}px`;return t0.floating.style.setProperty("--transform-origin",i&&g0==="y"&&z1?A1:u0),{}}},iP,D),U0(()=>{if(!N&&W)W.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[N,W]);let J0=w4.useMemo(()=>({elementResize:!Y&&typeof ResizeObserver<"u",layoutShift:!Y&&typeof IntersectionObserver<"u"}),[Y]),{refs:n,elements:f,x:l,y:m,middlewareData:a,update:o,placement:V0,context:O0,isPositioned:k0,floatingStyles:r0}=gK({rootContext:W,placement:b,middleware:z0,strategy:H,whileElementsMounted:K?void 0:(...p0)=>XX(...p0,J0),nodeId:A,externalTree:_}),{sideX:u,sideY:r}=a.adaptiveOrigin||IH,H0=k0?H:"fixed",A0=w4.useMemo(()=>{let p0=D?{position:H0,[u]:l,[r]:m}:{position:H0,...r0};if(!k0)p0.opacity=0;return p0},[D,H0,u,l,r,m,r0,k0]),j0=w4.useRef(null);U0(()=>{if(!N)return;let p0=I.current,t0=typeof p0==="function"?p0():p0,b0=(aP(t0)?t0.current:t0)||null||null;if(b0!==j0.current)n.setPositionReference(b0),j0.current=b0},[N,n,E,I]),w4.useEffect(()=>{if(!N)return;let p0=I.current;if(typeof p0==="function")return;if(aP(p0)&&p0.current!==j0.current)n.setPositionReference(p0.current),j0.current=p0.current},[N,n,E,I]),w4.useEffect(()=>{if(K&&N&&f.domReference&&f.floating)return XX(f.domReference,f.floating,o,J0);return},[K,N,f,o,J0]);let v0=x6(V0),G1=nP(B,v0,S),K1=SH(V0)||"center",c0=Boolean(a.hide?.referenceHidden);U0(()=>{if(q&&N&&k0)P(v0)},[q,N,k0,v0]);let R0=w4.useMemo(()=>({position:"absolute",top:a.arrow?.y,left:a.arrow?.x}),[a.arrow]),d0=a.arrow?.centerOffset!==0;return w4.useMemo(()=>({positionerStyles:A0,arrowStyles:R0,arrowRef:D0,arrowUncentered:d0,side:G1,align:K1,physicalSide:v0,anchorHidden:c0,refs:n,context:O0,isPositioned:k0,update:o}),[A0,R0,D0,d0,G1,K1,v0,c0,n,O0,k0,o])}function aP($){return $!=null&&"current"in $}var E4=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=c8.startingStyle]="startingStyle",$[$.endingStyle=c8.endingStyle]="endingStyle",$.anchorHidden="data-anchor-hidden",$.side="data-side",$.align="data-align",$}({}),RH=function($){return $.popupOpen="data-popup-open",$.pressed="data-pressed",$}({}),Ti={[RH.popupOpen]:""},Ci={[RH.popupOpen]:"",[RH.pressed]:""},wi={[E4.open]:""},Ei={[E4.closed]:""},Si={[E4.anchorHidden]:""},e8={open($){if($)return Ti;return null}},kH={open($){if($)return Ci;return null}},P1={open($){if($)return wi;return Ei},anchorHidden($){if($)return Si;return null}};function K2($){return $==="starting"?oP:b1}var FX=O(g(),1),tK=FX.createContext(void 0);function sP(){let $=FX.useContext(tK);if($===void 0)throw Error(E0(84));return $}var tP=O(d(),1),eP=G3.forwardRef(function(Z,H){let{toast:B,...J}=Z,Q=t9(),X=B.positionerProps??b1,{render:z,className:G,anchor:F=X.anchor,positionMethod:U=X.positionMethod??"absolute",side:Y=X.side??"top",align:K=X.align??"center",sideOffset:W=X.sideOffset??0,alignOffset:N=X.alignOffset??0,collisionBoundary:L=X.collisionBoundary??"clipping-ancestors",collisionPadding:V=X.collisionPadding??5,arrowPadding:A=X.arrowPadding??5,sticky:D=X.sticky??!1,disableAnchorTracking:q=X.disableAnchorTracking??!1,collisionAvoidance:_=X.collisionAvoidance??$9,...M}=J,[P,C]=G3.useState(null),R=Q.useState("toastIndex",B.id),y=Q.useState("toastVisibleIndex",B.id),w=T1(F)?F:null,h=wH({open:!0,onOpenChange:a1,elements:{floating:P,reference:w}}),E=t8({anchor:w,positionMethod:U,floatingRootContext:h,mounted:!0,side:Y,sideOffset:W,align:K,alignOffset:N,collisionBoundary:L,collisionPadding:V,sticky:D,arrowPadding:A,disableAnchorTracking:q,keepMounted:!0,collisionAvoidance:_}),I=G3.useMemo(()=>{let b={};return{role:"presentation",style:{...E.positionerStyles,...b,[l8.index]:B.transitionStatus==="ending"?R:y}}},[E.positionerStyles,B.transitionStatus,R,y]),j=G3.useMemo(()=>({side:E.side,align:E.align,anchorHidden:E.anchorHidden}),[E.side,E.align,E.anchorHidden]),S=G3.useMemo(()=>({...j,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[j,E.arrowRef,E.arrowStyles,E.arrowUncentered]),k=F0("div",Z,{state:j,props:[I,K2(B.transitionStatus),M],ref:[H,C],stateAttributesMapping:P1});return tP.jsx(tK.Provider,{value:S,children:k})});var $_=O(g(),1);var Z_=$_.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{arrowRef:X,side:z,align:G,arrowUncentered:F,arrowStyles:U}=sP();return F0("div",Z,{state:{side:z,align:G,uncentered:F},ref:[H,X],props:[{style:U,"aria-hidden":!0},Q]})});var UX=O(g(),1);function H_(){let $=UX.useContext(KH);if(!$)throw Error(E0(73));let Z=$.useState("toasts");return UX.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function B_(){let $=new Set;function Z(H){$.forEach((B)=>B(H))}return{" subscribe":function(B){return $.add(B),()=>{$.delete(B)}},add(H){let B=H.id||PQ("toast"),J={...H,id:B,transitionStatus:"starting"};return Z({action:"add",options:J}),B},close(H){Z({action:"close",options:{id:H}})},update(H,B){Z({action:"update",options:{...B,id:H}})},promise(H,B){let J=H;return Z({action:"promise",options:{...B,promise:H,setPromise(Q){J=Q}}}),J}}}var f1=O(d(),1),a4=y2.createToastManager();function Ii({...$}){return f1.jsx(y2.Provider,{...$})}function Ri({...$}){return f1.jsx(y2.Portal,{"data-slot":"toast-portal",...$})}function ki({className:$,...Z}){return f1.jsx(y2.Viewport,{"data-slot":"toast-viewport",className:s("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",$),...Z})}function bi({className:$,...Z}){return f1.jsx(y2.Root,{"data-slot":"toast",className:s("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",$),...Z})}function yi({className:$,...Z}){return f1.jsx(y2.Content,{"data-slot":"toast-content",className:s("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",$),...Z})}function hi({className:$,...Z}){return f1.jsx(y2.Title,{"data-slot":"toast-title",className:s("text-sm font-medium",$),...Z})}function xi({className:$,...Z}){return f1.jsx(y2.Description,{"data-slot":"toast-description",className:s("text-sm text-muted-foreground",$),...Z})}function vi({className:$,render:Z=f1.jsx(T0,{variant:"outline",size:"sm"}),...H}){return f1.jsx(y2.Action,{"data-slot":"toast-action",render:Z,className:s("shrink-0",$),...H})}function gi({className:$,children:Z,render:H=f1.jsx(T0,{variant:"ghost",size:"icon-sm"}),...B}){return f1.jsx(y2.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:H,className:s("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...B,children:Z??f1.jsx(S5,{"aria-hidden":"true",stroke:1.75})})}function fi({type:$}){let Z=null;if($==="success")Z=f1.jsx(Q_,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=f1.jsx(X_,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=f1.jsx(YX,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=f1.jsx(J_,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=f1.jsx(z_,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return f1.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function mi(){let{toasts:$}=y2.useToastManager();return $.map((Z)=>f1.jsx(bi,{toast:Z,children:f1.jsxs(yi,{children:[f1.jsx(fi,{type:Z.type}),f1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f1.jsx(hi,{}),f1.jsx(xi,{})]}),f1.jsx(vi,{}),f1.jsx(gi,{})]})},Z.id))}function G_({children:$,toastManager:Z=a4,...H}){return f1.jsxs(Ii,{toastManager:Z,...H,children:[$,f1.jsx(Ri,{children:f1.jsx(ki,{children:f1.jsx(mi,{})})})]})}var AA0=y2.createToastManager,VA0=y2.useToastManager;var x9={};j4(x9,{createHandle:()=>v_,Viewport:()=>x_,Trigger:()=>D_,Root:()=>W_,Provider:()=>E_,Positioner:()=>O_,Portal:()=>P_,Popup:()=>T_,Handle:()=>DX,Arrow:()=>w_});var H9=O(g(),1);var F_=O(g(),1);function Z9($){let Z=F_.useRef(!0);if(Z.current)Z.current=!1,$()}var KX=O(g(),1),eK=KX.createContext(void 0);function n4($){let Z=KX.useContext(eK);if(Z===void 0&&!$)throw Error(E0(72));return Z}var U_=O(g(),1),Y_=O(Y4(),1);var pi={...o8,disabled:S0(($)=>$.disabled),instantType:S0(($)=>$.instantType),isInstantPhase:S0(($)=>$.isInstantPhase),trackCursorAxis:S0(($)=>$.trackCursorAxis),disableHoverablePopup:S0(($)=>$.disableHoverablePopup),lastOpenChangeReason:S0(($)=>$.openChangeReason),closeDelay:S0(($)=>$.closeDelay),hasViewport:S0(($)=>$.hasViewport)};class B$ extends n2{constructor($){super({...ui(),...$},{popupRef:U_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new s2},pi)}setOpen=($,Z)=>{let H=Z.reason,B=H===G0.triggerHover,J=$&&H===G0.triggerFocus,Q=!$&&(H===G0.triggerPress||H===G0.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let X=()=>{let z={open:$,openChangeReason:H};if(J)z.instantType="focus";else if(Q)z.instantType="dismiss";else if(H===G0.triggerHover)z.instantType=void 0;let G=Z.trigger?.id??null;if(G||$)z.activeTriggerId=G,z.activeTriggerElement=Z.trigger??null;this.update(z)};if(B)Y_.flushSync(X);else X()};static useStore($,Z){let H=k1(()=>{return new B$(Z)}).current,B=$??H,J=A8({popupStore:B,onOpenChange:B.setOpen});return B.state.floatingRootContext=J,B}}function ui(){return{...n8(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}var K_=O(d(),1),W_=NH(function(Z){let{disabled:H=!1,defaultOpen:B=!1,open:J,disableHoverablePopup:Q=!1,trackCursorAxis:X="none",actionsRef:z,onOpenChange:G,onOpenChangeComplete:F,handle:U,triggerId:Y,defaultTriggerId:K=null,children:W}=Z,N=B$.useStore(U?.store,{open:B,openProp:J,activeTriggerId:K,triggerIdProp:Y});Z9(()=>{if(J===void 0&&N.state.open===!1&&B===!0)N.update({open:!0,activeTriggerId:K})}),N.useControlledProp("openProp",J),N.useControlledProp("triggerIdProp",Y),N.useContextCallback("onOpenChange",G),N.useContextCallback("onOpenChangeComplete",F);let L=N.useState("open"),V=!H&&L,A=N.useState("activeTriggerId"),D=N.useState("payload");N.useSyncedValues({trackCursorAxis:X,disableHoverablePopup:Q}),U0(()=>{if(L&&H)N.setOpen(!1,M0(G0.disabled))},[L,H,N]),N.useSyncedValue("disabled",H),r8(N);let{forceUnmount:q,transitionStatus:_}=a8(V,N),M=N.useState("isInstantPhase"),P=N.useState("instantType"),C=N.useState("lastOpenChangeReason"),R=H9.useRef(null);U0(()=>{if(_==="ending"&&C===G0.none||_!=="ending"&&M){if(P!=="delay")R.current=P;N.set("instantType","delay")}else if(R.current!==null)N.set("instantType",R.current),R.current=null},[_,M,C,P,N]),U0(()=>{if(V){if(A==null)N.set("payload",void 0)}},[N,A,V]);let y=H9.useCallback(()=>{N.setOpen(!1,ci(N,G0.imperativeAction))},[N]);H9.useImperativeHandle(z,()=>({unmount:q,close:y}),[q,y]);let w=N.useState("floatingRootContext"),h=L8(w,{enabled:!H,referencePress:!0}),E=xK(w,{enabled:!H&&X!=="none",axis:X==="none"?void 0:X}),{getReferenceProps:I,getFloatingProps:j,getTriggerProps:S}=Z2([h,E]),k=H9.useMemo(()=>I(),[I]),b=H9.useMemo(()=>S(),[S]),v=H9.useMemo(()=>j(),[j]);return N.useSyncedValues({activeTriggerProps:k,inactiveTriggerProps:b,popupProps:v}),K_.jsx(eK.Provider,{value:N,children:typeof W==="function"?W({payload:D}):W})});function ci($,Z){let H=M0(Z);return H.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},H}var V_=O(g(),1);function H1($){return Y2($,"base-ui")}var WX=O(g(),1),$W=WX.createContext(void 0);function N_(){return WX.useContext($W)}var L_=function($){return $[$.popupOpen=RH.popupOpen]="popupOpen",$.triggerDisabled="data-trigger-disabled",$}({});var A_=600;var D_=AQ(function(Z,H){let{className:B,render:J,handle:Q,payload:X,disabled:z,delay:G,closeDelay:F,id:U,...Y}=Z,K=n4(!0),W=Q?.store??K;if(!W)throw Error(E0(82));let N=H1(U),L=W.useState("isTriggerActive",N),V=W.useState("isOpenedByTrigger",N),A=W.useState("floatingRootContext"),D=V_.useRef(null),q=G??A_,_=F??0,{registerTrigger:M,isMountedByThisTrigger:P}=i8(N,D,W,{payload:X,closeDelay:_}),C=N_(),{delayRef:R,isInstantPhase:y,hasProvider:w}=IK(A,{open:V});W.useSyncedValue("isInstantPhase",y);let h=W.useState("disabled"),E=z??h,I=W.useState("trackCursorAxis"),j=W.useState("disableHoverablePopup"),S=V8(A,{enabled:!E,mouseOnly:!0,move:!1,handleClose:!j&&I!=="both"?D8():null,restMs(){let T=C?.delay,e=typeof R.current==="object"?R.current.open:void 0,Z0=q;if(w)if(e!==0)Z0=G??T??q;else Z0=0;return Z0},delay(){let T=typeof R.current==="object"?R.current.close:void 0,e=_;if(F==null&&w)e=T;return{close:e}},triggerElementRef:D,isActiveTrigger:L}),k=k6(A,{enabled:!E}).reference,b={open:V},v=W.useState("triggerProps",P);return F0("button",Z,{state:b,ref:[H,M,D],props:[S,k,v,{id:N,[L_.triggerDisabled]:E?"":void 0},Y],stateAttributesMapping:e8})});var M_=O(g(),1);var NX=O(g(),1),ZW=NX.createContext(void 0);function q_(){let $=NX.useContext(ZW);if($===void 0)throw Error(E0(70));return $}var HW=O(d(),1),P_=M_.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z;if(!(n4().useState("mounted")||B))return null;return HW.jsx(ZW.Provider,{value:B,children:HW.jsx(Z$,{ref:H,...J})})});var Q$=O(g(),1);var LX=O(g(),1),BW=LX.createContext(void 0);function J$(){let $=LX.useContext(BW);if($===void 0)throw Error(E0(71));return $}var __=O(d(),1),O_=Q$.forwardRef(function(Z,H){let{render:B,className:J,anchor:Q,positionMethod:X="absolute",side:z="top",align:G="center",sideOffset:F=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:N=!1,disableAnchorTracking:L=!1,collisionAvoidance:V=$9,...A}=Z,D=n4(),q=q_(),_=D.useState("open"),M=D.useState("mounted"),P=D.useState("trackCursorAxis"),C=D.useState("disableHoverablePopup"),R=D.useState("floatingRootContext"),y=D.useState("instantType"),w=D.useState("transitionStatus"),h=D.useState("hasViewport"),E=t8({anchor:Q,positionMethod:X,floatingRootContext:R,mounted:M,side:z,sideOffset:F,align:G,alignOffset:U,collisionBoundary:Y,collisionPadding:K,sticky:N,arrowPadding:W,disableAnchorTracking:L,keepMounted:q,collisionAvoidance:V,adaptiveOrigin:h?H$:void 0}),I=Q$.useMemo(()=>{let b={};if(!_||P==="both"||C)b.pointerEvents="none";return{role:"presentation",hidden:!M,style:{...E.positionerStyles,...b}}},[_,P,C,M,E.positionerStyles]),j=Q$.useMemo(()=>({open:_,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:P!=="none"?"tracking-cursor":y}),[_,E.side,E.align,E.anchorHidden,P,y]),S=Q$.useMemo(()=>({...j,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[j,E.arrowRef,E.arrowStyles,E.arrowUncentered]),k=F0("div",Z,{state:j,props:[I,K2(w),A],ref:[H,D.useStateSetter("positionerElement")],stateAttributesMapping:P1});return __.jsx(BW.Provider,{value:S,children:k})});var j_=O(g(),1);var di={...P1,...n1},T_=j_.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,X=n4(),{side:z,align:G}=J$(),F=X.useState("open"),U=X.useState("instantType"),Y=X.useState("transitionStatus"),K=X.useState("popupProps"),W=X.useState("floatingRootContext");y5({open:F,ref:X.context.popupRef,onComplete(){if(F)X.context.onOpenChangeComplete?.(!0)}});let N=X.useState("disabled"),L=X.useState("closeDelay");return h9(W,{enabled:!N,closeDelay:L}),F0("div",Z,{state:{open:F,side:z,align:G,instant:U,transitionStatus:Y},ref:[H,X.context.popupRef,X.useStateSetter("popupElement")],props:[K,K2(Y),Q],stateAttributesMapping:di})});var C_=O(g(),1);var w_=C_.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,z=n4().useState("instantType"),{open:G,arrowRef:F,side:U,align:Y,arrowUncentered:K,arrowStyles:W}=J$();return F0("div",Z,{state:{open:G,side:U,align:Y,uncentered:K,instant:z},ref:[H,F],props:[{style:W,"aria-hidden":!0},Q],stateAttributesMapping:P1})});var JW=O(g(),1);var QW=O(d(),1),E_=function(Z){let{delay:H,closeDelay:B,timeout:J=400}=Z,Q=JW.useMemo(()=>({delay:H,closeDelay:B}),[H,B]),X=JW.useMemo(()=>({open:H,close:B}),[H,B]);return QW.jsx($W.Provider,{value:Q,children:QW.jsx(SK,{delay:X,timeoutMs:J,children:Z.children})})};var h_=O(g(),1);var S_=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var h2=O(g(),1);var I_=O(g(),1);function R_($){let[Z,H]=I_.useState({current:$,previous:null});if($!==Z.current)H({current:$,previous:Z.current});return Z.previous}var v6=O(g(),1);function zW($){let Z=s7($),H=parseFloat(Z.width)||0,B=parseFloat(Z.height)||0,J=O5($),Q=J?$.offsetWidth:H,X=J?$.offsetHeight:B;if(XW(H)!==Q||XW(B)!==X)H=Q,B=X;return{width:H,height:B}}var li=typeof ResizeObserver<"u",ii=()=>!0;function b_($){let{popupElement:Z,positionerElement:H,content:B,mounted:J,enabled:Q=ii,onMeasureLayout:X,onMeasureLayoutComplete:z,side:G,direction:F}=$,U=d8(Z,!0,!1),Y=U4(),K=v6.useRef(null),W=v6.useRef(null),N=v6.useRef(!0),L=v6.useRef(a1),V=Y0(X),A=Y0(z),D=v6.useMemo(()=>{let q=G==="top",_=G==="left";if(F==="rtl")q=q||G==="inline-end",_=_||G==="inline-end";else q=q||G==="inline-start",_=_||G==="inline-start";return q?{position:"absolute",[G==="top"?"bottom":"top"]:"0",[_?"right":"left"]:"0"}:b1},[G,F]);U0(()=>{if(!J||!Q()||!li){L.current=a1,N.current=!0,K.current=null,W.current=null;return}if(!Z||!H)return;L.current=k_(Z,D);let q=new ResizeObserver((I)=>{let j=I[0];if(j)W.current={width:Math.ceil(j.borderBoxSize[0].inlineSize),height:Math.ceil(j.borderBoxSize[0].blockSize)}});q.observe(Z),AX(Z,"auto");let _=VX(Z,"position","static"),M=VX(Z,"transform","none"),P=VX(Z,"scale","1"),C=k_(H,{"--available-width":"max-content","--available-height":"max-content"});function R(){_(),M(),C()}function y(){R(),P()}if(V?.(),N.current||K.current===null){bH(H,"max-content");let I=zW(Z);return K.current=I,bH(H,I),y(),A?.(null,I),N.current=!1,()=>{q.disconnect(),L.current(),L.current=a1}}AX(Z,"auto"),bH(H,"max-content");let w=K.current??W.current,h=zW(Z);if(K.current=h,!w)return bH(H,h),y(),A?.(null,h),()=>{q.disconnect(),Y.cancel(),L.current(),L.current=a1};AX(Z,w),y(),A?.(w,h),bH(H,h);let E=new AbortController;return Y.request(()=>{AX(Z,h),U(()=>{Z.style.setProperty("--popup-width","auto"),Z.style.setProperty("--popup-height","auto")},E.signal)}),()=>{q.disconnect(),E.abort(),Y.cancel(),L.current(),L.current=a1}},[B,Z,H,U,Y,Q,J,V,A,D])}function VX($,Z,H){let B=$.style.getPropertyValue(Z);return $.style.setProperty(Z,H),()=>{$.style.setProperty(Z,B)}}function k_($,Z){let H=[];for(let[B,J]of Object.entries(Z))H.push(VX($,B,J));return H.length?()=>{H.forEach((B)=>B())}:a1}function AX($,Z){let H=Z==="auto"?"auto":`${Z.width}px`,B=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty("--popup-width",H),$.style.setProperty("--popup-height",B)}function bH($,Z){let H=Z==="max-content"?"max-content":`${Z.width}px`,B=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty("--positioner-width",H),$.style.setProperty("--positioner-height",B)}var X$=O(d(),1);function z$($){let{store:Z,side:H,cssVars:B,children:J}=$,Q=r4(),X=Z.useState("activeTriggerElement"),z=Z.useState("activeTriggerId"),G=Z.useState("open"),F=Z.useState("payload"),U=Z.useState("mounted"),Y=Z.useState("popupElement"),K=Z.useState("positionerElement"),W=R_(G?X:null),N=ni(z,F),L=h2.useRef(null),[V,A]=h2.useState(null),[D,q]=h2.useState(null),_=h2.useRef(null),M=h2.useRef(null),P=d8(_,!0,!1),C=U4(),[R,y]=h2.useState(null),[w,h]=h2.useState(!1);U0(()=>{return Z.set("hasViewport",!0),()=>{Z.set("hasViewport",!1)}},[Z]);let E=Y0(()=>{_.current?.style.setProperty("animation","none"),_.current?.style.setProperty("transition","none"),M.current?.style.setProperty("display","none")}),I=Y0((v)=>{if(_.current?.style.removeProperty("animation"),_.current?.style.removeProperty("transition"),M.current?.style.removeProperty("display"),v)y(v)}),j=h2.useRef(null);U0(()=>{if(X&&W&&X!==W&&j.current!==X&&L.current){A(L.current),h(!0);let v=ai(W,X);q(v),C.request(()=>{C.request(()=>{h(!1),P(()=>{A(null),y(null),L.current=null})})}),j.current=X}},[X,W,V,P,C]),U0(()=>{let v=_.current;if(!v)return;let c=document.createElement("div");for(let T of Array.from(v.childNodes))c.appendChild(T.cloneNode(!0));L.current=c});let S=V!=null,k;if(!S)k=X$.jsx("div",{"data-current":!0,ref:_,children:J},N);else k=X$.jsxs(h2.Fragment,{children:[X$.jsx("div",{"data-previous":!0,inert:p8(!0),ref:M,style:{[B.popupWidth]:`${R?.width}px`,[B.popupHeight]:`${R?.height}px`,position:"absolute"},"data-ending-style":w?void 0:""},"previous"),X$.jsx("div",{"data-current":!0,ref:_,"data-starting-style":w?"":void 0,children:J},N)]});U0(()=>{let v=M.current;if(!v||!V)return;v.replaceChildren(...Array.from(V.childNodes))},[V]),b_({popupElement:Y,positionerElement:K,mounted:U,content:F,onMeasureLayout:E,onMeasureLayoutComplete:I,side:H,direction:Q});let b={activationDirection:ri(D),transitioning:S};return{children:k,state:b}}function ri($){if(!$)return;return`${y_($.horizontal,5,"right","left")} ${y_($.vertical,5,"down","up")}`}function y_($,Z,H,B){if($>Z)return H;if($<-Z)return B;return""}function ai($,Z){let H=$.getBoundingClientRect(),B=Z.getBoundingClientRect(),J={x:H.left+H.width/2,y:H.top+H.height/2},Q={x:B.left+B.width/2,y:B.top+B.height/2};return{horizontal:Q.x-J.x,vertical:Q.y-J.y}}function ni($,Z){let[H,B]=h2.useState(0),J=h2.useRef($),Q=h2.useRef(Z),X=h2.useRef(!1);return U0(()=>{let z=J.current,G=Q.current,F=$!==z,U=Z!==G;if(F)B((Y)=>Y+1),X.current=!U;else if(X.current&&U)B((Y)=>Y+1),X.current=!1;J.current=$,Q.current=Z},[$,Z]),`${$??"current"}-${H}`}var oi={activationDirection:($)=>$?{"data-activation-direction":$}:null},x_=h_.forwardRef(function(Z,H){let{render:B,className:J,children:Q,...X}=Z,z=n4(),G=J$(),F=z.useState("instantType"),{children:U,state:Y}=z$({store:z,side:G.side,cssVars:S_,children:Q}),K={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:F};return F0("div",Z,{state:K,ref:H,props:[X,{children:U}],stateAttributesMapping:oi})});class DX{constructor(){this.store=new B$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(E0(81,$));this.store.setOpen(!0,M0(G0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,M0(G0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function v_(){return new DX}var g6=O(d(),1);function qX({delay:$=100,...Z}){return g6.jsx(x9.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function y1({...$}){return g6.jsx(x9.Root,{"data-slot":"tooltip",...$})}function h1({...$}){return g6.jsx(x9.Trigger,{"data-slot":"tooltip-trigger",...$})}function x1({className:$,side:Z="top",sideOffset:H=6,align:B="center",alignOffset:J=0,children:Q,...X}){return g6.jsx(x9.Portal,{children:g6.jsx(x9.Positioner,{align:B,alignOffset:J,side:Z,sideOffset:H,className:"isolate z-50",children:g6.jsx(x9.Popup,{"data-slot":"tooltip-content",className:s("z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...X,children:Q})})})}function MX({cooldownMs:$,windowMs:Z,maxPerWindow:H,maxKeys:B=256,now:J=Date.now}){let Q=new Map,X=0,z=0;return{admit(G){let F=J(),U=Q.get(G);if(U!==void 0&&F-U<$)return"cooldown";if(F-X>=Z)X=F,z=0;if(z>=H)return"window";if(z++,Q.set(G,F),Q.size>B)for(let Y of[...Q.keys()].slice(0,Math.ceil(B/2)))Q.delete(Y);return"ok"}}}var si=MX({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function q8($,Z){let H=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(si.admit(H)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var ti=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function g_($){if(!$)return null;let Z=ti.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var f_=!1;function m_(){if(f_)return;f_=!0;let $=(Z,H,B)=>{let J=H instanceof Error?H:null,Q=J?.stack??"",X=Z??g_(Q);if(!X)return;q8(X.workspaceId,{source:"window",kind:X.kind,name:X.name,message:J?.message||B||String(H),...Q?{stack:Q}:{}})};window.addEventListener("error",(Z)=>$(g_(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function F3($,Z){return`${$}:${Z}`}function G$($){return $==="running"}function c_($){return Object.values($).some(G$)}function yH($,Z,H){return G$($[F3(Z,H)])}function PX($,Z){let H=`${Z}:`;return Object.entries($).some(([B,J])=>B.startsWith(H)&&G$(J))}function d_($,Z,H){if(!H)return!1;let B=`${Z}:`,J=F3(Z,H);return Object.entries($).some(([Q,X])=>Q.startsWith(B)&&Q!==J&&G$(X))}function e2($,Z){return F3($,Z??"new")}var E1=p_()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,H,B)=>$((J)=>({activity:{...J.activity,[F3(Z,H)]:B}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((H)=>[F3(H.workspaceId,H.sessionId),H.activity]))})),setError:(Z,H,B)=>$((J)=>({errors:{...J.errors,[F3(Z,H)]:B}})),setPreview:(Z)=>$((H)=>({previews:{...H.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((H)=>{if(!(Z in H.previews))return H;let{[Z]:B,...J}=H.previews;return{previews:J}}),clearPreviewsForSession:(Z,H)=>$((B)=>{let J={},Q=!1;for(let[X,z]of Object.entries(B.previews))if(z.workspaceId===Z&&z.sessionId===H)Q=!0;else J[X]=z;return Q?{previews:J}:B}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,H)=>$((B)=>{let J={},Q=!1;for(let[X,z]of Object.entries(B.previews))if(H-z.updatedAt>Z)Q=!0;else J[X]=z;return Q?{previews:J}:B}),addAttachments:(Z,H,B)=>$((J)=>{let Q=e2(Z,H);return{attachments:{...J.attachments,[Q]:[...J.attachments[Q]??[],...B]}}}),updateAttachment:(Z,H,B,J)=>$((Q)=>{let X=e2(Z,H),z=Q.attachments[X];if(!z)return{};let G=z.find((F)=>F.localId===B);if(G?.previewUrl&&"previewUrl"in J&&J.previewUrl!==G.previewUrl)URL.revokeObjectURL(G.previewUrl);return{attachments:{...Q.attachments,[X]:z.map((F)=>F.localId===B?{...F,...J}:F)}}}),removeAttachment:(Z,H,B)=>$((J)=>{let Q=e2(Z,H),X=J.attachments[Q];if(!X)return{};let z=X.find((G)=>G.localId===B);if(z?.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...J.attachments,[Q]:X.filter((G)=>G.localId!==B)}}}),clearAttachments:(Z,H)=>$((B)=>{let J=e2(Z,H);for(let X of B.attachments[J]??[])if(X.previewUrl)URL.revokeObjectURL(X.previewUrl);let Q={...B.attachments};return delete Q[J],{attachments:Q}}),renameSession:(Z,H,B)=>$((J)=>{let Q=F3(Z,H),X=F3(Z,B),z={...J.activity},G={...J.errors};if(Q in z)z[X]=z[Q],delete z[Q];if(Q in G)G[X]=G[Q],delete G[Q];let F=J.previews,U=!1;for(let[Y,K]of Object.entries(J.previews))if(K.workspaceId===Z&&K.sessionId===H){if(!U)F={...J.previews},U=!0;F[Y]={...K,sessionId:B}}return{activity:z,errors:G,previews:F}})}));function l_($,Z,H){if(!H)return{root:null,byParent:{}};let B=null,J={};for(let Q of Object.values($)){if(Q.workspaceId!==Z||Q.sessionId!==H)continue;if(Q.parentToolUseId===null){if(!B||Q.updatedAt>B.updatedAt)B=Q}else{let X=J[Q.parentToolUseId];if(!X||Q.updatedAt>X.updatedAt)J[Q.parentToolUseId]=Q}}return{root:B,byParent:J}}function _2($){return u_(E1,$)}var w0={all:["workspaces"],discover:["workspaces","discover"],setupInfo:["workspaces","setup-info"],preview:($)=>["workspaces","preview",$],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],appletThumbnails:($)=>["workspaces","applet-thumbnails",$],views:($)=>["workspaces","views",$],viewBuilders:($)=>["workspaces","view-builders",$],sessions:($)=>["workspaces","sessions",$],events:($,Z)=>["workspaces","events",$,Z],sessionConfig:($,Z)=>["workspaces","sessionConfig",$,Z],mcp:($)=>["workspaces","mcp",$],agent:($)=>["workspaces","agent",$],skills:($)=>["workspaces","skills",$],env:($)=>["workspaces","env",$]};var hH=O(g(),1);var f6={all:["app-ui"],selectedSession:($)=>["app-ui","selected-session",$]};function ei($){return[...f6.selectedSession($),"save"]}function $r($,Z,H){let B=f6.selectedSession(Z),J=$.getQueryData(B),Q=J?.sessionId??null;if(J&&Q===H)return null;return $.setQueryData(B,{sessionId:H}),{sessionId:H,previousSessionId:Q}}function Zr($,Z,H,B){let J=f6.selectedSession(Z),Q=$.getQueryData(J);if(H.sessionId!==B.sessionId&&Q?.sessionId!==H.sessionId)return"conflict";if(Q?.sessionId!==B.sessionId&&Q?.sessionId!==B.previousSessionId)return"ignored";return $.setQueryData(J,H),"applied"}function Hr($,Z,H,B){if(B)return;$.setQueryData(f6.selectedSession(Z),{sessionId:H})}function i_($,Z,H,B){$.setQueryData(f6.selectedSession(Z),(J)=>J?.sessionId===H?{sessionId:B}:J)}function U3(){let $=H5(),Z=Z1(),H=hH.useMemo(()=>f6.selectedSession($),[$]),B=hH.useMemo(()=>ei($),[$]),J=$K({mutationKey:B,exact:!0}),Q=o1({queryKey:H,queryFn:()=>V1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),{mutate:X}=s1({mutationKey:B,scope:{id:`selected-session:${$}`},mutationFn:(F)=>V1(`/api/workspaces/${$}/selected-session`,n5("PUT",F),"Couldn’t save selected chat"),onSuccess:(F,U)=>{if(Zr(Z,$,F,U)!=="conflict")return;a4.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:H})},onError:(F,U)=>{if(Z.getQueryData(H)?.sessionId!==U.sessionId)return;a4.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:H})}}),z=hH.useCallback((F)=>{let U=$r(Z,$,F);if(U)X(U)},[Z,X,$]);return B2((F)=>{if(F.type!=="selected-session:updated"||F.workspaceId!==$)return;Hr(Z,$,F.sessionId,J>0)}),[Q.isLoading?void 0:Q.data?.sessionId??null,z]}function xH(){return{turns:[],notices:[]}}function vH($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let H=$.turns.findIndex((J)=>J.id===Z.turn.id);if(H>=0)return{...$,turns:$.turns.map((J,Q)=>Q===H?Z.turn:J)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let B=$.turns.findIndex((J)=>J.seq!==void 0&&J.seq>Z.turn.seq);if(B<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,B),Z.turn,...$.turns.slice(B)]}}case"notice":{if($.notices.some((H)=>H.id===Z.notice.id))return{...$,notices:$.notices.map((H)=>H.id===Z.notice.id?Z.notice:H)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function r_($){return $.reduce(vH,xH())}function n_($,Z){let{queryClient:H,sendMessage:B,onWorkspaceSwitch:J}=Z,Q=E1.getState();if($.type==="status_snapshot"){Q.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:F,sessionId:U,activity:Y}=$;if(Q.setActivity(F,U,Y),Y!=="running")Q.clearPreviewsForSession(F,U);return}if($.type==="preview"){let F=$,U=w0.events(F.workspaceId,F.sessionId);if(H?.getQueryData(U)===void 0)return;Q.setPreview({workspaceId:F.workspaceId,sessionId:F.sessionId,messageId:F.messageId,parentToolUseId:F.parentToolUseId,blocks:F.blocks});return}if($.type==="session_renamed"){let{workspaceId:F,from:U,to:Y}=$,K=w0.sessions(F),N=H?.getQueryData(K)?.find((A)=>A.sessionId===U||A.sessionId===Y);if(N)H?.cancelQueries({queryKey:K});if(Q.renameSession(F,U,Y),H)i_(H,F,U,Y);if(N)H?.setQueryData(K,(A)=>[{...N,sessionId:Y},...(A??[]).filter((D)=>D.sessionId!==U&&D.sessionId!==Y)]);let L=H?.getQueryData(w0.events(F,U));if(L!==void 0)H?.setQueryData(w0.events(F,Y),L),H?.removeQueries({queryKey:w0.events(F,U)});let V=H?.getQueryData(w0.sessionConfig(F,U));if(V!==void 0)H?.setQueryData(w0.sessionConfig(F,Y),V),H?.removeQueries({queryKey:w0.sessionConfig(F,U)});if(!N)H?.invalidateQueries({queryKey:K});H?.invalidateQueries({queryKey:w0.preview(F)});return}if($.type==="sessions_changed"){let F=$.workspaceId,U=w0.sessions(F);H?.invalidateQueries({queryKey:U}),H?.invalidateQueries({queryKey:w0.preview(F)});return}if($.type==="workspace:switch"){J?.($.workspaceId);return}if($.type==="scratchpad:op"){let F=a_($.workspaceId);if(!F)return;let U=$.opId;F($.op).then((Y)=>B({type:"scratchpad:op-result",opId:U,result:Y}),(Y)=>B({type:"scratchpad:op-result",opId:U,error:Y instanceof Error?Y.message:String(Y)}));return}let{workspaceId:X,sessionId:z}=$;if(!X||!z)return;let G=$.kind;if(G==="snapshot"||G==="turn"||G==="notice"||G==="result"){if(Br(H,X,z,$),G==="turn"){let F=$.turn?.meta?.apiMessageId;if(F)Q.clearPreview(F)}if(G==="result")Q.clearPreviewsForSession(X,z)}if(G==="error"&&typeof $.content==="string")Q.setError(X,z,$.content),Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z);if(G==="stopped")Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z)}function Br($,Z,H,B){let J=w0.events(Z,H),Q=$?.getQueryData(J);if(Q===void 0)return;$?.setQueryData(J,vH(Q,B))}var FW=null,F$=null,_X=0,OX=null,GW=[],t_=null,o_=null,Jr=15000;function e_($){if(FW=$,!o_)o_=setInterval(()=>E1.getState().sweepPreviews(Jr,Date.now()),5000);if(F$)return;$O()}function $O(){let $=++_X;if(OX)clearTimeout(OX),OX=null;let Z=new WebSocket(s_("/ws"));F$=Z,Z.onopen=()=>{if(_X!==$){Z.close();return}for(let H of GW)Z.send(JSON.stringify(H));GW.length=0,FW?.invalidateQueries({queryKey:["workspaces","events"]}),E1.getState().clearAllPreviews()},Z.onmessage=(H)=>{if(_X!==$)return;let B;try{B=JSON.parse(H.data)}catch{return}Qr(B)},Z.onclose=()=>{if(_X!==$)return;F$=null,OX=setTimeout($O,1000)},Z.onerror=()=>Z.close()}function Qr($){n_($,{queryClient:FW,sendMessage:jX,onWorkspaceSwitch:t_})}function jX($){if(F$&&F$.readyState===WebSocket.OPEN)F$.send(JSON.stringify($));else GW.push($)}function UW($){t_=$}var vY=O(g(),1);var Xr=($)=>ZO()(BO((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},viewBuilderDrafts:{},dockedChatWidth:360,setDiscoveredWorkspacesOpen:(H)=>Z({discoveredWorkspacesOpen:H}),markWorkspacePendingAnalysis:(H)=>Z((B)=>{let J=B.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:J.includes(H)?J:[...J,H]}}),markMessageSentFromMoi:(H)=>Z((B)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(B.workspaceIdsPendingAnalysis??[]).filter((J)=>J!==H)})),setComposerDraft:(H,B)=>Z((J)=>{let Q={...J.composerDrafts??{}};if(B)Q[H]=B;else delete Q[H];return{composerDrafts:Q}}),setViewBuilderDraft:(H,B)=>Z((J)=>{let Q=J.viewBuilderDrafts??{};if(B===null){if(!(H in Q))return J;let X={...Q};return delete X[H],{viewBuilderDrafts:X}}if(Q[H]===B)return J;return{viewBuilderDrafts:{...Q,[H]:B}}}),setDockedChatWidth:(H)=>Z({dockedChatWidth:H})}),$?{name:"moi:ui",storage:HO(()=>$)}:{name:"moi:ui"})),j5=Xr();function JO($,Z){let H=$??[],B=H.findIndex((J)=>J.id===Z.id||J.path===Z.path);if(B===-1)return[Z,...H];return H.map((J,Q)=>Q===B?{...J,...Z}:J)}function TX(){return o1({queryKey:w0.all,queryFn:()=>V1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function CX($){return o1({queryKey:w0.preview($),queryFn:()=>V1(`/api/workspaces/${$}/preview`),staleTime:60000})}function QO(){return o1({queryKey:w0.discover,queryFn:()=>V1("/api/workspaces/discover")})}function XO(){let $=Z1();return s1({mutationFn:(Z)=>V1("/api/workspaces",n5("POST",Z),"Failed to add workspace"),onSuccess:(Z,H)=>{j5.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(w0.all,(B)=>JO(B,Z)),$.setQueryData(w0.discover,(B)=>(B??[]).filter((J)=>J.path!==H.path))}})}function wX(){return o1({queryKey:w0.setupInfo,queryFn:()=>V1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function zO(){let $=Z1();return s1({mutationFn:(Z)=>V1("/api/workspaces/create",n5("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(w0.all,(H)=>JO(H,Z))}})}function GO(){let $=Z1();return s1({mutationFn:(Z)=>V1("/api/workspaces/order",n5("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:w0.all,exact:!0});let H=$.getQueryData(w0.all);if(H){let B=new Map(H.map((Q)=>[Q.id,Q])),J=Z.map((Q)=>B.get(Q)).filter((Q)=>Boolean(Q));if(J.length===H.length)$.setQueryData(w0.all,J)}return{previous:H}},onError:(Z,H,B)=>{if(B?.previous)$.setQueryData(w0.all,B.previous);$.invalidateQueries({queryKey:w0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(w0.all,Z)}})}function FO(){let $=Z1();return s1({mutationFn:(Z)=>S4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,H)=>{$.setQueryData(w0.all,(B)=>(B??[]).filter((J)=>J.id!==H)),$.invalidateQueries({queryKey:w0.discover})}})}var LO=O(g(),1);var UO=O(d(),1);function I4({className:$,...Z}){return UO.jsx(I5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:s("size-4 animate-spin",$),stroke:1.75,...Z})}var YW="Wait for active agents to finish, or stop them before updating moi";var zr=["update"],YO=300000,Gr=1000;function KO($){return o1({queryKey:zr,queryFn:()=>V1("/api/update"),staleTime:YO,refetchInterval:$?Gr:YO,refetchOnWindowFocus:!0,retry:!1})}function WO(){return s1({mutationFn:()=>V1("/api/update",{method:"POST"},"Could not update moi")})}var v9=O(d(),1);function Fr($,Z){return!!Z&&$?.runningVersion===Z}function Ur($,Z,H){let B=Z||H,J=$&&!B;return{busy:B,blocked:J,label:Z?"Updating":H?"Restarting":J?YW:"Update"}}function AO(){let $=WO(),Z=KO($.isSuccess),H=_2((z)=>c_(z.activity)),B=Z.data,J=$.data?.installedVersion??null;if(LO.useEffect(()=>{if(Fr(B,J))window.location.reload()},[J,B]),Z.isPending)return{status:"loading"};if(!B?.availableVersion&&!$.isSuccess)return{status:"unavailable"};let Q=$.isSuccess;return{status:"available",button:{...Ur(H,$.isPending,Q),errorMessage:$.error?.message??null,onClick:()=>$.mutate()}}}function VO({busy:$,blocked:Z,label:H,errorMessage:B,onClick:J}){return v9.jsxs(y1,{children:[v9.jsx(h1,{render:v9.jsx("div",{children:v9.jsx(T0,{type:"button",size:"icon",variant:$?"ghost":"default","aria-label":H,disabled:Z||$,onClick:J,children:$?v9.jsx(I4,{stroke:1.5}):v9.jsx(NO,{stroke:1.5})})})}),v9.jsx(x1,{side:"right",className:Z?"max-w-56":void 0,children:Z?YW:B??H})]})}var oH=O(g(),1);var M8={};j4(M8,{createHandle:()=>rO,Viewport:()=>cO,Trigger:()=>iO,Title:()=>lO,Root:()=>pO,Portal:()=>kO,Popup:()=>EO,Handle:()=>yX,Description:()=>OO,Close:()=>PO,Backdrop:()=>qO});var DO=O(g(),1);var EX=O(g(),1),KW=EX.createContext(void 0);function W2($){let Z=EX.useContext(KW);if($===!1&&Z===void 0)throw Error(E0(27));return Z}var Yr={...P1,...n1},qO=DO.forwardRef(function(Z,H){let{render:B,className:J,forceRender:Q=!1,...X}=Z,{store:z}=W2(),G=z.useState("open"),F=z.useState("nested"),U=z.useState("mounted"),Y=z.useState("transitionStatus");return F0("div",Z,{state:{open:G,transitionStatus:Y},ref:[z.context.backdropRef,H],stateAttributesMapping:Yr,props:[{role:"presentation",hidden:!U,style:{userSelect:"none",WebkitUserSelect:"none"}},X],enabled:Q||!F})});var MO=O(g(),1);var PO=MO.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,...z}=Z,{store:G}=W2(),F=G.useState("open");function U(N){if(F)G.setOpen(!1,M0(G0.closePress,N.nativeEvent))}let{getButtonProps:Y,buttonRef:K}=u5({disabled:Q,native:X});return F0("button",Z,{state:{disabled:Q},ref:[H,K],props:[{onClick:U},z,Y]})});var _O=O(g(),1);var OO=_O.forwardRef(function(Z,H){let{render:B,className:J,id:Q,...X}=Z,{store:z}=W2(),G=H1(Q);return z.useSyncedValueWithCleanup("descriptionElementId",G),F0("p",Z,{ref:H,props:[{id:G},X]})});var CO=O(g(),1);var jO=function($){return $.nestedDialogs="--nested-dialogs",$}({});var TO=function($){return $[$.open=E4.open]="open",$[$.closed=E4.closed]="closed",$[$.startingStyle=E4.startingStyle]="startingStyle",$[$.endingStyle=E4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var SX=O(g(),1),WW=SX.createContext(void 0);function IX(){let $=SX.useContext(WW);if($===void 0)throw Error(E0(26));return $}var gH="ArrowUp",fH="ArrowDown",mH="ArrowLeft",pH="ArrowRight",uH="Home",cH="End",Kr=new Set([mH,pH]);var Wr=new Set([gH,fH]);var Nr=new Set([...Kr,...Wr]),eq0=new Set([...Nr,uH,cH]),Y3=new Set([gH,fH,mH,pH,uH,cH]);var wO=O(d(),1),Lr={...P1,...n1,nestedDialogOpen($){return $?{[TO.nestedDialogOpen]:""}:null}},EO=CO.forwardRef(function(Z,H){let{className:B,finalFocus:J,initialFocus:Q,render:X,...z}=Z,{store:G}=W2(),F=G.useState("descriptionElementId"),U=G.useState("disablePointerDismissal"),Y=G.useState("floatingRootContext"),K=G.useState("popupProps"),W=G.useState("modal"),N=G.useState("mounted"),L=G.useState("nested"),V=G.useState("nestedOpenDialogCount"),A=G.useState("open"),D=G.useState("openMethod"),q=G.useState("titleElementId"),_=G.useState("transitionStatus"),M=G.useState("role");IX(),y5({open:A,ref:G.context.popupRef,onComplete(){if(A)G.context.onOpenChangeComplete?.(!0)}});function P(h){if(h==="touch")return G.context.popupRef.current;return!0}let C=Q===void 0?P:Q,R=V>0,w=F0("div",Z,{state:{open:A,nested:L,transitionStatus:_,nestedDialogOpen:R},props:[K,{"aria-labelledby":q??void 0,"aria-describedby":F??void 0,role:M,tabIndex:-1,hidden:!N,onKeyDown(h){if(Y3.has(h.key))h.stopPropagation()},style:{[jO.nestedDialogs]:V}},z],ref:[H,G.context.popupRef,G.useStateSetter("popupElement")],stateAttributesMapping:Lr});return wO.jsx(I6,{context:Y,openInteractionType:D,disabled:!N,closeOnFocusOut:!U,initialFocus:C,returnFocus:J,modal:W!==!1,restoreFocus:"popup",children:w})});var RO=O(g(),1);var SO=O(g(),1),IO=O(d(),1),U$=SO.forwardRef(function(Z,H){let{cutout:B,...J}=Z,Q;if(B){let X=B?.getBoundingClientRect();Q=`polygon(
13
- 0% 0%,
14
- 100% 0%,
15
- 100% 100%,
16
- 0% 100%,
17
- 0% 0%,
18
- ${X.left}px ${X.top}px,
19
- ${X.left}px ${X.bottom}px,
20
- ${X.right}px ${X.bottom}px,
21
- ${X.right}px ${X.top}px,
22
- ${X.left}px ${X.top}px
23
- )`}return IO.jsx("div",{ref:H,role:"presentation","data-base-ui-inert":"",...J,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Q}})});var dH=O(d(),1),kO=RO.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z,{store:Q}=W2(),X=Q.useState("mounted"),z=Q.useState("modal"),G=Q.useState("open");if(!(X||B))return null;return dH.jsx(WW.Provider,{value:B,children:dH.jsxs(S6,{ref:H,...J,children:[X&&z===!0&&dH.jsx(U$,{ref:Q.context.internalBackdropRef,inert:p8(!G)}),Z.children]})})});var fO=O(g(),1);var o4=O(g(),1);var bO={},yO={},hO="";function Ar($){if(typeof document>"u")return!1;let Z=m0($);return I2(Z).innerWidth-Z.documentElement.clientWidth>0}function Vr($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let H=m0($),B=H.documentElement,J=H.body,Q=RX(B)?B:J,X=Q.style.overflowY,z=B.style.scrollbarGutter;B.style.scrollbarGutter="stable",Q.style.overflowY="scroll";let G=Q.offsetWidth;Q.style.overflowY="hidden";let F=Q.offsetWidth;return Q.style.overflowY=X,B.style.scrollbarGutter=z,G===F}function Dr($){let Z=m0($),H=Z.documentElement,B=Z.body,J=RX(H)?H:B,Q={overflowY:J.style.overflowY,overflowX:J.style.overflowX};return Object.assign(J.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(J.style,Q)}}function qr($){let Z=m0($),H=Z.documentElement,B=Z.body,J=I2(H),Q=0,X=0,z=!1,G=N5.create();if(jQ&&(J.visualViewport?.scale??1)!==1)return()=>{};function F(){let K=J.getComputedStyle(H),W=J.getComputedStyle(B),V=(K.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";Q=H.scrollTop,X=H.scrollLeft,bO={scrollbarGutter:H.style.scrollbarGutter,overflowY:H.style.overflowY,overflowX:H.style.overflowX},hO=H.style.scrollBehavior,yO={position:B.style.position,height:B.style.height,width:B.style.width,boxSizing:B.style.boxSizing,overflowY:B.style.overflowY,overflowX:B.style.overflowX,scrollBehavior:B.style.scrollBehavior};let A=H.scrollHeight>H.clientHeight,D=H.scrollWidth>H.clientWidth,q=K.overflowY==="scroll"||W.overflowY==="scroll",_=K.overflowX==="scroll"||W.overflowX==="scroll",M=Math.max(0,J.innerWidth-B.clientWidth),P=Math.max(0,J.innerHeight-B.clientHeight),C=parseFloat(W.marginTop)+parseFloat(W.marginBottom),R=parseFloat(W.marginLeft)+parseFloat(W.marginRight),y=RX(H)?H:B;if(z=Vr($),z){H.style.scrollbarGutter=V,y.style.overflowY="hidden",y.style.overflowX="hidden";return}if(Object.assign(H.style,{scrollbarGutter:V,overflowY:"hidden",overflowX:"hidden"}),A||q)H.style.overflowY="scroll";if(D||_)H.style.overflowX="scroll";Object.assign(B.style,{position:"relative",height:C||P?`calc(100dvh - ${C+P}px)`:"100dvh",width:R||M?`calc(100vw - ${R+M}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),B.scrollTop=Q,B.scrollLeft=X,H.setAttribute("data-base-ui-scroll-locked",""),H.style.scrollBehavior="unset"}function U(){if(Object.assign(H.style,bO),Object.assign(B.style,yO),!z)H.scrollTop=Q,H.scrollLeft=X,H.removeAttribute("data-base-ui-scroll-locked"),H.style.scrollBehavior=hO}function Y(){U(),G.request(F)}return F(),J.addEventListener("resize",Y),()=>{if(G.cancel(),U(),typeof J.removeEventListener==="function")J.removeEventListener("resize",Y)}}class xO{lockCount=0;restore=null;timeoutLock=r5.create();timeoutUnlock=r5.create();acquire($){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock($));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock($){if(this.lockCount===0||this.restore!==null)return;let H=m0($).documentElement,B=I2(H).getComputedStyle(H).overflowY;if(B==="hidden"||B==="clip"){this.restore=a1;return}let J=TQ||!Ar($);this.restore=J?Dr($):qr($)}}var Mr=new xO;function Y$($=!0,Z=null){U0(()=>{if(!$)return;return Mr.acquire(Z)},[$,Z])}var K$=O(g(),1);var lH=O(g(),1);function vO($){let Z=lH.useRef(""),H=lH.useCallback((J)=>{if(J.defaultPrevented)return;Z.current=J.pointerType,$(J,J.pointerType)},[$]);return{onClick:lH.useCallback((J)=>{if(J.detail===0){$(J,"keyboard");return}if("pointerType"in J)$(J,J.pointerType);else $(J,Z.current);Z.current=""},[$]),onPointerDown:H}}function W$($){let[Z,H]=K$.useState(null),B=Y0((z,G)=>{if(!$)H(G||(TQ?"touch":""))}),J=K$.useCallback(()=>{H(null)},[]),{onClick:Q,onPointerDown:X}=vO(B);return K$.useMemo(()=>({openMethod:Z,reset:J,triggerProps:{onClick:Q,onPointerDown:X}}),[Z,J,Q,X])}function gO($){let{store:Z,parentContext:H,actionsRef:B}=$,J=Z.useState("open"),Q=Z.useState("disablePointerDismissal"),X=Z.useState("modal"),z=Z.useState("popupElement"),{openMethod:G,triggerProps:F,reset:U}=W$(J);r8(Z);let{forceUnmount:Y}=a8(J,Z,()=>{U()}),K=Y0((w)=>{let h=M0(w);return h.preventUnmountOnClose=()=>{Z.set("preventUnmountingOnClose",!0)},h}),W=o4.useCallback(()=>{Z.setOpen(!1,K(G0.imperativeAction))},[Z,K]);o4.useImperativeHandle(B,()=>({unmount:Y,close:W}),[Y,W]);let N=A8({popupStore:Z,onOpenChange:Z.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[L,V]=o4.useState(0),A=L===0,D=h6(N),q=L8(N,{outsidePressEvent(){if(Z.context.internalBackdropRef.current||Z.context.backdropRef.current)return"intentional";return{mouse:X==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(w){if(!Z.context.outsidePressEnabledRef.current)return!1;if("button"in w&&w.button!==0)return!1;if("touches"in w&&w.touches.length!==1)return!1;let h=g1(w);if(A&&!Q){let E=h;if(X)return Z.context.internalBackdropRef.current||Z.context.backdropRef.current?Z.context.internalBackdropRef.current===E||Z.context.backdropRef.current===E||f0(E,z)&&!E?.hasAttribute("data-base-ui-portal"):!0;return!0}return!1},escapeKey:A});Y$(J&&X===!0,z);let{getReferenceProps:_,getFloatingProps:M,getTriggerProps:P}=Z2([D,q]);Z.useContextCallback("onNestedDialogOpen",(w)=>{V(w+1)}),Z.useContextCallback("onNestedDialogClose",()=>{V(0)}),o4.useEffect(()=>{if(H?.onNestedDialogOpen&&J)H.onNestedDialogOpen(L);if(H?.onNestedDialogClose&&!J)H.onNestedDialogClose();return()=>{if(H?.onNestedDialogClose&&J)H.onNestedDialogClose()}},[J,H,L]);let C=o4.useMemo(()=>_(F),[_,F]),R=o4.useMemo(()=>P(F),[P,F]),y=o4.useMemo(()=>M(),[M]);Z.useSyncedValues({openMethod:G,activeTriggerProps:C,inactiveTriggerProps:R,popupProps:y,floatingRootContext:N,nestedOpenDialogCount:L})}var kX=O(g(),1);var Pr={...o8,modal:S0(($)=>$.modal),nested:S0(($)=>$.nested),nestedOpenDialogCount:S0(($)=>$.nestedOpenDialogCount),disablePointerDismissal:S0(($)=>$.disablePointerDismissal),openMethod:S0(($)=>$.openMethod),descriptionElementId:S0(($)=>$.descriptionElementId),titleElementId:S0(($)=>$.titleElementId),viewportElement:S0(($)=>$.viewportElement),role:S0(($)=>$.role)};class iH extends n2{constructor($){super(_r($),{popupRef:kX.createRef(),backdropRef:kX.createRef(),internalBackdropRef:kX.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new s2,onOpenChange:void 0,onOpenChangeComplete:void 0},Pr)}setOpen=($,Z)=>{if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!$&&Z.trigger==null&&this.state.activeTriggerId!=null)Z.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;let H={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",H);let B={open:$},J=Z.trigger?.id??null;if(J||$)B.activeTriggerId=J,B.activeTriggerElement=Z.trigger??null;this.update(B)}}function _r($={}){return{...n8(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...$}}var mO=O(d(),1);function pO($){let{children:Z,open:H,defaultOpen:B=!1,onOpenChange:J,onOpenChangeComplete:Q,disablePointerDismissal:X=!1,modal:z=!0,actionsRef:G,handle:F,triggerId:U,defaultTriggerId:Y=null}=$,K=W2(!0),W=Boolean(K),N=k1(()=>{return F?.store??new iH({open:B,openProp:H,activeTriggerId:Y,triggerIdProp:U,modal:z,disablePointerDismissal:X,nested:W})}).current;Z9(()=>{if(H===void 0&&N.state.open===!1&&B===!0)N.update({open:!0,activeTriggerId:Y})}),N.useControlledProp("openProp",H),N.useControlledProp("triggerIdProp",U),N.useSyncedValues({disablePointerDismissal:X,nested:W,modal:z}),N.useContextCallback("onOpenChange",J),N.useContextCallback("onOpenChangeComplete",Q);let L=N.useState("payload");gO({store:N,actionsRef:G,parentContext:K?.store.context,onOpenChange:J,triggerIdProp:U});let V=fO.useMemo(()=>({store:N}),[N]);return mO.jsx(KW.Provider,{value:V,children:typeof Z==="function"?Z({payload:L}):Z})}var uO=O(g(),1);var NW=function($){return $[$.open=E4.open]="open",$[$.closed=E4.closed]="closed",$[$.startingStyle=E4.startingStyle]="startingStyle",$[$.endingStyle=E4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var Or={...P1,...n1,nested($){return $?{[NW.nested]:""}:null},nestedDialogOpen($){return $?{[NW.nestedDialogOpen]:""}:null}},cO=uO.forwardRef(function(Z,H){let{className:B,render:J,children:Q,...X}=Z,z=IX(),{store:G}=W2(),F=G.useState("open"),U=G.useState("nested"),Y=G.useState("transitionStatus"),K=G.useState("nestedOpenDialogCount"),W=G.useState("mounted"),N=K>0;return F0("div",Z,{enabled:z||W,state:{open:F,nested:U,transitionStatus:Y,nestedDialogOpen:N},ref:[H,G.useStateSetter("viewportElement")],stateAttributesMapping:Or,props:[{role:"presentation",hidden:!W,style:{pointerEvents:!F?"none":void 0},children:Q},X]})});var dO=O(g(),1);var lO=dO.forwardRef(function(Z,H){let{render:B,className:J,id:Q,...X}=Z,{store:z}=W2(),G=H1(Q);return z.useSyncedValueWithCleanup("titleElementId",G),F0("h2",Z,{ref:H,props:[{id:G},X]})});var bX=O(g(),1);var iO=bX.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,id:z,payload:G,handle:F,...U}=Z,Y=W2(!0),K=F?.store??Y?.store;if(!K)throw Error(E0(79));let W=H1(z),N=K.useState("floatingRootContext"),L=K.useState("isOpenedByTrigger",W),V=bX.useRef(null),{registerTrigger:A,isMountedByThisTrigger:D}=i8(W,V,K,{payload:G}),{getButtonProps:q,buttonRef:_}=u5({disabled:Q,native:X}),M=y9(N,{enabled:N!=null}),P=Z2([M]),C={disabled:Q,open:L},R=K.useState("triggerProps",D);return F0("button",Z,{state:C,ref:[_,H,A,V],props:[P.getReferenceProps(),R,{[t7]:"",id:W},U,q],stateAttributesMapping:e8})});class yX{constructor($){this.store=$??new iH}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;this.store.setOpen(!0,M0(G0.imperativeAction,void 0,Z))}openWithPayload($){this.store.set("payload",$),this.store.setOpen(!0,M0(G0.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,M0(G0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function rO(){return new yX}var B9=O(d(),1);function K3({...$}){return B9.jsx(M8.Root,{"data-slot":"dialog",...$})}function hX({...$}){return B9.jsx(M8.Trigger,{"data-slot":"dialog-trigger",...$})}function N$({...$}){return B9.jsx(M8.Close,{"data-slot":"dialog-close",...$})}function L$({className:$,children:Z,...H}){return B9.jsxs(M8.Portal,{children:[B9.jsx(M8.Backdrop,{"data-slot":"dialog-backdrop",className:"fixed inset-0 z-50 bg-foreground/40 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),B9.jsx(M8.Popup,{"data-slot":"dialog-content",className:s("fixed top-1/2 left-1/2 z-50 origin-center -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl bg-card text-card-foreground shadow-xl outline-hidden duration-150 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...H,children:Z})]})}function W3({className:$,...Z}){return B9.jsx(M8.Title,{"data-slot":"dialog-title",className:s("text-lg font-semibold",$),...Z})}function A$({className:$,...Z}){return B9.jsx(M8.Description,{"data-slot":"dialog-description",className:s("text-sm text-muted-foreground",$),...Z})}var Fj=O(g(),1);var iX={};j4(iX,{Validity:()=>Qj,Root:()=>sO,Label:()=>tO,Item:()=>Gj,Error:()=>eO,Description:()=>Zj,Control:()=>Bj});var L2=O(g(),1);var xX=O(g(),1);var LW=function($){return $.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var m6={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},x2={valid($){if($===null)return null;if($)return{[LW.valid]:""};return{[LW.invalid]:""}}};var AW=xX.createContext({invalid:void 0,name:void 0,validityData:{state:m6,errors:[],error:"",value:"",initialValue:null},setValidityData:a1,disabled:void 0,touched:!1,setTouched:a1,dirty:!1,setDirty:a1,filled:!1,setFilled:a1,focused:!1,setFocused:a1,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:($=b1)=>$,getInputValidationProps:($=b1)=>$,inputRef:{current:null},commit:async()=>{}}});function h5($=!0){let Z=xX.useContext(AW);if(Z.setValidityData===a1&&!$)throw Error(E0(28));return Z}var vX=O(g(),1),jr=vX.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function aO($=!1){let Z=vX.useContext(jr);if(!Z&&!$)throw Error(E0(86));return Z}var gX=O(g(),1);var Tr=gX.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:a1,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function s4(){return gX.useContext(Tr)}var N3=O(g(),1);var fX=O(g(),1);var VW=fX.createContext({controlId:void 0,registerControlId:a1,labelId:void 0,setLabelId:a1,messageIds:[],setMessageIds:a1,getDescriptionProps:($)=>$});function N2(){return fX.useContext(VW)}var nO=O(d(),1),mX=function(Z){let H=H1(),[B,J]=N3.useState(Z.initialControlId===void 0?H:Z.initialControlId),[Q,X]=N3.useState(void 0),[z,G]=N3.useState([]),F=k1(()=>new Map),{messageIds:U}=N2(),Y=Y0((N,L)=>{let V=F.current;if(L===void 0){V.delete(N);return}V.set(N,L),J((A)=>{if(V.size===0)return;let D;for(let q of V.values()){if(A!==void 0&&q===A)return A;if(D===void 0)D=q}return D})}),K=N3.useCallback((N)=>{return W4({"aria-describedby":U.concat(z).join(" ")||void 0},N)},[U,z]),W=N3.useMemo(()=>({controlId:B,registerControlId:Y,labelId:Q,setLabelId:X,messageIds:z,setMessageIds:G,getDescriptionProps:K}),[B,Y,Q,X,z,G,K]);return nO.jsx(VW.Provider,{value:W,children:Z.children})};var u6=O(g(),1);function p6($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var pX=Object.keys(m6);function Cr($){if(!$||$.valid||!$.valueMissing)return!1;let Z=!1;for(let H of pX){if(H==="valid")continue;if(H==="valueMissing")Z=$[H];if($[H])Z=!1}return Z}function oO($){let{formRef:Z,clearErrors:H}=s4(),{setValidityData:B,validate:J,validityData:Q,validationDebounceTime:X,invalid:z,markedDirtyRef:G,state:F,name:U,shouldValidateOnChange:Y}=$,{controlId:K,getDescriptionProps:W}=N2(),N=_5(),L=u6.useRef(null),V=Y0(async(q,_=!1)=>{let M=L.current;if(!M)return;if(_){if(F.valid!==!1)return;let I=M.validity;if(!I.valueMissing){let S={value:q,state:{...m6,valid:!0},error:"",errors:[],initialValue:Q.initialValue};if(M.setCustomValidity(""),K){let k=Z.current.fields.get(K);if(k)Z.current.fields.set(K,{...k,...p6(S,!1)})}B(S);return}let j=pX.reduce((S,k)=>{return S[k]=I[k],S},{});if(!j.valid&&!Cr(j))return}function P(I){let j=pX.reduce((k,b)=>{return k[b]=I.validity[b],k},{}),S=!1;for(let k of pX){if(k==="valid")continue;if(k==="valueMissing"&&j[k])S=!0;else if(j[k])return j}if(S&&!G.current)j.valid=!0,j.valueMissing=!1;return j}N.clear();let C=null,R=[],y=P(M),w,h=Y();if(M.validationMessage&&!h)w=M.validationMessage,R=[M.validationMessage];else{let I=Array.from(Z.current.fields.values()).reduce((S,k)=>{if(k.name)S[k.name]=k.getValue();return S},{}),j=J(q,I);if(typeof j==="object"&&j!==null&&"then"in j)C=await j;else C=j;if(C!==null){if(y.valid=!1,y.customError=!0,Array.isArray(C))R=C,M.setCustomValidity(C.join(`
24
- `));else if(C)R=[C],M.setCustomValidity(C)}else if(h){if(M.setCustomValidity(""),y.customError=!1,M.validationMessage)w=M.validationMessage,R=[M.validationMessage];else if(M.validity.valid&&!y.valid)y.valid=!0}}let E={value:q,state:y,error:w??(Array.isArray(C)?C[0]:C??""),errors:R,initialValue:Q.initialValue};if(K){let I=Z.current.fields.get(K);if(I)Z.current.fields.set(K,{...I,...p6(E,z)})}B(E)}),A=u6.useCallback((q={})=>W4(W,F.valid===!1?{"aria-invalid":!0}:b1,q),[W,F.valid]),D=u6.useCallback((q={})=>W4({onChange(_){if(_.nativeEvent.defaultPrevented)return;if(H(U),!Y()){V(_.currentTarget.value,!0);return}if(z)return;let M=_.currentTarget;if(M.value===""){V(M.value);return}if(N.clear(),X)N.start(X,()=>{V(M.value)});else V(M.value)}},A(q)),[A,H,U,N,V,z,X,Y]);return u6.useMemo(()=>({getValidationProps:A,getInputValidationProps:D,inputRef:L,commit:V}),[A,D,V])}var uX=O(d(),1),wr=L2.forwardRef(function(Z,H){let{errors:B,validationMode:J,submitAttemptedRef:Q}=s4(),{render:X,className:z,validate:G,validationDebounceTime:F=0,validationMode:U=J,name:Y,disabled:K=!1,invalid:W,dirty:N,touched:L,actionsRef:V,...A}=Z,{disabled:D}=aO(),q=Y0(G||(()=>null)),_=D||K,[M,P]=L2.useState(!1),[C,R]=L2.useState(!1),[y,w]=L2.useState(!1),[h,E]=L2.useState(!1),I=N??C,j=L??M,S=L2.useRef(!1),k=Y0((K0)=>{if(N!==void 0)return;if(K0)S.current=!0;R(K0)}),b=Y0((K0)=>{if(L!==void 0)return;P(K0)}),v=Y0(()=>U==="onChange"||U==="onSubmit"&&Q.current),c=Boolean(W||Y&&{}.hasOwnProperty.call(B,Y)&&B[Y]!==void 0),[T,e]=L2.useState({state:m6,error:"",errors:[],value:null,initialValue:null}),Z0=!c&&T.state.valid,x=L2.useMemo(()=>({disabled:_,touched:j,dirty:I,valid:Z0,filled:y,focused:h}),[_,j,I,Z0,y,h]),t=oO({setValidityData:e,validate:q,validityData:T,validationDebounceTime:F,invalid:c,markedDirtyRef:S,state:x,name:Y,shouldValidateOnChange:v}),D0=L2.useCallback(()=>{S.current=!0,t.commit(T.value)},[t,T]);L2.useImperativeHandle(V,()=>({validate:D0}),[D0]);let p=L2.useMemo(()=>({invalid:c,name:Y,validityData:T,setValidityData:e,disabled:_,touched:j,setTouched:b,dirty:I,setDirty:k,filled:y,setFilled:w,focused:h,setFocused:E,validate:q,validationMode:U,validationDebounceTime:F,shouldValidateOnChange:v,state:x,markedDirtyRef:S,validation:t}),[c,Y,T,_,j,b,I,k,y,w,h,E,q,U,F,v,x,t]),X0=F0("div",Z,{ref:H,state:x,props:A,stateAttributesMapping:x2});return uX.jsx(AW.Provider,{value:p,children:X0})}),sO=L2.forwardRef(function(Z,H){return uX.jsx(mX,{children:uX.jsx(wr,{...Z,ref:H})})});var rH=O(g(),1);var tO=rH.forwardRef(function(Z,H){let{render:B,className:J,id:Q,nativeLabel:X=!0,...z}=Z,G=h5(!1),{controlId:F,setLabelId:U,labelId:Y}=N2(),K=H1(Q),W=rH.useRef(null),N=Y0((V)=>{if(g1(V.nativeEvent)?.closest("button,input,select,textarea"))return;if(!V.defaultPrevented&&V.detail>1)V.preventDefault();if(X||!F)return;let D=m0(V.currentTarget).getElementById(F);if(O5(D))D.focus({focusVisible:!0})});return U0(()=>{if(K)U(K);return()=>{U(void 0)}},[K,U]),F0("label",Z,{ref:[H,W],state:G.state,props:[{id:Y},X?{htmlFor:F??void 0,onMouseDown:N}:{onClick:N,onPointerDown(V){V.preventDefault()}},z],stateAttributesMapping:x2})});var c6=O(g(),1);var DW=O(d(),1),Er={...x2,...n1},eO=c6.forwardRef(function(Z,H){let{render:B,id:J,className:Q,match:X,...z}=Z,G=H1(J),{validityData:F,state:U,name:Y}=h5(!1),{setMessageIds:K}=N2(),{errors:W}=s4(),N=Y?W[Y]:null,L=!1;if(N||X===!0)L=!0;else if(X)L=Boolean(F.state[X]);else L=F.state.valid===!1;let{mounted:V,transitionStatus:A,setMounted:D}=i4(L);U0(()=>{if(!L||!G)return;return K((E)=>E.concat(G)),()=>{K((E)=>E.filter((I)=>I!==G))}},[L,G,K]);let q=c6.useRef(null),[_,M]=c6.useState(null),[P,C]=c6.useState(null),R=N||(F.errors.length>1?DW.jsx("ul",{children:F.errors.map((E)=>DW.jsx("li",{children:E},E))}):F.error),y=F.error;if(N!=null)y=Array.isArray(N)?JSON.stringify(N):N;else if(F.errors.length>1)y=JSON.stringify(F.errors);if(L&&y!==P)C(y),M(R);y5({open:L,ref:q,onComplete(){if(!L)D(!1)}});let w={...U,transitionStatus:A},h=F0("div",Z,{ref:[H,q],state:w,props:[{id:G,children:L?R:_},z],stateAttributesMapping:Er,enabled:V});if(!V)return null;return h});var $j=O(g(),1);var Zj=$j.forwardRef(function(Z,H){let{render:B,id:J,className:Q,...X}=Z,z=H1(J),G=h5(!1),{setMessageIds:F}=N2();return U0(()=>{if(!z)return;return F((Y)=>Y.concat(z)),()=>{F((Y)=>Y.filter((K)=>K!==z))}},[z,F]),F0("p",Z,{ref:H,state:G.state,props:[{id:z},X],stateAttributesMapping:x2})});var cX=O(g(),1);var d6=O(g(),1);function t4({controlled:$,default:Z,name:H,state:B="value"}){let{current:J}=d6.useRef($!==void 0),[Q,X]=d6.useState(Z),z=J?$:Q,G=d6.useCallback((F)=>{if(!J)X(F)},[]);return[z,G]}var aH=O(g(),1);function V$($={}){let{id:Z,implicit:H=!1,controlRef:B}=$,{controlId:J,registerControlId:Q}=N2(),X=H1(Z),z=H?J:void 0,G=k1(()=>Symbol("labelable-control")),F=aH.useRef(!1),U=aH.useRef(Z!=null),Y=Y0(()=>{if(!F.current||Q===a1)return;F.current=!1,Q(G.current,void 0)});return U0(()=>{if(Q===a1)return;let K;if(H){let W=B?.current;if(T1(W)&&W.closest("label")!=null)K=Z??null;else K=z??X}else if(Z!=null)U.current=!0,K=Z;else if(U.current)K=X;else{Y();return}if(K===void 0){Y();return}F.current=!0,Q(G.current,K);return},[Z,B,z,Q,H,X,G,Y]),aH.useEffect(()=>{return Y},[Y]),J??X}var Hj=O(Y4(),1);function D$($){let{enabled:Z=!0,value:H,id:B,name:J,controlRef:Q,commit:X}=$,{formRef:z}=s4(),{invalid:G,markedDirtyRef:F,validityData:U,setValidityData:Y}=h5(),K=Y0($.getValue);U0(()=>{if(!Z)return;let W=H;if(W===void 0)W=K();if(U.initialValue===null&&W!==null)Y((N)=>({...N,initialValue:W}))},[Z,Y,H,U.initialValue,K]),U0(()=>{if(!Z||!B)return;z.current.fields.set(B,{getValue:K,name:J,controlRef:Q,validityData:p6(U,G),validate(W=!0){let N=H;if(N===void 0)N=K();if(F.current=!0,!W)X(N);else Hj.flushSync(()=>X(N))}})},[X,Q,Z,z,K,B,G,F,J,U,H]),U0(()=>{let W=z.current.fields;return()=>{if(B)W.delete(B)}},[z,B])}var Bj=cX.forwardRef(function(Z,H){let{render:B,className:J,id:Q,name:X,value:z,disabled:G=!1,onValueChange:F,defaultValue:U,autoFocus:Y=!1,...K}=Z,{state:W,name:N,disabled:L,setTouched:V,setDirty:A,validityData:D,setFocused:q,setFilled:_,validationMode:M,validation:P}=h5(),C=L||G,R=N??X,y={...W,disabled:C},{labelId:w}=N2(),h=V$({id:Q});U0(()=>{let b=z!=null;if(P.inputRef.current?.value||b&&z!=="")_(!0);else if(b&&z==="")_(!1)},[P.inputRef,_,z]);let E=cX.useRef(null);U0(()=>{if(Y&&E.current===Z5(m0(E.current)))q(!0)},[Y,q]);let[I]=t4({controlled:z,default:U,name:"FieldControl",state:"value"}),j=z!==void 0,S=j?I:void 0;return D$({id:h,name:R,commit:P.commit,value:S,getValue:()=>P.inputRef.current?.value,controlRef:P.inputRef}),F0("input",Z,{ref:[H,E],state:y,props:[{id:h,disabled:C,name:R,ref:P.inputRef,"aria-labelledby":w,autoFocus:Y,...j?{value:S}:{defaultValue:U},onChange(b){let v=b.currentTarget.value;F?.(v,M0(G0.none,b.nativeEvent)),A(v!==D.initialValue),_(v!=="")},onFocus(){q(!0)},onBlur(b){if(V(!0),q(!1),M==="onBlur")P.commit(b.currentTarget.value)},onKeyDown(b){if(b.currentTarget.tagName==="INPUT"&&b.key==="Enter")V(!0),P.commit(b.currentTarget.value)}},P.getInputValidationProps(),K],stateAttributesMapping:x2})});var nH=O(g(),1);var Jj=O(d(),1),Qj=function(Z){let{children:H}=Z,{validityData:B,invalid:J}=h5(!1),Q=nH.useMemo(()=>p6(B,J),[B,J]),X=Q.state.valid===!1,{transitionStatus:z}=i4(X),G=nH.useMemo(()=>{return{...Q,validity:Q.state,transitionStatus:z}},[Q,z]);return Jj.jsx(nH.Fragment,{children:H(G)})};var lX=O(g(),1);var qW=O(g(),1),Xj=qW.createContext({disabled:!1});var dX=O(g(),1),Sr=dX.createContext(void 0);function zj($=!0){let Z=dX.useContext(Sr);if(Z===void 0&&!$)throw Error(E0(3));return Z}var MW=O(d(),1),Gj=lX.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,...X}=Z,{state:z,disabled:G}=h5(!1),F=G||Q,U=zj(),Y=U?.parent.id,W=U?.allValues!==void 0?Y:void 0,N=lX.useMemo(()=>({disabled:F}),[F]),L=F0("div",Z,{ref:H,state:z,props:X,stateAttributesMapping:x2});return MW.jsx(mX,{initialControlId:W,children:MW.jsx(Xj.Provider,{value:N,children:L})})});var Uj=O(d(),1),PW=Fj.forwardRef(function(Z,H){return Uj.jsx(iX.Control,{ref:H,...Z})});var Yj=O(d(),1);function L3({className:$,type:Z,...H}){return Yj.jsx(PW,{type:Z,"data-slot":"input",className:s("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",$),...H})}function Kj($){if(!$)return"Folder name is required";if($.length>64)return"Folder name is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9._ -]*$/.test($))return"Use letters, numbers, dots, dashes, underscores and spaces, starting with a letter or number";if($.endsWith(".")||$.endsWith(" "))return"Folder name cannot end with a dot or space";return null}var q$=["claude-code","codex","openclaw","hermes"];var M$=O(g(),1);var rX="/claude-z2xnay0d.svg";var Wj="/floppy-disk-wmjs0n85.webp";var aX="/hermes-pznd63x9.png";var nX="/openai-ep9ht2pq.svg";var oX="/openclaw-a2pyfhpn.svg";var B1=O(d(),1),Dj="Set up the moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function P$({trigger:$,open:Z,onOpenChange:H}){return B1.jsxs(K3,{open:Z,onOpenChange:H,children:[$&&B1.jsx(hX,{render:$}),B1.jsx(vr,{})]})}var Nj=2;function hr({demoInstallUrl:$}){let Z=M$.useRef(null);return B1.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(J)=>{if(!Z.current)return;let Q=J.currentTarget.getBoundingClientRect(),X=(J.clientX-Q.left)/Q.width-0.5,z=(J.clientY-Q.top)/Q.height-0.5;Z.current.style.setProperty("--floppy-x",`${X*-2*Nj}px`),Z.current.style.setProperty("--floppy-y",`${z*-2*Nj}px`)},onMouseLeave:()=>{Z.current?.style.removeProperty("--floppy-x"),Z.current?.style.removeProperty("--floppy-y")},children:B1.jsxs("a",{ref:Z,href:$,target:"_blank",rel:"noreferrer",className:"group absolute top-1/2 left-1/2 w-44 -translate-x-1/2 -translate-y-1/2 rotate-4 [transform:translate3d(var(--floppy-x,0px),var(--floppy-y,0px),0)] rounded-lg transition-transform duration-150 ease-out will-change-transform outline-none focus-visible:ring-3 focus-visible:ring-ring/50 motion-reduce:transform-none motion-reduce:transition-none md:w-40",children:[B1.jsx("img",{src:Wj,alt:"",className:"w-full drop-shadow-xl"}),B1.jsxs("div",{className:l6({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About moi",B1.jsx(Lj,{"data-icon":"inline-end",stroke:1.5})]})]})})}function xr(){let[$,Z]=M$.useState(!1);return M$.useEffect(()=>{if(!$)return;let B=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(B)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText(Dj).then(()=>Z(!0)).catch(()=>{})}}}function vr(){let{demoInstallUrl:$}=J9(),{copied:Z,copy:H}=xr();return B1.jsxs(L$,{"data-vivid":!0,className:"w-full max-w-md rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground md:max-w-2xl",children:[B1.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklch,var(--background)_14%,transparent),color-mix(in_oklch,var(--background)_6%,transparent))]"}),B1.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[B1.jsx("filter",{id:"floppy-grain",children:B1.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),B1.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),B1.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[B1.jsxs("div",{className:"rounded-xl bg-card p-6 text-card-foreground shadow-sm md:p-8",children:[B1.jsxs("div",{className:"flex flex-col gap-0.5",children:[B1.jsx(W3,{children:"Unlock all features"}),B1.jsx(A$,{className:"mt-1",children:"This is a demo version with sample workspaces. Install moi locally and connect to your agent."})]}),B1.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[B1.jsxs("li",{className:"flex items-center gap-3",children:[B1.jsx(Aj,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),B1.jsx("span",{className:"text-sm text-foreground",children:"Connect your own data sources and work on existing projects"})]}),B1.jsxs("li",{className:"flex items-center gap-3",children:[B1.jsx(Vj,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),B1.jsxs("span",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-sm text-foreground",children:[B1.jsx("span",{children:"Build with"}),B1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[B1.jsx("img",{src:rX,alt:"",className:"size-3.5 object-contain"}),"Claude Code,"]}),B1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[B1.jsx("img",{src:nX,alt:"",className:"size-3.5 object-contain"}),"Codex,"]}),B1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[B1.jsx("img",{src:aX,alt:"",className:"size-3.5 object-contain"}),"Hermes,"]}),B1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[B1.jsx("img",{src:oX,alt:"",className:"size-3.5 object-contain"}),"OpenClaw,"]}),B1.jsx("span",{children:"and more"})]})]})]}),B1.jsxs("div",{className:"mt-8 flex flex-col gap-3 pb-4",children:[B1.jsx("p",{className:"text-sm text-muted-foreground",children:"Give this prompt to your agent:"}),B1.jsxs("div",{className:"relative rounded-lg bg-muted p-4 pb-8 ring-1 ring-border",children:[B1.jsx("code",{className:"block font-mono text-sm leading-relaxed text-foreground",children:Dj}),B1.jsxs(T0,{type:"button",onClick:H,className:"absolute right-4 -bottom-4",children:[Z?B1.jsx(A3,{"data-icon":"inline-start",stroke:1.5}):B1.jsx(sX,{"data-icon":"inline-start",stroke:1.5}),Z?"Copied":"Copy prompt"]})]})]})]}),B1.jsx(hr,{demoInstallUrl:$})]}),B1.jsx(N$,{render:B1.jsx(T0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:B1.jsx(S5,{stroke:1.5})})})]})}var Mj=O(g(),1);var _W=O(d(),1),P8={"claude-code":rX,openclaw:oX,codex:nX,hermes:aX},OW={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex",hermes:"Hermes"};function qj({types:$}){let Z=$.map((H)=>OW[H]).join(", ");return _W.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((H)=>_W.jsx("img",{src:P8[H],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},H))})}function i6($){if("types"in $)return $.path.split("/").pop()||$.path;if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";if($.type==="hermes")return $.agentId??"Hermes agent";return $.path.split("/").pop()||$.path}var i1=O(d(),1),gr="Choose which agent moi will use to build your workspace",fr={openclaw:"To connect an OpenClaw agent, run",hermes:"To connect a Hermes agent, run"},mr={openclaw:"moi openclaw init",hermes:"moi hermes init"},pr={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function ur({availability:$,detectedTypes:Z=[]}){return q$.map((H)=>{let B=$?.[H],J=B&&B.status!=="available"?B.reason:void 0,Q=!Z.includes(H)?fr[H]:void 0,X=!Z.includes(H)?mr[H]:void 0,z=J??Q;return{type:H,description:pr[H],disabled:Boolean(z),...z?{disabledReason:z}:{},...!J&&X?{disabledCommand:X}:{}}})}function cr($,Z){let H=$.find((B)=>B.type===Z);if(H&&!H.disabled)return H.type;return $.find((B)=>!B.disabled)?.type}function eX({title:$,selectedType:Z,detectedTypes:H,availability:B,isPending:J,errorMessage:Q,secondaryAction:X,primaryLabel:z,pendingLabel:G,onTypeChange:F,onSubmit:U}){let Y=j5((V)=>V.hasSentMessageFromMoi),K=ur({availability:B,detectedTypes:H}),W=cr(K,Z),N=W!==Z,L=W==="claude-code"?"Tip: you can use your existing Claude subscription in moi":W==="codex"?"Tip: you can use your existing ChatGPT subscription in moi":void 0;return Mj.useEffect(()=>{if(W&&N)F(W)},[F,W,N]),i1.jsxs("div",{className:"flex flex-col gap-5",children:[i1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[i1.jsx(W3,{children:$}),i1.jsx(A$,{children:gr})]}),i1.jsxs("div",{className:"flex flex-col gap-4",children:[i1.jsx(dr,{options:K,selectedType:N?void 0:Z,onTypeChange:F}),!Y&&L&&i1.jsx("p",{className:"text-sm text-muted-foreground",children:L})]}),Q&&i1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:Q}),i1.jsxs("div",{className:"flex items-center justify-end gap-2",children:[X,i1.jsx(T0,{onClick:U,disabled:J||N,children:J&&G?G:z})]})]})}function dr({options:$,selectedType:Z,onTypeChange:H}){return i1.jsx("div",{role:"group","aria-label":"Agent",className:s("grid gap-2",$.length>2?"grid-cols-4":"grid-cols-2"),children:$.map((B)=>i1.jsx(lr,{option:B,selected:Z===B.type,onSelect:H},B.type))})}function lr({option:$,selected:Z,onSelect:H}){let B=Boolean($.disabledReason),J=i1.jsxs("button",{type:"button",disabled:$.disabled&&!B,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(Q)=>{if($.disabled){Q.preventDefault();return}H($.type)},className:s("relative flex w-full flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!Z&&"opacity-70",!Z&&!$.disabled&&"cursor-pointer hover:opacity-100",$.disabled&&"cursor-not-allowed"),children:[i1.jsxs("span",{className:"relative inline-flex",children:[i1.jsx(ir,{type:$.type}),Z&&i1.jsx(tX,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),i1.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[i1.jsx("span",{className:"text-sm font-medium text-foreground",children:OW[$.type]}),i1.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!B)return J;return i1.jsxs(y1,{children:[i1.jsx(h1,{render:J}),i1.jsx(x1,{className:s("max-w-64",$.disabledCommand&&"max-w-none leading-5"),children:i1.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&i1.jsxs(i1.Fragment,{children:[i1.jsx("br",{}),i1.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:$.disabledCommand})]})]})})]})}function ir({type:$}){return i1.jsx("img",{src:P8[$],alt:"",className:"size-8 shrink-0"})}var _$=O(d(),1);function $z({children:$,closeDisabled:Z=!1}){return _$.jsxs(L$,{className:"w-[calc(100%-2rem)] max-w-xl p-6",children:[_$.jsx(N$,{render:_$.jsx(T0,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"absolute top-4 right-4",disabled:Z,children:_$.jsx(S5,{stroke:1.75})})}),$]})}var Y5=O(d(),1),Pj=q$[0];function sH({trigger:$}){let[,Z]=u4(),H=J9(),B=wX(),J=zO(),[Q,X]=oH.useState(!1),[z,G]=oH.useState("agent"),[F,U]=oH.useState(Pj),[Y,K]=oH.useState(""),W=Y.trim(),N=W?Kj(W):null,L=J.isPending;if(H.cloudDemo)return Y5.jsx(P$,{trigger:$});function V(_){X(!1),Z(`/workspace/${_}`)}function A(){G("agent"),U(Pj),K(""),J.reset()}function D(){J.reset(),G("name")}function q(){if(!W||N||L)return;J.reset(),J.mutate({name:W,type:F},{onSuccess:(_)=>V(_.id)})}return Y5.jsxs(K3,{open:Q,onOpenChange:X,onOpenChangeComplete:(_)=>{if(!_)A()},children:[Y5.jsx(hX,{render:$}),Y5.jsx($z,{children:z==="agent"?Y5.jsx(eX,{title:"Create new workspace",selectedType:F,availability:B.data?.availability,isPending:!1,secondaryAction:Y5.jsx(ar,{}),primaryLabel:"Next",onTypeChange:U,onSubmit:D}):Y5.jsx(rr,{name:Y,validationError:N,requestError:J.error?.message,isPending:L,onNameChange:K,onSubmit:q})})]})}function rr({name:$,validationError:Z,requestError:H,isPending:B,onNameChange:J,onSubmit:Q}){function X(z){z.preventDefault(),Q()}return Y5.jsxs("form",{className:"flex flex-col gap-5",onSubmit:X,children:[Y5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[Y5.jsx(W3,{children:"Create new workspace"}),Y5.jsx(A$,{children:"Give it a short and recognizable name"})]}),Y5.jsxs("div",{className:"flex flex-col gap-2",children:[Y5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),Y5.jsx(L3,{id:"workspace-name",value:$,onChange:(z)=>J(z.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&Y5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),H&&Y5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:H}),Y5.jsx("div",{className:"flex items-center justify-end gap-2",children:Y5.jsx(T0,{type:"submit",disabled:!$.trim()||Boolean(Z)||B,children:B?"Creating…":"Create workspace"})})]})}function ar(){return Y5.jsxs(y1,{children:[Y5.jsx(h1,{render:Y5.jsx(T0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),Y5.jsx(x1,{className:"max-w-64",children:Y5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",Y5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:"moi init"})," ","in the folder from your console to add it"]})})]})}var D3=O(g(),1);var W0=O(g(),1),s6=O(Y4(),1);var o5=O(g(),1);var tH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function r6($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function Zz($){return"nodeType"in $}function v2($){var Z,H;if(!$)return window;if(r6($))return $;if(!Zz($))return window;return(Z=(H=$.ownerDocument)==null?void 0:H.defaultView)!=null?Z:window}function Hz($){let{Document:Z}=v2($);return $ instanceof Z}function j$($){if(r6($))return!1;return $ instanceof v2($).HTMLElement}function TW($){return $ instanceof v2($).SVGElement}function a6($){if(!$)return document;if(r6($))return $.document;if(!Zz($))return document;if(Hz($))return $;if(j$($)||TW($))return $.ownerDocument;return document}var Q9=tH?o5.useLayoutEffect:o5.useEffect;function eH($){let Z=o5.useRef($);return Q9(()=>{Z.current=$}),o5.useCallback(function(){for(var H=arguments.length,B=Array(H),J=0;J<H;J++)B[J]=arguments[J];return Z.current==null?void 0:Z.current(...B)},[])}function Oj(){let $=o5.useRef(null),Z=o5.useCallback((B,J)=>{$.current=setInterval(B,J)},[]),H=o5.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,H]}function T$($,Z){if(Z===void 0)Z=[$];let H=o5.useRef($);return Q9(()=>{if(H.current!==$)H.current=$},Z),H}function C$($,Z){let H=o5.useRef();return o5.useMemo(()=>{let B=$(H.current);return H.current=B,B},[...Z])}function $B($){let Z=eH($),H=o5.useRef(null),B=o5.useCallback((J)=>{if(J!==H.current)Z==null||Z(J,H.current);H.current=J},[]);return[H,B]}function ZB($){let Z=o5.useRef();return o5.useEffect(()=>{Z.current=$},[$]),Z.current}var jW={};function HB($,Z){return o5.useMemo(()=>{if(Z)return Z;let H=jW[$]==null?0:jW[$]+1;return jW[$]=H,$+"-"+H},[$,Z])}function jj($){return function(Z){for(var H=arguments.length,B=Array(H>1?H-1:0),J=1;J<H;J++)B[J-1]=arguments[J];return B.reduce((Q,X)=>{let z=Object.entries(X);for(let[G,F]of z){let U=Q[G];if(U!=null)Q[G]=U+$*F}return Q},{...Z})}}var n6=jj(1),BB=jj(-1);function nr($){return"clientX"in $&&"clientY"in $}function Bz($){if(!$)return!1;let{KeyboardEvent:Z}=v2($.target);return Z&&$ instanceof Z}function or($){if(!$)return!1;let{TouchEvent:Z}=v2($.target);return Z&&$ instanceof Z}function JB($){if(or($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:H}=$.touches[0];return{x:Z,y:H}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:H}=$.changedTouches[0];return{x:Z,y:H}}}if(nr($))return{x:$.clientX,y:$.clientY};return null}var O$=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:H}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(H?Math.round(H):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:H}=$;return"scaleX("+Z+") scaleY("+H+")"}},Transform:{toString($){if(!$)return;return[O$.Translate.toString($),O$.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:H,easing:B}=$;return Z+" "+H+"ms "+B}}}),_j="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Tj($){if($.matches(_j))return $;return $.querySelector(_j)}var o6=O(g(),1),sr={display:"none"};function Cj($){let{id:Z,value:H}=$;return o6.default.createElement("div",{id:Z,style:sr},H)}function wj($){let{id:Z,announcement:H,ariaLiveType:B="assertive"}=$,J={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return o6.default.createElement("div",{id:Z,style:J,role:"status","aria-live":B,"aria-atomic":!0},H)}function Ej(){let[$,Z]=o6.useState("");return{announce:o6.useCallback((B)=>{if(B!=null)Z(B)},[]),announcement:$}}var pj=W0.createContext(null);function tr($){let Z=W0.useContext(pj);W0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function er(){let[$]=W0.useState(()=>new Set),Z=W0.useCallback((B)=>{return $.add(B),()=>$.delete(B)},[$]);return[W0.useCallback((B)=>{let{type:J,event:Q}=B;$.forEach((X)=>{var z;return(z=X[J])==null?void 0:z.call(X,Q)})},[$]),Z]}var $a={draggable:`
25
- To pick up a draggable item, press the space bar.
26
- While dragging, use the arrow keys to move the item.
27
- Press space again to drop the item in its new position, or press escape to cancel.
28
- `},Za={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:H}=$;if(H)return"Draggable item "+Z.id+" was moved over droppable area "+H.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:H}=$;if(H)return"Draggable item "+Z.id+" was dropped over droppable area "+H.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function Ha($){let{announcements:Z=Za,container:H,hiddenTextDescribedById:B,screenReaderInstructions:J=$a}=$,{announce:Q,announcement:X}=Ej(),z=HB("DndLiveRegion"),[G,F]=W0.useState(!1);if(W0.useEffect(()=>{F(!0)},[]),tr(W0.useMemo(()=>({onDragStart(Y){let{active:K}=Y;Q(Z.onDragStart({active:K}))},onDragMove(Y){let{active:K,over:W}=Y;if(Z.onDragMove)Q(Z.onDragMove({active:K,over:W}))},onDragOver(Y){let{active:K,over:W}=Y;Q(Z.onDragOver({active:K,over:W}))},onDragEnd(Y){let{active:K,over:W}=Y;Q(Z.onDragEnd({active:K,over:W}))},onDragCancel(Y){let{active:K,over:W}=Y;Q(Z.onDragCancel({active:K,over:W}))}}),[Q,Z])),!G)return null;let U=W0.default.createElement(W0.default.Fragment,null,W0.default.createElement(Cj,{id:B,value:J.draggable}),W0.default.createElement(wj,{id:z,announcement:X}));return H?s6.createPortal(U,H):U}var J2;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(J2||(J2={}));function Qz(){}function kW($,Z){return W0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function uj(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];return W0.useMemo(()=>[...Z].filter((B)=>B!=null),[...Z])}var _8=Object.freeze({x:0,y:0});function Ba($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function Ja($,Z){let H=JB($);if(!H)return"0 0";let B={x:(H.x-Z.left)/Z.width*100,y:(H.y-Z.top)/Z.height*100};return B.x+"% "+B.y+"%"}function Qa($,Z){let{data:{value:H}}=$,{data:{value:B}}=Z;return H-B}function Xa($,Z){let{data:{value:H}}=$,{data:{value:B}}=Z;return B-H}function za($,Z){if(!$||$.length===0)return null;let[H]=$;return Z?H[Z]:H}function Sj($,Z,H){if(Z===void 0)Z=$.left;if(H===void 0)H=$.top;return{x:Z+$.width*0.5,y:H+$.height*0.5}}var cj=($)=>{let{collisionRect:Z,droppableRects:H,droppableContainers:B}=$,J=Sj(Z,Z.left,Z.top),Q=[];for(let X of B){let{id:z}=X,G=H.get(z);if(G){let F=Ba(Sj(G),J);Q.push({id:z,data:{droppableContainer:X,value:F}})}}return Q.sort(Qa)};function Ga($,Z){let H=Math.max(Z.top,$.top),B=Math.max(Z.left,$.left),J=Math.min(Z.left+Z.width,$.left+$.width),Q=Math.min(Z.top+Z.height,$.top+$.height),X=J-B,z=Q-H;if(B<J&&H<Q){let G=Z.width*Z.height,F=$.width*$.height,U=X*z,Y=U/(G+F-U);return Number(Y.toFixed(4))}return 0}var Fa=($)=>{let{collisionRect:Z,droppableRects:H,droppableContainers:B}=$,J=[];for(let Q of B){let{id:X}=Q,z=H.get(X);if(z){let G=Ga(z,Z);if(G>0)J.push({id:X,data:{droppableContainer:Q,value:G}})}}return J.sort(Xa)};function Ua($,Z,H){return{...$,scaleX:Z&&H?Z.width/H.width:1,scaleY:Z&&H?Z.height/H.height:1}}function dj($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:_8}function Ya($){return function(H){for(var B=arguments.length,J=Array(B>1?B-1:0),Q=1;Q<B;Q++)J[Q-1]=arguments[Q];return J.reduce((X,z)=>({...X,top:X.top+$*z.y,bottom:X.bottom+$*z.y,left:X.left+$*z.x,right:X.right+$*z.x}),{...H})}}var Ka=Ya(1);function lj($){if($.startsWith("matrix3d(")){let Z=$.slice(9,-1).split(/, /);return{x:+Z[12],y:+Z[13],scaleX:+Z[0],scaleY:+Z[5]}}else if($.startsWith("matrix(")){let Z=$.slice(7,-1).split(/, /);return{x:+Z[4],y:+Z[5],scaleX:+Z[0],scaleY:+Z[3]}}return null}function Wa($,Z,H){let B=lj(Z);if(!B)return $;let{scaleX:J,scaleY:Q,x:X,y:z}=B,G=$.left-X-(1-J)*parseFloat(H),F=$.top-z-(1-Q)*parseFloat(H.slice(H.indexOf(" ")+1)),U=J?$.width/J:$.width,Y=Q?$.height/Q:$.height;return{width:U,height:Y,top:F,right:G+U,bottom:F+Y,left:G}}var Na={ignoreTransform:!1};function zB($,Z){if(Z===void 0)Z=Na;let H=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:F,transformOrigin:U}=v2($).getComputedStyle($);if(F)H=Wa(H,F,U)}let{top:B,left:J,width:Q,height:X,bottom:z,right:G}=H;return{top:B,left:J,width:Q,height:X,bottom:z,right:G}}function Ij($){return zB($,{ignoreTransform:!0})}function La($){let{innerWidth:Z,innerHeight:H}=$;return{top:0,left:0,right:Z,bottom:H,width:Z,height:H}}function Aa($,Z){if(Z===void 0)Z=v2($).getComputedStyle($);return Z.position==="fixed"}function Va($,Z){if(Z===void 0)Z=v2($).getComputedStyle($);let H=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((J)=>{let Q=Z[J];return typeof Q==="string"?H.test(Q):!1})}function bW($,Z){let H=[];function B(J){if(Z!=null&&H.length>=Z)return H;if(!J)return H;if(Hz(J)&&J.scrollingElement!=null&&!H.includes(J.scrollingElement))return H.push(J.scrollingElement),H;if(!j$(J)||TW(J))return H;if(H.includes(J))return H;let Q=v2($).getComputedStyle(J);if(J!==$){if(Va(J,Q))H.push(J)}if(Aa(J,Q))return H;return B(J.parentNode)}if(!$)return H;return B($)}function ij($){let[Z]=bW($,1);return Z!=null?Z:null}function CW($){if(!tH||!$)return null;if(r6($))return $;if(!Zz($))return null;if(Hz($)||$===a6($).scrollingElement)return window;if(j$($))return $;return null}function rj($){if(r6($))return $.scrollX;return $.scrollLeft}function aj($){if(r6($))return $.scrollY;return $.scrollTop}function SW($){return{x:rj($),y:aj($)}}var A2;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(A2||(A2={}));function nj($){if(!tH||!$)return!1;return $===document.scrollingElement}function oj($){let Z={x:0,y:0},H=nj($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},B={x:$.scrollWidth-H.width,y:$.scrollHeight-H.height},J=$.scrollTop<=Z.y,Q=$.scrollLeft<=Z.x,X=$.scrollTop>=B.y,z=$.scrollLeft>=B.x;return{isTop:J,isLeft:Q,isBottom:X,isRight:z,maxScroll:B,minScroll:Z}}var Da={x:0.2,y:0.2};function qa($,Z,H,B,J){let{top:Q,left:X,right:z,bottom:G}=H;if(B===void 0)B=10;if(J===void 0)J=Da;let{isTop:F,isBottom:U,isLeft:Y,isRight:K}=oj($),W={x:0,y:0},N={x:0,y:0},L={height:Z.height*J.y,width:Z.width*J.x};if(!F&&Q<=Z.top+L.height)W.y=A2.Backward,N.y=B*Math.abs((Z.top+L.height-Q)/L.height);else if(!U&&G>=Z.bottom-L.height)W.y=A2.Forward,N.y=B*Math.abs((Z.bottom-L.height-G)/L.height);if(!K&&z>=Z.right-L.width)W.x=A2.Forward,N.x=B*Math.abs((Z.right-L.width-z)/L.width);else if(!Y&&X<=Z.left+L.width)W.x=A2.Backward,N.x=B*Math.abs((Z.left+L.width-X)/L.width);return{direction:W,speed:N}}function Ma($){if($===document.scrollingElement){let{innerWidth:Q,innerHeight:X}=window;return{top:0,left:0,right:Q,bottom:X,width:Q,height:X}}let{top:Z,left:H,right:B,bottom:J}=$.getBoundingClientRect();return{top:Z,left:H,right:B,bottom:J,width:$.clientWidth,height:$.clientHeight}}function sj($){return $.reduce((Z,H)=>{return n6(Z,SW(H))},_8)}function Pa($){return $.reduce((Z,H)=>{return Z+rj(H)},0)}function _a($){return $.reduce((Z,H)=>{return Z+aj(H)},0)}function tj($,Z){if(Z===void 0)Z=zB;if(!$)return;let{top:H,left:B,bottom:J,right:Q}=Z($);if(!ij($))return;if(J<=0||Q<=0||H>=window.innerHeight||B>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var Oa=[["x",["left","right"],Pa],["y",["top","bottom"],_a]];class zz{constructor($,Z){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let H=bW(Z),B=sj(H);this.rect={...$},this.width=$.width,this.height=$.height;for(let[J,Q,X]of Oa)for(let z of Q)Object.defineProperty(this,z,{get:()=>{let G=X(H),F=B[J]-G;return this.rect[z]+F},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class w${constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var H;return(H=this.target)==null?void 0:H.removeEventListener(...Z)})},this.target=$}add($,Z,H){var B;(B=this.target)==null||B.addEventListener($,Z,H),this.listeners.push([$,Z,H])}}function ja($){let{EventTarget:Z}=v2($);return $ instanceof Z?$:a6($)}function wW($,Z){let H=Math.abs($.x),B=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(H**2+B**2)>Z;if("x"in Z&&"y"in Z)return H>Z.x&&B>Z.y;if("x"in Z)return H>Z.x;if("y"in Z)return B>Z.y;return!1}var e4;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(e4||(e4={}));function Rj($){$.preventDefault()}function Ta($){$.stopPropagation()}var m1;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(m1||(m1={}));var ej={start:[m1.Space,m1.Enter],cancel:[m1.Esc],end:[m1.Space,m1.Enter,m1.Tab]},Ca=($,Z)=>{let{currentCoordinates:H}=Z;switch($.code){case m1.Right:return{...H,x:H.x+25};case m1.Left:return{...H,x:H.x-25};case m1.Down:return{...H,y:H.y+25};case m1.Up:return{...H,y:H.y-25}}return};class GB{constructor($){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=$;let{event:{target:Z}}=$;this.props=$,this.listeners=new w$(a6(Z)),this.windowListeners=new w$(v2(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(e4.Resize,this.handleCancel),this.windowListeners.add(e4.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(e4.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,H=$.node.current;if(H)tj(H);Z(_8)}handleKeyDown($){if(Bz($)){let{active:Z,context:H,options:B}=this.props,{keyboardCodes:J=ej,coordinateGetter:Q=Ca,scrollBehavior:X="smooth"}=B,{code:z}=$;if(J.end.includes(z)){this.handleEnd($);return}if(J.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:G}=H.current,F=G?{x:G.left,y:G.top}:_8;if(!this.referenceCoordinates)this.referenceCoordinates=F;let U=Q($,{active:Z,context:H.current,currentCoordinates:F});if(U){let Y=BB(U,F),K={x:0,y:0},{scrollableAncestors:W}=H.current;for(let N of W){let L=$.code,{isTop:V,isRight:A,isLeft:D,isBottom:q,maxScroll:_,minScroll:M}=oj(N),P=Ma(N),C={x:Math.min(L===m1.Right?P.right-P.width/2:P.right,Math.max(L===m1.Right?P.left:P.left+P.width/2,U.x)),y:Math.min(L===m1.Down?P.bottom-P.height/2:P.bottom,Math.max(L===m1.Down?P.top:P.top+P.height/2,U.y))},R=L===m1.Right&&!A||L===m1.Left&&!D,y=L===m1.Down&&!q||L===m1.Up&&!V;if(R&&C.x!==U.x){let w=N.scrollLeft+Y.x,h=L===m1.Right&&w<=_.x||L===m1.Left&&w>=M.x;if(h&&!Y.y){N.scrollTo({left:w,behavior:X});return}if(h)K.x=N.scrollLeft-w;else K.x=L===m1.Right?N.scrollLeft-_.x:N.scrollLeft-M.x;if(K.x)N.scrollBy({left:-K.x,behavior:X});break}else if(y&&C.y!==U.y){let w=N.scrollTop+Y.y,h=L===m1.Down&&w<=_.y||L===m1.Up&&w>=M.y;if(h&&!Y.x){N.scrollTo({top:w,behavior:X});return}if(h)K.y=N.scrollTop-w;else K.y=L===m1.Down?N.scrollTop-_.y:N.scrollTop-M.y;if(K.y)N.scrollBy({top:-K.y,behavior:X});break}}this.handleMove($,n6(BB(U,this.referenceCoordinates),K))}}}handleMove($,Z){let{onMove:H}=this.props;$.preventDefault(),H(Z)}handleEnd($){let{onEnd:Z}=this.props;$.preventDefault(),this.detach(),Z()}handleCancel($){let{onCancel:Z}=this.props;$.preventDefault(),this.detach(),Z()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}GB.activators=[{eventName:"onKeyDown",handler:($,Z,H)=>{let{keyboardCodes:B=ej,onActivation:J}=Z,{active:Q}=H,{code:X}=$.nativeEvent;if(B.start.includes(X)){let z=Q.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),J==null||J({event:$.nativeEvent}),!0}return!1}}];function kj($){return Boolean($&&"distance"in $)}function bj($){return Boolean($&&"delay"in $)}class Gz{constructor($,Z,H){var B;if(H===void 0)H=ja($.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=$,this.events=Z;let{event:J}=$,{target:Q}=J;this.props=$,this.events=Z,this.document=a6(Q),this.documentListeners=new w$(this.document),this.listeners=new w$(H),this.windowListeners=new w$(v2(Q)),this.initialCoordinates=(B=JB(J))!=null?B:_8,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:$,props:{options:{activationConstraint:Z,bypassActivationConstraint:H}}}=this;if(this.listeners.add($.move.name,this.handleMove,{passive:!1}),this.listeners.add($.end.name,this.handleEnd),$.cancel)this.listeners.add($.cancel.name,this.handleCancel);if(this.windowListeners.add(e4.Resize,this.handleCancel),this.windowListeners.add(e4.DragStart,Rj),this.windowListeners.add(e4.VisibilityChange,this.handleCancel),this.windowListeners.add(e4.ContextMenu,Rj),this.documentListeners.add(e4.Keydown,this.handleKeydown),Z){if(H!=null&&H({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(bj(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(kj(Z)){this.handlePending(Z);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending($,Z){let{active:H,onPending:B}=this.props;B(H,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(e4.Click,Ta,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(e4.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:H,initialCoordinates:B,props:J}=this,{onMove:Q,options:{activationConstraint:X}}=J;if(!B)return;let z=(Z=JB($))!=null?Z:_8,G=BB(B,z);if(!H&&X){if(kj(X)){if(X.tolerance!=null&&wW(G,X.tolerance))return this.handleCancel();if(wW(G,X.distance))return this.handleStart()}if(bj(X)){if(wW(G,X.tolerance))return this.handleCancel()}this.handlePending(X,G);return}if($.cancelable)$.preventDefault();Q(z)}handleEnd(){let{onAbort:$,onEnd:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleCancel(){let{onAbort:$,onCancel:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleKeydown($){if($.code===m1.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var wa={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class FB extends Gz{constructor($){let{event:Z}=$,H=a6(Z.target);super($,wa,H)}}FB.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:B}=Z;if(!H.isPrimary||H.button!==0)return!1;return B==null||B({event:H}),!0}}];var Ea={move:{name:"mousemove"},end:{name:"mouseup"}},IW;(function($){$[$.RightClick=2]="RightClick"})(IW||(IW={}));class $T extends Gz{constructor($){super($,Ea,a6($.event.target))}}$T.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:B}=Z;if(H.button===IW.RightClick)return!1;return B==null||B({event:H}),!0}}];var EW={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ZT extends Gz{constructor($){super($,EW)}static setup(){return window.addEventListener(EW.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(EW.move.name,$)};function $(){}}}ZT.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:B}=Z,{touches:J}=H;if(J.length>1)return!1;return B==null||B({event:H}),!0}}];var QB;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(QB||(QB={}));var Xz;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(Xz||(Xz={}));function Sa($){let{acceleration:Z,activator:H=QB.Pointer,canScroll:B,draggingRect:J,enabled:Q,interval:X=5,order:z=Xz.TreeOrder,pointerCoordinates:G,scrollableAncestors:F,scrollableAncestorRects:U,delta:Y,threshold:K}=$,W=Ra({delta:Y,disabled:!Q}),[N,L]=Oj(),V=W0.useRef({x:0,y:0}),A=W0.useRef({x:0,y:0}),D=W0.useMemo(()=>{switch(H){case QB.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case QB.DraggableRect:return J}},[H,J,G]),q=W0.useRef(null),_=W0.useCallback(()=>{let P=q.current;if(!P)return;let C=V.current.x*A.current.x,R=V.current.y*A.current.y;P.scrollBy(C,R)},[]),M=W0.useMemo(()=>z===Xz.TreeOrder?[...F].reverse():F,[z,F]);W0.useEffect(()=>{if(!Q||!F.length||!D){L();return}for(let P of M){if((B==null?void 0:B(P))===!1)continue;let C=F.indexOf(P),R=U[C];if(!R)continue;let{direction:y,speed:w}=qa(P,R,D,Z,K);for(let h of["x","y"])if(!W[h][y[h]])w[h]=0,y[h]=0;if(w.x>0||w.y>0){L(),q.current=P,N(_,X),V.current=w,A.current=y;return}}V.current={x:0,y:0},A.current={x:0,y:0},L()},[Z,_,B,L,Q,X,JSON.stringify(D),JSON.stringify(W),N,F,M,U,JSON.stringify(K)])}var Ia={x:{[A2.Backward]:!1,[A2.Forward]:!1},y:{[A2.Backward]:!1,[A2.Forward]:!1}};function Ra($){let{delta:Z,disabled:H}=$,B=ZB(Z);return C$((J)=>{if(H||!B||!J)return Ia;let Q={x:Math.sign(Z.x-B.x),y:Math.sign(Z.y-B.y)};return{x:{[A2.Backward]:J.x[A2.Backward]||Q.x===-1,[A2.Forward]:J.x[A2.Forward]||Q.x===1},y:{[A2.Backward]:J.y[A2.Backward]||Q.y===-1,[A2.Forward]:J.y[A2.Forward]||Q.y===1}}},[H,Z,B])}function ka($,Z){let H=Z!=null?$.get(Z):void 0,B=H?H.node.current:null;return C$((J)=>{var Q;if(Z==null)return null;return(Q=B!=null?B:J)!=null?Q:null},[B,Z])}function ba($,Z){return W0.useMemo(()=>$.reduce((H,B)=>{let{sensor:J}=B,Q=J.activators.map((X)=>({eventName:X.eventName,handler:Z(X.handler,B)}));return[...H,...Q]},[]),[$,Z])}var XB;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(XB||(XB={}));var RW;(function($){$.Optimized="optimized"})(RW||(RW={}));var yj=new Map;function ya($,Z){let{dragging:H,dependencies:B,config:J}=Z,[Q,X]=W0.useState(null),{frequency:z,measure:G,strategy:F}=J,U=W0.useRef($),Y=V(),K=T$(Y),W=W0.useCallback(function(A){if(A===void 0)A=[];if(K.current)return;X((D)=>{if(D===null)return A;return D.concat(A.filter((q)=>!D.includes(q)))})},[K]),N=W0.useRef(null),L=C$((A)=>{if(Y&&!H)return yj;if(!A||A===yj||U.current!==$||Q!=null){let D=new Map;for(let q of $){if(!q)continue;if(Q&&Q.length>0&&!Q.includes(q.id)&&q.rect.current){D.set(q.id,q.rect.current);continue}let _=q.node.current,M=_?new zz(G(_),_):null;if(q.rect.current=M,M)D.set(q.id,M)}return D}return A},[$,Q,H,Y,G]);return W0.useEffect(()=>{U.current=$},[$]),W0.useEffect(()=>{if(Y)return;W()},[H,Y]),W0.useEffect(()=>{if(Q&&Q.length>0)X(null)},[JSON.stringify(Q)]),W0.useEffect(()=>{if(Y||typeof z!=="number"||N.current!==null)return;N.current=setTimeout(()=>{W(),N.current=null},z)},[z,Y,W,...B]),{droppableRects:L,measureDroppableContainers:W,measuringScheduled:Q!=null};function V(){switch(F){case XB.Always:return!1;case XB.BeforeDragging:return H;default:return!H}}}function yW($,Z){return C$((H)=>{if(!$)return null;if(H)return H;return typeof Z==="function"?Z($):$},[Z,$])}function ha($,Z){return yW($,Z)}function xa($){let{callback:Z,disabled:H}=$,B=eH(Z),J=W0.useMemo(()=>{if(H||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:Q}=window;return new Q(B)},[B,H]);return W0.useEffect(()=>{return()=>J==null?void 0:J.disconnect()},[J]),J}function Fz($){let{callback:Z,disabled:H}=$,B=eH(Z),J=W0.useMemo(()=>{if(H||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:Q}=window;return new Q(B)},[H]);return W0.useEffect(()=>{return()=>J==null?void 0:J.disconnect()},[J]),J}function va($){return new zz(zB($),$)}function hj($,Z,H){if(Z===void 0)Z=va;let[B,J]=W0.useState(null);function Q(){J((G)=>{if(!$)return null;if($.isConnected===!1){var F;return(F=G!=null?G:H)!=null?F:null}let U=Z($);if(JSON.stringify(G)===JSON.stringify(U))return G;return U})}let X=xa({callback(G){if(!$)return;for(let F of G){let{type:U,target:Y}=F;if(U==="childList"&&Y instanceof HTMLElement&&Y.contains($)){Q();break}}}}),z=Fz({callback:Q});return Q9(()=>{if(Q(),$)z==null||z.observe($),X==null||X.observe(document.body,{childList:!0,subtree:!0});else z==null||z.disconnect(),X==null||X.disconnect()},[$]),B}function ga($){let Z=yW($);return dj($,Z)}var xj=[];function fa($){let Z=W0.useRef($),H=C$((B)=>{if(!$)return xj;if(B&&B!==xj&&$&&Z.current&&$.parentNode===Z.current.parentNode)return B;return bW($)},[$]);return W0.useEffect(()=>{Z.current=$},[$]),H}function ma($){let[Z,H]=W0.useState(null),B=W0.useRef($),J=W0.useCallback((Q)=>{let X=CW(Q.target);if(!X)return;H((z)=>{if(!z)return null;return z.set(X,SW(X)),new Map(z)})},[]);return W0.useEffect(()=>{let Q=B.current;if($!==Q){X(Q);let z=$.map((G)=>{let F=CW(G);if(F)return F.addEventListener("scroll",J,{passive:!0}),[F,SW(F)];return null}).filter((G)=>G!=null);H(z.length?new Map(z):null),B.current=$}return()=>{X($),X(Q)};function X(z){z.forEach((G)=>{let F=CW(G);F==null||F.removeEventListener("scroll",J)})}},[J,$]),W0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((Q,X)=>n6(Q,X),_8):sj($);return _8},[$,Z])}function vj($,Z){if(Z===void 0)Z=[];let H=W0.useRef(null);return W0.useEffect(()=>{H.current=null},Z),W0.useEffect(()=>{let B=$!==_8;if(B&&!H.current)H.current=$;if(!B&&H.current)H.current=null},[$]),H.current?BB($,H.current):_8}function pa($){W0.useEffect(()=>{if(!tH)return;let Z=$.map((H)=>{let{sensor:B}=H;return B.setup==null?void 0:B.setup()});return()=>{for(let H of Z)H==null||H()}},$.map((Z)=>{let{sensor:H}=Z;return H}))}function ua($,Z){return W0.useMemo(()=>{return $.reduce((H,B)=>{let{eventName:J,handler:Q}=B;return H[J]=(X)=>{Q(X,Z)},H},{})},[$,Z])}function HT($){return W0.useMemo(()=>$?La($):null,[$])}var gj=[];function ca($,Z){if(Z===void 0)Z=zB;let[H]=$,B=HT(H?v2(H):null),[J,Q]=W0.useState(gj);function X(){Q(()=>{if(!$.length)return gj;return $.map((G)=>nj(G)?B:new zz(Z(G),G))})}let z=Fz({callback:X});return Q9(()=>{z==null||z.disconnect(),X(),$.forEach((G)=>z==null?void 0:z.observe(G))},[$]),J}function BT($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return j$(Z)?Z:$}function da($){let{measure:Z}=$,[H,B]=W0.useState(null),J=W0.useCallback((F)=>{for(let{target:U}of F)if(j$(U)){B((Y)=>{let K=Z(U);return Y?{...Y,width:K.width,height:K.height}:K});break}},[Z]),Q=Fz({callback:J}),X=W0.useCallback((F)=>{let U=BT(F);if(Q==null||Q.disconnect(),U)Q==null||Q.observe(U);B(U?Z(U):null)},[Z,Q]),[z,G]=$B(X);return W0.useMemo(()=>({nodeRef:z,rect:H,setRef:G}),[H,z,G])}var la=[{sensor:FB,options:{}},{sensor:GB,options:{}}],ia={current:{}},Jz={draggable:{measure:Ij},droppable:{measure:Ij,strategy:XB.WhileDragging,frequency:RW.Optimized},dragOverlay:{measure:zB}};class E$ extends Map{get($){var Z;return $!=null?(Z=super.get($))!=null?Z:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(($)=>{let{disabled:Z}=$;return!Z})}getNodeFor($){var Z,H;return(Z=(H=this.get($))==null?void 0:H.node.current)!=null?Z:void 0}}var ra={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new E$,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qz},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Jz,measureDroppableContainers:Qz,windowRect:null,measuringScheduled:!1},JT={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qz,draggableNodes:new Map,over:null,measureDroppableContainers:Qz},UB=W0.createContext(JT),QT=W0.createContext(ra);function aa(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new E$}}}function na($,Z){switch(Z.type){case J2.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case J2.DragMove:if($.draggable.active==null)return $;return{...$,draggable:{...$.draggable,translate:{x:Z.coordinates.x-$.draggable.initialCoordinates.x,y:Z.coordinates.y-$.draggable.initialCoordinates.y}}};case J2.DragEnd:case J2.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case J2.RegisterDroppable:{let{element:H}=Z,{id:B}=H,J=new E$($.droppable.containers);return J.set(B,H),{...$,droppable:{...$.droppable,containers:J}}}case J2.SetDroppableDisabled:{let{id:H,key:B,disabled:J}=Z,Q=$.droppable.containers.get(H);if(!Q||B!==Q.key)return $;let X=new E$($.droppable.containers);return X.set(H,{...Q,disabled:J}),{...$,droppable:{...$.droppable,containers:X}}}case J2.UnregisterDroppable:{let{id:H,key:B}=Z,J=$.droppable.containers.get(H);if(!J||B!==J.key)return $;let Q=new E$($.droppable.containers);return Q.delete(H),{...$,droppable:{...$.droppable,containers:Q}}}default:return $}}function oa($){let{disabled:Z}=$,{active:H,activatorEvent:B,draggableNodes:J}=W0.useContext(UB),Q=ZB(B),X=ZB(H==null?void 0:H.id);return W0.useEffect(()=>{if(Z)return;if(!B&&Q&&X!=null){if(!Bz(Q))return;if(document.activeElement===Q.target)return;let z=J.get(X);if(!z)return;let{activatorNode:G,node:F}=z;if(!G.current&&!F.current)return;requestAnimationFrame(()=>{for(let U of[G.current,F.current]){if(!U)continue;let Y=Tj(U);if(Y){Y.focus();break}}})}},[B,Z,J,X,Q]),null}function XT($,Z){let{transform:H,...B}=Z;return $!=null&&$.length?$.reduce((J,Q)=>{return Q({transform:J,...B})},H):H}function sa($){return W0.useMemo(()=>({draggable:{...Jz.draggable,...$==null?void 0:$.draggable},droppable:{...Jz.droppable,...$==null?void 0:$.droppable},dragOverlay:{...Jz.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function ta($){let{activeNode:Z,measure:H,initialRect:B,config:J=!0}=$,Q=W0.useRef(!1),{x:X,y:z}=typeof J==="boolean"?{x:J,y:J}:J;Q9(()=>{if(!X&&!z||!Z){Q.current=!1;return}if(Q.current||!B)return;let F=Z==null?void 0:Z.node.current;if(!F||F.isConnected===!1)return;let U=H(F),Y=dj(U,B);if(!X)Y.x=0;if(!z)Y.y=0;if(Q.current=!0,Math.abs(Y.x)>0||Math.abs(Y.y)>0){let K=ij(F);if(K)K.scrollBy({top:Y.y,left:Y.x})}},[Z,X,z,B,H])}var Uz=W0.createContext({..._8,scaleX:1,scaleY:1}),V3;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(V3||(V3={}));var zT=W0.memo(function(Z){var H,B,J,Q;let{id:X,accessibility:z,autoScroll:G=!0,children:F,sensors:U=la,collisionDetection:Y=Fa,measuring:K,modifiers:W,...N}=Z,L=W0.useReducer(na,void 0,aa),[V,A]=L,[D,q]=er(),[_,M]=W0.useState(V3.Uninitialized),P=_===V3.Initialized,{draggable:{active:C,nodes:R,translate:y},droppable:{containers:w}}=V,h=C!=null?R.get(C):null,E=W0.useRef({initial:null,translated:null}),I=W0.useMemo(()=>{var C0;return C!=null?{id:C,data:(C0=h==null?void 0:h.data)!=null?C0:ia,rect:E}:null},[C,h]),j=W0.useRef(null),[S,k]=W0.useState(null),[b,v]=W0.useState(null),c=T$(N,Object.values(N)),T=HB("DndDescribedBy",X),e=W0.useMemo(()=>w.getEnabled(),[w]),Z0=sa(K),{droppableRects:x,measureDroppableContainers:t,measuringScheduled:D0}=ya(e,{dragging:P,dependencies:[y.x,y.y],config:Z0.droppable}),p=ka(R,C),X0=W0.useMemo(()=>b?JB(b):null,[b]),K0=W1(),Q0=ha(p,Z0.draggable.measure);ta({activeNode:C!=null?R.get(C):null,config:K0.layoutShiftCompensation,initialRect:Q0,measure:Z0.draggable.measure});let z0=hj(p,Z0.draggable.measure,Q0),L0=hj(p?p.parentElement:null),i=W0.useRef({activatorEvent:null,active:null,activeNode:p,collisionRect:null,collisions:null,droppableRects:x,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:w,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),B0=w.getNodeFor((H=i.current.over)==null?void 0:H.id),$0=da({measure:Z0.dragOverlay.measure}),J0=(B=$0.nodeRef.current)!=null?B:p,n=P?(J=$0.rect)!=null?J:z0:null,f=Boolean($0.nodeRef.current&&$0.rect),l=ga(f?null:z0),m=HT(J0?v2(J0):null),a=fa(P?B0!=null?B0:p:null),o=ca(a),V0=XT(W,{transform:{x:y.x-l.x,y:y.y-l.y,scaleX:1,scaleY:1},activatorEvent:b,active:I,activeNodeRect:z0,containerNodeRect:L0,draggingNodeRect:n,over:i.current.over,overlayNodeRect:$0.rect,scrollableAncestors:a,scrollableAncestorRects:o,windowRect:m}),O0=X0?n6(X0,y):null,k0=ma(a),r0=vj(k0),u=vj(k0,[z0]),r=n6(V0,r0),H0=n?Ka(n,V0):null,A0=I&&H0?Y({active:I,collisionRect:H0,droppableRects:x,droppableContainers:e,pointerCoordinates:O0}):null,j0=za(A0,"id"),[v0,G1]=W0.useState(null),K1=f?V0:n6(V0,u),c0=Ua(K1,(Q=v0==null?void 0:v0.rect)!=null?Q:null,z0),R0=W0.useRef(null),d0=W0.useCallback((C0,I0)=>{let{sensor:g0,options:$1}=I0;if(j.current==null)return;let l0=R.get(j.current);if(!l0)return;let L1=C0.nativeEvent,u1=new g0({active:j.current,activeNode:l0,event:L1,options:$1,context:i,onAbort(M1){if(!R.get(M1))return;let{onDragAbort:p5}=c.current,i5={id:M1};p5==null||p5(i5),D({type:"onDragAbort",event:i5})},onPending(M1,q5,p5,i5){if(!R.get(M1))return;let{onDragPending:z1}=c.current,u0={id:M1,constraint:q5,initialCoordinates:p5,offset:i5};z1==null||z1(u0),D({type:"onDragPending",event:u0})},onStart(M1){let q5=j.current;if(q5==null)return;let p5=R.get(q5);if(!p5)return;let{onDragStart:i5}=c.current,x0={activatorEvent:L1,active:{id:q5,data:p5.data,rect:E}};s6.unstable_batchedUpdates(()=>{i5==null||i5(x0),M(V3.Initializing),A({type:J2.DragStart,initialCoordinates:M1,active:q5}),D({type:"onDragStart",event:x0}),k(R0.current),v(L1)})},onMove(M1){A({type:J2.DragMove,coordinates:M1})},onEnd:c1(J2.DragEnd),onCancel:c1(J2.DragCancel)});R0.current=u1;function c1(M1){return async function(){let{active:p5,collisions:i5,over:x0,scrollAdjustedTranslate:z1}=i.current,u0=null;if(p5&&z1){let{cancelDrop:A1}=c.current;if(u0={activatorEvent:L1,active:p5,collisions:i5,delta:z1,over:x0},M1===J2.DragEnd&&typeof A1==="function"){if(await Promise.resolve(A1(u0)))M1=J2.DragCancel}}j.current=null,s6.unstable_batchedUpdates(()=>{A({type:M1}),M(V3.Uninitialized),G1(null),k(null),v(null),R0.current=null;let A1=M1===J2.DragEnd?"onDragEnd":"onDragCancel";if(u0){let v1=c.current[A1];v1==null||v1(u0),D({type:A1,event:u0})}})}}},[R]),p0=W0.useCallback((C0,I0)=>{return(g0,$1)=>{let l0=g0.nativeEvent,L1=R.get($1);if(j.current!==null||!L1||l0.dndKit||l0.defaultPrevented)return;let u1={active:L1};if(C0(g0,I0.options,u1)===!0)l0.dndKit={capturedBy:I0.sensor},j.current=$1,d0(g0,I0)}},[R,d0]),t0=ba(U,p0);pa(U),Q9(()=>{if(z0&&_===V3.Initializing)M(V3.Initialized)},[z0,_]),W0.useEffect(()=>{let{onDragMove:C0}=c.current,{active:I0,activatorEvent:g0,collisions:$1,over:l0}=i.current;if(!I0||!g0)return;let L1={active:I0,activatorEvent:g0,collisions:$1,delta:{x:r.x,y:r.y},over:l0};s6.unstable_batchedUpdates(()=>{C0==null||C0(L1),D({type:"onDragMove",event:L1})})},[r.x,r.y]),W0.useEffect(()=>{let{active:C0,activatorEvent:I0,collisions:g0,droppableContainers:$1,scrollAdjustedTranslate:l0}=i.current;if(!C0||j.current==null||!I0||!l0)return;let{onDragOver:L1}=c.current,u1=$1.get(j0),c1=u1&&u1.rect.current?{id:u1.id,rect:u1.rect.current,data:u1.data,disabled:u1.disabled}:null,M1={active:C0,activatorEvent:I0,collisions:g0,delta:{x:l0.x,y:l0.y},over:c1};s6.unstable_batchedUpdates(()=>{G1(c1),L1==null||L1(M1),D({type:"onDragOver",event:M1})})},[j0]),Q9(()=>{i.current={activatorEvent:b,active:I,activeNode:p,collisionRect:H0,collisions:A0,droppableRects:x,draggableNodes:R,draggingNode:J0,draggingNodeRect:n,droppableContainers:w,over:v0,scrollableAncestors:a,scrollAdjustedTranslate:r},E.current={initial:n,translated:H0}},[I,p,A0,H0,R,J0,n,x,w,v0,a,r]),Sa({...K0,delta:y,draggingRect:H0,pointerCoordinates:O0,scrollableAncestors:a,scrollableAncestorRects:o});let N0=W0.useMemo(()=>{return{active:I,activeNode:p,activeNodeRect:z0,activatorEvent:b,collisions:A0,containerNodeRect:L0,dragOverlay:$0,draggableNodes:R,droppableContainers:w,droppableRects:x,over:v0,measureDroppableContainers:t,scrollableAncestors:a,scrollableAncestorRects:o,measuringConfiguration:Z0,measuringScheduled:D0,windowRect:m}},[I,p,z0,b,A0,L0,$0,R,w,x,v0,t,a,o,Z0,D0,m]),b0=W0.useMemo(()=>{return{activatorEvent:b,activators:t0,active:I,activeNodeRect:z0,ariaDescribedById:{draggable:T},dispatch:A,draggableNodes:R,over:v0,measureDroppableContainers:t}},[b,t0,I,z0,A,T,R,v0,t]);return W0.default.createElement(pj.Provider,{value:q},W0.default.createElement(UB.Provider,{value:b0},W0.default.createElement(QT.Provider,{value:N0},W0.default.createElement(Uz.Provider,{value:c0},F)),W0.default.createElement(oa,{disabled:(z==null?void 0:z.restoreFocus)===!1})),W0.default.createElement(Ha,{...z,hiddenTextDescribedById:T}));function W1(){let C0=(S==null?void 0:S.autoScrollEnabled)===!1,I0=typeof G==="object"?G.enabled===!1:G===!1,g0=P&&!C0&&!I0;if(typeof G==="object")return{...G,enabled:g0};return{enabled:g0}}}),ea=W0.createContext(null),fj="button",$n="Draggable";function GT($){let{id:Z,data:H,disabled:B=!1,attributes:J}=$,Q=HB($n),{activators:X,activatorEvent:z,active:G,activeNodeRect:F,ariaDescribedById:U,draggableNodes:Y,over:K}=W0.useContext(UB),{role:W=fj,roleDescription:N="draggable",tabIndex:L=0}=J!=null?J:{},V=(G==null?void 0:G.id)===Z,A=W0.useContext(V?Uz:ea),[D,q]=$B(),[_,M]=$B(),P=ua(X,Z),C=T$(H);Q9(()=>{return Y.set(Z,{id:Z,key:Q,node:D,activatorNode:_,data:C}),()=>{let y=Y.get(Z);if(y&&y.key===Q)Y.delete(Z)}},[Y,Z]);let R=W0.useMemo(()=>({role:W,tabIndex:L,"aria-disabled":B,"aria-pressed":V&&W===fj?!0:void 0,"aria-roledescription":N,"aria-describedby":U.draggable}),[B,W,L,V,N,U.draggable]);return{active:G,activatorEvent:z,activeNodeRect:F,attributes:R,isDragging:V,listeners:B?void 0:P,node:D,over:K,setNodeRef:q,setActivatorNodeRef:M,transform:A}}function Zn(){return W0.useContext(QT)}var Hn="Droppable",Bn={timeout:25};function FT($){let{data:Z,disabled:H=!1,id:B,resizeObserverConfig:J}=$,Q=HB(Hn),{active:X,dispatch:z,over:G,measureDroppableContainers:F}=W0.useContext(UB),U=W0.useRef({disabled:H}),Y=W0.useRef(!1),K=W0.useRef(null),W=W0.useRef(null),{disabled:N,updateMeasurementsFor:L,timeout:V}={...Bn,...J},A=T$(L!=null?L:B),D=W0.useCallback(()=>{if(!Y.current){Y.current=!0;return}if(W.current!=null)clearTimeout(W.current);W.current=setTimeout(()=>{F(Array.isArray(A.current)?A.current:[A.current]),W.current=null},V)},[V]),q=Fz({callback:D,disabled:N||!X}),_=W0.useCallback((R,y)=>{if(!q)return;if(y)q.unobserve(y),Y.current=!1;if(R)q.observe(R)},[q]),[M,P]=$B(_),C=T$(Z);return W0.useEffect(()=>{if(!q||!M.current)return;q.disconnect(),Y.current=!1,q.observe(M.current)},[M,q]),W0.useEffect(()=>{return z({type:J2.RegisterDroppable,element:{id:B,key:Q,disabled:H,node:M,rect:K,data:C}}),()=>z({type:J2.UnregisterDroppable,key:Q,id:B})},[B]),W0.useEffect(()=>{if(H!==U.current.disabled)z({type:J2.SetDroppableDisabled,id:B,key:Q,disabled:H}),U.current.disabled=H},[B,Q,H,z]),{active:X,rect:K,isOver:(G==null?void 0:G.id)===B,node:M,over:G,setNodeRef:P}}function Jn($){let{animation:Z,children:H}=$,[B,J]=W0.useState(null),[Q,X]=W0.useState(null),z=ZB(H);if(!H&&!B&&z)J(z);return Q9(()=>{if(!Q)return;let G=B==null?void 0:B.key,F=B==null?void 0:B.props.id;if(G==null||F==null){J(null);return}Promise.resolve(Z(F,Q)).then(()=>{J(null)})},[Z,B,Q]),W0.default.createElement(W0.default.Fragment,null,H,B?W0.cloneElement(B,{ref:X}):null)}var Qn={x:0,y:0,scaleX:1,scaleY:1};function Xn($){let{children:Z}=$;return W0.default.createElement(UB.Provider,{value:JT},W0.default.createElement(Uz.Provider,{value:Qn},Z))}var zn={position:"fixed",touchAction:"none"},Gn=($)=>{return Bz($)?"transform 250ms ease":void 0},Fn=W0.forwardRef(($,Z)=>{let{as:H,activatorEvent:B,adjustScale:J,children:Q,className:X,rect:z,style:G,transform:F,transition:U=Gn}=$;if(!z)return null;let Y=J?F:{...F,scaleX:1,scaleY:1},K={...zn,width:z.width,height:z.height,top:z.top,left:z.left,transform:O$.Transform.toString(Y),transformOrigin:J&&B?Ja(B,z):void 0,transition:typeof U==="function"?U(B):U,...G};return W0.default.createElement(H,{className:X,style:K,ref:Z},Q)}),Un=($)=>(Z)=>{let{active:H,dragOverlay:B}=Z,J={},{styles:Q,className:X}=$;if(Q!=null&&Q.active)for(let[z,G]of Object.entries(Q.active)){if(G===void 0)continue;J[z]=H.node.style.getPropertyValue(z),H.node.style.setProperty(z,G)}if(Q!=null&&Q.dragOverlay)for(let[z,G]of Object.entries(Q.dragOverlay)){if(G===void 0)continue;B.node.style.setProperty(z,G)}if(X!=null&&X.active)H.node.classList.add(X.active);if(X!=null&&X.dragOverlay)B.node.classList.add(X.dragOverlay);return function(){for(let[G,F]of Object.entries(J))H.node.style.setProperty(G,F);if(X!=null&&X.active)H.node.classList.remove(X.active)}},Yn=($)=>{let{transform:{initial:Z,final:H}}=$;return[{transform:O$.Transform.toString(Z)},{transform:O$.Transform.toString(H)}]},Kn={duration:250,easing:"ease",keyframes:Yn,sideEffects:Un({styles:{active:{opacity:"0"}}})};function Wn($){let{config:Z,draggableNodes:H,droppableContainers:B,measuringConfiguration:J}=$;return eH((Q,X)=>{if(Z===null)return;let z=H.get(Q);if(!z)return;let G=z.node.current;if(!G)return;let F=BT(X);if(!F)return;let{transform:U}=v2(X).getComputedStyle(X),Y=lj(U);if(!Y)return;let K=typeof Z==="function"?Z:Nn(Z);return tj(G,J.draggable.measure),K({active:{id:Q,data:z.data,node:G,rect:J.draggable.measure(G)},draggableNodes:H,dragOverlay:{node:X,rect:J.dragOverlay.measure(F)},droppableContainers:B,measuringConfiguration:J,transform:Y})})}function Nn($){let{duration:Z,easing:H,sideEffects:B,keyframes:J}={...Kn,...$};return(Q)=>{let{active:X,dragOverlay:z,transform:G,...F}=Q;if(!Z)return;let U={x:z.rect.left-X.rect.left,y:z.rect.top-X.rect.top},Y={scaleX:G.scaleX!==1?X.rect.width*G.scaleX/z.rect.width:1,scaleY:G.scaleY!==1?X.rect.height*G.scaleY/z.rect.height:1},K={x:G.x-U.x,y:G.y-U.y,...Y},W=J({...F,active:X,dragOverlay:z,transform:{initial:G,final:K}}),[N]=W,L=W[W.length-1];if(JSON.stringify(N)===JSON.stringify(L))return;let V=B==null?void 0:B({active:X,dragOverlay:z,...F}),A=z.node.animate(W,{duration:Z,easing:H,fill:"forwards"});return new Promise((D)=>{A.onfinish=()=>{V==null||V(),D()}})}}var mj=0;function Ln($){return W0.useMemo(()=>{if($==null)return;return mj++,mj},[$])}var UT=W0.default.memo(($)=>{let{adjustScale:Z=!1,children:H,dropAnimation:B,style:J,transition:Q,modifiers:X,wrapperElement:z="div",className:G,zIndex:F=999}=$,{activatorEvent:U,active:Y,activeNodeRect:K,containerNodeRect:W,draggableNodes:N,droppableContainers:L,dragOverlay:V,over:A,measuringConfiguration:D,scrollableAncestors:q,scrollableAncestorRects:_,windowRect:M}=Zn(),P=W0.useContext(Uz),C=Ln(Y==null?void 0:Y.id),R=XT(X,{activatorEvent:U,active:Y,activeNodeRect:K,containerNodeRect:W,draggingNodeRect:V.rect,over:A,overlayNodeRect:V.rect,scrollableAncestors:q,scrollableAncestorRects:_,transform:P,windowRect:M}),y=yW(K),w=Wn({config:B,draggableNodes:N,droppableContainers:L,measuringConfiguration:D}),h=y?V.setRef:void 0;return W0.default.createElement(Xn,null,W0.default.createElement(Jn,{animation:w},Y&&C?W0.default.createElement(Fn,{key:C,id:Y.id,ref:h,as:z,activatorEvent:U,adjustScale:Z,className:G,transition:Q,rect:y,style:{zIndex:F,...J},transform:R},H):null))});var t6=O(d(),1),An={start:[m1.Space],cancel:[m1.Esc],end:[m1.Space,m1.Tab]};function Vn($,Z,H){let B=$.indexOf(Z),J=$.indexOf(H);if(B<0||J<0||B===J)return $;let Q=[...$],[X]=Q.splice(B,1);return Q.splice(J,0,X),Q}function Yz({items:$,getId:Z,className:H,itemClassName:B,dragDisabled:J=!1,onReorder:Q,renderItem:X,renderPlaceholder:z,renderOverlay:G}){let F=uj(kW(FB,{activationConstraint:{distance:4}}),kW(GB,{keyboardCodes:An})),[U,Y]=D3.useState(null),[K,W]=D3.useState(null),N=D3.useRef(null),L=D3.useMemo(()=>$.map(Z),[$,Z]),V=D3.useMemo(()=>new Map($.map((C)=>[Z(C),C])),[$,Z]),D=(U&&K?K:L).map((C)=>V.get(C)).filter((C)=>Boolean(C)),q=U?V.get(U):void 0,_=J||$.length<2;return t6.jsxs(zT,{sensors:F,collisionDetection:cj,onDragStart:(C)=>{let R=$.map(Z);Y(String(C.active.id)),N.current=R,W(R)},onDragOver:(C)=>{let R=String(C.active.id),y=C.over?String(C.over.id):void 0,w=N.current;if(!y||y===R||!w)return;let h=Vn(w,R,y);if(h===w)return;N.current=h,W(h)},onDragCancel:()=>{N.current=null,Y(null),W(null)},onDragEnd:(C)=>{let R=String(C.active.id),y=N.current;if(N.current=null,Y(null),W(null),!y||y.join("|")===L.join("|"))return;if(!y.includes(R))return;Q(y)},children:[t6.jsx("div",{className:H,children:D.map((C)=>t6.jsx(Dn,{id:Z(C),item:C,disabled:_,itemClassName:B,renderItem:X,renderPlaceholder:z},Z(C)))}),t6.jsx(UT,{dropAnimation:null,children:q&&G?G(q):null})]})}function Dn({id:$,item:Z,disabled:H,itemClassName:B,renderItem:J,renderPlaceholder:Q}){let{setNodeRef:X,isOver:z}=FT({id:$,disabled:H}),{attributes:G,listeners:F,setNodeRef:U,isDragging:Y}=GT({id:$,disabled:H,attributes:{roleDescription:"sortable item"}}),K=(N)=>{X(N),U(N)},W={isDragging:Y,isOver:z,dragDisabled:H,dragHandleProps:H?{}:{...G,...F}};return t6.jsxs(B5.div,{layout:!0,ref:K,className:s("relative",B?.(Z,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[Y&&Q?.(Z),J(Z,W)]})}var J1=O(d(),1),qn="https://mlfrg.notion.site/3c678a44b6788042b734d775dd2e935e?pvs=105";function Mn($){return s(l6({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function Kz({children:$,showWorkspaces:Z=!0}){let{data:H}=TX(),B=Z1();return B2((J)=>{if(J.type==="workspace:updated"||J.type==="workspaces-list:updated")B.invalidateQueries({queryKey:w0.all,exact:!0})}),J1.jsxs("div",{className:"flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none",children:[J1.jsx(Pn,{workspaces:Z?H??[]:[]}),J1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function Pn({workspaces:$}){let Z=GO();return J1.jsx(qX,{delay:500,children:J1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[J1.jsxs(y1,{children:[J1.jsx(h1,{render:J1.jsx(V6,{href:"/","aria-label":"Home",className:Mn,children:J1.jsx(WT,{stroke:1.5})})}),J1.jsx(x1,{side:"right",children:"Home"})]}),J1.jsx("nav",{className:"flex max-h-full min-h-0 w-14 flex-1 flex-col items-center justify-center gap-4",children:$.length>0&&J1.jsxs(J1.Fragment,{children:[J1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:J1.jsx(Yz,{items:$,getId:(H)=>H.id,className:"flex flex-col gap-4",onReorder:(H)=>Z.mutate(H),renderPlaceholder:()=>J1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-10 rounded-xl bg-accent"}),renderOverlay:(H)=>J1.jsx(YT,{workspace:H,dragOverlay:!0}),renderItem:(H,B)=>J1.jsx(YT,{workspace:H,dragState:B})})}),J1.jsx("div",{className:"shrink-0",children:J1.jsxs(y1,{children:[J1.jsx(sH,{trigger:J1.jsx(h1,{render:J1.jsx(T0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:J1.jsx(N4,{"data-icon":"inline-start",stroke:1.5})})})}),J1.jsx(x1,{side:"right",children:"Create new workspace"})]})})]})}),J1.jsx("div",{className:"size-8 shrink-0",children:J1.jsx(_n,{})})]})})}function _n(){let{cloudDemo:$}=J9(),Z=AO();if($)return J1.jsx(P$,{trigger:J1.jsx(T0,{size:"icon","aria-label":"Unlock all features",title:"Unlock all features",children:J1.jsx(NT,{stroke:1.5})})});if(Z.status==="loading")return null;if(Z.status==="available")return J1.jsx(VO,{...Z.button});return J1.jsx(On,{})}function On(){return J1.jsxs(y1,{children:[J1.jsx(h1,{render:J1.jsx(T0,{render:J1.jsx("a",{href:qn,target:"_blank",rel:"noreferrer"}),variant:"ghost",size:"icon","aria-label":"Leave feedback",className:"text-muted-foreground hover:text-foreground",children:J1.jsx(KT,{stroke:1.5})})}),J1.jsx(x1,{side:"right",children:"Leave feedback"})]})}function YT({workspace:$,dragOverlay:Z=!1,dragState:H}){let[B]=u4(),J=`/workspace/${$.id}`,Q=i6($),X=B===J||B.startsWith(`${J}/`),z=J1.jsx("div",{className:s(l6({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12 transition-[border-radius,background-color,color] duration-100 ease-out motion-reduce:transition-none",Z?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",X&&!Z&&"bg-accent text-accent-foreground"),children:J1.jsx("img",{src:$.icon??P8[$.type??"claude-code"],alt:"",className:"size-7 shrink-0 rounded-xs transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"})}),G=J1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:Q});if(Z)return J1.jsxs("span",{className:"flex w-14 flex-col items-center",children:[z,G]});return J1.jsxs(V6,{href:J,"aria-label":Q,onClick:(F)=>{if(H?.isDragging)F.preventDefault()},className:s("group flex w-14 flex-col items-center rounded-lg outline-none",H?.isDragging&&"invisible"),...H?.dragHandleProps,children:[z,J1.jsxs(y1,{children:[J1.jsx(h1,{render:G}),J1.jsx(x1,{side:"right",children:Q})]})]})}var gw=O(g(),1);var LT=O(g(),1);var S$=O(d(),1);function jn({choice:$,availability:Z,isPending:H,errorMessage:B,onTypeChange:J,onCancel:Q,onSubmit:X}){return S$.jsx(eX,{title:`Import ${i6($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:Z,isPending:H,errorMessage:B,secondaryAction:S$.jsx(T0,{variant:"secondary",onClick:Q,disabled:H,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:J,onSubmit:X})}function AT({choice:$,availability:Z,isPending:H,errorMessage:B,onTypeChange:J,onSubmit:Q,onReset:X}){let[z,G]=LT.useState(!0);function F(Y){if(!Y&&H)return;G(Y)}function U(Y){if(!Y)X()}return S$.jsx(K3,{open:z,onOpenChange:F,onOpenChangeComplete:U,children:S$.jsx($z,{closeDisabled:H,children:S$.jsx(jn,{choice:$,availability:Z,isPending:H,errorMessage:B,onTypeChange:J,onCancel:()=>G(!1),onSubmit:Q})})})}var VT=O(g(),1);function Tn($){return $.types[0]??q$[0]}function DT({onSuccess:$}){let Z=XO(),[H,B]=VT.useState(null);function J(G){Z.reset(),B({workspace:G,selectedType:Tn(G)})}function Q(G){B((F)=>F?{...F,selectedType:G}:F)}function X(){if(!H||Z.isPending)return;Z.mutate({path:H.workspace.path,type:H.selectedType},{onSuccess:$})}function z(){B(null),Z.reset()}return{choice:H,isPending:Z.isPending,error:Z.error,startImport:J,selectType:Q,submit:X,reset:z}}var KB=O(g(),1);var WB=O(d(),1),Cn=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],q3=10,Wz=3,wn=2.5,En={O:1,o:0.5,".":0},Sn=3000,In=2,qT=3,M3=3,MT=0.001,e6={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function Rn($){let Z=Math.max(...$.map((Q)=>Q.length)),H=Z*q3+(Z-1)*Wz,B=$.length*q3+($.length-1)*Wz,J=[];return $.forEach((Q,X)=>{Array.from(Q).forEach((z,G)=>{let F=En[z];if(F===void 0)return;let U=G*(q3+Wz),Y=X*(q3+Wz);J.push({x:U,y:Y,centerX:U+q3/2,centerY:Y+q3/2,targetOpacity:F})})}),{width:H,height:B,fieldColumns:Math.round(H/M3)+1,fieldRows:Math.round(B/M3)+1,pixels:J}}var kn=Cn.map(Rn);function YB($,Z,H){return $<Z?Z:$>H?H:$}function bn($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class PT{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,H){this.rects=$,this.svg=Z,this.geometry=H;let B=H.fieldColumns*H.fieldRows;this.field=new Float32Array(B),this.previousField=new Float32Array(B),this.nextField=new Float32Array(B)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=($)=>{let Z=this.svg.getBoundingClientRect();if(!Z.width||!Z.height)return;if(this.pointerActive=$.clientX>=Z.left&&$.clientX<=Z.right&&$.clientY>=Z.top&&$.clientY<=Z.bottom,this.pointerActive)this.pointerX=($.clientX-Z.left)/Z.width*this.geometry.width,this.pointerY=($.clientY-Z.top)/Z.height*this.geometry.height,this.resume()};seedImpulse(){let $=Math.round(this.geometry.width/2/M3),Z=Math.round(this.geometry.height/2/M3),H=2*qT*qT;for(let B=0;B<this.geometry.fieldRows;B++)for(let J=0;J<this.geometry.fieldColumns;J++){let Q=(J-$)**2+(B-Z)**2,X=In*Math.exp(-Q/H),z=B*this.geometry.fieldColumns+J;this.field[z]=X,this.previousField[z]=X}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=($)=>{if(this.stepWave(),this.pointerActive)this.driveWave($);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=$;let H=($-this.introStartedAt)/Sn;if(this.activation=1-bn(Math.min(1,H)),H>=1)this.intro=!1}else{this.intro=!1;let H=this.pointerActive?1:0,B=this.pointerActive?e6.fadeIn:e6.fadeOut;this.activation+=(H-this.activation)*B}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>MT||Z>MT){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let B=1;B<Z-1;B++)for(let J=1;J<$-1;J++){let Q=B*$+J,X=this.field[Q-1]+this.field[Q+1]+this.field[Q-$]+this.field[Q+$]-4*this.field[Q];this.nextField[Q]=(2*this.field[Q]-this.previousField[Q]+e6.courantSquared*X)*e6.damping}let H=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=H}driveWave($){let Z=YB(Math.round(this.pointerX/M3),1,this.geometry.fieldColumns-2),H=YB(Math.round(this.pointerY/M3),1,this.geometry.fieldRows-2);this.field[H*this.geometry.fieldColumns+Z]=e6.driveAmplitude*Math.sin($*e6.driveFrequency)}sampleField($,Z){let H=YB($/M3,0,this.geometry.fieldColumns-1),B=YB(Z/M3,0,this.geometry.fieldRows-1),J=Math.floor(H),Q=Math.floor(B),X=Math.min(J+1,this.geometry.fieldColumns-1),z=Math.min(Q+1,this.geometry.fieldRows-1),G=H-J,F=B-Q,{fieldColumns:U}=this.geometry,Y=this.field[Q*U+J],K=this.field[Q*U+X],W=this.field[z*U+J],N=this.field[z*U+X];return(Y*(1-G)+K*G)*(1-F)+(W*(1-G)+N*G)*F}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,H)=>{let B=this.rects[H];if(!B)return;let J=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(J));let Q=YB(0.5+J*e6.gain,0,1),X=Z.targetOpacity*(1-this.activation)+Q*this.activation;B.setAttribute("opacity",X.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function yn({geometry:$}){let Z=KB.useRef([]),H=KB.useRef(null);return KB.useEffect(()=>{let B=H.current;if(!B||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let J=new PT(Z.current,B,$);return J.start(),window.addEventListener("pointermove",J.handlePointerMove),()=>{J.stop(),window.removeEventListener("pointermove",J.handlePointerMove)}},[$]),WB.jsx("svg",{ref:H,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((B,J)=>WB.jsx("rect",{ref:(Q)=>{Z.current[J]=Q},x:B.x,y:B.y,width:q3,height:q3,rx:wn,opacity:B.targetOpacity},`${B.x}-${B.y}`))})}function _T({className:$}){return WB.jsx("div",{role:"img","aria-label":"moi",className:s("flex items-center gap-2 text-accent",$),children:kn.map((Z,H)=>WB.jsx(yn,{geometry:Z},H))})}var Lz=O(g(),1),$7=O(d(),1),hn=($,Z)=>`mo-root${$==="always"?" mo-always":""}${Z?" mo-expr":""}`;function xn($){let Z=(z)=>`${-Math.round(z)}ms`,H=(z)=>String(Math.round(z*100)/100),B=Math.round($.num("motion.blink",3500,6500)),J=Math.round($.num("motion.saccade",4200,7600)),Q=$.num("motion.lookX",1,2.2),X=$.num("motion.lookY",0.8,1.7);return{"--mo-phase":Z($.num("motion.phase",0,2800)),"--mo-bob-phase":Z($.num("motion.bob",0,3400)),"--mo-blink":`${B}ms`,"--mo-blink-phase":Z($.num("motion.blinkPhase",0,B)),"--mo-look-x":H(Q*($.bool("motion.lookXFlip")?-1:1)),"--mo-look-mx":H(Q),"--mo-look-y":H(X*($.bool("motion.lookYFlip")?-1:1)),"--mo-look-my":H(X),"--mo-saccade":`${J}ms`,"--mo-saccade-phase":Z($.num("motion.saccadePhase",0,J))}}function hW({l:$,c:Z,h:H}){let B=H*Math.PI/180,J=Z*Math.cos(B),Q=Z*Math.sin(B),X=$+0.3963377774*J+0.2158037573*Q,z=$-0.1055613458*J-0.0638541728*Q,G=$-0.0894841775*J-1.291485548*Q,F=X*X*X,U=z*z*z,Y=G*G*G;return[4.0767416621*F-3.3077115913*U+0.2309699292*Y,-1.2684380046*F+2.6097574011*U-0.3413193965*Y,-0.0041960863*F-0.7034186147*U+1.707614701*Y]}var OT=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function wT($){let Z=hW($);if(!OT(Z)){let H=0,B=$.c;for(let J=0;J<12;J++){let Q=(H+B)/2;if(OT(hW({...$,c:Q})))H=Q;else B=Q}Z=hW({...$,c:H})}return Z.map((H)=>Math.min(1,Math.max(0,H)))}function jT($){let[Z,H,B]=wT($);return 0.2126*Z+0.7152*H+0.0722*B}function Nz($,Z){let H=jT($),B=jT(Z);return(Math.max(H,B)+0.05)/(Math.min(H,B)+0.05)}function ET($,Z,H){if(Nz($,Z)>=H)return $;let B=$.l>=Z.l?1:-1;for(let X of[B,-B]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),Nz(z,Z)>=H)return z;if(z.l===0||z.l===1)break}}let J={...$,l:0,c:0},Q={...$,l:1,c:0};return Nz(J,Z)>=Nz(Q,Z)?J:Q}function vn($){return"#"+wT($).map((Z)=>{let H=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(H*255).toString(16).padStart(2,"0")}).join("")}var TT=[[0.2,{l:0.86,c:0.085}],[0.36,{l:0.9,c:0.028}],[0.62,{l:0.73,c:0.135}],[0.8,{l:0.62,c:0.165}],[0.93,{l:0.87,c:0.16}],[1,{l:0.34,c:0.035}]],gn=($)=>TT.find(([Z])=>$<Z)?.[1]??TT[0][1],fn={l:0.145,c:0,h:0},mn=1.5,pn=($,Z)=>{let H=gn(Z),B=ET({l:H.l,c:H.c,h:$},fn,mn);return{bg:{l:0.965,c:0.01,h:$},head:B,eye:B.l>=0.5?{l:0.17,c:0.02,h:$}:{l:0.97,c:0.012,h:$}}},un=[["head","bg",1.25],["eye","head",4.5]];function cn($,Z=!0,H=0){let B=pn($,H);if(Z)for(let[J,Q,X]of un)B[J]=ET(B[J],B[Q],X);return B}function dn($,Z=!0,H=0){let B=cn($,Z,H),J={};for(let Q in B)J[Q]=vn(B[Q]);return J}var J5=($)=>{let Z=Math.round($*100)/100;return Object.is(Z,-0)?"0":String(Z)};function xW({cx:$,cy:Z,rx:H,ry:B,n:J=4,rot:Q=0}){let X=Math.min(1,(8*Math.pow(2,-1/J)-4)/3),z=H,G=B,F=z*X,U=G*X,Y=[[z,0],[z,U],[F,G],[0,G],[-F,G],[-z,U],[-z,0],[-z,-U],[-F,-G],[0,-G],[F,-G],[z,-U],[z,0]],K=Q*Math.PI/180,W=Math.cos(K),N=Math.sin(K),L=(A)=>{let[D,q]=Y[A];return`${J5($+D*W-q*N)} ${J5(Z+D*N+q*W)}`},V=`M${L(0)}`;for(let A=1;A<13;A+=3)V+=`C${L(A)} ${L(A+1)} ${L(A+2)}`;return V+"Z"}function ln($,Z,H,B,J,Q=0){let X=J.length,z=Q*Math.PI/180,G=J.map((Y,K)=>{let W=z+2*Math.PI*K/X;return[$+H*Y*Math.cos(W),Z+B*Y*Math.sin(W)]}),F=(Y)=>G[(Y%X+X)%X],U=`M${J5(F(0)[0])} ${J5(F(0)[1])}`;for(let Y=0;Y<X;Y++){let[K,W]=F(Y-1),[N,L]=F(Y),[V,A]=F(Y+1),[D,q]=F(Y+2);U+=`C${J5(N+(V-K)/6)} ${J5(L+(A-W)/6)} ${J5(V-(D-N)/6)} ${J5(A-(q-L)/6)} ${J5(V)} ${J5(A)}`}return U+"Z"}function rn({cx:$,cy:Z,rx:H,ry:B,sides:J,round:Q=0.3,rot:X=0}){let z=Q>0?Q<1?Q/2:0.5:0,G=X*Math.PI/180-Math.PI/2,F=Array.from({length:J},(W,N)=>{let L=G+2*Math.PI*N/J;return[$+H*Math.cos(L),Z+B*Math.sin(L)]}),U=(W)=>F[(W%J+J)%J],Y=(W,N)=>{let[L,V]=U(W),[A,D]=U(N);return`${J5(L+(A-L)*z)} ${J5(V+(D-V)*z)}`},K=`M${Y(0,-1)}`;for(let W=0;W<J;W++){let[N,L]=U(W);if(K+=`Q${J5(N)} ${J5(L)} ${Y(W,W+1)}`,z<0.5)K+=`L${Y(W+1,W)}`}return K+"Z"}function an($,Z,H,B){let J=J5($-H),Q=J5($+H);return`M${J} ${J5(Z-B)}H${Q}V${J5(Z+B)}H${J}Z`}function nn($,Z,H,B,J){let Q=Math.max(1.05,J),X=H*Math.sqrt(1-1/(Q*Q)),z=Z-B/Q,G=Z-Q*B,F=X*0.14,U=z+0.86*(G-z);return`M${J5($-X)} ${J5(z)}L${J5($-F)} ${J5(U)}Q${J5($)} ${J5(G)} ${J5($+F)} ${J5(U)}L${J5($+X)} ${J5(z)}Z`}function vW($,Z){for(let H=0;H<Z.length;H++)$=Math.imul($^Z[H],3432918353),$=$<<13|$>>>19;return $}function on($){return $=Math.imul($^$>>>16,2246822507),$=Math.imul($^$>>>13,3266489909),($^$>>>16)>>>0}var ST=new TextEncoder;function sn($){return $.normalize("NFC").trim().toLowerCase()}function tn($,Z=!0){let H=Z?sn($):$;return vW(1779033703^H.length,ST.encode(H))}function CT($,Z){return on(vW(vW($,Uint8Array.of(255)),ST.encode(Z)))/4294967296}function en($,Z=!0,H){let B=tn($,Z),J=(Q)=>{let X=H?.[Q],z=Array.isArray(X)?X[Math.floor(CT(B,Q)*X.length)]:X;return z===void 0?CT(B,Q):z>0?z<1?z:0.999999:0};return J.num=(Q,X,z)=>X+J(Q)*(z-X),J.int=(Q,X,z)=>X+Math.floor(J(Q)*(z-X+1)),J.pick=(Q,X)=>X[Math.floor(J(Q)*X.length)],J.bool=(Q,X=0.5)=>J(Q)<X,J.jitter=(Q,X)=>(J(Q)*2-1)*X,J}function IT($,Z,H){let B=Z.expression;if(H||!B)return{l:$,wrap:""};return B.bake($,B.p)}var $o=($,Z)=>Z?.tint?Z.tint($,Z.p):$,RT=($,Z)=>Z?`<g transform="${Z}">${$}</g>`:$,Zo=($)=>$.replace(/[&<>]/g,(Z)=>Z==="&"?"&amp;":Z==="<"?"&lt;":"&gt;");function kT($,Z){let H=en($,Z.normalize??!0,Z.traits);return{t:H,palette:{...dn(Z.hue??H.num("hue",0,360),Z.contrast??!0,Z.tone??H("tone")),...Z.palette}}}var Ho=($)=>$.title?`<title>${Zo($.title)}</title>`:"";function bT($,Z,H){let B=Z.background??$.background;if(B===!1)return;return{d:B==="square"?"M0 0H100V100H0Z":xW({cx:50,cy:50,rx:50,ry:50,n:B==="circle"?2:6}),fill:H.bg}}var Bo=($)=>$?`<path d="${$.d}" fill="${$.fill}"/>`:"";function Jo($){return(Z,H={})=>{let{t:B,palette:J}=kT(Z,H),Q=$o(J,H.expression),X=H.size?` width="${H.size}" height="${H.size}"`:"",z=IT($.layout(B),H),G=Ho(H)+Bo(bT($,H,Q))+RT($.render(z.l,Q),z.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${X}>${G}</svg>`}}function Qo($){return(Z,H={},B)=>{let{t:J,palette:Q}=kT(Z,H),X=B?.(J,Q),z=IT($.layout(J),H,X);return{cls:X?.cls,bg:bT($,H,Q),inner:RT($.render(z.l,Q,!!X),z.wrap),vars:X?.vars}}}var Xo=($,Z,H)=>{let B=Z.rx,J=$.num("eye.rx",0.075,0.105)*B,Q=$.num("eye.ratio",1.9,3.2),X=$.num("eye.scale",0.78,1.24),z=$.num("eye.stretch",0.85,1.18),G=$.num("eye.gap",0.1,0.24)*B,F=J*Math.max(1,X),U=J*Q*Math.max(1,X*z),Y=F+B*0.03+G,K=$.jitter("gaze.x",0.09)*H.rx,W=$.num("gaze.y",-0.2,0.08)*H.ry,N=$.jitter("eye.dy",0.04)*H.ry,L=Math.hypot(F,U),V=Math.hypot((Math.abs(K)+Y+L)/H.rx,(Math.abs(W)+Math.abs(N)+L)/H.ry),A=V>0.9?0.9/V:1,D=J*A,q=D*Q,_=Y*A,M=Math.max(0,Math.min(1,G/U)),P=Math.min(12,Math.asin(M)*180/Math.PI),C=$.num("eye.lean",-1,1)*P,R=Math.max(-12,Math.min(12,C+$.jitter("eye.lean2",3.5))),y=H.cx+K*A,w=H.cy+W*A;return[{cx:y-_,cy:w,rx:D,ry:q,n:$.num("eye.n",3.5,6),rot:C},{cx:y+_,cy:w+N*A,rx:D*X,ry:q*X*z,n:$.num("eye.n",3.5,6),rot:R}]};function zo($,Z){let H=(Q)=>($.find(([,X])=>Q<X)??$[$.length-1])[0];function B(Q){let X=H(Q("shape")),z=Q.num("body.r",31,38)*X.core,G={cx:50+Q.jitter("body.x",1.5),cy:50+Q.jitter("body.y",1.5),rx:z,ry:z*Q.num("body.ratio",0.92,1.08),n:Q.num("body.n",1.9,2.5),rot:0,radii:Array.from({length:Q.int("body.pts",6,8)},(Y,K)=>1+Q.jitter(`body.r${K}`,0.16))};X.body?.(Q,G);let F=X.face?.(G)??G,U={petals:[],extra:[]};return X.decorate?.(Q,G,U),{shape:X.name,draw:X.path,body:G,face:F,petals:U.petals,extra:U.extra,eyes:Z(Q,G,F)}}function J(Q,X,z){let G=(Y)=>Math.round(Y*100)/100,F=(Y,K)=>{let W=`<path d="${xW(Y)}"/>`;return z?`<g class="mo-eye" style="--mo-wrap:${K?1:-1};--mo-lean:${G(Y.rot)};transform-origin:${G(Y.cx)}px ${G(Y.cy)}px">${W}</g>`:W},U=`<g fill="${X.head}">`+Q.petals.map((Y)=>`<circle cx="${G(Y.cx)}" cy="${G(Y.cy)}" r="${G(Y.r)}"/>`).join("")+Q.extra.map((Y)=>`<path d="${Y}"/>`).join("")+`<path d="${Q.draw?Q.draw(Q.body):xW(Q.body)}"/></g><g fill="${X.eye}"${z?' class="mo-eyes"':""}>`+Q.eyes.map(F).join("")+"</g>";return z?`<g class="mo-breathe"><g class="mo-bob">${U}</g></g>`:U}return{layout:B,render:J,background:!1}}var yT=($)=>rn($),hT=($)=>ln($.cx,$.cy,$.rx,$.ry,$.radii,$.rot),gW=($)=>(Z)=>({cx:Z.cx,cy:Z.cy,rx:Z.rx*$,ry:Z.ry*$}),xT=($)=>gW(Math.min(...$.radii)*0.95)($),Go=($)=>gW(0.84)($),Fo={name:"round",core:1},Uo={name:"organic",core:0.98,path:hT,face:xT},Yo={name:"boxy",core:0.86,body:($,Z)=>{Z.n=$.num("body.n",3.4,6),Z.rot=$.num("body.rot",-20,20)}},Ko={name:"capsule",core:1.02,body:($,Z)=>{Z.ry*=$.num("capsule.squat",0.55,0.68)},face:gW(0.94),decorate:($,Z,H)=>{for(let B of[-1,1])H.petals.push({cx:Z.cx+B*(Z.rx-Z.ry),cy:Z.cy,r:Z.ry})},path:($)=>an($.cx,$.cy,$.rx-$.ry,$.ry)},Wo={name:"nub",core:0.88,decorate:($,Z,H)=>{let B=$.int("nub.n",1,2);for(let J=0;J<B;J++){let Q=$.num(`nub.a${J}`,0,2*Math.PI);H.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.88,cy:Z.cy+Math.sin(Q)*Z.rx*0.88,r:Z.rx*$.num(`nub.r${J}`,0.24,0.4)})}}},No={name:"cloud",core:0.78,face:xT,path:hT,decorate:($,Z,H)=>{let B=$.int("cloud.n",4,6);for(let J=0;J<B;J++){let Q=Math.PI+Math.PI*(J+0.5)/B;H.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.8,cy:Z.cy+Math.sin(Q)*Z.rx*0.5,r:Z.rx*$.num(`cloud.r${J}`,0.44,0.62)})}}},Lo={name:"droplet",core:0.78,body:($,Z)=>{Z.cy+=0.22*Z.ry,Z.n=2},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.05,rx:$.rx*0.88,ry:$.ry*0.88}),decorate:($,Z,H)=>{H.extra.push(nn(Z.cx,Z.cy,Z.rx,Z.ry,$.num("droplet.tip",1.4,1.65)))}},Ao={name:"hexagon",core:1.05,path:yT,face:Go,body:($,Z)=>{Z.sides=6,Z.rot=$.num("body.rot",-12,12),Z.round=$.num("poly.round",0.24,0.5)}},Vo={name:"sun",core:0.7,decorate:($,Z,H)=>{let B=$.int("sun.n",6,9),J=Z.rx*$.num("sun.dist",1,1.08),Q=Z.rx*$.num("sun.r",0.2,0.26),X=$.num("sun.rot",0,2*Math.PI);for(let z=0;z<B;z++){let G=X+2*Math.PI*z/B;H.petals.push({cx:Z.cx+Math.cos(G)*J,cy:Z.cy+Math.sin(G)*J,r:Q})}}},Do={name:"triangle",core:1.15,path:yT,body:($,Z)=>{Z.sides=3,Z.rot=$.num("body.rot",-5,5),Z.round=$.num("poly.round",0.24,0.5)},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.1,rx:$.rx*0.54,ry:$.ry*0.36})},qo=[[Fo,0.22],[Uo,0.48],[Yo,0.6],[Ko,0.7],[Wo,0.79],[No,0.86],[Lo,0.915],[Ao,0.95],[Vo,0.98],[Do,1]],vT=zo(qo,Xo),Mo=Jo(vT),Po=($,Z)=>(H,B)=>{let J=Z?Z.vars(Z.p):{},Q=Z?.tint?Z.tint(B,Z.p):B;return{cls:hn($,!!Object.keys(J).length||!!Z?.tint),vars:{...xn(H),"--mo-head":Q.head,"--mo-eye":Q.eye,...J}}};function _o($,Z={}){return Qo(vT)($,Z,Z.animate&&Po(Z.animate,Z.expression))}function Oo($,Z){return"data:image/svg+xml,"+Mo($,Z).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(H)=>"%"+H.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function gT({name:$,size:Z,background:H,palette:B,hue:J,tone:Q,normalize:X,contrast:z,title:G,animate:F,expression:U,traits:Y,...K}){let W={size:Z,background:H,palette:B,hue:J,tone:Q,normalize:X,contrast:z,title:G,expression:U,traits:Y},N=JSON.stringify([$,W,F]),L=Lz.useMemo(()=>F?"":Oo($,W),[N]),V=Lz.useMemo(()=>F?_o($,{...W,animate:F}):null,[N]),A=Lz.useMemo(()=>({__html:V?.inner??""}),[V?.inner]);if(V){let{style:_,...M}=K;return $7.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:Z,height:Z,role:G?"img":void 0,"aria-hidden":G?void 0:!0,style:{...V.vars,..._},...M,children:[G?$7.jsx("title",{children:G}):null,V.bg?$7.jsx("path",{d:V.bg.d,fill:V.bg.fill}):null,$7.jsx("g",{className:V.cls,dangerouslySetInnerHTML:A})]})}let{alt:D,...q}=K;return $7.jsx("img",{src:L,width:Z,height:Z,alt:D??G??"",...q})}var fT=gT;function fW({l:$,c:Z,h:H}){let B=H*Math.PI/180,J=Z*Math.cos(B),Q=Z*Math.sin(B),X=$+0.3963377774*J+0.2158037573*Q,z=$-0.1055613458*J-0.0638541728*Q,G=$-0.0894841775*J-1.291485548*Q,F=X*X*X,U=z*z*z,Y=G*G*G;return[4.0767416621*F-3.3077115913*U+0.2309699292*Y,-1.2684380046*F+2.6097574011*U-0.3413193965*Y,-0.0041960863*F-0.7034186147*U+1.707614701*Y]}var mT=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function dT($){let Z=fW($);if(!mT(Z)){let H=0,B=$.c;for(let J=0;J<12;J++){let Q=(H+B)/2;if(mT(fW({...$,c:Q})))H=Q;else B=Q}Z=fW({...$,c:H})}return Z.map((H)=>Math.min(1,Math.max(0,H)))}function pT($){let[Z,H,B]=dT($);return 0.2126*Z+0.7152*H+0.0722*B}function NB($,Z){let H=pT($),B=pT(Z);return(Math.max(H,B)+0.05)/(Math.min(H,B)+0.05)}function uT($,Z,H){if(NB($,Z)>=H)return $;let B=$.l>=Z.l?1:-1;for(let X of[B,-B]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),NB(z,Z)>=H)return z;if(z.l===0||z.l===1)break}}let J={...$,l:0,c:0},Q={...$,l:1,c:0};return NB(J,Z)>=NB(Q,Z)?J:Q}function Az($){return"#"+dT($).map((Z)=>{let H=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(H*255).toString(16).padStart(2,"0")}).join("")}function I$($){let Z=parseInt($.slice(1),16),[H,B,J]=[Z>>16&255,Z>>8&255,Z&255].map((U)=>{let Y=U/255;return Y<=0.04045?Y/12.92:Math.pow((Y+0.055)/1.055,2.4)}),Q=Math.cbrt(0.4122214708*H+0.5363325363*B+0.0514459929*J),X=Math.cbrt(0.2119034982*H+0.6806995451*B+0.1073969566*J),z=Math.cbrt(0.0883024619*H+0.2817188376*B+0.6299787005*J),G=1.9779984951*Q-2.428592205*X+0.4505937099*z,F=0.0259040371*Q+0.7827717662*X-0.808675766*z;return{l:0.2104542553*Q+0.793617785*X-0.0040720468*z,c:Math.hypot(G,F),h:Math.atan2(F,G)*180/Math.PI}}function jo($,Z,H){let B=(U)=>U*Math.PI/180,J=$.c*Math.cos(B($.h)),Q=$.c*Math.sin(B($.h)),X=Z.c*Math.cos(B(Z.h)),z=Z.c*Math.sin(B(Z.h)),G=J+(X-J)*H,F=Q+(z-Q)*H;return{l:$.l+(Z.l-$.l)*H,c:Math.hypot(G,F),h:Math.atan2(F,G)*180/Math.PI}}var Vz=($,Z,H)=>Az(jo(I$($),I$(Z),H));var To={h:12,l:0.84,pull:0.4,c:0.1};var cT=4.55;function Co($,Z,H){let B=I$($),J=I$(Z),Q={l:B.l+(H.l-B.l)*H.pull,c:Math.max(B.c,H.c),h:H.h};Q=uT(Q,wo,Eo);let X=uT(J,Q,cT),z=X.l>=Q.l?1:-1,G=Az(Q);for(let F=0;F<40;F++){let U=Az(X),Y=1/0;for(let W=0;W<=10;W++){let N=W/10;Y=Math.min(Y,NB(I$(Vz(Z,U,N)),I$(Vz($,G,N))))}if(Y>=cT)return[G,U];let K=Math.min(1,Math.max(0,X.l+z*0.02));if(K===X.l)return[G,U];X={...X,l:K}}return[G,Az(X)]}var wo={l:0.145,c:0,h:0},Eo=1.5;var mW={esx:1,esy:1,tilt:0,edy:0,edx:0,esx2:0,esy2:0,tilt2:0,edy2:0,lock:0,heat:0,shake:0,rock:0,bdy:0},lT=($)=>String(Math.round($*1000)/1000);function X9($){let Z={};for(let H in mW){if(H==="heat")continue;let B=$[H];if(B!==mW[H])Z["--mo-"+H]=lT(B)}return Z}function So($,Z,H){let[B,J]=Co($.head,$.eye,H);return{...$,head:Vz($.head,B,Z.heat),eye:Vz($.eye,J,Z.heat)}}function z9($,Z){return{l:{...$,eyes:$.eyes.map((H,B)=>({...H,cx:H.cx+Z.edx*(B?1:-1),cy:H.cy+Z.edy+(B?Z.edy2:0),rx:H.rx*(Z.esx+(B?Z.esx2:0)),ry:H.ry*(Z.esy+(B?Z.esy2:0)),rot:H.rot*(1-Z.lock)+(Z.tilt+(B?Z.tilt2:0))*(B?1:-1)}))},wrap:Z.bdy!==0?`translate(0 ${lT(Z.bdy)})`:""}}var iT={p:mW,vars:X9,bake:z9},rT={p:{esx:1.72,esy:0.3,tilt:8,edy:-1.5,edx:1.5,esx2:0.08,esy2:0.05,tilt2:-16,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-2.2},vars:X9,bake:z9},aT={p:{esx:0.6,esy:0.56,tilt:26,edy:3.6,edx:1.9,esx2:-0.05,esy2:-0.07,tilt2:-7,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:2.6},vars:X9,bake:z9};var nT={p:{esx:1.34,esy:1.2,tilt:-6,edy:-1.05,edx:0.5,esx2:0.05,esy2:0.07,tilt2:3,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.4},vars:X9,bake:z9},oT={p:{esx:1.32,esy:0.76,tilt:5,edy:-0.6,edx:0.8,esx2:0.26,esy2:-0.56,tilt2:-11,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.1},vars:X9,bake:z9},sT={p:{esx:1.14,esy:0.22,tilt:0,edy:2.4,edx:0.3,esx2:-0.04,esy2:0.03,tilt2:4,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:1.2},vars:X9,bake:z9},tT={p:{esx:1.3,esy:0.42,tilt:18,edy:-0.5,edx:0.5,esx2:0.06,esy2:-0.06,tilt2:-36,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1},vars:X9,bake:z9},eT={p:{esx:0.95,esy:1.02,tilt:4,edy:-0.2,edx:0.3,esx2:0.24,esy2:-0.44,tilt2:-18,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:0},vars:X9,bake:z9};var $C={p:{esx:0.62,esy:0.5,tilt:10,edy:1.4,edx:-0.2,esx2:-0.05,esy2:-0.04,tilt2:-8,edy2:0,lock:1,heat:0.55,shake:0,rock:0,bdy:0.9},vars:X9,bake:z9,tint:($,Z)=>So($,Z,To)};var ZC={p:{esx:1.15,esy:0.62,tilt:0,edy:4.2,edx:0.4,esx2:0.02,esy2:0.06,tilt2:0,edy2:-8.4,lock:1,heat:0,shake:0,rock:0.8,bdy:-0.4},vars:X9,bake:z9};var Io=($,Z)=>{if(typeof $!=="number")return;if(Z===3)return{mode:"rgb",r:($>>8&15|$>>4&240)/255,g:($>>4&15|$&240)/255,b:($&15|$<<4&240)/255};if(Z===4)return{mode:"rgb",r:($>>12&15|$>>8&240)/255,g:($>>8&15|$>>4&240)/255,b:($>>4&15|$&240)/255,alpha:($&15|$<<4&240)/255};if(Z===6)return{mode:"rgb",r:($>>16&255)/255,g:($>>8&255)/255,b:($&255)/255};if(Z===8)return{mode:"rgb",r:($>>24&255)/255,g:($>>16&255)/255,b:($>>8&255)/255,alpha:($&255)/255}},Dz=Io;var Ro={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},HC=Ro;var ko=($)=>{return Dz(HC[$.toLowerCase()],6)},BC=ko;var bo=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,yo=($)=>{let Z;return(Z=$.match(bo))?Dz(parseInt(Z[1],16),Z[1].length):void 0},JC=yo;var qz="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var Z7="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var LB="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var QC="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var P3="\\s*,\\s*";var pT0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var ho=new RegExp(`^rgba?\\(\\s*${qz}${P3}${qz}${P3}${qz}\\s*(?:,\\s*${LB}\\s*)?\\)$`),xo=new RegExp(`^rgba?\\(\\s*${Z7}${P3}${Z7}${P3}${Z7}\\s*(?:,\\s*${LB}\\s*)?\\)$`),vo=($)=>{let Z={mode:"rgb"},H;if(H=$.match(ho)){if(H[1]!==void 0)Z.r=H[1]/255;if(H[2]!==void 0)Z.g=H[2]/255;if(H[3]!==void 0)Z.b=H[3]/255}else if(H=$.match(xo)){if(H[1]!==void 0)Z.r=H[1]/100;if(H[2]!==void 0)Z.g=H[2]/100;if(H[3]!==void 0)Z.b=H[3]/100}else return;if(H[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,H[4]/100));else if(H[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+H[5]));return Z},XC=vo;var go=($,Z)=>$===void 0?void 0:typeof $!=="object"?GC($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,zC=go;var fo=($="rgb")=>(Z)=>(Z=zC(Z,$))!==void 0?Z.mode===$?Z:O8[Z.mode][$]?O8[Z.mode][$](Z):$==="rgb"?O8[Z.mode].rgb(Z):O8.rgb[$](O8[Z.mode].rgb(Z)):void 0,Mz=fo;var O8={},FC={},AB=[],pW={},mo=($)=>$,r1=($)=>{if(O8[$.mode]={...O8[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!O8[Z])O8[Z]={};O8[Z][$.mode]=$.fromMode[Z]}),!$.ranges)$.ranges={};if(!$.difference)$.difference={};return $.channels.forEach((Z)=>{if($.ranges[Z]===void 0)$.ranges[Z]=[0,1];if(!$.interpolate[Z])throw Error(`Missing interpolator for: ${Z}`);if(typeof $.interpolate[Z]==="function")$.interpolate[Z]={use:$.interpolate[Z]};if(!$.interpolate[Z].fixup)$.interpolate[Z].fixup=mo}),FC[$.mode]=$,($.parse||[]).forEach((Z)=>{po(Z,$.mode)}),Mz($.mode)},UC=($)=>FC[$],po=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");pW[$]=Z}else if(typeof $==="function"){if(AB.indexOf($)<0)AB.push($)}};var uW=/[^\x00-\x7F]|[a-zA-Z_]/,uo=/[^\x00-\x7F]|[-\w]/,q0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},Q1=0;function Pz($){let Z=$[Q1],H=$[Q1+1];if(Z==="-"||Z==="+")return/\d/.test(H)||H==="."&&/\d/.test($[Q1+2]);if(Z===".")return/\d/.test(H);return/\d/.test(Z)}function cW($){if(Q1>=$.length)return!1;let Z=$[Q1];if(uW.test(Z))return!0;if(Z==="-"){if($.length-Q1<2)return!1;let H=$[Q1+1];if(H==="-"||uW.test(H))return!0;return!1}return!1}var co={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function VB($){let Z="";if($[Q1]==="-"||$[Q1]==="+")Z+=$[Q1++];if(Z+=_z($),$[Q1]==="."&&/\d/.test($[Q1+1]))Z+=$[Q1++]+_z($);if($[Q1]==="e"||$[Q1]==="E"){if(($[Q1+1]==="-"||$[Q1+1]==="+")&&/\d/.test($[Q1+2]))Z+=$[Q1++]+$[Q1++]+_z($);else if(/\d/.test($[Q1+1]))Z+=$[Q1++]+_z($)}if(cW($)){let H=Oz($);if(H==="deg"||H==="rad"||H==="turn"||H==="grad")return{type:q0.Hue,value:Z*co[H]};return}if($[Q1]==="%")return Q1++,{type:q0.Percentage,value:+Z};return{type:q0.Number,value:+Z}}function _z($){let Z="";while(/\d/.test($[Q1]))Z+=$[Q1++];return Z}function Oz($){let Z="";while(Q1<$.length&&uo.test($[Q1]))Z+=$[Q1++];return Z}function lo($){let Z=Oz($);if($[Q1]==="(")return Q1++,{type:q0.Function,value:Z};if(Z==="none")return{type:q0.None,value:void 0};return{type:q0.Ident,value:Z}}function io($=""){let Z=$.trim(),H=[],B;Q1=0;while(Q1<Z.length){if(B=Z[Q1++],B===`
29
- `||B==="\t"||B===" "){while(Q1<Z.length&&(Z[Q1]===`
30
- `||Z[Q1]==="\t"||Z[Q1]===" "))Q1++;continue}if(B===",")return;if(B===")"){H.push({type:q0.ParenClose});continue}if(B==="+"){if(Q1--,Pz(Z)){H.push(VB(Z));continue}return}if(B==="-"){if(Q1--,Pz(Z)){H.push(VB(Z));continue}if(cW(Z)){H.push({type:q0.Ident,value:Oz(Z)});continue}return}if(B==="."){if(Q1--,Pz(Z)){H.push(VB(Z));continue}return}if(B==="/"){while(Q1<Z.length&&(Z[Q1]===`
31
- `||Z[Q1]==="\t"||Z[Q1]===" "))Q1++;let J;if(Pz(Z)){if(J=VB(Z),J.type!==q0.Hue){H.push({type:q0.Alpha,value:J});continue}}if(cW(Z)){if(Oz(Z)==="none"){H.push({type:q0.Alpha,value:{type:q0.None,value:void 0}});continue}}return}if(/\d/.test(B)){Q1--,H.push(VB(Z));continue}if(uW.test(B)){Q1--,H.push(lo(Z));continue}return}return H}function ro($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==q0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==q0.Ident)return;let H=pW[Z.value];if(!H)return;let B={mode:H},J=YC($,!1);if(!J)return;let Q=UC(H).channels;for(let X=0,z,G;X<Q.length;X++)if(z=J[X],G=Q[X],z.type!==q0.None){if(B[G]=z.type===q0.Number?z.value:z.value/100,G==="alpha")B[G]=Math.max(0,Math.min(1,B[G]))}return B}function YC($,Z){let H=[],B;while($._i<$.length){if(B=$[$._i++],B.type===q0.None||B.type===q0.Number||B.type===q0.Alpha||B.type===q0.Percentage||Z&&B.type===q0.Hue){H.push(B);continue}if(B.type===q0.ParenClose){if($._i<$.length)return;continue}return}if(H.length<3||H.length>4)return;if(H.length===4){if(H[3].type!==q0.Alpha)return;H[3]=H[3].value}if(H.length===3)H.push({type:q0.None,value:void 0});return H.every((J)=>J.type!==q0.Alpha)?H:void 0}function ao($,Z){$._i=0;let H=$[$._i++];if(!H||H.type!==q0.Function)return;let B=YC($,Z);if(!B)return;return B.unshift(H.value),B}var no=($)=>{if(typeof $!=="string")return;let Z=io($),H=Z?ao(Z,!0):void 0,B=void 0,J=0,Q=AB.length;while(J<Q)if((B=AB[J++]($,H))!==void 0)return B;return Z?ro(Z):void 0},GC=no;function oo($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let H={mode:"rgb"},[,B,J,Q,X]=Z;if(B.type===q0.Hue||J.type===q0.Hue||Q.type===q0.Hue)return;if(B.type!==q0.None)H.r=B.type===q0.Number?B.value/255:B.value/100;if(J.type!==q0.None)H.g=J.type===q0.Number?J.value/255:J.value/100;if(Q.type!==q0.None)H.b=Q.type===q0.Number?Q.value/255:Q.value/100;if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var KC=oo;var so=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,WC=so;var NC=($,Z,H)=>$+H*(Z-$);var to=($)=>{let Z=[];for(let H=0;H<$.length-1;H++){let B=$[H],J=$[H+1];if(B===void 0&&J===void 0)Z.push(void 0);else if(B!==void 0&&J!==void 0)Z.push([B,J]);else Z.push(B!==void 0?[B,B]:[J,J])}return Z},LC=($)=>(Z)=>{let H=to(Z);return(B)=>{let J=B*H.length,Q=B>=1?H.length-1:Math.max(Math.floor(J),0),X=H[Q];return X===void 0?void 0:$(X[0],X[1],J-Q)}};var P0=LC(NC);var _1=($)=>{let Z=!1,H=$.map((B)=>{if(B!==void 0)return Z=!0,B;return 1});return Z?H:$};var eo={mode:"rgb",channels:["r","g","b","alpha"],parse:[KC,JC,XC,BC,WC,"srgb"],serialize:"srgb",interpolate:{r:P0,g:P0,b:P0,alpha:{use:P0,fixup:_1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},$8=eo;var dW=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),$s=($)=>{let Z=dW($.r),H=dW($.g),B=dW($.b),J={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*H+0.1882286462349947*B,y:0.297344975250536*Z+0.6273635662554661*H+0.0752914584939979*B,z:0.0270313613864123*Z+0.0706888525358272*H+0.9913375368376386*B};if($.alpha!==void 0)J.alpha=$.alpha;return J},lW=$s;var iW=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),Zs=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"a98",r:iW($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*H),g:iW($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*H),b:iW($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*H)};if(B!==void 0)J.alpha=B;return J},rW=Zs;var aW=($=0)=>{let Z=Math.abs($);if(Z<=0.04045)return $/12.92;return(Math.sign($)||1)*Math.pow((Z+0.055)/1.055,2.4)},Hs=({r:$,g:Z,b:H,alpha:B})=>{let J={mode:"lrgb",r:aW($),g:aW(Z),b:aW(H)};if(B!==void 0)J.alpha=B;return J},Z8=Hs;var Bs=($)=>{let{r:Z,g:H,b:B,alpha:J}=Z8($),Q={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*H+0.1804807884018343*B,y:0.2126390058715102*Z+0.715168678767756*H+0.0721923153607337*B,z:0.0193308187155918*Z+0.119194779794626*H+0.9505321522496607*B};if(J!==void 0)Q.alpha=J;return Q},L4=Bs;var nW=($=0)=>{let Z=Math.abs($);if(Z>0.0031308)return(Math.sign($)||1)*(1.055*Math.pow(Z,0.4166666666666667)-0.055);return $*12.92},Js=({r:$,g:Z,b:H,alpha:B},J="rgb")=>{let Q={mode:J,r:nW($),g:nW(Z),b:nW(H)};if(B!==void 0)Q.alpha=B;return Q},H8=Js;var Qs=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=H8({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*H,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*H,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*H});if(B!==void 0)J.alpha=B;return J},A4=Qs;var Xs={...$8,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>rW(L4($)),xyz65:rW},toMode:{rgb:($)=>A4(lW($)),xyz65:lW}},AC=Xs;var zs=($)=>($=$%360)<0?$+360:$,Q5=zs;var Gs=($,Z)=>{return $.map((H,B,J)=>{if(H===void 0)return H;let Q=Q5(H);if(B===0||$[B-1]===void 0)return Q;return Z(Q-Q5(J[B-1]))}).reduce((H,B)=>{if(!H.length||B===void 0||H[H.length-1]===void 0)return H.push(B),H;return H.push(B+H[H.length-1]),H},[])},V2=($)=>Gs($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var s5=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],VC=Math.PI/180,DC=180/Math.PI;var qC=s5[3]*s5[4],MC=s5[1]*s5[4],PC=s5[1]*s5[2]-s5[0]*s5[3],Fs=({r:$,g:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=(PC*H+$*qC-Z*MC)/(PC+qC-MC),Q=H-J,X=(s5[4]*(Z-J)-s5[2]*Q)/s5[3],z={mode:"cubehelix",l:J,s:J===0||J===1?void 0:Math.sqrt(Q*Q+X*X)/(s5[4]*J*(1-J))};if(z.s)z.h=Math.atan2(X,Q)*DC-120;if(B!==void 0)z.alpha=B;return z},_C=Fs;var Us=({h:$,s:Z,l:H,alpha:B})=>{let J={mode:"rgb"};if($=($===void 0?0:$+120)*VC,H===void 0)H=0;let Q=Z===void 0?0:Z*H*(1-H),X=Math.cos($),z=Math.sin($);if(J.r=H+Q*(s5[0]*X+s5[1]*z),J.g=H+Q*(s5[2]*X+s5[3]*z),J.b=H+Q*(s5[4]*X+s5[5]*z),B!==void 0)J.alpha=B;return J},OC=Us;var _3=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let H=Q5($.h),B=Q5(Z.h),J=Math.sin((B-H+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*J},jC=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let H=Q5($.h),B=Q5(Z.h);if(Math.abs(B-H)>180)return H-(B-360*Math.sign(B-H));return B-H},O3=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let H=Q5($.h),B=Q5(Z.h),J=Math.sin((B-H+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*J};var D2=($)=>{let Z=$.reduce((B,J)=>{if(J!==void 0){let Q=J*Math.PI/180;B.sin+=Math.sin(Q),B.cos+=Math.cos(Q)}return B},{sin:0,cos:0}),H=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return H<0?360+H:H};var Ys={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:_C},toMode:{rgb:OC},interpolate:{h:{use:P0,fixup:V2},s:P0,l:P0,alpha:{use:P0,fixup:_1}},difference:{h:_3},average:{h:D2}},TC=Ys;var Ks=({l:$,a:Z,b:H,alpha:B},J="lch")=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let Q=Math.sqrt(Z*Z+H*H),X={mode:J,l:$,c:Q};if(Q)X.h=Q5(Math.atan2(H,Z)*180/Math.PI);if(B!==void 0)X.alpha=B;return X},R4=Ks;var Ws=({l:$,c:Z,h:H,alpha:B},J="lab")=>{if(H===void 0)H=0;let Q={mode:J,l:$,a:Z?Z*Math.cos(H/180*Math.PI):0,b:Z?Z*Math.sin(H/180*Math.PI):0};if(B!==void 0)Q.alpha=B;return Q},k4=Ws;var jz=Math.pow(29,3)/Math.pow(3,3),Tz=Math.pow(6,3)/Math.pow(29,3);var T5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},j3={X:0.9504559270516716,Y:1,Z:1.0890577507598784},$w0=Math.pow(29,3)/Math.pow(3,3),Zw0=Math.pow(6,3)/Math.pow(29,3);var oW=($)=>Math.pow($,3)>Tz?Math.pow($,3):(116*$-16)/jz,Ns=({l:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=($+16)/116,Q=Z/500+J,X=J-H/200,z={mode:"xyz65",x:oW(Q)*j3.X,y:oW(J)*j3.Y,z:oW(X)*j3.Z};if(B!==void 0)z.alpha=B;return z},Cz=Ns;var Ls=($)=>A4(Cz($)),T3=Ls;var sW=($)=>$>Tz?Math.cbrt($):(jz*$+16)/116,As=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=sW($/j3.X),Q=sW(Z/j3.Y),X=sW(H/j3.Z),z={mode:"lab65",l:116*Q-16,a:500*(J-Q),b:200*(Q-X)};if(B!==void 0)z.alpha=B;return z},wz=As;var Vs=($)=>{let Z=wz(L4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},C3=Vs;var R$=1,Ez=1,H7=0.14444444444444443*Math.PI,k$=Math.cos(H7),b$=Math.sin(H7),Sz=100/Math.log(1.39);var Ds=({l:$,c:Z,h:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"lab65",l:(Math.exp($*R$/Sz)-1)/0.0039},Q=(Math.exp(0.0435*Z*Ez*R$)-1)/0.075,X=Q*Math.cos(H/180*Math.PI-H7),z=Q*Math.sin(H/180*Math.PI-H7);if(J.a=X*k$-z/0.83*b$,J.b=X*b$+z/0.83*k$,B!==void 0)J.alpha=B;return J},DB=Ds;var qs=({l:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Z*k$+H*b$,Q=0.83*(H*k$-Z*b$),X=Math.sqrt(J*J+Q*Q),z={mode:"dlch",l:Sz/R$*Math.log(1+0.0039*$),c:Math.log(1+0.075*X)/(0.0435*Ez*R$)};if(z.c)z.h=Q5((Math.atan2(Q,J)+H7)/Math.PI*180);if(B!==void 0)z.alpha=B;return z},qB=qs;var CC=($)=>DB(R4($,"dlch")),wC=($)=>k4(qB($),"dlab"),Ms={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:CC,rgb:($)=>T3(CC($))},fromMode:{lab65:wC,rgb:($)=>wC(C3($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:P0,a:P0,b:P0,alpha:{use:P0,fixup:_1}}},EC=Ms;var Ps={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:DB,dlab:($)=>k4($,"dlab"),rgb:($)=>T3(DB($))},fromMode:{lab65:qB,dlab:($)=>R4($,"dlch"),rgb:($)=>qB(C3($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:P0,c:P0,h:{use:P0,fixup:V2},alpha:{use:P0,fixup:_1}},difference:{h:O3},average:{h:D2}},SC=Ps;function tW({h:$,s:Z,i:H,alpha:B}){if($=Q5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:H*(1+Z*(3/(2-J)-1)),g:H*(1+Z*(3*(1-J)/(2-J)-1)),b:H*(1-Z)};break;case 1:Q={r:H*(1+Z*(3*(1-J)/(2-J)-1)),g:H*(1+Z*(3/(2-J)-1)),b:H*(1-Z)};break;case 2:Q={r:H*(1-Z),g:H*(1+Z*(3/(2-J)-1)),b:H*(1+Z*(3*(1-J)/(2-J)-1))};break;case 3:Q={r:H*(1-Z),g:H*(1+Z*(3*(1-J)/(2-J)-1)),b:H*(1+Z*(3/(2-J)-1))};break;case 4:Q={r:H*(1+Z*(3*(1-J)/(2-J)-1)),g:H*(1-Z),b:H*(1+Z*(3/(2-J)-1))};break;case 5:Q={r:H*(1+Z*(3/(2-J)-1)),g:H*(1-Z),b:H*(1+Z*(3*(1-J)/(2-J)-1))};break;default:Q={r:H*(1-Z),g:H*(1-Z),b:H*(1-Z)}}if(Q.mode="rgb",B!==void 0)Q.alpha=B;return Q}function eW({r:$,g:Z,b:H,alpha:B}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.max($,Z,H),Q=Math.min($,Z,H),X={mode:"hsi",s:$+Z+H===0?0:1-3*Q/($+Z+H),i:($+Z+H)/3};if(J-Q!==0)X.h=(J===$?(Z-H)/(J-Q)+(Z<H)*6:J===Z?(H-$)/(J-Q)+2:($-Z)/(J-Q)+4)*60;if(B!==void 0)X.alpha=B;return X}var _s={mode:"hsi",toMode:{rgb:tW},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:eW},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:P0,fixup:V2},s:P0,i:P0,alpha:{use:P0,fixup:_1}},difference:{h:_3},average:{h:D2}},IC=_s;function $N({h:$,s:Z,l:H,alpha:B}){if($=Q5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let J=H+Z*(H<0.5?H:1-H),Q=J-(J-H)*2*Math.abs($/60%2-1),X;switch(Math.floor($/60)){case 0:X={r:J,g:Q,b:2*H-J};break;case 1:X={r:Q,g:J,b:2*H-J};break;case 2:X={r:2*H-J,g:J,b:Q};break;case 3:X={r:2*H-J,g:Q,b:J};break;case 4:X={r:Q,g:2*H-J,b:J};break;case 5:X={r:J,g:2*H-J,b:Q};break;default:X={r:2*H-J,g:2*H-J,b:2*H-J}}if(X.mode="rgb",B!==void 0)X.alpha=B;return X}function ZN({r:$,g:Z,b:H,alpha:B}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.max($,Z,H),Q=Math.min($,Z,H),X={mode:"hsl",s:J===Q?0:(J-Q)/(1-Math.abs(J+Q-1)),l:0.5*(J+Q)};if(J-Q!==0)X.h=(J===$?(Z-H)/(J-Q)+(Z<H)*6:J===Z?(H-$)/(J-Q)+2:($-Z)/(J-Q)+4)*60;if(B!==void 0)X.alpha=B;return X}var Os=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},RC=Os;var js=new RegExp(`^hsla?\\(\\s*${QC}${P3}${Z7}${P3}${Z7}\\s*(?:,\\s*${LB}\\s*)?\\)$`),Ts=($)=>{let Z=$.match(js);if(!Z)return;let H={mode:"hsl"};if(Z[3]!==void 0)H.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)H.h=RC(Z[1],Z[2]);if(Z[4]!==void 0)H.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)H.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)H.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)H.alpha=Math.max(0,Math.min(1,+Z[7]));return H},kC=Ts;function Cs($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let H={mode:"hsl"},[,B,J,Q,X]=Z;if(B.type!==q0.None){if(B.type===q0.Percentage)return;H.h=B.value}if(J.type!==q0.None){if(J.type===q0.Hue)return;H.s=J.value/100}if(Q.type!==q0.None){if(Q.type===q0.Hue)return;H.l=Q.value/100}if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var bC=Cs;var ws={mode:"hsl",toMode:{rgb:$N},fromMode:{rgb:ZN},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[bC,kC],serialize:($)=>`hsl(${$.h!==void 0?$.h:"none"} ${$.s!==void 0?$.s*100+"%":"none"} ${$.l!==void 0?$.l*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:P0,fixup:V2},s:P0,l:P0,alpha:{use:P0,fixup:_1}},difference:{h:_3},average:{h:D2}},Iz=ws;function MB({h:$,s:Z,v:H,alpha:B}){if($=Q5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:H,g:H*(1-Z*J),b:H*(1-Z)};break;case 1:Q={r:H*(1-Z*J),g:H,b:H*(1-Z)};break;case 2:Q={r:H*(1-Z),g:H,b:H*(1-Z*J)};break;case 3:Q={r:H*(1-Z),g:H*(1-Z*J),b:H};break;case 4:Q={r:H*(1-Z*J),g:H*(1-Z),b:H};break;case 5:Q={r:H,g:H*(1-Z),b:H*(1-Z*J)};break;default:Q={r:H*(1-Z),g:H*(1-Z),b:H*(1-Z)}}if(Q.mode="rgb",B!==void 0)Q.alpha=B;return Q}function PB({r:$,g:Z,b:H,alpha:B}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.max($,Z,H),Q=Math.min($,Z,H),X={mode:"hsv",s:J===0?0:1-Q/J,v:J};if(J-Q!==0)X.h=(J===$?(Z-H)/(J-Q)+(Z<H)*6:J===Z?(H-$)/(J-Q)+2:($-Z)/(J-Q)+4)*60;if(B!==void 0)X.alpha=B;return X}var Es={mode:"hsv",toMode:{rgb:MB},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:PB},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:P0,fixup:V2},s:P0,v:P0,alpha:{use:P0,fixup:_1}},difference:{h:_3},average:{h:D2}},Rz=Es;function HN({h:$,w:Z,b:H,alpha:B}){if(Z===void 0)Z=0;if(H===void 0)H=0;if(Z+H>1){let J=Z+H;Z/=J,H/=J}return MB({h:$,s:H===1?1:1-Z/(1-H),v:1-H,alpha:B})}function BN($){let Z=PB($);if(Z===void 0)return;let H=Z.s!==void 0?Z.s:0,B=Z.v!==void 0?Z.v:0,J={mode:"hwb",w:(1-H)*B,b:1-B};if(Z.h!==void 0)J.h=Z.h;if(Z.alpha!==void 0)J.alpha=Z.alpha;return J}function Ss($,Z){if(!Z||Z[0]!=="hwb")return;let H={mode:"hwb"},[,B,J,Q,X]=Z;if(B.type!==q0.None){if(B.type===q0.Percentage)return;H.h=B.value}if(J.type!==q0.None){if(J.type===q0.Hue)return;H.w=J.value/100}if(Q.type!==q0.None){if(Q.type===q0.Hue)return;H.b=Q.value/100}if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var yC=Ss;var Is={mode:"hwb",toMode:{rgb:HN},fromMode:{rgb:BN},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[yC],serialize:($)=>`hwb(${$.h!==void 0?$.h:"none"} ${$.w!==void 0?$.w*100+"%":"none"} ${$.b!==void 0?$.b*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:P0,fixup:V2},w:P0,b:P0,alpha:{use:P0,fixup:_1}},difference:{h:jC},average:{h:D2}},hC=Is;var kz=203;var bz=0.1593017578125;var yz=0.8359375,hz=18.8515625,xz=18.6875;function vz($){if($<0)return 0;let Z=Math.pow($,0.012683313515655966);return 1e4*Math.pow(Math.max(0,Z-0.8359375)/(18.8515625-18.6875*Z),6.277394636015326)}function gz($){if($<0)return 0;let Z=Math.pow($/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*Z)/(1+18.6875*Z),78.84375)}var JN=($)=>Math.max($/kz,0),Rs=({i:$,t:Z,p:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=vz($+0.008609037037932761*Z+0.11102962500302593*H),Q=vz($-0.00860903703793275*Z-0.11102962500302599*H),X=vz($+0.5600313357106791*Z-0.32062717498731885*H),z={mode:"xyz65",x:JN(2.070152218389422*J-1.3263473389671556*Q+0.2066510476294051*X),y:JN(0.3647385209748074*J+0.680566024947227*Q-0.0453045459220346*X),z:JN(-0.049747207535812*J-0.0492609666966138*Q+1.1880659249923042*X)};if(B!==void 0)z.alpha=B;return z},QN=Rs;var XN=($=0)=>Math.max($*kz,0),ks=({x:$,y:Z,z:H,alpha:B})=>{let J=XN($),Q=XN(Z),X=XN(H),z=gz(0.3592832590121217*J+0.6976051147779502*Q-0.0358915932320289*X),G=gz(-0.1920808463704995*J+1.1004767970374323*Q+0.0753748658519118*X),F=gz(0.0070797844607477*J+0.0748396662186366*Q+0.8433265453898765*X),U=0.5*z+0.5*G,Y=1.61376953125*z-3.323486328125*G+1.709716796875*F,K=4.378173828125*z-4.24560546875*G-0.132568359375*F,W={mode:"itp",i:U,t:Y,p:K};if(B!==void 0)W.alpha=B;return W},zN=ks;var bs={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:QN,rgb:($)=>A4(QN($))},fromMode:{xyz65:zN,rgb:($)=>zN(L4($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:P0,t:P0,p:P0,alpha:{use:P0,fixup:_1}}},xC=bs;var ys=134.03437499999998,hs=0.000000000016295499532821565,GN=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,bz);return Math.pow((yz+hz*Z)/(1+xz*Z),ys)},FN=($=0)=>Math.max($*203,0),xs=({x:$,y:Z,z:H,alpha:B})=>{$=FN($),Z=FN(Z),H=FN(H);let J=1.15*$-0.15*H,Q=0.66*Z+0.34*$,X=GN(0.41478972*J+0.579999*Q+0.014648*H),z=GN(-0.20151*J+1.120649*Q+0.0531008*H),G=GN(-0.0166008*J+0.2648*Q+0.6684799*H),F=(X+z)/2,U={mode:"jab",j:0.44*F/(1-0.56*F)-hs,a:3.524*X-4.066708*z+0.542708*G,b:0.199076*X+1.096799*z-1.295875*G};if(B!==void 0)U.alpha=B;return U},fz=xs;var vs=134.03437499999998,vC=0.000000000016295499532821565,UN=($)=>{if($<0)return 0;let Z=Math.pow($,1/vs);return 1e4*Math.pow((yz-Z)/(xz*Z-hz),1/bz)},YN=($)=>$/203,gs=({j:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=($+vC)/(0.44+0.56*($+vC)),Q=UN(J+0.13860504*Z+0.058047316*H),X=UN(J-0.13860504*Z-0.058047316*H),z=UN(J-0.096019242*Z-0.8118919*H),G={mode:"xyz65",x:YN(1.661373024652174*Q-0.914523081304348*X+0.23136208173913045*z),y:YN(-0.3250758611844533*Q+1.571847026732543*X-0.21825383453227928*z),z:YN(-0.090982811*Q-0.31272829*X+1.5227666*z)};if(B!==void 0)G.alpha=B;return G},mz=gs;var fs=($)=>{let Z=fz(L4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},pz=fs;var ms=($)=>A4(mz($)),uz=ms;var ps={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:pz,xyz65:fz},toMode:{rgb:uz,xyz65:mz},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:P0,a:P0,b:P0,alpha:{use:P0,fixup:_1}}},gC=ps;var us=({j:$,a:Z,b:H,alpha:B})=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.sqrt(Z*Z+H*H),Q={mode:"jch",j:$,c:J};if(J)Q.h=Q5(Math.atan2(H,Z)*180/Math.PI);if(B!==void 0)Q.alpha=B;return Q},KN=us;var cs=({j:$,c:Z,h:H,alpha:B})=>{if(H===void 0)H=0;let J={mode:"jab",j:$,a:Z?Z*Math.cos(H/180*Math.PI):0,b:Z?Z*Math.sin(H/180*Math.PI):0};if(B!==void 0)J.alpha=B;return J},WN=cs;var ds={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:WN,rgb:($)=>uz(WN($))},fromMode:{rgb:($)=>KN(pz($)),jab:KN},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:P0,fixup:V2},c:P0,j:P0,alpha:{use:P0,fixup:_1}},difference:{h:O3},average:{h:D2}},fC=ds;var w3=Math.pow(29,3)/Math.pow(3,3),y$=Math.pow(6,3)/Math.pow(29,3);var NN=($)=>Math.pow($,3)>y$?Math.pow($,3):(116*$-16)/w3,ls=({l:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=($+16)/116,Q=Z/500+J,X=J-H/200,z={mode:"xyz50",x:NN(Q)*T5.X,y:NN(J)*T5.Y,z:NN(X)*T5.Z};if(B!==void 0)z.alpha=B;return z},h$=ls;var is=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=H8({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*H,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*H,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*H});if(B!==void 0)J.alpha=B;return J},G9=is;var rs=($)=>G9(h$($)),cz=rs;var as=($)=>{let{r:Z,g:H,b:B,alpha:J}=Z8($),Q={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*H+0.14307845442264197*B,y:0.22249319175623702*Z+0.7168870538238823*H+0.06061979053616537*B,z:0.013923904500943465*Z+0.09708128566574634*H+0.7140993584005155*B};if(J!==void 0)Q.alpha=J;return Q},F9=as;var LN=($)=>$>y$?Math.cbrt($):(w3*$+16)/116,ns=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=LN($/T5.X),Q=LN(Z/T5.Y),X=LN(H/T5.Z),z={mode:"lab",l:116*Q-16,a:500*(J-Q),b:200*(Q-X)};if(B!==void 0)z.alpha=B;return z},x$=ns;var os=($)=>{let Z=x$(F9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},dz=os;function ss($,Z){if(!Z||Z[0]!=="lab")return;let H={mode:"lab"},[,B,J,Q,X]=Z;if(B.type===q0.Hue||J.type===q0.Hue||Q.type===q0.Hue)return;if(B.type!==q0.None)H.l=Math.min(Math.max(0,B.value),100);if(J.type!==q0.None)H.a=J.type===q0.Number?J.value:J.value*125/100;if(Q.type!==q0.None)H.b=Q.type===q0.Number?Q.value:Q.value*125/100;if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var mC=ss;var ts={mode:"lab",toMode:{xyz50:h$,rgb:cz},fromMode:{xyz50:x$,rgb:dz},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[mC],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:P0,a:P0,b:P0,alpha:{use:P0,fixup:_1}}},v$=ts;var es={...v$,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Cz,rgb:T3},fromMode:{xyz65:wz,rgb:C3},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},pC=es;function $t($,Z){if(!Z||Z[0]!=="lch")return;let H={mode:"lch"},[,B,J,Q,X]=Z;if(B.type!==q0.None){if(B.type===q0.Hue)return;H.l=Math.min(Math.max(0,B.value),100)}if(J.type!==q0.None)H.c=Math.max(0,J.type===q0.Number?J.value:J.value*150/100);if(Q.type!==q0.None){if(Q.type===q0.Percentage)return;H.h=Q.value}if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var uC=$t;var Zt={mode:"lch",toMode:{lab:k4,rgb:($)=>cz(k4($))},fromMode:{rgb:($)=>R4(dz($)),lab:R4},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[uC],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:P0,fixup:V2},c:P0,l:P0,alpha:{use:P0,fixup:_1}},difference:{h:O3},average:{h:D2}},g$=Zt;var Ht={...g$,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>k4($,"lab65"),rgb:($)=>T3(k4($,"lab65"))},fromMode:{rgb:($)=>R4(C3($),"lch65"),lab65:($)=>R4($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},cC=Ht;var Bt=({l:$,u:Z,v:H,alpha:B})=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.sqrt(Z*Z+H*H),Q={mode:"lchuv",l:$,c:J};if(J)Q.h=Q5(Math.atan2(H,Z)*180/Math.PI);if(B!==void 0)Q.alpha=B;return Q},AN=Bt;var Jt=({l:$,c:Z,h:H,alpha:B})=>{if(H===void 0)H=0;let J={mode:"luv",l:$,u:Z?Z*Math.cos(H/180*Math.PI):0,v:Z?Z*Math.sin(H/180*Math.PI):0};if(B!==void 0)J.alpha=B;return J},VN=Jt;var dC=($,Z,H)=>4*$/($+15*Z+3*H),lC=($,Z,H)=>9*Z/($+15*Z+3*H),Qt=dC(T5.X,T5.Y,T5.Z),Xt=lC(T5.X,T5.Y,T5.Z),zt=($)=>$<=y$?w3*$:116*Math.cbrt($)-16,Gt=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=zt(Z/T5.Y),Q=dC($,Z,H),X=lC($,Z,H);if(!isFinite(Q)||!isFinite(X))J=Q=X=0;else Q=13*J*(Q-Qt),X=13*J*(X-Xt);let z={mode:"luv",l:J,u:Q,v:X};if(B!==void 0)z.alpha=B;return z},_B=Gt;var Ft=($,Z,H)=>4*$/($+15*Z+3*H),Ut=($,Z,H)=>9*Z/($+15*Z+3*H),Yt=Ft(T5.X,T5.Y,T5.Z),Kt=Ut(T5.X,T5.Y,T5.Z),Wt=({l:$,u:Z,v:H,alpha:B})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Z/(13*$)+Yt,Q=H/(13*$)+Kt,X=T5.Y*($<=8?$/w3:Math.pow(($+16)/116,3)),z=X*(9*J)/(4*Q),G=X*(12-3*J-20*Q)/(4*Q),F={mode:"xyz50",x:z,y:X,z:G};if(B!==void 0)F.alpha=B;return F},OB=Wt;var Nt=($)=>AN(_B(F9($))),Lt=($)=>G9(OB(VN($))),At={mode:"lchuv",toMode:{luv:VN,rgb:Lt},fromMode:{rgb:Nt,luv:AN},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:P0,fixup:V2},c:P0,l:P0,alpha:{use:P0,fixup:_1}},difference:{h:O3},average:{h:D2}},iC=At;var Vt={...$8,mode:"lrgb",toMode:{rgb:H8},fromMode:{rgb:Z8},parse:["srgb-linear"],serialize:"srgb-linear"},rC=Vt;var Dt={mode:"luv",toMode:{xyz50:OB,rgb:($)=>G9(OB($))},fromMode:{xyz50:_B,rgb:($)=>_B(F9($))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:P0,u:P0,v:P0,alpha:{use:P0,fixup:_1}}},aC=Dt;var qt=({r:$,g:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*H),Q=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*H),X=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*H),z={mode:"oklab",l:0.210454268309314*J+0.7936177747023054*Q-0.0040720430116193*X,a:1.9779985324311684*J-2.42859224204858*Q+0.450593709617411*X,b:0.0259040424655478*J+0.7827717124575296*Q-0.8086757549230774*X};if(B!==void 0)z.alpha=B;return z},lz=qt;var Mt=($)=>{let Z=lz(Z8($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},E3=Mt;var Pt=({l:$,a:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=Math.pow($+0.3963377773761749*Z+0.2158037573099136*H,3),Q=Math.pow($-0.1055613458156586*Z-0.0638541728258133*H,3),X=Math.pow($-0.0894841775298119*Z-1.2914855480194092*H,3),z={mode:"lrgb",r:4.076741636075957*J-3.3077115392580616*Q+0.2309699031821044*X,g:-1.2684379732850317*J+2.6097573492876887*Q-0.3413193760026573*X,b:-0.0041960761386756*J-0.7034186179359362*Q+1.7076146940746117*X};if(B!==void 0)z.alpha=B;return z},U9=Pt;var _t=($)=>H8(U9($)),S3=_t;function jB($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function B7($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function Ot($,Z){let H,B,J,Q,X,z,G,F;if(-1.88170328*$-0.80936493*Z>1)H=1.19086277,B=1.76576728,J=0.59662641,Q=0.75515197,X=0.56771245,z=4.0767416621,G=-3.3077115913,F=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)H=0.73956515,B=-0.45954404,J=0.08285427,Q=0.1254107,X=0.14503204,z=-1.2684380046,G=2.6097574011,F=-0.3413193965;else H=1.35733652,B=-0.00915799,J=-1.1513021,Q=-0.50559606,X=0.00692167,z=-0.0041960863,G=-0.7034186147,F=1.707614701;let U=H+B*$+J*Z+Q*$*$+X*$*Z,Y=0.3963377774*$+0.2158037573*Z,K=-0.1055613458*$-0.0638541728*Z,W=-0.0894841775*$-1.291485548*Z;{let N=1+U*Y,L=1+U*K,V=1+U*W,A=N*N*N,D=L*L*L,q=V*V*V,_=3*Y*N*N,M=3*K*L*L,P=3*W*V*V,C=6*Y*Y*N,R=6*K*K*L,y=6*W*W*V,w=z*A+G*D+F*q,h=z*_+G*M+F*P,E=z*C+G*R+F*y;U=U-w*h/(h*h-0.5*w*E)}return U}function DN($,Z){let H=Ot($,Z),B=U9({l:1,a:H*$,b:H*Z}),J=Math.cbrt(1/Math.max(B.r,B.g,B.b)),Q=J*H;return[J,Q]}function jt($,Z,H,B,J,Q=null){if(!Q)Q=DN($,Z);let X;if((H-J)*Q[1]-(Q[0]-J)*B<=0)X=Q[1]*J/(B*Q[0]+Q[1]*(J-H));else{X=Q[1]*(J-1)/(B*(Q[0]-1)+Q[1]*(J-H));{let z=H-J,G=B,F=0.3963377774*$+0.2158037573*Z,U=-0.1055613458*$-0.0638541728*Z,Y=-0.0894841775*$-1.291485548*Z,K=z+G*F,W=z+G*U,N=z+G*Y;{let L=J*(1-X)+X*H,V=X*B,A=L+V*F,D=L+V*U,q=L+V*Y,_=A*A*A,M=D*D*D,P=q*q*q,C=3*K*A*A,R=3*W*D*D,y=3*N*q*q,w=6*K*K*A,h=6*W*W*D,E=6*N*N*q,I=4.0767416621*_-3.3077115913*M+0.2309699292*P-1,j=4.0767416621*C-3.3077115913*R+0.2309699292*y,S=4.0767416621*w-3.3077115913*h+0.2309699292*E,k=j/(j*j-0.5*I*S),b=-I*k,v=-1.2684380046*_+2.6097574011*M-0.3413193965*P-1,c=-1.2684380046*C+2.6097574011*R-0.3413193965*y,T=-1.2684380046*w+2.6097574011*h-0.3413193965*E,e=c/(c*c-0.5*v*T),Z0=-v*e,x=-0.0041960863*_-0.7034186147*M+1.707614701*P-1,t=-0.0041960863*C-0.7034186147*R+1.707614701*y,D0=-0.0041960863*w-0.7034186147*h+1.707614701*E,p=t/(t*t-0.5*x*D0),X0=-x*p;b=k>=0?b:1e6,Z0=e>=0?Z0:1e6,X0=p>=0?X0:1e6,X+=Math.min(b,Math.min(Z0,X0))}}}return X}function TB($,Z,H=null){if(!H)H=DN($,Z);let B=H[0],J=H[1];return[J/B,J/(1-B)]}function iz($,Z,H){let B=DN(Z,H),J=jt(Z,H,$,1,$,B),Q=TB(Z,H,B),X=0.11516993+1/(7.4477897+4.1590124*H+Z*(-2.19557347+1.75198401*H+Z*(-2.13704948-10.02301043*H+Z*(-4.24894561+5.38770819*H+4.69891013*Z)))),z=0.11239642+1/(1.6132032-0.68124379*H+Z*(0.40370612+0.90148123*H+Z*(-0.27087943+0.6122399*H+Z*(0.00299215-0.45399568*H-0.14661872*Z)))),G=J/Math.min($*Q[0],(1-$)*Q[1]),F=$*X,U=(1-$)*z,Y=0.9*G*Math.sqrt(Math.sqrt(1/(1/(F*F*F*F)+1/(U*U*U*U))));return F=$*0.4,U=(1-$)*0.8,[Math.sqrt(1/(1/(F*F)+1/(U*U))),Y,J]}function rz($){let Z=$.l!==void 0?$.l:0,H=$.a!==void 0?$.a:0,B=$.b!==void 0?$.b:0,J={mode:"okhsl",l:jB(Z)};if($.alpha!==void 0)J.alpha=$.alpha;let Q=Math.sqrt(H*H+B*B);if(!Q)return J.s=0,J;let[X,z,G]=iz(Z,H/Q,B/Q),F;if(Q<z){let U=0,Y=0.8*X,K=1-Y/z;F=(Q-U)/(Y+K*(Q-U))*0.8}else{let U=z,Y=0.2*z*z*1.25*1.25/X,K=1-Y/(G-z);F=0.8+0.2*((Q-U)/(Y+K*(Q-U)))}if(F)J.s=F,J.h=Q5(Math.atan2(B,H)*180/Math.PI);return J}function az($){let Z=$.h!==void 0?$.h:0,H=$.s!==void 0?$.s:0,B=$.l!==void 0?$.l:0,J={mode:"oklab",l:B7(B)};if($.alpha!==void 0)J.alpha=$.alpha;if(!H||B===1)return J.a=J.b=0,J;let Q=Math.cos(Z/180*Math.PI),X=Math.sin(Z/180*Math.PI),[z,G,F]=iz(J.l,Q,X),U,Y,K,W;if(H<0.8)U=1.25*H,Y=0,K=0.8*z,W=1-K/G;else U=5*(H-0.8),Y=G,K=0.2*G*G*1.25*1.25/z,W=1-K/(F-G);let N=Y+U*K/(1-W*U);return J.a=N*Q,J.b=N*X,J}var Tt={...Iz,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:rz,rgb:($)=>rz(E3($))},toMode:{oklab:az,rgb:($)=>S3(az($))}},nC=Tt;function nz($){let Z=$.l!==void 0?$.l:0,H=$.a!==void 0?$.a:0,B=$.b!==void 0?$.b:0,J=Math.sqrt(H*H+B*B),Q=J?H/J:1,X=J?B/J:1,[z,G]=TB(Q,X),F=0.5,U=1-F/z,Y=G/(J+Z*G),K=Y*Z,W=Y*J,N=B7(K),L=W*N/K,V=U9({l:N,a:Q*L,b:X*L}),A=Math.cbrt(1/Math.max(V.r,V.g,V.b,0));Z=Z/A,J=J/A*jB(Z)/Z,Z=jB(Z);let D={mode:"okhsv",s:J?(F+G)*W/(G*F+G*U*W):0,v:Z?Z/K:0};if(D.s)D.h=Q5(Math.atan2(B,H)*180/Math.PI);if($.alpha!==void 0)D.alpha=$.alpha;return D}function oz($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let H=$.h!==void 0?$.h:0,B=$.s!==void 0?$.s:0,J=$.v!==void 0?$.v:0,Q=Math.cos(H/180*Math.PI),X=Math.sin(H/180*Math.PI),[z,G]=TB(Q,X),F=0.5,U=1-F/z,Y=1-B*F/(F+G-G*U*B),K=B*G*F/(F+G-G*U*B),W=B7(Y),N=K*W/Y,L=U9({l:W,a:Q*N,b:X*N}),V=Math.cbrt(1/Math.max(L.r,L.g,L.b,0)),A=B7(J*Y),D=K*A/Y;return Z.l=A*V,Z.a=D*Q*V,Z.b=D*X*V,Z}var Ct={...Rz,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:nz,rgb:($)=>nz(E3($))},toMode:{oklab:oz,rgb:($)=>S3(oz($))}},oC=Ct;function wt($,Z){if(!Z||Z[0]!=="oklab")return;let H={mode:"oklab"},[,B,J,Q,X]=Z;if(B.type===q0.Hue||J.type===q0.Hue||Q.type===q0.Hue)return;if(B.type!==q0.None)H.l=Math.min(Math.max(0,B.type===q0.Number?B.value:B.value/100),1);if(J.type!==q0.None)H.a=J.type===q0.Number?J.value:J.value*0.4/100;if(Q.type!==q0.None)H.b=Q.type===q0.Number?Q.value:Q.value*0.4/100;if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var sC=wt;var Et={...v$,mode:"oklab",toMode:{lrgb:U9,rgb:S3},fromMode:{lrgb:lz,rgb:E3},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[sC],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},tC=Et;function St($,Z){if(!Z||Z[0]!=="oklch")return;let H={mode:"oklch"},[,B,J,Q,X]=Z;if(B.type!==q0.None){if(B.type===q0.Hue)return;H.l=Math.min(Math.max(0,B.type===q0.Number?B.value:B.value/100),1)}if(J.type!==q0.None)H.c=Math.max(0,J.type===q0.Number?J.value:J.value*0.4/100);if(Q.type!==q0.None){if(Q.type===q0.Percentage)return;H.h=Q.value}if(X.type!==q0.None)H.alpha=Math.min(1,Math.max(0,X.type===q0.Number?X.value:X.value/100));return H}var eC=St;var It={...g$,mode:"oklch",toMode:{oklab:($)=>k4($,"oklab"),rgb:($)=>S3(k4($,"oklab"))},fromMode:{rgb:($)=>R4(E3($),"oklch"),oklab:($)=>R4($,"oklch")},parse:[eC],serialize:($)=>`oklch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,ranges:{l:[0,1],c:[0,0.4],h:[0,360]}},$w=It;var Rt=($)=>{let{r:Z,g:H,b:B,alpha:J}=Z8($),Q={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*H+0.1982172852343625*B,y:0.2289745640697487*Z+0.6917385218365062*H+0.079286914093745*B,z:0*Z+0.0451133818589026*H+1.043944368900976*B};if(J!==void 0)Q.alpha=J;return Q},qN=Rt;var kt=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=H8({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*H,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*H,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*H},"p3");if(B!==void 0)J.alpha=B;return J},MN=kt;var bt={...$8,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>MN(L4($)),xyz65:MN},toMode:{rgb:($)=>A4(qN($)),xyz65:qN}},Zw=bt;var PN=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},yt=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"prophoto",r:PN($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*H),g:PN($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*H),b:PN($*0+Z*0+1.2119675456389452*H)};if(B!==void 0)J.alpha=B;return J},_N=yt;var ON=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},ht=($)=>{let Z=ON($.r),H=ON($.g),B=ON($.b),J={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*H+0.0313477341283922*B,y:0.2880748288194013*Z+0.7118352342418731*H+0.0000899369387256*B,z:0*Z+0*H+0.8251046025104602*B};if($.alpha!==void 0)J.alpha=$.alpha;return J},jN=ht;var xt={...$8,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:_N,rgb:($)=>_N(F9($))},toMode:{xyz50:jN,rgb:($)=>G9(jN($))}},Hw=xt;var TN=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},vt=({x:$,y:Z,z:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"rec2020",r:TN($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*H),g:TN($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*H),b:TN($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*H)};if(B!==void 0)J.alpha=B;return J},CN=vt;var wN=($=0)=>{let Z=Math.abs($);if(Z<0.08124285829863151)return $/4.5;return(Math.sign($)||1)*Math.pow((Z+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},gt=($)=>{let Z=wN($.r),H=wN($.g),B=wN($.b),J={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*H+0.1688809751641721*B,y:0.262700212011267*Z+0.6779980715188708*H+0.059301716469862*B,z:0*Z+0.0280726930490874*H+1.0609850577107909*B};if($.alpha!==void 0)J.alpha=$.alpha;return J},EN=gt;var ft={...$8,mode:"rec2020",fromMode:{xyz65:CN,rgb:($)=>CN(L4($))},toMode:{xyz65:EN,rgb:($)=>A4(EN($))},parse:["rec2020"],serialize:"rec2020"},Bw=ft;var I3=0.0037930732552754493,sz=Math.cbrt(0.0037930732552754493);var SN=($)=>Math.cbrt($)-sz,mt=($)=>{let{r:Z,g:H,b:B,alpha:J}=Z8($),Q=SN(0.3*Z+0.622*H+0.078*B+I3),X=SN(0.23*Z+0.692*H+0.078*B+I3),z=SN(0.2434226892454782*Z+0.2047674442449682*H+0.5518098665095535*B+I3),G={mode:"xyb",x:(Q-X)/2,y:(Q+X)/2,b:z-(Q+X)/2};if(J!==void 0)G.alpha=J;return G},Jw=mt;var IN=($)=>Math.pow($+sz,3),pt=({x:$,y:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J=IN($+Z)-I3,Q=IN(Z-$)-I3,X=IN(H+Z)-I3,z=H8({r:11.031566904639861*J-9.866943908131562*Q-0.16462299650829934*X,g:-3.2541473810744237*J+4.418770377582723*Q-0.16462299650829934*X,b:-3.6588512867136815*J+2.7129230459360922*Q+1.9459282407775895*X});if(B!==void 0)z.alpha=B;return z},Qw=pt;var ut={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:Qw},fromMode:{rgb:Jw},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:P0,y:P0,b:P0,alpha:{use:P0,fixup:_1}}},Xw=ut;var ct={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:G9,lab:x$},fromMode:{rgb:F9,lab:h$},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:P0,y:P0,z:P0,alpha:{use:P0,fixup:_1}}},zw=ct;var dt=($)=>{let{x:Z,y:H,z:B,alpha:J}=$;if(Z===void 0)Z=0;if(H===void 0)H=0;if(B===void 0)B=0;let Q={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*H-0.0501922295431356*B,y:0.0296278156881593*Z+0.990434484573249*H-0.0170738250293851*B,z:-0.0092430581525912*Z+0.0150551448965779*H+0.7518742899580008*B};if(J!==void 0)Q.alpha=J;return Q},Gw=dt;var lt=($)=>{let{x:Z,y:H,z:B,alpha:J}=$;if(Z===void 0)Z=0;if(H===void 0)H=0;if(B===void 0)B=0;let Q={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*H+0.0632593086610217*B,y:-0.0283697069632081*Z+1.0099954580058226*H+0.021041398966943*B,z:0.0123140016883199*Z-0.0205076964334779*H+1.3303659366080753*B};if(J!==void 0)Q.alpha=J;return Q},Fw=lt;var it={mode:"xyz65",toMode:{rgb:A4,xyz50:Gw},fromMode:{rgb:L4,xyz50:Fw},ranges:{x:[0,0.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:P0,y:P0,z:P0,alpha:{use:P0,fixup:_1}}},Uw=it;var rt=({r:$,g:Z,b:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*H,i:0.59597799*$-0.2741761*Z-0.32180189*H,q:0.21147017*$-0.52261711*Z+0.31114694*H};if(B!==void 0)J.alpha=B;return J},Yw=rt;var at=({y:$,i:Z,q:H,alpha:B})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let J={mode:"rgb",r:$+0.95608445*Z+0.6208885*H,g:$-0.27137664*Z-0.6486059*H,b:$-1.10561724*Z+1.70250126*H};if(B!==void 0)J.alpha=B;return J},Kw=at;var nt={mode:"yiq",toMode:{rgb:Kw},fromMode:{rgb:Yw},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:P0,i:P0,q:P0,alpha:{use:P0,fixup:_1}}},Ww=nt;function RN($){let Z=Mz("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var ob0=r1(AC),sb0=r1(TC),tb0=r1(EC),eb0=r1(SC),$y0=r1(IC),Zy0=r1(Iz),Hy0=r1(Rz),By0=r1(hC),Jy0=r1(xC),Qy0=r1(gC),Xy0=r1(fC),zy0=r1(v$),Gy0=r1(pC),Fy0=r1(g$),Uy0=r1(cC),Yy0=r1(iC),Ky0=r1(rC),Wy0=r1(aC),Ny0=r1(nC),Ly0=r1(oC),Ay0=r1(tC),Vy0=r1($w),Dy0=r1(Zw),qy0=r1(Hw),My0=r1(Bw),Py0=r1($8),_y0=r1(Xw),Oy0=r1(zw),jy0=r1(Uw),Ty0=r1(Ww);var R3={sans:{label:"Sans",sans:"system-ui",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"},serif:{label:"Serif",sans:"Literata",mono:"Geist Mono",googleFontsQuery:"Literata:wght@400;600;700&family=Geist+Mono:wght@400;500"},mono:{label:"Mono",sans:"Geist Mono",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500;600"},geometric:{label:"Geometric",sans:"Manrope",mono:"Geist Mono",googleFontsQuery:"Manrope:wght@400;500;600&family=Geist+Mono:wght@400;500"},rounded:{label:"Rounded",sans:"SN Pro",mono:"Geist Mono",googleFontsQuery:"SN+Pro:wght@400;500;600&family=Geist+Mono:wght@400;500"},blobby:{label:"Blobby",sans:"Sour Gummy",mono:"Azeret Mono",googleFontsQuery:"Sour+Gummy:wght@400;500;600&family=Azeret+Mono:wght@400;500"},awkward:{label:"Awkward",sans:"Averia Sans Libre",mono:"Azeret Mono",googleFontsQuery:"Averia+Sans+Libre:wght@400;500;600&family=Azeret+Mono:wght@400;500"},comic:{label:"Comic",sans:"Comic Sans MS, Comic Sans, cursive",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"}},CB={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},wB={blob:{label:"Blob",traits:{shape:0.11,"body.r":0.5,"body.ratio":0,"body.n":0.5}},boxy:{label:"Boxy",traits:{shape:0.54,"body.r":1,"body.ratio":0}},pill:{label:"Pill",traits:{shape:0.65,"body.r":1}},dorito:{label:"Dorito",traits:{shape:0.99,"body.r":1,"body.ratio":0,"body.rot":0}}},ot="oklch(0.205 0 0)";function Nw($){return RN($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var Lw={workspace:{primary:($)=>$,primaryForeground:($)=>Nw($),background:()=>"color-mix(in srgb, var(--primary) 3%, oklch(1 0 0) 97%)",foreground:()=>"color-mix(in srgb, var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 97%, var(--foreground) 3%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 4%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 7%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"},widget:{background:($)=>$,foreground:($)=>Nw($),primary:()=>"color-mix(in srgb, var(--background) 3%, oklch(1 0 0) 97%)",primaryForeground:()=>"color-mix(in srgb, var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 97%, var(--foreground) 3%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 4%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 15%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"}},kN=Object.keys(Lw.workspace);function st($,Z="workspace"){let H={},B=Lw[Z];for(let J of kN)H[J]=B[J]($);return H}var ez={default:{label:"Default"},paper:{label:"Paper",primary:"oklch(0.4328 0.0351 66.67)"},rose:{label:"Rose",primary:"oklch(0.6322 0.2171 26.02)"},tangerine:{label:"Tangerine",primary:"oklch(0.6886 0.22 37.15)"},sand:{label:"Sand",primary:"oklch(0.8334 0.1271 67.80)"},mint:{label:"Tropics",primary:"oklch(0.5774 0.1399 156.06)"},sky:{label:"Sky",primary:"oklch(0.5824 0.1830 253.59)"},lavender:{label:"Lavender",primary:"oklch(0.6025 0.2426 294.58)"}},Y9={font:"sans",color:"default",radius:"soft",agent:"boxy"};function tz($,Z,H){return typeof $==="string"&&Object.hasOwn(Z,$)?$:H}function j8($){return{font:tz($?.font,R3,Y9.font),color:tz($?.color,ez,Y9.color),radius:tz($?.radius,CB,Y9.radius),agent:tz($?.agent,wB,Y9.agent)}}function Aw($,Z="workspace"){let H=j8($),J=ez[H.color].primary??(Z==="widget"?ot:void 0);return J?st(J,Z):void 0}var Vw=O(d(),1),tt="moi-agent",et={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},$e={idle:iT,happy:rT,sad:aT,surprised:nT,wink:oT,sleepy:sT,smug:tT,unsure:eT,shy:$C,thinking:ZC};function K9({size:$=56,preset:Z=Y9.agent,animated:H=!1,color:B="default",expression:J="idle",className:Q}){return Vw.jsx(fT,{name:tt,size:$,animate:H?"always":"hover",palette:et[B],expression:J?$e[J]:void 0,className:s("shrink-0",Q),traits:wB[Z].traits})}var f$={};j4(f$,{Trigger:()=>jw,Root:()=>Ow,Panel:()=>ww});var EB=O(g(),1);var b4=O(g(),1);function Dw($){let{open:Z,defaultOpen:H,onOpenChange:B,disabled:J}=$,Q=Z!==void 0,[X,z]=t4({controlled:Z,default:H,name:"Collapsible",state:"open"}),{mounted:G,setMounted:F,transitionStatus:U}=i4(X,!0,!0),[Y,K]=b4.useState(X),[{height:W,width:N},L]=b4.useState({height:void 0,width:void 0}),V=H1(),[A,D]=b4.useState(),q=A??V,[_,M]=b4.useState(!1),[P,C]=b4.useState(!1),R=b4.useRef(null),y=b4.useRef(null),w=b4.useRef(null),h=b4.useRef(null),E=d8(h,!1),I=Y0((j)=>{let S=!X,k=M0(G0.triggerPress,j.nativeEvent);if(B(S,k),k.isCanceled)return;let b=h.current;if(y.current==="css-animation"&&b!=null)b.style.removeProperty("animation-name");if(!_&&!P){if(y.current!=null&&y.current!=="css-animation"){if(!G&&S)F(!0)}if(y.current==="css-animation"){if(!Y&&S)K(!0);if(!G&&S)F(!0)}}if(z(S),y.current==="none"&&G&&!S)F(!1)});return U0(()=>{if(Q&&y.current==="none"&&!P&&!X)F(!1)},[Q,P,X,Z,F]),b4.useMemo(()=>({abortControllerRef:R,animationTypeRef:y,disabled:J,handleTrigger:I,height:W,mounted:G,open:X,panelId:q,panelRef:h,runOnceAnimationsFinish:E,setDimensions:L,setHiddenUntilFound:M,setKeepMounted:C,setMounted:F,setOpen:z,setPanelIdState:D,setVisible:K,transitionDimensionRef:w,transitionStatus:U,visible:Y,width:N}),[R,y,J,I,W,G,X,q,h,E,L,M,C,F,z,K,w,U,Y,N])}var $G=O(g(),1),bN=$G.createContext(void 0);function ZG(){let $=$G.useContext(bN);if($===void 0)throw Error(E0(15));return $}var J7=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=c8.startingStyle]="startingStyle",$[$.endingStyle=c8.endingStyle]="endingStyle",$}({});var qw=function($){return $.panelOpen="data-panel-open",$}({});var Ze={[J7.open]:""},He={[J7.closed]:""},Mw={open($){if($)return{[qw.panelOpen]:""};return null}},Pw={open($){if($)return Ze;return He}};var HG={...Pw,...n1};var _w=O(d(),1),Ow=EB.forwardRef(function(Z,H){let{render:B,className:J,defaultOpen:Q=!1,disabled:X=!1,onOpenChange:z,open:G,...F}=Z,U=Y0(z),Y=Dw({open:G,defaultOpen:Q,onOpenChange:U,disabled:X}),K=EB.useMemo(()=>({open:Y.open,disabled:Y.disabled,transitionStatus:Y.transitionStatus}),[Y.open,Y.disabled,Y.transitionStatus]),W=EB.useMemo(()=>({...Y,onOpenChange:U,state:K}),[Y,U,K]),N=F0("div",Z,{state:K,ref:H,props:F,stateAttributesMapping:HG});return _w.jsx(bN.Provider,{value:W,children:N})});var BG=O(g(),1);var Be={...Mw,...n1},jw=BG.forwardRef(function(Z,H){let{panelId:B,open:J,handleTrigger:Q,state:X,disabled:z}=ZG(),{className:G,disabled:F=z,id:U,render:Y,nativeButton:K=!0,...W}=Z,{getButtonProps:N,buttonRef:L}=u5({disabled:F,focusableWhenDisabled:!0,native:K}),V=BG.useMemo(()=>({"aria-controls":J?B:void 0,"aria-expanded":J,onClick:Q}),[B,J,Q]);return F0("button",Z,{state:X,ref:[H,L],props:[V,W,N],stateAttributesMapping:Be})});var JG=O(g(),1);var W9=O(g(),1);var Tw=function($){return $.disabled="data-disabled",$.orientation="data-orientation",$}({});function Cw($){let{abortControllerRef:Z,animationTypeRef:H,externalRef:B,height:J,hiddenUntilFound:Q,keepMounted:X,id:z,mounted:G,onOpenChange:F,open:U,panelRef:Y,runOnceAnimationsFinish:K,setDimensions:W,setMounted:N,setOpen:L,setVisible:V,transitionDimensionRef:A,visible:D,width:q}=$,_=W9.useRef(!1),M=W9.useRef(null),P=W9.useRef(U),C=W9.useRef(U),R=U4(),y=W9.useMemo(()=>{if(H.current==="css-animation")return!D;return!U&&!G},[U,G,D,H]),w=Y0((E)=>{if(!E)return;if(H.current==null||A.current==null){let S=getComputedStyle(E),k=S.animationName!=="none"&&S.animationName!=="",b=S.transitionDuration!=="0s"&&S.transitionDuration!=="";if(k&&b);else if(S.animationName==="none"&&S.transitionDuration!=="0s")H.current="css-transition";else if(S.animationName!=="none"&&S.transitionDuration==="0s")H.current="css-animation";else H.current="none";if(E.getAttribute(Tw.orientation)==="horizontal"||S.transitionProperty.indexOf("width")>-1)A.current="width";else A.current="height"}if(H.current!=="css-transition")return;if(J===void 0||q===void 0){if(W({height:E.scrollHeight,width:E.scrollWidth}),C.current)E.style.setProperty("transition-duration","0s")}let I=-1,j=-1;return I=N5.request(()=>{C.current=!1,j=N5.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})}),()=>{N5.cancel(I),N5.cancel(j)}}),h=C4(B,Y,w);return U0(()=>{if(H.current!=="css-transition")return;let E=Y.current;if(!E)return;let I=-1;if(Z.current!=null)Z.current.abort(),Z.current=null;if(U){let j={"justify-content":E.style.justifyContent,"align-items":E.style.alignItems,"align-content":E.style.alignContent,"justify-items":E.style.justifyItems};if(Object.keys(j).forEach((S)=>{E.style.setProperty(S,"initial","important")}),!C.current&&!X)E.setAttribute(J7.startingStyle,"");W({height:E.scrollHeight,width:E.scrollWidth}),I=N5.request(()=>{Object.entries(j).forEach(([S,k])=>{if(k==="")E.style.removeProperty(S);else E.style.setProperty(S,k)})})}else{if(E.scrollHeight===0&&E.scrollWidth===0)return;W({height:E.scrollHeight,width:E.scrollWidth});let j=new AbortController;Z.current=j;let S=j.signal,k=null,b=J7.endingStyle;return k=new MutationObserver((v)=>{if(v.some((T)=>T.type==="attributes"&&T.attributeName===b))k?.disconnect(),k=null,K(()=>{if(W({height:0,width:0}),E.style.removeProperty("content-visibility"),N(!1),Z.current===j)Z.current=null},S)}),k.observe(E,{attributes:!0,attributeFilter:[b]}),()=>{if(k?.disconnect(),R.cancel(),Z.current===j)j.abort(),Z.current=null}}return()=>{N5.cancel(I)}},[Z,H,R,Q,X,G,U,Y,K,W,N]),U0(()=>{if(H.current!=="css-animation")return;let E=Y.current;if(!E)return;if(M.current=E.style.animationName||M.current,E.style.setProperty("animation-name","none"),W({height:E.scrollHeight,width:E.scrollWidth}),!P.current&&!_.current)E.style.removeProperty("animation-name");if(U){if(Z.current!=null)Z.current.abort(),Z.current=null;N(!0),V(!0)}else Z.current=new AbortController,K(()=>{N(!1),V(!1),Z.current=null},Z.current.signal)},[Z,H,U,Y,K,W,N,V,D]),S2(()=>{let E=N5.request(()=>{P.current=!1});return()=>N5.cancel(E)}),U0(()=>{if(!Q)return;let E=Y.current;if(!E)return;let I=-1,j=-1;if(U&&_.current)E.style.transitionDuration="0s",W({height:E.scrollHeight,width:E.scrollWidth}),I=N5.request(()=>{_.current=!1,j=N5.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})});return()=>{N5.cancel(I),N5.cancel(j)}},[Q,U,Y,W]),U0(()=>{let E=Y.current;if(E&&Q&&y){if(E.setAttribute("hidden","until-found"),H.current==="css-transition")E.setAttribute(J7.startingStyle,"")}},[Q,y,H,Y]),W9.useEffect(function(){let I=Y.current;if(!I)return;function j(S){_.current=!0,L(!0),F(!0,M0(G0.none,S))}return I.addEventListener("beforematch",j),()=>{I.removeEventListener("beforematch",j)}},[F,Y,L]),W9.useMemo(()=>({props:{hidden:y,id:z,ref:h}}),[y,z,h])}var yN=function($){return $.collapsiblePanelHeight="--collapsible-panel-height",$.collapsiblePanelWidth="--collapsible-panel-width",$}({});var ww=JG.forwardRef(function(Z,H){let{className:B,hiddenUntilFound:J,keepMounted:Q,render:X,id:z,...G}=Z,{abortControllerRef:F,animationTypeRef:U,height:Y,mounted:K,onOpenChange:W,open:N,panelId:L,panelRef:V,runOnceAnimationsFinish:A,setDimensions:D,setHiddenUntilFound:q,setKeepMounted:_,setMounted:M,setPanelIdState:P,setOpen:C,setVisible:R,state:y,transitionDimensionRef:w,visible:h,width:E,transitionStatus:I}=ZG(),j=J??!1,S=Q??!1;U0(()=>{if(z)return P(z),()=>{P(void 0)};return},[z,P]),U0(()=>{q(j)},[q,j]),U0(()=>{_(S)},[_,S]);let{props:k}=Cw({abortControllerRef:F,animationTypeRef:U,externalRef:H,height:Y,hiddenUntilFound:j,id:L,keepMounted:S,mounted:K,onOpenChange:W,open:N,panelRef:V,runOnceAnimationsFinish:A,setDimensions:D,setMounted:M,setOpen:C,setVisible:R,transitionDimensionRef:w,visible:h,width:E});y5({open:N&&I==="idle",ref:V,onComplete(){if(!N)return;D({height:void 0,width:void 0})}});let b=JG.useMemo(()=>({...y,transitionStatus:I}),[y,I]),v=F0("div",Z,{state:b,ref:[H,V],props:[k,{style:{[yN.collapsiblePanelHeight]:Y===void 0?"auto":`${Y}px`,[yN.collapsiblePanelWidth]:E===void 0?"auto":`${E}px`}},G],stateAttributesMapping:HG});if(!(S||j||!S&&K))return null;return v});var GG=O(d(),1);function QG({...$}){return GG.jsx(f$.Root,{"data-slot":"collapsible",...$})}function XG({...$}){return GG.jsx(f$.Trigger,{"data-slot":"collapsible-trigger",...$})}function zG({...$}){return GG.jsx(f$.Panel,{"data-slot":"collapsible-content",...$})}var FG=O(g(),1);var hN="moi-fonts",Ew="moi-font-previews",Je=Object.values(R3).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),Iw=[["sans","--sans"],["mono","--mono"]],Rw=kN.map(($)=>[$,Qe($)]),kw="--radius",Sw=[...Iw.map(([,$])=>$),...Rw.map(([,$])=>$),kw];function Qe($){return`--${$.replace(/[A-Z]/g,(H)=>`-${H.toLowerCase()}`)}`}function Xe($){let Z={},H=j8($),B=H.font===Y9.font?void 0:R3[H.font];for(let[J,Q]of Iw)Z[Q]=B?.[J];return Z}function xN($,Z="workspace"){let H={},B=Aw($,Z);for(let[J,Q]of Rw)H[Q]=B?.[J];return H}function ze($){let Z={},H=j8($),B=H.radius===Y9.radius?void 0:CB[H.radius];return Z[kw]=B?.radius,Z}function T8($,Z="workspace"){return{...Xe($),...xN($,Z),...ze($)}}function UG(){FG.useEffect(()=>{if(document.getElementById(Ew))return;let $=document.createElement("link");return $.id=Ew,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${Je}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function Ge($){FG.useEffect(()=>{let Z=document.documentElement,H=T8($);for(let B of Sw){let J=H[B];if(J)Z.style.setProperty(B,J);else Z.style.removeProperty(B)}return()=>{for(let B of Sw)Z.style.removeProperty(B)}},[$])}function bw($){let{font:Z}=j8($);Ge($),FG.useEffect(()=>{let H=R3[Z]??R3[Y9.font],B=document.getElementById(hN);if(!H.googleFontsQuery)B?.remove();else{let J=`https://fonts.googleapis.com/css2?family=${H.googleFontsQuery}&display=swap`;if(B)B.href=J;else{let Q=document.createElement("link");Q.id=hN,Q.rel="stylesheet",Q.crossOrigin="anonymous",Q.href=J,document.head.appendChild(Q)}}return()=>{document.getElementById(hN)?.remove()}},[Z])}function vN($){return $==="agent"||$==="widgets"||$==="scratchpad"||typeof $==="string"&&(/^view:[^/]+$/.test($)||/^view-builder:[^/]+$/.test($))}function SB($){return vN($)?$:null}function YG($,Z){return`/workspace/${$}/${Z}`}var KG=($)=>`view:${$}`,k3=($)=>$.startsWith("view:")?$.slice(5):null,b3=($)=>`view-builder:${$}`,Q7=($)=>$.startsWith("view-builder:")?$.slice(13):null;function m$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function yw($){if(!m$($))return{};let Z=$.appletParams;return m$(Z)?Z:{}}var p$=O(g(),1);var Q2=O(d(),1),IB={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function Fe($){let{width:Z,height:H,radius:B,topLeftRadius:J,bodyTop:Q,tabEnd:X,shoulder:z}=IB,G=Math.min(Z/2,B*$),F=Math.min(Z/2,J*$),U=Math.max(0,z.width),Y=X+U,K=Math.max(0,Math.min(z.roundness,U/2));return[`M ${F} 0`,`H ${X}`,`C ${X+K} 0 ${Y-K} ${Q} ${Y} ${Q}`,`H ${Z-G}`,`Q ${Z} ${Q} ${Z} ${Q+B}`,`V ${H-B}`,`Q ${Z} ${H} ${Z-G} ${H}`,`H ${G}`,`Q 0 ${H} 0 ${H-B}`,`V ${J}`,`Q 0 0 ${F} 0`,"Z"].join(" ")}function Ue(){let $=p$.useRef(null),[Z,H]=p$.useState(1);return p$.useLayoutEffect(()=>{let B=$.current;if(!B)return;let J=(z,G)=>{if(z<=0||G<=0)return;let F=z/IB.width,Y=G/IB.height/F;H((K)=>Math.abs(K-Y)<0.001?K:Y)},Q=B.getBoundingClientRect();J(Q.width,Q.height);let X=new ResizeObserver(([z])=>{if(z)J(z.contentRect.width,z.contentRect.height)});return X.observe(B),()=>X.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var hw=[{frame:s("-translate-x-3 translate-y-3 -rotate-6","group-focus-within:translate-y-2 group-hover:translate-y-2"),img:"opacity-40"},{frame:s("translate-x-3 translate-y-2 rotate-5","group-focus-within:translate-y-1 group-hover:translate-y-1"),img:"opacity-50"},{frame:s("-translate-x-1 translate-y-1 -rotate-2","group-focus-within:-translate-y-2 group-hover:-translate-y-2"),img:"opacity-100"}];function xw({workspaceId:$}){let Z=CX($),H=Z.data?[...Z.data.thumbnails].reverse():[],B=hw.slice(hw.length-H.length),J=Z.data?.firstUserMessage,Q=Z.data?.theme,{ref:X,horizontalRadiusScale:z}=Ue(),G=Fe(z),F=`folder-noise-${$}`,U=T8(Q),Y=xN(Q);return Q2.jsxs("div",{ref:X,style:Y,className:"relative h-45 w-full",children:[Q2.jsxs("svg",{viewBox:`0 0 ${IB.width} ${IB.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[Q2.jsx("defs",{children:Q2.jsxs("filter",{id:F,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[Q2.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),Q2.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),Q2.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:Q2.jsx("feFuncA",{type:"linear",slope:"0.24"})}),Q2.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),Q2.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),Q2.jsx("path",{d:G,filter:`url(#${F})`,className:"fill-accent"})]}),H.map((K,W)=>Q2.jsx("div",{className:s("absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs [corner-shape:superellipse(1.2)]","animate-in duration-300 ease-out fade-in",B[W].frame),children:Q2.jsx("img",{src:K,alt:"",loading:"lazy",className:s("block h-auto max-h-32 w-auto max-w-full object-contain",B[W].img)})},K)),H.length===0&&J&&Q2.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:Q2.jsx("div",{"aria-hidden":"true",style:U,className:s("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs","animate-in transition-transform duration-300 ease-out fade-in","-translate-x-1 translate-y-1 -rotate-2","group-focus-within:translate-y-0.5 group-hover:translate-y-0.5"),children:Q2.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:J})})}),Q2.jsx("div",{className:s("absolute inset-x-2 top-[40%] bottom-2 rounded-2xl bg-[color-mix(in_oklch,var(--accent),var(--foreground)_5%)]","mask-[linear-gradient(to_bottom,rgba(0,0,0,0.9)_0%,black_50%)] backdrop-blur-lg","inset-shadow-[0_0_12px_color-mix(in_oklab,var(--background)_20%,transparent)]")})]})}var o0=O(d(),1);function fw(){UG();let[,$]=u4(),Z=TX(),H=QO(),B=wX(),J=DT({onSuccess:(N)=>$(`/workspace/${N.id}`)}),Q=J9(),[X,z]=gw.useState(!1),G=j5((N)=>N.discoveredWorkspacesOpen),F=j5((N)=>N.setDiscoveredWorkspacesOpen);if(Z.isPending||H.isPending)return o0.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:o0.jsx(I5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||H.isError)return o0.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:o0.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let U=Z.data,Y=H.data,K=U.length;function W(N){if(Q.cloudDemo){z(!0);return}J.startImport(N)}return o0.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[o0.jsx(_T,{className:"mb-10"}),K>0?o0.jsxs("section",{className:"mb-12",children:[o0.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[o0.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),o0.jsx(sH,{trigger:o0.jsxs(T0,{variant:"outline",size:"sm",children:[o0.jsx(N4,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),o0.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:U.map((N)=>o0.jsx(Ye,{workspace:N},N.id))})]}):o0.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[o0.jsx(vw,{size:32,stroke:1.5,className:"text-muted-foreground"}),o0.jsxs("div",{className:"flex flex-col gap-1.5",children:[o0.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),o0.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Workspace is a place for all the chats, widgets, and views that share the same context. Create a new one or import an existing folder you’ve worked in before."})]}),o0.jsx(sH,{trigger:o0.jsx(T0,{children:"Create workspace"})})]}),Y.length>0&&o0.jsx("section",{children:o0.jsxs(QG,{open:G,onOpenChange:F,className:"group",children:[o0.jsxs(XG,{className:s("group/trigger","flex w-full items-center gap-1 pb-4 text-left outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","text-muted-foreground group-data-open:text-foreground hover:text-foreground"),children:[o0.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),o0.jsx(X7,{size:16,stroke:2,className:s("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),o0.jsx(zG,{children:o0.jsx("ul",{className:"border-t border-border",children:Y.map((N)=>o0.jsx(Ke,{suggestion:N,onAdd:W},N.path))})})]})}),J.choice&&o0.jsx(AT,{choice:J.choice,availability:B.data?.availability,isPending:J.isPending,errorMessage:J.error?.message,onTypeChange:J.selectType,onSubmit:J.submit,onReset:J.reset}),o0.jsx(P$,{open:X,onOpenChange:z})]})}function Ye({workspace:$}){let Z=i6($),H=CX($.id),B=H.data?.theme,J=j8(B).agent,Q=_2((G)=>PX(G.activity,$.id)),X=H.data?.updatedAt??new Date($.addedAt).getTime(),z=`/workspace/${$.id}`;return o0.jsxs("div",{className:"group flex min-w-0 flex-col gap-3",children:[o0.jsxs("div",{className:"relative",children:[o0.jsx(xw,{workspaceId:$.id}),o0.jsx(V6,{href:z,"aria-label":`Open ${Z}`,className:"absolute inset-0 rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),H.data&&o0.jsxs(y1,{children:[o0.jsx(h1,{render:o0.jsx(V6,{href:YG($.id,"agent"),"aria-label":`Chat in ${Z}`,style:T8(B),className:"absolute right-3 bottom-3 rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:o0.jsx(K9,{preset:J,color:"primary",animated:Q,expression:Q?"thinking":void 0,size:48,className:"drop-shadow-sm drop-shadow-primary/20"})})}),o0.jsx(x1,{children:"Chat"})]})]}),o0.jsxs(V6,{href:z,className:"flex min-w-0 flex-col gap-2 rounded-lg px-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[o0.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:T8(B),children:[o0.jsx("img",{src:$.icon??P8[$.type??"claude-code"],alt:"",className:"size-4 shrink-0 rounded-xs"}),o0.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),o0.jsx("span",{className:"text-xs text-muted-foreground",children:We(X)})]})]})}function Ke({suggestion:$,onAdd:Z}){let{path:H,types:B}=$,J=i6($);return o0.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[o0.jsx(qj,{types:B}),o0.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:J}),o0.jsx("span",{title:H,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??H}),o0.jsxs(T0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[o0.jsx(N4,{stroke:1.75}),"Add"]})]})}function We($){let Z=Date.now()-$,H=Math.floor(Z/60000);if(H<1)return"Updated just now";if(H<60)return`Updated ${H} min${H===1?"":"s"} ago`;let B=Math.floor(H/60);if(B<24)return`Updated ${B} hour${B===1?"":"s"} ago`;let J=Math.floor(B/24);if(J<30)return`Updated ${J} day${J===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var WG=O(d(),1);function mw(){return WG.jsx(Kz,{showWorkspaces:!1,children:WG.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:WG.jsx(fw,{})})})}var NG=O(g(),1);var gN=O(d(),1),cw=($)=>$.map((Z)=>[...Z].map((H)=>H==="#"?1:0)),Ne=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],Le=["###.#","#.#.#","#.#.#","#.#.#","###.#"],Ae=cw([".....","####.","#.#.#","#.#.#","#.#.#"]),Ve=cw(Ne.map(($,Z)=>`${$}.${Le[Z]}`)),De={moi:Ae,"moi-full":Ve};function dw($,Z,H){let B=[];for(let J=0;J<Z;J++){let Q=[];for(let X=0;X<$;X++)Q.push(H(X,J));B.push(Q)}return B}function pw($,Z,H){let B=Math.sin($*12.9898+Z*78.233+H*37.719)*43758.5453;return B-Math.floor(B)}function qe($,Z,H){return dw(Z,H,(B,J)=>{let Q=pw(B,J,0)*Math.PI*2,X=5+pw(B,J,1)*6,z=0.5+0.5*Math.sin($*X+Q);return z*z})}function Me($,Z,H){return dw(Z,H,(J,Q)=>0.5+0.5*Math.sin(J*0.5+Q*0.32-$*6.5))}var lw=0.55;function Pe($,Z){let H=$.length,B=$.reduce((G,F)=>Math.max(G,F.length),0),J=Math.min(Z/lw,1),Q=1-Math.pow(1-J,3),X=Math.round((1-Q)*H),z=[];for(let G=0;G<H;G++){let F=[];for(let U=0;U<B;U++)F.push($[G-X]?.[U]??0);z.push(F)}return z}function uw($,Z,H){let B=De[$];if(Z===void 0)return Pe(B,H);let J=B.length,Q=B[0]?.length??0;return Z==="wave"?Me(H,Q,J):qe(H,Q,J)}var _e=24;function Oe($,Z,H){let[B,J]=NG.useState(()=>uw($,Z,0));return NG.useEffect(()=>{let Q=0,X=null,z=0,G=1000/H,F=(U)=>{if(X===null)X=U;let Y=(U-X)/1000;if(U-z>=G){if(z=U,J(uw($,Z,Y)),Z===void 0&&Y>=lw)return}Q=requestAnimationFrame(F)};return Q=requestAnimationFrame(F),()=>cancelAnimationFrame(Q)},[$,Z,H]),B}function je($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function iw({sprite:$="moi",effect:Z,fps:H=_e,pixelSize:B=3,gap:J=1,className:Q}){let X=Oe($,Z,H),z=X[0]?.length??0,G=Z!==void 0;return gN.jsx("div",{className:s("grid",Q),style:{gridTemplateColumns:`repeat(${z}, ${B}px)`,gap:`${J}px`},children:X.flatMap((F,U)=>F.map((Y,K)=>gN.jsx("div",{className:"rounded-[2px]",style:{width:B,height:B,background:je(Y),boxShadow:G?`0 0 ${(B*(0.4+Y)).toFixed(1)}px rgba(23, 23, 23, ${(Y*0.35).toFixed(3)})`:void 0}},`${U}-${K}`)))})}var c$=O(g(),1);var AG=O(g(),1);var rw=()=>({emit($,...Z){for(let H=this.events[$]||[],B=0,J=H.length;B<J;B++)H[B](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((H)=>Z!==H)}}});var fN=2000;var Te=({kind:$,name:Z})=>`${$}:${Z}`,aw=1000,mN={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function Ce($){let Z=rw(),H=MX(mN),B=(Q,X)=>{q8($,{source:"runtime",kind:Q.kind,name:Q.name,message:X})},J=(Q,X,z)=>{let G=H.admit(`${X}\x00${z}`);if(G==="cooldown")return B(Q,`sendChatMessage("${z}") was dropped: the same message was already sent less than ${mN.cooldownMs/1000}s ago. Call it from an event handler, not during render.`),!1;if(G==="window")return B(Q,`sendChatMessage("${z}") was dropped: more than ${mN.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`),!1;return!0};return{on(Q,X){return Z.on(Q,X)},connect(Q){let X=!0,z=Te(Q);return{bridge:{focusTab(F,U){if(!X)return;if(!vN(F))return;Z.emit("focusTab",F,m$(U)?U:void 0)},sendChatMessage(F,U){if(!X)return;if(typeof F!=="string")return;let Y=F.trim();if(!Y)return;if(Y.length>aw){B(Q,`sendChatMessage() was dropped: the message is ${Y.length} characters (max ${aw}). Put long content in the context argument, not the message.`);return}if(!J(Q,z,Y))return;Z.emit("sendChatMessage",{message:Y,source:z,...U!==void 0?{context:we(Q,U,B)}:{}})}},dispose:()=>{X=!1}}}}}function we($,Z,H){if(!m$(Z)){H($,"sendChatMessage() ignored its context argument: it must be a plain object.");return}let B;try{B=JSON.stringify(Z)}catch{H($,"sendChatMessage() ignored its context argument: it is not JSON-serializable (cycles, functions, or BigInt).");return}if(B.length>fN){H($,`sendChatMessage() ignored its context argument: ${B.length} characters serialized (max ${fN}). Send an id the agent can look up instead of the whole payload.`);return}return Z}var nw=new Map;function ow($){let Z=nw.get($);if(!Z)Z=Ce($),nw.set($,Z);return Z}function VG($,Z,H){let B=AG.useRef(H);B.current=H,AG.useEffect(()=>{let J=(...Q)=>B.current(...Q);return ow($).on(Z,J)},[$,Z])}var LG=new Map;function sw($,Z,H,B){let J=$.__attachBridge;if(typeof J!=="function")return;LG.get(H)?.();let{bridge:Q,dispose:X}=ow(Z).connect(B);LG.set(H,X),J(Q)}function pN($){let Z=LG.get($);if(!Z)return;LG.delete($),Z()}function DG($,Z,H){return`${$}/${Z}/${H}`}var u$=new Map,RB=new Map;function Ee($,Z,H){return u$.get(DG($,Z,H))??0}var Se="module";function tw($,Z,H){return`/api/workspaces/${Z}/${$}/${H}/${Se}?v=${Ee($,Z,H)}`}function qG($,Z,H){return`/api/workspaces/${Z}/${$}/${H}`}function MG($,Z){return`${$==="widgets"?"widget":"view"}:${Z}`}function ew($){return RB.get($)}function $E($,Z){RB.set($,Z)}function PG($,Z,H){let B=DG($,Z,H);RB.delete(B),u$.set(B,(u$.get(B)??0)+1),pN(B)}function uN($){let Z=`${$}/`;for(let H of new Set([...RB.keys(),...u$.keys()]))if(H.startsWith(Z))RB.delete(H),u$.set(H,(u$.get(H)??0)+1),pN(H)}var Ie={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},Re={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function ke($,Z,H){let{segment:B}=$,J=DG(B,Z,H),Q=ew(J);if(Q)return Q;let X=import(tw(B,Z,H)).then((z)=>{if(!z.default)throw Error(`"${H}" has no default export`);return sw(z,Z,J,{kind:$.kind,name:H}),z.default});return $E(J,X),X}function ZE($,Z){let H=H5(),[B,J]=c$.useState({status:"loading",version:0}),Q=c$.useCallback(()=>{J((X)=>({status:"loading",version:X.version})),ke($,H,Z).then((X)=>J((z)=>({status:"ready",Component:X,version:z.version+1}))).catch((X)=>{q8(H,{source:"load",kind:$.kind,name:Z,message:String(X),...X instanceof Error&&X.stack?{stack:X.stack}:{}}),J((z)=>({status:"error",error:String(X),version:z.version+1}))})},[$,H,Z]);return c$.useEffect(()=>{Q()},[Q]),B2((X)=>{if($.shouldReload(X,Z))PG($.segment,H,Z),Q()}),B}function HE($){return ZE(Ie,$)}function BE($){return ZE(Re,$)}function JE(){let $=H5();B2((Z)=>{if(Z.type==="view:updated")PG("views",$,Z.name);else if(Z.type==="widget:updated")PG("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")uN("widgets");if(Z.only!=="widgets")uN("views")}})}var B8=O(g(),1);var XE=O(g(),1);var y4={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function zE($){return o1({queryKey:w0.layout($),queryFn:()=>V1(`/api/workspaces/${$}`),...y4})}function N9($){let Z=Z1();return XE.useEffect(()=>QE(()=>{Z.invalidateQueries({queryKey:w0.agent($)})}),[Z,$]),B2((H)=>{if(H.type==="agent:updated"&&H.workspaceId===$)Z.setQueryData(w0.agent($),(B)=>B?{...B,availability:H.availability,login:H.login}:B);if(H.type==="env:updated"&&H.workspaceId===$)Z.invalidateQueries({queryKey:w0.agent($)})}),o1({queryKey:w0.agent($),queryFn:()=>V1(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function GE($){return V1(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function FE($){return o1({queryKey:w0.skills($),queryFn:()=>V1(`/api/workspaces/${$}/skills`),...y4})}async function be($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),H=await Z.text(),B=null;try{B=JSON.parse(H)}catch{}if(!Z.ok){let J=B&&"error"in B?B.error:H,Q=Error(J||"Failed to update workspace skill");if(B?.skills)Q.status={skills:B.skills,updateAvailable:B.updateAvailable};throw Q}if(!B)throw Error("Invalid workspace skill update response");return B}function UE($){let Z=Z1();return s1({mutationFn:()=>be($),onSuccess:(H)=>{Z.setQueryData(w0.skills($),H)},onError:(H)=>{if(H.status)Z.setQueryData(w0.skills($),H.status)}})}function YE($){return o1({queryKey:w0.widgets($),queryFn:async()=>{return(await V1(`/api/workspaces/${$}/widgets`)).widgets},...y4})}function _G($){return o1({queryKey:w0.views($),queryFn:async()=>{return(await V1(`/api/workspaces/${$}/views`)).views},...y4})}function KE($){let Z=Z1();return s1({mutationFn:(H)=>S4(`/api/workspaces/${$}`,n5("PUT",H),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.preview($)})}})}function cN(){return{open:["agent","widgets","scratchpad"],active:"agent"}}function WE(){return{version:1,widgetGrid:[],layoutMode:"split",tabs:cN()}}var VE=O(d(),1),dN=B8.createContext(null);function K5(){let $=B8.useContext(dN);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function LE(){return B8.useContext(dN)?.layout.theme}function NE($){let{cwd:Z,name:H,provider:B,agentId:J,...Q}=$;return Q}function AE({id:$,children:Z}){let H=Z1(),B=zE($),J=KE($),Q=B8.useRef(J.mutate);Q.current=J.mutate;let X=B8.useRef(null),z=B8.useCallback((F)=>{let U=w0.layout($),Y=H.getQueryData(U);if(!Y)return;let K={...Y,...F};if(H.setQueryData(U,K),X.current)clearTimeout(X.current);X.current=setTimeout(()=>{X.current=null,Q.current(NE(K))},600)},[$,H]),G=B8.useMemo(()=>({layout:B.data?NE(B.data):WE(),setLayout:z,name:B.data?.name??null,icon:B.data?.icon??null,cwd:B.data?.cwd??null,provider:B.data?.provider??null,workspaceId:$,isLoading:B.isLoading}),[B.data,B.isLoading,z,$]);return VE.jsx(dN,{value:G,children:Z})}var F4=O(g(),1);var jG=O(d(),1);function OG({visible:$,editing:Z,canvasRef:H,width:B,height:J,pointerProps:Q,onKeyDown:X,children:z}){if(!$)return null;return jG.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:X,children:[jG.jsx("canvas",{ref:H,...Q,width:B,height:J,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),Z&&z]})}var i0=O(g(),1);function iN($,Z,H){let B=Math.max($,Z);if(B<=0)return 1;return Math.min(Math.max(H,1),1568/B)}function ye($){return new Promise((Z,H)=>{setTimeout(()=>H(Error("Annotation capture timed out")),$)})}function he($){if(!($ instanceof HTMLElement))return;let{overflowX:Z,overflowY:H}=$.style;if(H==="auto"||H==="scroll")$.style.overflowY="hidden";if(Z==="auto"||Z==="scroll")$.style.overflowX="hidden"}async function DE($){let Z=$.getBoundingClientRect();if(Z.width<=0||Z.height<=0)throw Error("Annotation target is not visible");let{createContext:H,destroyContext:B,domToCanvas:J}=await import("/chunk-c9pjqx9m.js"),Q=async()=>{let X=await H($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:iN(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"},onCloneEachNode:he});try{return await J(X)}finally{B(X)}};return Promise.race([Q(),ye(1e4)])}var rN={past:[],present:[],future:[]};function xe($,Z){if(Z.type==="commit")return{past:[...$.past,$.present],present:[...$.present,Z.stroke],future:[]};if(Z.type==="undo"){let H=$.past.at(-1);if(!H)return $;return{past:$.past.slice(0,-1),present:H,future:[$.present,...$.future]}}if(Z.type==="redo"){let H=$.future[0];if(!H)return $;return{past:[...$.past,$.present],present:H,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function PE($,Z,H){let B=$.getBoundingClientRect();return{x:(Z-B.left)/B.width*$.width,y:(H-B.top)/B.height*$.height}}function qE($,Z){let H=Z.getCoalescedEvents?.()??[];return(H.length>0?H:[Z]).map((J)=>PE($,J.clientX,J.clientY))}var ve={canUndo:!1,canRedo:!1,hasStrokes:!1};function kB($){return i0.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function ME($,Z,H,B){let J=Z.points[0];if(!J)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=B,$.strokeStyle=H,$.moveTo(J.x,J.y);for(let Q=1;Q<Z.points.length;Q++){let X=Z.points[Q];$.lineTo(X.x,X.y)}if(Z.points.length===1)$.lineTo(J.x+0.01,J.y+0.01);$.stroke()}function _E($,Z,H,B,J,Q=null){let X=Math.max(3,Math.min(Z,H)*0.005),z=X+Math.max(2,X*0.75),G=Q?[...J,Q]:J;for(let F of G)ME($,F,B.haloColor,z);for(let F of G)ME($,F,B.strokeColor,X)}function ge($,Z,H,B=null){let J=$.getContext("2d");if(!J)return;J.clearRect(0,0,$.width,$.height),_E(J,$.width,$.height,Z,H,B)}function fe($,Z,H){let B=$.getContext("2d");if(!B)return;B.clearRect(0,0,$.width,$.height),B.drawImage(Z.snapshot,0,0,$.width,$.height),_E(B,$.width,$.height,Z,H)}function me($){return new Promise((Z,H)=>{$.toBlob((B)=>{if(B)Z(B);else H(Error("Could not export drawing"))},"image/png")})}function pe($,Z,H){let B=$.getBoundingClientRect();if(B.width<=0||B.height<=0)return null;let J=getComputedStyle($),Q=iN(B.width,B.height,window.devicePixelRatio),X=Math.max(1,Math.round(B.width*Q)),z=Math.max(1,Math.round(B.height*Q)),G=document.createElement("canvas");G.width=X,G.height=z;let F=J.getPropertyValue("--background").trim()||"#ffffff",U=G.getContext("2d");if(U)U.fillStyle=F,U.fillRect(0,0,X,z);return Z.width=X,Z.height=z,{id:H,snapshot:G,strokeColor:J.getPropertyValue("--primary").trim()||"#2563eb",haloColor:F,targetWidth:B.width,targetHeight:B.height}}function ue($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function TG({mode:$="annotation",onChange:Z,onEditingStart:H,onFinish:B}={}){let J=i0.useRef(null),Q=i0.useRef(null),[X,z]=i0.useState(null),G=i0.useRef(X),[F,U]=i0.useState(!1),Y=i0.useRef(!1),K=i0.useRef(rN),W=i0.useRef(ve),N=i0.useRef(new Set),L=i0.useRef(0),V=i0.useRef(null),A=i0.useRef(null),D=i0.useRef(0),q=i0.useRef(0),_=i0.useRef(null),M=i0.useRef(null),[P,C]=i0.useState(!1),R=i0.useRef(!1),[y,w]=i0.useState(!1),h=i0.useRef(!1),E=i0.useRef(Z),I=i0.useRef(H),j=i0.useRef(B);E.current=Z,I.current=H,j.current=B;let S=i0.useCallback(()=>{let f=K.current,l=W.current,m={canUndo:f.past.length>0,canRedo:f.future.length>0,hasStrokes:f.present.length>0};if(m.canUndo===l.canUndo&&m.canRedo===l.canRedo&&m.hasStrokes===l.hasStrokes)return;W.current=m;for(let a of N.current)a()},[]),k=i0.useCallback((f)=>{return N.current.add(f),()=>{N.current.delete(f)}},[]),b=i0.useCallback(()=>W.current,[]),v=i0.useCallback((f,l=null)=>{if(D.current)cancelAnimationFrame(D.current),D.current=0;let m=Q.current,a=G.current;if(m&&a)ge(m,a,f,l)},[]),c=i0.useCallback(()=>{if(D.current)return;D.current=requestAnimationFrame(()=>{D.current=0,v(K.current.present,V.current)})},[v]),T=i0.useCallback((f,l,m)=>{let a=_.current;if(a?.sessionId===f.id&&a.historyVersion===m)return Promise.resolve(a.blob);let o=M.current;if(o?.sessionId===f.id&&o.historyVersion===m)return o.promise;if(l.length===0)return _.current={sessionId:f.id,historyVersion:m,blob:null},E.current?.(null),Promise.resolve(null);let V0=document.createElement("canvas");V0.width=f.snapshot.width,V0.height=f.snapshot.height,fe(V0,f,l);let O0=me(V0).then((k0)=>{if(G.current?.id!==f.id||L.current!==m)return k0;return _.current={sessionId:f.id,historyVersion:m,blob:k0},E.current?.(k0),k0}).catch(()=>{if(G.current?.id===f.id&&L.current===m)a4.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(M.current?.promise===O0)M.current=null});return M.current={sessionId:f.id,historyVersion:m,promise:O0},O0},[]),e=i0.useCallback(()=>{if(!V.current)return;let f=Q.current,l=A.current;if(f&&l!==null&&f.hasPointerCapture(l))f.releasePointerCapture(l);V.current=null,A.current=null,v(K.current.present)},[v]),Z0=i0.useCallback((f)=>{let l=G.current;if(!l||h.current)return;let m=xe(K.current,f);if(m===K.current)return;K.current=m,S(),V.current=null;let a=++L.current;v(m.present),T(l,m.present,a)},[T,S,v]),x=i0.useCallback((f)=>{K.current=rN,L.current=0,_.current=null,M.current=null,V.current=null,A.current=null,S(),G.current=f,z(f)},[S]),t=i0.useCallback(()=>{if(Y.current)return;Y.current=!0,U(!0),I.current?.()},[]),D0=i0.useCallback(async()=>{let f=J.current;if(!f||G.current||R.current)return!1;let l=++q.current;R.current=!0,C(!0);try{let m=await DE(f);if(l!==q.current||J.current!==f)return!1;let a=f.getBoundingClientRect(),o=getComputedStyle(f),V0={id:l,snapshot:m,strokeColor:o.getPropertyValue("--primary").trim()||"#2563eb",haloColor:o.getPropertyValue("--background").trim()||"#ffffff",targetWidth:a.width,targetHeight:a.height};return x(V0),t(),!0}finally{if(l===q.current)R.current=!1,C(!1)}},[t,x]),p=i0.useCallback(()=>{let f=G.current;q.current+=1,R.current=!1,h.current=!1,C(!1),w(!1),Y.current=!1,U(!1),e(),z(null),K.current=rN,S();let l=M.current;if(!f||l?.sessionId!==f.id)return G.current=null,Promise.resolve();return l.promise.then(()=>{if(G.current?.id===f.id)G.current=null})},[e,S]),X0=i0.useCallback(async()=>{let f=G.current;if(!f)return null;return e(),T(f,K.current.present,L.current)},[e,T]),K0=i0.useCallback(async()=>{return Y.current=!1,U(!1),X0()},[X0]),Q0=i0.useCallback(async()=>{let f=G.current;if(!f||h.current)return null;h.current=!0,w(!0),e();let l=L.current,m=K.current.present,a=null;if(m.length>0||l>0)a=await T(f,m,l);if(G.current?.id!==f.id)return a;try{await j.current?.(a)}finally{if(G.current?.id===f.id)q.current+=1,Y.current=!1,U(!1),G.current=null,z(null),h.current=!1,w(!1)}return a},[e,T]),z0=i0.useCallback(()=>Z0({type:"undo"}),[Z0]),L0=i0.useCallback(()=>Z0({type:"redo"}),[Z0]),i=i0.useCallback(()=>Z0({type:"clear"}),[Z0]),B0=i0.useMemo(()=>({onPointerDown:(f)=>{if(h.current||!f.isPrimary||f.pointerType==="mouse"&&f.button!==0)return;if(!G.current&&$==="sketch"){let l=J.current;if(!l)return;let m=pe(l,f.currentTarget,++q.current);if(!m)return;x(m)}if(!G.current)return;t(),A.current=f.pointerId,f.currentTarget.setPointerCapture(f.pointerId),V.current={points:[PE(f.currentTarget,f.clientX,f.clientY)]},v(K.current.present,V.current)},onPointerMove:(f)=>{if(f.pointerId!==A.current||!V.current)return;V.current.points.push(...qE(f.currentTarget,f.nativeEvent)),c()},onPointerUp:(f)=>{if(f.pointerId!==A.current||!V.current)return;let l=V.current;if(l.points.push(...qE(f.currentTarget,f.nativeEvent)),V.current=null,A.current=null,f.currentTarget.hasPointerCapture(f.pointerId))f.currentTarget.releasePointerCapture(f.pointerId);Z0({type:"commit",stroke:l})},onPointerCancel:(f)=>{if(f.pointerId===A.current)e()}}),[Z0,t,e,x,$,v,c]),$0=i0.useCallback((f)=>{if(ue(f.target))return;if(f.key==="Escape"&&$==="annotation"){f.preventDefault(),Q0();return}if(!(f.metaKey||f.ctrlKey)||f.key.toLowerCase()!=="z")return;if(f.preventDefault(),f.shiftKey)L0();else z0()},[Q0,$,L0,z0]);i0.useLayoutEffect(()=>{if(!X)return;if(v(K.current.present,V.current),F)Q.current?.focus()},[F,v,X]),i0.useEffect(()=>{if(!X||$==="sketch")return;let f=J.current;if(!f){p();return}let l=new ResizeObserver((m)=>{let a=m[0]?.contentRect;if(!a)return;if(Math.abs(a.width-X.targetWidth)>1||Math.abs(a.height-X.targetHeight)>1)p()});return l.observe(f),()=>l.disconnect()},[p,$,X]),i0.useEffect(()=>()=>{if(q.current+=1,Y.current=!1,G.current=null,D.current)cancelAnimationFrame(D.current)},[]);let J0=i0.useMemo(()=>({active:F,visible:$==="sketch"||X!==null,starting:P,finishing:y,open:D0,undo:z0,redo:L0,clear:i,flush:X0,deactivate:K0,finish:Q0,cancel:p,subscribeHistory:k,getHistoryState:b}),[F,$,X,P,y,D0,z0,L0,i,X0,K0,Q0,p,k,b]),n=i0.useMemo(()=>({visible:J0.visible,editing:J0.active,canvasRef:Q,width:X?.snapshot.width??1,height:X?.snapshot.height??1,pointerProps:B0,onKeyDown:$0}),[J0.active,J0.visible,X,B0,$0]);return i0.useMemo(()=>({targetRef:J,controls:J0,layerProps:n}),[J0,n])}var c5=O(d(),1);function CG({controls:$,title:Z,busy:H,onComplete:B}){let{canUndo:J,canRedo:Q,hasStrokes:X}=kB($);return c5.jsxs("div",{className:"absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-lg bg-popover p-1.5 shadow-md",children:[c5.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),c5.jsxs("div",{className:"flex gap-1",children:[c5.jsxs(y1,{children:[c5.jsx(h1,{render:c5.jsx(T0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:H||!J,"aria-label":"Undo",children:c5.jsx(OE,{stroke:1.75})})}),c5.jsx(x1,{children:"Undo"})]}),c5.jsxs(y1,{children:[c5.jsx(h1,{render:c5.jsx(T0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:H||!Q,"aria-label":"Redo",children:c5.jsx(jE,{stroke:1.75})})}),c5.jsx(x1,{children:"Redo"})]}),c5.jsx(T0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:H||!X,children:"Clear"})]}),c5.jsx($4,{mode:"popLayout",initial:!1,children:c5.jsx(B5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.1,bounce:0},children:c5.jsx(T0,{type:"button",variant:X?"default":"ghost",size:"icon-sm",onClick:B,disabled:H,"aria-label":"Complete",className:s(!X&&"text-muted-foreground"),children:X?c5.jsx(A3,{stroke:1.75}):c5.jsx(S5,{stroke:1.75})})},X?"complete":"cancel")})]})}var x5=O(g(),1);async function aN($,Z){let H=new FormData;for(let J of Z)H.append("files",J);let B=await fetch(`/api/workspaces/${$}/uploads`,{method:"POST",body:H});if(!B.ok){let J=await B.text().catch(()=>"");throw Error(J||`Upload failed (${B.status})`)}return B.json()}function TE({workspaceId:$,sessionId:Z},H){if(H.length===0)return;let B=H.map((J)=>({kind:"file",localId:crypto.randomUUID(),name:J.name||"file",mediaType:J.type||"application/octet-stream",previewUrl:J.type.startsWith("image/")?URL.createObjectURL(J):void 0,status:"uploading"}));E1.getState().addAttachments($,Z,B),B.forEach((J,Q)=>{aN($,[H[Q]]).then(([X])=>{E1.getState().updateAttachment($,Z,J.localId,{status:"ready",upload:X,mediaType:X.mediaType})}).catch((X)=>{E1.getState().updateAttachment($,Z,J.localId,{status:"error",error:X instanceof Error?X.message:"Upload failed"})})})}function wG({workspaceId:$,sessionId:Z,localId:H,purpose:B,sourceTab:J,blob:Q}){let X=B==="sketch"?"Sketch":"Annotation",z=URL.createObjectURL(Q),G=E1.getState();if(G.attachments[e2($,Z)]?.some((U)=>U.localId===H))G.updateAttachment($,Z,H,{previewUrl:z,status:"draft",upload:void 0,error:void 0});else G.addAttachments($,Z,[{kind:"drawing",purpose:B,localId:H,sourceTab:J,name:`${X}.png`,mediaType:"image/png",previewUrl:z,status:"draft"}])}async function EG({workspaceId:$,sessionId:Z,localId:H,purpose:B,sourceTab:J,blob:Q,isCurrent:X}){let z=B==="sketch"?"Sketch":"Annotation",G=URL.createObjectURL(Q),F=E1.getState();if(F.attachments[e2($,Z)]?.some((Y)=>Y.localId===H))F.updateAttachment($,Z,H,{previewUrl:G,status:"uploading",upload:void 0,error:void 0});else F.addAttachments($,Z,[{kind:"drawing",purpose:B,localId:H,sourceTab:J,name:`${z}.png`,mediaType:"image/png",previewUrl:G,status:"uploading"}]);try{let[Y]=await aN($,[new File([Q],`${z}.png`,{type:"image/png"})]);if(!X())return;E1.getState().updateAttachment($,Z,H,{status:"ready",upload:Y,mediaType:Y.mediaType,error:void 0})}catch{if(!X())return;E1.getState().removeAttachment($,Z,H)}}function CE({workspaceId:$,sessionId:Z,activeTab:H,mode:B,available:J,closePopup:Q,openPopup:X}){let z=x5.useRef(null),G=x5.useRef(null),F=x5.useRef(new Map),U=x5.useRef(Q),Y=x5.useRef(X);U.current=Q,Y.current=X;let K=x5.useCallback((j)=>{let S=z.current;if(!S)return;if(G.current=j,!j){E1.getState().removeAttachment(S.workspaceId,S.sourceSessionId,S.attachmentId);return}wG({workspaceId:S.workspaceId,sessionId:S.sourceSessionId,localId:S.attachmentId,purpose:"annotation",sourceTab:S.sourceTab,blob:j})},[]),W=x5.useCallback((j,S)=>{let k=(F.current.get(j.attachmentId)??0)+1;return F.current.set(j.attachmentId,k),EG({workspaceId:j.workspaceId,sessionId:j.sourceSessionId,localId:j.attachmentId,purpose:"annotation",sourceTab:j.sourceTab,blob:S,isCurrent:()=>F.current.get(j.attachmentId)===k})},[]),N=x5.useCallback(async(j)=>{let S=z.current;if(z.current=null,G.current=null,S&&j)await W(S,j);if(S?.origin==="popup")Y.current()},[W]),L=TG({onChange:K,onFinish:N}),{controls:V}=L,{active:A,starting:D,open:q,finish:_,cancel:M}=V,P=x5.useCallback(async(j)=>{if(!J||A||D)return;let S={workspaceId:$,sourceSessionId:Z,sourceTab:H,origin:j,attachmentId:crypto.randomUUID()};z.current=S;try{if(!await q()){if(z.current===S)z.current=null;return}if(j==="popup")U.current()}catch{if(z.current!==S)return;z.current=null,a4.add({title:"Couldn’t capture this page",type:"error"})}},[A,H,J,q,Z,D,$]),C=x5.useCallback(async()=>{let j=z.current;if(await M(),z.current!==j)return;z.current=null;let S=G.current;if(G.current=null,j&&S)W(j,S)},[M,W]),R=x5.useCallback((j)=>{let S=(F.current.get(j)??0)+1;if(F.current.set(j,S),E1.getState().removeAttachment($,Z,j),z.current?.attachmentId===j)z.current=null,G.current=null,M()},[M,Z,$]),y=x5.useCallback(async()=>{if(D){await C();return}await _()},[C,_,D]),w=x5.useCallback(()=>{if(A||D)y();else P("docked")},[A,y,P,D]),h=x5.useCallback(()=>{if(A||D)y();else P("popup")},[A,y,P,D]);x5.useEffect(()=>{let j=z.current;if(!j)return;let S=j.origin==="docked"?"split":"fullscreen";if(j.workspaceId!==$||j.sourceSessionId!==Z||j.sourceTab!==H||B!==S||!J)C()},[H,J,C,B,Z,$]);let E=x5.useMemo(()=>J?{active:A||D,finish:y,onRemove:R,onToggle:w}:void 0,[J,A,D,y,R,w]),I=x5.useMemo(()=>J?{active:A||D,finish:y,onRemove:R,onToggle:h}:void 0,[J,A,D,y,R,h]);return x5.useMemo(()=>({...L,docked:E,popup:I}),[L,E,I])}var x4=O(g(),1);var J8=O(d(),1);function nN($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function EE({composerRef:$,className:Z,onMouseDown:H,children:B,...J}){return J8.jsx("form",{...J,onMouseDown:(Q)=>{if(H?.(Q),Q.defaultPrevented)return;if(Q.target instanceof Element&&Q.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;nN($.current)},className:s("group/composer flex w-full cursor-text flex-col gap-1 rounded-xl bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",Z),children:B})}function SE({textareaRef:$,className:Z,...H}){return J8.jsx("textarea",{...H,ref:$,className:s("field-sizing-content max-h-40 w-full resize-none bg-transparent px-2 py-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground disabled:opacity-50",Z)})}function IE({className:$,children:Z,...H}){return J8.jsx("div",{...H,className:s("flex items-center justify-end gap-3",$),children:Z})}function ce($){if($.status==="checking")return"Checking agent status…";return}function bB($,Z,H){return $&&!Z&&H.status==="available"}function RE({label:$,hasContent:Z,busy:H=!1,loading:B=!1,availability:J}){let Q=bB(Z,H||B,J),X=ce(J),z=J8.jsx(T0,{type:"submit",size:"icon",disabled:!Q,"aria-label":$,children:B?J8.jsx(I4,{}):J8.jsx(wE,{stroke:1.5})});if(B||!X)return z;return J8.jsxs(y1,{children:[J8.jsx(h1,{render:J8.jsx("span",{className:"inline-flex",children:z})}),J8.jsx(x1,{className:"max-w-64 text-center",children:X})]})}var h4=O(g(),1),de=48;function kE($,Z){let H=h4.useRef(!0),[B,J]=h4.useState(!0),Q=h4.useCallback((G)=>{H.current=G,J((F)=>F===G?F:G)},[]),X=h4.useCallback((G="auto")=>{let F=$.current;if(!F)return;Q(!0),F.scrollTo({top:F.scrollHeight,behavior:G})},[$,Q]),z=h4.useCallback(()=>{let G=$.current;if(!G)return;Q(!1),G.scrollTo({top:0,behavior:"auto"})},[$,Q]);return h4.useEffect(()=>{let G=$.current;if(!G)return;let F=()=>{let U=G.scrollHeight-G.scrollTop-G.clientHeight;Q(U<=de)};return G.addEventListener("scroll",F,{passive:!0}),()=>G.removeEventListener("scroll",F)},[$,Q]),h4.useEffect(()=>{let G=$.current;if(!G)return;let F=G.firstElementChild??G,U=new ResizeObserver(()=>{if(H.current)G.scrollTop=G.scrollHeight});return U.observe(F),()=>U.disconnect()},[$]),h4.useLayoutEffect(()=>{X("auto")},[Z,X]),{atBottom:B,scrollToBottom:X,scrollToTop:z}}function le($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function ie($,Z){let H=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:H}}function bE($){let Z=[];for(let H of $){if(!le(H))continue;if(H.role!=="assistant"){Z.push(H);continue}let B=Z.length>0?Z[Z.length-1]:null;if(B?.role==="assistant")Z[Z.length-1]=ie(B,H);else Z.push(H)}return Z.map((H,B)=>{let J=Z[B-1];if(H.role!=="assistant"||J?.role!=="user"||J.origin.kind!=="user-input"||!J.timestamp||!H.timestamp)return H;let Q=Date.parse(J.timestamp),X=Date.parse(H.timestamp);if(!Number.isFinite(Q)||!Number.isFinite(X)||X<Q)return H;return{...H,meta:{...H.meta,durationMs:X-Q}}})}function oN($){switch($.kind){case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"rate-limit":case"api-retry":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function yE($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function hE($,Z){let H=Z.filter((G)=>oN(G)!==null);if(H.length===0)return $.map((G)=>({kind:"turn",turn:G}));let B=[],J=[];for(let G of H){let F=yE(G.at);if(F===void 0)J.push(G);else B.push({notice:G,time:F})}B.sort((G,F)=>G.time-F.time);let Q=[],X=0,z=Number.NEGATIVE_INFINITY;for(let G of $){z=Math.max(z,yE(G.timestamp)??z);while(X<B.length&&B[X].time<=z)Q.push({kind:"notice",notice:B[X].notice}),X+=1;Q.push({kind:"turn",turn:G})}for(;X<B.length;X+=1)Q.push({kind:"notice",notice:B[X].notice});for(let G of J)Q.push({kind:"notice",notice:G});return Q}var UZ=O(g(),1);var h3={};j4(h3,{createHandle:()=>HS,Viewport:()=>ZS,Trigger:()=>dE,Root:()=>mE,Positioner:()=>iE,Portal:()=>cE,Popup:()=>aE,Handle:()=>yG,Backdrop:()=>tE,Arrow:()=>oE});var y3=O(g(),1);var SG=O(g(),1),sN=SG.createContext(void 0);function V4($){let Z=SG.useContext(sN);if(Z===void 0&&!$)throw Error(E0(50));return Z}var vE=O(g(),1),gE=O(Y4(),1);var xE=600,IG=300;var re={...o8,instantType:S0(($)=>$.instantType),hasViewport:S0(($)=>$.hasViewport)};class d$ extends n2{constructor($){super({...ae(),...$},{popupRef:vE.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new s2,closeDelayRef:{current:IG}},re)}setOpen=($,Z)=>{let H=Z.reason,B=H===G0.triggerHover,J=$&&H===G0.triggerFocus,Q=!$&&(H===G0.triggerPress||H===G0.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let X=()=>{let z={open:$};if(J)z.instantType="focus";else if(Q)z.instantType="dismiss";else if(H===G0.triggerHover)z.instantType=void 0;let G=Z.trigger?.id??null;if(G||$)z.activeTriggerId=G,z.activeTriggerElement=Z.trigger??null;this.update(z)};if(B)gE.flushSync(X);else X()};static useStore($,Z){let H=k1(()=>{return new d$(Z)}).current,B=$??H,J=A8({popupStore:B,onOpenChange:B.setOpen});return B.state.floatingRootContext=J,B}}function ae(){return{...n8(),instantType:void 0,hasViewport:!1}}var fE=O(d(),1);function mE($){let{open:Z,defaultOpen:H=!1,onOpenChange:B,onOpenChangeComplete:J,actionsRef:Q,handle:X,triggerId:z,defaultTriggerId:G=null,children:F}=$,U=d$.useStore(X?.store,{open:H,openProp:Z,activeTriggerId:G,triggerIdProp:z});Z9(()=>{if(Z===void 0&&U.state.open===!1&&H===!0)U.update({open:!0,activeTriggerId:G})}),U.useControlledProp("openProp",Z),U.useControlledProp("triggerIdProp",z),U.useContextCallback("onOpenChange",B),U.useContextCallback("onOpenChangeComplete",J);let Y=U.useState("open"),K=U.useState("activeTriggerId"),W=U.useState("payload");r8(U);let{forceUnmount:N}=a8(Y,U);U0(()=>{if(Y){if(K==null)U.set("payload",void 0)}},[U,K,Y]);let L=y3.useCallback(()=>{U.setOpen(!1,ne(U,G0.imperativeAction))},[U]);y3.useImperativeHandle(Q,()=>({unmount:N,close:L}),[N,L]);let V=U.useState("floatingRootContext"),A=L8(V),{getReferenceProps:D,getTriggerProps:q,getFloatingProps:_}=Z2([A]),M=y3.useMemo(()=>D(),[D]),P=y3.useMemo(()=>q(),[q]),C=y3.useMemo(()=>_(),[_]);return U.useSyncedValues({activeTriggerProps:M,inactiveTriggerProps:P,popupProps:C}),fE.jsx(sN.Provider,{value:U,children:typeof F==="function"?F({payload:W}):F})}function ne($,Z){let H=M0(Z);return H.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},H}var uE=O(g(),1);var RG=O(g(),1),tN=RG.createContext(void 0);function pE(){let $=RG.useContext(tN);if($===void 0)throw Error(E0(48));return $}var eN=O(d(),1),cE=uE.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z;if(!(V4().useState("mounted")||B))return null;return eN.jsx(tN.Provider,{value:B,children:eN.jsx(Z$,{ref:H,...J})})});var kG=O(g(),1);var dE=kG.forwardRef(function(Z,H){let{render:B,className:J,delay:Q,closeDelay:X,id:z,payload:G,handle:F,...U}=Z,Y=V4(!0),K=F?.store??Y;if(!K)throw Error(E0(89));let W=H1(z),N=K.useState("isTriggerActive",W),L=K.useState("isOpenedByTrigger",W),V=K.useState("floatingRootContext"),A=kG.useRef(null),D=Q??xE,q=X??IG,{registerTrigger:_,isMountedByThisTrigger:M}=i8(W,A,K,{payload:G});U0(()=>{if(M)K.context.closeDelayRef.current=q},[K,M,q]);let P=V8(V,{mouseOnly:!0,move:!1,handleClose:D8(),delay:()=>({open:D,close:q}),triggerElementRef:A,isActiveTrigger:N}),C=k6(V,{delay:D}),R={open:L},y=K.useState("triggerProps",M);return F0("a",Z,{state:R,ref:[H,_,A],props:[P,C.reference,y,{id:W},U],stateAttributesMapping:e8})});var yB=O(g(),1);var bG=O(g(),1),$L=bG.createContext(void 0);function l$(){let $=bG.useContext($L);if($===void 0)throw Error(E0(49));return $}var lE=O(d(),1),iE=yB.forwardRef(function(Z,H){let{render:B,className:J,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:F=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:N=!1,disableAnchorTracking:L=!1,collisionAvoidance:V=$9,...A}=Z,D=V4(),q=pE(),_=D.useState("open"),M=D.useState("mounted"),P=D.useState("floatingRootContext"),C=D.useState("instantType"),R=D.useState("transitionStatus"),y=D.useState("hasViewport"),w=t8({anchor:Q,floatingRootContext:P,positionMethod:X,mounted:M,side:z,sideOffset:F,align:G,alignOffset:U,arrowPadding:W,collisionBoundary:Y,collisionPadding:K,sticky:N,disableAnchorTracking:L,keepMounted:q,collisionAvoidance:V,adaptiveOrigin:y?H$:void 0}),h=yB.useMemo(()=>{let S={};if(!_)S.pointerEvents="none";return{role:"presentation",hidden:!M,style:{...w.positionerStyles,...S}}},[_,M,w.positionerStyles]),E={open:_,side:w.side,align:w.align,anchorHidden:w.anchorHidden,instant:C},I=yB.useMemo(()=>({side:w.side,align:w.align,arrowRef:w.arrowRef,arrowUncentered:w.arrowUncentered,arrowStyles:w.arrowStyles}),[w.side,w.align,w.arrowRef,w.arrowUncentered,w.arrowStyles]),j=F0("div",Z,{state:E,props:[h,K2(R),A],ref:[H,D.useStateSetter("positionerElement")],stateAttributesMapping:P1});return lE.jsx($L.Provider,{value:I,children:j})});var rE=O(g(),1);var oe={...P1,...n1},aE=rE.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,X=V4(),{side:z,align:G}=l$(),F=X.useState("open"),U=X.useState("instantType"),Y=X.useState("transitionStatus"),K=X.useState("popupProps"),W=X.useState("floatingRootContext");y5({open:F,ref:X.context.popupRef,onComplete(){if(F)X.context.onOpenChangeComplete?.(!0)}});let N=Y0(()=>X.context.closeDelayRef.current);return h9(W,{closeDelay:N}),F0("div",Z,{state:{open:F,side:z,align:G,instant:U,transitionStatus:Y},ref:[H,X.context.popupRef,X.useStateSetter("popupElement")],props:[K,K2(Y),Q],stateAttributesMapping:oe})});var nE=O(g(),1);var oE=nE.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,X=V4(),{arrowRef:z,side:G,align:F,arrowUncentered:U,arrowStyles:Y}=l$(),W={open:X.useState("open"),side:G,align:F,uncentered:U};return F0("div",Z,{state:W,ref:[z,H],props:[{style:Y,"aria-hidden":!0},Q],stateAttributesMapping:P1})});var sE=O(g(),1);var se={...P1,...n1},tE=sE.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,X=V4(),z=X.useState("open"),G=X.useState("mounted"),F=X.useState("transitionStatus");return F0("div",Z,{state:{open:z,transitionStatus:F},ref:[H],props:[{role:"presentation",hidden:!G,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},Q],stateAttributesMapping:se})});var $S=O(g(),1);var eE=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var te={activationDirection:($)=>$?{"data-activation-direction":$}:null},ZS=$S.forwardRef(function(Z,H){let{render:B,className:J,children:Q,...X}=Z,z=V4(),G=l$(),F=z.useState("instantType"),{children:U,state:Y}=z$({store:z,side:G.side,cssVars:eE,children:Q}),K={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:F};return F0("div",Z,{state:K,ref:H,props:[X,{children:U}],stateAttributesMapping:te})});class yG{constructor(){this.store=new d$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(E0(88,$));this.store.setOpen(!0,M0(G0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,M0(G0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function HS(){return new yG}var i$=O(d(),1);function BS({...$}){return i$.jsx(h3.Root,{"data-slot":"hover-card",...$})}function JS({...$}){return i$.jsx(h3.Trigger,{"data-slot":"hover-card-trigger",...$})}function QS({className:$,side:Z="bottom",sideOffset:H=4,align:B="center",alignOffset:J=0,...Q}){return i$.jsx(h3.Portal,{"data-slot":"hover-card-portal",children:i$.jsx(h3.Positioner,{align:B,alignOffset:J,side:Z,sideOffset:H,className:"isolate z-50",children:i$.jsx(h3.Popup,{"data-slot":"hover-card-content",className:s("z-50 w-64 origin-(--transform-origin) rounded-xl bg-popover p-2.5 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...Q})})})}var FZ=O(g(),1);function hG($){return o1({queryKey:w0.sessions($),queryFn:()=>V1(`/api/workspaces/${$}/sessions`),...y4})}function ee($,Z){return $?.filter((H)=>H.sessionId!==Z)}function XS($){let Z=Z1();return s1({mutationFn:(H)=>S4(`/api/workspaces/${$}/sessions/${H}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(H,B)=>{Z.setQueryData(w0.sessions($),(J)=>ee(J,B)),Z.removeQueries({queryKey:w0.events($,B)}),Z.removeQueries({queryKey:w0.sessionConfig($,B)}),Z.invalidateQueries({queryKey:w0.preview($)})}})}function zS($,Z){return o1({queryKey:w0.events($,Z??""),queryFn:async()=>{let H=await fetch(`/api/workspaces/${$}/sessions/${Z}/events`),B=H.ok?await H.json():[];return r_(B)},enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function xG($,Z){return o1({queryKey:w0.sessionConfig($,Z??""),queryFn:()=>V1(`/api/workspaces/${$}/sessions/${Z}/config`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function GS($){let Z=Z1();return s1({mutationFn:({patch:H,sessionId:B})=>V1(`/api/workspaces/${$}/sessions/${B}/config`,n5("PUT",H),"Failed to save chat settings"),onSuccess:(H,{sessionId:B})=>{Z.setQueryData(w0.sessionConfig($,B),H)}})}var $00=["fable","opus","sonnet","haiku"];function FS($){let Z=$.resolvedModel??$.value,H=$00.findIndex((B)=>Z===B||Z.startsWith(`${B}[`)||Z.includes(`-${B}-`));return H===-1?void 0:H}function Z00($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function H00($,Z){return Z00(FS($),FS(Z))}var B00={"claude-code":H00};function J00($,Z){return $.map((H,B)=>({model:H,index:B})).sort((H,B)=>Z(H.model,B.model)||H.index-B.index).map(({model:H})=>H)}function ZL($,Z,H){if(Z&&$.includes(Z))return Z;if(H&&$.includes(H))return H;if($.includes("high"))return"high";return $[$.length-1]}function US($,Z,H){let B=ZL($,Z,H);return B?$.indexOf(B):-1}function YS($){return $.length>1}function KS($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function WS($,Z){let H=B00[Z];return H?J00($,H):$}function NS($,Z){let H=[];for(let B of $){let J=B.group??Z,Q=H.find((X)=>X.label===J);if(Q)Q.models.push(B);else H.push({label:J,models:[B]})}return H}var Z4={};j4(Z4,{createHandle:()=>QI,Trigger:()=>ZI,SubmenuTrigger:()=>JI,SubmenuRoot:()=>oS,Separator:()=>BI,Root:()=>QF,RadioItemIndicator:()=>rS,RadioItem:()=>iS,RadioGroup:()=>cS,Positioner:()=>mS,Portal:()=>vS,Popup:()=>yS,LinkItem:()=>kS,Item:()=>RS,Handle:()=>YF,GroupLabel:()=>SS,Group:()=>wS,CheckboxItemIndicator:()=>jS,CheckboxItem:()=>OS,Backdrop:()=>DS,Arrow:()=>AS});var LS=O(g(),1);var vG=O(g(),1),HL=vG.createContext(void 0);function D4($){let Z=vG.useContext(HL);if(Z===void 0&&!$)throw Error(E0(33));return Z}var gG=O(g(),1),BL=gG.createContext(void 0);function F5($){let Z=gG.useContext(BL);if(Z===void 0&&!$)throw Error(E0(36));return Z}var AS=LS.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{store:X}=F5(),{arrowRef:z,side:G,align:F,arrowUncentered:U,arrowStyles:Y}=D4(),W={open:X.useState("open"),side:G,align:F,uncentered:U};return F0("div",Z,{ref:[z,H],stateAttributesMapping:P1,state:W,props:{style:Y,"aria-hidden":!0,...Q}})});var VS=O(g(),1);var fG=O(g(),1),Q00=fG.createContext(void 0);function L9($=!0){let Z=fG.useContext(Q00);if(Z===void 0&&!$)throw Error(E0(25));return Z}var X00={...P1,...n1},DS=VS.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{store:X}=F5(),z=X.useState("open"),G=X.useState("mounted"),F=X.useState("transitionStatus"),U=X.useState("lastOpenChangeReason"),Y=L9(),K={open:z,transitionStatus:F};return F0("div",Z,{ref:Y?.backdropRef?[H,Y.backdropRef]:H,state:K,stateAttributesMapping:X00,props:[{role:"presentation",hidden:!G,style:{pointerEvents:U===G0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},Q]})});var cG=O(g(),1);var mG=O(g(),1),JL=mG.createContext(void 0);function qS(){let $=mG.useContext(JL);if($===void 0)throw Error(E0(30));return $}var r$=O(g(),1);var MS=O(g(),1);function pG($){let{closeOnClick:Z,highlighted:H,id:B,nodeId:J,store:Q,itemRef:X,itemMetadata:z}=$,{events:G}=Q.useState("floatingTreeRoot"),F=L9(!0),U=F!==void 0;return MS.useMemo(()=>({id:B,role:"menuitem",tabIndex:H?0:-1,onMouseMove(Y){if(!J)return;G.emit("itemhover",{nodeId:J,target:Y.currentTarget})},onClick(Y){if(Z)G.emit("close",{domEvent:Y,reason:G0.itemPress})},onMouseUp(Y){if(F){let K=F.initialCursorPointRef.current;if(F.initialCursorPointRef.current=null,U&&K&&Math.abs(Y.clientX-K.x)<=1&&Math.abs(Y.clientY-K.y)<=1)return}if(X.current&&Q.context.allowMouseUpTriggerRef.current&&(!U||Y.button===2)){if(!z||z.type==="regular-item")X.current.click()}}}),[Z,H,B,G,J,Q,X,F,U,z])}var a$={type:"regular-item"};function x3($){let{closeOnClick:Z,disabled:H=!1,highlighted:B,id:J,store:Q,nativeButton:X,itemMetadata:z,nodeId:G}=$,F=r$.useRef(null),{getButtonProps:U,buttonRef:Y}=u5({disabled:H,focusableWhenDisabled:!0,native:X}),K=pG({closeOnClick:Z,highlighted:B,id:J,nodeId:G,store:Q,itemRef:F,itemMetadata:z}),W=r$.useCallback((L)=>{return W4(K,{onMouseEnter(){if(z.type!=="submenu-trigger")return;z.setActive()},onKeyUp(V){if(V.key===" "&&Q.context.typingRef.current)V.preventBaseUIHandler()}},L,U)},[K,U,Q,z]),N=C4(F,Y);return r$.useMemo(()=>({getItemProps:W,itemRef:N}),[W,N])}var g9=O(g(),1);var uG=O(g(),1),QL=uG.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>{return()=>{}},elementsRef:{current:[]},nextIndexRef:{current:0}});function PS(){return uG.useContext(QL)}var z00=function($){return $[$.None=0]="None",$[$.GuessFromOrder=1]="GuessFromOrder",$}({});function q4($={}){let{label:Z,metadata:H,textRef:B,indexGuessBehavior:J,index:Q}=$,{register:X,unregister:z,subscribeMapChange:G,elementsRef:F,labelsRef:U,nextIndexRef:Y}=PS(),K=g9.useRef(-1),[W,N]=g9.useState(Q??(J===z00.GuessFromOrder?()=>{if(K.current===-1){let A=Y.current;Y.current+=1,K.current=A}return K.current}:-1)),L=g9.useRef(null),V=g9.useCallback((A)=>{if(L.current=A,W!==-1&&A!==null){if(F.current[W]=A,U){let D=Z!==void 0;U.current[W]=D?Z:B?.current?.textContent??A.textContent}}},[W,F,U,Z,B]);return U0(()=>{if(Q!=null)return;let A=L.current;if(A)return X(A,H),()=>{z(A)};return},[Q,X,z,H]),U0(()=>{if(Q!=null)return;return G((A)=>{let D=L.current?A.get(L.current)?.index:null;if(D!=null)N(D)})},[Q,G,N]),g9.useMemo(()=>({ref:V,index:W}),[W,V])}var XL=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.highlighted="data-highlighted",$}({});var v3={checked($){if($)return{[XL.checked]:""};return{[XL.unchecked]:""}},...n1};var _S=O(d(),1),OS=cG.forwardRef(function(Z,H){let{render:B,className:J,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:F=!1,checked:U,defaultChecked:Y,onCheckedChange:K,...W}=Z,N=q4({label:X}),L=D4(!0),V=H1(Q),{store:A}=F5(),D=A.useState("isActive",N.index),q=A.useState("itemProps"),[_,M]=t4({controlled:U,default:Y??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:P,itemRef:C}=x3({closeOnClick:F,disabled:G,highlighted:D,id:V,store:A,nativeButton:z,nodeId:L?.nodeId,itemMetadata:a$}),R=cG.useMemo(()=>({disabled:G,highlighted:D,checked:_}),[G,D,_]),y=Y0((h)=>{let E={...M0(G0.itemPress,h.nativeEvent),preventUnmountOnClose:()=>{}};if(K?.(!_,E),E.isCanceled)return;M((I)=>!I)}),w=F0("div",Z,{state:R,stateAttributesMapping:v3,props:[q,{role:"menuitemcheckbox","aria-checked":_,onClick:y},W,P],ref:[C,H,N.ref]});return _S.jsx(JL.Provider,{value:R,children:w})});var dG=O(g(),1);var jS=dG.forwardRef(function(Z,H){let{render:B,className:J,keepMounted:Q=!1,...X}=Z,z=qS(),G=dG.useRef(null),{transitionStatus:F,setMounted:U}=i4(z.checked);y5({open:z.checked,ref:G,onComplete(){if(!z.checked)U(!1)}});let Y={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:F};return F0("span",Z,{state:Y,ref:[H,G],stateAttributesMapping:v3,props:{"aria-hidden":!0,...X},enabled:Q||z.checked})});var n$=O(g(),1);var lG=O(g(),1),zL=lG.createContext(void 0);function TS(){let $=lG.useContext(zL);if($===void 0)throw Error(E0(31));return $}var CS=O(d(),1),wS=n$.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,[X,z]=n$.useState(void 0),G=n$.useMemo(()=>({setLabelId:z}),[z]),F=F0("div",Z,{ref:H,props:{role:"group","aria-labelledby":X,...Q}});return CS.jsx(zL.Provider,{value:G,children:F})});var ES=O(g(),1);var SS=ES.forwardRef(function(Z,H){let{className:B,render:J,id:Q,...X}=Z,z=H1(Q),{setLabelId:G}=TS();return U0(()=>{return G(z),()=>{G(void 0)}},[G,z]),F0("div",Z,{ref:H,props:{id:z,role:"presentation",...X}})});var IS=O(g(),1);var RS=IS.forwardRef(function(Z,H){let{render:B,className:J,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:F=!0,...U}=Z,Y=q4({label:X}),K=D4(!0),W=H1(Q),{store:N}=F5(),L=N.useState("isActive",Y.index),V=N.useState("itemProps"),{getItemProps:A,itemRef:D}=x3({closeOnClick:F,disabled:G,highlighted:L,id:W,store:N,nativeButton:z,nodeId:K?.nodeId,itemMetadata:a$});return F0("div",Z,{state:{disabled:G,highlighted:L},props:[V,U,A],ref:[D,H,Y.ref]})});var o$=O(g(),1);var kS=o$.forwardRef(function(Z,H){let{render:B,className:J,id:Q,label:X,closeOnClick:z=!1,...G}=Z,F=o$.useRef(null),U=q4({label:X}),K=D4(!0)?.nodeId,W=H1(Q),{store:N}=F5(),L=N.useState("isActive",U.index),V=N.useState("itemProps"),A=pG({closeOnClick:z,highlighted:L,id:W,nodeId:K,store:N,itemRef:F}),D=o$.useMemo(()=>({highlighted:L}),[L]);return F0("a",Z,{state:D,props:[V,G,A],ref:[F,H,U.ref]})});var aG=O(g(),1);var iG=O(g(),1),G00=iG.createContext(void 0);function rG($){let Z=iG.useContext(G00);if(Z===void 0&&!$)throw Error(E0(69));return Z}var bS=O(d(),1),F00={...P1,...n1},yS=aG.forwardRef(function(Z,H){let{render:B,className:J,finalFocus:Q,...X}=Z,{store:z}=F5(),{side:G,align:F}=D4(),U=rG(!0)!=null,Y=z.useState("open"),K=z.useState("transitionStatus"),W=z.useState("popupProps"),N=z.useState("mounted"),L=z.useState("instantType"),V=z.useState("activeTriggerElement"),A=z.useState("parent"),D=z.useState("lastOpenChangeReason"),q=z.useState("rootId"),_=z.useState("floatingRootContext"),M=z.useState("floatingTreeRoot"),P=z.useState("closeDelay"),C=z.useState("activeTriggerElement"),R=A.type==="context-menu";y5({open:Y,ref:z.context.popupRef,onComplete(){if(Y)z.context.onOpenChangeComplete?.(!0)}}),aG.useEffect(()=>{function j(S){z.setOpen(!1,M0(S.reason,S.domEvent))}return M.events.on("close",j),()=>{M.events.off("close",j)}},[M.events,z]);let y=z.useState("hoverEnabled"),w=z.useState("disabled");h9(_,{enabled:y&&!w&&!R&&A.type!=="menubar",closeDelay:P});let h={transitionStatus:K,side:G,align:F,open:Y,nested:A.type==="menu",instant:L},E=F0("div",Z,{state:h,ref:[H,z.context.popupRef],stateAttributesMapping:F00,props:[W,{onKeyDown(j){if(U&&Y3.has(j.key))j.stopPropagation()}},K2(K),X,{"data-rootownerid":q}]}),I=A.type===void 0||R;if(V||A.type==="menubar"&&D!==G0.outsidePress)I=!0;return bS.jsx(I6,{context:_,modal:R,disabled:!N,returnFocus:Q===void 0?I:Q,initialFocus:A.type!=="menu",restoreFocus:!0,externalTree:A.type!=="menubar"?M:void 0,previousFocusableElement:C,nextFocusableElement:A.type===void 0?z.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:A.type===void 0?z.context.beforeContentFocusGuardRef:void 0,children:E})});var xS=O(g(),1);var nG=O(g(),1),GL=nG.createContext(void 0);function hS(){let $=nG.useContext(GL);if($===void 0)throw Error(E0(32));return $}var FL=O(d(),1),vS=xS.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z,{store:Q}=F5();if(!(Q.useState("mounted")||B))return null;return FL.jsx(GL.Provider,{value:B,children:FL.jsx(S6,{ref:H,...J})})});var A9=O(g(),1);var g3=O(g(),1);var gS=O(d(),1);function oG($){let{children:Z,elementsRef:H,labelsRef:B,onMapChange:J}=$,Q=Y0(J),X=g3.useRef(0),z=k1(Y00).current,G=k1(U00).current,[F,U]=g3.useState(0),Y=g3.useRef(F),K=Y0((A,D)=>{G.set(A,D??null),Y.current+=1,U(Y.current)}),W=Y0((A)=>{G.delete(A),Y.current+=1,U(Y.current)}),N=g3.useMemo(()=>{W00(F);let A=new Map;return Array.from(G.keys()).filter((q)=>q.isConnected).sort(K00).forEach((q,_)=>{let M=G.get(q)??{};A.set(q,{...M,index:_})}),A},[G,F]);U0(()=>{if(typeof MutationObserver!=="function"||N.size===0)return;let A=new MutationObserver((D)=>{let q=new Set,_=(M)=>q.has(M)?q.delete(M):q.add(M);if(D.forEach((M)=>{M.removedNodes.forEach(_),M.addedNodes.forEach(_)}),q.size===0)Y.current+=1,U(Y.current)});return N.forEach((D,q)=>{if(q.parentElement)A.observe(q.parentElement,{childList:!0})}),()=>{A.disconnect()}},[N]),U0(()=>{if(Y.current===F){if(H.current.length!==N.size)H.current.length=N.size;if(B&&B.current.length!==N.size)B.current.length=N.size;X.current=N.size}Q(N)},[Q,N,H,B,F]),U0(()=>{return()=>{H.current=[]}},[H]),U0(()=>{return()=>{if(B)B.current=[]}},[B]);let L=Y0((A)=>{return z.add(A),()=>{z.delete(A)}});U0(()=>{z.forEach((A)=>A(N))},[z,N]);let V=g3.useMemo(()=>({register:K,unregister:W,subscribeMapChange:L,elementsRef:H,labelsRef:B,nextIndexRef:X}),[K,W,L,H,B,X]);return gS.jsx(QL.Provider,{value:V,children:Z})}function U00(){return new Map}function Y00(){return new Set}function K00($,Z){let H=$.compareDocumentPosition(Z);if(H&Node.DOCUMENT_POSITION_FOLLOWING||H&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(H&Node.DOCUMENT_POSITION_PRECEDING||H&Node.DOCUMENT_POSITION_CONTAINS)return 1;return 0}function W00($){}var s$=O(d(),1),mS=A9.forwardRef(function(Z,H){let{anchor:B,positionMethod:J="absolute",className:Q,render:X,side:z,align:G,sideOffset:F=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:N=!1,disableAnchorTracking:L=!1,collisionAvoidance:V=fS,...A}=Z,{store:D}=F5(),q=hS(),_=L9(!0),M=D.useState("parent"),P=D.useState("floatingRootContext"),C=D.useState("floatingTreeRoot"),R=D.useState("mounted"),y=D.useState("open"),w=D.useState("modal"),h=D.useState("activeTriggerElement"),E=D.useState("transitionStatus"),I=D.useState("lastOpenChangeReason"),j=D.useState("floatingNodeId"),S=D.useState("floatingParentNodeId"),k=B,b=F,v=U,c=G,T=V;if(M.type==="context-menu"){if(k=B??M.context?.anchor,c=c??"start",!z&&c!=="center")v=Z.alignOffset??2,b=Z.sideOffset??-5}let e=z,Z0=c;if(M.type==="menu")e=e??"inline-end",Z0=Z0??"start",T=Z.collisionAvoidance??$9;else if(M.type==="menubar")e=e??"bottom",Z0=Z0??"start";let x=M.type==="context-menu",t=t8({anchor:k,floatingRootContext:P,positionMethod:_?"fixed":J,mounted:R,side:e,sideOffset:b,align:Z0,alignOffset:v,arrowPadding:x?0:W,collisionBoundary:Y,collisionPadding:K,sticky:N,nodeId:j,keepMounted:q,disableAnchorTracking:L,collisionAvoidance:T,shiftCrossAxis:x&&!(("side"in T)&&T.side==="flip"),externalTree:C}),D0=A9.useMemo(()=>{let L0={};if(!y)L0.pointerEvents="none";return{role:"presentation",hidden:!R,style:{...t.positionerStyles,...L0}}},[y,R,t.positionerStyles]);A9.useEffect(()=>{function L0(i){if(i.open){if(i.parentNodeId===j)D.set("hoverEnabled",!1);if(i.nodeId!==j&&i.parentNodeId===D.select("floatingParentNodeId"))D.setOpen(!1,M0(G0.siblingOpen))}}return C.events.on("menuopenchange",L0),()=>{C.events.off("menuopenchange",L0)}},[D,C.events,j]),A9.useEffect(()=>{if(D.select("floatingParentNodeId")==null)return;function L0(i){if(i.open||i.nodeId!==D.select("floatingParentNodeId"))return;let B0=i.reason??G0.siblingOpen;D.setOpen(!1,M0(B0))}return C.events.on("menuopenchange",L0),()=>{C.events.off("menuopenchange",L0)}},[C.events,D]),A9.useEffect(()=>{function L0(i){if(!y||i.nodeId!==D.select("floatingParentNodeId"))return;if(i.target&&h&&h!==i.target)D.setOpen(!1,M0(G0.siblingOpen))}return C.events.on("itemhover",L0),()=>{C.events.off("itemhover",L0)}},[C.events,y,h,D]),A9.useEffect(()=>{let L0={open:y,nodeId:j,parentNodeId:S,reason:D.select("lastOpenChangeReason")};C.events.emit("menuopenchange",L0)},[C.events,y,D,j,S]);let p={open:y,side:t.side,align:t.align,anchorHidden:t.anchorHidden,nested:M.type==="menu"},X0=A9.useMemo(()=>({side:t.side,align:t.align,arrowRef:t.arrowRef,arrowUncentered:t.arrowUncentered,arrowStyles:t.arrowStyles,nodeId:t.context.nodeId}),[t.side,t.align,t.arrowRef,t.arrowUncentered,t.arrowStyles,t.context.nodeId]),K0=F0("div",Z,{state:p,stateAttributesMapping:P1,ref:[H,D.useStateSetter("positionerElement")],props:[D0,K2(E),A]}),Q0=R&&M.type!=="menu"&&(M.type!=="menubar"&&w&&I!==G0.triggerHover||M.type==="menubar"&&M.context.modal),z0=null;if(M.type==="menubar")z0=M.context.contentElement;else if(M.type===void 0)z0=h;return s$.jsxs(HL.Provider,{value:X0,children:[Q0&&s$.jsx(U$,{ref:M.type==="context-menu"||M.type==="nested-context-menu"?M.context.internalBackdropRef:null,inert:p8(!y),cutout:z0}),s$.jsx(MH,{id:j,children:s$.jsx(oG,{elementsRef:D.context.itemDomElements,labelsRef:D.context.itemLabels,children:K0})})]})});var t$=O(g(),1);var sG=O(g(),1),UL=sG.createContext(void 0);function pS(){let $=sG.useContext(UL);if($===void 0)throw Error(E0(34));return $}var uS=O(d(),1),cS=t$.memo(t$.forwardRef(function(Z,H){let{render:B,className:J,value:Q,defaultValue:X,onValueChange:z,disabled:G=!1,...F}=Z,[U,Y]=t4({controlled:Q,default:X,name:"MenuRadioGroup"}),K=Y0(z),W=Y0((A,D)=>{if(K?.(A,D),D.isCanceled)return;Y(A)}),L=F0("div",Z,{state:{disabled:G},ref:H,props:{role:"group","aria-disabled":G||void 0,...F}}),V=t$.useMemo(()=>({value:U,setValue:W,disabled:G}),[U,W,G]);return uS.jsx(UL.Provider,{value:V,children:L})}));var eG=O(g(),1);var tG=O(g(),1),YL=tG.createContext(void 0);function dS(){let $=tG.useContext(YL);if($===void 0)throw Error(E0(35));return $}var lS=O(d(),1),iS=eG.forwardRef(function(Z,H){let{render:B,className:J,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:F=!1,value:U,...Y}=Z,K=q4({label:X}),W=D4(!0),N=H1(Q),{store:L}=F5(),V=L.useState("isActive",K.index),A=L.useState("itemProps"),{value:D,setValue:q,disabled:_}=pS(),M=_||G,P=D===U,{getItemProps:C,itemRef:R}=x3({closeOnClick:F,disabled:M,highlighted:V,id:N,store:L,nativeButton:z,nodeId:W?.nodeId,itemMetadata:a$}),y=eG.useMemo(()=>({disabled:M,highlighted:V,checked:P}),[M,V,P]),w=Y0((E)=>{let I={...M0(G0.itemPress,E.nativeEvent),preventUnmountOnClose:()=>{}};q(U,I)}),h=F0("div",Z,{state:y,stateAttributesMapping:v3,props:[A,{role:"menuitemradio","aria-checked":P,onClick:w},Y,C],ref:[R,H,K.ref]});return lS.jsx(YL.Provider,{value:y,children:h})});var $F=O(g(),1);var rS=$F.forwardRef(function(Z,H){let{render:B,className:J,keepMounted:Q=!1,...X}=Z,z=dS(),G=$F.useRef(null),{transitionStatus:F,setMounted:U}=i4(z.checked);y5({open:z.checked,ref:G,onComplete(){if(!z.checked)U(!1)}});let Y={checked:z.checked,disabled:z.disabled,highlighted:z.highlighted,transitionStatus:F};return F0("span",Z,{state:Y,stateAttributesMapping:v3,ref:[H,G],props:{"aria-hidden":!0,...X},enabled:Q||z.checked})});var R5=O(g(),1);var ZF=O(g(),1),N00=ZF.createContext(null);function HF($){let Z=ZF.useContext(N00);if(Z===null&&!$)throw Error(E0(5));return Z}var hB=O(g(),1);var L00={...o8,disabled:S0(($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled),modal:S0(($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0)),allowMouseEnter:S0(($)=>$.allowMouseEnter),stickIfOpen:S0(($)=>$.stickIfOpen),parent:S0(($)=>$.parent),rootId:S0(($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId}),activeIndex:S0(($)=>$.activeIndex),isActive:S0(($,Z)=>$.activeIndex===Z),hoverEnabled:S0(($)=>$.hoverEnabled),instantType:S0(($)=>$.instantType),lastOpenChangeReason:S0(($)=>$.openChangeReason),floatingTreeRoot:S0(($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot}),floatingNodeId:S0(($)=>$.floatingNodeId),floatingParentNodeId:S0(($)=>$.floatingParentNodeId),itemProps:S0(($)=>$.itemProps),closeDelay:S0(($)=>$.closeDelay),keyboardEventRelay:S0(($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return})};class e$ extends n2{constructor($){super({...A00(),...$},{positionerRef:hB.createRef(),popupRef:hB.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:hB.createRef(),beforeContentFocusGuardRef:hB.createRef(),onOpenChangeComplete:void 0,triggerElements:new s2},L00);this.unsubscribeParentListener=this.observe("parent",(Z)=>{if(this.unsubscribeParentListener?.(),Z.type==="menu"){this.unsubscribeParentListener=Z.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=Z.store.context.allowMouseUpTriggerRef;return}if(Z.type!==void 0)this.context.allowMouseUpTriggerRef=Z.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}static useStore($,Z){let H=k1(()=>{return new e$(Z)}).current;return $??H}unsubscribeParentListener=null}function A00(){return{...n8(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new T6,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:b1,keyboardEventRelay:void 0,closeDelay:0}}var BF=O(g(),1),KL=BF.createContext(void 0);function JF(){return BF.useContext(KL)}var WL=O(d(),1),QF=NH(function(Z){let{children:H,open:B,onOpenChange:J,onOpenChangeComplete:Q,defaultOpen:X=!1,disabled:z=!1,modal:G,loopFocus:F=!0,orientation:U="vertical",actionsRef:Y,closeParentOnEsc:K=!1,handle:W,triggerId:N,defaultTriggerId:L=null,highlightItemOnHover:V=!0}=Z,A=L9(!0),D=F5(!0),q=HF(!0),_=JF(),M=R5.useMemo(()=>{if(_&&D)return{type:"menu",store:D.store};if(q)return{type:"menubar",context:q};if(A&&!D)return{type:"context-menu",context:A};return{type:void 0}},[A,D,q,_]),P=e$.useStore(W?.store,{open:X,openProp:B,activeTriggerId:L,triggerIdProp:N,parent:M});Z9(()=>{if(B===void 0&&P.state.open===!1&&X===!0)P.update({open:!0,activeTriggerId:L})}),P.useControlledProp("openProp",B),P.useControlledProp("triggerIdProp",N),P.useContextCallback("onOpenChangeComplete",Q);let C=P.useState("floatingTreeRoot"),R=C6(C),y=e5();U0(()=>{if(A&&!D)P.update({parent:{type:"context-menu",context:A},floatingNodeId:R,floatingParentNodeId:y});else if(D)P.update({floatingNodeId:R,floatingParentNodeId:y})},[A,D,R,y,P]);let w=P.useState("open"),h=P.useState("activeTriggerElement"),E=P.useState("positionerElement"),I=P.useState("hoverEnabled"),j=P.useState("modal"),S=P.useState("disabled"),k=P.useState("lastOpenChangeReason"),b=P.useState("parent"),v=P.useState("activeIndex"),c=P.useState("payload"),T=P.useState("floatingParentNodeId"),e=R5.useRef(null),Z0=T!=null,x;P.useSyncedValues({disabled:z,modal:b.type===void 0?G:void 0,rootId:Y2()});let{openMethod:t,triggerProps:D0,reset:p}=W$(w);r8(P);let{forceUnmount:X0}=a8(w,P,()=>{P.update({allowMouseEnter:!1,stickIfOpen:!0}),p()}),K0=R5.useRef(b.type!=="context-menu"),Q0=_5();R5.useEffect(()=>{if(!w)e.current=null;if(b.type!=="context-menu")return;if(!w){Q0.clear(),K0.current=!1;return}Q0.start(500,()=>{K0.current=!0})},[Q0,w,b.type]),Y$(w&&j&&k!==G0.triggerHover&&t!=="touch",E),U0(()=>{if(!w&&!I)P.set("hoverEnabled",!0)},[w,I,P]);let z0=R5.useRef(!0),L0=_5(),i=Y0((c0,R0)=>{let d0=R0.reason;if(w===c0&&R0.trigger===h&&k===d0)return;if(R0.preventUnmountOnClose=()=>{P.set("preventUnmountingOnClose",!0)},!c0&&R0.trigger==null)R0.trigger=h??void 0;if(J?.(c0,R0),R0.isCanceled)return;let p0={open:c0,nativeEvent:R0.event,reason:R0.reason,nested:Z0};x?.emit("openchange",p0);let t0=R0.event;if(c0===!1&&t0?.type==="click"&&t0.pointerType==="touch"&&!z0.current)return;if(!c0&&v!==null){let I0=P.context.itemDomElements.current[v];queueMicrotask(()=>{I0?.setAttribute("tabindex","-1")})}if(c0&&d0===G0.triggerFocus)z0.current=!1,L0.start(300,()=>{z0.current=!0});else z0.current=!0,L0.clear();let N0=(d0===G0.triggerPress||d0===G0.itemPress)&&t0.detail===0&&t0?.isTrusted,b0=!c0&&(d0===G0.escapeKey||d0==null),W1={open:c0,openChangeReason:d0};e.current=R0.event??null;let C0=R0.trigger?.id??null;if(C0||c0)W1.activeTriggerId=C0,W1.activeTriggerElement=R0.trigger??null;if(P.update(W1),b.type==="menubar"&&(d0===G0.triggerFocus||d0===G0.focusOut||d0===G0.triggerHover||d0===G0.listNavigation||d0===G0.siblingOpen))P.set("instantType","group");else if(N0||b0)P.set("instantType",N0?"click":"dismiss");else P.set("instantType",void 0)}),B0=R5.useCallback((c0)=>{let R0=M0(c0);return R0.preventUnmountOnClose=()=>{P.set("preventUnmountingOnClose",!0)},R0},[P]),$0=R5.useCallback(()=>{P.setOpen(!1,B0(G0.imperativeAction))},[P,B0]);R5.useImperativeHandle(Y,()=>({unmount:X0,close:$0}),[X0,$0]);let J0;if(b.type==="context-menu")J0=b.context;R5.useImperativeHandle(J0?.positionerRef,()=>E,[E]),R5.useImperativeHandle(J0?.actionsRef,()=>({setOpen:i}),[i]);let n=A8({popupStore:P,onOpenChange:i});x=n.context.events,R5.useEffect(()=>{let c0=({open:R0,eventDetails:d0})=>i(R0,d0);return x.on("setOpen",c0),()=>{x?.off("setOpen",c0)}},[x,i]);let f=L8(n,{enabled:!S,bubbles:{escapeKey:K&&b.type==="menu"},outsidePress(){if(b.type!=="context-menu"||e.current?.type==="contextmenu")return!0;return K0.current},externalTree:Z0?C:void 0}),l=h6(n,{role:"menu"}),m=r4(),a=R5.useCallback((c0)=>{if(P.select("activeIndex")===c0)return;P.set("activeIndex",c0)},[P]),o=cK(n,{enabled:!S,listRef:P.context.itemDomElements,activeIndex:v,nested:b.type!==void 0,loopFocus:F,orientation:U,parentOrientation:b.type==="menubar"?b.context.orientation:void 0,rtl:m==="rtl",disabledIndices:xB,onNavigate:a,openOnArrowKeyDown:b.type!=="context-menu",externalTree:Z0?C:void 0,focusItemOnHover:V}),V0=R5.useCallback((c0)=>{P.context.typingRef.current=c0},[P]),O0=dK(n,{listRef:P.context.itemLabels,activeIndex:v,resetMs:aS,onMatch:(c0)=>{if(w&&c0!==v)P.set("activeIndex",c0)},onTypingChange:V0}),{getReferenceProps:k0,getFloatingProps:r0,getItemProps:u,getTriggerProps:r}=Z2([f,l,o,O0]),H0=R5.useMemo(()=>{let c0=W4(k0(),{onMouseMove(){P.set("allowMouseEnter",!0)}},D0);return delete c0.role,c0},[k0,P,D0]),A0=R5.useMemo(()=>{let c0=r();if(!c0)return c0;let R0=W4(c0,D0);return delete R0.role,delete R0["aria-controls"],R0},[r,D0]),j0=R5.useMemo(()=>r0({onMouseMove(){if(P.set("allowMouseEnter",!0),b.type==="menu")P.set("hoverEnabled",!1)},onClick(){if(P.select("hoverEnabled"))P.set("hoverEnabled",!1)},onKeyDown(c0){let R0=P.select("keyboardEventRelay");if(R0&&!c0.isPropagationStopped())R0(c0)}}),[r0,b.type,P]),v0=R5.useMemo(()=>u(),[u]);P.useSyncedValues({floatingRootContext:n,activeTriggerProps:H0,inactiveTriggerProps:A0,popupProps:j0,itemProps:v0});let G1=R5.useMemo(()=>({store:P,parent:M}),[P,M]),K1=WL.jsx(BL.Provider,{value:G1,children:typeof H==="function"?H({payload:c}):H});if(b.type===void 0||b.type==="context-menu")return WL.jsx(PH,{externalTree:C,children:K1});return K1});var nS=O(g(),1);var NL=O(d(),1);function oS($){let Z=F5().store,H=nS.useMemo(()=>({parentMenu:Z}),[Z]);return NL.jsx(KL.Provider,{value:H,children:NL.jsx(QF,{...$})})}var g2=O(g(),1),AL=O(Y4(),1);function sS($){let Z=$.getBoundingClientRect(),H=window.getComputedStyle($,"::before"),B=window.getComputedStyle($,"::after");if(!(H.content!=="none"||B.content!=="none"))return Z;let Q=parseFloat(H.width)||0,X=parseFloat(H.height)||0,z=parseFloat(B.width)||0,G=parseFloat(B.height)||0,F=Math.max(Z.width,Q,z),U=Math.max(Z.height,X,G),Y=F-Z.width,K=U-Z.height;return{left:Z.left-Y/2,right:Z.right+Y/2,top:Z.top-K/2,bottom:Z.bottom+K/2}}var zF=O(g(),1);function tS($={}){let{highlightItemOnHover:Z,highlightedIndex:H,onHighlightedIndexChange:B}=XF(),{ref:J,index:Q}=q4($),X=H===Q,z=zF.useRef(null),G=C4(J,z);return{compositeProps:zF.useMemo(()=>({tabIndex:X?0:-1,onFocus(){B(Q)},onMouseMove(){let U=z.current;if(!Z||!U)return;let Y=U.hasAttribute("disabled")||U.ariaDisabled==="true";if(!X&&!Y)U.focus()}}),[X,B,Q,Z]),compositeRef:G,index:Q}}function eS($){let{render:Z,className:H,state:B=b1,props:J=xB,refs:Q=xB,metadata:X,stateAttributesMapping:z,tag:G="div",...F}=$,{compositeProps:U,compositeRef:Y}=tS({metadata:X});return F0(G,$,{state:B,ref:[...Q,Y],props:[U,...J,F],stateAttributesMapping:z})}function LL($){if(O5($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid")??void 0;if(e7($))return;return LL($X($))}var GF=O(g(),1);function $I($){let{enabled:Z=!0,mouseDownAction:H,open:B}=$,J=GF.useRef(!1);return GF.useMemo(()=>{if(!Z)return b1;return{onMouseDown:(Q)=>{if(H==="open"&&!B||H==="close"&&B)J.current=!0,m0(Q.currentTarget).addEventListener("click",()=>{J.current=!1},{once:!0})},onClick:(Q)=>{if(J.current)J.current=!1,Q.preventBaseUIHandler()}}},[Z,H,B])}var f3=O(d(),1),FF=2,ZI=AQ(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,id:z,openOnHover:G,delay:F=100,closeDelay:U=0,handle:Y,payload:K,...W}=Z,N=F5(!0),L=Y?.store??N?.store;if(!L)throw Error(E0(85));let V=H1(z),A=L.useState("isTriggerActive",V),D=L.useState("floatingRootContext"),q=L.useState("isOpenedByTrigger",V),_=g2.useRef(null),M=D00(),P=XF(!0),C=b2(),R=g2.useMemo(()=>{return C??new T6},[C]),y=C6(R),w=e5(),{registerTrigger:h,isMountedByThisTrigger:E}=i8(V,_,L,{payload:K,closeDelay:U,parent:M,floatingTreeRoot:R,floatingNodeId:y,floatingParentNodeId:w,keyboardEventRelay:P?.relayKeyboardEvent}),I=M.type==="menubar",j=L.useState("disabled"),S=Q||j||I&&M.context.disabled,{getButtonProps:k,buttonRef:b}=u5({disabled:S,native:X});g2.useEffect(()=>{if(!q&&M.type===void 0)L.context.allowMouseUpTriggerRef.current=!1},[L,q,M.type]);let v=g2.useRef(null),c=_5(),T=Y0((f)=>{if(!v.current)return;c.clear(),L.context.allowMouseUpTriggerRef.current=!1;let l=f.target;if(f0(v.current,l)||f0(L.select("positionerElement"),l)||l===v.current)return;if(l!=null&&LL(l)===L.select("rootId"))return;let m=sS(v.current);if(f.clientX>=m.left-FF&&f.clientX<=m.right+FF&&f.clientY>=m.top-FF&&f.clientY<=m.bottom+FF)return;R.events.emit("close",{domEvent:f,reason:G0.cancelOpen})});g2.useEffect(()=>{if(q&&L.select("lastOpenChangeReason")===G0.triggerHover)m0(v.current).addEventListener("mouseup",T,{once:!0})},[q,T,L]);let e=I&&M.context.hasSubmenuOpen,x=V8(D,{enabled:(G??e)&&!S&&M.type!=="context-menu"&&(!I||e&&!E),handleClose:D8({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:M.type===void 0?F:void 0,delay:{close:U},triggerElementRef:_,externalTree:R,isActiveTrigger:A}),t=V00(q,L.select("lastOpenChangeReason")),D0=y9(D,{enabled:!S&&M.type!=="context-menu",event:q&&I?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:M.type===void 0?t:!1}),p=k6(D,{enabled:!S&&e}),X0=$I({open:q,enabled:I,mouseDownAction:"open"}),K0=Z2([D0,p]),Q0={disabled:S,open:q},z0=L.useState("triggerProps",E),L0=[v,H,b,h,_],i=[K0.getReferenceProps(),x??b1,z0,{"aria-haspopup":"menu",id:V,onMouseDown:(f)=>{if(L.select("open"))return;c.start(200,()=>{L.context.allowMouseUpTriggerRef.current=!0}),m0(f.currentTarget).addEventListener("mouseup",T,{once:!0})}},I?{role:"menuitem"}:{},X0,W,k],B0=g2.useRef(null),$0=Y0((f)=>{AL.flushSync(()=>{L.setOpen(!1,M0(G0.focusOut,f.nativeEvent,f.currentTarget))}),mQ(B0.current)?.focus()}),J0=Y0((f)=>{let l=L.select("positionerElement");if(l&&Y8(f,l))L.context.beforeContentFocusGuardRef.current?.focus();else{AL.flushSync(()=>{L.setOpen(!1,M0(G0.focusOut,f.nativeEvent,f.currentTarget))});let m=fQ(L.context.triggerFocusTargetRef.current||_.current);while(m!==null&&f0(l,m)){let a=m;if(m=H3(m),m===a)break}m?.focus()}}),n=F0("button",Z,{enabled:!I,stateAttributesMapping:kH,state:Q0,ref:L0,props:i});if(I)return f3.jsx(eS,{tag:"button",render:B,className:J,state:Q0,refs:L0,props:i,stateAttributesMapping:kH});if(q)return f3.jsxs(g2.Fragment,{children:[f3.jsx(R2,{ref:B0,onFocus:$0},`${V}-pre-focus-guard`),f3.jsx(g2.Fragment,{children:n},V),f3.jsx(R2,{ref:L.context.triggerFocusTargetRef,onFocus:J0},`${V}-post-focus-guard`)]});return f3.jsx(g2.Fragment,{children:n},V)});function V00($,Z){let H=_5(),[B,J]=g2.useState(!1);return U0(()=>{if($&&Z==="trigger-hover")J(!0),H.start(UF,()=>{J(!1)});else if(!$)H.clear(),J(!1)},[$,Z,H]),B}function D00(){let $=L9(!0),Z=F5(!0),H=HF(!0);return g2.useMemo(()=>{if(H)return{type:"menubar",context:H};if($&&!Z)return{type:"context-menu",context:$};return{type:void 0}},[$,Z,H])}var HI=O(g(),1);var BI=HI.forwardRef(function(Z,H){let{className:B,render:J,orientation:Q="horizontal",...X}=Z;return F0("div",Z,{state:{orientation:Q},ref:H,props:[{role:"separator","aria-orientation":Q},X]})});var f9=O(g(),1);var JI=f9.forwardRef(function(Z,H){let{render:B,className:J,label:Q,id:X,nativeButton:z=!1,openOnHover:G=!0,delay:F=100,closeDelay:U=0,disabled:Y=!1,...K}=Z,W=q4(),N=D4(),{store:L}=F5(),V=H1(X),A=L.useState("open"),D=L.useState("floatingRootContext"),q=L.useState("floatingTreeRoot"),_=vK(V,L),M=f9.useCallback((D0)=>{let p=_(D0);if(D0!==null&&L.select("open")&&L.select("activeTriggerId")==null)L.update({activeTriggerId:V,activeTriggerElement:D0,closeDelay:U});return p},[_,U,L,V]),P=f9.useRef(null),C=f9.useCallback((D0)=>{P.current=D0,L.set("activeTriggerElement",D0)},[L]),R=JF();if(!R?.parentMenu)throw Error(E0(37));L.useSyncedValue("closeDelay",U);let y=R.parentMenu,w=y.useState("itemProps"),h=y.useState("isActive",W.index),E=f9.useMemo(()=>({type:"submenu-trigger",setActive(){y.set("activeIndex",W.index)}}),[y,W.index]),I=L.useState("disabled"),j=Y||I,{getItemProps:S,itemRef:k}=x3({closeOnClick:!1,disabled:j,highlighted:h,id:V,store:L,nativeButton:z,itemMetadata:E,nodeId:N?.nodeId}),b=L.useState("hoverEnabled"),v=y.useState("allowMouseEnter"),c=V8(D,{enabled:b&&G&&!j,handleClose:D8({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:F,delay:v?{open:F,close:U}:0,triggerElementRef:P,externalTree:q}),T=y9(D,{enabled:!j,event:"mousedown",toggle:!G,ignoreMouse:G,stickIfOpen:!1}),e=Z2([T]),Z0=L.useState("triggerProps",!0);return delete Z0.id,F0("div",Z,{state:{disabled:j,highlighted:h,open:A},stateAttributesMapping:e8,props:[e.getReferenceProps(),c,Z0,w,{tabIndex:A||h?0:-1,onBlur(){if(h)y.set("activeIndex",null)}},K,S],ref:[H,W.ref,k,M,C]})});class YF{constructor(){this.store=new e$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(E0(83,$));this.store.setOpen(!0,M0("imperative-action",void 0,Z))}close(){this.store.setOpen(!1,M0("imperative-action",void 0,void 0))}get isOpen(){return this.store.state.open}}function QI(){return new YF}var f2=O(d(),1);function $Z({...$}){return f2.jsx(Z4.Root,{"data-slot":"dropdown-menu",...$})}function ZZ({...$}){return f2.jsx(Z4.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function HZ({align:$="start",alignOffset:Z=0,side:H="bottom",sideOffset:B=4,className:J,...Q}){return f2.jsx(Z4.Portal,{children:f2.jsx(Z4.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:H,sideOffset:B,children:f2.jsx(Z4.Popup,{"data-slot":"dropdown-menu-content",className:s("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",J),...Q})})})}function BZ({...$}){return f2.jsx(Z4.Group,{"data-slot":"dropdown-menu-group",...$})}function KF({className:$,inset:Z,...H}){return f2.jsx(Z4.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:s("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:pl-7",$),...H})}function vB({className:$,inset:Z,variant:H="default",...B}){return f2.jsx(Z4.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":H,className:s("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",$),...B})}function XI({...$}){return f2.jsx(Z4.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function zI({className:$,children:Z,inset:H,...B}){return f2.jsxs(Z4.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":H,className:s("relative flex cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...B,children:[f2.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:f2.jsx(Z4.RadioItemIndicator,{children:f2.jsx(A3,{stroke:1.75})})}),Z]})}function GI({className:$,...Z}){return f2.jsx(Z4.Separator,{"data-slot":"dropdown-menu-separator",className:s("mx-2 my-1 h-px bg-border",$),...Z})}var m3={};j4(m3,{createHandle:()=>bI,Viewport:()=>kI,Trigger:()=>WI,Title:()=>TI,Root:()=>YI,Positioner:()=>VI,Portal:()=>AI,Popup:()=>qI,Handle:()=>VF,Description:()=>wI,Close:()=>SI,Backdrop:()=>OI,Arrow:()=>PI});var Q8=O(g(),1);var WF=O(g(),1),VL=WF.createContext(void 0);function v5($){let Z=WF.useContext(VL);if(Z===void 0&&!$)throw Error(E0(47));return Z}var JZ=O(g(),1),FI=O(Y4(),1);function q00(){return{...n8(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var M00={...o8,disabled:S0(($)=>$.disabled),instantType:S0(($)=>$.instantType),openMethod:S0(($)=>$.openMethod),openChangeReason:S0(($)=>$.openChangeReason),modal:S0(($)=>$.modal),stickIfOpen:S0(($)=>$.stickIfOpen),titleElementId:S0(($)=>$.titleElementId),descriptionElementId:S0(($)=>$.descriptionElementId),openOnHover:S0(($)=>$.openOnHover),closeDelay:S0(($)=>$.closeDelay),hasViewport:S0(($)=>$.hasViewport)};class QZ extends n2{constructor($){let Z={...q00(),...$};if(Z.open&&$?.mounted===void 0)Z.mounted=!0;super(Z,{popupRef:JZ.createRef(),backdropRef:JZ.createRef(),internalBackdropRef:JZ.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:JZ.createRef(),beforeContentFocusGuardRef:JZ.createRef(),stickIfOpenTimeout:new r5,triggerElements:new s2},M00)}setOpen=($,Z)=>{let H=Z.reason===G0.triggerHover,B=Z.reason===G0.triggerPress&&Z.event.detail===0,J=!$&&(Z.reason===G0.escapeKey||Z.reason==null);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let Q={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested,triggerElement:Z.trigger};this.state.floatingRootContext.context.events?.emit("openchange",Q);let z=()=>{let G={open:$,openChangeReason:Z.reason},F=Z.trigger?.id??null;if(F||$)G.activeTriggerId=F,G.activeTriggerElement=Z.trigger??null;this.update(G)};if(H)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(UF,()=>{this.set("stickIfOpen",!1)}),FI.flushSync(z);else z();if(B||J)this.set("instantType",B?"click":"dismiss");else if(Z.reason===G0.focusOut)this.set("instantType","focus");else this.set("instantType",void 0)};static useStore($,Z){let H=k1(()=>{return new QZ(Z)}).current,B=$??H;return S2(H.disposeEffect),B}disposeEffect=()=>{return this.context.stickIfOpenTimeout.disposeEffect()}}var gB=O(d(),1);function UI({props:$}){let{children:Z,open:H,defaultOpen:B=!1,onOpenChange:J,onOpenChangeComplete:Q,modal:X=!1,handle:z,triggerId:G,defaultTriggerId:F=null}=$,U=QZ.useStore(z?.store,{modal:X,open:B,openProp:H,activeTriggerId:F,triggerIdProp:G});Z9(()=>{if(H===void 0&&U.state.open===!1&&B===!0)U.update({open:!0,activeTriggerId:F})}),U.useControlledProp("openProp",H),U.useControlledProp("triggerIdProp",G);let Y=U.useState("open"),K=U.useState("positionerElement"),W=U.useState("payload"),N=U.useState("openChangeReason");U.useContextCallback("onOpenChange",J),U.useContextCallback("onOpenChangeComplete",Q);let{openMethod:L,triggerProps:V,reset:A}=W$(Y);r8(U);let{forceUnmount:D}=a8(Y,U,()=>{U.update({stickIfOpen:!0,openChangeReason:null}),A()});Y$(Y&&X===!0&&N!==G0.triggerHover&&L!=="touch",K),Q8.useEffect(()=>{if(!Y)U.context.stickIfOpenTimeout.clear()},[U,Y]);let q=Q8.useCallback((S)=>{let k=M0(S);return k.preventUnmountOnClose=()=>{U.set("preventUnmountingOnClose",!0)},k},[U]),_=Q8.useCallback(()=>{U.setOpen(!1,q(G0.imperativeAction))},[U,q]);Q8.useImperativeHandle($.actionsRef,()=>({unmount:D,close:_}),[D,_]);let M=A8({popupStore:U,onOpenChange:U.setOpen}),P=L8(M,{outsidePressEvent:{mouse:X==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),C=h6(M),{getReferenceProps:R,getFloatingProps:y,getTriggerProps:w}=Z2([P,C]),h=Q8.useMemo(()=>{return R(V)},[R,V]),E=Q8.useMemo(()=>{return w(V)},[w,V]),I=Q8.useMemo(()=>{return y()},[y]);U.useSyncedValues({modal:X,openMethod:L,activeTriggerProps:h,inactiveTriggerProps:E,popupProps:I,floatingRootContext:M,nested:e5()!=null});let j=Q8.useMemo(()=>({store:U}),[U]);return gB.jsx(VL.Provider,{value:j,children:typeof Z==="function"?Z({payload:W}):Z})}function YI($){if(v5(!0))return gB.jsx(UI,{props:$});return gB.jsx(PH,{children:gB.jsx(UI,{props:$})})}var C8=O(g(),1),DL=O(Y4(),1);var KI=300;var z7=O(d(),1),WI=C8.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,handle:z,payload:G,openOnHover:F=!1,delay:U=KI,closeDelay:Y=0,id:K,...W}=Z,N=v5(!0),L=z?.store??N?.store;if(!L)throw Error(E0(74));let V=H1(K),A=L.useState("isTriggerActive",V),D=L.useState("floatingRootContext"),q=L.useState("isOpenedByTrigger",V),_=C8.useRef(null),{registerTrigger:M,isMountedByThisTrigger:P}=i8(V,_,L,{payload:G,disabled:Q,openOnHover:F,closeDelay:Y}),C=L.useState("openChangeReason"),R=L.useState("stickIfOpen"),y=L.useState("openMethod"),w=V8(D,{enabled:D!=null&&F&&(y!=="touch"||C!==G0.triggerPress),mouseOnly:!0,move:!1,handleClose:D8(),restMs:U,delay:{close:Y},triggerElementRef:_,isActiveTrigger:A}),h=y9(D,{enabled:D!=null,stickIfOpen:R}),E=Z2([h]),I=L.useState("triggerProps",P),j={disabled:Q,open:q},{getButtonProps:S,buttonRef:k}=u5({disabled:Q,native:X}),b=C8.useMemo(()=>({open(Z0){if(Z0&&C===G0.triggerPress)return kH.open(Z0);return e8.open(Z0)}}),[C]),v=F0("button",Z,{state:j,ref:[k,H,M,_],props:[E.getReferenceProps(),w,I,{[t7]:"",id:V},W,S],stateAttributesMapping:b}),c=C8.useRef(null),T=Y0((Z0)=>{DL.flushSync(()=>{L.setOpen(!1,M0(G0.focusOut,Z0.nativeEvent,Z0.currentTarget))}),mQ(c.current)?.focus()}),e=Y0((Z0)=>{let x=L.select("positionerElement");if(x&&Y8(Z0,x))L.context.beforeContentFocusGuardRef.current?.focus();else{DL.flushSync(()=>{L.setOpen(!1,M0(G0.focusOut,Z0.nativeEvent,Z0.currentTarget))});let t=fQ(L.context.triggerFocusTargetRef.current||_.current);while(t!==null&&f0(x,t)){let D0=t;if(t=H3(t),t===D0)break}t?.focus()}});if(A)return z7.jsxs(C8.Fragment,{children:[z7.jsx(R2,{ref:c,onFocus:T}),z7.jsx(C8.Fragment,{children:v},V),z7.jsx(R2,{ref:L.context.triggerFocusTargetRef,onFocus:e})]});return z7.jsx(C8.Fragment,{children:v},V)});var LI=O(g(),1);var NF=O(g(),1),qL=NF.createContext(void 0);function NI(){let $=NF.useContext(qL);if($===void 0)throw Error(E0(45));return $}var ML=O(d(),1),AI=LI.forwardRef(function(Z,H){let{keepMounted:B=!1,...J}=Z,{store:Q}=v5();if(!(Q.useState("mounted")||B))return null;return ML.jsx(qL.Provider,{value:B,children:ML.jsx(S6,{ref:H,...J})})});var m9=O(g(),1);var LF=O(g(),1),PL=LF.createContext(void 0);function XZ(){let $=LF.useContext(PL);if(!$)throw Error(E0(46));return $}var fB=O(d(),1),VI=m9.forwardRef(function(Z,H){let{render:B,className:J,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:F=0,alignOffset:U=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:K=5,arrowPadding:W=5,sticky:N=!1,disableAnchorTracking:L=!1,collisionAvoidance:V=$9,...A}=Z,{store:D}=v5(),q=NI(),_=C6(),M=D.useState("floatingRootContext"),P=D.useState("mounted"),C=D.useState("open"),R=D.useState("openChangeReason"),y=D.useState("activeTriggerElement"),w=D.useState("modal"),h=D.useState("positionerElement"),E=D.useState("instantType"),I=D.useState("transitionStatus"),j=D.useState("hasViewport"),S=m9.useRef(null),k=d8(h,!1,!1),b=t8({anchor:Q,floatingRootContext:M,positionMethod:X,mounted:P,side:z,sideOffset:F,align:G,alignOffset:U,arrowPadding:W,collisionBoundary:Y,collisionPadding:K,sticky:N,disableAnchorTracking:L,keepMounted:q,nodeId:_,collisionAvoidance:V,adaptiveOrigin:j?H$:void 0}),v=m9.useMemo(()=>{let t={};if(!C)t.pointerEvents="none";return{role:"presentation",hidden:!P,style:{...b.positionerStyles,...t}}},[C,P,b.positionerStyles]),c=m9.useMemo(()=>({props:v,...b}),[v,b]),T=M.useState("domReferenceElement");U0(()=>{let t=T,D0=S.current;if(t)S.current=t;if(D0&&t&&t!==D0){D.set("instantType",void 0);let p=new AbortController;return k(()=>{D.set("instantType","trigger-change")},p.signal),()=>{p.abort()}}return},[T,k,D]);let e={open:C,side:c.side,align:c.align,anchorHidden:c.anchorHidden,instant:E},Z0=m9.useCallback((t)=>{D.set("positionerElement",t)},[D]),x=F0("div",Z,{state:e,props:[c.props,K2(I),A],ref:[H,Z0],stateAttributesMapping:P1});return fB.jsxs(PL.Provider,{value:c,children:[P&&w===!0&&R!==G0.triggerHover&&fB.jsx(U$,{ref:D.context.internalBackdropRef,inert:p8(!C),cutout:y}),fB.jsx(MH,{id:_,children:x})]})});var AF=O(g(),1);var DI=O(d(),1),P00={...P1,...n1},qI=AF.forwardRef(function(Z,H){let{className:B,render:J,initialFocus:Q,finalFocus:X,...z}=Z,{store:G}=v5(),F=XZ(),U=rG(!0)!=null,Y=G.useState("open"),K=G.useState("openMethod"),W=G.useState("instantType"),N=G.useState("transitionStatus"),L=G.useState("popupProps"),V=G.useState("titleElementId"),A=G.useState("descriptionElementId"),D=G.useState("modal"),q=G.useState("mounted"),_=G.useState("openChangeReason"),M=G.useState("activeTriggerElement"),P=G.useState("floatingRootContext");y5({open:Y,ref:G.context.popupRef,onComplete(){if(Y)G.context.onOpenChangeComplete?.(!0)}});let C=G.useState("disabled"),R=G.useState("openOnHover"),y=G.useState("closeDelay");h9(P,{enabled:R&&!C,closeDelay:y});function w(S){if(S==="touch")return G.context.popupRef.current;return!0}let h=Q===void 0?w:Q,E={open:Y,side:F.side,align:F.align,instant:W,transitionStatus:N},I=AF.useCallback((S)=>{G.set("popupElement",S)},[G]),j=F0("div",Z,{state:E,ref:[H,G.context.popupRef,I],props:[L,{"aria-labelledby":V,"aria-describedby":A,onKeyDown(S){if(U&&Y3.has(S.key))S.stopPropagation()}},K2(N),z],stateAttributesMapping:P00});return DI.jsx(I6,{context:P,openInteractionType:K,modal:D==="trap-focus",disabled:!q||_===G0.triggerHover,initialFocus:h,returnFocus:X,restoreFocus:"popup",previousFocusableElement:O5(M)?M:void 0,nextFocusableElement:G.context.triggerFocusTargetRef,beforeContentFocusGuardRef:G.context.beforeContentFocusGuardRef,children:j})});var MI=O(g(),1);var PI=MI.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{store:X}=v5(),z=X.useState("open"),{arrowRef:G,side:F,align:U,arrowUncentered:Y,arrowStyles:K}=XZ();return F0("div",Z,{state:{open:z,side:F,align:U,uncentered:Y},ref:[H,G],props:[{style:K,"aria-hidden":!0},Q],stateAttributesMapping:P1})});var _I=O(g(),1);var _00={...P1,...n1},OI=_I.forwardRef(function(Z,H){let{className:B,render:J,...Q}=Z,{store:X}=v5(),z=X.useState("open"),G=X.useState("mounted"),F=X.useState("transitionStatus"),U=X.useState("openChangeReason");return F0("div",Z,{state:{open:z,transitionStatus:F},ref:[X.context.backdropRef,H],props:[{role:"presentation",hidden:!G,style:{pointerEvents:U===G0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},Q],stateAttributesMapping:_00})});var jI=O(g(),1);var TI=jI.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{store:X}=v5(),z=H1(Q.id);return U0(()=>{return X.set("titleElementId",z),()=>{X.set("titleElementId",void 0)}},[X,z]),F0("h2",Z,{ref:H,props:[{id:z},Q]})});var CI=O(g(),1);var wI=CI.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{store:X}=v5(),z=H1(Q.id);return U0(()=>{return X.set("descriptionElementId",z),()=>{X.set("descriptionElementId",void 0)}},[X,z]),F0("p",Z,{ref:H,props:[{id:z},Q]})});var EI=O(g(),1);var SI=EI.forwardRef(function(Z,H){let{render:B,className:J,disabled:Q=!1,nativeButton:X=!0,...z}=Z,{buttonRef:G,getButtonProps:F}=u5({disabled:Q,focusableWhenDisabled:!1,native:X}),{store:U}=v5();return F0("button",Z,{ref:[H,G],props:[{onClick(K){U.setOpen(!1,M0(G0.closePress,K.nativeEvent,K.currentTarget))}},z,F]})});var RI=O(g(),1);var II=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var O00={activationDirection:($)=>$?{"data-activation-direction":$}:null},kI=RI.forwardRef(function(Z,H){let{render:B,className:J,children:Q,...X}=Z,{store:z}=v5(),{side:G}=XZ(),F=z.useState("instantType"),{children:U,state:Y}=z$({store:z,side:G,cssVars:II,children:Q}),K={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:F};return F0("div",Z,{state:K,ref:H,props:[X,{children:U}],stateAttributesMapping:O00})});class VF{constructor(){this.store=new QZ}open($){let Z=$?this.store.context.triggerElements.getById($)??void 0:void 0;if($&&!Z)throw Error(E0(80,$));this.store.setOpen(!0,M0(G0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,M0(G0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function bI(){return new VF}var G7=O(d(),1);function DF({...$}){return G7.jsx(m3.Root,{"data-slot":"popover",...$})}function qF({...$}){return G7.jsx(m3.Trigger,{"data-slot":"popover-trigger",...$})}function MF({className:$,align:Z="center",alignOffset:H=0,disableAnchorTracking:B=!1,positionMethod:J="absolute",side:Q="bottom",sideOffset:X=4,keepMounted:z=!1,container:G,...F}){return G7.jsx(m3.Portal,{keepMounted:z,container:G,children:G7.jsx(m3.Positioner,{align:Z,alignOffset:H,disableAnchorTracking:B,positionMethod:J,side:Q,sideOffset:X,className:"isolate z-50",children:G7.jsx(m3.Popup,{"data-slot":"popover-content",className:s("z-50 flex w-72 origin-(--transform-origin) flex-col gap-3 rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...F})})})}function yI({className:$,...Z}){return G7.jsx("div",{"data-slot":"popover-header",className:s("flex flex-col gap-0.5 text-sm",$),...Z})}var RF=O(g(),1);var p3={};j4(p3,{Value:()=>fI,Track:()=>cI,Thumb:()=>nI,Root:()=>vI,Indicator:()=>oI,Control:()=>pI});var g5=O(g(),1);var hI=O(g(),1);function PF($,Z){let H=hI.useRef($),B=Y0(Z);U0(()=>{if(H.current===$)return;B(H.current)},[$,B]),U0(()=>{H.current=$},[$])}function m2($,Z=Number.MIN_SAFE_INTEGER,H=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,H))}function _L($,Z,H=(B,J)=>B===J){return $.length===Z.length&&$.every((B,J)=>H(B,Z[J]))}function _F($,Z){return $-Z}function xI($,Z,H){let B=$.slice();return B[Z]=H,B.sort(_F)}function OF($,Z,H,B,J,Q){let X=$;if(X=m2(X,H,B),J)X=xI(Q,Z,m2(X,Q[Z-1]||-1/0,Q[Z+1]||1/0));return X}function jF($,Z,H){if(!Array.isArray($))return!0;let B=$.reduce((J,Q,X,z)=>{if(X===z.length-1)return J;return J.push(Math.abs(Q-z[X+1])),J},[]);return Math.min(...B)>=Z*H}var X8={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...x2};var TF=O(g(),1),OL=TF.createContext(void 0);function V9(){let $=TF.useContext(OL);if($===void 0)throw Error(E0(62));return $}var jL=O(d(),1);function j00($){return"key"in $?G0.keyboard:G0.inputChange}function T00($,Z){if(typeof $==="number"&&typeof Z==="number")return $===Z;if(Array.isArray($)&&Array.isArray(Z))return _L($,Z);return!1}var vI=g5.forwardRef(function(Z,H){let{"aria-labelledby":B,className:J,defaultValue:Q,disabled:X=!1,id:z,format:G,largeStep:F=10,locale:U,render:Y,max:K=100,min:W=0,minStepsBetweenValues:N=0,name:L,onValueChange:V,onValueCommitted:A,orientation:D="horizontal",step:q=1,thumbCollisionBehavior:_="push",thumbAlignment:M="center",value:P,...C}=Z,R=H1(z),y=Y0(V),w=Y0(A),{clearErrors:h}=s4(),{state:E,disabled:I,name:j,setTouched:S,setDirty:k,validityData:b,shouldValidateOnChange:v,validation:c}=h5(),{labelId:T}=N2(),e=B??T,Z0=I||X,x=j??L,[t,D0]=t4({controlled:P,default:Q??W,name:"Slider"}),p=g5.useRef(null),X0=g5.useRef(null),K0=g5.useRef([]),Q0=g5.useRef(null),z0=g5.useRef(null),L0=g5.useRef(-1),i=g5.useRef(null),B0=g5.useRef(null),$0=g5.useRef("none"),J0=w5(G),[n,f]=g5.useState(-1),[l,m]=g5.useState(-1),[a,o]=g5.useState(!1),[V0,O0]=g5.useState(()=>new Map),[k0,r0]=g5.useState([void 0,void 0]),u=Y0((R0)=>{if(f(R0),R0!==-1)m(R0)});D$({id:R,commit:c.commit,value:t,controlRef:X0,name:x,getValue:()=>t}),PF(t,()=>{if(h(x),v())c.commit(t);else c.commit(t,!0);let R0=b.initialValue,d0;if(Array.isArray(t)&&Array.isArray(R0))d0=!_L(t,R0);else d0=t!==R0;k(d0)});let r=Y0((R0)=>{if(R0)X0.current=R0}),H0=Array.isArray(t),A0=g5.useMemo(()=>{if(!H0)return[m2(t,W,K)];return t.slice().sort(_F)},[K,W,H0,t]),j0=Y0((R0,d0)=>{if(Number.isNaN(R0)||T00(R0,t))return;let p0=d0??M0(G0.none,void 0,void 0,{activeThumbIndex:-1});$0.current=p0.reason;let t0=p0.event,b0=new(t0.constructor??Event)(t0.type,t0);if(Object.defineProperty(b0,"target",{writable:!0,value:{value:R0,name:x}}),p0.event=b0,B0.current=R0,y(R0,p0),p0.isCanceled)return;D0(R0)}),v0=Y0((R0,d0,p0)=>{let t0=OF(R0,d0,W,K,H0,A0);if(jF(t0,q,N)){let N0=j00(p0);j0(t0,M0(N0,p0.nativeEvent,void 0,{activeThumbIndex:d0})),S(!0);let b0=B0.current??t0;w(b0,aQ(N0,p0.nativeEvent))}});if(U0(()=>{let R0=Z5(m0(p.current));if(Z0&&R0&&p.current?.contains(R0))R0.blur()},[Z0]),Z0&&n!==-1)u(-1);let G1=g5.useMemo(()=>({...E,activeThumbIndex:n,disabled:Z0,dragging:a,orientation:D,max:K,min:W,minStepsBetweenValues:N,step:q,values:A0}),[E,n,Z0,a,K,W,N,D,q,A0]),K1=g5.useMemo(()=>({active:n,controlRef:X0,disabled:Z0,dragging:a,validation:c,formatOptionsRef:J0,handleInputChange:v0,indicatorPosition:k0,inset:M!=="center",labelId:e,largeStep:F,lastUsedThumbIndex:l,lastChangedValueRef:B0,lastChangeReasonRef:$0,locale:U,max:K,min:W,minStepsBetweenValues:N,name:x,onValueCommitted:w,orientation:D,pressedInputRef:Q0,pressedThumbCenterOffsetRef:z0,pressedThumbIndexRef:L0,pressedValuesRef:i,registerFieldControlRef:r,renderBeforeHydration:M==="edge",setActive:u,setDragging:o,setIndicatorPosition:r0,setValue:j0,state:G1,step:q,thumbCollisionBehavior:_,thumbMap:V0,thumbRefs:K0,values:A0}),[n,X0,e,Z0,a,c,J0,v0,k0,F,l,B0,$0,U,K,W,N,x,w,D,Q0,z0,L0,i,r,u,o,r0,j0,G1,q,_,M,V0,K0,A0]),c0=F0("div",Z,{state:G1,ref:[H,p],props:[{"aria-labelledby":e,id:R,role:"group"},c.getValidationProps,C],stateAttributesMapping:X8});return jL.jsx(OL.Provider,{value:K1,children:jL.jsx(oG,{elementsRef:K0,onMapChange:O0,children:c0})})});var zZ=O(g(),1);var gI=new Map;function C00($,Z){let H=JSON.stringify({locale:$,options:Z}),B=gI.get(H);if(B)return B;let J=new Intl.NumberFormat($,Z);return gI.set(H,J),J}function F7($,Z,H){if($==null)return"";return C00(Z,H).format($)}var fI=zZ.forwardRef(function(Z,H){let{"aria-live":B="off",render:J,className:Q,children:X,...z}=Z,{thumbMap:G,state:F,values:U,formatOptionsRef:Y,locale:K}=V9(),W=zZ.useMemo(()=>{let A="";for(let D of G.values())if(D?.inputId)A+=`${D.inputId} `;return A.trim()===""?void 0:A.trim()},[G]),N=zZ.useMemo(()=>{let A=[];for(let D=0;D<U.length;D+=1)A.push(F7(U[D],K,Y.current??void 0));return A},[Y,K,U]),L=zZ.useMemo(()=>{let A=[];for(let D=0;D<U.length;D+=1)A.push(N[D]||U[D]);return A.join(" – ")},[U,N]);return F0("output",Z,{state:F,ref:H,props:[{"aria-live":B,children:typeof X==="function"?X(N,U):L,htmlFor:W},z],stateAttributesMapping:X8})});var w8=O(g(),1);function CF($){let Z=$.getBoundingClientRect();return{x:(Z.left+Z.right)/2,y:(Z.top+Z.bottom)/2}}function w00($){if(Math.abs($)<1){let H=$.toExponential().split("e-"),B=H[0].split(".")[1];return(B?B.length:0)+parseInt(H[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function wF($,Z,H){let B=Math.round(($-H)/Z)*Z+H;return Number(B.toFixed(w00(Z)))}function TL({values:$,index:Z,nextValue:H,min:B,max:J,step:Q,minStepsBetweenValues:X,initialValues:z}){if($.length===0)return[];let G=$.slice(),F=Q*X,U=G.length-1,Y=z??$,K=B+Z*F,W=J-(U-Z)*F;G[Z]=m2(H,K,W);for(let N=Z+1;N<=U;N+=1){let L=G[N-1]+F,V=J-(U-N)*F,A=Y[N]??G[N],D=Math.max(G[N],L);if(A<D)D=Math.max(A,L);G[N]=m2(D,L,V)}for(let N=Z-1;N>=0;N-=1){let L=G[N+1]-F,V=B+N*F,A=Y[N]??G[N],D=Math.min(G[N],L);if(A>D)D=Math.min(A,L);G[N]=m2(D,V,L)}for(let N=0;N<=U;N+=1)G[N]=Number(G[N].toFixed(12));return G}function mI({behavior:$,values:Z,currentValues:H,initialValues:B,pressedIndex:J,nextValue:Q,min:X,max:z,step:G,minStepsBetweenValues:F}){let U=H??Z,Y=B??Z;if(!(U.length>1))return{value:Q,thumbIndex:0,didSwap:!1};let W=G*F;switch($){case"swap":{let N=U[J],L=0.0000001,V=U.slice(),A=V[J-1],D=V[J+1],q=A!=null?A+W:X,_=D!=null?D-W:z,M=m2(Q,q,_),P=Number(M.toFixed(12));V[J]=P;let C=Q>N,R=Q<N,y=C&&D!=null&&Q>=D-0.0000001,w=R&&A!=null&&Q<=A+0.0000001;if(!y&&!w)return{value:V,thumbIndex:J,didSwap:!1};let h=y?J+1:J-1,E=V.map((k,b)=>{if(b===J)return P;let v=Y[b];if(v!=null)return v;return U[b]}),I=Q;if(y)I=Math.max(Q,V[h]);else I=Math.min(Q,V[h]);let j=TL({values:V,index:h,nextValue:I,min:X,max:z,step:G,minStepsBetweenValues:F,initialValues:E}),S=y?h-1:h+1;if(S>=0&&S<j.length){let k=j[S-1],b=j[S+1],v=k!=null?k+W:X;v=Math.max(v,X+S*W);let c=b!=null?b-W:z;c=Math.min(c,z-(j.length-1-S)*W);let T=m2(P,v,c);j[S]=Number(T.toFixed(12))}return{value:j,thumbIndex:h,didSwap:!0}}case"push":return{value:TL({values:U,index:J,nextValue:Q,min:X,max:z,step:G,minStepsBetweenValues:F}),thumbIndex:J,didSwap:!1};case"none":default:{let N=U.slice(),L=N[J-1],V=N[J+1],A=L!=null?L+W:X,D=V!=null?V-W:z,q=m2(Q,A,D);return N[J]=Number(q.toFixed(12)),{value:N,thumbIndex:J,didSwap:!1}}}}var E00=2;function S00($,Z){if(!$)return{start:0,end:0};function H(Q){let X=Q!=null?parseFloat(Q):0;return Number.isNaN(X)?0:X}let B=!Z?"InlineStart":"Top",J=!Z?"InlineEnd":"Bottom";return{start:H($[`border${B}Width`])+H($[`padding${B}`]),end:H($[`border${J}Width`])+H($[`padding${J}`])}}function EF($,Z){if(Z.current!=null&&$.changedTouches){let H=$;for(let B=0;B<H.changedTouches.length;B+=1){let J=H.changedTouches[B];if(J.identifier===Z.current)return{x:J.clientX,y:J.clientY}}return null}return{x:$.clientX,y:$.clientY}}var pI=w8.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{disabled:X,dragging:z,validation:G,inset:F,lastChangedValueRef:U,lastChangeReasonRef:Y,max:K,min:W,minStepsBetweenValues:N,onValueCommitted:L,orientation:V,pressedInputRef:A,pressedThumbCenterOffsetRef:D,pressedThumbIndexRef:q,pressedValuesRef:_,registerFieldControlRef:M,renderBeforeHydration:P,setActive:C,setDragging:R,setValue:y,state:w,step:h,thumbCollisionBehavior:E,thumbRefs:I,values:j}=V9(),S=r4(),k=j.length>1,b=V==="vertical",v=w8.useRef(null),c=w8.useRef(null),T=Y0((J0)=>{if(J0&&c.current==null){if(c.current==null)c.current=getComputedStyle(J0)}}),e=w8.useRef(null),Z0=w8.useRef(0),x=w8.useRef(0),t=w5(j),D0=Y0((J0)=>{if(q.current!==J0)q.current=J0;let n=I.current[J0];if(!n){D.current=null,A.current=null;return}A.current=n.querySelector('input[type="range"]')}),p=Y0((J0)=>{let n=v.current;if(!n)return null;let{width:f,height:l,bottom:m,left:a,right:o}=n.getBoundingClientRect(),V0=S00(c.current,b),O0=x.current,k0=(b?l:f)-V0.start-V0.end-O0*2,r0=D.current??0,u=J0.x-r0,r=J0.y-r0,H0=b?m-r-V0.end:(S==="rtl"?o-u:u-a)-V0.start,A0=m2((H0-O0)/k0,0,1),j0=(K-W)*A0+W;if(j0=wF(j0,h,W),j0=m2(j0,W,K),!k)return{value:j0,thumbIndex:0,didSwap:!1};let v0=q.current;if(v0<0)return null;let G1=mI({behavior:E,values:j,currentValues:t.current??j,initialValues:_.current,pressedIndex:v0,nextValue:j0,min:W,max:K,step:h,minStepsBetweenValues:N});if(E==="swap"&&G1.didSwap)D0(G1.thumbIndex);else q.current=G1.thumbIndex;return G1}),X0=Y0((J0)=>{_.current=k?j.slice():null,t.current=j;let n=q.current,f=n;if(n>-1&&n<j.length){if(j[n]===K){let l=n;while(l>0&&j[l-1]===K)l-=1;f=l}}else{let l=!b?"x":"y",m;f=-1;for(let a=0;a<I.current.length;a+=1){let o=I.current[a];if(T1(o)){let V0=CF(o),O0=Math.abs(J0[l]-V0[l]);if(m===void 0||O0<=m)f=a,m=O0}}}if(f>-1&&f!==n)D0(f);if(F){let l=I.current[f];if(T1(l)){let m=l.getBoundingClientRect(),a=!b?"width":"height";x.current=m[a]/2}}}),K0=Y0((J0)=>{I.current?.[J0]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),Q0=Y0((J0)=>{let n=EF(J0,e);if(n==null)return;if(Z0.current+=1,J0.type==="pointermove"&&J0.buttons===0){z0(J0);return}let f=p(n);if(f==null)return;if(jF(f.value,h,N)){if(!z&&Z0.current>E00)R(!0);if(y(f.value,M0(G0.drag,J0,void 0,{activeThumbIndex:f.thumbIndex})),t.current=Array.isArray(f.value)?f.value:[f.value],f.didSwap)K0(f.thumbIndex)}});function z0(J0){C(-1),R(!1),A.current=null,D.current=null;let n=EF(J0,e),f=n!=null?p(n):null;if(f!=null){let l=Y.current;G.commit(U.current??f.value),L(U.current??f.value,aQ(l,J0))}if("pointerType"in J0&&v.current?.hasPointerCapture(J0.pointerId))v.current?.releasePointerCapture(J0.pointerId);q.current=-1,e.current=null,_.current=null,i()}let L0=Y0((J0)=>{if(X)return;let n=J0.changedTouches[0];if(n!=null)e.current=n.identifier;let f=EF(J0,e);if(f!=null){X0(f);let m=p(f);if(m==null)return;if(K0(m.thumbIndex),y(m.value,M0(G0.trackPress,J0,void 0,{activeThumbIndex:m.thumbIndex})),t.current=Array.isArray(m.value)?m.value:[m.value],m.didSwap)K0(m.thumbIndex)}Z0.current=0;let l=m0(v.current);l.addEventListener("touchmove",Q0,{passive:!0}),l.addEventListener("touchend",z0,{passive:!0})}),i=Y0(()=>{let J0=m0(v.current);J0.removeEventListener("pointermove",Q0),J0.removeEventListener("pointerup",z0),J0.removeEventListener("touchmove",Q0),J0.removeEventListener("touchend",z0),_.current=null}),B0=U4();return w8.useEffect(()=>{let J0=v.current;if(!J0)return()=>i();return J0.addEventListener("touchstart",L0,{passive:!0}),()=>{J0.removeEventListener("touchstart",L0),B0.cancel(),i()}},[i,L0,v,B0]),w8.useEffect(()=>{if(X)i()},[X,i]),F0("div",Z,{state:w,ref:[H,M,v,T],props:[{["data-base-ui-slider-control"]:P?"":void 0,onPointerDown(J0){let n=v.current;if(!n||X||J0.defaultPrevented||!T1(J0.target)||J0.button!==0)return;let f=EF(J0,e);if(f!=null){X0(f);let m=p(f);if(m==null)return;if(f0(I.current[m.thumbIndex],Z5(m0(n))))J0.preventDefault();else B0.request(()=>{K0(m.thumbIndex)});if(R(!0),D.current==null){if(y(m.value,M0(G0.trackPress,J0.nativeEvent,void 0,{activeThumbIndex:m.thumbIndex})),t.current=Array.isArray(m.value)?m.value:[m.value],m.didSwap)K0(m.thumbIndex)}}if(J0.nativeEvent.pointerId)n.setPointerCapture(J0.nativeEvent.pointerId);Z0.current=0;let l=m0(v.current);l.addEventListener("pointermove",Q0,{passive:!0}),l.addEventListener("pointerup",z0,{once:!0})},tabIndex:-1},Q],stateAttributesMapping:X8})});var uI=O(g(),1);var cI=uI.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{state:X}=V9();return F0("div",Z,{state:X,ref:H,props:[{style:{position:"relative"}},Q],stateAttributesMapping:X8})});var M4=O(g(),1);function mB($,Z,H){return($-Z)*100/(H-Z)}var SF=O(g(),1),I00=SF.createContext(void 0),R00={disableStyleElements:!1};function dI(){return SF.useContext(I00)??R00}var lI=function($){return $.index="data-index",$.dragging="data-dragging",$.orientation="data-orientation",$.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.focused="data-focused",$}({});var iI='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();';var pB=O(d(),1),rI="PageUp",aI="PageDown",k00=new Set([gH,fH,mH,pH,uH,cH,rI,aI]);function b00($,Z,H,B){if(Z<0)return;if($.length===2){if(Z===0)return`${F7($[Z],B,H)} start range`;return`${F7($[Z],B,H)} end range`}return H?F7($[Z],B,H):void 0}function GZ($,Z,H,B,J){return H===1?Math.min($+Z,J):Math.max($-Z,B)}var nI=M4.forwardRef(function(Z,H){let{render:B,children:J,className:Q,"aria-describedby":X,"aria-label":z,"aria-labelledby":G,disabled:F=!1,getAriaLabel:U,getAriaValueText:Y,id:K,index:W,inputRef:N,onBlur:L,onFocus:V,onKeyDown:A,tabIndex:D,...q}=Z,{nonce:_}=dI(),M=H1(K),{active:P,lastUsedThumbIndex:C,controlRef:R,disabled:y,validation:w,formatOptionsRef:h,handleInputChange:E,inset:I,labelId:j,largeStep:S,locale:k,max:b,min:v,minStepsBetweenValues:c,name:T,orientation:e,pressedInputRef:Z0,pressedThumbCenterOffsetRef:x,pressedThumbIndexRef:t,renderBeforeHydration:D0,setActive:p,setIndicatorPosition:X0,state:K0,step:Q0,values:z0}=V9(),L0=r4(),i=F||y,B0=z0.length>1,$0=e==="vertical",J0=L0==="rtl",{setTouched:n,setFocused:f,validationMode:l}=h5(),m=M4.useRef(null),a=M4.useRef(null),o=H1(),V0=V$(),O0=B0?o:V0,k0=M4.useMemo(()=>({inputId:O0}),[O0]),{ref:r0,index:u}=q4({metadata:k0}),r=!B0?0:W??u,H0=r===z0.length-1,A0=z0[r],j0=mB(A0,v,b),[v0,G1]=M4.useState(!1),[K1,c0]=M4.useState();S2(()=>G1(!0));let R0=C>=0&&C<z0.length?C:-1,d0=Y0(()=>{let C0=R.current,I0=m.current;if(!C0||!I0)return;let g0=I0.getBoundingClientRect(),$1=C0.getBoundingClientRect(),l0=$0?"height":"width",L1=$1[l0]-g0[l0],c1=(g0[l0]/2+L1*j0/100)/$1[l0]*100;if(c0(c1),r===0)X0((M1)=>[c1,M1[1]]);else if(H0)X0((M1)=>[M1[0],c1])});U0(()=>{if(I)queueMicrotask(d0)},[d0,I]),U0(()=>{if(I)d0()},[d0,I,j0]);let p0=M4.useCallback(()=>{let C0=$0?"bottom":"insetInlineStart",I0=$0?"left":"top",g0;if(B0){if(P===r)g0=2;else if(R0===r)g0=1}else if(P===r)g0=1;if(!I){if(!Number.isFinite(j0))return K8;return{position:"absolute",[C0]:`${j0}%`,[I0]:"50%",translate:`${($0||!J0?-1:1)*50}% ${($0?1:-1)*50}%`,zIndex:g0}}return{["--position"]:`${K1}%`,visibility:D0&&!v0||K1===void 0?"hidden":void 0,position:"absolute",[C0]:"var(--position)",[I0]:"50%",translate:`${($0||!J0?-1:1)*50}% ${($0?1:-1)*50}%`,zIndex:g0}},[P,r,I,v0,K1,B0,D0,J0,R0,j0,$0]),t0;if(e==="vertical")t0=J0?"vertical-rl":"vertical-lr";let N0=W4({"aria-label":typeof U==="function"?U(r):z,"aria-labelledby":G??j,"aria-describedby":X,"aria-orientation":e,"aria-valuenow":A0,"aria-valuetext":typeof Y==="function"?Y(F7(A0,k,h.current??void 0),A0,r):b00(z0,r,h.current??void 0,k),disabled:i,id:O0,max:b,min:v,name:T,onChange(C0){E(C0.target.valueAsNumber,r,C0)},onFocus(){p(r),f(!0)},onBlur(){if(!m.current)return;if(p(-1),n(!0),f(!1),l==="onBlur")w.commit(OF(A0,r,v,b,B0,z0))},onKeyDown(C0){if(!k00.has(C0.key))return;if(Y3.has(C0.key))C0.stopPropagation();let I0=null,g0=wF(A0,Q0,v);switch(C0.key){case gH:I0=GZ(g0,C0.shiftKey?S:Q0,1,v,b);break;case pH:I0=GZ(g0,C0.shiftKey?S:Q0,J0?-1:1,v,b);break;case fH:I0=GZ(g0,C0.shiftKey?S:Q0,-1,v,b);break;case mH:I0=GZ(g0,C0.shiftKey?S:Q0,J0?1:-1,v,b);break;case rI:I0=GZ(g0,S,1,v,b);break;case aI:I0=GZ(g0,S,-1,v,b);break;case cH:if(I0=b,B0)I0=Number.isFinite(z0[r+1])?z0[r+1]-Q0*c:b;break;case uH:if(I0=v,B0)I0=Number.isFinite(z0[r-1])?z0[r-1]+Q0*c:v;break;default:break}if(I0!==null)E(I0,r,C0),C0.preventDefault()},step:Q0,style:{...K8,width:"100%",height:"100%",writingMode:t0},tabIndex:D??void 0,type:"range",value:A0??""},w.getInputValidationProps),b0=C4(a,w.inputRef,N);return F0("div",Z,{state:K0,ref:[H,r0,m],props:[{[lI.index]:r,children:pB.jsxs(M4.Fragment,{children:[J,pB.jsx("input",{ref:b0,...N0}),I&&!v0&&D0&&H0&&pB.jsx("script",{nonce:_,dangerouslySetInnerHTML:{__html:iI},suppressHydrationWarning:!0})]}),id:M,onBlur:L,onFocus:V,onPointerDown(C0){if(t.current=r,m.current!=null){let I0=e==="horizontal"?"x":"y",g0=CF(m.current),$1=(e==="horizontal"?C0.clientX:C0.clientY)-g0[I0];x.current=$1}if(a.current!=null&&Z0.current!==a.current)Z0.current=a.current},style:p0(),suppressHydrationWarning:D0||void 0,tabIndex:-1},q],stateAttributesMapping:X8})});var IF=O(g(),1);function y00($,Z,H,B,J,Q){let X=H===void 0||Z&&B===void 0?"hidden":void 0,z=$?"bottom":"insetInlineStart",G=$?"height":"width",U={visibility:J&&!Q?"hidden":X,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(U["--start-position"]=`${H??0}%`,!Z)return U[z]=0,U[G]="var(--start-position)",U;return U["--relative-size"]=`${(B??0)-(H??0)}%`,U[z]="var(--start-position)",U[G]="var(--relative-size)",U}function h00($,Z,H,B){let J=$?"bottom":"insetInlineStart",Q=$?"height":"width",z={position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(!Z)return z[J]=0,z[Q]=`${H}%`,z;let G=B-H;return z[J]=`${H}%`,z[Q]=`${G}%`,z}var oI=IF.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{indicatorPosition:X,inset:z,max:G,min:F,orientation:U,renderBeforeHydration:Y,state:K,values:W}=V9(),[N,L]=IF.useState(!1);S2(()=>L(!0));let V=U==="vertical",A=W.length>1,D=z?y00(V,A,X[0],X[1],Y,N):h00(V,A,mB(W[0],F,G),mB(W[W.length-1],F,G));return F0("div",Z,{state:K,ref:H,props:[{["data-base-ui-slider-indicator"]:Y?"":void 0,style:D,suppressHydrationWarning:Y||void 0},Q],stateAttributesMapping:X8})});var U7=O(d(),1);function sI({children:$,className:Z,defaultValue:H,value:B,min:J=0,max:Q=100,...X}){let[z,G]=RF.useState(!1),F=Array.isArray(B)?B:Array.isArray(H)?H:[J,Q];return RF.useEffect(()=>{let U=requestAnimationFrame(()=>G(!0));return()=>cancelAnimationFrame(U)},[]),U7.jsx(p3.Root,{className:s("data-horizontal:w-full data-vertical:h-full",Z),"data-slot":"slider",defaultValue:H,value:B,min:J,max:Q,thumbAlignment:"edge",...X,children:U7.jsxs(p3.Control,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[U7.jsx(p3.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:U7.jsx(p3.Indicator,{"data-slot":"slider-range",className:s("bg-primary select-none data-horizontal:h-full data-vertical:w-full",z&&"transition-[width] duration-150 ease-in-out")})}),$,Array.from({length:F.length},(U,Y)=>U7.jsx(p3.Thumb,{"data-slot":"slider-thumb",className:s("relative block size-3 shrink-0 cursor-ew-resize rounded-full border border-ring bg-white ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50",z&&"transition-[inset-inline-start,color,box-shadow] duration-150 ease-in-out")},Y))]})})}var Y1=O(d(),1);function x00($){return $?.split(/\s*·\s*/)[0]??""}function tI($){return x00($.description)||$.displayName}function v00($){return $.charAt(0).toUpperCase()+$.slice(1)}function g00($){return $==="xhigh"?"Extra":v00($)}function eI($){return typeof $==="number"?$:$[0]??0}var $R={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},ZR={type:"spring",duration:0.3,delay:0.1,bounce:0};function BR({label:$,leadingIcon:Z,className:H,...B}){return Y1.jsxs(T0,{...B,variant:"ghost",className:s("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",H),children:[Z,Y1.jsx("span",{className:"truncate font-normal",children:$})]})}function f00({current:$,model:Z,models:H,onValueChange:B}){let J=tI(Z),Q=NS(H,"Models");return Y1.jsxs($Z,{children:[Y1.jsx(ZZ,{render:Y1.jsx(BR,{label:J,className:"shrink","aria-label":`Model: ${J}`})}),Y1.jsx(HZ,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:Y1.jsx(XI,{value:$,onValueChange:B,children:Q.map((X)=>Y1.jsxs(BZ,{children:[Y1.jsx(KF,{children:X.label}),X.models.map((z)=>Y1.jsx(zI,{value:z.value,closeOnClick:!0,children:tI(z)},z.value))]},X.label))})})]})}function m00({currentEffort:$,effortLevels:Z,fastMode:H,showFastMode:B,onFastModeChange:J,onValueChange:Q}){let X=US(Z,$),[z,G]=FZ.useState(!1),[F,U]=FZ.useState(X),[Y,K]=FZ.useState(!1),N=Z[z?F:X]??$,L=g00(N),V=(D)=>{if(D)U(X);else K(!1);G(D)},A=(D)=>{let q=Z[D];if(q&&q!==$)Q(q)};return Y1.jsxs(DF,{open:z,onOpenChange:V,children:[Y1.jsx(qF,{render:Y1.jsx(BR,{label:L,leadingIcon:H?Y1.jsx(uB,{stroke:1.5}):void 0,"aria-label":`Effort: ${L}`})}),Y1.jsxs(MF,{align:"end",side:"top",className:"w-64",disableAnchorTracking:!0,children:[Y1.jsx(yI,{className:"relative h-5 flex-row items-center",children:Y1.jsx($4,{mode:"popLayout",initial:!1,children:Y?Y1.jsxs(B5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:$R,initial:"from",animate:"to",exit:"from",transition:ZR,children:[Y1.jsx("span",{children:"Faster"}),Y1.jsx("span",{children:"Smarter"})]},"range"):Y1.jsxs(B5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:$R,initial:"from",animate:"to",exit:"from",transition:ZR,children:[Y1.jsxs("div",{className:"flex items-center gap-1",children:[Y1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),Y1.jsx("output",{"aria-live":"polite",children:L})]}),B&&Y1.jsxs(y1,{children:[Y1.jsx(h1,{render:Y1.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":H?"Turn off Fast mode":"Turn on Fast mode","aria-pressed":H,onClick:()=>J(!H),className:"-my-1 -mr-1",children:H?Y1.jsx(HR,{className:"text-primary"}):Y1.jsx(uB,{className:"text-muted-foreground",stroke:1.5})})}),Y1.jsxs(x1,{align:"center",className:"flex-col gap-0",children:[Y1.jsx("span",{children:"Fast mode"}),Y1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})]},"effort")})}),Y1.jsxs("label",{className:"block",children:[Y1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),Y1.jsx(sI,{value:F,min:0,max:Z.length-1,step:1,onPointerDown:(D)=>{if(D.button===0)K(!0)},onPointerCancel:()=>K(!1),onValueChange:(D)=>U(eI(D)),onValueCommitted:(D)=>{K(!1),A(eI(D))},className:s("**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm","**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:border-0 **:data-[slot=slider-thumb]:bg-card **:data-[slot=slider-thumb]:shadow-xs **:data-[slot=slider-thumb]:ring-0"),children:Y1.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:Z.length},(D,q)=>Y1.jsx("span",{className:s("size-1 rounded-full",q<=F?"bg-primary-foreground/30":"bg-foreground/30")},q))})})]})]})]})}var JR=FZ.memo(function({sessionId:Z}){let{workspaceId:H,layout:B,setLayout:J}=K5(),{data:Q}=N9(H),X=Q?.models??[],z=X.find((y)=>y.value==="default"),G=Q?WS(X.filter((y)=>y.value!=="default"),Q.provider):[],F=xG(H,Z).data,U=GS(H),Y=(Z?F?.model:void 0)??B.selectedModel,K=(Z?F?.effort:void 0)??B.selectedEffort,W=(Z?F?.fastMode:void 0)??B.selectedFastMode,N=(y)=>{if(Z)U.mutate({sessionId:Z,patch:{model:y}});else J({selectedModel:y})},L=(y)=>{if(Z)U.mutate({sessionId:Z,patch:{effort:y}});else J({selectedEffort:y})},V=(y)=>{if(Z)U.mutate({sessionId:Z,patch:{fastMode:y}});else J({selectedFastMode:y})};if(G.length===0)return null;let A=G.some((y)=>y.value===Y)?Y:void 0,D=G.find((y)=>z?.resolvedModel&&y.resolvedModel===z.resolvedModel)??G[0],q=A??D.value,_=G.find((y)=>y.value===q)??G[0],M=_.supportsEffort?_.supportedEffortLevels??[]:[],P=ZL(M,K,_.defaultEffort),C=YS(M)&&P!==void 0,R=KS(_,W);return Y1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[Y1.jsx(f00,{current:q,model:_,models:G,onValueChange:N}),C&&Y1.jsx(m00,{currentEffort:P,effortLevels:M,fastMode:R,showFastMode:_.supportsFastMode===!0,onFastModeChange:V,onValueChange:L},_.value)]})});var X1=O(d(),1);function XR({composerRef:$,onSend:Z,onStop:H,processing:B,sessionId:J,modelSessionId:Q,availability:X,annotation:z,onRemoveDrawing:G,allowFiles:F=!0,placeholder:U,draft:Y}){let K=UZ.useRef(null),W=H5(),N=j5((j)=>j.composerDrafts[W]??""),L=j5((j)=>Y?(j.viewBuilderDrafts??{})[Y.id]:void 0),V=Y?L??Y.initialValue:N,A=UZ.useRef(V);A.current=V;let D=_2((j)=>j.attachments[e2(W,J)]??p00),[q,_]=UZ.useState(!1),M=D.some((j)=>j.status==="uploading"),P=D.some((j)=>j.status==="ready"||j.status==="draft"),C=V.trim().length>0||P,R=bB(C,M,X),y=(j)=>{if(A.current=j,Y)Y.onChange(j);else j5.getState().setComposerDraft(W,j)},w=(j)=>{if(F)TE({workspaceId:W,sessionId:J},j)},h=UZ.useRef(!1),E=(j)=>{if(j.kind==="drawing"&&G){G(j.localId);return}E1.getState().removeAttachment(W,J,j.localId)},I=async()=>{if(!R||h.current)return;h.current=!0;try{if(await z?.finish(),await Z(A.current),!Y)A.current="",j5.getState().setComposerDraft(W,"")}finally{h.current=!1}};return X1.jsxs(EE,{composerRef:$,onSubmit:(j)=>{j.preventDefault(),I()},onDragOver:(j)=>{if(!j.dataTransfer.types.includes("Files"))return;if(j.preventDefault(),F)_(!0)},onDragLeave:(j)=>{if(!F)return;if(j.currentTarget.contains(j.relatedTarget))return;_(!1)},onDrop:(j)=>{if(!j.dataTransfer.types.includes("Files"))return;j.preventDefault(),_(!1),w(Array.from(j.dataTransfer.files))},className:s(q&&"ring-2 ring-ring/60"),children:[D.length>0&&X1.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:D.map((j)=>X1.jsx(u00,{attachment:j,onRemove:()=>E(j)},j.localId))}),X1.jsx(SE,{textareaRef:$,id:"chat-input",name:"message",value:V,onChange:(j)=>y(j.target.value),onKeyDown:(j)=>{if(j.key==="Enter"&&!j.shiftKey)j.preventDefault(),I()},onPaste:(j)=>{let S=Array.from(j.clipboardData?.files??[]);if(S.length===0)return;j.preventDefault(),w(S)},placeholder:B?"Queue a follow-up":U??"Do anything",rows:1}),X1.jsxs(IE,{children:[F&&X1.jsx("input",{ref:K,type:"file",multiple:!0,hidden:!0,onChange:(j)=>{w(Array.from(j.target.files??[])),j.target.value=""}}),X1.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[F&&X1.jsxs(y1,{children:[X1.jsx(h1,{render:X1.jsx(T0,{type:"button",variant:"ghost",size:"icon",onClick:()=>K.current?.click(),"aria-label":"Attach files",children:X1.jsx(kF,{stroke:1.6,className:"size-4.5!"})})}),X1.jsx(x1,{children:"Attach files"})]}),z&&X1.jsxs(y1,{children:[X1.jsx(h1,{render:X1.jsx(T0,{type:"button",variant:"ghost",size:"icon",onClick:z.onToggle,className:s(z.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":z.active,children:X1.jsx(cB,{stroke:1.5})})}),X1.jsx(x1,{children:"Draw annotation"})]})]}),X1.jsx(JR,{sessionId:Q}),B?X1.jsxs(y1,{children:[X1.jsx(h1,{render:X1.jsx(T0,{type:"button",size:"icon",onClick:H,"aria-label":"Stop agent",children:X1.jsx(QR,{})})}),X1.jsx(x1,{children:"Stop answering"})]}):X1.jsx(RE,{label:"Send message",hasContent:C,busy:M,availability:X})]})]})}var p00=[];function u00({attachment:$,onRemove:Z}){if($.kind==="drawing")return X1.jsx(c00,{attachment:$,onRemove:Z});let{name:H,previewUrl:B,status:J,error:Q}=$,X=!!B;return X1.jsxs("div",{className:s("group relative flex items-center gap-2 overflow-hidden rounded-lg bg-accent text-accent-foreground ring-1 ring-border",X?"size-14":"h-10 max-w-52 pr-2 pl-2",J==="error"&&"border-destructive/50"),title:Q??H,children:[X?X1.jsx("img",{src:B,alt:H,className:"size-full object-cover"}):X1.jsxs(X1.Fragment,{children:[X1.jsx(YZ,{size:16,stroke:1.75,className:"shrink-0 text-muted-foreground"}),X1.jsx("span",{className:"truncate text-xs",children:H})]}),J==="uploading"&&X1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:X1.jsx(I5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),J==="error"&&X1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-destructive/10 text-[10px] text-destructive",children:"Failed"}),X1.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${H}`,className:"absolute top-0.5 right-0.5 size-4 rounded-full bg-primary/70 text-primary-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-primary/80 [&_svg]:size-3",children:X1.jsx(S5,{stroke:1.75})})]})}function c00({attachment:$,onRemove:Z}){let{previewUrl:H,purpose:B}=$,J=B==="sketch"?"Sketch":"Annotation";return X1.jsxs(BS,{children:[X1.jsxs(JS,{render:X1.jsx("div",{tabIndex:0,className:"group flex h-7 cursor-default items-center rounded-md bg-background pr-2 pl-0.5 text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),children:[X1.jsxs(T0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${J.toLowerCase()}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[X1.jsx(cB,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),X1.jsx(S5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}),X1.jsx("span",{children:J})]}),H&&X1.jsx(QS,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)]",children:X1.jsx("img",{src:H,alt:`${J} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var Y7=O(d(),1);function CL({className:$,prompt:Z,disabled:H=!1,onSelect:B}){let J=Z.icon;return Y7.jsxs(T0,{type:"button",size:"sm",disabled:H,onClick:()=>B(Z),className:s("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[Y7.jsx(J,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),Y7.jsx("span",{children:Z.label})]})}function zR({prompts:$,disabled:Z=!1,onSelect:H}){return Y7.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 @md:grid-cols-3",children:$.map((B,J)=>{return Y7.jsx(CL,{prompt:B,disabled:Z,onSelect:H,className:s("h-full w-fit @md:w-full",J===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",J===1&&"@md:-rotate-1",J===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},B.prompt)})})}var t1=O(d(),1),wL="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",d00=[{label:"Check the weather",prompt:"Build me a set of weather widgets that surface current conditions, today's hourly forecast, and a simple weekly outlook at a glance",context:["Build this onboarding example immediately without asking follow-up questions.","Create three separate widgets: current conditions, today's hourly forecast, and a seven-day outlook.","Use one shared Open-Meteo server function with no API key and use Berlin as the default location.","Give each widget an appropriate grid size and a compact, visually distinct layout with loading, error, and last-updated states.","Bundle all three widgets, smoke-test the shared weather function, and check runtime logs before finishing.",wL],icon:FR},{label:"Track my finances",prompt:"Build me a personal finance view for tracking income, expenses, monthly budgets, spending trends, and savings, with an agent action that can add sample transactions",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services or bank connections.","Create a responsive View with a month selector, income, spending, and savings summaries, an income-versus-spending trend, category breakdowns, budget progress, and recent transactions.","Support adding, editing, and deleting income and expense transactions, categories, and monthly category budgets.","Persist transactions, categories, and budgets in a workspace-local SQLite database accessed through server functions. Store monetary amounts as integer cents and seed realistic sample data only when the database is empty.","Add an “Add with agent” action that imports `sendChatMessage` from `moi` and sends a concise request for the agent to generate and insert a realistic batch of sample transactions into the same database.","Provide a small documented workspace script the agent can use to validate and append transactions safely, then refresh the View data after the agent updates the database.","Include loading, empty, and error states, then bundle the View and smoke-test its SQLite persistence and transaction mutations before finishing.",wL],icon:UR},{label:"Build a playful synthesizer",prompt:"Build me a view with a simple, playful synthesizer featuring a keyboard, five sound controls, and the ability to record, save, and load music files from the workspace",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services.","Create a responsive View that uses the browser's audio capabilities, with an onscreen piano and computer-keyboard controls.","Include five clearly labeled sound controls for waveform, attack, release, filter cutoff, and volume.","Let the user record timed note events, play and stop recordings, give them names, and save and load them as JSON music files in a workspace music folder.","Include clear empty and error states, then bundle the View and check runtime logs before finishing.",wL],icon:bF}],l00={label:"Explore the workspace",prompt:"Explore this workspace and suggest what moi can build based on its content",context:["Explore the existing workspace files before making suggestions.","Briefly explain what the workspace appears to be for and which content informed your ideas.","Propose a focused set of useful widgets or views that fit the work already here.","Wait for me to choose before building anything."],icon:GR};function YR({isViewBuilderDraft:$,hasSentMessageFromMoi:Z,isWorkspacePendingAnalysis:H}){if($)return"view-builder";if(!Z)return"welcome";if(H)return"explore-workspace";return"empty"}function KR({agent:$,kind:Z,hasWorkspaceApplets:H,disabled:B=!1,onSelectPrompt:J,onNavigate:Q}){switch(Z){case"view-builder":return t1.jsx(i00,{agent:$});case"welcome":return t1.jsx(r00,{agent:$,disabled:B,showExamples:!H,onSelectPrompt:J,onNavigate:Q});case"explore-workspace":return t1.jsx(a00,{agent:$,disabled:B,onSelectPrompt:J});case"empty":return t1.jsx(n00,{agent:$})}}function yF({agent:$,children:Z,className:H}){return t1.jsxs("div",{className:s("flex flex-1 flex-col items-center justify-center self-center",H),children:[t1.jsx(K9,{preset:$,color:"secondary",expression:"idle",className:"mb-2",animated:!0}),Z]})}function i00({agent:$}){return t1.jsx(yF,{agent:$,className:"text-center text-muted-foreground",children:t1.jsx("p",{className:"mx-auto max-w-xs px-8 text-sm",children:"Describe the content, data, and key actions you need in the view"})})}function r00({agent:$,disabled:Z=!1,showExamples:H=!0,onSelectPrompt:B,onNavigate:J}){return t1.jsx(yF,{agent:$,className:"@container w-full max-w-md min-w-0",children:t1.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[t1.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[t1.jsx("p",{children:"moi is the visual workspace for you and your agent. It grows and adapts to the work you're doing."}),t1.jsxs("p",{children:["Ask agent to build"," ",t1.jsx(EL,{Icon:lB,destination:"widgets",onNavigate:J,children:"Widgets"})," ","that surface information and quick actions, or entire"," ",t1.jsx(EL,{Icon:dB,destination:"views",onNavigate:J,children:"Views"})," ","for more complex tools. Use"," ",t1.jsx(EL,{Icon:iB,destination:"scratchpad",onNavigate:J,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),H&&t1.jsx("p",{children:"Try an example:"})]}),H&&t1.jsx(zR,{prompts:d00,disabled:Z,onSelect:B})]})})}function a00({agent:$,disabled:Z=!1,onSelectPrompt:H}){return t1.jsx(yF,{agent:$,children:t1.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t1.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:t1.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),t1.jsx(CL,{prompt:l00,disabled:Z,onSelect:H})]})})}function n00({agent:$}){return t1.jsx(yF,{agent:$,className:"text-center text-muted-foreground",children:t1.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})})}function EL({Icon:$,children:Z,destination:H,onNavigate:B}){return t1.jsxs("button",{type:"button","data-welcome-destination":H,onClick:()=>B(H),className:"-mx-0.5 inline-flex cursor-pointer items-center gap-0.5 rounded-xs px-0.5 align-bottom font-medium text-foreground hover:bg-accent focus-visible:bg-accent focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",children:[t1.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),Z]})}var rB=O(g(),1);var C1=O(d(),1);function AR({label:$}){return C1.jsx("div",{className:"flex h-7 items-center px-2.5 text-sm font-medium",children:$})}function o00($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function s00({active:$,canArchive:Z,confirmingArchive:H,onArchive:B,onRequestArchive:J,onSelect:Q,session:X,workspaceId:z}){let G=rB.useRef(!1),[F,U]=rB.useState(!1),Y=_2((L)=>yH(L.activity,z,X.sessionId)),K=o00(X);function W(){J(X.sessionId)}async function N(){if(G.current)return;G.current=!0,U(!0);try{await B(X.sessionId)}catch{a4.add({title:"Couldn’t archive chat",type:"error"})}finally{G.current=!1,U(!1)}}return C1.jsxs("div",{className:"group/chat relative",children:[C1.jsx(vB,{className:s("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>Q(X.sessionId),children:C1.jsx("div",{className:s("flex min-w-0 flex-1 overflow-hidden",(Y||F)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!H&&"group-focus-within/chat:mr-4 group-focus-within/chat:mask-r-from-[calc(100%-16px)] group-hover/chat:mr-4 group-hover/chat:mask-r-from-[calc(100%-16px)] [@media(hover:none)]:mr-4 [@media(hover:none)]:mask-r-from-[calc(100%-16px)]",H&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:C1.jsxs("span",{className:s("flex min-w-0 items-baseline gap-1.5",(Y||F)&&"-mr-4",H?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[C1.jsx("span",{className:"min-w-0 truncate",children:X.summary}),K&&C1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:K})]})})}),Y&&C1.jsx(I4,{className:s("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",Z&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(H||F)&&"hidden")}),Z&&C1.jsx("div",{className:s("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!H&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",F&&"opacity-100!"),children:H?C1.jsx(T0,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${X.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:F,onClick:N,onPointerDown:(L)=>L.stopPropagation(),children:"Confirm"}):C1.jsxs(y1,{children:[C1.jsx(h1,{render:C1.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${X.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:F,onClick:W,onPointerDown:(L)=>L.stopPropagation(),children:C1.jsx(NR,{stroke:1.75})})}),C1.jsx(x1,{side:"right",children:"Archive chat"})]})})]})}function t00($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function WR($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function e00($,Z){let H=WR(Z)-WR($);if(H===0)return"Today";if(H===1)return"Yesterday";if(H>=2&&H<=5)return`${H} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function $10($,Z=new Date){let H=new Map;for(let B of $.slice().sort((J,Q)=>Q.lastModified-J.lastModified)){let J=new Date(B.lastModified),Q=t00(J),X=H.get(Q);if(X){X.sessions.push(B);continue}H.set(Q,{key:Q,label:e00(J,Z),sessions:[B]})}return[...H.values()]}function VR({isViewBuilder:$=!1}){if($)return C1.jsx(AR,{label:"Build a new view"});return C1.jsx(Z10,{})}function Z10(){let $=H5(),[Z,H]=U3(),B=Z??null,[J,Q]=rB.useState(null),{data:X=[]}=hG($),z=N9($).data?.supportsArchiving===!0,G=XS($),F=_2((L)=>d_(L.activity,$,B));if(X.length===0)return C1.jsx(AR,{label:"New chat"});let Y=X.find((L)=>L.sessionId===B)?.summary??"New chat",K=$10(X);function W(L){if(!L)Q(null)}async function N(L){Q(null),await G.mutateAsync(L);let V=E1.getState();if(V.clearAttachments($,L),V.clearPreviewsForSession($,L),B===L)H(null)}return C1.jsxs($Z,{onOpenChange:W,children:[C1.jsx(ZZ,{render:C1.jsxs(T0,{className:"group",variant:"ghost",size:"sm",children:[C1.jsx("span",{className:"max-w-64 truncate",children:Y}),F?C1.jsx(I4,{className:"size-4!",stroke:2}):C1.jsx(hF,{className:"text-muted-foreground group-hover:text-foreground",stroke:1.75})]})}),C1.jsxs(HZ,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:[C1.jsxs(vB,{className:"shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!",onClick:()=>H(null),children:[C1.jsx(LR,{size:16,stroke:1.75}),"New chat"]}),K.length>0&&C1.jsxs(C1.Fragment,{children:[C1.jsx(GI,{className:"shrink-0"}),C1.jsx("div",{className:"no-scrollbar flex min-h-0 flex-1 scroll-fade flex-col gap-1 overflow-y-auto overscroll-contain [--scroll-fade-reveal:8px]",children:K.map((L)=>C1.jsxs(BZ,{children:[C1.jsx(KF,{children:L.label}),L.sessions.map((V)=>C1.jsx(s00,{session:V,active:B===V.sessionId,canArchive:z,confirmingArchive:J===V.sessionId,onSelect:H,onArchive:N,onRequestArchive:Q,workspaceId:$},V.sessionId))]},L.key))})]})]})]})}var fv=O(g(),1);function p1(){}function xF(){}function DR($,Z){let H=Z||{};return($[$.length-1]===""?[...$,""]:$).join((H.padRight?" ":"")+","+(H.padLeft===!1?"":" ")).trim()}var H10=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,B10=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J10={};function vF($,Z){return((Z||J10).jsx?B10:H10).test($)}var Q10=/[ \t\n\f\r]/g;function SL($){return typeof $==="object"?$.type==="text"?qR($.value):!1:qR($)}function qR($){return $.replace(Q10,"")===""}class u3{constructor($,Z,H){if(this.normal=Z,this.property=$,H)this.space=H}}u3.prototype.normal={};u3.prototype.property={};u3.prototype.space=void 0;function IL($,Z){let H={},B={};for(let J of $)Object.assign(H,J.property),Object.assign(B,J.normal);return new u3(H,B,Z)}function aB($){return $.toLowerCase()}class O2{constructor($,Z){this.attribute=Z,this.property=$}}O2.prototype.attribute="";O2.prototype.booleanish=!1;O2.prototype.boolean=!1;O2.prototype.commaOrSpaceSeparated=!1;O2.prototype.commaSeparated=!1;O2.prototype.defined=!1;O2.prototype.mustUseProperty=!1;O2.prototype.number=!1;O2.prototype.overloadedBoolean=!1;O2.prototype.property="";O2.prototype.spaceSeparated=!1;O2.prototype.space=void 0;var nB={};j4(nB,{spaceSeparated:()=>e1,overloadedBoolean:()=>gF,number:()=>_0,commaSeparated:()=>c3,commaOrSpaceSeparated:()=>P4,booleanish:()=>f5,boolean:()=>U1});var X10=0,U1=K7(),f5=K7(),gF=K7(),_0=K7(),e1=K7(),c3=K7(),P4=K7();function K7(){return 2**++X10}var RL=Object.keys(nB);class KZ extends O2{constructor($,Z,H,B){let J=-1;super($,Z);if(MR(this,"space",B),typeof H==="number")while(++J<RL.length){let Q=RL[J];MR(this,RL[J],(H&nB[Q])===nB[Q])}}}KZ.prototype.defined=!0;function MR($,Z,H){if(H)$[Z]=H}function z8($){let Z={},H={};for(let[B,J]of Object.entries($.properties)){let Q=new KZ(B,$.transform($.attributes||{},B),J,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(B))Q.mustUseProperty=!0;Z[B]=Q,H[aB(B)]=B,H[aB(Q.attribute)]=B}return new u3(Z,H,$.space)}var kL=z8({properties:{ariaActiveDescendant:null,ariaAtomic:f5,ariaAutoComplete:null,ariaBusy:f5,ariaChecked:f5,ariaColCount:_0,ariaColIndex:_0,ariaColSpan:_0,ariaControls:e1,ariaCurrent:null,ariaDescribedBy:e1,ariaDetails:null,ariaDisabled:f5,ariaDropEffect:e1,ariaErrorMessage:null,ariaExpanded:f5,ariaFlowTo:e1,ariaGrabbed:f5,ariaHasPopup:null,ariaHidden:f5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:e1,ariaLevel:_0,ariaLive:null,ariaModal:f5,ariaMultiLine:f5,ariaMultiSelectable:f5,ariaOrientation:null,ariaOwns:e1,ariaPlaceholder:null,ariaPosInSet:_0,ariaPressed:f5,ariaReadOnly:f5,ariaRelevant:null,ariaRequired:f5,ariaRoleDescription:e1,ariaRowCount:_0,ariaRowIndex:_0,ariaRowSpan:_0,ariaSelected:f5,ariaSetSize:_0,ariaSort:null,ariaValueMax:_0,ariaValueMin:_0,ariaValueNow:_0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function fF($,Z){return Z in $?$[Z]:Z}function mF($,Z){return fF($,Z.toLowerCase())}var PR=z8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:c3,acceptCharset:e1,accessKey:e1,action:null,allow:null,allowFullScreen:U1,allowPaymentRequest:U1,allowUserMedia:U1,alt:null,as:null,async:U1,autoCapitalize:null,autoComplete:e1,autoFocus:U1,autoPlay:U1,blocking:e1,capture:null,charSet:null,checked:U1,cite:null,className:e1,cols:_0,colSpan:null,content:null,contentEditable:f5,controls:U1,controlsList:e1,coords:_0|c3,crossOrigin:null,data:null,dateTime:null,decoding:null,default:U1,defer:U1,dir:null,dirName:null,disabled:U1,download:gF,draggable:f5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:U1,formTarget:null,headers:e1,height:_0,hidden:gF,high:_0,href:null,hrefLang:null,htmlFor:e1,httpEquiv:e1,id:null,imageSizes:null,imageSrcSet:null,inert:U1,inputMode:null,integrity:null,is:null,isMap:U1,itemId:null,itemProp:e1,itemRef:e1,itemScope:U1,itemType:e1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:U1,low:_0,manifest:null,max:null,maxLength:_0,media:null,method:null,min:null,minLength:_0,multiple:U1,muted:U1,name:null,nonce:null,noModule:U1,noValidate:U1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:U1,optimum:_0,pattern:null,ping:e1,placeholder:null,playsInline:U1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:U1,referrerPolicy:null,rel:e1,required:U1,reversed:U1,rows:_0,rowSpan:_0,sandbox:e1,scope:null,scoped:U1,seamless:U1,selected:U1,shadowRootClonable:U1,shadowRootDelegatesFocus:U1,shadowRootMode:null,shape:null,size:_0,sizes:null,slot:null,span:_0,spellCheck:f5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_0,step:null,style:null,tabIndex:_0,target:null,title:null,translate:null,type:null,typeMustMatch:U1,useMap:null,value:f5,width:_0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:e1,axis:null,background:null,bgColor:null,border:_0,borderColor:null,bottomMargin:_0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:U1,declare:U1,event:null,face:null,frame:null,frameBorder:null,hSpace:_0,leftMargin:_0,link:null,longDesc:null,lowSrc:null,marginHeight:_0,marginWidth:_0,noResize:U1,noHref:U1,noShade:U1,noWrap:U1,object:null,profile:null,prompt:null,rev:null,rightMargin:_0,rules:null,scheme:null,scrolling:f5,standby:null,summary:null,text:null,topMargin:_0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:U1,disableRemotePlayback:U1,prefix:null,property:null,results:_0,security:null,unselectable:null},space:"html",transform:mF});var _R=z8({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:P4,accentHeight:_0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_0,amplitude:_0,arabicForm:null,ascent:_0,attributeName:null,attributeType:null,azimuth:_0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_0,by:null,calcMode:null,capHeight:_0,className:e1,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_0,diffuseConstant:_0,direction:null,display:null,dur:null,divisor:_0,dominantBaseline:null,download:U1,dx:null,dy:null,edgeMode:null,editable:null,elevation:_0,enableBackground:null,end:null,event:null,exponent:_0,externalResourcesRequired:null,fill:null,fillOpacity:_0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:c3,g2:c3,glyphName:c3,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_0,horizOriginX:_0,horizOriginY:_0,id:null,ideographic:_0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_0,k:_0,k1:_0,k2:_0,k3:_0,k4:_0,kernelMatrix:P4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_0,overlineThickness:_0,paintOrder:null,panose1:null,path:null,pathLength:_0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:e1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_0,pointsAtY:_0,pointsAtZ:_0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:P4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:P4,rev:P4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:P4,requiredFeatures:P4,requiredFonts:P4,requiredFormats:P4,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_0,specularExponent:_0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_0,strikethroughThickness:_0,string:null,stroke:null,strokeDashArray:P4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_0,strokeOpacity:_0,strokeWidth:null,style:null,surfaceScale:_0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:P4,tabIndex:_0,tableValues:null,target:null,targetX:_0,targetY:_0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:P4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_0,underlineThickness:_0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_0,values:null,vAlphabetic:_0,vMathematical:_0,vectorEffect:null,vHanging:_0,vIdeographic:_0,version:null,vertAdvY:_0,vertOriginX:_0,vertOriginY:_0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fF});var bL=z8({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform($,Z){return"xlink:"+Z.slice(5).toLowerCase()}});var yL=z8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mF});var hL=z8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var xL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var z10=/[A-Z]/g,OR=/-[a-z]/g,G10=/^data[-\w.:]+$/i;function vL($,Z){let H=aB(Z),B=Z,J=O2;if(H in $.normal)return $.property[$.normal[H]];if(H.length>4&&H.slice(0,4)==="data"&&G10.test(Z)){if(Z.charAt(4)==="-"){let Q=Z.slice(5).replace(OR,U10);B="data"+Q.charAt(0).toUpperCase()+Q.slice(1)}else{let Q=Z.slice(4);if(!OR.test(Q)){let X=Q.replace(z10,F10);if(X.charAt(0)!=="-")X="-"+X;Z="data"+X}}J=KZ}return new J(B,Z)}function F10($){return"-"+$.toLowerCase()}function U10($){return $.charAt(1).toUpperCase()}var jR=IL([kL,PR,bL,yL,hL],"html"),pF=IL([kL,_R,bL,yL,hL],"svg");function TR($){return $.join(" ").trim()}var uR=O(gR(),1);var uF=fR("end"),WZ=fR("start");function fR($){return Z;function Z(H){let B=H&&H.position&&H.position[$]||{};if(typeof B.line==="number"&&B.line>0&&typeof B.column==="number"&&B.column>0)return{line:B.line,column:B.column,offset:typeof B.offset==="number"&&B.offset>-1?B.offset:void 0}}}function mL($){let Z=WZ($),H=uF($);if(Z&&H)return{start:Z,end:H}}function d3($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return mR($.position);if("start"in $||"end"in $)return mR($);if("line"in $||"column"in $)return pL($);return""}function pL($){return pR($&&$.line)+":"+pR($&&$.column)}function mR($){return pL($&&$.start)+"-"+pL($&&$.end)}function pR($){return $&&typeof $==="number"?$:1}class t5 extends Error{constructor($,Z,H){super();if(typeof Z==="string")H=Z,Z=void 0;let B="",J={},Q=!1;if(Z)if("line"in Z&&"column"in Z)J={place:Z};else if("start"in Z&&"end"in Z)J={place:Z};else if("type"in Z)J={ancestors:[Z],place:Z.position};else J={...Z};if(typeof $==="string")B=$;else if(!J.cause&&$)Q=!0,B=$.message,J.cause=$;if(!J.ruleId&&!J.source&&typeof H==="string"){let z=H.indexOf(":");if(z===-1)J.ruleId=H;else J.source=H.slice(0,z),J.ruleId=H.slice(z+1)}if(!J.place&&J.ancestors&&J.ancestors){let z=J.ancestors[J.ancestors.length-1];if(z)J.place=z.position}let X=J.place&&"start"in J.place?J.place.start:J.place;this.ancestors=J.ancestors||void 0,this.cause=J.cause||void 0,this.column=X?X.column:void 0,this.fatal=void 0,this.file="",this.message=B,this.line=X?X.line:void 0,this.name=d3(J.place)||"1:1",this.place=J.place||void 0,this.reason=this.message,this.ruleId=J.ruleId||void 0,this.source=J.source||void 0,this.stack=Q&&J.cause&&typeof J.cause.stack==="string"?J.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}t5.prototype.file="";t5.prototype.name="";t5.prototype.reason="";t5.prototype.message="";t5.prototype.stack="";t5.prototype.column=void 0;t5.prototype.line=void 0;t5.prototype.ancestors=void 0;t5.prototype.cause=void 0;t5.prototype.fatal=void 0;t5.prototype.place=void 0;t5.prototype.ruleId=void 0;t5.prototype.source=void 0;var uL={}.hasOwnProperty,x10=new Map,v10=/[A-Z]/g,g10=new Set(["table","tbody","thead","tfoot","tr"]),f10=new Set(["td","th"]),cR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cL($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let H=Z.filePath||void 0,B;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");B=r10(H,Z.jsxDEV)}else{if(typeof Z.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof Z.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");B=i10(H,Z.jsx,Z.jsxs)}let J={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:B,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:H,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?pF:jR,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},Q=dR(J,$,void 0);if(Q&&typeof Q!=="string")return Q;return J.create($,J.Fragment,{children:Q||void 0},void 0)}function dR($,Z,H){if(Z.type==="element")return m10($,Z,H);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return p10($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return c10($,Z,H);if(Z.type==="mdxjsEsm")return u10($,Z);if(Z.type==="root")return d10($,Z,H);if(Z.type==="text")return l10($,Z)}function m10($,Z,H){let B=$.schema,J=B;if(Z.tagName.toLowerCase()==="svg"&&B.space==="html")J=pF,$.schema=J;$.ancestors.push(Z);let Q=iR($,Z.tagName,!1),X=a10($,Z),z=lL($,Z);if(g10.has(Z.tagName))z=z.filter(function(G){return typeof G==="string"?!SL(G):!0});return lR($,X,Q,Z),dL(X,z),$.ancestors.pop(),$.schema=B,$.create(Z,Q,X,H)}function p10($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let B=Z.data.estree.body[0];return p1(B.type==="ExpressionStatement"),$.evaluater.evaluateExpression(B.expression)}sB($,Z.position)}function u10($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);sB($,Z.position)}function c10($,Z,H){let B=$.schema,J=B;if(Z.name==="svg"&&B.space==="html")J=pF,$.schema=J;$.ancestors.push(Z);let Q=Z.name===null?$.Fragment:iR($,Z.name,!0),X=n10($,Z),z=lL($,Z);return lR($,X,Q,Z),dL(X,z),$.ancestors.pop(),$.schema=B,$.create(Z,Q,X,H)}function d10($,Z,H){let B={};return dL(B,lL($,Z)),$.create(Z,$.Fragment,B,H)}function l10($,Z){return Z.value}function lR($,Z,H,B){if(typeof H!=="string"&&H!==$.Fragment&&$.passNode)Z.node=B}function dL($,Z){if(Z.length>0){let H=Z.length>1?Z:Z[0];if(H)$.children=H}}function i10($,Z,H){return B;function B(J,Q,X,z){let F=Array.isArray(X.children)?H:Z;return z?F(Q,X,z):F(Q,X)}}function r10($,Z){return H;function H(B,J,Q,X){let z=Array.isArray(Q.children),G=WZ(B);return Z(J,Q,X,z,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function a10($,Z){let H={},B,J;for(J in Z.properties)if(J!=="children"&&uL.call(Z.properties,J)){let Q=o10($,J,Z.properties[J]);if(Q){let[X,z]=Q;if($.tableCellAlignToStyle&&X==="align"&&typeof z==="string"&&f10.has(Z.tagName))B=z;else H[X]=z}}if(B){let Q=H.style||(H.style={});Q[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=B}return H}function n10($,Z){let H={};for(let B of Z.attributes)if(B.type==="mdxJsxExpressionAttribute")if(B.data&&B.data.estree&&$.evaluater){let Q=B.data.estree.body[0];p1(Q.type==="ExpressionStatement");let X=Q.expression;p1(X.type==="ObjectExpression");let z=X.properties[0];p1(z.type==="SpreadElement"),Object.assign(H,$.evaluater.evaluateExpression(z.argument))}else sB($,Z.position);else{let J=B.name,Q;if(B.value&&typeof B.value==="object")if(B.value.data&&B.value.data.estree&&$.evaluater){let z=B.value.data.estree.body[0];p1(z.type==="ExpressionStatement"),Q=$.evaluater.evaluateExpression(z.expression)}else sB($,Z.position);else Q=B.value===null?!0:B.value;H[J]=Q}return H}function lL($,Z){let H=[],B=-1,J=$.passKeys?new Map:x10;while(++B<Z.children.length){let Q=Z.children[B],X;if($.passKeys){let G=Q.type==="element"?Q.tagName:Q.type==="mdxJsxFlowElement"||Q.type==="mdxJsxTextElement"?Q.name:void 0;if(G){let F=J.get(G)||0;X=G+"-"+F,J.set(G,F+1)}}let z=dR($,Q,X);if(z!==void 0)H.push(z)}return H}function o10($,Z,H){let B=vL($.schema,Z);if(H===null||H===void 0||typeof H==="number"&&Number.isNaN(H))return;if(Array.isArray(H))H=B.commaSeparated?DR(H):TR(H);if(B.property==="style"){let J=typeof H==="object"?H:s10($,String(H));if($.stylePropertyNameCase==="css")J=t10(J);return["style",J]}return[$.elementAttributeNameCase==="react"&&B.space?xL[B.property]||B.property:B.attribute,H]}function s10($,Z){try{return uR.default(Z,{reactCompat:!0})}catch(H){if($.ignoreInvalidStyle)return{};let B=H,J=new t5("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:B,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw J.file=$.filePath||void 0,J.url=cR+"#cannot-parse-style-attribute",J}}function iR($,Z,H){let B;if(!H)B={type:"Literal",value:Z};else if(Z.includes(".")){let J=Z.split("."),Q=-1,X;while(++Q<J.length){let z=vF(J[Q])?{type:"Identifier",name:J[Q]}:{type:"Literal",value:J[Q]};X=X?{type:"MemberExpression",object:X,property:z,computed:Boolean(Q&&z.type==="Literal"),optional:!1}:z}p1(X,"always a result"),B=X}else B=vF(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(B.type==="Literal"){let J=B.value;return uL.call($.components,J)?$.components[J]:J}if($.evaluater)return $.evaluater.evaluateExpression(B);sB($)}function sB($,Z){let H=new t5("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw H.file=$.filePath||void 0,H.url=cR+"#cannot-handle-mdx-estrees-without-createevaluater",H}function t10($){let Z={},H;for(H in $)if(uL.call($,H))Z[e10(H)]=$[H];return Z}function e10($){let Z=$.replace(v10,$50);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function $50($){return"-"+$.toLowerCase()}var tB={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var PZ=O(d(),1),Lb=O(g(),1);var Z50={};function N7($,Z){let H=Z||Z50,B=typeof H.includeImageAlt==="boolean"?H.includeImageAlt:!0,J=typeof H.includeHtml==="boolean"?H.includeHtml:!0;return aR($,B,J)}function aR($,Z,H){if(H50($)){if("value"in $)return $.type==="html"&&!H?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return rR($.children,Z,H)}if(Array.isArray($))return rR($,Z,H);return""}function rR($,Z,H){let B=[],J=-1;while(++J<$.length)B[J]=aR($[J],Z,H);return B.join("")}function H50($){return Boolean($&&typeof $==="object")}var nR=document.createElement("i");function NZ($){let Z="&"+$+";";nR.innerHTML=Z;let H=nR.textContent;if(H.charCodeAt(H.length-1)===59&&$!=="semi")return!1;return H===Z?!1:H}function d5($,Z,H,B){let J=$.length,Q=0,X;if(Z<0)Z=-Z>J?0:J+Z;else Z=Z>J?J:Z;if(H=H>0?H:0,B.length<1e4)X=Array.from(B),X.unshift(Z,H),$.splice(...X);else{if(H)$.splice(Z,H);while(Q<B.length)X=B.slice(Q,Q+1e4),X.unshift(Z,0),$.splice(...X),Q+=1e4,Z+=1e4}}function H4($,Z){if($.length>0)return d5($,$.length,0,Z),$;return Z}var oR={}.hasOwnProperty;function cF($){let Z={},H=-1;while(++H<$.length)B50(Z,$[H]);return Z}function B50($,Z){let H;for(H in Z){let J=(oR.call($,H)?$[H]:void 0)||($[H]={}),Q=Z[H],X;if(Q)for(X in Q){if(!oR.call(J,X))J[X]=[];let z=Q[X];J50(J[X],Array.isArray(z)?z:z?[z]:[])}}}function J50($,Z){let H=-1,B=[];while(++H<Z.length)(Z[H].add==="after"?$:B).push(Z[H]);d5($,0,0,B)}function dF($,Z){let H=Number.parseInt($,Z);if(H<9||H===11||H>13&&H<32||H>126&&H<160||H>55295&&H<57344||H>64975&&H<65008||(H&65535)===65535||(H&65535)===65534||H>1114111)return"�";return String.fromCodePoint(H)}function p2($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var X2=l3(/[A-Za-z]/),m5=l3(/[\dA-Za-z]/),sR=l3(/[#-'*+\--9=?A-Z^-~]/);function L7($){return $!==null&&($<32||$===127)}var eB=l3(/\d/),tR=l3(/[\dA-Fa-f]/),eR=l3(/[!-/:-@[-`{-~]/);function h0($){return $!==null&&$<-2}function O1($){return $!==null&&($<0||$===32)}function s0($){return $===-2||$===-1||$===32}var A7=l3(/\p{P}|\p{S}/u),D9=l3(/\s/);function l3($){return Z;function Z(H){return H!==null&&H>-1&&$.test(String.fromCharCode(H))}}function G8($){let Z=[],H=-1,B=0,J=0;while(++H<$.length){let Q=$.charCodeAt(H),X="";if(Q===37&&m5($.charCodeAt(H+1))&&m5($.charCodeAt(H+2)))J=2;else if(Q<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(Q)))X=String.fromCharCode(Q)}else if(Q>55295&&Q<57344){let z=$.charCodeAt(H+1);if(Q<56320&&z>56319&&z<57344)X=String.fromCharCode(Q,z),J=1;else X="�"}else X=String.fromCharCode(Q);if(X)Z.push($.slice(B,H),encodeURIComponent(X)),B=H+J+1,X="";if(J)H+=J,J=0}return Z.join("")+$.slice(B)}function a0($,Z,H,B){let J=B?B-1:Number.POSITIVE_INFINITY,Q=0;return X;function X(G){if(s0(G))return $.enter(H),z(G);return Z(G)}function z(G){if(s0(G)&&Q++<J)return $.consume(G),z;return $.exit(H),Z(G)}}var $k={tokenize:Q50};function Q50($){let Z=$.attempt(this.parser.constructs.contentInitial,B,J),H;return Z;function B(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),a0($,Z,"linePrefix")}function J(z){return $.enter("paragraph"),Q(z)}function Q(z){let G=$.enter("chunkText",{contentType:"text",previous:H});if(H)H.next=G;return H=G,X(z)}function X(z){if(z===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(z);return}if(h0(z))return $.consume(z),$.exit("chunkText"),Q;return $.consume(z),X}}var Hk={tokenize:X50},Zk={tokenize:z50};function X50($){let Z=this,H=[],B=0,J,Q,X;return z;function z(q){if(B<H.length){let _=H[B];return Z.containerState=_[1],$.attempt(_[0].continuation,G,F)(q)}return F(q)}function G(q){if(B++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,J)D();let _=Z.events.length,M=_,P;while(M--)if(Z.events[M][0]==="exit"&&Z.events[M][1].type==="chunkFlow"){P=Z.events[M][1].end;break}A(B);let C=_;while(C<Z.events.length)Z.events[C][1].end={...P},C++;return d5(Z.events,M+1,0,Z.events.slice(_)),Z.events.length=C,F(q)}return z(q)}function F(q){if(B===H.length){if(!J)return K(q);if(J.currentConstruct&&J.currentConstruct.concrete)return N(q);Z.interrupt=Boolean(J.currentConstruct&&!J._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(Zk,U,Y)(q)}function U(q){if(J)D();return A(B),K(q)}function Y(q){return Z.parser.lazy[Z.now().line]=B!==H.length,X=Z.now().offset,N(q)}function K(q){return Z.containerState={},$.attempt(Zk,W,N)(q)}function W(q){return B++,H.push([Z.currentConstruct,Z.containerState]),K(q)}function N(q){if(q===null){if(J)D();A(0),$.consume(q);return}return J=J||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:J,contentType:"flow",previous:Q}),L(q)}function L(q){if(q===null){V($.exit("chunkFlow"),!0),A(0),$.consume(q);return}if(h0(q))return $.consume(q),V($.exit("chunkFlow")),B=0,Z.interrupt=void 0,z;return $.consume(q),L}function V(q,_){let M=Z.sliceStream(q);if(_)M.push(null);if(q.previous=Q,Q)Q.next=q;if(Q=q,J.defineSkip(q.start),J.write(M),Z.parser.lazy[q.start.line]){let P=J.events.length;while(P--)if(J.events[P][1].start.offset<X&&(!J.events[P][1].end||J.events[P][1].end.offset>X))return;let C=Z.events.length,R=C,y,w;while(R--)if(Z.events[R][0]==="exit"&&Z.events[R][1].type==="chunkFlow"){if(y){w=Z.events[R][1].end;break}y=!0}A(B),P=C;while(P<Z.events.length)Z.events[P][1].end={...w},P++;d5(Z.events,R+1,0,Z.events.slice(C)),Z.events.length=P}}function A(q){let _=H.length;while(_-- >q){let M=H[_];Z.containerState=M[1],M[0].exit.call(Z,$)}H.length=q}function D(){J.write([null]),Q=void 0,J=void 0,Z.containerState._closeFlow=void 0}}function z50($,Z,H){return a0($,$.attempt(this.parser.constructs.document,Z,H),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function p9($){if($===null||O1($)||D9($))return 1;if(A7($))return 2}function i3($,Z,H){let B=[],J=-1;while(++J<$.length){let Q=$[J].resolveAll;if(Q&&!B.includes(Q))Z=Q(Z,H),B.push(Q)}return Z}var $J={name:"attention",resolveAll:G50,tokenize:F50};function G50($,Z){let H=-1,B,J,Q,X,z,G,F,U;while(++H<$.length)if($[H][0]==="enter"&&$[H][1].type==="attentionSequence"&&$[H][1]._close){B=H;while(B--)if($[B][0]==="exit"&&$[B][1].type==="attentionSequence"&&$[B][1]._open&&Z.sliceSerialize($[B][1]).charCodeAt(0)===Z.sliceSerialize($[H][1]).charCodeAt(0)){if(($[B][1]._close||$[H][1]._open)&&($[H][1].end.offset-$[H][1].start.offset)%3&&!(($[B][1].end.offset-$[B][1].start.offset+$[H][1].end.offset-$[H][1].start.offset)%3))continue;G=$[B][1].end.offset-$[B][1].start.offset>1&&$[H][1].end.offset-$[H][1].start.offset>1?2:1;let Y={...$[B][1].end},K={...$[H][1].start};if(Bk(Y,-G),Bk(K,G),X={type:G>1?"strongSequence":"emphasisSequence",start:Y,end:{...$[B][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...$[H][1].start},end:K},Q={type:G>1?"strongText":"emphasisText",start:{...$[B][1].end},end:{...$[H][1].start}},J={type:G>1?"strong":"emphasis",start:{...X.start},end:{...z.end}},$[B][1].end={...X.start},$[H][1].start={...z.end},F=[],$[B][1].end.offset-$[B][1].start.offset)F=H4(F,[["enter",$[B][1],Z],["exit",$[B][1],Z]]);if(F=H4(F,[["enter",J,Z],["enter",X,Z],["exit",X,Z],["enter",Q,Z]]),F=H4(F,i3(Z.parser.constructs.insideSpan.null,$.slice(B+1,H),Z)),F=H4(F,[["exit",Q,Z],["enter",z,Z],["exit",z,Z],["exit",J,Z]]),$[H][1].end.offset-$[H][1].start.offset)U=2,F=H4(F,[["enter",$[H][1],Z],["exit",$[H][1],Z]]);else U=0;d5($,B-1,H-B+3,F),H=B+F.length-U-2;break}}H=-1;while(++H<$.length)if($[H][1].type==="attentionSequence")$[H][1].type="data";return $}function F50($,Z){let H=this.parser.constructs.attentionMarkers.null,B=this.previous,J=p9(B),Q;return X;function X(G){return Q=G,$.enter("attentionSequence"),z(G)}function z(G){if(G===Q)return $.consume(G),z;let F=$.exit("attentionSequence"),U=p9(G),Y=!U||U===2&&J||H.includes(G),K=!J||J===2&&U||H.includes(B);return F._open=Boolean(Q===42?Y:Y&&(J||!K)),F._close=Boolean(Q===42?K:K&&(U||!Y)),Z(G)}}function Bk($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var iL={name:"autolink",tokenize:U50};function U50($,Z,H){let B=0;return J;function J(W){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),Q}function Q(W){if(X2(W))return $.consume(W),X;if(W===64)return H(W);return F(W)}function X(W){if(W===43||W===45||W===46||m5(W))return B=1,z(W);return F(W)}function z(W){if(W===58)return $.consume(W),B=0,G;if((W===43||W===45||W===46||m5(W))&&B++<32)return $.consume(W),z;return B=0,F(W)}function G(W){if(W===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(W===null||W===32||W===60||L7(W))return H(W);return $.consume(W),G}function F(W){if(W===64)return $.consume(W),U;if(sR(W))return $.consume(W),F;return H(W)}function U(W){return m5(W)?Y(W):H(W)}function Y(W){if(W===46)return $.consume(W),B=0,U;if(W===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;return K(W)}function K(W){if((W===45||m5(W))&&B++<63){let N=W===45?K:Y;return $.consume(W),N}return H(W)}}var q9={partial:!0,tokenize:Y50};function Y50($,Z,H){return B;function B(Q){return s0(Q)?a0($,J,"linePrefix")(Q):J(Q)}function J(Q){return Q===null||h0(Q)?Z(Q):H(Q)}}var lF={continuation:{tokenize:W50},exit:N50,name:"blockQuote",tokenize:K50};function K50($,Z,H){let B=this;return J;function J(X){if(X===62){let z=B.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(X),$.exit("blockQuoteMarker"),Q}return H(X)}function Q(X){if(s0(X))return $.enter("blockQuotePrefixWhitespace"),$.consume(X),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(X)}}function W50($,Z,H){let B=this;return J;function J(X){if(s0(X))return a0($,Q,"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X);return Q(X)}function Q(X){return $.attempt(lF,Z,H)(X)}}function N50($){$.exit("blockQuote")}var iF={name:"characterEscape",tokenize:L50};function L50($,Z,H){return B;function B(Q){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(Q),$.exit("escapeMarker"),J}function J(Q){if(eR(Q))return $.enter("characterEscapeValue"),$.consume(Q),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return H(Q)}}var rF={name:"characterReference",tokenize:A50};function A50($,Z,H){let B=this,J=0,Q,X;return z;function z(Y){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(Y),$.exit("characterReferenceMarker"),G}function G(Y){if(Y===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(Y),$.exit("characterReferenceMarkerNumeric"),F;return $.enter("characterReferenceValue"),Q=31,X=m5,U(Y)}function F(Y){if(Y===88||Y===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(Y),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),Q=6,X=tR,U;return $.enter("characterReferenceValue"),Q=7,X=eB,U(Y)}function U(Y){if(Y===59&&J){let K=$.exit("characterReferenceValue");if(X===m5&&!NZ(B.sliceSerialize(K)))return H(Y);return $.enter("characterReferenceMarker"),$.consume(Y),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(X(Y)&&J++<Q)return $.consume(Y),U;return H(Y)}}var Jk={partial:!0,tokenize:D50},aF={concrete:!0,name:"codeFenced",tokenize:V50};function V50($,Z,H){let B=this,J={partial:!0,tokenize:M},Q=0,X=0,z;return G;function G(P){return F(P)}function F(P){let C=B.events[B.events.length-1];return Q=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,z=P,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),U(P)}function U(P){if(P===z)return X++,$.consume(P),U;if(X<3)return H(P);return $.exit("codeFencedFenceSequence"),s0(P)?a0($,Y,"whitespace")(P):Y(P)}function Y(P){if(P===null||h0(P))return $.exit("codeFencedFence"),B.interrupt?Z(P):$.check(Jk,L,_)(P);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),K(P)}function K(P){if(P===null||h0(P))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),Y(P);if(s0(P))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),a0($,W,"whitespace")(P);if(P===96&&P===z)return H(P);return $.consume(P),K}function W(P){if(P===null||h0(P))return Y(P);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),N(P)}function N(P){if(P===null||h0(P))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),Y(P);if(P===96&&P===z)return H(P);return $.consume(P),N}function L(P){return $.attempt(J,_,V)(P)}function V(P){return $.enter("lineEnding"),$.consume(P),$.exit("lineEnding"),A}function A(P){return Q>0&&s0(P)?a0($,D,"linePrefix",Q+1)(P):D(P)}function D(P){if(P===null||h0(P))return $.check(Jk,L,_)(P);return $.enter("codeFlowValue"),q(P)}function q(P){if(P===null||h0(P))return $.exit("codeFlowValue"),D(P);return $.consume(P),q}function _(P){return $.exit("codeFenced"),Z(P)}function M(P,C,R){let y=0;return w;function w(S){return P.enter("lineEnding"),P.consume(S),P.exit("lineEnding"),h}function h(S){return P.enter("codeFencedFence"),s0(S)?a0(P,E,"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):E(S)}function E(S){if(S===z)return P.enter("codeFencedFenceSequence"),I(S);return R(S)}function I(S){if(S===z)return y++,P.consume(S),I;if(y>=X)return P.exit("codeFencedFenceSequence"),s0(S)?a0(P,j,"whitespace")(S):j(S);return R(S)}function j(S){if(S===null||h0(S))return P.exit("codeFencedFence"),C(S);return R(S)}}}function D50($,Z,H){let B=this;return J;function J(X){if(X===null)return H(X);return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q}function Q(X){return B.parser.lazy[B.now().line]?H(X):Z(X)}}var ZJ={name:"codeIndented",tokenize:M50},q50={partial:!0,tokenize:P50};function M50($,Z,H){let B=this;return J;function J(F){return $.enter("codeIndented"),a0($,Q,"linePrefix",5)(F)}function Q(F){let U=B.events[B.events.length-1];return U&&U[1].type==="linePrefix"&&U[2].sliceSerialize(U[1],!0).length>=4?X(F):H(F)}function X(F){if(F===null)return G(F);if(h0(F))return $.attempt(q50,X,G)(F);return $.enter("codeFlowValue"),z(F)}function z(F){if(F===null||h0(F))return $.exit("codeFlowValue"),X(F);return $.consume(F),z}function G(F){return $.exit("codeIndented"),Z(F)}}function P50($,Z,H){let B=this;return J;function J(X){if(B.parser.lazy[B.now().line])return H(X);if(h0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),J;return a0($,Q,"linePrefix",5)(X)}function Q(X){let z=B.events[B.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?Z(X):h0(X)?J(X):H(X)}}var rL={name:"codeText",previous:O50,resolve:_50,tokenize:j50};function _50($){let Z=$.length-4,H=3,B,J;if(($[H][1].type==="lineEnding"||$[H][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){B=H;while(++B<Z)if($[B][1].type==="codeTextData"){$[H][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",H+=2,Z-=2;break}}B=H-1,Z++;while(++B<=Z)if(J===void 0){if(B!==Z&&$[B][1].type!=="lineEnding")J=B}else if(B===Z||$[B][1].type==="lineEnding"){if($[J][1].type="codeTextData",B!==J+2)$[J][1].end=$[B-1][1].end,$.splice(J+2,B-J-2),Z-=B-J-2,B=J+2;J=void 0}return $}function O50($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function j50($,Z,H){let B=this,J=0,Q,X;return z;function z(K){return $.enter("codeText"),$.enter("codeTextSequence"),G(K)}function G(K){if(K===96)return $.consume(K),J++,G;return $.exit("codeTextSequence"),F(K)}function F(K){if(K===null)return H(K);if(K===32)return $.enter("space"),$.consume(K),$.exit("space"),F;if(K===96)return X=$.enter("codeTextSequence"),Q=0,Y(K);if(h0(K))return $.enter("lineEnding"),$.consume(K),$.exit("lineEnding"),F;return $.enter("codeTextData"),U(K)}function U(K){if(K===null||K===32||K===96||h0(K))return $.exit("codeTextData"),F(K);return $.consume(K),U}function Y(K){if(K===96)return $.consume(K),Q++,Y;if(Q===J)return $.exit("codeTextSequence"),$.exit("codeText"),Z(K);return X.type="codeTextData",U(K)}}class aL{constructor($){this.left=$?[...$]:[],this.right=[]}get($){if($<0||$>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+$+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if($<this.left.length)return this.left[$];return this.right[this.right.length-$+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice($,Z){let H=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(H<this.left.length)return this.left.slice($,H);if($>this.left.length)return this.right.slice(this.right.length-H+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-H+this.left.length).reverse())}splice($,Z,H){let B=Z||0;this.setCursor(Math.trunc($));let J=this.right.splice(this.right.length-B,Number.POSITIVE_INFINITY);if(H)HJ(this.left,H);return J.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push($){this.setCursor(Number.POSITIVE_INFINITY),this.left.push($)}pushMany($){this.setCursor(Number.POSITIVE_INFINITY),HJ(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),HJ(this.right,$.reverse())}setCursor($){if($===this.left.length||$>this.left.length&&this.right.length===0||$<0&&this.left.length===0)return;if($<this.left.length){let Z=this.left.splice($,Number.POSITIVE_INFINITY);HJ(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);HJ(this.left,Z.reverse())}}}function HJ($,Z){let H=0;if(Z.length<1e4)$.push(...Z);else while(H<Z.length)$.push(...Z.slice(H,H+1e4)),H+=1e4}function nF($){let Z={},H=-1,B,J,Q,X,z,G,F,U=new aL($);while(++H<U.length){while(H in Z)H=Z[H];if(B=U.get(H),H&&B[1].type==="chunkFlow"&&U.get(H-1)[1].type==="listItemPrefix"){if(G=B[1]._tokenizer.events,Q=0,Q<G.length&&G[Q][1].type==="lineEndingBlank")Q+=2;if(Q<G.length&&G[Q][1].type==="content")while(++Q<G.length){if(G[Q][1].type==="content")break;if(G[Q][1].type==="chunkText")G[Q][1]._isInFirstContentOfListItem=!0,Q++}}if(B[0]==="enter"){if(B[1].contentType)Object.assign(Z,T50(U,H)),H=Z[H],F=!0}else if(B[1]._container){Q=H,J=void 0;while(Q--)if(X=U.get(Q),X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="enter"){if(J)U.get(J)[1].type="lineEndingBlank";X[1].type="lineEnding",J=Q}}else if(X[1].type==="linePrefix"||X[1].type==="listItemIndent");else break;if(J)B[1].end={...U.get(J)[1].start},z=U.slice(J,H),z.unshift(B),U.splice(J,H-J+1,z)}}return d5($,0,Number.POSITIVE_INFINITY,U.slice(0)),!F}function T50($,Z){let H=$.get(Z)[1],B=$.get(Z)[2],J=Z-1,Q=[],X=H._tokenizer;if(!X){if(X=B.parser[H.contentType](H.start),H._contentTypeTextTrailing)X._contentTypeTextTrailing=!0}let z=X.events,G=[],F={},U,Y,K=-1,W=H,N=0,L=0,V=[L];while(W){while($.get(++J)[1]!==W);if(Q.push(J),!W._tokenizer){if(U=B.sliceStream(W),!W.next)U.push(null);if(Y)X.defineSkip(W.start);if(W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=!0;if(X.write(U),W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=void 0}Y=W,W=W.next}W=H;while(++K<z.length)if(z[K][0]==="exit"&&z[K-1][0]==="enter"&&z[K][1].type===z[K-1][1].type&&z[K][1].start.line!==z[K][1].end.line)L=K+1,V.push(L),W._tokenizer=void 0,W.previous=void 0,W=W.next;if(X.events=[],W)W._tokenizer=void 0,W.previous=void 0;else V.pop();K=V.length;while(K--){let A=z.slice(V[K],V[K+1]),D=Q.pop();G.push([D,D+A.length-1]),$.splice(D,2,A)}G.reverse(),K=-1;while(++K<G.length)F[N+G[K][0]]=N+G[K][1],N+=G[K][1]-G[K][0]-1;return F}var nL={resolve:w50,tokenize:E50},C50={partial:!0,tokenize:S50};function w50($){return nF($),$}function E50($,Z){let H;return B;function B(z){return $.enter("content"),H=$.enter("chunkContent",{contentType:"content"}),J(z)}function J(z){if(z===null)return Q(z);if(h0(z))return $.check(C50,X,Q)(z);return $.consume(z),J}function Q(z){return $.exit("chunkContent"),$.exit("content"),Z(z)}function X(z){return $.consume(z),$.exit("chunkContent"),H.next=$.enter("chunkContent",{contentType:"content",previous:H}),H=H.next,J}}function S50($,Z,H){let B=this;return J;function J(X){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),a0($,Q,"linePrefix")}function Q(X){if(X===null||h0(X))return H(X);let z=B.events[B.events.length-1];if(!B.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return Z(X);return $.interrupt(B.parser.constructs.flow,H,Z)(X)}}function oF($,Z,H,B,J,Q,X,z,G){let F=G||Number.POSITIVE_INFINITY,U=0;return Y;function Y(A){if(A===60)return $.enter(B),$.enter(J),$.enter(Q),$.consume(A),$.exit(Q),K;if(A===null||A===32||A===41||L7(A))return H(A);return $.enter(B),$.enter(X),$.enter(z),$.enter("chunkString",{contentType:"string"}),L(A)}function K(A){if(A===62)return $.enter(Q),$.consume(A),$.exit(Q),$.exit(J),$.exit(B),Z;return $.enter(z),$.enter("chunkString",{contentType:"string"}),W(A)}function W(A){if(A===62)return $.exit("chunkString"),$.exit(z),K(A);if(A===null||A===60||h0(A))return H(A);return $.consume(A),A===92?N:W}function N(A){if(A===60||A===62||A===92)return $.consume(A),W;return W(A)}function L(A){if(!U&&(A===null||A===41||O1(A)))return $.exit("chunkString"),$.exit(z),$.exit(X),$.exit(B),Z(A);if(U<F&&A===40)return $.consume(A),U++,L;if(A===41)return $.consume(A),U--,L;if(A===null||A===32||A===40||L7(A))return H(A);return $.consume(A),A===92?V:L}function V(A){if(A===40||A===41||A===92)return $.consume(A),L;return L(A)}}function sF($,Z,H,B,J,Q){let X=this,z=0,G;return F;function F(W){return $.enter(B),$.enter(J),$.consume(W),$.exit(J),$.enter(Q),U}function U(W){if(z>999||W===null||W===91||W===93&&!G||W===94&&!z&&"_hiddenFootnoteSupport"in X.parser.constructs)return H(W);if(W===93)return $.exit(Q),$.enter(J),$.consume(W),$.exit(J),$.exit(B),Z;if(h0(W))return $.enter("lineEnding"),$.consume(W),$.exit("lineEnding"),U;return $.enter("chunkString",{contentType:"string"}),Y(W)}function Y(W){if(W===null||W===91||W===93||h0(W)||z++>999)return $.exit("chunkString"),U(W);if($.consume(W),!G)G=!s0(W);return W===92?K:Y}function K(W){if(W===91||W===92||W===93)return $.consume(W),z++,Y;return Y(W)}}function tF($,Z,H,B,J,Q){let X;return z;function z(K){if(K===34||K===39||K===40)return $.enter(B),$.enter(J),$.consume(K),$.exit(J),X=K===40?41:K,G;return H(K)}function G(K){if(K===X)return $.enter(J),$.consume(K),$.exit(J),$.exit(B),Z;return $.enter(Q),F(K)}function F(K){if(K===X)return $.exit(Q),G(X);if(K===null)return H(K);if(h0(K))return $.enter("lineEnding"),$.consume(K),$.exit("lineEnding"),a0($,F,"linePrefix");return $.enter("chunkString",{contentType:"string"}),U(K)}function U(K){if(K===X||K===null||h0(K))return $.exit("chunkString"),F(K);return $.consume(K),K===92?Y:U}function Y(K){if(K===X||K===92)return $.consume(K),U;return U(K)}}function V7($,Z){let H;return B;function B(J){if(h0(J))return $.enter("lineEnding"),$.consume(J),$.exit("lineEnding"),H=!0,B;if(s0(J))return a0($,B,H?"linePrefix":"lineSuffix")(J);return Z(J)}}var oL={name:"definition",tokenize:R50},I50={partial:!0,tokenize:k50};function R50($,Z,H){let B=this,J;return Q;function Q(W){return $.enter("definition"),X(W)}function X(W){return sF.call(B,$,z,H,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function z(W){if(J=p2(B.sliceSerialize(B.events[B.events.length-1][1]).slice(1,-1)),W===58)return $.enter("definitionMarker"),$.consume(W),$.exit("definitionMarker"),G;return H(W)}function G(W){return O1(W)?V7($,F)(W):F(W)}function F(W){return oF($,U,H,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function U(W){return $.attempt(I50,Y,Y)(W)}function Y(W){return s0(W)?a0($,K,"whitespace")(W):K(W)}function K(W){if(W===null||h0(W))return $.exit("definition"),B.parser.defined.push(J),Z(W);return H(W)}}function k50($,Z,H){return B;function B(z){return O1(z)?V7($,J)(z):H(z)}function J(z){return tF($,Q,H,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function Q(z){return s0(z)?a0($,X,"whitespace")(z):X(z)}function X(z){return z===null||h0(z)?Z(z):H(z)}}var sL={name:"hardBreakEscape",tokenize:b50};function b50($,Z,H){return B;function B(Q){return $.enter("hardBreakEscape"),$.consume(Q),J}function J(Q){if(h0(Q))return $.exit("hardBreakEscape"),Z(Q);return H(Q)}}var tL={name:"headingAtx",resolve:y50,tokenize:h50};function y50($,Z){let H=$.length-2,B=3,J,Q;if($[B][1].type==="whitespace")B+=2;if(H-2>B&&$[H][1].type==="whitespace")H-=2;if($[H][1].type==="atxHeadingSequence"&&(B===H-1||H-4>B&&$[H-2][1].type==="whitespace"))H-=B+1===H?2:4;if(H>B)J={type:"atxHeadingText",start:$[B][1].start,end:$[H][1].end},Q={type:"chunkText",start:$[B][1].start,end:$[H][1].end,contentType:"text"},d5($,B,H-B+1,[["enter",J,Z],["enter",Q,Z],["exit",Q,Z],["exit",J,Z]]);return $}function h50($,Z,H){let B=0;return J;function J(U){return $.enter("atxHeading"),Q(U)}function Q(U){return $.enter("atxHeadingSequence"),X(U)}function X(U){if(U===35&&B++<6)return $.consume(U),X;if(U===null||O1(U))return $.exit("atxHeadingSequence"),z(U);return H(U)}function z(U){if(U===35)return $.enter("atxHeadingSequence"),G(U);if(U===null||h0(U))return $.exit("atxHeading"),Z(U);if(s0(U))return a0($,z,"whitespace")(U);return $.enter("atxHeadingText"),F(U)}function G(U){if(U===35)return $.consume(U),G;return $.exit("atxHeadingSequence"),z(U)}function F(U){if(U===null||U===35||O1(U))return $.exit("atxHeadingText"),z(U);return $.consume(U),F}}var Qk=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],eL=["pre","script","style","textarea"];var $A={concrete:!0,name:"htmlFlow",resolveTo:g50,tokenize:f50},x50={partial:!0,tokenize:p50},v50={partial:!0,tokenize:m50};function g50($){let Z=$.length;while(Z--)if($[Z][0]==="enter"&&$[Z][1].type==="htmlFlow")break;if(Z>1&&$[Z-2][1].type==="linePrefix")$[Z][1].start=$[Z-2][1].start,$[Z+1][1].start=$[Z-2][1].start,$.splice(Z-2,2);return $}function f50($,Z,H){let B=this,J,Q,X,z,G;return F;function F(x){return U(x)}function U(x){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(x),Y}function Y(x){if(x===33)return $.consume(x),K;if(x===47)return $.consume(x),Q=!0,L;if(x===63)return $.consume(x),J=3,B.interrupt?Z:T;if(X2(x))return $.consume(x),X=String.fromCharCode(x),V;return H(x)}function K(x){if(x===45)return $.consume(x),J=2,W;if(x===91)return $.consume(x),J=5,z=0,N;if(X2(x))return $.consume(x),J=4,B.interrupt?Z:T;return H(x)}function W(x){if(x===45)return $.consume(x),B.interrupt?Z:T;return H(x)}function N(x){if(x==="CDATA[".charCodeAt(z++)){if($.consume(x),z===6)return B.interrupt?Z:E;return N}return H(x)}function L(x){if(X2(x))return $.consume(x),X=String.fromCharCode(x),V;return H(x)}function V(x){if(x===null||x===47||x===62||O1(x)){let t=x===47,D0=X.toLowerCase();if(!t&&!Q&&eL.includes(D0))return J=1,B.interrupt?Z(x):E(x);if(Qk.includes(X.toLowerCase())){if(J=6,t)return $.consume(x),A;return B.interrupt?Z(x):E(x)}return J=7,B.interrupt&&!B.parser.lazy[B.now().line]?H(x):Q?D(x):q(x)}if(x===45||m5(x))return $.consume(x),X+=String.fromCharCode(x),V;return H(x)}function A(x){if(x===62)return $.consume(x),B.interrupt?Z:E;return H(x)}function D(x){if(s0(x))return $.consume(x),D;return w(x)}function q(x){if(x===47)return $.consume(x),w;if(x===58||x===95||X2(x))return $.consume(x),_;if(s0(x))return $.consume(x),q;return w(x)}function _(x){if(x===45||x===46||x===58||x===95||m5(x))return $.consume(x),_;return M(x)}function M(x){if(x===61)return $.consume(x),P;if(s0(x))return $.consume(x),M;return q(x)}function P(x){if(x===null||x===60||x===61||x===62||x===96)return H(x);if(x===34||x===39)return $.consume(x),G=x,C;if(s0(x))return $.consume(x),P;return R(x)}function C(x){if(x===G)return $.consume(x),G=null,y;if(x===null||h0(x))return H(x);return $.consume(x),C}function R(x){if(x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||O1(x))return M(x);return $.consume(x),R}function y(x){if(x===47||x===62||s0(x))return q(x);return H(x)}function w(x){if(x===62)return $.consume(x),h;return H(x)}function h(x){if(x===null||h0(x))return E(x);if(s0(x))return $.consume(x),h;return H(x)}function E(x){if(x===45&&J===2)return $.consume(x),k;if(x===60&&J===1)return $.consume(x),b;if(x===62&&J===4)return $.consume(x),e;if(x===63&&J===3)return $.consume(x),T;if(x===93&&J===5)return $.consume(x),c;if(h0(x)&&(J===6||J===7))return $.exit("htmlFlowData"),$.check(x50,Z0,I)(x);if(x===null||h0(x))return $.exit("htmlFlowData"),I(x);return $.consume(x),E}function I(x){return $.check(v50,j,Z0)(x)}function j(x){return $.enter("lineEnding"),$.consume(x),$.exit("lineEnding"),S}function S(x){if(x===null||h0(x))return I(x);return $.enter("htmlFlowData"),E(x)}function k(x){if(x===45)return $.consume(x),T;return E(x)}function b(x){if(x===47)return $.consume(x),X="",v;return E(x)}function v(x){if(x===62){let t=X.toLowerCase();if(eL.includes(t))return $.consume(x),e;return E(x)}if(X2(x)&&X.length<8)return $.consume(x),X+=String.fromCharCode(x),v;return E(x)}function c(x){if(x===93)return $.consume(x),T;return E(x)}function T(x){if(x===62)return $.consume(x),e;if(x===45&&J===2)return $.consume(x),T;return E(x)}function e(x){if(x===null||h0(x))return $.exit("htmlFlowData"),Z0(x);return $.consume(x),e}function Z0(x){return $.exit("htmlFlow"),Z(x)}}function m50($,Z,H){let B=this;return J;function J(X){if(h0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q;return H(X)}function Q(X){return B.parser.lazy[B.now().line]?H(X):Z(X)}}function p50($,Z,H){return B;function B(J){return $.enter("lineEnding"),$.consume(J),$.exit("lineEnding"),$.attempt(q9,Z,H)}}var ZA={name:"htmlText",tokenize:u50};function u50($,Z,H){let B=this,J,Q,X;return z;function z(T){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(T),G}function G(T){if(T===33)return $.consume(T),F;if(T===47)return $.consume(T),M;if(T===63)return $.consume(T),q;if(X2(T))return $.consume(T),R;return H(T)}function F(T){if(T===45)return $.consume(T),U;if(T===91)return $.consume(T),Q=0,N;if(X2(T))return $.consume(T),D;return H(T)}function U(T){if(T===45)return $.consume(T),W;return H(T)}function Y(T){if(T===null)return H(T);if(T===45)return $.consume(T),K;if(h0(T))return X=Y,b(T);return $.consume(T),Y}function K(T){if(T===45)return $.consume(T),W;return Y(T)}function W(T){return T===62?k(T):T===45?K(T):Y(T)}function N(T){if(T==="CDATA[".charCodeAt(Q++))return $.consume(T),Q===6?L:N;return H(T)}function L(T){if(T===null)return H(T);if(T===93)return $.consume(T),V;if(h0(T))return X=L,b(T);return $.consume(T),L}function V(T){if(T===93)return $.consume(T),A;return L(T)}function A(T){if(T===62)return k(T);if(T===93)return $.consume(T),A;return L(T)}function D(T){if(T===null||T===62)return k(T);if(h0(T))return X=D,b(T);return $.consume(T),D}function q(T){if(T===null)return H(T);if(T===63)return $.consume(T),_;if(h0(T))return X=q,b(T);return $.consume(T),q}function _(T){return T===62?k(T):q(T)}function M(T){if(X2(T))return $.consume(T),P;return H(T)}function P(T){if(T===45||m5(T))return $.consume(T),P;return C(T)}function C(T){if(h0(T))return X=C,b(T);if(s0(T))return $.consume(T),C;return k(T)}function R(T){if(T===45||m5(T))return $.consume(T),R;if(T===47||T===62||O1(T))return y(T);return H(T)}function y(T){if(T===47)return $.consume(T),k;if(T===58||T===95||X2(T))return $.consume(T),w;if(h0(T))return X=y,b(T);if(s0(T))return $.consume(T),y;return k(T)}function w(T){if(T===45||T===46||T===58||T===95||m5(T))return $.consume(T),w;return h(T)}function h(T){if(T===61)return $.consume(T),E;if(h0(T))return X=h,b(T);if(s0(T))return $.consume(T),h;return y(T)}function E(T){if(T===null||T===60||T===61||T===62||T===96)return H(T);if(T===34||T===39)return $.consume(T),J=T,I;if(h0(T))return X=E,b(T);if(s0(T))return $.consume(T),E;return $.consume(T),j}function I(T){if(T===J)return $.consume(T),J=void 0,S;if(T===null)return H(T);if(h0(T))return X=I,b(T);return $.consume(T),I}function j(T){if(T===null||T===34||T===39||T===60||T===61||T===96)return H(T);if(T===47||T===62||O1(T))return y(T);return $.consume(T),j}function S(T){if(T===47||T===62||O1(T))return y(T);return H(T)}function k(T){if(T===62)return $.consume(T),$.exit("htmlTextData"),$.exit("htmlText"),Z;return H(T)}function b(T){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(T),$.exit("lineEnding"),v}function v(T){return s0(T)?a0($,c,"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):c(T)}function c(T){return $.enter("htmlTextData"),X(T)}}var D7={name:"labelEnd",resolveAll:i50,resolveTo:r50,tokenize:a50},c50={tokenize:n50},d50={tokenize:o50},l50={tokenize:s50};function i50($){let Z=-1,H=[];while(++Z<$.length){let B=$[Z][1];if(H.push($[Z]),B.type==="labelImage"||B.type==="labelLink"||B.type==="labelEnd"){let J=B.type==="labelImage"?4:2;B.type="data",Z+=J}}if($.length!==H.length)d5($,0,$.length,H);return $}function r50($,Z){let H=$.length,B=0,J,Q,X,z;while(H--)if(J=$[H][1],Q){if(J.type==="link"||J.type==="labelLink"&&J._inactive)break;if($[H][0]==="enter"&&J.type==="labelLink")J._inactive=!0}else if(X){if($[H][0]==="enter"&&(J.type==="labelImage"||J.type==="labelLink")&&!J._balanced){if(Q=H,J.type!=="labelLink"){B=2;break}}}else if(J.type==="labelEnd")X=H;let G={type:$[Q][1].type==="labelLink"?"link":"image",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}},F={type:"label",start:{...$[Q][1].start},end:{...$[X][1].end}},U={type:"labelText",start:{...$[Q+B+2][1].end},end:{...$[X-2][1].start}};return z=[["enter",G,Z],["enter",F,Z]],z=H4(z,$.slice(Q+1,Q+B+3)),z=H4(z,[["enter",U,Z]]),z=H4(z,i3(Z.parser.constructs.insideSpan.null,$.slice(Q+B+4,X-3),Z)),z=H4(z,[["exit",U,Z],$[X-2],$[X-1],["exit",F,Z]]),z=H4(z,$.slice(X+1)),z=H4(z,[["exit",G,Z]]),d5($,Q,$.length,z),$}function a50($,Z,H){let B=this,J=B.events.length,Q,X;while(J--)if((B.events[J][1].type==="labelImage"||B.events[J][1].type==="labelLink")&&!B.events[J][1]._balanced){Q=B.events[J][1];break}return z;function z(K){if(!Q)return H(K);if(Q._inactive)return Y(K);return X=B.parser.defined.includes(p2(B.sliceSerialize({start:Q.end,end:B.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(K),$.exit("labelMarker"),$.exit("labelEnd"),G}function G(K){if(K===40)return $.attempt(c50,U,X?U:Y)(K);if(K===91)return $.attempt(d50,U,X?F:Y)(K);return X?U(K):Y(K)}function F(K){return $.attempt(l50,U,Y)(K)}function U(K){return Z(K)}function Y(K){return Q._balanced=!0,H(K)}}function n50($,Z,H){return B;function B(Y){return $.enter("resource"),$.enter("resourceMarker"),$.consume(Y),$.exit("resourceMarker"),J}function J(Y){return O1(Y)?V7($,Q)(Y):Q(Y)}function Q(Y){if(Y===41)return U(Y);return oF($,X,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(Y)}function X(Y){return O1(Y)?V7($,G)(Y):U(Y)}function z(Y){return H(Y)}function G(Y){if(Y===34||Y===39||Y===40)return tF($,F,H,"resourceTitle","resourceTitleMarker","resourceTitleString")(Y);return U(Y)}function F(Y){return O1(Y)?V7($,U)(Y):U(Y)}function U(Y){if(Y===41)return $.enter("resourceMarker"),$.consume(Y),$.exit("resourceMarker"),$.exit("resource"),Z;return H(Y)}}function o50($,Z,H){let B=this;return J;function J(z){return sF.call(B,$,Q,X,"reference","referenceMarker","referenceString")(z)}function Q(z){return B.parser.defined.includes(p2(B.sliceSerialize(B.events[B.events.length-1][1]).slice(1,-1)))?Z(z):H(z)}function X(z){return H(z)}}function s50($,Z,H){return B;function B(Q){return $.enter("reference"),$.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),J}function J(Q){if(Q===93)return $.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),$.exit("reference"),Z;return H(Q)}}var HA={name:"labelStartImage",resolveAll:D7.resolveAll,tokenize:t50};function t50($,Z,H){let B=this;return J;function J(z){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(z),$.exit("labelImageMarker"),Q}function Q(z){if(z===91)return $.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelImage"),X;return H(z)}function X(z){return z===94&&"_hiddenFootnoteSupport"in B.parser.constructs?H(z):Z(z)}}var BA={name:"labelStartLink",resolveAll:D7.resolveAll,tokenize:e50};function e50($,Z,H){let B=this;return J;function J(X){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(X),$.exit("labelMarker"),$.exit("labelLink"),Q}function Q(X){return X===94&&"_hiddenFootnoteSupport"in B.parser.constructs?H(X):Z(X)}}var BJ={name:"lineEnding",tokenize:$20};function $20($,Z){return H;function H(B){return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),a0($,Z,"linePrefix")}}var q7={name:"thematicBreak",tokenize:Z20};function Z20($,Z,H){let B=0,J;return Q;function Q(F){return $.enter("thematicBreak"),X(F)}function X(F){return J=F,z(F)}function z(F){if(F===J)return $.enter("thematicBreakSequence"),G(F);if(B>=3&&(F===null||h0(F)))return $.exit("thematicBreak"),Z(F);return H(F)}function G(F){if(F===J)return $.consume(F),B++,G;return $.exit("thematicBreakSequence"),s0(F)?a0($,z,"whitespace")(F):z(F)}}var u2={continuation:{tokenize:Q20},exit:z20,name:"list",tokenize:J20},H20={partial:!0,tokenize:G20},B20={partial:!0,tokenize:X20};function J20($,Z,H){let B=this,J=B.events[B.events.length-1],Q=J&&J[1].type==="linePrefix"?J[2].sliceSerialize(J[1],!0).length:0,X=0;return z;function z(W){let N=B.containerState.type||(W===42||W===43||W===45?"listUnordered":"listOrdered");if(N==="listUnordered"?!B.containerState.marker||W===B.containerState.marker:eB(W)){if(!B.containerState.type)B.containerState.type=N,$.enter(N,{_container:!0});if(N==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(q7,H,F)(W):F(W);if(!B.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return H(W)}function G(W){if(eB(W)&&++X<10)return $.consume(W),G;if((!B.interrupt||X<2)&&(B.containerState.marker?W===B.containerState.marker:W===41||W===46))return $.exit("listItemValue"),F(W);return H(W)}function F(W){return $.enter("listItemMarker"),$.consume(W),$.exit("listItemMarker"),B.containerState.marker=B.containerState.marker||W,$.check(q9,B.interrupt?H:U,$.attempt(H20,K,Y))}function U(W){return B.containerState.initialBlankLine=!0,Q++,K(W)}function Y(W){if(s0(W))return $.enter("listItemPrefixWhitespace"),$.consume(W),$.exit("listItemPrefixWhitespace"),K;return H(W)}function K(W){return B.containerState.size=Q+B.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(W)}}function Q20($,Z,H){let B=this;return B.containerState._closeFlow=void 0,$.check(q9,J,Q);function J(z){return B.containerState.furtherBlankLines=B.containerState.furtherBlankLines||B.containerState.initialBlankLine,a0($,Z,"listItemIndent",B.containerState.size+1)(z)}function Q(z){if(B.containerState.furtherBlankLines||!s0(z))return B.containerState.furtherBlankLines=void 0,B.containerState.initialBlankLine=void 0,X(z);return B.containerState.furtherBlankLines=void 0,B.containerState.initialBlankLine=void 0,$.attempt(B20,Z,X)(z)}function X(z){return B.containerState._closeFlow=!0,B.interrupt=void 0,a0($,$.attempt(u2,Z,H),"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function X20($,Z,H){let B=this;return a0($,J,"listItemIndent",B.containerState.size+1);function J(Q){let X=B.events[B.events.length-1];return X&&X[1].type==="listItemIndent"&&X[2].sliceSerialize(X[1],!0).length===B.containerState.size?Z(Q):H(Q)}}function z20($){$.exit(this.containerState.type)}function G20($,Z,H){let B=this;return a0($,J,"listItemPrefixWhitespace",B.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function J(Q){let X=B.events[B.events.length-1];return!s0(Q)&&X&&X[1].type==="listItemPrefixWhitespace"?Z(Q):H(Q)}}var eF={name:"setextUnderline",resolveTo:F20,tokenize:U20};function F20($,Z){let H=$.length,B,J,Q;while(H--)if($[H][0]==="enter"){if($[H][1].type==="content"){B=H;break}if($[H][1].type==="paragraph")J=H}else{if($[H][1].type==="content")$.splice(H,1);if(!Q&&$[H][1].type==="definition")Q=H}let X={type:"setextHeading",start:{...$[B][1].start},end:{...$[$.length-1][1].end}};if($[J][1].type="setextHeadingText",Q)$.splice(J,0,["enter",X,Z]),$.splice(Q+1,0,["exit",$[B][1],Z]),$[B][1].end={...$[Q][1].end};else $[B][1]=X;return $.push(["exit",X,Z]),$}function U20($,Z,H){let B=this,J;return Q;function Q(F){let U=B.events.length,Y;while(U--)if(B.events[U][1].type!=="lineEnding"&&B.events[U][1].type!=="linePrefix"&&B.events[U][1].type!=="content"){Y=B.events[U][1].type==="paragraph";break}if(!B.parser.lazy[B.now().line]&&(B.interrupt||Y))return $.enter("setextHeadingLine"),J=F,X(F);return H(F)}function X(F){return $.enter("setextHeadingLineSequence"),z(F)}function z(F){if(F===J)return $.consume(F),z;return $.exit("setextHeadingLineSequence"),s0(F)?a0($,G,"lineSuffix")(F):G(F)}function G(F){if(F===null||h0(F))return $.exit("setextHeadingLine"),Z(F);return H(F)}}var Xk={tokenize:Y20};function Y20($){let Z=this,H=$.attempt(q9,B,$.attempt(this.parser.constructs.flowInitial,J,a0($,$.attempt(this.parser.constructs.flow,J,$.attempt(nL,J)),"linePrefix")));return H;function B(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEndingBlank"),$.consume(Q),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,H}function J(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),Z.currentConstruct=void 0,H}}var zk={resolveAll:Yk()},Gk=Uk("string"),Fk=Uk("text");function Uk($){return{resolveAll:Yk($==="text"?K20:void 0),tokenize:Z};function Z(H){let B=this,J=this.parser.constructs[$],Q=H.attempt(J,X,z);return X;function X(U){return F(U)?Q(U):z(U)}function z(U){if(U===null){H.consume(U);return}return H.enter("data"),H.consume(U),G}function G(U){if(F(U))return H.exit("data"),Q(U);return H.consume(U),G}function F(U){if(U===null)return!0;let Y=J[U],K=-1;if(Y)while(++K<Y.length){let W=Y[K];if(!W.previous||W.previous.call(B,B.previous))return!0}return!1}}}function Yk($){return Z;function Z(H,B){let J=-1,Q;while(++J<=H.length)if(Q===void 0){if(H[J]&&H[J][1].type==="data")Q=J,J++}else if(!H[J]||H[J][1].type!=="data"){if(J!==Q+2)H[Q][1].end=H[J-1][1].end,H.splice(Q+2,J-Q-2),J=Q+2;Q=void 0}return $?$(H,B):H}}function K20($,Z){let H=0;while(++H<=$.length)if((H===$.length||$[H][1].type==="lineEnding")&&$[H-1][1].type==="data"){let B=$[H-1][1],J=Z.sliceStream(B),Q=J.length,X=-1,z=0,G;while(Q--){let F=J[Q];if(typeof F==="string"){X=F.length;while(F.charCodeAt(X-1)===32)z++,X--;if(X)break;X=-1}else if(F===-2)G=!0,z++;else if(F===-1);else{Q++;break}}if(Z._contentTypeTextTrailing&&H===$.length)z=0;if(z){let F={type:H===$.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:Q?X:B.start._bufferIndex+X,_index:B.start._index+Q,line:B.end.line,column:B.end.column-z,offset:B.end.offset-z},end:{...B.end}};if(B.end={...F.start},B.start.offset===B.end.offset)Object.assign(B,F);else $.splice(H,0,["enter",F,Z],["exit",F,Z]),H+=2}H++}return $}var JA={};j4(JA,{text:()=>D20,string:()=>V20,insideSpan:()=>q20,flowInitial:()=>L20,flow:()=>A20,document:()=>W20,disable:()=>P20,contentInitial:()=>N20,attentionMarkers:()=>M20});var W20={[42]:u2,[43]:u2,[45]:u2,[48]:u2,[49]:u2,[50]:u2,[51]:u2,[52]:u2,[53]:u2,[54]:u2,[55]:u2,[56]:u2,[57]:u2,[62]:lF},N20={[91]:oL},L20={[-2]:ZJ,[-1]:ZJ,[32]:ZJ},A20={[35]:tL,[42]:q7,[45]:[eF,q7],[60]:$A,[61]:eF,[95]:q7,[96]:aF,[126]:aF},V20={[38]:rF,[92]:iF},D20={[-5]:BJ,[-4]:BJ,[-3]:BJ,[33]:HA,[38]:rF,[42]:$J,[60]:[iL,ZA],[91]:BA,[92]:[sL,iF],[93]:D7,[95]:$J,[96]:rL},q20={null:[$J,zk]},M20={null:[42,95]},P20={null:[]};function Kk($,Z,H){let B={_bufferIndex:-1,_index:0,line:H&&H.line||1,column:H&&H.column||1,offset:H&&H.offset||0},J={},Q=[],X=[],z=[],G=!0,F={attempt:y(C),check:y(R),consume:_,enter:M,exit:P,interrupt:y(R,{interrupt:!0})},U={code:null,containerState:{},defineSkip:A,events:[],now:V,parser:$,previous:null,sliceSerialize:N,sliceStream:L,write:W},Y=Z.tokenize.call(U,F),K;if(Z.resolveAll)Q.push(Z);return U;function W(I){if(X=H4(X,I),D(),X[X.length-1]!==null)return[];return w(Z,0),U.events=i3(Q,U.events,U),U.events}function N(I,j){return O20(L(I),j)}function L(I){return _20(X,I)}function V(){let{_bufferIndex:I,_index:j,line:S,column:k,offset:b}=B;return{_bufferIndex:I,_index:j,line:S,column:k,offset:b}}function A(I){J[I.line]=I.column,E()}function D(){let I;while(B._index<X.length){let j=X[B._index];if(typeof j==="string"){if(I=B._index,B._bufferIndex<0)B._bufferIndex=0;while(B._index===I&&B._bufferIndex<j.length)q(j.charCodeAt(B._bufferIndex))}else q(j)}}function q(I){G=void 0,K=I,Y=Y(I)}function _(I){if(h0(I))B.line++,B.column=1,B.offset+=I===-3?2:1,E();else if(I!==-1)B.column++,B.offset++;if(B._bufferIndex<0)B._index++;else if(B._bufferIndex++,B._bufferIndex===X[B._index].length)B._bufferIndex=-1,B._index++;U.previous=I,G=!0}function M(I,j){let S=j||{};return S.type=I,S.start=V(),U.events.push(["enter",S,U]),z.push(S),S}function P(I){let j=z.pop();return j.end=V(),U.events.push(["exit",j,U]),j}function C(I,j){w(I,j.from)}function R(I,j){j.restore()}function y(I,j){return S;function S(k,b,v){let c,T,e,Z0;return Array.isArray(k)?t(k):("tokenize"in k)?t([k]):x(k);function x(K0){return Q0;function Q0(z0){let L0=z0!==null&&K0[z0],i=z0!==null&&K0.null,B0=[...Array.isArray(L0)?L0:L0?[L0]:[],...Array.isArray(i)?i:i?[i]:[]];return t(B0)(z0)}}function t(K0){if(c=K0,T=0,K0.length===0)return v;return D0(K0[T])}function D0(K0){return Q0;function Q0(z0){if(Z0=h(),e=K0,!K0.partial)U.currentConstruct=K0;if(K0.name&&U.parser.constructs.disable.null.includes(K0.name))return X0(z0);return K0.tokenize.call(j?Object.assign(Object.create(U),j):U,F,p,X0)(z0)}}function p(K0){return G=!0,I(e,Z0),b}function X0(K0){if(G=!0,Z0.restore(),++T<c.length)return D0(c[T]);return v}}}function w(I,j){if(I.resolveAll&&!Q.includes(I))Q.push(I);if(I.resolve)d5(U.events,j,U.events.length-j,I.resolve(U.events.slice(j),U));if(I.resolveTo)U.events=I.resolveTo(U.events,U)}function h(){let I=V(),j=U.previous,S=U.currentConstruct,k=U.events.length,b=Array.from(z);return{from:k,restore:v};function v(){B=I,U.previous=j,U.currentConstruct=S,U.events.length=k,z=b,E()}}function E(){if(B.line in J&&B.column<2)B.column=J[B.line],B.offset+=J[B.line]-1}}function _20($,Z){let H=Z.start._index,B=Z.start._bufferIndex,J=Z.end._index,Q=Z.end._bufferIndex,X;if(H===J)X=[$[H].slice(B,Q)];else{if(X=$.slice(H,J),B>-1){let z=X[0];if(typeof z==="string")X[0]=z.slice(B);else X.shift()}if(Q>0)X.push($[J].slice(0,Q))}return X}function O20($,Z){let H=-1,B=[],J;while(++H<$.length){let Q=$[H],X;if(typeof Q==="string")X=Q;else switch(Q){case-5:{X="\r";break}case-4:{X=`
32
- `;break}case-3:{X=`\r
33
- `;break}case-2:{X=Z?" ":"\t";break}case-1:{if(!Z&&J)continue;X=" ";break}default:X=String.fromCharCode(Q)}J=Q===-2,B.push(X)}return B.join("")}function QA($){let B={constructs:cF([JA,...($||{}).extensions||[]]),content:J($k),defined:[],document:J(Hk),flow:J(Xk),lazy:{},string:J(Gk),text:J(Fk)};return B;function J(Q){return X;function X(z){return Kk(B,Q,z)}}}function XA($){while(!nF($));return $}var Wk=/[\0\t\n\r]/g;function zA(){let $=1,Z="",H=!0,B;return J;function J(Q,X,z){let G=[],F,U,Y,K,W;if(Q=Z+(typeof Q==="string"?Q.toString():new TextDecoder(X||void 0).decode(Q)),Y=0,Z="",H){if(Q.charCodeAt(0)===65279)Y++;H=void 0}while(Y<Q.length){if(Wk.lastIndex=Y,F=Wk.exec(Q),K=F&&F.index!==void 0?F.index:Q.length,W=Q.charCodeAt(K),!F){Z=Q.slice(Y);break}if(W===10&&Y===K&&B)G.push(-3),B=void 0;else{if(B)G.push(-5),B=void 0;if(Y<K)G.push(Q.slice(Y,K)),$+=K-Y;switch(W){case 0:{G.push(65533),$++;break}case 9:{U=Math.ceil($/4)*4,G.push(-2);while($++<U)G.push(-1);break}case 10:{G.push(-4),$=1;break}default:B=!0,$=1}}Y=K+1}if(z){if(B)G.push(-5);if(Z)G.push(Z);G.push(null)}return G}}var j20=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Nk($){return $.replace(j20,T20)}function T20($,Z,H){if(Z)return Z;if(H.charCodeAt(0)===35){let J=H.charCodeAt(1),Q=J===120||J===88;return dF(H.slice(Q?2:1),Q?16:10)}return NZ(H)||$}var Ak={}.hasOwnProperty;function GA($,Z,H){if(Z&&typeof Z==="object")H=Z,Z=void 0;return C20(H)(XA(QA(H).document().write(zA()($,Z,!0))))}function C20($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Q(m),autolinkProtocol:y,autolinkEmail:y,atxHeading:Q(J0),blockQuote:Q(z0),characterEscape:y,characterReference:y,codeFenced:Q(L0),codeFencedFenceInfo:X,codeFencedFenceMeta:X,codeIndented:Q(L0,X),codeText:Q(i,X),codeTextData:y,data:y,codeFlowValue:y,definition:Q(B0),definitionDestinationString:X,definitionLabelString:X,definitionTitleString:X,emphasis:Q($0),hardBreakEscape:Q(n),hardBreakTrailing:Q(n),htmlFlow:Q(f,X),htmlFlowData:y,htmlText:Q(f,X),htmlTextData:y,image:Q(l),label:X,link:Q(m),listItem:Q(o),listItemValue:K,listOrdered:Q(a,Y),listUnordered:Q(a),paragraph:Q(V0),reference:x,referenceString:X,resourceDestinationString:X,resourceTitleString:X,setextHeading:Q(J0),strong:Q(O0),thematicBreak:Q(r0)},exit:{atxHeading:G(),atxHeadingSequence:M,autolink:G(),autolinkEmail:Q0,autolinkProtocol:K0,blockQuote:G(),characterEscapeValue:w,characterReferenceMarkerHexadecimal:D0,characterReferenceMarkerNumeric:D0,characterReferenceValue:p,characterReference:X0,codeFenced:G(V),codeFencedFence:L,codeFencedFenceInfo:W,codeFencedFenceMeta:N,codeFlowValue:w,codeIndented:G(A),codeText:G(S),codeTextData:w,data:w,definition:G(),definitionDestinationString:_,definitionLabelString:D,definitionTitleString:q,emphasis:G(),hardBreakEscape:G(E),hardBreakTrailing:G(E),htmlFlow:G(I),htmlFlowData:w,htmlText:G(j),htmlTextData:w,image:G(b),label:c,labelText:v,lineEnding:h,link:G(k),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:t,resourceDestinationString:T,resourceTitleString:e,resource:Z0,setextHeading:G(R),setextHeadingLineSequence:C,setextHeadingText:P,strong:G(),thematicBreak:G()}};Vk(Z,($||{}).mdastExtensions||[]);let H={};return B;function B(u){let r={type:"root",children:[]},H0={stack:[r],tokenStack:[],config:Z,enter:z,exit:F,buffer:X,resume:U,data:H},A0=[],j0=-1;while(++j0<u.length)if(u[j0][1].type==="listOrdered"||u[j0][1].type==="listUnordered")if(u[j0][0]==="enter")A0.push(j0);else{let v0=A0.pop();j0=J(u,v0,j0)}j0=-1;while(++j0<u.length){let v0=Z[u[j0][0]];if(Ak.call(v0,u[j0][1].type))v0[u[j0][1].type].call(Object.assign({sliceSerialize:u[j0][2].sliceSerialize},H0),u[j0][1])}if(H0.tokenStack.length>0){let v0=H0.tokenStack[H0.tokenStack.length-1];(v0[1]||Lk).call(H0,void 0,v0[0])}r.position={start:r3(u.length>0?u[0][1].start:{line:1,column:1,offset:0}),end:r3(u.length>0?u[u.length-2][1].end:{line:1,column:1,offset:0})},j0=-1;while(++j0<Z.transforms.length)r=Z.transforms[j0](r)||r;return r}function J(u,r,H0){let A0=r-1,j0=-1,v0=!1,G1,K1,c0,R0;while(++A0<=H0){let d0=u[A0];switch(d0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(d0[0]==="enter")j0++;else j0--;R0=void 0;break}case"lineEndingBlank":{if(d0[0]==="enter"){if(G1&&!R0&&!j0&&!c0)c0=A0;R0=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:R0=void 0}if(!j0&&d0[0]==="enter"&&d0[1].type==="listItemPrefix"||j0===-1&&d0[0]==="exit"&&(d0[1].type==="listUnordered"||d0[1].type==="listOrdered")){if(G1){let p0=A0;K1=void 0;while(p0--){let t0=u[p0];if(t0[1].type==="lineEnding"||t0[1].type==="lineEndingBlank"){if(t0[0]==="exit")continue;if(K1)u[K1][1].type="lineEndingBlank",v0=!0;t0[1].type="lineEnding",K1=p0}else if(t0[1].type==="linePrefix"||t0[1].type==="blockQuotePrefix"||t0[1].type==="blockQuotePrefixWhitespace"||t0[1].type==="blockQuoteMarker"||t0[1].type==="listItemIndent");else break}if(c0&&(!K1||c0<K1))G1._spread=!0;G1.end=Object.assign({},K1?u[K1][1].start:d0[1].end),u.splice(K1||A0,0,["exit",G1,d0[2]]),A0++,H0++}if(d0[1].type==="listItemPrefix"){let p0={type:"listItem",_spread:!1,start:Object.assign({},d0[1].start),end:void 0};G1=p0,u.splice(A0,0,["enter",p0,d0[2]]),A0++,H0++,c0=void 0,R0=!0}}}return u[r][1]._spread=v0,H0}function Q(u,r){return H0;function H0(A0){if(z.call(this,u(A0),A0),r)r.call(this,A0)}}function X(){this.stack.push({type:"fragment",children:[]})}function z(u,r,H0){this.stack[this.stack.length-1].children.push(u),this.stack.push(u),this.tokenStack.push([r,H0||void 0]),u.position={start:r3(r.start),end:void 0}}function G(u){return r;function r(H0){if(u)u.call(this,H0);F.call(this,H0)}}function F(u,r){let H0=this.stack.pop(),A0=this.tokenStack.pop();if(!A0)throw Error("Cannot close `"+u.type+"` ("+d3({start:u.start,end:u.end})+"): it’s not open");else if(A0[0].type!==u.type)if(r)r.call(this,u,A0[0]);else(A0[1]||Lk).call(this,u,A0[0]);H0.position.end=r3(u.end)}function U(){return N7(this.stack.pop())}function Y(){this.data.expectingFirstListItemValue=!0}function K(u){if(this.data.expectingFirstListItemValue){let r=this.stack[this.stack.length-2];r.start=Number.parseInt(this.sliceSerialize(u),10),this.data.expectingFirstListItemValue=void 0}}function W(){let u=this.resume(),r=this.stack[this.stack.length-1];r.lang=u}function N(){let u=this.resume(),r=this.stack[this.stack.length-1];r.meta=u}function L(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function V(){let u=this.resume(),r=this.stack[this.stack.length-1];r.value=u.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){let u=this.resume(),r=this.stack[this.stack.length-1];r.value=u.replace(/(\r?\n|\r)$/g,"")}function D(u){let r=this.resume(),H0=this.stack[this.stack.length-1];H0.label=r,H0.identifier=p2(this.sliceSerialize(u)).toLowerCase()}function q(){let u=this.resume(),r=this.stack[this.stack.length-1];r.title=u}function _(){let u=this.resume(),r=this.stack[this.stack.length-1];r.url=u}function M(u){let r=this.stack[this.stack.length-1];if(!r.depth){let H0=this.sliceSerialize(u).length;r.depth=H0}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function C(u){let r=this.stack[this.stack.length-1];r.depth=this.sliceSerialize(u).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function y(u){let H0=this.stack[this.stack.length-1].children,A0=H0[H0.length-1];if(!A0||A0.type!=="text")A0=k0(),A0.position={start:r3(u.start),end:void 0},H0.push(A0);this.stack.push(A0)}function w(u){let r=this.stack.pop();r.value+=this.sliceSerialize(u),r.position.end=r3(u.end)}function h(u){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){let H0=r.children[r.children.length-1];H0.position.end=r3(u.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(r.type))y.call(this,u),w.call(this,u)}function E(){this.data.atHardBreak=!0}function I(){let u=this.resume(),r=this.stack[this.stack.length-1];r.value=u}function j(){let u=this.resume(),r=this.stack[this.stack.length-1];r.value=u}function S(){let u=this.resume(),r=this.stack[this.stack.length-1];r.value=u}function k(){let u=this.stack[this.stack.length-1];if(this.data.inReference){let r=this.data.referenceType||"shortcut";u.type+="Reference",u.referenceType=r,delete u.url,delete u.title}else delete u.identifier,delete u.label;this.data.referenceType=void 0}function b(){let u=this.stack[this.stack.length-1];if(this.data.inReference){let r=this.data.referenceType||"shortcut";u.type+="Reference",u.referenceType=r,delete u.url,delete u.title}else delete u.identifier,delete u.label;this.data.referenceType=void 0}function v(u){let r=this.sliceSerialize(u),H0=this.stack[this.stack.length-2];H0.label=Nk(r),H0.identifier=p2(r).toLowerCase()}function c(){let u=this.stack[this.stack.length-1],r=this.resume(),H0=this.stack[this.stack.length-1];if(this.data.inReference=!0,H0.type==="link"){let A0=u.children;H0.children=A0}else H0.alt=r}function T(){let u=this.resume(),r=this.stack[this.stack.length-1];r.url=u}function e(){let u=this.resume(),r=this.stack[this.stack.length-1];r.title=u}function Z0(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function t(u){let r=this.resume(),H0=this.stack[this.stack.length-1];H0.label=r,H0.identifier=p2(this.sliceSerialize(u)).toLowerCase(),this.data.referenceType="full"}function D0(u){this.data.characterReferenceType=u.type}function p(u){let r=this.sliceSerialize(u),H0=this.data.characterReferenceType,A0;if(H0)A0=dF(r,H0==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else A0=NZ(r);let j0=this.stack[this.stack.length-1];j0.value+=A0}function X0(u){let r=this.stack.pop();r.position.end=r3(u.end)}function K0(u){w.call(this,u);let r=this.stack[this.stack.length-1];r.url=this.sliceSerialize(u)}function Q0(u){w.call(this,u);let r=this.stack[this.stack.length-1];r.url="mailto:"+this.sliceSerialize(u)}function z0(){return{type:"blockquote",children:[]}}function L0(){return{type:"code",lang:null,meta:null,value:""}}function i(){return{type:"inlineCode",value:""}}function B0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $0(){return{type:"emphasis",children:[]}}function J0(){return{type:"heading",depth:0,children:[]}}function n(){return{type:"break"}}function f(){return{type:"html",value:""}}function l(){return{type:"image",title:null,url:"",alt:null}}function m(){return{type:"link",title:null,url:"",children:[]}}function a(u){return{type:"list",ordered:u.type==="listOrdered",start:null,spread:u._spread,children:[]}}function o(u){return{type:"listItem",spread:u._spread,checked:null,children:[]}}function V0(){return{type:"paragraph",children:[]}}function O0(){return{type:"strong",children:[]}}function k0(){return{type:"text",value:""}}function r0(){return{type:"thematicBreak"}}}function r3($){return{line:$.line,column:$.column,offset:$.offset}}function Vk($,Z){let H=-1;while(++H<Z.length){let B=Z[H];if(Array.isArray(B))Vk($,B);else w20($,B)}}function w20($,Z){let H;for(H in Z)if(Ak.call(Z,H))switch(H){case"canContainEols":{let B=Z[H];if(B)$[H].push(...B);break}case"transforms":{let B=Z[H];if(B)$[H].push(...B);break}case"enter":case"exit":{let B=Z[H];if(B)Object.assign($[H],B);break}}}function Lk($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+d3({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+d3({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+d3({start:Z.start,end:Z.end})+") is still open")}function $U($){let Z=this;Z.parser=H;function H(B){return GA(B,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var ZU=-1,LZ=0,M7=1,AZ=2,JJ=3,QJ=4,XJ=5,zJ=6,HU=7,BU=8;var Dk=typeof self==="object"?self:globalThis,E20=($,Z)=>{let H=(J,Q)=>{return $.set(Q,J),J},B=(J)=>{if($.has(J))return $.get(J);let[Q,X]=Z[J];switch(Q){case LZ:case ZU:return H(X,J);case M7:{let z=H([],J);for(let G of X)z.push(B(G));return z}case AZ:{let z=H({},J);for(let[G,F]of X)z[B(G)]=B(F);return z}case JJ:return H(new Date(X),J);case QJ:{let{source:z,flags:G}=X;return H(new RegExp(z,G),J)}case XJ:{let z=H(new Map,J);for(let[G,F]of X)z.set(B(G),B(F));return z}case zJ:{let z=H(new Set,J);for(let G of X)z.add(B(G));return z}case HU:{let{name:z,message:G}=X;return H(new Dk[z](G),J)}case BU:return H(BigInt(X),J);case"BigInt":return H(Object(BigInt(X)),J);case"ArrayBuffer":return H(new Uint8Array(X).buffer,X);case"DataView":{let{buffer:z}=new Uint8Array(X);return H(new DataView(z),X)}}return H(new Dk[Q](X),J)};return B},FA=($)=>E20(new Map,$)(0);var VZ="",{toString:S20}={},{keys:I20}=Object,GJ=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[LZ,Z];let H=S20.call($).slice(8,-1);switch(H){case"Array":return[M7,VZ];case"Object":return[AZ,VZ];case"Date":return[JJ,VZ];case"RegExp":return[QJ,VZ];case"Map":return[XJ,VZ];case"Set":return[zJ,VZ];case"DataView":return[M7,H]}if(H.includes("Array"))return[M7,H];if(H.includes("Error"))return[HU,H];return[AZ,H]},JU=([$,Z])=>$===LZ&&(Z==="function"||Z==="symbol"),R20=($,Z,H,B)=>{let J=(X,z)=>{let G=B.push(X)-1;return H.set(z,G),G},Q=(X)=>{if(H.has(X))return H.get(X);let[z,G]=GJ(X);switch(z){case LZ:{let U=X;switch(G){case"bigint":z=BU,U=X.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);U=null;break;case"undefined":return J([ZU],X)}return J([z,U],X)}case M7:{if(G){let K=X;if(G==="DataView")K=new Uint8Array(X.buffer);else if(G==="ArrayBuffer")K=new Uint8Array(X);return J([G,[...K]],X)}let U=[],Y=J([z,U],X);for(let K of X)U.push(Q(K));return Y}case AZ:{if(G)switch(G){case"BigInt":return J([G,X.toString()],X);case"Boolean":case"Number":case"String":return J([G,X.valueOf()],X)}if(Z&&"toJSON"in X)return Q(X.toJSON());let U=[],Y=J([z,U],X);for(let K of I20(X))if($||!JU(GJ(X[K])))U.push([Q(K),Q(X[K])]);return Y}case JJ:return J([z,X.toISOString()],X);case QJ:{let{source:U,flags:Y}=X;return J([z,{source:U,flags:Y}],X)}case XJ:{let U=[],Y=J([z,U],X);for(let[K,W]of X)if($||!(JU(GJ(K))||JU(GJ(W))))U.push([Q(K),Q(W)]);return Y}case zJ:{let U=[],Y=J([z,U],X);for(let K of X)if($||!JU(GJ(K)))U.push(Q(K));return Y}}let{message:F}=X;return J([z,{name:G,message:F}],X)};return Q},UA=($,{json:Z,lossy:H}={})=>{let B=[];return R20(!(Z||H),!!Z,new Map,B)($),B};var DZ=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?FA(UA($,Z)):structuredClone($):($,Z)=>FA(UA($,Z));function k20($,Z){let H=[{type:"text",value:"↩"}];if(Z>1)H.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return H}function b20($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function qk($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=$.options.footnoteBackContent||k20,B=$.options.footnoteBackLabel||b20,J=$.options.footnoteLabel||"Footnotes",Q=$.options.footnoteLabelTagName||"h2",X=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],G=-1;while(++G<$.footnoteOrder.length){let F=$.footnoteById.get($.footnoteOrder[G]);if(!F)continue;let U=$.all(F),Y=String(F.identifier).toUpperCase(),K=G8(Y.toLowerCase()),W=0,N=[],L=$.footnoteCounts.get(Y);while(L!==void 0&&++W<=L){if(N.length>0)N.push({type:"text",value:" "});let D=typeof H==="string"?H:H(G,W);if(typeof D==="string")D={type:"text",value:D};N.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+K+(W>1?"-"+W:""),dataFootnoteBackref:"",ariaLabel:typeof B==="string"?B:B(G,W),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}let V=U[U.length-1];if(V&&V.type==="element"&&V.tagName==="p"){let D=V.children[V.children.length-1];if(D&&D.type==="text")D.value+=" ";else V.children.push({type:"text",value:" "});V.children.push(...N)}else U.push(...N);let A={type:"element",tagName:"li",properties:{id:Z+"fn-"+K},children:$.wrap(U,!0)};$.patch(F,A),z.push(A)}if(z.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Q,properties:{...DZ(X),id:"footnote-label"},children:[{type:"text",value:J}]},{type:"text",value:`
34
- `},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
35
- `}]}}var M9=function($){if($===null||$===void 0)return v20;if(typeof $==="function")return QU($);if(typeof $==="object")return Array.isArray($)?y20($):h20($);if(typeof $==="string")return x20($);throw Error("Expected function, string, or object as test")};function y20($){let Z=[],H=-1;while(++H<$.length)Z[H]=M9($[H]);return QU(B);function B(...J){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,J))return!0;return!1}}function h20($){let Z=$;return QU(H);function H(B){let J=B,Q;for(Q in $)if(J[Q]!==Z[Q])return!1;return!0}}function x20($){return QU(Z);function Z(H){return H&&H.type===$}}function QU($){return Z;function Z(H,B,J){return Boolean(g20(H)&&$.call(this,H,typeof B==="number"?B:void 0,J||void 0))}}function v20(){return!0}function g20($){return $!==null&&typeof $==="object"&&"type"in $}function Mk($){return $}var Pk=[],XU=!0,P7=!1,zU="skip";function FJ($,Z,H,B){let J;if(typeof Z==="function"&&typeof H!=="function")B=H,H=Z;else J=Z;let Q=M9(J),X=B?-1:1;z($,void 0,[])();function z(G,F,U){let Y=G&&typeof G==="object"?G:{};if(typeof Y.type==="string"){let W=typeof Y.tagName==="string"?Y.tagName:typeof Y.name==="string"?Y.name:void 0;Object.defineProperty(K,"name",{value:"node ("+Mk(G.type+(W?"<"+W+">":""))+")"})}return K;function K(){let W=Pk,N,L,V;if(!Z||Q(G,F,U[U.length-1]||void 0)){if(W=f20(H(G,U)),W[0]===P7)return W}if("children"in G&&G.children){let A=G;if(A.children&&W[0]!==zU){L=(B?A.children.length:-1)+X,V=U.concat(A);while(L>-1&&L<A.children.length){let D=A.children[L];if(N=z(D,L,V)(),N[0]===P7)return N;L=typeof N[1]==="number"?N[1]:L+X}}}return W}}}function f20($){if(Array.isArray($))return $;if(typeof $==="number")return[XU,$];return $===null||$===void 0?Pk:[$]}function u9($,Z,H,B){let J,Q,X;if(typeof Z==="function"&&typeof H!=="function")Q=void 0,X=Z,J=H;else Q=Z,X=H,J=B;FJ($,Q,z,J);function z(G,F){let U=F[F.length-1],Y=U?U.children.indexOf(G):void 0;return X(G,Y,U)}}function _k($,Z){let H={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,H),$.applyData(Z,H)}function Ok($,Z){let H={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,H),[$.applyData(Z,H),{type:"text",value:`
36
- `}]}function jk($,Z){let H=Z.value?Z.value+`
37
- `:"",B={},J=Z.lang?Z.lang.split(/\s+/):[];if(J.length>0)B.className=["language-"+J[0]];let Q={type:"element",tagName:"code",properties:B,children:[{type:"text",value:H}]};if(Z.meta)Q.data={meta:Z.meta};return $.patch(Z,Q),Q=$.applyData(Z,Q),Q={type:"element",tagName:"pre",properties:{},children:[Q]},$.patch(Z,Q),Q}function Tk($,Z){let H={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function Ck($,Z){let H={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function wk($,Z){let H=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",B=String(Z.identifier).toUpperCase(),J=G8(B.toLowerCase()),Q=$.footnoteOrder.indexOf(B),X,z=$.footnoteCounts.get(B);if(z===void 0)z=0,$.footnoteOrder.push(B),X=$.footnoteOrder.length;else X=Q+1;z+=1,$.footnoteCounts.set(B,z);let G={type:"element",tagName:"a",properties:{href:"#"+H+"fn-"+J,id:H+"fnref-"+J+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(X)}]};$.patch(Z,G);let F={type:"element",tagName:"sup",properties:{},children:[G]};return $.patch(Z,F),$.applyData(Z,F)}function Ek($,Z){let H={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function Sk($,Z){if($.options.allowDangerousHtml){let H={type:"raw",value:Z.value};return $.patch(Z,H),$.applyData(Z,H)}return}function GU($,Z){let H=Z.referenceType,B="]";if(H==="collapsed")B+="[]";else if(H==="full")B+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+B}];let J=$.all(Z),Q=J[0];if(Q&&Q.type==="text")Q.value="["+Q.value;else J.unshift({type:"text",value:"["});let X=J[J.length-1];if(X&&X.type==="text")X.value+=B;else J.push({type:"text",value:B});return J}function Ik($,Z){let H=String(Z.identifier).toUpperCase(),B=$.definitionById.get(H);if(!B)return GU($,Z);let J={src:G8(B.url||""),alt:Z.alt};if(B.title!==null&&B.title!==void 0)J.title=B.title;let Q={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function Rk($,Z){let H={src:G8(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)H.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)H.title=Z.title;let B={type:"element",tagName:"img",properties:H,children:[]};return $.patch(Z,B),$.applyData(Z,B)}function kk($,Z){let H={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,H);let B={type:"element",tagName:"code",properties:{},children:[H]};return $.patch(Z,B),$.applyData(Z,B)}function bk($,Z){let H=String(Z.identifier).toUpperCase(),B=$.definitionById.get(H);if(!B)return GU($,Z);let J={href:G8(B.url||"")};if(B.title!==null&&B.title!==void 0)J.title=B.title;let Q={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function yk($,Z){let H={href:G8(Z.url)};if(Z.title!==null&&Z.title!==void 0)H.title=Z.title;let B={type:"element",tagName:"a",properties:H,children:$.all(Z)};return $.patch(Z,B),$.applyData(Z,B)}function hk($,Z,H){let B=$.all(Z),J=H?m20(H):xk(Z),Q={},X=[];if(typeof Z.checked==="boolean"){let U=B[0],Y;if(U&&U.type==="element"&&U.tagName==="p")Y=U;else Y={type:"element",tagName:"p",properties:{},children:[]},B.unshift(Y);if(Y.children.length>0)Y.children.unshift({type:"text",value:" "});Y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),Q.className=["task-list-item"]}let z=-1;while(++z<B.length){let U=B[z];if(J||z!==0||U.type!=="element"||U.tagName!=="p")X.push({type:"text",value:`
38
- `});if(U.type==="element"&&U.tagName==="p"&&!J)X.push(...U.children);else X.push(U)}let G=B[B.length-1];if(G&&(J||G.type!=="element"||G.tagName!=="p"))X.push({type:"text",value:`
39
- `});let F={type:"element",tagName:"li",properties:Q,children:X};return $.patch(Z,F),$.applyData(Z,F)}function m20($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let H=$.children,B=-1;while(!Z&&++B<H.length)Z=xk(H[B])}return Z}function xk($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function vk($,Z){let H={},B=$.all(Z),J=-1;if(typeof Z.start==="number"&&Z.start!==1)H.start=Z.start;while(++J<B.length){let X=B[J];if(X.type==="element"&&X.tagName==="li"&&X.properties&&Array.isArray(X.properties.className)&&X.properties.className.includes("task-list-item")){H.className=["contains-task-list"];break}}let Q={type:"element",tagName:Z.ordered?"ol":"ul",properties:H,children:$.wrap(B,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function gk($,Z){let H={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function fk($,Z){let H={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,H),$.applyData(Z,H)}function mk($,Z){let H={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function pk($,Z){let H=$.all(Z),B=H.shift(),J=[];if(B){let X={type:"element",tagName:"thead",properties:{},children:$.wrap([B],!0)};$.patch(Z.children[0],X),J.push(X)}if(H.length>0){let X={type:"element",tagName:"tbody",properties:{},children:$.wrap(H,!0)},z=WZ(Z.children[1]),G=uF(Z.children[Z.children.length-1]);if(z&&G)X.position={start:z,end:G};J.push(X)}let Q={type:"element",tagName:"table",properties:{},children:$.wrap(J,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function uk($,Z,H){let B=H?H.children:void 0,Q=(B?B.indexOf(Z):1)===0?"th":"td",X=H&&H.type==="table"?H.align:void 0,z=X?X.length:Z.children.length,G=-1,F=[];while(++G<z){let Y=Z.children[G],K={},W=X?X[G]:void 0;if(W)K.align=W;let N={type:"element",tagName:Q,properties:K,children:[]};if(Y)N.children=$.all(Y),$.patch(Y,N),N=$.applyData(Y,N);F.push(N)}let U={type:"element",tagName:"tr",properties:{},children:$.wrap(F,!0)};return $.patch(Z,U),$.applyData(Z,U)}function ck($,Z){let H={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function lk($){let Z=String($),H=/\r?\n|\r/g,B=H.exec(Z),J=0,Q=[];while(B)Q.push(dk(Z.slice(J,B.index),J>0,!0),B[0]),J=B.index+B[0].length,B=H.exec(Z);return Q.push(dk(Z.slice(J),J>0,!1)),Q.join("")}function dk($,Z,H){let B=0,J=$.length;if(Z){let Q=$.codePointAt(B);while(Q===9||Q===32)B++,Q=$.codePointAt(B)}if(H){let Q=$.codePointAt(J-1);while(Q===9||Q===32)J--,Q=$.codePointAt(J-1)}return J>B?$.slice(B,J):""}function ik($,Z){let H={type:"text",value:lk(String(Z.value))};return $.patch(Z,H),$.applyData(Z,H)}function rk($,Z){let H={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,H),$.applyData(Z,H)}var ak={blockquote:_k,break:Ok,code:jk,delete:Tk,emphasis:Ck,footnoteReference:wk,heading:Ek,html:Sk,imageReference:Ik,image:Rk,inlineCode:kk,linkReference:bk,link:yk,listItem:hk,list:vk,paragraph:gk,root:fk,strong:mk,table:pk,tableCell:ck,tableRow:uk,text:ik,thematicBreak:rk,toml:FU,yaml:FU,definition:FU,footnoteDefinition:FU};function FU(){return}var YA={}.hasOwnProperty,p20={};function ok($,Z){let H=Z||p20,B=new Map,J=new Map,Q=new Map,X={...ak,...H.handlers},z={all:F,applyData:c20,definitionById:B,footnoteById:J,footnoteCounts:Q,footnoteOrder:[],handlers:X,one:G,options:H,patch:u20,wrap:l20};return u9($,function(U){if(U.type==="definition"||U.type==="footnoteDefinition"){let Y=U.type==="definition"?B:J,K=String(U.identifier).toUpperCase();if(!Y.has(K))Y.set(K,U)}}),z;function G(U,Y){let K=U.type,W=z.handlers[K];if(YA.call(z.handlers,K)&&W)return W(z,U,Y);if(z.options.passThrough&&z.options.passThrough.includes(K)){if("children"in U){let{children:L,...V}=U,A=DZ(V);return A.children=z.all(U),A}return DZ(U)}return(z.options.unknownHandler||d20)(z,U,Y)}function F(U){let Y=[];if("children"in U){let K=U.children,W=-1;while(++W<K.length){let N=z.one(K[W],U);if(N){if(W&&K[W-1].type==="break"){if(!Array.isArray(N)&&N.type==="text")N.value=nk(N.value);if(!Array.isArray(N)&&N.type==="element"){let L=N.children[0];if(L&&L.type==="text")L.value=nk(L.value)}}if(Array.isArray(N))Y.push(...N);else Y.push(N)}}}return Y}}function u20($,Z){if($.position)Z.position=mL($)}function c20($,Z){let H=Z;if($&&$.data){let B=$.data.hName,J=$.data.hChildren,Q=$.data.hProperties;if(typeof B==="string")if(H.type==="element")H.tagName=B;else{let X="children"in H?H.children:[H];H={type:"element",tagName:B,properties:{},children:X}}if(H.type==="element"&&Q)Object.assign(H.properties,DZ(Q));if("children"in H&&H.children&&J!==null&&J!==void 0)H.children=J}return H}function d20($,Z){let H=Z.data||{},B="value"in Z&&!(YA.call(H,"hProperties")||YA.call(H,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,B),$.applyData(Z,B)}function l20($,Z){let H=[],B=-1;if(Z)H.push({type:"text",value:`
40
- `});while(++B<$.length){if(B)H.push({type:"text",value:`
41
- `});H.push($[B])}if(Z&&$.length>0)H.push({type:"text",value:`
42
- `});return H}function nk($){let Z=0,H=$.charCodeAt(Z);while(H===9||H===32)Z++,H=$.charCodeAt(Z);return $.slice(Z)}function UU($,Z){let H=ok($,Z),B=H.one($,void 0),J=qk(H),Q=Array.isArray(B)?{type:"root",children:B}:B||{type:"root",children:[]};if(J)p1("children"in Q),Q.children.push({type:"text",value:`
43
- `},J);return Q}function YU($,Z){if($&&"run"in $)return async function(H,B){let J=UU(H,{file:B,...Z});await $.run(J,B)};return function(H,B){return UU(H,{file:B,...$||Z})}}function KA($){if($)throw $}var NU=O(Qb(),1);function UJ($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function WA(){let $=[],Z={run:H,use:B};return Z;function H(...J){let Q=-1,X=J.pop();if(typeof X!=="function")throw TypeError("Expected function as last argument, not "+X);z(null,...J);function z(G,...F){let U=$[++Q],Y=-1;if(G){X(G);return}while(++Y<J.length)if(F[Y]===null||F[Y]===void 0)F[Y]=J[Y];if(J=F,U)Xb(U,z)(...F);else X(null,...F)}}function B(J){if(typeof J!=="function")throw TypeError("Expected `middelware` to be a function, not "+J);return $.push(J),Z}}function Xb($,Z){let H;return B;function B(...X){let z=$.length>X.length,G;if(z)X.push(J);try{G=$.apply(this,X)}catch(F){let U=F;if(z&&H)throw U;return J(U)}if(!z)if(G&&G.then&&typeof G.then==="function")G.then(Q,J);else if(G instanceof Error)J(G);else Q(G)}function J(X,...z){if(!H)H=!0,Z(X,...z)}function Q(X){J(null,X)}}var E8={basename:i20,dirname:r20,extname:a20,join:n20,sep:"/"};function i20($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');YJ($);let H=0,B=-1,J=$.length,Q;if(Z===void 0||Z.length===0||Z.length>$.length){while(J--)if($.codePointAt(J)===47){if(Q){H=J+1;break}}else if(B<0)Q=!0,B=J+1;return B<0?"":$.slice(H,B)}if(Z===$)return"";let X=-1,z=Z.length-1;while(J--)if($.codePointAt(J)===47){if(Q){H=J+1;break}}else{if(X<0)Q=!0,X=J+1;if(z>-1)if($.codePointAt(J)===Z.codePointAt(z--)){if(z<0)B=J}else z=-1,B=X}if(H===B)B=X;else if(B<0)B=$.length;return $.slice(H,B)}function r20($){if(YJ($),$.length===0)return".";let Z=-1,H=$.length,B;while(--H)if($.codePointAt(H)===47){if(B){Z=H;break}}else if(!B)B=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function a20($){YJ($);let Z=$.length,H=-1,B=0,J=-1,Q=0,X;while(Z--){let z=$.codePointAt(Z);if(z===47){if(X){B=Z+1;break}continue}if(H<0)X=!0,H=Z+1;if(z===46){if(J<0)J=Z;else if(Q!==1)Q=1}else if(J>-1)Q=-1}if(J<0||H<0||Q===0||Q===1&&J===H-1&&J===B+1)return"";return $.slice(J,H)}function n20(...$){let Z=-1,H;while(++Z<$.length)if(YJ($[Z]),$[Z])H=H===void 0?$[Z]:H+"/"+$[Z];return H===void 0?".":o20(H)}function o20($){YJ($);let Z=$.codePointAt(0)===47,H=s20($,!Z);if(H.length===0&&!Z)H=".";if(H.length>0&&$.codePointAt($.length-1)===47)H+="/";return Z?"/"+H:H}function s20($,Z){let H="",B=0,J=-1,Q=0,X=-1,z,G;while(++X<=$.length){if(X<$.length)z=$.codePointAt(X);else if(z===47)break;else z=47;if(z===47){if(J===X-1||Q===1);else if(J!==X-1&&Q===2){if(H.length<2||B!==2||H.codePointAt(H.length-1)!==46||H.codePointAt(H.length-2)!==46){if(H.length>2){if(G=H.lastIndexOf("/"),G!==H.length-1){if(G<0)H="",B=0;else H=H.slice(0,G),B=H.length-1-H.lastIndexOf("/");J=X,Q=0;continue}}else if(H.length>0){H="",B=0,J=X,Q=0;continue}}if(Z)H=H.length>0?H+"/..":"..",B=2}else{if(H.length>0)H+="/"+$.slice(J+1,X);else H=$.slice(J+1,X);B=X-J-1}J=X,Q=0}else if(z===46&&Q>-1)Q++;else Q=-1}return H}function YJ($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var zb={cwd:t20};function t20(){return"/"}function qZ($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function Gb($){if(typeof $==="string")$=new URL($);else if(!qZ($)){let Z=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+$+"`");throw Z.code="ERR_INVALID_ARG_TYPE",Z}if($.protocol!=="file:"){let Z=TypeError("The URL must be of scheme file");throw Z.code="ERR_INVALID_URL_SCHEME",Z}return e20($)}function e20($){if($.hostname!==""){let B=TypeError('File URL host must be "localhost" or empty on darwin');throw B.code="ERR_INVALID_FILE_URL_HOST",B}let Z=$.pathname,H=-1;while(++H<Z.length)if(Z.codePointAt(H)===37&&Z.codePointAt(H+1)===50){let B=Z.codePointAt(H+2);if(B===70||B===102){let J=TypeError("File URL path must not include encoded / characters");throw J.code="ERR_INVALID_FILE_URL_PATH",J}}return decodeURIComponent(Z)}var NA=["history","path","basename","stem","extname","dirname"];class MZ{constructor($){let Z;if(!$)Z={};else if(qZ($))Z={path:$};else if(typeof $==="string"||$40($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":zb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let H=-1;while(++H<NA.length){let J=NA[H];if(J in Z&&Z[J]!==void 0&&Z[J]!==null)this[J]=J==="history"?[...Z[J]]:Z[J]}let B;for(B in Z)if(!NA.includes(B))this[B]=Z[B]}get basename(){return typeof this.path==="string"?E8.basename(this.path):void 0}set basename($){AA($,"basename"),LA($,"basename"),this.path=E8.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?E8.dirname(this.path):void 0}set dirname($){Fb(this.basename,"dirname"),this.path=E8.join($||"",this.basename)}get extname(){return typeof this.path==="string"?E8.extname(this.path):void 0}set extname($){if(LA($,"extname"),Fb(this.dirname,"extname"),$){if($.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if($.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=E8.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(qZ($))$=Gb($);if(AA($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?E8.basename(this.path,this.extname):void 0}set stem($){AA($,"stem"),LA($,"stem"),this.path=E8.join(this.dirname||"",$+(this.extname||""))}fail($,Z,H){let B=this.message($,Z,H);throw B.fatal=!0,B}info($,Z,H){let B=this.message($,Z,H);return B.fatal=void 0,B}message($,Z,H){let B=new t5($,Z,H);if(this.path)B.name=this.path+":"+B.name,B.file=this.path;return B.fatal=!1,this.messages.push(B),B}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function LA($,Z){if($&&$.includes(E8.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+E8.sep+"`")}function AA($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function Fb($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function $40($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var Ub=function($){let B=this.constructor.prototype,J=B[$],Q=function(){return J.apply(Q,arguments)};return Object.setPrototypeOf(Q,B),Q};var Z40={}.hasOwnProperty;class MA extends Ub{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=WA()}copy(){let $=new MA,Z=-1;while(++Z<this.attachers.length){let H=this.attachers[Z];$.use(...H)}return $.data(NU.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return qA("data",this.frozen),this.namespace[$]=Z,this;return Z40.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return qA("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[Z,...H]=this.attachers[this.freezeIndex];if(H[0]===!1)continue;if(H[0]===!0)H[0]=void 0;let B=Z.call($,...H);if(typeof B==="function")this.transformers.use(B)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=WU($),H=this.parser||this.Parser;return VA("parse",H),H(String(Z),Z)}process($,Z){let H=this;return this.freeze(),VA("process",this.parser||this.Parser),DA("process",this.compiler||this.Compiler),Z?B(void 0,Z):new Promise(B);function B(J,Q){let X=WU($),z=H.parse(X);H.run(z,X,function(F,U,Y){if(F||!U||!Y)return G(F);let K=U,W=H.stringify(K,Y);if(B40(W))Y.value=W;else Y.result=W;G(F,Y)});function G(F,U){if(F||!U)Q(F);else if(J)J(U);else p1(Z,"`done` is defined if `resolve` is not"),Z(void 0,U)}}}processSync($){let Z=!1,H;return this.freeze(),VA("processSync",this.parser||this.Parser),DA("processSync",this.compiler||this.Compiler),this.process($,B),Kb("processSync","process",Z),p1(H,"we either bailed on an error or have a tree"),H;function B(J,Q){Z=!0,KA(J),H=Q}}run($,Z,H){Yb($),this.freeze();let B=this.transformers;if(!H&&typeof Z==="function")H=Z,Z=void 0;return H?J(void 0,H):new Promise(J);function J(Q,X){p1(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=WU(Z);B.run($,z,G);function G(F,U,Y){let K=U||$;if(F)X(F);else if(Q)Q(K);else p1(H,"`done` is defined if `resolve` is not"),H(void 0,K,Y)}}}runSync($,Z){let H=!1,B;return this.run($,Z,J),Kb("runSync","run",H),p1(B,"we either bailed on an error or have a tree"),B;function J(Q,X){KA(Q),B=X,H=!0}}stringify($,Z){this.freeze();let H=WU(Z),B=this.compiler||this.Compiler;return DA("stringify",B),Yb($),B($,H)}use($,...Z){let H=this.attachers,B=this.namespace;if(qA("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,Z);else if(typeof $==="object")if(Array.isArray($))X($);else Q($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function J(G){if(typeof G==="function")z(G,[]);else if(typeof G==="object")if(Array.isArray(G)){let[F,...U]=G;z(F,U)}else Q(G);else throw TypeError("Expected usable value, not `"+G+"`")}function Q(G){if(!("plugins"in G)&&!("settings"in G))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(X(G.plugins),G.settings)B.settings=NU.default(!0,B.settings,G.settings)}function X(G){let F=-1;if(G===null||G===void 0);else if(Array.isArray(G))while(++F<G.length){let U=G[F];J(U)}else throw TypeError("Expected a list of plugins, not `"+G+"`")}function z(G,F){let U=-1,Y=-1;while(++U<H.length)if(H[U][0]===G){Y=U;break}if(Y===-1)H.push([G,...F]);else if(F.length>0){let[K,...W]=F,N=H[Y][1];if(UJ(N)&&UJ(K))K=NU.default(!0,N,K);H[Y]=[G,K,...W]}}}}var PA=new MA().freeze();function VA($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function DA($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function qA($,Z){if(Z)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yb($){if(!UJ($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function Kb($,Z,H){if(!H)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function WU($){return H40($)?$:new MZ($)}function H40($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function B40($){return typeof $==="string"||J40($)}function J40($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var Q40="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Wb=[],Nb={allowDangerousHtml:!0},X40=/^(https?|ircs?|mailto|xmpp)$/i,z40=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function LU($){let Z=G40($),H=F40($);return U40(Z.runSync(Z.parse(H),H),$)}function G40($){let Z=$.rehypePlugins||Wb,H=$.remarkPlugins||Wb,B=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...Nb}:Nb;return PA().use($U).use(H).use(YU,B).use(Z)}function F40($){let Z=$.children||"",H=new MZ;if(typeof Z==="string")H.value=Z;else xF("Unexpected value `"+Z+"` for `children` prop, expected `string`");return H}function U40($,Z){let{allowedElements:H,allowElement:B,components:J,disallowedElements:Q,skipHtml:X,unwrapDisallowed:z}=Z,G=Z.urlTransform||Ab;for(let U of z40)if(Object.hasOwn(Z,U.from))xF("Unexpected `"+U.from+"` prop, "+(U.to?"use `"+U.to+"` instead":"remove it")+" (see <"+Q40+"#"+U.id+"> for more info)");if(H&&Q)xF("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return u9($,F),cL($,{Fragment:PZ.Fragment,components:J,ignoreInvalidStyle:!0,jsx:PZ.jsx,jsxs:PZ.jsxs,passKeys:!0,passNode:!0});function F(U,Y,K){if(U.type==="raw"&&K&&typeof Y==="number"){if(X)K.children.splice(Y,1);else K.children[Y]={type:"text",value:U.value};return Y}if(U.type==="element"){let W;for(W in tB)if(Object.hasOwn(tB,W)&&Object.hasOwn(U.properties,W)){let N=U.properties[W],L=tB[W];if(L===null||L.includes(U.tagName))U.properties[W]=G(String(N||""),W,U)}}if(U.type==="element"){let W=H?!H.includes(U.tagName):Q?Q.includes(U.tagName):!1;if(!W&&B&&typeof Y==="number")W=!B(U,Y,K);if(W&&K&&typeof Y==="number"){if(z&&U.children)K.children.splice(Y,1,...U.children);else K.children.splice(Y,1);return Y}}}}function Ab($){let Z=$.indexOf(":"),H=$.indexOf("?"),B=$.indexOf("#"),J=$.indexOf("/");if(Z===-1||J!==-1&&Z>J||H!==-1&&Z>H||B!==-1&&Z>B||X40.test($.slice(0,Z)))return $;return""}var AU=function($,Z,H){let B=M9(H);if(!$||!$.type||!$.children)throw Error("Expected parent node");if(typeof Z==="number"){if(Z<0||Z===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(Z=$.children.indexOf(Z),Z<0)throw Error("Expected child node or index");while(++Z<$.children.length)if(B($.children[Z],Z,$))return $.children[Z];return};var c9=function($){if($===null||$===void 0)return W40;if(typeof $==="string")return K40($);if(typeof $==="object")return Y40($);if(typeof $==="function")return _A($);throw Error("Expected function, string, or array as `test`")};function Y40($){let Z=[],H=-1;while(++H<$.length)Z[H]=c9($[H]);return _A(B);function B(...J){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,J))return!0;return!1}}function K40($){return _A(Z);function Z(H){return H.tagName===$}}function _A($){return Z;function Z(H,B,J){return Boolean(N40(H)&&$.call(this,H,typeof B==="number"?B:void 0,J||void 0))}}function W40($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function N40($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var Vb=/\n/g,Db=/[\t ]+/g,OA=c9("br"),qb=c9(P40),L40=c9("p"),Mb=c9("tr"),A40=c9(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",M40,_40]),Pb=c9(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function jA($,Z){let H=Z||{},B="children"in $?$.children:[],J=Pb($),Q=jb($,{whitespace:H.whitespace||"normal",breakBefore:!1,breakAfter:!1}),X=[];if($.type==="text"||$.type==="comment")X.push(...Ob($,{whitespace:Q,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<B.length)X.push(..._b(B[z],$,{whitespace:Q,breakBefore:z?void 0:J,breakAfter:z<B.length-1?OA(B[z+1]):J}));let G=[],F;z=-1;while(++z<X.length){let U=X[z];if(typeof U==="number"){if(F!==void 0&&U>F)F=U}else if(U){if(F!==void 0&&F>-1)G.push(`
44
- `.repeat(F)||" ");F=-1,G.push(U)}}return G.join("")}function _b($,Z,H){if($.type==="element")return V40($,Z,H);if($.type==="text")return H.whitespace==="normal"?Ob($,H):D40($);return[]}function V40($,Z,H){let B=jb($,H),J=$.children||[],Q=-1,X=[];if(A40($))return X;let z,G;if(OA($))G=`
45
- `;else if(Mb($)&&AU(Z,$,Mb))G=`
46
- `;else if(L40($))z=2,G=2;else if(Pb($))z=1,G=1;while(++Q<J.length)X=X.concat(_b(J[Q],$,{whitespace:B,breakBefore:Q?void 0:z,breakAfter:Q<J.length-1?OA(J[Q+1]):G}));if(qb($)&&AU(Z,$,qb))X.push("\t");if(z)X.unshift(z);if(G)X.push(G);return X}function Ob($,Z){let H=String($.value),B=[],J=[],Q=0;while(Q<=H.length){Vb.lastIndex=Q;let G=Vb.exec(H),F=G&&"index"in G?G.index:H.length;B.push(q40(H.slice(Q,F).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),Q===0?Z.breakBefore:!0,F===H.length?Z.breakAfter:!0)),Q=F+1}let X=-1,z;while(++X<B.length)if(B[X].charCodeAt(B[X].length-1)===8203||X<B.length-1&&B[X+1].charCodeAt(0)===8203)J.push(B[X]),z=void 0;else if(B[X]){if(typeof z==="number")J.push(z);J.push(B[X]),z=0}else if(X===0||X===B.length-1)J.push(0);return J}function D40($){return[String($.value)]}function q40($,Z,H){let B=[],J=0,Q;while(J<$.length){Db.lastIndex=J;let X=Db.exec($);if(Q=X?X.index:$.length,!J&&!Q&&X&&!Z)B.push("");if(J!==Q)B.push($.slice(J,Q));J=X?Q+X[0].length:Q}if(J!==Q&&!H)B.push("");return B.join(" ")}function jb($,Z){if($.type==="element"){let H=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return H.wrap?"pre-wrap":"pre";case"td":case"th":return H.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function M40($){return Boolean(($.properties||{}).hidden)}function P40($){return $.tagName==="td"||$.tagName==="th"}function _40($){return $.tagName==="dialog"&&!($.properties||{}).open}function O40($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),B="decltype\\(auto\\)",J="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",F={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(F,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",N=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],L=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],V=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:L,keyword:N,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:V},M={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},P=[M,Y,z,H,$.C_BLOCK_COMMENT_MODE,U,F],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:P.concat([{begin:/\(/,end:/\)/,keywords:_,contains:P.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:_,relevance:0},{begin:W,returnBegin:!0,contains:[K],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[F,U]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,F,U,z,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,F,U,z]}]},z,H,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(C,R,M,P,[Y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Tb($){let Z={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},H=O40($),B=H.keywords;return B.type=[...B.type,...Z.type],B.literal=[...B.literal,...Z.literal],B.built_in=[...B.built_in,...Z.built_in],B._hints=Z._hints,H.name="Arduino",H.aliases=["ino"],H.supersetOf="cpp",H}function Cb($){let Z=$.regex,H={},B={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[H]}]};Object.assign(H,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},B]});let J={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},Q=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),X={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},z={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,H,J]};J.contains.push(z);let G={match:/\\"/},F={className:"string",begin:/'/,end:/'/},U={match:/\\'/},Y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,H]},K=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],W=$.SHEBANG({binary:`(${K.join("|")})`,relevance:10}),N={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],V=["true","false"],A={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],q=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:L,literal:V,built_in:[...D,...q,"set","shopt",..._,...M]},contains:[W,$.SHEBANG(),N,Y,Q,X,A,z,G,F,U,H]}}function wb($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),B="decltype\\(auto\\)",J="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",F={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(F,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",V={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},A=[Y,z,H,$.C_BLOCK_COMMENT_MODE,U,F],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:V,contains:A.concat([{begin:/\(/,end:/\)/,keywords:V,contains:A.concat(["self"]),relevance:0}]),relevance:0},q={begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:V,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:V,relevance:0},{begin:W,returnBegin:!0,contains:[$.inherit(K,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,F,U,z,{begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,F,U,z]}]},z,H,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C",aliases:["h"],keywords:V,disableAutodetect:!0,illegal:"</",contains:[].concat(D,q,A,[Y,{begin:$.IDENT_RE+"::",keywords:V},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:Y,strings:F,keywords:V}}}function Eb($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),B="decltype\\(auto\\)",J="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",F={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},U={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(F,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},K={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",N=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],L=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],V=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:L,keyword:N,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:V},M={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},P=[M,Y,z,H,$.C_BLOCK_COMMENT_MODE,U,F],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:P.concat([{begin:/\(/,end:/\)/,keywords:_,contains:P.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:_,relevance:0},{begin:W,returnBegin:!0,contains:[K],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[F,U]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,F,U,z,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,F,U,z]}]},z,H,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(C,R,M,P,[Y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Sb($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],H=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],B=["default","false","null","true"],J=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],Q=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],X={keyword:J.concat(Q),built_in:Z,literal:B},z=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),G={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},F={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},U={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},Y=$.inherit(U,{illegal:/\n/}),K={className:"subst",begin:/\{/,end:/\}/,keywords:X},W=$.inherit(K,{illegal:/\n/}),N={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,W]},L={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},K]},V=$.inherit(L,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},W]});K.contains=[L,N,U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.C_BLOCK_COMMENT_MODE],W.contains=[V,N,Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let A={variants:[F,L,N,U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},q=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:X,illegal:/::/,contains:[$.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,G,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},z,D,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,D,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+q+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:X,contains:[{beginKeywords:H.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:X,relevance:0,contains:[A,G,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},_]}}var j40=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},T40=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],C40=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],w40=[...T40,...C40],E40=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),S40=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),I40=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),R40=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Ib($){let Z=$.regex,H=j40($),B={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},J="and or not only",Q=/@-?\w[\w]*(-\w+)*/,X="[a-zA-Z-][a-zA-Z0-9_-]*",z=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[H.BLOCK_COMMENT,B,H.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},H.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+S40.join("|")+")"},{begin:":(:)?("+I40.join("|")+")"}]},H.CSS_VARIABLE,{className:"attribute",begin:"\\b("+R40.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[H.BLOCK_COMMENT,H.HEXCOLOR,H.IMPORTANT,H.CSS_NUMBER_MODE,...z,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...z,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},H.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:Q},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:E40.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,H.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+w40.join("|")+")\\b"}]}}function Rb($){let Z=$.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:Z.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:Z.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function kb($){let Q={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:Q,illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"string",variants:[$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[$.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Q,illegal:/["']/}]}]}}function bb($){let Z=$.regex,H=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[$.HASH_COMMENT_MODE,$.QUOTE_STRING_MODE,$.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:Z.concat(H,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function yb($){let Z=$.regex,H={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},B=$.COMMENT();B.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let J={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},Q={className:"literal",begin:/\bon|off|true|false|yes|no\b/},X={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},z={begin:/\[/,end:/\]/,contains:[B,Q,J,X,H,"self"],relevance:0},G=/[A-Za-z0-9_-]+/,F=/"(\\"|[^"])*"/,U=/'[^']*'/,Y=Z.either(G,F,U),K=Z.concat(Y,"(\\s*\\.\\s*",Y,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[B,{className:"section",begin:/\[+/,end:/\]+/},{begin:K,className:"attr",starts:{end:/$/,contains:[B,z,Q,J,X,H]}}]}}var _Z="[0-9](_*[0-9])*",VU=`\\.(${_Z})`,DU="[0-9a-fA-F](_*[0-9a-fA-F])*",hb={className:"number",variants:[{begin:`(\\b(${_Z})((${VU})|\\.)?|(${VU}))[eE][+-]?(${_Z})[fFdD]?\\b`},{begin:`\\b(${_Z})((${VU})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${VU})[fFdD]?\\b`},{begin:`\\b(${_Z})[fFdD]\\b`},{begin:`\\b0[xX]((${DU})\\.?|(${DU})?\\.(${DU}))[pP][+-]?(${_Z})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${DU})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function xb($,Z,H){if(H===-1)return"";return $.replace(Z,(B)=>{return xb($,Z,H-1)})}function vb($){let Z=$.regex,H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",B="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+xb("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),G={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},F={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},U={className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:G,illegal:/<\/|#/,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[$.BACKSLASH_ESCAPE]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[Z.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[U,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+B+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:G,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[F,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,hb,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},hb,F]}}var k40=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],b40=["true","false","null","undefined","NaN","Infinity"],gb=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],fb=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mb=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],y40=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h40=[].concat(mb,gb,fb);function pb($){let Z=$.regex,H=(v,{after:c})=>{let T="</"+v[0].slice(1);return v.input.indexOf(T,c)!==-1},B="[A-Za-z$_][0-9A-Za-z$_]*",J={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,c)=>{let T=v[0].length+v.index,e=v.input[T];if(e==="<"||e===","){c.ignoreMatch();return}if(e===">"){if(!H(v,{after:T}))c.ignoreMatch()}let Z0,x=v.input.substring(T);if(Z0=x.match(/^\s*=/)){c.ignoreMatch();return}if(Z0=x.match(/^\s+extends\s+/)){if(Z0.index===0){c.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:k40,literal:b40,built_in:h40,"variable.language":y40},G="[0-9](_?[0-9])*",F="\\.([0-9](_?[0-9])*)",U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Y={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},K={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"xml"}},N={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"graphql"}},V={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,K]},D={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},q=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,N,L,V,{match:/\$\d+/},Y];K.contains=q.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(q)});let _=[].concat(D,K.contains),M=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(_)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},C={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...gb,...fb]}},y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},w={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},h={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function E(v){return Z.concat("(?!",v.join("|"),")")}let I={match:Z.concat(/\b/,E([...mb,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},S={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",b={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,N,L,V,D,{match:/\$\d+/},Y,R,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},b,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:J.begin,end:J.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},I,h,C,S,{match:/\$[(.]/}]}}function ub($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},H={match:/[{}[\],:]/,className:"punctuation",relevance:0},B=["true","false","null"],J={scope:"literal",beginKeywords:B.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:B},contains:[Z,H,$.QUOTE_STRING_MODE,J,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var OZ="[0-9](_*[0-9])*",qU=`\\.(${OZ})`,MU="[0-9a-fA-F](_*[0-9a-fA-F])*",x40={className:"number",variants:[{begin:`(\\b(${OZ})((${qU})|\\.)?|(${qU}))[eE][+-]?(${OZ})[fFdD]?\\b`},{begin:`\\b(${OZ})((${qU})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${qU})[fFdD]?\\b`},{begin:`\\b(${OZ})[fFdD]\\b`},{begin:`\\b0[xX]((${MU})\\.?|(${MU})?\\.(${MU}))[pP][+-]?(${OZ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${MU})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function cb($){let Z={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},H={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},B={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},J={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},Q={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},X={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[Q,J]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,Q,J]}]};J.contains.push(X);let z={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},G={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(X,{className:"string"}),"self"]}]},F=x40,U=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),Y={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},K=Y;return K.variants[1].contains=[Y],Y.variants[1].contains=[K],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,U,H,B,z,G,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:Z,relevance:5,contains:[{begin:$.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[$.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Z,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[Y,$.C_LINE_COMMENT_MODE,U],relevance:0},$.C_LINE_COMMENT_MODE,U,z,G,X,$.C_NUMBER_MODE]},U]},{begin:[/class|interface|trait/,/\s+/,$.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},$.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},z,G]},X,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
47
- `},F]}}var v40=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},g40=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],f40=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],m40=[...g40,...f40],p40=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),db=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),lb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),u40=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),c40=db.concat(lb).sort().reverse();function ib($){let Z=v40($),H=c40,B="and or not only",J="[\\w-]+",Q="([\\w-]+|@\\{[\\w-]+\\})",X=[],z=[],G=function(q){return{className:"string",begin:"~?"+q+".*?"+q}},F=function(q,_,M){return{className:q,begin:_,relevance:M}},U={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:p40.join(" ")},Y={begin:"\\(",end:"\\)",contains:z,keywords:U,relevance:0};z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,G("'"),G('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,Y,F("variable","@@?[\\w-]+",10),F("variable","@\\{[\\w-]+\\}"),F("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let K=z.concat({begin:/\{/,end:/\}/,contains:X}),W={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},N={begin:Q+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+u40.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},L={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:U,returnEnd:!0,contains:z,relevance:0}},V={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:K}},A={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:Q,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,W,F("keyword","all\\b"),F("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+m40.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,F("selector-tag",Q,0),F("selector-id","#"+Q),F("selector-class","\\."+Q,0),F("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+db.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+lb.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:K},{begin:"!important"},Z.FUNCTION_DISPATCH]},D={begin:`[\\w-]+:(:)?(${H.join("|")})`,returnBegin:!0,contains:[A]};return X.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,L,V,D,N,A,W,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:X}}function rb($){let B={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},J=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[B],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:$.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:J.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[$.inherit($.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:J}].concat(J)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[B],relevance:5}])}}function ab($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},H={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},B={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[Z,H]},J={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},Q={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},X={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[Z]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[$.HASH_COMMENT_MODE,Z,H,B,J,Q,X]}}function nb($){let Z=$.regex,H={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},B={begin:"^[-\\*]{3,}",end:"$"},J={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},Q={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},X={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},z=/[A-Za-z][A-Za-z0-9+.-]*/,G={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Z.concat(/\[.+?\]\(/,z,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},F={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},U={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},Y=$.inherit(F,{contains:[]}),K=$.inherit(U,{contains:[]});F.contains.push(K),U.contains.push(Y);let W=[H,G];return[F,U,Y,K].forEach((A)=>{A.contains=A.contains.concat(W)}),W=W.concat(F,U),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:W},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:W}]}]},H,Q,F,U,{className:"quote",begin:"^>\\s+",contains:W,end:"$"},J,B,G,X,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ob($){let Z={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},H=/[a-zA-Z@][a-zA-Z0-9_]*/,z={"variable.language":["this","super"],$pattern:H,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},G={$pattern:H,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:z,illegal:"</",contains:[Z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,$.C_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit($.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+G.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:G,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function sb($){let Z=$.regex,H=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],B=/[dualxmsipngr]{0,12}/,J={$pattern:/[\w.]+/,keyword:H.join(" ")},Q={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:J},X={begin:/->\{/,end:/\}/},z={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},G={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[z]},F={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},U=[$.BACKSLASH_ESCAPE,Q,G],Y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],K=(L,V,A="\\1")=>{let D=A==="\\1"?A:Z.concat(A,V);return Z.concat(Z.concat("(?:",L,")"),V,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,A,B)},W=(L,V,A)=>{return Z.concat(Z.concat("(?:",L,")"),V,/(?:\\.|[^\\\/])*?/,A,B)},N=[G,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),X,{className:"string",contains:U,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},F,{begin:"(\\/\\/|"+$.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[$.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:K("s|tr|y",Z.either(...Y,{capture:!0}))},{begin:K("s|tr|y","\\(","\\)")},{begin:K("s|tr|y","\\[","\\]")},{begin:K("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:W("(?:m|qr)?",/\//,/\//)},{begin:W("m|qr",Z.either(...Y,{capture:!0}),/\1/)},{begin:W("m|qr",/\(/,/\)/)},{begin:W("m|qr",/\[/,/\]/)},{begin:W("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z,F]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return Q.contains=N,X.contains=N,{name:"Perl",aliases:["pl","pm"],keywords:J,contains:N}}function tb($){let Z=$.regex,H=/(?![A-Za-z0-9])(?![$])/,B=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,H),J=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,H),Q=Z.concat(/[A-Z]+/,H),X={scope:"variable",match:"\\$+"+B},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},G={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},F=$.inherit($.APOS_STRING_MODE,{illegal:null}),U=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(G)}),Y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(G),"on:begin":(j,S)=>{S.data._beginMatch=j[1]||j[2]},"on:end":(j,S)=>{if(S.data._beginMatch!==j[1])S.ignoreMatch()}},K=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),W=`[
48
- ]`,N={scope:"string",variants:[U,F,Y,K]},L={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},V=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],D=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:A,literal:((j)=>{let S=[];return j.forEach((k)=>{if(S.push(k),k.toLowerCase()===k)S.push(k.toUpperCase());else S.push(k.toLowerCase())}),S})(V),built_in:D},M=(j)=>{return j.map((S)=>{return S.replace(/\|\d+$/,"")})},P={variants:[{match:[/new/,Z.concat(`[
49
- ]`,"+"),Z.concat("(?!",M(D).join("\\b|"),"\\b)"),J],scope:{1:"keyword",4:"title.class"}}]},C=Z.concat(B,"\\b(?!\\()"),R={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[J,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[J,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[J,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},y={scope:"attr",match:Z.concat(B,Z.lookahead(":"),Z.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[y,X,R,$.C_BLOCK_COMMENT_MODE,N,L,P]},h={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",M(A).join("\\b|"),"|",M(D).join("\\b|"),"\\b)"),B,Z.concat(`[
50
- ]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(h);let E=[y,R,$.C_BLOCK_COMMENT_MODE,N,L,P],I={begin:Z.concat(/#\[\s*\\?/,Z.either(J,Q)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:V,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:V,keyword:["new","array"]},contains:["self",...E]},...E,{scope:"meta",variants:[{match:J},{match:Q}]}]};return{case_insensitive:!1,keywords:_,contains:[I,$.HASH_COMMENT_MODE,$.COMMENT("//","$"),$.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:$.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},z,{scope:"variable.language",match:/\$this\b/},X,h,R,{match:[/const/,/\s/,B],scope:{1:"keyword",3:"variable.constant"}},P,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},$.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",I,X,R,$.C_BLOCK_COMMENT_MODE,N,L]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},$.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[$.inherit($.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},$.UNDERSCORE_TITLE_MODE]},N,L]}}function eb($){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},$.inherit($.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),$.inherit($.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function $y($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Zy($){let Z=$.regex,H=/[\p{XID_Start}_]\p{XID_Continue}*/u,B=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],z={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:B,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},G={className:"meta",begin:/^(>>>|\.\.\.) /},F={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},U={begin:/\{\{/,relevance:0},Y={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G,U,F]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G,U,F]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[$.BACKSLASH_ESCAPE,U,F]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,U,F]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},K="[0-9](_?[0-9])*",W="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",N=`\\b|${B.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${N})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${N})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${N})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${N})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${N})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${N})`}]},V={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:z,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",G,L,Y,$.HASH_COMMENT_MODE]}]};return F.contains=[Y,L,G],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[G,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},Y,V,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,H],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,H,/\s*/,/\(\s*/,H,/\s*\)/]},{match:[/\bclass/,/\s+/,H]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[L,A,Y]}]}}function Hy($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function By($){let Z=$.regex,H=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,B=Z.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),J=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,Q=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:H,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[$.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:Z.lookahead(Z.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:H},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),$.HASH_COMMENT_MODE,{scope:"string",contains:[$.BACKSLASH_ESCAPE],variants:[$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[J,B]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,B]},{scope:{1:"punctuation",2:"number"},match:[Q,B]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,B]}]},{scope:{3:"operator"},match:[H,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:J},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:Q},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Jy($){let Z=$.regex,H="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",B=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),J=Z.concat(B,/(::\w+)*/),X={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},z={className:"doctag",begin:"@[A-Za-z]+"},G={begin:"#<",end:">"},F=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],U={className:"subst",begin:/#\{/,end:/\}/,keywords:X},Y={className:"string",contains:[$.BACKSLASH_ESCAPE,U],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:Z.concat(/<<[-~]?'?/,Z.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[$.BACKSLASH_ESCAPE,U]})]}]},K="[1-9](_?[0-9])*|0",W="[0-9](_?[0-9])*",N={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},L={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:X}]},P=[Y,{variants:[{match:[/class\s+/,J,/\s+<\s+/,J]},{match:[/\b(class|module)\s+/,J]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:X},{match:[/(include|extend)\s+/,J],scope:{2:"title.class"},keywords:X},{relevance:0,match:[J,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:B,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[L]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[Y,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},N,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:X},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,U],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(G,F),relevance:0}].concat(G,F);U.contains=P,L.contains=P;let C="[>?]>",R="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",y="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",w=[{begin:/^\s*=>/,starts:{end:"$",contains:P}},{className:"meta.prompt",begin:"^("+C+"|"+R+"|"+y+")(?=[ ])",starts:{end:"$",keywords:X,contains:P}}];return F.unshift(G),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:X,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(w).concat(F).concat(P)}}function Qy($){let Z=$.regex,H=/(r#)?/,B=Z.concat(H,$.UNDERSCORE_IDENT_RE),J=Z.concat(H,$.IDENT_RE),Q={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,J,Z.lookahead(/\s*\(/))},X="([ui](8|16|32|64|128|size)|f(32|64))?",z=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],G=["true","false","Some","None","Ok","Err"],F=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],U=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:$.IDENT_RE+"!?",type:U,keyword:z,literal:G,built_in:F},illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.COMMENT("/\\*","\\*/",{contains:["self"]}),$.inherit($.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,B],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,B],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,B,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,B],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,B],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:F,type:U}},{className:"punctuation",begin:"->"},Q]}}var d40=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},l40=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],i40=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r40=[...l40,...i40],a40=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),n40=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),o40=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),s40=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Xy($){let Z=d40($),H=o40,B=n40,J="@[a-z-]+",Q="and or not only",X="[a-zA-Z-][a-zA-Z0-9_-]*",z={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Z.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+r40.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+B.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+H.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+s40.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[Z.BLOCK_COMMENT,z,Z.HEXCOLOR,Z.CSS_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.IMPORTANT,Z.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:a40.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},z,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.HEXCOLOR,Z.CSS_NUMBER_MODE]},Z.FUNCTION_DISPATCH]}}function zy($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Gy($){let Z=$.regex,H=$.COMMENT("--","$"),B={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},J={begin:/"/,end:/"/,contains:[{match:/""/}]},Q=["true","false","unknown"],X=["double precision","large object","with timezone","without timezone"],z=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],G=["add","asc","collation","desc","final","first","last","view"],F=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],U=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],Y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],K=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],W=U,N=[...F,...G].filter((M)=>{return!U.includes(M)}),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},V={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:Z.concat(/\b/,Z.either(...W),/\s*\(/),relevance:0,keywords:{built_in:W}};function D(M){return Z.concat(/\b/,Z.either(...M.map((P)=>{return P.replace(/\s+/,"\\s+")})),/\b/)}let q={scope:"keyword",match:D(K),relevance:0};function _(M,{exceptions:P,when:C}={}){let R=C;return P=P||[],M.map((y)=>{if(y.match(/\|\d+$/)||P.includes(y))return y;else if(R(y))return`${y}|0`;else return y})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(N,{when:(M)=>M.length<3}),literal:Q,type:z,built_in:Y},contains:[{scope:"type",match:D(X)},q,A,L,B,J,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,H,V]}}function Ky($){if(!$)return null;if(typeof $==="string")return $;return $.source}function KJ($){return X5("(?=",$,")")}function X5(...$){return $.map((H)=>Ky(H)).join("")}function t40($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function B4(...$){return"("+(t40($).capture?"":"?:")+$.map((B)=>Ky(B)).join("|")+")"}var wA=($)=>X5(/\b/,$,/\w$/.test($)?/\b/:/\B/),e40=["Protocol","Type"].map(wA),Fy=["init","self"].map(wA),$80=["Any","Self"],TA=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Uy=["false","nil","true"],Z80=["assignment","associativity","higherThan","left","lowerThan","none","right"],H80=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Yy=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Wy=B4(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Ny=B4(Wy,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),CA=X5(Wy,Ny,"*"),Ly=B4(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),_U=B4(Ly,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),P9=X5(Ly,_U,"*"),PU=X5(/[A-Z]/,_U,"*"),B80=["attached","autoclosure",X5(/convention\(/,B4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",X5(/objc\(/,P9,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],J80=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ay($){let Z={match:/\s+/,relevance:0},H=$.COMMENT("/\\*","\\*/",{contains:["self"]}),B=[$.C_LINE_COMMENT_MODE,H],J={match:[/\./,B4(...e40,...Fy)],className:{2:"keyword"}},Q={match:X5(/\./,B4(...TA)),relevance:0},X=TA.filter((n)=>typeof n==="string").concat(["_|0"]),z=TA.filter((n)=>typeof n!=="string").concat($80).map(wA),G={variants:[{className:"keyword",match:B4(...z,...Fy)}]},F={$pattern:B4(/\b\w+/,/#\w+/),keyword:X.concat(H80),literal:Uy},U=[J,Q,G],Y={match:X5(/\./,B4(...Yy)),relevance:0},K={className:"built_in",match:X5(/\b/,B4(...Yy),/(?=\()/)},W=[Y,K],N={match:/->/,relevance:0},L={className:"operator",relevance:0,variants:[{match:CA},{match:`\\.(\\.|${Ny})+`}]},V=[N,L],A="([0-9]_*)+",D="([0-9a-fA-F]_*)+",q={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:"\\b0x(([0-9a-fA-F]_*)+)(\\.(([0-9a-fA-F]_*)+))?([pP][+-]?(([0-9]_*)+))?\\b"},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(n="")=>({className:"subst",variants:[{match:X5(/\\/,n,/[0\\tnr"']/)},{match:X5(/\\/,n,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(n="")=>({className:"subst",match:X5(/\\/,n,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(n="")=>({className:"subst",label:"interpol",begin:X5(/\\/,n,/\(/),end:/\)/}),C=(n="")=>({begin:X5(n,/"""/),end:X5(/"""/,n),contains:[_(n),M(n),P(n)]}),R=(n="")=>({begin:X5(n,/"/),end:X5(/"/,n),contains:[_(n),P(n)]}),y={className:"string",variants:[C(),C("#"),C("##"),C("###"),R(),R("#"),R("##"),R("###")]},w=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],h={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:w},E=(n)=>{let f=X5(n,/\//),l=X5(/\//,n);return{begin:f,end:l,contains:[...w,{scope:"comment",begin:`#(?!.*${l})`,end:/$/}]}},I={scope:"regexp",variants:[E("###"),E("##"),E("#"),h]},j={match:X5(/`/,P9,/`/)},S={className:"variable",match:/\$\d+/},k={className:"variable",match:`\\$${_U}+`},b=[j,S,k],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:J80,contains:[...V,q,y]}]}},c={scope:"keyword",match:X5(/@/,B4(...B80),KJ(B4(/\(/,/\s+/)))},T={scope:"meta",match:X5(/@/,P9)},e=[v,c,T],Z0={match:KJ(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:X5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,_U,"+")},{className:"type",match:PU,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:X5(/\s+&\s+/,KJ(PU)),relevance:0}]},x={begin:/</,end:/>/,keywords:F,contains:[...B,...U,...e,N,Z0]};Z0.contains.push(x);let t={match:X5(P9,/\s*:/),keywords:"_|0",relevance:0},D0={begin:/\(/,end:/\)/,relevance:0,keywords:F,contains:["self",t,...B,I,...U,...W,...V,q,y,...b,...e,Z0]},p={begin:/</,end:/>/,keywords:"repeat each",contains:[...B,Z0]},X0={begin:B4(KJ(X5(P9,/\s*:/)),KJ(X5(P9,/\s+/,P9,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:P9}]},K0={begin:/\(/,end:/\)/,keywords:F,contains:[X0,...B,...U,...V,q,y,...e,Z0,D0],endsParent:!0,illegal:/["']/},Q0={match:[/(func|macro)/,/\s+/,B4(j.match,P9,CA)],className:{1:"keyword",3:"title.function"},contains:[p,K0,Z],illegal:[/\[/,/%/]},z0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[p,K0,Z],illegal:/\[|%/},L0={match:[/operator/,/\s+/,CA],className:{1:"keyword",3:"title"}},i={begin:[/precedencegroup/,/\s+/,PU],className:{1:"keyword",3:"title"},contains:[Z0],keywords:[...Z80,...Uy],end:/}/},B0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},$0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},J0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,P9,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:F,contains:[p,...U,{begin:/:/,end:/\{/,keywords:F,contains:[{scope:"title.class.inherited",match:PU},...U],relevance:0}]};for(let n of y.variants){let f=n.contains.find((m)=>m.label==="interpol");f.keywords=F;let l=[...U,...W,...V,q,y,...b];f.contains=[...l,{begin:/\(/,end:/\)/,contains:["self",...l]}]}return{name:"Swift",keywords:F,contains:[...B,Q0,z0,B0,$0,J0,L0,i,{beginKeywords:"import",end:/$/,contains:[...B],relevance:0},I,...U,...W,...V,q,y,...b,...e,Z0,D0]}}var Vy=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Dy=["true","false","null","undefined","NaN","Infinity"],qy=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],My=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Py=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_y=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Oy=[].concat(Py,qy,My);function Q80($){let Z=$.regex,H=(v,{after:c})=>{let T="</"+v[0].slice(1);return v.input.indexOf(T,c)!==-1},B="[A-Za-z$_][0-9A-Za-z$_]*",J={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,c)=>{let T=v[0].length+v.index,e=v.input[T];if(e==="<"||e===","){c.ignoreMatch();return}if(e===">"){if(!H(v,{after:T}))c.ignoreMatch()}let Z0,x=v.input.substring(T);if(Z0=x.match(/^\s*=/)){c.ignoreMatch();return}if(Z0=x.match(/^\s+extends\s+/)){if(Z0.index===0){c.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Vy,literal:Dy,built_in:Oy,"variable.language":_y},G="[0-9](_?[0-9])*",F="\\.([0-9](_?[0-9])*)",U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Y={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},K={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"xml"}},N={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,K],subLanguage:"graphql"}},V={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,K]},D={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},q=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,N,L,V,{match:/\$\d+/},Y];K.contains=q.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(q)});let _=[].concat(D,K.contains),M=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(_)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},C={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...qy,...My]}},y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},w={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},h={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function E(v){return Z.concat("(?!",v.join("|"),")")}let I={match:Z.concat(/\b/,E([...Py,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},S={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",b={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,N,L,V,D,{match:/\$\d+/},Y,R,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},b,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:J.begin,end:J.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},I,h,C,S,{match:/\$[(.]/}]}}function jy($){let Z=$.regex,H=Q80($),B="[A-Za-z$_][0-9A-Za-z$_]*",J=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],Q={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},X={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:J},contains:[H.exports.CLASS_REFERENCE]},z={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},G=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],F={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Vy.concat(G),literal:Dy,built_in:Oy.concat(J),"variable.language":_y},U={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},Y=(L,V,A)=>{let D=L.contains.findIndex((q)=>q.label===V);if(D===-1)throw Error("can not find mode to replace");L.contains.splice(D,1,A)};Object.assign(H.keywords,F),H.exports.PARAMS_CONTAINS.push(U);let K=H.contains.find((L)=>L.scope==="attr"),W=Object.assign({},K,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});H.exports.PARAMS_CONTAINS.push([H.exports.CLASS_REFERENCE,K,W]),H.contains=H.contains.concat([U,Q,X,W]),Y(H,"shebang",$.SHEBANG()),Y(H,"use_strict",z);let N=H.contains.find((L)=>L.label==="func.def");return N.relevance=0,Object.assign(H,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),H}function Ty($){let Z=$.regex,H={className:"string",begin:/"(""|[^/n])"C\b/},B={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},J=/\d{1,2}\/\d{1,2}\/\d{4}/,Q=/\d{4}-\d{1,2}-\d{1,2}/,X=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,z=/\d{1,2}(:\d{1,2}){1,2}/,G={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(Q,J),/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,X,/ *#/)},{begin:Z.concat(/# */,Z.either(Q,J),/ +/,Z.either(X,z),/ *#/)}]},F={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},U={className:"label",begin:/^\w+:/},Y=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),K=$.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[H,B,G,F,U,Y,K,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[K]}]}}function Cy($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let H=$.COMMENT(/;;/,/$/),B=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],J={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},Q={className:"variable",begin:/\$[\w_]+/},X={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},z={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},G={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},F={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:B},contains:[H,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},Q,X,J,$.QUOTE_STRING_MODE,G,F,z]}}function wy($){let Z=$.regex,H=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),B=/[\p{L}0-9._:-]+/u,J={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},Q={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},X=$.inherit(Q,{begin:/\(/,end:/\)/}),z=$.inherit($.APOS_STRING_MODE,{className:"string"}),G=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),F={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:B,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[J]},{begin:/'/,end:/'/,contains:[J]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[Q,G,z,X,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[Q,X,G,z]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},J,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[G]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[F],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[F],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Z.concat(/</,Z.lookahead(Z.concat(H,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:H,relevance:0,starts:F}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(H,/>/))),contains:[{className:"name",begin:H,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Ey($){let B={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},J={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},Q={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},X={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,J]},z=$.inherit(X,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),G="[0-9]{4}(-[0-9][0-9]){0,2}",F="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",U="(\\.[0-9]*)?",Y="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",K={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},W={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},N={begin:/\{/,end:/\}/,contains:[W],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[W],illegal:"\\n",relevance:0},V=[B,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+$.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+$.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},$.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},K,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},N,L,Q,X],A=[...V];return A.pop(),A.push(z),W.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:V}}var EA={arduino:Tb,bash:Cb,c:wb,cpp:Eb,csharp:Sb,css:Ib,diff:Rb,go:kb,graphql:bb,ini:yb,java:vb,javascript:pb,json:ub,kotlin:cb,less:ib,lua:rb,makefile:ab,markdown:nb,objectivec:ob,perl:sb,php:tb,"php-template":eb,plaintext:$y,python:Zy,"python-repl":Hy,r:By,ruby:Jy,rust:Qy,scss:Xy,shell:zy,sql:Gy,swift:Ay,typescript:jy,vbnet:Ty,wasm:Cy,xml:wy,yaml:Ey};var ty=O(sy(),1);var ey=ty.default;var $h={},n80="hljs-";function hA($){let Z=ey.newInstance();if($)Q($);return{highlight:H,highlightAuto:B,listLanguages:J,register:Q,registerAlias:X,registered:z};function H(G,F,U){p1(typeof G==="string","expected `string` as `name`"),p1(typeof F==="string","expected `string` as `value`");let Y=U||$h,K=typeof Y.prefix==="string"?Y.prefix:n80;if(!Z.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");Z.configure({__emitter:Zh,classPrefix:K});let W=Z.highlight(F,{ignoreIllegals:!0,language:G});if(W.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:W.errorRaised});let N=W._emitter.root,L=N.data;return L.language=W.language,L.relevance=W.relevance,N}function B(G,F){p1(typeof G==="string","expected `string` as `value`");let Y=(F||$h).subset||J(),K=-1,W=0,N;while(++K<Y.length){let L=Y[K];if(!Z.getLanguage(L))continue;let V=H(L,G,F);if(V.data&&V.data.relevance!==void 0&&V.data.relevance>W)W=V.data.relevance,N=V}return N||{type:"root",children:[],data:{language:void 0,relevance:W}}}function J(){return Z.listLanguages()}function Q(G,F){if(typeof G==="string")p1(F!==void 0,"expected `grammar`"),Z.registerLanguage(G,F);else{let U;for(U in G)if(Object.hasOwn(G,U))Z.registerLanguage(U,G[U])}}function X(G,F){if(typeof G==="string")p1(F!==void 0),Z.registerAliases(typeof F==="string"?F:[...F],{languageName:G});else{let U;for(U in G)if(Object.hasOwn(G,U)){let Y=G[U];Z.registerAliases(typeof Y==="string"?Y:[...Y],{languageName:U})}}}function z(G){return Boolean(Z.getLanguage(G))}}class Zh{constructor($){this.options=$,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText($){if($==="")return;let Z=this.stack[this.stack.length-1],H=Z.children[Z.children.length-1];if(H&&H.type==="text")H.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let H=this.stack[this.stack.length-1],B=$.root.children;if(Z)H.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:B});else H.children.push(...B)}openNode($){let Z=this,H=$.split(".").map(function(Q,X){return X?Q+"_".repeat(X):Z.options.classPrefix+Q}),B=this.stack[this.stack.length-1],J={type:"element",tagName:"span",properties:{className:H},children:[]};B.children.push(J),this.stack.push(J)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var o80={};function CU($){let Z=$||o80,H=Z.aliases,B=Z.detect||!1,J=Z.languages||EA,Q=Z.plainText,X=Z.prefix,z=Z.subset,G="hljs",F=hA(J);if(H)F.registerAlias(H);if(X){let U=X.indexOf("-");G=U===-1?X:X.slice(0,U)}return function(U,Y){u9(U,"element",function(K,W,N){if(K.tagName!=="code"||!N||N.type!=="element"||N.tagName!=="pre")return;let L=s80(K);if(L===!1||!L&&!B||L&&Q&&Q.includes(L))return;if(!Array.isArray(K.properties.className))K.properties.className=[];if(!K.properties.className.includes(G))K.properties.className.unshift(G);let V=jA(K,{whitespace:"pre"}),A;try{A=L?F.highlight(L,V,{prefix:X}):F.highlightAuto(V,{prefix:X,subset:z})}catch(D){let q=D;if(L&&/Unknown language/.test(q.message)){Y.message("Cannot highlight as `"+L+"`, it’s not registered",{ancestors:[N,K],cause:q,place:K.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw q}if(!L&&A.data&&A.data.language)K.properties.className.push("language-"+A.data.language);if(A.children.length>0)K.children=A.children})}}function s80($){let Z=$.properties.className,H=-1;if(!Array.isArray(Z))return;let B;while(++H<Z.length){let J=String(Z[H]);if(J==="no-highlight"||J==="nohighlight")return!1;if(!B&&J.slice(0,5)==="lang-")B=J.slice(5);if(!B&&J.slice(0,9)==="language-")B=J.slice(9)}return B}function xA($,Z){let H=String($);if(typeof Z!=="string")throw TypeError("Expected character");let B=0,J=H.indexOf(Z);while(J!==-1)B++,J=H.indexOf(Z,J+Z.length);return B}function vA($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function gA($,Z,H){let J=M9((H||{}).ignore||[]),Q=t80(Z),X=-1;while(++X<Q.length)FJ($,"text",z);function z(F,U){let Y=-1,K;while(++Y<U.length){let W=U[Y],N=K?K.children:void 0;if(J(W,N?N.indexOf(W):void 0,K))return;K=W}if(K)return G(F,U)}function G(F,U){let Y=U[U.length-1],K=Q[X][0],W=Q[X][1],N=0,V=Y.children.indexOf(F),A=!1,D=[];K.lastIndex=0;let q=K.exec(F.value);while(q){let _=q.index,M={index:q.index,input:q.input,stack:[...U,F]},P=W(...q,M);if(typeof P==="string")P=P.length>0?{type:"text",value:P}:void 0;if(P===!1)K.lastIndex=_+1;else{if(N!==_)D.push({type:"text",value:F.value.slice(N,_)});if(Array.isArray(P))D.push(...P);else if(P)D.push(P);N=_+q[0].length,A=!0}if(!K.global)break;q=K.exec(F.value)}if(A){if(N<F.value.length)D.push({type:"text",value:F.value.slice(N)});Y.children.splice(V,1,...D)}else D=[F];return V+D.length}}function t80($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let H=!$[0]||Array.isArray($[0])?$:[$],B=-1;while(++B<H.length){let J=H[B];Z.push([e80(J[0]),$90(J[1])])}return Z}function e80($){return typeof $==="string"?new RegExp(vA($),"g"):$}function $90($){return typeof $==="function"?$:function(){return $}}var fA="phrasing",mA=["autolink","link","image","label"];function uA(){return{transforms:[X90],enter:{literalAutolink:Z90,literalAutolinkEmail:pA,literalAutolinkHttp:pA,literalAutolinkWww:pA},exit:{literalAutolink:Q90,literalAutolinkEmail:J90,literalAutolinkHttp:H90,literalAutolinkWww:B90}}}function cA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fA,notInConstruct:mA},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fA,notInConstruct:mA},{character:":",before:"[ps]",after:"\\/",inConstruct:fA,notInConstruct:mA}]}}function Z90($){this.enter({type:"link",title:null,url:"",children:[]},$)}function pA($){this.config.enter.autolinkProtocol.call(this,$)}function H90($){this.config.exit.autolinkProtocol.call(this,$)}function B90($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];p1(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function J90($){this.config.exit.autolinkEmail.call(this,$)}function Q90($){this.exit($)}function X90($){gA($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,z90],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,G90]],{ignore:["link","linkReference"]})}function z90($,Z,H,B,J){let Q="";if(!Hh(J))return!1;if(/^w/i.test(Z))H=Z+H,Z="",Q="http://";if(!F90(H))return!1;let X=U90(H+B);if(!X[0])return!1;let z={type:"link",title:null,url:Q+Z+X[0],children:[{type:"text",value:Z+X[0]}]};if(X[1])return[z,{type:"text",value:X[1]}];return z}function G90($,Z,H,B){if(!Hh(B,!0)||/[-\d_]$/.test(H))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+H,children:[{type:"text",value:Z+"@"+H}]}}function F90($){let Z=$.split(".");if(Z.length<2||Z[Z.length-1]&&(/_/.test(Z[Z.length-1])||!/[a-zA-Z\d]/.test(Z[Z.length-1]))||Z[Z.length-2]&&(/_/.test(Z[Z.length-2])||!/[a-zA-Z\d]/.test(Z[Z.length-2])))return!1;return!0}function U90($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let H=Z[0],B=H.indexOf(")"),J=xA($,"("),Q=xA($,")");while(B!==-1&&J>Q)$+=H.slice(0,B+1),H=H.slice(B+1),B=H.indexOf(")"),Q++;return[$,H]}function Hh($,Z){let H=$.input.charCodeAt($.index-1);return($.index===0||D9(H)||A7(H))&&(!Z||H!==47)}Bh.peek=q90;function Y90(){this.buffer()}function K90($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function W90(){this.buffer()}function N90($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function L90($){let Z=this.resume(),H=this.stack[this.stack.length-1];p1(H.type==="footnoteReference"),H.identifier=p2(this.sliceSerialize($)).toLowerCase(),H.label=Z}function A90($){this.exit($)}function V90($){let Z=this.resume(),H=this.stack[this.stack.length-1];p1(H.type==="footnoteDefinition"),H.identifier=p2(this.sliceSerialize($)).toLowerCase(),H.label=Z}function D90($){this.exit($)}function q90(){return"["}function Bh($,Z,H,B){let J=H.createTracker(B),Q=J.move("[^"),X=H.enter("footnoteReference"),z=H.enter("reference");return Q+=J.move(H.safe(H.associationId($),{after:"]",before:Q})),z(),X(),Q+=J.move("]"),Q}function dA(){return{enter:{gfmFootnoteCallString:Y90,gfmFootnoteCall:K90,gfmFootnoteDefinitionLabelString:W90,gfmFootnoteDefinition:N90},exit:{gfmFootnoteCallString:L90,gfmFootnoteCall:A90,gfmFootnoteDefinitionLabelString:V90,gfmFootnoteDefinition:D90}}}function lA($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:H,footnoteReference:Bh},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function H(B,J,Q,X){let z=Q.createTracker(X),G=z.move("[^"),F=Q.enter("footnoteDefinition"),U=Q.enter("label");if(G+=z.move(Q.safe(Q.associationId(B),{before:G,after:"]"})),U(),G+=z.move("]:"),B.children&&B.children.length>0)z.shift(4),G+=z.move((Z?`
51
- `:" ")+Q.indentLines(Q.containerFlow(B,z.current()),Z?Jh:M90));return F(),G}}function M90($,Z,H){return Z===0?$:Jh($,Z,H)}function Jh($,Z,H){return(H?"":" ")+$}var P90=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Qh.peek=j90;function iA(){return{canContainEols:["delete"],enter:{strikethrough:_90},exit:{strikethrough:O90}}}function rA(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:P90}],handlers:{delete:Qh}}}function _90($){this.enter({type:"delete",children:[]},$)}function O90($){this.exit($)}function Qh($,Z,H,B){let J=H.createTracker(B),Q=H.enter("strikethrough"),X=J.move("~~");return X+=H.containerPhrasing($,{...J.current(),before:X,after:"~"}),X+=J.move("~~"),Q(),X}function j90(){return"~"}function T90($){return $.length}function zh($,Z){let H=Z||{},B=(H.align||[]).concat(),J=H.stringLength||T90,Q=[],X=[],z=[],G=[],F=0,U=-1;while(++U<$.length){let L=[],V=[],A=-1;if($[U].length>F)F=$[U].length;while(++A<$[U].length){let D=C90($[U][A]);if(H.alignDelimiters!==!1){let q=J(D);if(V[A]=q,G[A]===void 0||q>G[A])G[A]=q}L.push(D)}X[U]=L,z[U]=V}let Y=-1;if(typeof B==="object"&&"length"in B)while(++Y<F)Q[Y]=Xh(B[Y]);else{let L=Xh(B);while(++Y<F)Q[Y]=L}Y=-1;let K=[],W=[];while(++Y<F){let L=Q[Y],V="",A="";if(L===99)V=":",A=":";else if(L===108)V=":";else if(L===114)A=":";let D=H.alignDelimiters===!1?1:Math.max(1,G[Y]-V.length-A.length),q=V+"-".repeat(D)+A;if(H.alignDelimiters!==!1){if(D=V.length+D+A.length,D>G[Y])G[Y]=D;W[Y]=D}K[Y]=q}X.splice(1,0,K),z.splice(1,0,W),U=-1;let N=[];while(++U<X.length){let L=X[U],V=z[U];Y=-1;let A=[];while(++Y<F){let D=L[Y]||"",q="",_="";if(H.alignDelimiters!==!1){let M=G[Y]-(V[Y]||0),P=Q[Y];if(P===114)q=" ".repeat(M);else if(P===99)if(M%2)q=" ".repeat(M/2+0.5),_=" ".repeat(M/2-0.5);else q=" ".repeat(M/2),_=q;else _=" ".repeat(M)}if(H.delimiterStart!==!1&&!Y)A.push("|");if(H.padding!==!1&&!(H.alignDelimiters===!1&&D==="")&&(H.delimiterStart!==!1||Y))A.push(" ");if(H.alignDelimiters!==!1)A.push(q);if(A.push(D),H.alignDelimiters!==!1)A.push(_);if(H.padding!==!1)A.push(" ");if(H.delimiterEnd!==!1||Y!==F-1)A.push("|")}N.push(H.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return N.join(`
52
- `)}function C90($){return $===null||$===void 0?"":String($)}function Xh($){let Z=typeof $==="string"?$.codePointAt(0):0;return Z===67||Z===99?99:Z===76||Z===108?108:Z===82||Z===114?114:0}function Gh($,Z,H,B){let J=H.enter("blockquote"),Q=H.createTracker(B);Q.move("> "),Q.shift(2);let X=H.indentLines(H.containerFlow($,Q.current()),w90);return J(),X}function w90($,Z,H){return">"+(H?"":" ")+$}function Uh($,Z){return Fh($,Z.inConstruct,!0)&&!Fh($,Z.notInConstruct,!1)}function Fh($,Z,H){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return H;let B=-1;while(++B<Z.length)if($.includes(Z[B]))return!0;return!1}function aA($,Z,H,B){let J=-1;while(++J<H.unsafe.length)if(H.unsafe[J].character===`
53
- `&&Uh(H.stack,H.unsafe[J]))return/[ \t]/.test(B.before)?"":" ";return"\\\n"}function Yh($,Z){let H=String($),B=H.indexOf(Z),J=B,Q=0,X=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(B!==-1){if(B===J){if(++Q>X)X=Q}else Q=1;J=B+Z.length,B=H.indexOf(Z,J)}return X}function Kh($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function Wh($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function Nh($,Z,H,B){let J=Wh(H),Q=$.value||"",X=J==="`"?"GraveAccent":"Tilde";if(Kh($,H)){let Y=H.enter("codeIndented"),K=H.indentLines(Q,E90);return Y(),K}let z=H.createTracker(B),G=J.repeat(Math.max(Yh(Q,J)+1,3)),F=H.enter("codeFenced"),U=z.move(G);if($.lang){let Y=H.enter(`codeFencedLang${X}`);U+=z.move(H.safe($.lang,{before:U,after:" ",encode:["`"],...z.current()})),Y()}if($.lang&&$.meta){let Y=H.enter(`codeFencedMeta${X}`);U+=z.move(" "),U+=z.move(H.safe($.meta,{before:U,after:`
54
- `,encode:["`"],...z.current()})),Y()}if(U+=z.move(`
55
- `),Q)U+=z.move(Q+`
56
- `);return U+=z.move(G),F(),U}function E90($,Z,H){return(H?"":" ")+$}function CZ($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function Lh($,Z,H,B){let J=CZ(H),Q=J==='"'?"Quote":"Apostrophe",X=H.enter("definition"),z=H.enter("label"),G=H.createTracker(B),F=G.move("[");if(F+=G.move(H.safe(H.associationId($),{before:F,after:"]",...G.current()})),F+=G.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=H.enter("destinationLiteral"),F+=G.move("<"),F+=G.move(H.safe($.url,{before:F,after:">",...G.current()})),F+=G.move(">");else z=H.enter("destinationRaw"),F+=G.move(H.safe($.url,{before:F,after:$.title?" ":`
57
- `,...G.current()}));if(z(),$.title)z=H.enter(`title${Q}`),F+=G.move(" "+J),F+=G.move(H.safe($.title,{before:F,after:J,...G.current()})),F+=G.move(J),z();return X(),F}function Ah($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function n3($){return"&#x"+$.toString(16).toUpperCase()+";"}function wZ($,Z,H){let B=p9($),J=p9(Z);if(B===void 0)return J===void 0?H==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:J===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(B===1)return J===void 0?{inside:!1,outside:!1}:J===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return J===void 0?{inside:!1,outside:!1}:J===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}nA.peek=S90;function nA($,Z,H,B){let J=Ah(H),Q=H.enter("emphasis"),X=H.createTracker(B),z=X.move(J),G=X.move(H.containerPhrasing($,{after:J,before:z,...X.current()})),F=G.charCodeAt(0),U=wZ(B.before.charCodeAt(B.before.length-1),F,J);if(U.inside)G=n3(F)+G.slice(1);let Y=G.charCodeAt(G.length-1),K=wZ(B.after.charCodeAt(0),Y,J);if(K.inside)G=G.slice(0,-1)+n3(Y);let W=X.move(J);return Q(),H.attentionEncodeSurroundingInfo={after:K.outside,before:U.outside},z+G+W}function S90($,Z,H){return H.options.emphasis||"*"}function Vh($,Z){let H=!1;return u9($,function(B){if("value"in B&&/\r?\n|\r/.test(B.value)||B.type==="break")return H=!0,P7}),Boolean((!$.depth||$.depth<3)&&N7($)&&(Z.options.setext||H))}function Dh($,Z,H,B){let J=Math.max(Math.min(6,$.depth||1),1),Q=H.createTracker(B);if(Vh($,H)){let U=H.enter("headingSetext"),Y=H.enter("phrasing"),K=H.containerPhrasing($,{...Q.current(),before:`
58
- `,after:`
59
- `});return Y(),U(),K+`
60
- `+(J===1?"=":"-").repeat(K.length-(Math.max(K.lastIndexOf("\r"),K.lastIndexOf(`
61
- `))+1))}let X="#".repeat(J),z=H.enter("headingAtx"),G=H.enter("phrasing");Q.move(X+" ");let F=H.containerPhrasing($,{before:"# ",after:`
62
- `,...Q.current()});if(/^[\t ]/.test(F))F=n3(F.charCodeAt(0))+F.slice(1);if(F=F?X+" "+F:X,H.options.closeAtx)F+=" "+X;return G(),z(),F}oA.peek=I90;function oA($){return $.value||""}function I90(){return"<"}sA.peek=R90;function sA($,Z,H,B){let J=CZ(H),Q=J==='"'?"Quote":"Apostrophe",X=H.enter("image"),z=H.enter("label"),G=H.createTracker(B),F=G.move("![");if(F+=G.move(H.safe($.alt,{before:F,after:"]",...G.current()})),F+=G.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=H.enter("destinationLiteral"),F+=G.move("<"),F+=G.move(H.safe($.url,{before:F,after:">",...G.current()})),F+=G.move(">");else z=H.enter("destinationRaw"),F+=G.move(H.safe($.url,{before:F,after:$.title?" ":")",...G.current()}));if(z(),$.title)z=H.enter(`title${Q}`),F+=G.move(" "+J),F+=G.move(H.safe($.title,{before:F,after:J,...G.current()})),F+=G.move(J),z();return F+=G.move(")"),X(),F}function R90(){return"!"}tA.peek=k90;function tA($,Z,H,B){let J=$.referenceType,Q=H.enter("imageReference"),X=H.enter("label"),z=H.createTracker(B),G=z.move("!["),F=H.safe($.alt,{before:G,after:"]",...z.current()});G+=z.move(F+"]["),X();let U=H.stack;H.stack=[],X=H.enter("reference");let Y=H.safe(H.associationId($),{before:G,after:"]",...z.current()});if(X(),H.stack=U,Q(),J==="full"||!F||F!==Y)G+=z.move(Y+"]");else if(J==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function k90(){return"!"}eA.peek=b90;function eA($,Z,H){let B=$.value||"",J="`",Q=-1;while(new RegExp("(^|[^`])"+J+"([^`]|$)").test(B))J+="`";if(/[^ \r\n]/.test(B)&&(/^[ \r\n]/.test(B)&&/[ \r\n]$/.test(B)||/^`|`$/.test(B)))B=" "+B+" ";while(++Q<H.unsafe.length){let X=H.unsafe[Q],z=H.compilePattern(X),G;if(!X.atBreak)continue;while(G=z.exec(B)){let F=G.index;if(B.charCodeAt(F)===10&&B.charCodeAt(F-1)===13)F--;B=B.slice(0,F)+" "+B.slice(G.index+1)}}return J+B+J}function b90(){return"`"}function $V($,Z){let H=N7($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(H===$.url||"mailto:"+H===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}ZV.peek=y90;function ZV($,Z,H,B){let J=CZ(H),Q=J==='"'?"Quote":"Apostrophe",X=H.createTracker(B),z,G;if($V($,H)){let U=H.stack;H.stack=[],z=H.enter("autolink");let Y=X.move("<");return Y+=X.move(H.containerPhrasing($,{before:Y,after:">",...X.current()})),Y+=X.move(">"),z(),H.stack=U,Y}z=H.enter("link"),G=H.enter("label");let F=X.move("[");if(F+=X.move(H.containerPhrasing($,{before:F,after:"](",...X.current()})),F+=X.move("]("),G(),!$.url&&$.title||/[\0- \u007F]/.test($.url))G=H.enter("destinationLiteral"),F+=X.move("<"),F+=X.move(H.safe($.url,{before:F,after:">",...X.current()})),F+=X.move(">");else G=H.enter("destinationRaw"),F+=X.move(H.safe($.url,{before:F,after:$.title?" ":")",...X.current()}));if(G(),$.title)G=H.enter(`title${Q}`),F+=X.move(" "+J),F+=X.move(H.safe($.title,{before:F,after:J,...X.current()})),F+=X.move(J),G();return F+=X.move(")"),z(),F}function y90($,Z,H){return $V($,H)?"<":"["}HV.peek=h90;function HV($,Z,H,B){let J=$.referenceType,Q=H.enter("linkReference"),X=H.enter("label"),z=H.createTracker(B),G=z.move("["),F=H.containerPhrasing($,{before:G,after:"]",...z.current()});G+=z.move(F+"]["),X();let U=H.stack;H.stack=[],X=H.enter("reference");let Y=H.safe(H.associationId($),{before:G,after:"]",...z.current()});if(X(),H.stack=U,Q(),J==="full"||!F||F!==Y)G+=z.move(Y+"]");else if(J==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function h90(){return"["}function EZ($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function qh($){let Z=EZ($),H=$.options.bulletOther;if(!H)return Z==="*"?"-":"*";if(H!=="*"&&H!=="+"&&H!=="-")throw Error("Cannot serialize items with `"+H+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(H===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+H+"`) to be different");return H}function Mh($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function wU($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function Ph($,Z,H,B){let J=H.enter("list"),Q=H.bulletCurrent,X=$.ordered?Mh(H):EZ(H),z=$.ordered?X==="."?")":".":qh(H),G=Z&&H.bulletLastUsed?X===H.bulletLastUsed:!1;if(!$.ordered){let U=$.children?$.children[0]:void 0;if((X==="*"||X==="-")&&U&&(!U.children||!U.children[0])&&H.stack[H.stack.length-1]==="list"&&H.stack[H.stack.length-2]==="listItem"&&H.stack[H.stack.length-3]==="list"&&H.stack[H.stack.length-4]==="listItem"&&H.indexStack[H.indexStack.length-1]===0&&H.indexStack[H.indexStack.length-2]===0&&H.indexStack[H.indexStack.length-3]===0)G=!0;if(wU(H)===X&&U){let Y=-1;while(++Y<$.children.length){let K=$.children[Y];if(K&&K.type==="listItem"&&K.children&&K.children[0]&&K.children[0].type==="thematicBreak"){G=!0;break}}}}if(G)X=z;H.bulletCurrent=X;let F=H.containerFlow($,B);return H.bulletLastUsed=X,H.bulletCurrent=Q,J(),F}function _h($){let Z=$.options.listItemIndent||"one";if(Z!=="tab"&&Z!=="one"&&Z!=="mixed")throw Error("Cannot serialize items with `"+Z+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return Z}function Oh($,Z,H,B){let J=_h(H),Q=H.bulletCurrent||EZ(H);if(Z&&Z.type==="list"&&Z.ordered)Q=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(H.options.incrementListMarker===!1?0:Z.children.indexOf($))+Q;let X=Q.length+1;if(J==="tab"||J==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))X=Math.ceil(X/4)*4;let z=H.createTracker(B);z.move(Q+" ".repeat(X-Q.length)),z.shift(X);let G=H.enter("listItem"),F=H.indentLines(H.containerFlow($,z.current()),U);return G(),F;function U(Y,K,W){if(K)return(W?"":" ".repeat(X))+Y;return(W?Q:Q+" ".repeat(X-Q.length))+Y}}function jh($,Z,H,B){let J=H.enter("paragraph"),Q=H.enter("phrasing"),X=H.containerPhrasing($,B);return Q(),J(),X}var BV=M9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Th($,Z,H,B){return($.children.some(function(X){return BV(X)})?H.containerPhrasing:H.containerFlow).call(H,$,B)}function Ch($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}JV.peek=x90;function JV($,Z,H,B){let J=Ch(H),Q=H.enter("strong"),X=H.createTracker(B),z=X.move(J+J),G=X.move(H.containerPhrasing($,{after:J,before:z,...X.current()})),F=G.charCodeAt(0),U=wZ(B.before.charCodeAt(B.before.length-1),F,J);if(U.inside)G=n3(F)+G.slice(1);let Y=G.charCodeAt(G.length-1),K=wZ(B.after.charCodeAt(0),Y,J);if(K.inside)G=G.slice(0,-1)+n3(Y);let W=X.move(J+J);return Q(),H.attentionEncodeSurroundingInfo={after:K.outside,before:U.outside},z+G+W}function x90($,Z,H){return H.options.strong||"*"}function wh($,Z,H,B){return H.safe($.value,B)}function Eh($){let Z=$.options.ruleRepetition||3;if(Z<3)throw Error("Cannot serialize rules with repetition `"+Z+"` for `options.ruleRepetition`, expected `3` or more");return Z}function Sh($,Z,H){let B=(wU(H)+(H.options.ruleSpaces?" ":"")).repeat(Eh(H));return H.options.ruleSpaces?B.slice(0,-1):B}var LJ={blockquote:Gh,break:aA,code:Nh,definition:Lh,emphasis:nA,hardBreak:aA,heading:Dh,html:oA,image:sA,imageReference:tA,inlineCode:eA,link:ZV,linkReference:HV,list:Ph,listItem:Oh,paragraph:jh,root:Th,strong:JV,text:wh,thematicBreak:Sh};function XV(){return{enter:{table:v90,tableData:Ih,tableHeader:Ih,tableRow:f90},exit:{codeText:m90,table:g90,tableData:QV,tableHeader:QV,tableRow:QV}}}function v90($){let Z=$._align;p1(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(H){return H==="none"?null:H}),children:[]},$),this.data.inTable=!0}function g90($){this.exit($),this.data.inTable=void 0}function f90($){this.enter({type:"tableRow",children:[]},$)}function QV($){this.exit($)}function Ih($){this.enter({type:"tableCell",children:[]},$)}function m90($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,p90);let H=this.stack[this.stack.length-1];p1(H.type==="inlineCode"),H.value=Z,this.exit($)}function p90($,Z){return Z==="|"?Z:$}function zV($){let Z=$||{},H=Z.tableCellPadding,B=Z.tablePipeAlign,J=Z.stringLength,Q=H?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
63
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:K,table:X,tableCell:G,tableRow:z}};function X(W,N,L,V){return F(U(W,L,V),W.align)}function z(W,N,L,V){let A=Y(W,L,V),D=F([A]);return D.slice(0,D.indexOf(`
64
- `))}function G(W,N,L,V){let A=L.enter("tableCell"),D=L.enter("phrasing"),q=L.containerPhrasing(W,{...V,before:Q,after:Q});return D(),A(),q}function F(W,N){return zh(W,{align:N,alignDelimiters:B,padding:H,stringLength:J})}function U(W,N,L){let V=W.children,A=-1,D=[],q=N.enter("table");while(++A<V.length)D[A]=Y(V[A],N,L);return q(),D}function Y(W,N,L){let V=W.children,A=-1,D=[],q=N.enter("tableRow");while(++A<V.length)D[A]=G(V[A],W,N,L);return q(),D}function K(W,N,L){let V=LJ.inlineCode(W,N,L);if(L.stack.includes("tableCell"))V=V.replace(/\|/g,"\\$&");return V}}function GV(){return{exit:{taskListCheckValueChecked:Rh,taskListCheckValueUnchecked:Rh,paragraph:u90}}}function FV(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:c90}}}function Rh($){let Z=this.stack[this.stack.length-2];p1(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function u90($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let H=this.stack[this.stack.length-1];p1(H.type==="paragraph");let B=H.children[0];if(B&&B.type==="text"){let J=Z.children,Q=-1,X;while(++Q<J.length){let z=J[Q];if(z.type==="paragraph"){X=z;break}}if(X===H){if(B.value=B.value.slice(1),B.value.length===0)H.children.shift();else if(H.position&&B.position&&typeof B.position.start.offset==="number")B.position.start.column++,B.position.start.offset++,H.position.start=Object.assign({},B.position.start)}}}this.exit($)}function c90($,Z,H,B){let J=$.children[0],Q=typeof $.checked==="boolean"&&J&&J.type==="paragraph",X="["+($.checked?"x":" ")+"] ",z=H.createTracker(B);if(Q)z.move(X);let G=LJ.listItem($,Z,H,{...B,...z.current()});if(Q)G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,F);return G;function F(U){return U+X}}function UV(){return[uA(),dA(),iA(),XV(),GV()]}function YV($){return{extensions:[cA(),lA($),rA(),zV($),FV()]}}var d90={tokenize:n90,partial:!0},kh={tokenize:o90,partial:!0},bh={tokenize:s90,partial:!0},yh={tokenize:t90,partial:!0},l90={tokenize:e90,partial:!0},hh={name:"wwwAutolink",tokenize:r90,previous:vh},xh={name:"protocolAutolink",tokenize:a90,previous:gh},d9={name:"emailAutolink",tokenize:i90,previous:fh},_9={};function WV(){return{text:_9}}var j7=48;while(j7<123)if(_9[j7]=d9,j7++,j7===58)j7=65;else if(j7===91)j7=97;_9[43]=d9;_9[45]=d9;_9[46]=d9;_9[95]=d9;_9[72]=[d9,xh];_9[104]=[d9,xh];_9[87]=[d9,hh];_9[119]=[d9,hh];function i90($,Z,H){let B=this,J,Q;return X;function X(Y){if(!KV(Y)||!fh.call(B,B.previous)||NV(B.events))return H(Y);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(Y)}function z(Y){if(KV(Y))return $.consume(Y),z;if(Y===64)return $.consume(Y),G;return H(Y)}function G(Y){if(Y===46)return $.check(l90,U,F)(Y);if(Y===45||Y===95||m5(Y))return Q=!0,$.consume(Y),G;return U(Y)}function F(Y){return $.consume(Y),J=!0,G}function U(Y){if(Q&&J&&X2(B.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(Y);return H(Y)}}function r90($,Z,H){let B=this;return J;function J(X){if(X!==87&&X!==119||!vh.call(B,B.previous)||NV(B.events))return H(X);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(d90,$.attempt(kh,$.attempt(bh,Q),H),H)(X)}function Q(X){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(X)}}function a90($,Z,H){let B=this,J="",Q=!1;return X;function X(Y){if((Y===72||Y===104)&&gh.call(B,B.previous)&&!NV(B.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),J+=String.fromCodePoint(Y),$.consume(Y),z;return H(Y)}function z(Y){if(X2(Y)&&J.length<5)return J+=String.fromCodePoint(Y),$.consume(Y),z;if(Y===58){let K=J.toLowerCase();if(K==="http"||K==="https")return $.consume(Y),G}return H(Y)}function G(Y){if(Y===47){if($.consume(Y),Q)return F;return Q=!0,G}return H(Y)}function F(Y){return Y===null||L7(Y)||O1(Y)||D9(Y)||A7(Y)?H(Y):$.attempt(kh,$.attempt(bh,U),H)(Y)}function U(Y){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(Y)}}function n90($,Z,H){let B=0;return J;function J(X){if((X===87||X===119)&&B<3)return B++,$.consume(X),J;if(X===46&&B===3)return $.consume(X),Q;return H(X)}function Q(X){return X===null?H(X):Z(X)}}function o90($,Z,H){let B,J,Q;return X;function X(F){if(F===46||F===95)return $.check(yh,G,z)(F);if(F===null||O1(F)||D9(F)||F!==45&&A7(F))return G(F);return Q=!0,$.consume(F),X}function z(F){if(F===95)B=!0;else J=B,B=void 0;return $.consume(F),X}function G(F){if(J||B||!Q)return H(F);return Z(F)}}function s90($,Z){let H=0,B=0;return J;function J(X){if(X===40)return H++,$.consume(X),J;if(X===41&&B<H)return Q(X);if(X===33||X===34||X===38||X===39||X===41||X===42||X===44||X===46||X===58||X===59||X===60||X===63||X===93||X===95||X===126)return $.check(yh,Z,Q)(X);if(X===null||O1(X)||D9(X))return Z(X);return $.consume(X),J}function Q(X){if(X===41)B++;return $.consume(X),J}}function t90($,Z,H){return B;function B(z){if(z===33||z===34||z===39||z===41||z===42||z===44||z===46||z===58||z===59||z===63||z===95||z===126)return $.consume(z),B;if(z===38)return $.consume(z),Q;if(z===93)return $.consume(z),J;if(z===60||z===null||O1(z)||D9(z))return Z(z);return H(z)}function J(z){if(z===null||z===40||z===91||O1(z)||D9(z))return Z(z);return B(z)}function Q(z){return X2(z)?X(z):H(z)}function X(z){if(z===59)return $.consume(z),B;if(X2(z))return $.consume(z),X;return H(z)}}function e90($,Z,H){return B;function B(Q){return $.consume(Q),J}function J(Q){return m5(Q)?H(Q):Z(Q)}}function vh($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||O1($)}function gh($){return!X2($)}function fh($){return!($===47||KV($))}function KV($){return $===43||$===45||$===46||$===95||m5($)}function NV($){let Z=$.length,H=!1;while(Z--){let B=$[Z][1];if((B.type==="labelLink"||B.type==="labelImage")&&!B._balanced){H=!0;break}if(B._gfmAutolinkLiteralWalkedInto){H=!1;break}}if($.length>0&&!H)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return H}var $30={tokenize:z30,partial:!0};function LV(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:J30,continuation:{tokenize:Q30},exit:X30}},text:{[91]:{name:"gfmFootnoteCall",tokenize:B30},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Z30,resolveTo:H30}}}}function Z30($,Z,H){let B=this,J=B.events.length,Q=B.parser.gfmFootnotes||(B.parser.gfmFootnotes=[]),X;while(J--){let G=B.events[J][1];if(G.type==="labelImage"){X=G;break}if(G.type==="gfmFootnoteCall"||G.type==="labelLink"||G.type==="label"||G.type==="image"||G.type==="link")break}return z;function z(G){if(!X||!X._balanced)return H(G);let F=p2(B.sliceSerialize({start:X.end,end:B.now()}));if(F.codePointAt(0)!==94||!Q.includes(F.slice(1)))return H(G);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(G),$.exit("gfmFootnoteCallLabelMarker"),Z(G)}}function H30($,Z){let H=$.length,B;while(H--)if($[H][1].type==="labelImage"&&$[H][0]==="enter"){B=$[H][1];break}$[H+1][1].type="data",$[H+3][1].type="gfmFootnoteCallLabelMarker";let J={type:"gfmFootnoteCall",start:Object.assign({},$[H+3][1].start),end:Object.assign({},$[$.length-1][1].end)},Q={type:"gfmFootnoteCallMarker",start:Object.assign({},$[H+3][1].end),end:Object.assign({},$[H+3][1].end)};Q.end.column++,Q.end.offset++,Q.end._bufferIndex++;let X={type:"gfmFootnoteCallString",start:Object.assign({},Q.end),end:Object.assign({},$[$.length-1][1].start)},z={type:"chunkString",contentType:"string",start:Object.assign({},X.start),end:Object.assign({},X.end)},G=[$[H+1],$[H+2],["enter",J,Z],$[H+3],$[H+4],["enter",Q,Z],["exit",Q,Z],["enter",X,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z],$[$.length-2],$[$.length-1],["exit",J,Z]];return $.splice(H,$.length-H+1,...G),$}function B30($,Z,H){let B=this,J=B.parser.gfmFootnotes||(B.parser.gfmFootnotes=[]),Q=0,X;return z;function z(Y){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),G}function G(Y){if(Y!==94)return H(Y);return $.enter("gfmFootnoteCallMarker"),$.consume(Y),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",F}function F(Y){if(Q>999||Y===93&&!X||Y===null||Y===91||O1(Y))return H(Y);if(Y===93){$.exit("chunkString");let K=$.exit("gfmFootnoteCallString");if(!J.includes(p2(B.sliceSerialize(K))))return H(Y);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!O1(Y))X=!0;return Q++,$.consume(Y),Y===92?U:F}function U(Y){if(Y===91||Y===92||Y===93)return $.consume(Y),Q++,F;return F(Y)}}function J30($,Z,H){let B=this,J=B.parser.gfmFootnotes||(B.parser.gfmFootnotes=[]),Q,X=0,z;return G;function G(N){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(N),$.exit("gfmFootnoteDefinitionLabelMarker"),F}function F(N){if(N===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(N),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",U;return H(N)}function U(N){if(X>999||N===93&&!z||N===null||N===91||O1(N))return H(N);if(N===93){$.exit("chunkString");let L=$.exit("gfmFootnoteDefinitionLabelString");return Q=p2(B.sliceSerialize(L)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(N),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),K}if(!O1(N))z=!0;return X++,$.consume(N),N===92?Y:U}function Y(N){if(N===91||N===92||N===93)return $.consume(N),X++,U;return U(N)}function K(N){if(N===58){if($.enter("definitionMarker"),$.consume(N),$.exit("definitionMarker"),!J.includes(Q))J.push(Q);return a0($,W,"gfmFootnoteDefinitionWhitespace")}return H(N)}function W(N){return Z(N)}}function Q30($,Z,H){return $.check(q9,Z,$.attempt($30,Z,H))}function X30($){$.exit("gfmFootnoteDefinition")}function z30($,Z,H){let B=this;return a0($,J,"gfmFootnoteDefinitionIndent",5);function J(Q){let X=B.events[B.events.length-1];return X&&X[1].type==="gfmFootnoteDefinitionIndent"&&X[2].sliceSerialize(X[1],!0).length===4?Z(Q):H(Q)}}function AV($){let H=($||{}).singleTilde,B={name:"strikethrough",tokenize:Q,resolveAll:J};if(H===null||H===void 0)H=!0;return{text:{[126]:B},insideSpan:{null:[B]},attentionMarkers:{null:[126]}};function J(X,z){let G=-1;while(++G<X.length)if(X[G][0]==="enter"&&X[G][1].type==="strikethroughSequenceTemporary"&&X[G][1]._close){let F=G;while(F--)if(X[F][0]==="exit"&&X[F][1].type==="strikethroughSequenceTemporary"&&X[F][1]._open&&X[G][1].end.offset-X[G][1].start.offset===X[F][1].end.offset-X[F][1].start.offset){X[G][1].type="strikethroughSequence",X[F][1].type="strikethroughSequence";let U={type:"strikethrough",start:Object.assign({},X[F][1].start),end:Object.assign({},X[G][1].end)},Y={type:"strikethroughText",start:Object.assign({},X[F][1].end),end:Object.assign({},X[G][1].start)},K=[["enter",U,z],["enter",X[F][1],z],["exit",X[F][1],z],["enter",Y,z]],W=z.parser.constructs.insideSpan.null;if(W)d5(K,K.length,0,i3(W,X.slice(F+1,G),z));d5(K,K.length,0,[["exit",Y,z],["enter",X[G][1],z],["exit",X[G][1],z],["exit",U,z]]),d5(X,F-1,G-F+3,K),G=F+K.length-2;break}}G=-1;while(++G<X.length)if(X[G][1].type==="strikethroughSequenceTemporary")X[G][1].type="data";return X}function Q(X,z,G){let F=this.previous,U=this.events,Y=0;return K;function K(N){if(F===126&&U[U.length-1][1].type!=="characterEscape")return G(N);return X.enter("strikethroughSequenceTemporary"),W(N)}function W(N){let L=p9(F);if(N===126){if(Y>1)return G(N);return X.consume(N),Y++,W}if(Y<2&&!H)return G(N);let V=X.exit("strikethroughSequenceTemporary"),A=p9(N);return V._open=!A||A===2&&Boolean(L),V._close=!L||L===2&&Boolean(A),z(N)}}}class VV{constructor(){this.map=[]}add($,Z,H){G30(this,$,Z,H)}consume($){if(this.map.sort(function(J,Q){return J[0]-Q[0]}),this.map.length===0)return;let Z=this.map.length,H=[];while(Z>0)Z-=1,H.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];H.push($.slice()),$.length=0;let B=H.pop();while(B){for(let J of B)$.push(J);B=H.pop()}this.map.length=0}}function G30($,Z,H,B){let J=0;if(H===0&&B.length===0)return;while(J<$.map.length){if($.map[J][0]===Z){$.map[J][1]+=H,$.map[J][2].push(...B);return}J+=1}$.map.push([Z,H,B])}function mh($,Z){let H=!1,B=[];while(Z<$.length){let J=$[Z];if(H){if(J[0]==="enter"){if(J[1].type==="tableContent")B.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(J[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let Q=B.length-1;B[Q]=B[Q]==="left"?"center":"right"}}else if(J[1].type==="tableDelimiterRow")break}else if(J[0]==="enter"&&J[1].type==="tableDelimiterRow")H=!0;Z+=1}return B}function DV(){return{flow:{null:{name:"table",tokenize:F30,resolveAll:U30}}}}function F30($,Z,H){let B=this,J=0,Q=0,X;return z;function z(w){let h=B.events.length-1;while(h>-1){let j=B.events[h][1].type;if(j==="lineEnding"||j==="linePrefix")h--;else break}let E=h>-1?B.events[h][1].type:null,I=E==="tableHead"||E==="tableRow"?P:G;if(I===P&&B.parser.lazy[B.now().line])return H(w);return I(w)}function G(w){return $.enter("tableHead"),$.enter("tableRow"),F(w)}function F(w){if(w===124)return U(w);return X=!0,Q+=1,U(w)}function U(w){if(w===null)return H(w);if(h0(w)){if(Q>1)return Q=0,B.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(w),$.exit("lineEnding"),W;return H(w)}if(s0(w))return a0($,U,"whitespace")(w);if(Q+=1,X)X=!1,J+=1;if(w===124)return $.enter("tableCellDivider"),$.consume(w),$.exit("tableCellDivider"),X=!0,U;return $.enter("data"),Y(w)}function Y(w){if(w===null||w===124||O1(w))return $.exit("data"),U(w);return $.consume(w),w===92?K:Y}function K(w){if(w===92||w===124)return $.consume(w),Y;return Y(w)}function W(w){if(B.interrupt=!1,B.parser.lazy[B.now().line])return H(w);if($.enter("tableDelimiterRow"),X=!1,s0(w))return a0($,N,"linePrefix",B.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w);return N(w)}function N(w){if(w===45||w===58)return V(w);if(w===124)return X=!0,$.enter("tableCellDivider"),$.consume(w),$.exit("tableCellDivider"),L;return M(w)}function L(w){if(s0(w))return a0($,V,"whitespace")(w);return V(w)}function V(w){if(w===58)return Q+=1,X=!0,$.enter("tableDelimiterMarker"),$.consume(w),$.exit("tableDelimiterMarker"),A;if(w===45)return Q+=1,A(w);if(w===null||h0(w))return _(w);return M(w)}function A(w){if(w===45)return $.enter("tableDelimiterFiller"),D(w);return M(w)}function D(w){if(w===45)return $.consume(w),D;if(w===58)return X=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(w),$.exit("tableDelimiterMarker"),q;return $.exit("tableDelimiterFiller"),q(w)}function q(w){if(s0(w))return a0($,_,"whitespace")(w);return _(w)}function _(w){if(w===124)return N(w);if(w===null||h0(w)){if(!X||J!==Q)return M(w);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(w)}return M(w)}function M(w){return H(w)}function P(w){return $.enter("tableRow"),C(w)}function C(w){if(w===124)return $.enter("tableCellDivider"),$.consume(w),$.exit("tableCellDivider"),C;if(w===null||h0(w))return $.exit("tableRow"),Z(w);if(s0(w))return a0($,C,"whitespace")(w);return $.enter("data"),R(w)}function R(w){if(w===null||w===124||O1(w))return $.exit("data"),C(w);return $.consume(w),w===92?y:R}function y(w){if(w===92||w===124)return $.consume(w),R;return R(w)}}function U30($,Z){let H=-1,B=!0,J=0,Q=[0,0,0,0],X=[0,0,0,0],z=!1,G=0,F,U,Y,K=new VV;while(++H<$.length){let W=$[H],N=W[1];if(W[0]==="enter"){if(N.type==="tableHead"){if(z=!1,G!==0)ph(K,Z,G,F,U),U=void 0,G=0;F={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},K.add(H,0,[["enter",F,Z]])}else if(N.type==="tableRow"||N.type==="tableDelimiterRow"){if(B=!0,Y=void 0,Q=[0,0,0,0],X=[0,H+1,0,0],z)z=!1,U={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},K.add(H,0,[["enter",U,Z]]);J=N.type==="tableDelimiterRow"?2:U?3:1}else if(J&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")){if(B=!1,X[2]===0){if(Q[1]!==0)X[0]=X[1],Y=EU(K,Z,Q,J,void 0,Y),Q=[0,0,0,0];X[2]=H}}else if(N.type==="tableCellDivider")if(B)B=!1;else{if(Q[1]!==0)X[0]=X[1],Y=EU(K,Z,Q,J,void 0,Y);Q=X,X=[Q[1],H,0,0]}}else if(N.type==="tableHead")z=!0,G=H;else if(N.type==="tableRow"||N.type==="tableDelimiterRow"){if(G=H,Q[1]!==0)X[0]=X[1],Y=EU(K,Z,Q,J,H,Y);else if(X[1]!==0)Y=EU(K,Z,X,J,H,Y);J=0}else if(J&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller"))X[3]=H}if(G!==0)ph(K,Z,G,F,U);K.consume(Z.events),H=-1;while(++H<Z.events.length){let W=Z.events[H];if(W[0]==="enter"&&W[1].type==="table")W[1]._align=mh(Z.events,H)}return $}function EU($,Z,H,B,J,Q){let X=B===1?"tableHeader":B===2?"tableDelimiter":"tableData",z="tableContent";if(H[0]!==0)Q.end=Object.assign({},SZ(Z.events,H[0])),$.add(H[0],0,[["exit",Q,Z]]);let G=SZ(Z.events,H[1]);if(Q={type:X,start:Object.assign({},G),end:Object.assign({},G)},$.add(H[1],0,[["enter",Q,Z]]),H[2]!==0){let F=SZ(Z.events,H[2]),U=SZ(Z.events,H[3]),Y={type:"tableContent",start:Object.assign({},F),end:Object.assign({},U)};if($.add(H[2],0,[["enter",Y,Z]]),B!==2){let K=Z.events[H[2]],W=Z.events[H[3]];if(K[1].end=Object.assign({},W[1].end),K[1].type="chunkText",K[1].contentType="text",H[3]>H[2]+1){let N=H[2]+1,L=H[3]-H[2]-1;$.add(N,L,[])}}$.add(H[3]+1,0,[["exit",Y,Z]])}if(J!==void 0)Q.end=Object.assign({},SZ(Z.events,J)),$.add(J,0,[["exit",Q,Z]]),Q=void 0;return Q}function ph($,Z,H,B,J){let Q=[],X=SZ(Z.events,H);if(J)J.end=Object.assign({},X),Q.push(["exit",J,Z]);B.end=Object.assign({},X),Q.push(["exit",B,Z]),$.add(H+1,0,Q)}function SZ($,Z){let H=$[Z],B=H[0]==="enter"?"start":"end";return H[1][B]}var Y30={name:"tasklistCheck",tokenize:K30};function qV(){return{text:{[91]:Y30}}}function K30($,Z,H){let B=this;return J;function J(G){if(B.previous!==null||!B._gfmTasklistFirstContentOfListItem)return H(G);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),Q}function Q(G){if(O1(G))return $.enter("taskListCheckValueUnchecked"),$.consume(G),$.exit("taskListCheckValueUnchecked"),X;if(G===88||G===120)return $.enter("taskListCheckValueChecked"),$.consume(G),$.exit("taskListCheckValueChecked"),X;return H(G)}function X(G){if(G===93)return $.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return H(G)}function z(G){if(h0(G))return Z(G);if(s0(G))return $.check({tokenize:W30},Z,H)(G);return H(G)}}function W30($,Z,H){return a0($,B,"whitespace");function B(J){return J===null?H(J):Z(J)}}function uh($){return cF([WV(),LV(),AV($),DV(),qV()])}var N30={};function SU($){let Z=this,H=$||N30,B=Z.data(),J=B.micromarkExtensions||(B.micromarkExtensions=[]),Q=B.fromMarkdownExtensions||(B.fromMarkdownExtensions=[]),X=B.toMarkdownExtensions||(B.toMarkdownExtensions=[]);J.push(uh(H)),Q.push(UV()),X.push(YV(H))}var T7=O(d(),1),L30=[SU],A30=[CU],V30={code({node:$,className:Z,children:H,...B}){return T7.jsx("code",{className:s("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",Z),...B,children:H})},pre({children:$}){return T7.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:T7.jsx("pre",{className:"overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0",children:$})})}};function ch({size:$="sm",content:Z}){return T7.jsx("div",{className:s("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:T7.jsx(LU,{remarkPlugins:L30,rehypePlugins:A30,components:V30,children:Z})})}function dh({content:$}){return T7.jsx(LU,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var uV=O(g(),1);var lh="/agentation-4s0nn45p.png";var ih="/airtable-hsa66v6q.png";var rh="/apollo-2ed5dy2d.png";var ah="/asana-tvgtwbx2.png";var nh="/atlassian-b3tq39hs.png";var oh="/box-w3n36t5g.png";var MV="/chrome-tspm94rw.svg";var sh="/clickup-qqrqqvqb.png";var th="/cloudflare-j9p931v6.png";var eh="/context7-8ht0xjfy.png";var $x="/datadog-70ne3yzt.png";var Zx="/discord-vejhptwx.png";var Hx="/dropbox-4m5s9mgr.png";var Bx="/elevenlabs-2nzzej1t.png";var Jx="/exa-qqj3vr0x.png";var Qx="/figma-y9898rry.png";var Xx="/firecrawl-w2t8nehx.png";var zx="/github-av5r5y3e.png";var Gx="/gitlab-4pv5vm6b.png";var Fx="/gmail-sg6a5v3x.png";var Ux="/googlecalendar-nqhh2v7r.png";var Yx="/googledrive-6s8xyab7.png";var Kx="/grafana-1yfsnwr6.png";var Wx="/granola-7j3b0nk2.png";var Nx="/hubspot-hghcmc2t.png";var Lx="/huggingface-kxzaxj83.png";var Ax="/intercom-td763jt8.png";var Vx="/linear-v9s3az2d.png";var Dx="/monday-jdbs4wwf.png";var qx="/mongodb-emzxvhd5.png";var Mx="/neon-zj4qar44.png";var Px="/notion-w034c0b8.png";var _x="/paper-zbt34fab.png";var Ox="/paypal-kwwf7xsc.png";var jx="/perplexity-4y63rxvj.png";var Tx="/postgresql-qsspbsr1.png";var Cx="/posthog-sphppc4w.png";var wx="/puppeteer-2xjt1a9b.png";var Ex="/railway-834de8d2.png";var Sx="/redis-spm6w2m1.png";var Ix="/salesforce-1mk56v4z.png";var Rx="/sentry-hdwpmvek.png";var kx="/shopify-90dadaav.png";var bx="/slack-1c1wj62s.png";var yx="/snowflake-hfpykpgy.png";var hx="/stripe-zrfaqbj3.png";var xx="/supabase-4vg33zf2.png";var vx="/telegram-v6tjyrs7.png";var gx="/twilio-dpyjdwpj.png";var fx="/vercel-7d0ssw28.png";var mx="/zapier-p67qfch0.png";var L60={agentation:lh,airtable:ih,apollo:rh,asana:ah,atlassian:nh,box:oh,chrome:MV,"chrome-devtools":MV,clickup:sh,cloudflare:th,context7:eh,datadog:$x,discord:Zx,dropbox:Hx,elevenlabs:Bx,exa:Jx,figma:Qx,firecrawl:Xx,github:zx,gitlab:Gx,gmail:Fx,googlecalendar:Ux,googledrive:Yx,grafana:Kx,granola:Wx,hubspot:Nx,huggingface:Lx,intercom:Ax,linear:Vx,monday:Dx,mongodb:qx,neon:Mx,notion:Px,paper:_x,paypal:Ox,perplexity:jx,postgresql:Tx,posthog:Cx,puppeteer:wx,railway:Ex,redis:Sx,salesforce:Ix,sentry:Rx,shopify:kx,slack:bx,snowflake:yx,stripe:hx,supabase:xx,telegram:vx,twilio:gx,vercel:fx,zapier:mx},A60={"google drive":"googledrive","google calendar":"googlecalendar",gcal:"googlecalendar",gdrive:"googledrive","apollo.io":"apollo","paper-desktop":"paper","granola-mcp":"granola","claude-in-chrome":"chrome",postgres:"postgresql","hugging face":"huggingface",jira:"atlassian",confluence:"atlassian"};function px($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function IU($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var V60=new Map(Object.entries(L60).map(([$,Z])=>[IU($),Z])),D60=new Map(Object.entries(A60).map(([$,Z])=>[IU($),IU(Z)]));function RU($){let Z=IU(px($));return V60.get(D60.get(Z)??Z)}function kU($){return px($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var PV=O(d(),1);function AJ({open:$,children:Z}){return PV.jsx($4,{initial:!1,children:$&&PV.jsx(B5.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",duration:0.25,bounce:0.1},className:"overflow-hidden",children:Z},"content")})}var ux=O(g(),1);var lx=O(d(),1),q60=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function cx($,Z){if($.name!=="Read"||!Z)return null;let H=$.input,B=typeof H.file_path==="string"?H.file_path:null;if(!B||!q60.test(B))return null;let J=Z.endsWith("/")?Z:`${Z}/`;if(!B.startsWith(J))return null;return B.slice(J.length)}function dx({relPath:$}){let Z=H5(),[H,B]=ux.useState(!1);if(H)return null;let J=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return lx.jsx("img",{src:J,alt:$,loading:"lazy",onError:()=>B(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var MJ=O(g(),1);var rx=O(d(),1),M60=s("animate-[text-shimmer_2s_ease-in-out_infinite]","bg-clip-text text-transparent","bg-[length:200%_auto]","bg-[linear-gradient(90deg,var(--muted-foreground)_0%,var(--muted-foreground)_40%,var(--foreground)_50%,var(--muted-foreground)_60%,var(--muted-foreground)_100%)]");function ix({children:$,active:Z=!0,className:H}){return rx.jsx("span",{className:s(H,Z&&M60),children:$})}var VJ=O(d(),1);function bU({className:$}){return VJ.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:$,"aria-hidden":"true",children:[VJ.jsx("path",{d:"M3.49994 11.7501L11.6717 3.57855C12.7762 2.47398 14.5672 2.47398 15.6717 3.57855C16.7762 4.68312 16.7762 6.47398 15.6717 7.57855M15.6717 7.57855L9.49994 13.7501M15.6717 7.57855C16.7762 6.47398 18.5672 6.47398 19.6717 7.57855C20.7762 8.68312 20.7762 10.474 19.6717 11.5785L12.7072 18.543C12.3167 18.9335 12.3167 19.5667 12.7072 19.9572L13.9999 21.2499"}),VJ.jsx("path",{d:"M17.4999 9.74921L11.3282 15.921C10.2238 17.0255 8.43275 17.0255 7.32825 15.921C6.22376 14.8164 6.22376 13.0255 7.32825 11.921L13.4999 5.74939"})]})}var z2=O(d(),1),yU="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function RZ({isFirst:$,isLast:Z,marker:H,loading:B=!1,isError:J=!1,children:Q}){let X=H!=null||B;return z2.jsxs("div",{className:"relative flex gap-2.5",children:[z2.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&z2.jsx("span",{className:s("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"h-1":"h-2.5")}),!Z&&z2.jsx("span",{className:s("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"top-[26px]":"top-5")}),H?z2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:H}):B?z2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:z2.jsx(I5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):z2.jsx("span",{className:s("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",J?"bg-destructive":"bg-border")})]}),Q]})}function DJ({open:$}){return z2.jsx(B5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:s("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:z2.jsx(X7,{size:12,stroke:1.75})})}function IZ({children:$,className:Z}){return z2.jsx("span",{className:s("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function ax({icon:$,size:Z=12,stroke:H=1.75}){return z2.jsx(IZ,{children:z2.jsx($,{size:Z,stroke:H,className:"text-muted-foreground"})})}function nx({src:$}){if(!$)return z2.jsx(IZ,{children:z2.jsx(bU,{className:"size-3 text-muted-foreground"})});return z2.jsx(IZ,{children:z2.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var R60=tx(),_V=Qv();function k60($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function b60($){try{return _V($,k60)}catch{return null}}function Xv($){return $.split("/").pop()??$}var y60=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),h60=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),x60=/^[A-Za-z_][A-Za-z0-9_]*=/;function v60($){if(/^-[a-zA-Z]*c$/.test($))return!0;let Z=$.toLowerCase();return Z==="--command"||Z==="-command"}function g60($){let Z=b60($);if(!Z||Z.length<3)return null;let H=(Q)=>{let X=Z[Q];return typeof X==="string"?X:null},B=0,J=()=>{while(x60.test(H(B)??""))B++};if(J(),Xv(H(B)??"")==="env")B++,J();if(!y60.has(Xv(H(B)??"")))return null;B++;while(B<Z.length){let Q=H(B);if(Q===null)return null;if(v60(Q)){if(B+2!==Z.length)return null;return H(B+1)?.trim()||null}if(!Q.startsWith("-")&&!Q.startsWith("+"))return null;B+=h60.has(Q)?2:1}return null}function f60($){let Z=$;for(let H=0;H<3;H++){let B=g60(Z);if(B===null)return Z;Z=B}return Z}function m60($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function w7($){return m60(f60($))}function kZ($,Z){let H=w7($);return H?Z(`$ ${H}`):""}var p60=/^[A-Za-z]:\//;function u60($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(p60,(Z)=>Z.toUpperCase())}var c60=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var zv=/^\/([A-Za-z]:)?$/;function d60(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var OV=function(...$){$=$.map((B)=>u60(B));let Z="",H=!1;for(let B=$.length-1;B>=-1&&!H;B--){let J=B>=0?$[B]:d60();if(!J||J.length===0)continue;Z=`${J}/${Z}`,H=jV(J)}if(Z=Gv(Z,!H),H&&!jV(Z))return`/${Z}`;return Z.length>0?Z:"."};function Gv($,Z){let H="",B=0,J=-1,Q=0,X=null;for(let z=0;z<=$.length;++z){if(z<$.length)X=$[z];else if(X==="/")break;else X="/";if(X==="/"){if(J===z-1||Q===1);else if(Q===2){if(H.length<2||B!==2||H[H.length-1]!=="."||H[H.length-2]!=="."){if(H.length>2){let G=H.lastIndexOf("/");if(G===-1)H="",B=0;else H=H.slice(0,G),B=H.length-1-H.lastIndexOf("/");J=z,Q=0;continue}else if(H.length>0){H="",B=0,J=z,Q=0;continue}}if(Z)H+=H.length>0?"/..":"..",B=2}else{if(H.length>0)H+=`/${$.slice(J+1,z)}`;else H=$.slice(J+1,z);B=z-J-1}J=z,Q=0}else if(X==="."&&Q!==-1)++Q;else Q=-1}return H}var jV=function($){return c60.test($)};var TV=function($,Z){let H=OV($).replace(zv,"$1").split("/"),B=OV(Z).replace(zv,"$1").split("/");if(B[0][1]===":"&&H[0][1]===":"&&H[0]!==B[0])return B.join("/");let J=[...H];for(let Q of J){if(B[0]!==Q)break;H.shift(),B.shift()}return[...H.map(()=>".."),...B].join("/")};function bZ($){return $.input??{}}function F1($,Z){let H=$[Z];return typeof H==="string"?H:""}function Fv($){return(Z)=>Z.replace(/\/[^\s"']+/g,(H)=>{if(!$)return H;let B=TV($,H);return B.startsWith("..")?H:B})}function E7($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let H=Math.floor(Z/60),B=Z%60;return B?`${H}m ${B}s`:`${H}m`}var l60={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function i60($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function r60($,Z){let H=$.name,B=bZ($);if(H==="Bash")return kZ(F1(B,"command"),Z);if(H==="Read"||H==="Write"||H==="Edit")return Z(F1(B,"file_path"));if(H==="Glob")return Z(F1(B,"pattern"));if(H==="Grep")return`/${F1(B,"pattern")}/ ${Z(F1(B,"path"))}`;if(H==="WebSearch")return F1(B,"query");if(H==="WebFetch")return F1(B,"url");if(H==="ToolSearch"){let J=F1(B,"query");if(J.startsWith("select:"))return J.slice(7).split(",").map(i60).join(", ");return J}return""}var qJ={displayName:($)=>l60[$.name]??$.name,brief:r60};var CV={exec:"Bash",apply_patch:"Edit",web_search:"Web search",update_plan:"Update plan",subagent:"Run sub-agent",subagent_activity:"Sub-agent",review:"Review",view_image:"View image",generate_image:"Generate image",list_mcp_resources:"List MCP resources",list_mcp_resource_templates:"List MCP templates",read_mcp_resource:"Read MCP resource"},Yv={read:"Read",listFiles:"List files",search:"Search"};function Kv($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let H=Z[0],B=H?.type;if(!B||!(B in Yv))return null;if(Z.some((J)=>J?.type!==B))return null;return H}var Uv={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function a60($){if($.name==="exec"){let Z=Kv($.input);if(Z?.type)return Yv[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in Uv)return Uv[Z]}return CV[$.name]??$.name}function n60($,Z){let H=$.name,B=bZ($);if(H==="exec"){let J=Kv(B);if(J?.type==="read")return Z(J.path||J.name||"");if(J?.type==="search")return[J.query&&`/${J.query}/`,J.path&&Z(J.path)].filter(Boolean).join(" ");if(J?.type==="listFiles")return J.path?Z(J.path):"";return kZ(F1(B,"command"),Z)}if(H==="apply_patch"){let J=B.changes;if(Array.isArray(J))return J.map((X)=>X&&typeof X==="object"?X.path:void 0).filter((X)=>typeof X==="string").map(Z).join(", ");return""}if(H==="web_search"){let J=B.queries;if(Array.isArray(J)&&J.length>0)return J.filter((Q)=>typeof Q==="string").join(" · ");return F1(B,"query")}if(H==="update_plan"){let J=B.plan;return typeof J==="string"?J.split(`
65
- `)[0]:""}if(H==="subagent"){if(F1(B,"action")==="close_agent")return"";return F1(B,"prompt")}if(H==="subagent_activity")return F1(B,"kind");if(H==="generate_image")return F1(B,"prompt").split(`
66
- `)[0];if(H==="read_mcp_resource")return F1(B,"uri");if(H==="list_mcp_resources"||H==="list_mcp_resource_templates")return F1(B,"server");return""}var Wv={displayName:a60,brief:n60};function Nv($){let Z=$.indexOf(":"),H=(Z>0?$.slice(0,Z):$).trim(),B=Z>0?$.slice(Z+1).trim():"",J=H.match(/^(.*?)\s*\(([^)]*)\)$/);if(!J)return{action:H,qualifier:"",detail:B};return{action:J[1].trim(),qualifier:J[2].trim(),detail:B}}var o60={terminal:"Run command",read:"Read",write:"Write",edit:"Edit",patch:"Edit",search:"Search",extract:"Fetch webpage","web extract":"Fetch webpage","web search":"Web search",delegate:"Delegate task","delegate batch":"Delegate tasks",todo:"Update TODO",python:"Run Python","process wait":"Wait for process","session search":"Search sessions","skills list":"List skills","skill view":"View skill"};function s60($){let{action:Z}=Nv($.name),H=o60[Z];if(H)return H;let B=Z.replace(/_/g," ");return B.charAt(0).toUpperCase()+B.slice(1)}function t60($,Z){let{action:H,qualifier:B,detail:J}=Nv($.name),Q=J||B;if(!Q)return"";return H==="terminal"?`$ ${w7(Q)}`:Z(Q)}var Lv={displayName:s60,brief:t60};var e60={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",bash:"Bash",ls:"List files",find:"Find files",grep:"Search",process:"Manage process",web_search:"Web search",web_fetch:"Fetch",sessions_list:"List sessions",sessions_history:"Recall session",sessions_yield:"Yield to session",sessions_send:"Send to session",sessions_spawn:"Spawn session",subagents:"Run sub-agent",agents_list:"List agents",session_status:"Session status",image:"Analyze image",image_generate:"Generate image",memory_get:"Read memory",memory_search:"Search memory",update_plan:"Update plan",message:"Send message",browser:"Browser",canvas:"Canvas",cron:"Cron",gateway:"Gateway",code_execution:"Run Python",tts:"Text-to-speech",music_generate:"Generate music",video_generate:"Generate video",x_search:"Search X"};function $70($,Z){let H=$.name,B=bZ($);if(H==="read"||H==="write"||H==="edit")return Z(F1(B,"path"));if(H==="apply_patch"){let J=B.changes;if(Array.isArray(J)&&J.length>0){let z=J.map((G)=>G&&typeof G==="object"?F1(G,"path"):"").filter(Boolean);if(z.length===1)return Z(z[0]);if(z.length>1)return`${z.length} files`}let Q=F1(B,"patch")||F1(B,"input"),X=Q.split(`
67
- `).find((z)=>z.startsWith("*** "))??Q.split(`
68
- `)[0];return Z(X??"")}if(H==="exec"||H==="bash"){let J=F1(B,"command")||F1(B,"code");return kZ(J,Z)}if(H==="ls"||H==="find"||H==="grep")return Z(F1(B,"path")||F1(B,"pattern"));if(H==="process"){let J=F1(B,"action"),Q=F1(B,"name");return[J,Q].filter(Boolean).join(" ")||Z(w7(F1(B,"command")))}if(H==="web_search"||H==="x_search")return F1(B,"query");if(H==="web_fetch")return F1(B,"url");if(H==="memory_search")return F1(B,"query");if(H==="memory_get")return F1(B,"key")||F1(B,"name");if(H==="sessions_history"||H==="sessions_send"||H==="sessions_yield")return F1(B,"sessionKey")||F1(B,"agentId");if(H==="sessions_list"||H==="agents_list")return F1(B,"agentId");if(H==="subagents"||H==="sessions_spawn")return F1(B,"task")||F1(B,"agentId");if(H==="image"||H==="image_generate")return F1(B,"prompt")||Z(F1(B,"path"));if(H==="message")return F1(B,"recipient")||F1(B,"to");if(H==="update_plan"){let J=B.plan;if(Array.isArray(J)){let X=J.find((z)=>!!z&&typeof z==="object"&&z.status==="in_progress")?.step??J[0]?.step;if(typeof X==="string")return X}return""}return""}var Av={displayName:($)=>e60[$.name]??qJ.displayName($),brief:($,Z)=>$70($,Z)||qJ.brief($,Z)};function wV($){if(!($.name==="Bash"||$.name==="exec"||$.name==="bash"))return null;let H=$.input??{},B=typeof H.command==="string"?H.command:"";if(!B)return null;let Q=w7(B).match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!Q)return null;return{server:Q[1],tool:Q[2],rest:(Q[3]??"").trim()}}function EV($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let H=Z.slice(5),B=H.indexOf("__");if(B<=0)return null;return{server:H.slice(0,B),tool:H.slice(B+2),rest:""}}function SV($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in CV)return null;if($.mcpServer==="codex")return null;let Z=$.name.indexOf(".");if(Z>0)return{server:$.name.slice(0,Z),tool:$.name.slice(Z+1),rest:""};return{server:$.mcpServer,tool:$.name,rest:""}}function IV($,Z){let H=Z.toLowerCase();return["-","_","."].find((J)=>H.startsWith($.toLowerCase()+J))?Z.slice($.length+1):Z}var Z70={"claude-code":qJ,openclaw:Av,codex:Wv,hermes:Lv};function Vv($){return Z70[$.provider??"claude-code"]}function Dv($){return Vv($).displayName($)}function qv($,Z){return Vv($).brief($,Fv(Z))}var l5=O(d(),1),Mv=[Pv,_v,RV];function H70(){let[$,Z]=MJ.useState(0);MJ.useEffect(()=>{let B=setInterval(()=>Z((J)=>(J+1)%Mv.length),600);return()=>clearInterval(B)},[]);let H=Mv[$];return l5.jsx(IZ,{className:"size-5",children:l5.jsx(H,{size:16,stroke:1.75,className:"text-foreground"})})}function Ov({call:$,cwd:Z,isFirst:H,isLast:B,renderNestedParts:J}){let[Q,X]=MJ.useState(!1),z=$.subagent,G=$.input??{},F=z?.description??G.description??"Subtask",U=z?.status,Y=$.state==="error"||U==="failed",K=$.state==="running"||U==="running",W=z?.usage?.toolUses,N=z?.usage?.durationMs,V=(K&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(W!=null?`Took ${W} step${W===1?"":"s"}`:null),A=(z?.transcript??[]).flatMap((_)=>_.parts),D=typeof $.output==="string"?$.output:"",q=A.length>0||!!D;return l5.jsx(RZ,{isFirst:H,isLast:B,marker:K?l5.jsx(H70,{}):l5.jsx(IZ,{className:"size-5",children:l5.jsx(RV,{size:16,stroke:1.75,className:"text-foreground"})}),isError:Y,children:l5.jsxs("div",{className:"min-w-0 flex-1",children:[l5.jsxs("button",{type:"button",title:`Agent: ${F}`,onClick:()=>q&&X((_)=>!_),className:s("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",q?"cursor-pointer":"cursor-default"),children:[l5.jsxs("span",{className:"flex w-full items-center gap-2",children:[l5.jsxs(ix,{active:K,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",F]}),!K&&N!=null&&l5.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:E7(N)}),U==="failed"&&l5.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),U==="stopped"&&l5.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),q&&l5.jsx(DJ,{open:Q})]}),V&&l5.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:V})]}),q&&l5.jsx(AJ,{open:Q,children:l5.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[A.length>0&&l5.jsx("div",{className:"py-1.5 pr-2 pl-3",children:J(A,Z)}),D&&l5.jsx("div",{className:s("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",A.length>0&&"border-t border-border"),children:D})]})})]})})}var S7=O(g(),1);var bv=O(g(),1);var yV=new Set(["<",">","{","}","[","]"]),gV=new Set(["for","do","while","if","else","return","function","var","let","const","true","false","undefined","this","new","delete","typeof","in","instanceof","void","break","continue","switch","case","default","throw","try","catch","finally","debugger","with","yield","async","await","class","extends","super","import","export","from","static"]),B70=new Set([...gV,"type","interface","enum","implements","readonly","abstract","declare","namespace","module","private","protected","public","override","keyof","infer","is","asserts","satisfies","as","unknown","never","any","number","string","boolean","bigint","symbol","object"]),wv=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...yV]),J70={keywords:gV,onCommentStart:Rv,onCommentEnd:W70};function Q70($){let Z=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test($))Z+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test($))Z+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test($))Z+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test($))Z+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test($))Z+=1;return Z>=2}function X70($,Z){if($[Z]!=="<")return!1;let H=0,B=!1;for(let J=Z;J<$.length;J++){let Q=$[J];if(Q==="<"){H++;continue}if(Q===">"){if(H--,H===0){let X=J+1;while(X<$.length&&/\s/.test($[X]))X++;if(!(B&&$[X]==="("))return!1;let z=$.slice(X,X+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(H===0)continue;if(/[$A-Za-z_]/.test(Q)){B=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(Q))continue;return!1}return!1}var vU=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[yZ,z70,o3,kV,bV,G70,F70,O9,jv,hV,Tv]=vU.map(($,Z)=>Z);function PJ($){return/^[^\S\r\n]+$/g.test($)}function U70($){return wv.has($)}function Y70($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function gU($){return/^[\w_]+$/.test($)||Ev($)}function Cv($){let Z=$[0];return gU(Z)&&Z===Z.toUpperCase()||$==="null"}function Ev($){return/[^\u0000-\u007f]/.test($)}function Sv($){return/^[a-zA-Z]$/.test($)}function Iv($){return Sv($)||Ev($)}function hZ($){return Iv($[0])&&($.length===1||gU($.slice(1)))}function xV($){return $==="`"}function vV($){return $==='"'||$==="'"}function K70($){return vV($)||xV($)}function Rv($,Z){let H=$+Z;if(H==="/*")return 2;return H==="//"?1:0}function W70($,Z){return $+Z==="*/"?2:Z===`
69
- `?1:0}function N70($){return $[0]==="/"&&!Rv($[0],$[1])}function L70($,Z){let H={...J70,...Z},B=!!(Z&&Z.keywords instanceof Set),J=Q70($),Q=B?H.keywords:J?B70:gV,{onCommentStart:X,onCommentEnd:z}=H,G=H.typeKeywords instanceof Set?H.typeKeywords:null,F="",U=-1,Y=[-1,""],K=[-2,""],W=[],N=!1,L=0,V=!1,A=0,D=()=>N&&!V&&!L,q=()=>L&&!D(),_=()=>!L&&D()&&!V&&A>0,M=null,P=!1,C=0,R=0,y=()=>M!==null,w=()=>P,h=()=>R>C,E=()=>R>0&&R===C,I=()=>y()||h();function j(k){let b=k===`
70
- `;if(q()){if(y())return o3;let[,c]=Y;if(hZ(k)){if(c==="<"||c==="</")return G70}}if(_())return F70;if(y()||h())return o3;else if(G&&G.has(k))return Y[1]==="."?yZ:kV;else if(Q.has(k))return Y[1]==="."?yZ:z70;else if(b)return hV;else if(PJ(k))return Tv;else if(k.split("").every(U70))return O9;else if(Cv(k))return q()?yZ:kV;else{if(hZ(k)){let c=Y[1]==="."&&hZ(K[1]);if(!I()&&!c)return yZ;if(c)return bV}return o3}}let S=(k,b)=>{if(b)F=b;if(F){U=typeof k==="number"?k:j(F);let v=[U,F];if(U!==Tv&&U!==hV)K=Y,Y=v;W.push(v)}F=""};for(let k=0;k<$.length;k++){let b=$[k],v=$[k-1],c=$[k+1],T=v+b,e=b+c;if(typeof H.onQuote==="function"&&b==="'"&&!y()&&!_()&&!h()){let p=H.onQuote(b,k,$);if(typeof p==="number"&&p>=1&&!Number.isNaN(p)){let X0=Math.min(p,$.length-k),K0=k+X0;S(),F=$.slice(k,K0),S(yZ),k=K0-1;continue}}if(vV(b)&&!_()&&!h()){if(S(),v!=="\\"){if(M&&b===M)M=null;else if(!M)M=b}S(o3,b);continue}if(!h()){if(v!=="\\n"&&xV(b)){S(),S(o3,b),R++;continue}}if(h()){if(v!=="\\n"&&xV(b)){if(R>0){S(),R--,S(o3,b);continue}}if(e==="${"){C++,S(o3),S(O9,e),k++;continue}}if(E()&&b==="}"){S(),C--,S(O9,b);continue}if(D()){if(b==="{"){S(),S(O9,b),V=!0;continue}}if(N){if(!L&&b==="<"){if(S(),c==="/")L=2,F=e,k++;else L=1,F=b;S(O9);continue}if(L){if(b===">"&&!"/=".includes(v)){if(S(),L===1)L=0,A++;else L=0,N=!1;S(O9,b);continue}if(e==="/>"||e==="</"){if(F!=="<"&&F!=="/")S();if(e==="/>")L=0;else A--;if(!A)N=!1;F=e,k++,S(O9);continue}if(b==="<"){S(),F=b,S(O9);continue}if(c==="-"&&!I()&&!_()){if(F){S(bV,F+b+c),k++;continue}}if(c==="="&&!I()){if(!PJ(b)){if(PJ(F))S();let p=F+b;if(hZ(p)){S(bV,p);continue}}}}}if(!L&&(b==="<"&&Iv(c)||e==="</")){let p=k-1;while(p>=0&&/\s/.test($[p]))p--;let X0=p>=0?$[p]:"",[K0,Q0]=Y,z0=!1,L0=!1;if(F&&!PJ(F)){let $0=F;if(Cv($0)||$0==="true"||$0==="false")z0=!0;else if(Q.has($0)&&hZ($0))L0=!0;else if(hZ($0))z0=!0}let i=b==="<"&&/[$\w\]\)]/.test(X0)&&(z0||!L0&&(K0===yZ||K0===kV||K0===O9&&(Q0===")"||Q0==="]"))),B0=b==="<"&&X70($,k);if(!i&&!B0)L=c==="/"?2:1;if(b==="<"&&(c==="/"||Sv(c))){if(!i&&!B0&&!I()&&!_()&&!w())N=!0}}let Z0=K70(b),x=h(),t=!N&&N70(e),D0=_();if(Z0||x||vV(M))F+=b;else if(t){S();let[p,X0]=Y;if(t&&p!==-1&&!(p===O9&&X0!==")"||p===jv)){F=b,S();continue}P=!0;let K0=k++,Q0=()=>k>=$.length,z0=()=>Q0()||$[k]===`
71
- `,L0=!1,i=!1;for(;!z0();k++){let B0=$[k],$0=$[k-1]==="\\";if(!$0&&B0==="[")i=!0;if(!$0&&B0==="]")i=!1;if(B0==="/"&&!i&&!$0){L0=!0;while(K0!==k&&/^[a-z]$/.test($[k+1])&&!z0())k++;break}}if(P=!1,K0!==k&&L0)F=$.slice(K0,k+1),S(o3);else F=b,S(),k=K0}else if(X(b,c)){S();let p=k,X0=X(b,c);if(X0){for(;k<$.length;k++)if(z($[k-1],$[k])==X0)break}F=$.slice(p,k+1),S(jv)}else if(b===" "||b===`
72
- `)if(b===" "&&(PJ(F)||!F||D0)){if(F+=b,c==="<")S()}else S(),F=b,S();else if(V&&b==="}")S(),F=b,S(),V=!1;else if(D0&&!yV.has(b)||h()||(gU(b)===gU(F[F.length-1])||D())&&!wv.has(b))F+=b;else{if(T==="</")F=T;if(S(),T!=="</")F=b;if(e==="</"||e==="/>")F=e,S(),k++;else if(yV.has(b))S()}}return S(),W}function A70($,Z){let H=[],B=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,J=0,Q=(F,U)=>{let Y=B?B(U,J):"";return J++,{type:"element",tagName:"span",children:F,properties:{className:Y?`sh__line ${Y}`:"sh__line"}}};function X(F){let U=F.map(([,K])=>K).join(""),Y=F.map(([K,W])=>{let N=vU[K];return{type:"element",tagName:"span",children:[{type:"text",value:W}],properties:{className:`sh__token--${N}`,style:{color:`var(--sh-${N})`}}}});H.push(Q(Y,U))}let z=[],G=!1;for(let F=0;F<$.length;F++){let U=$[F],[Y,K]=U,W=F===$.length-1;if(Y!==hV){if(K.includes(`
73
- `)){let N=K.split(`
74
- `);for(let L=0;L<N.length;L++)if(z.push([Y,N[L]]),L<N.length-1)X(z),z.length=0}else z.push(U);G=!1}else{if(G)X([]);else X(z),z.length=0;if(W)X([]);G=!0}}if(z.length)X(z);return H}var V70=($)=>{let Z=`class="${$.className}"`;if($.style){let H=Object.entries($.style).map(([B,J])=>`${B}:${J}`).join(";");Z+=` style="${H}"`}return Z};function D70($){return $.map((Z)=>{let{tagName:H}=Z,B=Z.children.map((J)=>{let{tagName:Q,children:X,properties:z}=J;return`<${Q} ${V70(z)}>${Y70(X[0].value)}</${Q}>`}).join("");return`<${H} class="${Z.properties.className}">${B}</${H}>`}).join(`
75
- `)}function kv($,Z){let H=L70($,Z),B=A70(H,Z);return D70(B)}var oZ1={TokenTypes:vU,TokenMap:new Map(vU.map(($,Z)=>[$,Z]))};var fV=O(d(),1),q70=s("[--sh-identifier:#1f2937]","[--sh-keyword:#cf222e]","[--sh-string:#16a34a]","[--sh-class:#2d6e7e]","[--sh-property:#0550ae]","[--sh-entity:#6f42c1]","[--sh-jsxliterals:#6f42c1]","[--sh-sign:#8b949e]","[--sh-comment:#9ca3af]");function yv({code:$,className:Z}){let H=bv.useMemo(()=>kv($),[$]);return fV.jsx("pre",{className:s("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",q70,Z),children:fV.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:H}})})}var M70={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",md:"md",mdx:"mdx",css:"css",scss:"scss",html:"html",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",c:"c",h:"c",cpp:"cpp",sh:"sh",bash:"sh",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",php:"php",swift:"swift",kt:"kt"};function P70($){let Z=$.split(/[\\/]/).pop()??"",H=Z.lastIndexOf("."),B=H>0?Z.slice(H+1).toLowerCase():"";return M70[B]??null}function _70($){let Z=$.trim();if(Z.length<2||!(Z.startsWith("{")||Z.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(Z),null,2)}catch{return null}}function O70($){let Z=$.split(`
76
- `);if(!Z.some((H)=>/^\s*\d+\t/.test(H)))return $;return Z.map((H)=>H.replace(/^\s*\d+\t/,"")).join(`
77
- `)}function hv($,Z){let H=$.input??{},B=typeof H.file_path==="string"?H.file_path:typeof H.path==="string"?H.path:"",J=B?P70(B):null,Q=$.name==="Read"||$.name==="read",X=$.name==="Write"||$.name==="write";if(J&&Q&&Z)return{kind:"highlight",code:O70(Z),label:J};if(J&&X&&typeof H.content==="string"&&H.content)return{kind:"highlight",code:H.content,label:J};let z=_70(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var J4=O(d(),1),mV="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function xv({call:$,output:Z,isError:H}){let[B,J]=S7.useState(!1),Q=S7.useMemo(()=>H?{kind:"plain"}:hv($,Z),[$,Z,H]);if(Q.kind==="plain")return J4.jsx("div",{className:s("rounded-lg border",H?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:J4.jsx("pre",{className:s(mV,"break-all whitespace-pre-wrap",H?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return J4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[J4.jsx(j70,{raw:B,onRaw:J,label:Q.label,copyText:B?Z:Q.code}),B?J4.jsx("pre",{className:s(mV,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):J4.jsx(yv,{code:Q.code,className:s(mV,"text-muted-foreground")})]})}function j70({raw:$,onRaw:Z,label:H,copyText:B}){return J4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,H],[!0,"raw"]].map(([Q,X])=>J4.jsx(T0,{type:"button",variant:$===Q?"outline":"ghost",size:"sm",onClick:()=>Z(Q),className:"rounded-full text-xs uppercase",children:X},X)),J4.jsx("div",{className:"flex-1"}),J4.jsx(T70,{text:B})]})}function T70({text:$}){let[Z,H]=S7.useState(!1);return S7.useEffect(()=>{if(!Z)return;let J=setTimeout(()=>H(!1),1500);return()=>clearTimeout(J)},[Z]),J4.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>H(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?J4.jsx(A3,{stroke:1.75}):J4.jsx(sX,{stroke:1.75})})}var S1=O(d(),1);function fU({parts:$,cwd:Z=null,processing:H=!1}){let B=$.filter((J)=>J.type==="reasoning"||J.type==="tool-call");return S1.jsx("div",{className:"flex flex-col",children:B.map((J,Q)=>{let X=Q===B.length-1,z={isFirst:Q===0,isLast:X};if(J.type==="reasoning")return S1.jsx(C70,{text:J.text,durationMs:J.durationMs,inProgress:H&&X,...z},Q);return S1.jsx(w70,{call:J.call,cwd:Z,...z},J.call.toolCallId||Q)})})}function pV({isFirst:$,isLast:Z,call:H,leading:B,marker:J,name:Q,brief:X,preview:z}){let[G,F]=uV.useState(!1),U=H.state==="error",Y=H.state==="running"||H.state==="pending",K=U?H.errorText??"":typeof H.output==="string"?H.output:"",W=!!(K||U||z),N=X?`${Q}: ${X}`:Q;return S1.jsx(RZ,{isFirst:$,isLast:Z,marker:J,loading:Y,isError:U,children:S1.jsxs("div",{className:"min-w-0 flex-1",children:[S1.jsxs("button",{type:"button",title:N,onClick:()=>W&&F((L)=>!L),className:s(yU,W?"cursor-pointer":"cursor-default"),children:[B,S1.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:Q}),X&&S1.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:X}),Y&&J&&S1.jsx(I5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&S1.jsx(DJ,{open:G})]}),W&&S1.jsx(AJ,{open:G,children:S1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(K||U)&&S1.jsx(xv,{call:H,output:K,isError:U})]})})]})})}function C70({isFirst:$,isLast:Z,text:H,inProgress:B=!1,durationMs:J}){let[Q,X]=uV.useState(!1);if(!H){let F=J===void 0?"Thought":`Thought for ${E7(J)}`;return S1.jsx(RZ,{isFirst:$,isLast:Z,loading:B,children:S1.jsx("div",{className:s(yU,"min-w-0 flex-1 cursor-default"),children:S1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:B?"Thinking":F})})})}let z=B?"Thinking":"Thought",G=B||Q;return S1.jsx(RZ,{isFirst:$,isLast:Z,loading:B,children:S1.jsxs("div",{className:"min-w-0 flex-1",children:[S1.jsxs("button",{type:"button","aria-expanded":G,onClick:()=>X((F)=>!F),className:s(yU,"cursor-pointer"),children:[S1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),S1.jsx(DJ,{open:G})]}),S1.jsx(AJ,{open:G,children:S1.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:S1.jsx(dh,{content:H})})})]})})}function w70({call:$,cwd:Z,isFirst:H,isLast:B}){if($.caller==="subagent")return S1.jsx(Ov,{call:$,cwd:Z,isFirst:H,isLast:B,renderNestedParts:(X,z)=>S1.jsx(fU,{parts:X,cwd:z})});if($.name==="Skill"&&$.skill){let X=$.state==="success";return S1.jsx(pV,{isFirst:H,isLast:B,call:$,marker:X?S1.jsx(ax,{icon:vv,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let J=wV($)??EV($)??SV($);if(J){let X=IV(J.server,J.tool);return S1.jsx(pV,{isFirst:H,isLast:B,call:$,marker:S1.jsx(nx,{src:RU(J.server)}),name:kU(J.server),brief:J.rest?`${X} ${J.rest}`:X})}let Q=$.state==="error"?null:cx($,Z);return S1.jsx(pV,{isFirst:H,isLast:B,call:$,leading:S1.jsx(E70,{call:$}),name:Dv($),brief:qv($,Z),preview:Q?S1.jsx(dx,{relPath:Q}):void 0})}function E70({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return S1.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var I1=O(d(),1);function mv($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function S70($){let Z=[];for(let H of $)if(mv(H)){let B=Z[Z.length-1];if(B&&B.kind==="run")B.parts.push(H);else Z.push({kind:"run",parts:[H]})}else Z.push({kind:"single",part:H});return Z}function mU({parts:$,cwd:Z,processing:H=!1}){let B=S70($);return I1.jsx("div",{className:"flex flex-col",children:B.map((J,Q)=>{let X=Q===0?"":"mt-3",z=Q===B.length-1;return I1.jsx("div",{className:X,children:J.kind==="run"?I1.jsx(fU,{parts:J.parts,cwd:Z,processing:H&&z}):I1.jsx(y70,{part:J.part})},Q)})})}function I70($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function R70($){let Z=-1;for(let B=$.length-1;B>=0;B--)if(mv($[B])){Z=B;break}if(Z<0)return null;let H=$.slice(Z+1);if(!I70(H))return null;return{work:$.slice(0,Z+1),response:H}}function k70({parts:$,cwd:Z,durationMs:H,defaultOpen:B}){let J=H===void 0?"Worked":`Worked for ${E7(H)}`;return I1.jsxs(QG,{defaultOpen:B,className:"group/collapsible",children:[I1.jsxs(XG,{className:"flex w-fit items-center gap-1 rounded-sm py-1 text-left text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[I1.jsx("span",{children:J}),I1.jsx(X7,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),I1.jsx(zG,{className:"overflow-hidden pt-2",children:I1.jsx(mU,{parts:$,cwd:Z})})]})}function b70({parts:$,cwd:Z,processing:H=!1,durationMs:B}){let J=H?null:R70($);return I1.jsx("div",{className:"w-full min-w-0",children:H?I1.jsx(mU,{parts:$,cwd:Z,processing:!0}):J?I1.jsxs("div",{className:"flex flex-col gap-3",children:[I1.jsx(k70,{parts:J.work,cwd:Z,durationMs:B}),I1.jsx(mU,{parts:J.response,cwd:Z})]}):I1.jsx(mU,{parts:$,cwd:Z})})}var pv=fv.memo(function({turn:Z,processing:H=!1}){let B=K5().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let J=Z.parts.filter((X)=>X.type==="file"),Q=Z.parts.filter((X)=>X.type==="text").map((X)=>X.type==="text"?X.text:"").join(`
78
- `);if(!Q&&J.length===0)return null;return I1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[J.map((X,z)=>I1.jsx(uv,{mediaType:X.mediaType,url:X.url,filename:X.filename},z)),Q&&I1.jsx("p",{className:s("max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere whitespace-pre-wrap text-primary-foreground","inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]"),children:Q})]})}return I1.jsx(b70,{parts:Z.parts,cwd:B,processing:H,durationMs:Z.meta?.durationMs})});function y70({part:$}){switch($.type){case"text":return I1.jsx(ch,{content:$.text});case"tool-call":return I1.jsx(fU,{parts:[$],cwd:null});case"file":return I1.jsx(uv,{mediaType:$.mediaType,url:$.url,filename:$.filename});case"source-url":return I1.jsx(gv,{url:$.url,title:$.title});case"source-document":return I1.jsx(gv,{url:"#",title:$.title});case"data":return I1.jsx(h70,{name:$.name,data:$.data});case"reasoning":return null}}function uv({mediaType:$,url:Z,filename:H}){if($.startsWith("image/")&&Z)return I1.jsx("img",{src:Z,alt:H??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return I1.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[I1.jsx(YZ,{size:16,stroke:1.75}),I1.jsx("span",{className:"truncate",children:H??$})]})}function gv({url:$,title:Z}){return I1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function h70({name:$,data:Z}){return I1.jsxs("details",{children:[I1.jsxs("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:["data:",$]}),I1.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(Z,null,2)})]})}var U5=O(d(),1),x70=[],v70=[];function pU({agent:$,active:Z=!0,focusRequest:H=0,docked:B=!1,chatLoaded:J,hasWorkspaceApplets:Q,view:X,previewTurn:z,sessionId:G,processing:F,composerBanner:U,agentAvailability:Y,annotation:K,send:W,stop:N,onNavigateFromWelcome:L,onClose:V,builderDraft:A}){let D=H5(),q=x4.useRef(null),_=x4.useRef(null),M=A?.sessionId??G??null,P=A?null:G??null,C=A?x70:X.turns,R=j5((p)=>p.hasSentMessageFromMoi),y=j5((p)=>(p.workspaceIdsPendingAnalysis??[]).includes(D)),w=_2((p)=>(p.attachments[e2(D,M)]??[]).some((X0)=>X0.status==="uploading")),h=!bB(!0,w,Y),E=A?null:z,I=A?v70:X.notices,j=x4.useMemo(()=>bE(E?[...C,E]:C),[C,E]),S=x4.useMemo(()=>hE(j,I),[j,I]),k=j.length>0?j[j.length-1].id:null,b=A?!1:F,v=!!A||J&&S.length===0&&!b,c=J&&!v,T=YR({isViewBuilderDraft:!!A,hasSentMessageFromMoi:R,isWorkspacePendingAnalysis:y}),{atBottom:e,scrollToBottom:Z0,scrollToTop:x}=kE(_,M);x4.useLayoutEffect(()=>{if(v&&T!=="empty")x()},[v,T,x]),x4.useEffect(()=>{if(Z)nN(q.current)},[Z,H]);let t=x4.useCallback(async(p,X0)=>{if(A)await A.onSubmit(p);else W(p,X0);Z0()},[A,W,Z0]),D0=x4.useCallback((p)=>{if(h)return;t(p.prompt,{directives:p.context})},[t,h]);return U5.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[U5.jsxs("header",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+40px)] items-center justify-between pr-2 pb-2 pl-2",children:[U5.jsx(VR,{isViewBuilder:!!A}),V&&B&&U5.jsxs(y1,{children:[U5.jsx(h1,{render:U5.jsx(T0,{variant:"ghost",size:"icon-sm",onClick:V,"aria-label":"Undock agent",children:U5.jsx(cv,{className:"size-5! text-muted-foreground",stroke:1.5})})}),U5.jsx(x1,{children:"Undock agent"})]}),!A&&V&&!B&&U5.jsx(T0,{variant:"ghost",size:"icon-sm",onClick:V,"aria-label":"Close chat",children:U5.jsx(S5,{stroke:2})})]}),U5.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[U5.jsx("div",{ref:_,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-8 [--scroll-fade-reveal:8px]",children:U5.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[v&&U5.jsx(KR,{agent:$,kind:T,hasWorkspaceApplets:Q,disabled:h,onSelectPrompt:D0,onNavigate:L}),c&&S.map((p)=>p.kind==="notice"?U5.jsx(g70,{notice:p.notice},`notice:${p.notice.id}`):U5.jsx(pv,{turn:p.turn,processing:b&&p.turn.id===k},p.turn.id)),c&&U5.jsx("div",{className:"mt-auto -ml-3 pt-2",children:U5.jsx(K9,{preset:$,color:"primary",animated:b,expression:b?"thinking":void 0})})]})}),c&&!e&&C.length>0&&U5.jsx(T0,{type:"button",variant:"outline",size:"icon",onClick:()=>Z0("smooth"),"aria-label":"Jump to latest",className:"absolute bottom-3 left-1/2 -translate-x-1/2 animate-in rounded-full fade-in slide-in-from-bottom-1",children:U5.jsx(hF,{stroke:1.5})})]}),U5.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:U5.jsxs("div",{className:s("@container flex w-full flex-col transition-[padding]",U&&"gap-2 rounded-t-lg rounded-b-2xl p-2",U?.tone==="default"&&"bg-accent",U?.tone==="error"&&"bg-destructive/10"),children:[U?.content,U5.jsx(XR,{composerRef:q,onSend:t,onStop:N,processing:b,sessionId:M,modelSessionId:P,availability:Y,annotation:A?void 0:K,onRemoveDrawing:A?.onRemoveDrawing??K?.onRemove,allowFiles:!A,placeholder:A?"Drop in the details":void 0,draft:A?{id:A.builderId,initialValue:A.initialValue,onChange:A.onChange}:void 0})]})})]})}function g70({notice:$}){let Z=oN($);if(!Z)return null;return U5.jsx("div",{className:"flex justify-center",children:U5.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var l9=O(d(),1);function dv({agent:$,loading:Z,open:H,onOpenChange:B,onOpenChangeComplete:J,children:Q}){let X=()=>B(!1);return l9.jsxs(DF,{open:H,onOpenChange:(G,F)=>{if(!G&&F.reason==="outside-press"){F.cancel();return}B(G)},onOpenChangeComplete:J,children:[l9.jsx(qF,{render:l9.jsx("div",{className:"fixed right-4 bottom-4 sm:right-4 sm:bottom-4",children:l9.jsx(B5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"},invisible:{opacity:0,scale:1,filter:"blur(4px)"}},initial:"from",animate:H?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:l9.jsx("button",{type:"button",className:"group block cursor-pointer rounded-xl p-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":"Agent",children:l9.jsx(K9,{preset:$,color:"primary",animated:Z,size:Z?80:64,expression:Z?"thinking":void 0,className:s("drop-shadow-md drop-shadow-primary/25","group-hover:drop-shadow-lg group-hover:drop-shadow-primary/40","transition-[width,height,filter] duration-300 ease-in-out motion-reduce:transition-none")})})})})}),l9.jsx(MF,{positionMethod:"fixed",side:"top",sideOffset:-56,align:"end",className:"flex h-[calc(100vh-2rem)] w-[min(440px,calc(100vw-1rem))] flex-col gap-0 rounded-3xl p-0 sm:h-[calc(100vh-8rem)] sm:w-[min(440px,calc(100vw-2rem))] sm:p-1",keepMounted:!0,children:Q(X)})]})}var s3=O(d(),1);function uU({className:$,title:Z,children:H,onClose:B,ref:J}){return s3.jsxs(B5.div,{ref:J,className:s("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-card text-card-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad) pb-0",$),variants:{hidden:{opacity:0,y:40,filter:"blur(4px)"},visible:{opacity:1,y:0,filter:"blur(0px)"}},initial:"hidden",animate:"visible",exit:"hidden",transition:{type:"spring",duration:0.25,bounce:0},children:[s3.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[s3.jsx("p",{className:"text-sm font-medium",children:Z}),s3.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm",onClick:B,"aria-label":"Close panel",children:s3.jsx(S5,{stroke:1.75})})]}),s3.jsx("div",{className:"flex-1 pb-(--page-pad)",children:H})]})}var $5=O(d(),1),f70=Object.entries(R3),m70=Object.entries(ez),p70=Object.entries(CB),u70=Object.entries(wB),c70="relative w-full rounded-lg bg-card text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50";function cU({children:$,className:Z,gridClassName:H,label:B}){return $5.jsxs("div",{className:s("flex flex-col gap-2",Z),children:[$5.jsx("p",{className:"text-xs font-medium",children:B}),$5.jsx("div",{role:"group","aria-label":B,className:s("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",H),children:$})]})}function dU({active:$,children:Z,className:H,onSelect:B,style:J}){return $5.jsxs("button",{type:"button","aria-pressed":$,onClick:B,className:s(c70,"flex items-center gap-2 p-3",H,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:J,children:[$5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&$5.jsx(tX,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function lv({onClose:$,ref:Z}){UG();let{layout:H,setLayout:B}=K5(),J=j8(H.theme);function Q(X){B({theme:{...J,...X}})}return $5.jsx(uU,{ref:Z,title:"Customize",onClose:$,className:"@4xl/workspace:max-w-5xl",children:$5.jsxs("div",{className:"grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2",children:[$5.jsx(cU,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:f70.map(([X,z])=>$5.jsx(dU,{active:X===J.font,onSelect:()=>Q({font:X}),style:{fontFamily:z.sans},children:$5.jsx("span",{className:"text-sm font-medium",children:z.label})},X))}),$5.jsx(cU,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:m70.map(([X,z])=>$5.jsx(dU,{active:X===J.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>Q({color:X}),style:T8({...J,color:X}),children:$5.jsxs("div",{className:"flex gap-2",children:[$5.jsx("span",{className:s("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",z.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),$5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),$5.jsx(cU,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:p70.map(([X,z])=>$5.jsx(dU,{active:X===J.radius,onSelect:()=>Q({radius:X}),style:T8({...J,radius:X}),children:$5.jsxs("div",{className:"flex items-center gap-2",children:[$5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),$5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),$5.jsx(cU,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:u70.map(([X,z])=>$5.jsx(dU,{active:X===J.agent,onSelect:()=>Q({agent:X}),children:$5.jsxs("div",{className:"flex items-center gap-2",children:[$5.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:$5.jsx(K9,{preset:X,color:"primary",size:28})}),$5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))})]})})}var YY=O(g(),1);var xZ=O(g(),1);function iv($){return o1({queryKey:w0.appletThumbnails($),queryFn:async()=>(await V1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...y4})}function rv($){let Z=Z1();return s1({mutationFn:(H)=>S4(`/api/workspaces/${$}/applet-thumbnails`,n5("PUT",H),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.appletThumbnails($)}),Z.invalidateQueries({queryKey:w0.preview($)})}})}var d70=1000,l70=3,i70=10800000,r70=1000,a70="1000px-3x-webp-q80-v1",n70=5000,o70=1000,s70=1e4,t70=100,e70=5000;function $$0($){return Math.min(l70,d70/Math.max($.offsetWidth,$.offsetHeight))}function Z$0($){return`${a70}:${$??""}`}function H$0($,Z,H=Date.now()){if(!$||$.revision!==Z)return!0;let B=Date.parse($.capturedAt);return!Number.isFinite(B)||H-B>=i70}function B$0($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=r70}var J$0=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});function Q$0($,Z=t70){let H=$.getBoundingClientRect(),B=H.top-Z,J=H.bottom+Z,Q=H.left-Z,X=H.right+Z;return(z)=>{if(z.nodeType!==1)return!0;let G=z,F=G.getBoundingClientRect();if(F.width===0&&F.height===0)return G.ownerDocument?.defaultView?.getComputedStyle(G).display!=="none";return F.bottom>B&&F.top<J&&F.right>Q&&F.left<X}}function X$0($,Z,H=e70){let B=H,J=(Q)=>{for(let X of Q.children){if(!Z(X))continue;if(--B<0)return!0;if(J(X))return!0}return!1};return J($)}async function z$0($,Z){let{createContext:H,destroyContext:B,domToDataUrl:J}=await import("/chunk-c9pjqx9m.js"),Q=Q$0($);if(X$0($,Q))return null;let X=async()=>{let z=await H($,{scale:$$0($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:o70,filter:Q,...Z&&{onCreateForeignObjectSvg:(G)=>{let F=document.createElement("style");F.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",G.append(F)}}});try{return await J(z)}finally{B(z)}};return Promise.race([X(),J$0(s70)])}async function G$0($,Z,H,B,J=z$0,Q=Date.now()){let X=[];for(let z of H){if(B())return null;let G=Z$0(z.revision),F=Z.find((W)=>W.kind===$&&W.id===z.id);if(!H$0(F,G,Q)){X.push({id:z.id,revision:G});continue}if(B$0(F,G)){X.push({id:z.id,revision:G});continue}if(!z.element){X.push({id:z.id,revision:G,image:null});continue}let U=performance.now(),Y=await J(z.element,$==="widget").catch(()=>null),K=Math.round(performance.now()-U);if(B())return null;X.push({id:z.id,revision:G,image:Y,captureMs:K})}return X}function lU({kind:$,enabled:Z,targets:H}){let B=H5(),J=iv(B).data,Q=rv(B),X=xZ.useRef(H);X.current=H;let z=xZ.useRef(J??[]);z.current=J??[];let G=xZ.useRef(Q.mutate);G.current=Q.mutate;let F=H.map((Y)=>`${Y.id}@${Y.revision??""}`).join(`
79
- `),U=J!==void 0;xZ.useEffect(()=>{if(!Z||!U||F==="")return;let Y=!1,K=0,W,N=()=>{K+=1;let L=K;if(W!==void 0)clearTimeout(W);if(document.visibilityState!=="visible")return;W=setTimeout(async()=>{W=void 0;let V=await G$0($,z.current,X.current.map((A)=>({...A,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(`${$}:${A.id}`)}"]`)})),()=>Y||K!==L||document.visibilityState!=="visible");if(!V||Y||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:V})},n70)};return document.addEventListener("visibilitychange",N),N(),()=>{if(Y=!0,W!==void 0)clearTimeout(W);document.removeEventListener("visibilitychange",N)}},[Z,$,U,F])}function _J($,Z,H,B){let J=$.reduce((Q,X)=>Math.max(Q,X.y+X.h),0);for(let Q=0;Q<=J+H;Q++)for(let X=0;X<=B-Z;X++)if(!$.some((G)=>!(X+Z<=G.x||G.x+G.w<=X||Q+H<=G.y||G.y+G.h<=Q)))return{x:X,y:Q};return{x:0,y:J}}function OJ($,Z=[],H=4){let B=[];for(let J of $){let{x:Q,y:X}=J.x!==void 0&&J.y!==void 0?{x:J.x,y:J.y}:_J([...Z,...B],J.w,J.h,H);B.push({i:J.id,x:Q,y:X,w:J.w,h:J.h})}return B}var cV=O(g(),1),iU=new Map;function F$0($){let Z=window.__moiAppletCss?.get($)??"",H=iU.get($);if(!H){let Q=document.createElement("style");Q.dataset.appletStyle=$,document.head.appendChild(Q),H={el:Q,refs:0},iU.set($,H)}if(H.el.textContent!==Z)H.el.textContent=Z;H.refs++;let B=H,J=!1;return()=>{if(J)return;if(J=!0,B.refs--,B.refs<=0)B.el.remove(),iU.delete($)}}function U$0($){let Z=iU.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function rU($,Z,H=!1){cV.useInsertionEffect(()=>F$0($),[$,Z]),cV.useInsertionEffect(()=>{if(H)U$0($)},[$,H,Z])}var nv=O(d(),1);function av({segment:$,name:Z,version:H,children:B}){let J=H5();return rU(qG($,J,Z),H),nv.jsx("div",{"data-applet":MG($,Z),className:"size-full",children:B})}var ov=O(g(),1);var vZ=O(d(),1);class jJ extends ov.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),q8(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
80
- `)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return vZ.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[vZ.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[vZ.jsx(YX,{size:16,stroke:1.75}),"Widget crashed"]}),vZ.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var t3=O(d(),1);function sv({name:$}){let Z=H5(),H=HE($);return t3.jsxs($4,{mode:"wait",initial:!1,children:[H.status==="ready"&&t3.jsx(B5.div,{className:"absolute inset-0",initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:{duration:0.45,ease:"easeInOut"},children:t3.jsx(jJ,{name:$,kind:"widget",workspaceId:Z,resetKey:H.version,children:t3.jsx(av,{segment:"widgets",name:$,version:H.version,children:t3.jsx(H.Component,{})})})},H.version),H.status==="error"&&t3.jsx(B5.p,{className:"absolute inset-0 p-4 text-xs text-destructive",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:0.45,ease:"easeInOut"},children:H.error},`err-${H.version}`)]})}var tv=O(d(),1);function gZ({className:$,...Z}){return tv.jsx("div",{"data-slot":"skeleton",className:s("animate-pulse rounded-lg bg-muted",$),...Z})}var $g=O(g(),1);var e3=O(d(),1);function aU({editing:$,hidden:Z,onRemove:H,children:B}){let J=LE();return e3.jsxs(B5.div,{variants:{idle:{rotate:0},wiggle:{rotate:[0.5,-0.5],transition:{rotate:{repeat:1/0,repeatType:"reverse",duration:0.15,ease:"easeInOut"}}}},animate:$?"wiggle":"idle",transition:{type:"spring",duration:0.35,bounce:0},className:"group/widget relative size-full",children:[e3.jsx("div",{"data-widget-chrome":!0,"data-vivid":!0,style:T8(J,"widget"),className:s("absolute inset-0 overflow-hidden rounded-2xl text-foreground [corner-shape:superellipse(1.2)]","shadow-[0_1px_2px_-1px_rgba(0,0,0,0.08),0_2px_4px_0_rgba(0,0,0,0.03)]","after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit]","after:content-[''] after:[corner-shape:inherit]","after:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]",$&&"pointer-events-none"),children:B}),$&&H&&e3.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:e3.jsx(T0,{size:"icon-sm",variant:"outline",className:"rounded-full",onClick:H,children:Z?e3.jsx(N4,{stroke:1.75}):e3.jsx(ev,{stroke:1.75})})})]})}var fZ=O(d(),1),Y$0={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},K$0={0:"row-start-1",1:"row-start-2",2:"row-start-3",3:"row-start-4",4:"row-start-5",5:"row-start-6",6:"row-start-7",7:"row-start-8"},W$0={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},N$0={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function Zg({items:$,renderItem:Z,onClose:H,onRestore:B,ref:J}){let Q=$g.useMemo(()=>OJ($),[$]);return fZ.jsx(uU,{ref:J,title:"Hidden widgets",onClose:H,className:"max-h-[60vh]",children:fZ.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:fZ.jsx($4,{children:Q.map((X)=>fZ.jsx(B5.div,{layoutId:X.i,className:s(Y$0[X.x],K$0[X.y],W$0[X.w],N$0[X.h]),transition:{type:"spring",duration:0.35,bounce:0},children:fZ.jsx(aU,{editing:!0,onRemove:()=>B(X.i),hidden:!0,children:Z(X.i)})},X.i))})})})}var gJ=O(g(),1);function Z6($){let{margin:Z,containerPadding:H,containerWidth:B,cols:J}=$;return(B-Z[0]*(J-1)-H[0]*2)/J}function S8($,Z,H){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*H)}function CJ($,Z,H,B,J,Q,X){let{margin:z,containerPadding:G,rowHeight:F}=$,U=Z6($),Y,K,W,N;if(X)Y=Math.round(X.width),K=Math.round(X.height);else Y=S8(B,U,z[0]),K=S8(J,F,z[1]);if(Q)W=Math.round(Q.top),N=Math.round(Q.left);else if(X)W=Math.round(X.top),N=Math.round(X.left);else W=Math.round((F+z[1])*H+G[1]),N=Math.round((U+z[0])*Z+G[0]);if(!Q&&!X){if(Number.isFinite(B)){let V=Math.round((U+z[0])*(Z+B)+G[0])-N-Y;if(V!==z[0])Y+=V-z[0]}if(Number.isFinite(J)){let V=Math.round((F+z[1])*(H+J)+G[1])-W-K;if(V!==z[1])K+=V-z[1]}}return{top:W,left:N,width:Y,height:K}}function Bg($,Z,H,B,J){let{margin:Q,containerPadding:X,cols:z,rowHeight:G,maxRows:F}=$,U=Z6($),Y=Math.round((H-X[0])/(U+Q[0])),K=Math.round((Z-X[1])/(G+Q[1]));return Y=TJ(Y,0,z-B),K=TJ(K,0,F-J),{x:Y,y:K}}function wJ($,Z,H){let{margin:B,containerPadding:J,rowHeight:Q}=$,X=Z6($),z=Math.round((H-J[0])/(X+B[0])),G=Math.round((Z-J[1])/(Q+B[1]));return{x:z,y:G}}function Jg($,Z,H){let{margin:B,rowHeight:J}=$,Q=Z6($),X=Math.max(1,Math.round((Z+B[0])/(Q+B[0]))),z=Math.max(1,Math.round((H+B[1])/(J+B[1])));return{w:X,h:z}}function TJ($,Z,H){return Math.max(Math.min($,H),Z)}function oU($,Z){if($.i===Z.i)return!1;if($.x+$.w<=Z.x)return!1;if($.x>=Z.x+Z.w)return!1;if($.y+$.h<=Z.y)return!1;if($.y>=Z.y+Z.h)return!1;return!0}function H6($,Z){for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0&&oU(B,Z))return B}return}function dV($,Z){return $.filter((H)=>oU(H,Z))}function L$0($,Z){if(Z==="horizontal")return lV($);if(Z==="vertical")return nU($);if(Z==="wrap")return nU($);return[...$]}function nU($){return[...$].sort((Z,H)=>{if(Z.y!==H.y)return Z.y-H.y;return Z.x-H.x})}function lV($){return[...$].sort((Z,H)=>{if(Z.x!==H.x)return Z.x-H.x;return Z.y-H.y})}function EJ($){let Z=0;for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0){let J=B.y+B.h;if(J>Z)Z=J}}return Z}function B6($,Z){for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0&&B.i===Z)return B}return}function SJ($){return $.filter((Z)=>Z.static===!0)}function i9($){return{i:$.i,x:$.x,y:$.y,w:$.w,h:$.h,minW:$.minW,maxW:$.maxW,minH:$.minH,maxH:$.maxH,moved:Boolean($.moved),static:Boolean($.static),isDraggable:$.isDraggable,isResizable:$.isResizable,resizeHandles:$.resizeHandles,constraints:$.constraints,isBounded:$.isBounded}}function mZ($){let Z=Array($.length);for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0)Z[H]=i9(B)}return Z}function A$0($,Z){let H=Array($.length);for(let B=0;B<$.length;B++){let J=$[B];if(J!==void 0)if(Z.i===J.i)H[B]=Z;else H[B]=J}return H}function Qg($,Z,H){let B=B6($,Z);if(!B)return[[...$],null];return B=H(i9(B)),[A$0($,B),B]}function iV($,Z){let H=SJ($);for(let B=0;B<$.length;B++){let J=$[B];if(J===void 0)continue;if(J.x+J.w>Z.cols)J.x=Z.cols-J.w;if(J.x<0)J.x=0,J.w=Z.cols;if(!J.static)H.push(J);else while(H6(H,J))J.y++}return $}function $6($,Z,H,B,J,Q,X,z,G){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===B&&Z.x===H)return[...$];let{x:F,y:U}=Z;if(typeof H==="number")Z.x=H;if(typeof B==="number")Z.y=B;Z.moved=!0;let Y=L$0($,X);if(X==="vertical"&&typeof B==="number"?U>=B:X==="horizontal"&&typeof H==="number"?F>=H:!1)Y=Y.reverse();let W=dV(Y,Z),N=W.length>0;if(N&&G)return mZ($);if(N&&Q)return Z.x=F,Z.y=U,Z.moved=!1,$;let L=[...$];for(let V=0;V<W.length;V++){let A=W[V];if(A===void 0)continue;if(A.moved)continue;if(A.static)L=Hg(L,A,Z,J,X);else L=Hg(L,Z,A,J,X)}return L}function Hg($,Z,H,B,J,Q){let X=J==="horizontal",z=J==="vertical",G=Z.static;if(B){B=!1;let Y={x:X?Math.max(Z.x-H.w,0):H.x,y:z?Math.max(Z.y-H.h,0):H.y,w:H.w,h:H.h,i:"-1"},K=H6($,Y),W=K!==void 0&&K.y+K.h>Z.y,N=K!==void 0&&Z.x+Z.w>K.x;if(!K)return $6($,H,X?Y.x:void 0,z?Y.y:void 0,B,G,J);if(W&&z)return $6($,H,void 0,H.y+1,B,G,J);if(W&&J===null)return Z.y=H.y,H.y=H.y+H.h,[...$];if(N&&X)return $6($,Z,H.x,void 0,B,G,J)}let F=X?H.x+1:void 0,U=z?H.y+1:void 0;if(F===void 0&&U===void 0)return[...$];return $6($,H,F,U,B,G,J)}function pZ($,Z,H){return Math.max(Z,Math.min(H,$))}var V$0={name:"gridBounds",constrainPosition($,Z,H,{cols:B,maxRows:J}){return{x:pZ(Z,0,Math.max(0,B-$.w)),y:pZ(H,0,Math.max(0,J-$.h))}},constrainSize($,Z,H,B,{cols:J,maxRows:Q}){let X=B==="w"||B==="nw"||B==="sw"?$.x+$.w:J-$.x,z=B==="n"||B==="nw"||B==="ne"?$.y+$.h:Q-$.y;return{w:pZ(Z,1,Math.max(1,X)),h:pZ(H,1,Math.max(1,z))}}},D$0={name:"minMaxSize",constrainSize($,Z,H){return{w:pZ(Z,$.minW??1,$.maxW??1/0),h:pZ(H,$.minH??1,$.maxH??1/0)}}};var rV=[V$0,D$0];function IJ($,Z,H,B,J){let Q={x:H,y:B};for(let X of $)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,J);if(Z.constraints){for(let X of Z.constraints)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,J)}return Q}function Xg($,Z,H,B,J,Q){let X={w:H,h:B};for(let z of $)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,J,Q);if(Z.constraints){for(let z of Z.constraints)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,J,Q)}return X}function tU({top:$,left:Z,width:H,height:B}){let J=`translate(${Z}px,${$}px)`;return{transform:J,WebkitTransform:J,MozTransform:J,msTransform:J,OTransform:J,width:`${H}px`,height:`${B}px`,position:"absolute"}}function aV({top:$,left:Z,width:H,height:B}){return{top:`${$}px`,left:`${Z}px`,width:`${H}px`,height:`${B}px`,position:"absolute"}}function nV($){return $*100+"%"}function q$0($,Z,H,B){return $+H>B?Z:H}function zg($,Z,H){return $<0?Z:H}function M$0($){return Math.max(0,$)}function sU($){return Math.max(0,$)}var oV=($,Z,H)=>{let{left:B,height:J,width:Q}=Z,X=$.top-(J-$.height);return{left:B,width:Q,height:zg(X,$.height,J),top:sU(X)}},sV=($,Z,H)=>{let{top:B,left:J,height:Q,width:X}=Z;return{top:B,height:Q,width:q$0($.left,$.width,X,H),left:M$0(J)}},tV=($,Z,H)=>{let{top:B,height:J,width:Q}=Z,X=$.left+$.width-Q;if(X<0)return{height:J,width:$.left+$.width,top:sU(B),left:0};return{height:J,width:Q,top:sU(B),left:X}},eV=($,Z,H)=>{let{top:B,left:J,height:Q,width:X}=Z;return{width:X,left:J,height:zg(B,$.height,Q),top:sU(B)}},P$0=($,Z,H)=>oV($,sV($,Z,H)),_$0=($,Z,H)=>oV($,tV($,Z)),O$0=($,Z,H)=>eV($,sV($,Z,H)),j$0=($,Z,H)=>eV($,tV($,Z)),T$0={n:oV,ne:P$0,e:sV,se:O$0,s:eV,sw:j$0,w:tV,nw:_$0};function Gg($,Z,H,B){let J=T$0[$];if(!J)return H;return J(Z,{...Z,...H},B)}var C$0={type:"transform",scale:1,calcStyle($){return tU($)}};var Fg=C$0,Ug={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Yg={enabled:!0,bounded:!1,threshold:3},Kg={enabled:!0,handles:["se"]},Wg={enabled:!1,defaultItem:{w:1,h:1}};function $D($,Z,H,B,J){let Q=B==="x"?"w":"h";Z[B]+=1;let X=$.findIndex((G)=>G.i===Z.i),z=J??SJ($).length>0;for(let G=X+1;G<$.length;G++){let F=$[G];if(F===void 0)continue;if(F.static)continue;if(!z&&F.y>Z.y+Z.h)break;if(oU(Z,F))$D($,F,H+Z[Q],B,z)}Z[B]=H}function w$0($,Z,H,B){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(B,Z.y);while(Z.y>0&&!H6($,Z))Z.y--;let J;while((J=H6($,Z))!==void 0)$D(H,Z,J.y+J.h,"y");return Z.y=Math.max(Z.y,0),Z}function E$0($,Z,H,B){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!H6($,Z))Z.x--;let J;while((J=H6($,Z))!==void 0)if($D(B,Z,J.x+J.w,"x"),Z.x+Z.w>H){Z.x=H-Z.w,Z.y++;while(Z.x>0&&!H6($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var RJ={type:"vertical",allowOverlap:!1,compact($,Z){let H=SJ($),B=EJ(H),J=nU($),Q=Array($.length);for(let X=0;X<J.length;X++){let z=J[X];if(z===void 0)continue;let G=i9(z);if(!G.static)G=w$0(H,G,J,B),B=Math.max(B,G.y+G.h),H.push(G);let F=$.indexOf(z);Q[F]=G,G.moved=!1}return Q}},ZD={type:"horizontal",allowOverlap:!1,compact($,Z){let H=SJ($),B=lV($),J=Array($.length);for(let Q=0;Q<B.length;Q++){let X=B[Q];if(X===void 0)continue;let z=i9(X);if(!z.static)z=E$0(H,z,Z,B),H.push(z);let G=$.indexOf(X);J[G]=z,z.moved=!1}return J}},HD={type:null,allowOverlap:!1,compact($,Z){return mZ($)}},S$0={...RJ,allowOverlap:!0,compact($,Z){return mZ($)}},I$0={...ZD,allowOverlap:!0,compact($,Z){return mZ($)}},R$0={...HD,allowOverlap:!0};function BD($,Z=!1,H=!1){let B;if(Z)if($==="vertical")B=S$0;else if($==="horizontal")B=I$0;else B=R$0;else if($==="vertical")B=RJ;else if($==="horizontal")B=ZD;else B=HD;if(H)return{...B,preventCollision:H};return B}var I8=O(g(),1);function JD($={}){let{measureBeforeMount:Z=!1,initialWidth:H=1280}=$,[B,J]=I8.useState(H),[Q,X]=I8.useState(!Z),z=I8.useRef(null),G=I8.useRef(null),F=I8.useCallback(()=>{let U=z.current;if(U){let Y=U.offsetWidth;if(J(Y),!Q)X(!0)}},[Q]);return I8.useEffect(()=>{let U=z.current;if(!U)return;if(F(),typeof ResizeObserver<"u"){let Y=null;return G.current=new ResizeObserver((K)=>{let W=K[0];if(W){let N=W.contentRect.width;if(Y!==null)cancelAnimationFrame(Y);Y=requestAnimationFrame(()=>{J(N),Y=null})}}),G.current.observe(U),()=>{if(Y!==null)cancelAnimationFrame(Y);if(G.current)G.current.disconnect(),G.current=null}}return()=>{if(G.current)G.current.disconnect(),G.current=null}},[F]),{width:B,mounted:Q,containerRef:z,measureWidth:F}}var y0=O(g(),1),Yf=O(zY(),1),Kf=O(Gf(),1);var a9=O(d(),1),I7=O(Lg(),1);function jD($){let{children:Z,cols:H,containerWidth:B,margin:J,containerPadding:Q,rowHeight:X,maxRows:z,isDraggable:G,isResizable:F,isBounded:U,static:Y,useCSSTransforms:K=!0,usePercentages:W=!1,transformScale:N=1,positionStrategy:L,dragThreshold:V=0,droppingPosition:A,className:D="",style:q,handle:_="",cancel:M="",x:P,y:C,w:R,h:y,minW:w=1,maxW:h=1/0,minH:E=1,maxH:I=1/0,i:j,resizeHandles:S,resizeHandle:k,constraints:b=rV,layoutItem:v,layout:c=[],onDragStart:T,onDrag:e,onDragStop:Z0,onResizeStart:x,onResize:t,onResizeStop:D0}=$,[p,X0]=y0.useState(!1),[K0,Q0]=y0.useState(!1),z0=y0.useRef(null),L0=y0.useRef({left:0,top:0}),i=y0.useRef({top:0,left:0,width:0,height:0}),B0=y0.useRef(void 0),$0=y0.useRef(c);$0.current=c;let J0=y0.useRef(null),n=y0.useRef(null),f=y0.useRef(!1),l=y0.useRef({x:0,y:0}),m=y0.useRef(!1),a=y0.useMemo(()=>({cols:H,containerPadding:Q,containerWidth:B,margin:J,maxRows:z,rowHeight:X}),[H,Q,B,J,z,X]),o=y0.useMemo(()=>({cols:H,maxRows:z,containerWidth:B,containerHeight:0,rowHeight:X,margin:J,layout:[]}),[H,z,B,X,J]),V0=y0.useCallback(()=>({...o,layout:$0.current}),[o]),O0=y0.useMemo(()=>v??{i:j,x:P,y:C,w:R,h:y,minW:w,maxW:h,minH:E,maxH:I},[v,j,P,C,R,y,w,h,E,I]),k0=y0.useCallback((C0)=>{if(L?.calcStyle)return L.calcStyle(C0);if(K)return tU(C0);let I0=aV(C0);if(W)return{...I0,left:nV(C0.left/B),width:nV(C0.width/B)};return I0},[L,K,W,B]),r0=y0.useCallback((C0,{node:I0})=>{if(!T)return;let{offsetParent:g0}=I0;if(!g0)return;let $1=g0.getBoundingClientRect(),l0=I0.getBoundingClientRect(),L1=l0.left/N,u1=$1.left/N,c1=l0.top/N,M1=$1.top/N,q5;if(L?.calcDragPosition){let z1=C0;q5=L.calcDragPosition(z1.clientX,z1.clientY,z1.clientX-l0.left,z1.clientY-l0.top)}else q5={left:L1-u1+g0.scrollLeft,top:c1-M1+g0.scrollTop};if(L0.current=q5,V>0){let z1=C0;l.current={x:z1.clientX,y:z1.clientY},f.current=!0,m.current=!1,X0(!0);return}X0(!0);let p5=wJ(a,q5.top,q5.left),{x:i5,y:x0}=IJ(b,O0,p5.x,p5.y,V0());T(j,i5,x0,{e:C0,node:I0,newPosition:q5})},[T,N,a,L,V,b,O0,V0,j]),u=y0.useCallback((C0,{node:I0,deltaX:g0,deltaY:$1})=>{if(!e||!p)return;let l0=C0;if(f.current&&!m.current){let i5=l0.clientX-l.current.x,x0=l0.clientY-l.current.y;if(Math.hypot(i5,x0)<V)return;if(m.current=!0,f.current=!1,T){let u0=wJ(a,L0.current.top,L0.current.left),{x:A1,y:v1}=IJ(b,O0,u0.x,u0.y,V0());T(j,A1,v1,{e:C0,node:I0,newPosition:L0.current})}}let L1=L0.current.top+$1,u1=L0.current.left+g0;if(U){let{offsetParent:i5}=I0;if(i5){let x0=i5.clientHeight-S8(y,X,J[1]);L1=TJ(L1,0,x0);let z1=Z6(a),u0=B-S8(R,z1,J[0]);u1=TJ(u1,0,u0)}}let c1={top:L1,left:u1};L0.current=c1;let M1=wJ(a,L1,u1),{x:q5,y:p5}=IJ(b,O0,M1.x,M1.y,V0());e(j,q5,p5,{e:C0,node:I0,newPosition:c1})},[e,T,p,V,U,y,X,J,a,B,R,j,b,O0,V0]),r=y0.useCallback((C0,{node:I0})=>{if(!Z0||!p)return;let g0=f.current;if(f.current=!1,m.current=!1,l.current={x:0,y:0},g0){X0(!1),L0.current={left:0,top:0};return}let{left:$1,top:l0}=L0.current,L1={top:l0,left:$1};X0(!1),L0.current={left:0,top:0};let u1=wJ(a,l0,$1),{x:c1,y:M1}=IJ(b,O0,u1.x,u1.y,V0());Z0(j,c1,M1,{e:C0,node:I0,newPosition:L1})},[Z0,p,a,b,O0,V0,j]);J0.current=r0,n.current=u;let H0=y0.useCallback((C0,{node:I0,size:g0,handle:$1},l0,L1)=>{let u1=L1==="onResizeStart"?x:L1==="onResize"?t:D0;if(!u1)return;let c1;if(I0)c1=Gg($1,l0,g0,B);else c1={...g0,top:l0.top,left:l0.left};i.current=c1;let M1=Jg(a,c1.width,c1.height),{w:q5,h:p5}=Xg(b,O0,M1.w,M1.h,$1,V0());u1(j,q5,p5,{e:C0.nativeEvent,node:I0,size:c1,handle:$1})},[x,t,D0,B,a,j,b,O0,V0]),A0=y0.useCallback((C0,I0)=>{Q0(!0);let g0=CJ(a,P,C,R,y),$1={...I0,handle:I0.handle};H0(C0,$1,g0,"onResizeStart")},[H0,a,P,C,R,y]),j0=y0.useCallback((C0,I0)=>{let g0=CJ(a,P,C,R,y),$1={...I0,handle:I0.handle};H0(C0,$1,g0,"onResize")},[H0,a,P,C,R,y]),v0=y0.useCallback((C0,I0)=>{Q0(!1),i.current={top:0,left:0,width:0,height:0};let g0=CJ(a,P,C,R,y),$1={...I0,handle:I0.handle};H0(C0,$1,g0,"onResizeStop")},[H0,a,P,C,R,y]);y0.useEffect(()=>{if(!A)return;let C0=z0.current;if(!C0)return;let I0=B0.current||{left:0,top:0},g0=p&&(A.left!==I0.left||A.top!==I0.top);if(!p){let $1={node:C0,deltaX:A.left,deltaY:A.top,lastX:0,lastY:0,x:A.left,y:A.top};J0.current?.(A.e,$1)}else if(g0){let $1=A.left-L0.current.left,l0=A.top-L0.current.top,L1={node:C0,deltaX:$1,deltaY:l0,lastX:L0.current.left,lastY:L0.current.top,x:A.left,y:A.top};n.current?.(A.e,L1)}B0.current=A},[A,p,j]);let G1=CJ(a,P,C,R,y,p?L0.current:null,K0?i.current:null),K1=y0.default.Children.only(Z),c0=Z6(a),R0=[S8(w,c0,J[0]),S8(E,X,J[1])],d0=[S8(h,c0,J[0]),S8(I,X,J[1])],p0=K1.props,t0=p0.className,N0=p0.style,b0=y0.default.cloneElement(K1,{ref:z0,className:TD("react-grid-item",t0,D,{static:Y,resizing:K0,"react-draggable":G,"react-draggable-dragging":p,dropping:Boolean(A),cssTransforms:K}),style:{...q,...N0,...k0(G1)}}),W1=k;return b0=a9.jsx(Kf.Resizable,{draggableOpts:{disabled:!F},className:F?void 0:"react-resizable-hide",width:G1.width,height:G1.height,minConstraints:R0,maxConstraints:d0,onResizeStart:A0,onResize:j0,onResizeStop:v0,transformScale:N,resizeHandles:S,handle:W1,children:b0}),b0=a9.jsx(Yf.DraggableCore,{disabled:!G,onStart:r0,onDrag:u,onStop:r,handle:_,cancel:".react-resizable-handle"+(M?","+M:""),scale:N,nodeRef:z0,children:b0}),b0}var r9=()=>{},Ff="react-grid-layout",Wf=!1;try{Wf=/firefox/i.test(navigator.userAgent)}catch{}function dH0($,Z){let H=y0.default.Children.toArray($),B=y0.default.Children.toArray(Z);if(H.length!==B.length)return!1;for(let J=0;J<H.length;J++){let Q=H[J],X=B[J];if(Q?.key!==X?.key)return!1}return!0}function Uf($,Z,H,B){let J=[],Q=new Set;y0.default.Children.forEach(Z,(z)=>{if(!y0.default.isValidElement(z)||z.key===null)return;let G=String(z.key);Q.add(G);let F=$.find((U)=>U.i===G);if(F)J.push(i9(F));else{let Y=z.props["data-grid"];if(Y)J.push({i:G,x:Y.x??0,y:Y.y??0,w:Y.w??1,h:Y.h??1,minW:Y.minW,maxW:Y.maxW,minH:Y.minH,maxH:Y.maxH,static:Y.static,isDraggable:Y.isDraggable,isResizable:Y.isResizable,resizeHandles:Y.resizeHandles,isBounded:Y.isBounded});else J.push({i:G,x:0,y:EJ(J),w:1,h:1})}});let X=iV(J,{cols:H});return B.compact(X,H)}function vJ($){let{children:Z,width:H,gridConfig:B,dragConfig:J,resizeConfig:Q,dropConfig:X,positionStrategy:z=Fg,compactor:G,constraints:F=rV,layout:U=[],droppingItem:Y,autoSize:K=!0,className:W="",style:N={},innerRef:L,onLayoutChange:V=r9,onDragStart:A=r9,onDrag:D=r9,onDragStop:q=r9,onResizeStart:_=r9,onResize:M=r9,onResizeStop:P=r9,onDrop:C=r9,onDropDragOver:R=r9}=$,y=y0.useMemo(()=>({...Ug,...B}),[B]),w=y0.useMemo(()=>({...Yg,...J}),[J]),h=y0.useMemo(()=>({...Kg,...Q}),[Q]),E=y0.useMemo(()=>({...Wg,...X}),[X]),{cols:I,rowHeight:j,maxRows:S,margin:k,containerPadding:b}=y,{enabled:v,bounded:c,handle:T,cancel:e,threshold:Z0}=w,{enabled:x,handles:t,handleComponent:D0}=h,{enabled:p,defaultItem:X0,onDragOver:K0}=E,Q0=G??BD("vertical"),z0=Q0.type,L0=Q0.allowOverlap,i=Q0.preventCollision??!1,B0=y0.useMemo(()=>Y??{i:"__dropping-elem__",...X0},[Y,X0]),$0=z.type==="transform",J0=z.scale,n=b??k,[f,l]=y0.useState(!1),[m,a]=y0.useState(()=>Uf(U,Z,I,Q0)),[o,V0]=y0.useState(null),[O0,k0]=y0.useState(!1),[r0,u]=y0.useState(null),[r,H0]=y0.useState(),A0=y0.useRef(null),j0=y0.useRef(null),v0=y0.useRef(null),G1=y0.useRef(0),K1=y0.useRef(m),c0=y0.useRef(U),R0=y0.useRef(Z),d0=y0.useRef(z0),p0=y0.useRef(m);p0.current=m,y0.useEffect(()=>{if(l(!0),!I7.deepEqual(m,U))V(m)},[]),y0.useEffect(()=>{if(o)return;if(r0)return;let x0=!I7.deepEqual(U,c0.current),z1=!dH0(Z,R0.current),u0=z0!==d0.current;if(x0||z1||u0){let v1=Uf(x0?U:m,Z,I,Q0);if(!I7.deepEqual(v1,m))a(v1)}c0.current=U,R0.current=Z,d0.current=z0},[U,Z,I,z0,Q0,o,r0,m]),y0.useEffect(()=>{if(!o&&!I7.deepEqual(m,K1.current)){K1.current=m;let x0=m.filter((z1)=>z1.i!==B0.i);V(x0)}},[m,o,V,B0.i]);let t0=y0.useMemo(()=>{if(!K)return;let x0=EJ(m),z1=n[1];return x0*j+(x0-1)*k[1]+z1*2+"px"},[K,m,j,k,n]),N0=y0.useCallback((x0,z1,u0,A1)=>{let v1=p0.current,d1=B6(v1,x0);if(!d1)return;let M5={w:d1.w,h:d1.h,x:d1.x,y:d1.y,i:x0};A0.current=i9(d1),v0.current=v1,V0(M5),A(v1,d1,d1,null,A1.e,A1.node)},[A]),b0=y0.useCallback((x0,z1,u0,A1)=>{let v1=p0.current,d1=A0.current,M5=B6(v1,x0);if(!M5)return;let U2={w:M5.w,h:M5.h,x:M5.x,y:M5.y,i:x0},P5=$6(v1,M5,z1,u0,!0,i,z0,I,L0);D(P5,d1,M5,U2,A1.e,A1.node),a(Q0.compact(P5,I)),V0(U2)},[i,z0,I,L0,Q0,D]),W1=y0.useCallback((x0,z1,u0,A1)=>{if(!o)return;let v1=p0.current,d1=A0.current,M5=B6(v1,x0);if(!M5)return;let U2=$6(v1,M5,z1,u0,!0,i,z0,I,L0),P5=Q0.compact(U2,I);q(P5,d1,M5,null,A1.e,A1.node);let E2=v0.current;if(A0.current=null,v0.current=null,V0(null),a(P5),E2&&!I7.deepEqual(E2,P5))V(P5)},[o,i,z0,I,L0,Q0,q,V]),C0=y0.useCallback((x0,z1,u0,A1)=>{let v1=p0.current,d1=B6(v1,x0);if(!d1)return;j0.current=i9(d1),v0.current=v1,k0(!0),_(v1,d1,d1,null,A1.e,A1.node)},[_]),I0=y0.useCallback((x0,z1,u0,A1)=>{let v1=p0.current,d1=j0.current,{handle:M5}=A1,U2=!1,P5,E2,[nJ,I9]=Qg(v1,x0,(C5)=>{if(P5=C5.x,E2=C5.y,["sw","w","nw","n","ne"].includes(M5)){if(["sw","nw","w"].includes(M5))P5=C5.x+(C5.w-z1),z1=C5.x!==P5&&P5<0?C5.w:z1,P5=P5<0?0:P5;if(["ne","n","nw"].includes(M5))E2=C5.y+(C5.h-u0),u0=C5.y!==E2&&E2<0?C5.h:u0,E2=E2<0?0:E2;U2=!0}if(i&&!L0){if(dV(v1,{...C5,w:z1,h:u0,x:P5??C5.x,y:E2??C5.y}).filter((sJ)=>sJ.i!==C5.i).length>0)E2=C5.y,u0=C5.h,P5=C5.x,z1=C5.w,U2=!1}return C5.w=z1,C5.h=u0,C5});if(!I9)return;let JH=nJ;if(U2&&P5!==void 0&&E2!==void 0)JH=$6(nJ,I9,P5,E2,!0,i,z0,I,L0);let oJ={w:I9.w,h:I9.h,x:I9.x,y:I9.y,i:x0,static:!0};M(JH,d1,I9,oJ,A1.e,A1.node),a(Q0.compact(JH,I)),V0(oJ)},[i,z0,I,L0,Q0,M]),g0=y0.useCallback((x0,z1,u0,A1)=>{let v1=p0.current,d1=j0.current,M5=B6(v1,x0),U2=Q0.compact(v1,I);P(U2,d1,M5??null,null,A1.e,A1.node);let P5=v0.current;if(j0.current=null,v0.current=null,V0(null),k0(!1),a(U2),P5&&!I7.deepEqual(P5,U2))V(U2)},[I,Q0,P,V]),$1=y0.useCallback(()=>{let x0=p0.current;if(!x0.some((A1)=>A1.i===B0.i)){u(null),V0(null),H0(void 0);return}let u0=Q0.compact(x0.filter((A1)=>A1.i!==B0.i),I);a(u0),u(null),V0(null),H0(void 0)},[B0.i,I,Q0]),l0=y0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),Wf&&!x0.nativeEvent.target?.classList.contains(Ff))return!1;let z1=K0?K0(x0.nativeEvent):R(x0);if(z1===!1){if(r0)$1();return!1}let{dragOffsetX:u0=0,dragOffsetY:A1=0,...v1}=z1??{},d1={...B0,...v1},M5=x0.currentTarget.getBoundingClientRect(),U2={cols:I,margin:k,maxRows:S,rowHeight:j,containerWidth:H,containerPadding:n},P5=Z6(U2),E2=S8(d1.w,P5,k[0]),nJ=S8(d1.h,j,k[1]),I9=E2/2,JH=nJ/2,oJ=x0.clientX-M5.left+u0-I9,C5=x0.clientY-M5.top+A1-JH,gY=Math.max(0,oJ),sJ=Math.max(0,C5),tJ={left:gY/J0,top:sJ/J0,e:x0.nativeEvent};if(!r0){let fY=Bg(U2,sJ,gY,d1.w,d1.h);u(a9.jsx("div",{},d1.i)),H0(tJ);let kc=p0.current.filter((bc)=>bc.i!==d1.i);a([...kc,{...d1,x:fY.x,y:fY.y,static:!1,isDraggable:!0}])}else if(r){if(r.left!==tJ.left||r.top!==tJ.top)H0(tJ)}},[r0,r,B0,K0,R,$1,J0,I,k,S,j,H,n]),L1=y0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),G1.current--,G1.current<0)G1.current=0;if(G1.current===0)$1()},[$1]),u1=y0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation(),G1.current++},[]),c1=y0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation();let z1=p0.current,u0=z1.find((A1)=>A1.i===B0.i);G1.current=0,$1(),C(z1,u0,x0.nativeEvent)},[B0.i,$1,C]),M1=y0.useCallback((x0,z1)=>{if(!x0||!x0.key)return null;let u0=B6(m,String(x0.key));if(!u0)return null;let A1=typeof u0.isDraggable==="boolean"?u0.isDraggable:!u0.static&&v,v1=typeof u0.isResizable==="boolean"?u0.isResizable:!u0.static&&x,d1=u0.resizeHandles||[...t],M5=A1&&c&&u0.isBounded!==!1,U2=D0;return a9.jsx(jD,{containerWidth:H,cols:I,margin:k,containerPadding:n,maxRows:S,rowHeight:j,cancel:e,handle:T,onDragStart:N0,onDrag:b0,onDragStop:W1,onResizeStart:C0,onResize:I0,onResizeStop:g0,isDraggable:A1,isResizable:v1,isBounded:M5,useCSSTransforms:$0&&f,usePercentages:!f,transformScale:J0,positionStrategy:z,dragThreshold:Z0,w:u0.w,h:u0.h,x:u0.x,y:u0.y,i:u0.i,minH:u0.minH,minW:u0.minW,maxH:u0.maxH,maxW:u0.maxW,static:u0.static,droppingPosition:z1?r:void 0,resizeHandles:d1,resizeHandle:U2,constraints:F,layoutItem:u0,layout:m,children:x0},u0.i)},[m,H,I,k,n,S,j,e,T,N0,b0,W1,C0,I0,g0,v,x,c,$0,f,J0,z,Z0,r,t,D0,F]),q5=()=>{if(!o)return null;return a9.jsx(jD,{w:o.w,h:o.h,x:o.x,y:o.y,i:o.i,className:`react-grid-placeholder ${O0?"placeholder-resizing":""}`,containerWidth:H,cols:I,margin:k,containerPadding:n,maxRows:S,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:$0,transformScale:J0,constraints:F,layout:m,children:a9.jsx("div",{})})},p5=TD(Ff,W),i5={height:t0,...N};return a9.jsxs("div",{ref:L,className:p5,style:i5,onDrop:p?c1:void 0,onDragLeave:p?L1:void 0,onDragEnter:p?u1:void 0,onDragOver:p?l0:void 0,children:[y0.default.Children.map(Z,(x0)=>{if(!y0.default.isValidElement(x0))return null;return M1(x0)}),p&&r0&&M1(r0,!0),q5()]})}var R7=O(d(),1);function CD({items:$,editing:Z,renderItem:H,onLayoutChange:B}){let[J,Q]=gJ.useState(()=>OJ($,[])),[X,z]=gJ.useState($),{width:G,containerRef:F,mounted:U}=JD({measureBeforeMount:!0});if(X!==$)z($),Q((K)=>{let W=new Map(K.map((A)=>[A.i,A])),N=$.filter((A)=>W.has(A.id)).map((A)=>({...W.get(A.id),w:A.w,h:A.h})),L=new Set(N.map((A)=>A.i)),V=OJ($.filter((A)=>!L.has(A.id)),N);return[...N,...V]});let Y=gJ.useCallback((K)=>{Q(K),B?.(K.map((W)=>({id:W.i,w:W.w,h:W.h,x:W.x,y:W.y})))},[B]);return R7.jsx("div",{ref:F,className:"w-full",children:U&&R7.jsx(vJ,{width:G,layout:J,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:RJ,onLayoutChange:Y,children:J.map((K)=>R7.jsx("div",{children:R7.jsx(B5.div,{layoutId:K.i,"data-applet-thumbnail":`widget:${K.i}`,className:"size-full",transition:{type:"spring",duration:0.35,bounce:0},children:H(K.i)})},K.i))})})}function Nf({items:$,editing:Z,renderItem:H,onLayoutChange:B,onRemove:J}){return R7.jsx(CD,{items:$,editing:Z,onLayoutChange:B,renderItem:(Q)=>R7.jsx(aU,{editing:Z,onRemove:J?()=>J(Q):void 0,children:H(Q)})})}var R1=O(d(),1);function Lf($){return R1.jsx(sv,{name:$})}var iH0=Array.from({length:10},($,Z)=>({id:`empty-widget-${Z}`,w:2,h:1}));function rH0(){return R1.jsx(gZ,{className:"size-full animate-none rounded-2xl texture-checker [corner-shape:superellipse(1.2)]"})}function aH0({onCreateWidget:$}){return R1.jsxs("div",{className:"relative min-h-0 w-full max-w-(--column-w) flex-1 pt-7",children:[R1.jsx("div",{"aria-hidden":"true",children:R1.jsx(CD,{items:iH0,renderItem:rH0})}),R1.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-6",children:R1.jsxs("div",{className:"flex h-full w-full max-w-(--column-w) flex-col items-center justify-center gap-4 bg-radial from-background from-30% to-transparent to-80% text-center",children:[R1.jsxs("div",{className:"flex flex-col gap-1.5",children:[R1.jsx("h2",{className:"font-medium",children:"A little empty here"}),R1.jsx("p",{className:"mx-auto max-w-xs text-sm text-muted-foreground",children:"Widgets are small apps that can read data, perform tasks, and surface important information"})]}),R1.jsxs(T0,{type:"button",variant:"secondary",onClick:$,children:[R1.jsx(N4,{"data-icon":"inline-start",stroke:1.5}),"Create widget"]})]})})]})}function nH0({editing:$,onCreateWidget:Z,onEditingChange:H}){return R1.jsxs("div",{className:"mb-4 flex w-full max-w-(--column-w) shrink-0 items-center justify-end gap-2",children:[$&&R1.jsxs(T0,{type:"button",variant:"ghost",size:"sm",className:"mr-auto",onClick:Z,children:[R1.jsx(N4,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),R1.jsx($4,{mode:"popLayout",initial:!1,children:R1.jsx(B5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.3,bounce:0},children:R1.jsx(T0,{type:"button",variant:$?"default":"ghost",size:"sm",className:s(!$&&"text-muted-foreground group-hover/widgets:opacity-100 [@media(hover:hover)]:opacity-0"),onClick:()=>H(!$),children:$?"Done":"Edit widgets"})},$?"done":"edit")})]})}function oH0(){return R1.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:R1.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets added yet"})})}function sH0(){let[$,Z]=YY.useState(0);return[YY.useCallback((B)=>{if(!B)return;let J=new ResizeObserver(([Q])=>{let X=Q.borderBoxSize?.[0];Z(X?X.blockSize:Q.contentRect.height)});return J.observe(B),()=>J.disconnect()},[]),$]}function Vf({onCreateWidget:$,editing:Z,onEditingChange:H,widgets:B}){let{layout:J,setLayout:Q}=K5(),X=B.length>0,z=new Set(J.widgetGrid.map((L)=>L.i)),G=J.widgetGrid.filter((L)=>B.some((V)=>V.id===L.i)).map((L)=>{let V=B.find((A)=>A.id===L.i);return{id:L.i,w:V.config.colSpan,h:V.config.rowSpan,x:L.x,y:L.y}}),F=B.filter((L)=>!z.has(L.id)).map((L)=>({id:L.id,w:L.config.colSpan,h:L.config.rowSpan})),[U,Y]=sH0(),K=Z&&F.length>0;lU({kind:"widget",enabled:!Z,targets:G.map((L)=>({id:L.id,revision:B.find((V)=>V.id===L.id)?.revision}))});function W(L){Q({widgetGrid:J.widgetGrid.filter((V)=>V.i!==L)})}function N(L){let V=B.find((q)=>q.id===L);if(!V)return;let A=J.widgetGrid.map((q)=>{let _=B.find((M)=>M.id===q.i);return{...q,w:_?.config.colSpan??1,h:_?.config.rowSpan??1}}),D=_J(A,V.config.colSpan,V.config.rowSpan,4);Q({widgetGrid:[...J.widgetGrid,{i:L,x:D.x,y:D.y}]})}return R1.jsx("div",{className:"group/widgets relative min-h-0 flex-1",children:R1.jsxs(Af,{children:[R1.jsx("div",{className:s("relative flex h-full flex-col items-center p-4",X?"overflow-y-auto":"overflow-hidden"),children:X?R1.jsxs(R1.Fragment,{children:[R1.jsx(nH0,{editing:Z,onCreateWidget:$,onEditingChange:H}),G.length===0?R1.jsx(B5.div,{className:"flex min-h-0 w-full max-w-(--column-w) flex-1 flex-col",animate:{paddingBottom:K?Y:0},transition:{type:"spring",duration:0.3,bounce:0},children:R1.jsx(oH0,{})}):R1.jsx(B5.div,{className:"w-full max-w-(--column-w)",animate:{marginBottom:K?Y:0},transition:{type:"spring",duration:0.3,bounce:0},children:R1.jsx(Nf,{items:G,editing:Z,renderItem:Lf,onRemove:W,onLayoutChange:(L)=>Q({widgetGrid:L.map((V)=>({i:V.id,x:V.x??0,y:V.y??0}))})})})]}):R1.jsx(aH0,{onCreateWidget:$})}),R1.jsx($4,{children:X&&Z&&F.length>0&&R1.jsx(Zg,{ref:U,items:F,renderItem:Lf,onClose:()=>H(!1),onRestore:N})})]})})}var qf=O(d(),1);function Df({children:$}){return qf.jsx("header",{className:s("@container relative flex shrink-0 items-center gap-2.5 py-2 pr-3 pl-4","after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border"),children:$})}var pD=O(g(),1);var q2=O(d(),1);function tH0($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function eH0({name:$,status:Z}){let H=RU($),B="size-full rounded-lg ring-2 ring-background";return q2.jsxs("span",{className:"relative size-10 shrink-0",children:[H?q2.jsx("img",{src:H,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):q2.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:q2.jsx(bU,{className:"size-5"})}),Z!=="connected"&&q2.jsx(Mf,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function Pf($){return[...$].sort((Z,H)=>Number(H.status==="connected")-Number(Z.status==="connected"))}function _f({icon:$,children:Z}){return q2.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,q2.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function Of({server:$}){return q2.jsxs(_f,{icon:q2.jsx(eH0,{name:$.name,status:$.status}),children:[q2.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:kU($.name)}),q2.jsx("span",{className:"text-sm text-muted-foreground",children:tH0($.status)})]})}function jf(){return q2.jsxs(_f,{icon:q2.jsx(gZ,{className:"size-10 shrink-0 rounded-lg"}),children:[q2.jsx(gZ,{className:"h-4 w-36 max-w-full"}),q2.jsx(gZ,{className:"h-4 w-20"})]})}function wD({children:$}){return q2.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function Tf($,Z){return o1({queryKey:w0.mcp($),queryFn:()=>V1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var _4=O(d(),1);function iZ({title:$,description:Z,children:H}){return _4.jsxs("div",{className:"flex flex-col gap-6",children:[_4.jsxs("header",{className:"flex flex-col gap-0.5",children:[_4.jsx("h2",{className:"text-lg font-medium tracking-tight",children:$}),Z&&_4.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),H]})}function rZ({label:$,children:Z}){return _4.jsxs("section",{className:"flex flex-col gap-2",children:[$&&_4.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),_4.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border border-border bg-card text-card-foreground",children:Z})]})}function aZ({title:$,description:Z,control:H}){return _4.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[_4.jsxs("div",{className:"flex min-w-0 flex-col",children:[_4.jsx("span",{className:"text-sm font-medium",children:$}),Z&&_4.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),H&&_4.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:H})]})}var d2=O(d(),1),$B0=Array.from({length:4},($,Z)=>Z);function ZB0({connectors:$}){if($.isPending)return d2.jsx("div",{role:"status","aria-label":"Loading connectors",children:d2.jsx(wD,{children:$B0.map((Z)=>d2.jsx(jf,{},Z))})});if($.isError)return d2.jsxs(Cf,{children:[d2.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),d2.jsx(T0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return d2.jsxs(Cf,{children:[d2.jsx(KY,{size:24,stroke:1.5,className:"text-muted-foreground"}),d2.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return d2.jsx(wD,{children:Pf($.data).map((Z)=>d2.jsx(Of,{server:Z},Z.name))})}function Cf({children:$}){return d2.jsx("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border px-8 py-12 text-center",children:$})}function wf(){let{workspaceId:$}=K5(),Z=Tf($,!0);return d2.jsx(iZ,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:d2.jsx(ZB0,{connectors:Z})})}var kD=O(g(),1);var mJ={};j4(mJ,{Thumb:()=>Rf,Root:()=>Sf});var X6=O(g(),1);var WY=O(g(),1),ED=WY.createContext(void 0);function Ef(){let $=WY.useContext(ED);if($===void 0)throw Error(E0(63));return $}var SD=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.readonly="data-readonly",$.required="data-required",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var NY={...x2,checked($){if($)return{[SD.checked]:""};return{[SD.unchecked]:""}}};var fJ=O(d(),1),Sf=X6.forwardRef(function(Z,H){let{checked:B,className:J,defaultChecked:Q,id:X,inputRef:z,name:G,nativeButton:F=!1,onCheckedChange:U,readOnly:Y=!1,required:K=!1,disabled:W=!1,render:N,uncheckedValue:L,value:V,...A}=Z,{clearErrors:D}=s4(),{state:q,setTouched:_,setDirty:M,validityData:P,setFilled:C,setFocused:R,shouldValidateOnChange:y,validationMode:w,disabled:h,name:E,validation:I}=h5(),{labelId:j}=N2(),S=h||W,k=E??G,b=Y0(U),v=X6.useRef(null),c=C4(v,z,I.inputRef),T=X6.useRef(null),e=H1(),Z0=V$({id:X,implicit:!1,controlRef:T}),x=F?void 0:Z0,[t,D0]=t4({controlled:B,default:Boolean(Q),name:"Switch",state:"checked"});D$({id:e,commit:I.commit,value:t,controlRef:T,name:k,getValue:()=>t}),U0(()=>{if(v.current)C(v.current.checked)},[v,C]),PF(t,()=>{if(D(k),M(t!==P.initialValue),C(t),y())I.commit(t);else I.commit(t,!0)});let{getButtonProps:p,buttonRef:X0}=u5({disabled:S,native:F}),K0={id:F?Z0:e,role:"switch","aria-checked":t,"aria-readonly":Y||void 0,"aria-required":K||void 0,"aria-labelledby":j,onFocus(){if(!S)R(!0)},onBlur(){let i=v.current;if(!i||S)return;if(_(!0),R(!1),w==="onBlur")I.commit(i.checked)},onClick(i){if(Y||S)return;i.preventDefault(),v.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:i.shiftKey,ctrlKey:i.ctrlKey,altKey:i.altKey,metaKey:i.metaKey}))}},Q0=X6.useMemo(()=>W4({checked:t,disabled:S,id:x,name:k,required:K,style:k?nM:K8,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:c,onChange(i){if(i.nativeEvent.defaultPrevented)return;let B0=i.target.checked,$0=M0(G0.none,i.nativeEvent);if(b?.(B0,$0),$0.isCanceled)return;D0(B0)},onFocus(){T.current?.focus()}},I.getInputValidationProps,V!==void 0?{value:V}:b1),[t,S,c,x,k,b,K,D0,I,V]),z0=X6.useMemo(()=>({...q,checked:t,disabled:S,readOnly:Y,required:K}),[q,t,S,Y,K]),L0=F0("span",Z,{state:z0,ref:[H,T,X0],props:[K0,I.getValidationProps,A,p],stateAttributesMapping:NY});return fJ.jsxs(ED.Provider,{value:z0,children:[L0,!t&&k&&L!==void 0&&fJ.jsx("input",{type:"hidden",name:k,value:L}),fJ.jsx("input",{...Q0})]})});var If=O(g(),1);var Rf=If.forwardRef(function(Z,H){let{render:B,className:J,...Q}=Z,{state:X}=h5(),z=Ef(),G={...X,...z};return F0("span",Z,{state:G,ref:H,stateAttributesMapping:NY,props:Q})});var ID=O(d(),1);function kf({className:$,...Z}){return ID.jsx(mJ.Root,{"data-slot":"switch",className:s("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-primary data-unchecked:bg-input",$),...Z,children:ID.jsx(mJ.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0.5"})})}var RD=["app-settings"];function bf(){let $=Z1();return B2((Z)=>{if(Z.type==="settings:updated")$.setQueryData(RD,Z.settings)}),o1({queryKey:RD,queryFn:()=>V1("/api/settings"),staleTime:30000})}function yf(){let $=Z1();return s1({mutationFn:(Z)=>V1("/api/settings",n5("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(RD,Z)}})}function hf($){return o1({queryKey:w0.env($),queryFn:()=>V1(`/api/workspaces/${$}/env`),...y4})}function xf($){let Z=Z1();return s1({mutationFn:(H)=>V1(`/api/workspaces/${$}/env`,n5("PUT",H)),onSuccess:(H)=>{Z.setQueryData(w0.env($),H)}})}function vf($){let Z=Z1();return s1({mutationFn:(H)=>S4(`/api/workspaces/${$}/config`,n5("PUT",{name:H}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.layout($)}),Z.invalidateQueries({queryKey:w0.all})}})}function gf($){let Z=Z1();return s1({scope:{id:`workspace-icon:${$}`},mutationFn:(H)=>V1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":H.type||"application/octet-stream"},body:H}),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.layout($)}),Z.invalidateQueries({queryKey:w0.all})}})}function ff($){let Z=Z1();return s1({scope:{id:`workspace-icon:${$}`},mutationFn:()=>S4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon"),onSuccess:()=>{Z.invalidateQueries({queryKey:w0.layout($)}),Z.invalidateQueries({queryKey:w0.all})}})}function mf($){let Z=Z1();return B2((H)=>{if(H.type==="env:updated"&&H.workspaceId===$)Z.invalidateQueries({queryKey:w0.env($)})}),{env:hf($),update:xf($)}}var k5=O(d(),1),HB0={dotenv:".env",custom:"secret",both:"override"},BB0=/^[A-Za-z_][A-Za-z0-9_]*$/;function uf(){let{workspaceId:$}=K5(),{env:Z,update:H}=mf($),[B,J]=kD.useState(""),[Q,X]=kD.useState(""),z=BB0.test(B),G=z&&Q.length>0&&!H.isPending,F=()=>{if(!G)return;H.mutate({set:{[B]:Q}},{onSuccess:()=>{J(""),X("")}})},U=Z.data?.vars??[],Y=Z.data?.files.reduce((W,N)=>W+N.count,0)??0,K=Z.data?.files.length??0;return k5.jsxs(iZ,{title:"Environment",description:"Secrets injected into widgets and the agent at run time. Values are write-only — they're never shown again once saved.",children:[k5.jsxs(rZ,{label:"Variables",children:[Z.isLoading?k5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:k5.jsx(I5,{className:"size-4 animate-spin",stroke:1.75})}):U.length===0?k5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):U.map((W)=>{let N=W.source!=="dotenv";return k5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[k5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),k5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),k5.jsx("span",{className:s("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",W.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:HB0[W.source]}),!N&&k5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),k5.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>H.mutate({remove:[W.key]}),disabled:!N,"aria-label":`Delete ${W.key}`,className:"disabled:invisible",children:k5.jsx(pf,{stroke:1.75})})]},W.key)}),k5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[k5.jsx(L3,{value:B,onChange:(W)=>J(W.target.value),placeholder:"NEW_KEY","aria-invalid":B.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),k5.jsx(L3,{value:Q,onChange:(W)=>X(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")F()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),k5.jsxs(T0,{variant:"outline",size:"sm",onClick:F,disabled:!G,children:[H.isPending?k5.jsx(I5,{stroke:1.75,className:"animate-spin"}):k5.jsx(N4,{stroke:1.75}),"Add"]})]})]}),k5.jsx(rZ,{label:"From .env files",children:k5.jsx(aZ,{title:"Inherit .env files",description:K>0?`Discovered ${Y} ${Y===1?"key":"keys"} across ${K} ${K===1?"file":"files"} in this space.`:"No .env files found in this space.",control:k5.jsx(kf,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(W)=>H.mutate({inheritDotenv:W})})})})]})}var ip=O(g(),1);var T2=O(g(),1);var n0=O(g(),1),nZ=O(g(),1),m4=O(g(),1),Ym=O(d(),1),AY=O(g(),1),VY=O(g(),1),j1=O(d(),1),JB0=Object.defineProperty,QB0=($,Z)=>{for(var H in Z)JB0($,H,{get:Z[H],enumerable:!0})},n9={};QB0(n9,{ActiveEmoji:()=>wm,Empty:()=>Cm,List:()=>Om,Loading:()=>Tm,Root:()=>Am,Search:()=>Vm,SkinTone:()=>Em,SkinToneSelector:()=>jm,Viewport:()=>Dm});var Qm="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",hD=["none","light","medium-light","medium","medium-dark","dark"];function bD($){return $.charAt(0).toUpperCase()+$.slice(1)}var k8=2,l2=null;function cf($){try{l2??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!l2||(queueMicrotask(()=>{l2&&(l2=null)}),l2.canvas.width=k8,l2.canvas.height=k8,l2.font=`2px ${Qm}`,l2.textBaseline="middle",l2.measureText($).width>=k8*2))return!1;l2.fillStyle="#00f",l2.fillText($,0,0);let Z=l2.getImageData(0,0,k8,k8).data;l2.clearRect(0,0,k8,k8),l2.fillStyle="#f00",l2.fillText($,0,0);let H=l2.getImageData(0,0,k8,k8).data;for(let B=0;B<k8*k8*4;B+=4)if(Z[B]!==H[B]||Z[B+1]!==H[B+1]||Z[B+2]!==H[B+2])return!1;return!0}function df($,Z,H){try{let B=$.getItem(Z);if(!B)throw Error(`No value found for "${Z}".`);let J=JSON.parse(B);return H(J)}catch{return null}}function Xm($,Z,H){$.setItem(Z,JSON.stringify(H))}function lf($){return(Z)=>Z===void 0?void 0:$(Z)}function rf($){return(Z)=>Z===null?null:$(Z)}function j2($){if(typeof $!="string")throw Error();return $}function LY($){if(typeof $!="number")throw Error();return $}function zm($){if(typeof $!="boolean")throw Error();return $}function z6($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let H={};for(let B in $){let J=Z[B];J===void 0&&$[B](void 0),H[B]=$[B](J)}return H}}function yD($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var Gm=($,Z)=>`${$}/${Z}/data.json`,Fm=($,Z)=>`${$}/${Z}/messages.json`,XB0=["bn","da","de","en-gb","en","es-mx","es","et","fi","fr","hi","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","vi","zh-hant","zh"],af="en",Um=($)=>`frimousse/data/${$}`,nf="frimousse/metadata";async function of($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function zB0($,Z,H){let[{emojis:B,emojisEtag:J},{messages:Q,messagesEtag:X}]=await Promise.all([fetch(Gm($,Z),{signal:H}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(Fm($,Z),{signal:H}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:B,messages:Q,emojisEtag:J,messagesEtag:X}}async function GB0($,Z,H){let[B,J]=await Promise.all([of(Gm($,Z),H),of(Fm($,Z),H)]);return{emojisEtag:B,messagesEtag:J}}function FB0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,H)=>{let B=hD[H.tone];return Z[B]=H.emoji,Z},{}):void 0}async function sf($,Z,H){let{emojis:B,emojisEtag:J,messages:Q,messagesEtag:X}=await zB0($,Z,H),z=Q.subgroups.find((N)=>N.key==="country-flag"||N.key==="subdivision-flag"),G=Q.groups.filter((N)=>N.key!=="component"),F=B.filter((N)=>("group"in N)),U=G.map((N)=>({index:N.order,label:bD(N.message)})),Y=Q.skinTones.reduce((N,L)=>(N[L.key]=bD(L.message),N),{}),K=F.map((N)=>({emoji:N.emoji,category:N.group,version:N.version,label:bD(N.label),tags:N.tags??[],countryFlag:z&&N.subgroup===z.order||void 0,skins:FB0(N)})),W={locale:Z,emojis:K,categories:U,skinTones:Y};return Xm(localStorage,Um(Z),{data:W,metadata:{emojisEtag:J,messagesEtag:X}}),W}function UB0($,Z){let H=new Map;for(let X of $)H.has(X.version)||H.set(X.version,X.emoji);let B=[...H.keys()].sort((X,z)=>z-X),J=B[0]??0,Q=cf("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:Q};for(let X of B){let z=H.get(X);if(cf(z))return{emojiVersion:X,countryFlags:Q}}return{emojiVersion:J,countryFlags:Q}}var YB0=z6({emojiVersion:LY,countryFlags:zm}),KB0=z6({data:z6({locale:j2,emojis:yD(z6({emoji:j2,category:LY,label:j2,version:LY,tags:yD(j2),countryFlag:lf(zm),skins:lf(z6({light:j2,"medium-light":j2,medium:j2,"medium-dark":j2,dark:j2}))})),categories:yD(z6({index:LY,label:j2})),skinTones:z6({light:j2,"medium-light":j2,medium:j2,"medium-dark":j2,dark:j2})}),metadata:z6({emojisEtag:rf(j2),messagesEtag:rf(j2)})});async function WB0({locale:$,emojiVersion:Z,emojibaseUrl:H,signal:B}){let J=typeof H=="string"?H:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,Q=df(sessionStorage,nf,YB0),X=df(localStorage,Um($),KB0),z;if(!X)z=await sf(J,$,B);else if(Q)z=X.data;else try{let{emojisEtag:F,messagesEtag:U}=await GB0(J,$,B);z=!F||!U||F!==X.metadata.emojisEtag||U!==X.metadata.messagesEtag?await sf(J,$,B):X.data}catch{z=X.data}Q??=UB0(z.emojis,Z),Xm(sessionStorage,nf,Q);let G=z.emojis.filter((F)=>{let U=F.version<=Q.emojiVersion;return F.countryFlag?U&&Q.countryFlags:U});return{locale:$,emojis:G,categories:z.categories,skinTones:z.skinTones}}function tf($){return XB0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${af}" instead.`),af)}function ef($){return hD.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function NB0($,Z){let H=[];if(Z<=0)return H;for(let B=0,J=$.length;B<J;B+=Z)H.push($.slice(B,B+Z));return H}function LB0($,Z){if(!Z)return $;let H=Z.toLowerCase().trim(),B=new WeakMap;return $.filter((J)=>{let Q=0;J.label.toLowerCase().includes(H)&&(Q+=10);for(let X of J.tags)X.toLowerCase().includes(H)&&(Q+=1);return Q>0?(B.set(J,Q),!0):!1}).sort((J,Q)=>(B.get(Q)??0)-(B.get(J)??0))}function AB0($,Z,H,B){let J=LB0($.emojis,B),Q=[],X=[],z=[],G={},F=0,U=0;for(let Y of J)G[Y.category]||(G[Y.category]=[]),G[Y.category].push({emoji:H&&H!=="none"&&Y.skins?Y.skins[H]:Y.emoji,label:Y.label});for(let Y of $.categories){let K=G[Y.index];if(!K||K.length===0)continue;let W=NB0(Array.from(K),Z).map((N)=>({categoryIndex:F,emojis:N}));Q.push(...W),X.push({label:Y.label,rowsCount:W.length,startRowIndex:U}),z.push(U),F++,U+=W.length}return{count:J.length,categories:X,categoriesStartRowIndices:z,rows:Q,skinTones:$.skinTones}}function VB0($){let Z={},H=null,B=null,J=new Set,Q=()=>{if(H){Z=H,H=null;for(let F of J)F(Z)}B=null},X=()=>H??Z,z=(F)=>{H??=Z,Object.assign(H,typeof F=="function"?F(X()):F),B||(B=requestAnimationFrame(Q))},G=(F)=>(J.add(F),()=>J.delete(F));return Z=$(z,X),{get:X,set:z,subscribe:G}}function DB0($){let[Z]=m4.useState($);return Z}function qB0($){let Z=m4.createContext(null);return{useStore:()=>{let H=m4.useContext(Z);if(!H)throw Error($);return H},Provider:({store:H,children:B})=>Ym.jsx(Z.Provider,{value:H,children:B})}}function f4($,Z,H=Object.is){let[B,J]=m4.useState(()=>Z($.get()));return m4.useEffect(()=>$.subscribe(()=>{let Q=Z($.get());J((X)=>H(X,Q)?X:Q)}),[$,Z,H]),m4.useDebugValue(B),B}function j9($,Z,H){let B=m4.useCallback((J)=>J[Z],[Z]);return f4($,B,H)}var $m=2;function MB0($,Z,H,B,J){let Q=0;return VB0((X,z)=>({locale:Z,columns:H,sticky:B,skinTone:J,onEmojiSelect:$,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:(G)=>{let F=z(),U=G?.data??F.data,Y=G?.categoryHeaderHeight??F.categoryHeaderHeight,K=G?.rowHeight??F.rowHeight,W=G?.viewportHeight??F.viewportHeight;if(!U||U.rows.length===0||!Y||!K||!W)return X({...G,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let N=0,L=0;for(let R of U.categories)if(L++*Y+R.startRowIndex*K<Q)N+=Y;else break;let V=U.categories.length*Y+U.rows.length*K,A=Math.floor($m*K/2),D=Math.ceil($m*K/2),q=Math.min(Q-N-A,V-W),_=q+W+D,M=Math.max(0,Math.floor(q/K)),P=Math.min(U.rows.length-1,Math.ceil(_/K)),C=U.rows[M]?.categoryIndex;return X(C===void 0&&G?G:{...G,viewportStartCategoryIndex:C,viewportStartRowIndex:M,viewportEndRowIndex:P})},onDataChange:(G)=>{z().updateViewportState({data:G,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(G)=>{X({search:G,interaction:G?"keyboard":"none"})},onActiveEmojiChange:(G,F,U)=>{if(X({interaction:G,activeColumnIndex:F,activeRowIndex:U}),G!=="keyboard")return;let{listRef:Y,viewportRef:K,sticky:W,rowHeight:N,viewportHeight:L,categoryHeaderHeight:V}=z(),A=Y?.current,D=K?.current;if(!A||!D||!N||!V||!L)return;let q=U;q===0&&D.scrollTo({top:0,behavior:"instant"});let _=A.querySelector(`[aria-rowindex="${q}"]`);if(!(_ instanceof HTMLElement))return;let M=_.offsetTop,P=getComputedStyle(_),C=Number.parseFloat(P.scrollMarginTop),R=Number.parseFloat(P.scrollMarginBottom),y=Q+C;W&&M<Q+L/2&&(y+=V);let w=y+L-R;(M<y||M+N>w)&&D.scrollTo({top:Math.max(M<y+V?M-Math.max(W?V:0,C):M-L+N+R,0),behavior:"instant"})},onActiveEmojiReset:()=>{X({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(G)=>{z().updateViewportState({rowHeight:G})},onCategoryHeaderHeightChange:(G)=>{z().updateViewportState({categoryHeaderHeight:G})},onViewportSizeChange:(G,F)=>{z().updateViewportState({viewportWidth:G,viewportHeight:F})},onViewportScroll:(G)=>{Q=G,z().updateViewportState()}}))}var{useStore:O4,Provider:PB0}=qB0("EmojiPicker.Root is missing.");function _B0($){return $.search}function xD($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function OB0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function jB0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function Km($){return $.data?.rows.length}function TB0($){return $.data?.categories.length}function CB0($){return $.data?.categoriesStartRowIndices}function wB0($){return $.data?.skinTones}function Wm($,Z){return $?.emoji===Z?.emoji}function EB0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((H,B)=>Wm(H,Z?.emojis[B]))}var pJ="‍",Zm=/\p{Emoji_Modifier_Base}/u,SB0=/\uFE0F$/,IB0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,RB0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function kB0($,Z){if(!$.split(pJ).some((B)=>Zm.test(B)))return $;let H=$.split(pJ).map((B)=>B.replace(IB0,"")).join(pJ);return Z==="none"?H:H.split(pJ).map((B,J,Q)=>{let X=Q.length>1;return!Zm.test(B)||X&&B==="\uD83E\uDD1D"?B:B.replace(SB0,"")+RB0[Z]}).join(pJ)}function bB0($){return hD.map((Z)=>({skinTone:Z,emoji:kB0($,Z)}))}function Nm(){let $=O4(),Z=f4($,xD,Wm);return nZ.useDeferredValue(Z)}function Lm($="✋"){let Z=O4(),H=j9(Z,"skinTone"),B=nZ.useMemo(()=>bB0($),[$]),J=nZ.useCallback((Q)=>{Z.set({skinTone:Q})},[]);return[H,J,B]}function vD($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let H=Object.keys($),B=Object.keys(Z);return H.length!==B.length?!1:H.every((J)=>(J in Z)&&$[J]===Z[J])}function yB0(...$){}function hB0($,Z){let H=null;if(typeof window.requestIdleCallback=="function")H=window.requestIdleCallback($,Z);else{let B=Date.now();H=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-B))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(H):window.clearTimeout(H)}}var b8=typeof window<"u"?AY.useLayoutEffect:AY.useEffect;function xB0($){let Z=VY.useRef($);return b8(()=>{Z.current=$}),VY.useCallback((...H)=>Z.current(...H),[])}function vB0({emojiVersion:$,emojibaseUrl:Z}){let[H,B]=n0.useState(void 0),J=O4(),Q=j9(J,"locale"),X=j9(J,"columns"),z=j9(J,"skinTone"),G=j9(J,"search");return n0.useEffect(()=>{let F=new AbortController,U=F.signal;return WB0({locale:Q,emojiVersion:$,emojibaseUrl:Z,signal:U}).then((Y)=>{B(Y)}).catch((Y)=>{U.aborted||console.error(Y)}),()=>{F.abort()}},[$,Z,Q]),n0.useEffect(()=>{if(H)return hB0(()=>{J.get().onDataChange(AB0(H,X,z,G))},{timeout:100})},[H,X,z,G]),null}var Am=n0.forwardRef(({locale:$="en",columns:Z=9,skinTone:H="none",onEmojiSelect:B=yB0,emojiVersion:J,emojibaseUrl:Q,onFocusCapture:X,onBlurCapture:z,children:G,style:F,sticky:U=!0,...Y},K)=>{let W=xB0(B),N=DB0(()=>MB0(W,tf($),Z,U,ef(H))),[L,V]=n0.useState(!1),A=n0.useRef(null),D=n0.useCallback((M)=>{M&&(A.current=M,N.set({rootRef:A}))},[]);b8(()=>{N.set({locale:tf($)})},[$]),b8(()=>{N.set({columns:Z})},[Z]),b8(()=>{N.set({sticky:U})},[U]),b8(()=>{N.set({skinTone:ef(H)})},[H]);let q=n0.useCallback((M)=>{X?.(M);let{searchRef:P,viewportRef:C}=N.get(),R=M.target===P?.current||M.target.hasAttribute("frimousse-search"),y=M.target===C?.current||M.target.hasAttribute("frimousse-viewport");M.isDefaultPrevented()||(V(R||y),M.isDefaultPrevented()||(V(R||y),y?N.get().onActiveEmojiChange("keyboard",0,0):R&&N.get().search===""&&N.set({interaction:"none"})))},[X]),_=n0.useCallback((M)=>{z?.(M),!M.isDefaultPrevented()&&!M.currentTarget.contains(M.relatedTarget)&&V(!1)},[z]);return b8(()=>{L||N.get().onActiveEmojiReset()},[L]),n0.useImperativeHandle(K,()=>A.current),n0.useEffect(()=>{if(!L)return;function M(P){if(P.defaultPrevented||!P.key.startsWith("Arrow")&&P.key!=="Enter")return;let{data:C,onEmojiSelect:R,onActiveEmojiChange:y,interaction:w,activeColumnIndex:h,activeRowIndex:E}=N.get();if(P.key==="Enter"){let I=xD(N.get());I&&(P.preventDefault(),R(I))}if(P.key.startsWith("Arrow")){let I=h,j=E;if(P.preventDefault(),w!=="none"){if(C?.rows&&C.rows.length>0)switch(P.key){case"ArrowLeft":{if(I===0){let S=j-1,k=C.rows[S];k&&(j=S,I=k.emojis.length-1)}else I-=1;break}case"ArrowRight":{if(I===C.rows[j].emojis.length-1){let S=j+1;C.rows[S]&&(j=S,I=0)}else I+=1;break}case"ArrowUp":{let S=C.rows[j-1];S&&(j-=1,S.emojis[I]||(I=S.emojis.length-1));break}case"ArrowDown":{let S=C.rows[j+1];S&&(j+=1,S.emojis[I]||(I=S.emojis.length-1));break}}y("keyboard",I,j)}else y("keyboard",0,0)}}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[L]),b8(()=>{let M=null,P=null,C=null,R=null,y=N.subscribe((j)=>{A.current&&(M!==j.viewportWidth&&(M=j.viewportWidth,A.current.style.setProperty("--frimousse-viewport-width",`${j.viewportWidth}px`)),P!==j.viewportHeight&&(P=j.viewportHeight,A.current.style.setProperty("--frimousse-viewport-height",`${j.viewportHeight}px`)),C!==j.rowHeight&&(C=j.rowHeight,A.current.style.setProperty("--frimousse-row-height",`${j.rowHeight}px`)),R!==j.categoryHeaderHeight&&(R=j.categoryHeaderHeight,A.current.style.setProperty("--frimousse-category-header-height",`${j.categoryHeaderHeight}px`)))}),{viewportWidth:w,viewportHeight:h,rowHeight:E,categoryHeaderHeight:I}=N.get();return w&&A.current.style.setProperty("--frimousse-viewport-width",`${w}px`),h&&A.current.style.setProperty("--frimousse-viewport-height",`${h}px`),E&&A.current.style.setProperty("--frimousse-row-height",`${E}px`),I&&A.current.style.setProperty("--frimousse-category-header-height",`${I}px`),y},[]),j1.jsx("div",{"data-focused":L?"":void 0,"frimousse-root":"",onBlurCapture:_,onFocusCapture:q,...Y,ref:D,style:{"--frimousse-emoji-font":Qm,...F},children:j1.jsxs(PB0,{store:N,children:[j1.jsx(vB0,{emojiVersion:J,emojibaseUrl:Q}),G]})})}),Vm=n0.forwardRef(({value:$,defaultValue:Z,onChange:H,...B},J)=>{let Q=O4(),X=n0.useRef(null),z=n0.useCallback((Y)=>{Y&&(X.current=Y,Q.set({searchRef:X}))},[]),G=typeof $=="string",F=n0.useRef(G);n0.useEffect(()=>{F.current=G},[G]),b8(()=>{Q.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),b8(()=>{typeof $=="string"&&Q.get().onSearchChange($)},[$]);let U=n0.useCallback((Y)=>{H?.(Y),Y.isDefaultPrevented()||Q.get().onSearchChange(Y.target.value)},[H]);return n0.useImperativeHandle(J,()=>X.current),j1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...B,defaultValue:Z,onChange:U,ref:z,value:$})}),gB0=n0.memo(()=>{let $=Nm();return $?j1.jsx("div",{"aria-live":"polite",style:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1,wordWrap:"normal"},children:$.label}):null}),Dm=n0.forwardRef(({children:$,onScroll:Z,onKeyDown:H,style:B,...J},Q)=>{let X=O4(),z=n0.useRef(null),G=n0.useCallback((K)=>{K&&(z.current=K,X.set({viewportRef:z}))},[]),F=f4(X,Km),U=f4(X,TB0),Y=n0.useCallback((K)=>{Z?.(K),X.get().onViewportScroll(K.currentTarget.scrollTop)},[Z]);return b8(()=>{if(!z.current)return;let K=new ResizeObserver(([W])=>{let N=W?.borderBoxSize[0]?.inlineSize??0,L=W?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:V,viewportHeight:A,viewportWidth:D}=X.get();(A!==L||D!==N)&&V(N,L)});return K.observe(z.current),X.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{K.disconnect()}},[]),n0.useImperativeHandle(Q,()=>z.current),j1.jsxs("div",{"frimousse-viewport":"",...J,onScroll:Y,ref:G,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof F=="number"&&typeof U=="number"?`var(--frimousse-viewport-width, auto) calc(${F} * var(--frimousse-row-height) + ${U} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...B},children:[j1.jsx(gB0,{}),$]})});function qm($,Z,H){return{emoji:{...$,isActive:H},role:"gridcell","aria-colindex":Z,"aria-selected":H||void 0,"aria-label":$.label,"data-active":H?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function Mm($,Z=!1){return{role:Z?void 0:"row","aria-rowindex":Z?void 0:$,"frimousse-row":"",style:{contain:Z?void 0:"content",height:Z?void 0:"var(--frimousse-row-height)",display:"flex"}}}function Pm($,Z){return{"frimousse-category":"",style:{contain:"content",top:Z?`calc(${$} * var(--frimousse-category-header-height) + ${Z.startRowIndex} * var(--frimousse-row-height))`:void 0,height:Z?`calc(var(--frimousse-category-header-height) + ${Z.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function _m($,Z=!1,H=!0){return{category:$,"frimousse-category-header":"",style:{contain:Z?void 0:"layout paint",height:Z?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:H?"sticky":void 0,top:0}}}function Hm($,Z,H,B){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${H} * var(--frimousse-row-height) + ${B} * var(--frimousse-category-header-height))`}}}function Bm($,Z,H){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...H},role:"grid"}}function fB0($){$.preventDefault()}var mB0=n0.memo(({Emoji:$,emoji:Z,columnIndex:H,rowIndex:B})=>{let J=O4(),Q=f4(J,(F)=>xD(F)?.emoji===Z.emoji),X=n0.useCallback(()=>{J.get().onEmojiSelect(Z)},[Z]),z=n0.useCallback(()=>{J.get().onActiveEmojiChange("pointer",H,B)},[H,B]),G=n0.useCallback(()=>{J.get().onActiveEmojiReset()},[]);return j1.jsx($,{...qm(Z,H,Q),onClick:X,onPointerDown:fB0,onPointerEnter:z,onPointerLeave:G})}),pB0=n0.memo(({Row:$,Emoji:Z,rowIndex:H})=>{let B=O4(),J=f4(B,(Q)=>Q.data?.rows[H],EB0);return J?j1.jsx($,{...Mm(H),children:J.emojis.map((Q,X)=>j1.jsx(mB0,{Emoji:Z,columnIndex:X,emoji:Q,rowIndex:H},Q.label))}):null}),uB0=n0.memo(({CategoryHeader:$,categoryIndex:Z})=>{let H=O4(),B=f4(H,(Q)=>Q.data?.categories[Z],vD),J=j9(H,"sticky");return B?j1.jsx("div",{...Pm(Z,B),children:j1.jsx($,{..._m({label:B.label},!1,J)})}):null}),Jm=n0.memo(({CategoryHeader:$,Row:Z,Emoji:H})=>{let B=n0.useRef(null),J=O4(),Q=j9(J,"columns"),X=n0.useMemo(()=>Array(Q).fill({emoji:"\uD83D\uDE42",label:""}),[Q]),z=n0.useMemo(()=>({label:"Category"}),[]),G=n0.useRef(null),F=n0.useRef(null);return b8(()=>{let U=B.current?.parentElement?.parentElement;if(!U||!G.current||!F.current)return;let Y=new ResizeObserver((N)=>{for(let L of N){let V=L.contentRect.height,{onRowHeightChange:A,onCategoryHeaderHeightChange:D,rowHeight:q,categoryHeaderHeight:_}=J.get();L.target===G.current&&q!==V&&A(V),L.target===F.current&&_!==V&&D(V)}});Y.observe(U),Y.observe(G.current),Y.observe(F.current);let{onRowHeightChange:K,onCategoryHeaderHeightChange:W}=J.get();return K(G.current.clientHeight),W(F.current.clientHeight),()=>{Y.disconnect()}},[]),j1.jsxs("div",{"aria-hidden":!0,ref:B,style:{height:0,visibility:"hidden"},children:[j1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:j1.jsx(Z,{...Mm(-1,!0),children:X.map((U,Y)=>j1.jsx(H,{...qm(U,Y,!1)},Y))})}),j1.jsx("div",{...Pm(-1),children:j1.jsx("div",{"frimousse-category-header-sizer":"",ref:F,children:j1.jsx($,{..._m(z,!0)})})})]})});function cB0({category:$,...Z}){return j1.jsx("div",{...Z,children:$.label})}function dB0({emoji:$,...Z}){return j1.jsx("button",{type:"button",...Z,children:$.emoji})}function lB0({...$}){return j1.jsx("div",{...$})}var Om=n0.forwardRef(({style:$,components:Z,...H},B)=>{let J=O4(),Q=n0.useRef(null),X=n0.useCallback((A)=>{A&&(Q.current=A,J.set({listRef:Q}))},[]),z=Z?.CategoryHeader??cB0,G=Z?.Emoji??dB0,F=Z?.Row??lB0,U=j9(J,"columns"),Y=j9(J,"viewportStartRowIndex"),K=j9(J,"viewportEndRowIndex"),W=f4(J,Km),N=f4(J,CB0,vD),L=n0.useMemo(()=>N?.filter((A)=>A<Y).length??0,[N,Y]),V=N?.length??0;return n0.useImperativeHandle(B,()=>Q.current),!W||!N||V===0?j1.jsx("div",{...Bm(U,0,$),...H,children:j1.jsx("div",{...Hm(0,0,0,0),children:j1.jsx(Jm,{CategoryHeader:z,Emoji:G,Row:F})})}):j1.jsx("div",{...Bm(U,W,$),...H,ref:X,children:j1.jsxs("div",{...Hm(W,V,Y,L),children:[j1.jsx(Jm,{CategoryHeader:z,Emoji:G,Row:F}),Array.from({length:K-Y+1},(A,D)=>{let q=Y+D,_=N.indexOf(q);return j1.jsxs(n0.Fragment,{children:[_>=0&&j1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),j1.jsx(pB0,{Emoji:G,Row:F,rowIndex:q})]},q)}),Array.from({length:V},(A,D)=>j1.jsx(uB0,{CategoryHeader:z,categoryIndex:D},D))]})})}),jm=n0.forwardRef(({emoji:$,onClick:Z,"aria-label":H="Change skin tone",...B},J)=>{let Q=O4(),X=f4(Q,wB0,vD),[z,G,F]=Lm($),U=n0.useMemo(()=>Math.max(0,F.findIndex((V)=>V.skinTone===z)),[z,F]),Y=F[U],K=F[(U+1)%F.length].skinTone,W=z==="none"?void 0:X?.[z],N=K==="none"?void 0:X?.[K],L=n0.useCallback((V)=>{Z?.(V),V.isDefaultPrevented()||G(K)},[Z,G,K]);return j1.jsx("button",{type:"button",...B,"aria-label":H+(N?` (${N})`:""),"aria-live":"polite","aria-valuetext":W,"frimousse-skin-tone-selector":"",onClick:L,ref:J,children:Y.emoji})});function Tm({children:$,...Z}){let H=O4();return f4(H,jB0)?j1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function iB0({children:$}){let Z=O4(),H=f4(Z,_B0);return $({search:H})}function Cm({children:$,...Z}){let H=O4();return f4(H,OB0)?j1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?j1.jsx(iB0,{children:$}):$}):null}function wm({children:$}){let Z=Nm();return $({emoji:Z})}function Em({children:$,emoji:Z}){let[H,B,J]=Lm(Z);return $({skinTone:H,setSkinTone:B,skinToneVariations:J})}Am.displayName="EmojiPicker.Root";Vm.displayName="EmojiPicker.Search";Dm.displayName="EmojiPicker.Viewport";Om.displayName="EmojiPicker.List";Tm.displayName="EmojiPicker.Loading";Cm.displayName="EmojiPicker.Empty";jm.displayName="EmojiPicker.SkinToneSelector";wm.displayName="EmojiPicker.ActiveEmoji";Em.displayName="EmojiPicker.SkinTone";var uJ=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","settings","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],rB0=new Set(uJ);function Sm($){return rB0.has($)}var bp={rocket:qp,sparkles:Op,bolt:uB,flame:tm,star:jp,heart:Jp,diamond:om,trophy:Sp,target:Cp,bulb:gm,brain:hm,robot:Dp,wand:Rp,atom:km,flask:em,cpu:im,code:dm,terminal:wp,api:Rm,database:am,cube:rm,hexagon:Qp,plug:Vp,tool:Ep,settings:cJ,bug:vm,activity:Im,chart:pm,briefcase:xm,folder:$p,file:YZ,book:ym,message:Up,mail:Gp,bell:bm,paperclip:kF,key:DY,shield:Mp,user:Ip,home:Xp,globe:Bp,world:kp,planet:Ap,compass:lm,map:Fp,calendar:fm,cloud:cm,sun:Tp,moon:Yp,snowflake:_p,leaf:zp,mountain:Kp,feather:sm,ghost:Zp,music:Wp,piano:bF,camera:mm,photo:Lp,palette:Np,gamepad:nm,gift:Hp,cart:Pp,chef:um},gD=uJ.map(($)=>({id:$,Icon:bp[$]}));function qY($){return $&&Sm($)?bp[$]:null}var mD=[{id:"sunrise",gradient:{angle:140,stops:["#FFE29F","#FFA99F","#FF719A"]}},{id:"ocean",gradient:{angle:135,stops:["#67E8F9","#3B82F6","#4F46E5"]}},{id:"meadow",gradient:{angle:135,stops:["#A7F3D0","#34D399","#059669"]}},{id:"dusk",gradient:{angle:120,stops:["#C471F5","#FA71CD"]}},{id:"midnight",gradient:{angle:135,stops:["#30CFD0","#330867"]}}];function fD($,Z,H){let B=H*Math.PI/180,J=Z*Math.cos(B),Q=Z*Math.sin(B),X=($+0.3963377774*J+0.2158037573*Q)**3,z=($-0.1055613458*J-0.0638541728*Q)**3,G=($-0.0894841775*J-1.291485548*Q)**3;return`#${[4.0767416621*X-3.3077115913*z+0.2309699292*G,-1.2684380046*X+2.6097574011*z-0.3413193965*G,-0.0041960863*X-0.7034186147*z+1.707614701*G].map((U)=>{let Y=Math.min(1,Math.max(0,U)),K=Y<=0.0031308?12.92*Y:1.055*Y**0.4166666666666667-0.055;return Math.round(K*255).toString(16).padStart(2,"0")}).join("")}`}function yp(){let $=Math.random()*360,Z=(35+Math.random()*55)*(Math.random()<0.5?-1:1),H=Math.round(115+Math.random()*55),B=fD(0.83+Math.random()*0.06,0.09+Math.random()*0.06,$),J=fD(0.5+Math.random()*0.14,0.17+Math.random()*0.07,$+Z);if(Math.random()<0.4){let Q=fD(0.7+Math.random()*0.05,0.15,$+Z/2);return{angle:H,stops:[B,Q,J]}}return{angle:H,stops:[B,J]}}var aB0="radial-gradient(120% 100% at 28% 12%, rgba(255,255,255,0.32), rgba(255,255,255,0) 58%)";function MY($){return`${aB0}, linear-gradient(${$.angle}deg, ${$.stops.join(", ")})`}var G2=256;function hp($,Z){let H=Z.angle*Math.PI/180,B=Math.sin(H),J=-Math.cos(H),Q=G2*(Math.abs(B)+Math.abs(J))/2,X=G2/2,z=$.createLinearGradient(X-B*Q,X-J*Q,X+B*Q,X+J*Q),G=Z.stops.length-1;Z.stops.forEach((U,Y)=>z.addColorStop(G===0?0:Y/G,U)),$.fillStyle=z,$.fillRect(0,0,G2,G2);let F=$.createRadialGradient(G2*0.28,G2*0.12,0,G2*0.28,G2*0.12,G2*1.1);F.addColorStop(0,"rgba(255,255,255,0.32)"),F.addColorStop(0.58,"rgba(255,255,255,0)"),$.fillStyle=F,$.fillRect(0,0,G2,G2)}function xp($){return new Promise((Z,H)=>{$.toBlob((B)=>B?Z(B):H(Error("Canvas is empty")),"image/png")})}function vp(){let $=document.createElement("canvas");$.width=G2,$.height=G2;let Z=$.getContext("2d");if(!Z)throw Error("2D canvas unavailable");return[$,Z]}var nB0=0.92,oB0=0.68;async function gp($,Z){let[H,B]=vp();if(Z)hp(B,Z);B.textAlign="center",B.textBaseline="middle";let J=Z?oB0:nB0;return B.font=`${Math.round(G2*J)}px "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,B.fillText($,G2/2,G2/2+G2*0.04),xp(H)}function sB0($){return new Promise((Z,H)=>{let B=new Image;B.onload=()=>Z(B),B.onerror=()=>H(Error("Failed to load SVG")),B.src=$})}var tB0=0.78,eB0=0.6;async function fp($,Z){let[H,B]=vp();if(Z)hp(B,Z);let J=Z?"#ffffff":"#18181b",Q=$.replace(/currentColor/g,J),X=await sB0(`data:image/svg+xml;utf8,${encodeURIComponent(Q)}`),z=G2*(Z?eB0:tB0),G=(G2-z)/2;return B.drawImage(X,G,G,z,z),xp(H)}var mp=["\uD83D\uDE80","✨","\uD83D\uDD25","⚡","\uD83D\uDCA1","\uD83E\uDDE0","\uD83E\uDD16","\uD83E\uDE84","\uD83E\uDDEA","⚙️","\uD83D\uDEE0️","\uD83D\uDCBB","\uD83D\uDCE6","\uD83D\uDCCA","\uD83D\uDCC8","\uD83D\uDCDD","\uD83D\uDCDA","\uD83C\uDFAF","\uD83C\uDFC6","\uD83D\uDC8E","\uD83E\uDE90","\uD83C\uDF0D","\uD83E\uDDED","\uD83C\uDFA8","\uD83C\uDFAE","☕"],PY="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var e0=O(d(),1);function $J0({category:$,...Z}){return e0.jsx("div",{className:"bg-background px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",...Z,children:$.label})}function ZJ0({children:$,...Z}){return e0.jsx("div",{className:"scroll-my-1 px-1.5",...Z,children:$})}function HJ0({emoji:$,...Z}){return e0.jsx("button",{className:s("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75 data-active:bg-muted",PY),...Z,children:$.emoji})}function lp({icon:$}){let{workspaceId:Z,provider:H}=K5(),{isPending:B,mutateAsync:J}=gf(Z),{isPending:Q,mutate:X}=ff(Z),[z,G]=T2.useState("emoji"),[F,U]=T2.useState({id:"sunrise",gradient:mD[0].gradient}),[Y,K]=T2.useState(null),[W,N]=T2.useState(null),[L,V]=T2.useState(""),[A,D]=T2.useState(null),[q,_]=T2.useState(null),[M,P]=T2.useState(!1),[C,R]=T2.useState(null),y=T2.useRef(null),w=T2.useRef(null),h=T2.useRef(null),E=gD.find((T)=>T.id===A),I=F.gradient!==null,j=B||Q,S=()=>{let T=yp();K(T),U({id:"shuffle",gradient:T})},k=(T)=>{R(null),h.current=T,G("upload"),_(URL.createObjectURL(T))};T2.useEffect(()=>{let T=!1,e=async()=>{let x;if(z==="upload"){if(!h.current)return;x=h.current}else if(z==="emoji"){if(!W)return;x=await gp(W,F.gradient)}else{let t=w.current?.querySelector("svg");if(!t)return;x=await fp(new XMLSerializer().serializeToString(t),F.gradient)}if(!T)await J(x)};R(null);let Z0=window.setTimeout(()=>{e().catch((x)=>{if(!T)R(x instanceof Error?x.message:"Failed to save icon")})},150);return()=>{T=!0,window.clearTimeout(Z0)}},[F.gradient,W,z,J,E,q]),T2.useEffect(()=>{return()=>{if(q)URL.revokeObjectURL(q)}},[q]);let b=()=>{h.current=null,N(null),D(null),_(null),R(null),X()},v=z==="emoji"&&W?"emoji":z==="icon"&&E?"glyph":"image",c=z==="upload"&&q?q:$??P8[H??"claude-code"];return e0.jsxs("div",{className:"flex gap-6",children:[e0.jsxs("div",{className:"flex w-24 shrink-0 flex-col items-center gap-2.5",children:[e0.jsx("div",{className:s("flex size-24 items-center justify-center overflow-hidden rounded-xl",v!=="image"&&!I&&"bg-[repeating-conic-gradient(#0000000d_0%_25%,transparent_0%_50%)] bg-size-[16px_16px]"),style:v!=="image"&&F.gradient?{background:MY(F.gradient)}:void 0,children:v==="emoji"?e0.jsx("span",{className:s("leading-none",PY,I?"text-[64px]":"text-[86px]"),children:W}):v==="glyph"&&E?e0.jsx(E.Icon,{stroke:1.5,className:s(I?"size-14 text-white":"size-18 text-foreground")}):e0.jsx("img",{src:c,alt:"",className:"size-full object-cover"})}),e0.jsx("button",{type:"button",onClick:b,disabled:j,className:"text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:"Reset to default"})]}),e0.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[e0.jsx("div",{className:"flex gap-1 self-start rounded-xl bg-muted p-0.5",children:["emoji","icon","upload"].map((T)=>e0.jsx("button",{type:"button",onClick:()=>G(T),className:s("rounded-lg px-3.5 py-1 text-xs font-medium capitalize transition-colors",z===T?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:T},T))}),e0.jsxs("div",{className:s("flex items-center gap-2",z==="upload"&&"pointer-events-none opacity-35"),children:[e0.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Background"}),e0.jsxs("div",{className:"flex items-center gap-2",children:[e0.jsx("button",{type:"button","aria-label":"No background",onClick:()=>U({id:"none",gradient:null}),className:s("flex size-7 items-center justify-center rounded-full bg-muted ring-offset-2 ring-offset-card transition-shadow",F.id==="none"?"ring-2 ring-primary":"ring-1 ring-border hover:ring-muted-foreground/30"),children:e0.jsx(up,{size:16,stroke:1.75,className:"text-muted-foreground"})}),mD.map((T)=>e0.jsx("button",{type:"button","aria-label":`${T.id} background`,onClick:()=>U({id:T.id,gradient:T.gradient}),style:{background:MY(T.gradient)},className:s("size-7 rounded-full ring-offset-2 ring-offset-card transition-shadow",F.id===T.id?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30")},T.id)),e0.jsx("button",{type:"button","aria-label":"Random background",title:"Surprise me",onClick:S,style:Y?{background:MY(Y)}:void 0,className:s("flex size-7 items-center justify-center rounded-full ring-offset-2 ring-offset-card transition-shadow",Y?"text-white":"bg-muted text-muted-foreground ring-1 ring-border",F.id==="shuffle"?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30"),children:e0.jsx(pp,{size:16,stroke:1.75})})]})]}),z==="emoji"?e0.jsxs(n9.Root,{onEmojiSelect:(T)=>N(T.emoji),emojibaseUrl:"/vendor/emojibase",columns:13,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[e0.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[e0.jsx(n9.Search,{placeholder:"Search emoji…",onChange:(T)=>V(T.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-lg bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),e0.jsx(n9.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),e0.jsxs(n9.Viewport,{className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[e0.jsxs(n9.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[e0.jsx(I5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),L.trim()===""&&e0.jsxs("div",{className:"border-b border-dashed border-border pb-1.5",children:[e0.jsx("p",{className:"px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:"Favorites"}),e0.jsx("div",{className:"grid grid-cols-13 justify-items-start px-1.5",children:mp.map((T)=>e0.jsx("button",{type:"button",onClick:()=>N(T),className:s("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75",PY,W===T?"bg-primary/10":"hover:bg-accent"),children:T},T))})]}),e0.jsxs(n9.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[e0.jsx(cp,{size:20,stroke:1.5}),"No emoji found"]}),e0.jsx(n9.List,{className:"pb-1.5 select-none",components:{CategoryHeader:$J0,Row:ZJ0,Emoji:HJ0}})]})]}):z==="icon"?e0.jsx("div",{className:"grid scrollbar-thin h-72 grid-cols-[repeat(auto-fill,minmax(2.25rem,1fr))] content-start gap-1 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:gD.map(({id:T,Icon:e})=>e0.jsx("button",{type:"button","aria-label":T,onClick:()=>D(T),className:s("flex aspect-square items-center justify-center rounded-xl text-muted-foreground transition-colors [&_svg]:size-5",A===T?"bg-primary/10 text-primary":"hover:bg-accent hover:text-accent-foreground"),children:e0.jsx(e,{stroke:1.5})},T))}):e0.jsxs("button",{type:"button",onClick:()=>y.current?.click(),onDragOver:(T)=>{T.preventDefault(),P(!0)},onDragLeave:()=>P(!1),onDrop:(T)=>{T.preventDefault(),P(!1);let e=T.dataTransfer.files?.[0];if(e)k(e)},className:s("flex h-72 flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",M?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[e0.jsx(dp,{size:24,stroke:1.5}),e0.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),e0.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]}),e0.jsx("div",{className:"min-h-4","aria-live":"polite",children:C?e0.jsx("p",{className:"text-xs text-destructive",children:C}):j?e0.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving…"}):null})]}),e0.jsx("input",{ref:y,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(T)=>{let e=T.target.files?.[0];if(e)k(e);T.target.value=""}}),e0.jsx("span",{ref:w,"aria-hidden":!0,className:"hidden",children:E&&e0.jsx(E.Icon,{stroke:1.5})})]})}var M2=O(d(),1);function rp(){let{cloudDemo:$}=J9(),{name:Z,icon:H,cwd:B,workspaceId:J}=K5(),[,Q]=u4(),X=vf(J),z=FO(),[G,F]=ip.useState(Z??"");return M2.jsxs(iZ,{title:"General",description:"Basic details for this space.",children:[M2.jsxs(rZ,{children:[M2.jsx(aZ,{title:"Name",description:"Shown in the sidebar and the workspace header.",control:M2.jsx(L3,{value:G,onChange:(K)=>F(K.target.value),onBlur:()=>{let K=G.trim();if(K===(Z??""))return;X.mutate(K===""?null:K)},onKeyDown:(K)=>{if(K.key==="Enter")K.currentTarget.blur()},placeholder:"Space name",className:"w-56"})}),M2.jsx(aZ,{title:"Path",control:M2.jsx(L3,{value:B??"",readOnly:!0,"aria-label":"Workspace path",title:B??void 0,className:"w-56"})}),M2.jsxs("div",{className:"flex flex-col gap-4 px-3.5 py-3.5",children:[M2.jsxs("div",{className:"flex flex-col",children:[M2.jsx("span",{className:"text-sm font-medium",children:"Icon"}),M2.jsx("span",{className:"text-xs text-muted-foreground",children:"Pick an emoji or a glyph on a generated background, or upload an image."})]}),M2.jsx(lp,{icon:H})]})]}),!$&&M2.jsxs(rZ,{label:"Danger zone",children:[M2.jsx(aZ,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:M2.jsxs(T0,{type:"button",variant:"destructive",size:"sm",onClick:()=>{let W=`Remove "${Z??B??"this space"}" from your workspaces?
81
-
82
- This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time.`;if(!window.confirm(W))return;z.mutate(J,{onSuccess:()=>Q("/")})},disabled:z.isPending,children:[z.isPending&&M2.jsx(I5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})}),z.isError&&M2.jsx("p",{className:"px-3.5 py-3 text-xs text-destructive",children:z.error.message})]})]})}var V5=O(d(),1),BJ0=[{id:"general",label:"General",icon:cJ},{id:"connectors",label:"Connectors",icon:KY},{id:"environment",label:"Environment",icon:DY}];function ap(){let[$,Z]=pD.useState(!1),[H,B]=pD.useState("general");return V5.jsxs(V5.Fragment,{children:[V5.jsxs(y1,{children:[V5.jsx(h1,{render:V5.jsx(T0,{variant:"ghost",size:"icon-sm","aria-label":"Settings",onClick:()=>Z(!0),children:V5.jsx(cJ,{stroke:1.75})})}),V5.jsx(x1,{children:"Settings"})]}),V5.jsx(K3,{open:$,onOpenChange:Z,children:V5.jsxs(L$,{className:"flex h-[min(680px,90vh)] w-[880px] max-w-[94vw]",children:[V5.jsx(W3,{className:"sr-only",children:"Space settings"}),V5.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r border-border bg-muted/30 p-3",children:[V5.jsx("p",{className:"px-2.5 pt-4 pb-2 text-[11px] font-semibold tracking-wider text-muted-foreground/80 uppercase",children:"Settings"}),BJ0.map((J)=>V5.jsxs(T0,{type:"button",variant:H===J.id?"secondary":"ghost",size:"sm",onClick:()=>B(J.id),className:"justify-start",children:[V5.jsx(J.icon,{stroke:1.75}),J.label]},J.id))]}),V5.jsxs("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:[V5.jsxs("div",{className:"px-8 py-7",children:[H==="general"&&V5.jsx(rp,{}),H==="connectors"&&V5.jsx(wf,{}),H==="environment"&&V5.jsx(uf,{})]}),V5.jsx(N$,{render:V5.jsx(T0,{variant:"ghost",size:"icon","aria-label":"Close",className:"absolute top-3 right-3",children:V5.jsx(S5,{stroke:1.5})})})]})]})})]})}function JJ0($){if($.status==="available")return null;if($.status==="checking")return"this workspace's agent availability has not resolved yet";if($.status==="disconnected")return"this workspace is disconnected from moi";if($.status==="login-required")return"this workspace's agent needs a login";return"this workspace's agent is unavailable"}function np({send:$,revealChat:Z,agentAvailability:H}){let B=H5();VG(B,"sendChatMessage",(J)=>{let Q=JJ0(H);if(Q){q8(B,{source:"runtime",message:`sendChatMessage("${J.message}") was dropped: ${Q}.`});return}let{message:X,...z}=J;Z(),$(X,{applet:z})})}var G6=O(g(),1);var Zu=O(g(),1);function _Y($,Z){let H=$??[];if(H.findIndex((J)=>J.id===Z.id)===-1)return[...H,Z];return H.map((J)=>J.id===Z.id&&J.updatedAt<=Z.updatedAt?Z:J)}function OY($){let Z=Z1();return B2((H)=>{if(H.type==="view-builder:updated"&&H.workspaceId===$)Z.setQueryData(w0.viewBuilders($),(B)=>_Y(B,H.builder));else if(H.type==="view-builder:deleted"&&H.workspaceId===$)Z.setQueryData(w0.viewBuilders($),(B)=>(B??[]).filter((J)=>J.id!==H.builderId))}),o1({queryKey:w0.viewBuilders($),queryFn:async()=>{return(await V1(`/api/workspaces/${$}/view-builders`)).builders},...y4})}function op($){let Z=Z1();return s1({mutationFn:()=>V1(`/api/workspaces/${$}/view-builders`,n5("POST"),"Failed to create view builder"),onSuccess:(H)=>{Z.setQueryData(w0.viewBuilders($),(B)=>_Y(B,H))}})}function sp($){let Z=Z1();return s1({mutationFn:({builderId:H,requirements:B})=>V1(`/api/workspaces/${$}/view-builders/${H}`,n5("PATCH",{input:{requirements:B}}),"Failed to save view requirements"),onSuccess:(H)=>{Z.setQueryData(w0.viewBuilders($),(B)=>_Y(B,H))}})}function tp($){let Z=Z1();return s1({mutationFn:({builderId:H,requirements:B,...J})=>V1(`/api/workspaces/${$}/view-builders/${H}/submit`,n5("POST",{input:{requirements:B},availableIcons:uJ,...J}),"Failed to start view builder"),onSuccess:(H)=>{Z.setQueryData(w0.viewBuilders($),(B)=>_Y(B,H))}})}function ep($){let Z=Z1();return s1({mutationFn:(H)=>S4(`/api/workspaces/${$}/view-builders/${H}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:(H,B)=>{Z.setQueryData(w0.viewBuilders($),(J)=>(J??[]).filter((Q)=>Q.id!==B))}})}var $u=new Map;function QJ0($){let Z=$u.get($)??[];return $u.delete($),Z}function XJ0($,Z=[]){return[...QJ0($),...Z]}function zJ0($,Z){if(!$.startsWith("view:"))return;return Object.keys(Z).length>0?Z:void 0}function GJ0($,Z,H){if($.startsWith("view:"))return Z?.find((B)=>B.id===$.slice(5))?.config.title||void 0;if($.startsWith("view-builder:"))return H?.find((B)=>B.id===$.slice(13))?.title||void 0;return}function Hu({activeTab:$,appletParams:Z}){let H=H5(),B=_G(H).data,J=OY(H).data;return Zu.useCallback((Q={})=>{let X=XJ0(H,Q.directives??[]),z=zJ0($,Z);return{activeTab:$,tabTitle:GJ0($,B,J),...z?{tabParams:z}:{},...Q.applet?{applet:Q.applet}:{},...X.length>0?{directives:X}:{}}},[H,$,Z,B,J])}var Bu=!0;function Ju($,Z=[]){return($.trim()||Z.filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,64).trimEnd()}function jY($){return!$?.applet}function TY($,Z,H){if(!jY(H))return[];return(E1.getState().attachments[e2($,Z)]??[]).filter((J)=>J.status==="ready"&&J.upload)}function CY($){return $.map((Z)=>{if(Z.upload?.kind==="image"&&Z.previewUrl)return{type:"file",mediaType:Z.mediaType,url:Z.previewUrl,filename:Z.name};return{type:"file",mediaType:Z.mediaType,url:"",filename:Z.name}})}function Qu($,Z){if(!jY($))return $;let H=[],B=[],J=0;for(let X of Z){if(X.upload?.kind!=="image")continue;if(J+=1,X.kind==="drawing"&&X.purpose==="annotation")H.push(`${J}. ${JSON.stringify(X.sourceTab)}`);if(X.kind==="drawing"&&X.purpose==="sketch")B.push(`${J}. ${JSON.stringify(X.sourceTab)}`)}if(H.length===0&&B.length===0)return $;let Q=[...$?.directives??[]];if(H.length>0)Q.push(`Annotation attachment sources in attachment order: ${H.join("; ")}.`);if(B.length>0)Q.push(`Sketch attachment sources in attachment order: ${B.join("; ")}. Each sketch shows the intended layout of a new view.`);return{...$,directives:Q}}function wY({queryClient:$,workspaceId:Z,sessionId:H,parts:B}){let J=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(w0.events(Z,H),(Q)=>vH(Q??xH(),{kind:"turn",turn:{id:J,role:"user",origin:{kind:"user-input"},parts:B,timestamp:new Date().toISOString()}})),E1.getState().setActivity(Z,H,"running"),E1.getState().setError(Z,H,null),J}function EY({queryClient:$,workspaceId:Z,sessionId:H,text:B,filenames:J=[]}){let Q=Ju(B,J);if(!Q)return;$.setQueryData(w0.sessions(Z),(X)=>[{sessionId:H,summary:Q,lastModified:Date.now()},...(X??[]).filter((z)=>z.sessionId!==H)])}function SY($,Z,H,B){let J=$?.models,Q=!Z||!J||J.some((U)=>U.value===Z)?Z:void 0,X=J?.find((U)=>U.value===Q),z=H&&(!X||(X.supportedEffortLevels??[]).includes(H))?H:void 0,G=B===void 0||!X||X.supportsFastMode?B:!1,F=Bu&&$?.supportsStreaming?!0:void 0;return{model:Q,effort:z,...G!==void 0?{fastMode:G}:{},stream:F}}function FJ0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function Xu($){let Z=FJ0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var UJ0=xH();function zu($){let Z=H5(),H=Z1(),{layout:B}=K5(),[J,Q]=U3(),X=N9(Z).data,z=hG(Z).data,G=Boolean(J)&&z!==void 0&&!z.some((C)=>C.sessionId===J),F=G?null:J??null;G6.useEffect(()=>{if(G)Q(null)},[Q,G]);let U=Hu($),Y=_2((C)=>F?C.activity[`${Z}:${F}`]??"idle":"idle"),K=G$(Y),W=_2((C)=>F?C.errors[`${Z}:${F}`]??null:null),N=zS(Z,F),L=N.data??UJ0,V=z!==void 0&&(F===null||N.data!==void 0),A=_2((C)=>l_(C.previews,Z,F).root),D=G6.useMemo(()=>Xu(A),[A]),q=xG(Z,F).data,_=G6.useCallback((C,R)=>{let y=C.trim(),w=TY(Z,F,R);if(!y&&w.length===0)return;let h=F,E=!1;if(!h)h=crypto.randomUUID(),E=!0,Q(h),EY({queryClient:H,workspaceId:Z,sessionId:h,text:y,filenames:w.map((Z0)=>Z0.name)});let I=CY(w);if(y)I.push({type:"text",text:y});let j=wY({queryClient:H,workspaceId:Z,sessionId:h,parts:I}),S=q?.model??B.selectedModel,k=q?.effort??B.selectedEffort,b=q?.fastMode??B.selectedFastMode,{model:v,effort:c,fastMode:T,stream:e}=SY(X,S,k,b);if(jX({type:"chat",workspaceId:Z,content:y,sessionId:h,isNew:E,optimisticId:j,model:v,effort:c,fastMode:T,stream:e,context:U(Qu(R,w)),...w.length>0?{attachments:w.map((Z0)=>Z0.upload.id)}:{}}),j5.getState().markMessageSentFromMoi(Z),E)H.invalidateQueries({queryKey:w0.preview(Z)});if(jY(R))E1.getState().clearAttachments(Z,F)},[F,Z,H,B.selectedModel,B.selectedEffort,B.selectedFastMode,U,q?.model,q?.effort,q?.fastMode,Q,X]),M=G6.useCallback(()=>{if(!F)return;E1.getState().setError(Z,F,null)},[F,Z]),P=G6.useCallback(()=>{if(!K||!F)return;jX({type:"stop",workspaceId:Z,sessionId:F})},[K,F,Z]);return{view:L,chatLoaded:V,previewTurn:D,sessionId:F,processing:K,error:W,send:_,stop:P,selectSession:Q,dismissError:M}}var Fu=O(g(),1);var F2=O(g(),1);function Gu({active:$,builderId:Z,sessionId:H,sourceTab:B,workspaceId:J,onEditingStart:Q,onContinueInChat:X}){let z=F2.useRef(`sketch:${Z}`),G=F2.useRef(0),F=F2.useRef(null),U=F2.useRef(null),Y=F2.useRef(!0),[K,W]=F2.useState(!1),N=F2.useRef(Q),L=F2.useRef(X);N.current=Q,L.current=X;let V=F2.useCallback((R)=>{if(!Y.current)return;if(!R){G.current+=1,F.current=null,U.current=null,E1.getState().removeAttachment(J,H,z.current);return}wG({workspaceId:J,sessionId:H,localId:z.current,purpose:"sketch",sourceTab:B,blob:R})},[H,B,J]),A=F2.useCallback((R)=>{if(!R)return U.current??Promise.resolve();if(R===F.current){if(E1.getState().attachments[e2(J,H)]?.some((E)=>E.localId===z.current&&(E.status==="ready"||E.status==="uploading")))return U.current??Promise.resolve()}F.current=R;let y=++G.current,w=EG({workspaceId:J,sessionId:H,localId:z.current,purpose:"sketch",sourceTab:B,blob:R,isCurrent:()=>G.current===y});return U.current=w,w},[H,B,J]),D=TG({mode:"sketch",onChange:V,onEditingStart:()=>N.current()}),{controls:q}=D,_=F2.useCallback(async()=>{await A(await q.flush())},[q,A]),M=F2.useCallback(async()=>{await A(await q.deactivate())},[q,A]),P=F2.useCallback(async()=>{if(K)return;W(!0);try{await M(),L.current()}finally{W(!1)}},[K,M]),C=F2.useCallback(async()=>{Y.current=!1,G.current+=1,F.current=null,U.current=null,E1.getState().removeAttachment(J,H,z.current);try{await q.cancel()}finally{Y.current=!0}},[q,H,J]);return F2.useEffect(()=>{if(!$&&q.active)M()},[$,q.active,M]),{...D,continuing:K,continueInChat:P,prepareForSend:_,resetDocument:C}}var W5=O(d(),1);function Uu({ref:$,active:Z,builder:H,chatDocked:B,workspaceId:J,onEditingStart:Q,onContinueInChat:X,onOpenChat:z,onDiscard:G}){let F=Gu({active:Z&&H.status==="draft",builderId:H.id,sessionId:H.sessionId,sourceTab:b3(H.id),workspaceId:J,onEditingStart:Q,onContinueInChat:X});switch(Fu.useImperativeHandle($,()=>({prepareSketchForSend:F.prepareForSend,resetSketch:F.resetDocument}),[F.prepareForSend,F.resetDocument]),H.status){case"ready":return null;case"draft":case"waiting":case"building":return W5.jsx(YJ0,{active:Z,chatDocked:B,error:H.error,sketch:F,status:H.status,onDiscard:G,onOpenChat:z})}}function YJ0({active:$,chatDocked:Z,error:H,sketch:B,status:J,onDiscard:Q,onOpenChat:X}){let z=J==="draft";return W5.jsxs("div",{className:s("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[z&&W5.jsx(KJ0,{chatDocked:Z,sketch:B}),W5.jsx("div",{inert:z?void 0:!0,className:s("absolute inset-0",J==="building"&&"pointer-events-none opacity-50",J==="waiting"&&"invisible"),children:W5.jsx(OG,{...B.layerProps,children:z&&W5.jsx(CG,{controls:B.controls,title:"Sketch the view",busy:B.continuing,onComplete:()=>void B.continueInChat()})})}),W5.jsx("div",{"aria-hidden":!0,className:s("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",J==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),J==="building"&&W5.jsx(NJ0,{controls:B.controls}),J==="waiting"&&W5.jsx(WJ0,{error:H,onDiscard:Q,onOpenChat:X})]})}function KJ0({chatDocked:$,sketch:Z}){let{hasStrokes:H}=kB(Z.controls);return W5.jsx("div",{ref:Z.targetRef,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:!Z.controls.active&&!H&&W5.jsxs("div",{className:s("mb-4 flex h-full flex-col items-center justify-center gap-2 p-12 text-center text-sm text-muted-foreground","bg-radial from-background from-10% to-transparent",$?"w-full":"mr-auto w-[calc(100%-var(--chat-max))]"),children:[W5.jsx(cB,{size:56,stroke:0.5}),W5.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function WJ0({error:$,onDiscard:Z,onOpenChat:H}){return W5.jsx(Yu,{children:W5.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-12 text-center",children:[W5.jsxs("div",{className:"flex flex-col gap-1",children:[W5.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),W5.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),W5.jsxs("div",{className:"flex gap-2",children:[W5.jsx(T0,{onClick:H,children:"Open chat"}),W5.jsx(T0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function NJ0({controls:$}){let{hasStrokes:Z}=kB($);return W5.jsx(Yu,{children:!Z&&W5.jsx(I4,{className:"size-6 text-muted-foreground"})})}function Yu({children:$,className:Z}){return W5.jsx("div",{className:s("relative flex min-h-0 flex-1 items-center justify-center texture-checker-20",Z),children:$})}var i2=O(g(),1);function Ku($,{activeId:Z,available:H,now:B}){let J=[];if(Z!==null&&H.has(Z))J.push({id:Z,releasedAt:null});for(let Q of $){if(Q.id===Z||!H.has(Q.id))continue;let X=Q.releasedAt??B;if(B-X>=60000)continue;if(J.length>=4)break;J.push({id:Q.id,releasedAt:X})}return J}function Wu($,Z){let H=null;for(let{releasedAt:B}of $){if(B===null)continue;let J=B+60000;if(H===null||J<H)H=J}return H===null?null:Math.max(0,H-Z)}function Nu($,Z){return $.length===Z.length&&$.every((H,B)=>{let J=Z[B];return H.id===J.id&&H.releasedAt===J.releasedAt})}var C2=O(d(),1),Au=i2.memo(function({views:Z,activeViewId:H,params:B}){let J=LJ0(H,Z),Q=new Set(J.map((X)=>X.id));return C2.jsx("div",{className:s("relative min-h-0 flex-1 overflow-hidden",!H&&"hidden"),children:Z.filter((X)=>Q.has(X.id)).map((X)=>C2.jsx(AJ0,{view:X,active:X.id===H,params:B},X.id))})});function LJ0($,Z){let[H,B]=i2.useState([]),J=i2.useRef(Z);J.current=Z;let Q=Z.map((z)=>z.id).join(`
83
- `),X=i2.useCallback(()=>{B((z)=>{let G=Ku(z,{activeId:$,available:new Set(J.current.map((F)=>F.id)),now:Date.now()});return Nu(z,G)?z:G})},[$]);return i2.useEffect(()=>{X()},[Q,X]),i2.useEffect(()=>{let z=Wu(H,Date.now());if(z===null)return;let G=setTimeout(X,z);return()=>clearTimeout(G)},[X,H]),H}function AJ0({view:$,active:Z,params:H}){let B=H5(),J=BE($.id),{current:Q,outgoing:X}=DJ0(J,Z),[z,G]=i2.useState(H);if(Z&&z!==H)G(H);rU(qG("views",B,$.id),Q?.version??J.version,Z);let F=J.status==="error";return lU({kind:"view",enabled:Z&&Boolean(Q)&&!F,targets:[{id:$.id,revision:$.revision}]}),C2.jsxs(C2.Fragment,{children:[Z&&F&&C2.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:J.error}),Z&&!F&&!Q&&C2.jsx(qJ0,{}),Q&&!F&&C2.jsxs(i2.Activity,{mode:Z?"visible":"hidden",children:[X&&C2.jsx(Lu,{view:$,build:X,params:z},X.version),C2.jsx(Lu,{view:$,build:Q,params:z,entering:X!==null,thumbnailTarget:!0},Q.version)]})]})}function Lu({view:$,build:Z,params:H,entering:B,thumbnailTarget:J}){let Q=H5();return C2.jsx("div",{"data-applet-thumbnail":J?`view:${$.id}`:void 0,"data-applet":MG("views",$.id),className:s("absolute inset-0 isolate overflow-auto",B&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:C2.jsx(jJ,{name:$.id,kind:"view",workspaceId:Q,resetKey:Z.version,children:C2.jsx(Z.Component,{params:H})})})}var VJ0=200;function DJ0($,Z){let[H,B]=i2.useState({current:null,outgoing:null});if($.status==="ready"&&H.current?.version!==$.version){let J={Component:$.Component,version:$.version};B((Q)=>({current:J,outgoing:Z?Q.current:null}))}return i2.useEffect(()=>{if(!H.outgoing)return;let J=setTimeout(()=>B((Q)=>({...Q,outgoing:null})),VJ0);return()=>clearTimeout(J)},[H.outgoing]),H}function qJ0(){return C2.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:C2.jsx(I4,{className:"text-muted-foreground"})})}function Vu(){let $=Z1(),{workspaceId:Z,layout:H}=K5(),[,B]=U3(),J=N9(Z).data,Q=op(Z),X=sp(Z),z=tp(Z),G=ep(Z);return{create:()=>Q.mutateAsync(),save:(W,N)=>X.mutateAsync({builderId:W,requirements:N}),submit:async(W,N)=>{let L=N.trim(),V=TY(Z,W.sessionId);if(!L&&V.length===0)return;EY({queryClient:$,workspaceId:Z,sessionId:W.sessionId,text:L,filenames:V.map((C)=>C.name)});let A=CY(V);if(L)A.push({type:"text",text:L});let D=wY({queryClient:$,workspaceId:Z,sessionId:W.sessionId,parts:A});B(W.sessionId);let{model:q,effort:_,fastMode:M,stream:P}=SY(J,H.selectedModel,H.selectedEffort,H.selectedFastMode);try{await z.mutateAsync({builderId:W.id,requirements:L,optimisticId:D,...V.length>0?{attachments:V.map((C)=>C.upload.id)}:{},model:q,effort:_,fastMode:M,stream:P}),E1.getState().clearAttachments(Z,W.sessionId)}catch(C){throw E1.getState().setActivity(Z,W.sessionId,"idle"),E1.getState().setError(Z,W.sessionId,C instanceof Error?C.message:"Could not start view builder"),C}},discard:(W)=>G.mutateAsync(W)}}var T9=O(g(),1);function Du({builders:$,onSave:Z}){let H=T9.useRef(new Map),B=T9.useRef($),J=T9.useRef(Z);B.current=$,J.current=Z;let Q=T9.useCallback((z)=>{let G=H.current.get(z);if(G)clearTimeout(G);H.current.delete(z),j5.getState().setViewBuilderDraft(z,null)},[]),X=T9.useCallback((z,G)=>{j5.getState().setViewBuilderDraft(z,G);let F=H.current.get(z);if(F)clearTimeout(F);H.current.set(z,setTimeout(()=>{H.current.delete(z);let U=B.current.find((Y)=>Y.id===z);if(!U||U.status!=="draft")return;J.current(z,G).catch(()=>{a4.add({title:"Couldn’t save view description",type:"error"})})},500))},[]);return T9.useEffect(()=>{for(let z of $)if(z.status!=="draft")Q(z.id)},[$,Q]),T9.useEffect(()=>()=>{for(let z of H.current.values())clearTimeout(z)},[]),{change:X,clear:Q}}var oZ=O(g(),1);function uD($){let Z=document.documentElement,H=getComputedStyle(Z).getPropertyValue($).trim(),B=Number.parseFloat(H);if(!Number.isFinite(B))return 0;return H.endsWith("rem")?B*Number.parseFloat(getComputedStyle(Z).fontSize):B}function qu(){let $=oZ.useRef(null),[Z,H]=oZ.useState(null);return oZ.useLayoutEffect(()=>{let B=$.current;if(!B)return;let J=(X)=>{let z=uD("--column-w"),G=uD("--chat-min"),F=uD("--chat-max"),U={fits:X-G>=z,workspaceMinWidth:z,chatMinWidth:G,chatMaxWidth:F};H((Y)=>Y?.fits===U.fits&&Y.workspaceMinWidth===U.workspaceMinWidth&&Y.chatMinWidth===U.chatMinWidth&&Y.chatMaxWidth===U.chatMaxWidth?Y:U)};J(B.getBoundingClientRect().width);let Q=()=>J(B.getBoundingClientRect().width);return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}function Mu($,Z){if(Z)return{status:"disconnected"};return $??{status:"checking"}}var Pu=O(d(),1);function cD({agentUnavailable:$,chatError:Z,skillUpdate:H}){return $??Z??H}function F6({className:$,...Z}){return Pu.jsx("div",{...Z,className:s("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var sZ=O(d(),1);function _u({error:$,onDismiss:Z}){return sZ.jsxs(F6,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[sZ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),sZ.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:sZ.jsx(S5,{stroke:1.75})})]})}var dD=O(g(),1);var z4=O(d(),1);function wu({availability:$,login:Z,onStartLogin:H}){switch($.status){case"login-required":return z4.jsx(MJ0,{login:Z,onStartLogin:H});case"disconnected":return z4.jsx(Ou,{icon:Cu,children:"Reconnecting to moi…"});case"unavailable":return z4.jsx(Ou,{icon:ju,children:$.reason})}}function MJ0({login:$,onStartLogin:Z}){let[H,B]=dD.useState(!1),[J,Q]=dD.useState(null),X=$?.state==="failed"?$.reason:null,z=J??X,G=async()=>{let F=window.open("about:blank","moi-agent-login");if(F)F.opener=null;B(!0),Q(null);try{let U=await Z();if(U.url){if(!F)throw Error("Allow pop-ups, then try again");F.location.href=U.url}else F?.close()}catch(U){F?.close(),Q(U instanceof Error?U.message:"Could not start sign-in")}finally{B(!1)}};return z4.jsxs(F6,{role:"alert",className:"flex items-center gap-2",children:[z4.jsx(Tu,{size:20,stroke:1.5}),z4.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[z4.jsx("div",{className:"wrap-break-word",children:"Log in to your agent to send messages"}),z&&z4.jsx("div",{className:"wrap-break-word text-destructive",children:z})]}),z4.jsxs(T0,{type:"button",size:"sm",onClick:()=>void G(),disabled:H,children:[H&&z4.jsx(I5,{stroke:1.75,className:"animate-spin"}),"Log in"]})]})}function Ou({icon:$,children:Z}){return z4.jsxs(F6,{role:"alert",className:"flex items-center gap-2",children:[z4.jsx($,{size:20,stroke:1.5}),z4.jsx("div",{className:"min-w-0 flex-1 wrap-break-word",children:Z})]})}var w2=O(d(),1);function Su({error:$,pendingAction:Z,onUpdate:H,onDismiss:B}){if(!$&&Z==="auto")return w2.jsxs(F6,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[w2.jsx(I5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),w2.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let J=Z!==null;return w2.jsxs(F6,{role:$?"alert":"status",className:s("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[w2.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[w2.jsx(Eu,{size:20,stroke:1.5,className:"shrink-0"}),$?w2.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):w2.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),w2.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm",onClick:B,className:"col-start-2 row-start-1 -mt-1 -mr-1 text-muted-foreground hover:text-foreground @xl:order-4 @xl:m-0","aria-label":"Dismiss skill update",children:w2.jsx(S5,{stroke:1.75})}),w2.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[w2.jsxs(T0,{type:"button",variant:"default",size:"sm",onClick:()=>H("auto"),disabled:J,className:"@xl:order-2",children:[Z==="auto"&&w2.jsx(I5,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),w2.jsxs(T0,{type:"button",variant:"secondary",size:"sm",onClick:()=>H("once"),disabled:J,className:"@xl:order-3",children:[Z==="once"&&w2.jsx(I5,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var U6=O(g(),1);function lD($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function PJ0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function _J0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function Iu($){let Z=FE($),{isPending:H,mutate:B,reset:J}=UE($),Q=bf(),{mutate:X}=yf(),z=Q.data!==void 0,G=Q.data?.autoUpdateSkills??!1,F=U6.useCallback(()=>X({autoUpdateSkills:!0}),[X]),[U,Y]=U6.useState(()=>lD($)),K=U.workspaceId===$?U:lD($);U6.useEffect(()=>{Y(lD($)),J()},[$,J]);let W=U6.useCallback((V)=>{if(H)return;if(V==="auto")F();Y({workspaceId:$,phase:"active",pendingAction:V,error:null}),B(void 0,{onSuccess:()=>{Y((A)=>A.workspaceId===$?{...A,phase:"dismissed",pendingAction:null,error:null}:A)},onError:(A)=>{Y((D)=>D.workspaceId===$&&D.phase!=="dismissed"?{...D,phase:"active",pendingAction:null,error:A.message}:D)}})},[F,H,B,$]),N=Z.data?.updateAvailable??!1;return U6.useEffect(()=>{if(z&&_J0({updateAvailable:N,autoUpdateEnabled:G,updatePending:H,phase:K.phase}))W("auto")},[G,K.phase,W,z,N,H]),{bannerProps:z&&PJ0({updateAvailable:N,autoUpdateEnabled:G,phase:K.phase})?{error:K.error,pendingAction:K.pendingAction,onUpdate:W,onDismiss:()=>{Y((V)=>V.workspaceId===$?{...V,phase:"dismissed",pendingAction:null,error:null}:V)}}:null}}var IY=O(d(),1);function Ru($,{chatError:Z,onDismissChatError:H}){let{data:B,error:J}=N9($),Q=B?.availability,{bannerProps:X}=Iu($),z=Mu(Q,Boolean(J)),G=z.status==="checking"||z.status==="available"?void 0:z,F=G?{tone:"default",content:IY.jsx(wu,{availability:G,login:B?.login,onStartLogin:()=>GE($)})}:void 0,U=Z?{tone:"error",content:IY.jsx(_u,{error:Z,onDismiss:H})}:void 0,Y=X?{tone:"default",content:IY.jsx(Su,{...X})}:void 0,K=cD({agentUnavailable:F,chatError:U,skillUpdate:Y}),W=cD({agentUnavailable:F,skillUpdate:Y});return{agentAvailability:z,composerBanner:K,builderComposerBanner:W}}var iD=cN();function RY($){if(!$||!Array.isArray($.open))return iD;let Z=$.open.filter((H,B,J)=>J.indexOf(H)===B);if(Z.length===0)return iD;return{open:Z,active:Z.includes($.active)?$.active:Z[0]}}function dJ($,Z,H){if($==="agent"||$==="widgets"||$==="scratchpad")return!0;let B=Q7($);if(B)return H.some((Q)=>Q.id===B);let J=k3($);return J?Z.some((Q)=>Q.id===J):!1}function kY($,Z,H){let B=$.open.filter((J)=>dJ(J,Z,H));return B.length>0?B:iD.open}function ku($){if(!$)return!1;let Z=SB($);return Z===null||k3(Z)!==null}function bu($,Z,H,B,J){if($!==null&&dJ($,H,B)&&!(J&&$==="agent"))return $;let Q=kY(Z,H,B),X=J?Q.filter((z)=>z!=="agent"):Q;return X.includes(Z.active)?Z.active:X[0]??"agent"}var C9=O(g(),1);function yu({views:$,builders:Z,split:H}){let{layout:B,setLayout:J,workspaceId:Q}=K5(),[,X]=u4(),z=XK()["*"]??null,G=aq(),F=C9.useMemo(()=>yw(G),[G]),U=RY(B.tabs),Y=C9.useRef(U);Y.current=U;let K=SB(z),W=bu(K,U,$,Z,H),N=K!==null&&K===W,L=C9.useCallback((A,D)=>{X(YG(Q,A),{replace:!0,...D?{state:{appletParams:D}}:{}})},[X,Q]),V=C9.useCallback((A)=>{Y.current=A,J({tabs:A})},[J]);return C9.useEffect(()=>{if(z===W)return;if(ku(z))OJ0(Q,z,W);L(W)},[W,L,z,Q]),C9.useEffect(()=>{if(!N)return;let A=Y.current,D=A.open.includes(W)?A.open:[...A.open,W];if(D===A.open&&A.active===W)return;V({open:D,active:W})},[W,V,N]),{tabsState:U,activeTab:W,appletParams:F,navigateToTab:L,setTabs:V}}function OJ0($,Z,H){let B=SB(Z),J=B?k3(B):null;q8($,{source:"runtime",...J?{kind:"view",name:J}:{},message:`Tab "${Z}" does not exist in this workspace — the URL redirected to "${H}". A link, bookmark, or focusTab call is pointing at a tab that was deleted or renamed.`})}var D5=O(d(),1),jJ0=xu([l6({variant:"ghost",size:"sm"}),"group/tab min-w-0"],{variants:{active:{true:"bg-accent text-accent-foreground"},dragging:{true:"invisible"},preview:{true:"cursor-grabbing ring-1 ring-border"}},compoundVariants:[{preview:!0}]});function TJ0({items:$}){return D5.jsxs($Z,{children:[D5.jsx(ZZ,{render:D5.jsx(T0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:D5.jsx(N4,{stroke:1.75})})}),D5.jsx(HZ,{align:"start",className:"min-w-48",children:D5.jsx(BZ,{children:$.map((Z)=>D5.jsxs(vB,{onClick:Z.onClick,className:"font-medium",children:[D5.jsx(Z.Icon,{stroke:2}),Z.label]},Z.key))})})]})}function hu($){let{tab:Z,active:H}=$,B=$.preview===!0;return D5.jsxs("button",{type:"button","aria-hidden":B||void 0,"aria-label":Z.label,disabled:B,tabIndex:B?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:jJ0({active:H,dragging:$.preview?!1:$.state.isDragging,preview:B}),...$.preview?{}:$.state.dragHandleProps,children:[D5.jsxs("div",{className:s("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.loading?D5.jsx(I4,{"data-icon":"inline-start"}):D5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2}),D5.jsx("span",{className:s("truncate",Z.closable&&"group-hover/tab:-mr-3 group-hover/tab:mask-r-from-[calc(100%-24px)] group-hover/tab:mask-r-to-[calc(100%-12px)]"),children:Z.label})]}),Z.closable&&D5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:B?-1:void 0,className:s("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",B&&"pointer-events-none"),onClick:$.preview?void 0:(J)=>{J.stopPropagation(),$.onClose(Z.key)},children:D5.jsx(S5,{stroke:1.75})})]})}function vu({tabs:$,active:Z,createItems:H,onSelect:B,onClose:J,onReorder:Q}){return D5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[D5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:D5.jsx(Yz,{items:$,getId:(X)=>X.key,className:"flex w-max items-center gap-1",onReorder:(X)=>Q(X),renderPlaceholder:()=>D5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(X)=>D5.jsx(hu,{tab:X,active:Z===X.key,preview:!0}),renderItem:(X,z)=>D5.jsx(hu,{tab:X,active:Z===X.key,state:z,onSelect:B,onClose:J})})}),D5.jsx("div",{className:"shrink-0",children:D5.jsx(TJ0,{items:H})})]})}var W6=O(g(),1);var HH=O(d(),1),q1=O(g(),1);function CJ0($,Z){let H=getComputedStyle($),B=parseFloat(H.fontSize);return Z*B}function wJ0($,Z){let H=getComputedStyle($.ownerDocument.documentElement),B=parseFloat(H.fontSize);return Z*B}function EJ0($){return $/100*window.innerHeight}function SJ0($){return $/100*window.innerWidth}function IJ0($){switch(typeof $){case"number":return[$,"px"];case"string":{let Z=parseFloat($);return $.endsWith("%")?[Z,"%"]:$.endsWith("px")?[Z,"px"]:$.endsWith("rem")?[Z,"rem"]:$.endsWith("em")?[Z,"em"]:$.endsWith("vh")?[Z,"vh"]:$.endsWith("vw")?[Z,"vw"]:[Z,"%"]}}}function lJ({groupSize:$,panelElement:Z,styleProp:H}){let B,[J,Q]=IJ0(H);switch(Q){case"%":{B=J/100*$;break}case"px":{B=J;break}case"rem":{B=wJ0(Z,J);break}case"em":{B=CJ0(Z,J);break}case"vh":{B=EJ0(J);break}case"vw":{B=SJ0(J);break}}return B}function G4($){return parseFloat($.toFixed(3))}function BH({group:$}){let{orientation:Z,panels:H}=$;return H.reduce((B,J)=>(B+=Z==="horizontal"?J.element.offsetWidth:J.element.offsetHeight,B),0)}function aD($){let{panels:Z}=$,H=BH({group:$});return H===0?Z.map((B)=>({groupResizeBehavior:B.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:B.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:B.panelConstraints.disabled,minSize:0,maxSize:100,panelId:B.id})):Z.map((B)=>{let{element:J,panelConstraints:Q}=B,X=0;if(Q.collapsedSize!==void 0){let U=lJ({groupSize:H,panelElement:J,styleProp:Q.collapsedSize});X=G4(U/H*100)}let z;if(Q.defaultSize!==void 0){let U=lJ({groupSize:H,panelElement:J,styleProp:Q.defaultSize});z=G4(U/H*100)}let G=0;if(Q.minSize!==void 0){let U=lJ({groupSize:H,panelElement:J,styleProp:Q.minSize});G=G4(U/H*100)}let F=100;if(Q.maxSize!==void 0){let U=lJ({groupSize:H,panelElement:J,styleProp:Q.maxSize});F=G4(U/H*100)}return{groupResizeBehavior:Q.groupResizeBehavior,collapsedSize:X,collapsible:Q.collapsible===!0,defaultSize:z,disabled:Q.disabled,minSize:G,maxSize:F,panelId:B.id}})}function z5($,Z="Assertion error"){if(!$)throw Error(Z)}function nD($,Z){return Array.from(Z).sort($==="horizontal"?RJ0:kJ0)}function RJ0($,Z){let H=$.element.offsetLeft-Z.element.offsetLeft;return H!==0?H:$.element.offsetWidth-Z.element.offsetWidth}function kJ0($,Z){let H=$.element.offsetTop-Z.element.offsetTop;return H!==0?H:$.element.offsetHeight-Z.element.offsetHeight}function Zc($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function Hc($,Z){return{x:$.x>=Z.left&&$.x<=Z.right?0:Math.min(Math.abs($.x-Z.left),Math.abs($.x-Z.right)),y:$.y>=Z.top&&$.y<=Z.bottom?0:Math.min(Math.abs($.y-Z.top),Math.abs($.y-Z.bottom))}}function bJ0({orientation:$,rects:Z,targetRect:H}){let B={x:H.x+H.width/2,y:H.y+H.height/2},J,Q=Number.MAX_VALUE;for(let X of Z){let{x:z,y:G}=Hc(B,X),F=$==="horizontal"?z:G;F<Q&&(Q=F,J=X)}return z5(J,"No rect found"),J}var bY;function yJ0(){return bY===void 0&&(typeof matchMedia=="function"?bY=!!matchMedia("(pointer:coarse)").matches:bY=!1),bY}function Bc($){let{element:Z,orientation:H,panels:B,separators:J}=$,Q=nD(H,Array.from(Z.children).filter(Zc).map((N)=>({element:N}))).map(({element:N})=>N),X=[],z=!1,G=!1,F=-1,U=-1,Y=0,K,W=[];{let N=-1;for(let L of Q)L.hasAttribute("data-panel")&&(N++,L.hasAttribute("data-disabled")||(Y++,F===-1&&(F=N),U=N))}if(Y>1){let N=-1;for(let L of Q)if(L.hasAttribute("data-panel")){N++;let V=B.find((A)=>A.element===L);if(V){if(K){let A=K.element.getBoundingClientRect(),D=L.getBoundingClientRect(),q;if(G){let _=H==="horizontal"?new DOMRect(A.right,A.top,0,A.height):new DOMRect(A.left,A.bottom,A.width,0),M=H==="horizontal"?new DOMRect(D.left,D.top,0,D.height):new DOMRect(D.left,D.top,D.width,0);switch(W.length){case 0:{q=[_,M];break}case 1:{let P=W[0],C=bJ0({orientation:H,rects:[A,D],targetRect:P.element.getBoundingClientRect()});q=[P,C===A?M:_];break}default:{q=W;break}}}else W.length?q=W:q=[H==="horizontal"?new DOMRect(A.right,D.top,D.left-A.right,D.height):new DOMRect(D.left,A.bottom,D.width,D.top-A.bottom)];for(let _ of q){let M="width"in _?_:_.element.getBoundingClientRect(),P=yJ0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(M.width<P){let R=P-M.width;M=new DOMRect(M.x-R/2,M.y,M.width+R,M.height)}if(M.height<P){let R=P-M.height;M=new DOMRect(M.x,M.y-R/2,M.width,M.height+R)}let C=N<=F||N>U;!z&&!C&&X.push({group:$,groupSize:BH({group:$}),panels:[K,V],separator:"width"in _?void 0:_,rect:M}),z=!1}}G=!1,K=V,W=[]}}else if(L.hasAttribute("data-separator")){L.ariaDisabled!==null&&(z=!0);let V=J.find((A)=>A.element===L);V?W.push(V):(K=void 0,W=[])}else G=!0}return X}class oD{#$={};addListener($,Z){let H=this.#$[$];return H===void 0?this.#$[$]=[Z]:H.includes(Z)||H.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let H=this.#$[$];if(H!==void 0)if(H.length===1)H[0].call(null,Z);else{let B=!1,J=null,Q=Array.from(H);for(let X=0;X<Q.length;X++){let z=Q[X];try{z.call(null,Z)}catch(G){J===null&&(B=!0,J=G)}}if(B)throw J}}removeAllListeners(){this.#$={}}removeListener($,Z){let H=this.#$[$];if(H!==void 0){let B=H.indexOf(Z);B>=0&&H.splice(B,1)}}}var $H={cursorFlags:0,state:"inactive"},sD=new oD;function b7(){return $H}function hJ0($){return sD.addListener("change",$)}function xJ0($){let Z=$H,H={...$H};H.cursorFlags=$,$H=H,sD.emit("change",{prev:Z,next:H})}function ZH($){let Z=$H;$H=$,sD.emit("change",{prev:Z,next:$})}var vJ0=($)=>$,rD=()=>{},Jc=1,Qc=2,Xc=4,zc=8,gu=3,fu=12,yY;function mu(){return yY===void 0&&(yY=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(yY=!0)),yY}function gJ0({cursorFlags:$,groups:Z,state:H}){let B=0,J=0;switch(H){case"active":case"hover":Z.forEach((Q)=>{if(!Q.mutableState.disableCursor)switch(Q.orientation){case"horizontal":{B++;break}case"vertical":{J++;break}}})}if(!(B===0&&J===0)){switch(H){case"active":{if($&&mu()){let Q=($&Jc)!==0,X=($&Qc)!==0,z=($&Xc)!==0,G=($&zc)!==0;if(Q)return z?"se-resize":G?"ne-resize":"e-resize";if(X)return z?"sw-resize":G?"nw-resize":"w-resize";if(z)return"s-resize";if(G)return"n-resize"}break}}return mu()?B>0&&J>0?"move":B>0?"ew-resize":"ns-resize":B>0&&J>0?"grab":B>0?"col-resize":"row-resize"}}var pu=new WeakMap;function tD($){if($.defaultView===null||$.defaultView===void 0)return;let{prevStyle:Z,styleSheet:H}=pu.get($)??{};H===void 0&&(H=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(H):$.adoptedStyleSheets=[...$.adoptedStyleSheets,H]));let B=b7();switch(B.state){case"active":case"hover":{let J=gJ0({cursorFlags:B.cursorFlags,groups:B.hitRegions.map((X)=>X.group),state:B.state}),Q=`*, *:hover {cursor: ${J} !important; }`;if(Z===Q)return;Z=Q,J?H.cssRules.length===0?H.insertRule(Q):H.replaceSync(Q):H.cssRules.length===1&&H.deleteRule(0);break}case"inactive":{Z=void 0,H.cssRules.length===1&&H.deleteRule(0);break}}pu.set($,{prevStyle:Z,styleSheet:H})}var E9=new Map,Gc=new oD;function fJ0($){E9=new Map(E9),E9.delete($)}function uu($,Z){for(let[H]of E9)if(H.id===$)return H}function Y6($,Z){for(let[H,B]of E9)if(H.id===$)return B;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function x7(){return E9}function eD($,Z){return Gc.addListener("groupChange",(H)=>{H.group.id===$&&Z(H)})}function o9($,Z,H){let B=E9.get($);E9=new Map(E9),E9.set($,Z),Gc.emit("groupChange",{group:$,isUserInteraction:H?.isUserInteraction===!0,prev:B,next:Z})}function Fc($){let Z=b7(),H=!1;switch(Z.state){case"active":ZH({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(tD($),H=!0,Z.hitRegions.forEach((B)=>{let J=Y6(B.group.id,!0);o9(B.group,J,{isUserInteraction:!0})}))}return H}function cu($){$.defaultPrevented||Fc($.currentTarget)}function mJ0($,Z,H){let B,J={x:1/0,y:1/0};for(let Q of Z){let X=Hc(H,Q.rect);switch($){case"horizontal":{X.x<=J.x&&(B=Q,J=X);break}case"vertical":{X.y<=J.y&&(B=Q,J=X);break}}}return B?{distance:J,hitRegion:B}:void 0}function pJ0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function uJ0($,Z){if($===Z)throw Error("Cannot compare node with itself");let H={a:iu($),b:iu(Z)},B;for(;H.a.at(-1)===H.b.at(-1);)B=H.a.pop(),H.b.pop();z5(B,"Stacking order can only be calculated for elements with a common ancestor");let J={a:lu(du(H.a)),b:lu(du(H.b))};if(J.a===J.b){let Q=B.childNodes,X={a:H.a.at(-1),b:H.b.at(-1)},z=Q.length;for(;z--;){let G=Q[z];if(G===X.a)return 1;if(G===X.b)return-1}}return Math.sign(J.a-J.b)}var cJ0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function dJ0($){let Z=getComputedStyle(Uc($)??$).display;return Z==="flex"||Z==="inline-flex"}function lJ0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||dJ0($))||+Z.opacity<1||("transform"in Z)&&Z.transform!=="none"||("webkitTransform"in Z)&&Z.webkitTransform!=="none"||("mixBlendMode"in Z)&&Z.mixBlendMode!=="normal"||("filter"in Z)&&Z.filter!=="none"||("webkitFilter"in Z)&&Z.webkitFilter!=="none"||("isolation"in Z)&&Z.isolation==="isolate"||cJ0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function du($){let Z=$.length;for(;Z--;){let H=$[Z];if(z5(H,"Missing node"),lJ0(H))return H}return null}function lu($){return $&&Number(getComputedStyle($).zIndex)||0}function iu($){let Z=[];for(;$;)Z.push($),$=Uc($);return Z}function Uc($){let{parentNode:Z}=$;return pJ0(Z)?Z.host:Z}function iJ0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function rJ0({groupElement:$,hitRegion:Z,pointerEventTarget:H}){if(!Zc(H)||H.contains($)||$.contains(H))return!0;if(uJ0(H,$)>0){let B=H;for(;B;){if(B.contains($))return!0;if(iJ0(B.getBoundingClientRect(),Z))return!1;B=B.parentElement}}return!0}function $q($,Z){let H=[];return Z.forEach((B,J)=>{if(J.disabled)return;let Q=Bc(J),X=mJ0(J.orientation,Q,{x:$.clientX,y:$.clientY});X&&X.distance.x<=0&&X.distance.y<=0&&rJ0({groupElement:J.element,hitRegion:X.hitRegion.rect,pointerEventTarget:$.target})&&H.push(X.hitRegion)}),H}function aJ0($,Z){if($.length!==Z.length)return!1;for(let H=0;H<$.length;H++)if($[H]!=Z[H])return!1;return!0}function r2($,Z,H=0){return Math.abs(G4($)-G4(Z))<=H}function w9($,Z){return r2($,Z)?0:$>Z?1:-1}function eZ({overrideDisabledPanels:$,panelConstraints:Z,prevSize:H,size:B}){let{collapsedSize:J=0,collapsible:Q,disabled:X,maxSize:z=100,minSize:G=0}=Z;if(X&&!$)return H;if(w9(B,G)<0)if(Q){let F=(J+G)/2;w9(B,F)<0?B=J:B=G}else B=G;return B=Math.min(z,B),B=G4(B),B}function rJ({delta:$,initialLayout:Z,panelConstraints:H,pivotIndices:B,prevLayout:J,trigger:Q}){if(r2($,0))return Z;let X=Q==="imperative-api",z=Object.values(Z),G=Object.values(J),F=[...z],[U,Y]=B;z5(U!=null,"Invalid first pivot index"),z5(Y!=null,"Invalid second pivot index");let K=0;switch(Q){case"keyboard":{{let L=$<0?Y:U,V=H[L];z5(V,`Panel constraints not found for index ${L}`);let{collapsedSize:A=0,collapsible:D,minSize:q=0}=V;if(D){let _=z[L];if(z5(_!=null,`Previous layout not found for panel index ${L}`),r2(_,A)){let M=q-_;w9(M,Math.abs($))>0&&($=$<0?0-M:M)}}}{let L=$<0?U:Y,V=H[L];z5(V,`No panel constraints found for index ${L}`);let{collapsedSize:A=0,collapsible:D,minSize:q=0}=V;if(D){let _=z[L];if(z5(_!=null,`Previous layout not found for panel index ${L}`),r2(_,q)){let M=_-A;w9(M,Math.abs($))>0&&($=$<0?0-M:M)}}}break}default:{let L=$<0?Y:U,V=H[L];z5(V,`Panel constraints not found for index ${L}`);let A=z[L],{collapsible:D,collapsedSize:q,minSize:_}=V;if(D&&w9(A,_)<0)if($>0){let M=_-q,P=M/2,C=A+$;w9(C,_)<0&&($=w9($,P)<=0?0:M)}else{let M=_-q,P=100-M/2,C=A-$;w9(C,_)<0&&($=w9(100+$,P)>0?0:-M)}break}}{let L=$<0?1:-1,V=$<0?Y:U,A=0;for(;;){let q=z[V];z5(q!=null,`Previous layout not found for panel index ${V}`);let _=eZ({overrideDisabledPanels:X,panelConstraints:H[V],prevSize:q,size:100})-q;if(A+=_,V+=L,V<0||V>=H.length)break}let D=Math.min(Math.abs($),Math.abs(A));$=$<0?0-D:D}{let L=$<0?U:Y;for(;L>=0&&L<H.length;){let V=Math.abs($)-Math.abs(K),A=z[L];z5(A!=null,`Previous layout not found for panel index ${L}`);let D=A-V,q=eZ({overrideDisabledPanels:X,panelConstraints:H[L],prevSize:A,size:D});if(!r2(A,q)&&(K+=A-q,F[L]=q,K.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?L--:L++}}if(aJ0(G,F))return J;{let L=$<0?Y:U,V=z[L];z5(V!=null,`Previous layout not found for panel index ${L}`);let A=V+K,D=eZ({overrideDisabledPanels:X,panelConstraints:H[L],prevSize:V,size:A});if(F[L]=D,!r2(D,A)){let q=A-D,_=$<0?Y:U;for(;_>=0&&_<H.length;){let M=F[_];z5(M!=null,`Previous layout not found for panel index ${_}`);let P=M+q,C=eZ({overrideDisabledPanels:X,panelConstraints:H[_],prevSize:M,size:P});if(r2(M,C)||(q-=C-M,F[_]=C),r2(q,0))break;$>0?_--:_++}}}let W=Object.values(F).reduce((L,V)=>V+L,0);if(!r2(W,100,0.1))return J;let N=Object.keys(J);return F.reduce((L,V,A)=>(L[N[A]]=V,L),{})}function y7($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if(Z[H]===void 0||w9($[H],Z[H])!==0)return!1;return!0}function h7({layout:$,panelConstraints:Z}){let H=Object.values($),B=[...H],J=B.reduce((z,G)=>z+G,0);if(B.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${B.map((z)=>`${z}%`).join(", ")}`);if(!r2(J,100)&&B.length>0)for(let z=0;z<Z.length;z++){let G=B[z];z5(G!=null,`No layout data found for index ${z}`);let F=100/J*G;B[z]=F}let Q=0;for(let z=0;z<Z.length;z++){let G=H[z];z5(G!=null,`No layout data found for index ${z}`);let F=B[z];z5(F!=null,`No layout data found for index ${z}`);let U=eZ({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:F});F!=U&&(Q+=F-U,B[z]=U)}if(!r2(Q,0))for(let z=0;z<Z.length;z++){let G=B[z];z5(G!=null,`No layout data found for index ${z}`);let F=G+Q,U=eZ({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:F});if(G!==U&&(Q-=U-G,B[z]=U,r2(Q,0)))break}let X=Object.keys($);return B.reduce((z,G,F)=>(z[X[F]]=G,z),{})}function Yc({groupId:$,panelId:Z}){let H=()=>{let G=x7();for(let[F,{defaultLayoutDeferred:U,derivedPanelConstraints:Y,layout:K,groupSize:W,separatorToPanels:N}]of G)if(F.id===$)return{defaultLayoutDeferred:U,derivedPanelConstraints:Y,group:F,groupSize:W,layout:K,separatorToPanels:N};throw Error(`Group ${$} not found`)},B=()=>{let G=H().derivedPanelConstraints.find((F)=>F.panelId===Z);if(G!==void 0)return G;throw Error(`Panel constraints not found for Panel ${Z}`)},J=()=>{let G=H().group.panels.find((F)=>F.id===Z);if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},Q=()=>{let G=H().layout[Z];if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},X=({nextSize:G,panels:F,prevLayout:U,derivedPanelConstraints:Y})=>{let K=Q(),W=F.findIndex((V)=>V.id===Z),N=W===0,L=W===F.length-1;if(L&&G<K&&(N||F.slice(0,W).every((V,A)=>{let D=Y[A];return D?.collapsible&&r2(D.collapsedSize,U[D.panelId])}))){let V=F.slice(0,W).reduce((A,D)=>A+U[D.id],0);return{...U,[Z]:G4(100-V)}}return rJ({delta:L?K-G:G-K,initialLayout:U,panelConstraints:Y,pivotIndices:L?[W-1,W]:[W,W+1],prevLayout:U,trigger:"imperative-api"})},z=(G)=>{let F=Q();if(G===F)return;let{defaultLayoutDeferred:U,derivedPanelConstraints:Y,group:K,groupSize:W,layout:N,separatorToPanels:L}=H(),V=X({nextSize:G,panels:K.panels,prevLayout:N,derivedPanelConstraints:Y}),A=h7({layout:V,panelConstraints:Y});y7(N,A)||o9(K,{defaultLayoutDeferred:U,derivedPanelConstraints:Y,groupSize:W,layout:A,separatorToPanels:L})};return{collapse:()=>{let{collapsible:G,collapsedSize:F}=B(),{mutableValues:U}=J(),Y=Q();G&&Y!==F&&(U.expandToSize=Y,z(F))},expand:()=>{let{collapsible:G,collapsedSize:F,minSize:U}=B(),{mutableValues:Y}=J(),K=Q();if(G&&K===F){let W=Y.expandToSize??U;W===0&&(W=1),z(W)}},getSize:()=>{let{group:G}=H(),F=Q(),{element:U}=J(),Y=G.orientation==="horizontal"?U.offsetWidth:U.offsetHeight;return{asPercentage:F,inPixels:Y}},isCollapsed:()=>{let{collapsible:G,collapsedSize:F}=B(),U=Q();return G&&r2(F,U)},resize:(G)=>{let{group:F}=H(),{element:U}=J(),Y=BH({group:F}),K=lJ({groupSize:Y,panelElement:U,styleProp:G}),W=G4(K/Y*100);z(W)}}}function ru($){if($.defaultPrevented)return;let Z=x7();$q($,Z).forEach((H)=>{if(H.separator&&!H.separator.disableDoubleClick){let B=H.panels.find((J)=>J.panelConstraints.defaultSize!==void 0);if(B){let J=B.panelConstraints.defaultSize,Q=Yc({groupId:H.group.id,panelId:B.id});Q&&J!==void 0&&(Q.resize(J),$.preventDefault())}}})}function hY($){let Z=x7();for(let[H]of Z)if(H.separators.some((B)=>B.element===$))return H;throw Error("Could not find parent Group for separator element")}function Kc({groupId:$}){let Z=()=>{let H=x7();for(let[B,J]of H)if(B.id===$)return{group:B,...J};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:H,layout:B}=Z();return H?{}:B},setLayout(H){let{defaultLayoutDeferred:B,derivedPanelConstraints:J,group:Q,groupSize:X,layout:z,separatorToPanels:G}=Z(),F=h7({layout:H,panelConstraints:J});return B?z:(y7(z,F)||o9(Q,{defaultLayoutDeferred:B,derivedPanelConstraints:J,groupSize:X,layout:F,separatorToPanels:G}),F)}}}function k7($,Z){let H=hY($),B=Y6(H.id,!0),J=H.separators.find((U)=>U.element===$);z5(J,"Matching separator not found");let Q=B.separatorToPanels.get(J);z5(Q,"Matching panels not found");let X=Q.map((U)=>H.panels.indexOf(U)),z=Kc({groupId:H.id}).getLayout(),G=rJ({delta:Z,initialLayout:z,panelConstraints:B.derivedPanelConstraints,pivotIndices:X,prevLayout:z,trigger:"keyboard"}),F=h7({layout:G,panelConstraints:B.derivedPanelConstraints});y7(z,F)||o9(H,{defaultLayoutDeferred:B.defaultLayoutDeferred,derivedPanelConstraints:B.derivedPanelConstraints,groupSize:B.groupSize,layout:F,separatorToPanels:B.separatorToPanels},{isUserInteraction:!0})}function au($){if($.defaultPrevented)return;let Z=$.currentTarget,H=hY(Z);if(!H.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),H.orientation==="vertical"&&k7(Z,5);break}case"ArrowLeft":{$.preventDefault(),H.orientation==="horizontal"&&k7(Z,-5);break}case"ArrowRight":{$.preventDefault(),H.orientation==="horizontal"&&k7(Z,5);break}case"ArrowUp":{$.preventDefault(),H.orientation==="vertical"&&k7(Z,-5);break}case"End":{$.preventDefault(),k7(Z,100);break}case"Enter":{$.preventDefault();let B=hY(Z),J=Y6(B.id,!0),{derivedPanelConstraints:Q,layout:X,separatorToPanels:z}=J,G=B.separators.find((K)=>K.element===Z);z5(G,"Matching separator not found");let F=z.get(G);z5(F,"Matching panels not found");let U=F[0],Y=Q.find((K)=>K.panelId===U.id);if(z5(Y,"Panel metadata not found"),Y.collapsible){let K=X[U.id],W=Y.collapsedSize===K?B.mutableState.expandedPanelSizes[U.id]??Y.minSize:Y.collapsedSize;k7(Z,W-K)}break}case"F6":{$.preventDefault();let B=hY(Z).separators.map((X)=>X.element),J=Array.from(B).findIndex((X)=>X===$.currentTarget);z5(J!==null,"Index not found");let Q=$.shiftKey?J>0?J-1:B.length-1:J+1<B.length?J+1:0;B[Q].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),k7(Z,-100);break}}}function nu($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=x7(),H=$q($,Z),B=new Map,J=!1;H.forEach((Q)=>{Q.separator&&(J||(J=!0,Q.separator.element.focus({focusVisible:!1,preventScroll:!0})));let X=Z.get(Q.group);X&&B.set(Q.group,X.layout)}),ZH({cursorFlags:0,hitRegions:H,initialLayoutMap:B,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),H.length&&$.preventDefault()}function Wc({document:$,event:Z,hitRegions:H,initialLayoutMap:B,mountedGroups:J,pointerDownAtPoint:Q,prevCursorFlags:X}){let z=0;H.forEach((F)=>{let{group:U,groupSize:Y}=F,{orientation:K,panels:W}=U,{disableCursor:N}=U.mutableState,L=0;Q?K==="horizontal"?L=(Z.clientX-Q.x)/Y*100:L=(Z.clientY-Q.y)/Y*100:K==="horizontal"?L=Z.clientX<0?-100:100:L=Z.clientY<0?-100:100;let V=B.get(U),A=J.get(U);if(!V||!A)return;let{defaultLayoutDeferred:D,derivedPanelConstraints:q,groupSize:_,layout:M,separatorToPanels:P}=A;if(q&&M&&P){let C=rJ({delta:L,initialLayout:V,panelConstraints:q,pivotIndices:F.panels.map((R)=>W.indexOf(R)),prevLayout:M,trigger:"mouse-or-touch"});if(y7(C,M)){if(L!==0&&!N)switch(K){case"horizontal":{z|=L<0?Jc:Qc;break}case"vertical":{z|=L<0?Xc:zc;break}}}else o9(F.group,{defaultLayoutDeferred:D,derivedPanelConstraints:q,groupSize:_,layout:C,separatorToPanels:P})}});let G=0;Z.movementX===0?G|=X&gu:G|=z&gu,Z.movementY===0?G|=X&fu:G|=z&fu,xJ0(G),tD($)}function ou($){let Z=x7(),H=b7();switch(H.state){case"active":Wc({document:$.currentTarget,event:$,hitRegions:H.hitRegions,initialLayoutMap:H.initialLayoutMap,mountedGroups:Z,prevCursorFlags:H.cursorFlags})}}function su($){if($.defaultPrevented)return;let Z=b7(),H=x7();switch(Z.state){case"active":{if($.buttons===0){ZH({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((B)=>{let J=Y6(B.group.id,!0);o9(B.group,J,{isUserInteraction:!0})});return}for(let B of Z.hitRegions)if(B.separator){let{element:J}=B.separator;J.hasPointerCapture?.($.pointerId)||J.setPointerCapture?.($.pointerId)}Wc({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:H,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let B=$q($,H);B.length===0?Z.state!=="inactive"&&ZH({cursorFlags:0,state:"inactive"}):ZH({cursorFlags:0,hitRegions:B,state:"hover"}),tD($.currentTarget);break}}}function tu($){if($.relatedTarget instanceof HTMLIFrameElement)switch(b7().state){case"hover":ZH({cursorFlags:0,state:"inactive"})}}function eu($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;Fc($.currentTarget)&&$.preventDefault()}function $c($){let Z=0,H=0,B={};for(let Q of $)if(Q.defaultSize!==void 0){Z++;let X=G4(Q.defaultSize);H+=X,B[Q.panelId]=X}else B[Q.panelId]=void 0;let J=$.length-Z;if(J!==0){let Q=G4((100-H)/J);for(let X of $)X.defaultSize===void 0&&(B[X.panelId]=Q)}return B}function nJ0($,Z,H){if(!H[0])return;let B=$.panels.find((G)=>G.element===Z);if(!B||!B.onResize)return;let J=BH({group:$}),Q=$.orientation==="horizontal"?B.element.offsetWidth:B.element.offsetHeight,X=B.mutableValues.prevSize,z={asPercentage:G4(Q/J*100),inPixels:Q};B.mutableValues.prevSize=z,B.onResize(z,B.id,X)}function oJ0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if($[H]!==Z[H])return!1;return!0}function sJ0({group:$,nextGroupSize:Z,prevGroupSize:H,prevLayout:B}){if(H<=0||Z<=0||H===Z)return B;let J=0,Q=0,X=!1,z=new Map,G=[];for(let Y of $.panels){let K=B[Y.id]??0;switch(Y.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{X=!0;let W=K/100*H,N=G4(W/Z*100);z.set(Y.id,N),J+=N;break}case"preserve-relative-size":default:{G.push(Y.id),Q+=K;break}}}if(!X||G.length===0)return B;let F=100-J,U={...B};if(z.forEach((Y,K)=>{U[K]=Y}),Q>0)for(let Y of G){let K=B[Y]??0;U[Y]=G4(K/Q*F)}else{let Y=G4(F/G.length);for(let K of G)U[K]=Y}return U}function tJ0($,Z){let H=$.map((J)=>J.id),B=Object.keys(Z);if(H.length!==B.length)return!1;for(let J of H)if(!B.includes(J))return!1;return!0}var tZ=new Map;function eJ0($){let Z=!0;z5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let H=$.element.ownerDocument.defaultView.ResizeObserver,B=new Set,J=new Set,Q=new H((N)=>{for(let L of N){let{borderBoxSize:V,target:A}=L;if(A===$.element){if(Z){let D=BH({group:$});if(D===0)return;let q=Y6($.id);if(!q)return;let _=aD($),M=q.defaultLayoutDeferred?$c(_):q.layout,P=sJ0({group:$,nextGroupSize:D,prevGroupSize:q.groupSize,prevLayout:M}),C=h7({layout:P,panelConstraints:_});if(!q.defaultLayoutDeferred&&y7(q.layout,C)&&oJ0(q.derivedPanelConstraints,_)&&q.groupSize===D)return;o9($,{defaultLayoutDeferred:!1,derivedPanelConstraints:_,groupSize:D,layout:C,separatorToPanels:q.separatorToPanels})}}else nJ0($,A,V)}});Q.observe($.element),$.panels.forEach((N)=>{z5(!B.has(N.id),`Panel ids must be unique; id "${N.id}" was used more than once`),B.add(N.id),N.onResize&&Q.observe(N.element)});let X=BH({group:$}),z=aD($),G=$.panels.map(({id:N})=>N).join(","),F=$.mutableState.defaultLayout;F&&(tJ0($.panels,F)||(F=void 0));let U=$.mutableState.layouts[G]??F??$c(z),Y=h7({layout:U,panelConstraints:z}),K=$.element.ownerDocument;tZ.set(K,(tZ.get(K)??0)+1);let W=new Map;return Bc($).forEach((N)=>{N.separator&&W.set(N.separator,N.panels)}),o9($,{defaultLayoutDeferred:X===0,derivedPanelConstraints:z,groupSize:X,layout:Y,separatorToPanels:W}),$.separators.forEach((N)=>{z5(!J.has(N.id),`Separator ids must be unique; id "${N.id}" was used more than once`),J.add(N.id),N.element.addEventListener("keydown",au)}),tZ.get(K)===1&&(K.addEventListener("contextmenu",cu,!0),K.addEventListener("dblclick",ru,!0),K.addEventListener("pointerdown",nu,!0),K.addEventListener("pointerleave",ou),K.addEventListener("pointermove",su),K.addEventListener("pointerout",tu),K.addEventListener("pointerup",eu,!0)),function(){Z=!1,tZ.set(K,Math.max(0,(tZ.get(K)??0)-1)),fJ0($),$.separators.forEach((N)=>{N.element.removeEventListener("keydown",au)}),tZ.get(K)||(K.removeEventListener("contextmenu",cu,!0),K.removeEventListener("dblclick",ru,!0),K.removeEventListener("pointerdown",nu,!0),K.removeEventListener("pointerleave",ou),K.removeEventListener("pointermove",su),K.removeEventListener("pointerout",tu),K.removeEventListener("pointerup",eu,!0)),Q.disconnect()}}function $Q0(){let[$,Z]=q1.useState({}),H=q1.useCallback(()=>Z({}),[]);return[$,H]}function Zq($){let Z=q1.useId();return`${$??Z}`}var v7=typeof window<"u"?q1.useLayoutEffect:q1.useEffect;function iJ($){let Z=q1.useRef($);return v7(()=>{Z.current=$},[$]),q1.useCallback((...H)=>Z.current?.(...H),[Z])}function Hq(...$){return iJ((Z)=>{$.forEach((H)=>{if(H)switch(typeof H){case"function":{H(Z);break}case"object":{H.current=Z;break}}})})}function Bq($){let Z=q1.useRef({...$});return v7(()=>{for(let H in $)Z.current[H]=$[H]},[$]),Z.current}var Nc=q1.createContext(null);function ZQ0($,Z){let H=q1.useRef({getLayout:()=>({}),setLayout:vJ0});q1.useImperativeHandle(Z,()=>H.current,[]),v7(()=>{Object.assign(H.current,Kc({groupId:$}))})}function Jq({children:$,className:Z,defaultLayout:H,disableCursor:B,disabled:J,elementRef:Q,groupRef:X,id:z,onLayoutChange:G,onLayoutChanged:F,orientation:U="horizontal",resizeTargetMinimumSize:Y={coarse:20,fine:10},style:K,...W}){let N=q1.useRef({onLayoutChange:{},onLayoutChanged:{}}),L=iJ((h)=>{y7(N.current.onLayoutChange,h)||(N.current.onLayoutChange=h,G?.(h))}),V=iJ((h,E)=>{y7(N.current.onLayoutChanged,h)||(N.current.onLayoutChanged=h,F?.(h,{isUserInteraction:E}))}),A=Zq(z),D=q1.useRef(null),[q,_]=$Q0(),M=q1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:Y,separators:[]}),P=Hq(D,Q);ZQ0(A,X);let C=iJ((h,E)=>{let I=b7(),j=uu(h),S=Y6(h);if(S){let k=!1;switch(I.state){case"active":{k=I.hitRegions.some((b)=>b.group===j);break}}return{flexGrow:S.layout[E]??1,pointerEvents:k?"none":void 0}}if(H?.[E])return{flexGrow:H?.[E]}}),R=Bq({defaultLayout:H,disableCursor:B}),y=q1.useMemo(()=>({get disableCursor(){return!!R.disableCursor},getPanelStyles:C,id:A,orientation:U,registerPanel:(h)=>{let E=M.current;return E.panels=nD(U,[...E.panels,h]),_(),()=>{E.panels=E.panels.filter((I)=>I!==h),_()}},registerSeparator:(h)=>{let E=M.current;return E.separators=nD(U,[...E.separators,h]),_(),()=>{E.separators=E.separators.filter((I)=>I!==h),_()}},updatePanelProps:(h,{disabled:E})=>{let I=M.current.panels.find((k)=>k.id===h);I&&(I.panelConstraints.disabled=E);let j=uu(A),S=Y6(A);j&&S&&o9(j,{...S,derivedPanelConstraints:aD(j)})},updateSeparatorProps:(h,{disabled:E,disableDoubleClick:I})=>{let j=M.current.separators.find((S)=>S.id===h);j&&(j.disabled=E,j.disableDoubleClick=I)}}),[C,A,_,U,R]),w=q1.useRef(null);return v7(()=>{let h=D.current;if(h===null)return;let E=M.current,I;if(R.defaultLayout!==void 0&&Object.keys(R.defaultLayout).length===E.panels.length){I={};for(let T of E.panels){let e=R.defaultLayout[T.id];e!==void 0&&(I[T.id]=e)}}let j={disabled:!!J,element:h,id:A,mutableState:{defaultLayout:I,disableCursor:!!R.disableCursor,expandedPanelSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:U,panels:E.panels,resizeTargetMinimumSize:E.resizeTargetMinimumSize,separators:E.separators};w.current=j;let S=eJ0(j),{defaultLayoutDeferred:k,derivedPanelConstraints:b,layout:v}=Y6(j.id,!0);!k&&b.length>0&&(L(v),V(v,!1));let c=eD(A,(T)=>{let{defaultLayoutDeferred:e,derivedPanelConstraints:Z0,layout:x}=T.next;if(e||Z0.length===0)return;let t=j.panels.map(({id:p})=>p).join(",");j.mutableState.layouts[t]=x,Z0.forEach((p)=>{if(p.collapsible){let{layout:X0}=T.prev??{};if(X0){let K0=r2(p.collapsedSize,x[p.panelId]),Q0=r2(p.collapsedSize,X0[p.panelId]);K0&&!Q0&&(j.mutableState.expandedPanelSizes[p.panelId]=X0[p.panelId])}}});let D0=b7().state!=="active";L(x),D0&&V(x,T.isUserInteraction)});return()=>{w.current=null,S(),c()}},[J,A,V,L,U,q,R]),q1.useEffect(()=>{let h=w.current;h&&(h.mutableState.defaultLayout=H,h.mutableState.disableCursor=!!B)}),HH.jsx(Nc.Provider,{value:y,children:HH.jsx("div",{...W,className:Z,"data-group":!0,"data-testid":A,id:A,ref:P,style:{height:"100%",width:"100%",overflow:"hidden",...K,display:"flex",flexDirection:U==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:U==="horizontal"?"pan-y":"pan-x"},children:$})})}Jq.displayName="Group";function Qq(){let $=q1.useContext(Nc);return z5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function HQ0($,Z){let{id:H}=Qq(),B=q1.useRef({collapse:rD,expand:rD,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:rD});q1.useImperativeHandle(Z,()=>B.current,[]),v7(()=>{Object.assign(B.current,Yc({groupId:H,panelId:$}))})}function Xq({children:$,className:Z,collapsedSize:H="0%",collapsible:B=!1,defaultSize:J,disabled:Q,elementRef:X,groupResizeBehavior:z="preserve-relative-size",id:G,maxSize:F="100%",minSize:U="0%",onResize:Y,panelRef:K,style:W,...N}){let L=!!G,V=Zq(G),A=Bq({disabled:Q}),D=q1.useRef(null),q=Hq(D,X),{getPanelStyles:_,id:M,orientation:P,registerPanel:C,updatePanelProps:R}=Qq(),y=Y!==null,w=iJ((j,S,k)=>{Y?.(j,G,k)});v7(()=>{let j=D.current;if(j!==null){let S={element:j,id:V,idIsStable:L,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:y?w:void 0,panelConstraints:{groupResizeBehavior:z,collapsedSize:H,collapsible:B,defaultSize:J,disabled:A.disabled,maxSize:F,minSize:U}};return C(S)}},[z,H,B,J,y,V,L,F,U,w,C,A]),q1.useEffect(()=>{R(V,{disabled:Q})},[Q,V,R]),HQ0(V,K);let h=()=>{let j=_(M,V);if(j)return JSON.stringify(j)},E=q1.useSyncExternalStore((j)=>eD(M,j),h,h),I;return E?I=JSON.parse(E):J!==void 0?I={flexGrow:void 0,flexShrink:void 0,flexBasis:J}:I={flexGrow:1},HH.jsx("div",{...N,"data-disabled":Q||void 0,"data-panel":!0,"data-testid":V,id:V,ref:q,style:{...BQ0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...I},children:HH.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:P==="horizontal"?"pan-y":"pan-x"},children:$})})}Xq.displayName="Panel";var BQ0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function JQ0({layout:$,panelConstraints:Z,panelId:H,panelIndex:B}){let J,Q,X=$[H],z=Z.find((G)=>G.panelId===H);if(z){let G=z.maxSize,F=z.collapsible?z.collapsedSize:z.minSize,U=[B,B+1];Q=h7({layout:rJ({delta:F-X,initialLayout:$,panelConstraints:Z,pivotIndices:U,prevLayout:$}),panelConstraints:Z})[H],J=h7({layout:rJ({delta:G-X,initialLayout:$,panelConstraints:Z,pivotIndices:U,prevLayout:$}),panelConstraints:Z})[H]}return{valueControls:H,valueMax:J,valueMin:Q,valueNow:X}}function zq({children:$,className:Z,disabled:H,disableDoubleClick:B,elementRef:J,id:Q,style:X,...z}){let G=Zq(Q),F=Bq({disabled:H,disableDoubleClick:B}),[U,Y]=q1.useState({}),[K,W]=q1.useState("inactive"),[N,L]=q1.useState(!1),V=q1.useRef(null),A=Hq(V,J),{disableCursor:D,id:q,orientation:_,registerSeparator:M,updateSeparatorProps:P}=Qq(),C=_==="horizontal"?"vertical":"horizontal";v7(()=>{let w=V.current;if(w!==null){let h={disabled:F.disabled,disableDoubleClick:F.disableDoubleClick,element:w,id:G},E=M(h),I=hJ0((S)=>{W(S.next.state!=="inactive"&&S.next.hitRegions.some((k)=>k.separator===h)?S.next.state:"inactive")}),j=eD(q,(S)=>{let{derivedPanelConstraints:k,layout:b,separatorToPanels:v}=S.next,c=v.get(h);if(c){let T=c[0],e=c.indexOf(T);Y(JQ0({layout:b,panelConstraints:k,panelId:T.id,panelIndex:e}))}});return()=>{I(),j(),E()}}},[q,G,M,F]),q1.useEffect(()=>{P(G,{disabled:H,disableDoubleClick:B})},[H,B,G,P]);let R;H&&!D&&(R="not-allowed");let y;if(H)y="disabled";else switch(K){case"active":{y="active";break}default:N?y="focus":y=K}return HH.jsx("div",{...z,"aria-controls":U.valueControls,"aria-disabled":H||void 0,"aria-orientation":C,"aria-valuemax":U.valueMax,"aria-valuemin":U.valueMin,"aria-valuenow":U.valueNow,children:$,className:Z,"data-separator":y,"data-testid":G,id:G,onBlur:()=>L(!1),onFocus:()=>L(!0),ref:A,role:"separator",style:{flexBasis:"auto",cursor:R,...X,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:H?void 0:0})}zq.displayName="Separator";var aJ=O(d(),1);function Lc({className:$,...Z}){return aJ.jsx(Jq,{"data-slot":"resizable-panel-group",className:s("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function Gq({...$}){return aJ.jsx(Xq,{"data-slot":"resizable-panel",...$})}function Ac({withHandle:$,className:Z,...H}){return aJ.jsx(zq,{"data-slot":"resizable-handle",className:s("relative flex w-0 items-center justify-center ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-0 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",Z),...H,children:$&&aJ.jsx("div",{className:"flex h-6 w-1 shrink-0 rounded-lg bg-border"})})}var K6=O(d(),1);function Vc({workspace:$,chat:Z,open:H,workspaceMinWidth:B,chatMinWidth:J,chatMaxWidth:Q,chatWidth:X,onCollapse:z,onChatWidthChange:G}){let F=W6.useRef(null),U=W6.useRef(null),[Y,K]=W6.useState(!1),W=Math.min(Math.max(X,J),Q),N=W6.useRef(H?W:0).current;return W6.useLayoutEffect(()=>{let L=F.current;if(!L)return;if(H)L.resize(W);else L.collapse()},[W,H]),K6.jsxs(Lc,{orientation:"horizontal",className:s("overflow-visible!",Y&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",Y&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(L,V)=>{if(!Y&&U.current===null)U.current=requestAnimationFrame(()=>{K(!0)});if(V.isUserInteraction)requestAnimationFrame(()=>{let A=F.current;if(!A)return;let D=A.getSize();if(D.inPixels>0)G(Math.round(D.inPixels))})},children:[K6.jsx(Gq,{id:"workspace",className:"overflow-visible!",minSize:B,children:K6.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),K6.jsx(Ac,{"aria-label":"Resize chat",hidden:!H,disabled:!H}),K6.jsx(Gq,{id:"chat","aria-hidden":!H,inert:!H,collapsible:!0,collapsedSize:0,defaultSize:N,minSize:J,maxSize:Q,groupResizeBehavior:"preserve-pixel-size",panelRef:F,onResize:(L,V,A)=>{if(H&&L.inPixels===0&&A&&A.inPixels>0)z()},className:s("overflow-hidden!",Y&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",H?"opacity-100":"opacity-0"),children:K6.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var N1=O(d(),1),XQ0=F4.lazy(()=>import("/chunk-j2w2vak4.js").then(($)=>({default:$.Scratchpad}))),Pc=($)=>$.config.title||$.id,_c=($)=>qY($.icon)??dB;function Oc($,Z){let H=Z.find((B)=>B.viewId===$.id);return qY($.config.icon)??qY(H?.icon)??dB}function zQ0({onToggleMode:$}){return N1.jsxs(y1,{children:[N1.jsx(h1,{render:N1.jsx(T0,{variant:"ghost",size:"icon-sm",onClick:$,"aria-label":"Dock agent",children:N1.jsx(qc,{stroke:1.75})})}),N1.jsx(x1,{children:"Dock agent"})]})}function GQ0({active:$,onToggle:Z}){return N1.jsxs(y1,{children:[N1.jsx(h1,{render:N1.jsx(T0,{variant:"ghost",size:"icon-sm","aria-label":"Customize","aria-pressed":$,onClick:Z,className:s($&&"bg-accent"),children:N1.jsx(Mc,{stroke:1.75})})}),N1.jsx(x1,{children:"Customize"})]})}function FQ0($,Z,H,B,J,Q){if($==="agent")return{key:$,Icon:Fq,label:"Agent",closable:B,loading:J};if($==="widgets")return{key:$,Icon:lB,label:"Widgets",closable:B};if($==="scratchpad")return{key:$,Icon:iB,label:"Scratchpad",closable:B};let X=Q7($),z=X?H.find((U)=>U.id===X):null;if(z)return{key:$,Icon:_c(z),label:z.title||z.viewId||"New view",closable:B,loading:Q(z.sessionId)};let G=k3($),F=G?Z.find((U)=>U.id===G):null;return F?{key:$,Icon:Oc(F,H),label:Pc(F),closable:B}:null}function UQ0($,Z,H){let B=new Set(Z),J=0;return $.map((Q)=>B.has(Q)?H[J++]:Q)}function jc({widgets:$,views:Z,builders:H}){let{layout:B,setLayout:J,name:Q,icon:X,provider:z,workspaceId:G}=K5(),F=j8(B.theme),U=Vu(),{ref:Y,fits:K,constraints:W}=qu(),[N,L]=F4.useState("idle"),[V,A]=F4.useState(!1),[D,q]=F4.useState(0),_=F4.useRef(new Map),M=j5((N0)=>N0.dockedChatWidth),P=j5((N0)=>N0.setDockedChatWidth),C=_2((N0)=>N0.activity),R=PX(C,G),y=Du({builders:H,onSave:(N0,b0)=>U.save(N0,b0)});bw(B.theme);let w=kY(RY(B.tabs),Z,H),h=w.filter((N0)=>N0!=="agent"),E=h.length>0,I=$.length>0||Z.length>0,S=B.layoutMode==="split"&&E&&K?"split":"fullscreen",k=S==="split",{tabsState:b,activeTab:v,appletParams:c,navigateToTab:T,setTabs:e}=yu({views:Z,builders:H,split:k}),{view:Z0,chatLoaded:x,previewTurn:t,sessionId:D0,processing:p,error:X0,send:K0,stop:Q0,selectSession:z0,dismissError:L0}=zu({activeTab:v,appletParams:c}),{composerBanner:i,builderComposerBanner:B0,agentAvailability:$0}=Ru(G,{chatError:X0,onDismissChatError:L0}),J0=new Set(b.open),n=(N0)=>{J({layoutMode:N0})},f=k?h:w,l=w.length>1,m=f.map((N0)=>FQ0(N0,Z,H,l||Q7(N0)!==null,R,(b0)=>yH(C,G,b0))).filter((N0)=>Boolean(N0)),a=k3(v),o=a?Z.find((N0)=>N0.id===a):void 0,V0=Q7(v),O0=V0?H.find((N0)=>N0.id===V0):void 0,k0=O0?.status==="draft"&&!yH(C,G,O0.sessionId)?O0:void 0,r0=k0?.id,u=N==="idle"&&(v==="widgets"&&$.length>0||o!==void 0),r=CE({workspaceId:G,sessionId:D0,activeTab:v,mode:S,available:u,closePopup:()=>A(!1),openPopup:()=>A(!0)});F4.useEffect(()=>{if(b.open.filter((W1)=>dJ(W1,Z,H)).length===b.open.length)return;let b0=kY(b,Z,H);J({tabs:{open:b0,active:b0.includes(b.active)?b.active:b0[0]}})},[H,J,b,Z]),F4.useEffect(()=>{let N0=new Map;for(let l0 of H){if(l0.status!=="ready"||!l0.viewId)continue;if(!Z.some((L1)=>L1.id===l0.viewId))continue;N0.set(b3(l0.id),KG(l0.viewId))}if(N0.size===0)return;let b0=N0.get(v);if(b0)T(b0);let W1=new Set(N0.values()),C0=new Map([...N0].map(([l0,L1])=>[L1,l0])),I0=[],g0=!1;for(let l0 of b.open){let L1=C0.get(l0);if(W1.has(l0)&&L1&&b.open.includes(L1)){g0=!0;continue}let u1=N0.get(l0),c1=u1??l0;if(u1)g0=!0;if(!I0.includes(c1))I0.push(c1)}if(!g0)return;let $1=N0.get(b.active)??b.active;J({tabs:{open:I0.length>0?I0:["agent"],active:$1}})},[v,H,T,J,b,Z]),F4.useEffect(()=>{if(S!=="fullscreen"||v==="agent")A(!1)},[v,S]),F4.useEffect(()=>{if(!r0)return;if(S==="fullscreen")A(!0);q((N0)=>N0+1)},[r0,S]);let H0=(N0,b0)=>{if(T(N0,b0),N0==="agent")A(!1),q((W1)=>W1+1)},A0=(N0)=>{if(N0==="views"){let b0=Z[0];if(b0)H0(KG(b0.id));else U.create().then((W1)=>H0(b3(W1.id)))}else H0(N0);A(!1)};VG(G,"focusTab",H0),B2((N0)=>{if(N0.type==="tab:focus"&&N0.workspaceId===G)H0(N0.tab,N0.params)});let j0=(N0)=>{let b0=Q7(N0),W1=b0?H.find((l0)=>l0.id===b0):void 0;if(!l&&!W1||!J0.has(N0))return;let C0=b.open.filter((l0)=>l0!==N0);if(C0.length===0)C0=["agent"];let I0=f.indexOf(N0),g0=f[I0+1]??f[I0-1]??C0.find((l0)=>dJ(l0,Z,H))??"agent",$1=b.active===N0||!C0.includes(b.active)?g0:b.active;if(e({open:C0,active:$1}),v===N0)T(g0);if(W1?.status==="draft")_.current.get(W1.id)?.resetSketch(),y.clear(W1.id),U.discard(W1.id)},v0=(N0)=>{let b0=b3(N0.id);if(J0.has(b0)){let W1=b.open.filter((C0)=>C0!==b0);if(W1.length===0)W1=["agent"];if(e({open:W1,active:b.active===b0?W1[0]:b.active}),v===b0)T(W1[0])}_.current.get(N0.id)?.resetSketch(),y.clear(N0.id),U.discard(N0.id)},G1=(N0)=>{let b0=UQ0(b.open,f,N0);if(b0===b.open)return;e({open:b0,active:b.active})},K1=(N0)=>{if(N0!==void 0)j5.getState().setComposerDraft(G,N0);if(S==="fullscreen"&&v!=="agent"){if(A(!0),V)q((b0)=>b0+1);return}q((b0)=>b0+1)};np({send:K0,revealChat:K1,agentAvailability:$0});let c0=[...!k&&!J0.has("agent")?[{key:"agent",Icon:Fq,label:"Agent",onClick:()=>H0("agent")}]:[],...!J0.has("widgets")?[{key:"widgets",Icon:lB,label:"Widgets",onClick:()=>H0("widgets")}]:[],...!J0.has("scratchpad")?[{key:"scratchpad",Icon:iB,label:"Scratchpad",onClick:()=>H0("scratchpad")}]:[],...Z.map((N0)=>({view:N0,tab:KG(N0.id)})).filter(({tab:N0})=>!J0.has(N0)).map(({view:N0,tab:b0})=>({key:b0,Icon:Oc(N0,H),label:Pc(N0),onClick:()=>H0(b0)})),...H.filter((N0)=>N0.status!=="ready").map((N0)=>({builder:N0,tab:b3(N0.id)})).filter(({tab:N0})=>!J0.has(N0)).map(({builder:N0,tab:b0})=>({key:b0,Icon:_c(N0),label:N0.title||N0.viewId||"New view",onClick:()=>H0(b0)})),{key:"create-view",Icon:Dc,label:"New view",onClick:()=>{U.create().then((N0)=>H0(b3(N0.id)))}}],R0=k0?{sessionId:k0.sessionId,builderId:k0.id,initialValue:k0.input.requirements,onChange:(N0)=>y.change(k0.id,N0),onRemoveDrawing:()=>{_.current.get(k0.id)?.resetSketch()},onSubmit:async(N0)=>{await _.current.get(k0.id)?.prepareSketchForSend(),await U.submit(k0,N0),y.clear(k0.id)}}:void 0,d0=N1.jsx(pU,{agent:F.agent,active:S==="split",focusRequest:D,chatLoaded:x,hasWorkspaceApplets:I,view:Z0,previewTurn:t,sessionId:D0,processing:p,composerBanner:R0?B0:i,agentAvailability:$0,send:K0,stop:Q0,onNavigateFromWelcome:A0,onClose:()=>n("fullscreen"),annotation:r.docked,builderDraft:R0,docked:!0}),p0=N1.jsx(pU,{agent:F.agent,active:S==="fullscreen"&&v==="agent",focusRequest:D,chatLoaded:x,hasWorkspaceApplets:I,view:Z0,previewTurn:t,sessionId:D0,processing:p,composerBanner:i,agentAvailability:$0,send:K0,stop:Q0,onNavigateFromWelcome:A0}),t0=N1.jsxs("div",{className:s("@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius,background-color] duration-100 ease-out motion-reduce:transition-none",S==="split"&&"rounded-xl"),children:[N1.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[N1.jsxs("div",{ref:r.targetRef,inert:r.controls.active||void 0,"aria-hidden":r.controls.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background transition-colors duration-100 ease-out motion-reduce:transition-none",children:[v==="agent"?p0:v==="widgets"?N1.jsx(Vf,{editing:N==="editing",onEditingChange:(N0)=>L(N0?"editing":"idle"),widgets:$,onCreateWidget:()=>{z0(null),K1("Create widget")}}):v==="scratchpad"?N1.jsx(F4.Suspense,{fallback:null,children:N1.jsx(XQ0,{})}):null,H.filter((N0)=>N0.status!=="ready").map((N0)=>N1.jsx(Uu,{ref:(b0)=>{if(b0)_.current.set(N0.id,b0);else _.current.delete(N0.id)},active:O0?.id===N0.id,builder:N0,chatDocked:S==="split",workspaceId:G,onEditingStart:()=>{if(S==="fullscreen")A(!1)},onContinueInChat:K1,onOpenChat:()=>{z0(N0.sessionId),K1()},onDiscard:()=>v0(N0)},N0.id)),N1.jsx(Au,{views:Z,activeViewId:o?.id??null,params:c})]}),N1.jsx(OG,{...r.layerProps,children:N1.jsx(CG,{controls:r.controls,title:"Draw annotation",busy:r.controls.finishing,onComplete:()=>void r.controls.finish()})})]}),N1.jsx($4,{children:N==="customizing"&&N1.jsx(lv,{onClose:()=>L("idle")})}),N1.jsxs(Df,{children:[N1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[N1.jsxs("div",{className:"flex items-center gap-2",children:[N1.jsx("img",{src:X??P8[z??"claude-code"],alt:"",className:"size-5 shrink-0 rounded-xs"}),Q&&N1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Q})]}),N1.jsx(vu,{tabs:m,active:v,createItems:c0,onSelect:H0,onClose:j0,onReorder:G1})]}),N1.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[N1.jsx(GQ0,{active:N==="customizing",onToggle:()=>L(N==="customizing"?"idle":"customizing")}),N1.jsx(ap,{}),E&&K&&S==="fullscreen"&&N1.jsx(zQ0,{onToggleMode:()=>n("split")})]})]})]});return N1.jsxs("div",{className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[N1.jsx("div",{ref:Y,className:"flex min-h-0 flex-1",children:E&&K&&W?N1.jsx(Vc,{...W,workspace:t0,chat:d0,open:S==="split",chatWidth:M,onCollapse:()=>n("fullscreen"),onChatWidthChange:P}):t0}),S==="fullscreen"&&v!=="agent"&&E&&N1.jsx(dv,{agent:F.agent,loading:R,open:V,onOpenChange:A,onOpenChangeComplete:(N0)=>{if(N0)q((b0)=>b0+1)},children:(N0)=>N1.jsx(pU,{agent:F.agent,active:V,focusRequest:D,chatLoaded:x,hasWorkspaceApplets:I,view:Z0,previewTurn:t,sessionId:D0,processing:p,composerBanner:R0?B0:i,agentAvailability:$0,send:K0,stop:Q0,onNavigateFromWelcome:A0,onClose:N0,annotation:r.popup,builderDraft:R0})})]})}var xY=O(g(),1);function Tc($,Z,H,B){let J=xY.useRef(null);xY.useEffect(()=>{if(!Z)return;let Q=new Map(Z.map((W)=>[W.id,{w:W.config.colSpan,h:W.config.rowSpan}]));if(J.current?.workspaceId!==$){J.current={workspaceId:$,sizes:Q};return}let X=J.current.sizes,z=new Set(H.widgetGrid.map((W)=>W.i)),G=Z.filter((W)=>{if(!X.has(W.id))return!z.has(W.id);if(!z.has(W.id))return!1;let L=X.get(W.id);return L.w!==W.config.colSpan||L.h!==W.config.rowSpan});if(J.current={workspaceId:$,sizes:Q},G.length===0)return;let F=new Map(Z.map((W)=>[W.id,W.config])),U=H.widgetGrid.filter((W)=>!G.some((N)=>N.id===W.i)&&F.has(W.i)).map((W)=>{let N=F.get(W.i);return{i:W.i,x:W.x,y:W.y,w:N.colSpan,h:N.rowSpan}}),Y=U.map(({i:W,x:N,y:L})=>({i:W,x:N,y:L})),K=[...U];for(let W of G){let N=_J(K,W.config.colSpan,W.config.rowSpan,4);Y.push({i:W.id,x:N.x,y:N.y}),K.push({i:W.id,x:N.x,y:N.y,w:W.config.colSpan,h:W.config.rowSpan})}B({widgetGrid:Y})},[$,Z,H.widgetGrid,B])}var y8=O(d(),1);function wc({id:$}){return y8.jsx(Cc,{id:$,children:y8.jsx(AE,{id:$,children:y8.jsx(YQ0,{id:$})})})}function YQ0({id:$}){let Z=Z1(),[H]=U3(),{layout:B,setLayout:J,isLoading:Q}=K5(),X=YE($),z=_G($),G=OY($);Tc($,X.data,B,J),JE(),B2((U)=>{if(U.type==="theme:updated"||U.type==="workspace:updated")Z.invalidateQueries({queryKey:w0.layout($)});else if(U.type==="widget-layout:updated"||U.type==="widget:updated")Z.invalidateQueries({queryKey:w0.widgets($)});else if(U.type==="view-layout:updated"||U.type==="view:updated")Z.invalidateQueries({queryKey:w0.views($)})});let F=Q||H===void 0||X.isLoading||z.isLoading||G.isLoading;return y8.jsx(y8.Fragment,{children:y8.jsx(Kz,{children:F?y8.jsx("div",{className:"flex h-full items-center justify-center",children:y8.jsx(iw,{sprite:"moi",effect:"chaos"})}):y8.jsx(jc,{widgets:X.data??[],views:z.data??[],builders:G.data??[]})})})}var S9=O(d(),1),Ec=null;function KQ0(){if(!Ec)return S9.jsx(GM,{to:"/"});return S9.jsx(vY.Suspense,{fallback:null,children:S9.jsx(Ec,{})})}function Sc(){let[,$]=u4();return vY.useEffect(()=>{return UW((Z)=>$(`/workspace/${Z}`)),()=>UW(null)},[$]),S9.jsxs(zM,{children:[S9.jsx(YQ,{path:"/",component:mw}),S9.jsx(YQ,{path:"/dev/*?",component:KQ0}),S9.jsx(YQ,{path:"/workspace/:id/*?",children:(Z)=>S9.jsx(wc,{id:Z.id},Z.id)})]})}var N6=O(d(),1),Rc=new oY;e_(Rc);m_();function rU1($){function Z(){return N6.jsx(tY,{client:Rc,children:N6.jsxs(qX,{children:[N6.jsx(zK,{children:N6.jsx(Sc,{})}),N6.jsx(G_,{}),!1]})})}Ic.createRoot($).render(N6.jsx(Z,{}))}export{rU1 as mount};