moi-computer 0.12.0 → 0.12.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -27
- package/bin/moi.mjs +2 -2
- package/client/AGENTS.md +7 -4
- package/client/api/app-config.ts +3 -2
- package/client/api/app-ui-keys.ts +1 -1
- package/client/api/workspace-keys.ts +2 -4
- package/client/app/{AppRouter.tsx → app-router.tsx} +4 -4
- package/client/app/routes/{HomeRoute.tsx → home-route.tsx} +2 -2
- package/client/app/routes/{WorkspaceRoute.tsx → workspace-route.tsx} +20 -31
- package/client/app/shell/{SidebarLayout.tsx → sidebar-layout.tsx} +10 -10
- package/client/dev/index.html +43 -0
- package/client/dev/index.ts +15 -0
- package/client/features/applets/{AppletContainer.tsx → applet-container.tsx} +1 -1
- package/client/features/applets/applet-runtime.ts +11 -13
- package/client/features/applets/applet-thumbnail.ts +1 -1
- package/client/features/applets/{useApplet.ts → use-applet.ts} +2 -2
- package/client/features/applets/{WidgetShell.tsx → widget-shell.tsx} +4 -4
- package/client/features/chat/applet-chat-intents.ts +33 -14
- package/client/features/chat/{ChatPanel.tsx → chat-panel.tsx} +80 -59
- package/client/features/chat/chat-popup.tsx +171 -0
- package/client/features/chat/chat-send.ts +33 -1
- package/client/features/chat/chat-store.ts +10 -0
- package/client/features/chat/composer/attachments/{DrawingAttachmentChip.tsx → drawing-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/attachments/{FileAttachmentChip.tsx → file-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/attachments/{TextAttachmentChip.tsx → text-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/banners/{ComposerBanner.tsx → composer-banner.tsx} +0 -14
- package/client/features/chat/composer/banners/{ErrorBanner.tsx → error-banner.tsx} +1 -1
- package/client/features/chat/composer/banners/{SkillUpdateBanner.tsx → skill-update-banner.tsx} +3 -3
- package/client/features/chat/composer/{ChatComposer.tsx → chat-composer.tsx} +31 -33
- package/client/features/chat/composer/{ModelPicker.tsx → model-picker.tsx} +4 -4
- package/client/features/chat/composer/{useWorkspaceComposerState.tsx → use-workspace-composer-state.tsx} +14 -30
- package/client/features/chat/composer/{useWorkspaceSkillUpdates.ts → use-workspace-skill-updates.ts} +1 -1
- package/client/features/chat/connection/chat-frames.ts +15 -8
- package/client/features/chat/messages/{ChatEmptyState.tsx → chat-empty-state.tsx} +37 -23
- package/client/features/chat/messages/fork-history.ts +14 -0
- package/client/features/chat/messages/{MarkdownContent.tsx → markdown-content.tsx} +4 -4
- package/client/features/chat/messages/tool-group/index.ts +1 -1
- package/client/features/chat/messages/tool-group/{ReadImagePreview.tsx → read-image-preview.tsx} +2 -2
- package/client/features/chat/messages/tool-group/{SubagentCard.tsx → subagent-card.tsx} +3 -3
- package/client/features/chat/messages/tool-group/{TimelineRow.tsx → timeline-row.tsx} +1 -1
- package/client/features/chat/messages/tool-group/{ToolCallGroup.tsx → tool-call-group.tsx} +8 -8
- package/client/features/chat/messages/tool-group/{ToolOutput.tsx → tool-output.tsx} +1 -1
- package/client/features/chat/messages/{TurnView.tsx → turn-view.tsx} +4 -4
- package/client/features/chat/sessions/api.ts +109 -19
- package/client/features/chat/sessions/browser-tab-state.ts +30 -7
- package/client/features/chat/sessions/{ChatSelector.tsx → chat-selector.tsx} +139 -80
- package/client/features/chat/sessions/use-selected-session.ts +351 -0
- package/client/features/chat/{useChat.ts → use-chat.ts} +46 -48
- package/client/features/collab/client.ts +10 -11
- package/client/features/collab/hooks.tsx +6 -11
- package/client/features/collab/host-state.ts +57 -128
- package/client/features/collab/provider.tsx +3 -3
- package/client/features/collab/proxy-user.ts +1 -1
- package/client/features/collab/testing/fake-engine.ts +6 -27
- package/client/features/collab/workspace-users-menu.tsx +3 -7
- package/client/features/connectors/mcp-icons.ts +1 -1
- package/client/features/connectors/{McpServerCards.tsx → mcp-server-cards.tsx} +1 -1
- package/client/features/{home/workspace-setup/DemoDialog.tsx → demo/demo-dialog.tsx} +6 -6
- package/client/features/dev/chat-states-fixtures.ts +4 -4
- package/client/features/dev/{ChatStatesPage.tsx → chat-states-page.tsx} +6 -6
- package/client/features/dev/collab/local-user-settings.tsx +4 -4
- package/client/features/dev/{DevIndexPage.tsx → dev-index-page.tsx} +7 -1
- package/client/features/dev/{DevRoutes.tsx → dev-routes.tsx} +8 -6
- package/client/features/dev/workspace-setup-mocks.ts +102 -0
- package/client/features/dev/workspace-setup-page.tsx +11 -0
- package/client/features/dev/workspace-setup-preview.tsx +226 -0
- package/client/features/drawings/{DrawingToolbar.tsx → drawing-toolbar.tsx} +1 -1
- package/client/features/drawings/{useChatAnnotation.ts → use-chat-annotation.ts} +29 -23
- package/client/features/drawings/{useDrawingLayer.ts → use-drawing-layer.ts} +1 -1
- package/client/features/drawings/{useViewBuilderSketch.ts → use-view-sketch.ts} +8 -8
- package/client/features/harness/api.ts +36 -0
- package/client/features/harness/device-login-steps.tsx +97 -0
- package/client/features/home/api.ts +1 -81
- package/client/features/home/{HomeLogo.tsx → home-logo.tsx} +1 -1
- package/client/features/home/{HomePage.tsx → home-page.tsx} +16 -20
- package/client/features/overview/api.ts +2 -2
- package/client/features/overview/default/registry.tsx +3 -5
- package/client/features/overview/default/{ViewsWidget.tsx → views-widget.tsx} +6 -13
- package/client/features/overview/{HiddenPanel.tsx → hidden-panel.tsx} +2 -2
- package/client/features/overview/{Overview.tsx → overview.tsx} +9 -12
- package/client/features/overview/{WidgetCanvas.tsx → widget-canvas.tsx} +1 -1
- package/client/features/overview/{WidgetFrame.tsx → widget-frame.tsx} +1 -1
- package/client/features/overview/workspace-name.tsx +55 -0
- package/client/features/scratchpad/{Scratchpad.tsx → scratchpad.tsx} +7 -7
- package/client/features/scratchpad/{useScratchpadSnapshot.tsx → use-scratchpad-snapshot.tsx} +3 -3
- package/client/features/settings/api.ts +1 -1
- package/client/features/settings/{ConnectorsSettings.tsx → connectors-settings.tsx} +3 -3
- package/client/features/settings/{EnvironmentSettings.tsx → environment-settings.tsx} +3 -3
- package/client/features/settings/{GeneralSettings.tsx → general-settings.tsx} +5 -5
- package/client/features/settings/{useEnvVars.ts → use-env-vars.ts} +1 -1
- package/client/features/settings/{WorkspaceIconPicker.tsx → workspace-icon-picker.tsx} +1 -1
- package/client/features/settings/{WorkspaceSettingsDialog.tsx → workspace-settings-dialog.tsx} +3 -3
- package/client/features/update/api.ts +1 -1
- package/client/features/views/api.ts +64 -131
- package/client/features/views/pending-view-screen.tsx +282 -0
- package/client/features/views/use-view-actions.ts +151 -0
- package/client/features/views/use-view-drafts.ts +88 -0
- package/client/features/views/{ViewManager.tsx → view-manager.tsx} +13 -13
- package/client/features/views/view-presentation.ts +4 -5
- package/client/features/views/view-submission.ts +88 -0
- package/client/features/workspace/add/api.ts +80 -0
- package/client/features/{home/workspace-setup/CreateWorkspaceDialog.tsx → workspace/add/create-workspace-dialog.tsx} +56 -42
- package/client/features/workspace/add/import-workspace-dialog.tsx +81 -0
- package/client/features/{home/workspace-setup/useWorkspaceImport.ts → workspace/add/use-workspace-import.ts} +1 -1
- package/client/features/workspace/add/workspace-agent-options.ts +53 -0
- package/client/features/{home/workspace-setup/WorkspaceAgentStep.tsx → workspace/add/workspace-agent-selector.tsx} +59 -98
- package/client/features/{home/workspace-setup/WorkspaceDialogContent.tsx → workspace/add/workspace-dialog-content.tsx} +1 -1
- package/client/features/workspace/api.ts +24 -15
- package/client/features/workspace/browser-tab-state.ts +16 -9
- package/client/features/workspace/moi-context.ts +14 -16
- package/client/features/workspace/setup/workspace-login-state.tsx +175 -0
- package/client/features/workspace/setup/workspace-recovery-states.tsx +125 -0
- package/client/features/workspace/setup/workspace-setup-panel.tsx +18 -0
- package/client/features/workspace/setup/workspace-setup.tsx +77 -0
- package/client/features/workspace/setup/workspace-welcome-state.tsx +81 -0
- package/client/features/workspace/tab-resolution.ts +16 -29
- package/client/features/workspace/{ThemePanel.tsx → theme-panel.tsx} +3 -3
- package/client/features/workspace/use-workspace-navigation.ts +245 -0
- package/client/features/workspace/workspace-content.tsx +641 -0
- package/client/features/workspace/workspace-identity.tsx +40 -0
- package/client/features/workspace/workspace-menu.tsx +63 -0
- package/client/features/{home → workspace}/workspace-presentation.tsx +10 -3
- package/client/features/workspace/workspace-screen.tsx +28 -0
- package/client/features/workspace/{WorkspaceSplitLayout.tsx → workspace-split-layout.tsx} +1 -1
- package/client/features/workspace/{WorkspaceTabs.tsx → workspace-tabs.tsx} +2 -2
- package/client/index.css +2 -2
- package/client/index.html +1 -1
- package/client/index.tsx +5 -1
- package/client/lib/agent-availability.ts +0 -5
- package/client/main.tsx +1 -1
- package/client/runtime/{useWorkspaceEvents.ts → use-workspace-events.ts} +10 -18
- package/client/store/ui.ts +25 -29
- package/dist/chunk-08ndj2rg.js +2 -0
- package/dist/chunk-2x040tmg.js +68 -0
- package/dist/chunk-3smxq0ts.js +1 -0
- package/dist/chunk-68ch5hs8.js +2 -0
- package/dist/{chunk-z3byfve5.js → chunk-9vg3xa81.js} +2 -2
- package/dist/chunk-c2p00p9j.css +1 -0
- package/dist/chunk-cs833y9j.js +1 -0
- package/dist/{chunk-97eg9mjn.js → chunk-d7cbm65e.js} +1 -1
- package/dist/{chunk-efdyz6xp.js → chunk-hvh9f5h0.js} +1 -1
- package/dist/{chunk-vfpsc75k.js → chunk-jvyvwwv3.js} +1 -1
- package/dist/chunk-nwevqe86.js +10 -0
- package/dist/{chunk-3a48fyf7.js → chunk-q0gbdts4.js} +4 -4
- package/dist/chunk-rt30jbcm.js +1 -0
- package/dist/chunk-y5y3kj67.js +1 -0
- package/dist/index.html +2 -2
- package/lib/format.ts +1 -1
- package/lib/harness-instructions.ts +30 -0
- package/lib/ids.ts +3 -6
- package/lib/moi-context.ts +102 -75
- package/lib/navigation.ts +48 -87
- package/lib/scratchpad-skew.ts +3 -3
- package/lib/session-drafts.ts +10 -0
- package/lib/types.ts +92 -51
- package/lib/update.ts +1 -1
- package/lib/view-build-directives.ts +12 -0
- package/lib/workspace-layout.ts +1 -1
- package/lib/workspace-tabs.ts +12 -7
- package/package.json +7 -2
- package/server/AGENTS.md +10 -4
- package/server/README.md +102 -0
- package/server/agent-launcher.ts +27 -0
- package/server/api/harnesses.ts +56 -0
- package/server/{api.ts → api/index.ts} +197 -299
- package/server/app-config.ts +45 -14
- package/server/app-settings.ts +1 -1
- package/server/applets/applet-css.ts +1 -1
- package/server/applets/build-applet.ts +4 -4
- package/server/applets/build-worker.ts +3 -2
- package/server/applets/config.ts +1 -1
- package/server/{functions-worker.ts → applets/functions-worker.ts} +1 -1
- package/server/{functions.ts → applets/functions.ts} +3 -2
- package/server/applets/index.ts +2 -2
- package/server/{thumbnails.ts → applets/thumbnails.ts} +1 -1
- package/server/{applet-typecheck.ts → applets/typecheck.ts} +4 -4
- package/server/{ui-components.ts → applets/ui-components.ts} +2 -2
- package/server/applets/view-source.ts +7 -1
- package/server/{views.ts → applets/views.ts} +35 -46
- package/server/{widgets.ts → applets/widgets.ts} +2 -2
- package/server/cli/applet-selector.ts +19 -0
- package/server/cli/args.ts +5 -0
- package/server/{cli-colors.ts → cli/colors.ts} +1 -1
- package/server/cli/commands/bundle.ts +119 -0
- package/server/cli/commands/call-server-fn.ts +42 -0
- package/server/cli/commands/check.ts +53 -0
- package/server/cli/commands/config.ts +132 -0
- package/server/cli/commands/debug.ts +119 -0
- package/server/cli/commands/env.ts +162 -0
- package/server/cli/commands/hermes.ts +149 -0
- package/server/cli/commands/init.ts +286 -0
- package/server/cli/commands/navigate.ts +35 -0
- package/server/cli/commands/openclaw.ts +168 -0
- package/server/cli/commands/refresh.ts +39 -0
- package/server/cli/commands/scratch.ts +496 -0
- package/server/cli/commands/service.ts +298 -0
- package/server/cli/commands/skill.ts +122 -0
- package/server/cli/commands/start.ts +138 -0
- package/server/cli/commands/status.ts +80 -0
- package/server/cli/commands/tabs.ts +43 -0
- package/server/cli/commands/theme.ts +192 -0
- package/server/cli/commands/ui-components.ts +15 -0
- package/server/cli/commands/update.ts +192 -0
- package/server/cli/commands/version.ts +9 -0
- package/server/cli/commands/views.ts +87 -0
- package/server/cli/control.ts +89 -0
- package/server/{cli-env.ts → cli/env.ts} +78 -56
- package/server/cli/index.ts +171 -0
- package/server/{cli-pc.ts → cli/pc.ts} +1 -1
- package/server/cli/provider.ts +25 -0
- package/server/cli/server-version.ts +16 -0
- package/server/cli/server.ts +81 -0
- package/server/{cli-ui-components.ts → cli/ui-components.ts} +5 -5
- package/server/cli.ts +2 -3215
- package/server/collab/manager.ts +3 -3
- package/server/collab/skill/index.ts +2 -2
- package/server/control.ts +97 -78
- package/server/data-dir.ts +13 -0
- package/server/harness/README.md +55 -25
- package/server/harness/acp/NOTES.md +11 -11
- package/server/harness/acp/adapter.ts +2 -2
- package/server/harness/acp/archived.ts +3 -3
- package/server/harness/acp/client.ts +4 -3
- package/server/harness/acp/discovery.ts +3 -3
- package/server/harness/acp/run-durations.ts +1 -1
- package/server/harness/acp/session.ts +9 -12
- package/server/harness/auth.ts +303 -0
- package/server/harness/claude-code/NOTES.md +9 -7
- package/server/harness/claude-code/adapter.ts +13 -8
- package/server/harness/claude-code/auth.ts +127 -18
- package/server/harness/claude-code/cli.ts +3 -1
- package/server/harness/claude-code/git-worktree.ts +5 -2
- package/server/harness/claude-code/index.ts +7 -1
- package/server/harness/claude-code/mcp.ts +3 -1
- package/server/harness/claude-code/models.ts +2 -0
- package/server/harness/claude-code/session.ts +13 -39
- package/server/harness/claude-code/sessions.ts +8 -12
- package/server/harness/codex/NOTES.md +35 -16
- package/server/harness/codex/adapter.ts +5 -3
- package/server/harness/codex/auth.ts +86 -19
- package/server/harness/codex/client.ts +30 -34
- package/server/harness/codex/index.ts +20 -1
- package/server/harness/codex/permissions.ts +3 -3
- package/server/harness/codex/probe.ts +3 -5
- package/server/harness/codex/session.ts +20 -25
- package/server/harness/codex/thread-list.ts +74 -0
- package/server/harness/codex/transport.ts +5 -5
- package/server/harness/executable.ts +42 -18
- package/server/harness/fork.ts +12 -0
- package/server/harness/hermes/NOTES.md +70 -70
- package/server/harness/hermes/discovery.ts +1 -1
- package/server/harness/openclaw/NOTES.md +24 -24
- package/server/harness/openclaw/adapter.ts +4 -4
- package/server/harness/openclaw/compat.ts +1 -1
- package/server/harness/openclaw/session.ts +6 -31
- package/server/harness/registry.ts +1 -1
- package/server/harness/session-title.ts +12 -3
- package/server/harness/shell-path.ts +31 -21
- package/server/harness/types.ts +17 -5
- package/server/navigation-relay.ts +1 -1
- package/server/open-browser.ts +7 -0
- package/server/{scratchpad-assets.ts → scratchpad/assets.ts} +4 -4
- package/server/{scratchpad.ts → scratchpad/document.ts} +8 -8
- package/server/{scratchpad-executor.ts → scratchpad/executor.ts} +7 -7
- package/server/{scratchpad-relay.ts → scratchpad/relay.ts} +4 -5
- package/server/{scratchpad-shape-defaults.ts → scratchpad/shape-defaults.ts} +2 -2
- package/server/server-cwd.ts +1 -1
- package/server/service.ts +18 -4
- package/server/sessions/archive.ts +32 -0
- package/server/{attachment-message.ts → sessions/attachment-message.ts} +1 -1
- package/server/sessions/config.ts +41 -0
- package/server/sessions/lifecycle.ts +17 -0
- package/server/sessions/pending-views.ts +164 -0
- package/server/sessions/selected.ts +199 -0
- package/server/sessions/store.ts +127 -0
- package/server/sessions/view-sessions.ts +267 -0
- package/server/{skills-template.ts → skills/template.ts} +1 -1
- package/server/{skill-update.ts → skills/update.ts} +5 -5
- package/server/{skill-version.ts → skills/version.ts} +4 -4
- package/server/static.ts +1 -1
- package/server/status.ts +6 -4
- package/server/web.ts +58 -49
- package/server/{env-apply.ts → workspaces/env-apply.ts} +5 -5
- package/server/{workspace-env.ts → workspaces/env.ts} +30 -3
- package/server/{workspace-import.ts → workspaces/import.ts} +4 -4
- package/server/{workspace-init.ts → workspaces/init.ts} +10 -6
- package/server/{layout.ts → workspaces/layout.ts} +2 -2
- package/server/{preview.ts → workspaces/preview.ts} +1 -1
- package/server/{registry.ts → workspaces/registry.ts} +17 -7
- package/server/{required-env.ts → workspaces/required-env.ts} +3 -3
- package/server/{moi-scaffold.ts → workspaces/scaffold.ts} +4 -3
- package/server/{tabs.ts → workspaces/tabs.ts} +7 -10
- package/ui-components/button.tsx +1 -1
- package/ui-components/docs/attachment.md +2 -2
- package/ui-components/docs/button.md +1 -1
- package/ui-components/docs/calendar.md +1 -1
- package/ui-components/docs/chart.md +4 -4
- package/ui-components/docs/data-table.md +1 -1
- package/ui-components/docs/drawer.md +1 -1
- package/ui-components/docs/field.md +1 -1
- package/ui-components/docs/input.md +2 -2
- package/ui-components/docs/label.md +2 -2
- package/ui-components/docs/table.md +2 -2
- package/workspace/.claude/skills/moi-workspace/SKILL.md +61 -32
- package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +4 -7
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +2 -2
- package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +2 -2
- package/client/features/chat/ChatPopup.tsx +0 -98
- package/client/features/chat/composer/banners/AgentAvailabilityBanner.tsx +0 -101
- package/client/features/chat/sessions/useSelectedSession.ts +0 -185
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +0 -92
- package/client/features/overview/WorkspaceName.tsx +0 -60
- package/client/features/views/ViewBuilder.tsx +0 -239
- package/client/features/views/useViewBuilderActions.ts +0 -103
- package/client/features/views/useViewBuilderDrafts.ts +0 -68
- package/client/features/workspace/WorkspaceScreen.tsx +0 -839
- package/client/features/workspace/useWorkspaceNavigation.ts +0 -203
- package/dist/chunk-2jncyq65.js +0 -1
- package/dist/chunk-e2q5ken7.js +0 -68
- package/dist/chunk-h2kj1ysj.js +0 -1
- package/dist/chunk-jf6czgrz.js +0 -2
- package/dist/chunk-nez8sdta.js +0 -1
- package/dist/chunk-nzwgm8vc.css +0 -1
- package/dist/chunk-ph0h6h86.js +0 -1
- package/dist/chunk-ryg9z3kn.js +0 -10
- package/dist/chunk-tpn177bt.js +0 -2
- package/lib/view-builder-directives.ts +0 -16
- package/server/agent.ts +0 -223
- package/server/chat-selection.ts +0 -22
- package/server/selected-session.ts +0 -152
- package/server/session-config.ts +0 -136
- package/server/view-builders.ts +0 -453
- /package/client/components/shared/{AgentBlobatar.tsx → agent-blobatar.tsx} +0 -0
- /package/client/components/shared/{BottomPanel.tsx → bottom-panel.tsx} +0 -0
- /package/client/components/shared/{Composer.tsx → composer.tsx} +0 -0
- /package/client/components/shared/{LedLogo.tsx → led-logo.tsx} +0 -0
- /package/client/components/shared/{PanelHeader.tsx → panel-header.tsx} +0 -0
- /package/client/components/shared/{ReorderableList.tsx → reorderable-list.tsx} +0 -0
- /package/client/components/shared/{WorkspaceIcon.tsx → workspace-icon.tsx} +0 -0
- /package/client/features/applets/{WidgetErrorBoundary.tsx → widget-error-boundary.tsx} +0 -0
- /package/client/features/chat/composer/attachments/{AttachmentChip.tsx → attachment-chip.tsx} +0 -0
- /package/client/features/chat/messages/{ChatPromptBubbles.tsx → chat-prompt-bubbles.tsx} +0 -0
- /package/client/features/chat/messages/{ShimmerText.tsx → shimmer-text.tsx} +0 -0
- /package/client/features/chat/messages/tool-group/{CodeBlock.tsx → code-block.tsx} +0 -0
- /package/client/features/chat/messages/tool-group/{Collapse.tsx → collapse.tsx} +0 -0
- /package/client/features/chat/messages/{useStickToBottom.ts → use-stick-to-bottom.ts} +0 -0
- /package/client/features/connectors/{IconMcp.tsx → icon-mcp.tsx} +0 -0
- /package/client/features/dev/{BlobatarShapesPage.tsx → blobatar-shapes-page.tsx} +0 -0
- /package/client/features/dev/{HarnessDebugPage.tsx → harness-debug-page.tsx} +0 -0
- /package/client/features/dev/{TextureLabPage.tsx → texture-lab-page.tsx} +0 -0
- /package/client/features/dev/{ToolCallsPage.tsx → tool-calls-page.tsx} +0 -0
- /package/client/features/drawings/{DrawingLayer.tsx → drawing-layer.tsx} +0 -0
- /package/client/features/home/{WorkspacePreview.tsx → workspace-preview.tsx} +0 -0
- /package/client/features/overview/{useGridReconcile.ts → use-grid-reconcile.ts} +0 -0
- /package/client/features/scratchpad/{ScratchpadControls.tsx → scratchpad-controls.tsx} +0 -0
- /package/client/features/settings/{SettingsLayout.tsx → settings-layout.tsx} +0 -0
- /package/client/features/update/{UpdateControl.tsx → update-control.tsx} +0 -0
- /package/client/features/workspace/{UnavailablePage.tsx → unavailable-page.tsx} +0 -0
- /package/client/features/workspace/{useFitsSplitLayout.ts → use-fits-split-layout.ts} +0 -0
- /package/client/features/workspace/{WorkspaceContext.tsx → workspace-context.tsx} +0 -0
- /package/client/features/workspace/{WorkspaceLayoutContext.tsx → workspace-layout-context.tsx} +0 -0
- /package/server/{bundle-queue.ts → applets/bundle-queue.ts} +0 -0
- /package/server/{applet-log.ts → applets/log.ts} +0 -0
- /package/server/{cli-ui.ts → cli/ui.ts} +0 -0
- /package/server/{workspace-config.ts → workspaces/config.ts} +0 -0
- /package/server/{icon.ts → workspaces/icon.ts} +0 -0
- /package/server/{theme.ts → workspaces/theme.ts} +0 -0
package/dist/chunk-e2q5ken7.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import{$ as wf,$a as Gb,$b as Rb,A as M8,Aa as rI,Ab as tU,Ac as Ss,B as y2,Ba as aU,Bb as Db,Bc as PR,C as GQ,Ca as aI,Cb as bl,Cc as _R,D as P8,Da as oI,Db as aP,E as SZ,Ea as nI,Eb as kl,F as wV,Fa as sI,Fb as Tn,G as m0,Ga as tI,Gb as fW,H as x2,Ha as oU,Hb as Lb,I as xx,Ia as kR,Ib as f2,J as X2,Ja as TF,Jb as XR,K as z0,Ka as lx,Kb as lo,L as Wa,Lb as Mb,M as uJ,Ma as eI,Mb as Pb,N as gJ,Na as _F,Nb as vJ,O as T5,Oa as WJ,Ob as S6,P as zj,Pa as $b,Pb as _b,Q as B0,Qa as Zb,Qb as jb,R as JJ,Ra as wn,Rb as hB,S as a0,Sa as EI,Sb as iy,T as V$,Ta as Jb,Tb as Ob,U as j0,Ua as Hb,Ub as Tb,V as al,Va as Qb,W as bI,Wa as Bb,Wb as Cb,X as jn,Y as jw,Ya as Xb,Yb as wb,Z as NG,Za as zb,Zb as Eb,_ as kI,_b as Sb,aa as fh,ab as Tw,ac as cW,b as c,ba as ja,bb as nU,bc as Ib,c as Xq0,ca as mh,cb as jF,d as X1,da as wI,db as js,dc as _f,e as r2,ea as lh,eb as Ub,ec as Ta,f as L1,fa as rJ,fb as uq,fc as $U,g as l1,ga as yI,gb as Jv,h as J0,ha as xI,hc as jf,i as y0,ia as gQ,ib as k5,ic as bb,j as Uz,ja as hI,jb as Cw,jc as kb,k as xT,ka as vI,kb as On,kc as o5,l as U0,la as gI,lb as Kb,lc as zi,m as e4,ma as _s,mb as Yb,mc as ry,n as P2,na as fI,nb as ly,nc as qf,o as I1,oa as mI,ob as SI,oc as hK,p as M3,pa as uI,pb as Fb,pc as Lf,q as lT,qa as pI,qb as xB,qc as YE,r as s0,ra as cI,rb as ei,rc as FE,s as P1,sa as O8,sb as Oa,sc as MR,t as n3,ta as dI,tb as Wb,u as zQ,ua as ZJ,ub as qb,uc as qR,v as gC,va as R$,vb as Nb,vc as j4,w as BG,wa as $i,wb as Vb,wc as KU,x as EV,xa as Ow,xb as sU,xc as UR,y as fC,ya as lI,yc as z5,z as SV,za as iI,zb as Ab,zc as e1}from"/chunk-ryg9z3kn.js";import{Ec as T8}from"/chunk-jf6czgrz.js";import{Fc as _E,Gc as jE,Hc as OE,Ic as j3,Jc as bG}from"/chunk-tpn177bt.js";import{Nc as q1,Oc as P4,Pc as g5}from"/chunk-vfpsc75k.js";import{Qc as m,Rc as kG,Sc as Y5,Tc as Lh,Uc as W2,Vc as xn}from"/chunk-z3byfve5.js";import{Wc as P,Xc as O5,Yc as C5,Zc as WL}from"/chunk-97eg9mjn.js";var AZ=O5((Bt)=>{var v8=P(m());function ns($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var ss=typeof Object.is==="function"?Object.is:ns,ts=v8.useState,es=v8.useEffect,$t=v8.useLayoutEffect,Zt=v8.useDebugValue;function Jt($,Z){var J=Z(),H=ts({inst:{value:J,getSnapshot:Z}}),Q=H[0].inst,B=H[1];return $t(function(){Q.value=J,Q.getSnapshot=Z,LN(Q)&&B({inst:Q})},[$,J,Z]),es(function(){return LN(Q)&&B({inst:Q}),$(function(){LN(Q)&&B({inst:Q})})},[$]),Zt(J),J}function LN($){var Z=$.getSnapshot;$=$.value;try{var J=Z();return!ss($,J)}catch(H){return!0}}function Ht($,Z){return Z()}var Qt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ht:Jt;Bt.useSyncExternalStore=v8.useSyncExternalStore!==void 0?v8.useSyncExternalStore:Qt});var cf=O5((OZ1,pf)=>{var gf=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,m70=/\n/g,u70=/^\s*/,p70=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,c70=/^:\s*/,d70=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l70=/^[;\s]*/,i70=/^\s+|\s+$/g,r70=`
|
|
2
|
-
`,ff="/",mf="*",h$="",a70="comment",o70="declaration";function n70($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var J=1,H=1;function Q(q){var N=q.match(m70);if(N)J+=N.length;var A=q.lastIndexOf(r70);H=~A?q.length-A:H+q.length}function B(){var q={line:J,column:H};return function(N){return N.position=new X(q),U(),N}}function X(q){this.start=q,this.end={line:J,column:H},this.source=Z.source}X.prototype.content=$;function z(q){var N=Error(Z.source+":"+J+":"+H+": "+q);if(N.reason=q,N.filename=Z.source,N.line=J,N.column=H,N.source=$,Z.silent);else throw N}function G(q){var N=q.exec($);if(!N)return;var A=N[0];return Q(A),$=$.slice(A.length),N}function U(){G(u70)}function K(q){var N;q=q||[];while(N=Y())if(N!==!1)q.push(N);return q}function Y(){var q=B();if(ff!=$.charAt(0)||mf!=$.charAt(1))return;var N=2;while(h$!=$.charAt(N)&&(mf!=$.charAt(N)||ff!=$.charAt(N+1)))++N;if(N+=2,h$===$.charAt(N-1))return z("End of comment missing");var A=$.slice(2,N-2);return H+=2,Q(A),$=$.slice(N),H+=2,q({type:a70,comment:A})}function F(){var q=B(),N=G(p70);if(!N)return;if(Y(),!G(c70))return z("property missing ':'");var A=G(d70),V=q({type:o70,property:uf(N[0].replace(gf,h$)),value:A?uf(A[0].replace(gf,h$)):h$});return G(l70),V}function W(){var q=[];K(q);var N;while(N=F())if(N!==!1)q.push(N),K(q);return q}return U(),W()}function uf($){return $?$.replace(i70,h$):h$}pf.exports=n70});var df=O5((mB)=>{var s70=mB&&mB.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(mB,"__esModule",{value:!0});mB.default=e70;var t70=s70(cf());function e70($,Z){let J=null;if(!$||typeof $!=="string")return J;let H=(0,t70.default)($),Q=typeof Z==="function";return H.forEach((B)=>{if(B.type!=="declaration")return;let{property:X,value:z}=B;if(Q)Z(X,z,B);else if(z)J=J||{},J[X]=z}),J}});var of=O5((rf)=>{Object.defineProperty(rf,"__esModule",{value:!0});rf.camelCase=void 0;var $$0=/^--[a-zA-Z0-9_-]+$/,Z$0=/-([a-z])/g,J$0=/^[^-]+$/,H$0=/^-(webkit|moz|ms|o|khtml)-/,Q$0=/^-(ms)-/,B$0=function($){return!$||J$0.test($)||$$0.test($)},X$0=function($,Z){return Z.toUpperCase()},lf=function($,Z){return"".concat(Z,"-")},z$0=function($,Z){if(Z===void 0)Z={};if(B$0($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(Q$0,lf);else $=$.replace(H$0,lf);return $.replace(Z$0,X$0)};rf.camelCase=z$0});var sf=O5((JM,nf)=>{var G$0=JM&&JM.__importDefault||function($){return $&&$.__esModule?$:{default:$}},U$0=G$0(df()),K$0=of();function ZM($,Z){var J={};if(!$||typeof $!=="string")return J;return(0,U$0.default)($,function(H,Q){if(H&&Q)J[(0,K$0.camelCase)(H,Z)]=Q}),J}ZM.default=ZM;nf.exports=ZM});var Du=O5((Nz1,Au)=>{var JW=Object.prototype.hasOwnProperty,Vu=Object.prototype.toString,Ku=Object.defineProperty,Yu=Object.getOwnPropertyDescriptor,Fu=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return Vu.call(Z)==="[object Array]"},Wu=function(Z){if(!Z||Vu.call(Z)!=="[object Object]")return!1;var J=JW.call(Z,"constructor"),H=Z.constructor&&Z.constructor.prototype&&JW.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!J&&!H)return!1;var Q;for(Q in Z);return typeof Q>"u"||JW.call(Z,Q)},qu=function(Z,J){if(Ku&&J.name==="__proto__")Ku(Z,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else Z[J.name]=J.newValue},Nu=function(Z,J){if(J==="__proto__"){if(!JW.call(Z,J))return;else if(Yu)return Yu(Z,J).value}return Z[J]};Au.exports=function $(){var Z,J,H,Q,B,X,z=arguments[0],G=1,U=arguments.length,K=!1;if(typeof z==="boolean")K=z,z=arguments[1]||{},G=2;if(z==null||typeof z!=="object"&&typeof z!=="function")z={};for(;G<U;++G)if(Z=arguments[G],Z!=null){for(J in Z)if(H=Nu(z,J),Q=Nu(Z,J),z!==Q){if(K&&Q&&(Wu(Q)||(B=Fu(Q)))){if(B)B=!1,X=H&&Fu(H)?H:[];else X=H&&Wu(H)?H:{};qu(z,{name:J,newValue:$(K,X,Q)})}else if(typeof Q<"u")qu(z,{name:J,newValue:Q})}}return z}});var Uc=O5((hU1,Gc)=>{function rp($){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 J=$[Z],H=typeof J;if((H==="object"||H==="function")&&!Object.isFrozen(J))rp(J)}),$}class rM{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ap($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function K7($,...Z){let J=Object.create(null);for(let H in $)J[H]=$[H];return Z.forEach(function(H){for(let Q in H)J[Q]=H[Q]}),J}var xH0="</span>",up=($)=>{return!!$.scope},hH0=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let J=$.split(".");return[`${Z}${J.shift()}`,...J.map((H,Q)=>`${H}${"_".repeat(Q+1)}`)].join(" ")}return`${Z}${$}`};class op{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=ap($)}openNode($){if(!up($))return;let Z=hH0($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!up($))return;this.buffer+=xH0}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var pp=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class aM{constructor(){this.rootNode=pp(),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=pp({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((J)=>this._walk($,J)),$.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)=>{aM._collapse(Z)})}}class np extends aM{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let J=$.root;if(Z)J.scope=`language:${Z}`;this.add(J)}toHTML(){return new op(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function HX($){if(!$)return null;if(typeof $==="string")return $;return $.source}function sp($){return i$("(?=",$,")")}function vH0($){return i$("(?:",$,")*")}function gH0($){return i$("(?:",$,")?")}function i$(...$){return $.map((J)=>HX(J)).join("")}function fH0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function oM(...$){return"("+(fH0($).capture?"":"?:")+$.map((H)=>HX(H)).join("|")+")"}function tp($){return new RegExp($.toString()+"|").exec("").length-1}function mH0($,Z){let J=$&&$.exec(Z);return J&&J.index===0}var uH0=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function nM($,{joinWith:Z}){let J=0;return $.map((H)=>{J+=1;let Q=J,B=HX(H),X="";while(B.length>0){let z=uH0.exec(B);if(!z){X+=B;break}if(X+=B.substring(0,z.index),B=B.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1])X+="\\"+String(Number(z[1])+Q);else if(X+=z[0],z[0]==="(")J++}return X}).map((H)=>`(${H})`).join(Z)}var pH0=/\b\B/,ep="[a-zA-Z]\\w*",sM="[a-zA-Z_]\\w*",$c="\\b\\d+(\\.\\d+)?",Zc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Jc="\\b(0b[01]+)",cH0="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",dH0=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=i$(Z,/.*\b/,$.binary,/\b.*/);return K7({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(J,H)=>{if(J.index!==0)H.ignoreMatch()}},$)},QX={begin:"\\\\[\\s\\S]",relevance:0},lH0={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[QX]},iH0={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[QX]},rH0={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/},VW=function($,Z,J={}){let H=K7({scope:"comment",begin:$,end:Z,contains:[]},J);H.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 Q=oM("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 H.contains.push({begin:i$(/[ ]+/,"(",Q,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),H},aH0=VW("//","$"),oH0=VW("/\\*","\\*/"),nH0=VW("#","$"),sH0={scope:"number",begin:$c,relevance:0},tH0={scope:"number",begin:Zc,relevance:0},eH0={scope:"number",begin:Jc,relevance:0},$Q0={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[QX,{begin:/\[/,end:/\]/,relevance:0,contains:[QX]}]},ZQ0={scope:"title",begin:ep,relevance:0},JQ0={scope:"title",begin:sM,relevance:0},HQ0={begin:"\\.\\s*"+sM,relevance:0},QQ0=function($){return Object.assign($,{"on:begin":(Z,J)=>{J.data._beginMatch=Z[1]},"on:end":(Z,J)=>{if(J.data._beginMatch!==Z[1])J.ignoreMatch()}})},qW=Object.freeze({__proto__:null,APOS_STRING_MODE:lH0,BACKSLASH_ESCAPE:QX,BINARY_NUMBER_MODE:eH0,BINARY_NUMBER_RE:Jc,COMMENT:VW,C_BLOCK_COMMENT_MODE:oH0,C_LINE_COMMENT_MODE:aH0,C_NUMBER_MODE:tH0,C_NUMBER_RE:Zc,END_SAME_AS_BEGIN:QQ0,HASH_COMMENT_MODE:nH0,IDENT_RE:ep,MATCH_NOTHING_RE:pH0,METHOD_GUARD:HQ0,NUMBER_MODE:sH0,NUMBER_RE:$c,PHRASAL_WORDS_MODE:rH0,QUOTE_STRING_MODE:iH0,REGEXP_MODE:$Q0,RE_STARTERS_RE:cH0,SHEBANG:dH0,TITLE_MODE:ZQ0,UNDERSCORE_IDENT_RE:sM,UNDERSCORE_TITLE_MODE:JQ0});function BQ0($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function XQ0($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function zQ0($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=BQ0,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function GQ0($,Z){if(!Array.isArray($.illegal))return;$.illegal=oM(...$.illegal)}function UQ0($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function KQ0($,Z){if($.relevance===void 0)$.relevance=1}var YQ0=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let J=Object.assign({},$);Object.keys($).forEach((H)=>{delete $[H]}),$.keywords=J.keywords,$.begin=i$(J.beforeMatch,sp(J.begin)),$.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},$.relevance=0,delete J.beforeMatch},FQ0=["of","and","for","in","not","or","if","then","parent","list","value"],WQ0="keyword";function Hc($,Z,J=WQ0){let H=Object.create(null);if(typeof $==="string")Q(J,$.split(" "));else if(Array.isArray($))Q(J,$);else Object.keys($).forEach(function(B){Object.assign(H,Hc($[B],Z,B))});return H;function Q(B,X){if(Z)X=X.map((z)=>z.toLowerCase());X.forEach(function(z){let G=z.split("|");H[G[0]]=[B,qQ0(G[0],G[1])]})}}function qQ0($,Z){if(Z)return Number(Z);return NQ0($)?0:1}function NQ0($){return FQ0.includes($.toLowerCase())}var cp={},l$=($)=>{console.error($)},dp=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},XH=($,Z)=>{if(cp[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),cp[`${$}/${Z}`]=!0},NW=Error();function Qc($,Z,{key:J}){let H=0,Q=$[J],B={},X={};for(let z=1;z<=Z.length;z++)X[z+H]=Q[z],B[z+H]=!0,H+=tp(Z[z-1]);$[J]=X,$[J]._emit=B,$[J]._multi=!0}function VQ0($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw l$("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),NW;if(typeof $.beginScope!=="object"||$.beginScope===null)throw l$("beginScope must be object"),NW;Qc($,$.begin,{key:"beginScope"}),$.begin=nM($.begin,{joinWith:""})}function AQ0($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw l$("skip, excludeEnd, returnEnd not compatible with endScope: {}"),NW;if(typeof $.endScope!=="object"||$.endScope===null)throw l$("endScope must be object"),NW;Qc($,$.end,{key:"endScope"}),$.end=nM($.end,{joinWith:""})}function DQ0($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function LQ0($){if(DQ0($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};VQ0($),AQ0($)}function MQ0($){function Z(X,z){return new RegExp(HX(X),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class J{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+=tp(X)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let X=this.regexes.map((z)=>z[1]);this.matcherRe=Z(nM(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((K,Y)=>Y>0&&K!==void 0),U=this.matchIndexes[G];return z.splice(0,G),Object.assign(z,U)}}class H{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 J;return this.rules.slice(X).forEach(([G,U])=>z.addRule(G,U)),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 U=this.getMatcher(0);U.lastIndex=this.lastIndex+1,G=U.exec(X)}if(G){if(this.regexIndex+=G.position+1,this.regexIndex===this.count)this.considerAll()}return G}}function Q(X){let z=new H;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 B(X,z){let G=X;if(X.isCompiled)return G;[XQ0,UQ0,LQ0,YQ0].forEach((K)=>K(X,z)),$.compilerExtensions.forEach((K)=>K(X,z)),X.__beforeBegin=null,[zQ0,GQ0,KQ0].forEach((K)=>K(X,z)),X.isCompiled=!0;let U=null;if(typeof X.keywords==="object"&&X.keywords.$pattern)X.keywords=Object.assign({},X.keywords),U=X.keywords.$pattern,delete X.keywords.$pattern;if(U=U||/\w+/,X.keywords)X.keywords=Hc(X.keywords,$.case_insensitive);if(G.keywordPatternRe=Z(U,!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=HX(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(K){return PQ0(K==="self"?X:K)})),X.contains.forEach(function(K){B(K,G)}),X.starts)B(X.starts,z);return G.matcher=Q(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=K7($.classNameAliases||{}),B($)}function Bc($){if(!$)return!1;return $.endsWithParent||Bc($.starts)}function PQ0($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return K7($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(Bc($))return K7($,{starts:$.starts?K7($.starts):null});if(Object.isFrozen($))return K7($);return $}var _Q0="11.11.1";class Xc extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var iM=ap,lp=K7,ip=Symbol("nomatch"),jQ0=7,zc=function($){let Z=Object.create(null),J=Object.create(null),H=[],Q=!0,B="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:np};function G(b){return z.noHighlightRe.test(b)}function U(b){let h=b.className+" ";h+=b.parentNode?b.parentNode.className:"";let v=z.languageDetectRe.exec(h);if(v){let f=C(v[1]);if(!f)dp(B.replace("{}",v[1])),dp("Falling back to no-highlight mode for this block.",b);return f?v[1]:"no-highlight"}return h.split(/\s+/).find((f)=>G(f)||C(f))}function K(b,h,v){let f="",w="";if(typeof h==="object")f=b,v=h.ignoreIllegals,w=h.language;else XH("10.7.0","highlight(lang, code, ...args) has been deprecated."),XH("10.7.0",`Please use highlight(code, options) instead.
|
|
3
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),w=b,f=h;if(v===void 0)v=!0;let i={code:f,language:w};O("before:highlight",i);let r=i.result?i.result:Y(i.language,i.code,v);return r.code=i.code,O("after:highlight",r),r}function Y(b,h,v,f){let w=Object.create(null);function i(g,u){return g.keywords[u]}function r(){if(!a.keywords){$0.addText(Q0);return}let g=0;a.keywordPatternRe.lastIndex=0;let u=a.keywordPatternRe.exec(Q0),t="";while(u){t+=Q0.substring(g,u.index);let W0=N0.case_insensitive?u[0].toLowerCase():u[0],I0=i(a,W0);if(I0){let[c0,f0]=I0;if($0.addText(t),t="",w[W0]=(w[W0]||0)+1,w[W0]<=jQ0)_0+=f0;if(c0.startsWith("_"))t+=u[0];else{let T0=N0.classNameAliases[c0]||c0;s(u[0],T0)}}else t+=u[0];g=a.keywordPatternRe.lastIndex,u=a.keywordPatternRe.exec(Q0)}t+=Q0.substring(g),$0.addText(t)}function x(){if(Q0==="")return;let g=null;if(typeof a.subLanguage==="string"){if(!Z[a.subLanguage]){$0.addText(Q0);return}g=Y(a.subLanguage,Q0,!0,e[a.subLanguage]),e[a.subLanguage]=g._top}else g=W(Q0,a.subLanguage.length?a.subLanguage:null);if(a.relevance>0)_0+=g.relevance;$0.__addSublanguage(g._emitter,g.language)}function l(){if(a.subLanguage!=null)x();else r();Q0=""}function s(g,u){if(g==="")return;$0.startScope(u),$0.addText(g),$0.endScope()}function p(g,u){let t=1,W0=u.length-1;while(t<=W0){if(!g._emit[t]){t++;continue}let I0=N0.classNameAliases[g[t]]||g[t],c0=u[t];if(I0)s(c0,I0);else Q0=c0,r(),Q0="";t++}}function d(g,u){if(g.scope&&typeof g.scope==="string")$0.openNode(N0.classNameAliases[g.scope]||g.scope);if(g.beginScope){if(g.beginScope._wrap)s(Q0,N0.classNameAliases[g.beginScope._wrap]||g.beginScope._wrap),Q0="";else if(g.beginScope._multi)p(g.beginScope,u),Q0=""}return a=Object.create(g,{parent:{value:a}}),a}function o(g,u,t){let W0=mH0(g.endRe,t);if(W0){if(g["on:end"]){let I0=new rM(g);if(g["on:end"](u,I0),I0.isMatchIgnored)W0=!1}if(W0){while(g.endsParent&&g.parent)g=g.parent;return g}}if(g.endsWithParent)return o(g.parent,u,t)}function Z0(g){if(a.matcher.regexIndex===0)return Q0+=g[0],1;else return L0=!0,0}function H0(g){let u=g[0],t=g.rule,W0=new rM(t),I0=[t.__beforeBegin,t["on:begin"]];for(let c0 of I0){if(!c0)continue;if(c0(g,W0),W0.isMatchIgnored)return Z0(u)}if(t.skip)Q0+=u;else{if(t.excludeBegin)Q0+=u;if(l(),!t.returnBegin&&!t.excludeBegin)Q0=u}return d(t,g),t.returnBegin?0:u.length}function G0(g){let u=g[0],t=h.substring(g.index),W0=o(a,g,t);if(!W0)return ip;let I0=a;if(a.endScope&&a.endScope._wrap)l(),s(u,a.endScope._wrap);else if(a.endScope&&a.endScope._multi)l(),p(a.endScope,g);else if(I0.skip)Q0+=u;else{if(!(I0.returnEnd||I0.excludeEnd))Q0+=u;if(l(),I0.excludeEnd)Q0=u}do{if(a.scope)$0.closeNode();if(!a.skip&&!a.subLanguage)_0+=a.relevance;a=a.parent}while(a!==W0.parent);if(W0.starts)d(W0.starts,g);return I0.returnEnd?0:u.length}function X0(){let g=[];for(let u=a;u!==N0;u=u.parent)if(u.scope)g.unshift(u.scope);g.forEach((u)=>$0.openNode(u))}let Y0={};function A0(g,u){let t=u&&u[0];if(Q0+=g,t==null)return l(),0;if(Y0.type==="begin"&&u.type==="end"&&Y0.index===u.index&&t===""){if(Q0+=h.slice(u.index,u.index+1),!Q){let W0=Error(`0 width match regex (${b})`);throw W0.languageName=b,W0.badRule=Y0.rule,W0}return 1}if(Y0=u,u.type==="begin")return H0(u);else if(u.type==="illegal"&&!v){let W0=Error('Illegal lexeme "'+t+'" for mode "'+(a.scope||"<unnamed>")+'"');throw W0.mode=a,W0}else if(u.type==="end"){let W0=G0(u);if(W0!==ip)return W0}if(u.type==="illegal"&&t==="")return Q0+=`
|
|
4
|
-
`,1;if(V0>1e5&&V0>u.index*3)throw Error("potential infinite loop, way more iterations than matches");return Q0+=t,t.length}let N0=C(b);if(!N0)throw l$(B.replace("{}",b)),Error('Unknown language: "'+b+'"');let F0=MQ0(N0),n="",a=f||F0,e={},$0=new z.__emitter(z);X0();let Q0="",_0=0,M0=0,V0=0,L0=!1;try{if(!N0.__emitTokens){a.matcher.considerAll();for(;;){if(V0++,L0)L0=!1;else a.matcher.considerAll();a.matcher.lastIndex=M0;let g=a.matcher.exec(h);if(!g)break;let u=h.substring(M0,g.index),t=A0(u,g);M0=g.index+t}A0(h.substring(M0))}else N0.__emitTokens(h,$0);return $0.finalize(),n=$0.toHTML(),{language:b,value:n,relevance:_0,illegal:!1,_emitter:$0,_top:a}}catch(g){if(g.message&&g.message.includes("Illegal"))return{language:b,value:iM(h),illegal:!0,relevance:0,_illegalBy:{message:g.message,index:M0,context:h.slice(M0-100,M0+100),mode:g.mode,resultSoFar:n},_emitter:$0};else if(Q)return{language:b,value:iM(h),illegal:!1,relevance:0,errorRaised:g,_emitter:$0,_top:a};else throw g}}function F(b){let h={value:iM(b),illegal:!1,relevance:0,_top:X,_emitter:new z.__emitter(z)};return h._emitter.addText(b),h}function W(b,h){h=h||z.languages||Object.keys(Z);let v=F(b),f=h.filter(C).filter(T).map((l)=>Y(l,b,!1));f.unshift(v);let w=f.sort((l,s)=>{if(l.relevance!==s.relevance)return s.relevance-l.relevance;if(l.language&&s.language){if(C(l.language).supersetOf===s.language)return 1;else if(C(s.language).supersetOf===l.language)return-1}return 0}),[i,r]=w,x=i;return x.secondBest=r,x}function q(b,h,v){let f=h&&J[h]||v;b.classList.add("hljs"),b.classList.add(`language-${f}`)}function N(b){let h=null,v=U(b);if(G(v))return;if(O("before:highlightElement",{el:b,language:v}),b.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",b);return}if(b.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(b);if(z.throwUnescapedHTML)throw new Xc("One of your code blocks includes unescaped HTML.",b.innerHTML)}h=b;let f=h.textContent,w=v?K(f,{language:v,ignoreIllegals:!0}):W(f);if(b.innerHTML=w.value,b.dataset.highlighted="yes",q(b,v,w.language),b.result={language:w.language,re:w.relevance,relevance:w.relevance},w.secondBest)b.secondBest={language:w.secondBest.language,relevance:w.secondBest.relevance};O("after:highlightElement",{el:b,result:w,text:f})}function A(b){z=lp(z,b)}let V=()=>{j(),XH("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){j(),XH("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function j(){function b(){j()}if(document.readyState==="loading"){if(!L)window.addEventListener("DOMContentLoaded",b,!1);L=!0;return}document.querySelectorAll(z.cssSelector).forEach(N)}function M(b,h){let v=null;try{v=h($)}catch(f){if(l$("Language definition for '{}' could not be registered.".replace("{}",b)),!Q)throw f;else l$(f);v=X}if(!v.name)v.name=b;if(Z[b]=v,v.rawDefinition=h.bind(null,$),v.aliases)R(v.aliases,{languageName:b})}function _(b){delete Z[b];for(let h of Object.keys(J))if(J[h]===b)delete J[h]}function E(){return Object.keys(Z)}function C(b){return b=(b||"").toLowerCase(),Z[b]||Z[J[b]]}function R(b,{languageName:h}){if(typeof b==="string")b=[b];b.forEach((v)=>{J[v.toLowerCase()]=h})}function T(b){let h=C(b);return h&&!h.disableAutodetect}function I(b){if(b["before:highlightBlock"]&&!b["before:highlightElement"])b["before:highlightElement"]=(h)=>{b["before:highlightBlock"](Object.assign({block:h.el},h))};if(b["after:highlightBlock"]&&!b["after:highlightElement"])b["after:highlightElement"]=(h)=>{b["after:highlightBlock"](Object.assign({block:h.el},h))}}function y(b){I(b),H.push(b)}function S(b){let h=H.indexOf(b);if(h!==-1)H.splice(h,1)}function O(b,h){let v=b;H.forEach(function(f){if(f[v])f[v](h)})}function k(b){return XH("10.7.0","highlightBlock will be removed entirely in v12.0"),XH("10.7.0","Please use highlightElement now."),N(b)}Object.assign($,{highlight:K,highlightAuto:W,highlightAll:j,highlightElement:N,highlightBlock:k,configure:A,initHighlighting:V,initHighlightingOnLoad:D,registerLanguage:M,unregisterLanguage:_,listLanguages:E,getLanguage:C,registerAliases:R,autoDetection:T,inherit:lp,addPlugin:y,removePlugin:S}),$.debugMode=function(){Q=!1},$.safeMode=function(){Q=!0},$.versionString=_Q0,$.regex={concat:i$,lookahead:sp,either:oM,optional:gH0,anyNumberOfTimes:vH0};for(let b in qW)if(typeof qW[b]==="object")rp(qW[b]);return Object.assign($,qW),$},zH=zc({});zH.newInstance=()=>zc({});Gc.exports=zH;zH.HighlightJS=zH;zH.default=zH});var Ul=O5((xN1,Gl)=>{var oX0=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],zl=/[\n\r\u2028\u2029]/,nX0=/[\s#!"$&'():;<=>@\\^`|]/g;Gl.exports=function(Z){return Z.map(function(J){if(J==="")return"''";if(J&&typeof J==="object"){if("op"in J&&J.op==="glob"){if(typeof J.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(zl.test(J.pattern))throw TypeError("glob `pattern` must not contain line terminators");return J.pattern.replace(nX0,"\\$&")}if("op"in J&&typeof J.op==="string"){if(oX0.indexOf(J.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(J.op));return J.op.replace(/[\s\S]/g,"\\$&")}if("comment"in J&&typeof J.comment==="string"){if(zl.test(J.comment))throw TypeError("`comment` must not contain line terminators");return"#"+J.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(J)&&!/'/.test(J))return"'"+J.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(J))return'"'+J.replace(/(["\\$`!])/g,"\\$1")+'"';return String(J).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var Vl=O5((hN1,Nl)=>{var ql="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",Kl=new RegExp("^"+ql+"$"),Yl="|&;()<> \\t",sX0="'([^']*?)'",tX0='"((\\\\"|[^"])*?)"',eX0=/^#$/,Fl="'",Wl='"',CW="$",o$="",$z0=4294967296;for(wW=0;wW<4;wW++)o$+=($z0*Math.random()).toString(16);var wW,Zz0=new RegExp("^"+o$);function Jz0($,Z){var J=Z.lastIndex,H=[],Q;while(Q=Z.exec($))if(H[H.length]=Q,Z.lastIndex===Q.index)Z.lastIndex+=1;return Z.lastIndex=J,H}function Hz0($,Z,J){var H=typeof $==="function"?$(J):$[J];if(typeof H>"u"&&J!="")H="";else if(typeof H>"u")H="$";if(typeof H==="object")return Z+o$+JSON.stringify(H)+o$;return Z+H}function Qz0($,Z,J){if(!J)J={};var H=J.escape||"\\",Q=J.splitUnquoted===!0?`
|
|
5
|
-
`:typeof J.splitUnquoted==="string"?J.splitUnquoted:"",B="(\\"+H+`['"`+Yl+`]|[^\\s'"`+Yl+"])+",X=new RegExp(["("+ql+")","("+B+"|"+tX0+"|"+sX0+")+"].join("|"),"g"),z=Jz0($,X);if(z.length===0)return[];if(!Z)Z={};var G=!1;return z.map(function(U){var K=U[0];if(!K||G)return;if(Kl.test(K))return{op:K};var Y=!1,F=!1,W="",q=[],N=!1,A=null,V=!1,D;function L(){D+=1;var I,y,S=K.charAt(D);if(S==="{"){if(D+=1,K.charAt(D)==="}")throw Error("Bad substitution: "+K.slice(D-2,D+1));var O=1;I=D;while(O>0&&I<K.length){if(K.charAt(I)==="{"&&K.charAt(I-1)==="$")O+=1;else if(K.charAt(I)==="}")O-=1;I+=1}if(O!==0)throw Error("Bad substitution: "+K.slice(D));I-=1,y=K.slice(D,I),D=I}else if(/[*@#?$!_-]/.test(S))y=S,D+=1;else{var k=K.slice(D);if(I=k.match(/[^\w\d_]/),!I)y=k,D=K.length;else y=k.slice(0,I.index),D+=I.index-1}return Hz0(Z,"",y)}function j(){if(A===null)return;if(A===0){if(W!=="")q[q.length]=W,W=""}else{q[q.length]=W,W="";for(var I=1;I<A;I+=1)q[q.length]=""}A=null}for(D=0;D<K.length;D++){var M=K.charAt(D);if(Q&&M!==CW)j();if(V=V||!Y&&(M==="*"||M==="?"),F)W+=M,F=!1;else if(Y)if(M===Y)Y=!1;else if(Y==Fl)W+=M;else if(M===H)if(D+=1,M=K.charAt(D),M===Wl||M===H||M===CW)W+=M;else W+=H+M;else if(M===CW)W+=L();else W+=M;else if(M===Wl||M===Fl)Y=M,N=!0;else if(Kl.test(M))return{op:K};else if(eX0.test(M)){G=!0;var _={comment:$.slice(U.index+D+1)};if(W.length)return[W,_];return[_]}else if(M===H)F=!0;else if(M===CW){var E=L();if(!Q)W+=E;else for(var C=0;C<E.length;C+=1){var R=E.charAt(C);if(Q.indexOf(R)<0)j(),W+=R;else if(A===null)A=R===" "||R==="\t"||R===`
|
|
6
|
-
`?0:1;else if(R!==" "&&R!=="\t"&&R!==`
|
|
7
|
-
`)A+=1}}else W+=M}if(V)return{op:"glob",pattern:W};if(Q){if(A!==null&&A>0){q[q.length]=W,W="";for(var T=1;T<A;T+=1)q[q.length]=""}if(W!==""||N&&q.length===0)q[q.length]=W;return q}return W}).reduce(function(U,K){if(typeof K>"u")return U;return[].concat(K).forEach(function(Y){U[U.length]=Y}),U},[])}Nl.exports=function(Z,J,H){var Q=Qz0(Z,J,H);if(typeof J!=="function")return Q;return Q.reduce(function(B,X){if(typeof X==="object")return B[B.length]=X,B;var z=X.split(RegExp("("+o$+".*?"+o$+")","g"));if(z.length===1)return B[B.length]=z[0],B;return z.filter(Boolean).forEach(function(G){B[B.length]=Zz0.test(G)?JSON.parse(G.split(o$)[1]):G}),B},[])}});var ca=O5((Sq,pa)=>{(function($,Z){typeof Sq==="object"&&typeof pa<"u"?Z(Sq):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(Sq,function($){function Z(p){return function(o,Z0,H0,G0,X0,Y0,A0){return p(o,Z0,A0)}}function J(p){return function(o,Z0,H0,G0){if(!o||!Z0||typeof o!=="object"||typeof Z0!=="object")return p(o,Z0,H0,G0);var X0=G0.get(o),Y0=G0.get(Z0);if(X0&&Y0)return X0===Z0&&Y0===o;G0.set(o,Z0),G0.set(Z0,o);var A0=p(o,Z0,H0,G0);return G0.delete(o),G0.delete(Z0),A0}}function H(p,d){var o={};for(var Z0 in p)o[Z0]=p[Z0];for(var Z0 in d)o[Z0]=d[Z0];return o}function Q(p){return p.constructor===Object||p.constructor==null}function B(p){return typeof p.then==="function"}function X(p,d){return p===d||p!==p&&d!==d}var z="[object Arguments]",G="[object Boolean]",U="[object Date]",K="[object RegExp]",Y="[object Map]",F="[object Number]",W="[object Object]",q="[object Set]",N="[object String]",A=Object.prototype.toString;function V(p){var{areArraysEqual:d,areDatesEqual:o,areMapsEqual:Z0,areObjectsEqual:H0,areRegExpsEqual:G0,areSetsEqual:X0,createIsNestedEqual:Y0}=p,A0=Y0(N0);function N0(F0,n,a){if(F0===n)return!0;if(!F0||!n||typeof F0!=="object"||typeof n!=="object")return F0!==F0&&n!==n;if(Q(F0)&&Q(n))return H0(F0,n,A0,a);var e=Array.isArray(F0),$0=Array.isArray(n);if(e||$0)return e===$0&&d(F0,n,A0,a);var Q0=A.call(F0);if(Q0!==A.call(n))return!1;if(Q0===U)return o(F0,n,A0,a);if(Q0===K)return G0(F0,n,A0,a);if(Q0===Y)return Z0(F0,n,A0,a);if(Q0===q)return X0(F0,n,A0,a);if(Q0===W||Q0===z)return B(F0)||B(n)?!1:H0(F0,n,A0,a);if(Q0===G||Q0===F||Q0===N)return X(F0.valueOf(),n.valueOf());return!1}return N0}function D(p,d,o,Z0){var H0=p.length;if(d.length!==H0)return!1;while(H0-- >0)if(!o(p[H0],d[H0],H0,H0,p,d,Z0))return!1;return!0}var L=J(D);function j(p,d){return X(p.valueOf(),d.valueOf())}function M(p,d,o,Z0){var H0=p.size===d.size;if(!H0)return!1;if(!p.size)return!0;var G0={},X0=0;return p.forEach(function(Y0,A0){if(!H0)return;var N0=!1,F0=0;d.forEach(function(n,a){if(!N0&&!G0[F0]&&(N0=o(A0,a,X0,F0,p,d,Z0)&&o(Y0,n,A0,a,p,d,Z0)))G0[F0]=!0;F0++}),X0++,H0=N0}),H0}var _=J(M),E="_owner",C=Object.prototype.hasOwnProperty;function R(p,d,o,Z0){var H0=Object.keys(p),G0=H0.length;if(Object.keys(d).length!==G0)return!1;var X0;while(G0-- >0){if(X0=H0[G0],X0===E){var Y0=!!p.$$typeof,A0=!!d.$$typeof;if((Y0||A0)&&Y0!==A0)return!1}if(!C.call(d,X0)||!o(p[X0],d[X0],X0,X0,p,d,Z0))return!1}return!0}var T=J(R);function I(p,d){return p.source===d.source&&p.flags===d.flags}function y(p,d,o,Z0){var H0=p.size===d.size;if(!H0)return!1;if(!p.size)return!0;var G0={};return p.forEach(function(X0,Y0){if(!H0)return;var A0=!1,N0=0;d.forEach(function(F0,n){if(!A0&&!G0[N0]&&(A0=o(X0,F0,Y0,n,p,d,Z0)))G0[N0]=!0;N0++}),H0=A0}),H0}var S=J(y),O=Object.freeze({areArraysEqual:D,areDatesEqual:j,areMapsEqual:M,areObjectsEqual:R,areRegExpsEqual:I,areSetsEqual:y,createIsNestedEqual:Z}),k=Object.freeze({areArraysEqual:L,areDatesEqual:j,areMapsEqual:_,areObjectsEqual:T,areRegExpsEqual:I,areSetsEqual:S,createIsNestedEqual:Z}),b=V(O);function h(p,d){return b(p,d,void 0)}var v=V(H(O,{createIsNestedEqual:function(){return X}}));function f(p,d){return v(p,d,void 0)}var w=V(k);function i(p,d){return w(p,d,new WeakMap)}var r=V(H(k,{createIsNestedEqual:function(){return X}}));function x(p,d){return r(p,d,new WeakMap)}function l(p){return V(H(O,p(O)))}function s(p){var d=V(H(k,p(k)));return function(o,Z0,H0){if(H0===void 0)H0=new WeakMap;return d(o,Z0,H0)}}$.circularDeepEqual=i,$.circularShallowEqual=x,$.createCustomCircularEqual=s,$.createCustomEqual=l,$.deepEqual=h,$.sameValueZeroEqual=X,$.shallowEqual=f,Object.defineProperty($,"__esModule",{value:!0})})});var la=O5((OO1,da)=>{var IK0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";da.exports=IK0});var oa=O5((TO1,aa)=>{var bK0=la();function ia(){}function ra(){}ra.resetWarningCache=ia;aa.exports=function(){function $(H,Q,B,X,z,G){if(G===bK0)return;var U=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 U.name="Invariant Violation",U}$.isRequired=$;function Z(){return $}var J={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:ra,resetWarningCache:ia};return J.PropTypes=J,J}});var IX=O5((CO1,na)=>{na.exports=oa()();var kK0,yK0});var ea=O5((wO1,u_)=>{function ta($){var Z,J,H="";if(typeof $=="string"||typeof $=="number")H+=$;else if(typeof $=="object")if(Array.isArray($)){var Q=$.length;for(Z=0;Z<Q;Z++)$[Z]&&(J=ta($[Z]))&&(H&&(H+=" "),H+=J)}else for(J in $)$[J]&&(H&&(H+=" "),H+=J);return H}function sa(){for(var $,Z,J=0,H="",Q=arguments.length;J<Q;J++)($=arguments[J])&&(Z=ta($))&&(H&&(H+=" "),H+=Z);return H}u_.exports=sa,u_.exports.clsx=sa});var bX=O5(($o)=>{Object.defineProperty($o,"__esModule",{value:!0});$o.dontSetMe=fK0;$o.findInArray=xK0;$o.int=gK0;$o.isFunction=hK0;$o.isNum=vK0;function xK0($,Z){for(let J=0,H=$.length;J<H;J++)if(Z.apply(Z,[$[J],J,$]))return $[J]}function hK0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function vK0($){return typeof $==="number"&&!isNaN($)}function gK0($){return parseInt($,10)}function fK0($,Z,J){if($[Z])return Error(`Invalid prop ${Z} passed to ${J} - do not set this, set it on the child.`)}});var Bo=O5((Ho)=>{Object.defineProperty(Ho,"__esModule",{value:!0});Ho.browserPrefixToKey=Jo;Ho.browserPrefixToStyle=lK0;Ho.default=void 0;Ho.getPrefix=Zo;var p_=["Moz","Webkit","O","ms"];function Zo(){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 J=0;J<p_.length;J++)if(Jo($,p_[J])in Z)return p_[J];return""}function Jo($,Z){return Z?`${Z}${iK0($)}`:$}function lK0($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function iK0($){let Z="",J=!0;for(let H=0;H<$.length;H++)if(J)Z+=$[H].toUpperCase(),J=!1;else if($[H]==="-")J=!0;else Z+=$[H];return Z}var SO1=Ho.default=Zo()});var Iq=O5((Fo)=>{Object.defineProperty(Fo,"__esModule",{value:!0});Fo.addClassName=Ko;Fo.addEvent=sK0;Fo.addUserSelectStyles=GY0;Fo.createCSSTransform=QY0;Fo.createSVGTransform=BY0;Fo.getTouch=XY0;Fo.getTouchIdentifier=zY0;Fo.getTranslation=c_;Fo.innerHeight=ZY0;Fo.innerWidth=JY0;Fo.matchesSelector=Uo;Fo.matchesSelectorAndParentsTo=nK0;Fo.offsetXYFromParent=HY0;Fo.outerHeight=eK0;Fo.outerWidth=$Y0;Fo.removeClassName=Yo;Fo.removeEvent=tK0;Fo.scheduleRemoveUserSelectStyles=UY0;var U8=bX(),Xo=Go(Bo());function Go($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Go=function(Q,B){if(!B&&Q&&Q.__esModule)return Q;var X,z,G={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return G;if(X=B?H:J){if(X.has(Q))return X.get(Q);X.set(Q,G)}for(let U in Q)U!=="default"&&{}.hasOwnProperty.call(Q,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,U))&&(z.get||z.set)?X(G,U,z):G[U]=Q[U]);return G})($,Z)}var Rq="";function Uo($,Z){if(!Rq)Rq=(0,U8.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(J){return(0,U8.isFunction)($[J])});if(!(0,U8.isFunction)($[Rq]))return!1;return $[Rq](Z)}function nK0($,Z,J){let H=$;do{if(Uo(H,Z))return!0;if(H===J)return!1;H=H.parentNode}while(H);return!1}function sK0($,Z,J,H){if(!$)return;let Q={capture:!0,...H};if($.addEventListener)$.addEventListener(Z,J,Q);else if($.attachEvent)$.attachEvent("on"+Z,J);else $["on"+Z]=J}function tK0($,Z,J,H){if(!$)return;let Q={capture:!0,...H};if($.removeEventListener)$.removeEventListener(Z,J,Q);else if($.detachEvent)$.detachEvent("on"+Z,J);else $["on"+Z]=null}function eK0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,U8.int)(J.borderTopWidth),Z+=(0,U8.int)(J.borderBottomWidth),Z}function $Y0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,U8.int)(J.borderLeftWidth),Z+=(0,U8.int)(J.borderRightWidth),Z}function ZY0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,U8.int)(J.paddingTop),Z-=(0,U8.int)(J.paddingBottom),Z}function JY0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,U8.int)(J.paddingLeft),Z-=(0,U8.int)(J.paddingRight),Z}function HY0($,Z,J){let Q=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),B=($.clientX+Z.scrollLeft-Q.left)/J,X=($.clientY+Z.scrollTop-Q.top)/J;return{x:B,y:X}}function QY0($,Z){let J=c_($,Z,"px");return{[(0,Xo.browserPrefixToKey)("transform",Xo.default)]:J}}function BY0($,Z){return c_($,Z,"")}function c_($,Z,J){let{x:H,y:Q}=$,B=`translate(${H}${J},${Q}${J})`;if(Z){let X=`${typeof Z.x==="string"?Z.x:Z.x+J}`,z=`${typeof Z.y==="string"?Z.y:Z.y+J}`;B=`translate(${X}, ${z})`+B}return B}function XY0($,Z){return $.targetTouches&&(0,U8.findInArray)($.targetTouches,(J)=>Z===J.identifier)||$.changedTouches&&(0,U8.findInArray)($.changedTouches,(J)=>Z===J.identifier)}function zY0($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function GY0($){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)Ko($.body,"react-draggable-transparent-selection")}function UY0($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{zo($)});else zo($)}function zo($){if(!$)return;try{if($.body)Yo($.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 Ko($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function Yo($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var l_=O5((Wo)=>{Object.defineProperty(Wo,"__esModule",{value:!0});Wo.canDragX=RY0;Wo.canDragY=IY0;Wo.createCoreData=kY0;Wo.createDraggableData=yY0;Wo.getBoundPosition=EY0;Wo.getControlPosition=bY0;Wo.snapToGrid=SY0;var K8=bX(),TH=Iq();function EY0($,Z,J){if(!$.props.bounds)return[Z,J];let{bounds:H}=$.props;H=typeof H==="string"?H:xY0(H);let Q=d_($);if(typeof H==="string"){let{ownerDocument:B}=Q,X=B.defaultView,z;if(H==="parent")z=Q.parentNode;else z=Q.getRootNode().querySelector(H);if(!(z instanceof X.HTMLElement))throw Error('Bounds selector "'+H+'" could not find an element.');let G=z,U=X.getComputedStyle(Q),K=X.getComputedStyle(G);H={left:-Q.offsetLeft+(0,K8.int)(K.paddingLeft)+(0,K8.int)(U.marginLeft),top:-Q.offsetTop+(0,K8.int)(K.paddingTop)+(0,K8.int)(U.marginTop),right:(0,TH.innerWidth)(G)-(0,TH.outerWidth)(Q)-Q.offsetLeft+(0,K8.int)(K.paddingRight)-(0,K8.int)(U.marginRight),bottom:(0,TH.innerHeight)(G)-(0,TH.outerHeight)(Q)-Q.offsetTop+(0,K8.int)(K.paddingBottom)-(0,K8.int)(U.marginBottom)}}if((0,K8.isNum)(H.right))Z=Math.min(Z,H.right);if((0,K8.isNum)(H.bottom))J=Math.min(J,H.bottom);if((0,K8.isNum)(H.left))Z=Math.max(Z,H.left);if((0,K8.isNum)(H.top))J=Math.max(J,H.top);return[Z,J]}function SY0($,Z,J){let H=Math.round(Z/$[0])*$[0],Q=Math.round(J/$[1])*$[1];return[H,Q]}function RY0($){return $.props.axis==="both"||$.props.axis==="x"}function IY0($){return $.props.axis==="both"||$.props.axis==="y"}function bY0($,Z,J){let H=typeof Z==="number"?(0,TH.getTouch)($,Z):null;if(typeof Z==="number"&&!H)return null;let Q=d_(J),B=J.props.offsetParent||Q.offsetParent||Q.ownerDocument.body;return(0,TH.offsetXYFromParent)(H||$,B,J.props.scale)}function kY0($,Z,J){let H=!(0,K8.isNum)($.lastX),Q=d_($);if(H)return{node:Q,deltaX:0,deltaY:0,lastX:Z,lastY:J,x:Z,y:J};else return{node:Q,deltaX:Z-$.lastX,deltaY:J-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:J}}function yY0($,Z){let J=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/J,y:$.state.y+Z.deltaY/J,deltaX:Z.deltaX/J,deltaY:Z.deltaY/J,lastX:$.state.x,lastY:$.state.y}}function xY0($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function d_($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var i_=O5((qo)=>{Object.defineProperty(qo,"__esModule",{value:!0});qo.default=cY0;function cY0(){}});var Do=O5((Vo)=>{var aY0=P(m()),oY0=P(e4());Object.defineProperty(Vo,"__esModule",{value:!0});Vo.default=void 0;var r_=No(aY0),S4=o_(IX()),lY0=o_(oY0),W4=Iq(),P7=l_(),a_=bX(),kX=o_(i_());function o_($){return $&&$.__esModule?$:{default:$}}function No($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(No=function(Q,B){if(!B&&Q&&Q.__esModule)return Q;var X,z,G={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return G;if(X=B?H:J){if(X.has(Q))return X.get(Q);X.set(Q,G)}for(let U in Q)U!=="default"&&{}.hasOwnProperty.call(Q,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,U))&&(z.get||z.set)?X(G,U,z):G[U]=Q[U]);return G})($,Z)}function R4($,Z,J){return(Z=iY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function iY0($){var Z=rY0($,"string");return typeof Z=="symbol"?Z:Z+""}function rY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var F9={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},_7=F9.mouse;class yX extends r_.Component{constructor(){super(...arguments);R4(this,"dragging",!1),R4(this,"lastX",NaN),R4(this,"lastY",NaN),R4(this,"touchIdentifier",null),R4(this,"mounted",!1),R4(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:J}=Z;if(this.props.disabled||!($.target instanceof J.defaultView.Node)||this.props.handle&&!(0,W4.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,W4.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let H=(0,W4.getTouchIdentifier)($);this.touchIdentifier=H;let Q=(0,P7.getControlPosition)($,H,this);if(Q==null)return;let{x:B,y:X}=Q,z=(0,P7.createCoreData)(this,B,X);if((0,kX.default)("DraggableCore: handleDragStart: %j",z),(0,kX.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,W4.addUserSelectStyles)(J);this.dragging=!0,this.lastX=B,this.lastY=X,(0,W4.addEvent)(J,_7.move,this.handleDrag),(0,W4.addEvent)(J,_7.stop,this.handleDragStop)}),R4(this,"handleDrag",($)=>{let Z=(0,P7.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:H}=Z;if(Array.isArray(this.props.grid)){let X=J-this.lastX,z=H-this.lastY;if([X,z]=(0,P7.snapToGrid)(this.props.grid,X,z),!X&&!z)return;J=this.lastX+X,H=this.lastY+z}let Q=(0,P7.createCoreData)(this,J,H);if((0,kX.default)("DraggableCore: handleDrag: %j",Q),this.props.onDrag($,Q)===!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=J,this.lastY=H}),R4(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,P7.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:H}=Z;if(Array.isArray(this.props.grid)){let z=J-this.lastX||0,G=H-this.lastY||0;[z,G]=(0,P7.snapToGrid)(this.props.grid,z,G),J=this.lastX+z,H=this.lastY+G}let Q=(0,P7.createCoreData)(this,J,H);if(this.props.onStop($,Q)===!1||this.mounted===!1)return!1;let X=this.findDOMNode();if(X){if(this.props.enableUserSelectHack)(0,W4.scheduleRemoveUserSelectStyles)(X.ownerDocument)}if((0,kX.default)("DraggableCore: handleDragStop: %j",Q),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,X)(0,kX.default)("DraggableCore: Removing handlers"),(0,W4.removeEvent)(X.ownerDocument,_7.move,this.handleDrag),(0,W4.removeEvent)(X.ownerDocument,_7.stop,this.handleDragStop)}),R4(this,"onMouseDown",($)=>{return _7=F9.mouse,this.handleDragStart($)}),R4(this,"onMouseUp",($)=>{return _7=F9.mouse,this.handleDragStop($)}),R4(this,"onTouchStart",($)=>{return _7=F9.touch,this.handleDragStart($)}),R4(this,"onTouchEnd",($)=>{return _7=F9.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,W4.addEvent)($,F9.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,W4.removeEvent)(Z,F9.mouse.move,this.handleDrag),(0,W4.removeEvent)(Z,F9.touch.move,this.handleDrag),(0,W4.removeEvent)(Z,F9.mouse.stop,this.handleDragStop),(0,W4.removeEvent)(Z,F9.touch.stop,this.handleDragStop),(0,W4.removeEvent)($,F9.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,W4.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:lY0.default.findDOMNode(this)}render(){return r_.cloneElement(r_.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}Vo.default=yX;R4(yX,"displayName","DraggableCore");R4(yX,"propTypes",{allowAnyClick:S4.default.bool,allowMobileScroll:S4.default.bool,children:S4.default.node.isRequired,disabled:S4.default.bool,enableUserSelectHack:S4.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:S4.default.arrayOf(S4.default.number),handle:S4.default.string,cancel:S4.default.string,nodeRef:S4.default.object,onStart:S4.default.func,onDrag:S4.default.func,onStop:S4.default.func,onMouseDown:S4.default.func,scale:S4.default.number,className:a_.dontSetMe,style:a_.dontSetMe,transform:a_.dontSetMe});R4(yX,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var _o=O5((t_)=>{var $F0=P(m()),ZF0=P(e4());Object.defineProperty(t_,"__esModule",{value:!0});Object.defineProperty(t_,"DraggableCore",{enumerable:!0,get:function(){return yq.default}});t_.default=void 0;var bq=Mo($F0),y5=xq(IX()),nY0=xq(ZF0),sY0=ea(),Lo=Iq(),CH=l_(),n_=bX(),yq=xq(Do()),kq=xq(i_());function xq($){return $&&$.__esModule?$:{default:$}}function Mo($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Mo=function(Q,B){if(!B&&Q&&Q.__esModule)return Q;var X,z,G={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return G;if(X=B?H:J){if(X.has(Q))return X.get(Q);X.set(Q,G)}for(let U in Q)U!=="default"&&{}.hasOwnProperty.call(Q,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,U))&&(z.get||z.set)?X(G,U,z):G[U]=Q[U]);return G})($,Z)}function s_(){return s_=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},s_.apply(null,arguments)}function wH($,Z,J){return(Z=tY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function tY0($){var Z=eY0($,"string");return typeof Z=="symbol"?Z:Z+""}function eY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class xX extends bq.Component{static getDerivedStateFromProps($,Z){let{position:J}=$,{prevPropsPosition:H}=Z;if(J&&(!H||J.x!==H.x||J.y!==H.y))return(0,kq.default)("Draggable: getDerivedStateFromProps %j",{position:J,prevPropsPosition:H}),{x:J.x,y:J.y,prevPropsPosition:{...J}};return null}constructor($){super($);if(wH(this,"onDragStart",(Z,J)=>{if((0,kq.default)("Draggable: onDragStart: %j",J),this.props.onStart(Z,(0,CH.createDraggableData)(this,J))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),wH(this,"onDrag",(Z,J)=>{if(!this.state.dragging)return!1;(0,kq.default)("Draggable: onDrag: %j",J);let H=(0,CH.createDraggableData)(this,J),Q={x:H.x,y:H.y,slackX:0,slackY:0};if(this.props.bounds){let{x:X,y:z}=Q;Q.x+=this.state.slackX,Q.y+=this.state.slackY;let[G,U]=(0,CH.getBoundPosition)(this,Q.x,Q.y);Q.x=G,Q.y=U,Q.slackX=this.state.slackX+(X-Q.x),Q.slackY=this.state.slackY+(z-Q.y),H.x=Q.x,H.y=Q.y,H.deltaX=Q.x-this.state.x,H.deltaY=Q.y-this.state.y}if(this.props.onDrag(Z,H)===!1)return!1;this.setState(Q)}),wH(this,"onDragStop",(Z,J)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,CH.createDraggableData)(this,J))===!1)return!1;(0,kq.default)("Draggable: onDragStop: %j",J);let Q={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:X,y:z}=this.props.position;Q.x=X,Q.y=z}this.setState(Q)}),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??nY0.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:J,defaultPosition:H,defaultClassName:Q,defaultClassNameDragging:B,defaultClassNameDragged:X,position:z,positionOffset:G,scale:U,...K}=this.props,Y={},F=null,q=!Boolean(z)||this.state.dragging,N=z||H,A={x:(0,CH.canDragX)(this)&&q?this.state.x:N.x,y:(0,CH.canDragY)(this)&&q?this.state.y:N.y};if(this.state.isElementSVG)F=(0,Lo.createSVGTransform)(A,G);else Y=(0,Lo.createCSSTransform)(A,G);let V=(0,sY0.clsx)(J.props.className||"",Q,{[B]:this.state.dragging,[X]:this.state.dragged});return bq.createElement(yq.default,s_({},K,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),bq.cloneElement(bq.Children.only(J),{className:V,style:{...J.props.style,...Y},transform:F}))}}t_.default=xX;wH(xX,"displayName","Draggable");wH(xX,"propTypes",{...yq.default.propTypes,axis:y5.default.oneOf(["both","x","y","none"]),bounds:y5.default.oneOfType([y5.default.shape({left:y5.default.number,right:y5.default.number,top:y5.default.number,bottom:y5.default.number}),y5.default.string,y5.default.oneOf([!1])]),defaultClassName:y5.default.string,defaultClassNameDragging:y5.default.string,defaultClassNameDragged:y5.default.string,defaultPosition:y5.default.shape({x:y5.default.number,y:y5.default.number}),positionOffset:y5.default.shape({x:y5.default.oneOfType([y5.default.number,y5.default.string]),y:y5.default.oneOfType([y5.default.number,y5.default.string])}),position:y5.default.shape({x:y5.default.number,y:y5.default.number}),className:n_.dontSetMe,style:n_.dontSetMe,transform:n_.dontSetMe});wH(xX,"defaultProps",{...yq.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 vq=O5((hO1,hq)=>{var{default:jo,DraggableCore:JF0}=_o();hq.exports=jo;hq.exports.default=jo;hq.exports.DraggableCore=JF0});var Co=O5((UF0)=>{var FF0=P(m());UF0.__esModule=!0;UF0.cloneElement=GF0;var HF0=QF0(FF0);function QF0($){return $&&$.__esModule?$:{default:$}}function Oo($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),J.push.apply(J,H)}return J}function To($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Oo(Object(J),!0).forEach(function(H){BF0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Oo(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function BF0($,Z,J){return(Z=XF0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function XF0($){var Z=zF0($,"string");return typeof Z=="symbol"?Z:Z+""}function zF0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function GF0($,Z){if(Z.style&&$.props.style)Z.style=To(To({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=$.props.className+" "+Z.className;return HF0.default.cloneElement($,Z)}});var e_=O5((qF0)=>{qF0.__esModule=!0;qF0.resizableProps=void 0;var E1=WF0(IX()),gO1=vq();function WF0($){return $&&$.__esModule?$:{default:$}}var fO1=qF0.resizableProps={axis:E1.default.oneOf(["both","x","y","none"]),className:E1.default.string,children:E1.default.element.isRequired,draggableOpts:E1.default.shape({allowAnyClick:E1.default.bool,cancel:E1.default.string,children:E1.default.node,disabled:E1.default.bool,enableUserSelectHack:E1.default.bool,offsetParent:typeof Element<"u"?E1.default.instanceOf(Element):E1.default.any,grid:E1.default.arrayOf(E1.default.number),handle:E1.default.string,nodeRef:E1.default.object,onStart:E1.default.func,onDrag:E1.default.func,onStop:E1.default.func,onMouseDown:E1.default.func,scale:E1.default.number}),height:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let H=Z[0];if(H.axis==="both"||H.axis==="y")return E1.default.number.isRequired(...Z);return E1.default.number(...Z)},handle:E1.default.oneOfType([E1.default.node,E1.default.func]),handleSize:E1.default.arrayOf(E1.default.number),lockAspectRatio:E1.default.bool,maxConstraints:E1.default.arrayOf(E1.default.number),minConstraints:E1.default.arrayOf(E1.default.number),onResizeStop:E1.default.func,onResizeStart:E1.default.func,onResize:E1.default.func,resizeHandles:E1.default.arrayOf(E1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:E1.default.number,width:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let H=Z[0];if(H.axis==="both"||H.axis==="x")return E1.default.number.isRequired(...Z);return E1.default.number(...Z)}}});var Jj=O5((OF0)=>{var CF0=P(m());OF0.__esModule=!0;OF0.default=void 0;var EH=So(CF0),VF0=vq(),AF0=Co(),DF0=e_(),LF0=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function So($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(So=function(Q,B){if(!B&&Q&&Q.__esModule)return Q;var X,z,G={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return G;if(X=B?H:J){if(X.has(Q))return X.get(Q);X.set(Q,G)}for(let U in Q)U!=="default"&&{}.hasOwnProperty.call(Q,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,U))&&(z.get||z.set)?X(G,U,z):G[U]=Q[U]);return G})($,Z)}function Zj(){return Zj=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},Zj.apply(null,arguments)}function MF0($,Z){if($==null)return{};var J={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(Z.indexOf(H)!==-1)continue;J[H]=$[H]}return J}function Eo($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),J.push.apply(J,H)}return J}function $j($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Eo(Object(J),!0).forEach(function(H){PF0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Eo(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function PF0($,Z,J){return(Z=_F0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function _F0($){var Z=jF0($,"string");return typeof Z=="symbol"?Z:Z+""}function jF0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class gq extends EH.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 J=this.props,H=J.minConstraints,Q=J.maxConstraints,B=J.lockAspectRatio;if(!H&&!Q&&!B)return[$,Z];if(B){let Y=this.props.width/this.props.height,F=$-this.props.width,W=Z-this.props.height;if(Math.abs(F)>Math.abs(W*Y))Z=$/Y;else $=Z*Y}let X=$,z=Z,G=this.slack||[0,0],U=G[0],K=G[1];if($+=U,Z+=K,H)$=Math.max(H[0],$),Z=Math.max(H[1],Z);if(Q)$=Math.min(Q[0],$),Z=Math.min(Q[1],Z);return this.slack=[U+(X-$),K+(z-Z)],[$,Z]}resizeHandler($,Z){return(J,H)=>{var Q,B,X,z;let{node:G,deltaX:U,deltaY:K}=H;if($==="onResizeStart")this.resetData();let Y=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",F=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!Y&&!F)return;let W=Z[0],q=Z[Z.length-1],N=G.getBoundingClientRect();if(this.lastHandleRect!=null){if(q==="w"){let R=N.left-this.lastHandleRect.left;U+=R}if(W==="n"){let R=N.top-this.lastHandleRect.top;K+=R}}if(this.lastHandleRect=N,q==="w")U=-U;if(W==="n")K=-K;let A=(Q=(B=this.lastSize)==null?void 0:B.width)!=null?Q:this.props.width,V=(X=(z=this.lastSize)==null?void 0:z.height)!=null?X:this.props.height,D=A+(Y?U/this.props.transformScale:0),L=V+(F?K/this.props.transformScale:0);var j=this.runConstraints(D,L);if(D=j[0],L=j[1],$==="onResizeStop"&&this.lastSize){var M=this.lastSize;D=M.width,L=M.height}let _=D!==A||L!==V;if($!=="onResizeStop")this.lastSize={width:D,height:L};let E=typeof this.props[$]==="function"?this.props[$]:null;if(E&&!($==="onResize"&&!_))J.persist==null||J.persist(),E(J,{node:G,size:{width:D,height:L},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let J=this.props.handle;if(!J)return EH.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+$,ref:Z});if(typeof J==="function")return J($,Z);let H=typeof J.type==="string",Q=$j({ref:Z},H?{}:{handleAxis:$});return EH.cloneElement(J,Q)}render(){let $=this.props,Z=$.children,J=$.className,H=$.draggableOpts,Q=$.width,B=$.height,X=$.handle,z=$.handleSize,G=$.lockAspectRatio,U=$.axis,K=$.minConstraints,Y=$.maxConstraints,F=$.onResize,W=$.onResizeStop,q=$.onResizeStart,N=$.resizeHandles,A=$.transformScale,V=MF0($,LF0);return(0,AF0.cloneElement)(Z,$j($j({},V),{},{className:(J?J+" ":"")+"react-resizable",children:[...EH.Children.toArray(Z.props.children),...N.map((D)=>{var L;let j=(L=this.handleRefs[D])!=null?L:this.handleRefs[D]=EH.createRef();return EH.createElement(VF0.DraggableCore,Zj({},H,{nodeRef:j,key:"resizableHandle-"+D,onStop:this.resizeHandler("onResizeStop",D),onStart:this.resizeHandler("onResizeStart",D),onDrag:this.resizeHandler("onResize",D)}),this.renderResizeHandle(D,j))})]}))}}OF0.default=gq;gq.propTypes=DF0.resizableProps;gq.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var xo=O5((xF0)=>{var vF0=P(m());xF0.__esModule=!0;xF0.default=void 0;var Hj=ko(vF0),wF0=bo(IX()),EF0=bo(Jj()),SF0=e_(),RF0=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function bo($){return $&&$.__esModule?$:{default:$}}function ko($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(ko=function(Q,B){if(!B&&Q&&Q.__esModule)return Q;var X,z,G={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return G;if(X=B?H:J){if(X.has(Q))return X.get(Q);X.set(Q,G)}for(let U in Q)U!=="default"&&{}.hasOwnProperty.call(Q,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,U))&&(z.get||z.set)?X(G,U,z):G[U]=Q[U]);return G})($,Z)}function Qj(){return Qj=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},Qj.apply(null,arguments)}function Io($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),J.push.apply(J,H)}return J}function fq($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Io(Object(J),!0).forEach(function(H){IF0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Io(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function IF0($,Z,J){return(Z=bF0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function bF0($){var Z=kF0($,"string");return typeof Z=="symbol"?Z:Z+""}function kF0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function yF0($,Z){if($==null)return{};var J={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(Z.indexOf(H)!==-1)continue;J[H]=$[H]}return J}class Bj extends Hj.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 J=Z.size;if(this.props.onResize)$.persist==null||$.persist(),this.setState(J,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(J)}}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,Z=$.handle,J=$.handleSize,H=$.onResize,Q=$.onResizeStart,B=$.onResizeStop,X=$.draggableOpts,z=$.minConstraints,G=$.maxConstraints,U=$.lockAspectRatio,K=$.axis,Y=$.width,F=$.height,W=$.resizeHandles,q=$.style,N=$.transformScale,A=yF0($,RF0);return Hj.createElement(EF0.default,{axis:K,draggableOpts:X,handle:Z,handleSize:J,height:this.state.height,lockAspectRatio:U,maxConstraints:G,minConstraints:z,onResizeStart:Q,onResize:this.onResize,onResizeStop:B,resizeHandles:W,transformScale:N,width:this.state.width},Hj.createElement("div",Qj({},A,{style:fq(fq({},q),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}xF0.default=Bj;Bj.propTypes=fq(fq({},SF0.resizableProps),{},{children:wF0.default.element})});var ho=O5((cO1,mq)=>{mq.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};mq.exports.Resizable=Jj().default;mq.exports.ResizableBox=xo().default});var KZ=P(m(),1),Ij=P(c(),1),BN=KZ.createContext(void 0),U1=($)=>{let Z=KZ.useContext(BN);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},XN=({client:$,children:Z})=>{return KZ.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),Ij.jsx(BN.Provider,{value:$,children:Z})};var aX=P(m(),1),bj=aX.createContext(!1),kj=()=>aX.useContext(bj),Gq0=bj.Provider;var vH=P(m(),1),vs=P(c(),1);function gs(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var fs=vH.createContext(gs()),yj=()=>vH.useContext(fs);var $O=P(m(),1);var ms={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},us=class{#$=ms;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},W9=new us;function xj($){setTimeout($,0)}var GN=typeof window>"u"||"Deno"in globalThis;function u5(){}function gj($,Z){return typeof $==="function"?$(Z):$}function oX($){return typeof $==="number"&&$>=0&&$!==1/0}function nX($,Z){return Math.max($+(Z||0)-Date.now(),0)}function R5($,Z){return typeof $==="function"?$(Z):$}function sX($,Z){let{type:J="all",exact:H,fetchStatus:Q,predicate:B,queryKey:X,stale:z}=$;if(X){if(H){if(Z.queryHash!==gH(X,Z.options))return!1}else if(!i3(Z.queryKey,X))return!1}if(J!=="all"){let G=Z.isActive();if(J==="active"&&!G)return!1;if(J==="inactive"&&G)return!1}if(typeof z==="boolean"&&Z.isStale()!==z)return!1;if(Q&&Q!==Z.state.fetchStatus)return!1;if(B&&!B(Z))return!1;return!0}function tX($,Z){let{exact:J,status:H,predicate:Q,mutationKey:B}=$;if(B){if(!Z.options.mutationKey)return!1;if(J){if(q9(Z.options.mutationKey)!==q9(B))return!1}else if(!i3(Z.options.mutationKey,B))return!1}if(H&&Z.state.status!==H)return!1;if(Q&&!Q(Z))return!1;return!0}function gH($,Z){return(Z?.queryKeyHashFn||q9)($)}function q9($){return JSON.stringify($,(Z,J)=>zN(J)?Object.keys(J).sort().reduce((H,Q)=>{return H[Q]=J[Q],H},{}):J)}function i3($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object"){if(Array.isArray($)&&Array.isArray(Z)){for(let H=0;H<Z.length;H++)if(!i3($[H],Z[H]))return!1;return!0}let J=Object.keys(Z);for(let H of J)if(!i3($[H],Z[H]))return!1;return!0}return!1}var ps=Object.prototype.hasOwnProperty;function fH($,Z,J=0){if($===Z)return $;if(J>500)return Z;let H=hj($)&&hj(Z);if(!H&&!(zN($)&&zN(Z)))return Z;let Q=(H?$:Object.keys($)).length,B=H?Z:Object.keys(Z),X=B.length,z=H?Array(X):{},G=0;for(let U=0;U<X;U++){let K=H?U:B[U],Y=$[K],F=Z[K];if(Y===F){if(z[K]=Y,H?U<Q:ps.call($,K))G++;continue}if(Y===null||F===null||typeof Y!=="object"||typeof F!=="object"){z[K]=F;continue}let W=fH(Y,F,J+1);if(z[K]=W,W===Y)G++}return Q===X&&G===Q?$:z}function YZ($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function hj($){return Array.isArray($)&&$.length===Object.keys($).length}function zN($){if(!vj($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let J=Z.prototype;if(!vj(J))return!1;if(!J.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function vj($){return Object.prototype.toString.call($)==="[object Object]"}function fj($){return new Promise((Z)=>{W9.setTimeout(Z,$)})}function mH($,Z,J){if(typeof J.structuralSharing==="function")return J.structuralSharing($,Z);else if(J.structuralSharing!==!1)return fH($,Z);return Z}function mj($,Z,J=0){let H=[...$,Z];return J&&H.length>J?H.slice(1):H}function uj($,Z,J=0){let H=[Z,...$];return J&&H.length>J?H.slice(0,-1):H}var FZ=Symbol();function eX($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===FZ)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function WZ($,Z){if(typeof $==="function")return $(...Z);return!!$}function pj($,Z,J){let H=!1,Q;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(Q??=Z(),H)return Q;if(H=!0,Q.aborted)J();else Q.addEventListener("abort",J,{once:!0});return Q}}),$}var cs=()=>GN,qZ=()=>cs();var W8=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 ds=class extends W8{#$;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,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"}},NZ=new ds;var cj=xj;function ls(){let $=[],Z=0,J=(z)=>{z()},H=(z)=>{z()},Q=cj,B=(z)=>{if(Z)$.push(z);else Q(()=>{J(z)})},X=()=>{let z=$;if($=[],z.length)Q(()=>{H(()=>{z.forEach((G)=>{J(G)})})})};return{batch:(z)=>{let G;Z++;try{G=z()}finally{if(Z--,!Z)X()}return G},batchCalls:(z)=>{return(...G)=>{B(()=>{z(...G)})}},schedule:B,setNotifyFunction:(z)=>{J=z},setBatchNotifyFunction:(z)=>{H=z},setScheduler:(z)=>{Q=z}}}var t1=ls();var is=class extends W8{#$=!0;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),J=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",J,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",J)}}}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((Z)=>{Z($)})}isOnline(){return this.#$}},VZ=new is;function rs($){return Math.min(1000*2**$,30000)}function UN($){return($??"online")==="online"?VZ.isOnline():!0}var $z=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function Zz($){let Z=!1,J=0,H,Q="pending",B,X,z=new Promise((D,L)=>{B=D,X=L});z.catch(u5);let G=()=>Q!=="pending",U=(D)=>{if(!G()){let L=new $z(D);N(L),$.onCancel?.(L)}},K=()=>{Z=!0},Y=()=>{Z=!1},F=()=>NZ.isFocused()&&($.networkMode==="always"||VZ.isOnline())&&$.canRun(),W=()=>UN($.networkMode)&&$.canRun(),q=(D)=>{if(!G())H?.(),Q="resolved",B(D)},N=(D)=>{if(!G())H?.(),Q="rejected",X(D)},A=()=>{return new Promise((D)=>{H=(L)=>{if(G()||F())D(L)},$.onPause?.()}).then(()=>{if(H=void 0,!G())$.onContinue?.()})},V=()=>{if(G())return;let D,L=J===0?$.initialPromise:void 0;try{D=L??$.fn()}catch(j){D=Promise.reject(j)}Promise.resolve(D).then(q).catch((j)=>{if(G())return;let M=$.retry??(qZ()?0:3),_=$.retryDelay??rs,E=typeof _==="function"?_(J,j):_,C=M===!0||typeof M==="number"&&J<M||typeof M==="function"&&M(J,j);if(Z||!C){N(j);return}J++,$.onFail?.(J,j),fj(E).then(()=>{return F()?void 0:A()}).then(()=>{if(Z)N(j);else V()})})};return{promise:z,status:()=>Q,cancel:U,continue:()=>{return H?.(),z},cancelRetry:K,continueRetry:Y,canStart:W,start:()=>{if(W())V();else A().then(V);return z}}}var Jz=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),oX(this.gcTime))this.#$=W9.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(qZ()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)W9.clearTimeout(this.#$),this.#$=void 0}};function lj($){return{onFetch:(Z,J)=>{let H=Z.options,Q=Z.fetchOptions?.meta?.fetchMore?.direction,B=Z.state.data?.pages||[],X=Z.state.data?.pageParams||[],z={pages:[],pageParams:[]},G=0,U=async()=>{let K=!1,Y=(q)=>{pj(q,()=>Z.signal,()=>K=!0)},F=eX(Z.options,Z.fetchOptions),W=async(q,N,A)=>{if(K)return Promise.reject(Z.signal.reason);if(N==null&&q.pages.length)return Promise.resolve(q);let D=(()=>{let _={client:Z.client,queryKey:Z.queryKey,pageParam:N,direction:A?"backward":"forward",meta:Z.options.meta};return Y(_),_})(),L=await F(D),{maxPages:j}=Z.options,M=A?uj:mj;return{pages:M(q.pages,L,j),pageParams:M(q.pageParams,N,j)}};if(Q&&B.length){let q=Q==="backward",N=q?as:dj,A={pages:B,pageParams:X};z=await W(A,N(H,A),q)}else{let q=$??B.length;do{let N=G===0?X[0]??H.initialPageParam:dj(H,z);if(G>0&&N==null)break;z=await W(z,N),G++}while(G<q)}return z};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(U,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},J)};else Z.fetchFn=U}}}function dj($,{pages:Z,pageParams:J}){let H=Z.length-1;return Z.length>0?$.getNextPageParam(Z[H],Z,J[H],J):void 0}function as($,{pages:Z,pageParams:J}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,J[0],J):void 0}var aj=class extends Jz{#$;#Z;#J;#H;#B;#Q;#X;#G;constructor($){super();this.#G=!1,this.#X=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#B=$.client,this.#H=this.#B.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#Z=rj(this.options),this.state=$.state??this.#Z,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#$}get promise(){return this.#Q?.promise}setOptions($){if(this.options={...this.#X,...$},$?._type)this.#$=$._type;if(this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=rj(this.options);if(Z.data!==void 0)this.setState(ij(Z.data,Z.dataUpdatedAt)),this.#Z=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#H.remove(this)}setData($,Z){let J=mH(this.state.data,$,this.options);return this.#z({data:J,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),J}setState($){this.#z({type:"setState",state:$})}cancel($){let Z=this.#Q?.promise;return this.#Q?.cancel($),Z?Z.then(u5).catch(u5):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#Z}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(($)=>R5($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===FZ||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>R5($.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!nX(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find(($)=>$.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#Q?.continue()}onOnline(){this.observers.find(($)=>$.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#Q?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){let Z=this.observers.indexOf($);if(Z!==-1){if(this.observers.splice(Z,1),!this.observers.length){if(this.#Q)if(this.#G||this.state.fetchStatus==="paused"&&this.state.status==="pending")this.#Q.cancel({revert:!0});else this.#Q.cancelRetry();this.scheduleGc()}this.#H.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#z({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#Q?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#Q)return this.#Q.continueRetry(),this.#Q.promise}if($)this.setOptions($);if(!this.options.queryFn){let G=this.observers.find((U)=>U.options.queryFn);if(G)this.setOptions(G.options)}let J=new AbortController,H=(G)=>{Object.defineProperty(G,"signal",{enumerable:!0,get:()=>{return this.#G=!0,J.signal}})},Q=()=>{let G=eX(this.options,Z),K=(()=>{let Y={client:this.#B,queryKey:this.queryKey,meta:this.meta};return H(Y),Y})();if(this.#G=!1,this.options.persister)return this.options.persister(G,K,this);return G(K)},X=(()=>{let G={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#B,state:this.state,fetchFn:Q};return H(G),G})();if((this.#$==="infinite"?lj(this.options.pages):this.options.behavior)?.onFetch(X,this),this.#J=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==X.fetchOptions?.meta)this.#z({type:"fetch",meta:X.fetchOptions?.meta});let z=this.#Q=Zz({initialPromise:Z?.initialPromise,fn:X.fetchFn,onCancel:(G)=>{if(G instanceof $z&&G.revert)this.setState({...this.#J,fetchStatus:"idle"});J.abort()},onFail:(G,U)=>{this.#z({type:"failed",failureCount:G,error:U})},onPause:()=>{this.#z({type:"pause"})},onContinue:()=>{this.#z({type:"continue"})},retry:X.options.retry,retryDelay:X.options.retryDelay,networkMode:X.options.networkMode,canRun:()=>!0});try{let G=await z.start();if(G===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(G),this.#H.config.onSuccess?.(G,this),this.#H.config.onSettled?.(G,this.state.error,this),G}catch(G){if(G instanceof $z){if(G.silent)return this.#Q.promise;else if(G.revert){if(this.state.data===void 0)throw G;return this.state.data}}throw this.#z({type:"error",error:G}),this.#H.config.onError?.(G,this),this.#H.config.onSettled?.(this.state.data,G,this),G}finally{if(this.#Q===z)this.#Q=void 0;this.scheduleGc()}}#z($){let Z=(J)=>{switch($.type){case"failed":return{...J,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...J,fetchStatus:"paused"};case"continue":return{...J,fetchStatus:"fetching"};case"fetch":return{...J,...KN(J.data,this.options),fetchMeta:$.meta??null};case"success":let H={...J,...ij($.data,$.dataUpdatedAt),dataUpdateCount:J.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#J=$.manual?H:void 0,H;case"error":let Q=$.error;return{...J,error:Q,errorUpdateCount:J.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:J.fetchFailureCount+1,fetchFailureReason:Q,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...J,isInvalidated:!0};case"setState":return{...J,...$.state}}};this.state=Z(this.state),t1.batch(()=>{this.observers.slice().forEach((J)=>{J.onQueryUpdate()}),this.#H.notify({query:this,type:"updated",action:$})})}};function KN($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:UN(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function ij($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rj($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,J=Z!==void 0,H=J?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:J?H??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:J?"success":"pending",fetchStatus:"idle"}}var FN=class extends W8{#$;#Z=void 0;#J=void 0;#H=void 0;#B;#Q;#X;#G;#z;#W;#K;#Y;#U;#q=new Set;constructor($,Z){super();this.options=Z,this.#$=$,this.#X=null,this.bindMethods(),this.setOptions(Z)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),oj(this.#Z,this.options))this.#F();else this.updateResult();this.#L()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return YN(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return YN(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,J=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof R5(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&&!YZ(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let H=this.hasListeners();if(H&&nj(this.#Z,J,this.options,Z))this.#F();if(this.updateResult(),H&&(this.#Z!==J||R5(this.options.enabled,this.#Z)!==R5(Z.enabled,this.#Z)||R5(this.options.staleTime,this.#Z)!==R5(Z.staleTime,this.#Z)))this.#V();let Q=this.#A();if(H&&(this.#Z!==J||R5(this.options.enabled,this.#Z)!==R5(Z.enabled,this.#Z)||Q!==this.#U))this.#D(Q)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),J=this.createResult(Z,$);if(!YZ(this.getCurrentResult(),J))this.#H=J,this.#Q=this.options,this.#B=this.#Z.state;return J}getCurrentResult(){return this.#H}trackResult($,Z){return new Proxy($,{get:(J,H)=>{return this.trackProp(H),Z?.(H),Reflect.get(J,H)}})}trackProp($){this.#q.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),J=this.#$.getQueryCache().build(this.#$,Z),H=()=>{},Q,B=new Promise((X)=>{Q=X,H=this.#$.getQueryCache().subscribe((z)=>{if(z.type==="updated"&&z.query.queryHash===J.queryHash&&J.state.data!==void 0)H(),X(this.createResult(J,Z))})});return Promise.race([J.fetch().then(()=>{let X=this.createResult(J,Z);return Q?.(X),X}).finally(()=>{H()}),B])}fetch($){return this.#F({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#H})}#F($){this.#_();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(u5);return Z}#N($){return!qZ()&&R5(this.options.enabled,this.#Z)!==!1&&oX($)}#V(){this.#M();let $=R5(this.options.staleTime,this.#Z);if(this.#H.isStale||!this.#N($))return;let Z=nX(this.#H.dataUpdatedAt,$)+1;this.#K=W9.setTimeout(()=>{if(!this.#H.isStale)this.updateResult()},Z)}#A(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#D($){if(this.#P(),this.#U=$,this.#U===0||!this.#N(this.#U))return;this.#Y=W9.setInterval(()=>{if(this.options.refetchIntervalInBackground||NZ.isFocused())this.#F()},this.#U)}#L(){this.#V(),this.#D(this.#A())}#M(){if(this.#K!==void 0)W9.clearTimeout(this.#K),this.#K=void 0}#P(){if(this.#Y!==void 0)W9.clearInterval(this.#Y),this.#Y=void 0}createResult($,Z){let J=this.#Z,H=this.options,Q=this.#H,B=this.#B,X=this.#Q,z=$!==J?$.state:this.#J,{state:G}=$,U={...G},K=!1,Y;if(Z._optimisticResults){let M=this.hasListeners(),_=!M&&oj($,Z),E=M&&nj($,J,Z,H);if(_||E)U={...U,...KN(G.data,$.options)};if(Z._optimisticResults==="isRestoring")U.fetchStatus="idle"}let{error:F,errorUpdatedAt:W,status:q}=U;Y=U.data;let N=!1;if(Z.placeholderData!==void 0&&Y===void 0&&q==="pending"){let M;if(Q?.isPlaceholderData&&Z.placeholderData===X?.placeholderData)M=Q.data,N=!0;else M=typeof Z.placeholderData==="function"?Z.placeholderData(this.#W?.state.data,this.#W):Z.placeholderData;if(M!==void 0)q="success",Y=mH(Q?.data,M,Z),K=!0}if(Z.select&&Y!==void 0&&!N)if(Q&&Y===B?.data&&Z.select===this.#G)Y=this.#z;else try{this.#G=Z.select,Y=Z.select(Y),Y=mH(Q?.data,Y,Z),this.#z=Y,this.#X=null}catch(M){this.#X=M}else if(Y===void 0)this.#X=null;if(this.#X)F=this.#X,Y=this.#z,W=Date.now(),q="error",K=!1;let A=U.fetchStatus==="fetching",V=q==="pending",D=q==="error",L=V&&A,j=Y!==void 0;return{status:q,fetchStatus:U.fetchStatus,isPending:V,isSuccess:q==="success",isError:D,isInitialLoading:L,isLoading:L,data:Y,dataUpdatedAt:U.dataUpdatedAt,error:F,errorUpdatedAt:W,failureCount:U.fetchFailureCount,failureReason:U.fetchFailureReason,errorUpdateCount:U.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:U.dataUpdateCount>z.dataUpdateCount||U.errorUpdateCount>z.errorUpdateCount,isFetching:A,isRefetching:A&&!V,isLoadingError:D&&!j,isPaused:U.fetchStatus==="paused",isPlaceholderData:K,isRefetchError:D&&j,isStale:WN($,Z),refetch:this.refetch,isEnabled:R5(Z.enabled,$)!==!1}}updateResult(){let $=this.#H,Z=this.createResult(this.#Z,this.options);if(this.#B=this.#Z.state,this.#Q=this.options,this.#B.data!==void 0)this.#W=this.#Z;if(YZ(Z,$))return;this.#H=Z;let H=(()=>{if(!$)return!0;let{notifyOnChangeProps:Q}=this.options,B=typeof Q==="function"?Q():Q;if(B==="all"||!B&&!this.#q.size)return!0;let X=new Set(B??this.#q);if(this.options.throwOnError)X.add("error");return Object.keys(this.#H).some((z)=>{let G=z;return this.#H[G]!==$[G]&&X.has(G)})})();t1.batch(()=>{if(H)this.listeners.forEach((Q)=>{Q(this.#H)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}#_(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#J=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#L()}};function os($,Z){return R5(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&R5(Z.retryOnMount,$)===!1)}function oj($,Z){return os($,Z)||$.state.data!==void 0&&YN($,Z,Z.refetchOnMount)}function YN($,Z,J){if(R5(Z.enabled,$)!==!1&&R5(Z.staleTime,$)!=="static"){let H=typeof J==="function"?J($):J;return H==="always"||H!==!1&&WN($,Z)}return!1}function nj($,Z,J,H){return($!==Z||R5(H.enabled,$)===!1)&&(!J.suspense||$.state.status!=="error")&&WN($,J)}function WN($,Z){return R5(Z.enabled,$)!==!1&&$.isStaleByTime(R5(Z.staleTime,$))}var sj=class extends Jz{#$;#Z;#J;#H;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#J=$.mutationCache,this.#Z=[],this.state=$.state||qN(),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.#J.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#J.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#J.remove(this)}continue(){return this.#H?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute($){let Z=()=>{this.#B({type:"continue"})},J={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey},H=this.#H=Zz({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,J)},onFail:(X,z)=>{this.#B({type:"failed",failureCount:X,error:z})},onPause:()=>{this.#B({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#J.canRun(this)}),Q=this.state.status==="pending",B=!H.canStart();try{if(Q)Z();else{if(this.#B({type:"pending",variables:$,isPaused:B}),this.#J.config.onMutate)await this.#J.config.onMutate($,this,J);let z=await this.options.onMutate?.($,J);if(z!==this.state.context)this.#B({type:"pending",context:z,variables:$,isPaused:B})}let X=await H.start();return await this.#J.config.onSuccess?.(X,$,this.state.context,this,J),await this.options.onSuccess?.(X,$,this.state.context,J),await this.#J.config.onSettled?.(X,null,this.state.variables,this.state.context,this,J),await this.options.onSettled?.(X,null,$,this.state.context,J),this.#B({type:"success",data:X}),X}catch(X){try{await this.#J.config.onError?.(X,$,this.state.context,this,J)}catch(z){Promise.reject(z)}try{await this.options.onError?.(X,$,this.state.context,J)}catch(z){Promise.reject(z)}try{await this.#J.config.onSettled?.(void 0,X,this.state.variables,this.state.context,this,J)}catch(z){Promise.reject(z)}try{await this.options.onSettled?.(void 0,X,$,this.state.context,J)}catch(z){Promise.reject(z)}throw this.#B({type:"error",error:X}),X}finally{if(this.#H===H)this.#H=void 0;this.#J.runNext(this)}}#B($){let Z=(J)=>{switch($.type){case"failed":return{...J,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...J,isPaused:!0};case"continue":return{...J,isPaused:!1};case"pending":return{...J,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...J,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...J,data:void 0,error:$.error,failureCount:J.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),t1.batch(()=>{this.#Z.forEach((J)=>{J.onMutationUpdate($)}),this.#J.notify({mutation:this,type:"updated",action:$})})}};function qN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tj=class extends W8{#$;#Z;#J;constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#J=0}build($,Z,J){let H=new sj({client:$,mutationCache:this,mutationId:++this.#J,options:$.defaultMutationOptions(Z),state:J});return this.add(H),H}add($){this.#$.add($);let Z=Hz($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J)J.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=Hz($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J){if(J.length>1){let H=J.indexOf($);if(H!==-1)J.splice(H,1)}else if(J[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=Hz($);if(typeof Z==="string"){let J=this.#Z.get(Z)?.find((H)=>H.state.status==="pending");return!J||J===$}else return!0}runNext($){let Z=Hz($);if(typeof Z==="string")return this.#Z.get(Z)?.find((J)=>J!==$&&J.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){t1.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((J)=>tX(Z,J))}findAll($={}){return this.getAll().filter((Z)=>tX($,Z))}notify($){t1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return t1.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(u5))))}};function Hz($){return $.options.scope?.id}var NN=class extends W8{#$;#Z=void 0;#J;#H;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($),!YZ(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&q9(Z.mutationKey)!==q9(this.options.mutationKey))this.reset();else if(this.#J?.state.status==="pending")this.#J.setOptions(this.options)}onSubscribe(){if(this.listeners.size===1&&this.#J)this.#J.addObserver(this),this.#B()}onUnsubscribe(){if(!this.hasListeners())this.#J?.removeObserver(this)}onMutationUpdate($){this.#B(),this.#Q($)}getCurrentResult(){return this.#Z}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#B(),this.#Q()}mutate($,Z){return this.#H=Z,this.#J?.removeObserver(this),this.#J=this.#$.getMutationCache().build(this.#$,this.options),this.#J.addObserver(this),this.#J.execute($)}#B(){let $=this.#J?.state??qN();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#Q($){t1.batch(()=>{if(this.#H&&this.hasListeners()){let Z=this.#Z.variables,J=this.#Z.context,H={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#H.onSuccess?.($.data,Z,J,H)}catch(Q){Promise.reject(Q)}try{this.#H.onSettled?.($.data,null,Z,J,H)}catch(Q){Promise.reject(Q)}}else if($?.type==="error"){try{this.#H.onError?.($.error,Z,J,H)}catch(Q){Promise.reject(Q)}try{this.#H.onSettled?.(void 0,$.error,Z,J,H)}catch(Q){Promise.reject(Q)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var ej=class extends W8{#$;constructor($={}){super();this.config=$,this.#$=new Map}build($,Z,J){let H=Z.queryKey,Q=Z.queryHash??gH(H,Z),B=this.get(Q);if(!B)B=new aj({client:$,queryKey:H,queryHash:Q,options:$.defaultQueryOptions(Z),state:J,defaultOptions:$.getQueryDefaults(H)}),this.add(B);return B}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(){t1.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>sX(Z,J))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((J)=>sX($,J)):Z}notify($){t1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){t1.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){t1.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var VN=class{#$;#Z;#J;#H;#B;#Q;#X;#G;constructor($={}){this.#$=$.queryCache||new ej,this.#Z=$.mutationCache||new tj,this.#J=$.defaultOptions||{},this.#H=new Map,this.#B=new Map,this.#Q=0}mount(){if(this.#Q++,this.#Q!==1)return;this.#X=NZ.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#G=VZ.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#Q--,this.#Q!==0)return;this.#X?.(),this.#X=void 0,this.#G?.(),this.#G=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($),J=this.#$.build(this,Z),H=J.state.data;if(H===void 0)return this.fetchQuery($);if($.revalidateIfStale&&J.isStaleByTime(R5(Z.staleTime,J)))this.prefetchQuery(Z);return Promise.resolve(H)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:J})=>{return[Z,J.data]})}setQueryData($,Z,J){let H=this.defaultQueryOptions({queryKey:$}),Q=this.#$.get(H.queryHash)?.state.data,B=gj(Z,Q);if(B===void 0)return;return this.#$.build(this,H).setData(B,{...J,manual:!0})}setQueriesData($,Z,J){return t1.batch(()=>this.#$.findAll($).map(({queryKey:H})=>[H,this.setQueryData(H,Z,J)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;t1.batch(()=>{Z.findAll($).forEach((J)=>{Z.remove(J)})})}resetQueries($,Z){let J=this.#$;return t1.batch(()=>{let H=J.findAll($),Q=new Set(H);return H.forEach((B)=>{B.reset()}),this.refetchQueries({type:"active",predicate:(B)=>Q.has(B)},Z)})}cancelQueries($,Z={}){let J={revert:!0,...Z},H=t1.batch(()=>this.#$.findAll($).map((Q)=>Q.cancel(J)));return Promise.all(H).then(u5).catch(u5)}invalidateQueries($,Z={}){return t1.batch(()=>{if(this.#$.findAll($).forEach((J)=>{J.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let J={...Z,cancelRefetch:Z.cancelRefetch??!0},H=t1.batch(()=>this.#$.findAll($).filter((Q)=>!Q.isDisabled()&&!Q.isStatic()).map((Q)=>{let B=Q.fetch(void 0,J);if(!J.throwOnError)B=B.catch(u5);return Q.state.fetchStatus==="paused"?Promise.resolve():B}));return Promise.all(H).then(u5)}async query($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z),H=J.isStaleByTime(R5(Z.staleTime,J))?await J.fetch(Z):J.state.data,Q=Z.select;if(Q)return Q(H);return H}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z);return J.isStaleByTime(R5(Z.staleTime,J))?J.fetch(Z):Promise.resolve(J.state.data)}prefetchQuery($){return this.fetchQuery($).then(u5).catch(u5)}infiniteQuery($){return $._type="infinite",this.query($)}fetchInfiniteQuery($){return $._type="infinite",this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(u5).catch(u5)}ensureInfiniteQueryData($){return $._type="infinite",this.ensureQueryData($)}resumePausedMutations(){if(VZ.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#J}setDefaultOptions($){this.#J=$}setQueryDefaults($,Z){this.#H.set(q9($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#H.values()],J={};return Z.forEach((H)=>{if(i3($,H.queryKey))Object.assign(J,H.defaultOptions)}),J}setMutationDefaults($,Z){this.#B.set(q9($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#B.values()],J={};return Z.forEach((H)=>{if(i3($,H.mutationKey))Object.assign(J,H.defaultOptions)}),J}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#J.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=gH(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===FZ)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#J.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var ZO=($,Z,J)=>{let H=J?.state.error&&typeof $.throwOnError==="function"?WZ($.throwOnError,[J.state.error,J]):$.throwOnError;if($.suspense||H){if(!Z.isReset())$.retryOnMount=!1}},JO=($)=>{$O.useEffect(()=>{$.clearReset()},[$])},HO=({result:$,errorResetBoundary:Z,throwOnError:J,query:H,suspense:Q})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&H&&(Q&&$.data===void 0||WZ(J,[$.error,H]))};var QO=($)=>{if($.suspense){let J=(Q)=>Q==="static"?Q:Math.max(Q??1000,1000),H=$.staleTime;if($.staleTime=typeof H==="function"?(...Q)=>J(H(...Q)):J(H),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},BO=($,Z)=>$?.suspense&&Z.isPending,XO=($,Z,J)=>Z.fetchOptimistic($).catch(()=>{J.clearReset()});var r3=P(m(),1);function zO($,Z,J){let H=kj(),Q=yj(),B=U1(J),X=B.defaultQueryOptions($),z=B.getQueryCache().get(X.queryHash),G=$.subscribed!==!1;X._optimisticResults=H?"isRestoring":G?"optimistic":void 0,QO(X),ZO(X,Q,z),JO(Q);let[U]=r3.useState(()=>new Z(B,X)),K=U.getOptimisticResult(X),Y=!H&&G;if(r3.useSyncExternalStore(r3.useCallback((F)=>{let W=Y?U.subscribe(t1.batchCalls(F)):u5;return U.updateResult(),W},[U,Y]),()=>U.getCurrentResult(),()=>U.getCurrentResult()),r3.useEffect(()=>{U.setOptions(X)},[X,U]),BO(X,K))throw XO(X,U,Q);if(HO({result:K,errorResetBoundary:Q,throwOnError:X.throwOnError,query:z,suspense:X.suspense}))throw K.error;return!X.notifyOnChangeProps?U.trackResult(K):K}function J5($,Z){return zO($,FN,Z)}function AN($){return $}var Y3=P(m(),1);function DN($,Z){let J=U1(Z);return UO({filters:{...$,status:"pending"}},J).length}function GO($,Z){return $.findAll(Z.filters).map((J)=>Z.select?Z.select(J):J.state)}function UO($={},Z){let J=U1(Z).getMutationCache(),H=Y3.useRef($),Q=Y3.useRef(null);if(Q.current===null)Q.current=GO(J,$);return Y3.useEffect(()=>{H.current=$}),Y3.useSyncExternalStore(Y3.useCallback((B)=>J.subscribe(()=>{let X=fH(Q.current,GO(J,H.current));if(Q.current!==X)Q.current=X,t1.schedule(B)}),[J]),()=>Q.current,()=>Q.current)}var F3=P(m(),1);function H5($,Z){let J=U1(Z),[H]=F3.useState(()=>new NN(J,$));F3.useEffect(()=>{H.setOptions($)},[H,$]);let Q=F3.useSyncExternalStore(F3.useCallback((X)=>H.subscribe(t1.batchCalls(X)),[H]),()=>H.getCurrentResult(),()=>H.getCurrentResult()),B=F3.useCallback((...X)=>{H.mutate(X[0],X[1]).catch(u5)},[H]);if(Q.error&&WZ(H.options.throwOnError,[Q.error]))throw Q.error;return{...Q,mutate:B,mutateAsync:Q.mutate}}var ks=P(Xq0(),1);function KO($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var J,H,Q,B,X=[],z="",G=$.split("/");G[0]||G.shift();while(Q=G.shift())if(J=Q[0],J==="*")X.push(J),z+=Q[1]==="?"?"(?:/(.*))?":"/(.*)";else if(J===":"){if(H=Q.indexOf("?",1),B=Q.indexOf(".",1),X.push(Q.substring(1,~H?H:~B?B:Q.length)),z+=!!~H&&!~B?"(?:/([^/]+?))?":"/([^/]+?)",~B)z+=(~H?"?":"")+"\\"+Q.substring(B)}else z+="/"+Q;return{keys:X,pattern:new RegExp("^"+z+(Z?"(?=$|/)":"/?$"),"i")}}var b7=P(m(),1),f1=P(m(),1);var Qz=P(AZ(),1);var zt=b7.useInsertionEffect,Gt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MN=Gt?b7.useLayoutEffect:b7.useEffect,Ut=zt||MN,Bz=($)=>{let Z=b7.useRef([$,(...J)=>Z[0](...J)]).current;return Ut(()=>{Z[0]=$}),Z[1]};var YO=["popstate","pushState","replaceState","hashchange"],uH=[],FO=()=>uH.forEach(($)=>$()),Kt=($)=>{if(uH.push($)===1)YO.forEach((Z)=>addEventListener(Z,FO));return()=>{if(uH=uH.filter((Z)=>Z!==$),!uH.length)YO.forEach((Z)=>removeEventListener(Z,FO))}},VO=($,Z)=>Qz.useSyncExternalStore(Kt,$,Z),WO=()=>location.search,Xz=({ssrSearch:$}={})=>VO(WO,$!=null?()=>$:WO),qO=()=>location.pathname,k7=({ssrPath:$}={})=>VO(qO,$!=null?()=>$:qO);var Yt=($,{replace:Z=!1,state:J=null}={})=>history[Z?"replaceState":"pushState"](J,"",$),AO=($)=>[k7($),Yt],NO=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[NO]>"u"){for(let $ of["pushState","replaceState"]){let Z=history[$];history[$]=function(){let J=Z.apply(this,arguments),H=new Event($);return H.arguments=arguments,dispatchEvent(H),J}}Object.defineProperty(window,NO,{value:!0})}var LO=($="")=>$==="/"?"":$,MO=($,Z)=>$[0]==="~"?$.slice(1):LO(Z)+$,PN=($,Z)=>{return $=DO(LO($)),Z=DO(Z),!$||!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z},DO=($)=>{try{return $.includes("%")?decodeURI($):$}catch(Z){return $}};var PO={hook:AO,searchHook:Xz,parser:KO,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,J)=>$(Z,J)},_O=f1.createContext(PO),i2=()=>f1.useContext(_O),jO={},OO=f1.createContext(jO),Ft=()=>f1.useContext(OO),TO=($,Z=$.base)=>PN(Z,$.hook($)[0]),_N=($)=>{let[Z,J]=$.hook($);return[PN($.base,Z),Bz((H,Q)=>$.aroundNav(J,MO(H,$.base),Q))]},q8=()=>_N(i2());var CO=($,Z,J,H)=>{let{pattern:Q,keys:B}=Z instanceof RegExp?{pattern:Z}:$(Z||"*",H),X=Q.exec(J);if(!X)return[!1,null];let z={};for(let G=1;G<X.length;G++)z[G-1]=X[G];if(B)for(let G=0;G<B.length;G++)z[B[G]]=X[G+1];else Object.assign(z,X.groups);return H?[!0,z,X[0]]:[!0,z]};var jN=({children:$,...Z})=>{let J=i2(),H=Z.hook?PO:J,Q=H;if(Z.ssrPath){let[G,U=Z.ssrSearch??""]=Z.ssrPath.split("?");if(G)Z.ssrSearch=U,Z.ssrPath=G}Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let B=f1.useRef(H),X=B.current,z=X;for(let G in H){let U=G==="base"?H[G]+(Z[G]??""):Z[G]??H[G];if(U!==z[G]){if(X===z)B.current=z={...z};z[G]=U}if(U!==H[G]||U!==Q[G])Q=z}return f1.createElement(_O.Provider,{value:Q},$)},Wt=({children:$,component:Z},J)=>{if(Z)return f1.createElement(Z,{params:J});return typeof $==="function"?$(J):$},qt=($)=>{let Z=f1.useRef(jO),J=Z.current,H=Object.keys($);return Z.current=H.length!==Object.keys(J).length||H.some((Q)=>$[Q]!==J[Q])?$:J};var zz=({path:$,nest:Z,match:J,...H})=>{let Q=i2(),B=TO(Q),[X,z,G]=J??CO(Q.parser,$,B,Z),U=qt({...Ft(),...z});if(!X)return null;let K=Wt(H,U);return f1.createElement(OO.Provider,{value:U},G?f1.createElement(jN,{base:G},K):K)},y7=f1.forwardRef(($,Z)=>{let J=i2(),[H,Q]=_N(J),{to:B="",href:X=B,onClick:z,asChild:G,children:U,className:K,replace:Y,state:F,transition:W,...q}=$;if(q.onClick=Bz((N)=>{if(N.ctrlKey||N.metaKey||N.altKey||N.shiftKey||N.button!==0)return;if(z?.(N),!N.defaultPrevented)N.preventDefault(),Q(X,$)}),q.href=J.hrefs(X[0]==="~"?X.slice(1):J.base+X,J),K!==void 0)q.className=K?.call?K(H===X):K;if(Z)q.ref=Z;return G&&f1.isValidElement(U)?f1.cloneElement(U,q):f1.createElement("a",q,U)}),wO=($,Z=[])=>{if(Array.isArray($))for(let J of $)wO(J&&J.type===f1.Fragment?J.props.children:J,Z);else Z.push($);return Z},EO=({children:$,location:Z})=>{let J=i2(),H=TO(J);for(let Q of wO($)){let B=0;if(f1.isValidElement(Q)&&(B=CO(J.parser,Q.props.path,Z||H,Q.props.nest))[0])return f1.cloneElement(Q,{match:B})}return null},SO=($)=>{let{to:Z,href:J=Z}=$,H=i2(),[,Q]=_N(H),B=Bz(()=>Q(Z||J,$)),{ssrContext:X}=H;if(MN(()=>{B()},[]),X)X.redirectTo=Z;return null};var e2={};C5(e2,{useToastManager:()=>Pw,createToastManager:()=>_w,Viewport:()=>WT,Title:()=>uT,Root:()=>IT,Provider:()=>UT,Positioner:()=>Aw,Portal:()=>sT,Description:()=>fT,Content:()=>bT,Close:()=>pT,Arrow:()=>Lw,Action:()=>dT});var GT=P(m(),1);var RO=P(m(),1);function a3($){RO.useEffect($,r2)}var Gz=P(m(),1),ON=Gz.createContext(void 0);function N9(){let $=Gz.useContext(ON);if(!$)throw Error(y0(73));return $}var yO=P(m(),1),EN=P(AZ(),1);var o3=P(m(),1),Nt=AZ();function Vt($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var At=typeof Object.is==="function"?Object.is:Vt,Dt=Nt.useSyncExternalStore,Lt=o3.useRef,Mt=o3.useEffect,Pt=o3.useMemo,_t=o3.useDebugValue;var TN=function($,Z,J,H,Q){var B=Lt(null);if(B.current===null){var X={hasValue:!1,value:null};B.current=X}else X=B.current;B=Pt(function(){function G(W){if(!U){if(U=!0,K=W,W=H(W),Q!==void 0&&X.hasValue){var q=X.value;if(Q(q,W))return Y=q}return Y=W}if(q=Y,At(K,W))return q;var N=H(W);if(Q!==void 0&&Q(q,N))return K=W,q;return K=W,Y=N}var U=!1,K,Y,F=J===void 0?null:J;return[function(){return G(Z())},F===null?void 0:function(){return G(F())}]},[Z,J,H,Q]);var z=Dt($,B[0],B[1]);return Mt(function(){X.hasValue=!0,X.value=z},[z]),_t(z),z};var IO=P(m(),1);var CN=[],wN=void 0;function bO(){return wN}function kO($){CN.push($)}function g8($){let Z=(J,H)=>{let Q=l1(jt).current,B;try{wN=Q;for(let X of CN)X.before(Q);B=$(J,H);for(let X of CN)X.after(Q);Q.didInitialize=!0}finally{wN=void 0}return B};return Z.displayName=$.displayName||$.name,Z}function V9($){return IO.forwardRef(g8($))}function jt(){return{didInitialize:!1}}var Ot=Uz(19),Tt=Ot?wt:Et;function Kz($,Z,J,H,Q){return Tt($,Z,J,H,Q)}function Ct($,Z,J,H,Q){let B=yO.useCallback(()=>Z($.getSnapshot(),J,H,Q),[$,Z,J,H,Q]);return EN.useSyncExternalStore($.subscribe,B,B)}kO({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let J=0;J<$.syncHooks.length;J+=1){let H=$.syncHooks[J],Q=H.selector(H.store.state,H.a1,H.a2,H.a3);if(!Object.is(H.value,Q))Z=!0,H.value=Q}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let J=new Set;for(let Q of $.syncHooks)J.add(Q.store);let H=[];for(let Q of J)H.push(Q.subscribe(Z));return()=>{for(let Q of H)Q()}};EN.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function wt($,Z,J,H,Q){let B=bO();if(!B)return Ct($,Z,J,H,Q);let X=B.syncIndex;B.syncIndex+=1;let z;if(!B.didInitialize)z={store:$,selector:Z,a1:J,a2:H,a3:Q,value:Z($.getSnapshot(),J,H,Q)},B.syncHooks.push(z);else if(z=B.syncHooks[X],z.store!==$||z.selector!==Z||!Object.is(z.a1,J)||!Object.is(z.a2,H)||!Object.is(z.a3,Q)){if(z.store!==$)B.didChangeStore=!0;z.store=$,z.selector=Z,z.a1=J,z.a2=H,z.a3=Q,z.value=Z($.getSnapshot(),J,H,Q)}return z.value}function Et($,Z,J,H,Q){return TN($.subscribe,$.getSnapshot,$.getSnapshot,(B)=>Z(B,J,H,Q))}class SN{static create($){return new this($)}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 J of this.listeners){if(Z!==this.updateTick)return;J($)}}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,J,H){return Kz(this,$,Z,J,H)}}var x7=P(m(),1);class b2 extends SN{constructor($,Z={},J){super($);this.context=Z,this.selectors=J}useSyncedValue($,Z){x7.useDebugValue($);let J=this;J0(()=>{if(J.state[$]!==Z)J.set($,Z)},[J,$,Z])}useSyncedValueWithCleanup($,Z){let J=this;J0(()=>{if(J.state[$]!==Z)J.set($,Z);return()=>{J.set($,void 0)}},[J,$,Z])}useSyncedValues($){let Z=this,J=Object.values($);J0(()=>{Z.update($)},[Z,...J])}useControlledProp($,Z){x7.useDebugValue($);let J=this,H=Z!==void 0;J0(()=>{if(H&&!Object.is(J.state[$],Z))J.setState({...J.state,[$]:Z})},[J,$,Z,H])}select($,Z,J,H){let Q=this.selectors[$];return Q(this.state,Z,J,H)}useState($,Z,J,H){return x7.useDebugValue($),Kz(this,this.selectors[$],Z,J,H)}useContextCallback($,Z){x7.useDebugValue($);let J=U0(Z??X1);this.context[$]=J}useStateSetter($){let Z=x7.useRef(void 0);if(Z.current===void 0)Z.current=(J)=>{this.set($,J)};return Z.current}observe($,Z){let J;if(typeof $==="function")J=$;else J=this.selectors[$];let H=J(this.state);return Z(H,H,this),this.subscribe((Q)=>{let B=J(Q);if(!Object.is(H,B)){let X=H;H=B,Z(B,X,this)}})}}function M2(...$){return()=>{for(let Z=0;Z<$.length;Z+=1){let J=$[Z];if(J)J()}}}function n0($,Z,J,H){return $.addEventListener(Z,J,H),()=>{$.removeEventListener(Z,J,H)}}var Yz=P(m(),1);function xO(){let[,$]=Yz.useState({});return Yz.useCallback(()=>{$({})},[])}var Fz=null,TA0=globalThis.requestAnimationFrame;class hO{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,J=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,J>0)for(let H=0;H<Z.length;H+=1)Z[H]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let J=!1;if(!this.isScheduled||J)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;if(this.callbacks[Z]===null)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var Wz=new hO;class k2{static create(){return new k2}static request($){return Wz.request($)}static cancel($){return Wz.cancel($)}currentId=Fz;request($){this.cancel(),this.currentId=Wz.request(()=>{this.currentId=Fz,$()})}cancel=()=>{if(this.currentId!==Fz)Wz.cancel(this.currentId),this.currentId=Fz};disposeEffect=()=>{return this.cancel}}function N4(){let $=l1(k2.create).current;return a3($.disposeEffect),$}var pH=0;class c5{static create(){return new c5}currentId=pH;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=pH,Z()},$)}isStarted(){return this.currentId!==pH}clear=()=>{if(this.currentId!==pH)clearTimeout(this.currentId),this.currentId=pH};disposeEffect=()=>{return this.clear}}function d1(){let $=l1(c5.create).current;return a3($.disposeEffect),$}var vO=0;function qz($){return vO+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${vO}`}function Nz($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let J=$(Z);return typeof J==="string"?{description:J}:J}return $}var r1={};C5(r1,{screenReader:()=>xN,os:()=>bN,mediaQuery:()=>vN,env:()=>hN,engine:()=>yN});var bN={};C5(bN,{windows:()=>bt,mac:()=>uO,linux:()=>kt,ios:()=>RN,apple:()=>IN,android:()=>mO});function St(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Rt,platform:It,maxTouchPoints:gO}=St(),h7=Rt.toLowerCase(),v7=It.toLowerCase();var RN=/^i(os$|p)/.test(v7)||v7==="macintel"&&gO>1,fO="android",mO=v7===fO||h7.includes(fO),uO=!RN&&v7.startsWith("mac"),bt=v7.startsWith("win"),kt=!mO&&/^(linux|chrome os)/.test(v7),IN=uO||RN;var yN={};C5(yN,{webkit:()=>kN,gecko:()=>yt,blink:()=>xt});var kN=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),yt=!kN&&h7.includes("firefox"),xt=!kN&&h7.includes("chrom");var xN={};C5(xN,{voiceOver:()=>ht});var ht=IN;var hN={};C5(hN,{jsdom:()=>vt});var vt=/jsdom|happydom/.test(h7);var vN={};C5(vN,{iOS:()=>gt});var gt="@supports (-webkit-touch-callout: none)";function p1($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function b0($,Z){if(!$||!Z)return!1;let J=Z.getRootNode?.();if($.contains(Z))return!0;if(J&&n3(J)){let H=Z;while(H){if($===H)return!0;H=H.parentNode||H.host}}return!1}function M1($){if("composedPath"in $)return $.composedPath()[0]??$.target;return $.target}var cH="data-base-ui-focusable";var gN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",dH="ArrowLeft",lH="ArrowRight",fN="ArrowUp",Vz="ArrowDown";var n4={};C5(n4,{startingStyle:()=>g7,endingStyle:()=>iH});var g7="data-starting-style",iH="data-ending-style";var ft={[g7]:""},mt={[iH]:""},Q2={transitionStatus($){if($==="starting")return ft;if($==="ending")return mt;return null}};var f7={};C5(f7,{startingStyle:()=>ut,side:()=>ct,open:()=>mN,endingStyle:()=>pt,closed:()=>uN,anchorHidden:()=>pN,align:()=>dt});var mN="data-open",uN="data-closed",ut=g7,pt=iH,pN="data-anchor-hidden",ct="data-side",dt="data-align";var Dz={};C5(Dz,{pressed:()=>cN,popupOpen:()=>Az});var Az="data-popup-open",cN="data-pressed";var lt={[Az]:""},it={[Az]:"",[cN]:""},rt={[mN]:""},at={[uN]:""},ot={[pN]:""},A9={open($){if($)return lt;return null}},rH={open($){if($)return it;return null}},s4={open($){if($)return rt;return at},anchorHidden($){if($)return ot;return null}},a2={...s4,...Q2};var lA0=Dz.popupOpen,aH="data-trigger-disabled";function s3($,Z){if(!s0($))return!1;let J=$;if(Z.hasElement(J))return!J.hasAttribute(aH);for(let[,H]of Z.entries())if(b0(H,J))return!H.hasAttribute(aH);return!1}function Lz($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let J=$;return J.target!=null&&Z.contains(J.target)}function cO($){return $.matches("html,body")}function m7($){return P1($)&&$.matches(gN)}function dN($){return $?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gN}`)!=null}function oH($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&m7($)}function D9($){if(!$||r1.env.jsdom)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function nH($){if(!$)return null;return $.hasAttribute(cH)?$:$.querySelector(`[${cH}]`)||$}function N8($,Z,J=!0){return $.filter((Q)=>Q.parentId===Z).flatMap((Q)=>[...!J||Q.context?.open?[Q]:[],...N8($,Q.id,J)])}function lN($,Z){let J=[],H=$.find((Q)=>Q.id===Z)?.parentId;while(H){let Q=$.find((B)=>B.id===H);if(H=Q?.parentId,Q)J=J.concat(Q)}return J}function k4($){$.preventDefault(),$.stopPropagation()}function dO($){return"nativeEvent"in $}function DZ($){if($.pointerType===""&&$.isTrusted)return!0;if(r1.os.android&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function LZ($){if(r1.env.jsdom)return!1;return!r1.os.android&&$.width===0&&$.height===0||r1.os.android&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function t4($,Z){let J=["mouse","pen"];if(!Z)J.push("",void 0);return J.includes($)}function lO($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}var{min:t3,max:f8,round:e3,floor:tH}=Math,L9=($)=>({x:$,y:$}),nt={left:"right",right:"left",bottom:"top",top:"bottom"};function Pz($,Z,J){return f8($,t3(Z,J))}function M9($,Z){return typeof $==="function"?$(Z):$}function o2($){return $.split("-")[0]}function V8($){return $.split("-")[1]}function _z($){return $==="x"?"y":"x"}function eH($){return $==="y"?"height":"width"}function y4($){let Z=$[0];return Z==="t"||Z==="b"?"y":"x"}function $Q($){return _z(y4($))}function aO($,Z,J){if(J===void 0)J=!1;let H=V8($),Q=$Q($),B=eH(Q),X=Q==="x"?H===(J?"end":"start")?"right":"left":H==="start"?"bottom":"top";if(Z.reference[B]>Z.floating[B])X=sH(X);return[X,sH(X)]}function oO($){let Z=sH($);return[Mz($),Z,Mz(Z)]}function Mz($){return $.includes("start")?$.replace("start","end"):$.replace("end","start")}var iO=["left","right"],rO=["right","left"],st=["top","bottom"],tt=["bottom","top"];function et($,Z,J){switch($){case"top":case"bottom":if(J)return Z?rO:iO;return Z?iO:rO;case"left":case"right":return Z?st:tt;default:return[]}}function nO($,Z,J,H){let Q=V8($),B=et(o2($),J==="start",H);if(Q){if(B=B.map((X)=>X+"-"+Q),Z)B=B.concat(B.map(Mz))}return B}function sH($){let Z=o2($);return nt[Z]+$.slice(Z.length)}function $e($){var Z,J,H,Q;return{top:(Z=$.top)!=null?Z:0,right:(J=$.right)!=null?J:0,bottom:(H=$.bottom)!=null?H:0,left:(Q=$.left)!=null?Q:0}}function jz($){return typeof $!=="number"?$e($):{top:$,right:$,bottom:$,left:$}}function u7($){let{x:Z,y:J,width:H,height:Q}=$;return{width:H,height:Q,top:J,left:Z,right:Z+H,bottom:J+Q,x:Z,y:J}}function $6($,Z){return Z<0||Z>=$.length}function p7($,Z){return A8($.current,{disabledIndices:Z})}function MZ($,Z){return A8($.current,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function A8($,{startingIndex:Z=-1,decrement:J=!1,disabledIndices:H,amount:Q=1}={}){let B=Z;do B+=J?-Q:Q;while(B>=0&&B<=$.length-1&&W3($,B,H));return B}function W3($,Z,J){if(typeof J==="function"?J(Z):J?.includes(Z)??!1)return!0;let Q=$[Z];if(!Q)return!1;if(!c7(Q))return!0;if(Q.matches(":disabled"))return!0;return!J&&(Q.hasAttribute("disabled")||Q.getAttribute("aria-disabled")==="true")}function Ze($){return $.visibility==="hidden"||$.visibility==="collapse"}function c7($,Z=$?y2($):null){if(!$||!$.isConnected||!Z||Ze(Z))return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return Z.display!=="none"&&Z.display!=="contents"}var Je='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function He($){let Z=$.assignedSlot;if(Z)return Z;if($.parentElement)return $.parentElement;let J=$.getRootNode();return n3(J)?J.host:null}function rN($){for(let Z of Array.from($.children))if(P2(Z)==="summary")return Z;return null}function Qe($,Z){let J=rN(Z);return!!J&&($===J||b0(J,$))}function sO($){let Z=$?P2($):"";return $!=null&&$.matches(Je)&&(Z!=="summary"||$.parentElement!=null&&P2($.parentElement)==="details"&&rN($.parentElement)===$)&&(Z!=="details"||rN($)==null)&&(Z!=="input"||$.type!=="hidden")}function tO($){if(!sO($)||!$.isConnected||$.matches(":disabled"))return!1;for(let Z=$;Z;Z=He(Z)){let J=Z!==$,H=P2(Z)==="slot";if(Z.hasAttribute("inert"))return!1;if(J&&P2(Z)==="details"&&!Z.open&&!Qe($,Z)||Z.hasAttribute("hidden")||!H&&!Be(Z,J))return!1}return!0}function Be($,Z){let J=y2($);if(!Z)return c7($,J);return J.display!=="none"}function eO($){let Z=$.tabIndex;if(Z<0){let J=P2($);if(J==="details"||J==="audio"||J==="video"||P1($)&&$.isContentEditable)return 0}return Z}function iN($){if(P2($)!=="input")return null;let Z=$;return Z.type==="radio"&&Z.name!==""?Z:null}function Xe($,Z){let J=iN($);if(!J)return!0;let H=Z.find((Q)=>{let B=iN(Q);return B?.name===J.name&&B.form===J.form&&B.checked});if(H)return H===J;return Z.find((Q)=>{let B=iN(Q);return B?.name===J.name&&B.form===J.form})===J}function $T($){if(P1($)&&P2($)==="slot"){let Z=$.assignedElements({flatten:!0});if(Z.length>0)return Z}if(P1($)&&$.shadowRoot)return Array.from($.shadowRoot.children);return Array.from($.children)}function ZT($,Z){$T($).forEach((J)=>{if(sO(J))Z.push(J);ZT(J,Z)})}function JT($,Z,J){$T($).forEach((H)=>{if(P1(H)&&H.matches(Z))J.push(H);JT(H,Z,J)})}function Oz($){return tO($)&&eO($)>=0}function aN($){let Z=[];return ZT($,Z),Z.filter(tO)}function PZ($){let Z=aN($);return Z.filter((J)=>eO(J)>=0&&Xe(J,Z))}function HT($,Z){let J=PZ($),H=J.length;if(H===0)return;let Q=p1(m0($)),B=J.indexOf(Q),X=B===-1?Z===1?0:H-1:B+Z;return J[X]}function _Z($){return HT(m0($).body,1)||$}function Tz($){return HT(m0($).body,-1)||$}function QT($,Z){if(!$)return null;let J=PZ(m0($).body),H=J.length;if(H===0)return null;let Q=J.indexOf($);if(Q===-1)return null;let B=(Q+Z+H)%H;return J[B]}function BT($){return QT($,1)}function XT($){return QT($,-1)}function q3($,Z){let J=Z||$.currentTarget,H=$.relatedTarget;return!H||!b0(J,H)}function zT($){PZ($).forEach((J)=>{J.dataset.tabindex=J.getAttribute("tabindex")||"",J.setAttribute("tabindex","-1")})}function oN($){let Z=[];JT($,"[data-tabindex]",Z),Z.forEach((J)=>{let H=J.dataset.tabindex;if(delete J.dataset.tabindex,H)J.setAttribute("tabindex",H);else J.removeAttribute("tabindex")})}function nN($){let Z=new Map,J=0,H=0;return $.forEach((Q,B)=>{let X=Q.transitionStatus==="ending";if(Z.set(Q.id,{value:Q,domIndex:B,visibleIndex:X?-1:J,offsetY:H}),H+=Q.height||0,!X)J+=1}),Z}function sN($,Z){let J=0;return $.map((H)=>{if(H.transitionStatus==="ending")return H;let Q=J>=Z;return J+=1,H.limited===Q?H:{...H,limited:Q}})}var m8={toasts:($)=>$.toasts,isEmpty:($)=>$.toasts.length===0,toast:($,Z)=>$.toastMetadata.get(Z)?.value,toastIndex:($,Z)=>$.toastMetadata.get(Z)?.domIndex??-1,toastOffsetY:($,Z)=>$.toastMetadata.get(Z)?.offsetY??0,toastVisibleIndex:($,Z)=>$.toastMetadata.get(Z)?.visibleIndex??-1,focused:($)=>$.focused,expanded:($)=>$.hovering||$.focused,expandedOrOutOfFocus:($)=>$.hovering||$.focused||!$.isWindowFocused,prevFocusElement:($)=>$.prevFocusElement};class tN extends b2{timers=new Map;areTimersPaused=!1;constructor($){super({...$,toastMetadata:nN($.toasts)},{},m8)}setViewport=($)=>{this.set("viewport",$)};syncProviderProps($,Z){let J=this.state.limit!==Z;if(this.state.timeout===$&&!J)return;let H={timeout:$,limit:Z};if(J){let Q=sN(this.state.toasts,Z);H.toasts=Q,H.toastMetadata=nN(Q)}this.update(H)}disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($,Z=!1){let J=m8.toastIndex(this.state,$);if(J===-1)return;let H=this.state.toasts[J];if(!Z)H?.onRemove?.();let Q=[...this.state.toasts];Q.splice(J,1),this.setToasts(Q)}addToast=($)=>{let{timeout:Z,limit:J}=this.state,H=$.id||qz("toast");if($.id){let z=m8.toast(this.state,$.id);if(z)if(z.transitionStatus==="ending")this.removeToast($.id,!0);else{let{id:G,transitionStatus:U,...K}=$;return this.updateToastInternal($.id,K,!0,!0),$.id}}let Q={...$,id:H,updateKey:0,transitionStatus:"starting"},B=[Q,...this.state.toasts];this.setToasts(sN(B,J));let X=Q.timeout??Z;if(Q.type!=="loading"&&X>0)this.scheduleTimer(H,X,()=>this.closeToast(H));if(m8.expandedOrOutOfFocus(this.state))this.pauseTimers();return H};updateToast=($,Z)=>{let J=m8.toast(this.state,$);if(!J||J.transitionStatus==="ending")return;this.updateToastInternal($,typeof Z==="function"?Z(J):Z,!1,!0)};updateToastInternal=($,Z,J=!1,H=!1)=>{let{timeout:Q,toasts:B}=this.state,X=m8.toast(this.state,$);if(!X)return;if(X.transitionStatus==="ending")return;let z={...X,...Z,...H&&{updateKey:X.updateKey+1}};this.setToasts(B.map((N)=>N.id===$?z:N));let G=z.timeout??Q,U=X.timeout??Q,K=Object.hasOwn(Z,"timeout"),Y=z.transitionStatus!=="ending"&&z.type!=="loading"&&G>0,F=this.timers.has($),W=U!==G,q=X.type==="loading";if(!Y&&F){this.clearTimer($);return}if(Y&&(!F||W||K||q||J)){if(this.clearTimer($),this.scheduleTimer($,G,()=>this.closeToast($)),m8.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{let Z=$===void 0,{limit:J,toasts:H}=this.state,Q;if(Z)Q=H,this.clearTimers();else{let z=m8.toast(this.state,$);if(!z)return;Q=[z],this.clearTimer($)}let B=H.map((z)=>Z||z.id===$?{...z,transitionStatus:"ending",height:0}:z),X=sN(B,J);this.setToasts(X,!X.some((z)=>z.transitionStatus!=="ending")),Q.forEach((z)=>{if(z.transitionStatus!=="ending")z.onClose?.()}),this.handleFocusManagement($)};promiseToast=($,Z)=>{let J=Nz(Z.loading),H=this.addToast({...J,type:"loading"}),Q=$.then((B)=>{let X=Nz(Z.success,B);return this.updateToast(H,{...X,type:"success",timeout:X.timeout}),B}).catch((B)=>{let X=Nz(Z.error,B);return this.updateToast(H,{...X,type:"error",timeout:X.timeout}),Promise.reject(B)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(Q);return Q};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout)$.timeout.clear(),$.remaining=Math.max($.remaining-(Date.now()-$.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=c5.create(),$.timeout.start($.remaining,()=>{this.handleTimerFired(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=M1($);if(b0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,J){let H=Date.now(),B=!m8.expandedOrOutOfFocus(this.state)?c5.create():void 0;B?.start(Z,()=>{this.handleTimerFired($),J()}),this.timers.set($,{timeout:B,start:H,delay:Z,remaining:Z,callback:J})}clearTimers(){this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer($){this.timers.get($)?.timeout?.clear(),this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}handleTimerFired($){this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts($,Z=$.length===0){let J={toasts:$,toastMetadata:nN($)};if(Z)J.hovering=!1,J.focused=!1;this.update(J)}handleFocusManagement($){let Z=p1(m0(this.state.viewport));if(!this.state.viewport||!b0(this.state.viewport,Z)||!D9(Z))return;if($===void 0){this.restoreFocusToPrevElement();return}let J=m8.toasts(this.state),H=m8.toastIndex(this.state,$),Q=(X,z)=>{for(let G=X;G>=0&&G<J.length;G+=z)if(J[G].transitionStatus!=="ending")return J[G];return null},B=Q(H+1,1)??Q(H-1,-1);if(B)B.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var Cz=P(c(),1),UT=function(Z){let{children:J,timeout:H=5000,limit:Q=3,toastManager:B}=Z,X=l1(()=>new tN({timeout:H,limit:Q,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return a3(X.disposeEffect),GT.useEffect(function(){if(!B)return;return B[" subscribe"](({action:U,options:K})=>{let Y=K.id;if(U==="promise"&&K.promise)X.promiseToast(K.promise,K);else if(U==="update"&&Y)X.updateToast(Y,K.updates);else if(U==="close")X.closeToast(Y);else X.addToast(K)})},[X,B]),Cz.jsxs(ON.Provider,{value:X,children:[Cz.jsx(ze,{store:X,timeout:H,limit:Q}),J]})};function ze($){let{store:Z,timeout:J,limit:H}=$;return J0(()=>{Z.syncProviderProps(J,H)},[Z,J,H]),null}var D8=P(m(),1);var KT={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},u8={...KT,position:"fixed",top:0,left:0},wz={...KT,position:"absolute"};var Ez=P(m(),1);var YT=P(c(),1),x4=Ez.forwardRef(function(Z,J){let[H,Q]=Ez.useState();return J0(()=>{if(r1.screenReader.voiceOver&&r1.engine.webkit)Q("button")},[]),YT.jsx("span",{...Z,ref:J,style:u8,"aria-hidden":H?void 0:!0,...{tabIndex:0,role:H},"data-base-ui-focus-guard":""})});var FT="--toast-frontmost-height";var N3=P(c(),1),WT=D8.forwardRef(function(Z,J){let{render:H,className:Q,style:B,children:X,...z}=Z,G=N9(),U=d1(),K=D8.useRef(!1),Y=D8.useRef(!1),F=D8.useRef(!1),W=G.useState("isEmpty"),q=G.useState("toasts"),N=G.useState("focused"),A=G.useState("expanded"),V=G.useState("prevFocusElement"),D=q[0]?.height,L=q.some((f)=>f.transitionStatus==="ending"),j=q.filter((f)=>f.priority==="high");D8.useEffect(()=>{let f=G.state.viewport;if(!f||W)return;let w=I1(f),i=m0(f);function r(s){if(s.key==="F6"&&M1(s)!==f)s.preventDefault(),G.set("prevFocusElement",p1(i)),f?.focus({preventScroll:!0}),G.pauseTimers(),G.set("focused",!0)}function x(s){if(M1(s)!==w)return;G.set("isWindowFocused",!1),G.pauseTimers()}function l(s){if(s.relatedTarget)return;let p=M1(s),d=p1(m0(f));if(p===w||!b0(f,p)||!D9(d))G.resumeTimers();U.start(0,()=>G.set("isWindowFocused",!0))}return M2(n0(w,"keydown",r),n0(w,"blur",x,!0),n0(w,"focus",l,!0),n0(i,"pointerdown",G.handleDocumentPointerDown,!0))},[G,U,W]);function M(f){K.current=!0;let w=f.relatedTarget===G.state.viewport?q.find((i)=>i.transitionStatus!=="ending"&&!i.limited):void 0;if(w)w.ref?.current?.focus();else G.restoreFocusToPrevElement()}function _(f){if(f.key==="Tab"&&f.shiftKey&&M1(f.nativeEvent)===G.state.viewport)f.preventDefault(),G.restoreFocusToPrevElement()}function E(){if(G.state.toasts.some((w)=>w.transitionStatus==="ending")||F.current||!Y.current)return;if(G.state.isWindowFocused)G.resumeTimers();G.set("hovering",!1),Y.current=!1}D8.useEffect(E,[L,G]);function C(){G.pauseTimers(),G.set("hovering",!0),Y.current=!1}function R(){if(G.state.isWindowFocused)G.resumeTimers()}function T(){Y.current=!0,E()}function I(f){if(f.pointerType==="touch")F.current=!0}function y(f){if(f.pointerType!=="touch")return;F.current=!1,E()}function S(){if(K.current){K.current=!1;return}if(N)return;if(D9(p1(m0(G.state.viewport))))G.set("focused",!0),G.pauseTimers()}function O(f){if(!N||b0(G.state.viewport,f.relatedTarget))return;G.set("focused",!1),R()}let k={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:C,onMouseMove:C,onMouseLeave:T,onFocus:S,onBlur:O,onKeyDown:_,onClick:S,onPointerDown:I,onPointerUp:y,onPointerCancel:y,style:{[FT]:D?`${D}px`:void 0}},b={expanded:A},h=!W&&V&&N3.jsx(x4,{onFocus:M}),v=z0("div",Z,{ref:[J,G.setViewport],state:b,props:[k,z,{children:N3.jsxs(D8.Fragment,{children:[h,X,h]})}]});return N3.jsxs(D8.Fragment,{children:[h,v,!N&&j.length>0&&N3.jsx("div",{style:u8,children:j.map((f)=>N3.jsxs("div",{role:"alert","aria-atomic":!0,children:[N3.jsx("div",{children:f.title}),N3.jsx("div",{children:f.description})]},f.id))})]})});var N5=P(m(),1),ST=P(e4(),1);function L8($){if(Uz(19))return $;return $?"true":void 0}var Sz=P(m(),1),eN=Sz.createContext(void 0);function Z6(){let $=Sz.useContext(eN);if(!$)throw Error(y0(66));return $}var qT=P(m(),1);var $V=P(e4(),1);function p8($){if($==null)return $;return"current"in $?$.current:$}var Rz=null;function Ue($){if(!Rz){let Z=[];Rz=Z,queueMicrotask(()=>{Rz=null,$V.flushSync(()=>{for(let J of Z)J()})})}Rz.push($)}function h4($,Z=!1,J=!1){let H=N4();return U0((Q,B=null)=>{H.cancel();let X=p8($);if(X==null)return;let z=X,G=()=>{if(!J){$V.flushSync(Q);return}Ue(()=>{if(!B?.aborted)Q()})};if(typeof z.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){Q();return}function U(){Promise.all(z.getAnimations().map((K)=>K.finished)).then(()=>{if(!B?.aborted)G()},()=>{if(B?.aborted)return;if(z.getAnimations().some((Y)=>Y.pending||Y.playState!=="finished")){U();return}G()})}if(Z){let K=g7;if(!z.hasAttribute(K)){H.request(U);return}let Y=new MutationObserver(()=>{if(!z.hasAttribute(K))Y.disconnect(),U()});Y.observe(z,{attributes:!0,attributeFilter:[K]}),B?.addEventListener("abort",()=>Y.disconnect(),{once:!0});return}H.request(U)})}function q5($){let{enabled:Z=!0,open:J,ref:H,batch:Q=!1,onComplete:B}=$,X=U0(B),z=h4(H,J,Q);qT.useEffect(()=>{if(!Z)return;let G=new AbortController;return z(X,G.signal),()=>{G.abort()}},[Z,J,X,z])}var NT=500,Iz=500,VT={style:{transition:"none"}},jZ="data-base-ui-click-trigger";var AT="[data-base-ui-swipe-ignore]",DT="[data-swipe-ignore]",LT={fallbackAxisSide:"none"},P9={fallbackAxisSide:"end"},MT={clipPath:"inset(50%)",position:"fixed",top:0,left:0};var kz=P(m(),1);function _2($,Z=Number.MIN_SAFE_INTEGER,J=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,J))}function bz($,Z){let J=(Z??I1($).getComputedStyle($)).transform,H=0,Q=0,B=1;if(J&&J!=="none"){let X=J.match(/matrix(?:3d)?\(([^)]+)\)/);if(X){let z=X[1].split(", ").map(parseFloat);if(z.length===6)H=z[4],Q=z[5],B=Math.sqrt(z[0]*z[0]+z[1]*z[1]);else if(z.length===16)H=z[12],Q=z[13],B=z[0]}}return{x:H,y:Q,scale:B}}function yz($,Z,J){switch($){case"up":return-J;case"down":return J;case"left":return-Z;case"right":return Z;default:return 0}}var xz="--toast-index",PT="--toast-offset-y",_T="--toast-height",jT="--toast-swipe-movement-x",OT="--toast-swipe-movement-y";var CT="data-swipe-direction",QL0=n4.startingStyle,BL0=n4.endingStyle;var RT=P(c(),1),Ye={...Q2,swipeDirection($){return $?{[CT]:$}:null}},wT=40,Fe=10,ET=0.5,We=1,qe=`${AT},${DT}`,IT=N5.forwardRef(function(Z,J){let{toast:H,render:Q,className:B,swipeDirection:X=["down","right"],style:z,...G}=Z,U=H.positionerProps?.anchor!==void 0,K=[];if(!U)K=Array.isArray(X)?X:[X];let Y=K.length>0,F=N9(),[W,q]=N5.useState(void 0),[N,A]=N5.useState(!1),[V,D]=N5.useState(!1),[L,j]=N5.useState({x:0,y:0}),[M,_]=N5.useState({x:0,y:0,scale:1}),[E,C]=N5.useState(),[R,T]=N5.useState(),[I,y]=N5.useState(null),S=N5.useRef(null),O=N5.useRef(void 0),k=N5.useRef({x:0,y:0}),b=N5.useRef({x:0,y:0,scale:1}),h=N5.useRef(void 0),v=N5.useRef(0),f=N5.useRef(!1),w=N5.useRef({x:0,y:0}),i=N5.useRef(!1),r=N5.useRef({x:0,y:0}),x=N5.useRef(null),l=N5.useRef(null),s=F.useState("toastIndex",H.id),p=F.useState("toastVisibleIndex",H.id),d=F.useState("toastOffsetY",H.id),o=F.useState("focused"),Z0=F.useState("expanded");q5({open:H.transitionStatus!=="ending",ref:S,onComplete(){if(H.transitionStatus==="ending")F.removeToast(H.id)}});let H0=U0((M0=!1)=>{let V0=S.current;if(!V0)return;let L0=V0.style.height;V0.style.height="auto";let g=V0.offsetHeight;V0.style.height=L0;function u(){F.updateToastInternal(H.id,{ref:S,height:g,transitionStatus:void 0})}if(M0)ST.flushSync(u);else u()});J0(()=>{let M0=O.current;if(H.transitionStatus!=="starting"&&M0===H.id)return;if(M0!==void 0)q(void 0),_({x:0,y:0,scale:1}),G0({x:0,y:0});O.current=H.id,H0()},[H0,H.id,H.transitionStatus]);function G0(M0){r.current=M0,j(M0)}J0(()=>{return()=>{l.current?.abort()}},[]);function X0(M0,V0){let L0=(t)=>t>0?t**ET:-(Math.abs(t)**ET),g=M0>0&&!K.includes("right")||M0<0&&!K.includes("left"),u=V0>0&&!K.includes("down")||V0<0&&!K.includes("up");return{x:g?L0(M0):M0,y:u?L0(V0):V0}}let Y0=U0((M0)=>{if(M0.pointerId!==x.current)return;x.current=null,l.current?.abort(),l.current=null,A(!1),D(!1),y(null);let V0=b.current;if(M0.type==="pointercancel"||f.current){G0({x:V0.x,y:V0.y}),q(void 0);return}let L0=r.current,g=L0.x-V0.x,u=L0.y-V0.y,t;for(let W0 of K)if(yz(W0,g,u)>wT){t=W0;break}if(t)q(t),F.closeToast(H.id);else G0({x:V0.x,y:V0.y}),q(void 0)});function A0(M0){if(M0.button!==0)return;if(M0.pointerType==="touch")F.pauseTimers();if(M1(M0.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${qe}`))return;f.current=!1,h.current=void 0,v.current=0,x.current=M0.pointerId,k.current={x:M0.clientX,y:M0.clientY},w.current=k.current;let g=M0.currentTarget,u=bz(g);b.current=u,_(u),G0({x:u.x,y:u.y}),F.set("hovering",!0),A(!0),D(!1),y(null),i.current=!0,l.current?.abort();let t=new AbortController;l.current=t;let W0=m0(g);W0.addEventListener("pointerup",Y0,{signal:t.signal}),W0.addEventListener("pointercancel",Y0,{signal:t.signal}),g.setPointerCapture?.(M0.pointerId)}function N0(M0){if(M0.pointerId!==x.current)return;if(M0.preventDefault(),i.current)k.current={x:M0.clientX,y:M0.clientY},i.current=!1;let{clientY:V0,clientX:L0,movementX:g,movementY:u}=M0;if(u<0&&V0>w.current.y||u>0&&V0<w.current.y)w.current={x:w.current.x,y:V0};if(g<0&&L0>w.current.x||g>0&&L0<w.current.x)w.current={x:L0,y:w.current.y};let t=L0-k.current.x,W0=V0-k.current.y,I0=V0-w.current.y,c0=L0-w.current.x,f0=I;if(!V){if(Math.sqrt(t*t+W0*W0)>=We){D(!0);let B1=K.includes("left")||K.includes("right"),s1=K.includes("up")||K.includes("down");if(B1&&s1){let C0=Math.abs(t),p0=Math.abs(W0);f0=C0>p0?"horizontal":"vertical",y(f0)}}}let T0;if(!h.current){if(f0==="vertical"){if(W0>0)T0="down";else if(W0<0)T0="up"}else if(f0==="horizontal"){if(t>0)T0="right";else if(t<0)T0="left"}else if(Math.abs(t)>=Math.abs(W0))T0=t>0?"right":"left";else T0=W0>0?"down":"up";if(T0&&K.includes(T0))h.current=T0,v.current=yz(T0,t,W0),q(T0)}else{let S1=h.current,B1=yz(S1,c0,I0);if(B1>wT)f.current=!1,q(S1);else if(!(K.includes("left")&&K.includes("right"))&&!(K.includes("up")&&K.includes("down"))&&v.current-B1>=Fe)f.current=!0}let x0=X0(t,W0),J1=b.current.x,W1=b.current.y,d0=K.includes("left")||K.includes("right"),v0=K.includes("up")||K.includes("down");if(f0!=="vertical"&&d0)J1+=x0.x;if(f0!=="horizontal"&&v0)W1+=x0.y;G0({x:J1,y:W1})}function F0(M0){if(M0.key==="Escape"){if(!S.current||!b0(S.current,p1(m0(S.current))))return;F.closeToast(H.id)}}N5.useEffect(()=>{let M0=S.current;if(!Y||!M0)return;function V0(L0){if(x.current===null||!b0(M0,M1(L0)))return;L0.preventDefault()}return n0(M0,"touchmove",V0,{passive:!1})},[Y]);function n(){let M0=L.x-M.x,V0=L.y-M.y;return{transition:N?"none":void 0,transform:N?`translateX(${L.x}px) translateY(${L.y}px) scale(${M.scale})`:void 0,[jT]:`${M0}px`,[OT]:`${V0}px`}}let a=H.priority==="high",e={role:a?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":E,"aria-describedby":R,"aria-hidden":a&&!o?!0:void 0,onPointerDown:Y?A0:void 0,onPointerMove:Y?N0:void 0,onPointerUp:Y?Y0:void 0,onPointerCancel:Y?Y0:void 0,onKeyDown:F0,inert:L8(H.limited),style:{...n(),[xz]:H.transitionStatus==="ending"?s:p,[PT]:`${d}px`,[_T]:H.height?`${H.height}px`:void 0}},$0=N5.useMemo(()=>({toast:H,setTitleId:C,setDescriptionId:T,recalculateHeight:H0,visibleIndex:p,expanded:Z0}),[H,C,T,H0,p,Z0]),Q0={transitionStatus:H.transitionStatus,expanded:Z0,limited:H.limited||!1,type:H.type,swiping:N,swipeDirection:W},_0=z0("div",Z,{ref:[J,S],state:Q0,stateAttributesMapping:Ye,props:[e,G]});return RT.jsx(eN.Provider,{value:$0,children:_0})});var hz=P(m(),1);var bT=hz.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,{visibleIndex:z,expanded:G,recalculateHeight:U}=Z6(),K=hz.useRef(null);J0(()=>{U();let W=K.current;if(!W||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let q=new ResizeObserver(()=>U(!0)),N=new MutationObserver(()=>U(!0));return q.observe(W),N.observe(W,{childList:!0,subtree:!0,characterData:!0}),()=>{q.disconnect(),N.disconnect()}},[U]);let Y=z>0;return z0("div",Z,{ref:[J,K],state:{expanded:G,behind:Y},props:X})});var gT=P(m(),1);var vz=P(m(),1);var kT=0;function Ne($,Z="mui"){let[J,H]=vz.useState($),Q=$||J;return vz.useEffect(()=>{if(J==null)kT+=1,H(`${Z}-${kT}`)},[J,Z]),Q}var yT=xT.useId;function V4($,Z){if(yT!==void 0){let J=yT();return $??(Z?`${Z}-${J}`:J)}return Ne($,Z)}var hT=P(m(),1);function vT($){if($==null||typeof $==="boolean"||$==="")return!1;if(Array.isArray($))return $.some(vT);return!0}function gz($){return hT.isValidElement($)&&vT($.props.children)}function fz($,Z,J){let{toast:H,setTitleId:Q,setDescriptionId:B}=Z6(),X=J==="title"?Q:B,z=Z??(J==="title"?H.title:H.description);return{id:V4($),children:z,type:H.type,setId:X}}function mz($,Z,J){let H=gz($);return J0(()=>{if(!H)return;return J(Z),()=>{J((Q)=>Q===Z?void 0:Q)}},[H,Z,J]),H?$:null}var fT=gT.forwardRef(function(Z,J){let{render:H,className:Q,style:B,id:X,children:z,...G}=Z,{id:U,children:K,type:Y,setId:F}=fz(X,z,"description"),q=z0("p",Z,{ref:J,state:{type:Y},props:{...G,id:U,children:K}});return mz(q,U,F)});var mT=P(m(),1);var uT=mT.forwardRef(function(Z,J){let{render:H,className:Q,style:B,id:X,children:z,...G}=Z,{id:U,children:K,type:Y,setId:F}=fz(X,z,"title"),q=z0("h2",Z,{ref:J,state:{type:Y},props:{...G,id:U,children:K}});return mz(q,U,F)});var uz=P(m(),1);var pT=uz.forwardRef(function(Z,J){let{render:H,className:Q,style:B,disabled:X,nativeButton:z=!0,...G}=Z,U=N9(),{toast:K,expanded:Y}=Z6(),[F,W]=uz.useState(!1),{getButtonProps:q,buttonRef:N}=T5({disabled:X,native:z}),A={type:K.type};return z0("button",Z,{ref:[J,N],state:A,props:[{"aria-hidden":!Y&&!F,onClick(){U.closeToast(K.id)},onFocus(){W(!0)},onBlur(){W(!1)}},G,q]})});var cT=P(m(),1);var dT=cT.forwardRef(function(Z,J){let{render:H,className:Q,style:B,disabled:X,nativeButton:z=!0,...G}=Z,{toast:U}=Z6(),K=U.actionProps?.children??G.children,{getButtonProps:Y,buttonRef:F}=T5({disabled:X,native:z}),W={type:U.type},q=z0("button",Z,{ref:[J,F],state:W,props:[G,U.actionProps,Y,{children:K}]});return gz(q)?q:null});var oT=P(m(),1);var dz=P(m(),1),rT=P(e4(),1);var I5=P(m(),1),ZV=P(e4(),1);var K0={};C5(K0,{windowResize:()=>ne,wheel:()=>ue,triggerPress:()=>Ae,triggerHover:()=>De,triggerFocus:()=>Le,trackPress:()=>Ce,swipe:()=>oe,siblingOpen:()=>de,scrub:()=>pe,pointer:()=>fe,outsidePress:()=>Me,none:()=>Ve,missing:()=>ie,listNavigation:()=>ve,linkPress:()=>je,keyboard:()=>ge,itemPress:()=>Pe,inputPress:()=>ke,inputPaste:()=>be,inputClear:()=>Re,inputChange:()=>Se,inputBlur:()=>Ie,initial:()=>re,incrementPress:()=>we,imperativeAction:()=>ae,focusOut:()=>ye,escapeKey:()=>xe,drag:()=>me,disabled:()=>le,decrementPress:()=>Ee,closeWatcher:()=>he,closePress:()=>_e,clearPress:()=>Oe,chipRemovePress:()=>Te,cancelOpen:()=>ce});var Ve="none",Ae="trigger-press",De="trigger-hover",Le="trigger-focus",Me="outside-press",Pe="item-press",_e="close-press",je="link-press",Oe="clear-press",Te="chip-remove-press",Ce="track-press",we="increment-press",Ee="decrement-press",Se="input-change",Re="input-clear",Ie="input-blur",be="input-paste",ke="input-press",ye="focus-out",xe="escape-key",he="close-watcher",ve="list-navigation",ge="keyboard",fe="pointer",me="drag",ue="wheel",pe="scrub",ce="cancel-open",de="sibling-open",le="disabled",ie="missing",re="initial",ae="imperative-action",oe="swipe",ne="window-resize";function R0($,Z,J,H){let Q=!1,B=!1,X=H??L1;return{reason:$,event:Z??new Event("base-ui"),cancel(){Q=!0},allowPropagation(){B=!0},get isCanceled(){return Q},get isPropagationAllowed(){return B},trigger:J,...X}}function pz($,Z,J){let H=J??L1;return{reason:$,event:Z??new Event("base-ui"),...H}}function V3($){return`data-base-ui-${$}`}var d7=P(c(),1),iT=I5.createContext(null),JV=()=>I5.useContext(iT),se=V3("portal");function cz($={}){let{ref:Z,container:J,componentProps:H=L1,elementProps:Q}=$,B=V4(),z=JV()?.portalNode,[G,U]=I5.useState(null),[K,Y]=I5.useState(null),F=U0((A)=>{if(A!==null)Y(A)}),W=I5.useRef(null);J0(()=>{if(J===null){if(W.current)W.current=null,Y(null),U(null);return}let A=(J&&(lT(J)?J:J.current))??z??document.body;if(A==null){if(W.current)W.current=null,Y(null),U(null);return}if(W.current!==A)W.current=A,Y(null),U(A)},[J,z]);let q=z0("div",H,{ref:[Z,F],props:[{id:B,[se]:""},Q]}),N=G&&q?ZV.createPortal(q,G):null;return{node:K,nodeId:I5.isValidElement(q)?q.props.id:void 0,subtree:N}}var l7=I5.forwardRef(function(Z,J){let{render:H,className:Q,style:B,children:X,container:z,portalOwnerRole:G,...U}=Z,{node:K,nodeId:Y,subtree:F}=cz({container:z,ref:J,componentProps:Z,elementProps:U}),W=I5.useRef(null),q=I5.useRef(null),N=I5.useRef(null),A=I5.useRef(null),[V,D]=I5.useState(null),L=I5.useRef(!1),j=V?.modal,M=V?.open,_=!!V&&!V.modal&&V.open&&!!K;I5.useEffect(()=>{if(!K||j)return;function C(R){if(K&&R.relatedTarget&&q3(R))if(R.type==="focusin"){if(L.current)oN(K),L.current=!1}else zT(K),L.current=!0}return M2(n0(K,"focusin",C,!0),n0(K,"focusout",C,!0))},[K,j]),J0(()=>{if(!K||M!==!0||!L.current)return;oN(K),L.current=!1},[M,K]);let E=I5.useMemo(()=>({beforeOutsideRef:W,afterOutsideRef:q,beforeInsideRef:N,afterInsideRef:A,portalNode:K,setFocusManagerState:D}),[K]);return d7.jsxs(I5.Fragment,{children:[F,d7.jsxs(iT.Provider,{value:E,children:[_&&K&&d7.jsx(x4,{"data-type":"outside",ref:W,onFocus:(C)=>{if(q3(C,K))N.current?.focus();else{let R=V?V.domReference:null;Tz(R)?.focus()}}}),_&&K&&d7.jsx("span",{role:G,"aria-owns":Y,style:MT}),K&&ZV.createPortal(X,K),_&&K&&d7.jsx(x4,{"data-type":"outside",ref:q,onFocus:(C)=>{if(q3(C,K))A.current?.focus();else{let R=V?V.domReference:null;if(_Z(R)?.focus(),V?.closeOnFocusOut)V?.onOpenChange(!1,R0(K0.focusOut,C.nativeEvent))}}})]})]})});var aT=P(c(),1),OZ=dz.forwardRef(function(Z,J){let{children:H,container:Q,className:B,render:X,style:z,...G}=Z,{node:U,subtree:K}=cz({container:Q,ref:J,componentProps:Z,elementProps:G});if(!K&&!U)return null;return aT.jsxs(dz.Fragment,{children:[K,U&&rT.createPortal(H,U)]})});var nT=P(c(),1),sT=oT.forwardRef(function(Z,J){return nT.jsx(OZ,{ref:J,...Z})});var qG=P(m(),1);var $8=P(m(),1);function U5($){let Z=l1(te,$).current;return Z.next=$,J0(Z.effect),Z}function te($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var A4=P(m(),1);function ee($,Z){if(Z!=null&&!t4(Z))return 0;if(typeof $==="function")return $();return $}function c8($,Z,J){let H=ee($,J);if(typeof H==="number")return H;return H?.[Z]}function HV($){if(typeof $==="function")return $();return $}function lz($,Z){return Z||$==="click"||$==="mousedown"}function tT($){return $?.includes("mouse")&&$!=="mousedown"}var eT=P(c(),1),$C=A4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new c5,currentIdRef:{current:null},currentContextRef:{current:null}});function $00($,Z){$.current=Z.current}function QV($){let{children:Z,delay:J,timeoutMs:H=0}=$,Q=A4.useRef(J),B=A4.useRef(J),X=A4.useRef(null),z=A4.useRef(null),G=d1();return J0(()=>{if(B.current=J,!X.current){Q.current=J;return}Q.current={open:c8(Q.current,"open"),close:c8(J,"close")}},[J,X,Q,B]),eT.jsx($C.Provider,{value:A4.useMemo(()=>({hasProvider:!0,delayRef:Q,initialDelayRef:B,currentIdRef:X,timeoutMs:H,currentContextRef:z,timeout:G}),[H,G]),children:Z})}function BV($,Z={open:!1}){let{open:J}=Z,H="rootStore"in $?$.rootStore:$,Q=H.useState("floatingId"),B=A4.useContext($C),{currentIdRef:X,delayRef:z,timeoutMs:G,initialDelayRef:U,currentContextRef:K,hasProvider:Y,timeout:F}=B,[W,q]=A4.useState(!1),N=A4.useRef(J);return J0(()=>{N.current=J},[J]),J0(()=>{function A(){K.current?.setIsInstantPhase(!1),X.current=null,K.current=null,z.current=U.current,F.clear()}if(!X.current)return;if(!J&&X.current===Q){if(q(!1),G){let V=Q;return F.start(G,()=>{if(H.select("open")||X.current&&X.current!==V)return;A()}),()=>{if(N.current||X.current!==V)F.clear()}}A()}return},[J,Q,X,z,G,U,K,F,H]),J0(()=>{if(!J)return;let A=K.current,V=X.current;if(F.clear(),K.current={onOpenChange:H.setOpen,setIsInstantPhase:q},X.current=Q,z.current={open:0,close:c8(U.current,"close")},V!==null&&V!==Q)q(!0),A?.setIsInstantPhase(!0),A?.onOpenChange(!1,R0(K0.none));else q(!1),A?.setIsInstantPhase(!1)},[J,Q,H,X,z,U,K,F]),J0(()=>{return()=>{if(X.current===Q){if(K.current=null,!N.current)return;X.current=null,$00(z,U),F.clear()}}},[K,X,z,Q,U,F]),A4.useMemo(()=>({activeIdRef:X,hasProvider:Y,delayRef:z,isInstantPhase:W}),[X,Y,z,W])}var s2=P(m(),1);var iz=0;function TZ($,Z={}){let{preventScroll:J=!1,sync:H=!1,shouldFocus:Q}=Z;cancelAnimationFrame(iz);function B(){if(Q&&!Q())return;$?.focus({preventScroll:J})}if(H)return B(),X1;let X=requestAnimationFrame(B);return iz=X,()=>{if(iz===X)cancelAnimationFrame(X),iz=0}}var XV={inert:new WeakMap,"aria-hidden":new WeakMap},ZC="data-base-ui-inert",GV={inert:new WeakSet,"aria-hidden":new WeakSet},ZQ=new WeakMap,zV=0;function Z00($){return GV[$]}function BC($){if(!$)return null;return n3($)?$.host:BC($.parentNode)}var JC=($,Z)=>Z.map((J)=>{if($.contains(J))return J;let H=BC(J);if($.contains(H))return H;return null}).filter((J)=>J!=null),HC=($)=>{let Z=new Set;return $.forEach((J)=>{let H=J;while(H&&!Z.has(H))Z.add(H),H=H.parentNode}),Z},QC=($,Z,J)=>{let H=[],Q=(B)=>{if(!B||J.has(B))return;Array.from(B.children).forEach((X)=>{if(P2(X)==="script")return;if(Z.has(X))Q(X);else H.push(X)})};return Q($),H};function J00($,Z,J,H,{mark:Q=!0}){let B=null;if(H)B="inert";else if(J)B="aria-hidden";let X=null,z=null,G=JC(Z,$),U=Q?QC(Z,HC(G),new Set(G)):[],K=[],Y=[];if(B){let F=XV[B],W=Z00(B);z=W,X=F;let q=JC(Z,Array.from(Z.querySelectorAll("[aria-live]"))),N=G.concat(q);QC(Z,HC(N),new Set(N)).forEach((V)=>{let D=V.getAttribute(B),L=D!==null&&D!=="false",j=(F.get(V)||0)+1;if(F.set(V,j),K.push(V),j===1&&L)W.add(V);if(!L)V.setAttribute(B,B==="inert"?"":"true")})}if(Q)U.forEach((F)=>{let W=(ZQ.get(F)||0)+1;if(ZQ.set(F,W),Y.push(F),W===1)F.setAttribute(ZC,"")});return zV+=1,()=>{if(X)K.forEach((F)=>{let q=(X.get(F)||0)-1;if(X.set(F,q),!q){if(!z?.has(F)&&B)F.removeAttribute(B);z?.delete(F)}});if(Q)Y.forEach((F)=>{let W=(ZQ.get(F)||0)-1;if(ZQ.set(F,W),!W)F.removeAttribute(ZC)});if(zV-=1,!zV)XV.inert=new WeakMap,XV["aria-hidden"]=new WeakMap,GV.inert=new WeakSet,GV["aria-hidden"]=new WeakSet,ZQ=new WeakMap}}function UV($,Z={}){let{ariaHidden:J=!1,inert:H=!1,mark:Q=!0}=Z,B=m0($[0]).body;return J00($,B,J,H,{mark:Q})}var J6=P(m(),1);function rz(){let $=new Map;return{emit(Z,J){$.get(Z)?.forEach((H)=>H(J))},on(Z,J){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(J)},off(Z,J){$.get(Z)?.delete(J)}}}class i7{nodesRef={current:[]};events=rz();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((J)=>J===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var KV=P(c(),1),XC=J6.createContext(null),zC=J6.createContext(null),D4=()=>J6.useContext(XC)?.id||null,n2=($)=>{let Z=J6.useContext(zC);return $??Z};function A3($){let Z=V4(),J=n2($),H=D4();return J0(()=>{if(!Z)return;let Q={id:Z,parentId:H};return J?.addNode(Q),()=>{J?.removeNode(Q)}},[J,Z,H]),Z}function r7($){let{children:Z,id:J}=$,H=D4();return KV.jsx(XC.Provider,{value:J6.useMemo(()=>({id:J,parentId:H}),[J,H]),children:Z})}function a7($){let{children:Z,externalTree:J}=$,H=l1(()=>J??new i7).current;return KV.jsx(zC.Provider,{value:H,children:Z})}var JQ=P(c(),1);function H00($,Z){let J=I1(M1($));if($ instanceof J.KeyboardEvent)return"keyboard";if($ instanceof J.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof J.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var GC=20,H6=[];function YV(){H6=H6.filter(($)=>{return $.deref()?.isConnected})}function UC($){if(YV(),$&&P2($)!=="body"){if(H6.push(new WeakRef($)),H6.length>GC)H6=H6.slice(-GC)}}function KC(){return YV(),H6[H6.length-1]?.deref()}function Q00($){if(!$)return null;if(Oz($))return $;return PZ($)[0]||$}function YC($){if($.hasAttribute("tabindex")&&!$.hasAttribute("data-tabindex"))return;if(!$.getAttribute("role")?.includes("dialog"))return;let J=aN($).filter((Q)=>{let B=Q.getAttribute("data-tabindex")||"";return Oz(Q)||Q.hasAttribute("data-tabindex")&&!B.startsWith("-")}),H=$.getAttribute("tabindex");if(J.length===0){if(H!=="0")$.setAttribute("tabindex","0"),$.setAttribute("data-tabindex","0")}else if(H!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function o7($){let{context:Z,children:J,disabled:H=!1,initialFocus:Q=!0,returnFocus:B=!0,restoreFocus:X=!1,modal:z=!0,closeOnFocusOut:G=!0,openInteractionType:U="",nextFocusableElement:K,previousFocusableElement:Y,beforeContentFocusGuardRef:F,externalTree:W,getInsideElements:q}=$,N="rootStore"in Z?Z.rootStore:Z,A=N.useState("open"),V=N.useState("domReferenceElement"),D=N.useState("floatingElement"),{events:L,dataRef:j}=N.context,M=U0(()=>j.current.floatingContext?.nodeId),_=Q===!1,E=oH(V)&&_,C=U5(Q),R=U5(B),T=U5(U),I=U5(A),y=n2(W),S=JV(),O=s2.useRef(!1),k=s2.useRef(!1),b=s2.useRef(!1),h=s2.useRef(null),v=s2.useRef(""),f=s2.useRef(""),w=s2.useRef(null),i=s2.useRef(null),r=x2(w,F,S?.beforeInsideRef),x=x2(i,S?.afterInsideRef),l=d1(),s=d1(),p=N4(),d=S!=null,o=nH(D),Z0=U0((X0=o)=>{return X0?PZ(X0):[]}),H0=U0(()=>q?.().filter((X0)=>X0!=null)??[]);s2.useEffect(()=>{if(H||!z)return;function X0(A0){if(A0.key==="Tab"){if(b0(o,p1(m0(o)))&&Z0().length===0&&!E)k4(A0)}}let Y0=m0(o);return n0(Y0,"keydown",X0)},[H,o,z,E,Z0]),s2.useEffect(()=>{if(H||!A)return;let X0=m0(o);function Y0(){b.current=!1}function A0(F0){let n=M1(F0),a=H0(),e=b0(D,n)||b0(V,n)||b0(S?.portalNode,n)||a.some(($0)=>$0===n||b0($0,n));if(b.current=!e,f.current=F0.pointerType||"keyboard",n?.closest(`[${jZ}]`))k.current=!0,s.start(0,()=>{k.current=!1})}function N0(){f.current="keyboard"}return M2(n0(X0,"pointerdown",A0,!0),n0(X0,"pointerup",Y0,!0),n0(X0,"pointercancel",Y0,!0),n0(X0,"keydown",N0,!0),Y0)},[H,D,V,o,A,S,s,H0]),s2.useEffect(()=>{if(H||!G)return;let X0=m0(o);function Y0(){k.current=!0,s.start(0,()=>{k.current=!1})}function A0(a){let e=M1(a);if(Oz(e))h.current=e}function N0(a){let{relatedTarget:e,currentTarget:$0}=a,Q0=M1(a);if(z&&e==null&&Q0!=null&&b0(D,Q0))UC(Q0);queueMicrotask(()=>{let _0=M(),M0=N.context.triggerElements,V0=H0(),L0=e?.hasAttribute(V3("focus-guard"))&&[w.current,i.current,S?.beforeInsideRef.current,S?.afterInsideRef.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,p8(Y),p8(K)].includes(e),g=!(b0(V,e)||b0(D,e)||b0(e,D)||b0(S?.portalNode,e)||V0.some((u)=>u===e||b0(u,e))||M0.hasMatchingElement((u)=>b0(u,e))||L0||y&&(N8(y.nodesRef.current,_0).find((u)=>b0(u.context?.elements.floating,e)||b0(u.context?.elements.domReference,e))||lN(y.nodesRef.current,_0).find((u)=>[u.context?.elements.floating,nH(u.context?.elements.floating)].includes(e)||u.context?.elements.domReference===e)));if($0===V&&o)YC(o);if(X&&$0!==V&&!c7(Q0)&&p1(X0)===X0.body){if(P1(o)){if(o.focus(),X==="popup"){p.request(()=>{o.focus()});return}}let u=Z0(),t=h.current,W0=(t&&u.includes(t)?t:null)||u[u.length-1]||o;if(P1(W0))W0.focus()}if(j.current.insideReactTree){j.current.insideReactTree=!1;return}if((E?!0:!z)&&e&&g&&!k.current&&(E||e!==KC()))O.current=!0,N.setOpen(!1,R0(K0.focusOut,a))})}function F0(){if(b.current)return;j.current.insideReactTree=!0,l.start(0,()=>{j.current.insideReactTree=!1})}let n=P1(V)?V:null;if(!D&&!n)return;return M2(n&&n0(n,"focusout",N0),n&&n0(n,"pointerdown",Y0),D&&n0(D,"focusin",A0),D&&n0(D,"focusout",N0),D&&S&&n0(D,"focusout",F0,!0))},[H,V,D,o,z,y,S,N,G,X,Z0,E,M,j,l,s,p,K,Y,H0]),s2.useEffect(()=>{if(H||!D||!A)return;let X0=Array.from(S?.portalNode?.querySelectorAll(`[${V3("portal")}]`)||[]),A0=(y?lN(y.nodesRef.current,M()):[]).find(($0)=>oH($0.context?.elements.domReference||null))?.context?.elements.domReference,F0=[...[D,...X0,w.current,i.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,...H0()],A0,p8(Y),p8(K),E?V:null].filter(($0)=>$0!=null),n=UV(F0,{ariaHidden:z||E,mark:!1}),a=[D,...X0].filter(($0)=>$0!=null),e=UV(a);return()=>{e(),n()}},[A,H,V,D,z,S,E,y,M,K,Y,H0]),J0(()=>{if(!A||H||!P1(o))return;v.current="",f.current="";let X0=m0(o),Y0=p1(X0);queueMicrotask(()=>{let A0=C.current,N0=typeof A0==="function"?A0(T.current||""):A0;if(N0===void 0||N0===!1)return;if(b0(o,Y0))return;let n=null,a=()=>{if(n==null)n=Z0(o);return n[0]||o},e;if(N0===!0||N0===null)e=a();else e=p8(N0);e=e||a();let $0=b0(o,p1(X0));TZ(e,{preventScroll:e===o,shouldFocus(){if(!I.current)return!1;if($0)return!0;let Q0=p1(X0);return!(Q0!==e&&b0(o,Q0))}})})},[H,A,o,Z0,C,T,I]),J0(()=>{if(H||!o)return;let X0=m0(o),Y0=p1(X0),A0=T.current==null;UC(Y0);function N0(n){if(!n.open)v.current=H00(n.nativeEvent,f.current);if(n.reason===K0.triggerHover&&n.nativeEvent.type==="mouseleave")O.current=!0;if(n.reason!==K0.outsidePress)return;if(n.nested)O.current=!1;else if(DZ(n.nativeEvent)||LZ(n.nativeEvent))O.current=!1;else{let a=!1;if(m0(o).createElement("div").focus({get preventScroll(){return a=!0,!1}}),a)O.current=!1;else O.current=!0}}L.on("openchange",N0);function F0(n){let a=R.current,e=typeof a==="function"?a(n):a;if(e===void 0||e===!1)return null;if(e===null)e=!0;let $0=V?.isConnected?V:null,Q0=Y0?.isConnected&&P2(Y0)!=="body"?Y0:null,_0=A0?Q0||$0:$0||Q0;if(!_0)_0=KC()||null;if(typeof e==="boolean")return _0;return p8(e)||_0||null}return()=>{L.off("openchange",N0);let n=p1(X0),a=H0(),e=b0(D,n)||a.some((M0)=>M0===n||b0(M0,n))||y&&N8(y.nodesRef.current,M(),!1).some((M0)=>b0(M0.context?.elements.floating,n)),$0=R.current,Q0=v.current,_0=F0(Q0);queueMicrotask(()=>{let M0=Q00(_0),V0=typeof $0!=="boolean";if($0&&!O.current&&P1(M0)&&(!V0&&M0!==n&&n!==X0.body?e:!0)){let L0={preventScroll:!0};if(Q0==="keyboard")L0.focusVisible=!0;M0.focus(L0)}O.current=!1})}},[H,D,o,R,T,L,y,V,M,H0]),J0(()=>{if(!r1.engine.webkit||A||!D)return;let X0=p1(m0(D));if(!P1(X0)||!m7(X0))return;if(b0(D,X0))X0.blur()},[A,D]),J0(()=>{if(H||!S)return;return S.setFocusManagerState({modal:z,closeOnFocusOut:G,open:A,onOpenChange:N.setOpen,domReference:V}),()=>{S.setFocusManagerState(null)}},[H,S,z,A,N,G,V]),J0(()=>{if(H||!o)return;return YC(o),()=>{queueMicrotask(YV)}},[H,o]);let G0=!H&&(z?!E:!0)&&(d||z);return JQ.jsxs(s2.Fragment,{children:[G0&&JQ.jsx(x4,{"data-type":"inside",ref:r,onFocus:(X0)=>{if(z){let Y0=Z0();TZ(Y0[Y0.length-1])}else if(S?.portalNode)if(O.current=!1,q3(X0,S.portalNode))_Z(V)?.focus();else p8(Y??S.beforeOutsideRef)?.focus()}}),J,G0&&JQ.jsx(x4,{"data-type":"inside",ref:x,onFocus:(X0)=>{if(z)TZ(Z0()[0]);else if(S?.portalNode){if(G)O.current=!0;if(q3(X0,S.portalNode))Tz(V)?.focus();else p8(K??S.afterOutsideRef)?.focus()}}})]})}var HQ=P(m(),1);function D3($,Z={}){let{enabled:J=!0,event:H="click",toggle:Q=!0,ignoreMouse:B=!1,stickIfOpen:X=!0,touchOpenDelay:z=0,reason:G=K0.triggerPress}=Z,U="rootStore"in $?$.rootStore:$,K=U.context.dataRef,Y=HQ.useRef(void 0),F=N4(),W=d1(),q=HQ.useMemo(()=>{function N(V,D,L,j){let M=R0(G,D,L);if(V&&j==="touch"&&z>0)W.start(z,()=>{U.setOpen(!0,M)});else U.setOpen(V,M)}function A(V,D,L){let j=K.current.openEvent,M=U.select("domReferenceElement")!==D;if(V&&M)return!0;if(!V)return!0;if(!Q)return!0;if(j&&X)return!L(j.type);return!1}return{onPointerDown(V){Y.current=t4(V.pointerType,!0)&&LZ(V.nativeEvent)?"virtual":V.pointerType},onMouseDown(V){let D=Y.current,L=V.nativeEvent,j=U.select("open");if(V.button!==0||H==="click"||t4(D,!0)&&B)return;let M=A(j,V.currentTarget,(C)=>C==="click"||C==="mousedown"),_=M1(L);if(m7(_)){N(M,L,_,D);return}let E=V.currentTarget;F.request(()=>{N(M,L,E,D)})},onClick(V){if(H==="mousedown-only")return;let D=Y.current;if(H==="mousedown"&&D){Y.current=void 0;return}if(t4(D,!0)&&B)return;let L=U.select("open"),j=A(L,V.currentTarget,(M)=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");N(j,V.nativeEvent,V.currentTarget,D)},onKeyDown(){Y.current=void 0}}},[K,H,B,G,U,X,Q,F,W,z]);return HQ.useMemo(()=>J?{reference:q}:L1,[J,q])}var v4=P(m(),1);function B00($,Z){let J=null,H=null,Q=!1;return{contextElement:$||void 0,getBoundingClientRect(){let B=$?.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",U=B.width,K=B.height,Y=B.x,F=B.y;if(J==null&&Z.x&&X)J=B.x-Z.x;if(H==null&&Z.y&&z)H=B.y-Z.y;if(Y-=J||0,F-=H||0,U=0,K=0,!Q||G)U=Z.axis==="y"?B.width:0,K=Z.axis==="x"?B.height:0,Y=X&&Z.x!=null?Z.x:Y,F=z&&Z.y!=null?Z.y:F;else if(Q&&!G)K=Z.axis==="x"?B.height:K,U=Z.axis==="y"?B.width:U;return Q=!0,{width:U,height:K,x:Y,y:F,top:F,right:Y+U,bottom:F+K,left:Y}}}}function FC($){return $!=null&&$.clientX!=null}function FV($,Z={}){let{enabled:J=!0,axis:H="both"}=Z,Q="rootStore"in $?$.rootStore:$,B=Q.useState("open"),X=Q.useState("floatingElement"),z=Q.useState("domReferenceElement"),G=Q.context.dataRef,U=v4.useRef(!1),K=v4.useRef(null),[Y,F]=v4.useState(),[W,q]=v4.useState([]),N=U0((j)=>{Q.set("positionReference",j)}),A=U0((j,M,_)=>{if(U.current)return;if(G.current.openEvent&&!FC(G.current.openEvent))return;Q.set("positionReference",B00(_??z,{x:j,y:M,axis:H,dataRef:G,pointerType:Y}))}),V=U0((j)=>{if(!B)A(j.clientX,j.clientY,j.currentTarget);else if(!K.current)A(j.clientX,j.clientY,j.currentTarget),q([])}),D=t4(Y)?X:B;v4.useEffect(()=>{if(!J){N(z);return}if(!D)return;function j(){K.current?.(),K.current=null}let M=I1(X);function _(E){let C=M1(E);if(!b0(X,C))A(E.clientX,E.clientY);else j()}if(!G.current.openEvent||FC(G.current.openEvent))K.current=n0(M,"mousemove",_);else N(z);return j},[D,J,X,G,z,Q,A,N,W]),v4.useEffect(()=>()=>{Q.set("positionReference",null)},[Q]),v4.useEffect(()=>{if(J&&!X)U.current=!1},[J,X]),v4.useEffect(()=>{if(!J&&B)U.current=!0},[J,B]);let L=v4.useMemo(()=>{function j(M){F(M.pointerType)}return{onPointerDown:j,onPointerEnter:j,onMouseMove:V,onMouseEnter:V}},[V]);return v4.useMemo(()=>J?{reference:L,trigger:L}:{},[J,L])}var L4=P(m(),1);function X00(){return!1}function z00($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function d8($,Z={}){let{enabled:J=!0,escapeKey:H=!0,outsidePress:Q=!0,outsidePressEvent:B="sloppy",referencePress:X=X00,bubbles:z,externalTree:G}=Z,U="rootStore"in $?$.rootStore:$,K=U.useState("open"),Y=U.useState("floatingElement"),{dataRef:F,events:W}=U.context,q=n2(G),N=U0(typeof Q==="function"?Q:()=>!1),A=typeof Q==="function"?N:Q,V=A!==!1,D=U0(()=>B),{escapeKey:L,outsidePress:j}=z00(z),M=L4.useRef(!1),_=L4.useRef(!1),E=L4.useRef(!1),C=L4.useRef(!1),R=L4.useRef(!1),T=L4.useRef(""),I=L4.useRef(null),y=d1(),S=d1(),O=U0(()=>{S.clear(),F.current.insideReactTree=!1}),k=U0((l)=>{let s=F.current.floatingContext?.nodeId;return(q?N8(q.nodesRef.current,s):[]).some((d)=>d.context?.open&&!d.context.dataRef.current[l])}),b=U0((l)=>{return Lz(l,U.select("floatingElement"))||Lz(l,U.select("domReferenceElement"))}),h=U0((l)=>{if(!X())return;U.setOpen(!1,R0(K0.triggerPress,l.nativeEvent))}),v=U0((l)=>{if(!K||!J||!H||l.key!=="Escape")return;if(R.current)return;if(!L&&k("__escapeKeyBubbles"))return;let s=dO(l)?l.nativeEvent:l,p=R0(K0.escapeKey,s);if(U.setOpen(!1,p),!p.isCanceled)l.preventDefault();if(!L&&!p.isPropagationAllowed)l.stopPropagation()}),f=U0(()=>{F.current.insideReactTree=!0,S.start(0,O)}),w=U0((l)=>{if(!K||!J||l.button!==0)return;let s=M1(l.nativeEvent);if(!b0(U.select("floatingElement"),s))return;if(!M.current)M.current=!0,_.current=!1}),i=U0((l)=>{if(!K||!J)return;if(!(l.defaultPrevented||l.nativeEvent.defaultPrevented))return;if(M.current)_.current=!0});L4.useEffect(()=>{function l(s){if(!s.open)C.current=!1}return W.on("openchange",l),()=>{W.off("openchange",l)}},[W]),L4.useEffect(()=>{if(!K||!J){if(!K)C.current=!1;return O}F.current.__escapeKeyBubbles=L,F.current.__outsidePressBubbles=j;let l=new c5,s=new c5,p=m0(Y);function d(){l.clear(),R.current=!0}function o(){l.start(r1.engine.webkit?5:0,()=>{R.current=!1})}function Z0(){E.current=!0,s.start(0,()=>{E.current=!1})}function H0(){M.current=!1,_.current=!1}function G0(){let g=T.current,u=g==="pen"||!g?"mouse":g,t=D(),W0=typeof t==="function"?t():t;if(typeof W0==="string")return W0;return W0[u]}function X0(g){let u=G0();return u==="intentional"&&g.type!=="click"||u==="sloppy"&&g.type==="click"}function Y0(g){let u=F.current.floatingContext?.nodeId,t=q&&N8(q.nodesRef.current,u).some((W0)=>Lz(g,W0.context?.elements.floating));return b(g)||t}function A0(g){if(X0(g)){if(g.type!=="click"&&!b(g))s.clear(),E.current=!1;O();return}if(F.current.insideReactTree){O();return}let u=M1(g),t=`[${V3("inert")}]`,W0=s0(u)?u.getRootNode():null,I0=Array.from((n3(W0)?W0:m0(U.select("floatingElement"))).querySelectorAll(t)),c0=U.context.triggerElements;if(u&&(c0.hasElement(u)||c0.hasMatchingElement((T0)=>b0(T0,u))))return;let f0=s0(u)?u:null;while(f0&&!M8(f0)){let T0=P8(f0);if(M8(T0)||!s0(T0))break;f0=T0}if(I0.length&&s0(u)&&!cO(u)&&!b0(u,U.select("floatingElement"))&&I0.every((T0)=>!b0(f0,T0)))return;if(P1(u)&&!("touches"in g)){let T0=M8(u),x0=y2(u),J1=/auto|scroll/,W1=T0||J1.test(x0.overflowX),d0=T0||J1.test(x0.overflowY),v0=W1&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,S1=d0&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,B1=x0.direction==="rtl",s1=S1&&(B1?g.offsetX<=u.offsetWidth-u.clientWidth:g.offsetX>u.clientWidth),C0=v0&&g.offsetY>u.clientHeight;if(s1||C0)return}if(Y0(g))return;if(G0()==="intentional"){if(g.detail!==0&&!DZ(g)&&!C.current)return;if(E.current){s.clear(),E.current=!1;return}}if(typeof A==="function"&&!A(g))return;if(k("__outsidePressBubbles"))return;U.setOpen(!1,R0(K0.outsidePress,g)),O()}function N0(g){if(G0()!=="sloppy"||g.pointerType==="touch"||!U.select("open")||!J||b(g))return;A0(g)}function F0(g){if(G0()!=="sloppy"||!U.select("open")||!J||b(g))return;let u=g.touches[0];if(u)I.current={startTime:Date.now(),startX:u.clientX,startY:u.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},y.start(1000,()=>{if(I.current)I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1})}function n(g,u){let t=M1(g);if(!t)return;let W0=n0(t,g.type,()=>{u(g),W0()})}function a(g){T.current="touch",n(g,F0)}function e(g){if(y.clear(),g.type==="pointerdown"){if(g.button===0)C.current=!0;T.current=g.pointerType}if(g.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;n(g,(u)=>{if(u.type==="pointerdown")N0(u);else A0(u)})}function $0(g){if(g.type==="pointercancel")C.current=!1;if(!M.current)return;let u=_.current;if(H0(),G0()!=="intentional")return;if(g.type==="pointercancel"){if(u)Z0();return}if(Y0(g))return;if(u){Z0();return}if(typeof A==="function"&&!A(g))return;s.clear(),E.current=!0,O()}function Q0(g){if(G0()!=="sloppy"||!I.current||b(g))return;let u=g.touches[0];if(!u)return;let t=Math.abs(u.clientX-I.current.startX),W0=Math.abs(u.clientY-I.current.startY),I0=Math.sqrt(t*t+W0*W0);if(I0>5)I.current.dismissOnTouchEnd=!0;if(I0>10)A0(g),y.clear(),I.current=null}function _0(g){n(g,Q0)}function M0(g){if(G0()!=="sloppy"||!I.current||b(g))return;if(I.current.dismissOnTouchEnd)A0(g);y.clear(),I.current=null}function V0(g){n(g,M0)}let L0=M2(H&&M2(n0(p,"keydown",v),n0(p,"compositionstart",d),n0(p,"compositionend",o)),V&&M2(n0(p,"click",e,!0),n0(p,"pointerdown",e,!0),n0(p,"pointerup",$0,!0),n0(p,"pointercancel",$0,!0),n0(p,"mousedown",e,!0),n0(p,"mouseup",$0,!0),n0(p,"touchstart",a,{capture:!0,passive:!0}),n0(p,"touchmove",_0,{capture:!0,passive:!0}),n0(p,"touchend",V0,{capture:!0,passive:!0})));return()=>{L0(),l.clear(),s.clear(),H0(),E.current=!1,O()}},[F,Y,H,V,A,K,J,L,j,v,O,D,k,b,q,U,y]);let r=L4.useMemo(()=>({onKeyDown:v,onPointerDown:h,onClick:h}),[v,h]),x=L4.useMemo(()=>({onKeyDown:v,onPointerDown:i,onMouseDown:i,onClickCapture:f,onMouseDownCapture(l){f(),w(l)},onPointerDownCapture(l){f(),w(l)},onMouseUpCapture:f,onTouchEndCapture:f,onTouchMoveCapture:f}),[v,f,w,i]);return L4.useMemo(()=>J?{reference:r,floating:x,trigger:r}:{},[J,r,x])}function az($,Z,J,H){return{left:$,top:Z,right:J,bottom:H,x:$,y:Z,width:J-$,height:H-Z}}function G00($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom,width:$.width,height:$.height}}function qC($){let Z=[],J,H=Number.POSITIVE_INFINITY,Q=Number.POSITIVE_INFINITY,B=Number.NEGATIVE_INFINITY,X=Number.NEGATIVE_INFINITY;for(let z of Array.from($).sort((G,U)=>G.top-U.top)){if(H=Math.min(H,z.left),Q=Math.min(Q,z.top),B=Math.max(B,z.right),X=Math.max(X,z.bottom),!J||z.top-J.top>J.height/2)Z.push(G00(z));else{let G=Z[Z.length-1];G.left=Math.min(G.left,z.left),G.right=Math.max(G.right,z.right),G.bottom=Math.max(G.bottom,z.bottom),G.width=G.right-G.left,G.height=G.bottom-G.top}J=z}return{lines:Z,fallback:az(H,Q,B,X)}}function NC($,Z,J){return $.findIndex((H)=>Z>H.left-2&&Z<H.right+2&&J>H.top-2&&J<H.bottom+2)}function WC($){return az($.left,$.top,$.right,$.bottom)}function U00($,Z,J){let{lines:H}=qC($.getClientRects());if(H.length<2)return;let Q=NC(H,Z,J);return{x:Z,y:J,lineIndex:Q===-1?void 0:Q,element:$}}function K00($,Z,J){let{lines:H,fallback:Q}=qC($.getClientRects());if(H.length<2)return null;let B=J?.x,X=J?.y,z=Z[0];if(J?.lineIndex!=null&&H[J.lineIndex])return WC(H[J.lineIndex]);if(B!=null&&X!=null){let q=NC(H,B,X);if(q!==-1)return WC(H[q])}if(H.length===2&&H[0].left>H[1].right&&B!=null&&X!=null)return Q;if(z==="t"||z==="b"){let q=H[0],N=H[H.length-1],A=z==="t"?q:N;return az(A.left,q.top,A.right,N.bottom)}let G=z==="l",U=H[0].left,K=H[0].right,Y=G?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,F=H[0],W=H[0];for(let q of H){U=Math.min(U,q.left),K=Math.max(K,q.right);let N=G?q.left:q.right;if(G&&N<Y||!G&&N>Y)Y=N,F=q,W=q;else if(N===Y)W=q}return az(U,F.top,K,W.bottom)}function Y00($){if("contextElement"in $&&$.contextElement)return $.contextElement;return s0($)?$:void 0}function VC($,Z){function J(Q){WV($,Q.currentTarget,Q.clientX,Q.clientY)}function H(Q){if(!Z)J(Q)}return{onFocus(){$.current=void 0},onMouseEnter:H,onMouseMove:H}}function WV($,Z,J,H){let Q=U00(Z,J,H);return $.current=Q,Q}function AC($){return{name:"inline",async fn(Z){let J=Z.elements.reference;if(typeof J?.getClientRects!=="function")return{};let H=Y00(J),Q=$.current,B=Q?.element===J||Q?.element===H?Q:void 0,X=K00(J,Z.placement,B);if(!X||typeof Z.platform.getElementRects!=="function")return{};let z=await Z.platform.getElementRects({reference:{contextElement:H,getBoundingClientRect(){return X}},floating:Z.elements.floating,strategy:Z.strategy});if(Z.rects.reference.x===z.reference.x&&Z.rects.reference.y===z.reference.y&&Z.rects.reference.width===z.reference.width&&Z.rects.reference.height===z.reference.height)return{};return{reset:{rects:z}}}}}class l8{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor($,Z,J=!0){this.fallbackStore=$,this.componentName=Z,this.throwOnMissingTrigger=J}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore($){return this.storeListeners.add($),()=>{this.storeListeners.delete($)}}attachStore($){return this.attachedStores.push($),this.setActiveStore($),()=>{let Z=this.attachedStores.lastIndexOf($);if(Z!==-1)this.attachedStores.splice(Z,1);this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore($){if(this.attachedStoreValue!==$)this.attachedStoreValue=$,this.storeListeners.forEach((Z)=>{Z()})}openByTrigger($){let Z=this.attachedStore;if(Z===null)return;let J;if($){for(let H=this.attachedStores.length-1;H>=0&&!J;H-=1)J=this.attachedStores[H].context.triggerElements.getById($);J??=this.fallbackStore.context.triggerElements.getById($)}if($&&!J){if(this.throwOnMissingTrigger)throw Error(y0(99,this.componentName,$,this.componentName))}Z.setOpen(!0,R0(K0.imperativeAction,void 0,J))}closePopup(){let $=this.attachedStore;if($===null)return;$.setOpen(!1,R0(K0.imperativeAction))}}var NV=P(m(),1),MC=P(e4(),1);var DC=P(m(),1);var F00={open:($)=>$.open,transitionStatus:($)=>$.transitionStatus,domReferenceElement:($)=>$.domReferenceElement,referenceElement:($)=>$.positionReference??$.referenceElement,floatingElement:($)=>$.floatingElement,floatingId:($)=>$.floatingId};class n7 extends b2{constructor($){let{syncOnly:Z,nested:J,onOpenChange:H,triggerElements:Q,...B}=$;super({...B,positionReference:B.referenceElement,domReferenceElement:B.referenceElement},{onOpenChange:H,dataRef:{current:{}},events:rz(),nested:J,triggerElements:Q},F00);this.syncOnly=Z}syncOpenEvent=($,Z)=>{if(!$||!this.state.open||Z!=null&&lO(Z))this.context.dataRef.current.openEvent=$?Z:void 0};dispatchOpenChange=($,Z)=>{this.syncOpenEvent($,Z.event);let J={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",J)};setOpen=($,Z)=>{if(this.syncOnly){this.context.onOpenChange?.($,Z);return}this.dispatchOpenChange($,Z),this.context.onOpenChange?.($,Z)}}function QQ($){let{popupStore:Z,treatPopupAsFloatingElement:J=!1,floatingRootContext:H,floatingId:Q,nested:B,onOpenChange:X}=$,z=Z.useState("open"),G=Z.useState("activeTriggerElement"),U=Z.useState(J?"popupElement":"positionerElement"),K=Z.context.triggerElements,Y=X,F=DC.useRef(null);if(H===void 0&&F.current===null)F.current=new n7({open:z,transitionStatus:void 0,referenceElement:G,floatingElement:U,triggerElements:K,onOpenChange:Y,floatingId:Q,syncOnly:!0,nested:B});let W=H??F.current;return Z.useSyncedValue("floatingId",Q),J0(()=>{let q={open:z,floatingId:Q,referenceElement:G,floatingElement:U};if(s0(G))q.domReferenceElement=G;if(W.state.positionReference===W.state.referenceElement)q.positionReference=G;W.update(q)},[z,Q,G,U,W]),W.context.onOpenChange=Y,W.context.nested=B,W}var qV=P(m(),1);function j2($,Z=!1,J=!1,H=!1){let[Q,B]=qV.useState($&&Z?"idle":void 0),[X,z]=qV.useState($&&!H);if($&&!X)z(!0),B("starting");if(!$&&X&&Q!=="ending"&&!J)B("ending");if(!$&&!X&&Q==="ending")B(void 0);return J0(()=>{if(!$&&X&&Q!=="ending"&&J){let G=k2.request(()=>{B("ending")});return()=>{k2.cancel(G)}}return},[$,X,Q,J]),J0(()=>{if(!$||Z)return;let G=k2.request(()=>{B(void 0)});return()=>{k2.cancel(G)}},[Z,$]),J0(()=>{if(!$||!Z)return;if($&&X&&Q!=="idle")B("starting");let G=k2.request(()=>{B("idle")});return()=>{k2.cancel(G)}},[Z,$,X,Q]),{mounted:X,setMounted:z,transitionStatus:Q}}var _9={tabIndex:-1,[cH]:""};function oz($){return(Z)=>Z==="touch"?$.current:!0}function Q6($,Z=!1){let J=V4(),H=D4()!=null,Q=l1(()=>$(J,H)).current;return QQ({popupStore:Q,treatPopupAsFloatingElement:Z,floatingRootContext:Q.state.floatingRootContext,floatingId:J,nested:H,onOpenChange:Q.setOpen}),Q}function j9({handle:$,store:Z}){return J0(()=>{return $.attachStore(Z)},[$,Z]),null}function LC($){let Z=$.context.triggerElements.size;if($.select("open")&&$.state.triggerCount!==Z)$.set("triggerCount",Z)}function VV($,Z){let J=NV.useRef(null);return U0((H)=>{let Q=J.current;if(Q!==null){if(Q.element===H&&Q.store===Z&&Q.id===$)return;J.current=null;let B=Q.store;if(B.context.triggerElements.getById(Q.id)===Q.element)B.context.triggerElements.delete(Q.id),LC(B)}if(H!==null&&$!==void 0)J.current={store:Z,id:$,element:H},Z.context.triggerElements.add($,H),LC(Z)})}function s7($,Z,J,H=!1){let Q=$.preventUnmountingOnClose;if(Z)Q=!1;else if(H)Q=!0;let B=J?.id??null,X=$.activeTriggerId,z=$.activeTriggerElement;if(B||Z)X=B,z=J??null;return{open:Z,preventUnmountingOnClose:Q,activeTriggerId:X,activeTriggerElement:z}}function BQ($){let Z=!1;return $.preventUnmountOnClose=()=>{Z=!0},()=>Z}function nz($,Z,J,H={}){let Q=J.reason,B=Q===K0.triggerHover,X=Z&&Q===K0.triggerFocus,z=!Z&&(Q===K0.triggerPress||Q===K0.escapeKey),G=BQ(J);if($.context.onOpenChange?.(Z,J),J.isCanceled)return;H.onBeforeDispatch?.(),$.state.floatingRootContext.dispatchOpenChange(Z,J);let U=()=>{let K=s7($.state,Z,J.trigger,G()),Y={...H.extraState,...K};if(X)Y.instantType="focus";else if(z)Y.instantType="dismiss";else if(B)Y.instantType=void 0;$.update(Y)};if(B)MC.flushSync(U);else U()}function O9($,Z,J,H){let Q=J.useState("isMountedByTrigger",$),B=VV($,J),X=U0((G)=>{let U=J.select("open"),K=J.select("activeTriggerId");if(K===$){let Y={activeTriggerElement:G,...U?H:null};J.update(Y);return}if(K==null&&U){let Y={activeTriggerId:$??null,activeTriggerElement:G,...H};J.update(Y)}}),z=U0((G)=>{if(B(G),G)X(G)});return J0(()=>{return z(Z.current),()=>z(null)},[z,Z,J,$]),J0(()=>{if(Q){let G={activeTriggerElement:Z.current,...H};J.update(G)}},[Q,J,Z,...Object.values(H)]),{registerTrigger:z,isMountedByThisTrigger:Q}}function T9($,Z={}){let{closeOnActiveTriggerUnmount:J=!1}=Z,H=NV.useRef(null),Q=$.useState("open"),B=$.useState("triggerCount"),X=$.useState("activeTriggerId"),z=$.useState("activeTriggerElement");J0(()=>{if(!Q){if(H.current=null,$.state.triggerCount!==0)$.set("triggerCount",0);return}let G=$.context.triggerElements.size,U={};if($.state.triggerCount!==G)U.triggerCount=G;let K=$.select("activeTriggerId"),Y=null;if(K){let F=$.context.triggerElements.getById(K);if(!F){for(let[W,q]of $.context.triggerElements.entries())if(q===$.state.activeTriggerElement){U.activeTriggerId=W,U.activeTriggerElement=q,H.current=W;break}if(U.activeTriggerId===void 0)if(H.current===K)Y=K;else H.current=null}else if(H.current=K,F!==$.state.activeTriggerElement)U.activeTriggerElement=F}else H.current=null;if(!Y&&!K&&G===1){let F=$.context.triggerElements.entries().next();if(!F.done){let[W,q]=F.value;U.activeTriggerId=W,U.activeTriggerElement=q,H.current=W}}if(U.triggerCount!==void 0||U.activeTriggerId!==void 0||U.activeTriggerElement!==void 0)$.update(U);if(Y){if(J)queueMicrotask(()=>{if($.select("open")&&$.select("activeTriggerId")===Y&&!$.context.triggerElements.getById(Y)){let F=R0(K0.none);if($.setOpen(!1,F),!F.isCanceled)$.update({activeTriggerId:null,activeTriggerElement:null})}})}},[Q,$,B,X,z,J])}function C9($,Z,J,H){let{mounted:Q,setMounted:B,transitionStatus:X}=j2($,!1,!1,H),z=Z.useState("preventUnmountingOnClose"),G=$?!1:z;Z.useSyncedValues({mounted:Q,transitionStatus:X,preventUnmountingOnClose:G});let U=U0(()=>{B(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),J?.(),Z.context.onOpenChangeComplete?.(!1)});return q5({enabled:Q&&!$&&!G,open:$,ref:Z.context.popupRef,onComplete(){if(!$)U()}}),{forceUnmount:U,transitionStatus:X}}function w9($,Z){$.useSyncedValues(Z),J0(()=>()=>{$.update({activeTriggerProps:L1,inactiveTriggerProps:L1,popupProps:L1})},[$])}function sz($,Z){J0(()=>{if(!Z&&$.state.openMethod!==null)$.set("openMethod",null)},[Z,$]),J0(()=>()=>{if($.state.openMethod!==null)$.set("openMethod",null)},[$])}class O2{constructor(){this.idMap=new Map}add($,Z){this.idMap.set($,Z)}delete($){this.idMap.delete($)}hasElement($){for(let Z of this.idMap.values())if(Z===$)return!0;return!1}hasMatchingElement($){for(let Z of this.idMap.values())if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function E9($,Z,J=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new n7({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:$,floatingId:Z,syncOnly:!0,nested:J,onOpenChange:void 0}),floatingId:Z,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:L1,inactiveTriggerProps:L1,popupProps:L1}}var XQ=($)=>$.triggerIdProp??$.activeTriggerId,AV=($)=>$.openProp??$.open,PC=($)=>{return($.popupElement?.id??$.floatingId)||void 0};function _C($,Z){return Z!==void 0&&AV($)&&XQ($)===Z}function W00($,Z){if(_C($,Z))return!0;return Z!==void 0&&AV($)&&XQ($)==null&&$.triggerCount===1}var S9={open:AV,mounted:($)=>$.mounted,transitionStatus:($)=>$.transitionStatus,floatingRootContext:($)=>$.floatingRootContext,triggerCount:($)=>$.triggerCount,preventUnmountingOnClose:($)=>$.preventUnmountingOnClose,payload:($)=>$.payload,activeTriggerId:XQ,activeTriggerElement:($)=>$.mounted?$.activeTriggerElement:null,popupId:PC,isTriggerActive:($,Z)=>Z!==void 0&&XQ($)===Z,isOpenedByTrigger:($,Z)=>_C($,Z),isMountedByTrigger:($,Z)=>Z!==void 0&&XQ($)===Z&&$.mounted,triggerProps:($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps,triggerPopupId:($,Z)=>W00($,Z)?PC($):void 0,popupProps:($)=>$.popupProps,popupElement:($)=>$.popupElement,positionerElement:($)=>$.positionerElement};var DV=P(m(),1),jC=P(AZ(),1);function R9($){let Z=DV.useCallback((H)=>{if($===void 0)return X1;return $.subscribeStore(H)},[$]),J=DV.useCallback(()=>{return $===void 0?void 0:$.store},[$]);return jC.useSyncExternalStore(Z,J,()=>$?.serverStore)}function LV($){let{open:Z=!1,onOpenChange:J,elements:H={}}=$,Q=V4(),B=D4()!=null,X=l1(()=>new n7({open:Z,transitionStatus:void 0,onOpenChange:J,referenceElement:H.reference??null,floatingElement:H.floating??null,triggerElements:new O2,floatingId:Q,syncOnly:!1,nested:B})).current;return J0(()=>{let z={open:Z,floatingId:Q};if(H.reference!==void 0)z.referenceElement=H.reference,z.domReferenceElement=s0(H.reference)?H.reference:null;if(H.floating!==void 0)z.floatingElement=H.floating;X.update(z)},[Z,Q,H.reference,H.floating,X]),X.context.onOpenChange=J,X.context.nested=B,X}var I9=P(m(),1);var MV=r1.os.mac&&r1.engine.webkit;function t7($,Z={}){let{enabled:J=!0,delay:H}=Z,Q="rootStore"in $?$.rootStore:$,{events:B,dataRef:X}=Q.context,z=I9.useRef(!1),G=I9.useRef(null),U=I9.useRef(!0),K=d1();I9.useEffect(()=>{let F=Q.select("domReferenceElement");if(!J)return;let W=I1(F);function q(){let V=Q.select("domReferenceElement");if(!Q.select("open")&&P1(V)&&V===p1(m0(V)))z.current=!0,G.current=V}function N(){U.current=!0}function A(){U.current=!1}return M2(n0(W,"blur",q),MV&&n0(W,"keydown",N,!0),MV&&n0(W,"pointerdown",A,!0))},[Q,J]),I9.useEffect(()=>{if(!J)return;function F(W){if(W.reason===K0.triggerPress||W.reason===K0.escapeKey){let q=Q.select("domReferenceElement");if(s0(q))G.current=q,z.current=!0}}return B.on("openchange",F),()=>{B.off("openchange",F)}},[B,J,Q]);let Y=I9.useMemo(()=>{function F(){z.current=!1,G.current=null}return{onMouseLeave(){F()},onFocus(W){let q=W.currentTarget;if(z.current){if(G.current===q)return;F()}let N=M1(W.nativeEvent);if(s0(N)){if(MV&&!W.relatedTarget){if(!U.current&&!m7(N))return}else if(!D9(N))return}let A=s3(W.relatedTarget,Q.context.triggerElements),{nativeEvent:V,currentTarget:D}=W,L=typeof H==="function"?H():H;if(Q.select("open")&&A||L===0||L===void 0){Q.setOpen(!0,R0(K0.triggerFocus,V,D));return}K.start(L,()=>{if(z.current)return;Q.setOpen(!0,R0(K0.triggerFocus,V,D))})},onBlur(W){F();let{relatedTarget:q,nativeEvent:N}=W,A=s0(q)&&q.hasAttribute(V3("focus-guard"))&&q.getAttribute("data-type")==="outside";K.start(0,()=>{let V=Q.select("domReferenceElement"),D=p1(m0(V));if(!q&&D===V)return;if(b0(X.current.floatingContext?.refs.floating.current,D)||b0(V,D)||A)return;if(s3(q??D,Q.context.triggerElements))return;Q.setOpen(!1,R0(K0.triggerFocus,N))})}}},[X,H,Q,K]);return I9.useMemo(()=>J?{reference:Y,trigger:Y}:{},[J,Y])}var _V=P(m(),1);class PV{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new c5,this.restTimeout=new c5,this.handleCloseOptions=void 0}static create(){return new PV}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}var tz=new WeakMap;function CZ($){if(!$.performedPointerEventsMutation)return;let Z=$.pointerEventsScopeElement;if(Z&&tz.get(Z)===$)$.pointerEventsScopeElement?.style.removeProperty("pointer-events"),$.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),$.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),tz.delete(Z);$.performedPointerEventsMutation=!1,$.pointerEventsScopeElement=null,$.pointerEventsReferenceElement=null,$.pointerEventsFloatingElement=null}function ez($,Z){let{scopeElement:J,referenceElement:H,floatingElement:Q}=Z,B=tz.get(J);if(B&&B!==$)CZ(B);CZ($),$.performedPointerEventsMutation=!0,$.pointerEventsScopeElement=J,$.pointerEventsReferenceElement=H,$.pointerEventsFloatingElement=Q,tz.set(J,$),J.style.pointerEvents="none",H.style.pointerEvents="auto",Q.style.pointerEvents="auto"}function wZ($){let Z=$.context.dataRef.current,J=l1(()=>Z.hoverInteractionState??PV.create()).current;if(!Z.hoverInteractionState)Z.hoverInteractionState=J;return a3(Z.hoverInteractionState.disposeEffect),Z.hoverInteractionState}function L3($,Z={}){let{enabled:J=!0,closeDelay:H=0,nodeId:Q}=Z,B="rootStore"in $?$.rootStore:$,X=B.useState("open"),z=B.useState("floatingElement"),G=B.useState("domReferenceElement"),{dataRef:U}=B.context,K=n2(),Y=D4(),F=wZ(B),W=d1(),q=U0(()=>{return lz(U.current.openEvent?.type,F.interactedInside)}),N=U0(()=>{return tT(U.current.openEvent?.type)}),A=U0(()=>{CZ(F)});J0(()=>{if(!X)F.pointerType=void 0,F.restTimeoutPending=!1,F.interactedInside=!1,A()},[X,F,A]),_V.useEffect(()=>{return A},[A]),J0(()=>{if(!J)return;if(X&&F.handleCloseOptions?.blockPointerEvents&&N()&&s0(G)&&z){let V=G,D=z,L=m0(z),j=K?.nodesRef.current.find((C)=>C.id===Y)?.context?.elements.floating;if(j)j.style.pointerEvents="";let M=F.pointerEventsScopeElement!==D?F.pointerEventsScopeElement:null,_=j!==D?j:null,E=F.handleCloseOptions?.getScope?.()??M??_??V.closest("[data-rootownerid]")??L.body;return ez(F,{scopeElement:E,referenceElement:V,floatingElement:D}),()=>{A()}}return},[J,X,G,z,F,N,K,Y,A]),_V.useEffect(()=>{if(!J)return;function V(){return!!(K&&Y&&N8(K.nodesRef.current,Y).length>0)}function D(C){let R=c8(H,"close",F.pointerType),T=()=>{B.setOpen(!1,R0(K0.triggerHover,C)),K?.events.emit("floating.closed",C)};if(R)F.openChangeTimeout.start(R,T);else F.openChangeTimeout.clear(),T()}function L(C){let R=M1(C);if(!dN(R)){F.interactedInside=!1;return}F.interactedInside=R?.closest("[aria-haspopup]")!=null}function j(){F.openChangeTimeout.clear(),W.clear(),K?.events.off("floating.closed",_),A()}function M(C){if(V()&&K){K.events.on("floating.closed",_);return}if(s3(C.relatedTarget,B.context.triggerElements))return;let R=U.current.floatingContext?.nodeId??Q,T=C.relatedTarget;if(K&&R&&s0(T)&&N8(K.nodesRef.current,R,!1).some((y)=>b0(y.context?.elements.floating,T)))return;if(F.handler){F.handler(C);return}if(A(),N()&&!q())D(C)}function _(C){if(!K||!Y||V())return;W.start(0,()=>{K.events.off("floating.closed",_),B.setOpen(!1,R0(K0.triggerHover,C)),K.events.emit("floating.closed",C)})}let E=z;return M2(E&&n0(E,"mouseenter",j),E&&n0(E,"mouseleave",M),E&&n0(E,"pointerdown",L,!0),()=>{K?.events.off("floating.closed",_)})},[J,z,B,U,H,Q,N,q,A,F,K,Y,W])}var B6=P(m(),1),OC=P(e4(),1);var q00={current:null};function i8($,Z={}){let{enabled:J=!0,delay:H=0,handleClose:Q=null,mouseOnly:B=!1,restMs:X=0,move:z=!0,triggerElementRef:G=q00,externalTree:U,isActiveTrigger:K=!0,getHandleCloseContext:Y,isClosing:F,shouldOpen:W,guardStaleOpen:q=!1}=Z,N="rootStore"in $?$.rootStore:$,{dataRef:A,events:V}=N.context,D=n2(U),L=wZ(N),j=B6.useRef(!1),M=U5(Q),_=U5(H),E=U5(X),C=U5(J),R=U5(W),T=U5(F),I=U0(()=>{return lz(A.current.openEvent?.type,L.interactedInside)}),y=U0(()=>{return R.current?.()!==!1}),S=U0((b,h,v)=>{let f=N.context.triggerElements;if(f.hasElement(h))return!b||!b0(b,h);if(!s0(v))return!1;let w=v;return f.hasMatchingElement((i)=>b0(i,w))&&(!b||!b0(b,w))}),O=U0(()=>{if(!L.handler)return;m0(N.select("domReferenceElement")).removeEventListener("mousemove",L.handler),L.handler=void 0}),k=U0(()=>{CZ(L)});if(K)L.handleCloseOptions=Q?.__options;return B6.useEffect(()=>O,[O]),B6.useEffect(()=>{if(!J)return;function b(h){if(!h.open)j.current=h.reason===K0.triggerHover,O(),L.openChangeTimeout.clear(),L.restTimeout.clear(),L.blockMouseMove=!0,L.restTimeoutPending=!1;else j.current=!1}return V.on("openchange",b),()=>{V.off("openchange",b)}},[J,V,L,O]),B6.useEffect(()=>{if(!J)return;function b(r,x=!0){let l=c8(_.current,"close",L.pointerType);if(l)L.openChangeTimeout.start(l,()=>{N.setOpen(!1,R0(K0.triggerHover,r)),D?.events.emit("floating.closed",r)});else if(x)L.openChangeTimeout.clear(),N.setOpen(!1,R0(K0.triggerHover,r)),D?.events.emit("floating.closed",r)}let h=G.current??(K?N.select("domReferenceElement"):null);if(!s0(h))return;function v(r){if(L.openChangeTimeout.clear(),L.blockMouseMove=!1,B&&!t4(L.pointerType))return;let x=HV(E.current),l=c8(_.current,"open",L.pointerType),s=M1(r),p=r.currentTarget??null,d=N.select("domReferenceElement"),o=p;if(s0(s)&&!N.context.triggerElements.hasElement(s)){for(let n of N.context.triggerElements.elements())if(b0(n,s)){o=n;break}}if(s0(p)&&s0(d)&&!N.context.triggerElements.hasElement(p)&&b0(p,d))o=d;let Z0=o==null?!1:S(d,o,s),H0=N.select("open"),G0=T.current?.()??N.select("transitionStatus")==="ending",X0=!H0&&G0&&j.current,Y0=!Z0&&s0(o)&&s0(d)&&b0(d,o)&&X0,A0=x>0&&!l,N0=Z0&&(H0||X0)||Y0,F0=!H0||Z0;if(N0){if(y())N.setOpen(!0,R0(K0.triggerHover,r,o));return}if(A0)return;if(l)L.openChangeTimeout.start(l,()=>{if(F0&&y())N.setOpen(!0,R0(K0.triggerHover,r,o))});else if(F0){if(y())N.setOpen(!0,R0(K0.triggerHover,r,o))}}function f(r){if(I()){k();return}O();let x=N.select("domReferenceElement"),l=m0(x);L.restTimeout.clear(),L.restTimeoutPending=!1;let s=A.current.floatingContext??Y?.();if(s3(r.relatedTarget,N.context.triggerElements))return;if(M.current&&s){if(!N.select("open"))L.openChangeTimeout.clear();let d=G.current;L.handler=M.current({...s,tree:D,x:r.clientX,y:r.clientY,onClose(){if(k(),O(),C.current&&!I()&&d===N.select("domReferenceElement"))b(r,!0)}}),l.addEventListener("mousemove",L.handler),L.handler(r);return}if(L.pointerType==="touch"?!b0(N.select("floatingElement"),r.relatedTarget):!0)b(r)}function w(r){if(b0(h,r.relatedTarget))return;L.openChangeTimeout.clear(),L.restTimeout.clear(),L.restTimeoutPending=!1}let i=q?n0(h,"mouseout",w):void 0;if(z)return M2(n0(h,"mousemove",v,{once:!0}),n0(h,"mouseenter",v),n0(h,"mouseleave",f),i);return M2(n0(h,"mouseenter",v),n0(h,"mouseleave",f),i)},[O,k,A,_,N,J,M,L,K,S,I,B,z,E,G,D,C,Y,T,y,q]),B6.useMemo(()=>{if(!J)return;function b(h){L.pointerType=h.pointerType}return{onPointerDown:b,onPointerEnter:b,onMouseMove(h){let{nativeEvent:v}=h,f=h.currentTarget,w=N.select("domReferenceElement"),i=N.select("open"),r=S(w,f,h.target);if(B&&!t4(L.pointerType))return;if(i&&r&&L.handleCloseOptions?.blockPointerEvents){let s=N.select("floatingElement");if(s){let p=L.handleCloseOptions?.getScope?.()??f.ownerDocument.body;ez(L,{scopeElement:p,referenceElement:f,floatingElement:s})}}let x=HV(E.current);if(i&&!r||x===0)return;if(!r&&L.restTimeoutPending&&h.movementX**2+h.movementY**2<2)return;L.restTimeout.clear();function l(){if(L.restTimeoutPending=!1,I())return;let s=N.select("open");if(!L.blockMouseMove&&(!s||r)&&y())N.setOpen(!0,R0(K0.triggerHover,v,f))}if(L.pointerType==="touch")OC.flushSync(()=>{l()});else if(r&&i)l();else L.restTimeoutPending=!0,L.restTimeout.start(x,l)}}},[J,L,I,S,B,N,E,y])}var h2=P(m(),1);var N00="Escape";function TC($){return r1.engine.webkit&&$.movementX===0&&$.movementY===0}function ZG($,Z,J){switch($){case"vertical":return Z;case"horizontal":return J;default:return Z||J}}function $G($,Z){return ZG(Z,$===fN||$===Vz,$===dH||$===lH)}function jV($,Z,J){return ZG(Z,$===Vz,J?$===dH:$===lH)||$==="Enter"||$===" "||$===""}function V00($,Z,J){return ZG(Z,J?$===dH:$===lH,$===Vz)}function A00($,Z,J,H){let Q=J?$===lH:$===dH,B=$===fN;if(Z==="both"||Z==="horizontal"&&H)return $===N00;return ZG(Z,Q,B)}function OV($,Z){let{listRef:J,activeIndex:H,onNavigate:Q=()=>{},enabled:B=!0,selectedIndex:X=null,allowEscape:z=!1,loopFocus:G=!1,nested:U=!1,rtl:K=!1,virtual:Y=!1,focusItemOnOpen:F="auto",focusItemOnHover:W=!0,openOnArrowKeyDown:q=!0,disabledIndices:N=void 0,orientation:A="vertical",parentOrientation:V,id:D,resetOnPointerLeave:L=!0,externalTree:j,grid:M}=Z,_=M!=null,E="rootStore"in $?$.rootStore:$,C=E.useState("open"),R=E.useState("floatingElement"),T=E.useState("domReferenceElement"),I=E.context.dataRef,y=nH(R),S=oH(T),O=U5(y),k=D4(),b=n2(j),h=h2.useRef(F),v=h2.useRef(X??-1),f=h2.useRef(null),w=h2.useRef(!0),i=U0((V0)=>{Q(v.current===-1?null:v.current,V0)}),r=h2.useRef(!!R),x=h2.useRef(C),l=h2.useRef(!1),s=h2.useRef(!1),p=h2.useRef(null),d=U5(N),o=U5(C),Z0=U5(X),H0=U5(L),G0=N4(),X0=N4(),Y0=U0(()=>{function V0(t){if(Y)b?.events.emit("virtualfocus",t);else p.current=TZ(t,{sync:l.current,preventScroll:!0})}let L0=J.current[v.current],g=s.current;if(L0)V0(L0);(l.current?(t)=>t():(t)=>G0.request(t))(()=>{let t=J.current[v.current]||L0;if(!t)return;if(!L0)V0(t);if(e&&(g||!w.current))t.scrollIntoView?.({block:"nearest",inline:"nearest"})})});J0(()=>{I.current.orientation=A},[I,A]),J0(()=>{if(!B)return;if(C&&R){if(v.current=X??-1,h.current&&X!=null)s.current=!0,i()}else if(r.current)v.current=-1,i()},[B,C,R,X,i]),J0(()=>{if(!B)return;if(!C){l.current=!1;return}if(!R)return;if(H==null){if(l.current=!1,Z0.current!=null)return;if(r.current)v.current=-1,Y0();if((!x.current||!r.current)&&h.current&&(f.current!=null||h.current===!0&&f.current==null)){let V0=0,L0=()=>{if(J.current[0]==null){if(V0<2)(V0?(u)=>X0.request(u):queueMicrotask)(L0);V0+=1}else v.current=f.current==null||jV(f.current,A,K)||U?p7(J):MZ(J),f.current=null,i()};L0()}}else if(!$6(J.current,H))v.current=H,Y0(),s.current=!1},[B,C,R,H,Z0,U,J,A,K,i,Y0,X0]),J0(()=>{if(!B||R||!b||Y||!r.current)return;let V0=b.nodesRef.current,L0=V0.find((t)=>t.id===k)?.context?.elements.floating,g=p1(m0(T??L0??null)),u=V0.some((t)=>t.context&&b0(t.context.elements.floating,g));if(L0&&!u&&w.current)L0.focus({preventScroll:!0})},[B,R,T,b,k,Y]),J0(()=>{x.current=C,r.current=!!R}),J0(()=>{if(!C)f.current=null,h.current=F},[C,F]);let A0=H!=null,N0=U0((V0)=>{if(!o.current)return;let L0=J.current.indexOf(V0.currentTarget);if(L0!==-1&&(v.current!==L0||H!==L0))v.current=L0,i(V0)}),F0=U0(()=>{return V??b?.nodesRef.current.find((V0)=>V0.id===k)?.context?.dataRef?.current.orientation}),n=U0(()=>{return p7(J,d.current)}),a=U0((V0)=>{if(w.current=!1,l.current=!0,V0.which===229)return;if(!o.current&&V0.currentTarget===O.current)return;if(U&&A00(V0.key,A,K,_)){if(!$G(V0.key,F0()))k4(V0);if(E.setOpen(!1,R0(K0.listNavigation,V0.nativeEvent)),P1(T))if(Y)b?.events.emit("virtualfocus",T);else T.focus();return}let L0=v.current,g=p7(J,N),u=MZ(J,N);if(!S){if(V0.key==="Home")k4(V0),v.current=g,i(V0);if(V0.key==="End")k4(V0),v.current=u,i(V0)}if(M!=null){let t=M(V0,v.current,J,A,G,K,N,g,u);if(t!=null)v.current=t,i(V0);if(A==="both")return}if($G(V0.key,A)){if(k4(V0),C&&!Y&&p1(V0.currentTarget.ownerDocument)===V0.currentTarget){v.current=jV(V0.key,A,K)?g:u,i(V0);return}if(jV(V0.key,A,K))if(G)if(L0>=u)if(z&&L0!==J.current.length)v.current=-1;else l.current=!1,v.current=g;else v.current=A8(J.current,{startingIndex:L0,disabledIndices:N});else v.current=Math.min(u,A8(J.current,{startingIndex:L0,disabledIndices:N}));else if(G)if(L0<=g)if(z&&L0!==-1)v.current=J.current.length;else l.current=!1,v.current=u;else v.current=A8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N});else v.current=Math.max(g,A8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N}));if($6(J.current,v.current))v.current=-1;i(V0)}}),e=h2.useMemo(()=>{return{onFocus(L0){l.current=!0,N0(L0)},onClick:({currentTarget:L0})=>L0.focus({preventScroll:!0}),onMouseMove(L0){if(TC(L0))return;if(l.current=!0,s.current=!1,W)N0(L0)},onPointerLeave(L0){if(!o.current||!w.current||L0.pointerType==="touch")return;l.current=!0;let g=L0.relatedTarget;if(!W||J.current.includes(g))return;if(!H0.current)return;if(p.current?.(),p.current=null,v.current=-1,i(L0),!Y){let u=O.current,t=p1(m0(u));if(u&&b0(u,t))u.focus({preventScroll:!0})}}}},[N0,o,O,W,J,i,H0,Y]),$0=h2.useMemo(()=>{return Y&&C&&A0&&{"aria-activedescendant":`${D}-${H}`}},[Y,C,A0,D,H]),Q0=h2.useMemo(()=>{return{...!S?$0:{},onKeyDown(V0){if(V0.key==="Tab"&&V0.shiftKey&&C&&!Y){let L0=M1(V0.nativeEvent);if(L0&&!b0(O.current,L0))return;if(k4(V0),E.setOpen(!1,R0(K0.focusOut,V0.nativeEvent)),P1(T))T.focus();return}a(V0)},onPointerMove(V0){if(TC(V0))return;w.current=!0}}},[$0,a,O,S,E,C,Y,T]),_0=h2.useMemo(()=>{function V0(u){E.setOpen(!0,R0(K0.listNavigation,u.nativeEvent,u.currentTarget))}function L0(u){if(F==="auto"&&DZ(u.nativeEvent))h.current=!Y}function g(u){if(h.current=F,F==="auto"&&LZ(u.nativeEvent))h.current=!0}return{onKeyDown(u){let t=E.select("open");w.current=!1;let W0=u.key.startsWith("Arrow"),I0=V00(u.key,F0(),K),c0=$G(u.key,A),f0=(U?I0:c0)||u.key==="Enter"||u.key.trim()==="";if(Y&&t)return a(u);if(!t&&!q&&W0)return;if(f0){let T0=$G(u.key,F0());f.current=U&&T0?null:u.key}if(U){if(I0)if(k4(u),t)v.current=n(),i(u);else V0(u);return}if(c0){if(Z0.current!=null)v.current=Z0.current;if(k4(u),!t&&q)V0(u);else a(u);if(t)i(u)}return},onFocus(u){if(E.select("open")&&!Y)v.current=-1,i(u)},onPointerDown:g,onPointerEnter:g,onMouseDown:L0,onClick:L0}},[a,F,n,U,i,E,q,A,F0,K,Z0,Y]),M0=h2.useMemo(()=>{return{...$0,..._0}},[$0,_0]);return h2.useMemo(()=>B?{reference:M0,floating:Q0,item:e,trigger:_0}:{},[B,M0,Q0,_0,e])}var e7=P(m(),1);function TV($,Z){let{listRef:J,elementsRef:H,activeIndex:Q,onMatch:B,disabledIndices:X,onTyping:z,enabled:G=!0,resetMs:U=750,selectedIndex:K=null}=Z,Y="rootStore"in $?$.rootStore:$,F=Y.useState("open"),W=d1(),q=e7.useRef(""),N=e7.useRef(K??Q??-1),A=e7.useRef(null),V=U0((j)=>{function M(O){return H?.current[O]}function _(O){let k=M(O);if(k&&!c7(k)||k?.matches(":disabled"))return!1;return X==null||!W3(r2,O,X)}function E(O,k,b=0){if(O.length===0)return-1;let h=(b%O.length+O.length)%O.length,v=k.toLowerCase();for(let f=0;f<O.length;f+=1){let w=(h+f)%O.length;if(!O[w]?.toLowerCase().startsWith(v)||!_(w))continue;return w}return-1}let C=J.current;if(q.current.length>0&&j.key===" ")k4(j),z?.(!0);if(q.current.length>0&&q.current[0]!==" "){if(E(C,q.current)===-1&&j.key!==" ")z?.(!1)}if(C==null||j.key.length!==1||j.ctrlKey||j.metaKey||j.altKey)return;if(F&&j.key!==" ")k4(j),z?.(!0);let R=q.current==="";if(R)N.current=K??Q??-1;if(C.every((O,k)=>O&&_(k)?O[0]?.toLowerCase()!==O[1]?.toLowerCase():!0)&&q.current===j.key)q.current="",N.current=A.current;q.current+=j.key,W.start(U,()=>{q.current="",N.current=A.current,z?.(!1)});let y=((R?K??Q??-1:N.current)??0)+1,S=E(C,q.current,y);if(S!==-1)B?.(S),A.current=S;else if(j.key!==" ")q.current="",z?.(!1)}),D=U0((j)=>{let M=j.relatedTarget,_=Y.select("domReferenceElement"),E=Y.select("floatingElement");if(b0(_,M)||b0(E,M))return;W.clear(),q.current="",N.current=A.current,z?.(!1)});J0(()=>{if(!F&&K!==null)return;if(W.clear(),A.current=null,q.current!=="")q.current=""},[F,K,W]);let L=e7.useMemo(()=>({onKeyDown:V,onBlur:D}),[V,D]);return e7.useMemo(()=>G?{reference:L,floating:L}:{},[G,L])}var CC=0.1,D00=CC*CC,V5=0.5;function JG($,Z,J,H,Q,B){return H>=Z!==B>=Z&&$<=(Q-J)*(Z-H)/(B-H)+J}function HG($,Z,J,H,Q,B,X,z,G,U){let K=!1;if(JG($,Z,J,H,Q,B))K=!K;if(JG($,Z,Q,B,X,z))K=!K;if(JG($,Z,X,z,G,U))K=!K;if(JG($,Z,G,U,J,H))K=!K;return K}function L00($,Z,J){return $>=J.x&&$<=J.x+J.width&&Z>=J.y&&Z<=J.y+J.height}function QG($,Z,J,H,Q,B){let X=Math.min(J,Q),z=Math.max(J,Q),G=Math.min(H,B),U=Math.max(H,B);return $>=X&&$<=z&&Z>=G&&Z<=U}function r8($={}){let{blockPointerEvents:Z=!1}=$,J=new c5,H=({x:Q,y:B,placement:X,elements:z,onClose:G,nodeId:U,tree:K})=>{let Y=X?.split("-")[0],F=!1,W=null,q=null,N=typeof performance<"u"?performance.now():0;function A(D,L){let j=performance.now(),M=j-N;if(W===null||q===null||M===0)return W=D,q=L,N=j,!1;let _=D-W,E=L-q,C=_*_+E*E,R=M*M*D00;return W=D,q=L,N=j,C<R}function V(){J.clear(),G()}return function(L){J.clear();let{domReference:j,floating:M}=z;if(!j||!M||Y==null||Q==null||B==null)return;let{clientX:_,clientY:E}=L,C=M1(L),R=L.type==="mouseleave",T=b0(M,C),I=b0(j,C);if(T){if(F=!0,!R)return}if(I){if(F=!1,!R){F=!0;return}}if(R&&s0(L.relatedTarget)&&b0(M,L.relatedTarget))return;function y(){return Boolean(K&&N8(K.nodesRef.current,U).length>0)}function S(){if(!y())V()}if(y())return;let O=j.getBoundingClientRect(),k=M.getBoundingClientRect(),b=Q>k.right-k.width/2,h=B>k.bottom-k.height/2,v=k.width>O.width,f=k.height>O.height,w=(v?O:k).left,i=(v?O:k).right,r=(f?O:k).top,x=(f?O:k).bottom;if(Y==="top"&&B>=O.bottom-1||Y==="bottom"&&B<=O.top+1||Y==="left"&&Q>=O.right-1||Y==="right"&&Q<=O.left+1){S();return}let l=!1;switch(Y){case"top":l=QG(_,E,w,O.top+1,i,k.bottom-1);break;case"bottom":l=QG(_,E,w,k.top+1,i,O.bottom-1);break;case"left":l=QG(_,E,k.right-1,x,O.left+1,r);break;case"right":l=QG(_,E,O.right-1,x,k.left+1,r);break;default:}if(l)return;if(F&&!L00(_,E,O)){S();return}if(!R&&A(_,E)){S();return}let s=!1;switch(Y){case"top":{let p=v?V5/2:V5*4,d=v?Q+p:b?Q+p:Q-p,o=v?Q-p:b?Q+p:Q-p,Z0=B+V5+1,H0=b?k.bottom-V5:v?k.bottom-V5:k.top,G0=b?v?k.bottom-V5:k.top:k.bottom-V5;s=HG(_,E,d,Z0,o,Z0,k.left,H0,k.right,G0);break}case"bottom":{let p=v?V5/2:V5*4,d=v?Q+p:b?Q+p:Q-p,o=v?Q-p:b?Q+p:Q-p,Z0=B-V5,H0=b?k.top+V5:v?k.top+V5:k.bottom,G0=b?v?k.top+V5:k.bottom:k.top+V5;s=HG(_,E,d,Z0,o,Z0,k.left,H0,k.right,G0);break}case"left":{let p=f?V5/2:V5*4,d=f?B+p:h?B+p:B-p,o=f?B-p:h?B+p:B-p,Z0=Q+V5+1,H0=h?k.right-V5:f?k.right-V5:k.left,G0=h?f?k.right-V5:k.left:k.right-V5;s=HG(_,E,H0,k.top,G0,k.bottom,Z0,d,Z0,o);break}case"right":{let p=f?V5/2:V5*4,d=f?B+p:h?B+p:B-p,o=f?B-p:h?B+p:B-p,Z0=Q-V5,H0=h?k.left+V5:f?k.left+V5:k.right,G0=h?f?k.left+V5:k.right:k.left+V5;s=HG(_,E,Z0,d,Z0,o,H0,k.top,G0,k.bottom);break}default:}if(!s)S();else if(!F)J.start(40,S);return}};return H.__options={...$,blockPointerEvents:Z},H}function wC($,Z,J){let{reference:H,floating:Q}=$,B=y4(Z),X=$Q(Z),z=eH(X),G=o2(Z),U=B==="y",K=H.x+H.width/2-Q.width/2,Y=H.y+H.height/2-Q.height/2,F=H[z]/2-Q[z]/2,W;switch(G){case"top":W={x:K,y:H.y-Q.height};break;case"bottom":W={x:K,y:H.y+H.height};break;case"right":W={x:H.x+H.width,y:Y};break;case"left":W={x:H.x-Q.width,y:Y};break;default:W={x:H.x,y:H.y}}let q=V8(Z);if(q)W[X]+=F*(q==="end"?1:-1)*(J&&U?-1:1);return W}async function EC($,Z){var J;if(Z===void 0)Z={};let{x:H,y:Q,platform:B,rects:X,elements:z,strategy:G}=$,{boundary:U="clippingAncestors",rootBoundary:K="viewport",elementContext:Y="floating",altBoundary:F=!1,padding:W=0}=M9(Z,$),q=jz(W),A=z[F?Y==="floating"?"reference":"floating":Y],V=u7(await B.getClippingRect({element:((J=await(B.isElement==null?void 0:B.isElement(A)))!=null?J:!0)?A:A.contextElement||await(B.getDocumentElement==null?void 0:B.getDocumentElement(z.floating)),boundary:U,rootBoundary:K,strategy:G})),D=Y==="floating"?{x:H,y:Q,width:X.floating.width,height:X.floating.height}:X.reference,L=await(B.getOffsetParent==null?void 0:B.getOffsetParent(z.floating)),j=await(B.isElement==null?void 0:B.isElement(L))&&await(B.getScale==null?void 0:B.getScale(L))||{x:1,y:1},M=u7(B.convertOffsetParentRelativeRectToViewportRelativeRect?await B.convertOffsetParentRelativeRectToViewportRelativeRect({elements:z,rect:D,offsetParent:L,strategy:G}):D);return{top:(V.top-M.top+q.top)/j.y,bottom:(M.bottom-V.bottom+q.bottom)/j.y,left:(V.left-M.left+q.left)/j.x,right:(M.right-V.right+q.right)/j.x}}var M00=50,SC=async($,Z,J)=>{let{placement:H="bottom",strategy:Q="absolute",middleware:B=[],platform:X}=J,z=X.detectOverflow?X:{...X,detectOverflow:EC},G=await(X.isRTL==null?void 0:X.isRTL(Z)),U=await X.getElementRects({reference:$,floating:Z,strategy:Q}),{x:K,y:Y}=wC(U,H,G),F=H,W=0,q={};for(let N=0;N<B.length;N++){let A=B[N];if(!A)continue;let{name:V,fn:D}=A,{x:L,y:j,data:M,reset:_}=await D({x:K,y:Y,initialPlacement:H,placement:F,strategy:Q,middlewareData:q,rects:U,platform:z,elements:{reference:$,floating:Z}});if(K=L!=null?L:K,Y=j!=null?j:Y,q[V]={...q[V],...M},_&&W<M00){if(W++,typeof _==="object"){if(_.placement)F=_.placement;if(_.rects)U=_.rects===!0?await X.getElementRects({reference:$,floating:Z,strategy:Q}):_.rects;({x:K,y:Y}=wC(U,F,G))}N=-1}}return{x:K,y:Y,placement:F,strategy:Q,middlewareData:q}};var RC=function($){if($===void 0)$={};return{name:"flip",options:$,async fn(Z){var J,H;let{placement:Q,middlewareData:B,rects:X,initialPlacement:z,platform:G,elements:U}=Z,{mainAxis:K=!0,crossAxis:Y=!0,fallbackPlacements:F,fallbackStrategy:W="bestFit",fallbackAxisSideDirection:q="none",flipAlignment:N=!0,...A}=M9($,Z);if((J=B.arrow)!=null&&J.alignmentOffset)return{};let V=o2(Q),D=y4(z),L=o2(z)===z,j=await(G.isRTL==null?void 0:G.isRTL(U.floating)),M=F||(L||!N?[sH(z)]:oO(z)),_=q!=="none";if(!F&&_)M.push(...nO(z,N,q,j));let E=[z,...M],C=await G.detectOverflow(Z,A),R=[],T=((H=B.flip)==null?void 0:H.overflows)||[];if(K)R.push(C[V]);if(Y){let O=aO(Q,X,j);R.push(C[O[0]],C[O[1]])}if(T=[...T,{placement:Q,overflows:R}],!R.every((O)=>O<=0)){var I,y;let O=(((I=B.flip)==null?void 0:I.index)||0)+1,k=E[O];if(k){if(!(Y==="alignment"?D!==y4(k):!1)||T.every((v)=>y4(v.placement)===D?v.overflows[0]>0:!0))return{data:{index:O,overflows:T},reset:{placement:k}}}let b=(y=T.filter((h)=>h.overflows[0]<=0).sort((h,v)=>h.overflows[1]-v.overflows[1])[0])==null?void 0:y.placement;if(!b)switch(W){case"bestFit":{var S;let h=(S=T.filter((v)=>{if(_){let f=y4(v.placement);return f===D||f==="y"}return!0}).map((v)=>[v.placement,v.overflows.filter((f)=>f>0).reduce((f,w)=>f+w,0)]).sort((v,f)=>v[1]-f[1])[0])==null?void 0:S[0];if(h)b=h;break}case"initialPlacement":b=z;break}if(Q!==b)return{reset:{placement:b}}}return{}}}};var IC=new Set(["left","top"]);async function P00($,Z){let{placement:J,platform:H,elements:Q}=$,B=await(H.isRTL==null?void 0:H.isRTL(Q.floating)),X=o2(J),z=V8(J),G=y4(J)==="y",U=IC.has(X)?-1:1,K=B&&G?-1:1,Y=M9(Z,$),{mainAxis:F,crossAxis:W,alignmentAxis:q}=typeof Y==="number"?{mainAxis:Y,crossAxis:0,alignmentAxis:null}:{mainAxis:Y.mainAxis||0,crossAxis:Y.crossAxis||0,alignmentAxis:Y.alignmentAxis};if(z&&typeof q==="number")W=z==="end"?q*-1:q;return G?{x:W*K,y:F*U}:{x:F*U,y:W*K}}var bC=function($){if($===void 0)$=0;return{name:"offset",options:$,async fn(Z){var J,H;let{x:Q,y:B,placement:X,middlewareData:z}=Z,G=await P00(Z,$);if(X===((J=z.offset)==null?void 0:J.placement)&&(H=z.arrow)!=null&&H.alignmentOffset)return{};return{x:Q+G.x,y:B+G.y,data:{...G,placement:X}}}}},kC=function($){if($===void 0)$={};return{name:"shift",options:$,async fn(Z){let{x:J,y:H,placement:Q,platform:B}=Z,{mainAxis:X=!0,crossAxis:z=!1,limiter:G={fn:(D)=>{let{x:L,y:j}=D;return{x:L,y:j}}},...U}=M9($,Z),K={x:J,y:H},Y=await B.detectOverflow(Z,U),F=y4(Q),W=_z(F),q=K[W],N=K[F],A=(D,L)=>Pz(L+Y[D==="y"?"top":"left"],L,L-Y[D==="y"?"bottom":"right"]);if(X)q=A(W,q);if(z)N=A(F,N);let V=G.fn({...Z,[W]:q,[F]:N});return{...V,data:{x:V.x-J,y:V.y-H,enabled:{[W]:X,[F]:z}}}}}},yC=function($){if($===void 0)$={};return{options:$,fn(Z){var J,H;let{x:Q,y:B,placement:X,rects:z,middlewareData:G}=Z,{offset:U=0,mainAxis:K=!0,crossAxis:Y=!0}=M9($,Z),F={x:Q,y:B},W=y4(X),q=_z(W),N=F[q],A=F[W],V=M9(U,Z),D=typeof V==="number"?{mainAxis:V,crossAxis:0}:{mainAxis:(J=V.mainAxis)!=null?J:0,crossAxis:(H=V.crossAxis)!=null?H:0};if(K){let M=q==="y"?"height":"width",_=z.reference[q]-z.floating[M]+D.mainAxis,E=z.reference[q]+z.reference[M]-D.mainAxis;if(N<_)N=_;else if(N>E)N=E}if(Y){var L,j;let M=q==="y"?"width":"height",_=IC.has(o2(X)),E=z.reference[W]-z.floating[M]+(_?((L=G.offset)==null?void 0:L[W])||0:0)+(_?0:D.crossAxis),C=z.reference[W]+z.reference[M]+(_?0:((j=G.offset)==null?void 0:j[W])||0)-(_?D.crossAxis:0);if(A<E)A=E;else if(A>C)A=C}return{[q]:N,[W]:A}}}},xC=function($){if($===void 0)$={};return{name:"size",options:$,async fn(Z){let{placement:J,rects:H,platform:Q,elements:B}=Z,{apply:X=()=>{},...z}=M9($,Z),G=await Q.detectOverflow(Z,z),U=o2(J),K=V8(J),Y=y4(J)==="y",{width:F,height:W}=H.floating,q,N;if(U==="top"||U==="bottom")q=U,N=K===(await(Q.isRTL==null?void 0:Q.isRTL(B.floating))?"start":"end")?"left":"right";else N=U,q=K==="end"?"top":"bottom";let A=W-G.top-G.bottom,V=F-G.left-G.right,D=t3(W-G[q],A),L=t3(F-G[N],V),j=Z.middlewareData.shift,M=!j,_=D,E=L;if(j!=null&&j.enabled.x)E=V;if(j!=null&&j.enabled.y)_=A;if(M&&!K)if(Y)E=F-2*f8(G.left,G.right);else _=W-2*f8(G.top,G.bottom);await X({...Z,availableWidth:E,availableHeight:_});let C=await Q.getDimensions(B.floating);if(F!==C.width||W!==C.height)return{reset:{rects:!0}};return{}}}};function mC($){let Z=y2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,Q=P1($),B=Q?$.offsetWidth:J,X=Q?$.offsetHeight:H,z=e3(J)!==B||e3(H)!==X;if(z)J=B,H=X;return{width:J,height:H,$:z}}function RV($){return!s0($)?$.contextElement:$}function EZ($){let Z=RV($);if(!P1(Z))return L9(1);let J=Z.getBoundingClientRect(),{width:H,height:Q,$:B}=mC(Z),X=(B?e3(J.width):J.width)/H,z=(B?e3(J.height):J.height)/Q;if(!X||!Number.isFinite(X))X=1;if(!z||!Number.isFinite(z))z=1;return{x:X,y:z}}var _00=L9(0);function uC($){let Z=I1($);if(!SV()||!Z.visualViewport)return _00;return{x:Z.visualViewport.offsetLeft,y:Z.visualViewport.offsetTop}}function j00($,Z,J){if(Z===void 0)Z=!1;return!!J&&Z&&J===I1($)}function $$($,Z,J,H){if(Z===void 0)Z=!1;if(J===void 0)J=!1;let Q=$.getBoundingClientRect(),B=RV($),X=L9(1);if(Z)if(H){if(s0(H))X=EZ(H)}else X=EZ($);let z=j00(B,J,H)?uC(B):L9(0),G=(Q.left+z.x)/X.x,U=(Q.top+z.y)/X.y,K=Q.width/X.x,Y=Q.height/X.y;if(B&&H){let F=I1(B),W=s0(H)?I1(H):H,q=F,N=wV(q);while(N&&W!==q){let A=EZ(N),V=N.getBoundingClientRect(),D=y2(N),L=V.left+(N.clientLeft+parseFloat(D.paddingLeft))*A.x,j=V.top+(N.clientTop+parseFloat(D.paddingTop))*A.y;G*=A.x,U*=A.y,K*=A.x,Y*=A.y,G+=L,U+=j,q=I1(N),N=wV(q)}}return u7({width:K,height:Y,x:G,y:U})}function XG($,Z){let J=GQ($).scrollLeft;if(!Z)return $$(M3($)).left+J;return Z.left+J}function pC($,Z){let J=$.getBoundingClientRect(),H=J.left+Z.scrollLeft-XG($,J),Q=J.top+Z.scrollTop;return{x:H,y:Q}}function O00($){let{elements:Z,rect:J,offsetParent:H,strategy:Q}=$,B=Q==="fixed",X=M3(H),z=Z?BG(Z.floating):!1;if(H===X||z&&B)return J;let G={scrollLeft:0,scrollTop:0},U=L9(1),K=L9(0),Y=P1(H);if(Y||!B){if(P2(H)!=="body"||zQ(X))G=GQ(H);if(Y){let W=$$(H);U=EZ(H),K.x=W.x+H.clientLeft,K.y=W.y+H.clientTop}}let F=X&&!Y&&!B?pC(X,G):L9(0);return{width:J.width*U.x,height:J.height*U.y,x:J.x*U.x-G.scrollLeft*U.x+K.x+F.x,y:J.y*U.y-G.scrollTop*U.y+K.y+F.y}}function T00($){return $.getClientRects?Array.from($.getClientRects()):[]}function C00($){let Z=GQ($),J=$.ownerDocument.body,H=f8($.scrollWidth,$.clientWidth,J.scrollWidth,J.clientWidth),Q=f8($.scrollHeight,$.clientHeight,J.scrollHeight,J.clientHeight),B=-Z.scrollLeft+XG($),X=-Z.scrollTop;if(y2(J).direction==="rtl")B+=f8($.clientWidth,J.clientWidth)-H;return{width:H,height:Q,x:B,y:X}}var w00=25;function E00($,Z,J){if(J===void 0)J="viewport";let H=J==="layoutViewport",Q=I1($),B=M3($),X=Q.visualViewport,z=B.clientWidth,G=B.clientHeight,U=0,K=0;if(X){let F=!SV()||Z==="fixed";if(H){if(!F)U=-X.offsetLeft,K=-X.offsetTop}else if(z=X.width,G=X.height,F)U=X.offsetLeft,K=X.offsetTop}if(XG(B)<=0){let F=B.ownerDocument,W=F.body,q=getComputedStyle(W),N=F.compatMode==="CSS1Compat"?parseFloat(q.marginLeft)+parseFloat(q.marginRight)||0:0,A=Math.abs(B.clientWidth-W.clientWidth-N),V=getComputedStyle(B).scrollbarGutter==="stable both-edges"?A/2:A;if(V<=w00)z-=V}return{width:z,height:G,x:U,y:K}}function S00($,Z){let J=$$($,!0,Z==="fixed"),H=J.top+$.clientTop,Q=J.left+$.clientLeft,B=EZ($),X=$.clientWidth*B.x,z=$.clientHeight*B.y,G=Q*B.x,U=H*B.y;return{width:X,height:z,x:G,y:U}}function hC($,Z,J){let H;if(Z==="viewport"||Z==="layoutViewport")H=E00($,J,Z);else if(Z==="document")H=C00(M3($));else if(s0(Z))H=S00(Z,J);else{let Q=uC($);H={x:Z.x-Q.x,y:Z.y-Q.y,width:Z.width,height:Z.height}}return u7(H)}function R00($,Z){let J=Z.get($);if(J)return J;let H=SZ($,[],!1).filter((z)=>s0(z)&&P2(z)!=="body"),Q=null,B=y2($).position==="fixed",X=B?P8($):$;while(s0(X)&&!M8(X)){let z=y2(X),G=EV(X),U=Q?Q.position:B?"fixed":"";if(!G&&(U==="fixed"||U==="absolute"&&z.position==="static"))H=H.filter((Y)=>Y!==X);else Q=z;X=P8(X)}return Z.set($,H),H}function I00($){let{element:Z,boundary:J,rootBoundary:H,strategy:Q}=$,X=[...J==="clippingAncestors"?BG(Z)?[]:R00(Z,this._c):[].concat(J),H],z=hC(Z,X[0],Q),G=z.top,U=z.right,K=z.bottom,Y=z.left;for(let F=1;F<X.length;F++){let W=hC(Z,X[F],Q);G=f8(W.top,G),U=t3(W.right,U),K=t3(W.bottom,K),Y=f8(W.left,Y)}return{width:U-Y,height:K-G,x:Y,y:G}}function b00($){let{width:Z,height:J}=mC($);return{width:Z,height:J}}function k00($,Z,J){let H=P1(Z),Q=M3(Z),B=J==="fixed",X=$$($,!0,B,Z),z={scrollLeft:0,scrollTop:0},G=L9(0);if(H||!B){if(P2(Z)!=="body"||zQ(Q))z=GQ(Z);if(H){let F=$$(Z,!0,B,Z);G.x=F.x+Z.clientLeft,G.y=F.y+Z.clientTop}}if(!H&&Q)G.x=XG(Q);let U=Q&&!H&&!B?pC(Q,z):L9(0),K=X.left+z.scrollLeft-G.x-U.x,Y=X.top+z.scrollTop-G.y-U.y;return{x:K,y:Y,width:X.width,height:X.height}}function CV($){return y2($).position==="static"}function vC($,Z){if(!P1($)||y2($).position==="fixed")return null;if(Z)return Z($);let J=$.offsetParent;if(M3($)===J)J=J.ownerDocument.body;return J}function cC($,Z){let J=I1($);if(BG($))return J;if(!P1($)){let Q=P8($);while(Q&&!M8(Q)){if(s0(Q)&&!CV(Q))return Q;Q=P8(Q)}return J}let H=vC($,Z);while(H&&gC(H)&&CV(H))H=vC(H,Z);if(H&&M8(H)&&CV(H)&&!EV(H))return J;return H||fC($)||J}var y00=async function($){let Z=this.getOffsetParent||cC,J=this.getDimensions,H=await J($.floating);return{reference:k00($.reference,await Z($.floating),$.strategy),floating:{x:0,y:0,width:H.width,height:H.height}}};function x00($){return y2($).direction==="rtl"}var IV={convertOffsetParentRelativeRectToViewportRelativeRect:O00,getDocumentElement:M3,getClippingRect:I00,getOffsetParent:cC,getElementRects:y00,getClientRects:T00,getDimensions:b00,getScale:EZ,isElement:s0,isRTL:x00};function dC($,Z){return $.x===Z.x&&$.y===Z.y&&$.width===Z.width&&$.height===Z.height}function h00($,Z,J){let H=null,Q,B=M3($);function X(){var K;clearTimeout(Q),(K=H)==null||K.disconnect(),H=null}function z(K,Y){if(K===void 0)K=!1;if(Y===void 0)Y=1;X();let F=$.getBoundingClientRect(),{left:W,top:q,width:N,height:A}=F;if(!K)Z();if(!N||!A)return;let V=tH(q),D=tH(B.clientWidth-(W+N)),L=tH(B.clientHeight-(q+A)),j=tH(W),_={rootMargin:-V+"px "+-D+"px "+-L+"px "+-j+"px",threshold:f8(0,t3(1,Y))||1},E=!0;function C(R){let T=R[0].intersectionRatio;if(!dC(F,$.getBoundingClientRect()))return z();if(T!==Y){if(!E)return z();if(!T)Q=setTimeout(()=>{z(!1,0.0000001)},1000);else z(!1,T)}E=!1}try{H=new IntersectionObserver(C,{..._,root:B.ownerDocument})}catch(R){H=new IntersectionObserver(C,_)}H.observe($)}let G=I1($),U=()=>z(J);return G.addEventListener("resize",U),z(!0),()=>{G.removeEventListener("resize",U),X()}}function UQ($,Z,J,H){if(H===void 0)H={};let{ancestorScroll:Q=!0,ancestorResize:B=!0,elementResize:X=typeof ResizeObserver==="function",layoutShift:z=typeof IntersectionObserver==="function",animationFrame:G=!1}=H,U=RV($),K=Q||B?[...U?SZ(U):[],...Z?SZ(Z):[]]:[];K.forEach((V)=>{Q&&V.addEventListener("scroll",J),B&&V.addEventListener("resize",J)});let Y=U&&z?h00(U,J,B):null,F=-1,W=null;if(X){if(W=new ResizeObserver((V)=>{let[D]=V;if(D&&D.target===U&&W&&Z)W.unobserve(Z),cancelAnimationFrame(F),F=requestAnimationFrame(()=>{var L;(L=W)==null||L.observe(Z)});J()}),U&&!G)W.observe(U);if(Z)W.observe(Z)}let q,N=G?$$($):null;if(G)A();function A(){let V=$$($);if(N&&!dC(N,V))J();N=V,q=requestAnimationFrame(A)}return J(),()=>{var V;if(K.forEach((D)=>{Q&&D.removeEventListener("scroll",J),B&&D.removeEventListener("resize",J)}),Y==null||Y(),(V=W)==null||V.disconnect(),W=null,G)cancelAnimationFrame(q)}}var lC=bC;var iC=kC,rC=RC,aC=xC;var oC=yC,zG=($,Z,J)=>{let H=new Map,Q=J!=null?J:{},B={...IV,...Q.platform,_c:H};return SC($,Z,{...Q,platform:B})};var B2=P(m(),1),sC=P(m(),1),tC=P(e4(),1),g00=typeof document<"u",f00=function(){},GG=g00?sC.useLayoutEffect:f00;function UG($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if(typeof $==="function"&&$.toString()===Z.toString())return!0;let J,H,Q;if($&&Z&&typeof $==="object"){if(Array.isArray($)){if(J=$.length,J!==Z.length)return!1;for(H=J;H--!==0;)if(!UG($[H],Z[H]))return!1;return!0}if(Q=Object.keys($),J=Q.length,J!==Object.keys(Z).length)return!1;for(H=J;H--!==0;)if(!{}.hasOwnProperty.call(Z,Q[H]))return!1;for(H=J;H--!==0;){let B=Q[H];if(B==="_owner"&&$.$$typeof)continue;if(!UG($[B],Z[B]))return!1}return!0}return $!==$&&Z!==Z}function eC($){if(typeof window>"u")return 1;return($.ownerDocument.defaultView||window).devicePixelRatio||1}function nC($,Z){let J=eC($);return Math.round(Z*J)/J}function bV($){let Z=B2.useRef($);return GG(()=>{Z.current=$}),Z}function $w($){if($===void 0)$={};let{placement:Z="bottom",strategy:J="absolute",middleware:H=[],platform:Q,elements:{reference:B,floating:X}={},transform:z=!0,whileElementsMounted:G,open:U}=$,[K,Y]=B2.useState({x:0,y:0,strategy:J,placement:Z,middlewareData:{},isPositioned:!1}),[F,W]=B2.useState(H);if(!UG(F,H))W(H);let[q,N]=B2.useState(null),[A,V]=B2.useState(null),D=B2.useCallback((v)=>{if(v!==_.current)_.current=v,N(v)},[]),L=B2.useCallback((v)=>{if(v!==E.current)E.current=v,V(v)},[]),j=B||q,M=X||A,_=B2.useRef(null),E=B2.useRef(null),C=B2.useRef(K),R=G!=null,T=bV(G),I=bV(Q),y=bV(U),S=B2.useCallback(()=>{if(!_.current||!E.current)return;let v={placement:Z,strategy:J,middleware:F};if(I.current)v.platform=I.current;zG(_.current,E.current,v).then((f)=>{let w={...f,isPositioned:y.current!==!1};if(O.current&&!UG(C.current,w))C.current=w,tC.flushSync(()=>{Y(w)})})},[F,Z,J,I,y]);GG(()=>{if(U===!1&&C.current.isPositioned)C.current.isPositioned=!1,Y((v)=>({...v,isPositioned:!1}))},[U]);let O=B2.useRef(!1);GG(()=>{return O.current=!0,()=>{O.current=!1}},[]),GG(()=>{if(j)_.current=j;if(M)E.current=M;if(j&&M){if(T.current)return T.current(j,M,S);S()}},[j,M,S,T,R]);let k=B2.useMemo(()=>({reference:_,floating:E,setReference:D,setFloating:L}),[D,L]),b=B2.useMemo(()=>({reference:j,floating:M}),[j,M]),h=B2.useMemo(()=>{let v={position:J,left:0,top:0};if(!b.floating)return v;let f=nC(b.floating,K.x),w=nC(b.floating,K.y);if(z)return{...v,transform:"translate("+f+"px, "+w+"px)",...eC(b.floating)>=1.5&&{willChange:"transform"}};return{position:J,left:f,top:w}},[J,z,b.floating,K.x,K.y]);return B2.useMemo(()=>({...K,update:S,refs:k,elements:b,floatingStyles:h}),[K,S,k,b,h])}var kV=($,Z)=>{let J=lC($);return{name:J.name,fn:J.fn,options:[$,Z]}},yV=($,Z)=>{let J=iC($);return{name:J.name,fn:J.fn,options:[$,Z]}},xV=($,Z)=>{return{fn:oC($).fn,options:[$,Z]}},hV=($,Z)=>{let J=rC($);return{name:J.name,fn:J.fn,options:[$,Z]}},vV=($,Z)=>{let J=aC($);return{name:J.name,fn:J.fn,options:[$,Z]}};var t2=P(m(),1);function Zw($){return m00($,$.rootContext)}function m00($,Z){let{nodeId:J,externalTree:H}=$,Q=Z.useState("referenceElement"),B=Z.useState("floatingElement"),X=Z.useState("domReferenceElement"),z=Z.useState("open"),G=Z.useState("floatingId"),[U,K]=t2.useState(null),[Y,F]=t2.useState(void 0),[W,q]=t2.useState(void 0),N=t2.useRef(null),A=n2(H),V=t2.useMemo(()=>({reference:Q,floating:B,domReference:X}),[Q,B,X]),D=$w({...$,elements:{...V,...U&&{reference:U}}}),L=s0(Y)?Y:null,j=W===void 0?Z.state.floatingElement:W;Z.useSyncedValue("referenceElement",Y??null),Z.useSyncedValue("domReferenceElement",Y===void 0?X:L),Z.useSyncedValue("floatingElement",j);let M=t2.useCallback((I)=>{let y=s0(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;K(y),D.refs.setReference(y)},[D.refs]),_=t2.useCallback((I)=>{if(s0(I)||I===null)N.current=I,F(I);if(s0(D.refs.reference.current)||D.refs.reference.current===null||I!==null&&!s0(I))D.refs.setReference(I)},[D.refs,F]),E=t2.useCallback((I)=>{q(I),D.refs.setFloating(I)},[D.refs]),C=t2.useMemo(()=>({...D.refs,setReference:_,setFloating:E,setPositionReference:M,domReference:N}),[D.refs,_,E,M]),R=t2.useMemo(()=>({...D.elements,domReference:X}),[D.elements,X]),T=t2.useMemo(()=>({...D,dataRef:Z.context.dataRef,open:z,onOpenChange:Z.setOpen,events:Z.context.events,floatingId:G,refs:C,elements:R,nodeId:J,rootStore:Z}),[D,C,R,J,Z,z,G]);return J0(()=>{if(X)N.current=X},[X]),J0(()=>{Z.context.dataRef.current.floatingContext=T;let I=A?.nodesRef.current.find((y)=>y.id===J);if(I)I.context=T}),t2.useMemo(()=>({...D,context:T,refs:C,elements:R,rootStore:Z}),[D,C,R,T,Z])}var KG=P(m(),1),u00=KG.createContext(void 0);function g4(){return KG.useContext(u00)?.direction??"ltr"}var p00=($)=>({name:"arrow",options:$,async fn(Z){let{x:J,y:H,placement:Q,rects:B,platform:X,elements:z,middlewareData:G}=Z,{element:U,padding:K=0,offsetParent:Y="real"}=M9($,Z)||{};if(U==null)return{};let F=jz(K),W={x:J,y:H},q=$Q(Q),N=eH(q),A=await X.getDimensions(U),V=q==="y",D=V?"top":"left",L=V?"bottom":"right",j=V?"clientHeight":"clientWidth",M=B.reference[N]+B.reference[q]-W[q]-B.floating[N],_=W[q]-B.reference[q],E=Y==="real"?await X.getOffsetParent?.(U):z.floating,C=z.floating[j]||B.floating[N];if(!C||!await X.isElement?.(E))C=z.floating[j]||B.floating[N];let R=M/2-_/2,T=C/2-A[N]/2-1,I=Math.min(F[D],T),y=Math.min(F[L],T),S=I,O=C-A[N]-y,k=C/2-A[N]/2+R,b=Pz(S,k,O),h=!G.arrow&&V8(Q)!=null&&k!==b&&B.reference[N]/2-(k<S?I:y)-A[N]/2<0,v=h?k<S?k-S:k-O:0;return{[q]:W[q]+v,data:{[q]:b,centerOffset:k-b-v,...h&&{alignmentOffset:v}},reset:h}}}),Jw=($,Z)=>{let{name:J,fn:H}=p00($);return{name:J,fn:H,options:[$,Z]}};var Hw={name:"hide",async fn($){let{width:Z,height:J,x:H,y:Q}=$.rects.reference,B=Z===0&&J===0&&H===0&&Q===0,X=await $.platform.detectOverflow($,{elementContext:"reference"});return{data:{referenceHidden:X.top-J>=0||X.right-Z>=0||X.bottom-J>=0||X.left-Z>=0||B}}}};var RZ={sideX:"left",sideY:"top"};var YG="--available-width",FG="--available-height",Qw="--anchor-width",Bw="--anchor-height",Xw="--transform-origin",zw="--positioner-width",Gw="--positioner-height";var Kw=YG,Yw=FG;function qw($,Z,J){let H=$==="inline-start"||$==="inline-end";return{top:"top",right:H?J?"inline-start":"inline-end":"right",bottom:"bottom",left:H?J?"inline-end":"inline-start":"left"}[Z]}function Fw($,Z,J){let{rects:H,placement:Q}=$;return{side:qw(Z,o2(Q),J),align:V8(Q)||"center",anchor:{width:H.reference.width,height:H.reference.height},positioner:{width:H.floating.width,height:H.floating.height}}}function b9($){return c00($,Zw)}function c00($,Z){let{anchor:J,positionMethod:H="absolute",side:Q="bottom",sideOffset:B=0,align:X="center",alignOffset:z=0,collisionBoundary:G,collisionPadding:U=5,sticky:K=!1,arrowPadding:Y=5,disableAnchorTracking:F=!1,inline:W,keepMounted:q=!1,floatingRootContext:N,mounted:A,collisionAvoidance:V,shift:D,nodeId:L,adaptiveOrigin:j,lazyFlip:M=!1,externalTree:_}=$,[E,C]=$8.useState(null);if(!A&&E!==null)C(null);let R=V.side||"flip",T=V.align||"flip",I=V.fallbackAxisSide||"end",y=D?.crossAxis??!1,S=D?.rootBoundary,O=typeof J==="function"?J:void 0,k=U0(O),b=O?k:J,h=U5(J),v=U5(A),w=g4()==="rtl",i=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":w?"left":"right","inline-start":w?"right":"left"}[Q],r=X==="center"?i:`${i}-${X}`,x=U;if(typeof x==="number")x={top:x,right:x,bottom:x,left:x};else if(x)x={top:x.top||0,right:x.right||0,bottom:x.bottom||0,left:x.left||0};let l=1,s=Q==="bottom"?l:0,p=Q==="top"?l:0,d=Q==="right"?l:0,o=Q==="left"?l:0,Z0={boundary:G==="clipping-ancestors"?"clippingAncestors":G,padding:x},H0=$8.useRef(null),G0=U5(B),X0=U5(z),Y0=typeof B!=="function"?B:0,A0=typeof z!=="function"?z:0,N0=[];if(W)N0.push(W);N0.push(kV((C0)=>{let p0=Fw(C0,Q,w),i0=typeof G0.current==="function"?G0.current(p0):G0.current,o0=typeof X0.current==="function"?X0.current(p0):X0.current;return{mainAxis:i0,crossAxis:o0,alignmentAxis:o0}},[Y0,A0,w,Q]));let F0=T==="none"&&R!=="shift",n=!F0&&(K||y||R==="shift"),a=R==="none"?null:hV({...Z0,padding:{top:x.top+l+s,right:x.right+l+o,bottom:x.bottom+l+p,left:x.left+l+d},mainAxis:!y&&R==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),e=F0?null:yV({...Z0,rootBoundary:S,mainAxis:T!=="none",crossAxis:n,limiter:K||y?void 0:xV((C0)=>{if(!H0.current)return{};let{width:p0,height:i0}=H0.current.getBoundingClientRect(),o0=y4(o2(C0.placement)),A1=o0==="y"?p0:i0,D1=o0==="y"?x.left+x.right:x.top+x.bottom;return{offset:A1/2+D1/2}})},[Z0,K,y,S,x,T]);if(R==="shift"||T==="shift"||X==="center")N0.push(e,a);else N0.push(a,e);N0.push(vV({...Z0,apply({elements:{floating:C0},availableWidth:p0,availableHeight:i0,rects:o0}){if(!v.current)return;let A1=C0.style;A1.setProperty(Kw,`${p0}px`),A1.setProperty(Yw,`${i0}px`);let D1=I1(C0).devicePixelRatio||1,{x:u1,y:q0,width:P0,height:l0}=o0.reference,z1=(Math.round((u1+P0)*D1)-Math.round(u1*D1))/D1,O1=(Math.round((q0+l0)*D1)-Math.round(q0*D1))/D1;A1.setProperty(Qw,`${z1}px`),A1.setProperty(Bw,`${O1}px`)}}),Jw((C0)=>({element:H0.current||m0(C0.elements.floating).createElement("div"),padding:H0.current?Y:0,offsetParent:"floating"}),[Y]),{name:"transformOrigin",fn(C0){let{elements:{floating:p0},middlewareData:i0,placement:o0,platform:A1,rects:D1,y:u1}=C0,q0=o2(o0),P0=V8(o0),l0=y4(q0)==="y",z1=H0.current,O1=typeof B==="function"?B(Fw(C0,Q,w)):B,k0;if(!z1&&P0&&Math.abs(l0?i0.shift?.x||0:i0.shift?.y||0)<=1)k0=P0==="start"===(l0&&A1.isRTL?.(p0)===!0)?"100%":"0%";else{let h0=l0?i0.arrow?.x||0:i0.arrow?.y||0,G1=l0?z1?.clientWidth||0:z1?.clientHeight||0;k0=`${h0+G1/2}px`}let r0=q0==="top"||q0==="left"?`calc(100% + ${O1}px)`:`${-O1}px`;if(n&&l0&&Math.abs(i0.shift?.y||0)>O1)r0=`${D1.reference.y+D1.reference.height/2-u1}px`;return p0.style.setProperty(Xw,l0?`${k0} ${r0}`:`${r0} ${k0}`),{}}},Hw,j),J0(()=>{if(!A&&N)N.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[A,N]);let $0=$8.useMemo(()=>({ancestorScroll:!F,elementResize:!F&&typeof ResizeObserver<"u",layoutShift:!F&&typeof IntersectionObserver<"u"}),[F]),{refs:Q0,elements:_0,x:M0,y:V0,middlewareData:L0,update:g,placement:u,context:t,isPositioned:W0,floatingStyles:I0}=Z({rootContext:N,open:q?A:void 0,placement:r,middleware:N0,strategy:H,whileElementsMounted:q?void 0:(...C0)=>UQ(...C0,$0),nodeId:L,externalTree:_}),{sideX:c0,sideY:f0}=L0.adaptiveOrigin||RZ,T0=W0?H:"fixed",x0=$8.useMemo(()=>{let C0;if(!W0)C0={position:T0,top:0,left:0};else if(j)C0={position:T0,[c0]:M0,[f0]:V0};else C0={...I0,position:T0};if(C0[Kw]="100vw",C0[Yw]="100vh",!W0)C0.opacity=0;return C0},[j,T0,c0,M0,f0,V0,I0,W0]),J1=$8.useRef(null);J0(()=>{if(!A)return;let C0=h.current,p0=typeof C0==="function"?C0():C0,o0=(Ww(p0)?p0.current:p0)||null||null;if(o0!==J1.current)Q0.setPositionReference(o0),J1.current=o0},[A,Q0,b,h]),$8.useEffect(()=>{if(!A)return;let C0=h.current;if(typeof C0==="function")return;if(Ww(C0)&&C0.current!==J1.current)Q0.setPositionReference(C0.current),J1.current=C0.current},[A,Q0,b,h]),$8.useEffect(()=>{if(q&&A&&_0.reference&&_0.floating)return UQ(_0.reference,_0.floating,g,$0);return},[q,A,_0,g,$0]);let W1=o2(u),d0=qw(Q,W1,w),v0=V8(u)||"center",S1=Boolean(L0.hide?.referenceHidden);J0(()=>{if(M&&A&&W0&&W1!==i)C(W1)},[M,A,W0,W1,i]);let B1=$8.useMemo(()=>({position:"absolute",top:L0.arrow?.y,left:L0.arrow?.x}),[L0.arrow]),s1=L0.arrow?.centerOffset!==0;return $8.useMemo(()=>({positionerStyles:x0,arrowStyles:B1,arrowRef:H0,arrowUncentered:s1,side:d0,align:v0,physicalSide:W1,anchorHidden:S1,refs:Q0,context:t,isPositioned:W0,update:g}),[x0,B1,H0,s1,d0,v0,W1,S1,Q0,t,W0,g])}function Ww($){return $!=null&&"current"in $}var WG=P(m(),1),gV=WG.createContext(void 0);function Nw(){let $=WG.useContext(gV);if($===void 0)throw Error(y0(84));return $}function k9($){return $==="starting"?VT:L1}function y9($,Z,{styles:J,transitionStatus:H,props:Q,refs:B,hidden:X,inert:z=!1}){let G={...J};if(z)G.pointerEvents="none";return z0("div",$,{state:Z,ref:B,props:[{role:"presentation",hidden:X,style:G},k9(H),Q],stateAttributesMapping:s4})}var Vw=P(c(),1),Aw=qG.forwardRef(function(Z,J){let{toast:H,...Q}=Z,B=N9(),X=H.positionerProps??L1,{render:z,className:G,anchor:U=X.anchor,positionMethod:K=X.positionMethod??"absolute",side:Y=X.side??"top",align:F=X.align??"center",sideOffset:W=X.sideOffset??0,alignOffset:q=X.alignOffset??0,collisionBoundary:N=X.collisionBoundary??"clipping-ancestors",collisionPadding:A=X.collisionPadding??5,arrowPadding:V=X.arrowPadding??5,sticky:D=X.sticky??!1,disableAnchorTracking:L=X.disableAnchorTracking??!1,collisionAvoidance:j=X.collisionAvoidance??P9,style:M,..._}=Q,[E,C]=qG.useState(null),R=B.useState("toastIndex",H.id),T=B.useState("toastVisibleIndex",H.id),I=s0(U)?U:null,y=LV({open:!0,onOpenChange:X1,elements:{floating:E,reference:I}}),S=b9({anchor:I,positionMethod:K,floatingRootContext:y,mounted:!0,side:Y,sideOffset:W,align:F,alignOffset:q,collisionBoundary:N,collisionPadding:A,sticky:D,arrowPadding:V,disableAnchorTracking:L,keepMounted:!0,collisionAvoidance:j}),O={side:S.side,align:S.align,anchorHidden:S.anchorHidden},k=y9(Z,O,{styles:{...S.positionerStyles,[xz]:H.transitionStatus==="ending"?R:T},transitionStatus:H.transitionStatus,props:_,refs:[J,C]});return Vw.jsx(gV.Provider,{value:S,children:k})});var Dw=P(m(),1);var Lw=Dw.forwardRef(function(Z,J){let{className:H,render:Q,style:B,...X}=Z,{arrowRef:z,side:G,align:U,arrowUncentered:K,arrowStyles:Y}=Nw();return z0("div",Z,{state:{side:G,align:U,uncentered:K},ref:[J,z],props:[{style:Y,"aria-hidden":!0},X]})});var Mw=P(m(),1);function Pw(){let $=N9(),Z=$.useState("toasts");return Mw.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function _w(){let $=new Set;function Z(J){$.forEach((H)=>H(J))}return{" subscribe":function(H){return $.add(H),()=>{$.delete(H)}},add(J){let H=J.id||qz("toast"),Q={...J,id:H,transitionStatus:"starting"};return Z({action:"add",options:Q}),H},close(J){Z({action:"close",options:{id:J}})},update(J,H){Z({action:"update",options:{id:J,updates:H}})},promise(J,H){let Q=J;return Z({action:"promise",options:{...H,promise:J,setPromise(B){Q=B}}}),Q}}}var a1=P(c(),1),K5=e2.createToastManager();function d00({...$}){return a1.jsx(e2.Provider,{...$})}function l00({...$}){return a1.jsx(e2.Portal,{"data-slot":"toast-portal",...$})}function i00({className:$,...Z}){return a1.jsx(e2.Viewport,{"data-slot":"toast-viewport",className:B0("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 r00({className:$,...Z}){return a1.jsx(e2.Root,{"data-slot":"toast",className:B0("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-xl 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 a00({className:$,...Z}){return a1.jsx(e2.Content,{"data-slot":"toast-content",className:B0("flex 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 o00({className:$,...Z}){return a1.jsx(e2.Title,{"data-slot":"toast-title",className:B0("text-sm font-medium",$),...Z})}function n00({className:$,...Z}){return a1.jsx(e2.Description,{"data-slot":"toast-description",className:B0("text-sm text-muted-foreground",$),...Z})}function s00({className:$,render:Z=a1.jsx(j0,{variant:"outline",size:"sm"}),...J}){return a1.jsx(e2.Action,{"data-slot":"toast-action",render:Z,className:B0("shrink-0",$),...J})}function t00({className:$,children:Z,render:J=a1.jsx(j0,{variant:"ghost",size:"icon-sm"}),...H}){return a1.jsx(e2.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:J,className:B0("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...H,children:Z??a1.jsx(o5,{"aria-hidden":"true",stroke:1.75})})}function e00({type:$}){let Z=null;if($==="success")Z=a1.jsx(Ow,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=a1.jsx(Tw,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=a1.jsx(NG,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=a1.jsx(jw,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=a1.jsx(Cw,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return a1.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function $10(){let{toasts:$}=e2.useToastManager();return $.map((Z)=>a1.jsx(r00,{toast:Z,children:a1.jsxs(a00,{children:[a1.jsx(e00,{type:Z.type}),a1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[a1.jsx(o00,{}),a1.jsx(n00,{})]}),a1.jsx(s00,{}),a1.jsx(t00,{})]})},Z.id))}function ww({children:$,toastManager:Z=K5,...J}){return a1.jsxs(d00,{toastManager:Z,...J,children:[$,a1.jsx(l00,{children:a1.jsx(i00,{children:a1.jsx($10,{})})})]})}var GC0=e2.createToastManager,UC0=e2.useToastManager;var P3={};C5(P3,{createHandle:()=>zE,Viewport:()=>XE,Trigger:()=>gw,Root:()=>kw,Provider:()=>ow,Positioner:()=>cw,Portal:()=>uw,Popup:()=>lw,Handle:()=>OG,Arrow:()=>rw});var IZ=P(m(),1);var VG=P(m(),1),fV=VG.createContext(void 0);function _8($){let Z=VG.useContext(fV);if(Z===void 0&&!$)throw Error(y0(72));return Z}var Ew=P(m(),1);class a8 extends b2{setState($){}update($){}set($,Z){}notifyAll(){}}var Sw={...S9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,isInstantPhase:($)=>$.isInstantPhase,trackCursorAxis:($)=>$.trackCursorAxis,disableHoverablePopup:($)=>$.disableHoverablePopup,lastOpenChangeReason:($)=>$.openChangeReason,closeOnClick:($)=>$.closeOnClick,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class mV extends b2{constructor($,Z,J){let H=new O2;super(Iw($,H,Z,J),bw(H),Sw)}setOpen=($,Z)=>{nz(this,$,Z,{extraState:{openChangeReason:Z.reason}})};cancelPendingOpen($){this.state.floatingRootContext.dispatchOpenChange(!1,R0(K0.triggerPress,$))}}function Rw(){let $=new O2,Z=new a8(Object.freeze(Iw(void 0,$)),Object.freeze(bw($)),Sw);return Object.assign(Z,{setOpen:X1,cancelPendingOpen:X1})}function Iw($,Z,J,H=!1){return{...E9(Z,J,H),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...$}}function bw($){return{popupRef:Ew.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$}}var KQ=P(c(),1),kw=g8(function(Z){let{disabled:J=!1,defaultOpen:H=!1,open:Q,disableHoverablePopup:B=!1,trackCursorAxis:X="none",actionsRef:z,onOpenChange:G,onOpenChangeComplete:U,handle:K,triggerId:Y,defaultTriggerId:F=null,children:W}=Z,q=Q6((I,y)=>new mV({open:H,openProp:Q,activeTriggerId:F,triggerIdProp:Y},I,y));q.useControlledProp("openProp",Q),q.useControlledProp("triggerIdProp",Y),q.useContextCallback("onOpenChange",G),q.useContextCallback("onOpenChangeComplete",U);let N=q.useState("open"),A=!J&&N,V=q.useState("activeTriggerId"),D=q.useState("mounted"),L=q.useState("payload");q.useSyncedValues({trackCursorAxis:X,disableHoverablePopup:B,disabled:J}),T9(q,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:j,transitionStatus:M}=C9(A,q),_=q.useState("isInstantPhase"),E=q.useState("instantType"),C=q.useState("lastOpenChangeReason"),R=IZ.useRef(null);J0(()=>{if(N&&J)q.setOpen(!1,R0(K0.disabled))},[N,J,q]),J0(()=>{if(M==="ending"&&C===K0.none||M!=="ending"&&_){if(E!=="delay")R.current=E;q.set("instantType","delay")}else if(R.current!==null)q.set("instantType",R.current),R.current=null},[M,_,C,E,q]),J0(()=>{if(A){if(V==null)q.set("payload",void 0)}},[q,V,A]),IZ.useImperativeHandle(z,()=>({unmount:j,close:()=>q.setOpen(!1,R0(K0.imperativeAction))}),[j,q]);let T=A||D||!J&&X!=="none";return KQ.jsxs(fV.Provider,{value:q,children:[K&&KQ.jsx(j9,{handle:K,store:q}),T&&KQ.jsx(Z10,{store:q,disabled:J,trackCursorAxis:X}),typeof W==="function"?W({payload:L}):W]})});function Z10({store:$,disabled:Z,trackCursorAxis:J}){let H=$.useState("floatingRootContext"),Q=d8(H,{enabled:!Z,referencePress:()=>$.select("closeOnClick")}),B=FV(H,{enabled:!Z&&J!=="none",axis:J==="none"?void 0:J}),X=IZ.useMemo(()=>X2(B.reference,Q.reference),[B.reference,Q.reference]);return w9($,{activeTriggerProps:X,inactiveTriggerProps:X,popupProps:Q.floating??L1}),null}var DG=P(m(),1);function t0($){return V4($,"base-ui")}var AG=P(m(),1),uV=AG.createContext(void 0);function yw(){return AG.useContext(uV)}var xw=600;var vw="data-base-ui-tooltip-trigger";function hw($){if("composedPath"in $){let J=$.composedPath();for(let H=0;H<J.length;H+=1){let Q=J[H];if(s0(Q))return Q}}let Z=$.target;if(s0(Z))return Z;return null}function J10($){let Z=$;while(Z){let J=Z.closest(`[${vw}]`);if(J)return J;let H=Z.getRootNode();Z="host"in H&&s0(H.host)?H.host:null}return null}var gw=V9(function(Z,J){let{render:H,className:Q,style:B,handle:X,payload:z,disabled:G,delay:U,closeOnClick:K=!0,closeDelay:Y,id:F,...W}=Z,q=_8(!0),A=R9(X)??q;if(!A)throw Error(y0(82));let V=t0(F),D=A.useState("isTriggerActive",V),L=A.useState("isOpenedByTrigger",V),j=A.useState("floatingRootContext"),M=DG.useRef(null),_=Y??0,{registerTrigger:E,isMountedByThisTrigger:C}=O9(V,M,A,{payload:z,closeOnClick:K,closeDelay:_}),R=yw(),{activeIdRef:T,delayRef:I,isInstantPhase:y,hasProvider:S}=BV(j,{open:L}),O=wZ(j);A.useSyncedValue("isInstantPhase",y);let k=A.useState("disabled"),b=G??k,h=U5(b),v=A.useState("trackCursorAxis"),f=A.useState("disableHoverablePopup"),w=DG.useRef(!1),i=d1(),r=DG.useRef(void 0);function x(){if(S&&T.current!=null)return 0;return U??R??xw}function l(Y0){let A0=M.current;if(!A0||!Y0)return!1;let N0=J10(Y0);return N0!==null&&N0!==A0&&b0(A0,N0)}function s(Y0){let A0=l(Y0);if(w.current=A0,A0)O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,i.clear();return A0}let p=i8(j,{enabled:!b,mouseOnly:!0,move:!1,handleClose:!f&&v!=="both"?r8():null,restMs:x,delay(){if(Y==null&&S)return{close:c8(I.current,"close")};return{close:_}},triggerElementRef:M,isActiveTrigger:D,isClosing:()=>A.select("transitionStatus")==="ending",shouldOpen(){return!w.current}}),d=t7(j,{enabled:!b}).reference,o=(Y0)=>{let A0=w.current,N0=hw(Y0),F0=s(N0),n=M.current,a=n&&N0&&b0(n,N0);if(F0&&A.select("open")&&A.select("lastOpenChangeReason")===K0.triggerHover){A.setOpen(!1,R0(K0.triggerHover,Y0));return}if(A0&&!F0&&a&&!h.current&&!A.select("open")&&n&&t4(r.current)){let e=()=>{if(!w.current&&!h.current&&!A.select("open"))A.setOpen(!0,R0(K0.triggerHover,Y0,n))},$0=x();if($0===0)i.clear(),e();else i.start($0,e)}},Z0=A.useState("triggerProps",C);return z0("button",Z,{state:{open:L},ref:[J,E,M],props:[p,d,C||v!=="none"?Z0:void 0,{onMouseOver(Y0){o(Y0.nativeEvent)},onFocus(Y0){if(l(hw(Y0.nativeEvent)))Y0.preventBaseUIHandler()},onMouseLeave(){w.current=!1,i.clear(),r.current=void 0},onPointerEnter(Y0){r.current=Y0.pointerType},onPointerDown(Y0){if(r.current=Y0.pointerType,A.set("closeOnClick",K),K&&!A.select("open"))A.cancelPendingOpen(Y0.nativeEvent)},onClick(Y0){if(K&&!A.select("open"))A.cancelPendingOpen(Y0.nativeEvent)},id:V,[aH]:b?"":void 0,[vw]:b?void 0:""},W],stateAttributesMapping:A9})});var mw=P(m(),1);var LG=P(m(),1),pV=LG.createContext(void 0);function fw(){let $=LG.useContext(pV);if($===void 0)throw Error(y0(70));return $}var cV=P(c(),1),uw=mw.forwardRef(function(Z,J){let{keepMounted:H=!1,...Q}=Z;if(!(_8().useState("mounted")||H))return null;return cV.jsx(pV.Provider,{value:H,children:cV.jsx(OZ,{ref:J,...Q})})});var PG=P(m(),1);var MG=P(m(),1),dV=MG.createContext(void 0);function bZ(){let $=MG.useContext(dV);if($===void 0)throw Error(y0(71));return $}var pw=P(c(),1),cw=PG.forwardRef(function(Z,J){let{render:H,className:Q,anchor:B,positionMethod:X="absolute",side:z="top",align:G="center",sideOffset:U=0,alignOffset:K=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:A=P9,style:V,...D}=Z,L=_8(),j=fw(),M=L.useState("open"),_=L.useState("mounted"),E=L.useState("trackCursorAxis"),C=L.useState("disableHoverablePopup"),R=L.useState("floatingRootContext"),T=L.useState("instantType"),I=L.useState("transitionStatus"),y=L.useState("adaptiveOrigin"),S=b9({anchor:B,positionMethod:X,floatingRootContext:R,mounted:_,side:z,sideOffset:U,align:G,alignOffset:K,collisionBoundary:Y,collisionPadding:F,sticky:q,arrowPadding:W,disableAnchorTracking:N,keepMounted:j,collisionAvoidance:A,adaptiveOrigin:y}),O=PG.useMemo(()=>({open:M,side:S.side,align:S.align,anchorHidden:S.anchorHidden,instant:E!=="none"?"tracking-cursor":T}),[M,S.side,S.align,S.anchorHidden,E,T]),k=y9(Z,O,{styles:S.positionerStyles,transitionStatus:I,props:D,refs:[J,L.useStateSetter("positionerElement")],hidden:!_,inert:!M||E==="both"||C});return pw.jsx(dV.Provider,{value:S,children:k})});var dw=P(m(),1);var lw=dw.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=_8(),{side:G,align:U}=bZ(),K=z.useState("open"),Y=z.useState("instantType"),F=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("floatingRootContext"),N=z.useState("disabled"),A=z.useState("closeDelay");q5({open:K,ref:z.context.popupRef,onComplete(){if(K)z.context.onOpenChangeComplete?.(!0)}}),L3(q,{enabled:!N,closeDelay:A});let V=z.useStateSetter("popupElement");return z0("div",Z,{state:{open:K,side:G,align:U,instant:Y,transitionStatus:F},ref:[J,z.context.popupRef,V],props:[_9,W,k9(F),X],stateAttributesMapping:a2})});var iw=P(m(),1);var rw=iw.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=_8(),{arrowRef:G,side:U,align:K,arrowUncentered:Y,arrowStyles:F}=bZ(),W=z.useState("open"),q=z.useState("instantType");return z0("div",Z,{state:{open:W,side:U,align:K,uncentered:Y,instant:q},ref:[J,G],props:[{style:F,"aria-hidden":!0},X],stateAttributesMapping:s4})});var aw=P(m(),1);var lV=P(c(),1),ow=function(Z){let{delay:J,closeDelay:H,timeout:Q=400}=Z,B=aw.useMemo(()=>({open:J,close:H}),[J,H]);return lV.jsx(uV.Provider,{value:J,children:lV.jsx(QV,{delay:B,timeoutMs:Q,children:Z.children})})};var BE=P(m(),1);var v2=P(m(),1),QE=P(e4(),1);var nw=P(m(),1);function sw($){let[Z,J]=nw.useState({current:$,previous:null});if(!Object.is($,Z.current))J({current:$,previous:Z.current});return Z.previous}var yZ=P(m(),1);function kZ($){let Z=y2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,Q=P1($),B=Q?$.offsetWidth:J,X=Q?$.offsetHeight:H;if(e3(J)!==B||e3(H)!==X)J=B,H=X;return{width:J,height:H}}var YQ="--popup-width",FQ="--popup-height";function $E($){let{popupElement:Z,positionerElement:J,content:H,mounted:Q,onMeasureLayout:B,onMeasureLayoutComplete:X,side:z,direction:G}=$,U=h4(Z,!0),K=N4(),Y=yZ.useRef(null),F=yZ.useRef(!0),W=yZ.useRef(X1),q=U0(B),N=U0(X),A=yZ.useMemo(()=>H10(z,G),[z,G]);J0(()=>{if(!Q){W.current=X1,F.current=!0,Y.current=null;return}if(!Z||!J)return;W.current=ew(Z,A),iV(Z,"auto");let V=jG(Z,"position","static"),D=jG(Z,"transform","none"),L=jG(Z,"scale","1"),j=ew(J,{[YG]:"max-content",[FG]:"max-content"});function M(){V(),D(),j()}function _(){M(),L()}if(q?.(),F.current||Y.current===null){_G(J,"max-content");let T=kZ(Z);return Y.current=T,_G(J,T),_(),N?.(null,T),F.current=!1,()=>{W.current(),W.current=X1}}_G(J,"max-content");let E=Y.current,C=kZ(Z);Y.current=C,iV(Z,E),_(),N?.(E,C),_G(J,C);let R=new AbortController;return K.request(()=>{iV(Z,C),U(()=>{Z.style.setProperty(YQ,"auto"),Z.style.setProperty(FQ,"auto")},R.signal)}),()=>{R.abort(),K.cancel(),W.current(),W.current=X1}},[H,Z,J,U,K,Q,q,N,A])}function H10($,Z){let J=$==="top",H=$==="left"||$===(Z==="rtl"?"inline-end":"inline-start");if(!J&&!H)return L1;return{position:"absolute",[J?"bottom":"top"]:"0",[H?"right":"left"]:"0"}}function jG($,Z,J){let H=$.style.getPropertyValue(Z);return $.style.setProperty(Z,J),()=>{$.style.setProperty(Z,H)}}function ew($,Z){let J=[];for(let[H,Q]of Object.entries(Z))J.push(jG($,H,Q));return J.length?()=>{J.forEach((H)=>H())}:X1}function iV($,Z){let J=Z==="auto"?"auto":`${Z.width}px`,H=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty(YQ,J),$.style.setProperty(FQ,H)}function _G($,Z){let J=Z==="max-content"?"max-content":`${Z.width}px`,H=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty(zw,J),$.style.setProperty(Gw,H)}var ZE={name:"adaptiveOrigin",async fn($){let{x:Z,y:J,rects:{floating:H},elements:{floating:Q},platform:B,strategy:X,placement:z}=$,G=I1(Q),U=G.getComputedStyle(Q);if(!(U.transitionDuration!=="0s"&&U.transitionDuration!==""))return{x:Z,y:J,data:RZ};let Y=await B.getOffsetParent?.(Q),F={width:0,height:0};if(X==="fixed"&&G?.visualViewport)F={width:G.visualViewport.width,height:G.visualViewport.height};else if(Y===G){let D=m0(Q);F={width:D.documentElement.clientWidth,height:D.documentElement.clientHeight}}else if(await B.isElement?.(Y))F=await B.getDimensions(Y);let W=o2(z),q=Z,N=J;if(W==="left")q=F.width-(Z+H.width);if(W==="top")N=F.height-(J+H.height);let A=W==="left"?"right":RZ.sideX,V=W==="top"?"bottom":RZ.sideY;return{x:q,y:N,data:{sideX:A,sideY:V}}}};var JE="data-activation-direction";var xZ=P(c(),1),X6={activationDirection:($)=>$?{[JE]:$}:null};function z6($){let{store:Z,side:J,children:H}=$,Q=g4(),B=Z.useState("activeTriggerElement"),X=Z.useState("activeTriggerId"),z=Z.useState("open"),G=Z.useState("payload"),U=Z.useState("mounted"),K=Z.useState("popupElement"),Y=Z.useState("positionerElement"),F=sw(z?B:null),W=z10(X,G),q=v2.useRef(null),[N,A]=v2.useState(null),[V,D]=v2.useState(null),L=v2.useRef(null),j=v2.useRef(null),M=h4(L,!0),_=N4(),E=v2.useRef(null),[C,R]=v2.useState(null),[T,I]=v2.useState(!1);J0(()=>{return Z.set("adaptiveOrigin",ZE),()=>{Z.set("adaptiveOrigin",void 0)}},[Z]);let y=U0(()=>{L.current?.style.setProperty("animation","none"),L.current?.style.setProperty("transition","none"),j.current?.style.setProperty("display","none")}),S=U0((f)=>{if(L.current?.style.removeProperty("animation"),L.current?.style.removeProperty("transition"),j.current?.style.removeProperty("display"),f)R(f)}),O=U0(()=>{E.current?.abort();let f=new AbortController;E.current=f,M(()=>{A(null),R(null),q.current=null},f.signal)}),k=v2.useRef(null);J0(()=>{if(!z||!U)k.current=null},[z,U]),J0(()=>{if(B&&F&&B!==F&&k.current!==B&&q.current){A(q.current),I(!0);let f=X10(F,B);D(f),k.current=B}},[B,F]),J0(()=>{if(N==null)return;E.current?.abort(),I(!0),_.request(()=>{QE.flushSync(()=>{I(!1)}),O()})},[W,N,O,_]),J0(()=>{let f=L.current;if(!f)return;let w=m0(f).createElement("div");for(let i of Array.from(f.childNodes))w.appendChild(i.cloneNode(!0));q.current=w});let b=N!=null,h;if(!b)h=xZ.jsx("div",{"data-current":!0,ref:L,children:H},W);else h=xZ.jsxs(v2.Fragment,{children:[xZ.jsx("div",{"data-previous":!0,inert:L8(!0),ref:j,style:{...C?{[YQ]:`${C.width}px`,[FQ]:`${C.height}px`}:null,position:"absolute"},"data-ending-style":T?void 0:""},"previous"),xZ.jsx("div",{"data-current":!0,ref:L,"data-starting-style":T?"":void 0,children:H},W)]});J0(()=>{let f=j.current;if(!f||!N)return;f.replaceChildren(...Array.from(N.childNodes))},[N]),$E({popupElement:K,positionerElement:Y,mounted:U,content:G,onMeasureLayout:y,onMeasureLayoutComplete:S,side:J,direction:Q});let v={activationDirection:B10(V),transitioning:b};return{children:h,state:v}}function B10($){if(!$)return;return`${HE($.horizontal,5,"right","left")} ${HE($.vertical,5,"down","up")}`}function HE($,Z,J,H){if($>Z)return J;if($<-Z)return H;return""}function X10($,Z){let J=$.getBoundingClientRect(),H=Z.getBoundingClientRect(),Q={x:J.left+J.width/2,y:J.top+J.height/2},B={x:H.left+H.width/2,y:H.top+H.height/2};return{horizontal:B.x-Q.x,vertical:B.y-Q.y}}function z10($,Z){let[J,H]=v2.useState(0),Q=v2.useRef($),B=v2.useRef(Z),X=v2.useRef(!1);return J0(()=>{let z=Q.current,G=B.current,U=$!==z,K=Z!==G;if(U)H((Y)=>Y+1),X.current=!K;else if(X.current&&K)H((Y)=>Y+1),X.current=!1;Q.current=$,B.current=Z},[$,Z]),`${$??"current"}-${J}`}var XE=BE.forwardRef(function(Z,J){let{render:H,className:Q,style:B,children:X,...z}=Z,G=_8(),U=bZ(),K=G.useState("instantType"),{children:Y,state:F}=z6({store:G,side:U.side,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:K};return z0("div",Z,{state:W,ref:J,props:[z,{children:Y}],stateAttributesMapping:X6})});class OG extends l8{constructor(){super(Rw(),"Tooltip")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function zE(){return new OG}var TG=P(m(),1),G6=P(c(),1);function j8({portal:$,children:Z,...J}){let[H,Q]=TG.useState(void 0),B=TG.useCallback((X)=>{if(X)Q(X.closest("[data-applet]")?.getAttribute("data-applet")??void 0)},[]);return G6.jsxs(G6.Fragment,{children:[G6.jsx("span",{hidden:!0,ref:B}),G6.jsx($,{...J,children:G6.jsx("div",{"data-applet":H,className:"contents",children:Z})})]})}var Z$=P(c(),1);function CG({delay:$=100,...Z}){return Z$.jsx(P3.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function Q5({...$}){return Z$.jsx(P3.Root,{"data-slot":"tooltip",...$})}function B5({...$}){return Z$.jsx(P3.Trigger,{"data-slot":"tooltip-trigger",...$})}function X5({className:$,side:Z="top",sideOffset:J=6,align:H="center",alignOffset:Q=0,children:B,...X}){return Z$.jsx(j8,{portal:P3.Portal,children:Z$.jsx(P3.Positioner,{align:H,alignOffset:Q,side:Z,sideOffset:J,className:"isolate z-50",children:Z$.jsx(P3.Popup,{"data-slot":"tooltip-content",className:a0("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:B})})})}function wG({cooldownMs:$,windowMs:Z,maxPerWindow:J,maxKeys:H=256,now:Q=Date.now}){let B=new Map,X=0,z=0;return{admit(G){let U=Q(),K=B.get(G);if(K!==void 0&&U-K<$)return"cooldown";if(U-X>=Z)X=U,z=0;if(z>=J)return"window";if(z++,B.set(G,U),B.size>H)for(let Y of[...B.keys()].slice(0,Math.ceil(H/2)))B.delete(Y);return"ok"}}}var G10=wG({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function Z8($,Z){let J=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(G10.admit(J)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var U10=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function GE($){if(!$)return null;let Z=U10.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var UE=!1;function KE(){if(UE)return;UE=!0;let $=(Z,J,H)=>{let Q=J instanceof Error?J:null,B=Q?.stack??"",X=Z??GE(B);if(!X)return;Z8(X.workspaceId,{source:"window",kind:X.kind,name:X.name,message:Q?.message||H||String(J),...B?{stack:B}:{}})};window.addEventListener("error",(Z)=>$(GE(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function J$($,Z){return`${$}:${Z}`}function hZ($){return $==="running"}function WE($){return Object.values($).some(hZ)}function WQ($,Z,J){return hZ($[J$(Z,J)])}function SG($,Z){let J=`${Z}:`;return Object.entries($).some(([H,Q])=>H.startsWith(J)&&hZ(Q))}function qE($,Z,J){if(!J)return!1;let H=`${Z}:`,Q=J$(Z,J);return Object.entries($).some(([B,X])=>B.startsWith(H)&&B!==Q&&hZ(X))}function J8($,Z){return J$($,Z??"new")}function EG($,Z,J){for(let[H,Q]of Object.entries($)){if(!H.startsWith(`${Z}:`))continue;let B=Q.find((X)=>X.localId===J);if(B)return{key:H,attachment:B}}}var w1=YE()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,J,H)=>$((Q)=>({activity:{...Q.activity,[J$(Z,J)]:H}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((J)=>[J$(J.workspaceId,J.sessionId),J.activity]))})),setError:(Z,J,H)=>$((Q)=>({errors:{...Q.errors,[J$(Z,J)]:H}})),setPreview:(Z)=>$((J)=>({previews:{...J.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((J)=>{if(!(Z in J.previews))return J;let{[Z]:H,...Q}=J.previews;return{previews:Q}}),clearPreviewsForSession:(Z,J)=>$((H)=>{let Q={},B=!1;for(let[X,z]of Object.entries(H.previews))if(z.workspaceId===Z&&z.sessionId===J)B=!0;else Q[X]=z;return B?{previews:Q}:H}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,J)=>$((H)=>{let Q={},B=!1;for(let[X,z]of Object.entries(H.previews))if(J-z.updatedAt>Z)B=!0;else Q[X]=z;return B?{previews:Q}:H}),addAttachments:(Z,J,H)=>$((Q)=>{let B=J8(Z,J);return{attachments:{...Q.attachments,[B]:[...Q.attachments[B]??[],...H]}}}),updateAttachment:(Z,J,H)=>$((Q)=>{let B=EG(Q.attachments,Z,J);if(!B)return{};let{key:X,attachment:z}=B,G=Q.attachments[X];if(z.kind!=="text"&&z.previewUrl&&"previewUrl"in H&&H.previewUrl!==z.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...Q.attachments,[X]:G.map((U)=>U.localId===J&&U.kind!=="text"?{...U,...H}:U)}}}),removeAttachment:(Z,J)=>$((H)=>{let Q=EG(H.attachments,Z,J);if(!Q)return{};let{key:B,attachment:X}=Q,z=H.attachments[B];if(X.kind!=="text"&&X.previewUrl)URL.revokeObjectURL(X.previewUrl);return{attachments:{...H.attachments,[B]:z.filter((G)=>G.localId!==J)}}}),clearAttachments:(Z,J)=>$((H)=>{let Q=J8(Z,J);for(let X of H.attachments[Q]??[])if(X.kind!=="text"&&X.previewUrl)URL.revokeObjectURL(X.previewUrl);let B={...H.attachments};return delete B[Q],{attachments:B}}),renameSession:(Z,J,H)=>$((Q)=>{let B=J8(Z,J),X=J$(Z,H),z={...Q.activity},G={...Q.errors};if(B in z)z[X]=z[B],delete z[B];if(B in G)G[X]=G[B],delete G[B];let U=Q.previews,K=!1;for(let[F,W]of Object.entries(Q.previews))if(W.workspaceId===Z&&W.sessionId===J){if(!K)U={...Q.previews},K=!0;U[F]={...W,sessionId:H}}let Y=Q.attachments;if(B!==X&&Y[B])Y={...Y,[X]:[...Y[X]??[],...Y[B]]},delete Y[B];return{activity:z,errors:G,previews:U,attachments:Y}})}));function NE($,Z,J){if(!J)return{root:null,byParent:{}};let H=null,Q={};for(let B of Object.values($)){if(B.workspaceId!==Z||B.sessionId!==J)continue;if(B.parentToolUseId===null){if(!H||B.updatedAt>H.updatedAt)H=B}else{let X=Q[B.parentToolUseId];if(!X||B.updatedAt>X.updatedAt)Q[B.parentToolUseId]=B}}return{root:H,byParent:Q}}function g2($){return FE(w1,$)}var S0={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",$]};function qQ(){return{turns:[],notices:[]}}function RG($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let J=$.turns.findIndex((Q)=>Q.id===Z.turn.id);if(J>=0)return{...$,turns:$.turns.map((Q,B)=>B===J?Z.turn:Q)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let H=$.turns.findIndex((Q)=>Q.seq!==void 0&&Q.seq>Z.turn.seq);if(H<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,H),Z.turn,...$.turns.slice(H)]}}case"notice":{if($.notices.some((J)=>J.id===Z.notice.id))return{...$,notices:$.notices.map((J)=>J.id===Z.notice.id?Z.notice:J)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function VE($){let Z=qQ(),J=new Map,H=new Map,Q=-1/0;for(let B of $)switch(B.kind){case"snapshot":Z.snapshot=B.snapshot;break;case"turn":{let X=B.turn,z=X.seq,G=J.get(X.id);if(G!==void 0)Z.turns[G]=X;else{let U=z!==void 0&&z<Q?Z.turns.findIndex((K)=>K.seq!==void 0&&K.seq>z):-1;if(U<0)J.set(X.id,Z.turns.length),Z.turns.push(X);else{Z.turns.splice(U,0,X);for(let K=U;K<Z.turns.length;K++)J.set(Z.turns[K].id,K)}}if(z!==void 0)Q=Math.max(Q,z);break}case"notice":H.set(B.notice.id,B.notice);break;case"result":Z.result=B.result;break}return Z.notices=[...H.values()],Z}var rV=new WeakMap;function AE($,Z,J,H){for(let Q of rV.get($)??[])if(Q.workspaceId===Z&&Q.sessionId===J)Q.events.push(H)}function DE($,Z){return AN({queryKey:S0.events($,Z),queryFn:async({client:J,signal:H})=>{let Q=rV.get(J)??new Set;rV.set(J,Q);let B={workspaceId:$,sessionId:Z,events:[]};Q.add(B);try{let X=await q1(`/api/workspaces/${$}/sessions/${Z}/events`,{signal:H},"Couldn’t load chat");return VE([...X,...B.events])}finally{Q.delete(B)}},staleTime:1/0,gcTime:300000})}var f4=P(m(),1);function NQ($){return $==="agent"||$==="overview"||$==="scratchpad"||typeof $==="string"&&/^(views|view-builders)\/[a-zA-Z0-9_-]+$/.test($)}var vZ=($)=>`views/${$}`,VQ=($)=>$.startsWith("views/")?$.slice(6):null,H$=($)=>`view-builders/${$}`,Q$=($)=>$.startsWith("view-builders/")?$.slice(14):null;function x9($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function aV($){if(typeof $!=="string"||!$.startsWith("moi:/")||$.startsWith("moi://"))throw Error("Expected a workspace address such as moi:/views/events?eventId=123");let Z=$.slice(5).split(/[?#]/,1)[0];if($.includes("#")||/[\s\\]/.test(Z))throw Error("Invalid workspace address");let J=_3(Z);if(!J||J==="agent"||J.startsWith("view-builders/"))throw Error(`Unsupported workspace destination: ${Z}`);let H=$.indexOf("?"),Q=H<0?"":AQ($.slice(H+1));return{tab:J,search:Q}}function AQ($){let Z=new URLSearchParams($);Z.sort();let J=Z.toString();return J?`?${J}`:""}function LE($){let Z=new URLSearchParams($);return Object.fromEntries(Array.from(Z.keys(),(J)=>[J,Z.get(J)]))}function _3($){try{let Z=decodeURIComponent($);return NQ(Z)?Z:null}catch{return null}}function IG($){let Z=/^(view|view-builder):(.+)$/.exec($);return Z?_3(`${Z[1]}s/${Z[2]}`):null}function o8($,Z=""){return`${Z.replace(/\/$/,"")}/workspace/${encodeURIComponent($)}`}function gZ($,Z,J=""){return`${o8($,J)}/${Z.tab}${Z.search}`}function ME($,Z){return gZ($,{tab:Z,search:""})}function B$($,Z){if($.startsWith("moi:/files/")){let H=$.slice(11),Q=H.search(/[?#]/),B=Q<0?H:H.slice(0,Q),X=Q<0?"":H.slice(Q),z=B.split("/").map((G)=>{let U=decodeURIComponent(G);if(!U||U==="."||U===".."||/[/\\\0]/.test(U))throw Error("Invalid workspace file path");return encodeURIComponent(U)});return`${Z.apiBase}/files/${z.join("/")}${X}`}if($.startsWith("moi:")){let{tab:H,search:Q}=aV($);return Z.workspacePath?`${Z.workspacePath}/${H}${Q}`:""}let J=new URL($);if(J.protocol!=="https:"&&J.protocol!=="http:")throw Error("Unsupported URL");return J.href}var U6={status:"disconnected",connectionId:null,connections:[],users:[],error:null},K10=[],PE=($,Z)=>JSON.stringify([$,Z]);class oV{state=U6;usersState=U6;channels=new Map;listeners=new Set;registrations=new Map;location=null;send=()=>{};getSnapshot=()=>this.state;getUsersSnapshot=()=>this.usersState;getPresenceSnapshot=($,Z)=>this.channels.get(PE($,Z))??K10;subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};setSender($){this.send=$}connecting(){this.publish({status:"connecting",error:null})}disconnect($){this.publish({...U6,error:$??null})}setLocation($){if(JSON.stringify(this.location)===JSON.stringify($))return;if(this.location=$,this.publish({},!0),this.state.status==="connected")this.send({type:"location",location:$})}getLocation(){return this.location}setPresence($){let Z=this.registrations.get($.registrationId);if(Z&&JSON.stringify(Z)===JSON.stringify($))return;if(this.registrations.set($.registrationId,$),this.state.status==="connected")this.send({type:"presence:set",...$})}deletePresence($){if(this.registrations.delete($),this.state.status==="connected")this.send({type:"presence:delete",registrationId:$})}receive($){switch($.type){case"welcome":this.publish({status:"connected",connectionId:$.connectionId,connections:$.connections,users:$.users,error:null});for(let Z of this.registrations.values())this.send({type:"presence:set",...Z});break;case"connections":this.publish({connections:$.connections,users:$.users});break;case"error":this.publish({error:$.message});break;case"pong":break}}publish($,Z=!1){this.state={...this.state,...$};let J={...this.state,connections:this.state.connections.map((Q)=>({...Q,presence:[]}))};if(Z||JSON.stringify(J)!==JSON.stringify(this.usersState))this.usersState=J;let H=new Map;if(this.location?.status==="active")for(let Q of this.state.connections){if(Q.connectionId===this.state.connectionId||Q.location?.page!==this.location.page||Q.location.status!=="active")continue;for(let B of Q.presence){let X=PE(B.appletId,B.channel),z=H.get(X)??[];z.push({registrationId:B.registrationId,connectionId:Q.connectionId,userId:Q.userId,value:B.value}),H.set(X,z)}}this.channels=new Map([...H].map(([Q,B])=>{let X=this.channels.get(Q);return[Q,X&&JSON.stringify(X)===JSON.stringify(B)?X:B]})),this.listeners.forEach((Q)=>Q())}}var K6=()=>{},TE=[],CE={workspaceId:"",enabled:!1,start:()=>K6,getSnapshot:()=>U6,getUsersSnapshot:()=>U6,getPresenceSnapshot:()=>TE,subscribe:()=>K6,getCurrentUser:j3,subscribeCurrentUser:bG,getWorkspaceDirectory:()=>{return},subscribeWorkspaceUsers:()=>K6,getLocation:()=>null,setLocation:K6,setPresence:K6,deletePresence:K6};class nV{workspaceId;enabled;store=new oV;socket=null;retry;heartbeat;unsubscribeCurrentUser;presenceTimer;queuedPresence=new Map;stopped=!0;attempts=0;lastMessageAt=0;userId=j3()?.id;constructor($,Z=!0){this.workspaceId=$;this.enabled=Z;this.store.setSender((J)=>this.send(J))}getSnapshot=()=>this.enabled?this.store.getSnapshot():U6;getUsersSnapshot=()=>this.enabled?this.store.getUsersSnapshot():U6;getPresenceSnapshot=($,Z)=>this.enabled?this.store.getPresenceSnapshot($,Z):TE;subscribe=($)=>this.enabled?this.store.subscribe($):K6;getCurrentUser=j3;subscribeCurrentUser=bG;getWorkspaceDirectory=()=>jE(this.workspaceId);subscribeWorkspaceUsers=($)=>OE(this.workspaceId,$);getLocation=()=>this.enabled?this.store.getLocation():null;setLocation=($)=>{this.store.setLocation($)};setPresence=($)=>{if(this.enabled)this.store.setPresence($)};deletePresence=($)=>{if(this.enabled)this.store.deletePresence($)};start(){if(!this.enabled)return K6;if(!this.stopped)return()=>{};return this.stopped=!1,this.userId=j3()?.id,this.unsubscribeCurrentUser=bG(()=>{let $=j3();if($?.id!==this.userId)if(this.userId=$?.id,this.store.disconnect(),clearTimeout(this.retry),this.socket)this.socket.close();else this.connect();else if($)this.send({type:"profile",profile:$})}),this.connect(),()=>this.stop()}wantsConnection(){return!this.stopped&&j3()!==void 0}connect(){if(!this.wantsConnection()){this.store.disconnect();return}if(this.socket)return;clearTimeout(this.retry),this.store.connecting();let $=new WebSocket(kG(`/api/workspaces/${encodeURIComponent(this.workspaceId)}/collab/ws`));this.socket=$,$.onopen=()=>{if($!==this.socket)return;this.lastMessageAt=Date.now();let Z=j3();if(!Z){$.close();return}this.heartbeat=setInterval(()=>{if(Date.now()-this.lastMessageAt>45000)$.close();else this.rawSend({type:"ping"})},15000),this.rawSend({type:"join",version:_E,profile:Z,location:this.store.getLocation()})},$.onmessage=(Z)=>{if($!==this.socket)return;this.lastMessageAt=Date.now();try{let J=JSON.parse(String(Z.data));if(J.type==="welcome")this.attempts=0;let H=J.type==="error"&&this.store.getSnapshot().status!=="connected";if(this.store.receive(J),H)$.close()}catch{this.store.disconnect("The collaboration connection returned an invalid message."),$.close()}},$.onerror=()=>$.close(),$.onclose=()=>{if($!==this.socket)return;if(clearInterval(this.heartbeat),clearTimeout(this.presenceTimer),this.presenceTimer=void 0,this.queuedPresence.clear(),this.socket=null,this.store.disconnect(),this.wantsConnection()){let Z=Math.min(500*2**this.attempts++,1e4);this.retry=setTimeout(()=>this.connect(),Z)}}}send($){if(!j3()&&($.type==="location"||$.type==="presence:set"||$.type==="presence:delete"))return;if($.type==="presence:set"){if(this.queuedPresence.set($.registrationId,$),!this.presenceTimer)this.presenceTimer=setTimeout(()=>{this.presenceTimer=void 0;for(let Z of this.queuedPresence.values())this.rawSend(Z);this.queuedPresence.clear()},50);return}if($.type==="presence:delete")this.queuedPresence.delete($.registrationId);this.rawSend($)}rawSend($){if(this.socket?.readyState===WebSocket.OPEN)try{this.socket.send(JSON.stringify($))}catch{this.socket.close()}}stop(){this.stopped=!0,this.unsubscribeCurrentUser?.(),clearTimeout(this.retry),clearTimeout(this.presenceTimer),this.presenceTimer=void 0,clearInterval(this.heartbeat),this.queuedPresence.clear(),this.socket?.close(),this.socket=null,this.store.disconnect()}}var $A=P(c(),1),wE=f4.createContext(CE),EE=f4.createContext(null);function sV($,Z,J=""){let H=o8(Z,J)+"/",Q=$.startsWith(H)?$.slice(H.length):"";return _3(Q)??IG(Q)??(Q||"overview")}function tV({workspaceId:$,enabled:Z,children:J}){let H=f4.useMemo(()=>new nV($,Z),[$,Z]),Q=i2(),B=k7(Q),{base:X}=Q;return f4.useEffect(()=>H.start(),[H]),f4.useEffect(()=>{let z=()=>H.setLocation({page:sV(window.location.pathname,$,X),status:document.visibilityState==="hidden"?"away":"active"});return z(),document.addEventListener("visibilitychange",z),()=>document.removeEventListener("visibilitychange",z)},[X,H,B,$]),$A.jsx(wE,{value:H,children:J})}function DQ({appletId:$,active:Z=!0,children:J}){let{enabled:H}=O3(),Q=f4.useMemo(()=>({active:H&&Z,appletId:$}),[H,Z,$]);return $A.jsx(EE,{value:Q,children:J})}function O3(){return f4.useContext(wE)}function eV(){return f4.useContext(EE)}function M4(){let $=O3(),Z=f4.useSyncExternalStore($.subscribeCurrentUser,$.getCurrentUser,$.getCurrentUser);return $.enabled&&Z!==void 0}var HU=P(m(),1);var T3={};C5(T3,{createHandle:()=>DS,Viewport:()=>AS,Trigger:()=>uE,Title:()=>YS,Root:()=>xE,Positioner:()=>eE,Portal:()=>dE,Popup:()=>BS,Handle:()=>iG,Description:()=>WS,Close:()=>NS,Backdrop:()=>US,Arrow:()=>zS});var LQ=P(m(),1);var yG=P(m(),1),ZA=yG.createContext(void 0);function d5($){let Z=yG.useContext(ZA);if(Z===void 0&&!$)throw Error(y0(47));return Z}var xG=P(m(),1),SE=P(e4(),1);var RE={...S9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,openMethod:($)=>$.openMethod,openChangeReason:($)=>$.openChangeReason,modal:($)=>$.modal,focusManagerModal:($)=>$.focusManagerModal,stickIfOpen:($)=>$.stickIfOpen,titleElementId:($)=>$.titleElementId,descriptionElementId:($)=>$.descriptionElementId,openOnHover:($)=>$.openOnHover,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class JA extends b2{constructor($,Z,J){let H=new O2;super(bE($,H,Z,J),kE(H),RE)}setOpen=($,Z)=>{let J=Z.reason===K0.triggerHover,H=Z.reason===K0.triggerPress&&Z.event.detail===0,Q=!$&&(Z.reason===K0.escapeKey||Z.reason==null),B=BQ(Z),X=this.select("activeTriggerId");if(!$&&Z.reason===K0.closePress&&Z.trigger==null&&X!=null)Z.trigger=this.context.triggerElements.getById(X)??this.select("activeTriggerElement")??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange($,Z);let z=()=>{let U=s7(this.state,$,Z.trigger,B());U.openChangeReason=Z.reason,this.update(U)};if(J)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Iz,()=>{this.set("stickIfOpen",!1)}),SE.flushSync(z);else z();let G;if(H)G="click";else if(Q)G="dismiss";else if(Z.reason===K0.focusOut)G="focus";this.set("instantType",G)}}function IE(){let $=new O2,Z=new a8(Object.freeze(bE(void 0,$)),Object.freeze(kE($)),RE);return Object.assign(Z,{setOpen:X1})}function bE($,Z,J,H=!1){let Q={...E9(Z,J,H),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...$};if(Q.open&&$?.mounted===void 0)Q.mounted=!0;return Q}function kE($){return{popupRef:xG.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:xG.createRef(),beforeContentFocusGuardRef:xG.createRef(),stickIfOpenTimeout:new c5,triggerElements:$}}var Y6=P(c(),1),yE=g8(function({props:Z}){let{children:J,open:H,defaultOpen:Q=!1,onOpenChange:B,onOpenChangeComplete:X,modal:z=!1,handle:G,triggerId:U,defaultTriggerId:K=null}=Z,Y=Y10(G,{modal:z,open:Q,openProp:H,activeTriggerId:K,triggerIdProp:U});Y.useControlledProp("openProp",H),Y.useControlledProp("triggerIdProp",U);let F=Y.useState("open"),W=Y.useState("mounted"),q=Y.useState("payload");Y.useContextCallback("onOpenChange",B),Y.useContextCallback("onOpenChangeComplete",X),sz(Y,F),T9(Y);let{forceUnmount:N}=C9(F,Y,()=>{Y.update({stickIfOpen:!0,openChangeReason:null})});Y.useSyncedValues({modal:z}),LQ.useEffect(()=>{if(!F)Y.context.stickIfOpenTimeout.clear()},[Y,F]),LQ.useImperativeHandle(Z.actionsRef,()=>({unmount:N,close:()=>Y.setOpen(!1,R0(K0.imperativeAction))}),[N,Y]);let A=F||W;return Y6.jsxs(ZA.Provider,{value:Y,children:[G&&Y6.jsx(j9,{handle:G,store:Y}),A&&Y6.jsx(F10,{store:Y,modal:z}),typeof J==="function"?J({payload:q}):J]})});function xE($){if(d5(!0))return Y6.jsx(yE,{props:$});return Y6.jsx(a7,{children:Y6.jsx(yE,{props:$})})}function Y10($,Z){let J=Q6((H,Q)=>new JA(Z,H,Q));return LQ.useEffect(()=>J.context.stickIfOpenTimeout.disposeEffect(),[J]),J}function F10({store:$,modal:Z}){let J=$.useState("floatingRootContext"),H=d8(J,{outsidePressEvent:{mouse:Z==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),Q=H.reference,B=H.floating;return w9($,{activeTriggerProps:Q,inactiveTriggerProps:Q,popupProps:B}),null}var jQ=P(m(),1);var hE=300;var vE=P(m(),1),HA=P(e4(),1);function hG($,Z){let J=vE.useRef(null);function H(B){HA.flushSync(()=>{$.setOpen(!1,R0(K0.focusOut,B.nativeEvent,B.currentTarget))}),XT(J.current)?.focus()}function Q(B){let X=$.select("positionerElement");if(X&&q3(B,X))$.context.beforeContentFocusGuardRef.current?.focus();else{HA.flushSync(()=>{$.setOpen(!1,R0(K0.focusOut,B.nativeEvent,B.currentTarget))});let z=BT($.context.triggerFocusTargetRef.current||Z.current);while(z!==null&&b0(X,z)){let G=z;if(z=_Z(z),z===G)break}z?.focus()}}return{preFocusGuardRef:J,handlePreFocusGuardFocus:H,handleFocusTargetFocus:Q}}var PQ=P(m(),1);var MQ=P(m(),1);function gE($){let Z=MQ.useRef(""),J=MQ.useCallback((Q)=>{if(Q.defaultPrevented)return;Z.current=Q.pointerType,$(Q,Q.pointerType)},[$]);return{onClick:MQ.useCallback((Q)=>{if(Q.detail===0){$(Q,"keyboard");return}if("pointerType"in Q)$(Q,Q.pointerType);else $(Q,Z.current);Z.current=""},[$]),onPointerDown:J}}var fE=P(m(),1);function h9($,Z){let J=fE.useRef($),H=U0(Z);J0(()=>{if(J.current!==$)H(J.current);J.current=$},[$,H])}function _Q($,Z){let J=U0((B,X)=>{if(!(typeof $==="function"?$():$))Z(X||(r1.os.ios?"touch":""))}),{onClick:H,onPointerDown:Q}=gE(J);return PQ.useMemo(()=>({onClick:H,onPointerDown:Q}),[H,Q])}function mE($){let[Z,J]=PQ.useState(null),H=_Q($,J);return h9($,(Q)=>{if(Q&&!$)J(null)}),PQ.useMemo(()=>({openMethod:Z,triggerProps:H}),[Z,H])}var fZ=P(c(),1),uE=V9(function(Z,J){let{render:H,className:Q,style:B,disabled:X=!1,nativeButton:z=!0,handle:G,payload:U,openOnHover:K=!1,delay:Y=hE,closeDelay:F=0,id:W,...q}=Z,N=d5(!0),V=R9(G)??N;if(!V)throw Error(y0(74));let D=t0(W),L=V.useState("isTriggerActive",D),j=V.useState("floatingRootContext"),M=V.useState("isOpenedByTrigger",D),_=V.useState("triggerPopupId",D),E=jQ.useRef(null),{registerTrigger:C,isMountedByThisTrigger:R}=O9(D,E,V,{payload:U,disabled:X,openOnHover:K,closeDelay:F}),T=V.useState("openChangeReason"),I=V.useState("stickIfOpen"),y=V.useState("openMethod"),S=V.useState("focusManagerModal"),O=i8(j,{enabled:!X&&K&&(y!=="touch"||T!==K0.triggerPress),mouseOnly:!0,move:!1,handleClose:r8(),restMs:Y,delay:{close:F},triggerElementRef:E,isActiveTrigger:L,isClosing:()=>V.select("transitionStatus")==="ending"}),k=D3(j,{stickIfOpen:I}),b=_Q(()=>V.select("open"),(d)=>{V.set("openMethod",d)}),h=V.useState("triggerProps",R),{getButtonProps:v,buttonRef:f}=T5({disabled:X,native:z}),w={open(d){if(d&&T===K0.triggerPress)return rH.open(d);return A9.open(d)}},{preFocusGuardRef:i,handlePreFocusGuardFocus:r,handleFocusTargetFocus:x}=hG(V,E),s=z0("button",Z,{state:{disabled:X,open:M},ref:[f,J,C,E],props:[k.reference,O,h,b,{[jZ]:"",id:D,"aria-haspopup":"dialog","aria-expanded":M,"aria-controls":_},q,v],stateAttributesMapping:w}),p=fZ.jsx(jQ.Fragment,{children:s},D);if(R&&!S)return fZ.jsxs(jQ.Fragment,{children:[fZ.jsx(x4,{ref:i,onFocus:r}),p,fZ.jsx(x4,{ref:V.context.triggerFocusTargetRef,onFocus:x})]});return p});var cE=P(m(),1);var vG=P(m(),1),QA=vG.createContext(void 0);function pE(){let $=vG.useContext(QA);if($===void 0)throw Error(y0(45));return $}var BA=P(c(),1),dE=cE.forwardRef(function(Z,J){let{keepMounted:H=!1,...Q}=Z;if(!(d5().useState("mounted")||H))return null;return BA.jsx(QA.Provider,{value:H,children:BA.jsx(l7,{ref:J,...Q})})});var pG=P(m(),1);var gG=P(m(),1),XA=gG.createContext(void 0);function mZ(){let $=gG.useContext(XA);if(!$)throw Error(y0(46));return $}var lE=P(m(),1),iE=P(c(),1),uZ=lE.forwardRef(function(Z,J){let{cutout:H,...Q}=Z,B;if(H){let X=H.getBoundingClientRect();B=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${X.left}px ${X.top}px,${X.left}px ${X.bottom}px,${X.right}px ${X.bottom}px,${X.right}px ${X.top}px,${X.left}px ${X.top}px)`}return iE.jsx("div",{ref:J,role:"presentation","data-base-ui-inert":"",...Q,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:B}})});var tE=P(m(),1);var rE={},aE={},oE="";function fG($,Z){return zQ($)?$:Z}function nE($,Z,J){return/hidden|clip/.test($.getComputedStyle(fG(Z,J)).overflowY)}function W10($){if(typeof document>"u")return!1;let Z=m0($);return I1(Z).innerWidth-Z.documentElement.clientWidth>0}function q10($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let J=m0($),H=J.documentElement,Q=J.body,B=fG(H,Q),X=B.style.overflowY,z=H.style.scrollbarGutter;H.style.scrollbarGutter="stable",B.style.overflowY="scroll";let G=B.offsetWidth;B.style.overflowY="hidden";let U=B.offsetWidth;return B.style.overflowY=X,H.style.scrollbarGutter=z,G===U}function N10($){let Z=m0($),J=Z.documentElement,H=Z.body,Q=fG(J,H),B={overflowY:Q.style.overflowY,overflowX:Q.style.overflowX};return Object.assign(Q.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(Q.style,B)}}function V10($){let Z=m0($),J=Z.documentElement,H=Z.body,Q=I1(J),B=0,X=0,z=!1,G=k2.create();if(r1.engine.webkit&&(Q.visualViewport?.scale??1)!==1)return()=>{};function U(){let W=Q.getComputedStyle(J),q=Q.getComputedStyle(H),V=(W.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";B=J.scrollTop,X=J.scrollLeft,rE={scrollbarGutter:J.style.scrollbarGutter,overflowY:J.style.overflowY,overflowX:J.style.overflowX},oE=J.style.scrollBehavior,aE={position:H.style.position,height:H.style.height,width:H.style.width,boxSizing:H.style.boxSizing,overflowY:H.style.overflowY,overflowX:H.style.overflowX,scrollBehavior:H.style.scrollBehavior};let D=J.scrollHeight>J.clientHeight,L=J.scrollWidth>J.clientWidth,j=W.overflowY==="scroll"||q.overflowY==="scroll",M=W.overflowX==="scroll"||q.overflowX==="scroll",_=Math.max(0,Q.innerWidth-H.clientWidth),E=Math.max(0,Q.innerHeight-H.clientHeight),C=parseFloat(q.marginTop)+parseFloat(q.marginBottom),R=parseFloat(q.marginLeft)+parseFloat(q.marginRight),T=fG(J,H);if(z=q10($),z){J.style.scrollbarGutter=V,T.style.overflowY="hidden",T.style.overflowX="hidden";return}if(Object.assign(J.style,{scrollbarGutter:V,overflowY:"hidden",overflowX:"hidden"}),D||j)J.style.overflowY="scroll";if(L||M)J.style.overflowX="scroll";Object.assign(H.style,{position:"relative",height:C||E?`calc(100dvh - ${C+E}px)`:"100dvh",width:R||_?`calc(100vw - ${R+_}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),H.scrollTop=B,H.scrollLeft=X,J.setAttribute("data-base-ui-scroll-locked",""),J.style.scrollBehavior="unset"}function K(){if(Object.assign(J.style,rE),Object.assign(H.style,aE),!z)J.scrollTop=B,J.scrollLeft=X,J.removeAttribute("data-base-ui-scroll-locked"),J.style.scrollBehavior=oE}function Y(){K(),G.request(U)}U();let F=n0(Q,"resize",Y);return()=>{if(G.cancel(),K(),typeof Q.removeEventListener==="function")F()}}class sE{lockCount=0;restore=null;timeoutLock=c5.create();timeoutUnlock=c5.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 Z=m0($),J=Z.documentElement,H=Z.body,Q=I1(J);if(nE(Q,J,H)){let X=new Q.MutationObserver(()=>{if(nE(Q,J,H))return;X.disconnect(),this.restore=null,this.lock($)}),z={attributes:!0};X.observe(J,z),X.observe(H,z),this.restore=()=>X.disconnect();return}let B=r1.os.ios||!W10($);this.restore=B?N10($):V10($)}}var A10=new sE;function mG($=!0,Z=null){J0(()=>{if(!$)return;return A10.acquire(Z)},[$,Z])}var D10=20;function uG($,Z,J,H){let[Q,B]=tE.useState(!1);J0(()=>{if(!$||!Z||J==null){B(!1);return}let X=m0(J).documentElement.clientWidth,z=J.offsetWidth;B(X>0&&z>0&&z>=X-D10)},[$,Z,J]),mG($&&(!Z||Q),H)}var OQ=P(c(),1),eE=pG.forwardRef(function(Z,J){let{render:H,className:Q,style:B,anchor:X,positionMethod:z,side:G,align:U,sideOffset:K,alignOffset:Y,collisionBoundary:F="clipping-ancestors",collisionPadding:W,arrowPadding:q,sticky:N,disableAnchorTracking:A=!1,collisionAvoidance:V=P9,...D}=Z,L=d5(),j=pE(),M=A3(),_=L.useState("floatingRootContext"),E=L.useState("mounted"),C=L.useState("open"),R=L.useState("openChangeReason"),T=L.useState("activeTriggerElement"),I=L.useState("modal"),y=L.useState("openMethod"),S=L.useState("positionerElement"),O=L.useState("instantType"),k=L.useState("transitionStatus"),b=L.useState("adaptiveOrigin"),h=pG.useRef(null),v=h4(S),f=b9({anchor:X,floatingRootContext:_,positionMethod:z,mounted:E,side:G,sideOffset:K,align:U,alignOffset:Y,arrowPadding:q,collisionBoundary:F,collisionPadding:W,sticky:N,disableAnchorTracking:A,keepMounted:j,nodeId:M,collisionAvoidance:V,adaptiveOrigin:b}),w=_.useState("domReferenceElement");J0(()=>{let s=w,p=h.current;if(s)h.current=s;if(p&&s&&s!==p){L.set("instantType",void 0);let d=new AbortController;return v(()=>{L.set("instantType","trigger-change")},d.signal),()=>{d.abort()}}return},[w,v,L]);let i=I===!0&&R!==K0.triggerHover;uG(C&&i,y==="touch",S,T);let r=L.useStateSetter("positionerElement"),x={open:C,side:f.side,align:f.align,anchorHidden:f.anchorHidden,instant:O},l=y9(Z,x,{styles:f.positionerStyles,transitionStatus:k,props:D,refs:[J,r],hidden:!E,inert:!C});return OQ.jsxs(XA.Provider,{value:f,children:[E&&i&&OQ.jsx(uZ,{inert:L8(!C),cutout:T}),OQ.jsx(r7,{id:M,children:l})]})});var QS=P(m(),1);var pZ="ArrowUp",cZ="ArrowDown",dZ="ArrowLeft",lZ="ArrowRight",iZ="Home",rZ="End",zA="PageUp",GA="PageDown",n8=new Set([pZ,cZ,dZ,lZ,iZ,rZ]),L10="Shift",ZS=[L10,"Control","Alt","Meta"];function M10($){return P1($)&&$.tagName==="INPUT"}function UA($){if(M10($)&&$.selectionStart!=null)return!0;if(P1($)&&$.tagName==="TEXTAREA")return!0;return!1}function KA($,Z,J,H){if(!$||!Z||!Z.scrollTo)return;let{scrollLeft:Q,scrollTop:B}=$,X=$.clientWidth<$.scrollWidth,z=$.clientHeight<$.scrollHeight;if(X&&H!=="vertical"){let G=$S($,Z,"left"),U=cG($),K=cG(Z);if(J==="ltr"){if(G+Z.offsetWidth+K.scrollMarginRight>$.scrollLeft+$.clientWidth-U.scrollPaddingRight)Q=G+Z.offsetWidth+K.scrollMarginRight-$.clientWidth+U.scrollPaddingRight;else if(G-K.scrollMarginLeft<$.scrollLeft+U.scrollPaddingLeft)Q=G-K.scrollMarginLeft-U.scrollPaddingLeft}if(J==="rtl"){if(G-K.scrollMarginLeft<$.scrollLeft+U.scrollPaddingLeft)Q=G-K.scrollMarginLeft-U.scrollPaddingLeft;else if(G+Z.offsetWidth+K.scrollMarginRight>$.scrollLeft+$.clientWidth-U.scrollPaddingRight)Q=G+Z.offsetWidth+K.scrollMarginRight-$.clientWidth+U.scrollPaddingRight}}if(z&&H!=="horizontal"){let G=$S($,Z,"top"),U=cG($),K=cG(Z);if(G-K.scrollMarginTop<$.scrollTop+U.scrollPaddingTop)B=G-K.scrollMarginTop-U.scrollPaddingTop;else if(G+Z.offsetHeight+K.scrollMarginBottom>$.scrollTop+$.clientHeight-U.scrollPaddingBottom)B=G+Z.offsetHeight+K.scrollMarginBottom-$.clientHeight+U.scrollPaddingBottom}$.scrollTo({left:Q,top:B,behavior:"auto"})}function $S($,Z,J){let H=J==="left"?"offsetLeft":"offsetTop",Q=0;while(Z.offsetParent){if(Q+=Z[H],Z.offsetParent===$)break;Z=Z.offsetParent}return Q}function cG($){let Z=getComputedStyle($);return{scrollMarginTop:parseFloat(Z.scrollMarginTop)||0,scrollMarginRight:parseFloat(Z.scrollMarginRight)||0,scrollMarginBottom:parseFloat(Z.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(Z.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(Z.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(Z.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(Z.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(Z.scrollPaddingLeft)||0}}var dG=P(m(),1),P10=dG.createContext(void 0);function lG($){let Z=dG.useContext(P10);if(Z===void 0&&!$)throw Error(y0(69));return Z}var F6=P(m(),1);var YA=F6.createContext(void 0);function JS(){let[$,Z]=F6.useState(0),J=U0(()=>{return Z((Q)=>Q+1),()=>{Z((Q)=>Math.max(0,Q-1))}});return{context:F6.useMemo(()=>({register:J}),[J]),hasClosePart:$>0}}function HS(){let $=F6.useContext(YA);J0(()=>{return $?.register()},[$])}var FA=P(c(),1),BS=QS.forwardRef(function(Z,J){let{render:H,className:Q,style:B,initialFocus:X,finalFocus:z,...G}=Z,U=d5(),K=mZ(),Y=lG(!0)!=null,{context:F,hasClosePart:W}=JS(),q=U.useState("open"),N=U.useState("openMethod"),A=U.useState("instantType"),V=U.useState("transitionStatus"),D=U.useState("popupProps"),L=U.useState("titleElementId"),j=U.useState("descriptionElementId"),M=U.useState("modal"),_=U.useState("mounted"),E=U.useState("openChangeReason"),C=U.useState("activeTriggerElement"),R=U.useState("floatingRootContext"),T=R.useState("floatingId"),I=U.useState("disabled"),y=U.useState("openOnHover"),S=U.useState("closeDelay");q5({open:q,ref:U.context.popupRef,onComplete(){if(q)U.context.onOpenChangeComplete?.(!0)}}),L3(R,{enabled:y&&!I,closeDelay:S});let O=X===void 0?oz(U.context.popupRef):X,k=M!==!1&&W;U.useSyncedValue("focusManagerModal",k);let b=U.useStateSetter("popupElement"),h={open:q,side:K.side,align:K.align,instant:A,transitionStatus:V},v=z0("div",Z,{state:h,ref:[J,U.context.popupRef,b],props:[D,{id:T,role:"dialog",..._9,"aria-labelledby":L,"aria-describedby":j,onKeyDown(f){if(Y&&n8.has(f.key))f.stopPropagation()}},k9(V),G],stateAttributesMapping:a2});return FA.jsx(o7,{context:R,openInteractionType:N,modal:k,disabled:!_||E===K0.triggerHover,initialFocus:O,returnFocus:z,restoreFocus:"popup",previousFocusableElement:P1(C)?C:void 0,nextFocusableElement:U.context.triggerFocusTargetRef,beforeContentFocusGuardRef:U.context.beforeContentFocusGuardRef,children:FA.jsx(YA.Provider,{value:F,children:v})})});var XS=P(m(),1);var zS=XS.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,G=d5().useState("open"),{arrowRef:U,side:K,align:Y,arrowUncentered:F,arrowStyles:W}=mZ();return z0("div",Z,{state:{open:G,side:K,align:Y,uncentered:F},ref:[J,U],props:[{style:W,"aria-hidden":!0},X],stateAttributesMapping:s4})});var GS=P(m(),1);var US=GS.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=d5(),G=z.useState("open"),U=z.useState("mounted"),K=z.useState("transitionStatus"),Y=z.useState("openChangeReason");return z0("div",Z,{state:{open:G,transitionStatus:K},ref:J,props:[{role:"presentation",hidden:!U,style:{pointerEvents:Y===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X],stateAttributesMapping:a2})});var KS=P(m(),1);var YS=KS.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=d5(),G=t0(X.id);return z.useSyncedValueWithCleanup("titleElementId",G),z0("h2",Z,{ref:J,props:[{id:G},X]})});var FS=P(m(),1);var WS=FS.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=d5(),G=t0(X.id);return z.useSyncedValueWithCleanup("descriptionElementId",G),z0("p",Z,{ref:J,props:[{id:G},X]})});var qS=P(m(),1);var NS=qS.forwardRef(function(Z,J){let{render:H,className:Q,style:B,disabled:X=!1,nativeButton:z=!0,...G}=Z,{buttonRef:U,getButtonProps:K}=T5({disabled:X,focusableWhenDisabled:!1,native:z}),Y=d5();return HS(),z0("button",Z,{ref:[J,U],props:[{onClick(W){Y.setOpen(!1,R0(K0.closePress,W.nativeEvent))}},G,K]})});var VS=P(m(),1);var AS=VS.forwardRef(function(Z,J){let{render:H,className:Q,style:B,children:X,...z}=Z,G=d5(),{side:U}=mZ(),K=G.useState("instantType"),{children:Y,state:F}=z6({store:G,side:U,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:K};return z0("div",Z,{state:W,ref:J,props:[z,{children:Y}],stateAttributesMapping:X6})});class iG extends l8{constructor(){super(IE(),"Popover")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function DS(){return new iG}var W6=P(c(),1);function q6({...$}){return W6.jsx(T3.Root,{"data-slot":"popover",...$})}function N6({...$}){return W6.jsx(T3.Trigger,{"data-slot":"popover-trigger",...$})}function V6({className:$,align:Z="center",alignOffset:J=0,side:H="bottom",sideOffset:Q=4,keepMounted:B,...X}){return W6.jsx(j8,{portal:T3.Portal,keepMounted:B,children:W6.jsx(T3.Positioner,{align:Z,alignOffset:J,side:H,sideOffset:Q,className:"isolate z-50",children:W6.jsx(T3.Popup,{"data-slot":"popover-content",className:a0("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 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",$),...X})})})}function LS({className:$,...Z}){return W6.jsx("div",{"data-slot":"popover-header",className:a0("flex flex-col gap-0.5 text-sm",$),...Z})}function MS({className:$,...Z}){return W6.jsx(T3.Title,{"data-slot":"popover-title",className:a0("font-medium",$),...Z})}var aG=P(m(),1),X$=P(c(),1),_10=($,Z)=>`mo-root${$==="always"?" mo-always":""}${Z?" mo-expr":""}`;function j10($){let Z=Math.round($.num("motion.blink",3500,6500)),J=Math.round($.num("motion.saccade",4200,7600)),H=$.num("motion.lookX",1,2.2),Q=$.num("motion.lookY",0.8,1.7),B=(X)=>Math.round(X*100)/100;return{phase:Math.round($.num("motion.phase",0,2800)),bob:Math.round($.num("motion.bob",0,3400)),blink:Z,blinkPhase:Math.round($.num("motion.blinkPhase",0,Z)),saccade:J,saccadePhase:Math.round($.num("motion.saccadePhase",0,J)),lookX:B(H)*($.bool("motion.lookXFlip")?-1:1),lookY:B(Q)*($.bool("motion.lookYFlip")?-1:1),lookMX:B(H),lookMY:B(Q)}}function O10($){let Z=(H)=>`${-H}ms`,J=j10($);return{"--mo-phase":Z(J.phase),"--mo-bob-phase":Z(J.bob),"--mo-blink":`${J.blink}ms`,"--mo-blink-phase":Z(J.blinkPhase),"--mo-look-x":String(J.lookX),"--mo-look-mx":String(J.lookMX),"--mo-look-y":String(J.lookY),"--mo-look-my":String(J.lookMY),"--mo-saccade":`${J.saccade}ms`,"--mo-saccade-phase":Z(J.saccadePhase)}}function WA({l:$,c:Z,h:J}){let H=J*Math.PI/180,Q=Z*Math.cos(H),B=Z*Math.sin(H),X=$+0.3963377774*Q+0.2158037573*B,z=$-0.1055613458*Q-0.0638541728*B,G=$-0.0894841775*Q-1.291485548*B,U=X*X*X,K=z*z*z,Y=G*G*G;return[4.0767416621*U-3.3077115913*K+0.2309699292*Y,-1.2684380046*U+2.6097574011*K-0.3413193965*Y,-0.0041960863*U-0.7034186147*K+1.707614701*Y]}var PS=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function TS($){let Z=WA($);if(!PS(Z)){let J=0,H=$.c;for(let Q=0;Q<12;Q++){let B=(J+H)/2;if(PS(WA({...$,c:B})))J=B;else H=B}Z=WA({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function _S($){let[Z,J,H]=TS($);return 0.2126*Z+0.7152*J+0.0722*H}function rG($,Z){let J=_S($),H=_S(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function CS($,Z,J){if(rG($,Z)>=J)return $;let H=$.l>=Z.l?1:-1;for(let X of[H,-H]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),rG(z,Z)>=J)return z;if(z.l===0||z.l===1)break}}let Q={...$,l:0,c:0},B={...$,l:1,c:0};return rG(Q,Z)>=rG(B,Z)?Q:B}function T10($){return"#"+TS($).map((Z)=>{let J=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(J*255).toString(16).padStart(2,"0")}).join("")}var jS=[[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}]],C10=($)=>jS.find(([Z])=>$<Z)?.[1]??jS[0][1],w10={l:0.145,c:0,h:0},E10=1.5,S10=($,Z)=>{let J=C10(Z),H=CS({l:J.l,c:J.c,h:$},w10,E10);return{bg:{l:0.965,c:0.01,h:$},head:H,eye:H.l>=0.5?{l:0.17,c:0.02,h:$}:{l:0.97,c:0.012,h:$}}},R10=[["head","bg",1.25],["eye","head",4.5]];function I10($,Z=!0,J=0){let H=S10($,J);if(Z)for(let[Q,B,X]of R10)H[Q]=CS(H[Q],H[B],X);return H}function b10($,Z=!0,J=0){let H=I10($,Z,J),Q={};for(let B in H)Q[B]=T10(H[B]);return Q}var A5=($)=>{let Z=Math.round($*100)/100;return Object.is(Z,-0)?"0":String(Z)};function qA({cx:$,cy:Z,rx:J,ry:H,n:Q=4,rot:B=0}){let X=Math.min(1,(8*Math.pow(2,-1/Q)-4)/3),z=J,G=H,U=z*X,K=G*X,Y=[[z,0],[z,K],[U,G],[0,G],[-U,G],[-z,K],[-z,0],[-z,-K],[-U,-G],[0,-G],[U,-G],[z,-K],[z,0]],F=B*Math.PI/180,W=Math.cos(F),q=Math.sin(F),N=(V)=>{let[D,L]=Y[V];return`${A5($+D*W-L*q)} ${A5(Z+D*q+L*W)}`},A=`M${N(0)}`;for(let V=1;V<13;V+=3)A+=`C${N(V)} ${N(V+1)} ${N(V+2)}`;return A+"Z"}function k10($,Z,J,H,Q,B=0){let X=Q.length,z=B*Math.PI/180,G=Q.map((Y,F)=>{let W=z+2*Math.PI*F/X;return[$+J*Y*Math.cos(W),Z+H*Y*Math.sin(W)]}),U=(Y)=>G[(Y%X+X)%X],K=`M${A5(U(0)[0])} ${A5(U(0)[1])}`;for(let Y=0;Y<X;Y++){let[F,W]=U(Y-1),[q,N]=U(Y),[A,V]=U(Y+1),[D,L]=U(Y+2);K+=`C${A5(q+(A-F)/6)} ${A5(N+(V-W)/6)} ${A5(A-(D-q)/6)} ${A5(V-(L-N)/6)} ${A5(A)} ${A5(V)}`}return K+"Z"}function y10({cx:$,cy:Z,rx:J,ry:H,sides:Q,round:B=0.3,rot:X=0}){let z=B>0?B<1?B/2:0.5:0,G=X*Math.PI/180-Math.PI/2,U=Array.from({length:Q},(W,q)=>{let N=G+2*Math.PI*q/Q;return[$+J*Math.cos(N),Z+H*Math.sin(N)]}),K=(W)=>U[(W%Q+Q)%Q],Y=(W,q)=>{let[N,A]=K(W),[V,D]=K(q);return`${A5(N+(V-N)*z)} ${A5(A+(D-A)*z)}`},F=`M${Y(0,-1)}`;for(let W=0;W<Q;W++){let[q,N]=K(W);if(F+=`Q${A5(q)} ${A5(N)} ${Y(W,W+1)}`,z<0.5)F+=`L${Y(W+1,W)}`}return F+"Z"}function x10($,Z,J,H){let Q=A5($-J),B=A5($+J);return`M${Q} ${A5(Z-H)}H${B}V${A5(Z+H)}H${Q}Z`}function h10($,Z,J,H,Q){let B=Math.max(1.05,Q),X=J*Math.sqrt(1-1/(B*B)),z=Z-H/B,G=Z-B*H,U=X*0.14,K=z+0.86*(G-z);return`M${A5($-X)} ${A5(z)}L${A5($-U)} ${A5(K)}Q${A5($)} ${A5(G)} ${A5($+U)} ${A5(K)}L${A5($+X)} ${A5(z)}Z`}function NA($,Z){for(let J=0;J<Z.length;J++)$=Math.imul($^Z[J],3432918353),$=$<<13|$>>>19;return $}function v10($){return $=Math.imul($^$>>>16,2246822507),$=Math.imul($^$>>>13,3266489909),($^$>>>16)>>>0}var wS=new TextEncoder;function g10($){return $.normalize("NFC").trim().toLowerCase()}function f10($,Z=!0){let J=Z?g10($):$;return NA(1779033703^J.length,wS.encode(J))}function OS($,Z){return v10(NA(NA($,Uint8Array.of(255)),wS.encode(Z)))/4294967296}function m10($,Z=!0,J){let H=f10($,Z),Q=(B)=>{let X=J?.[B],z=Array.isArray(X)?X[Math.floor(OS(H,B)*X.length)]:X;return z===void 0?OS(H,B):z>0?z<1?z:0.999999:0};return Q.num=(B,X,z)=>X+Q(B)*(z-X),Q.int=(B,X,z)=>X+Math.floor(Q(B)*(z-X+1)),Q.pick=(B,X)=>X[Math.floor(Q(B)*X.length)],Q.bool=(B,X=0.5)=>Q(B)<X,Q.jitter=(B,X)=>(Q(B)*2-1)*X,Q}function ES($,Z,J){let H=Z.expression;if(J||!H)return{l:$,wrap:""};return H.bake($,H.p)}var u10=($,Z)=>Z?.tint?Z.tint($,Z.p):$,SS=($,Z)=>Z?`<g transform="${Z}">${$}</g>`:$,p10=($)=>$.replace(/[&<>]/g,(Z)=>Z==="&"?"&":Z==="<"?"<":">");function RS($,Z){let J=m10($,Z.normalize??!0,Z.traits);return{t:J,palette:{...b10(Z.hue??J.num("hue",0,360),Z.contrast??!0,Z.tone??J("tone")),...Z.palette}}}var c10=($)=>$.title?`<title>${p10($.title)}</title>`:"";function IS($,Z,J){let H=Z.background??$.background;if(H===!1)return;return{d:H==="square"?"M0 0H100V100H0Z":qA({cx:50,cy:50,rx:50,ry:50,n:H==="circle"?2:6}),fill:J.bg}}var d10=($)=>$?`<path d="${$.d}" fill="${$.fill}"/>`:"";function l10($){return(Z,J={})=>{let{t:H,palette:Q}=RS(Z,J),B=u10(Q,J.expression),X=J.size?` width="${J.size}" height="${J.size}"`:"",z=ES($.layout(H),J),G=c10(J)+d10(IS($,J,B))+SS($.render(z.l,B),z.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${X}>${G}</svg>`}}function i10($){return(Z,J={},H)=>{let{t:Q,palette:B}=RS(Z,J),X=H?.(Q,B),z=ES($.layout(Q),J,X);return{cls:X?.cls,bg:IS($,J,B),inner:SS($.render(z.l,B,!!X),z.wrap),vars:X?.vars}}}var r10=($,Z,J)=>{let H=Z.rx,Q=$.num("eye.rx",0.075,0.105)*H,B=$.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)*H,U=Q*Math.max(1,X),K=Q*B*Math.max(1,X*z),Y=U+H*0.03+G,F=$.jitter("gaze.x",0.09)*J.rx,W=$.num("gaze.y",-0.2,0.08)*J.ry,q=$.jitter("eye.dy",0.04)*J.ry,N=Math.hypot(U,K),A=Math.hypot((Math.abs(F)+Y+N)/J.rx,(Math.abs(W)+Math.abs(q)+N)/J.ry),V=A>0.9?0.9/A:1,D=Q*V,L=D*B,j=Y*V,M=Math.max(0,Math.min(1,G/K)),_=Math.min(12,Math.asin(M)*180/Math.PI),E=$.num("eye.lean",-1,1)*_,C=Math.max(-12,Math.min(12,E+$.jitter("eye.lean2",3.5))),R=J.cx+F*V,T=J.cy+W*V;return[{cx:R-j,cy:T,rx:D,ry:L,n:$.num("eye.n",3.5,6),rot:E},{cx:R+j,cy:T+q*V,rx:D*X,ry:L*X*z,n:$.num("eye.n",3.5,6),rot:C}]};function a10($,Z){let J=(B)=>($.find(([,X])=>B<X)??$[$.length-1])[0];function H(B){let X=J(B("shape")),z=B.num("body.r",31,38)*X.core,G={cx:50+B.jitter("body.x",1.5),cy:50+B.jitter("body.y",1.5),rx:z,ry:z*B.num("body.ratio",0.92,1.08),n:B.num("body.n",1.9,2.5),rot:0,radii:Array.from({length:B.int("body.pts",6,8)},(Y,F)=>1+B.jitter(`body.r${F}`,0.16))};X.body?.(B,G);let U=X.face?.(G)??G,K={petals:[],extra:[]};return X.decorate?.(B,G,K),{shape:X.name,draw:X.path,body:G,face:U,petals:K.petals,extra:K.extra,eyes:Z(B,G,U)}}function Q(B,X,z){let G=(Y)=>Math.round(Y*100)/100,U=(Y,F)=>{let W=`<path d="${qA(Y)}"/>`;return z?`<g class="mo-eye" style="--mo-wrap:${F?1:-1};--mo-lean:${G(Y.rot)};transform-origin:${G(Y.cx)}px ${G(Y.cy)}px">${W}</g>`:W},K=`<g fill="${X.head}">`+B.petals.map((Y)=>`<circle cx="${G(Y.cx)}" cy="${G(Y.cy)}" r="${G(Y.r)}"/>`).join("")+B.extra.map((Y)=>`<path d="${Y}"/>`).join("")+`<path d="${B.draw?B.draw(B.body):qA(B.body)}"/></g><g fill="${X.eye}"${z?' class="mo-eyes"':""}>`+B.eyes.map(U).join("")+"</g>";return z?`<g class="mo-breathe"><g class="mo-bob">${K}</g></g>`:K}return{layout:H,render:Q,background:!1}}var bS=($)=>y10($),kS=($)=>k10($.cx,$.cy,$.rx,$.ry,$.radii,$.rot),VA=($)=>(Z)=>({cx:Z.cx,cy:Z.cy,rx:Z.rx*$,ry:Z.ry*$}),yS=($)=>VA(Math.min(...$.radii)*0.95)($),o10=($)=>VA(0.84)($),n10={name:"round",core:1},s10={name:"organic",core:0.98,path:kS,face:yS},t10={name:"boxy",core:0.86,body:($,Z)=>{Z.n=$.num("body.n",3.4,6),Z.rot=$.num("body.rot",-20,20)}},e10={name:"capsule",core:1.02,body:($,Z)=>{Z.ry*=$.num("capsule.squat",0.55,0.68)},face:VA(0.94),decorate:($,Z,J)=>{for(let H of[-1,1])J.petals.push({cx:Z.cx+H*(Z.rx-Z.ry),cy:Z.cy,r:Z.ry})},path:($)=>x10($.cx,$.cy,$.rx-$.ry,$.ry)},$50={name:"nub",core:0.88,decorate:($,Z,J)=>{let H=$.int("nub.n",1,2);for(let Q=0;Q<H;Q++){let B=$.num(`nub.a${Q}`,0,2*Math.PI);J.petals.push({cx:Z.cx+Math.cos(B)*Z.rx*0.88,cy:Z.cy+Math.sin(B)*Z.rx*0.88,r:Z.rx*$.num(`nub.r${Q}`,0.24,0.4)})}}},Z50={name:"cloud",core:0.78,face:yS,path:kS,decorate:($,Z,J)=>{let H=$.int("cloud.n",4,6);for(let Q=0;Q<H;Q++){let B=Math.PI+Math.PI*(Q+0.5)/H;J.petals.push({cx:Z.cx+Math.cos(B)*Z.rx*0.8,cy:Z.cy+Math.sin(B)*Z.rx*0.5,r:Z.rx*$.num(`cloud.r${Q}`,0.44,0.62)})}}},J50={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,J)=>{J.extra.push(h10(Z.cx,Z.cy,Z.rx,Z.ry,$.num("droplet.tip",1.4,1.65)))}},H50={name:"hexagon",core:1.05,path:bS,face:o10,body:($,Z)=>{Z.sides=6,Z.rot=$.num("body.rot",-12,12),Z.round=$.num("poly.round",0.24,0.5)}},Q50={name:"sun",core:0.7,decorate:($,Z,J)=>{let H=$.int("sun.n",6,9),Q=Z.rx*$.num("sun.dist",1,1.08),B=Z.rx*$.num("sun.r",0.2,0.26),X=$.num("sun.rot",0,2*Math.PI);for(let z=0;z<H;z++){let G=X+2*Math.PI*z/H;J.petals.push({cx:Z.cx+Math.cos(G)*Q,cy:Z.cy+Math.sin(G)*Q,r:B})}}},B50={name:"triangle",core:1.15,path:bS,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})},X50=[[n10,0.22],[s10,0.48],[t10,0.6],[e10,0.7],[$50,0.79],[Z50,0.86],[J50,0.915],[H50,0.95],[Q50,0.98],[B50,1]],xS=a10(X50,r10),z50=l10(xS),G50=($,Z)=>(J,H)=>{let Q=Z?Z.vars(Z.p):{},B=Z?.tint?Z.tint(H,Z.p):H;return{cls:_10($,!!Object.keys(Q).length||!!Z?.tint),vars:{...O10(J),"--mo-head":B.head,"--mo-eye":B.eye,...Q}}};function U50($,Z={}){return i10(xS)($,Z,Z.animate&&G50(Z.animate,Z.expression))}function K50($,Z){return"data:image/svg+xml,"+z50($,Z).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(J)=>"%"+J.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function hS({name:$,size:Z,background:J,palette:H,hue:Q,tone:B,normalize:X,contrast:z,title:G,animate:U,expression:K,traits:Y,...F}){let W={size:Z,background:J,palette:H,hue:Q,tone:B,normalize:X,contrast:z,title:G,expression:K,traits:Y},q=JSON.stringify([$,W,U]),N=aG.useMemo(()=>U?"":K50($,W),[q]),A=aG.useMemo(()=>U?U50($,{...W,animate:U}):null,[q]),V=aG.useMemo(()=>({__html:A?.inner??""}),[A?.inner]);if(A){let{style:j,...M}=F;return X$.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:{...A.vars,...j},...M,children:[G?X$.jsx("title",{children:G}):null,A.bg?X$.jsx("path",{d:A.bg.d,fill:A.bg.fill}):null,X$.jsx("g",{className:A.cls,dangerouslySetInnerHTML:V})]})}let{alt:D,...L}=F;return X$.jsx("img",{src:N,width:Z,height:Z,alt:D??G??"",...L})}var oG=hS;var sZ={};C5(sZ,{Root:()=>gS,Image:()=>uS,Fallback:()=>pS});var oZ=P(m(),1);var nG=P(m(),1),AA=nG.createContext(void 0);function sG(){let $=nG.useContext(AA);if($===void 0)throw Error(y0(13));return $}var aZ={imageLoadingStatus:()=>null};var vS=P(c(),1),gS=oZ.forwardRef(function(Z,J){let{className:H,render:Q,style:B,...X}=Z,[z,G]=oZ.useState("idle"),U={imageLoadingStatus:z},K=oZ.useMemo(()=>({imageLoadingStatus:z,setImageLoadingStatus:G}),[z,G]),Y=z0("span",Z,{state:U,ref:J,props:X,stateAttributesMapping:aZ});return vS.jsx(AA.Provider,{value:K,children:Y})});var TQ=P(m(),1);var fS=P(m(),1);function mS($,{referrerPolicy:Z,crossOrigin:J,sizes:H,srcSet:Q},B){let X=fS.useState("idle"),z=X[1];return J0(()=>{if(!B)return X1;if(!$&&!Q)return z("error"),X1;let G=!0,U=new window.Image,K=(Y)=>()=>{if(!G)return;z(Y)};if(z("loading"),U.onload=K("loaded"),U.onerror=K("error"),Z)U.referrerPolicy=Z;if(U.crossOrigin=J??null,H)U.sizes=H;if(Q)U.srcset=Q;if($)U.src=$;if(U.complete)z(U.naturalWidth>0?"loaded":"error");return()=>{G=!1}},[B,$,Q,H,J,Z,z]),X}var Y50={...aZ,...Q2},uS=TQ.forwardRef(function(Z,J){let{className:H,render:Q,onLoadingStatusChange:B,keepMounted:X=!1,style:z,sizes:G,srcSet:U,src:K,...Y}=Z,{setImageLoadingStatus:F}=sG(),[W,q]=mS(K,Z,!X),N=W==="loaded",{mounted:A,transitionStatus:V,setMounted:D}=j2(N),L=TQ.useRef(null),j=TQ.useRef(!0);J0(()=>{if(!X)return;let I=j.current;j.current=!1;let y=L.current;if(!y)return;if(!y.complete){q("loading");return}let S=y.naturalWidth>0?"loaded":"error";if(q(S),S==="loaded"&&I)D(!0)},[X,K,U,G,Y.crossOrigin,Y.referrerPolicy,Q,q,D]);let M=X?{"data-loading":W==="loading"?"":void 0,"data-error":W==="error"?"":void 0,"aria-hidden":W!=="loaded"||void 0,onLoad(){q("loaded")},onError(){q("error")}}:void 0,_=U0((I)=>{B?.(I),F(I)});J0(()=>{if(W!=="idle")_(W)},[W,_]),J0(()=>{return()=>F("idle")},[F]),q5({enabled:!N,open:N,ref:L,onComplete(){if(!N)D(!1)}});let E={imageLoadingStatus:W,transitionStatus:X&&V==="ending"?void 0:V},C=X||A,R={};if(G!==void 0)R.sizes=G;if(U!==void 0)R.srcSet=U;if(K!==void 0)R.src=K;let T=z0("img",Z,{state:E,ref:[J,L],props:[M,Y,R],stateAttributesMapping:Y50,enabled:C});if(!C)return null;return T});var nZ=P(m(),1);var pS=nZ.forwardRef(function(Z,J){let{className:H,render:Q,delay:B=0,style:X,...z}=Z,{imageLoadingStatus:G}=sG(),[U,K]=nZ.useState(B===0),Y=d1();return nZ.useEffect(()=>{if(B>0)Y.start(B,()=>K(!0));else K(!0);return Y.clear},[Y,B]),z0("span",Z,{state:{imageLoadingStatus:G},ref:J,props:z,stateAttributesMapping:aZ,enabled:G!=="loaded"&&(B===0||U)})});var z$=P(c(),1);function cS({className:$,size:Z="default",...J}){return z$.jsx(sZ.Root,{"data-slot":"avatar","data-size":Z,className:a0("group/avatar relative isolate flex shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=default]:size-8 data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5 dark:after:mix-blend-lighten","[--avatar-badge-size:--spacing(2.5)] data-[size=sm]:[--avatar-badge-size:--spacing(2)] data-[size=xs]:[--avatar-badge-size:--spacing(1.5)]","has-[>[data-slot=avatar-badge]]:[&::after,&>:where([data-slot=avatar-image],[data-slot=avatar-fallback])]:mask-[radial-gradient(circle_at_calc(100%_-_var(--avatar-badge-size)/2)_calc(100%_-_var(--avatar-badge-size)/2),transparent_calc(var(--avatar-badge-size)/2_+_2px),black_calc(var(--avatar-badge-size)/2_+_2.5px))]",$),...J})}function dS({className:$,...Z}){return z$.jsx(sZ.Image,{"data-slot":"avatar-image",className:a0("aspect-square size-full rounded-full object-cover",$),...Z})}function lS({className:$,...Z}){return z$.jsx(sZ.Fallback,{"data-slot":"avatar-fallback",className:a0("flex size-full items-center justify-center overflow-hidden rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs group-data-[size=xs]/avatar:text-xs",$),...Z})}function iS({className:$,...Z}){return z$.jsx("span",{"data-slot":"avatar-badge",className:a0("absolute right-0 bottom-0 size-(--avatar-badge-size) rounded-full bg-primary select-none",$),...Z})}function rS({className:$,...Z}){return z$.jsx("div",{"data-slot":"avatar-group",className:a0("group/avatar-group flex items-center -space-x-2 [--avatar-radius:--spacing(4)]","*:data-[size=lg]:[--avatar-radius:--spacing(5)] *:data-[size=sm]:[--avatar-radius:--spacing(3)] *:data-[size=xs]:[--avatar-radius:--spacing(2.5)]","[&>[data-slot=avatar]:not(:last-child)]:mask-[radial-gradient(circle_at_calc(100%_+_var(--avatar-radius)_-_--spacing(2))_50%,transparent_calc(var(--avatar-radius)_+_2px),black_calc(var(--avatar-radius)_+_2.5px))]",$),...Z})}function aS({className:$,size:Z="default",...J}){return z$.jsx("div",{"data-slot":"avatar-group-count","data-size":Z,className:a0("relative flex shrink-0 items-center justify-center rounded-full bg-accent text-sm text-muted-foreground [&>svg]:size-4","data-[size=default]:size-8 data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5","data-[size=sm]:text-[11px] data-[size=xs]:text-[11px]","data-[size=lg]:[&>svg]:size-5 data-[size=sm]:[&>svg]:size-3 data-[size=xs]:[&>svg]:size-3",$),...J})}var b5=P(m(),1);function A6($){return $.name?.trim()||$.email?.trim()||$.id}function oS($,Z){let J=$.filter((H)=>H.userId===Z);return J.some((H)=>H.location?.status==="active")?"active":J.length?"away":"offline"}function nS($,Z,J){if(J!==void 0)return J;let H=new Map($.map((Q)=>[Q.id,Q]));if(Z)H.set(Z.id,Z);return[...H.values()]}function tZ($,Z){let J=$.users.find((H)=>H.id===Z);return J?{...J,status:oS($.connections,Z)}:void 0}function sS($,Z,J,{scope:H="page",status:Q}={}){let B=[],X=new Set($.connections.filter((z)=>z.userId!==Z&&(H==="workspace"||J!==null&&z.location?.page===J.page)).map((z)=>z.userId));for(let z of X){let G=tZ($,z);if(G&&(!Q||G.status===Q))B.push(G)}return B}function tS($,Z){return[...Z.users].sort((H,Q)=>Number(Q.id===Z.currentUser?.id)-Number(H.id===Z.currentUser?.id)).map((H)=>{let Q=new Set;for(let X of $){if(X.userId!==H.id||X.connectionId===Z.connectionId)continue;if(X.location)Q.add(X.location.page)}let B=H.id===Z.currentUser?.id;if(B&&Z.page)Q.add(Z.page);return{profile:H,self:B,pages:[...Q],status:oS($,H.id)}})}function eS($,Z,J=()=>!0){let H=!1,Q=()=>{if(!H)return;H=!1,$.deletePresence(Z.registrationId)};return{publish(B,X){if(!X||!J(B)){Q();return}H=!0,$.setPresence({...Z,value:B})},clear:Q}}function DA(){let $=O3();return b5.useSyncExternalStore($.subscribe,$.getUsersSnapshot,$.getUsersSnapshot)}function LA(){let $=O3();return b5.useSyncExternalStore($.subscribeWorkspaceUsers,$.getWorkspaceDirectory,$.getWorkspaceDirectory)}function eZ(){let $=O3(),Z=DA(),J=b5.useSyncExternalStore($.subscribeCurrentUser,$.getCurrentUser,$.getCurrentUser),H=LA(),Q=b5.useMemo(()=>nS(Z.users,J,H?.status==="loading"?[]:H?.users),[Z.users,J,H]);return{state:Z,self:J,users:Q,engine:$}}function D6($){let{state:Z,users:J}=eZ();return b5.useMemo(()=>tZ({...Z,users:J},$),[Z,J,$])}function $R($){let{state:Z,users:J}=eZ();return $.map((H)=>tZ({...Z,users:J},H))}function tG({status:$}={}){let{state:Z,users:J}=eZ();return b5.useMemo(()=>J.map((H)=>tZ({...Z,users:J},H.id)).filter((H)=>!$||H.status===$),[Z,J,$])}function eG(){let{state:$,self:Z,users:J}=eZ();return b5.useMemo(()=>Z?tZ({...$,users:J},Z.id):void 0,[$,Z,J])}function ZR($={}){let{state:Z,self:J,users:H,engine:Q}=eZ(),{scope:B,status:X}=$;return b5.useMemo(()=>sS({...Z,users:H},J?.id,Q.getLocation(),{scope:B,status:X}),[Z,J,H,Q,B,X])}var $J={custom:($)=>`custom:${$}`,cursor:($)=>`cursor:${$}`,target:($)=>`field:${$}`};function JR($){return CQ($J.custom($))}function CQ($){let{users:Z,engine:J}=eZ(),H=eV(),Q=H?.appletId??"",B=b5.useCallback(()=>J.getPresenceSnapshot(Q,$),[J,Q,$]),X=b5.useSyncExternalStore(J.subscribe,B,B);return b5.useMemo(()=>{if(!H?.active)return[];let z=new Set(Z.map((G)=>G.id));return X.filter((G)=>z.has(G.userId)).map((G)=>({connectionId:G.connectionId,userId:G.userId,value:G.value}))},[X,Z,H])}function wQ($,Z,J){let H=O3(),Q=eV(),[B]=b5.useState(()=>crypto.randomUUID()),X=b5.useRef(Z),z=b5.useRef(!1),G=Q?.appletId??"",U=b5.useMemo(()=>eS(H,{registrationId:B,appletId:G,channel:$},J),[H,B,G,$,J]),K=b5.useCallback(()=>{U.publish(X.current,Q?.active===!0&&document.visibilityState!=="hidden")},[Q,U]);return b5.useLayoutEffect(()=>{if(!Q?.active)return;return z.current=!0,K(),document.addEventListener("visibilitychange",K),()=>{z.current=!1,document.removeEventListener("visibilitychange",K),U.clear()}},[Q,K,U]),b5.useCallback((Y)=>{if(X.current=Y,z.current)K()},[K])}function F50($,Z,J){let H=wQ($,Z,J);b5.useLayoutEffect(()=>H(Z),[H,Z])}function HR($,Z){F50($J.custom($),Z)}var L6=P(c(),1);function M6({id:$,size:Z="default",showStatusBadge:J,className:H}){let Q=D6($),B=Q?A6(Q):"Unknown user";return L6.jsxs(cS,{size:Z,"aria-label":B,"data-collab-color":Q?.color??"unknown",className:H,children:[Q?.avatar&&L6.jsx(dS,{src:Q.avatar,alt:""}),L6.jsx(lS,{children:Q?L6.jsx(oG,{name:$,animate:"hover",background:"circle",traits:{shape:0,"body.r":1},palette:{bg:"var(--collab)",head:"var(--collab)",eye:"var(--collab-foreground)"}}):L6.jsx($U,{size:Z==="xs"||Z==="sm"?12:16,stroke:1.75})}),J&&Q?.status==="active"&&L6.jsx(iS,{className:"bg-success"})]})}var v9=P(c(),1),W50="Unknown user";function ZU({id:$,size:Z="default",showStatusBadge:J,showYouLabel:H,description:Q,className:B}){let X=D6($),z=eG(),G=X?A6(X):W50,U=X!==void 0&&X.id===z?.id;return v9.jsxs("span",{className:B0("inline-flex min-w-0 items-center gap-2",B),children:[v9.jsx(M6,{id:$,size:Z,showStatusBadge:J}),v9.jsxs("span",{className:B0("flex min-w-0 flex-1 text-sm",Z==="xs"?"items-baseline":"flex-col"),children:[v9.jsxs("span",{className:"flex min-w-0 items-baseline gap-1",children:[v9.jsx("span",{className:B0("truncate",!X&&"text-muted-foreground"),children:G}),H&&U&&v9.jsx("span",{className:"shrink-0 text-muted-foreground",children:"(You)"})]}),Q&&v9.jsxs("span",{className:B0("truncate text-muted-foreground",Z==="sm"&&"text-xs leading-tight"),children:[Z==="xs"&&v9.jsx("span",{"aria-hidden":"true",className:"whitespace-pre",children:" · "}),Q]})]})]})}var EQ=P(c(),1);function JU({ids:$,max:Z=3,size:J="sm",className:H}){let Q=[...new Set($)],B=Q.slice(0,Z),X=Q.length-B.length;return EQ.jsxs(rS,{className:H,"aria-label":`${Q.length} users`,children:[B.map((z)=>EQ.jsx(M6,{id:z,size:J},z)),X>0&&EQ.jsxs(aS,{size:J,"aria-label":`${X} more`,children:["+",X]})]})}var n5=P(c(),1),QR={active:0,away:1,offline:2};function MA({workspaceId:$,describeTab:Z,onOpenTab:J}){let H=M4(),Q=O3(),B=DA(),X=tG(),z=LA(),G=HU.useSyncExternalStore(Q.subscribeCurrentUser,Q.getCurrentUser,Q.getCurrentUser),U=i2(),K=sV(k7(U),$,U.base),Y=tS(B.connections,{currentUser:G,connectionId:B.connectionId,users:X,page:K}),F=Y.filter((N)=>N.self||N.status!=="offline").map((N)=>N.profile.id),[W,q]=HU.useState(!1);if(!H)return null;return n5.jsxs(q6,{open:W,onOpenChange:q,children:[n5.jsxs(N6,{render:n5.jsx(j0,{variant:"ghost",size:"sm","aria-label":"Users in this workspace",className:"gap-0.5 rounded-full pr-1 pl-1 data-popup-open:bg-accent"}),children:[n5.jsx(JU,{ids:F,size:"xs",max:4}),n5.jsx(ZJ,{stroke:2.5,className:"size-3! text-muted-foreground"})]}),n5.jsxs(V6,{align:"end",className:"max-w-64 p-1",children:[n5.jsx(MS,{className:"sr-only",children:"Users in this workspace"}),n5.jsx(q50,{users:Y,page:K,describeTab:Z,onOpenTab:(N)=>{q(!1),J(N)}}),z?.status==="loading"&&n5.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:"Loading workspace users…"}),Y.length===0&&z?.status!=="loading"&&n5.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No workspace users to show."})]})]})}function q50({users:$,page:Z,describeTab:J,onOpenTab:H}){let Q=$.toSorted((B,X)=>QR[B.status]-QR[X.status]||Number(X.self)-Number(B.self));return n5.jsx("ul",{className:"flex max-h-80 scroll-fade flex-col overflow-y-auto",children:Q.map((B)=>n5.jsx(N50,{user:B,page:Z,describeTab:J,onOpenTab:H},B.profile.id))})}function N50({user:$,page:Z,describeTab:J,onOpenTab:H}){let Q=$.pages.map((F)=>{let W=_3(F);return{tab:W,info:W?J(W):null}}),B=$.self||$.status==="offline"?void 0:Q.find(({tab:F,info:W})=>F!==null&&W!==null&&F!==Z),X=B?.tab,z=[...new Set(Q.map(({tab:F,info:W})=>W?.label??F??"Another tab"))].join(", "),G=$.status==="offline"?"Offline":$.status==="away"?z?`${z} · Away`:"Away":z||"Another tab",U=$.status==="offline"?void 0:Q[0]?.info?.Icon,K=n5.jsx(ZU,{id:$.profile.id,className:"flex-1",size:"sm",showYouLabel:!0,description:n5.jsxs("span",{className:"flex items-center gap-1 text-xs",children:[U&&n5.jsx(U,{size:12,stroke:1.75,className:"shrink-0"}),n5.jsx("span",{className:"truncate",children:G})]})}),Y="flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left";return n5.jsx("li",{children:X?n5.jsx("button",{type:"button",title:`Go to ${B?.info?.label}`,className:B0("flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left","cursor-pointer outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50"),onClick:()=>H(X),children:K}):n5.jsx("div",{className:"flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left",children:K})})}var G$=P(m(),1);function BR($){return z0($.defaultTagName??"div",$,$)}var V50=JJ("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-sm border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-accent [a]:hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function QU({className:$,variant:Z="default",render:J,...H}){return BR({defaultTagName:"span",props:X2({className:a0(V50({variant:Z}),$)},H),render:J,state:{slot:"badge",variant:Z}})}var P6=P(m(),1);function BU(...$){if(!$.length||$.some((Z)=>typeof Z!=="string"||!Z.trim()))throw Error("PresenceGroup, PresenceFrame, and PresenceAvatars require a nonempty id.");return $.map((Z)=>encodeURIComponent(Z)).join("/")}var PA=($)=>$!==!1&&$!==null,HJ=P6.createContext([]);function XU($){return BU(...P6.useContext(HJ),$)}function zU($,Z){let J=Z===void 0,H=P6.useRef(null),Q=$J.target($),B=CQ(Q),X=wQ(Q,!1,PA),z=(U,K)=>K!==null&&U instanceof Element&&U.closest("[data-presence-target]")===K;P6.useLayoutEffect(()=>{X(Z??z(document.activeElement,H.current))},[$,Z,X]);let G=new Map;for(let U of B)if(U.value===!0&&!G.has(U.userId))G.set(U.userId,{id:U.userId,connectionId:U.connectionId});return{users:[...G.values()],props:{ref:H,"data-collab-target":$,"data-presence-target":J?$:void 0,onFocusCapture:J?(U)=>X(z(U.target,U.currentTarget)):void 0,onBlurCapture:J?(U)=>X(z(U.relatedTarget,U.currentTarget)):void 0}}}var s8=P(c(),1);function A50($){if(!$||typeof $!=="object"||Array.isArray($))return null;if(typeof $.x!=="number"||typeof $.y!=="number")return null;if(!Number.isFinite($.x)||!Number.isFinite($.y))return null;return{x:$.x,y:$.y,...typeof $.target==="string"?{target:$.target}:{},...typeof $.targetX==="number"&&Number.isFinite($.targetX)?{targetX:$.targetX}:{},...typeof $.targetY==="number"&&Number.isFinite($.targetY)?{targetY:$.targetY}:{}}}function zR({id:$="default",children:Z,className:J}){let H=G$.useRef(null),Q=G$.useRef(null);G$.useLayoutEffect(()=>{let K=H.current,Y=Q.current;if(!K||!Y)return;let F=()=>{Y.style.transform=`translate(${K.scrollLeft}px, ${K.scrollTop}px)`};return F(),K.addEventListener("scroll",F),()=>K.removeEventListener("scroll",F)},[]);let B=$J.cursor($),X=CQ(B),z=wQ(B,null,PA),G=new Map;for(let{connectionId:K,userId:Y,value:F}of X){let W=A50(F);if(W)G.set(K,{id:Y,point:W})}let U=(K)=>{if(K.pointerType==="touch")return;let Y=H.current;if(!Y||!(K.target instanceof Element)||K.target.closest("[data-collab-cursors]")!==Y)return;let F=Y.getBoundingClientRect(),W=K.target instanceof Element?K.target.closest("[data-collab-target]"):null,q=W&&Y.contains(W)?W:null,N=q?.getBoundingClientRect();z({x:K.clientX-F.left-Y.clientLeft+Y.scrollLeft,y:K.clientY-F.top-Y.clientTop+Y.scrollTop,...q&&N?{target:q.dataset.collabTarget??"",targetX:N.width?(K.clientX-N.left)/N.width:0,targetY:N.height?(K.clientY-N.top)/N.height:0}:{}})};return s8.jsxs("div",{ref:H,"data-collab-cursors":$,className:B0("relative",J),onPointerEnter:U,onPointerMove:U,onPointerLeave:(K)=>{if(K.target instanceof Element&&K.target.closest("[data-collab-cursors]")===K.currentTarget)z(null)},children:[Z,s8.jsx("div",{ref:Q,className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":"true",children:[...G].map(([K,{id:Y,point:F}])=>s8.jsx(D50,{root:H,point:F,id:Y},K))})]})}function D50({root:$,point:Z,id:J}){let H=G$.useRef(null);return G$.useLayoutEffect(()=>{let Q=$.current,B=H.current;if(!Q||!B)return;let X=(K=!1)=>{let Y=Z.x-Q.scrollLeft,F=Z.y-Q.scrollTop;if(Z.target){let q=[...Q.querySelectorAll("[data-collab-target]")].find((V)=>V.dataset.collabTarget===Z.target);if(!q){B.hidden=!0;return}let N=Q.getBoundingClientRect(),A=q.getBoundingClientRect();Y=A.left-N.left-Q.clientLeft+A.width*(Z.targetX??0),F=A.top-N.top-Q.clientTop+A.height*(Z.targetY??0)}let W=`translate(${Y}px, ${F}px)`;if(B.hidden||B.style.transform!==W)B.dataset.moving=K&&!B.hidden?"true":"false",B.style.transform=W;B.hidden=!1};X(!0);let z=()=>X(),G=new ResizeObserver(z);G.observe(Q);let U=new MutationObserver(z);return U.observe(Q,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-collab-target"]}),Q.addEventListener("scroll",z,!0),window.addEventListener("resize",z),()=>{G.disconnect(),U.disconnect(),Q.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[$,Z]),s8.jsx(L50,{ref:H,id:J})}function L50({id:$,ref:Z}){let J=D6($);return s8.jsx("span",{ref:Z,hidden:!0,"aria-hidden":"true","data-collab-color":J?.color??"unknown",className:"pointer-events-none absolute top-0 left-0 transition-transform duration-100 ease-linear data-[moving=false]:transition-none motion-reduce:transition-none",children:s8.jsxs("span",{className:"relative block animate-in duration-200 zoom-in-75 fade-in",children:[s8.jsx(XR,{size:24,stroke:1.5,className:"-translate-x-0.5 -translate-y-0.5 fill-collab stroke-white drop-shadow-xs"}),s8.jsx(QU,{className:"absolute top-3.5 left-3.5 bg-collab text-collab-foreground",children:s8.jsx("span",{className:"truncate",children:J?A6(J):"Someone"})})]})})}var GU=P(m(),1);var _6=P(c(),1);function GR({id:$,present:Z,align:J,children:H,className:Q}){let B=XU($),X=zU(B,Z);return _6.jsx(M50,{...X.props,ids:X.users.map((z)=>z.id),align:J,className:Q,children:H})}function M50({ids:$,align:Z,children:J,className:H,...Q}){let B=$R($).filter((X)=>X!==void 0);return _6.jsxs("div",{className:B0("relative",H),...Q,children:[_6.jsx(j50,{names:B.map(A6).join(", "),color:B[0]?.color,align:Z}),J]})}var SQ=4,P50=6,_50=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function j50({names:$,color:Z,align:J="end"}){let H=GU.useRef(null);return GU.useLayoutEffect(()=>{let Q=H.current,B=Q?.parentElement;if(!$||!Q||!B)return;let X=()=>{let G=[...B.children].filter((V)=>{if(V===Q)return!1;let{display:D,position:L}=getComputedStyle(V);return D!=="none"&&L!=="absolute"&&L!=="fixed"}),U=[...B.childNodes].some((V)=>V.nodeType===Node.TEXT_NODE&&V.textContent?.trim()),K=G.length===1&&!U?G[0]:null,Y=K instanceof HTMLElement?K:null,W=(Y??B).getBoundingClientRect(),q=B.getBoundingClientRect(),N=Q.style;N.left=`${W.left-q.left-B.clientLeft+B.scrollLeft-SQ}px`,N.top=`${W.top-q.top-B.clientTop+B.scrollTop-SQ}px`,N.width=`${W.width+SQ*2}px`,N.height=`${W.height+SQ*2}px`,N.setProperty("--presence-target-width",`${W.width}px`);let A=Y?getComputedStyle(Y):null;for(let V of _50)N[V]=A?`calc(${A[V]} + ${SQ}px)`:`${P50}px`};X();let z=new ResizeObserver(X);z.observe(B);for(let G of B.children)if(G!==Q)z.observe(G);return()=>z.disconnect()}),_6.jsx("div",{ref:H,hidden:!$,"data-align":J,"data-collab-color":Z??"unknown",className:"group/frame pointer-events-none absolute m-0! animate-in ring-2 ring-collab duration-150 fade-in",children:_6.jsx(QU,{className:"absolute bottom-full mb-1.5 max-w-[min(var(--presence-target-width),10rem)] bg-collab text-collab-foreground group-data-[align=end]/frame:-right-0.5 group-data-[align=start]/frame:-left-0.5",children:_6.jsx("span",{className:"truncate",children:$})})})}var QJ=P(m(),1);var UU=P(c(),1);function KR({id:$,children:Z}){let J=QJ.useContext(HJ),H=QJ.useMemo(()=>{return BU($),[...J,$]},[J,$]),Q=QJ.useId();return UU.jsx(UR,{reducedMotion:"user",children:UU.jsx(KU,{id:Q,children:UU.jsx(HJ,{value:H,children:Z})})})}var YR=P(m(),1);var U$=P(c(),1);function FR({id:$,present:Z,align:J,children:H,className:Q}){let B=XU($),X=zU(B,Z),z=YR.useContext(HJ).length>0;return U$.jsx(O50,{...X.props,users:X.users,animate:z&&Z===void 0,align:J,className:Q,children:H})}function O50({users:$,children:Z,animate:J=!1,align:H="center",className:Q,...B}){return U$.jsxs("div",{className:B0("relative pl-8",Q),...B,children:[Z,U$.jsx("div",{"data-align":H,className:"pointer-events-none absolute inset-y-0 left-0 flex items-center -space-x-3 data-[align=end]:items-end data-[align=start]:items-start","aria-hidden":"true",children:$.map(({id:X,connectionId:z})=>U$.jsx(z5.span,{layoutId:J?`presence:${z}`:void 0,children:U$.jsx(M6,{id:X,size:"sm",className:"animate-in duration-200 zoom-in-75 fade-in"})},X))})]})}var _A={Cursors:zR,User:ZU,UserAvatar:M6,UserAvatarGroup:JU,PresenceFrame:GR,PresenceAvatars:FR,PresenceGroup:KR,useMe:eG,usePeers:ZR,useUser:D6,useWorkspaceUsers:tG,usePresence:JR,usePublishPresence:HR};var jA=($)=>`moi:collab:${$}:session`;function OA($){try{return sessionStorage.getItem(jA($))}catch{return null}}function TA($,Z){try{if(Z===null)sessionStorage.removeItem(jA($));else sessionStorage.setItem(jA($),Z)}catch{}}var RQ=P(m(),1);var CA={all:["app-ui"],selectedSession:($)=>["app-ui","selected-session",$]};function K$($,Z="shared"){let J=CA.selectedSession($);return Z==="browser-tab"?[...J,"browser-tab"]:J}function T50($,Z){return[...K$($,Z),"save"]}function C50($,Z,J,H="shared"){let Q=K$(Z,H),B=$.getQueryData(Q),X=B?.sessionId??null;if(B&&X===J)return null;return $.setQueryData(Q,{sessionId:J}),{sessionId:J,previousSessionId:X}}function w50($,Z,J,H,Q="shared"){let B=K$(Z,Q),X=$.getQueryData(B);if(J.sessionId!==H.sessionId&&X?.sessionId!==J.sessionId)return"conflict";if(X?.sessionId!==H.sessionId&&X?.sessionId!==H.previousSessionId)return"ignored";return $.setQueryData(B,J),"applied"}function E50($,Z,J,H){if(H)return;$.setQueryData(CA.selectedSession(Z),{sessionId:J})}function WR($,Z,J,H){for(let Q of["shared","browser-tab"])$.setQueryData(K$(Z,Q),(B)=>B?.sessionId===J?{sessionId:H}:B);if(OA(Z)===J)TA(Z,H)}function j6(){let $=e1(),J=M4()?"browser-tab":"shared",H=U1(),Q=RQ.useMemo(()=>K$($,J),[$,J]),B=RQ.useMemo(()=>T50($,J),[$,J]),X=DN({mutationKey:B,exact:!0}),z=J5({queryKey:Q,queryFn:()=>J==="browser-tab"?Promise.resolve({sessionId:OA($)}):q1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),{mutate:G}=H5({mutationKey:B,scope:{id:`selected-session:${$}`},mutationFn:(Y)=>{if(J==="browser-tab")return TA($,Y.sessionId),Promise.resolve({sessionId:Y.sessionId});return q1(`/api/workspaces/${$}/selected-session`,g5("PUT",Y),"Couldn’t save selected chat")},onSuccess:(Y,F)=>{if(w50(H,$,Y,F,J)!=="conflict")return;K5.add({title:"Couldn’t save selected chat",type:"error"}),H.invalidateQueries({queryKey:Q})},onError:(Y,F)=>{if(H.getQueryData(Q)?.sessionId!==F.sessionId)return;K5.add({title:"Couldn’t save selected chat",type:"error"}),H.invalidateQueries({queryKey:Q})}}),U=RQ.useCallback((Y)=>{let F=C50(H,$,Y,J);if(F)G(F)},[H,G,$,J]);return W2((Y)=>{if(J==="browser-tab"||Y.type!=="selected-session:updated"||Y.workspaceId!==$)return;E50(H,$,Y.sessionId,X>0)}),[z.isLoading?void 0:z.data?.sessionId??null,U]}function NR($,Z){let{queryClient:J,sendMessage:H,onWorkspaceSwitch:Q}=Z,B=w1.getState();if($.type==="status_snapshot"){B.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:U,sessionId:K,activity:Y}=$;if(B.setActivity(U,K,Y),Y!=="running")B.clearPreviewsForSession(U,K);return}if($.type==="preview"){let U=$,K=S0.events(U.workspaceId,U.sessionId);if(J?.getQueryData(K)===void 0)return;B.setPreview({workspaceId:U.workspaceId,sessionId:U.sessionId,messageId:U.messageId,parentToolUseId:U.parentToolUseId,blocks:U.blocks});return}if($.type==="session_renamed"){let{workspaceId:U,from:K,to:Y}=$,F=S0.sessions(U),q=J?.getQueryData(F)?.find((V)=>V.sessionId===K||V.sessionId===Y);if(q)J?.cancelQueries({queryKey:F});if(B.renameSession(U,K,Y),J)WR(J,U,K,Y);if(q)J?.setQueryData(F,(V)=>[{...q,sessionId:Y},...(V??[]).filter((D)=>D.sessionId!==K&&D.sessionId!==Y)]);let N=J?.getQueryData(S0.events(U,K));if(N!==void 0)J?.setQueryData(S0.events(U,Y),N),J?.removeQueries({queryKey:S0.events(U,K)});let A=J?.getQueryData(S0.sessionConfig(U,K));if(A!==void 0)J?.setQueryData(S0.sessionConfig(U,Y),A),J?.removeQueries({queryKey:S0.sessionConfig(U,K)});if(!q)J?.invalidateQueries({queryKey:F});J?.invalidateQueries({queryKey:S0.preview(U)});return}if($.type==="sessions_changed"){let U=$.workspaceId,K=S0.sessions(U);J?.invalidateQueries({queryKey:K}),J?.invalidateQueries({queryKey:S0.preview(U)});return}if($.type==="workspace:switch"){Q?.($.workspaceId);return}if($.type==="scratchpad:op"){let U=qR($.workspaceId);if(!U)return;let K=$.opId;U($.op).then((Y)=>H({type:"scratchpad:op-result",opId:K,result:Y}),(Y)=>H({type:"scratchpad:op-result",opId:K,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(S50(J,X,z,$),G==="turn"){let U=$.turn?.meta?.apiMessageId;if(U)B.clearPreview(U)}if(G==="result")B.clearPreviewsForSession(X,z)}if(G==="error"&&typeof $.content==="string"){if(B.setError(X,z,$.content),$.terminal!==!1)B.setActivity(X,z,"idle"),B.clearPreviewsForSession(X,z)}if(G==="stopped")B.setActivity(X,z,"idle"),B.clearPreviewsForSession(X,z)}function S50($,Z,J,H){if(!$)return;AE($,Z,J,H);let Q=S0.events(Z,J),B=$.getQueryData(Q);if(B===void 0)return;$.setQueryData(Q,RG(B,H))}var EA=null,BJ=null,YU=0,FU=null,wA=[],AR=null,VR=null,R50=15000;function DR($){if(EA=$,!VR)VR=setInterval(()=>w1.getState().sweepPreviews(R50,Date.now()),5000);if(BJ)return;LR()}function LR(){let $=++YU;if(FU)clearTimeout(FU),FU=null;let Z=new WebSocket(kG("/ws"));BJ=Z,Z.onopen=()=>{if(YU!==$){Z.close();return}for(let J of wA)Z.send(JSON.stringify(J));wA.length=0,EA?.invalidateQueries({queryKey:["workspaces","events"]}),w1.getState().clearAllPreviews()},Z.onmessage=(J)=>{if(YU!==$)return;let H;try{H=JSON.parse(J.data)}catch{return}I50(H)},Z.onclose=()=>{if(YU!==$)return;BJ=null,FU=setTimeout(LR,1000)},Z.onerror=()=>Z.close()}function I50($){NR($,{queryClient:EA,sendMessage:WU,onWorkspaceSwitch:AR})}function WU($){if(BJ&&BJ.readyState===WebSocket.OPEN)BJ.send(JSON.stringify($));else wA.push($)}function SA($){AR=$}var JN=P(m(),1);var b50=($)=>MR()(_R((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},viewBuilderDrafts:{},dockedChatWidth:360,setDiscoveredWorkspacesOpen:(J)=>Z({discoveredWorkspacesOpen:J}),markWorkspacePendingAnalysis:(J)=>Z((H)=>{let Q=H.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:Q.includes(J)?Q:[...Q,J]}}),markMessageSentFromMoi:(J)=>Z((H)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(H.workspaceIdsPendingAnalysis??[]).filter((Q)=>Q!==J)})),setComposerDraft:(J,H)=>Z((Q)=>{let B={...Q.composerDrafts??{}};if(H)B[J]=H;else delete B[J];return{composerDrafts:B}}),setViewBuilderDraft:(J,H)=>Z((Q)=>{let B=Q.viewBuilderDrafts??{};if(H===null){if(!(J in B))return Q;let X={...B};return delete X[J],{viewBuilderDrafts:X}}if(B[J]===H)return Q;return{viewBuilderDrafts:{...B,[J]:H}}}),setDockedChatWidth:(J)=>Z({dockedChatWidth:J})}),$?{name:"moi:ui",storage:PR(()=>$)}:{name:"moi:ui"})),w5=b50();function jR($,Z){let J=$??[],H=J.findIndex((Q)=>Q.id===Z.id||Q.path===Z.path);if(H===-1)return[Z,...J];return J.map((Q,B)=>B===H?{...Q,...Z}:Q)}function qU(){return J5({queryKey:S0.all,queryFn:()=>q1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function NU($){return J5({queryKey:S0.preview($),queryFn:()=>q1(`/api/workspaces/${$}/preview`),staleTime:60000})}function OR(){return J5({queryKey:S0.discover,queryFn:()=>q1("/api/workspaces/discover")})}function TR(){let $=U1();return H5({mutationFn:(Z)=>q1("/api/workspaces",g5("POST",Z),"Failed to add workspace"),onSuccess:(Z,J)=>{w5.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(S0.all,(H)=>jR(H,Z)),$.setQueryData(S0.discover,(H)=>(H??[]).filter((Q)=>Q.path!==J.path))}})}function VU(){return J5({queryKey:S0.setupInfo,queryFn:()=>q1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function CR(){let $=U1();return H5({mutationFn:(Z)=>q1("/api/workspaces/create",g5("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(S0.all,(J)=>jR(J,Z))}})}function wR(){let $=U1();return H5({mutationFn:(Z)=>q1("/api/workspaces/order",g5("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:S0.all,exact:!0});let J=$.getQueryData(S0.all);if(J){let H=new Map(J.map((B)=>[B.id,B])),Q=Z.map((B)=>H.get(B)).filter((B)=>Boolean(B));if(Q.length===J.length)$.setQueryData(S0.all,Q)}return{previous:J}},onError:(Z,J,H)=>{if(H?.previous)$.setQueryData(S0.all,H.previous);$.invalidateQueries({queryKey:S0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(S0.all,Z)}})}function ER(){let $=U1();return H5({mutationFn:(Z)=>P4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,J)=>{$.setQueryData(S0.all,(H)=>(H??[]).filter((Q)=>Q.id!==J)),$.invalidateQueries({queryKey:S0.discover})}})}var yR=P(m(),1);var SR=P(c(),1);function H8({className:$,...Z}){return SR.jsx(k5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:a0("size-4 animate-spin",$),stroke:1.75,...Z})}var RA="Wait for active agents to finish, or stop them before updating moi";var k50=["update"],RR=300000,y50=1000;function IR($){return J5({queryKey:k50,queryFn:()=>q1("/api/update"),staleTime:RR,refetchInterval:$?y50:RR,refetchOnWindowFocus:!0,retry:!1})}function bR(){return H5({mutationFn:()=>q1("/api/update",{method:"POST"},"Could not update moi")})}var C3=P(c(),1);function x50($,Z){return!!Z&&$?.runningVersion===Z}function h50($,Z,J){let H=Z||J,Q=$&&!H;return{busy:H,blocked:Q,label:Z?"Updating":J?"Restarting":Q?RA:"Update"}}function xR(){let $=bR(),Z=IR($.isSuccess),J=g2((z)=>WE(z.activity)),H=Z.data,Q=$.data?.installedVersion??null;if(yR.useEffect(()=>{if(x50(H,Q))window.location.reload()},[Q,H]),Z.isPending)return{status:"loading"};if(!H?.availableVersion&&!$.isSuccess)return{status:"unavailable"};let B=$.isSuccess;return{status:"available",button:{...h50(J,$.isPending,B),errorMessage:$.error?.message??null,onClick:()=>$.mutate()}}}function hR({busy:$,blocked:Z,label:J,errorMessage:H,onClick:Q}){return C3.jsxs(Q5,{children:[C3.jsx(B5,{render:C3.jsx("div",{children:C3.jsx(j0,{type:"button",size:"icon",variant:$?"ghost":"default","aria-label":J,disabled:Z||$,onClick:Q,children:$?C3.jsx(H8,{stroke:1.5}):C3.jsx(kR,{stroke:1.5})})})}),C3.jsx(X5,{side:"right",className:Z?"max-w-56":void 0,children:Z?RA:H??J})]})}var $B=P(m(),1);var t8={};C5(t8,{createHandle:()=>ZI,Viewport:()=>EU,Trigger:()=>RU,Title:()=>SU,Root:()=>sR,Portal:()=>TU,Popup:()=>OU,Handle:()=>XJ,Description:()=>MU,Close:()=>LU,Backdrop:()=>DU});var vR=P(m(),1);var AU=P(m(),1),IA=AU.createContext(void 0);function T2($){let Z=AU.useContext(IA);if(!$&&Z===void 0)throw Error(y0(27));return Z}var DU=vR.forwardRef(function(Z,J){let{render:H,className:Q,style:B,forceRender:X=!1,...z}=Z,G=T2(),U=G.useState("open"),K=G.useState("nested"),Y=G.useState("mounted"),F=G.useState("transitionStatus");return z0("div",Z,{state:{open:U,transitionStatus:F},ref:[G.context.backdropRef,J],stateAttributesMapping:a2,props:[{role:"presentation",hidden:!Y,style:{userSelect:"none",WebkitUserSelect:"none"}},z],enabled:X||!K})});var gR=P(m(),1);var LU=gR.forwardRef(function(Z,J){let{render:H,className:Q,style:B,disabled:X=!1,nativeButton:z=!0,...G}=Z,U=T2(),K=U.useState("open"),{getButtonProps:Y,buttonRef:F}=T5({disabled:X,native:z}),W={disabled:X};function q(N){if(K)U.setOpen(!1,R0(K0.closePress,N.nativeEvent))}return z0("button",Z,{state:W,ref:[J,F],props:[{onClick:q},G,Y]})});var fR=P(m(),1);var MU=fR.forwardRef(function(Z,J){let{render:H,className:Q,style:B,id:X,...z}=Z,G=T2(),U=t0(X);return G.useSyncedValueWithCleanup("descriptionElementId",U),z0("p",Z,{ref:J,props:[{id:U},z]})});var pR=P(m(),1);var PU=P(m(),1),bA=PU.createContext(void 0);function _U(){let $=PU.useContext(bA);if($===void 0)throw Error(y0(26));return $}var mR="--nested-dialogs";var Tx0=f7.open,Cx0=f7.closed,wx0=f7.startingStyle,Ex0=f7.endingStyle;var uR="data-nested-dialog-open";var jU={...s4,...Q2,nestedDialogOpen($){return $?{[uR]:""}:null}};var cR=P(c(),1),OU=pR.forwardRef(function(Z,J){let{render:H,className:Q,style:B,finalFocus:X,initialFocus:z,...G}=Z,U=T2(),K=U.useState("descriptionElementId"),Y=U.useState("disablePointerDismissal"),F=U.useState("floatingRootContext"),W=U.useState("popupProps"),q=U.useState("modal"),N=U.useState("mounted"),A=U.useState("nested"),V=U.useState("nestedOpenDialogCount"),D=U.useState("open"),L=U.useState("openMethod"),j=U.useState("titleElementId"),M=U.useState("transitionStatus"),_=U.useState("role"),E=F.useState("floatingId");_U(),q5({open:D,ref:U.context.popupRef,onComplete(){if(D)U.context.onOpenChangeComplete?.(!0)}});let C=z===void 0?oz(U.context.popupRef):z,R=V>0,T=U.useStateSetter("popupElement"),y=z0("div",Z,{state:{open:D,nested:A,transitionStatus:M,nestedDialogOpen:R},props:[W,{id:E,"aria-labelledby":j,"aria-describedby":K,role:_,..._9,hidden:!N,onKeyDown(S){if(n8.has(S.key))S.stopPropagation()},style:{[mR]:V}},G],ref:[J,U.context.popupRef,T],stateAttributesMapping:jU});return cR.jsx(o7,{context:F,openInteractionType:L,disabled:!N,closeOnFocusOut:!Y,initialFocus:C,returnFocus:X,modal:q!==!1,restoreFocus:"popup",children:y})});var dR=P(m(),1);var IQ=P(c(),1),TU=dR.forwardRef(function(Z,J){let{keepMounted:H=!1,...Q}=Z,B=T2(),X=B.useState("mounted"),z=B.useState("modal"),G=B.useState("open");if(!(X||H))return null;return IQ.jsx(bA.Provider,{value:H,children:IQ.jsxs(l7,{ref:J,...Q,children:[X&&z===!0&&IQ.jsx(uZ,{ref:B.context.internalBackdropRef,inert:L8(!G)}),Z.children]})})});var nR=P(m(),1);var kA=P(m(),1);function lR({store:$,parentContext:Z,isDrawer:J}){let H=$.useState("open"),Q=$.useState("disablePointerDismissal"),B=$.useState("modal"),X=$.useState("popupElement"),z=$.useState("floatingRootContext"),[G,U]=kA.useState(0),[K,Y]=kA.useState(0),F=G===0,W=d8(z,{outsidePressEvent(){if($.context.internalBackdropRef.current||$.context.backdropRef.current)return"intentional";return{mouse:B==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(q){if(!$.context.outsidePressEnabledRef.current)return!1;if("button"in q&&q.button!==0)return!1;if("touches"in q){if(q.type==="touchend"){if(q.changedTouches.length!==1||q.touches.length!==0)return!1}else if(q.touches.length!==1)return!1}let N=M1(q);if(F&&!Q){if(B){let A=$.context.internalBackdropRef.current,V=$.context.backdropRef.current;return A||V?A===N||V===N||b0(N,X)&&!N?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:F});return mG(H&&B===!0,X),$.useContextCallback("onNestedDialogOpen",(q,N)=>{U(q),Y(N)}),J0(()=>{if(Z?.onNestedDialogOpen)if(H)Z.onNestedDialogOpen(G+1,K+(J?1:0));else Z.onNestedDialogOpen(0,0);return()=>{if(Z?.onNestedDialogOpen&&H)Z.onNestedDialogOpen(0,0)}},[J,H,G,K,Z]),w9($,{activeTriggerProps:W.reference,inactiveTriggerProps:W.trigger,popupProps:W.floating,nestedOpenDialogCount:G,nestedOpenDrawerCount:K}),null}var CU=P(m(),1);var iR={...S9,modal:($)=>$.modal,nested:($)=>$.nested,nestedOpenDialogCount:($)=>$.nestedOpenDialogCount,nestedOpenDrawerCount:($)=>$.nestedOpenDrawerCount,disablePointerDismissal:($)=>$.disablePointerDismissal,openMethod:($)=>$.openMethod,descriptionElementId:($)=>$.descriptionElementId,titleElementId:($)=>$.titleElementId,viewportElement:($)=>$.viewportElement,role:($)=>$.role};class yA extends b2{constructor($,Z,J){let H=new O2,Q=aR($,H,Z,J);super(Q,oR(H),iR)}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;this.state.floatingRootContext.dispatchOpenChange($,Z),this.update(s7(this.state,$,Z.trigger))}}function rR(){let $=new O2;return new a8(Object.freeze(aR(void 0,$)),Object.freeze(oR($)),iR)}function aR($,Z,J,H=!1){return{...E9(Z,J,H),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...$}}function oR($){return{popupRef:CU.createRef(),backdropRef:CU.createRef(),internalBackdropRef:CU.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:$,onOpenChange:void 0,onOpenChangeComplete:void 0}}var bQ=P(c(),1);function wU($,Z){let{children:J,open:H,defaultOpen:Q=!1,onOpenChange:B,onOpenChangeComplete:X,disablePointerDismissal:z=!1,modal:G=!0,actionsRef:U,handle:K,triggerId:Y,defaultTriggerId:F=null}=Z,W=$==="drawer",q=$==="alert-dialog",N=q?!0:G,A=q||z,V=q?"alertdialog":"dialog",D=T2(!0),L=D!=null,j={modal:N,disablePointerDismissal:A,nested:L,role:V},M=Q6((I,y)=>new yA({open:Q,openProp:H,activeTriggerId:F,triggerIdProp:Y,...j},I,y),!0);M.useControlledProp("openProp",H),M.useControlledProp("triggerIdProp",Y),M.useSyncedValues(j),M.useContextCallback("onOpenChange",B),M.useContextCallback("onOpenChangeComplete",X);let _=M.useState("open"),E=M.useState("mounted"),C=M.useState("payload");sz(M,_),T9(M);let{forceUnmount:R}=C9(_,M);nR.useImperativeHandle(U,()=>({unmount:R,close:()=>M.setOpen(!1,R0(K0.imperativeAction))}),[R,M]);let T=_||E;return bQ.jsxs(IA.Provider,{value:M,children:[K&&bQ.jsx(j9,{handle:K,store:M}),T&&bQ.jsx(lR,{store:M,parentContext:D?.context,isDrawer:W}),typeof J==="function"?J({payload:C}):J]})}var sR=g8(function(Z){return wU("dialog",Z)});var tR=P(m(),1);var EU=tR.forwardRef(function(Z,J){let{render:H,className:Q,style:B,children:X,...z}=Z,G=_U(),U=T2(),K=U.useState("open"),Y=U.useState("nested"),F=U.useState("transitionStatus"),W=U.useState("nestedOpenDialogCount"),q=U.useState("mounted"),N=U.useStateSetter("viewportElement"),A=W>0;return z0("div",Z,{enabled:G||q,state:{open:K,nested:Y,transitionStatus:F,nestedDialogOpen:A},ref:[J,N],stateAttributesMapping:jU,props:[{role:"presentation",hidden:!q,style:{pointerEvents:!K?"none":void 0},children:X},z]})});var eR=P(m(),1);var SU=eR.forwardRef(function(Z,J){let{render:H,className:Q,style:B,id:X,...z}=Z,G=T2(),U=t0(X);return G.useSyncedValueWithCleanup("titleElementId",U),z0("h2",Z,{ref:J,props:[{id:U},z]})});var $I=P(m(),1);var RU=V9(function(Z,J){let{render:H,className:Q,style:B,disabled:X=!1,nativeButton:z=!0,id:G,payload:U,handle:K,...Y}=Z,F=T2(!0),q=R9(K)??F;if(!q)throw Error(y0(79));let N=t0(G),A=q.useState("floatingRootContext"),V=q.useState("isOpenedByTrigger",N),D=q.useState("triggerPopupId",N),L=$I.useRef(null),{registerTrigger:j,isMountedByThisTrigger:M}=O9(N,L,q,{payload:U}),{getButtonProps:_,buttonRef:E}=T5({disabled:X,native:z}),C=D3(A),R=_Q(()=>q.select("open"),(y)=>{q.set("openMethod",y)}),T={disabled:X,open:V},I=q.useState("triggerProps",M);return z0("button",Z,{state:T,ref:[E,J,j,L],props:[C.reference,I,R,{[jZ]:"",id:N,"aria-haspopup":"dialog","aria-expanded":V,"aria-controls":D},Y,_],stateAttributesMapping:A9})});class XJ extends l8{constructor(){super(rR(),"Dialog",!1)}open($){this.openByTrigger($)}openWithPayload($){let Z=this.attachedStore;if(Z===null)return;Z.set("payload",$),Z.setOpen(!0,R0(K0.imperativeAction))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function ZI(){return new XJ}var $4=P(c(),1);function O6({...$}){return $4.jsx(t8.Root,{"data-slot":"dialog",...$})}function w3({...$}){return $4.jsx(t8.Trigger,{"data-slot":"dialog-trigger",...$})}function f50({...$}){return $4.jsx(j8,{portal:t8.Portal,"data-slot":"dialog-portal",...$})}function kQ({...$}){return $4.jsx(t8.Close,{"data-slot":"dialog-close",...$})}function m50({className:$,...Z}){return $4.jsx(t8.Backdrop,{"data-slot":"dialog-overlay",className:a0("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function zJ({className:$,children:Z,showCloseButton:J=!0,...H}){return $4.jsxs(f50,{children:[$4.jsx(m50,{}),$4.jsxs(t8.Popup,{"data-slot":"dialog-content",className:a0("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none sm:max-w-sm 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,J&&$4.jsxs(kQ,{render:$4.jsx(j0,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4"}),children:[$4.jsx(o5,{stroke:1.75}),$4.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function T6({className:$,...Z}){return $4.jsx(t8.Title,{"data-slot":"dialog-title",className:a0("text-lg font-semibold",$),...Z})}function GJ({className:$,...Z}){return $4.jsx(t8.Description,{"data-slot":"dialog-description",className:a0("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}var PI=P(m(),1);var cU={};C5(cU,{Validity:()=>LI,Root:()=>YI,Label:()=>WI,Item:()=>MI,Error:()=>qI,Description:()=>VI,Control:()=>AI});var w2=P(m(),1);var IU=P(m(),1);var JI="data-valid",HI="data-invalid";var Y$={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},p50={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},QI={disabled:!1,...p50},C2={valid($){if($===null)return null;if($)return{[JI]:""};return{[HI]:""}}};var c50={invalid:void 0,name:void 0,validityData:{state:Y$,errors:[],error:"",value:"",initialValue:null},setValidityData:X1,disabled:void 0,setTouched:X1,setDirty:X1,setFilled:X1,setFocused:X1,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:QI,registerFieldControl:X1,validation:{getValidationProps:($,Z=L1)=>Z,inputRef:{current:null},registeredInputs:new Map,registerInput:X1,getInputControl:()=>null,commit:async()=>{},change:X1}},xA=IU.createContext(c50);function l5($=!0){let Z=IU.useContext(xA);if(Z.setValidityData===X1&&!$)throw Error(y0(28));return Z}var bU=P(m(),1),d50=bU.createContext(void 0);function BI($=!1){let Z=bU.useContext(d50);if(!Z&&!$)throw Error(y0(86));return Z}var kU=P(m(),1);var l50=kU.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:X1,validationMode:"onSubmit",submitCountRef:{current:0}});function Z4(){return kU.useContext(l50)}var C6=P(m(),1);var yU=P(m(),1);var hA=yU.createContext({controlId:void 0,registerControlId:X1,resetControlId:X1,labelId:void 0,setLabelId:X1,messageIds:[],setMessageIds:X1,getDescriptionProps:($)=>$});function i5(){return yU.useContext(hA)}var XI=P(c(),1),xU=function(Z){let J=t0(),[H,Q]=C6.useState(J),[B,X]=C6.useState(),[z,G]=C6.useState([]),U=H===void 0?J:H,K=l1(()=>new Map),{messageIds:Y}=i5(),F=U0((A,V)=>{let D=K.current;if(V===void 0)D.delete(A);else D.set(A,V);Q((L)=>{if(D.size===0)return L;let j;for(let M of D.values()){if(M===L)return L;if(j===void 0)j=M}return j})}),W=U0(()=>{if(K.current.size===0)Q(J)}),q=C6.useCallback((A)=>{let V=A["aria-describedby"]?A["aria-describedby"].split(" "):[];return V.push(...Y,...z),{...A,"aria-describedby":Array.from(new Set(V)).join(" ")||void 0}},[Y,z]),N=C6.useMemo(()=>({controlId:U,registerControlId:F,resetControlId:W,labelId:B,setLabelId:X,messageIds:z,setMessageIds:G,getDescriptionProps:q}),[U,F,W,B,X,z,G,q]);return XI.jsx(hA.Provider,{value:N,children:Z.children})};var E3=P(m(),1);function F$($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var vA=Object.keys(Y$);function i50($,Z){if($.matches(":disabled"))return!1;if(!Z||$.form===Z)return!0;return $.form===null&&!$.hasAttribute("form")}function zI($,Z){let J=null;for(let H of $.keys()){if(!i50(H,Z))continue;if(!H.validity.valid)return H;J??=H}return J}function GI($){return{...Y$,valid:!$,customError:$}}function gA($){return $&&$.validationMessage?[$.validationMessage]:[]}function UI($){let{elementRef:Z,formRef:J}=Z4(),{setValidityData:H,validate:Q,validityData:B,validationDebounceTime:X,invalid:z,markedDirtyRef:G,state:U,shouldValidateOnChange:K,validationMode:Y,registeredFieldIdRef:F}=$,{controlId:W,getDescriptionProps:q}=i5(),N=d1(),A=E3.useRef(null),V=l1(()=>new Map).current,D=E3.useRef(0),L=E3.useRef(null),j=E3.useCallback((R,T)=>{return V.set(R,T),()=>{V.delete(R)}},[V]),M=U0(()=>{let R=zI(V,Z.current);return R&&V.get(R)?.controlRef.current||null}),_=U0(async(R,T=!1)=>{D.current+=1;let I=D.current;function y(l,s=z){let p=F.current??W;if(p==null)return;let d=J.current.fields.get(p);if(!d)return;let o=F$(l,s);J.current.fields.set(p,{...d,validityData:o})}function S(l,s){let p=l.valid===!1?s:[];return{value:R,state:l,error:p[0]??"",errors:p,initialValue:B.initialValue}}function O(l,s){let p=l.validity.customError?l.validationMessage:"",d=s.replace(/\r\n?/g,`
|
|
10
|
-
`);l.setCustomValidity(d),L.current=[l,d,p]}function k(){let l=L.current;if(L.current=null,l&&(!l[0].willValidate||l[0].validationMessage===l[1]))l[0].setCustomValidity(l[2])}function b(l,s,p){let d=S(l,s);y(d,p),H(d)}function h(l){let s=vA.reduce((d,o)=>{return d[o]=l.validity[o],d},{}),p=!1;for(let d of vA){if(d==="valid")continue;if(d==="valueMissing"&&s[d])p=!0;else if(s[d])return s}if(p&&!G.current)s.valid=!0,s.valueMissing=!1;return s}function v(){return V.size>0?zI(V,Z.current):A.current}let f=v();function w(){return f=v(),f?.willValidate?h(f):GI(!1)}if(T){if(U.valid!==!1||!f)return;if(!f.validity.valueMissing){k();let l=v(),s=l?.validity.customError?gA(l):[];b(GI(s.length>0),s,!1);return}for(let l of vA)if(l!=="valid"&&l!=="valueMissing"&&l!=="customError"&&f.validity[l])return}N.clear(),k();let i=w(),r=gA(f),x=K();if(r.length===0||x){let l=Array.from(J.current.fields.values()).reduce((d,o)=>{if(o.name)d[o.name]=o.getValue();return d},{}),s=Q(R,l),p;if(typeof s==="object"&&s!==null&&"then"in s){if(i.valid===!1)b(i,r);else if(Y==="onSubmit"||!B.state.customError)i.valid=null,b(i,r);if(p=await s,I!==D.current)return;i=w()}else p=s;if(r=p?[].concat(p).filter(Boolean):[],r.length>0){if(i.valid=!1,i.customError=!0,f?.willValidate)O(f,r.join(`
|
|
11
|
-
`))}else r=gA(f)}b(i,r)}),E=U0((R,T=!1)=>{if(N.clear(),D.current+=1,T)return;let I=K();if(I&&R!==""&&X)N.start(X,()=>{_(R)});else _(R,!I)}),C=E3.useCallback((R,T={})=>X2(q(T),U.valid===!1&&!U.disabled&&!R?{"aria-invalid":!0}:L1),[q,U.disabled,U.valid]);return E3.useMemo(()=>({getValidationProps:C,inputRef:A,registeredInputs:V,registerInput:j,getInputControl:M,commit:_,change:E}),[C,V,j,M,_,E])}var hU=P(m(),1);function KI($){let{change:Z,commit:J,invalid:H,markedDirtyRef:Q,name:B,setRegisteredFieldName:X,registeredFieldIdRef:z,setValidityData:G,validityData:U}=$,{formRef:K}=Z4(),Y=hU.useRef(null),F=hU.useRef(null),W=hU.useRef(!1),q=U0(()=>{let M=F.current;if(!M)return;if(M.getValue)return M.getValue();return M.value});function N(M){return M.value===void 0?q():M.value}let A=U0(()=>{let M=F.current;if(Q.current=!0,!M){J(U.value);return}J(N(M))});function V(){let M=F.current;if(!M||!M.id)return;K.current.fields.set(M.id,{getValue:q,name:B??M.name,controlRef:M.controlRef,validityData:F$(U,H),validate:A})}function D(M=F.current?.id){if(M)K.current.fields.delete(M)}function L(M){if(W.current)return;W.current=!0;let _=N(M);G((E)=>E.initialValue===_?E:{...E,initialValue:_})}J0(()=>{let M=F.current;if(!M||!M.id)return;X(B?void 0:M.name),K.current.fields.set(M.id,{getValue:q,name:B??M.name,controlRef:M.controlRef,validityData:F$(U,H),validate:A})},[K,q,H,B,X,A,U]),J0(()=>{let M=K.current.fields;return()=>{let _=F.current?.id;if(_)M.delete(_)}},[K]);let j=U0((M,_)=>{if(!_){if(Y.current===M)Y.current=null,Z(void 0,!0),D(),F.current=null,X(void 0),z.current=void 0;return}let E=F.current?.id,C=Y.current;if(C&&C!==M)Z(void 0,!0);if(Y.current=M,F.current=_,!B)X(_.name);if(z.current=_.id,E&&E!==_.id)D(E);L(_),V()});return[A,j]}var vU=P(c(),1),r50=w2.forwardRef(function(Z,J){let{errors:H,validationMode:Q,submitCountRef:B}=Z4(),{render:X,className:z,validate:G,validationDebounceTime:U=0,validationMode:K=Q,name:Y,disabled:F=!1,invalid:W,dirty:q,touched:N,actionsRef:A,style:V,...D}=Z,L=BI(!0)?.disabled,j=U0(G||(()=>null)),M=L||F,[_,E]=w2.useState(!1),[C,R]=w2.useState(!1),[T,I]=w2.useState(!1),[y,S]=w2.useState(!1),O=q??C,k=N??_,b=w2.useRef(O),h=w2.useRef(void 0),[v,f]=w2.useState(),w=Y??v;J0(()=>{if(q!==void 0)b.current=q},[q]);let i=U0((F0)=>{if(q!==void 0)return;if(F0)b.current=!0;R(F0)}),r=U0((F0)=>{if(N!==void 0)return;E(F0)}),x=U0(()=>K==="onChange"||K==="onSubmit"&&B.current>0),l=w&&Object.hasOwn(H,w)?H[w]:null,s=!!(Array.isArray(l)?l.length:l),p=W===!0||s,[d,o]=w2.useState({state:Y$,error:"",errors:[],value:null,initialValue:null}),Z0=!p&&(M?null:d.state.valid),H0=w2.useMemo(()=>({disabled:M,touched:k,dirty:O,valid:Z0,filled:T,focused:y}),[M,k,O,Z0,T,y]),G0=UI({setValidityData:o,validate:j,validityData:d,validationDebounceTime:U,invalid:p,markedDirtyRef:b,state:H0,shouldValidateOnChange:x,validationMode:K,registeredFieldIdRef:h}),[X0,Y0]=KI({change:G0.change,commit:G0.commit,invalid:p,markedDirtyRef:b,name:Y,setRegisteredFieldName:f,registeredFieldIdRef:h,setValidityData:o,validityData:d});w2.useImperativeHandle(A,()=>({validate:X0}),[X0]);let A0=w2.useMemo(()=>({invalid:p,name:w,validityData:d,setValidityData:o,disabled:M,setTouched:r,setDirty:i,setFilled:I,setFocused:S,validationMode:K,shouldValidateOnChange:x,state:H0,registerFieldControl:Y0,validation:G0}),[p,w,d,M,r,i,I,S,K,x,H0,Y0,G0]),N0=z0("div",Z,{ref:J,state:H0,props:D,stateAttributesMapping:C2});return vU.jsx(xA.Provider,{value:A0,children:N0})}),YI=w2.forwardRef(function(Z,J){return vU.jsx(xU,{children:vU.jsx(r50,{...Z,ref:J})})});var yQ=P(m(),1);function FI($,Z){let J=t0($);return J0(()=>{return Z(J),()=>{Z((H)=>H===J?void 0:H)}},[J,Z]),J}function gU($={}){let{id:Z,fallbackControlId:J,native:H=!1,setLabelId:Q,focusControl:B}=$,{controlId:X,setLabelId:z}=i5(),G=U0((W)=>{z(W),Q?.(W)}),U=FI(Z,G),K=X??J;function Y(W){if(B){B(W,K);return}if(!K)return;let q=m0(W.currentTarget).getElementById(K);if(P1(q))fU(q)}function F(W){if(M1(W.nativeEvent)?.closest("button,input,select,textarea"))return;if(!W.defaultPrevented&&W.detail>1)W.preventDefault();if(H)return;Y(W)}return H?{id:U,htmlFor:K,onMouseDown:F}:{id:U,onClick:F,onPointerDown(W){W.preventDefault()}}}function fU($){$.focus({focusVisible:!0})}var mU=P(m(),1),fA=mU.createContext({disabled:!1});function UJ(){return mU.useContext(fA)}var WI=yQ.forwardRef(function(Z,J){let{render:H,className:Q,style:B,id:X,nativeLabel:z=!0,...G}=Z,U=l5(!1),K=UJ(),{labelId:Y}=i5(),F={...U.state,disabled:U.disabled||K.disabled},W=yQ.useRef(null),q=gU({id:Y??X,native:z});return z0("label",Z,{ref:[J,W],state:F,props:[q,G],stateAttributesMapping:C2})});var W$=P(m(),1);var mA=P(c(),1),a50={...C2,...Q2},qI=W$.forwardRef(function(Z,J){let{render:H,id:Q,className:B,match:X,style:z,...G}=Z,U=t0(Q),{validityData:K,state:Y,name:F}=l5(!1),{setMessageIds:W}=i5(),{errors:q}=Z4(),N=F&&Object.hasOwn(q,F)?q[F]:null,A=!!(Array.isArray(N)?N.length:N),V=typeof X==="string",D=!1;if(X===!0)D=!0;else if(Y.disabled)D=!1;else if(V)D=Boolean(K.state[X]);else D=A||K.state.valid===!1;let{mounted:L,transitionStatus:j,setMounted:M}=j2(D);J0(()=>{if(!D||!U)return;return W((b)=>b.concat(U)),()=>{W((b)=>b.filter((h)=>h!==U))}},[D,U,W]);let _=W$.useRef(null),[E,C]=W$.useState(null),[R,T]=W$.useState(null),I=K.error;if(!V&&A)I=N;else if(K.errors.length>1)I=K.errors;let y=I;if(Array.isArray(I))y=I.length>1?mA.jsx("ul",{children:I.map((b)=>mA.jsx("li",{children:b},b))}):I[0];let S=Array.isArray(I)?JSON.stringify(I):I;if(D&&S!==R)T(S),C(y);q5({open:D,ref:_,onComplete(){if(!D)M(!1)}});let O={...Y,transitionStatus:j},k=z0("div",Z,{ref:[J,_],state:O,props:[{id:U,children:D?y:E},G],stateAttributesMapping:a50,enabled:L});if(!L)return null;return k});var NI=P(m(),1);var VI=NI.forwardRef(function(Z,J){let{render:H,id:Q,className:B,style:X,...z}=Z,G=t0(Q),U=l5(!1),K=UJ(),{setMessageIds:Y}=i5(),F={...U.state,disabled:U.disabled||K.disabled};return J0(()=>{if(!G)return;return Y((q)=>q.concat(G)),()=>{Y((q)=>q.filter((N)=>N!==G))}},[G,Y]),z0("p",Z,{ref:J,state:F,props:[{id:G},z],stateAttributesMapping:C2})});var uU=P(m(),1);var q$=P(m(),1);function J4({controlled:$,default:Z,name:J,state:H="value"}){let{current:Q}=q$.useRef($!==void 0),[B,X]=q$.useState(Z),z=Q&&$!==void 0?$:B,G=q$.useCallback((U)=>{if(!Q)X(U)},[]);return[z,G]}function w6($,Z,J,H,Q=!0,B){let{registerFieldControl:X}=l5(),z=l1(()=>Symbol());J0(()=>{let G=z.current;if(!Q){X(G,void 0);return}X(G,{controlRef:$,getValue:H,id:Z,name:B,value:J})},[$,Q,H,Z,B,X,z,J]),J0(()=>{let G=z.current;return()=>{X(G,void 0)}},[X,z])}var uA=P(m(),1);function E6($={}){let{id:Z,enabled:J=!0}=$,{controlId:H,registerControlId:Q,resetControlId:B}=i5(),X=t0(),z=l1(()=>Symbol()),G=uA.useRef(!1),U=uA.useRef(!1),K=U0(()=>{if(!G.current||Q===X1)return;G.current=!1,Q(z.current,void 0)});return J0(()=>{if(!J||Q===X1){K();return}let Y;if(Z!==void 0)U.current=!0,Y=Z;else if(U.current)Y=X;else{B();return}if(Y===void 0){K();return}G.current=!0,Q(z.current,Y);return},[Z,J,Q,B,X,z,K]),J0(()=>{return K},[K]),(J?H:void 0)??Z??X}var AI=uU.forwardRef(function(Z,J){let{render:H,className:Q,id:B,name:X,value:z,disabled:G=!1,onValueChange:U,defaultValue:K,autoFocus:Y=!1,style:F,...W}=Z,{state:q,name:N,disabled:A,setTouched:V,setDirty:D,validityData:L,setFocused:j,setFilled:M,validationMode:_,validation:E}=l5(),{clearErrors:C,elementRef:R,submitCountRef:T}=Z4(),I=A||G,y=N??X,S={...q,disabled:I},{labelId:O}=i5(),k=E6({id:B}),[b]=J4({controlled:z,default:K,name:"FieldControl",state:"value"}),h=z!==void 0,v=h?b:void 0,f=v==null?void 0:String(v),w=U0(()=>E.inputRef.current?.value);w6(E.inputRef,k,f,w,!I,X),J0(()=>{let l=f??E.inputRef.current?.value;if(l!==void 0)M(l!=="")},[f,E.inputRef,M]),h9(f,()=>{if(f===void 0)return;C(y),D(f!==(L.initialValue??"")),E.change(f)});let i=uU.useRef(null),r=d1();return J0(()=>{if(Y&&i.current===p1(m0(i.current)))j(!0)},[Y,j]),z0("input",Z,{ref:[J,i],state:S,props:[{id:k,disabled:I,name:y,ref:E.inputRef,"aria-labelledby":O,autoFocus:Y,...h?{value:v}:{defaultValue:K},onChange(l){let s=l.currentTarget.value,p=R0(K0.none,l.nativeEvent);if(U?.(s,p),h)return;if(D(s!==(L.initialValue??"")),M(s!==""),!l.nativeEvent.defaultPrevented&&!p.isCanceled)C(y),E.change(s)},onFocus(){j(!0)},onBlur(l){if(V(!0),j(!1),_==="onBlur"){let s=l.currentTarget.value;if(E.commit(s),h)queueMicrotask(()=>{let p=E.inputRef.current?.value;if(p!==void 0&&p!==s&&p!==(L.initialValue??""))E.commit(p)})}},onKeyDown(l){if(l.currentTarget.tagName==="INPUT"&&l.key==="Enter"){V(!0);let s=l.currentTarget.value,p=l.currentTarget.form;if(p&&p===R.current&&!l.defaultPrevented){let d=l.currentTarget,o=T.current;r.start(0,()=>{if(T.current===o)E.commit(d.value)})}else E.commit(s)}}},W,(l)=>E.getValidationProps(I,l)],stateAttributesMapping:C2})});var xQ=P(m(),1);var DI=P(c(),1),LI=function(Z){let{children:J}=Z,{validityData:H,invalid:Q}=l5(!1),B=xQ.useMemo(()=>F$(H,Q),[H,Q]),X=B.state.valid===!1,{transitionStatus:z}=j2(X),G=xQ.useMemo(()=>{return{...B,validity:B.state,transitionStatus:z}},[B,z]);return DI.jsx(xQ.Fragment,{children:J(G)})};var pU=P(m(),1);var pA=P(c(),1),MI=pU.forwardRef(function(Z,J){let{render:H,className:Q,style:B,disabled:X=!1,...z}=Z,{state:G,disabled:U}=l5(!1),K=U||X,Y={...G,disabled:K},F=pU.useMemo(()=>({disabled:K}),[K]),W=z0("div",Z,{ref:J,state:Y,props:z,stateAttributesMapping:C2});return pA.jsx(xU,{children:pA.jsx(fA.Provider,{value:F,children:W})})});var _I=P(c(),1),hQ=PI.forwardRef(function(Z,J){return _I.jsx(cU.Control,{ref:J,...Z})});var jI=P(c(),1);function N$({className:$,type:Z,...J}){return jI.jsx(hQ,{type:Z,"data-slot":"input",className:a0("h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base 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",$),...J})}function OI($){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 KJ=["claude-code","codex","openclaw","hermes"];var YJ=P(m(),1);var dU="/claude-z2xnay0d.svg";var TI="/floppy-disk-wmjs0n85.webp";var lU="/hermes-pznd63x9.png";var iU="/openai-ep9ht2pq.svg";var rU="/openclaw-a2pyfhpn.svg";var K1=P(c(),1),RI="Set up the moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function FJ({trigger:$,open:Z,onOpenChange:J}){return K1.jsxs(O6,{open:Z,onOpenChange:J,children:[$&&K1.jsx(w3,{render:$}),K1.jsx(J20,{})]})}var CI=2;function $20({demoInstallUrl:$}){let Z=YJ.useRef(null);return K1.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(Q)=>{if(!Z.current)return;let B=Q.currentTarget.getBoundingClientRect(),X=(Q.clientX-B.left)/B.width-0.5,z=(Q.clientY-B.top)/B.height-0.5;Z.current.style.setProperty("--floppy-x",`${X*-2*CI}px`),Z.current.style.setProperty("--floppy-y",`${z*-2*CI}px`)},onMouseLeave:()=>{Z.current?.style.removeProperty("--floppy-x"),Z.current?.style.removeProperty("--floppy-y")},children:K1.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:[K1.jsx("img",{src:TI,alt:"",className:"w-full drop-shadow-xl"}),K1.jsxs("div",{className:V$({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About moi",K1.jsx(wI,{"data-icon":"inline-end",stroke:1.5})]})]})})}function Z20(){let[$,Z]=YJ.useState(!1);return YJ.useEffect(()=>{if(!$)return;let H=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(H)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText(RI).then(()=>Z(!0)).catch(()=>{})}}}function J20(){let{demoInstallUrl:$}=T8(),{copied:Z,copy:J}=Z20();return K1.jsxs(zJ,{"data-vivid":!0,showCloseButton:!1,className:"block w-full max-w-md overflow-hidden rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground sm:max-w-md md:max-w-2xl",children:[K1.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))]"}),K1.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[K1.jsx("filter",{id:"floppy-grain",children:K1.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),K1.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),K1.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[K1.jsxs("div",{className:"rounded-xl bg-background p-6 text-foreground shadow-sm md:p-8",children:[K1.jsxs("div",{className:"flex flex-col gap-0.5",children:[K1.jsx(T6,{children:"Unlock all features"}),K1.jsx(GJ,{className:"mt-1",children:"This is a demo version with sample workspaces. Install moi locally and connect to your agent."})]}),K1.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[K1.jsxs("li",{className:"flex items-center gap-3",children:[K1.jsx(EI,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),K1.jsx("span",{className:"text-sm text-foreground",children:"Connect your own data sources and work on existing projects"})]}),K1.jsxs("li",{className:"flex items-center gap-3",children:[K1.jsx(SI,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),K1.jsxs("span",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-sm text-foreground",children:[K1.jsx("span",{children:"Build with"}),K1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[K1.jsx("img",{src:dU,alt:"",className:"size-3.5 object-contain"}),"Claude Code,"]}),K1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[K1.jsx("img",{src:iU,alt:"",className:"size-3.5 object-contain"}),"Codex,"]}),K1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[K1.jsx("img",{src:lU,alt:"",className:"size-3.5 object-contain"}),"Hermes,"]}),K1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[K1.jsx("img",{src:rU,alt:"",className:"size-3.5 object-contain"}),"OpenClaw,"]}),K1.jsx("span",{children:"and more"})]})]})]}),K1.jsxs("div",{className:"mt-8 flex flex-col gap-3 pb-4",children:[K1.jsx("p",{className:"text-sm text-muted-foreground",children:"Give this prompt to your agent:"}),K1.jsxs("div",{className:"relative rounded-lg bg-muted p-4 pb-8 ring-1 ring-border",children:[K1.jsx("code",{className:"block font-mono text-sm leading-relaxed text-foreground",children:RI}),K1.jsxs(j0,{type:"button",onClick:J,className:"absolute right-4 -bottom-4",children:[Z?K1.jsx(O8,{"data-icon":"inline-start",stroke:1.5}):K1.jsx(aU,{"data-icon":"inline-start",stroke:1.5}),Z?"Copied":"Copy prompt"]})]})]})]}),K1.jsx($20,{demoInstallUrl:$})]}),K1.jsx(kQ,{render:K1.jsx(j0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:K1.jsx(o5,{stroke:1.5})})})]})}var tk=P(m(),1);var nk=P(m(),1);var vQ=["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","dots","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"],H20=new Set(vQ);function II($){return H20.has($)}var yb={rocket:Pb,sparkles:Tb,bolt:gQ,flame:$b,star:Cb,heart:Xb,diamond:tI,trophy:Ib,target:Eb,bulb:mI,brain:vI,robot:Mb,wand:bb,atom:yI,flask:Zb,cpu:aI,code:iI,terminal:Sb,api:kI,database:nI,cube:oI,hexagon:zb,plug:Lb,tool:Rb,settings:S6,dots:oU,bug:fI,activity:bI,chart:cI,briefcase:gI,folder:Jb,file:WJ,book:hI,message:Fb,mail:Kb,bell:xI,paperclip:sU,key:nU,shield:_b,user:$U,home:Gb,globe:Bb,world:kb,planet:Db,compass:rI,map:Yb,calendar:uI,cloud:lI,sun:wb,moon:Wb,snowflake:Ob,leaf:Ub,mountain:qb,feather:eI,ghost:Hb,music:Nb,piano:tU,camera:pI,photo:Ab,palette:Vb,gamepad:sI,gift:Qb,cart:jb,chef:dI},xb=vQ.map(($)=>({id:$,Icon:yb[$]}));function A$($){return $&&II($)?yb[$]:null}var Q20=($,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}},eU=Q20;var B20={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},hb=B20;var X20=($)=>{return eU(hb[$.toLowerCase()],6)},vb=X20;var z20=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,G20=($)=>{let Z;return(Z=$.match(z20))?eU(parseInt(Z[1],16),Z[1].length):void 0},gb=G20;var $K="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var D$="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var fQ="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var fb="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var R6="\\s*,\\s*";var zm0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var U20=new RegExp(`^rgba?\\(\\s*${$K}${R6}${$K}${R6}${$K}\\s*(?:,\\s*${fQ}\\s*)?\\)$`),K20=new RegExp(`^rgba?\\(\\s*${D$}${R6}${D$}${R6}${D$}\\s*(?:,\\s*${fQ}\\s*)?\\)$`),Y20=($)=>{let Z={mode:"rgb"},J;if(J=$.match(U20)){if(J[1]!==void 0)Z.r=J[1]/255;if(J[2]!==void 0)Z.g=J[2]/255;if(J[3]!==void 0)Z.b=J[3]/255}else if(J=$.match(K20)){if(J[1]!==void 0)Z.r=J[1]/100;if(J[2]!==void 0)Z.g=J[2]/100;if(J[3]!==void 0)Z.b=J[3]/100}else return;if(J[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,J[4]/100));else if(J[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+J[5]));return Z},mb=Y20;var F20=($,Z)=>$===void 0?void 0:typeof $!=="object"?pb($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,ub=F20;var W20=($="rgb")=>(Z)=>(Z=ub(Z,$))!==void 0?Z.mode===$?Z:e8[Z.mode][$]?e8[Z.mode][$](Z):$==="rgb"?e8[Z.mode].rgb(Z):e8.rgb[$](e8[Z.mode].rgb(Z)):void 0,ZK=W20;var e8={},cb={},mQ=[],cA={},q20=($)=>$,$5=($)=>{if(e8[$.mode]={...e8[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!e8[Z])e8[Z]={};e8[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=q20}),cb[$.mode]=$,($.parse||[]).forEach((Z)=>{N20(Z,$.mode)}),ZK($.mode)},db=($)=>cb[$],N20=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");cA[$]=Z}else if(typeof $==="function"){if(mQ.indexOf($)<0)mQ.push($)}};var dA=/[^\x00-\x7F]|[a-zA-Z_]/,V20=/[^\x00-\x7F]|[-\w]/,O0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},Y1=0;function JK($){let Z=$[Y1],J=$[Y1+1];if(Z==="-"||Z==="+")return/\d/.test(J)||J==="."&&/\d/.test($[Y1+2]);if(Z===".")return/\d/.test(J);return/\d/.test(Z)}function lA($){if(Y1>=$.length)return!1;let Z=$[Y1];if(dA.test(Z))return!0;if(Z==="-"){if($.length-Y1<2)return!1;let J=$[Y1+1];if(J==="-"||dA.test(J))return!0;return!1}return!1}var A20={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function uQ($){let Z="";if($[Y1]==="-"||$[Y1]==="+")Z+=$[Y1++];if(Z+=HK($),$[Y1]==="."&&/\d/.test($[Y1+1]))Z+=$[Y1++]+HK($);if($[Y1]==="e"||$[Y1]==="E"){if(($[Y1+1]==="-"||$[Y1+1]==="+")&&/\d/.test($[Y1+2]))Z+=$[Y1++]+$[Y1++]+HK($);else if(/\d/.test($[Y1+1]))Z+=$[Y1++]+HK($)}if(lA($)){let J=QK($);if(J==="deg"||J==="rad"||J==="turn"||J==="grad")return{type:O0.Hue,value:Z*A20[J]};return}if($[Y1]==="%")return Y1++,{type:O0.Percentage,value:+Z};return{type:O0.Number,value:+Z}}function HK($){let Z="";while(/\d/.test($[Y1]))Z+=$[Y1++];return Z}function QK($){let Z="";while(Y1<$.length&&V20.test($[Y1]))Z+=$[Y1++];return Z}function D20($){let Z=QK($);if($[Y1]==="(")return Y1++,{type:O0.Function,value:Z};if(Z==="none")return{type:O0.None,value:void 0};return{type:O0.Ident,value:Z}}function L20($=""){let Z=$.trim(),J=[],H;Y1=0;while(Y1<Z.length){if(H=Z[Y1++],H===`
|
|
12
|
-
`||H==="\t"||H===" "){while(Y1<Z.length&&(Z[Y1]===`
|
|
13
|
-
`||Z[Y1]==="\t"||Z[Y1]===" "))Y1++;continue}if(H===",")return;if(H===")"){J.push({type:O0.ParenClose});continue}if(H==="+"){if(Y1--,JK(Z)){J.push(uQ(Z));continue}return}if(H==="-"){if(Y1--,JK(Z)){J.push(uQ(Z));continue}if(lA(Z)){J.push({type:O0.Ident,value:QK(Z)});continue}return}if(H==="."){if(Y1--,JK(Z)){J.push(uQ(Z));continue}return}if(H==="/"){while(Y1<Z.length&&(Z[Y1]===`
|
|
14
|
-
`||Z[Y1]==="\t"||Z[Y1]===" "))Y1++;let Q;if(JK(Z)){if(Q=uQ(Z),Q.type!==O0.Hue){J.push({type:O0.Alpha,value:Q});continue}}if(lA(Z)){if(QK(Z)==="none"){J.push({type:O0.Alpha,value:{type:O0.None,value:void 0}});continue}}return}if(/\d/.test(H)){Y1--,J.push(uQ(Z));continue}if(dA.test(H)){Y1--,J.push(D20(Z));continue}return}return J}function M20($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==O0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==O0.Ident)return;let J=cA[Z.value];if(!J)return;let H={mode:J},Q=lb($,!1);if(!Q)return;let B=db(J).channels;for(let X=0,z,G;X<B.length;X++)if(z=Q[X],G=B[X],z.type!==O0.None){if(H[G]=z.type===O0.Number?z.value:z.value/100,G==="alpha")H[G]=Math.max(0,Math.min(1,H[G]))}return H}function lb($,Z){let J=[],H;while($._i<$.length){if(H=$[$._i++],H.type===O0.None||H.type===O0.Number||H.type===O0.Alpha||H.type===O0.Percentage||Z&&H.type===O0.Hue){J.push(H);continue}if(H.type===O0.ParenClose){if($._i<$.length)return;continue}return}if(J.length<3||J.length>4)return;if(J.length===4){if(J[3].type!==O0.Alpha)return;J[3]=J[3].value}if(J.length===3)J.push({type:O0.None,value:void 0});return J.every((Q)=>Q.type!==O0.Alpha)?J:void 0}function P20($,Z){$._i=0;let J=$[$._i++];if(!J||J.type!==O0.Function)return;let H=lb($,Z);if(!H)return;return H.unshift(J.value),H}var _20=($)=>{if(typeof $!=="string")return;let Z=L20($),J=Z?P20(Z,!0):void 0,H=void 0,Q=0,B=mQ.length;while(Q<B)if((H=mQ[Q++]($,J))!==void 0)return H;return Z?M20(Z):void 0},pb=_20;function j20($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let J={mode:"rgb"},[,H,Q,B,X]=Z;if(H.type===O0.Hue||Q.type===O0.Hue||B.type===O0.Hue)return;if(H.type!==O0.None)J.r=H.type===O0.Number?H.value/255:H.value/100;if(Q.type!==O0.None)J.g=Q.type===O0.Number?Q.value/255:Q.value/100;if(B.type!==O0.None)J.b=B.type===O0.Number?B.value/255:B.value/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var ib=j20;var O20=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,rb=O20;var ab=($,Z,J)=>$+J*(Z-$);var T20=($)=>{let Z=[];for(let J=0;J<$.length-1;J++){let H=$[J],Q=$[J+1];if(H===void 0&&Q===void 0)Z.push(void 0);else if(H!==void 0&&Q!==void 0)Z.push([H,Q]);else Z.push(H!==void 0?[H,H]:[Q,Q])}return Z},ob=($)=>(Z)=>{let J=T20(Z);return(H)=>{let Q=H*J.length,B=H>=1?J.length-1:Math.max(Math.floor(Q),0),X=J[B];return X===void 0?void 0:$(X[0],X[1],Q-B)}};var w0=ob(ab);var y1=($)=>{let Z=!1,J=$.map((H)=>{if(H!==void 0)return Z=!0,H;return 1});return Z?J:$};var C20={mode:"rgb",channels:["r","g","b","alpha"],parse:[ib,gb,mb,vb,rb,"srgb"],serialize:"srgb",interpolate:{r:w0,g:w0,b:w0,alpha:{use:w0,fixup:y1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},C8=C20;var iA=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),w20=($)=>{let Z=iA($.r),J=iA($.g),H=iA($.b),Q={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*J+0.1882286462349947*H,y:0.297344975250536*Z+0.6273635662554661*J+0.0752914584939979*H,z:0.0270313613864123*Z+0.0706888525358272*J+0.9913375368376386*H};if($.alpha!==void 0)Q.alpha=$.alpha;return Q},rA=w20;var aA=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),E20=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q={mode:"a98",r:aA($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*J),g:aA($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*J),b:aA($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*J)};if(H!==void 0)Q.alpha=H;return Q},oA=E20;var nA=($=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)},S20=({r:$,g:Z,b:J,alpha:H})=>{let Q={mode:"lrgb",r:nA($),g:nA(Z),b:nA(J)};if(H!==void 0)Q.alpha=H;return Q},w8=S20;var R20=($)=>{let{r:Z,g:J,b:H,alpha:Q}=w8($),B={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*J+0.1804807884018343*H,y:0.2126390058715102*Z+0.715168678767756*J+0.0721923153607337*H,z:0.0193308187155918*Z+0.119194779794626*J+0.9505321522496607*H};if(Q!==void 0)B.alpha=Q;return B},m4=R20;var sA=($=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},I20=({r:$,g:Z,b:J,alpha:H},Q="rgb")=>{let B={mode:Q,r:sA($),g:sA(Z),b:sA(J)};if(H!==void 0)B.alpha=H;return B},E8=I20;var b20=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=E8({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*J,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*J,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*J});if(H!==void 0)Q.alpha=H;return Q},u4=b20;var k20={...C8,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>oA(m4($)),xyz65:oA},toMode:{rgb:($)=>u4(rA($)),xyz65:rA}},nb=k20;var y20=($)=>($=$%360)<0?$+360:$,D5=y20;var x20=($,Z)=>{return $.map((J,H,Q)=>{if(J===void 0)return J;let B=D5(J);if(H===0||$[H-1]===void 0)return B;return Z(B-D5(Q[H-1]))}).reduce((J,H)=>{if(!J.length||H===void 0||J[J.length-1]===void 0)return J.push(H),J;return J.push(H+J[J.length-1]),J},[])},E2=($)=>x20($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var z2=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],sb=Math.PI/180,tb=180/Math.PI;var eb=z2[3]*z2[4],$k=z2[1]*z2[4],Zk=z2[1]*z2[2]-z2[0]*z2[3],h20=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=(Zk*J+$*eb-Z*$k)/(Zk+eb-$k),B=J-Q,X=(z2[4]*(Z-Q)-z2[2]*B)/z2[3],z={mode:"cubehelix",l:Q,s:Q===0||Q===1?void 0:Math.sqrt(B*B+X*X)/(z2[4]*Q*(1-Q))};if(z.s)z.h=Math.atan2(X,B)*tb-120;if(H!==void 0)z.alpha=H;return z},Jk=h20;var v20=({h:$,s:Z,l:J,alpha:H})=>{let Q={mode:"rgb"};if($=($===void 0?0:$+120)*sb,J===void 0)J=0;let B=Z===void 0?0:Z*J*(1-J),X=Math.cos($),z=Math.sin($);if(Q.r=J+B*(z2[0]*X+z2[1]*z),Q.g=J+B*(z2[2]*X+z2[3]*z),Q.b=J+B*(z2[4]*X+z2[5]*z),H!==void 0)Q.alpha=H;return Q},Hk=v20;var I6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let J=D5($.h),H=D5(Z.h),Q=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*Q},Qk=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let J=D5($.h),H=D5(Z.h);if(Math.abs(H-J)>180)return J-(H-360*Math.sign(H-J));return H-J},b6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let J=D5($.h),H=D5(Z.h),Q=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*Q};var S2=($)=>{let Z=$.reduce((H,Q)=>{if(Q!==void 0){let B=Q*Math.PI/180;H.sin+=Math.sin(B),H.cos+=Math.cos(B)}return H},{sin:0,cos:0}),J=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return J<0?360+J:J};var g20={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:Jk},toMode:{rgb:Hk},interpolate:{h:{use:w0,fixup:E2},s:w0,l:w0,alpha:{use:w0,fixup:y1}},difference:{h:I6},average:{h:S2}},Bk=g20;var f20=({l:$,a:Z,b:J,alpha:H},Q="lch")=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.sqrt(Z*Z+J*J),X={mode:Q,l:$,c:B};if(B)X.h=D5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)X.alpha=H;return X},Q8=f20;var m20=({l:$,c:Z,h:J,alpha:H},Q="lab")=>{if(J===void 0)J=0;let B={mode:Q,l:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},B8=m20;var BK=Math.pow(29,3)/Math.pow(3,3),XK=Math.pow(6,3)/Math.pow(29,3);var f5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},k6={X:0.9504559270516716,Y:1,Z:1.0890577507598784},Mu0=Math.pow(29,3)/Math.pow(3,3),Pu0=Math.pow(6,3)/Math.pow(29,3);var tA=($)=>Math.pow($,3)>XK?Math.pow($,3):(116*$-16)/BK,u20=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=($+16)/116,B=Z/500+Q,X=Q-J/200,z={mode:"xyz65",x:tA(B)*k6.X,y:tA(Q)*k6.Y,z:tA(X)*k6.Z};if(H!==void 0)z.alpha=H;return z},zK=u20;var p20=($)=>u4(zK($)),y6=p20;var eA=($)=>$>XK?Math.cbrt($):(BK*$+16)/116,c20=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=eA($/k6.X),B=eA(Z/k6.Y),X=eA(J/k6.Z),z={mode:"lab65",l:116*B-16,a:500*(Q-B),b:200*(B-X)};if(H!==void 0)z.alpha=H;return z},GK=c20;var d20=($)=>{let Z=GK(m4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},x6=d20;var qJ=1,UK=1,L$=0.14444444444444443*Math.PI,NJ=Math.cos(L$),VJ=Math.sin(L$),KK=100/Math.log(1.39);var l20=({l:$,c:Z,h:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q={mode:"lab65",l:(Math.exp($*qJ/KK)-1)/0.0039},B=(Math.exp(0.0435*Z*UK*qJ)-1)/0.075,X=B*Math.cos(J/180*Math.PI-L$),z=B*Math.sin(J/180*Math.PI-L$);if(Q.a=X*NJ-z/0.83*VJ,Q.b=X*VJ+z/0.83*NJ,H!==void 0)Q.alpha=H;return Q},pQ=l20;var i20=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Z*NJ+J*VJ,B=0.83*(J*NJ-Z*VJ),X=Math.sqrt(Q*Q+B*B),z={mode:"dlch",l:KK/qJ*Math.log(1+0.0039*$),c:Math.log(1+0.075*X)/(0.0435*UK*qJ)};if(z.c)z.h=D5((Math.atan2(B,Q)+L$)/Math.PI*180);if(H!==void 0)z.alpha=H;return z},cQ=i20;var Xk=($)=>pQ(Q8($,"dlch")),zk=($)=>B8(cQ($),"dlab"),r20={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Xk,rgb:($)=>y6(Xk($))},fromMode:{lab65:zk,rgb:($)=>zk(x6($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:w0,a:w0,b:w0,alpha:{use:w0,fixup:y1}}},Gk=r20;var a20={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:pQ,dlab:($)=>B8($,"dlab"),rgb:($)=>y6(pQ($))},fromMode:{lab65:cQ,dlab:($)=>Q8($,"dlch"),rgb:($)=>cQ(x6($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:w0,c:w0,h:{use:w0,fixup:E2},alpha:{use:w0,fixup:y1}},difference:{h:b6},average:{h:S2}},Uk=a20;function $D({h:$,s:Z,i:J,alpha:H}){if($=D5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.abs($/60%2-1),B;switch(Math.floor($/60)){case 0:B={r:J*(1+Z*(3/(2-Q)-1)),g:J*(1+Z*(3*(1-Q)/(2-Q)-1)),b:J*(1-Z)};break;case 1:B={r:J*(1+Z*(3*(1-Q)/(2-Q)-1)),g:J*(1+Z*(3/(2-Q)-1)),b:J*(1-Z)};break;case 2:B={r:J*(1-Z),g:J*(1+Z*(3/(2-Q)-1)),b:J*(1+Z*(3*(1-Q)/(2-Q)-1))};break;case 3:B={r:J*(1-Z),g:J*(1+Z*(3*(1-Q)/(2-Q)-1)),b:J*(1+Z*(3/(2-Q)-1))};break;case 4:B={r:J*(1+Z*(3*(1-Q)/(2-Q)-1)),g:J*(1-Z),b:J*(1+Z*(3/(2-Q)-1))};break;case 5:B={r:J*(1+Z*(3/(2-Q)-1)),g:J*(1-Z),b:J*(1+Z*(3*(1-Q)/(2-Q)-1))};break;default:B={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(B.mode="rgb",H!==void 0)B.alpha=H;return B}function ZD({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.max($,Z,J),B=Math.min($,Z,J),X={mode:"hsi",s:$+Z+J===0?0:1-3*B/($+Z+J),i:($+Z+J)/3};if(Q-B!==0)X.h=(Q===$?(Z-J)/(Q-B)+(Z<J)*6:Q===Z?(J-$)/(Q-B)+2:($-Z)/(Q-B)+4)*60;if(H!==void 0)X.alpha=H;return X}var o20={mode:"hsi",toMode:{rgb:$D},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:ZD},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:w0,fixup:E2},s:w0,i:w0,alpha:{use:w0,fixup:y1}},difference:{h:I6},average:{h:S2}},Kk=o20;function JD({h:$,s:Z,l:J,alpha:H}){if($=D5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let Q=J+Z*(J<0.5?J:1-J),B=Q-(Q-J)*2*Math.abs($/60%2-1),X;switch(Math.floor($/60)){case 0:X={r:Q,g:B,b:2*J-Q};break;case 1:X={r:B,g:Q,b:2*J-Q};break;case 2:X={r:2*J-Q,g:Q,b:B};break;case 3:X={r:2*J-Q,g:B,b:Q};break;case 4:X={r:B,g:2*J-Q,b:Q};break;case 5:X={r:Q,g:2*J-Q,b:B};break;default:X={r:2*J-Q,g:2*J-Q,b:2*J-Q}}if(X.mode="rgb",H!==void 0)X.alpha=H;return X}function HD({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.max($,Z,J),B=Math.min($,Z,J),X={mode:"hsl",s:Q===B?0:(Q-B)/(1-Math.abs(Q+B-1)),l:0.5*(Q+B)};if(Q-B!==0)X.h=(Q===$?(Z-J)/(Q-B)+(Z<J)*6:Q===Z?(J-$)/(Q-B)+2:($-Z)/(Q-B)+4)*60;if(H!==void 0)X.alpha=H;return X}var n20=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},Yk=n20;var s20=new RegExp(`^hsla?\\(\\s*${fb}${R6}${D$}${R6}${D$}\\s*(?:,\\s*${fQ}\\s*)?\\)$`),t20=($)=>{let Z=$.match(s20);if(!Z)return;let J={mode:"hsl"};if(Z[3]!==void 0)J.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)J.h=Yk(Z[1],Z[2]);if(Z[4]!==void 0)J.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)J.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)J.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)J.alpha=Math.max(0,Math.min(1,+Z[7]));return J},Fk=t20;function e20($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let J={mode:"hsl"},[,H,Q,B,X]=Z;if(H.type!==O0.None){if(H.type===O0.Percentage)return;J.h=H.value}if(Q.type!==O0.None){if(Q.type===O0.Hue)return;J.s=Q.value/100}if(B.type!==O0.None){if(B.type===O0.Hue)return;J.l=B.value/100}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var Wk=e20;var $40={mode:"hsl",toMode:{rgb:JD},fromMode:{rgb:HD},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Wk,Fk],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:w0,fixup:E2},s:w0,l:w0,alpha:{use:w0,fixup:y1}},difference:{h:I6},average:{h:S2}},YK=$40;function dQ({h:$,s:Z,v:J,alpha:H}){if($=D5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.abs($/60%2-1),B;switch(Math.floor($/60)){case 0:B={r:J,g:J*(1-Z*Q),b:J*(1-Z)};break;case 1:B={r:J*(1-Z*Q),g:J,b:J*(1-Z)};break;case 2:B={r:J*(1-Z),g:J,b:J*(1-Z*Q)};break;case 3:B={r:J*(1-Z),g:J*(1-Z*Q),b:J};break;case 4:B={r:J*(1-Z*Q),g:J*(1-Z),b:J};break;case 5:B={r:J,g:J*(1-Z),b:J*(1-Z*Q)};break;default:B={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(B.mode="rgb",H!==void 0)B.alpha=H;return B}function lQ({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.max($,Z,J),B=Math.min($,Z,J),X={mode:"hsv",s:Q===0?0:1-B/Q,v:Q};if(Q-B!==0)X.h=(Q===$?(Z-J)/(Q-B)+(Z<J)*6:Q===Z?(J-$)/(Q-B)+2:($-Z)/(Q-B)+4)*60;if(H!==void 0)X.alpha=H;return X}var Z40={mode:"hsv",toMode:{rgb:dQ},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:lQ},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:w0,fixup:E2},s:w0,v:w0,alpha:{use:w0,fixup:y1}},difference:{h:I6},average:{h:S2}},FK=Z40;function QD({h:$,w:Z,b:J,alpha:H}){if(Z===void 0)Z=0;if(J===void 0)J=0;if(Z+J>1){let Q=Z+J;Z/=Q,J/=Q}return dQ({h:$,s:J===1?1:1-Z/(1-J),v:1-J,alpha:H})}function BD($){let Z=lQ($);if(Z===void 0)return;let J=Z.s!==void 0?Z.s:0,H=Z.v!==void 0?Z.v:0,Q={mode:"hwb",w:(1-J)*H,b:1-H};if(Z.h!==void 0)Q.h=Z.h;if(Z.alpha!==void 0)Q.alpha=Z.alpha;return Q}function J40($,Z){if(!Z||Z[0]!=="hwb")return;let J={mode:"hwb"},[,H,Q,B,X]=Z;if(H.type!==O0.None){if(H.type===O0.Percentage)return;J.h=H.value}if(Q.type!==O0.None){if(Q.type===O0.Hue)return;J.w=Q.value/100}if(B.type!==O0.None){if(B.type===O0.Hue)return;J.b=B.value/100}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var qk=J40;var H40={mode:"hwb",toMode:{rgb:QD},fromMode:{rgb:BD},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[qk],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:w0,fixup:E2},w:w0,b:w0,alpha:{use:w0,fixup:y1}},difference:{h:Qk},average:{h:S2}},Nk=H40;var WK=203;var qK=0.1593017578125;var NK=0.8359375,VK=18.8515625,AK=18.6875;function DK($){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 LK($){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 XD=($)=>Math.max($/WK,0),Q40=({i:$,t:Z,p:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=DK($+0.008609037037932761*Z+0.11102962500302593*J),B=DK($-0.00860903703793275*Z-0.11102962500302599*J),X=DK($+0.5600313357106791*Z-0.32062717498731885*J),z={mode:"xyz65",x:XD(2.070152218389422*Q-1.3263473389671556*B+0.2066510476294051*X),y:XD(0.3647385209748074*Q+0.680566024947227*B-0.0453045459220346*X),z:XD(-0.049747207535812*Q-0.0492609666966138*B+1.1880659249923042*X)};if(H!==void 0)z.alpha=H;return z},zD=Q40;var GD=($=0)=>Math.max($*WK,0),B40=({x:$,y:Z,z:J,alpha:H})=>{let Q=GD($),B=GD(Z),X=GD(J),z=LK(0.3592832590121217*Q+0.6976051147779502*B-0.0358915932320289*X),G=LK(-0.1920808463704995*Q+1.1004767970374323*B+0.0753748658519118*X),U=LK(0.0070797844607477*Q+0.0748396662186366*B+0.8433265453898765*X),K=0.5*z+0.5*G,Y=1.61376953125*z-3.323486328125*G+1.709716796875*U,F=4.378173828125*z-4.24560546875*G-0.132568359375*U,W={mode:"itp",i:K,t:Y,p:F};if(H!==void 0)W.alpha=H;return W},UD=B40;var X40={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:zD,rgb:($)=>u4(zD($))},fromMode:{xyz65:UD,rgb:($)=>UD(m4($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:w0,t:w0,p:w0,alpha:{use:w0,fixup:y1}}},Vk=X40;var z40=134.03437499999998,G40=0.000000000016295499532821565,KD=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,qK);return Math.pow((NK+VK*Z)/(1+AK*Z),z40)},YD=($=0)=>Math.max($*203,0),U40=({x:$,y:Z,z:J,alpha:H})=>{$=YD($),Z=YD(Z),J=YD(J);let Q=1.15*$-0.15*J,B=0.66*Z+0.34*$,X=KD(0.41478972*Q+0.579999*B+0.014648*J),z=KD(-0.20151*Q+1.120649*B+0.0531008*J),G=KD(-0.0166008*Q+0.2648*B+0.6684799*J),U=(X+z)/2,K={mode:"jab",j:0.44*U/(1-0.56*U)-G40,a:3.524*X-4.066708*z+0.542708*G,b:0.199076*X+1.096799*z-1.295875*G};if(H!==void 0)K.alpha=H;return K},MK=U40;var K40=134.03437499999998,Ak=0.000000000016295499532821565,FD=($)=>{if($<0)return 0;let Z=Math.pow($,1/K40);return 1e4*Math.pow((NK-Z)/(AK*Z-VK),1/qK)},WD=($)=>$/203,Y40=({j:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=($+Ak)/(0.44+0.56*($+Ak)),B=FD(Q+0.13860504*Z+0.058047316*J),X=FD(Q-0.13860504*Z-0.058047316*J),z=FD(Q-0.096019242*Z-0.8118919*J),G={mode:"xyz65",x:WD(1.661373024652174*B-0.914523081304348*X+0.23136208173913045*z),y:WD(-0.3250758611844533*B+1.571847026732543*X-0.21825383453227928*z),z:WD(-0.090982811*B-0.31272829*X+1.5227666*z)};if(H!==void 0)G.alpha=H;return G},PK=Y40;var F40=($)=>{let Z=MK(m4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},_K=F40;var W40=($)=>u4(PK($)),jK=W40;var q40={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:_K,xyz65:MK},toMode:{rgb:jK,xyz65:PK},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:w0,a:w0,b:w0,alpha:{use:w0,fixup:y1}}},Dk=q40;var N40=({j:$,a:Z,b:J,alpha:H})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.sqrt(Z*Z+J*J),B={mode:"jch",j:$,c:Q};if(Q)B.h=D5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)B.alpha=H;return B},qD=N40;var V40=({j:$,c:Z,h:J,alpha:H})=>{if(J===void 0)J=0;let Q={mode:"jab",j:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)Q.alpha=H;return Q},ND=V40;var A40={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:ND,rgb:($)=>jK(ND($))},fromMode:{rgb:($)=>qD(_K($)),jab:qD},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:w0,fixup:E2},c:w0,j:w0,alpha:{use:w0,fixup:y1}},difference:{h:b6},average:{h:S2}},Lk=A40;var h6=Math.pow(29,3)/Math.pow(3,3),AJ=Math.pow(6,3)/Math.pow(29,3);var VD=($)=>Math.pow($,3)>AJ?Math.pow($,3):(116*$-16)/h6,D40=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=($+16)/116,B=Z/500+Q,X=Q-J/200,z={mode:"xyz50",x:VD(B)*f5.X,y:VD(Q)*f5.Y,z:VD(X)*f5.Z};if(H!==void 0)z.alpha=H;return z},DJ=D40;var L40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=E8({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*J,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*J,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*J});if(H!==void 0)Q.alpha=H;return Q},g9=L40;var M40=($)=>g9(DJ($)),OK=M40;var P40=($)=>{let{r:Z,g:J,b:H,alpha:Q}=w8($),B={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*J+0.14307845442264197*H,y:0.22249319175623702*Z+0.7168870538238823*J+0.06061979053616537*H,z:0.013923904500943465*Z+0.09708128566574634*J+0.7140993584005155*H};if(Q!==void 0)B.alpha=Q;return B},f9=P40;var AD=($)=>$>AJ?Math.cbrt($):(h6*$+16)/116,_40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=AD($/f5.X),B=AD(Z/f5.Y),X=AD(J/f5.Z),z={mode:"lab",l:116*B-16,a:500*(Q-B),b:200*(B-X)};if(H!==void 0)z.alpha=H;return z},LJ=_40;var j40=($)=>{let Z=LJ(f9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},TK=j40;function O40($,Z){if(!Z||Z[0]!=="lab")return;let J={mode:"lab"},[,H,Q,B,X]=Z;if(H.type===O0.Hue||Q.type===O0.Hue||B.type===O0.Hue)return;if(H.type!==O0.None)J.l=Math.min(Math.max(0,H.value),100);if(Q.type!==O0.None)J.a=Q.type===O0.Number?Q.value:Q.value*125/100;if(B.type!==O0.None)J.b=B.type===O0.Number?B.value:B.value*125/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var Mk=O40;var T40={mode:"lab",toMode:{xyz50:DJ,rgb:OK},fromMode:{xyz50:LJ,rgb:TK},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[Mk],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:w0,a:w0,b:w0,alpha:{use:w0,fixup:y1}}},MJ=T40;var C40={...MJ,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:zK,rgb:y6},fromMode:{xyz65:GK,rgb:x6},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},Pk=C40;function w40($,Z){if(!Z||Z[0]!=="lch")return;let J={mode:"lch"},[,H,Q,B,X]=Z;if(H.type!==O0.None){if(H.type===O0.Hue)return;J.l=Math.min(Math.max(0,H.value),100)}if(Q.type!==O0.None)J.c=Math.max(0,Q.type===O0.Number?Q.value:Q.value*150/100);if(B.type!==O0.None){if(B.type===O0.Percentage)return;J.h=B.value}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var _k=w40;var E40={mode:"lch",toMode:{lab:B8,rgb:($)=>OK(B8($))},fromMode:{rgb:($)=>Q8(TK($)),lab:Q8},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[_k],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:w0,fixup:E2},c:w0,l:w0,alpha:{use:w0,fixup:y1}},difference:{h:b6},average:{h:S2}},PJ=E40;var S40={...PJ,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>B8($,"lab65"),rgb:($)=>y6(B8($,"lab65"))},fromMode:{rgb:($)=>Q8(x6($),"lch65"),lab65:($)=>Q8($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},jk=S40;var R40=({l:$,u:Z,v:J,alpha:H})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.sqrt(Z*Z+J*J),B={mode:"lchuv",l:$,c:Q};if(Q)B.h=D5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)B.alpha=H;return B},DD=R40;var I40=({l:$,c:Z,h:J,alpha:H})=>{if(J===void 0)J=0;let Q={mode:"luv",l:$,u:Z?Z*Math.cos(J/180*Math.PI):0,v:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)Q.alpha=H;return Q},LD=I40;var Ok=($,Z,J)=>4*$/($+15*Z+3*J),Tk=($,Z,J)=>9*Z/($+15*Z+3*J),b40=Ok(f5.X,f5.Y,f5.Z),k40=Tk(f5.X,f5.Y,f5.Z),y40=($)=>$<=AJ?h6*$:116*Math.cbrt($)-16,x40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=y40(Z/f5.Y),B=Ok($,Z,J),X=Tk($,Z,J);if(!isFinite(B)||!isFinite(X))Q=B=X=0;else B=13*Q*(B-b40),X=13*Q*(X-k40);let z={mode:"luv",l:Q,u:B,v:X};if(H!==void 0)z.alpha=H;return z},iQ=x40;var h40=($,Z,J)=>4*$/($+15*Z+3*J),v40=($,Z,J)=>9*Z/($+15*Z+3*J),g40=h40(f5.X,f5.Y,f5.Z),f40=v40(f5.X,f5.Y,f5.Z),m40=({l:$,u:Z,v:J,alpha:H})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Z/(13*$)+g40,B=J/(13*$)+f40,X=f5.Y*($<=8?$/h6:Math.pow(($+16)/116,3)),z=X*(9*Q)/(4*B),G=X*(12-3*Q-20*B)/(4*B),U={mode:"xyz50",x:z,y:X,z:G};if(H!==void 0)U.alpha=H;return U},rQ=m40;var u40=($)=>DD(iQ(f9($))),p40=($)=>g9(rQ(LD($))),c40={mode:"lchuv",toMode:{luv:LD,rgb:p40},fromMode:{rgb:u40,luv:DD},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:w0,fixup:E2},c:w0,l:w0,alpha:{use:w0,fixup:y1}},difference:{h:b6},average:{h:S2}},Ck=c40;var d40={...C8,mode:"lrgb",toMode:{rgb:E8},fromMode:{rgb:w8},parse:["srgb-linear"],serialize:"srgb-linear"},wk=d40;var l40={mode:"luv",toMode:{xyz50:rQ,rgb:($)=>g9(rQ($))},fromMode:{xyz50:iQ,rgb:($)=>iQ(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:w0,u:w0,v:w0,alpha:{use:w0,fixup:y1}}},Ek=l40;var i40=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*J),B=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*J),X=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*J),z={mode:"oklab",l:0.210454268309314*Q+0.7936177747023054*B-0.0040720430116193*X,a:1.9779985324311684*Q-2.42859224204858*B+0.450593709617411*X,b:0.0259040424655478*Q+0.7827717124575296*B-0.8086757549230774*X};if(H!==void 0)z.alpha=H;return z},CK=i40;var r40=($)=>{let Z=CK(w8($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},v6=r40;var a40=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.pow($+0.3963377773761749*Z+0.2158037573099136*J,3),B=Math.pow($-0.1055613458156586*Z-0.0638541728258133*J,3),X=Math.pow($-0.0894841775298119*Z-1.2914855480194092*J,3),z={mode:"lrgb",r:4.076741636075957*Q-3.3077115392580616*B+0.2309699031821044*X,g:-1.2684379732850317*Q+2.6097573492876887*B-0.3413193760026573*X,b:-0.0041960761386756*Q-0.7034186179359362*B+1.7076146940746117*X};if(H!==void 0)z.alpha=H;return z},m9=a40;var o40=($)=>E8(m9($)),g6=o40;function aQ($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function M$($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function n40($,Z){let J,H,Q,B,X,z,G,U;if(-1.88170328*$-0.80936493*Z>1)J=1.19086277,H=1.76576728,Q=0.59662641,B=0.75515197,X=0.56771245,z=4.0767416621,G=-3.3077115913,U=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)J=0.73956515,H=-0.45954404,Q=0.08285427,B=0.1254107,X=0.14503204,z=-1.2684380046,G=2.6097574011,U=-0.3413193965;else J=1.35733652,H=-0.00915799,Q=-1.1513021,B=-0.50559606,X=0.00692167,z=-0.0041960863,G=-0.7034186147,U=1.707614701;let K=J+H*$+Q*Z+B*$*$+X*$*Z,Y=0.3963377774*$+0.2158037573*Z,F=-0.1055613458*$-0.0638541728*Z,W=-0.0894841775*$-1.291485548*Z;{let q=1+K*Y,N=1+K*F,A=1+K*W,V=q*q*q,D=N*N*N,L=A*A*A,j=3*Y*q*q,M=3*F*N*N,_=3*W*A*A,E=6*Y*Y*q,C=6*F*F*N,R=6*W*W*A,T=z*V+G*D+U*L,I=z*j+G*M+U*_,y=z*E+G*C+U*R;K=K-T*I/(I*I-0.5*T*y)}return K}function MD($,Z){let J=n40($,Z),H=m9({l:1,a:J*$,b:J*Z}),Q=Math.cbrt(1/Math.max(H.r,H.g,H.b)),B=Q*J;return[Q,B]}function s40($,Z,J,H,Q,B=null){if(!B)B=MD($,Z);let X;if((J-Q)*B[1]-(B[0]-Q)*H<=0)X=B[1]*Q/(H*B[0]+B[1]*(Q-J));else{X=B[1]*(Q-1)/(H*(B[0]-1)+B[1]*(Q-J));{let z=J-Q,G=H,U=0.3963377774*$+0.2158037573*Z,K=-0.1055613458*$-0.0638541728*Z,Y=-0.0894841775*$-1.291485548*Z,F=z+G*U,W=z+G*K,q=z+G*Y;{let N=Q*(1-X)+X*J,A=X*H,V=N+A*U,D=N+A*K,L=N+A*Y,j=V*V*V,M=D*D*D,_=L*L*L,E=3*F*V*V,C=3*W*D*D,R=3*q*L*L,T=6*F*F*V,I=6*W*W*D,y=6*q*q*L,S=4.0767416621*j-3.3077115913*M+0.2309699292*_-1,O=4.0767416621*E-3.3077115913*C+0.2309699292*R,k=4.0767416621*T-3.3077115913*I+0.2309699292*y,b=O/(O*O-0.5*S*k),h=-S*b,v=-1.2684380046*j+2.6097574011*M-0.3413193965*_-1,f=-1.2684380046*E+2.6097574011*C-0.3413193965*R,w=-1.2684380046*T+2.6097574011*I-0.3413193965*y,i=f/(f*f-0.5*v*w),r=-v*i,x=-0.0041960863*j-0.7034186147*M+1.707614701*_-1,l=-0.0041960863*E-0.7034186147*C+1.707614701*R,s=-0.0041960863*T-0.7034186147*I+1.707614701*y,p=l/(l*l-0.5*x*s),d=-x*p;h=b>=0?h:1e6,r=i>=0?r:1e6,d=p>=0?d:1e6,X+=Math.min(h,Math.min(r,d))}}}return X}function oQ($,Z,J=null){if(!J)J=MD($,Z);let H=J[0],Q=J[1];return[Q/H,Q/(1-H)]}function wK($,Z,J){let H=MD(Z,J),Q=s40(Z,J,$,1,$,H),B=oQ(Z,J,H),X=0.11516993+1/(7.4477897+4.1590124*J+Z*(-2.19557347+1.75198401*J+Z*(-2.13704948-10.02301043*J+Z*(-4.24894561+5.38770819*J+4.69891013*Z)))),z=0.11239642+1/(1.6132032-0.68124379*J+Z*(0.40370612+0.90148123*J+Z*(-0.27087943+0.6122399*J+Z*(0.00299215-0.45399568*J-0.14661872*Z)))),G=Q/Math.min($*B[0],(1-$)*B[1]),U=$*X,K=(1-$)*z,Y=0.9*G*Math.sqrt(Math.sqrt(1/(1/(U*U*U*U)+1/(K*K*K*K))));return U=$*0.4,K=(1-$)*0.8,[Math.sqrt(1/(1/(U*U)+1/(K*K))),Y,Q]}function EK($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,Q={mode:"okhsl",l:aQ(Z)};if($.alpha!==void 0)Q.alpha=$.alpha;let B=Math.sqrt(J*J+H*H);if(!B)return Q.s=0,Q;let[X,z,G]=wK(Z,J/B,H/B),U;if(B<z){let K=0,Y=0.8*X,F=1-Y/z;U=(B-K)/(Y+F*(B-K))*0.8}else{let K=z,Y=0.2*z*z*1.25*1.25/X,F=1-Y/(G-z);U=0.8+0.2*((B-K)/(Y+F*(B-K)))}if(U)Q.s=U,Q.h=D5(Math.atan2(H,J)*180/Math.PI);return Q}function SK($){let Z=$.h!==void 0?$.h:0,J=$.s!==void 0?$.s:0,H=$.l!==void 0?$.l:0,Q={mode:"oklab",l:M$(H)};if($.alpha!==void 0)Q.alpha=$.alpha;if(!J||H===1)return Q.a=Q.b=0,Q;let B=Math.cos(Z/180*Math.PI),X=Math.sin(Z/180*Math.PI),[z,G,U]=wK(Q.l,B,X),K,Y,F,W;if(J<0.8)K=1.25*J,Y=0,F=0.8*z,W=1-F/G;else K=5*(J-0.8),Y=G,F=0.2*G*G*1.25*1.25/z,W=1-F/(U-G);let q=Y+K*F/(1-W*K);return Q.a=q*B,Q.b=q*X,Q}var t40={...YK,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:EK,rgb:($)=>EK(v6($))},toMode:{oklab:SK,rgb:($)=>g6(SK($))}},Sk=t40;function RK($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,Q=Math.sqrt(J*J+H*H),B=Q?J/Q:1,X=Q?H/Q:1,[z,G]=oQ(B,X),U=0.5,K=1-U/z,Y=G/(Q+Z*G),F=Y*Z,W=Y*Q,q=M$(F),N=W*q/F,A=m9({l:q,a:B*N,b:X*N}),V=Math.cbrt(1/Math.max(A.r,A.g,A.b,0));Z=Z/V,Q=Q/V*aQ(Z)/Z,Z=aQ(Z);let D={mode:"okhsv",s:Q?(U+G)*W/(G*U+G*K*W):0,v:Z?Z/F:0};if(D.s)D.h=D5(Math.atan2(H,J)*180/Math.PI);if($.alpha!==void 0)D.alpha=$.alpha;return D}function IK($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let J=$.h!==void 0?$.h:0,H=$.s!==void 0?$.s:0,Q=$.v!==void 0?$.v:0,B=Math.cos(J/180*Math.PI),X=Math.sin(J/180*Math.PI),[z,G]=oQ(B,X),U=0.5,K=1-U/z,Y=1-H*U/(U+G-G*K*H),F=H*G*U/(U+G-G*K*H),W=M$(Y),q=F*W/Y,N=m9({l:W,a:B*q,b:X*q}),A=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),V=M$(Q*Y),D=F*V/Y;return Z.l=V*A,Z.a=D*B*A,Z.b=D*X*A,Z}var e40={...FK,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:RK,rgb:($)=>RK(v6($))},toMode:{oklab:IK,rgb:($)=>g6(IK($))}},Rk=e40;function $80($,Z){if(!Z||Z[0]!=="oklab")return;let J={mode:"oklab"},[,H,Q,B,X]=Z;if(H.type===O0.Hue||Q.type===O0.Hue||B.type===O0.Hue)return;if(H.type!==O0.None)J.l=Math.min(Math.max(0,H.type===O0.Number?H.value:H.value/100),1);if(Q.type!==O0.None)J.a=Q.type===O0.Number?Q.value:Q.value*0.4/100;if(B.type!==O0.None)J.b=B.type===O0.Number?B.value:B.value*0.4/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var Ik=$80;var Z80={...MJ,mode:"oklab",toMode:{lrgb:m9,rgb:g6},fromMode:{lrgb:CK,rgb:v6},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[Ik],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},bk=Z80;function J80($,Z){if(!Z||Z[0]!=="oklch")return;let J={mode:"oklch"},[,H,Q,B,X]=Z;if(H.type!==O0.None){if(H.type===O0.Hue)return;J.l=Math.min(Math.max(0,H.type===O0.Number?H.value:H.value/100),1)}if(Q.type!==O0.None)J.c=Math.max(0,Q.type===O0.Number?Q.value:Q.value*0.4/100);if(B.type!==O0.None){if(B.type===O0.Percentage)return;J.h=B.value}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var kk=J80;var H80={...PJ,mode:"oklch",toMode:{oklab:($)=>B8($,"oklab"),rgb:($)=>g6(B8($,"oklab"))},fromMode:{rgb:($)=>Q8(v6($),"oklch"),oklab:($)=>Q8($,"oklch")},parse:[kk],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]}},yk=H80;var Q80=($)=>{let{r:Z,g:J,b:H,alpha:Q}=w8($),B={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*J+0.1982172852343625*H,y:0.2289745640697487*Z+0.6917385218365062*J+0.079286914093745*H,z:0*Z+0.0451133818589026*J+1.043944368900976*H};if(Q!==void 0)B.alpha=Q;return B},PD=Q80;var B80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=E8({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*J,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*J,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*J},"p3");if(H!==void 0)Q.alpha=H;return Q},_D=B80;var X80={...C8,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>_D(m4($)),xyz65:_D},toMode:{rgb:($)=>u4(PD($)),xyz65:PD}},xk=X80;var jD=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},z80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q={mode:"prophoto",r:jD($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*J),g:jD($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*J),b:jD($*0+Z*0+1.2119675456389452*J)};if(H!==void 0)Q.alpha=H;return Q},OD=z80;var TD=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},G80=($)=>{let Z=TD($.r),J=TD($.g),H=TD($.b),Q={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*J+0.0313477341283922*H,y:0.2880748288194013*Z+0.7118352342418731*J+0.0000899369387256*H,z:0*Z+0*J+0.8251046025104602*H};if($.alpha!==void 0)Q.alpha=$.alpha;return Q},CD=G80;var U80={...C8,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:OD,rgb:($)=>OD(f9($))},toMode:{xyz50:CD,rgb:($)=>g9(CD($))}},hk=U80;var wD=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},K80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q={mode:"rec2020",r:wD($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*J),g:wD($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*J),b:wD($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*J)};if(H!==void 0)Q.alpha=H;return Q},ED=K80;var SD=($=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)},Y80=($)=>{let Z=SD($.r),J=SD($.g),H=SD($.b),Q={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*J+0.1688809751641721*H,y:0.262700212011267*Z+0.6779980715188708*J+0.059301716469862*H,z:0*Z+0.0280726930490874*J+1.0609850577107909*H};if($.alpha!==void 0)Q.alpha=$.alpha;return Q},RD=Y80;var F80={...C8,mode:"rec2020",fromMode:{xyz65:ED,rgb:($)=>ED(m4($))},toMode:{xyz65:RD,rgb:($)=>u4(RD($))},parse:["rec2020"],serialize:"rec2020"},vk=F80;var f6=0.0037930732552754493,bK=Math.cbrt(0.0037930732552754493);var ID=($)=>Math.cbrt($)-bK,W80=($)=>{let{r:Z,g:J,b:H,alpha:Q}=w8($),B=ID(0.3*Z+0.622*J+0.078*H+f6),X=ID(0.23*Z+0.692*J+0.078*H+f6),z=ID(0.2434226892454782*Z+0.2047674442449682*J+0.5518098665095535*H+f6),G={mode:"xyb",x:(B-X)/2,y:(B+X)/2,b:z-(B+X)/2};if(Q!==void 0)G.alpha=Q;return G},gk=W80;var bD=($)=>Math.pow($+bK,3),q80=({x:$,y:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=bD($+Z)-f6,B=bD(Z-$)-f6,X=bD(J+Z)-f6,z=E8({r:11.031566904639861*Q-9.866943908131562*B-0.16462299650829934*X,g:-3.2541473810744237*Q+4.418770377582723*B-0.16462299650829934*X,b:-3.6588512867136815*Q+2.7129230459360922*B+1.9459282407775895*X});if(H!==void 0)z.alpha=H;return z},fk=q80;var N80={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:fk},fromMode:{rgb:gk},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:w0,y:w0,b:w0,alpha:{use:w0,fixup:y1}}},mk=N80;var V80={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:g9,lab:LJ},fromMode:{rgb:f9,lab:DJ},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:w0,y:w0,z:w0,alpha:{use:w0,fixup:y1}}},uk=V80;var A80=($)=>{let{x:Z,y:J,z:H,alpha:Q}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(H===void 0)H=0;let B={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*J-0.0501922295431356*H,y:0.0296278156881593*Z+0.990434484573249*J-0.0170738250293851*H,z:-0.0092430581525912*Z+0.0150551448965779*J+0.7518742899580008*H};if(Q!==void 0)B.alpha=Q;return B},pk=A80;var D80=($)=>{let{x:Z,y:J,z:H,alpha:Q}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(H===void 0)H=0;let B={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*J+0.0632593086610217*H,y:-0.0283697069632081*Z+1.0099954580058226*J+0.021041398966943*H,z:0.0123140016883199*Z-0.0205076964334779*J+1.3303659366080753*H};if(Q!==void 0)B.alpha=Q;return B},ck=D80;var L80={mode:"xyz65",toMode:{rgb:u4,xyz50:pk},fromMode:{rgb:m4,xyz50:ck},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:w0,y:w0,z:w0,alpha:{use:w0,fixup:y1}}},dk=L80;var M80=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*J,i:0.59597799*$-0.2741761*Z-0.32180189*J,q:0.21147017*$-0.52261711*Z+0.31114694*J};if(H!==void 0)Q.alpha=H;return Q},lk=M80;var P80=({y:$,i:Z,q:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let Q={mode:"rgb",r:$+0.95608445*Z+0.6208885*J,g:$-0.27137664*Z-0.6486059*J,b:$-1.10561724*Z+1.70250126*J};if(H!==void 0)Q.alpha=H;return Q},ik=P80;var _80={mode:"yiq",toMode:{rgb:ik},fromMode:{rgb:lk},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:w0,i:w0,q:w0,alpha:{use:w0,fixup:y1}}},rk=_80;function kD($){let Z=ZK("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var Va0=$5(nb),Aa0=$5(Bk),Da0=$5(Gk),La0=$5(Uk),Ma0=$5(Kk),Pa0=$5(YK),_a0=$5(FK),ja0=$5(Nk),Oa0=$5(Vk),Ta0=$5(Dk),Ca0=$5(Lk),wa0=$5(MJ),Ea0=$5(Pk),Sa0=$5(PJ),Ra0=$5(jk),Ia0=$5(Ck),ba0=$5(wk),ka0=$5(Ek),ya0=$5(Sk),xa0=$5(Rk),ha0=$5(bk),va0=$5(yk),ga0=$5(xk),fa0=$5(hk),ma0=$5(vk),ua0=$5(C8),pa0=$5(mk),ca0=$5(uk),da0=$5(dk),la0=$5(rk);var m6={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"}},nQ={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},sQ={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}}},yD="oklch(0.205 0 0)";function ak($){return kD($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var ok={workspace:{primary:($)=>$,primaryForeground:($)=>ak($),background:()=>"color-mix(in srgb, var(--primary) 2%, oklch(1 0 0) 98%)",foreground:()=>"color-mix(in srgb, var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, 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:($)=>ak($),primary:()=>"color-mix(in srgb, var(--background) 2%, oklch(1 0 0) 98%)",primaryForeground:()=>"color-mix(in srgb, var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, 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%)"}},xD=Object.keys(ok.workspace);function hD($,Z="workspace"){let J={},H=ok[Z];for(let Q of xD)J[Q]=H[Q]($);return J}var yK={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)"}},u9={font:"sans",color:"default",radius:"soft",agent:"boxy"};function kK($,Z,J){return typeof $==="string"&&Object.hasOwn(Z,$)?$:J}function $9($){return{font:kK($?.font,m6,u9.font),color:kK($?.color,yK,u9.color),radius:kK($?.radius,nQ,u9.radius),agent:kK($?.agent,sQ,u9.agent)}}function xK($,Z="workspace"){let J=$9($),Q=yK[J.color].primary??(Z==="widget"?yD:void 0);return Q?hD(Q,Z):void 0}var tQ=P(c(),1),eQ={"claude-code":dU,openclaw:rU,codex:iU,hermes:lU};function j80($,Z,J){switch($?.type){case"emoji":return tQ.jsx("span",{"aria-hidden":"true",className:B0("flex size-full translate-y-[2cqi] items-center justify-center font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif] leading-none",Z?"text-[60cqi]":"text-[85cqi]"),children:$.value});case"upload":return tQ.jsx("img",{src:$.value,alt:"",className:"size-full"});case"glyph":{let H=A$($.value);if(H)return nk.createElement(H,{"aria-hidden":!0,stroke:1.75,className:Z?"size-[70%]":"size-[95%] text-foreground"})}default:return tQ.jsx("img",{src:J,alt:"",className:"size-[95%]"})}}function u6({className:$,icon:Z,workspaceType:J,workspaceTheme:H}){let Q=Z?.type!=="upload"&&Z?.background==="theme",B=Q?xK(H)??hD(yD):void 0,X=eQ[J??"claude-code"];return tQ.jsx("span",{className:B0("@container inline-flex shrink-0 items-center justify-center overflow-hidden",Q&&"shadow-[inset_0_0_1rem_rgba(255,255,255,0.3)]",$),style:B?{backgroundColor:B.primary,color:B.primaryForeground}:void 0,children:j80(Z,Q,X)})}var vD=P(c(),1),gD={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex",hermes:"Hermes"};function sk({types:$}){let Z=$.map((J)=>gD[J]).join(", ");return vD.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((J)=>vD.jsx("img",{src:eQ[J],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},J))})}function P$($){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 Z5=P(c(),1),O80="Choose which agent moi will use to build your workspace",T80={openclaw:"To connect an OpenClaw agent, run",hermes:"To connect a Hermes agent, run"},C80={openclaw:"moi openclaw init",hermes:"moi hermes init"},w80={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function E80({availability:$,detectedTypes:Z=[]}){return KJ.map((J)=>{let H=$?.[J],Q=H&&H.status!=="available"?H.reason:void 0,B=!Z.includes(J)?T80[J]:void 0,X=!Z.includes(J)?C80[J]:void 0,z=Q??B;return{type:J,description:w80[J],disabled:Boolean(z),...z?{disabledReason:z}:{},...!Q&&X?{disabledCommand:X}:{}}})}function S80($,Z){let J=$.find((H)=>H.type===Z);if(J&&!J.disabled)return J.type;return $.find((H)=>!H.disabled)?.type}function vK({title:$,selectedType:Z,detectedTypes:J,availability:H,isPending:Q,errorMessage:B,secondaryAction:X,primaryLabel:z,pendingLabel:G,onTypeChange:U,onSubmit:K}){let Y=w5((A)=>A.hasSentMessageFromMoi),F=E80({availability:H,detectedTypes:J}),W=S80(F,Z),q=W!==Z,N=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 tk.useEffect(()=>{if(W&&q)U(W)},[U,W,q]),Z5.jsxs("div",{className:"flex flex-col gap-5",children:[Z5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[Z5.jsx(T6,{children:$}),Z5.jsx(GJ,{children:O80})]}),Z5.jsxs("div",{className:"flex flex-col gap-4",children:[Z5.jsx(R80,{options:F,selectedType:q?void 0:Z,onTypeChange:U}),!Y&&N&&Z5.jsx("p",{className:"text-sm text-muted-foreground",children:N})]}),B&&Z5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:B}),Z5.jsxs("div",{className:"flex items-center justify-end gap-2",children:[X,Z5.jsx(j0,{onClick:K,disabled:Q||q,children:Q&&G?G:z})]})]})}function R80({options:$,selectedType:Z,onTypeChange:J}){return Z5.jsx("div",{role:"group","aria-label":"Agent",className:B0("grid gap-2",$.length>2?"grid-cols-4":"grid-cols-2"),children:$.map((H)=>Z5.jsx(I80,{option:H,selected:Z===H.type,onSelect:J},H.type))})}function I80({option:$,selected:Z,onSelect:J}){let H=Boolean($.disabledReason),Q=Z5.jsxs("button",{type:"button",disabled:$.disabled&&!H,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(B)=>{if($.disabled){B.preventDefault();return}J($.type)},className:B0("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:[Z5.jsxs("span",{className:"relative inline-flex",children:[Z5.jsx(b80,{type:$.type}),Z&&Z5.jsx(hK,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),Z5.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[Z5.jsx("span",{className:"text-sm font-medium text-foreground",children:gD[$.type]}),Z5.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!H)return Q;return Z5.jsxs(Q5,{children:[Z5.jsx(B5,{render:Q}),Z5.jsx(X5,{className:B0("max-w-64",$.disabledCommand&&"max-w-none leading-5"),children:Z5.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&Z5.jsxs(Z5.Fragment,{children:[Z5.jsx("br",{}),Z5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:$.disabledCommand})]})]})})]})}function b80({type:$}){return Z5.jsx("img",{src:eQ[$],alt:"",className:"size-8 shrink-0"})}var ek=P(c(),1);function gK({children:$,showCloseButton:Z=!0}){return ek.jsx(zJ,{showCloseButton:Z,className:"block w-[calc(100%-2rem)] max-w-xl overflow-hidden p-6 sm:max-w-xl",children:$})}var E5=P(c(),1),$y=KJ[0];function ZB({trigger:$}){let[,Z]=q8(),J=T8(),H=VU(),Q=CR(),[B,X]=$B.useState(!1),[z,G]=$B.useState("agent"),[U,K]=$B.useState($y),[Y,F]=$B.useState(""),W=Y.trim(),q=W?OI(W):null,N=Q.isPending;if(J.cloudDemo)return E5.jsx(FJ,{trigger:$});function A(j){X(!1),Z(`/workspace/${j}`)}function V(){G("agent"),K($y),F(""),Q.reset()}function D(){Q.reset(),G("name")}function L(){if(!W||q||N)return;Q.reset(),Q.mutate({name:W,type:U},{onSuccess:(j)=>A(j.id)})}return E5.jsxs(O6,{open:B,onOpenChange:X,onOpenChangeComplete:(j)=>{if(!j)V()},children:[E5.jsx(w3,{render:$}),E5.jsx(gK,{children:z==="agent"?E5.jsx(vK,{title:"Create new workspace",selectedType:U,availability:H.data?.availability,isPending:!1,secondaryAction:E5.jsx(y80,{}),primaryLabel:"Next",onTypeChange:K,onSubmit:D}):E5.jsx(k80,{name:Y,validationError:q,requestError:Q.error?.message,isPending:N,onNameChange:F,onSubmit:L})})]})}function k80({name:$,validationError:Z,requestError:J,isPending:H,onNameChange:Q,onSubmit:B}){function X(z){z.preventDefault(),B()}return E5.jsxs("form",{className:"flex flex-col gap-5",onSubmit:X,children:[E5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[E5.jsx(T6,{children:"Create new workspace"}),E5.jsx(GJ,{children:"Give it a short and recognizable name"})]}),E5.jsxs("div",{className:"flex flex-col gap-2",children:[E5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),E5.jsx(N$,{id:"workspace-name",value:$,onChange:(z)=>Q(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&&E5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),J&&E5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:J}),E5.jsx("div",{className:"flex items-center justify-end gap-2",children:E5.jsx(j0,{type:"submit",disabled:!$.trim()||Boolean(Z)||H,children:H?"Creating…":"Create workspace"})})]})}function y80(){return E5.jsxs(Q5,{children:[E5.jsx(B5,{render:E5.jsx(j0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),E5.jsx(X5,{className:"max-w-64",children:E5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",E5.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 c6=P(m(),1);var D0=P(m(),1),C$=P(e4(),1);var G2=P(m(),1);var JB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _$($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function fK($){return"nodeType"in $}function H4($){var Z,J;if(!$)return window;if(_$($))return $;if(!fK($))return window;return(Z=(J=$.ownerDocument)==null?void 0:J.defaultView)!=null?Z:window}function mK($){let{Document:Z}=H4($);return $ instanceof Z}function jJ($){if(_$($))return!1;return $ instanceof H4($).HTMLElement}function mD($){return $ instanceof H4($).SVGElement}function j$($){if(!$)return document;if(_$($))return $.document;if(!fK($))return document;if(mK($))return $;if(jJ($)||mD($))return $.ownerDocument;return document}var p9=JB?G2.useLayoutEffect:G2.useEffect;function HB($){let Z=G2.useRef($);return p9(()=>{Z.current=$}),G2.useCallback(function(){for(var J=arguments.length,H=Array(J),Q=0;Q<J;Q++)H[Q]=arguments[Q];return Z.current==null?void 0:Z.current(...H)},[])}function Jy(){let $=G2.useRef(null),Z=G2.useCallback((H,Q)=>{$.current=setInterval(H,Q)},[]),J=G2.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,J]}function OJ($,Z){if(Z===void 0)Z=[$];let J=G2.useRef($);return p9(()=>{if(J.current!==$)J.current=$},Z),J}function TJ($,Z){let J=G2.useRef();return G2.useMemo(()=>{let H=$(J.current);return J.current=H,H},[...Z])}function QB($){let Z=HB($),J=G2.useRef(null),H=G2.useCallback((Q)=>{if(Q!==J.current)Z==null||Z(Q,J.current);J.current=Q},[]);return[J,H]}function BB($){let Z=G2.useRef();return G2.useEffect(()=>{Z.current=$},[$]),Z.current}var fD={};function XB($,Z){return G2.useMemo(()=>{if(Z)return Z;let J=fD[$]==null?0:fD[$]+1;return fD[$]=J,$+"-"+J},[$,Z])}function Hy($){return function(Z){for(var J=arguments.length,H=Array(J>1?J-1:0),Q=1;Q<J;Q++)H[Q-1]=arguments[Q];return H.reduce((B,X)=>{let z=Object.entries(X);for(let[G,U]of z){let K=B[G];if(K!=null)B[G]=K+$*U}return B},{...Z})}}var O$=Hy(1),zB=Hy(-1);function x80($){return"clientX"in $&&"clientY"in $}function uK($){if(!$)return!1;let{KeyboardEvent:Z}=H4($.target);return Z&&$ instanceof Z}function h80($){if(!$)return!1;let{TouchEvent:Z}=H4($.target);return Z&&$ instanceof Z}function GB($){if(h80($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:J}=$.touches[0];return{x:Z,y:J}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:J}=$.changedTouches[0];return{x:Z,y:J}}}if(x80($))return{x:$.clientX,y:$.clientY};return null}var _J=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:J}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(J?Math.round(J):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:J}=$;return"scaleX("+Z+") scaleY("+J+")"}},Transform:{toString($){if(!$)return;return[_J.Translate.toString($),_J.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:J,easing:H}=$;return Z+" "+J+"ms "+H}}}),Zy="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Qy($){if($.matches(Zy))return $;return $.querySelector(Zy)}var T$=P(m(),1),v80={display:"none"};function By($){let{id:Z,value:J}=$;return T$.default.createElement("div",{id:Z,style:v80},J)}function Xy($){let{id:Z,announcement:J,ariaLiveType:H="assertive"}=$,Q={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 T$.default.createElement("div",{id:Z,style:Q,role:"status","aria-live":H,"aria-atomic":!0},J)}function zy(){let[$,Z]=T$.useState("");return{announce:T$.useCallback((H)=>{if(H!=null)Z(H)},[]),announcement:$}}var My=D0.createContext(null);function g80($){let Z=D0.useContext(My);D0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function f80(){let[$]=D0.useState(()=>new Set),Z=D0.useCallback((H)=>{return $.add(H),()=>$.delete(H)},[$]);return[D0.useCallback((H)=>{let{type:Q,event:B}=H;$.forEach((X)=>{var z;return(z=X[Q])==null?void 0:z.call(X,B)})},[$]),Z]}var m80={draggable:`
|
|
15
|
-
To pick up a draggable item, press the space bar.
|
|
16
|
-
While dragging, use the arrow keys to move the item.
|
|
17
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
18
|
-
`},u80={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was moved over droppable area "+J.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was dropped over droppable area "+J.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function p80($){let{announcements:Z=u80,container:J,hiddenTextDescribedById:H,screenReaderInstructions:Q=m80}=$,{announce:B,announcement:X}=zy(),z=XB("DndLiveRegion"),[G,U]=D0.useState(!1);if(D0.useEffect(()=>{U(!0)},[]),g80(D0.useMemo(()=>({onDragStart(Y){let{active:F}=Y;B(Z.onDragStart({active:F}))},onDragMove(Y){let{active:F,over:W}=Y;if(Z.onDragMove)B(Z.onDragMove({active:F,over:W}))},onDragOver(Y){let{active:F,over:W}=Y;B(Z.onDragOver({active:F,over:W}))},onDragEnd(Y){let{active:F,over:W}=Y;B(Z.onDragEnd({active:F,over:W}))},onDragCancel(Y){let{active:F,over:W}=Y;B(Z.onDragCancel({active:F,over:W}))}}),[B,Z])),!G)return null;let K=D0.default.createElement(D0.default.Fragment,null,D0.default.createElement(By,{id:H,value:Q.draggable}),D0.default.createElement(Xy,{id:z,announcement:X}));return J?C$.createPortal(K,J):K}var q2;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(q2||(q2={}));function cK(){}function rD($,Z){return D0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function Py(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];return D0.useMemo(()=>[...Z].filter((H)=>H!=null),[...Z])}var Z9=Object.freeze({x:0,y:0});function c80($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function d80($,Z){let J=GB($);if(!J)return"0 0";let H={x:(J.x-Z.left)/Z.width*100,y:(J.y-Z.top)/Z.height*100};return H.x+"% "+H.y+"%"}function l80($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return J-H}function i80($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return H-J}function r80($,Z){if(!$||$.length===0)return null;let[J]=$;return Z?J[Z]:J}function Gy($,Z,J){if(Z===void 0)Z=$.left;if(J===void 0)J=$.top;return{x:Z+$.width*0.5,y:J+$.height*0.5}}var _y=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,Q=Gy(Z,Z.left,Z.top),B=[];for(let X of H){let{id:z}=X,G=J.get(z);if(G){let U=c80(Gy(G),Q);B.push({id:z,data:{droppableContainer:X,value:U}})}}return B.sort(l80)};function a80($,Z){let J=Math.max(Z.top,$.top),H=Math.max(Z.left,$.left),Q=Math.min(Z.left+Z.width,$.left+$.width),B=Math.min(Z.top+Z.height,$.top+$.height),X=Q-H,z=B-J;if(H<Q&&J<B){let G=Z.width*Z.height,U=$.width*$.height,K=X*z,Y=K/(G+U-K);return Number(Y.toFixed(4))}return 0}var o80=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,Q=[];for(let B of H){let{id:X}=B,z=J.get(X);if(z){let G=a80(z,Z);if(G>0)Q.push({id:X,data:{droppableContainer:B,value:G}})}}return Q.sort(i80)};function n80($,Z,J){return{...$,scaleX:Z&&J?Z.width/J.width:1,scaleY:Z&&J?Z.height/J.height:1}}function jy($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:Z9}function s80($){return function(J){for(var H=arguments.length,Q=Array(H>1?H-1:0),B=1;B<H;B++)Q[B-1]=arguments[B];return Q.reduce((X,z)=>({...X,top:X.top+$*z.y,bottom:X.bottom+$*z.y,left:X.left+$*z.x,right:X.right+$*z.x}),{...J})}}var t80=s80(1);function Oy($){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 e80($,Z,J){let H=Oy(Z);if(!H)return $;let{scaleX:Q,scaleY:B,x:X,y:z}=H,G=$.left-X-(1-Q)*parseFloat(J),U=$.top-z-(1-B)*parseFloat(J.slice(J.indexOf(" ")+1)),K=Q?$.width/Q:$.width,Y=B?$.height/B:$.height;return{width:K,height:Y,top:U,right:G+K,bottom:U+Y,left:G}}var $90={ignoreTransform:!1};function YB($,Z){if(Z===void 0)Z=$90;let J=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:U,transformOrigin:K}=H4($).getComputedStyle($);if(U)J=e80(J,U,K)}let{top:H,left:Q,width:B,height:X,bottom:z,right:G}=J;return{top:H,left:Q,width:B,height:X,bottom:z,right:G}}function Uy($){return YB($,{ignoreTransform:!0})}function Z90($){let{innerWidth:Z,innerHeight:J}=$;return{top:0,left:0,right:Z,bottom:J,width:Z,height:J}}function J90($,Z){if(Z===void 0)Z=H4($).getComputedStyle($);return Z.position==="fixed"}function H90($,Z){if(Z===void 0)Z=H4($).getComputedStyle($);let J=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((Q)=>{let B=Z[Q];return typeof B==="string"?J.test(B):!1})}function aD($,Z){let J=[];function H(Q){if(Z!=null&&J.length>=Z)return J;if(!Q)return J;if(mK(Q)&&Q.scrollingElement!=null&&!J.includes(Q.scrollingElement))return J.push(Q.scrollingElement),J;if(!jJ(Q)||mD(Q))return J;if(J.includes(Q))return J;let B=H4($).getComputedStyle(Q);if(Q!==$){if(H90(Q,B))J.push(Q)}if(J90(Q,B))return J;return H(Q.parentNode)}if(!$)return J;return H($)}function Ty($){let[Z]=aD($,1);return Z!=null?Z:null}function uD($){if(!JB||!$)return null;if(_$($))return $;if(!fK($))return null;if(mK($)||$===j$($).scrollingElement)return window;if(jJ($))return $;return null}function Cy($){if(_$($))return $.scrollX;return $.scrollLeft}function wy($){if(_$($))return $.scrollY;return $.scrollTop}function dD($){return{x:Cy($),y:wy($)}}var R2;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(R2||(R2={}));function Ey($){if(!JB||!$)return!1;return $===document.scrollingElement}function Sy($){let Z={x:0,y:0},J=Ey($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},H={x:$.scrollWidth-J.width,y:$.scrollHeight-J.height},Q=$.scrollTop<=Z.y,B=$.scrollLeft<=Z.x,X=$.scrollTop>=H.y,z=$.scrollLeft>=H.x;return{isTop:Q,isLeft:B,isBottom:X,isRight:z,maxScroll:H,minScroll:Z}}var Q90={x:0.2,y:0.2};function B90($,Z,J,H,Q){let{top:B,left:X,right:z,bottom:G}=J;if(H===void 0)H=10;if(Q===void 0)Q=Q90;let{isTop:U,isBottom:K,isLeft:Y,isRight:F}=Sy($),W={x:0,y:0},q={x:0,y:0},N={height:Z.height*Q.y,width:Z.width*Q.x};if(!U&&B<=Z.top+N.height)W.y=R2.Backward,q.y=H*Math.abs((Z.top+N.height-B)/N.height);else if(!K&&G>=Z.bottom-N.height)W.y=R2.Forward,q.y=H*Math.abs((Z.bottom-N.height-G)/N.height);if(!F&&z>=Z.right-N.width)W.x=R2.Forward,q.x=H*Math.abs((Z.right-N.width-z)/N.width);else if(!Y&&X<=Z.left+N.width)W.x=R2.Backward,q.x=H*Math.abs((Z.left+N.width-X)/N.width);return{direction:W,speed:q}}function X90($){if($===document.scrollingElement){let{innerWidth:B,innerHeight:X}=window;return{top:0,left:0,right:B,bottom:X,width:B,height:X}}let{top:Z,left:J,right:H,bottom:Q}=$.getBoundingClientRect();return{top:Z,left:J,right:H,bottom:Q,width:$.clientWidth,height:$.clientHeight}}function Ry($){return $.reduce((Z,J)=>{return O$(Z,dD(J))},Z9)}function z90($){return $.reduce((Z,J)=>{return Z+Cy(J)},0)}function G90($){return $.reduce((Z,J)=>{return Z+wy(J)},0)}function Iy($,Z){if(Z===void 0)Z=YB;if(!$)return;let{top:J,left:H,bottom:Q,right:B}=Z($);if(!Ty($))return;if(Q<=0||B<=0||J>=window.innerHeight||H>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var U90=[["x",["left","right"],z90],["y",["top","bottom"],G90]];class lK{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 J=aD(Z),H=Ry(J);this.rect={...$},this.width=$.width,this.height=$.height;for(let[Q,B,X]of U90)for(let z of B)Object.defineProperty(this,z,{get:()=>{let G=X(J),U=H[Q]-G;return this.rect[z]+U},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class CJ{constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var J;return(J=this.target)==null?void 0:J.removeEventListener(...Z)})},this.target=$}add($,Z,J){var H;(H=this.target)==null||H.addEventListener($,Z,J),this.listeners.push([$,Z,J])}}function K90($){let{EventTarget:Z}=H4($);return $ instanceof Z?$:j$($)}function pD($,Z){let J=Math.abs($.x),H=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(J**2+H**2)>Z;if("x"in Z&&"y"in Z)return J>Z.x&&H>Z.y;if("x"in Z)return J>Z.x;if("y"in Z)return H>Z.y;return!1}var S8;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(S8||(S8={}));function Ky($){$.preventDefault()}function Y90($){$.stopPropagation()}var o1;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(o1||(o1={}));var by={start:[o1.Space,o1.Enter],cancel:[o1.Esc],end:[o1.Space,o1.Enter,o1.Tab]},F90=($,Z)=>{let{currentCoordinates:J}=Z;switch($.code){case o1.Right:return{...J,x:J.x+25};case o1.Left:return{...J,x:J.x-25};case o1.Down:return{...J,y:J.y+25};case o1.Up:return{...J,y:J.y-25}}return};class FB{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 CJ(j$(Z)),this.windowListeners=new CJ(H4(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(S8.Resize,this.handleCancel),this.windowListeners.add(S8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(S8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,J=$.node.current;if(J)Iy(J);Z(Z9)}handleKeyDown($){if(uK($)){let{active:Z,context:J,options:H}=this.props,{keyboardCodes:Q=by,coordinateGetter:B=F90,scrollBehavior:X="smooth"}=H,{code:z}=$;if(Q.end.includes(z)){this.handleEnd($);return}if(Q.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:G}=J.current,U=G?{x:G.left,y:G.top}:Z9;if(!this.referenceCoordinates)this.referenceCoordinates=U;let K=B($,{active:Z,context:J.current,currentCoordinates:U});if(K){let Y=zB(K,U),F={x:0,y:0},{scrollableAncestors:W}=J.current;for(let q of W){let N=$.code,{isTop:A,isRight:V,isLeft:D,isBottom:L,maxScroll:j,minScroll:M}=Sy(q),_=X90(q),E={x:Math.min(N===o1.Right?_.right-_.width/2:_.right,Math.max(N===o1.Right?_.left:_.left+_.width/2,K.x)),y:Math.min(N===o1.Down?_.bottom-_.height/2:_.bottom,Math.max(N===o1.Down?_.top:_.top+_.height/2,K.y))},C=N===o1.Right&&!V||N===o1.Left&&!D,R=N===o1.Down&&!L||N===o1.Up&&!A;if(C&&E.x!==K.x){let T=q.scrollLeft+Y.x,I=N===o1.Right&&T<=j.x||N===o1.Left&&T>=M.x;if(I&&!Y.y){q.scrollTo({left:T,behavior:X});return}if(I)F.x=q.scrollLeft-T;else F.x=N===o1.Right?q.scrollLeft-j.x:q.scrollLeft-M.x;if(F.x)q.scrollBy({left:-F.x,behavior:X});break}else if(R&&E.y!==K.y){let T=q.scrollTop+Y.y,I=N===o1.Down&&T<=j.y||N===o1.Up&&T>=M.y;if(I&&!Y.x){q.scrollTo({top:T,behavior:X});return}if(I)F.y=q.scrollTop-T;else F.y=N===o1.Down?q.scrollTop-j.y:q.scrollTop-M.y;if(F.y)q.scrollBy({top:-F.y,behavior:X});break}}this.handleMove($,O$(zB(K,this.referenceCoordinates),F))}}}handleMove($,Z){let{onMove:J}=this.props;$.preventDefault(),J(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()}}FB.activators=[{eventName:"onKeyDown",handler:($,Z,J)=>{let{keyboardCodes:H=by,onActivation:Q}=Z,{active:B}=J,{code:X}=$.nativeEvent;if(H.start.includes(X)){let z=B.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),Q==null||Q({event:$.nativeEvent}),!0}return!1}}];function Yy($){return Boolean($&&"distance"in $)}function Fy($){return Boolean($&&"delay"in $)}class iK{constructor($,Z,J){var H;if(J===void 0)J=K90($.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:Q}=$,{target:B}=Q;this.props=$,this.events=Z,this.document=j$(B),this.documentListeners=new CJ(this.document),this.listeners=new CJ(J),this.windowListeners=new CJ(H4(B)),this.initialCoordinates=(H=GB(Q))!=null?H:Z9,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:J}}}=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(S8.Resize,this.handleCancel),this.windowListeners.add(S8.DragStart,Ky),this.windowListeners.add(S8.VisibilityChange,this.handleCancel),this.windowListeners.add(S8.ContextMenu,Ky),this.documentListeners.add(S8.Keydown,this.handleKeydown),Z){if(J!=null&&J({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Fy(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(Yy(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:J,onPending:H}=this.props;H(J,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(S8.Click,Y90,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(S8.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:J,initialCoordinates:H,props:Q}=this,{onMove:B,options:{activationConstraint:X}}=Q;if(!H)return;let z=(Z=GB($))!=null?Z:Z9,G=zB(H,z);if(!J&&X){if(Yy(X)){if(X.tolerance!=null&&pD(G,X.tolerance))return this.handleCancel();if(pD(G,X.distance))return this.handleStart()}if(Fy(X)){if(pD(G,X.tolerance))return this.handleCancel()}this.handlePending(X,G);return}if($.cancelable)$.preventDefault();B(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===o1.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var W90={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class WB extends iK{constructor($){let{event:Z}=$,J=j$(Z.target);super($,W90,J)}}WB.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(!J.isPrimary||J.button!==0)return!1;return H==null||H({event:J}),!0}}];var q90={move:{name:"mousemove"},end:{name:"mouseup"}},lD;(function($){$[$.RightClick=2]="RightClick"})(lD||(lD={}));class ky extends iK{constructor($){super($,q90,j$($.event.target))}}ky.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(J.button===lD.RightClick)return!1;return H==null||H({event:J}),!0}}];var cD={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class yy extends iK{constructor($){super($,cD)}static setup(){return window.addEventListener(cD.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(cD.move.name,$)};function $(){}}}yy.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z,{touches:Q}=J;if(Q.length>1)return!1;return H==null||H({event:J}),!0}}];var UB;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(UB||(UB={}));var dK;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(dK||(dK={}));function N90($){let{acceleration:Z,activator:J=UB.Pointer,canScroll:H,draggingRect:Q,enabled:B,interval:X=5,order:z=dK.TreeOrder,pointerCoordinates:G,scrollableAncestors:U,scrollableAncestorRects:K,delta:Y,threshold:F}=$,W=A90({delta:Y,disabled:!B}),[q,N]=Jy(),A=D0.useRef({x:0,y:0}),V=D0.useRef({x:0,y:0}),D=D0.useMemo(()=>{switch(J){case UB.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case UB.DraggableRect:return Q}},[J,Q,G]),L=D0.useRef(null),j=D0.useCallback(()=>{let _=L.current;if(!_)return;let E=A.current.x*V.current.x,C=A.current.y*V.current.y;_.scrollBy(E,C)},[]),M=D0.useMemo(()=>z===dK.TreeOrder?[...U].reverse():U,[z,U]);D0.useEffect(()=>{if(!B||!U.length||!D){N();return}for(let _ of M){if((H==null?void 0:H(_))===!1)continue;let E=U.indexOf(_),C=K[E];if(!C)continue;let{direction:R,speed:T}=B90(_,C,D,Z,F);for(let I of["x","y"])if(!W[I][R[I]])T[I]=0,R[I]=0;if(T.x>0||T.y>0){N(),L.current=_,q(j,X),A.current=T,V.current=R;return}}A.current={x:0,y:0},V.current={x:0,y:0},N()},[Z,j,H,N,B,X,JSON.stringify(D),JSON.stringify(W),q,U,M,K,JSON.stringify(F)])}var V90={x:{[R2.Backward]:!1,[R2.Forward]:!1},y:{[R2.Backward]:!1,[R2.Forward]:!1}};function A90($){let{delta:Z,disabled:J}=$,H=BB(Z);return TJ((Q)=>{if(J||!H||!Q)return V90;let B={x:Math.sign(Z.x-H.x),y:Math.sign(Z.y-H.y)};return{x:{[R2.Backward]:Q.x[R2.Backward]||B.x===-1,[R2.Forward]:Q.x[R2.Forward]||B.x===1},y:{[R2.Backward]:Q.y[R2.Backward]||B.y===-1,[R2.Forward]:Q.y[R2.Forward]||B.y===1}}},[J,Z,H])}function D90($,Z){let J=Z!=null?$.get(Z):void 0,H=J?J.node.current:null;return TJ((Q)=>{var B;if(Z==null)return null;return(B=H!=null?H:Q)!=null?B:null},[H,Z])}function L90($,Z){return D0.useMemo(()=>$.reduce((J,H)=>{let{sensor:Q}=H,B=Q.activators.map((X)=>({eventName:X.eventName,handler:Z(X.handler,H)}));return[...J,...B]},[]),[$,Z])}var KB;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(KB||(KB={}));var iD;(function($){$.Optimized="optimized"})(iD||(iD={}));var Wy=new Map;function M90($,Z){let{dragging:J,dependencies:H,config:Q}=Z,[B,X]=D0.useState(null),{frequency:z,measure:G,strategy:U}=Q,K=D0.useRef($),Y=A(),F=OJ(Y),W=D0.useCallback(function(V){if(V===void 0)V=[];if(F.current)return;X((D)=>{if(D===null)return V;return D.concat(V.filter((L)=>!D.includes(L)))})},[F]),q=D0.useRef(null),N=TJ((V)=>{if(Y&&!J)return Wy;if(!V||V===Wy||K.current!==$||B!=null){let D=new Map;for(let L of $){if(!L)continue;if(B&&B.length>0&&!B.includes(L.id)&&L.rect.current){D.set(L.id,L.rect.current);continue}let j=L.node.current,M=j?new lK(G(j),j):null;if(L.rect.current=M,M)D.set(L.id,M)}return D}return V},[$,B,J,Y,G]);return D0.useEffect(()=>{K.current=$},[$]),D0.useEffect(()=>{if(Y)return;W()},[J,Y]),D0.useEffect(()=>{if(B&&B.length>0)X(null)},[JSON.stringify(B)]),D0.useEffect(()=>{if(Y||typeof z!=="number"||q.current!==null)return;q.current=setTimeout(()=>{W(),q.current=null},z)},[z,Y,W,...H]),{droppableRects:N,measureDroppableContainers:W,measuringScheduled:B!=null};function A(){switch(U){case KB.Always:return!1;case KB.BeforeDragging:return J;default:return!J}}}function oD($,Z){return TJ((J)=>{if(!$)return null;if(J)return J;return typeof Z==="function"?Z($):$},[Z,$])}function P90($,Z){return oD($,Z)}function _90($){let{callback:Z,disabled:J}=$,H=HB(Z),Q=D0.useMemo(()=>{if(J||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:B}=window;return new B(H)},[H,J]);return D0.useEffect(()=>{return()=>Q==null?void 0:Q.disconnect()},[Q]),Q}function rK($){let{callback:Z,disabled:J}=$,H=HB(Z),Q=D0.useMemo(()=>{if(J||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:B}=window;return new B(H)},[J]);return D0.useEffect(()=>{return()=>Q==null?void 0:Q.disconnect()},[Q]),Q}function j90($){return new lK(YB($),$)}function qy($,Z,J){if(Z===void 0)Z=j90;let[H,Q]=D0.useState(null);function B(){Q((G)=>{if(!$)return null;if($.isConnected===!1){var U;return(U=G!=null?G:J)!=null?U:null}let K=Z($);if(JSON.stringify(G)===JSON.stringify(K))return G;return K})}let X=_90({callback(G){if(!$)return;for(let U of G){let{type:K,target:Y}=U;if(K==="childList"&&Y instanceof HTMLElement&&Y.contains($)){B();break}}}}),z=rK({callback:B});return p9(()=>{if(B(),$)z==null||z.observe($),X==null||X.observe(document.body,{childList:!0,subtree:!0});else z==null||z.disconnect(),X==null||X.disconnect()},[$]),H}function O90($){let Z=oD($);return jy($,Z)}var Ny=[];function T90($){let Z=D0.useRef($),J=TJ((H)=>{if(!$)return Ny;if(H&&H!==Ny&&$&&Z.current&&$.parentNode===Z.current.parentNode)return H;return aD($)},[$]);return D0.useEffect(()=>{Z.current=$},[$]),J}function C90($){let[Z,J]=D0.useState(null),H=D0.useRef($),Q=D0.useCallback((B)=>{let X=uD(B.target);if(!X)return;J((z)=>{if(!z)return null;return z.set(X,dD(X)),new Map(z)})},[]);return D0.useEffect(()=>{let B=H.current;if($!==B){X(B);let z=$.map((G)=>{let U=uD(G);if(U)return U.addEventListener("scroll",Q,{passive:!0}),[U,dD(U)];return null}).filter((G)=>G!=null);J(z.length?new Map(z):null),H.current=$}return()=>{X($),X(B)};function X(z){z.forEach((G)=>{let U=uD(G);U==null||U.removeEventListener("scroll",Q)})}},[Q,$]),D0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((B,X)=>O$(B,X),Z9):Ry($);return Z9},[$,Z])}function Vy($,Z){if(Z===void 0)Z=[];let J=D0.useRef(null);return D0.useEffect(()=>{J.current=null},Z),D0.useEffect(()=>{let H=$!==Z9;if(H&&!J.current)J.current=$;if(!H&&J.current)J.current=null},[$]),J.current?zB($,J.current):Z9}function w90($){D0.useEffect(()=>{if(!JB)return;let Z=$.map((J)=>{let{sensor:H}=J;return H.setup==null?void 0:H.setup()});return()=>{for(let J of Z)J==null||J()}},$.map((Z)=>{let{sensor:J}=Z;return J}))}function E90($,Z){return D0.useMemo(()=>{return $.reduce((J,H)=>{let{eventName:Q,handler:B}=H;return J[Q]=(X)=>{B(X,Z)},J},{})},[$,Z])}function xy($){return D0.useMemo(()=>$?Z90($):null,[$])}var Ay=[];function S90($,Z){if(Z===void 0)Z=YB;let[J]=$,H=xy(J?H4(J):null),[Q,B]=D0.useState(Ay);function X(){B(()=>{if(!$.length)return Ay;return $.map((G)=>Ey(G)?H:new lK(Z(G),G))})}let z=rK({callback:X});return p9(()=>{z==null||z.disconnect(),X(),$.forEach((G)=>z==null?void 0:z.observe(G))},[$]),Q}function hy($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return jJ(Z)?Z:$}function R90($){let{measure:Z}=$,[J,H]=D0.useState(null),Q=D0.useCallback((U)=>{for(let{target:K}of U)if(jJ(K)){H((Y)=>{let F=Z(K);return Y?{...Y,width:F.width,height:F.height}:F});break}},[Z]),B=rK({callback:Q}),X=D0.useCallback((U)=>{let K=hy(U);if(B==null||B.disconnect(),K)B==null||B.observe(K);H(K?Z(K):null)},[Z,B]),[z,G]=QB(X);return D0.useMemo(()=>({nodeRef:z,rect:J,setRef:G}),[J,z,G])}var I90=[{sensor:WB,options:{}},{sensor:FB,options:{}}],b90={current:{}},pK={draggable:{measure:Uy},droppable:{measure:Uy,strategy:KB.WhileDragging,frequency:iD.Optimized},dragOverlay:{measure:YB}};class wJ 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,J;return(Z=(J=this.get($))==null?void 0:J.node.current)!=null?Z:void 0}}var k90={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wJ,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:cK},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pK,measureDroppableContainers:cK,windowRect:null,measuringScheduled:!1},vy={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:cK,draggableNodes:new Map,over:null,measureDroppableContainers:cK},qB=D0.createContext(vy),gy=D0.createContext(k90);function y90(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wJ}}}function x90($,Z){switch(Z.type){case q2.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case q2.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 q2.DragEnd:case q2.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case q2.RegisterDroppable:{let{element:J}=Z,{id:H}=J,Q=new wJ($.droppable.containers);return Q.set(H,J),{...$,droppable:{...$.droppable,containers:Q}}}case q2.SetDroppableDisabled:{let{id:J,key:H,disabled:Q}=Z,B=$.droppable.containers.get(J);if(!B||H!==B.key)return $;let X=new wJ($.droppable.containers);return X.set(J,{...B,disabled:Q}),{...$,droppable:{...$.droppable,containers:X}}}case q2.UnregisterDroppable:{let{id:J,key:H}=Z,Q=$.droppable.containers.get(J);if(!Q||H!==Q.key)return $;let B=new wJ($.droppable.containers);return B.delete(J),{...$,droppable:{...$.droppable,containers:B}}}default:return $}}function h90($){let{disabled:Z}=$,{active:J,activatorEvent:H,draggableNodes:Q}=D0.useContext(qB),B=BB(H),X=BB(J==null?void 0:J.id);return D0.useEffect(()=>{if(Z)return;if(!H&&B&&X!=null){if(!uK(B))return;if(document.activeElement===B.target)return;let z=Q.get(X);if(!z)return;let{activatorNode:G,node:U}=z;if(!G.current&&!U.current)return;requestAnimationFrame(()=>{for(let K of[G.current,U.current]){if(!K)continue;let Y=Qy(K);if(Y){Y.focus();break}}})}},[H,Z,Q,X,B]),null}function fy($,Z){let{transform:J,...H}=Z;return $!=null&&$.length?$.reduce((Q,B)=>{return B({transform:Q,...H})},J):J}function v90($){return D0.useMemo(()=>({draggable:{...pK.draggable,...$==null?void 0:$.draggable},droppable:{...pK.droppable,...$==null?void 0:$.droppable},dragOverlay:{...pK.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function g90($){let{activeNode:Z,measure:J,initialRect:H,config:Q=!0}=$,B=D0.useRef(!1),{x:X,y:z}=typeof Q==="boolean"?{x:Q,y:Q}:Q;p9(()=>{if(!X&&!z||!Z){B.current=!1;return}if(B.current||!H)return;let U=Z==null?void 0:Z.node.current;if(!U||U.isConnected===!1)return;let K=J(U),Y=jy(K,H);if(!X)Y.x=0;if(!z)Y.y=0;if(B.current=!0,Math.abs(Y.x)>0||Math.abs(Y.y)>0){let F=Ty(U);if(F)F.scrollBy({top:Y.y,left:Y.x})}},[Z,X,z,H,J])}var aK=D0.createContext({...Z9,scaleX:1,scaleY:1}),p6;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(p6||(p6={}));var my=D0.memo(function(Z){var J,H,Q,B;let{id:X,accessibility:z,autoScroll:G=!0,children:U,sensors:K=I90,collisionDetection:Y=o80,measuring:F,modifiers:W,...q}=Z,N=D0.useReducer(x90,void 0,y90),[A,V]=N,[D,L]=f80(),[j,M]=D0.useState(p6.Uninitialized),_=j===p6.Initialized,{draggable:{active:E,nodes:C,translate:R},droppable:{containers:T}}=A,I=E!=null?C.get(E):null,y=D0.useRef({initial:null,translated:null}),S=D0.useMemo(()=>{var C0;return E!=null?{id:E,data:(C0=I==null?void 0:I.data)!=null?C0:b90,rect:y}:null},[E,I]),O=D0.useRef(null),[k,b]=D0.useState(null),[h,v]=D0.useState(null),f=OJ(q,Object.values(q)),w=XB("DndDescribedBy",X),i=D0.useMemo(()=>T.getEnabled(),[T]),r=v90(F),{droppableRects:x,measureDroppableContainers:l,measuringScheduled:s}=M90(i,{dragging:_,dependencies:[R.x,R.y],config:r.droppable}),p=D90(C,E),d=D0.useMemo(()=>h?GB(h):null,[h]),o=s1(),Z0=P90(p,r.draggable.measure);g90({activeNode:E!=null?C.get(E):null,config:o.layoutShiftCompensation,initialRect:Z0,measure:r.draggable.measure});let H0=qy(p,r.draggable.measure,Z0),G0=qy(p?p.parentElement:null),X0=D0.useRef({activatorEvent:null,active:null,activeNode:p,collisionRect:null,collisions:null,droppableRects:x,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Y0=T.getNodeFor((J=X0.current.over)==null?void 0:J.id),A0=R90({measure:r.dragOverlay.measure}),N0=(H=A0.nodeRef.current)!=null?H:p,F0=_?(Q=A0.rect)!=null?Q:H0:null,n=Boolean(A0.nodeRef.current&&A0.rect),a=O90(n?null:H0),e=xy(N0?H4(N0):null),$0=T90(_?Y0!=null?Y0:p:null),Q0=S90($0),_0=fy(W,{transform:{x:R.x-a.x,y:R.y-a.y,scaleX:1,scaleY:1},activatorEvent:h,active:S,activeNodeRect:H0,containerNodeRect:G0,draggingNodeRect:F0,over:X0.current.over,overlayNodeRect:A0.rect,scrollableAncestors:$0,scrollableAncestorRects:Q0,windowRect:e}),M0=d?O$(d,R):null,V0=C90($0),L0=Vy(V0),g=Vy(V0,[H0]),u=O$(_0,L0),t=F0?t80(F0,_0):null,W0=S&&t?Y({active:S,collisionRect:t,droppableRects:x,droppableContainers:i,pointerCoordinates:M0}):null,I0=r80(W0,"id"),[c0,f0]=D0.useState(null),T0=n?_0:O$(_0,g),x0=n80(T0,(B=c0==null?void 0:c0.rect)!=null?B:null,H0),J1=D0.useRef(null),W1=D0.useCallback((C0,p0)=>{let{sensor:i0,options:o0}=p0;if(O.current==null)return;let A1=C.get(O.current);if(!A1)return;let D1=C0.nativeEvent,u1=new i0({active:O.current,activeNode:A1,event:D1,options:o0,context:X0,onAbort(P0){if(!C.get(P0))return;let{onDragAbort:z1}=f.current,O1={id:P0};z1==null||z1(O1),D({type:"onDragAbort",event:O1})},onPending(P0,l0,z1,O1){if(!C.get(P0))return;let{onDragPending:r0}=f.current,h0={id:P0,constraint:l0,initialCoordinates:z1,offset:O1};r0==null||r0(h0),D({type:"onDragPending",event:h0})},onStart(P0){let l0=O.current;if(l0==null)return;let z1=C.get(l0);if(!z1)return;let{onDragStart:O1}=f.current,k0={activatorEvent:D1,active:{id:l0,data:z1.data,rect:y}};C$.unstable_batchedUpdates(()=>{O1==null||O1(k0),M(p6.Initializing),V({type:q2.DragStart,initialCoordinates:P0,active:l0}),D({type:"onDragStart",event:k0}),b(J1.current),v(D1)})},onMove(P0){V({type:q2.DragMove,coordinates:P0})},onEnd:q0(q2.DragEnd),onCancel:q0(q2.DragCancel)});J1.current=u1;function q0(P0){return async function(){let{active:z1,collisions:O1,over:k0,scrollAdjustedTranslate:r0}=X0.current,h0=null;if(z1&&r0){let{cancelDrop:G1}=f.current;if(h0={activatorEvent:D1,active:z1,collisions:O1,delta:r0,over:k0},P0===q2.DragEnd&&typeof G1==="function"){if(await Promise.resolve(G1(h0)))P0=q2.DragCancel}}O.current=null,C$.unstable_batchedUpdates(()=>{V({type:P0}),M(p6.Uninitialized),f0(null),b(null),v(null),J1.current=null;let G1=P0===q2.DragEnd?"onDragEnd":"onDragCancel";if(h0){let R1=f.current[G1];R1==null||R1(h0),D({type:G1,event:h0})}})}}},[C]),d0=D0.useCallback((C0,p0)=>{return(i0,o0)=>{let A1=i0.nativeEvent,D1=C.get(o0);if(O.current!==null||!D1||A1.dndKit||A1.defaultPrevented)return;let u1={active:D1};if(C0(i0,p0.options,u1)===!0)A1.dndKit={capturedBy:p0.sensor},O.current=o0,W1(i0,p0)}},[C,W1]),v0=L90(K,d0);w90(K),p9(()=>{if(H0&&j===p6.Initializing)M(p6.Initialized)},[H0,j]),D0.useEffect(()=>{let{onDragMove:C0}=f.current,{active:p0,activatorEvent:i0,collisions:o0,over:A1}=X0.current;if(!p0||!i0)return;let D1={active:p0,activatorEvent:i0,collisions:o0,delta:{x:u.x,y:u.y},over:A1};C$.unstable_batchedUpdates(()=>{C0==null||C0(D1),D({type:"onDragMove",event:D1})})},[u.x,u.y]),D0.useEffect(()=>{let{active:C0,activatorEvent:p0,collisions:i0,droppableContainers:o0,scrollAdjustedTranslate:A1}=X0.current;if(!C0||O.current==null||!p0||!A1)return;let{onDragOver:D1}=f.current,u1=o0.get(I0),q0=u1&&u1.rect.current?{id:u1.id,rect:u1.rect.current,data:u1.data,disabled:u1.disabled}:null,P0={active:C0,activatorEvent:p0,collisions:i0,delta:{x:A1.x,y:A1.y},over:q0};C$.unstable_batchedUpdates(()=>{f0(q0),D1==null||D1(P0),D({type:"onDragOver",event:P0})})},[I0]),p9(()=>{X0.current={activatorEvent:h,active:S,activeNode:p,collisionRect:t,collisions:W0,droppableRects:x,draggableNodes:C,draggingNode:N0,draggingNodeRect:F0,droppableContainers:T,over:c0,scrollableAncestors:$0,scrollAdjustedTranslate:u},y.current={initial:F0,translated:t}},[S,p,W0,t,C,N0,F0,x,T,c0,$0,u]),N90({...o,delta:R,draggingRect:t,pointerCoordinates:M0,scrollableAncestors:$0,scrollableAncestorRects:Q0});let S1=D0.useMemo(()=>{return{active:S,activeNode:p,activeNodeRect:H0,activatorEvent:h,collisions:W0,containerNodeRect:G0,dragOverlay:A0,draggableNodes:C,droppableContainers:T,droppableRects:x,over:c0,measureDroppableContainers:l,scrollableAncestors:$0,scrollableAncestorRects:Q0,measuringConfiguration:r,measuringScheduled:s,windowRect:e}},[S,p,H0,h,W0,G0,A0,C,T,x,c0,l,$0,Q0,r,s,e]),B1=D0.useMemo(()=>{return{activatorEvent:h,activators:v0,active:S,activeNodeRect:H0,ariaDescribedById:{draggable:w},dispatch:V,draggableNodes:C,over:c0,measureDroppableContainers:l}},[h,v0,S,H0,V,w,C,c0,l]);return D0.default.createElement(My.Provider,{value:L},D0.default.createElement(qB.Provider,{value:B1},D0.default.createElement(gy.Provider,{value:S1},D0.default.createElement(aK.Provider,{value:x0},U)),D0.default.createElement(h90,{disabled:(z==null?void 0:z.restoreFocus)===!1})),D0.default.createElement(p80,{...z,hiddenTextDescribedById:w}));function s1(){let C0=(k==null?void 0:k.autoScrollEnabled)===!1,p0=typeof G==="object"?G.enabled===!1:G===!1,i0=_&&!C0&&!p0;if(typeof G==="object")return{...G,enabled:i0};return{enabled:i0}}}),f90=D0.createContext(null),Dy="button",m90="Draggable";function uy($){let{id:Z,data:J,disabled:H=!1,attributes:Q}=$,B=XB(m90),{activators:X,activatorEvent:z,active:G,activeNodeRect:U,ariaDescribedById:K,draggableNodes:Y,over:F}=D0.useContext(qB),{role:W=Dy,roleDescription:q="draggable",tabIndex:N=0}=Q!=null?Q:{},A=(G==null?void 0:G.id)===Z,V=D0.useContext(A?aK:f90),[D,L]=QB(),[j,M]=QB(),_=E90(X,Z),E=OJ(J);p9(()=>{return Y.set(Z,{id:Z,key:B,node:D,activatorNode:j,data:E}),()=>{let R=Y.get(Z);if(R&&R.key===B)Y.delete(Z)}},[Y,Z]);let C=D0.useMemo(()=>({role:W,tabIndex:N,"aria-disabled":H,"aria-pressed":A&&W===Dy?!0:void 0,"aria-roledescription":q,"aria-describedby":K.draggable}),[H,W,N,A,q,K.draggable]);return{active:G,activatorEvent:z,activeNodeRect:U,attributes:C,isDragging:A,listeners:H?void 0:_,node:D,over:F,setNodeRef:L,setActivatorNodeRef:M,transform:V}}function u90(){return D0.useContext(gy)}var p90="Droppable",c90={timeout:25};function py($){let{data:Z,disabled:J=!1,id:H,resizeObserverConfig:Q}=$,B=XB(p90),{active:X,dispatch:z,over:G,measureDroppableContainers:U}=D0.useContext(qB),K=D0.useRef({disabled:J}),Y=D0.useRef(!1),F=D0.useRef(null),W=D0.useRef(null),{disabled:q,updateMeasurementsFor:N,timeout:A}={...c90,...Q},V=OJ(N!=null?N:H),D=D0.useCallback(()=>{if(!Y.current){Y.current=!0;return}if(W.current!=null)clearTimeout(W.current);W.current=setTimeout(()=>{U(Array.isArray(V.current)?V.current:[V.current]),W.current=null},A)},[A]),L=rK({callback:D,disabled:q||!X}),j=D0.useCallback((C,R)=>{if(!L)return;if(R)L.unobserve(R),Y.current=!1;if(C)L.observe(C)},[L]),[M,_]=QB(j),E=OJ(Z);return D0.useEffect(()=>{if(!L||!M.current)return;L.disconnect(),Y.current=!1,L.observe(M.current)},[M,L]),D0.useEffect(()=>{return z({type:q2.RegisterDroppable,element:{id:H,key:B,disabled:J,node:M,rect:F,data:E}}),()=>z({type:q2.UnregisterDroppable,key:B,id:H})},[H]),D0.useEffect(()=>{if(J!==K.current.disabled)z({type:q2.SetDroppableDisabled,id:H,key:B,disabled:J}),K.current.disabled=J},[H,B,J,z]),{active:X,rect:F,isOver:(G==null?void 0:G.id)===H,node:M,over:G,setNodeRef:_}}function d90($){let{animation:Z,children:J}=$,[H,Q]=D0.useState(null),[B,X]=D0.useState(null),z=BB(J);if(!J&&!H&&z)Q(z);return p9(()=>{if(!B)return;let G=H==null?void 0:H.key,U=H==null?void 0:H.props.id;if(G==null||U==null){Q(null);return}Promise.resolve(Z(U,B)).then(()=>{Q(null)})},[Z,H,B]),D0.default.createElement(D0.default.Fragment,null,J,H?D0.cloneElement(H,{ref:X}):null)}var l90={x:0,y:0,scaleX:1,scaleY:1};function i90($){let{children:Z}=$;return D0.default.createElement(qB.Provider,{value:vy},D0.default.createElement(aK.Provider,{value:l90},Z))}var r90={position:"fixed",touchAction:"none"},a90=($)=>{return uK($)?"transform 250ms ease":void 0},o90=D0.forwardRef(($,Z)=>{let{as:J,activatorEvent:H,adjustScale:Q,children:B,className:X,rect:z,style:G,transform:U,transition:K=a90}=$;if(!z)return null;let Y=Q?U:{...U,scaleX:1,scaleY:1},F={...r90,width:z.width,height:z.height,top:z.top,left:z.left,transform:_J.Transform.toString(Y),transformOrigin:Q&&H?d80(H,z):void 0,transition:typeof K==="function"?K(H):K,...G};return D0.default.createElement(J,{className:X,style:F,ref:Z},B)}),n90=($)=>(Z)=>{let{active:J,dragOverlay:H}=Z,Q={},{styles:B,className:X}=$;if(B!=null&&B.active)for(let[z,G]of Object.entries(B.active)){if(G===void 0)continue;Q[z]=J.node.style.getPropertyValue(z),J.node.style.setProperty(z,G)}if(B!=null&&B.dragOverlay)for(let[z,G]of Object.entries(B.dragOverlay)){if(G===void 0)continue;H.node.style.setProperty(z,G)}if(X!=null&&X.active)J.node.classList.add(X.active);if(X!=null&&X.dragOverlay)H.node.classList.add(X.dragOverlay);return function(){for(let[G,U]of Object.entries(Q))J.node.style.setProperty(G,U);if(X!=null&&X.active)J.node.classList.remove(X.active)}},s90=($)=>{let{transform:{initial:Z,final:J}}=$;return[{transform:_J.Transform.toString(Z)},{transform:_J.Transform.toString(J)}]},t90={duration:250,easing:"ease",keyframes:s90,sideEffects:n90({styles:{active:{opacity:"0"}}})};function e90($){let{config:Z,draggableNodes:J,droppableContainers:H,measuringConfiguration:Q}=$;return HB((B,X)=>{if(Z===null)return;let z=J.get(B);if(!z)return;let G=z.node.current;if(!G)return;let U=hy(X);if(!U)return;let{transform:K}=H4(X).getComputedStyle(X),Y=Oy(K);if(!Y)return;let F=typeof Z==="function"?Z:$30(Z);return Iy(G,Q.draggable.measure),F({active:{id:B,data:z.data,node:G,rect:Q.draggable.measure(G)},draggableNodes:J,dragOverlay:{node:X,rect:Q.dragOverlay.measure(U)},droppableContainers:H,measuringConfiguration:Q,transform:Y})})}function $30($){let{duration:Z,easing:J,sideEffects:H,keyframes:Q}={...t90,...$};return(B)=>{let{active:X,dragOverlay:z,transform:G,...U}=B;if(!Z)return;let K={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},F={x:G.x-K.x,y:G.y-K.y,...Y},W=Q({...U,active:X,dragOverlay:z,transform:{initial:G,final:F}}),[q]=W,N=W[W.length-1];if(JSON.stringify(q)===JSON.stringify(N))return;let A=H==null?void 0:H({active:X,dragOverlay:z,...U}),V=z.node.animate(W,{duration:Z,easing:J,fill:"forwards"});return new Promise((D)=>{V.onfinish=()=>{A==null||A(),D()}})}}var Ly=0;function Z30($){return D0.useMemo(()=>{if($==null)return;return Ly++,Ly},[$])}var cy=D0.default.memo(($)=>{let{adjustScale:Z=!1,children:J,dropAnimation:H,style:Q,transition:B,modifiers:X,wrapperElement:z="div",className:G,zIndex:U=999}=$,{activatorEvent:K,active:Y,activeNodeRect:F,containerNodeRect:W,draggableNodes:q,droppableContainers:N,dragOverlay:A,over:V,measuringConfiguration:D,scrollableAncestors:L,scrollableAncestorRects:j,windowRect:M}=u90(),_=D0.useContext(aK),E=Z30(Y==null?void 0:Y.id),C=fy(X,{activatorEvent:K,active:Y,activeNodeRect:F,containerNodeRect:W,draggingNodeRect:A.rect,over:V,overlayNodeRect:A.rect,scrollableAncestors:L,scrollableAncestorRects:j,transform:_,windowRect:M}),R=oD(F),T=e90({config:H,draggableNodes:q,droppableContainers:N,measuringConfiguration:D}),I=R?A.setRef:void 0;return D0.default.createElement(i90,null,D0.default.createElement(d90,{animation:T},Y&&E?D0.default.createElement(o90,{key:E,id:Y.id,ref:I,as:z,activatorEvent:K,adjustScale:Z,className:G,transition:B,rect:R,style:{zIndex:U,...Q},transform:C},J):null))});var w$=P(c(),1),J30={start:[o1.Space],cancel:[o1.Esc],end:[o1.Space,o1.Tab]};function H30($,Z,J){let H=$.indexOf(Z),Q=$.indexOf(J);if(H<0||Q<0||H===Q)return $;let B=[...$],[X]=B.splice(H,1);return B.splice(Q,0,X),B}function oK({items:$,getId:Z,className:J,itemClassName:H,dragDisabled:Q=!1,isItemDragDisabled:B,onReorder:X,renderItem:z,renderPlaceholder:G,renderOverlay:U}){let K=Py(rD(WB,{activationConstraint:{distance:4}}),rD(FB,{keyboardCodes:J30})),[Y,F]=c6.useState(null),[W,q]=c6.useState(null),N=c6.useRef(null),A=c6.useMemo(()=>$.map(Z),[$,Z]),V=c6.useMemo(()=>new Map($.map((R)=>[Z(R),R])),[$,Z]),L=(Y&&W?W:A).map((R)=>V.get(R)).filter((R)=>Boolean(R)),j=Y?V.get(Y):void 0,M=B?$.filter((R)=>!B(R)).length:$.length,_=Q||M<2;return w$.jsxs(my,{sensors:K,collisionDetection:_y,onDragStart:(R)=>{let T=$.map(Z);F(String(R.active.id)),N.current=T,q(T)},onDragOver:(R)=>{let T=String(R.active.id),I=R.over?String(R.over.id):void 0,y=N.current;if(!I||I===T||!y)return;let S=H30(y,T,I);if(S===y)return;N.current=S,q(S)},onDragCancel:()=>{N.current=null,F(null),q(null)},onDragEnd:(R)=>{let T=String(R.active.id),I=N.current;if(N.current=null,F(null),q(null),!I||I.join("|")===A.join("|"))return;if(!I.includes(T))return;X(I)},children:[w$.jsx("div",{className:J,children:L.map((R)=>w$.jsx(Q30,{id:Z(R),item:R,disabled:_||B?.(R)===!0,itemClassName:H,renderItem:z,renderPlaceholder:G},Z(R)))}),w$.jsx(cy,{dropAnimation:null,children:j&&U?U(j):null})]})}function Q30({id:$,item:Z,disabled:J,itemClassName:H,renderItem:Q,renderPlaceholder:B}){let{setNodeRef:X,isOver:z}=py({id:$,disabled:J}),{attributes:G,listeners:U,setNodeRef:K,isDragging:Y}=uy({id:$,disabled:J,attributes:{roleDescription:"sortable item"}}),F=(q)=>{X(q),K(q)},W={isDragging:Y,isOver:z,dragDisabled:J,dragHandleProps:J?{}:{...G,...U}};return w$.jsxs(z5.div,{layout:!0,ref:F,className:B0("relative",H?.(Z,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[Y&&B?.(Z),Q(Z,W)]})}var F1=P(c(),1),B30="https://mlfrg.notion.site/3c678a44b6788042b734d775dd2e935e?pvs=105";function X30($){return B0(V$({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function nK({children:$,showWorkspaces:Z=!0}){let{data:J}=qU(),H=U1();return W2((Q)=>{if(Q.type==="workspace:updated"||Q.type==="theme:updated"||Q.type==="workspaces-list:updated")H.invalidateQueries({queryKey:S0.all,exact:!0})}),F1.jsxs("div",{className:"flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none",children:[F1.jsx(z30,{workspaces:Z?J??[]:[]}),F1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function z30({workspaces:$}){let Z=wR();return F1.jsx(CG,{delay:500,children:F1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[F1.jsxs(Q5,{children:[F1.jsx(B5,{render:F1.jsx(y7,{href:"/","aria-label":"Home",className:X30,children:F1.jsx(iy,{stroke:1.5})})}),F1.jsx(X5,{side:"right",children:"Home"})]}),F1.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&&F1.jsxs(F1.Fragment,{children:[F1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:F1.jsx(oK,{items:$,getId:(J)=>J.id,className:"flex flex-col gap-4",onReorder:(J)=>Z.mutate(J),renderPlaceholder:()=>F1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-12 rounded-xl bg-accent"}),renderOverlay:(J)=>F1.jsx(dy,{workspace:J,dragOverlay:!0}),renderItem:(J,H)=>F1.jsx(dy,{workspace:J,dragState:H})})}),F1.jsx("div",{className:"shrink-0",children:F1.jsxs(Q5,{children:[F1.jsx(ZB,{trigger:F1.jsx(B5,{render:F1.jsx(j0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:F1.jsx(f2,{"data-icon":"inline-start",stroke:1.5})})})}),F1.jsx(X5,{side:"right",children:"Create new workspace"})]})})]})}),F1.jsx("div",{className:"size-8 shrink-0",children:F1.jsx(G30,{})})]})})}function G30(){let{cloudDemo:$}=T8(),Z=xR();if($)return F1.jsx(FJ,{trigger:F1.jsx(j0,{size:"icon","aria-label":"Unlock all features",title:"Unlock all features",children:F1.jsx(ry,{stroke:1.5})})});if(Z.status==="loading")return null;if(Z.status==="available")return F1.jsx(hR,{...Z.button});return F1.jsx(U30,{})}function U30(){return F1.jsxs(Q5,{children:[F1.jsx(B5,{render:F1.jsx(j0,{render:F1.jsx("a",{href:B30,target:"_blank",rel:"noreferrer"}),variant:"ghost",size:"icon","aria-label":"Leave feedback",className:"text-muted-foreground hover:text-foreground",children:F1.jsx(ly,{stroke:1.5})})}),F1.jsx(X5,{side:"right",children:"Leave feedback"})]})}function dy({workspace:$,dragOverlay:Z=!1,dragState:J}){let[H]=q8(),Q=`/workspace/${$.id}`,B=P$($),X=H===Q||H.startsWith(`${Q}/`),z=F1.jsx("div",{className:B0(V$({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:F1.jsx(u6,{icon:$.icon,workspaceType:$.type,workspaceTheme:$.theme,className:"size-7 shrink-0 rounded-md transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"})}),G=F1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:B});if(Z)return F1.jsxs("span",{className:"flex w-14 flex-col items-center",children:[z,G]});return F1.jsxs(y7,{href:Q,"aria-label":B,onClick:(U)=>{if(J?.isDragging)U.preventDefault()},className:B0("group flex w-14 flex-col items-center rounded-xl outline-none",J?.isDragging&&"invisible"),...J?.dragHandleProps,children:[z,F1.jsxs(Q5,{children:[F1.jsx(B5,{render:G}),F1.jsx(X5,{side:"right",children:B})]})]})}var ix=P(m(),1);var ay=P(m(),1);var E$=P(c(),1);function K30({choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:Q,onSubmit:B}){return E$.jsx(vK,{title:`Import ${P$($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:Z,isPending:J,errorMessage:H,secondaryAction:E$.jsx(kQ,{render:E$.jsx(j0,{variant:"secondary"}),disabled:J,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:Q,onSubmit:B})}function oy({choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:Q,onSubmit:B,onReset:X}){let[z,G]=ay.useState(!0);function U(Y){if(!Y&&J)return;G(Y)}function K(Y){if(!Y)X()}return E$.jsx(O6,{open:z,onOpenChange:U,onOpenChangeComplete:K,children:E$.jsx(gK,{showCloseButton:!J,children:E$.jsx(K30,{choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:Q,onSubmit:B})})})}var ny=P(m(),1);function Y30($){return $.types[0]??KJ[0]}function sy({onSuccess:$}){let Z=TR(),[J,H]=ny.useState(null);function Q(G){Z.reset(),H({workspace:G,selectedType:Y30(G)})}function B(G){H((U)=>U?{...U,selectedType:G}:U)}function X(){if(!J||Z.isPending)return;Z.mutate({path:J.workspace.path,type:J.selectedType},{onSuccess:$})}function z(){H(null),Z.reset()}return{choice:J,isPending:Z.isPending,error:Z.error,startImport:Q,selectType:B,submit:X,reset:z}}var VB=P(m(),1);var AB=P(c(),1),F30=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],d6=10,sK=3,W30=2.5,q30={O:1,o:0.5,".":0},N30=3000,V30=2,ty=3,l6=3,ey=0.001,S$={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function A30($){let Z=Math.max(...$.map((B)=>B.length)),J=Z*d6+(Z-1)*sK,H=$.length*d6+($.length-1)*sK,Q=[];return $.forEach((B,X)=>{Array.from(B).forEach((z,G)=>{let U=q30[z];if(U===void 0)return;let K=G*(d6+sK),Y=X*(d6+sK);Q.push({x:K,y:Y,centerX:K+d6/2,centerY:Y+d6/2,targetOpacity:U})})}),{width:J,height:H,fieldColumns:Math.round(J/l6)+1,fieldRows:Math.round(H/l6)+1,pixels:Q}}var D30=F30.map(A30);function NB($,Z,J){return $<Z?Z:$>J?J:$}function L30($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class $x{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,J){this.rects=$,this.svg=Z,this.geometry=J;let H=J.fieldColumns*J.fieldRows;this.field=new Float32Array(H),this.previousField=new Float32Array(H),this.nextField=new Float32Array(H)}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/l6),Z=Math.round(this.geometry.height/2/l6),J=2*ty*ty;for(let H=0;H<this.geometry.fieldRows;H++)for(let Q=0;Q<this.geometry.fieldColumns;Q++){let B=(Q-$)**2+(H-Z)**2,X=V30*Math.exp(-B/J),z=H*this.geometry.fieldColumns+Q;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 J=($-this.introStartedAt)/N30;if(this.activation=1-L30(Math.min(1,J)),J>=1)this.intro=!1}else{this.intro=!1;let J=this.pointerActive?1:0,H=this.pointerActive?S$.fadeIn:S$.fadeOut;this.activation+=(J-this.activation)*H}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>ey||Z>ey){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let H=1;H<Z-1;H++)for(let Q=1;Q<$-1;Q++){let B=H*$+Q,X=this.field[B-1]+this.field[B+1]+this.field[B-$]+this.field[B+$]-4*this.field[B];this.nextField[B]=(2*this.field[B]-this.previousField[B]+S$.courantSquared*X)*S$.damping}let J=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=J}driveWave($){let Z=NB(Math.round(this.pointerX/l6),1,this.geometry.fieldColumns-2),J=NB(Math.round(this.pointerY/l6),1,this.geometry.fieldRows-2);this.field[J*this.geometry.fieldColumns+Z]=S$.driveAmplitude*Math.sin($*S$.driveFrequency)}sampleField($,Z){let J=NB($/l6,0,this.geometry.fieldColumns-1),H=NB(Z/l6,0,this.geometry.fieldRows-1),Q=Math.floor(J),B=Math.floor(H),X=Math.min(Q+1,this.geometry.fieldColumns-1),z=Math.min(B+1,this.geometry.fieldRows-1),G=J-Q,U=H-B,{fieldColumns:K}=this.geometry,Y=this.field[B*K+Q],F=this.field[B*K+X],W=this.field[z*K+Q],q=this.field[z*K+X];return(Y*(1-G)+F*G)*(1-U)+(W*(1-G)+q*G)*U}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,J)=>{let H=this.rects[J];if(!H)return;let Q=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(Q));let B=NB(0.5+Q*S$.gain,0,1),X=Z.targetOpacity*(1-this.activation)+B*this.activation;H.setAttribute("opacity",X.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function M30({geometry:$}){let Z=VB.useRef([]),J=VB.useRef(null);return VB.useEffect(()=>{let H=J.current;if(!H||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let Q=new $x(Z.current,H,$);return Q.start(),window.addEventListener("pointermove",Q.handlePointerMove),()=>{Q.stop(),window.removeEventListener("pointermove",Q.handlePointerMove)}},[$]),AB.jsx("svg",{ref:J,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((H,Q)=>AB.jsx("rect",{ref:(B)=>{Z.current[Q]=B},x:H.x,y:H.y,width:d6,height:d6,rx:W30,opacity:H.targetOpacity},`${H.x}-${H.y}`))})}function Zx({className:$}){return AB.jsx("div",{role:"img","aria-label":"moi",className:B0("flex items-center gap-2 text-accent",$),children:D30.map((Z,J)=>AB.jsx(M30,{geometry:Z},J))})}function nD({l:$,c:Z,h:J}){let H=J*Math.PI/180,Q=Z*Math.cos(H),B=Z*Math.sin(H),X=$+0.3963377774*Q+0.2158037573*B,z=$-0.1055613458*Q-0.0638541728*B,G=$-0.0894841775*Q-1.291485548*B,U=X*X*X,K=z*z*z,Y=G*G*G;return[4.0767416621*U-3.3077115913*K+0.2309699292*Y,-1.2684380046*U+2.6097574011*K-0.3413193965*Y,-0.0041960863*U-0.7034186147*K+1.707614701*Y]}var Jx=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function Xx($){let Z=nD($);if(!Jx(Z)){let J=0,H=$.c;for(let Q=0;Q<12;Q++){let B=(J+H)/2;if(Jx(nD({...$,c:B})))J=B;else H=B}Z=nD({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function Hx($){let[Z,J,H]=Xx($);return 0.2126*Z+0.7152*J+0.0722*H}function DB($,Z){let J=Hx($),H=Hx(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function Qx($,Z,J){if(DB($,Z)>=J)return $;let H=$.l>=Z.l?1:-1;for(let X of[H,-H]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),DB(z,Z)>=J)return z;if(z.l===0||z.l===1)break}}let Q={...$,l:0,c:0},B={...$,l:1,c:0};return DB(Q,Z)>=DB(B,Z)?Q:B}function tK($){return"#"+Xx($).map((Z)=>{let J=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(J*255).toString(16).padStart(2,"0")}).join("")}function EJ($){let Z=parseInt($.slice(1),16),[J,H,Q]=[Z>>16&255,Z>>8&255,Z&255].map((K)=>{let Y=K/255;return Y<=0.04045?Y/12.92:Math.pow((Y+0.055)/1.055,2.4)}),B=Math.cbrt(0.4122214708*J+0.5363325363*H+0.0514459929*Q),X=Math.cbrt(0.2119034982*J+0.6806995451*H+0.1073969566*Q),z=Math.cbrt(0.0883024619*J+0.2817188376*H+0.6299787005*Q),G=1.9779984951*B-2.428592205*X+0.4505937099*z,U=0.0259040371*B+0.7827717662*X-0.808675766*z;return{l:0.2104542553*B+0.793617785*X-0.0040720468*z,c:Math.hypot(G,U),h:Math.atan2(U,G)*180/Math.PI}}function P30($,Z,J){let H=(K)=>K*Math.PI/180,Q=$.c*Math.cos(H($.h)),B=$.c*Math.sin(H($.h)),X=Z.c*Math.cos(H(Z.h)),z=Z.c*Math.sin(H(Z.h)),G=Q+(X-Q)*J,U=B+(z-B)*J;return{l:$.l+(Z.l-$.l)*J,c:Math.hypot(G,U),h:Math.atan2(U,G)*180/Math.PI}}var eK=($,Z,J)=>tK(P30(EJ($),EJ(Z),J));var _30={h:12,l:0.84,pull:0.4,c:0.1};var Bx=4.55;function j30($,Z,J){let H=EJ($),Q=EJ(Z),B={l:H.l+(J.l-H.l)*J.pull,c:Math.max(H.c,J.c),h:J.h};B=Qx(B,O30,T30);let X=Qx(Q,B,Bx),z=X.l>=B.l?1:-1,G=tK(B);for(let U=0;U<40;U++){let K=tK(X),Y=1/0;for(let W=0;W<=10;W++){let q=W/10;Y=Math.min(Y,DB(EJ(eK(Z,K,q)),EJ(eK($,G,q))))}if(Y>=Bx)return[G,K];let F=Math.min(1,Math.max(0,X.l+z*0.02));if(F===X.l)return[G,K];X={...X,l:F}}return[G,tK(X)]}var O30={l:0.145,c:0,h:0},T30=1.5;var sD={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},zx=($)=>String(Math.round($*1000)/1000);function c9($,Z){return{l:{...$,eyes:$.eyes.map((J,H)=>({...J,cx:J.cx+Z.edx*(H?1:-1),cy:J.cy+Z.edy+(H?Z.edy2:0),rx:J.rx*(Z.esx+(H?Z.esx2:0)),ry:J.ry*(Z.esy+(H?Z.esy2:0)),rot:J.rot*(1-Z.lock)+(Z.tilt+(H?Z.tilt2:0))*(H?1:-1)}))},wrap:Z.bdy!==0?`translate(0 ${zx(Z.bdy)})`:""}}function d9($){let Z={};for(let J in sD){if(J==="heat")continue;let H=$[J];if(H!==sD[J])Z["--mo-"+J]=zx(H)}return Z}function C30($,Z,J){let[H,Q]=j30($.head,$.eye,J);return{...$,head:eK($.head,H,Z.heat),eye:eK($.eye,Q,Z.heat)}}var Gx={p:sD,vars:d9,bake:c9},Ux={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:d9,bake:c9},Kx={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:d9,bake:c9};var Yx={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:d9,bake:c9},Fx={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:d9,bake:c9},Wx={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:d9,bake:c9},qx={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:d9,bake:c9},Nx={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:d9,bake:c9};var Vx={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:d9,bake:c9,tint:($,Z)=>C30($,Z,_30)};var Ax={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:d9,bake:c9};var Dx=P(c(),1),w30="moi-agent",E30={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},S30={idle:Gx,happy:Ux,sad:Kx,surprised:Yx,wink:Fx,sleepy:Wx,smug:qx,unsure:Nx,shy:Vx,thinking:Ax};function l9({size:$=56,preset:Z=u9.agent,animated:J=!1,color:H="default",expression:Q="idle",className:B}){return Dx.jsx(oG,{name:w30,size:$,animate:J?"always":"hover",palette:E30[H],expression:Q?S30[Q]:void 0,className:B0("shrink-0",B),traits:sQ[Z].traits})}var RJ={};C5(RJ,{Trigger:()=>Rx,Root:()=>Ex,Panel:()=>hx});var LB=P(m(),1);var $Y=P(m(),1);function Lx($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,disabled:Q}=$,[B,X]=J4({controlled:Z,default:J,name:"Collapsible",state:"open"}),{mounted:z,setMounted:G,transitionStatus:U}=j2(B,!0,!0),K=t0(),[Y,F]=$Y.useState(),W=Y===null?void 0:Y??K,q=U0((N)=>{let A=!B,V=R0(K0.triggerPress,N.nativeEvent);if(H(A,V),V.isCanceled)return;X(A)});return $Y.useMemo(()=>({defaultPanelId:K,disabled:Q,handleTrigger:q,mounted:z,open:B,panelId:W,setMounted:G,setOpen:X,setPanelIdState:F,transitionStatus:U}),[K,Q,q,z,B,W,G,X,F,U])}var ZY=P(m(),1),tD=ZY.createContext(void 0);function JY(){let $=ZY.useContext(tD);if($===void 0)throw Error(y0(15));return $}var Mx="data-open",Px="data-closed",_x=n4.startingStyle,Rn0=n4.endingStyle;var Ox="data-panel-open";var I30={[Mx]:""},b30={[Px]:""},Tx={open($){if($)return{[Ox]:""};return null}},Cx={open($){if($)return I30;return b30}};var HY={...Cx,...Q2};var wx=P(c(),1),Ex=LB.forwardRef(function(Z,J){let{render:H,className:Q,defaultOpen:B=!1,disabled:X=!1,onOpenChange:z,open:G,style:U,...K}=Z,Y=U0(z),F=Lx({open:G,defaultOpen:B,onOpenChange:Y,disabled:X}),W=LB.useMemo(()=>({open:F.open,disabled:F.disabled,transitionStatus:F.transitionStatus}),[F.open,F.disabled,F.transitionStatus]),q=LB.useMemo(()=>({...F,onOpenChange:Y,state:W}),[F,Y,W]),N=z0("div",Z,{state:W,ref:J,props:K,stateAttributesMapping:HY});return wx.jsx(tD.Provider,{value:q,children:N})});var Sx=P(m(),1);var k30={...Tx,...Q2},Rx=Sx.forwardRef(function(Z,J){let{panelId:H,open:Q,handleTrigger:B,state:X,disabled:z}=JY(),{className:G,disabled:U=z,render:K,nativeButton:Y=!0,style:F,...W}=Z,{getButtonProps:q,buttonRef:N}=T5({disabled:U,focusableWhenDisabled:!0,native:Y});return z0("button",Z,{state:X,ref:[J,N],props:[{"aria-controls":Q?H:void 0,"aria-expanded":Q,onClick:B},W,q],stateAttributesMapping:k30})});var eD=P(m(),1);var _4=P(m(),1);var MB={height:void 0,width:void 0};function bx($){let{externalRef:Z,hiddenUntilFound:J,id:H,keepMounted:Q,mounted:B,onOpenChange:X,open:z,setMounted:G,setOpen:U,transitionStatus:K}=$,Y=_4.useRef(null),F=_4.useRef(null),[W,q]=_4.useState(MB),N=_4.useRef(MB),A=_4.useRef(!1),V=_4.useRef(z),D=_4.useRef(!1),[L,j]=_4.useState(!1),M=_4.useRef(null),_=x2(Z,Y),E=U5(z),C=h4(Y),R=!z&&!B,T=L?"idle":K,I=z&&(V.current||D.current),y=!z&&B&&F.current==="css-animation"&&W.height===void 0&&W.width===void 0?N.current:W,S=J&&R&&F.current!=="css-animation",O=U0((f,w=!0)=>{if(w)N.current=f;q(f)}),k=U0(()=>{M.current?.(),M.current=null}),b=U0((f)=>{k(),M.current=()=>{M.current=null,f()}}),h=U0(()=>{if(z&&B&&F.current==="css-animation")D.current=!0});J0(()=>{if(!L||K==="starting")return;j(!1)},[L,K]),_4.useEffect(()=>{return()=>{h(),k()}},[h,k]),J0(()=>{let f=Y.current;if(!f)return;if(!z&&M.current)k();let w=y30(f,I);if(F.current=w,z&&K==="idle"&&V.current&&w==="css-animation"){N.current=SJ(f);return}if(z&&K==="starting"){let x=A.current;if(A.current=!1,w==="none"){O(SJ(f)),j(!0);return}if(w==="css-transition"){let p=x30(f);if(O(SJ(f)),!x)return p;let d=QY(f,"transition-duration","0s");return b(d),j(!0),p}O(SJ(f));let l=QY(f,"animation-name","none");if(!x){l();return}let s=QY(f,"animation-duration","0s");l(),b(s),j(!0);return}if(!z&&B&&(K==="idle"||K==="starting")){if(V.current=!1,D.current=!1,w==="none"){O(MB,!1),G(!1);return}O(SJ(f));return}if(K!=="ending")return;if(w==="none"){G(!1);return}let i=SJ(f);if(!(i.height>0||i.width>0)){G(!1);return}if(O(i),w==="css-animation")QY(f,"animation-name","none")();return},[B,z,k,O,G,b,I,K]),q5({enabled:z&&B&&T==="idle",open:!0,ref:Y,onComplete(){if(!z)return;O(MB,!1)}}),_4.useEffect(()=>{if(z||!B||T!=="ending")return;if(!Y.current)return;let w=new AbortController,i=-1;function r(){if(E.current)return;G(!1),O(MB,!1)}return i=k2.request(()=>{C(r,w.signal)}),()=>{k2.cancel(i),w.abort()}},[E,B,z,T,C,O,G]),J0(()=>{let f=Y.current;if(!f||!J||!R)return;f.setAttribute("hidden","until-found")},[R,J]),_4.useEffect(function(){let w=Y.current;if(!w)return;function i(r){let x=R0(K0.none,r);if(X(!0,x),x.isCanceled)return;A.current=!0,U(!0)}return n0(w,"beforematch",i)},[X,U]);let v=Q||J||B||z;return{height:y.height,props:{...S?{[_x]:""}:void 0,hidden:R,id:H},ref:_,shouldPreventOpenAnimation:I,shouldRender:v,transitionStatus:T,width:y.width}}function SJ($){return{height:$.scrollHeight,width:$.scrollWidth}}function y30($,Z){let J=I1($).getComputedStyle($),H=(J.animationName.split(",").map((B)=>B.trim()).some((B)=>B!==""&&B!=="none")||Z)&&Ix(J.animationDuration),Q=Ix(J.transitionDuration);if(H&&Q)return"css-transition";if(Q)return"css-transition";if(H)return"css-animation";return"none"}function Ix($){return $.split(",").map((Z)=>Z.trim()).some((Z)=>Z!==""&&Number.parseFloat(Z)>0)}function QY($,Z,J){let H=$.style.getPropertyValue(Z),Q=$.style.getPropertyPriority(Z);return $.style.setProperty(Z,J),()=>{if(H===""){$.style.removeProperty(Z);return}$.style.setProperty(Z,H,Q)}}function x30($){let Z={"justify-content":$.style.justifyContent,"align-items":$.style.alignItems,"align-content":$.style.alignContent,"justify-items":$.style.justifyItems};Object.keys(Z).forEach((Q)=>{$.style.setProperty(Q,"initial","important")});function J(){Object.entries(Z).forEach(([Q,B])=>{if(B===""){$.style.removeProperty(Q);return}$.style.setProperty(Q,B)})}let H=k2.request(J);return()=>{k2.cancel(H),J()}}var kx="--collapsible-panel-height",yx="--collapsible-panel-width";var hx=eD.forwardRef(function(Z,J){let{className:H,hiddenUntilFound:Q,keepMounted:B,render:X,id:z,style:G,...U}=Z,{defaultPanelId:K,mounted:Y,onOpenChange:F,open:W,setMounted:q,setPanelIdState:N,setOpen:A,state:V,transitionStatus:D}=JY(),L=Q??!1,j=B??!1,M=z||void 0,_=M??K;J0(()=>{return N((h)=>M??(h===null?void 0:h)),()=>{N((h)=>h===M?null:h)}},[M,N]);let{height:E,props:C,ref:R,shouldPreventOpenAnimation:T,shouldRender:I,transitionStatus:y,width:S}=bx({externalRef:J,hiddenUntilFound:L,id:_,keepMounted:j,mounted:Y,onOpenChange:F,open:W,setMounted:q,setOpen:A,transitionStatus:D}),O={...V,transitionStatus:y},k=xx(G,O),b=z0("div",{...Z,style:void 0},{state:O,ref:R,props:[C,{style:{[kx]:E===void 0?"auto":`${E}px`,[yx]:S===void 0?"auto":`${S}px`}},U,k?{style:k}:void 0,T?{style:{animationName:"none"}}:void 0],stateAttributesMapping:HY});if(!I)return null;return b});var GY=P(c(),1);function BY({...$}){return GY.jsx(RJ.Root,{"data-slot":"collapsible",...$})}function XY({...$}){return GY.jsx(RJ.Trigger,{"data-slot":"collapsible-trigger",...$})}function zY({...$}){return GY.jsx(RJ.Panel,{"data-slot":"collapsible-content",...$})}var UY=P(m(),1);var $L="moi-fonts",vx="moi-font-previews",v30=Object.values(m6).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),fx=[["sans","--sans"],["mono","--mono"]],mx=xD.map(($)=>[$,g30($)]),ux="--radius",gx=[...fx.map(([,$])=>$),...mx.map(([,$])=>$),ux];function g30($){return`--${$.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}`}function f30($){let Z={},J=$9($),H=J.font===u9.font?void 0:m6[J.font];for(let[Q,B]of fx)Z[B]=H?.[Q];return Z}function ZL($,Z="workspace"){let J={},H=xK($,Z);for(let[Q,B]of mx)J[B]=H?.[Q];return J}function m30($){let Z={},J=$9($),H=J.radius===u9.radius?void 0:nQ[J.radius];return Z[ux]=H?.radius,Z}function J9($,Z="workspace"){return{...f30($),...ZL($,Z),...m30($)}}function KY(){UY.useEffect(()=>{if(document.getElementById(vx))return;let $=document.createElement("link");return $.id=vx,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${v30}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function u30($){UY.useEffect(()=>{let Z=document.documentElement,J=J9($);for(let H of gx){let Q=J[H];if(Q)Z.style.setProperty(H,Q);else Z.style.removeProperty(H)}return()=>{for(let H of gx)Z.style.removeProperty(H)}},[$])}function px($){let{font:Z}=$9($);u30($),UY.useEffect(()=>{let J=m6[Z]??m6[u9.font],H=document.getElementById($L);if(!J.googleFontsQuery)H?.remove();else{let Q=`https://fonts.googleapis.com/css2?family=${J.googleFontsQuery}&display=swap`;if(H)H.href=Q;else{let B=document.createElement("link");B.id=$L,B.rel="stylesheet",B.crossOrigin="anonymous",B.href=Q,document.head.appendChild(B)}}return()=>{document.getElementById($L)?.remove()}},[Z])}var IJ=P(m(),1);var N2=P(c(),1),PB={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function p30($){let{width:Z,height:J,radius:H,topLeftRadius:Q,bodyTop:B,tabEnd:X,shoulder:z}=PB,G=Math.min(Z/2,H*$),U=Math.min(Z/2,Q*$),K=Math.max(0,z.width),Y=X+K,F=Math.max(0,Math.min(z.roundness,K/2));return[`M ${U} 0`,`H ${X}`,`C ${X+F} 0 ${Y-F} ${B} ${Y} ${B}`,`H ${Z-G}`,`Q ${Z} ${B} ${Z} ${B+H}`,`V ${J-H}`,`Q ${Z} ${J} ${Z-G} ${J}`,`H ${G}`,`Q 0 ${J} 0 ${J-H}`,`V ${Q}`,`Q 0 0 ${U} 0`,"Z"].join(" ")}function c30(){let $=IJ.useRef(null),[Z,J]=IJ.useState(1);return IJ.useLayoutEffect(()=>{let H=$.current;if(!H)return;let Q=(z,G)=>{if(z<=0||G<=0)return;let U=z/PB.width,Y=G/PB.height/U;J((F)=>Math.abs(F-Y)<0.001?F:Y)},B=H.getBoundingClientRect();Q(B.width,B.height);let X=new ResizeObserver(([z])=>{if(z)Q(z.contentRect.width,z.contentRect.height)});return X.observe(H),()=>X.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var cx=[{frame:B0("-translate-x-3 translate-y-3 -rotate-6","group-focus-within:translate-y-2 group-hover:translate-y-2"),img:"opacity-40"},{frame:B0("translate-x-3 translate-y-2 rotate-5","group-focus-within:translate-y-1 group-hover:translate-y-1"),img:"opacity-50"},{frame:B0("-translate-x-1 translate-y-1 -rotate-2","group-focus-within:-translate-y-2 group-hover:-translate-y-2"),img:"opacity-100"}];function dx({workspaceId:$}){let Z=NU($),J=Z.data?[...Z.data.thumbnails].reverse():[],H=cx.slice(cx.length-J.length),Q=Z.data?.firstUserMessage,B=Z.data?.theme,{ref:X,horizontalRadiusScale:z}=c30(),G=p30(z),U=`folder-noise-${$}`,K=J9(B),Y=ZL(B);return N2.jsxs("div",{ref:X,style:Y,className:"relative h-45 w-full",children:[N2.jsxs("svg",{viewBox:`0 0 ${PB.width} ${PB.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[N2.jsx("defs",{children:N2.jsxs("filter",{id:U,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[N2.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),N2.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),N2.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:N2.jsx("feFuncA",{type:"linear",slope:"0.24"})}),N2.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),N2.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),N2.jsx("path",{d:G,filter:`url(#${U})`,className:"fill-accent"})]}),J.map((F,W)=>N2.jsx("div",{className:B0("absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs squircle","animate-in duration-300 ease-out fade-in",H[W].frame),children:N2.jsx("img",{src:F,alt:"",loading:"lazy",className:B0("block h-auto max-h-32 w-auto max-w-full object-contain",H[W].img)})},F)),J.length===0&&Q&&N2.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:N2.jsx("div",{"aria-hidden":"true",style:K,className:B0("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:N2.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:Q})})}),N2.jsx("div",{className:B0("absolute inset-x-2 top-[40%] bottom-2 rounded-3xl 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 H1=P(c(),1);function rx(){KY();let[,$]=q8(),Z=qU(),J=OR(),H=VU(),Q=sy({onSuccess:(q)=>$(`/workspace/${q.id}`)}),B=T8(),[X,z]=ix.useState(!1),G=w5((q)=>q.discoveredWorkspacesOpen),U=w5((q)=>q.setDiscoveredWorkspacesOpen);if(Z.isPending||J.isPending)return H1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:H1.jsx(k5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||J.isError)return H1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:H1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let K=Z.data,Y=J.data,F=K.length;function W(q){if(B.cloudDemo){z(!0);return}Q.startImport(q)}return H1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[H1.jsx(Zx,{className:"mb-10"}),F>0?H1.jsxs("section",{className:"mb-12",children:[H1.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[H1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),H1.jsx(ZB,{trigger:H1.jsxs(j0,{variant:"outline",size:"sm",children:[H1.jsx(f2,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),H1.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:K.map((q)=>H1.jsx(d30,{workspace:q},q.id))})]}):H1.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[H1.jsx(lx,{size:32,stroke:1.5,className:"text-muted-foreground"}),H1.jsxs("div",{className:"flex flex-col gap-1.5",children:[H1.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),H1.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."})]}),H1.jsx(ZB,{trigger:H1.jsx(j0,{children:"Create workspace"})})]}),Y.length>0&&H1.jsx("section",{children:H1.jsxs(BY,{open:G,onOpenChange:U,className:"group",children:[H1.jsxs(XY,{className:B0("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:[H1.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),H1.jsx(R$,{size:16,stroke:2,className:B0("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),H1.jsx(zY,{children:H1.jsx("ul",{className:"border-t border-border",children:Y.map((q)=>H1.jsx(l30,{suggestion:q,onAdd:W},q.path))})})]})}),Q.choice&&H1.jsx(oy,{choice:Q.choice,availability:H.data?.availability,isPending:Q.isPending,errorMessage:Q.error?.message,onTypeChange:Q.selectType,onSubmit:Q.submit,onReset:Q.reset}),H1.jsx(FJ,{open:X,onOpenChange:z})]})}function d30({workspace:$}){let Z=P$($),J=NU($.id),H=$.theme??J.data?.theme,Q=$9(H).agent,B=g2((G)=>SG(G.activity,$.id)),X=J.data?.updatedAt??new Date($.addedAt).getTime(),z=`/workspace/${$.id}`;return H1.jsxs("div",{className:"group flex min-w-0 flex-col gap-3",children:[H1.jsxs("div",{className:"relative",children:[H1.jsx(dx,{workspaceId:$.id}),H1.jsx(y7,{href:z,"aria-label":`Open ${Z}`,className:"absolute inset-0 rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),J.data&&H1.jsxs(Q5,{children:[H1.jsx(B5,{render:H1.jsx(y7,{href:ME($.id,"agent"),"aria-label":`Chat in ${Z}`,style:J9(H),className:"absolute right-3 bottom-3 rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:H1.jsx(l9,{preset:Q,color:"primary",animated:B,expression:B?"thinking":void 0,size:48,className:"drop-shadow-sm drop-shadow-primary/20"})})}),H1.jsx(X5,{children:"Chat"})]})]}),H1.jsxs(y7,{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:[H1.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:J9(H),children:[H1.jsx(u6,{icon:$.icon,workspaceType:$.type,workspaceTheme:H,className:"size-4 shrink-0 rounded-xs"}),H1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),H1.jsx("span",{className:"text-xs text-muted-foreground",children:i30(X)})]})]})}function l30({suggestion:$,onAdd:Z}){let{path:J,types:H}=$,Q=P$($);return H1.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[H1.jsx(sk,{types:H}),H1.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:Q}),H1.jsx("span",{title:J,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??J}),H1.jsxs(j0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[H1.jsx(f2,{stroke:1.75}),"Add"]})]})}function i30($){let Z=Date.now()-$,J=Math.floor(Z/60000);if(J<1)return"Updated just now";if(J<60)return`Updated ${J} min${J===1?"":"s"} ago`;let H=Math.floor(J/60);if(H<24)return`Updated ${H} hour${H===1?"":"s"} ago`;let Q=Math.floor(H/24);if(Q<30)return`Updated ${Q} day${Q===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var YY=P(c(),1);function ax(){return YY.jsx(nK,{showWorkspaces:!1,children:YY.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:YY.jsx(rx,{})})})}var FY=P(m(),1);var JL=P(c(),1),sx=($)=>$.map((Z)=>[...Z].map((J)=>J==="#"?1:0)),r30=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],a30=["###.#","#.#.#","#.#.#","#.#.#","###.#"],o30=sx([".....","####.","#.#.#","#.#.#","#.#.#"]),n30=sx(r30.map(($,Z)=>`${$}.${a30[Z]}`)),s30={moi:o30,"moi-full":n30};function tx($,Z,J){let H=[];for(let Q=0;Q<Z;Q++){let B=[];for(let X=0;X<$;X++)B.push(J(X,Q));H.push(B)}return H}function ox($,Z,J){let H=Math.sin($*12.9898+Z*78.233+J*37.719)*43758.5453;return H-Math.floor(H)}function t30($,Z,J){return tx(Z,J,(H,Q)=>{let B=ox(H,Q,0)*Math.PI*2,X=5+ox(H,Q,1)*6,z=0.5+0.5*Math.sin($*X+B);return z*z})}function e30($,Z,J){return tx(Z,J,(Q,B)=>0.5+0.5*Math.sin(Q*0.5+B*0.32-$*6.5))}var ex=0.55;function $60($,Z){let J=$.length,H=$.reduce((G,U)=>Math.max(G,U.length),0),Q=Math.min(Z/ex,1),B=1-Math.pow(1-Q,3),X=Math.round((1-B)*J),z=[];for(let G=0;G<J;G++){let U=[];for(let K=0;K<H;K++)U.push($[G-X]?.[K]??0);z.push(U)}return z}function nx($,Z,J){let H=s30[$];if(Z===void 0)return $60(H,J);let Q=H.length,B=H[0]?.length??0;return Z==="wave"?e30(J,B,Q):t30(J,B,Q)}var Z60=24;function J60($,Z,J){let[H,Q]=FY.useState(()=>nx($,Z,0));return FY.useEffect(()=>{let B=0,X=null,z=0,G=1000/J,U=(K)=>{if(X===null)X=K;let Y=(K-X)/1000;if(K-z>=G){if(z=K,Q(nx($,Z,Y)),Z===void 0&&Y>=ex)return}B=requestAnimationFrame(U)};return B=requestAnimationFrame(U),()=>cancelAnimationFrame(B)},[$,Z,J]),H}function H60($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function $h({sprite:$="moi",effect:Z,fps:J=Z60,pixelSize:H=3,gap:Q=1,className:B}){let X=J60($,Z,J),z=X[0]?.length??0,G=Z!==void 0;return JL.jsx("div",{className:B0("grid",B),style:{gridTemplateColumns:`repeat(${z}, ${H}px)`,gap:`${Q}px`},children:X.flatMap((U,K)=>U.map((Y,F)=>JL.jsx("div",{className:"rounded-[2px]",style:{width:H,height:H,background:H60(Y),boxShadow:G?`0 0 ${(H*(0.4+Y)).toFixed(1)}px rgba(23, 23, 23, ${(Y*0.35).toFixed(3)})`:void 0}},`${K}-${F}`)))})}var kJ=P(m(),1);var WY=5000,qY=120;var Q60="</moi-attachments>";function HL($){if(!x9($)||typeof $.label!=="string")return null;let Z=$.label.trim();if(!Z||Z.length>qY||typeof $.text!=="string"||!$.text.trim()||$.text.length>WY)return null;return{label:Z,text:$.text}}function Zh($){return Array.isArray($)&&$.every((Z)=>x9(Z)&&Z.purpose===void 0&&(Z.source===void 0||typeof Z.source==="string"&&Z.source.length>0)&&HL(Z)!==null)}function Jh($){return $==="annotation"||$==="sketch"}function B60($){return Array.isArray($)&&$.every((Z)=>{if(!x9(Z))return!1;if(Z.type==="text")return Zh([Z]);if(Z.type!=="file"&&Z.type!=="image")return!1;if(Z.source!==void 0&&(typeof Z.source!=="string"||!Z.source))return!1;if(typeof Z.mediaType!=="string"||!Z.mediaType)return!1;if(Z.purpose!==void 0&&(!Jh(Z.purpose)||!Z.mediaType.startsWith("image/")))return!1;let J=typeof Z.path==="string"&&/^(\/|[A-Za-z]:[\\/])/.test(Z.path)&&!Z.path.includes("\x00");if(Z.type==="file")return J&&Z.label===void 0;return Z.path===void 0&&Z.mediaType.startsWith("image/")&&typeof Z.label==="string"&&Boolean(Z.label.trim())})}function QL($){let Z=[],J=!1,H=$.replace(/<moi-attachments>([^<]*)<\/moi-attachments>/g,(Q,B)=>{try{let X=JSON.parse(B),z=x9(X)&&X.version===1&&Array.isArray(X.attachments)?X.attachments.map((G)=>x9(G)?{type:"text",source:G.source,label:G.label,text:G.text}:G):X;if(!B60(z))return Q;return Z.push(...z),J=!0,""}catch{return Q}});return{text:J?H.trim():$,attachments:Z}}function BL($){return $.type==="file"?$.path.split(/[\\/]/).at(-1):$.label}function Hh($,Z){let{source:J}=$,H=BL($);if($.type==="text")return{type:"text-attachment",source:$.source,label:H,text:$.text};return{type:"file-attachment",label:H,mediaType:$.mediaType,source:J,...$.purpose?{purpose:$.purpose}:{},previewUrl:Z,path:$.type==="file"?$.path:void 0}}function X60($){return QL($).text}function Qh($){let Z=X60($),J=Z.search(/<moi-attachments>\s*(?:\[|\{"version":1,"attachments":\[)/);return(J<0||Z.includes(Q60,J)?Z:Z.slice(0,J)).trimEnd()}var _B=10;function NY($){return $.length>_B?`A message can have at most ${_B} attachments.`:null}var Bh=33554432;function Xh($){return typeof $==="string"&&$.length>0&&!/[\\:\0]/.test($)&&$.split("/").every((Z)=>Z.length>0&&!Z.startsWith("."))}var Kh=P(m(),1);var zh=()=>({emit($,...Z){for(let J=this.events[$]||[],H=0,Q=J.length;H<Q;H++)J[H](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((J)=>Z!==J)}}});var z60=({kind:$,name:Z})=>`${$}:${Z}`,G60=1000,XL={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function U60($){let Z=zh(),J=wG(XL),H=(X,z)=>{Z8($,{source:"runtime",kind:X.kind,name:X.name,message:z})},Q=(X,z,G,U,K)=>{let Y=X.admit(G);if(Y==="ok")return!0;return H(z,Y==="cooldown"?U:K),!1},B=(X,z,G)=>{return Q(J,X,`${z}\x00${G}`,`sendChatMessage() for "${G}" was dropped: the same message was already sent less than ${XL.cooldownMs/1000}s ago. Call it from an event handler, not during render.`,`sendChatMessage() for "${G}" was dropped: more than ${XL.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`)};return{on(X,z){return Z.on(X,z)},connect(X,z=""){let G=!0,U=z60(X),K={apiBase:`/api/workspaces/${encodeURIComponent($)}`,workspacePath:o8($,z)};return{bridge:{get collab(){return G?_A:void 0},addChatAttachment(F){if(!G)return;try{let W=Gh(F,U);Z.emit("addChatAttachment",W)}catch(W){let q=zL(W);K5.add({title:"Couldn’t add attachment",description:q,type:"error"}),H(X,`addChatAttachment() was dropped: ${q}`)}},navigate(F){if(!G)return;try{if(typeof F!=="string")throw Error("Navigation needs a URL");B$(F,K),Z.emit("navigate",F)}catch(W){H(X,`navigate() was dropped: ${zL(W)}`)}},resolveUrl(F){if(!G)return"";if(typeof F!=="string")throw Error("A URL is required");return B$(F,K)},sendChatMessage(F,W){if(!G)return;try{if(typeof F==="string")F={message:F,attachments:W===void 0?[]:[{type:"text",label:"Context",text:JSON.stringify(W)}]};if(!x9(F)||typeof F.message!=="string")throw Error("This message uses an unsupported format");if("context"in F)throw Error("This message uses an outdated format");let q=F.message.trim();if(!q)throw Error("The message is empty");if(q.length>G60)throw Error("Messages can be up to 1,000 characters");if(F.attachments!==void 0&&!Array.isArray(F.attachments))throw Error("The attachments use an unsupported format");let N=Array.from(F.attachments??[],(A)=>Gh(A,U));if(!B(X,U,q))return;Z.emit("sendChatMessage",{message:q,source:U,attachments:N})}catch(q){let N=zL(q);K5.add({title:"Couldn’t send message",description:N,type:"error"}),H(X,`sendChatMessage() was dropped: ${N}`)}}},dispose:()=>{G=!1}}}}}function Gh($,Z){if(!x9($))throw Error("This attachment isn’t supported");if($.type==="text"){let J=HL($);if(J)return{type:"text",...J,source:Z};if(typeof $.label!=="string"||!$.label.trim())throw Error("Add a label to this text attachment");if($.label.trim().length>qY)throw Error(`Attachment labels can be up to ${qY} characters`);if(typeof $.text!=="string"||!$.text.trim())throw Error("Add some text to this attachment");if($.text.length>WY)throw Error(`Text attachments can be up to ${WY.toLocaleString("en-US")} characters`)}else if($.type==="file"){if($.file instanceof File&&$.path===void 0){if($.file.size>Bh)throw Error("Files can be up to 32 MB");return{type:"file",file:$.file,source:Z}}if(typeof $.path==="string"&&$.file===void 0){if(!Xh($.path))throw Error("Choose a file from this workspace");return{type:"file",path:$.path,source:Z}}}throw Error("This attachment isn’t supported")}function zL($){return $ instanceof Error?$.message:String($)}var Uh=new Map;function AY($){let Z=Uh.get($);if(!Z)Z=U60($),Uh.set($,Z);return Z}function DY($,Z,J){let H=Y5(J);Kh.useEffect(()=>{let Q=(...B)=>H.current(...B);return AY($).on(Z,Q)},[$,Z,H])}var VY=new Map;function Yh($,Z,J,H,Q=""){let B=$.__attachBridge;if(typeof B!=="function")return;VY.get(J)?.();let{bridge:X,dispose:z}=AY(Z).connect(H,Q);VY.set(J,z),B(X)}function GL($){let Z=VY.get($);if(!Z)return;VY.delete($),Z()}function LY($,Z,J){return`${$}/${Z}/${J}`}var bJ=new Map,jB=new Map;function K60($,Z,J){return bJ.get(LY($,Z,J))??0}var Y60="module";function Fh($,Z,J){return`/api/workspaces/${Z}/${$}/${J}/${Y60}?v=${K60($,Z,J)}`}function MY($,Z,J){return`/api/workspaces/${Z}/${$}/${J}`}function i6($,Z){return`${$}/${Z}`}function Wh($){return jB.get($)}function qh($,Z){jB.set($,Z)}function PY($,Z,J){let H=LY($,Z,J);jB.delete(H),bJ.set(H,(bJ.get(H)??0)+1),GL(H)}function UL($){let Z=`${$}/`;for(let J of new Set([...jB.keys(),...bJ.keys()]))if(J.startsWith(Z))jB.delete(J),bJ.set(J,(bJ.get(J)??0)+1),GL(J)}var F60={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},W60={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function q60($,Z,J,H){let{segment:Q}=$,B=LY(Q,Z,J),X=Wh(B);if(X)return X;let z=import(Fh(Q,Z,J)).then((G)=>{if(!G.default)throw Error(`"${J}" has no default export`);return Yh(G,Z,B,{kind:$.kind,name:J},H),G.default});return qh(B,z),z}function Nh($,Z){let J=e1(),{base:H}=i2(),[Q,B]=kJ.useState({status:"loading",version:0}),X=kJ.useCallback(()=>{B((z)=>({status:"loading",version:z.version})),q60($,J,Z,H).then((z)=>B((G)=>({status:"ready",Component:z,version:G.version+1}))).catch((z)=>{Z8(J,{source:"load",kind:$.kind,name:Z,message:String(z),...z instanceof Error&&z.stack?{stack:z.stack}:{}}),B((G)=>({status:"error",error:String(z),version:G.version+1}))})},[H,$,J,Z]);return kJ.useEffect(()=>{X()},[X]),W2((z)=>{if($.shouldReload(z,Z))PY($.segment,J,Z),X()}),Q}function Vh($){return Nh(F60,$)}function Ah($){return Nh(W60,$)}function Dh(){let $=e1();W2((Z)=>{if(Z.type==="view:updated")PY("views",$,Z.name);else if(Z.type==="widget:updated")PY("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")UL("widgets");if(Z.only!=="widgets")UL("views")}})}var R8=P(m(),1);var Mh=P(m(),1);var p4={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function Ph($){return J5({queryKey:S0.layout($),queryFn:()=>q1(`/api/workspaces/${$}`),...p4})}function i9($){let Z=U1();return Mh.useEffect(()=>Lh(()=>{Z.invalidateQueries({queryKey:S0.agent($)})}),[Z,$]),W2((J)=>{if(J.type==="agent:updated"&&J.workspaceId===$)Z.setQueryData(S0.agent($),(H)=>H?{...H,availability:J.availability,login:J.login}:H);if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:S0.agent($)})}),J5({queryKey:S0.agent($),queryFn:()=>q1(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function _h($){return q1(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function jh($){return J5({queryKey:S0.skills($),queryFn:()=>q1(`/api/workspaces/${$}/skills`),...p4})}async function N60($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),J=await Z.text(),H=null;try{H=JSON.parse(J)}catch{}if(!Z.ok){let Q=H&&"error"in H?H.error:J,B=Error(Q||"Failed to update workspace skill");if(H?.skills)B.status={skills:H.skills,updateAvailable:H.updateAvailable};throw B}if(!H)throw Error("Invalid workspace skill update response");return H}function Oh($){let Z=U1();return H5({mutationFn:()=>N60($),onSuccess:(J)=>{Z.setQueryData(S0.skills($),J)},onError:(J)=>{if(J.status)Z.setQueryData(S0.skills($),J.status)}})}function Th($){let Z=U1();return H5({mutationFn:(J)=>P4(`/api/workspaces/${$}`,g5("PUT",J),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.preview($)})}})}var KL={id:"_moi_views",config:{colSpan:4,rowSpan:1},defaultPosition:{x:0,y:0}},YL=[KL],V60=new Set(YL.map(($)=>$.id));function r9($){return V60.has($)}function Ch($){return[...YL,...$]}function wh(){return YL.map(($)=>({i:$.id,...$.defaultPosition}))}function _Y(){return{open:["overview","agent","scratchpad"],active:"overview"}}function jY($){let Z=_Y();if(!$||typeof $!=="object")return Z;let J=$,H=Array.isArray(J.open)?J.open.filter(NQ).filter((X,z,G)=>G.indexOf(X)===z):[];if(H.length===0)return Z;let Q=["overview",...H.filter((X)=>X!=="overview")],B=NQ(J.active)&&Q.includes(J.active)?J.active:"overview";return{open:Q,active:B}}function Eh(){return{version:1,widgetGrid:wh(),layoutMode:"split",tabs:_Y()}}function Sh($,Z,J){let{tabs:H,...Q}=$,B=Z.tabs??J?.tabs;return B===void 0?Q:{...Q,tabs:B}}var kh=P(c(),1),FL=R8.createContext(null);function i1(){let $=R8.useContext(FL);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function Ih(){return R8.useContext(FL)?.layout.theme}function Rh($){let{cwd:Z,name:J,provider:H,agentId:Q,...B}=$;return B}function bh({id:$,children:Z}){let J=U1(),H=Ph($),Q=Th($),B=Y5(Q.mutate),X=R8.useRef(null),z=R8.useRef(null),G=R8.useCallback((K)=>{let Y=S0.layout($),F=J.getQueryData(Y);if(!F)return;let W={...F,...K};if(J.setQueryData(Y,W),z.current=Sh(Rh(W),K,z.current),X.current)clearTimeout(X.current);X.current=setTimeout(()=>{X.current=null;let q=z.current;if(z.current=null,q)B.current(q)},600)},[$,J,B]),U=R8.useMemo(()=>({layout:H.data?Rh(H.data):Eh(),setLayout:G,name:H.data?.name??null,cwd:H.data?.cwd??null,provider:H.data?.provider??null,workspaceId:$,isLoading:H.isLoading}),[H.data,H.isLoading,G,$]);return kh.jsx(FL,{value:U,children:Z})}var F2=P(m(),1);var TY=P(c(),1);function OY({visible:$,editing:Z,canvasRef:J,width:H,height:Q,pointerProps:B,onKeyDown:X,children:z}){if(!$)return null;return TY.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:X,children:[TY.jsx("canvas",{ref:J,...B,width:H,height:Q,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),Z&&z]})}var e0=P(m(),1);function qL($,Z,J){let H=Math.max($,Z);if(H<=0)return 1;return Math.min(Math.max(J,1),1568/H)}function A60($){return new Promise((Z,J)=>{setTimeout(()=>J(Error("Annotation capture timed out")),$)})}function D60($){if(!($ instanceof HTMLElement))return;let{overflowX:Z,overflowY:J}=$.style;if(J==="auto"||J==="scroll")$.style.overflowY="hidden";if(Z==="auto"||Z==="scroll")$.style.overflowX="hidden"}async function yh($){let Z=$.getBoundingClientRect();if(Z.width<=0||Z.height<=0)throw Error("Annotation target is not visible");let{createContext:J,destroyContext:H,domToCanvas:Q}=await import("/chunk-efdyz6xp.js"),B=async()=>{let X=await J($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:qL(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"},onCloneEachNode:D60});try{return await Q(X)}finally{H(X)}};return Promise.race([B(),A60(1e4)])}var NL={past:[],present:[],future:[]};function L60($,Z){if(Z.type==="commit")return{past:[...$.past,$.present],present:[...$.present,Z.stroke],future:[]};if(Z.type==="undo"){let J=$.past.at(-1);if(!J)return $;return{past:$.past.slice(0,-1),present:J,future:[$.present,...$.future]}}if(Z.type==="redo"){let J=$.future[0];if(!J)return $;return{past:[...$.past,$.present],present:J,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function vh($,Z,J){let H=$.getBoundingClientRect();return{x:(Z-H.left)/H.width*$.width,y:(J-H.top)/H.height*$.height}}function xh($,Z){let J=Z.getCoalescedEvents?.()??[];return(J.length>0?J:[Z]).map((Q)=>vh($,Q.clientX,Q.clientY))}var M60={canUndo:!1,canRedo:!1,hasStrokes:!1};function OB($){return e0.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function hh($,Z,J,H){let Q=Z.points[0];if(!Q)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=H,$.strokeStyle=J,$.moveTo(Q.x,Q.y);for(let B=1;B<Z.points.length;B++){let X=Z.points[B];$.lineTo(X.x,X.y)}if(Z.points.length===1)$.lineTo(Q.x+0.01,Q.y+0.01);$.stroke()}function gh($,Z,J,H,Q,B=null){let X=Math.max(3,Math.min(Z,J)*0.005),z=X+Math.max(2,X*0.75),G=B?[...Q,B]:Q;for(let U of G)hh($,U,H.haloColor,z);for(let U of G)hh($,U,H.strokeColor,X)}function P60($,Z,J,H=null){let Q=$.getContext("2d");if(!Q)return;Q.clearRect(0,0,$.width,$.height),gh(Q,$.width,$.height,Z,J,H)}function _60($,Z,J){let H=$.getContext("2d");if(!H)return;H.clearRect(0,0,$.width,$.height),H.drawImage(Z.snapshot,0,0,$.width,$.height),gh(H,$.width,$.height,Z,J)}function j60($){return new Promise((Z,J)=>{$.toBlob((H)=>{if(H)Z(H);else J(Error("Could not export drawing"))},"image/png")})}function O60($,Z,J){let H=$.getBoundingClientRect();if(H.width<=0||H.height<=0)return null;let Q=getComputedStyle($),B=qL(H.width,H.height,window.devicePixelRatio),X=Math.max(1,Math.round(H.width*B)),z=Math.max(1,Math.round(H.height*B)),G=document.createElement("canvas");G.width=X,G.height=z;let U=Q.getPropertyValue("--background").trim()||"#ffffff",K=G.getContext("2d");if(K)K.fillStyle=U,K.fillRect(0,0,X,z);return Z.width=X,Z.height=z,{id:J,snapshot:G,strokeColor:Q.getPropertyValue("--primary").trim()||"#2563eb",haloColor:U,targetWidth:H.width,targetHeight:H.height}}function T60($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function CY({mode:$="annotation",onChange:Z,onEditingStart:J,onFinish:H}={}){let Q=e0.useRef(null),B=e0.useRef(null),[X,z]=e0.useState(null),G=e0.useRef(X),[U,K]=e0.useState(!1),Y=e0.useRef(!1),F=e0.useRef(NL),W=e0.useRef(M60),q=e0.useRef(new Set),N=e0.useRef(0),A=e0.useRef(null),V=e0.useRef(null),D=e0.useRef(0),L=e0.useRef(0),j=e0.useRef(null),M=e0.useRef(null),[_,E]=e0.useState(!1),C=e0.useRef(!1),[R,T]=e0.useState(!1),I=e0.useRef(!1),y=Y5(Z),S=Y5(J),O=Y5(H),k=e0.useCallback(()=>{let n=F.current,a=W.current,e={canUndo:n.past.length>0,canRedo:n.future.length>0,hasStrokes:n.present.length>0};if(e.canUndo===a.canUndo&&e.canRedo===a.canRedo&&e.hasStrokes===a.hasStrokes)return;W.current=e;for(let $0 of q.current)$0()},[]),b=e0.useCallback((n)=>{return q.current.add(n),()=>{q.current.delete(n)}},[]),h=e0.useCallback(()=>W.current,[]),v=e0.useCallback((n,a=null)=>{if(D.current)cancelAnimationFrame(D.current),D.current=0;let e=B.current,$0=G.current;if(e&&$0)P60(e,$0,n,a)},[]),f=e0.useCallback(()=>{if(D.current)return;D.current=requestAnimationFrame(()=>{D.current=0,v(F.current.present,A.current)})},[v]),w=e0.useCallback((n,a,e)=>{let $0=j.current;if($0?.sessionId===n.id&&$0.historyVersion===e)return Promise.resolve($0.blob);let Q0=M.current;if(Q0?.sessionId===n.id&&Q0.historyVersion===e)return Q0.promise;if(a.length===0)return j.current={sessionId:n.id,historyVersion:e,blob:null},y.current?.(null),Promise.resolve(null);let _0=document.createElement("canvas");_0.width=n.snapshot.width,_0.height=n.snapshot.height,_60(_0,n,a);let M0=j60(_0).then((V0)=>{if(G.current?.id!==n.id||N.current!==e)return V0;return j.current={sessionId:n.id,historyVersion:e,blob:V0},y.current?.(V0),V0}).catch(()=>{if(G.current?.id===n.id&&N.current===e)K5.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(M.current?.promise===M0)M.current=null});return M.current={sessionId:n.id,historyVersion:e,promise:M0},M0},[y]),i=e0.useCallback(()=>{if(!A.current)return;let n=B.current,a=V.current;if(n&&a!==null&&n.hasPointerCapture(a))n.releasePointerCapture(a);A.current=null,V.current=null,v(F.current.present)},[v]),r=e0.useCallback((n)=>{let a=G.current;if(!a||I.current)return;let e=L60(F.current,n);if(e===F.current)return;F.current=e,k(),A.current=null;let $0=++N.current;v(e.present),w(a,e.present,$0)},[w,k,v]),x=e0.useCallback((n)=>{F.current=NL,N.current=0,j.current=null,M.current=null,A.current=null,V.current=null,k(),G.current=n,z(n)},[k]),l=e0.useCallback(()=>{if(Y.current)return;Y.current=!0,K(!0),S.current?.()},[S]),s=e0.useCallback(async()=>{let n=Q.current;if(!n||G.current||C.current)return!1;let a=++L.current;C.current=!0,E(!0);try{let e=await yh(n);if(a!==L.current||Q.current!==n)return!1;let $0=n.getBoundingClientRect(),Q0=getComputedStyle(n),_0={id:a,snapshot:e,strokeColor:Q0.getPropertyValue("--primary").trim()||"#2563eb",haloColor:Q0.getPropertyValue("--background").trim()||"#ffffff",targetWidth:$0.width,targetHeight:$0.height};return x(_0),l(),!0}finally{if(a===L.current)C.current=!1,E(!1)}},[l,x]),p=e0.useCallback(()=>{let n=G.current;L.current+=1,C.current=!1,I.current=!1,E(!1),T(!1),Y.current=!1,K(!1),i(),z(null),F.current=NL,k();let a=M.current;if(!n||a?.sessionId!==n.id)return G.current=null,Promise.resolve();return a.promise.then(()=>{if(G.current?.id===n.id)G.current=null})},[i,k]),d=e0.useCallback(async()=>{let n=G.current;if(!n)return null;return i(),w(n,F.current.present,N.current)},[i,w]),o=e0.useCallback(async()=>{return Y.current=!1,K(!1),d()},[d]),Z0=e0.useCallback(async()=>{let n=G.current;if(!n||I.current)return null;I.current=!0,T(!0),i();let a=N.current,e=F.current.present,$0=null;if(e.length>0||a>0)$0=await w(n,e,a);if(G.current?.id!==n.id)return $0;try{await O.current?.($0)}finally{if(G.current?.id===n.id)L.current+=1,Y.current=!1,K(!1),G.current=null,z(null),I.current=!1,T(!1)}return $0},[i,w,O]),H0=e0.useCallback(()=>r({type:"undo"}),[r]),G0=e0.useCallback(()=>r({type:"redo"}),[r]),X0=e0.useCallback(()=>r({type:"clear"}),[r]),Y0=e0.useMemo(()=>({onPointerDown:(n)=>{if(I.current||!n.isPrimary||n.pointerType==="mouse"&&n.button!==0)return;if(!G.current&&$==="sketch"){let a=Q.current;if(!a)return;let e=O60(a,n.currentTarget,++L.current);if(!e)return;x(e)}if(!G.current)return;l(),V.current=n.pointerId,n.currentTarget.setPointerCapture(n.pointerId),A.current={points:[vh(n.currentTarget,n.clientX,n.clientY)]},v(F.current.present,A.current)},onPointerMove:(n)=>{if(n.pointerId!==V.current||!A.current)return;A.current.points.push(...xh(n.currentTarget,n.nativeEvent)),f()},onPointerUp:(n)=>{if(n.pointerId!==V.current||!A.current)return;let a=A.current;if(a.points.push(...xh(n.currentTarget,n.nativeEvent)),A.current=null,V.current=null,n.currentTarget.hasPointerCapture(n.pointerId))n.currentTarget.releasePointerCapture(n.pointerId);r({type:"commit",stroke:a})},onPointerCancel:(n)=>{if(n.pointerId===V.current)i()}}),[r,l,i,x,$,v,f]),A0=e0.useCallback((n)=>{if(T60(n.target))return;if(n.key==="Escape"&&$==="annotation"){n.preventDefault(),Z0();return}if(!(n.metaKey||n.ctrlKey)||n.key.toLowerCase()!=="z")return;if(n.preventDefault(),n.shiftKey)G0();else H0()},[Z0,$,G0,H0]);e0.useLayoutEffect(()=>{if(!X)return;if(v(F.current.present,A.current),U)B.current?.focus()},[U,v,X]),e0.useEffect(()=>{if(!X||$==="sketch")return;let n=Q.current;if(!n){p();return}let a=new ResizeObserver((e)=>{let $0=e[0]?.contentRect;if(!$0)return;if(Math.abs($0.width-X.targetWidth)>1||Math.abs($0.height-X.targetHeight)>1)p()});return a.observe(n),()=>a.disconnect()},[p,$,X]),e0.useEffect(()=>()=>{if(L.current+=1,Y.current=!1,G.current=null,D.current)cancelAnimationFrame(D.current)},[]);let N0=e0.useMemo(()=>({active:U,visible:$==="sketch"||X!==null,starting:_,finishing:R,open:s,undo:H0,redo:G0,clear:X0,flush:d,deactivate:o,finish:Z0,cancel:p,subscribeHistory:b,getHistoryState:h}),[U,$,X,_,R,s,H0,G0,X0,d,o,Z0,p,b,h]),F0=e0.useMemo(()=>({visible:N0.visible,editing:N0.active,canvasRef:B,width:X?.snapshot.width??1,height:X?.snapshot.height??1,pointerProps:Y0,onKeyDown:A0}),[N0.active,N0.visible,X,Y0,A0]);return e0.useMemo(()=>({targetRef:Q,controls:N0,layerProps:F0}),[N0,F0])}var s5=P(c(),1);function wY({controls:$,title:Z,busy:J,onComplete:H}){let{canUndo:Q,canRedo:B,hasStrokes:X}=OB($);return s5.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:[s5.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),s5.jsxs("div",{className:"flex gap-1",children:[s5.jsxs(Q5,{children:[s5.jsx(B5,{render:s5.jsx(j0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:J||!Q,"aria-label":"Undo",children:s5.jsx(fh,{stroke:1.75})})}),s5.jsx(X5,{children:"Undo"})]}),s5.jsxs(Q5,{children:[s5.jsx(B5,{render:s5.jsx(j0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:J||!B,"aria-label":"Redo",children:s5.jsx(mh,{stroke:1.75})})}),s5.jsx(X5,{children:"Redo"})]}),s5.jsx(j0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:J||!X,children:"Clear"})]}),s5.jsx(j4,{mode:"popLayout",initial:!1,children:s5.jsx(z5.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:s5.jsx(j0,{type:"button",variant:X?"default":"ghost",size:"icon-sm",onClick:H,disabled:J,"aria-label":"Complete",className:B0(!X&&"text-muted-foreground"),children:X?s5.jsx(O8,{stroke:1.75}):s5.jsx(o5,{stroke:1.75})})},X?"complete":"cancel")})]})}var U2=P(m(),1);async function TB($,Z){let J=`/api/workspaces/${$}/uploads`;if(typeof Z==="string")return q1(`${J}/from-path`,g5("POST",{path:Z}),"The file couldn’t be uploaded");let H=new FormData;H.append("files",Z);let[Q]=await q1(J,{method:"POST",body:H},"The file couldn’t be uploaded");if(!Q)throw Error("The upload didn’t finish");return Q}function VL({workspaceId:$,sessionId:Z}){if((w1.getState().attachments[J8($,Z)]??[]).length<_B)return!0;return K5.add({id:"draft-attachment-limit",title:"Attachment limit reached",description:`You can attach up to ${_B} items. Remove one to add another.`,type:"error"}),!1}function uh($,Z){for(let J of Z)ph($,J)}async function ph({workspaceId:$,sessionId:Z},J,H,Q){if(!VL({workspaceId:$,sessionId:Z}))return;let B=typeof J==="string"?null:J,X=typeof J==="string"?J.split("/").at(-1):J.name||"file",z=crypto.randomUUID();w1.getState().addAttachments($,Z,[{kind:"file",source:Q,localId:z,label:X,mediaType:B?.type||"application/octet-stream",previewUrl:B?.type.startsWith("image/")?URL.createObjectURL(B):void 0,status:"uploading"}]);try{let G=await TB($,J);w1.getState().updateAttachment($,z,{status:"ready",upload:G,label:G.filename,mediaType:G.mediaType,...G.kind==="image"&&!B?.type.startsWith("image/")?{previewUrl:`/api/workspaces/${$}/uploads/${G.id}`}:{}})}catch(G){let U=G instanceof Error?G.message:"The file couldn’t be uploaded";w1.getState().removeAttachment($,z),K5.add({title:`Couldn’t add ${X}`,description:U,type:"error"}),H?.(U)}}function ch($,Z){if(Z.type==="text"){let{source:J,label:H,text:Q}=Z;return C60($,{source:J,label:H,text:Q}),Promise.resolve()}return ph($,Z.file??Z.path,(J)=>{Z8($.workspaceId,{source:"runtime",message:`addChatAttachment() from ${Z.source}: ${J}`})},Z.source)}function CB({workspaceId:$,sessionId:Z,localId:J,purpose:H,source:Q,blob:B}){let X=H==="sketch"?"Sketch":"Annotation",z=w1.getState(),G=EG(z.attachments,$,J);if(!G&&!VL({workspaceId:$,sessionId:Z}))return!1;let U=URL.createObjectURL(B);if(G)z.updateAttachment($,J,{previewUrl:U,status:"draft",upload:void 0});else z.addAttachments($,Z,[{kind:"drawing",purpose:H,localId:J,source:Q,label:`${X}.png`,mediaType:"image/png",previewUrl:U,status:"draft"}]);return!0}async function EY($){let{workspaceId:Z,localId:J,purpose:H,blob:Q,isCurrent:B}=$,X=H==="sketch"?"Sketch":"Annotation";if(!CB($))return;w1.getState().updateAttachment(Z,J,{status:"uploading"});try{let z=await TB(Z,new File([Q],`${X}.png`,{type:"image/png"}));if(!B())return;w1.getState().updateAttachment(Z,J,{status:"ready",upload:z,mediaType:z.mediaType})}catch{if(!B())return;w1.getState().removeAttachment(Z,J)}}function C60({workspaceId:$,sessionId:Z},J){if(!VL({workspaceId:$,sessionId:Z}))return;w1.getState().addAttachments($,Z,[{kind:"text",localId:crypto.randomUUID(),...J}])}function dh({workspaceId:$,sessionId:Z,activeTab:J,mode:H,available:Q,closePopup:B,openPopup:X}){let z=U2.useRef(null),G=U2.useRef(null),U=U2.useRef(new Map),K=Y5(B),Y=Y5(X),F=U2.useCallback((O)=>{let k=z.current;if(!k)return;if(G.current=O,!O){w1.getState().removeAttachment(k.workspaceId,k.attachmentId);return}CB({workspaceId:k.workspaceId,sessionId:k.sourceSessionId,localId:k.attachmentId,purpose:"annotation",source:k.source,blob:O})},[]),W=U2.useCallback((O,k)=>{let b=(U.current.get(O.attachmentId)??0)+1;return U.current.set(O.attachmentId,b),EY({workspaceId:O.workspaceId,sessionId:O.sourceSessionId,localId:O.attachmentId,purpose:"annotation",source:O.source,blob:k,isCurrent:()=>U.current.get(O.attachmentId)===b})},[]),q=U2.useCallback(async(O)=>{let k=z.current;if(z.current=null,G.current=null,k&&O)await W(k,O);if(k?.origin==="popup")Y.current()},[Y,W]),N=CY({onChange:F,onFinish:q}),{controls:A}=N,{active:V,starting:D,open:L,finish:j,cancel:M}=A,_=U2.useCallback(async(O)=>{if(!Q||V||D)return;let k={workspaceId:$,sourceSessionId:Z,source:J,origin:O,attachmentId:crypto.randomUUID()};z.current=k;try{if(!await L()){if(z.current===k)z.current=null;return}if(O==="popup")K.current()}catch{if(z.current!==k)return;z.current=null,K5.add({title:"Couldn’t capture this page",type:"error"})}},[V,J,Q,K,L,Z,D,$]),E=U2.useCallback(async()=>{let O=z.current;if(await M(),z.current!==O)return;z.current=null;let k=G.current;if(G.current=null,O&&k)W(O,k)},[M,W]),C=U2.useCallback((O)=>{let k=(U.current.get(O)??0)+1;if(U.current.set(O,k),w1.getState().removeAttachment($,O),z.current?.attachmentId===O)z.current=null,G.current=null,M()},[M,$]),R=U2.useCallback(async()=>{if(D){await E();return}await j()},[E,j,D]),T=U2.useCallback(()=>{if(V||D)R();else _("docked")},[V,R,_,D]),I=U2.useCallback(()=>{if(V||D)R();else _("popup")},[V,R,_,D]);U2.useEffect(()=>{let O=z.current;if(!O)return;let k=O.origin==="docked"?"split":"fullscreen";if(O.workspaceId!==$||O.sourceSessionId!==Z||O.source!==J||H!==k||!Q)E()},[J,Q,E,H,Z,$]);let y=U2.useMemo(()=>Q?{active:V||D,finish:R,onRemove:C,onToggle:T}:void 0,[Q,V,D,R,C,T]),S=U2.useMemo(()=>Q?{active:V||D,finish:R,onRemove:C,onToggle:I}:void 0,[Q,V,D,R,C,I]);return U2.useMemo(()=>({...N,docked:y,popup:S}),[N,y,S])}var l4=P(m(),1);var I8=P(c(),1);function AL($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function ih({composerRef:$,className:Z,onMouseDown:J,children:H,...Q}){return I8.jsx("form",{...Q,onMouseDown:(B)=>{if(J?.(B),B.defaultPrevented)return;if(B.target instanceof Element&&B.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;AL($.current)},className:B0("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:H})}function rh({textareaRef:$,className:Z,...J}){return I8.jsx("textarea",{...J,ref:$,className:B0("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 ah({className:$,children:Z,...J}){return I8.jsx("div",{...J,className:B0("flex items-center justify-end gap-3",$),children:Z})}function w60($){if($.status==="checking")return"Checking agent status…";return}function wB($,Z,J){return $&&!Z&&J.status==="available"}function oh({label:$,hasContent:Z,busy:J=!1,loading:H=!1,availability:Q}){let B=wB(Z,J||H,Q),X=w60(Q),z=I8.jsx(j0,{type:"submit",size:"icon",disabled:!B,"aria-label":$,children:H?I8.jsx(H8,{}):I8.jsx(lh,{stroke:1.5})});if(H||!X)return z;return I8.jsxs(Q5,{children:[I8.jsx(B5,{render:I8.jsx("span",{className:"inline-flex",children:z})}),I8.jsx(X5,{className:"max-w-64 text-center",children:X})]})}var X8=P(m(),1),E60=48;function nh($,Z){let J=X8.useRef(!0),[H,Q]=X8.useState(!0),B=X8.useCallback((G)=>{J.current=G,Q((U)=>U===G?U:G)},[]),X=X8.useCallback((G="auto")=>{let U=$.current;if(!U)return;B(!0),U.scrollTo({top:U.scrollHeight,behavior:G})},[$,B]),z=X8.useCallback(()=>{let G=$.current;if(!G)return;B(!1),G.scrollTo({top:0,behavior:"auto"})},[$,B]);return X8.useEffect(()=>{let G=$.current;if(!G)return;let U=()=>{let K=G.scrollHeight-G.scrollTop-G.clientHeight;B(K<=E60)};return G.addEventListener("scroll",U,{passive:!0}),()=>G.removeEventListener("scroll",U)},[$,B]),X8.useEffect(()=>{let G=$.current;if(!G)return;let U=G.firstElementChild??G,K=new ResizeObserver(()=>{if(J.current)G.scrollTop=G.scrollHeight});return K.observe(U),()=>K.disconnect()},[$]),X8.useLayoutEffect(()=>{X("auto")},[Z,X]),{atBottom:H,scrollToBottom:X,scrollToTop:z}}function S60($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function sh($,Z){let J=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:J}}function th($,Z){if(!Z)return $;let J=$.at(-1);if(J?.role==="assistant")return[...$.slice(0,-1),sh(J,Z)];return[...$,Z]}function eh($){let Z=[];for(let J of $){if(!S60(J))continue;if(J.role!=="assistant"){Z.push(J);continue}let H=Z.length>0?Z[Z.length-1]:null;if(H?.role==="assistant")Z[Z.length-1]=sh(H,J);else Z.push(J)}return Z.map((J,H)=>{let Q=Z[H-1];if(J.role!=="assistant"||J.meta?.durationMs!==void 0||Q?.role!=="user"||Q.origin.kind!=="user-input"||!Q.timestamp||!J.timestamp)return J;let B=Date.parse(Q.timestamp),X=Date.parse(J.timestamp);if(!Number.isFinite(B)||!Number.isFinite(X)||X<B)return J;return{...J,meta:{...J.meta,durationMs:X-B}}})}function DL($){switch($.kind){case"warning":return $.message;case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"api-retry":return $.error?`Retrying: ${$.error}`:"Retrying the connection";case"rate-limit":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function $v($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function Zv($,Z){let J=Z.filter((G)=>DL(G)!==null);if(J.length===0)return $.map((G)=>({kind:"turn",turn:G}));let H=[],Q=[];for(let G of J){let U=$v(G.at);if(U===void 0)Q.push(G);else H.push({notice:G,time:U})}H.sort((G,U)=>G.time-U.time);let B=[],X=0,z=Number.NEGATIVE_INFINITY;for(let G of $){z=Math.max(z,$v(G.timestamp)??z);while(X<H.length&&H[X].time<=z)B.push({kind:"notice",notice:H[X].notice}),X+=1;B.push({kind:"turn",turn:G})}for(;X<H.length;X+=1)B.push({kind:"notice",notice:H[X].notice});for(let G of Q)B.push({kind:"notice",notice:G});return B}var t5=P(c(),1);function yJ({label:$,icon:Z,onRemove:J,previewUrl:H,loading:Q,className:B,children:X,...z}){return t5.jsxs("div",{...z,className:B0("group relative flex max-w-full min-w-0 cursor-default items-center rounded-md bg-background text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50",H?"size-14 overflow-hidden":"h-7 pr-2 pl-0.5",B),children:[Q&&t5.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-background/70",children:t5.jsx(k5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),H?t5.jsx(I60,{label:$,previewUrl:H,onRemove:J}):t5.jsx(R60,{label:$,icon:Z,onRemove:J}),X]})}function R60({label:$,icon:Z,onRemove:J}){return t5.jsxs(t5.Fragment,{children:[J?t5.jsxs(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[t5.jsx(Z,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),t5.jsx(o5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}):t5.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center",children:t5.jsx(Z,{size:16,stroke:1.75})}),t5.jsx("span",{className:"truncate",children:$})]})}function I60({label:$,previewUrl:Z,onRemove:J}){return t5.jsxs(t5.Fragment,{children:[t5.jsx("img",{src:Z,alt:$,className:"size-full object-cover"}),J&&t5.jsx(j0,{type:"button",variant:"outline",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,className:"absolute top-1 right-1 size-4 rounded-xs border-0 opacity-0 shadow-xs transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 [&_svg]:size-3",children:t5.jsx(o5,{stroke:1.75})})]})}var Hv=P(c(),1);function EB({label:$,onRemove:Z}){return Hv.jsx(yJ,{label:$,icon:Jv,onRemove:Z})}var a6={};C5(a6,{createHandle:()=>Ev,Viewport:()=>wv,Trigger:()=>Av,Root:()=>Fv,Positioner:()=>Lv,Portal:()=>Nv,Popup:()=>Pv,Handle:()=>kY,Backdrop:()=>Tv,Arrow:()=>jv});var Yv=P(m(),1);var SY=P(m(),1),LL=SY.createContext(void 0);function Q4($){let Z=SY.useContext(LL);if(Z===void 0&&!$)throw Error(y0(50));return Z}var Bv=P(m(),1);var Qv=600,RY=300;var Xv={...S9,instantType:($)=>$.instantType,adaptiveOrigin:($)=>$.adaptiveOrigin,closeDelay:($)=>$.closeDelay};class ML extends b2{constructor($,Z,J){let H=new O2;super(Gv($,H,Z,J),Uv(H),Xv)}setOpen=($,Z)=>{let{inlineRectCoordsRef:J}=this.context;nz(this,$,Z,{onBeforeDispatch(){let H=Z.event;if($&&Z.reason===K0.triggerHover&&Z.trigger&&"clientX"in H&&"clientY"in H&&J.current?.element!==Z.trigger)WV(J,Z.trigger,H.clientX,H.clientY)}})}}function zv(){let $=new O2;return new a8(Object.freeze(Gv(void 0,$)),Object.freeze(Uv($)),Xv)}function Gv($,Z,J,H=!1){return{...E9(Z,J,H),instantType:void 0,adaptiveOrigin:void 0,closeDelay:RY,...$}}function Uv($){return{popupRef:Bv.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$,inlineRectCoordsRef:{current:void 0}}}var r6=P(c(),1);function Kv($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,onOpenChangeComplete:Q,actionsRef:B,handle:X,triggerId:z,defaultTriggerId:G=null,children:U}=$,K=Q6((V,D)=>new ML({open:J,openProp:Z,activeTriggerId:G,triggerIdProp:z},V,D));K.useControlledProp("openProp",Z),K.useControlledProp("triggerIdProp",z),K.useContextCallback("onOpenChange",H),K.useContextCallback("onOpenChangeComplete",Q);let Y=K.useState("open"),F=K.useState("activeTriggerId"),W=K.useState("mounted"),q=K.useState("payload");T9(K,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:N}=C9(Y,K,()=>{K.context.inlineRectCoordsRef.current=void 0});J0(()=>{if(Y){if(F==null)K.set("payload",void 0)}},[K,F,Y]),Yv.useImperativeHandle(B,()=>({unmount:N,close:()=>K.setOpen(!1,R0(K0.imperativeAction))}),[N,K]);let A=Y||W;return r6.jsxs(LL.Provider,{value:K,children:[X&&r6.jsx(j9,{handle:X,store:K}),A&&r6.jsx(b60,{store:K}),typeof U==="function"?U({payload:q}):U]})}function b60({store:$}){let Z=$.useState("floatingRootContext"),J=d8(Z);return w9($,{activeTriggerProps:J.reference,inactiveTriggerProps:J.trigger,popupProps:J.floating}),null}var Fv=g8(function(Z){if(Q4(!0))return r6.jsx(Kv,{...Z});return r6.jsx(a7,{children:r6.jsx(Kv,{...Z})})});var qv=P(m(),1);var IY=P(m(),1),PL=IY.createContext(void 0);function Wv(){let $=IY.useContext(PL);if($===void 0)throw Error(y0(48));return $}var _L=P(c(),1),Nv=qv.forwardRef(function(Z,J){let{keepMounted:H=!1,...Q}=Z;if(!(Q4().useState("mounted")||H))return null;return _L.jsx(PL.Provider,{value:H,children:_L.jsx(OZ,{ref:J,...Q})})});var Vv=P(m(),1);var Av=V9(function(Z,J){let{render:H,className:Q,delay:B,closeDelay:X,id:z,payload:G,handle:U,style:K,...Y}=Z,F=Q4(!0),q=R9(U)??F;if(!q)throw Error(y0(89));let N=t0(z),A=q.useState("isTriggerActive",N),V=q.useState("isOpenedByTrigger",N),D=q.useState("floatingRootContext"),L=q.context.inlineRectCoordsRef,j=Vv.useRef(null),M=B??Qv,_=X??RY,{registerTrigger:E,isMountedByThisTrigger:C}=O9(N,j,q,{payload:G,closeDelay:_}),R=i8(D,{mouseOnly:!0,move:!1,handleClose:r8(),delay:()=>({open:M,close:_}),triggerElementRef:j,isActiveTrigger:A,isClosing:()=>q.select("transitionStatus")==="ending"}),T=t7(D,{delay:M}),I={open:V},y=q.useState("triggerProps",C),S=VC(L,V);return z0("a",Z,{state:I,ref:[J,E,j],props:[R,T.reference,y,S,{id:N},Y],stateAttributesMapping:A9})});var Dv=P(m(),1);var bY=P(m(),1),jL=bY.createContext(void 0);function xJ(){let $=bY.useContext(jL);if($===void 0)throw Error(y0(49));return $}var OL=P(c(),1),Lv=Dv.forwardRef(function(Z,J){let{render:H,className:Q,anchor:B,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:U=0,alignOffset:K=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:A=P9,style:V,...D}=Z,L=Q4(),j=Wv(),M=A3(),_=L.useState("open"),E=L.useState("mounted"),C=L.useState("floatingRootContext"),R=L.useState("instantType"),T=L.useState("transitionStatus"),I=L.useState("adaptiveOrigin"),y=L.context.inlineRectCoordsRef,S=b9({anchor:B,floatingRootContext:C,positionMethod:X,mounted:E,side:z,sideOffset:U,align:G,alignOffset:K,arrowPadding:W,collisionBoundary:Y,collisionPadding:F,sticky:q,disableAnchorTracking:N,keepMounted:j,nodeId:M,collisionAvoidance:A,adaptiveOrigin:I,inline:AC(y)}),O=S.update;J0(()=>{if(_&&E)O()},[_,E,O]);let k={open:_,side:S.side,align:S.align,anchorHidden:S.anchorHidden,instant:R},b=y9(Z,k,{styles:S.positionerStyles,transitionStatus:T,props:D,refs:[J,L.useStateSetter("positionerElement")],hidden:!E,inert:!_});return OL.jsx(jL.Provider,{value:S,children:OL.jsx(r7,{id:M,children:b})})});var Mv=P(m(),1);var Pv=Mv.forwardRef(function(Z,J){let{className:H,render:Q,style:B,...X}=Z,z=Q4(),{side:G,align:U}=xJ(),K=z.useState("open"),Y=z.useState("instantType"),F=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("floatingRootContext"),N=z.useState("closeDelay");return q5({open:K,ref:z.context.popupRef,onComplete(){if(K)z.context.onOpenChangeComplete?.(!0)}}),L3(q,{closeDelay:N}),z0("div",Z,{state:{open:K,side:G,align:U,instant:Y,transitionStatus:F},ref:[J,z.context.popupRef,z.useStateSetter("popupElement")],props:[_9,W,k9(F),X],stateAttributesMapping:a2})});var _v=P(m(),1);var jv=_v.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=Q4(),{arrowRef:G,side:U,align:K,arrowUncentered:Y,arrowStyles:F}=xJ(),q={open:z.useState("open"),side:U,align:K,uncentered:Y};return z0("div",Z,{state:q,ref:[G,J],props:[{style:F,"aria-hidden":!0},X],stateAttributesMapping:s4})});var Ov=P(m(),1);var Tv=Ov.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=Q4(),G=z.useState("open"),U=z.useState("mounted"),K=z.useState("transitionStatus");return z0("div",Z,{state:{open:G,transitionStatus:K},ref:[J],props:[{role:"presentation",hidden:!U,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},X],stateAttributesMapping:a2})});var Cv=P(m(),1);var wv=Cv.forwardRef(function(Z,J){let{render:H,className:Q,style:B,children:X,...z}=Z,G=Q4(),U=xJ(),K=G.useState("instantType"),{children:Y,state:F}=z6({store:G,side:U.side,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:K};return z0("div",Z,{state:W,ref:J,props:[z,{children:Y}],stateAttributesMapping:X6})});class kY extends l8{constructor(){super(zv(),"PreviewCard")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function Ev(){return new kY}var hJ=P(c(),1);function Sv({...$}){return hJ.jsx(a6.Root,{"data-slot":"hover-card",...$})}function Rv({...$}){return hJ.jsx(a6.Trigger,{"data-slot":"hover-card-trigger",...$})}function Iv({className:$,side:Z="bottom",sideOffset:J=4,align:H="center",alignOffset:Q=0,...B}){return hJ.jsx(j8,{portal:a6.Portal,"data-slot":"hover-card-portal",children:hJ.jsx(a6.Positioner,{align:H,alignOffset:Q,side:Z,sideOffset:J,className:"isolate z-50",children:hJ.jsx(a6.Popup,{"data-slot":"hover-card-content",className:a0("z-50 w-64 origin-(--transform-origin) 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",$),...B})})})}var I$=P(c(),1);function bv({attachment:$,onRemove:Z}){let{previewUrl:J,purpose:H}=$,Q=H==="sketch"?"Sketch":"Annotation";return I$.jsxs(Sv,{children:[I$.jsx(Rv,{render:I$.jsx(yJ,{tabIndex:0,label:Q,icon:vJ,onRemove:Z})}),J&&I$.jsx(Iv,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)] rounded-xl",children:I$.jsx("img",{src:J,alt:`${Q} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var yv=P(c(),1);function kv({attachment:$,onRemove:Z}){return yv.jsx(yJ,{label:$.label,icon:WJ,onRemove:Z,previewUrl:$.previewUrl,loading:$.status==="uploading",title:$.label,className:"max-w-52"})}var yB=P(m(),1);var iJ=P(m(),1);function yY($){return J5({queryKey:S0.sessions($),queryFn:()=>q1(`/api/workspaces/${$}/sessions`),...p4})}function k60($,Z){return $?.filter((J)=>J.sessionId!==Z)}function xv($){let Z=U1();return H5({mutationFn:(J)=>P4(`/api/workspaces/${$}/sessions/${J}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(J,H)=>{Z.setQueryData(S0.sessions($),(Q)=>k60(Q,H)),Z.removeQueries({queryKey:S0.events($,H)}),Z.removeQueries({queryKey:S0.sessionConfig($,H)}),Z.invalidateQueries({queryKey:S0.preview($)})}})}function hv($,Z){return J5({...DE($,Z??""),enabled:Boolean(Z)})}function xY($,Z){return J5({queryKey:S0.sessionConfig($,Z??""),queryFn:()=>q1(`/api/workspaces/${$}/sessions/${Z}/config`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function vv($){let Z=U1();return H5({mutationFn:({patch:J,sessionId:H})=>q1(`/api/workspaces/${$}/sessions/${H}/config`,g5("PUT",J),"Failed to save chat settings"),onSuccess:(J,{sessionId:H})=>{Z.setQueryData(S0.sessionConfig($,H),J)}})}var y60=["fable","opus","sonnet","haiku"];function hY($,Z,J=$.find((H)=>H.value==="default")?.resolvedModel){let H=$.filter((Q)=>Q.value!=="default");return H.find((Q)=>Q.value===Z)??H.find((Q)=>(Q.resolvedModel??Q.value)===J)??H[0]}function gv($){let Z=$.resolvedModel??$.value,J=y60.findIndex((H)=>Z===H||Z.startsWith(`${H}[`)||Z.includes(`-${H}-`));return J===-1?void 0:J}function x60($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function h60($,Z){return x60(gv($),gv(Z))}var v60={"claude-code":h60};function g60($,Z){return $.map((J,H)=>({model:J,index:H})).sort((J,H)=>Z(J.model,H.model)||J.index-H.index).map(({model:J})=>J)}function TL($,Z,J){if(Z&&$.includes(Z))return Z;if(J&&$.includes(J))return J;if($.includes("high"))return"high";return $[$.length-1]}function fv($,Z,J){let H=TL($,Z,J);return H?$.indexOf(H):-1}function mv($){return $.length>1}function uv($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function pv($,Z){let J=v60[Z];return J?g60($,J):$}function cv($,Z){let J=[];for(let H of $){let Q=H.group??Z,B=J.find((X)=>X.label===Q);if(B)B.models.push(H);else J.push({label:Q,models:[H]})}return J}var O4={};C5(O4,{createHandle:()=>ug,Viewport:()=>hg,Trigger:()=>yg,SubmenuTrigger:()=>mg,SubmenuRoot:()=>Sg,Separator:()=>gg,Root:()=>QF,RadioItemIndicator:()=>jg,RadioItem:()=>_g,RadioGroup:()=>Lg,Positioner:()=>Ag,Portal:()=>qg,Popup:()=>Yg,LinkItem:()=>Ug,Item:()=>Gg,Handle:()=>GF,GroupLabel:()=>Xg,Group:()=>Qg,CheckboxItemIndicator:()=>Zg,CheckboxItem:()=>$g,Backdrop:()=>rv,Arrow:()=>lv});var dv=P(m(),1);var vY=P(m(),1),CL=vY.createContext(void 0);function B4($){let Z=vY.useContext(CL);if(Z===void 0&&!$)throw Error(y0(33));return Z}var gY=P(m(),1),wL=gY.createContext(void 0);function L5($){let Z=gY.useContext(wL);if(Z===void 0&&!$)throw Error(y0(36));return Z}var lv=dv.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,{store:z}=L5(),{arrowRef:G,side:U,align:K,arrowUncentered:Y,arrowStyles:F}=B4(),q={open:z.useState("open"),side:U,align:K,uncentered:Y};return z0("div",Z,{ref:[G,J],stateAttributesMapping:s4,state:q,props:{style:F,"aria-hidden":!0,...X}})});var iv=P(m(),1);var fY=P(m(),1),f60=fY.createContext(void 0);function o6($=!0){let Z=fY.useContext(f60);if(Z===void 0&&!$)throw Error(y0(25));return Z}var rv=iv.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,{store:z}=L5(),G=z.useState("open"),U=z.useState("mounted"),K=z.useState("transitionStatus"),Y=z.useState("lastOpenChangeReason"),F=o6(),W={open:G,transitionStatus:K};return z0("div",Z,{ref:F?.backdropRef?[J,F.backdropRef]:J,state:W,stateAttributesMapping:a2,props:[{role:"presentation",hidden:!U,style:{pointerEvents:Y===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X]})});var cY=P(m(),1);var mY=P(m(),1),EL=mY.createContext(void 0);function av(){let $=mY.useContext(EL);if($===void 0)throw Error(y0(30));return $}var fJ=P(m(),1);var ov=P(m(),1);function uY($){let{closeOnClick:Z,highlighted:J,id:H,nodeId:Q,store:B,typingRef:X,itemRef:z,itemMetadata:G}=$,{events:U}=B.useState("floatingTreeRoot"),K=B.useState("open"),Y=o6(!0),F=Y!==void 0;return ov.useMemo(()=>({id:H,role:"menuitem",tabIndex:K&&J?0:-1,onKeyDown(W){if(W.key===" "&&X?.current)W.preventDefault()},onMouseMove(W){if(!Q)return;U.emit("itemhover",{nodeId:Q,target:W.currentTarget})},onClick(W){if(Z)U.emit("close",{domEvent:W,reason:K0.itemPress})},onMouseUp(W){if(Y){let q=Y.initialCursorPointRef.current;if(Y.initialCursorPointRef.current=null,F&&q&&Math.abs(W.clientX-q.x)<=1&&Math.abs(W.clientY-q.y)<=1)return;if(F&&!r1.os.mac&&W.button===2)return}if(z.current&&B.context.allowMouseUpTriggerRef.current&&(!F||W.button===2)){if(G.type==="regular-item")gJ(z.current,W,{detail:1})}}}),[Z,J,H,U,Q,K,B,X,z,Y,F,G])}var n6={type:"regular-item"};function s6($){let{closeOnClick:Z,disabled:J,highlighted:H,id:Q,store:B,typingRef:X=B.context.typingRef,nativeButton:z,itemMetadata:G,nodeId:U}=$,K=fJ.useRef(null),{getButtonProps:Y,buttonRef:F}=T5({disabled:J,focusableWhenDisabled:!0,native:z,composite:!0}),W=uY({closeOnClick:Z,highlighted:H,id:Q,nodeId:U,store:B,typingRef:X,itemRef:K,itemMetadata:G}),q=fJ.useCallback((A)=>{return X2(W,{onMouseEnter(){if(G.type!=="submenu-trigger")return;G.setActive()}},A,Y)},[W,Y,G]),N=x2(K,F);return fJ.useMemo(()=>({getItemProps:q,itemRef:N}),[q,N])}var b$=P(m(),1);var pY=P(m(),1),SL=pY.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function nv(){return pY.useContext(SL)}function X4($={}){let{guess:Z,label:J,metadata:H,textRef:Q,index:B}=$,{register:X,unregister:z,subscribeMapChange:G,nextIndexRef:U}=nv(),K=b$.useRef(-1),[Y,F]=b$.useState(B==null&&Z?()=>{if(K.current===-1){let A=U.current;U.current+=1,K.current=A}return K.current}:-1),W=B??Y,q=b$.useRef(null),N=b$.useCallback((A)=>{let V=q.current;if(V)z(V);if(q.current=A,A)X(A,{metadata:H??null,index:B??null,label:J,textRef:Q})},[B,X,z,H,J,Q]);return J0(()=>{if(B!=null)return;return G((A)=>{let V=q.current?A.get(q.current)?.index:null;if(V!=null)F(V)})},[B,G]),{ref:N,index:W}}var sv="data-checked",tv="data-unchecked";var t6={checked($){if($)return{[sv]:""};return{[tv]:""}},...Q2};var ev=P(c(),1),$g=cY.forwardRef(function(Z,J){let{render:H,className:Q,id:B,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!1,checked:K,defaultChecked:Y,onCheckedChange:F,style:W,...q}=Z,N=X4({guess:!0,label:X}),A=B4(!0),V=t0(B),{store:D}=L5(),L=D.useState("disabled"),j=G||L,M=D.useState("isActive",N.index),_=D.useState("itemProps"),[E,C]=J4({controlled:K,default:Y??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:R,itemRef:T}=s6({closeOnClick:U,disabled:j,highlighted:M,id:V,store:D,nativeButton:z,nodeId:A?.context.nodeId,itemMetadata:n6}),I=cY.useMemo(()=>({disabled:j,highlighted:M,checked:E}),[j,M,E]);function y(O){let k=R0(K0.itemPress,O.nativeEvent,void 0,{preventUnmountOnClose:X1});if(F?.(!E,k),k.isCanceled)return;C((b)=>!b)}let S=z0("div",Z,{state:I,stateAttributesMapping:t6,props:[_,{role:"menuitemcheckbox","aria-checked":E,onClick:y},q,R],ref:[T,J,N.ref]});return ev.jsx(EL.Provider,{value:I,children:S})});var dY=P(m(),1);var Zg=dY.forwardRef(function(Z,J){let{render:H,className:Q,style:B,keepMounted:X=!1,...z}=Z,G=av(),U=dY.useRef(null),{transitionStatus:K,mounted:Y,setMounted:F}=j2(G.checked);q5({batch:!0,enabled:!G.checked,open:G.checked,ref:U,onComplete(){if(!G.checked)F(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:K};return z0("span",Z,{state:W,ref:[J,U],stateAttributesMapping:t6,props:{"aria-hidden":!0,...z},enabled:X||Y})});var iY=P(m(),1);var lY=P(m(),1),SB=lY.createContext(void 0);function Jg(){let $=lY.useContext(SB);if($===void 0)throw Error(y0(31));return $}var Hg=P(c(),1),Qg=iY.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,[z,G]=iY.useState(void 0),U=z0("div",Z,{ref:J,props:{role:"group","aria-labelledby":z,...X}});return Hg.jsx(SB.Provider,{value:G,children:U})});var Bg=P(m(),1);var Xg=Bg.forwardRef(function(Z,J){let{render:H,className:Q,style:B,id:X,...z}=Z,G=t0(X),U=Jg();return J0(()=>{return U(G),()=>{U((K)=>K===G?void 0:K)}},[U,G]),z0("div",Z,{ref:J,props:{id:G,"aria-hidden":!0,...z}})});var zg=P(m(),1);var Gg=zg.forwardRef(function(Z,J){let{render:H,className:Q,id:B,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!0,style:K,...Y}=Z,F=X4({guess:!0,label:X}),W=B4(!0),q=t0(B),{store:N}=L5(),A=N.useState("disabled"),V=G||A,D=N.useState("isActive",F.index),L=N.useState("itemProps"),{getItemProps:j,itemRef:M}=s6({closeOnClick:U,disabled:V,highlighted:D,id:q,store:N,nativeButton:z,nodeId:W?.context.nodeId,itemMetadata:n6});return z0("div",Z,{state:{disabled:V,highlighted:D},props:[L,Y,j],ref:[M,J,F.ref]})});var rY=P(m(),1);var Ug=rY.forwardRef(function(Z,J){let{render:H,className:Q,id:B,label:X,closeOnClick:z=!1,style:G,...U}=Z,K=rY.useRef(null),Y=X4({guess:!0,label:X}),W=B4(!0)?.context.nodeId,q=t0(B),{store:N}=L5(),A=N.useState("isActive",Y.index),V=N.useState("itemProps"),D=N.context.typingRef,{getButtonProps:L,buttonRef:j}=T5({native:!1,composite:!0}),M=uY({closeOnClick:z,highlighted:A,id:q,nodeId:W,store:N,typingRef:D,itemRef:K,itemMetadata:n6});function _(C){return X2(M,C,L)}return z0("a",Z,{state:{highlighted:A},props:[V,U,_],ref:[K,j,J,Y.ref]})});var aY=P(m(),1);var Kg=P(c(),1),Yg=aY.forwardRef(function(Z,J){let{render:H,className:Q,style:B,finalFocus:X,...z}=Z,{store:G}=L5(),{side:U,align:K}=B4(),Y=lG(!0)!=null,F=G.useState("open"),W=G.useState("transitionStatus"),q=G.useState("popupProps"),N=G.useState("mounted"),A=G.useState("instantType"),V=G.useState("activeTriggerElement"),D=G.useState("parent"),L=G.useState("lastOpenChangeReason"),j=G.useState("rootId"),M=G.useState("floatingRootContext"),_=G.useState("floatingTreeRoot"),E=G.useState("closeDelay"),C=G.useState("hoverEnabled"),R=G.useState("disabled"),T=G.useState("openMethod"),I=D.type==="context-menu";q5({open:F,ref:G.context.popupRef,onComplete(){if(F)G.context.onOpenChangeComplete?.(!0)}}),aY.useEffect(()=>{function b(h){G.setOpen(!1,R0(h.reason,h.domEvent))}return _.events.on("close",b),()=>{_.events.off("close",b)}},[_.events,G]),L3(M,{enabled:C&&!R&&!I&&D.type!=="menubar",closeDelay:E});let y=G.useStateSetter("popupElement"),S={transitionStatus:W,side:U,align:K,open:F,nested:D.type==="menu",instant:A},O=z0("div",Z,{state:S,ref:[J,G.context.popupRef,y],stateAttributesMapping:a2,props:[q,{onKeyDown(b){if(Y&&n8.has(b.key))b.stopPropagation()}},k9(W),z,{"data-rootownerid":j}]}),k=D.type===void 0||I;if(V||D.type==="menubar"&&L!==K0.outsidePress)k=!0;return Kg.jsx(o7,{context:M,openInteractionType:T,modal:I,disabled:!N,returnFocus:X===void 0?k:X,initialFocus:D.type!=="menu",restoreFocus:!0,externalTree:D.type!=="menubar"?_:void 0,previousFocusableElement:V,nextFocusableElement:D.type===void 0?G.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:D.type===void 0?G.context.beforeContentFocusGuardRef:void 0,children:O})});var Wg=P(m(),1);var oY=P(m(),1),RL=oY.createContext(void 0);function Fg(){let $=oY.useContext(RL);if($===void 0)throw Error(y0(32));return $}var IL=P(c(),1),qg=Wg.forwardRef(function(Z,J){let{keepMounted:H=!1,...Q}=Z,{store:B,parent:X}=L5();if(!(B.useState("mounted")||H))return null;let U=X.type==="menu"||X.type==="menubar"?"group":void 0;return IL.jsx(RL.Provider,{value:H,children:IL.jsx(l7,{ref:J,...Q,portalOwnerRole:U})})});var a9=P(m(),1);var S3=P(m(),1);var Ng=P(c(),1);function e6($){let{children:Z,elementsRef:J,labelsRef:H,onMapChange:Q}=$,B=U0(Q),[,X]=S3.useState(!1),z=l1(p60).current,G=l1(u60).current,U=S3.useRef(0),K=S3.useRef(!0),Y=S3.useRef(null),F=S3.useRef(null),W=U0(()=>{if(K.current)return;K.current=!0,X((M)=>!M)}),q=U0((M,_)=>{G.set(M,_),W()}),N=U0((M)=>{G.delete(M),W()}),A=U0((M)=>{let _=new Map;if(J.current.length=0,H)H.current.length=0;return M.forEach((E)=>{if(_.set(E.element,{...E.registration.metadata??{},index:E.index}),J.current[E.index]=E.element,H)H.current[E.index]=E.registration.label!==void 0?E.registration.label:E.registration.textRef?.current?.textContent??E.element.textContent}),U.current=J.current.length,_});function V(M){if(F.current?.disconnect(),F.current=null,typeof MutationObserver!=="function"||M.length<2)return;let _=new MutationObserver((C)=>{if(!l60(C))return;let R=null;for(let T of M){if(!T.isConnected)continue;if(R&&Vg(R,T)>0){_.disconnect(),W();return}R=T}});F.current=_;let E=new Set;for(let C=1;C<M.length;C+=1){let R=d60(M[C-1],M[C]);if(R)E.add(R)}E.forEach((C)=>_.observe(C,{childList:!0}))}let D=U0(()=>{let[M,_]=c60(G),E=A(M),C=Y.current,R=!C||C.length!==M.length||M.some((T,I)=>{let y=C[I];return T.index!==y.index||T.element!==y.element||T.registration.index!==y.registration.index||T.registration.metadata!==y.registration.metadata});if(V(_),Y.current=M,K.current=!1,!R)return;z.forEach((T)=>T(E)),B(E)});J0(()=>{if(!K.current&&Y.current)A(Y.current);return()=>{if(J.current=[],H)H.current=[]}},[J,H,A]),J0(()=>{if(K.current)D()}),J0(()=>{return()=>{F.current?.disconnect(),K.current=!0}},[]);let L=U0((M)=>{return z.add(M),()=>{z.delete(M)}}),j=S3.useMemo(()=>({register:q,unregister:N,subscribeMapChange:L,nextIndexRef:U}),[q,N,L,U]);return Ng.jsx(SL.Provider,{value:j,children:Z})}function u60(){return new Map}function p60(){return new Set}function c60($){let Z=new Set,J=[],H=[];$.forEach((B,X)=>{if(!X.isConnected)return;let z=B.index,G={index:z??-1,element:X,registration:B};if(z===null)H.push(G);else if(z>=0)Z.add(z),J.push(G)});let Q=0;if(H.sort((B,X)=>Vg(B.element,X.element)),H.forEach((B)=>{while(Z.has(Q))Q+=1;B.index=Q,J.push(B),Q+=1}),Z.size>0)J.sort((B,X)=>B.index-X.index);return[J,H.map((B)=>B.element)]}function d60($,Z){let J=$.parentElement;while(J&&!J.contains(Z))J=J.parentElement;return J}function l60($){for(let Z of $)for(let J=0;J<Z.removedNodes.length;J+=1)if(Z.removedNodes[J].isConnected)return!0;return!1}function Vg($,Z){return $.compareDocumentPosition(Z)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var mJ=P(c(),1),Ag=a9.forwardRef(function(Z,J){let{anchor:H,positionMethod:Q="absolute",className:B,render:X,side:z,align:G,sideOffset:U=0,alignOffset:K=0,collisionBoundary:Y="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:A=LT,style:V,...D}=Z,{store:L}=L5(),j=Fg(),M=o6(!0),_=L.useState("parent"),E=L.useState("floatingRootContext"),C=L.useState("floatingTreeRoot"),R=L.useState("mounted"),T=L.useState("open"),I=L.useState("modal"),y=L.useState("openMethod"),S=L.useState("activeTriggerElement"),O=L.useState("transitionStatus"),k=L.useState("positionerElement"),b=L.useState("instantType"),h=L.useState("adaptiveOrigin"),v=L.useState("lastOpenChangeReason"),f=L.useState("floatingNodeId"),w=L.useState("floatingParentNodeId"),i=E.useState("domReferenceElement"),r=a9.useRef(null),x=h4(k),l=H,s=U,p=K,d=G,o=A;if(_.type==="context-menu"){if(l=H??_.context?.anchor,d=d??"start",!z&&d!=="center")p=Z.alignOffset??2,s=Z.sideOffset??-5}let Z0=z,H0=d;if(_.type==="menu")Z0=Z0??"inline-end",H0=H0??"start",o=Z.collisionAvoidance??P9;else if(_.type==="menubar")Z0=Z0??(_.context.orientation==="vertical"?"inline-end":"bottom"),H0=H0??"start";let G0=_.type==="context-menu",X0=b9({anchor:l,floatingRootContext:E,positionMethod:M?"fixed":Q,mounted:R,side:Z0,sideOffset:s,align:H0,alignOffset:p,arrowPadding:G0?0:W,collisionBoundary:Y,collisionPadding:F,sticky:q,nodeId:f,keepMounted:j,disableAnchorTracking:N,collisionAvoidance:o,shift:G0?{crossAxis:!(("side"in o)&&o.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:C,adaptiveOrigin:h});a9.useEffect(()=>{function $0(Q0){if(Q0.open){if(Q0.parentNodeId===f)L.set("hoverEnabled",!1);if(Q0.nodeId!==f&&Q0.parentNodeId===L.select("floatingParentNodeId"))L.setOpen(!1,R0(K0.siblingOpen))}}return C.events.on("menuopenchange",$0),()=>{C.events.off("menuopenchange",$0)}},[L,C.events,f]),a9.useEffect(()=>{if(L.select("floatingParentNodeId")==null)return;function $0(Q0){if(Q0.open||Q0.nodeId!==L.select("floatingParentNodeId"))return;let _0=Q0.reason??K0.siblingOpen;L.setOpen(!1,R0(_0))}return C.events.on("menuopenchange",$0),()=>{C.events.off("menuopenchange",$0)}},[C.events,L]);let Y0=d1();a9.useEffect(()=>{if(!T)Y0.clear()},[T,Y0]),a9.useEffect(()=>{function $0(Q0){if(!T||Q0.nodeId!==L.select("floatingParentNodeId"))return;if(Q0.target&&S&&S!==Q0.target){let _0=L.select("closeDelay");if(_0>0){if(!Y0.isStarted())Y0.start(_0,()=>{L.setOpen(!1,R0(K0.siblingOpen))})}else L.setOpen(!1,R0(K0.siblingOpen))}else Y0.clear()}return C.events.on("itemhover",$0),()=>{C.events.off("itemhover",$0)}},[C.events,T,S,L,Y0]),a9.useEffect(()=>{let $0={open:T,nodeId:f,parentNodeId:w,reason:L.select("lastOpenChangeReason")};C.events.emit("menuopenchange",$0)},[C.events,T,L,f,w]),J0(()=>{let $0=i,Q0=r.current;if($0)r.current=$0;if(Q0&&$0&&$0!==Q0){L.set("instantType",void 0);let _0=new AbortController;return x(()=>{L.set("instantType","trigger-change")},_0.signal),()=>{_0.abort()}}return},[i,x,L]);let A0={open:T,side:X0.side,align:X0.align,anchorHidden:X0.anchorHidden,nested:_.type==="menu",instant:b},N0=_.type==="menubar"&&_.context.modal,F0=I&&v!==K0.triggerHover;uG(T&&(N0||F0),y==="touch",k,S);let n=y9(Z,A0,{styles:X0.positionerStyles,transitionStatus:O,props:D,refs:[J,L.useStateSetter("positionerElement")],hidden:!R,inert:!T}),a=R&&_.type!=="menu"&&(_.type!=="menubar"&&I&&v!==K0.triggerHover||_.type==="menubar"&&_.context.modal),e=null;if(_.type==="menubar")e=_.context.contentElement;else if(_.type===void 0)e=S;return mJ.jsxs(CL.Provider,{value:X0,children:[a&&mJ.jsx(uZ,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:L8(!T),cutout:e}),mJ.jsx(r7,{id:f,children:mJ.jsx(e6,{elementsRef:L.context.itemDomElements,labelsRef:L.context.itemLabels,children:n})})]})});var $7=P(m(),1);var nY=P(m(),1),bL=nY.createContext(void 0);function Dg(){let $=nY.useContext(bL);if($===void 0)throw Error(y0(34));return $}var kL=P(c(),1),Lg=$7.memo($7.forwardRef(function(Z,J){let{render:H,className:Q,value:B,defaultValue:X,onValueChange:z,disabled:G=!1,style:U,"aria-labelledby":K,...Y}=Z,[F,W]=$7.useState(void 0),[q,N]=J4({controlled:B,default:X,name:"MenuRadioGroup"}),A=U0((j,M)=>{if(z?.(j,M),M.isCanceled)return;N(j)}),D=z0("div",Z,{state:{disabled:G},ref:J,props:{role:"group","aria-labelledby":K??F,"aria-disabled":G||void 0,...Y}}),L=$7.useMemo(()=>({value:q,setValue:A,disabled:G}),[q,A,G]);return kL.jsx(SB.Provider,{value:W,children:kL.jsx(bL.Provider,{value:L,children:D})})}));var tY=P(m(),1);var sY=P(m(),1),yL=sY.createContext(void 0);function Mg(){let $=sY.useContext(yL);if($===void 0)throw Error(y0(35));return $}var Pg=P(c(),1),_g=tY.forwardRef(function(Z,J){let{render:H,className:Q,id:B,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!1,value:K,style:Y,...F}=Z,W=X4({guess:!0,label:X}),q=B4(!0),N=t0(B),{store:A}=L5(),V=A.useState("isActive",W.index),D=A.useState("itemProps"),{value:L,setValue:j,disabled:M}=Dg(),_=A.useState("disabled"),E=G||M||_,C=L===K,{getItemProps:R,itemRef:T}=s6({closeOnClick:U,disabled:E,highlighted:V,id:N,store:A,nativeButton:z,nodeId:q?.context.nodeId,itemMetadata:n6}),I=tY.useMemo(()=>({disabled:E,highlighted:V,checked:C}),[E,V,C]);function y(O){let k=R0(K0.itemPress,O.nativeEvent,void 0,{preventUnmountOnClose:X1});j(K,k)}let S=z0("div",Z,{state:I,stateAttributesMapping:t6,props:[D,{role:"menuitemradio","aria-checked":C,onClick:y},F,R],ref:[T,J,W.ref]});return Pg.jsx(yL.Provider,{value:I,children:S})});var eY=P(m(),1);var jg=eY.forwardRef(function(Z,J){let{render:H,className:Q,style:B,keepMounted:X=!1,...z}=Z,G=Mg(),U=eY.useRef(null),{transitionStatus:K,mounted:Y,setMounted:F}=j2(G.checked);q5({batch:!0,enabled:!G.checked,open:G.checked,ref:U,onComplete(){if(!G.checked)F(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:K};return z0("span",Z,{state:W,stateAttributesMapping:t6,ref:[J,U],props:{"aria-hidden":!0,...z},enabled:X||Y})});var e5=P(m(),1);var $F=P(m(),1),i60=$F.createContext(null);function ZF($){let Z=$F.useContext(i60);if(Z===null&&!$)throw Error(y0(5));return Z}var RB=P(m(),1);var Og={...S9,disabled:($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled,modal:($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0),openMethod:($)=>$.openMethod,allowMouseEnter:($)=>$.allowMouseEnter,highlightItemOnHover:($)=>$.highlightItemOnHover,parent:($)=>$.parent,rootId:($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId},activeIndex:($)=>$.activeIndex,isActive:($,Z)=>$.activeIndex===Z,hoverEnabled:($)=>$.hoverEnabled,instantType:($)=>$.instantType,lastOpenChangeReason:($)=>$.openChangeReason,floatingTreeRoot:($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot},floatingNodeId:($)=>$.floatingNodeId,floatingParentNodeId:($)=>$.floatingParentNodeId,itemProps:($)=>$.itemProps,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin,keyboardEventRelay:($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return}};class xL extends b2{constructor($,Z,J=!1){let H=new O2,Q=wg(H,Z,J,$);super(Q,Cg(H),Og);this.unsubscribeParentListener=this.observe("parent",(B)=>{if(this.unsubscribeParentListener?.(),B.type==="menu"){let X=B.store.select("rootId"),z=B.store.select("floatingTreeRoot"),G=B.store.select("keyboardEventRelay");this.unsubscribeParentListener=B.store.subscribe(()=>{let U=B.store.select("rootId"),K=B.store.select("floatingTreeRoot"),Y=B.store.select("keyboardEventRelay");if(X===U&&z===K&&G===Y)return;X=U,z=K,G=Y,this.notifyAll()}),this.context.allowMouseUpTriggerRef=B.store.context.allowMouseUpTriggerRef;return}if(B.type!==void 0)this.context.allowMouseUpTriggerRef=B.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}unsubscribeParentListener=null}function Tg(){let $=new O2,Z=new a8(Object.freeze(wg($)),Object.freeze(Cg($)),Og);return Object.assign(Z,{setOpen:X1})}function Cg($){return{positionerRef:RB.createRef(),popupRef:RB.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:RB.createRef(),beforeContentFocusGuardRef:RB.createRef(),onOpenChangeComplete:void 0,triggerElements:$}}function wg($,Z,J=!1,H){return{...E9($,Z,J),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new i7,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:L1,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...H}}var JF=P(m(),1),hL=JF.createContext(void 0);function HF(){return JF.useContext(hL)}var IB=P(c(),1),QF=g8(function(Z){let{children:J,open:H,onOpenChange:Q,onOpenChangeComplete:B,defaultOpen:X=!1,disabled:z=!1,modal:G,loopFocus:U=!0,orientation:K="vertical",actionsRef:Y,closeParentOnEsc:F=!1,handle:W,triggerId:q,defaultTriggerId:N=null,highlightItemOnHover:A=!0}=Z,V=o6(!0),D=L5(!0),L=ZF(!0),j=HF(),M=e5.useMemo(()=>{if(j&&D)return{type:"menu",store:D.store};if(L)return{type:"menubar",context:L};if(V&&!D)return{type:"context-menu",context:V};return{type:void 0}},[V,D,L,j]),_=V4(),E=V4(),C=D4(),R=M.type==="menu"?M.store:void 0,T=(H??X)&&R?.state.transitionStatus==="starting",I=l1(()=>T?R?.state.instantType:void 0).current,y=r60({open:X,openProp:H,activeTriggerId:N,triggerIdProp:q,parent:M,disabled:z,highlightItemOnHover:A,modal:M.type===void 0?G:void 0,rootId:_,instantType:I},E,C!=null);y.useControlledProp("openProp",H),y.useControlledProp("triggerIdProp",q),y.useContextCallback("onOpenChangeComplete",B);let S=y.useState("floatingTreeRoot"),O=A3(S),k=y.useState("open"),b=y.useState("activeTriggerElement"),h=y.useState("positionerElement"),v=y.useState("hoverEnabled"),f=y.useState("disabled"),w=y.useState("lastOpenChangeReason"),i=y.useState("parent"),r=y.useState("activeIndex"),x=y.useState("payload"),l=y.useState("floatingParentNodeId"),s=e5.useRef(null),p=e5.useRef(i.type!=="context-menu"),d=d1(),o=e5.useRef(!0),Z0=d1(),H0=l!=null,{openMethod:G0,triggerProps:X0}=mE(k);y.useSyncedValues({disabled:z,highlightItemOnHover:A,modal:i.type===void 0?G:void 0,openMethod:G0,rootId:_}),T9(y);let{forceUnmount:Y0,transitionStatus:A0}=C9(k,y,()=>{y.set("allowMouseEnter",!1)},T),N0=h4(y.context.popupRef);e5.useEffect(()=>{if(I===void 0)return;let T0=()=>{if(y.state.instantType===I)y.set("instantType",void 0)};if(!k){T0();return}if(A0!==void 0)return;if(y.context.popupRef.current==null){T0();return}let x0=new AbortController;return N0(T0,x0.signal),()=>{x0.abort()}},[I,k,A0,N0,y]),J0(()=>{if(V&&!D)y.update({parent:{type:"context-menu",context:V},floatingNodeId:O,floatingParentNodeId:C});else if(D)y.update({floatingNodeId:O,floatingParentNodeId:C})},[V,D,O,C,y]),e5.useEffect(()=>{if(!k)s.current=null;if(i.type!=="context-menu")return;if(!k){d.clear(),p.current=!1;return}d.start(500,()=>{p.current=!0})},[d,k,i.type]),J0(()=>{if(!k&&!v)y.set("hoverEnabled",!0)},[k,v,y]);let F0=U0((T0,x0)=>{let J1=x0.reason;if(!T0&&!y.select("open"))return;if(k===T0&&x0.trigger===b&&w===J1)return;let W1=BQ(x0);if(!T0&&x0.trigger==null)x0.trigger=b??void 0;if(Q?.(T0,x0),x0.isCanceled)return;y.state.floatingRootContext.dispatchOpenChange(T0,x0);let d0=x0.event;if(T0===!1&&d0?.type==="click"&&d0.pointerType==="touch"&&!o.current)return;if(T0&&J1===K0.triggerFocus)o.current=!1,Z0.start(300,()=>{o.current=!0});else o.current=!0,Z0.clear();let v0=(J1===K0.triggerPress||J1===K0.itemPress)&&d0.detail===0,S1=!T0&&(J1===K0.escapeKey||J1==null);s.current=x0.event;let B1=s7(y.state,T0,x0.trigger,W1());if(B1.openChangeReason=J1,i.type==="menubar"&&(J1===K0.triggerFocus||J1===K0.focusOut||J1===K0.triggerHover||J1===K0.listNavigation||J1===K0.siblingOpen))B1.instantType="group";else if(v0||S1)B1.instantType=v0?"click":"dismiss";else B1.instantType=void 0;y.update(B1)}),n=QQ({popupStore:y,floatingRootContext:y.state.floatingRootContext,floatingId:E,nested:C!=null,onOpenChange:F0}),a=n.context.events;J0(()=>{let T0=({open:x0,eventDetails:J1})=>F0(x0,J1);return a.on("setOpen",T0),()=>{a?.off("setOpen",T0)}},[a,F0]);let e=e5.useCallback(()=>{y.setOpen(!1,R0(K0.imperativeAction))},[y]);e5.useImperativeHandle(Y,()=>({unmount:Y0,close:e}),[Y0,e]);let $0;if(i.type==="context-menu")$0=i.context;e5.useImperativeHandle($0?.positionerRef,()=>h,[h]),e5.useImperativeHandle($0?.actionsRef,()=>({setOpen:F0}),[F0]);let Q0=d8(n,{enabled:!f,bubbles:{escapeKey:F&&i.type==="menu"},outsidePress(){if(i.type!=="context-menu"||s.current?.type==="contextmenu")return!0;return p.current},externalTree:H0?S:void 0}),_0=g4(),M0=e5.useCallback((T0)=>{if(y.select("activeIndex")===T0)return;y.set("activeIndex",T0)},[y]),V0=OV(n,{enabled:!f,listRef:y.context.itemDomElements,activeIndex:r,nested:i.type!==void 0,loopFocus:U,orientation:K,parentOrientation:i.type==="menubar"?i.context.orientation:void 0,rtl:_0==="rtl",disabledIndices:r2,onNavigate:M0,openOnArrowKeyDown:i.type!=="context-menu",externalTree:H0?S:void 0,focusItemOnHover:A}),L0=e5.useCallback((T0)=>{y.context.typingRef.current=T0},[y]),g=TV(n,{enabled:!f,listRef:y.context.itemLabels,elementsRef:y.context.itemDomElements,activeIndex:r,resetMs:NT,onMatch:(T0)=>{if(k&&T0!==r)y.set("activeIndex",T0)},onTyping:L0}),u=e5.useMemo(()=>{let T0=X2(g.reference,V0.reference,Q0.reference,{onMouseMove(){y.set("allowMouseEnter",!0)}},X0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=k,T0},[y,g.reference,V0.reference,Q0.reference,X0,k]),t=e5.useMemo(()=>{let T0=X2(V0.trigger,Q0.trigger,X0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=!1,T0},[V0.trigger,Q0.trigger,X0]);l1(()=>{return y.update({inactiveTriggerProps:t}),null});let W0=e5.useMemo(()=>X2(_9,{id:E,role:"menu","aria-orientation":K==="horizontal"?"horizontal":void 0,"aria-labelledby":b?.id,onMouseMove(){if(y.set("allowMouseEnter",!0),i.type==="menu")y.set("hoverEnabled",!1)},onClick(){if(y.select("hoverEnabled"))y.set("hoverEnabled",!1)},onKeyDown(T0){let x0=y.select("keyboardEventRelay");if(x0&&!T0.isPropagationStopped())x0(T0)}},g.floating,V0.floating,Q0.floating),[b,E,K,i.type,y,g.floating,V0.floating,Q0.floating]),I0=V0.item??L1;w9(y,{floatingRootContext:n,activeTriggerProps:u,inactiveTriggerProps:t,popupProps:W0,itemProps:I0});let c0=e5.useMemo(()=>({store:y,parent:M}),[y,M]),f0=IB.jsxs(wL.Provider,{value:c0,children:[W&&IB.jsx(j9,{handle:W,store:y}),typeof J==="function"?J({payload:x}):J]});if(i.type===void 0||i.type==="context-menu")return IB.jsx(a7,{externalTree:S,children:f0});return f0});function r60($,Z,J){return l1(()=>new xL($,Z,J)).current}var Eg=P(m(),1);var vL=P(c(),1);function Sg($){let Z=L5().store,J=Eg.useMemo(()=>({parentMenu:Z}),[Z]);return vL.jsx(hL.Provider,{value:J,children:vL.jsx(QF,{...$})})}var z4=P(m(),1);var BF=5;function Rg($,Z){let J=a60(Z);return $.clientX>=J.left-BF&&$.clientX<=J.right+BF&&$.clientY>=J.top-BF&&$.clientY<=J.bottom+BF}function a60($){let Z=$.getBoundingClientRect(),J=I1($);if(r1.env.jsdom)return Z;let H=J.getComputedStyle($,"::before"),Q=J.getComputedStyle($,"::after");if(!(H.content!=="none"||Q.content!=="none"))return Z;let X=parseFloat(H.width)||0,z=parseFloat(H.height)||0,G=parseFloat(Q.width)||0,U=parseFloat(Q.height)||0,K=Math.max(Z.width,X,G),Y=Math.max(Z.height,z,U),F=K-Z.width,W=Y-Z.height;return{left:Z.left-F/2,right:Z.right+F/2,top:Z.top-W/2,bottom:Z.bottom+W/2}}var Ig=P(m(),1);function XF($={}){let{highlightItemOnHover:Z,highlightedIndex:J,onHighlightedIndexChange:H}=uJ(),{ref:Q,index:B}=X4($),X=J===B,z=Ig.useRef(null),G=x2(Q,z);return{compositeProps:{tabIndex:X?0:-1,onFocus(){H(B)},onMouseMove(){let K=z.current;if(!Z||!K)return;let Y=K.hasAttribute("disabled")||K.ariaDisabled==="true";if(!X&&!Y)K.focus()}},compositeRef:G,index:B}}function bg($){let{render:Z,className:J,style:H,state:Q=L1,props:B=r2,refs:X=r2,metadata:z,stateAttributesMapping:G,tag:U="div",...K}=$,{compositeProps:Y,compositeRef:F}=XF({metadata:z});return z0(U,$,{state:Q,ref:[F,...X],props:[Y,...B,K],stateAttributesMapping:G})}function gL($){if(P1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid");if(M8($))return;return gL(P8($))}var zF=P(m(),1);function kg($){let{enabled:Z=!0,mouseDownAction:J,open:H}=$,Q=zF.useRef(!1);return zF.useMemo(()=>{if(!Z)return L1;return{onMouseDown:(B)=>{if(J==="open"&&!H||J==="close"&&H)Q.current=!0,m0(B.currentTarget).addEventListener("click",()=>{Q.current=!1},{once:!0})},onClick:(B)=>{if(Q.current)Q.current=!1,B.preventBaseUIHandler()}}},[Z,J,H])}var Z7=P(c(),1),yg=V9(function(Z,J){let{render:H,className:Q,style:B,disabled:X=!1,nativeButton:z=!0,id:G,openOnHover:U,delay:K=100,closeDelay:Y=0,handle:F,payload:W,...q}=Z,N=L5(!0),V=R9(F)??N?.store;if(!V)throw Error(y0(85));let D=t0(G),L=V.useState("isTriggerActive",D),j=V.useState("floatingRootContext"),M=V.useState("isOpenedByTrigger",D),_=V.useState("triggerPopupId",D),E=z4.useRef(null),C=n60(),R=uJ(!0),T=n2(),I=z4.useMemo(()=>{return T??new i7},[T]),y=A3(I),S=D4(),{registerTrigger:O,isMountedByThisTrigger:k}=O9(D,E,V,{payload:W,closeDelay:Y,parent:C,floatingTreeRoot:I,floatingNodeId:y,floatingParentNodeId:S,keyboardEventRelay:R?.relayKeyboardEvent}),b=C.type==="menubar",h=V.useState("disabled"),v=X||h||b&&C.context.disabled,{getButtonProps:f,buttonRef:w}=T5({disabled:v,native:z});z4.useEffect(()=>{if(!M&&C.type===void 0)V.context.allowMouseUpTriggerRef.current=!1},[V,M,C.type]);let i=z4.useRef(null),r=d1(),x=U0(($0)=>{if(!i.current)return;r.clear(),V.context.allowMouseUpTriggerRef.current=!1;let Q0=$0.target;if(b0(i.current,Q0)||b0(V.select("positionerElement"),Q0)||Q0===i.current)return;if(Q0!=null&&gL(Q0)===V.select("rootId"))return;if(Rg($0,i.current))return;I.events.emit("close",{domEvent:$0,reason:K0.cancelOpen})});z4.useEffect(()=>{if(M&&V.select("lastOpenChangeReason")===K0.triggerHover)m0(i.current).addEventListener("mouseup",x,{once:!0})},[M,x,V]);let l=b&&C.context.hasSubmenuOpen,p=i8(j,{enabled:(U??l)&&!v&&(!b||l&&!k),handleClose:r8({blockPointerEvents:!b}),mouseOnly:!0,move:!1,restMs:C.type===void 0?K:void 0,delay:{close:Y},triggerElementRef:E,externalTree:I,isActiveTrigger:L,isClosing:()=>V.select("transitionStatus")==="ending"}),d=o60(M,V.select("lastOpenChangeReason")),o=D3(j,{enabled:!v,event:M&&b?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0?d:!1}),Z0=t7(j,{enabled:!v&&l}),H0=kg({open:M,enabled:b,mouseDownAction:"open"}),G0=z4.useMemo(()=>X2(Z0.reference,o.reference),[Z0.reference,o.reference]),X0=V.useState("triggerProps",k),{preFocusGuardRef:Y0,handlePreFocusGuardFocus:A0,handleFocusTargetFocus:N0}=hG(V,E),F0={disabled:v,open:M},n=[i,J,w,O,E],a=[G0,p??L1,X0,{"aria-haspopup":"menu","aria-controls":_,id:D,onMouseDown:($0)=>{if(V.select("open"))return;r.start(200,()=>{V.context.allowMouseUpTriggerRef.current=!0}),m0($0.currentTarget).addEventListener("mouseup",x,{once:!0})}},b?{role:"menuitem"}:{},H0,q,f],e=z0("button",Z,{enabled:!b,stateAttributesMapping:rH,state:F0,ref:n,props:a});if(b)return Z7.jsx(bg,{tag:"button",render:H,className:Q,style:B,state:F0,refs:n,props:a,stateAttributesMapping:rH});if(M)return Z7.jsxs(z4.Fragment,{children:[Z7.jsx(x4,{ref:Y0,onFocus:A0},`${D}-pre-focus-guard`),Z7.jsx(z4.Fragment,{children:e},D),Z7.jsx(x4,{ref:V.context.triggerFocusTargetRef,onFocus:N0},`${D}-post-focus-guard`)]});return Z7.jsx(z4.Fragment,{children:e},D)});function o60($,Z){let J=d1(),[H,Q]=z4.useState(!1);return J0(()=>{if($&&Z===K0.triggerHover)Q(!0),J.start(Iz,()=>{Q(!1)});else if(!$)J.clear(),Q(!1)},[$,Z,J]),H}function n60(){let $=ZF(!0);return z4.useMemo(()=>{if($)return{type:"menubar",context:$};return{type:void 0}},[$])}var xg=P(m(),1);var hg=xg.forwardRef(function(Z,J){let{render:H,className:Q,style:B,children:X,...z}=Z,{store:G}=L5(),{side:U}=B4(),K=G.useState("instantType"),{children:Y,state:F}=z6({store:G,side:U,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:K};return z0("div",Z,{state:W,ref:J,props:[z,{children:Y}],stateAttributesMapping:X6})});var vg=P(m(),1);var gg=vg.forwardRef(function(Z,J){let{className:H,render:Q,orientation:B="horizontal",style:X,...z}=Z;return z0("div",Z,{state:{orientation:B},ref:J,props:[{role:"separator","aria-orientation":B},z]})});var R3=P(m(),1);function fg($){return $==null||$.hasAttribute("disabled")||$.getAttribute("aria-disabled")==="true"}var s60={"aria-expanded":void 0},mg=R3.forwardRef(function(Z,J){let{render:H,className:Q,style:B,label:X,id:z,nativeButton:G=!1,openOnHover:U=!0,delay:K=100,closeDelay:Y=0,disabled:F=!1,...W}=Z,q=HF();if(!q?.parentMenu)throw Error(y0(37));let N=X4({guess:!0,label:X}),A=B4(),{store:V}=L5(),D=t0(z),L=V.useState("open"),j=V.useState("floatingRootContext"),M=V.useState("floatingTreeRoot"),_=V.useState("triggerPopupId",D),E=VV(D,V),C=U0((G0)=>{if(E(G0),G0!==null&&V.select("open")&&V.select("activeTriggerId")==null)V.update({activeTriggerId:D??null,activeTriggerElement:G0,closeDelay:Y})}),R=R3.useRef(null),T=R3.useCallback((G0)=>{R.current=G0,V.set("activeTriggerElement",G0)},[V]);J0(()=>{return C(R.current),()=>C(null)},[C,D,V]),V.useSyncedValue("closeDelay",Y);let I=q.parentMenu,y=V.useState("disabled"),S=I.useState("disabled"),O=F||y||S,k=I.useState("itemProps"),b=I.useState("isActive",N.index),h=R3.useMemo(()=>({type:"submenu-trigger",setActive(){if(I.select("highlightItemOnHover"))I.set("activeIndex",N.index)}}),[I,N.index]),{getItemProps:v,itemRef:f}=s6({closeOnClick:!1,disabled:O,highlighted:b,id:D,store:V,typingRef:I.context.typingRef,nativeButton:G,itemMetadata:h,nodeId:A?.context.nodeId}),w=V.useState("hoverEnabled"),i=i8(j,{enabled:w&&U&&!O,handleClose:r8({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:K,delay:{open:K,close:Y},shouldOpen:K>0?()=>I.select("allowMouseEnter"):void 0,triggerElementRef:R,externalTree:M,isClosing:()=>V.select("transitionStatus")==="ending",guardStaleOpen:!0}),x=D3(j,{enabled:!O,event:"mousedown",toggle:!U,ignoreMouse:U,stickIfOpen:!1}).reference??L1,l=V.useState("triggerProps",!0);delete l.id;let s={disabled:O,highlighted:b,open:L},p=V.useState("openMethod"),o=V.useState("lastOpenChangeReason")===K0.listNavigation||p==="keyboard",Z0=L&&o&&r1.screenReader.voiceOver;return z0("div",Z,{state:s,stateAttributesMapping:A9,props:[x,i,l,k,Z0?s60:void 0,{"aria-controls":_,tabIndex:L||b?0:-1,onBlur(){if(b)I.set("activeIndex",null)}},W,v],ref:[J,N.ref,f,C,T]})});class GF extends l8{constructor(){super(Tg(),"Menu")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function ug(){return new GF}var m2=P(c(),1);function o9({...$}){return m2.jsx(O4.Root,{"data-slot":"dropdown-menu",...$})}function t60({...$}){return m2.jsx(j8,{portal:O4.Portal,"data-slot":"dropdown-menu-portal",...$})}function n9({...$}){return m2.jsx(O4.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function s9({align:$="start",alignOffset:Z=0,side:J="bottom",sideOffset:H=4,className:Q,...B}){return m2.jsx(t60,{children:m2.jsx(O4.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:J,sideOffset:H,children:m2.jsx(O4.Popup,{"data-slot":"dropdown-menu-content",className:a0("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 rtl:data-[side=inline-end]:slide-in-from-right-2 rtl:data-[side=inline-start]:slide-in-from-left-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",Q),...B})})})}function J7({...$}){return m2.jsx(O4.Group,{"data-slot":"dropdown-menu-group",...$})}function UF({className:$,inset:Z,...J}){return m2.jsx(O4.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:a0("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:ps-7",$),...J})}function H9({className:$,inset:Z,variant:J="default",...H}){return m2.jsx(O4.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":J,className:a0("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm 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:ps-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",$),...H})}function pg({...$}){return m2.jsx(O4.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function cg({className:$,children:Z,inset:J,...H}){return m2.jsxs(O4.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":J,className:a0("relative flex cursor-default items-center gap-2 rounded-md py-1 ps-2 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...H,children:[m2.jsx("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:m2.jsx(O4.RadioItemIndicator,{children:m2.jsx(O8,{stroke:1.75})})}),Z]})}function dg({className:$,...Z}){return m2.jsx(O4.Separator,{"data-slot":"dropdown-menu-separator",className:a0("mx-2 my-1 h-px bg-border",$),...Z})}var MF=P(m(),1);var H7={};C5(H7,{Value:()=>sg,Track:()=>Zf,Thumb:()=>zf,Root:()=>rg,Label:()=>og,Indicator:()=>Uf,Control:()=>eg});var $2=P(m(),1);function fL($,Z,J=Object.is){let{length:H}=$;if(H!==Z.length)return!1;for(let Q=0;Q<H;Q+=1)if(!J($[Q],Z[Q]))return!1;return!0}function lg($){return $==null?void 0:`${$}-label`}function ig($,Z){return $??Z}function KF($,Z){return $-Z}function YF($,Z,J,H,Q,B){let X=_2($,J,H);if(!Q)return X;let z=B.slice();return z[Z]=_2(X,B[Z-1]??-1/0,B[Z+1]??1/0),z.sort(KF)}function FF($,Z,J){if(!Array.isArray($))return!0;let H=Z*J;for(let Q=0;Q<$.length-1;Q+=1)if(!(Math.abs($[Q]-$[Q+1])>=H))return!1;return!0}var pJ=()=>null,c4={activeThumbIndex:pJ,max:pJ,min:pJ,minStepsBetweenValues:pJ,step:pJ,values:pJ,...C2};var WF=P(m(),1),mL=WF.createContext(void 0);function b8(){let $=WF.useContext(mL);if($===void 0)throw Error(y0(62));return $}var uL=P(c(),1);function e60($,Z){return $===Z||Array.isArray($)&&Array.isArray(Z)&&fL($,Z)}var rg=$2.forwardRef(function(Z,J){let{"aria-labelledby":H,className:Q,defaultValue:B,disabled:X=!1,id:z,format:G,largeStep:U=10,locale:K,render:Y,max:F=100,min:W=0,minStepsBetweenValues:q=0,form:N,name:A,onValueChange:V,onValueCommitted:D,orientation:L="horizontal",step:j=1,thumbCollisionBehavior:M="push",thumbAlignment:_="center",value:E,style:C,...R}=Z,T=t0(z),I=lg(T),y=U0(V),S=U0(D),{clearErrors:O}=Z4(),{state:k,disabled:b,name:h,setTouched:v,setDirty:f,validityData:w,validation:i}=l5(),{labelId:r}=i5(),[x,l]=$2.useState(),s=H??ig(r,x),p=b||X,d=h??A,[o,Z0]=J4({controlled:E,default:B??W,name:"Slider"}),H0=$2.useRef(null),G0=$2.useRef(null),X0=$2.useRef([]),Y0=$2.useRef(null),A0=$2.useRef(-1),N0=$2.useRef(null),F0=$2.useRef(K0.none),[n,a]=$2.useState(-1),[e,$0]=$2.useState(-1),[Q0,_0]=$2.useState(!1),[M0,V0]=$2.useState(()=>new Map),[L0,g]=$2.useState([void 0,void 0]),u=U0((d0)=>{if(a(d0),d0!==-1)$0(d0)}),t=U0((d0)=>{if(d0)G0.current=d0}),W0=Array.isArray(o),I0=$2.useMemo(()=>{if(!W0)return[_2(o,W,F)];return o.map((d0)=>_2(d0,W,F)).sort(KF)},[F,W,W0,o]),c0=W0?I0:I0[0];w6(i.inputRef,T,c0,void 0,!p,A),h9(c0,()=>{O(d),i.change(c0);let d0=w.initialValue,v0;if(Array.isArray(c0)&&Array.isArray(d0))v0=!fL(c0,d0);else v0=c0!==d0;f(v0)});let f0=U0((d0,v0)=>{if(Number.isNaN(d0)||e60(d0,o))return!1;let S1=v0.event,s1=new S1.constructor(S1.type,S1);if(Object.defineProperty(s1,"target",{writable:!0,value:{value:d0,name:d}}),v0.event=s1,y(d0,v0),v0.isCanceled)return!1;return F0.current=v0.reason,Z0(d0),!0}),T0=U0((d0,v0,S1)=>{let B1=YF(d0,v0,W,F,W0,I0);if(FF(B1,j,q)){let s1="key"in S1?K0.keyboard:K0.inputChange,C0=f0(B1,R0(s1,S1.nativeEvent,void 0,{activeThumbIndex:v0}));if(v(!0),C0)S(B1,pz(s1,S1.nativeEvent))}});J0(()=>{if(!p)return;let d0=p1(m0(H0.current));if(b0(H0.current,d0))d0.blur();if(n!==-1)u(-1)},[n,p,u]);let x0=$2.useMemo(()=>({...k,activeThumbIndex:n,disabled:p,dragging:Q0,orientation:L,max:F,min:W,minStepsBetweenValues:q,step:j,values:I0}),[k,n,p,Q0,F,W,q,L,j,I0]),J1=$2.useMemo(()=>({active:n,controlRef:G0,disabled:p,dragging:Q0,validation:i,format:G,handleInputChange:T0,indicatorPosition:L0,inset:_!=="center",labelId:s,rootLabelId:I,largeStep:U,lastUsedThumbIndex:e,lastChangeReasonRef:F0,form:N,locale:K,max:F,min:W,minStepsBetweenValues:q,name:d,onValueCommitted:S,orientation:L,pressedThumbCenterOffsetRef:Y0,pressedThumbIndexRef:A0,pressedValuesRef:N0,registerFieldControlRef:t,renderBeforeHydration:_==="edge",setActive:u,setDragging:_0,setIndicatorPosition:g,setLabelId:l,setValue:f0,state:x0,step:j,thumbCollisionBehavior:M,thumbMap:M0,thumbRefs:X0,values:I0}),[n,s,I,p,Q0,i,G,T0,L0,U,e,N,K,F,W,q,d,S,L,t,u,f0,x0,j,M,_,M0,I0]),W1=z0("div",Z,{state:x0,ref:[J,H0],props:[{"aria-labelledby":s,id:T,role:"group"},R,(d0)=>i.getValidationProps(p,d0)],stateAttributesMapping:c4});return uL.jsx(mL.Provider,{value:J1,children:uL.jsx(e6,{elementsRef:X0,onMapChange:V0,children:W1})})});var ag=P(m(),1);var og=ag.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=X;delete z.id;let{state:G,setLabelId:U,controlRef:K,rootLabelId:Y}=b8();function F(q,N){if(N){let D=m0(q.currentTarget).getElementById(N);if(P1(D)){fU(D);return}}let A=K.current?.querySelectorAll('input[type="range"]'),V=A?.length===1?A[0]:null;if(P1(V))fU(V)}let W=gU({id:Y,setLabelId:U,focusControl:F});return z0("div",Z,{ref:J,state:G,props:[W,X],stateAttributesMapping:c4})});var qF=P(m(),1);function pL($){if(Array.isArray($))return $.map((Z)=>pL(Z)).join(",");if($==null)return"";return String($)}var ng=new Map;function $70($,Z){let J=JSON.stringify({locale:pL($),options:Z}),H=ng.get(J);if(H)return H;let Q=new Intl.NumberFormat($,Z);return ng.set(J,Q),Q}function cJ($,Z,J){if($==null)return"";return $70(Z,J).format($)}var sg=qF.forwardRef(function(Z,J){let{"aria-live":H="off",render:Q,className:B,children:X,style:z,...G}=Z,{thumbMap:U,state:K,values:Y,format:F,locale:W}=b8(),q=Array.from(U.values(),({inputId:D})=>D).join(" ").trim()||void 0,N=qF.useMemo(()=>Y.map((D)=>cJ(D,W,F)),[F,W,Y]),A=N.join(" – ");return z0("output",Z,{state:K,ref:J,props:[{"aria-live":H,children:typeof X==="function"?X(N,Y):A,htmlFor:q},G],stateAttributesMapping:c4})});var k8=P(m(),1);function NF($,Z){let J=$.getBoundingClientRect();return Z?(J.top+J.bottom)/2:(J.left+J.right)/2}function dJ($){if($===0)return 0;if(Math.abs($)<1){let J=$.toExponential().split("e-"),H=J[0].split(".")[1];return(H?H.length:0)+parseInt(J[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function VF($,Z,J){let H=Math.round(($-J)/Z)*Z+J;return Number(H.toFixed(Math.max(dJ(Z),dJ(J))))}function cL($,Z,J,H,Q,B,X,z){let G=$.slice(),U=B*X,K=G.length-1,Y=z??$,F=H+Z*U,W=Q-(K-Z)*U;G[Z]=_2(J,F,W);for(let q=Z+1;q<=K;q+=1){let N=G[q-1]+U,A=Q-(K-q)*U,V=Y[q],D=Math.max(G[q],N);if(V<D)D=Math.max(V,N);G[q]=_2(D,N,A)}for(let q=Z-1;q>=0;q-=1){let N=G[q+1]-U,A=H+q*U,V=Y[q],D=Math.min(G[q],N);if(V>D)D=Math.min(V,N);G[q]=_2(D,A,N)}for(let q=0;q<=K;q+=1)G[q]=Number(G[q].toFixed(12));return G}function tg($,Z,J,H,Q,B,X,z,G,U){let K=J??Z,Y=H??Z;if(!(K.length>1))return{value:B,thumbIndex:0,didSwap:!1};let W=G*U;if($==="push")return{value:cL(K,Q,B,X,z,G,U),thumbIndex:Q,didSwap:!1};let q=K.slice(),N=q[Q-1],A=q[Q+1],V=N!=null?N+W:X,D=A!=null?A-W:z,L=Number(_2(B,V,D).toFixed(12));switch(q[Q]=L,$){case"swap":{let j=K[Q],M=0.0000001,_=B>j,E=B<j,C=_&&A!=null&&B>=A-0.0000001,R=E&&N!=null&&B<=N+0.0000001;if(!C&&!R)return{value:q,thumbIndex:Q,didSwap:!1};let T=C?Q+1:Q-1,I=q.map((w,i)=>{if(i===Q)return L;let r=Y[i];if(r!=null)return r;return K[i]}),y=B;if(C)y=Math.max(B,q[T]);else y=Math.min(B,q[T]);let S=cL(q,T,y,X,z,G,U,I),O=C?T-1:T+1,k=S[O-1],b=S[O+1],h=k!=null?k+W:X;h=Math.max(h,X+O*W);let v=b!=null?b-W:z;v=Math.min(v,z-(S.length-1-O)*W);let f=_2(L,h,v);return S[O]=Number(f.toFixed(12)),{value:S,thumbIndex:T,didSwap:!0}}case"none":default:return{value:q,thumbIndex:Q,didSwap:!1}}}var Z70=2;function J70($,Z){if(!$)return{start:0,end:0};function J(B){let X=B!=null?parseFloat(B):0;return Number.isNaN(X)?0:X}let H=!Z?"InlineStart":"Top",Q=!Z?"InlineEnd":"Bottom";return{start:J($[`border${H}Width`])+J($[`padding${H}`]),end:J($[`border${Q}Width`])+J($[`padding${Q}`])}}function H70($,Z){if(Z.current!=null&&$.changedTouches){let J=$;for(let H=0;H<J.changedTouches.length;H+=1){let Q=J.changedTouches[H];if(Q.identifier===Z.current)return{x:Q.clientX,y:Q.clientY}}return null}return{x:$.clientX,y:$.clientY}}var eg=k8.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,{disabled:z,dragging:G,inset:U,lastChangeReasonRef:K,max:Y,min:F,minStepsBetweenValues:W,onValueCommitted:q,orientation:N,pressedThumbCenterOffsetRef:A,pressedThumbIndexRef:V,pressedValuesRef:D,registerFieldControlRef:L,renderBeforeHydration:j,setActive:M,setDragging:_,setValue:E,state:C,step:R,thumbCollisionBehavior:T,thumbRefs:I,values:y}=b8(),S=g4(),O=y.length>1,k=N==="vertical",b=k8.useRef(null),h=k8.useRef(null),v=U0((a)=>{if(a&&h.current==null)h.current=I1(a).getComputedStyle(a)}),f=k8.useRef(null),w=k8.useRef(0),i=k8.useRef(0),r=k8.useRef(null),x=U5(y);function l(a){return a?.querySelector('input[type="range"]')}function s(a){if(V.current=a,!I.current[a])A.current=null}function p(){V.current=-1,A.current=null}function d(a){if(!s0(a))return!1;return I.current.some((e)=>{if(!s0(e)||!b0(e,a))return!1;return l(e)?.disabled===!0})}function o(a){let e=b.current,$0=V.current;if(!e||$0<0||$0>=y.length){if($0>=y.length)r.current=null;return null}let{width:Q0,height:_0,bottom:M0,left:V0,right:L0}=e.getBoundingClientRect(),g=J70(h.current,k),u=i.current,t=(k?_0:Q0)-g.start-g.end-u*2,W0=A.current??0,I0=a.x-W0,c0=a.y-W0,f0=k?M0-c0-g.end:(S==="rtl"?L0-I0:I0-V0)-g.start,T0=_2((f0-u)/t,0,1),x0=(Y-F)*T0+F;if(x0=VF(x0,R,F),x0=_2(x0,F,Y),!O)return{value:x0,thumbIndex:$0,didSwap:!1};return tg(T,y,x.current,D.current,$0,x0,F,Y,R,W)}function Z0(a){D.current=O?y.slice():null,r.current=null,x.current=y;let e=V.current,$0=e;if(e>-1&&e<y.length){if(y[e]===Y){let Q0=e;while(Q0>0&&y[Q0-1]===Y)Q0-=1;$0=Q0}}else{let Q0=!k?"x":"y",_0;$0=-1;for(let M0=0;M0<I.current.length;M0+=1){let V0=I.current[M0];if(s0(V0)&&!l(V0)?.disabled){let L0=NF(V0,k),g=Math.abs(a[Q0]-L0);if(_0===void 0||g<=_0)$0=M0,_0=g}}}if($0>-1&&$0!==e)s($0);if(U){let Q0=I.current[$0];if(s0(Q0)){let _0=Q0.getBoundingClientRect(),M0=!k?"width":"height";i.current=_0[M0]/2}}}function H0(a){let e=l(I.current?.[a]);if(!e)return;e.focus({preventScroll:!0,focusVisible:!1})}function G0(a,e,$0){let Q0=E(a.value,R0(e,$0,void 0,{activeThumbIndex:a.thumbIndex}));if(Q0){if(r.current=a.value,x.current=Array.isArray(a.value)?a.value:[a.value],a.didSwap)s(a.thumbIndex),H0(a.thumbIndex)}return Q0}let X0=U0((a)=>{let e=H70(a,f);if(e==null)return;if(w.current+=1,a.type==="pointermove"&&a.buttons===0){Y0(a);return}let $0=o(e);if($0==null)return;if(FF($0.value,R,W)){if(!G&&w.current>Z70)_(!0);G0($0,K0.drag,a)}}),Y0=U0((a)=>{M(-1),_(!1),A.current=null;let e=r.current;if(Array.isArray(e)&&e.length!==y.length)r.current=null;if(r.current!=null){let $0=K.current;q(r.current,pz($0,a))}if("pointerType"in a&&b.current?.hasPointerCapture(a.pointerId))b.current?.releasePointerCapture(a.pointerId);V.current=-1,f.current=null,N0()}),A0=U0((a)=>{if(z)return;if(d(M1(a))){p();return}let e=a.changedTouches[0];if(e==null)return;f.current=e.identifier;let $0={x:e.clientX,y:e.clientY};Z0($0);let Q0=o($0);if(Q0==null)return;H0(Q0.thumbIndex),G0(Q0,K0.trackPress,a),w.current=0;let _0=m0(b.current);_0.addEventListener("touchmove",X0,{passive:!0}),_0.addEventListener("touchend",Y0,{passive:!0})}),N0=U0(()=>{let a=m0(b.current);a.removeEventListener("pointermove",X0),a.removeEventListener("pointerup",Y0),a.removeEventListener("touchmove",X0),a.removeEventListener("touchend",Y0),D.current=null,r.current=null}),F0=N4();return k8.useEffect(()=>{let a=b.current;if(!a)return()=>N0();let e=n0(a,"touchstart",A0,{passive:!0});return()=>{e(),F0.cancel(),N0()}},[N0,A0,b,F0]),k8.useEffect(()=>{if(z)N0()},[z,N0]),z0("div",Z,{state:C,ref:[J,L,b,v],props:[{["data-base-ui-slider-control"]:j?"":void 0,onPointerDown(a){let e=b.current,$0=M1(a.nativeEvent);if(!e||z||a.defaultPrevented||!s0($0)||a.button!==0)return;if(d($0)){p();return}let Q0={x:a.clientX,y:a.clientY};Z0(Q0);let _0=o(Q0);if(_0==null)return;if(b0(I.current[_0.thumbIndex],p1(m0(e))))a.preventDefault();else F0.request(()=>{H0(_0.thumbIndex)});if(_(!0),A.current==null)G0(_0,K0.trackPress,a.nativeEvent);if(a.nativeEvent.pointerId)e.setPointerCapture(a.nativeEvent.pointerId);w.current=0;let L0=m0(e);L0.addEventListener("pointermove",X0,{passive:!0}),L0.addEventListener("pointerup",Y0,{once:!0})}},X],stateAttributesMapping:c4})});var $f=P(m(),1);var Zf=$f.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,{state:z}=b8();return z0("div",Z,{state:z,ref:J,props:[{style:{position:"relative"}},X],stateAttributesMapping:c4})});var y8=P(m(),1);var AF="";var Jf=P(AZ(),1);function Q70(){return X1}function B70(){return!1}function X70(){return!0}function lJ(){return Jf.useSyncExternalStore(Q70,B70,X70)}function bB($,Z,J){return($-Z)*100/(J-Z)}var S61=P(m(),1);var DF=P(m(),1),z70=DF.createContext(void 0),G70={disableStyleElements:!1};function Hf(){return DF.useContext(z70)??G70}var Qf=P(c(),1);function LF($){let{script:Z}=$,{nonce:J}=Hf();if(!lJ())return null;return Qf.jsx("script",{nonce:J,dangerouslySetInnerHTML:{__html:Z},suppressHydrationWarning:!0})}var Bf="data-index";var kB=P(c(),1),Xf,K70=new Set([...n8,zA,GA]);function Y70($,Z,J,H){if(Z<0)return;if($.length===2)return`${cJ($[Z],H,J)} ${Z===0?"start":"end"} range`;return J?cJ($[Z],H,J):void 0}function F70($,Z,J,H,Q){let B=$+Z*J,X=Number(B.toFixed(Math.max(dJ($),dJ(Z),dJ(H))));return _2(X,H,Q)}var zf=y8.forwardRef(function(Z,J){let{render:H,children:Q,className:B,"aria-describedby":X,"aria-label":z,"aria-labelledby":G,"aria-valuetext":U,disabled:K=!1,getAriaLabel:Y,getAriaValueText:F,id:W,index:q,inputRef:N,onBlur:A,onFocus:V,onKeyDown:D,tabIndex:L,style:j,...M}=Z,_=t0(W),{active:E,lastUsedThumbIndex:C,controlRef:R,disabled:T,validation:I,format:y,handleInputChange:S,inset:O,labelId:k,largeStep:b,locale:h,max:v,min:f,minStepsBetweenValues:w,form:i,name:r,orientation:x,pressedThumbCenterOffsetRef:l,pressedThumbIndexRef:s,renderBeforeHydration:p,setActive:d,setIndicatorPosition:o,state:Z0,step:H0,thumbRefs:G0,values:X0}=b8(),Y0=g4(),A0=K||T,N0=X0.length>1,F0=x==="vertical",n=Y0==="rtl",{setTouched:a,setFocused:e,validationMode:$0}=l5(),Q0=y8.useRef(null),_0=y8.useRef(null),M0=y8.useRef(!1),V0=U0((P0)=>{if(M0.current)return;V?.(P0)}),L0=U0((P0)=>{if(M0.current)return;A?.(P0)}),g=t0(),u=E6(),t=N0?g:u,W0=y8.useMemo(()=>({inputId:t}),[t]),{ref:I0,index:c0}=X4({metadata:W0}),f0=!N0?0:q??c0,T0=f0===X0.length-1,x0=X0[f0],J1=bB(x0,f,v),[W1,d0]=y8.useState(),v0=lJ(),S1=C>=0&&C<X0.length?C:-1,B1=U0(()=>{let P0=R.current,l0=Q0.current;if(!P0||!l0)return;let z1=l0.getBoundingClientRect(),O1=P0.getBoundingClientRect(),k0=F0?"height":"width",r0=O1[k0]-z1[k0],G1=(z1[k0]/2+r0*J1/100)/O1[k0]*100,R1=Number.isFinite(G1)?G1:void 0;if(d0(R1),f0===0)o((k1)=>[R1,k1[1]]);else if(T0)o((k1)=>[k1[0],R1])});J0(()=>{if(O)queueMicrotask(B1)},[B1,O]),J0(()=>{if(O)B1()},[B1,O,J1]),J0(()=>{if(!O)return;let P0=R.current,l0=Q0.current;if(!P0||!l0)return;let z1=I1(P0).ResizeObserver;if(typeof z1!=="function")return;let O1=new z1(B1);return O1.observe(P0),O1.observe(l0),()=>{O1.disconnect()}},[R,B1,O]);let s1=F0?"bottom":"insetInlineStart",C0=F0?"left":"top",p0;if(N0){if(E===f0)p0=2;else if(S1===f0)p0=1}else if(E===f0)p0=1;let i0;if(!O&&!Number.isFinite(J1))i0=u8;else i0={position:"absolute",[s1]:O?"var(--position)":`${J1}%`,[C0]:"50%",translate:`${(F0||!n?-1:1)*50}% ${(F0?1:-1)*50}%`,zIndex:p0,...O&&{["--position"]:`${W1??0}%`,visibility:p&&v0||W1===void 0?"hidden":void 0}};let o0;if(F0)o0=n?"vertical-rl":"vertical-lr";let A1=typeof Y==="function"?Y(f0):z,D1=X2({"aria-label":A1,"aria-labelledby":G??(A1==null?k:void 0),"aria-describedby":X,"aria-orientation":x,"aria-valuenow":x0,"aria-valuetext":typeof F==="function"?F(cJ(x0,h,y),x0,f0):U??Y70(X0,f0,y,h),disabled:A0,form:i,id:t,max:v,min:f,name:r,onChange(P0){S(P0.currentTarget.valueAsNumber,f0,P0)},onFocus(P0){let l0=M0.current;if(M0.current=!1,d(f0),e(!0),l0)P0.stopPropagation()},onBlur(P0){if(M0.current){P0.stopPropagation();return}if(d(-1),G0.current.some((l0)=>b0(l0,P0.relatedTarget)))return;if(a(!0),e(!1),$0==="onBlur")I.commit(YF(x0,f0,f,v,N0,X0))},onKeyDown(P0){if(P0.defaultPrevented)return;if(!K70.has(P0.key))return;if(n8.has(P0.key))P0.stopPropagation();let l0=null,z1=0,O1=P0.shiftKey?b:H0,k0=VF(x0,H0,f);switch(P0.key){case pZ:z1=1;break;case lZ:z1=n?-1:1;break;case cZ:z1=-1;break;case dZ:z1=n?1:-1;break;case zA:O1=b,z1=1;break;case GA:O1=b,z1=-1;break;case rZ:l0=N0&&Number.isFinite(X0[f0+1])?X0[f0+1]-H0*w:v;break;case iZ:l0=N0&&Number.isFinite(X0[f0-1])?X0[f0-1]+H0*w:f;break;default:break}if(z1!==0)l0=F70(k0,O1,z1,f,v);if(l0!==null){let r0=P0.currentTarget;if(!D9(r0))M0.current=!0,r0.blur(),r0.focus({preventScroll:!0,focusVisible:!0});S(l0,f0,P0),P0.preventDefault()}},step:H0,style:{...u8,width:"100%",height:"100%",writingMode:o0},tabIndex:L,type:"range",value:x0??""},(P0)=>I.getValidationProps(A0,P0),{onFocus:V0,onBlur:L0,onKeyDown:D}),u1=x2(_0,I.inputRef,N);return z0("div",Z,{state:Z0,ref:[J,I0,Q0],props:[{[Bf]:f0,children:kB.jsxs(y8.Fragment,{children:[Q,kB.jsx("input",{ref:u1,...D1,suppressHydrationWarning:!0}),O&&T0&&p&&(Xf||(Xf=kB.jsx(LF,{script:AF})))]}),id:_,onPointerDown(P0){if(A0)return;s.current=f0;let l0=NF(P0.currentTarget,F0);l.current=(F0?P0.clientY:P0.clientX)-l0},style:i0,suppressHydrationWarning:p||void 0},M],stateAttributesMapping:c4})});var Gf=P(m(),1);function W70($,Z,J,H,Q,B){let X={visibility:B||J&&(H===void 0||Z&&Q===void 0)?"hidden":void 0,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"},z=`${H??0}%`,G=`${(Q??0)-(H??0)}%`;if(J){if(X["--start-position"]=z,z="var(--start-position)",Z)X["--relative-size"]=G,G="var(--relative-size)"}return X[$?"bottom":"insetInlineStart"]=Z?z:0,X[$?"height":"width"]=Z?G:z,X}var Uf=Gf.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,{indicatorPosition:z,inset:G,max:U,min:K,orientation:Y,renderBeforeHydration:F,state:W,values:q}=b8(),N=lJ(),A=Y==="vertical",V=q.length>1,D=W70(A,V,G,G?z[0]:bB(q[0],K,U),G?z[1]:bB(q[q.length-1],K,U),G&&F&&N);return z0("div",Z,{state:W,ref:J,props:[{["data-base-ui-slider-indicator"]:F?"":void 0,style:D,suppressHydrationWarning:F||void 0},X],stateAttributesMapping:c4})});var k$=P(c(),1);function Kf({animate:$=!1,children:Z,className:J,defaultValue:H,value:Q,min:B=0,max:X=100,...z}){let[G,U]=MF.useState(!1),K=Array.isArray(Q)?Q:Array.isArray(H)?H:[B];return MF.useEffect(()=>{let Y=requestAnimationFrame(()=>U(!0));return()=>cancelAnimationFrame(Y)},[]),k$.jsx(H7.Root,{className:a0("data-horizontal:w-full data-vertical:h-full",J),"data-slot":"slider",defaultValue:H,value:Q,min:B,max:X,thumbAlignment:"edge",...z,children:k$.jsxs(H7.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:[k$.jsx(H7.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-accent select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:k$.jsx(H7.Indicator,{"data-slot":"slider-range",className:a0("bg-primary select-none data-horizontal:h-full data-vertical:w-full",$&&G&&"transition-[width,height,inset-inline-start,bottom] duration-100 ease-in-out")})}),Z,Array.from({length:K.length},(Y,F)=>k$.jsx(H7.Thumb,{"data-slot":"slider-thumb",className:a0("relative block size-3 shrink-0 rounded-xs bg-white shadow-xs 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 data-horizontal:cursor-ew-resize data-vertical:cursor-ns-resize",$&&G&&"transition-[inset-inline-start,bottom,color,box-shadow] duration-100 ease-in-out")},F))]})})}var _1=P(c(),1);function q70($){return $.charAt(0).toUpperCase()+$.slice(1)}function N70($){return $==="xhigh"?"Extra":q70($)}function Yf($){return typeof $==="number"?$:$[0]??0}var Ff={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},Wf={type:"spring",duration:0.3,delay:0.1,bounce:0};function Nf({label:$,leadingIcon:Z,className:J,...H}){return _1.jsxs(j0,{...H,variant:"ghost",className:B0("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",J),children:[Z,_1.jsx("span",{className:"truncate font-normal",children:$})]})}function V70({current:$,model:Z,models:J,onValueChange:H}){let Q=Z.displayName,B=cv(J,"Models");return _1.jsxs(o9,{children:[_1.jsx(n9,{render:_1.jsx(Nf,{label:Q,className:"shrink","aria-label":`Model: ${Q}`})}),_1.jsx(s9,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:_1.jsx(pg,{value:$,onValueChange:H,children:B.map((X)=>_1.jsxs(J7,{children:[_1.jsx(UF,{children:X.label}),X.models.map((z)=>_1.jsx(cg,{value:z.value,closeOnClick:!0,children:z.displayName},z.value))]},X.label))})})]})}function Vf({fastMode:$,onChange:Z}){return _1.jsxs(Q5,{children:[_1.jsx(B5,{render:_1.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":$?"Turn off fast mode":"Turn on fast mode","aria-pressed":$,onClick:()=>Z(!$),className:"-my-1 -mr-1",children:$?_1.jsx(qf,{className:"text-primary",stroke:1.75}):_1.jsx(gQ,{className:"text-muted-foreground",stroke:1.75})})}),_1.jsxs(X5,{align:"center",className:"flex-col gap-0",children:[_1.jsx("span",{children:"Fast mode"}),_1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})}function A70({currentEffort:$,effortLevels:Z,fastMode:J,showFastMode:H,onFastModeChange:Q,onValueChange:B}){let X=fv(Z,$),[z,G]=iJ.useState(!1),[U,K]=iJ.useState(X),[Y,F]=iJ.useState(!1),q=Z[z?U:X]??$,N=N70(q),A=(D)=>{if(D)K(X);else F(!1);G(D)},V=(D)=>{let L=Z[D];if(L&&L!==$)B(L)};return _1.jsxs(q6,{open:z,onOpenChange:A,children:[_1.jsx(N6,{render:_1.jsx(Nf,{label:N,leadingIcon:J?_1.jsx(gQ,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),_1.jsxs(V6,{align:"end",side:"top",className:"w-64",children:[_1.jsx(LS,{className:"relative h-5 flex-row items-center",children:_1.jsx(j4,{mode:"popLayout",initial:!1,children:Y?_1.jsxs(z5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:Ff,initial:"from",animate:"to",exit:"from",transition:Wf,children:[_1.jsx("span",{children:"Faster"}),_1.jsx("span",{children:"Smarter"})]},"range"):_1.jsxs(z5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:Ff,initial:"from",animate:"to",exit:"from",transition:Wf,children:[_1.jsxs("div",{className:"flex items-center gap-1",children:[_1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),_1.jsx("output",{"aria-live":"polite",children:N})]}),H&&_1.jsx(Vf,{fastMode:J,onChange:Q})]},"effort")})}),_1.jsxs("label",{className:"block",children:[_1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),_1.jsx(Kf,{value:[U],min:0,max:Z.length-1,step:1,onPointerDown:(D)=>{if(D.button===0)F(!0)},onPointerCancel:()=>F(!1),onValueChange:(D)=>K(Yf(D)),onValueCommitted:(D)=>{F(!1),V(Yf(D))},className:B0("**: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]:ring-0"),animate:!0,children:_1.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,L)=>_1.jsx("span",{className:B0("size-1 rounded-full",L<=U?"bg-primary-foreground/30":"bg-foreground/30")},L))})})]})]})]})}var Af=iJ.memo(function({sessionId:Z}){let{workspaceId:J,layout:H,setLayout:Q}=i1(),{data:B}=i9(J),X=B?.models??[],z=X.find((_)=>_.value==="default"),G=B?pv(X.filter((_)=>_.value!=="default"),B.provider):[],U=xY(J,Z).data,K=vv(J),Y=(Z?U?.model:void 0)??H.selectedModel,F=(Z?U?.effort:void 0)??H.selectedEffort,W=(Z?U?.fastMode:void 0)??H.selectedFastMode,q=(_)=>{if(Z)K.mutate({sessionId:Z,patch:{model:_}});else Q({selectedModel:_})},N=(_)=>{if(Z)K.mutate({sessionId:Z,patch:{effort:_}});else Q({selectedEffort:_})},A=(_)=>{if(Z)K.mutate({sessionId:Z,patch:{fastMode:_}});else Q({selectedFastMode:_})},V=hY(G,Y,z?.resolvedModel);if(!V)return null;let D=V.supportsEffort?V.supportedEffortLevels??[]:[],L=TL(D,F,V.defaultEffort),j=mv(D)&&L!==void 0,M=uv(V,W);return _1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[_1.jsx(V70,{current:V.value,model:V,models:G,onValueChange:q}),!j&&V.supportsFastMode&&_1.jsx(Vf,{fastMode:M,onChange:A}),j&&_1.jsx(A70,{currentEffort:L,effortLevels:D,fastMode:M,showFastMode:V.supportsFastMode===!0,onFastModeChange:A,onValueChange:N},V.value)]})});var M5=P(c(),1);function Mf({composerRef:$,onSend:Z,onStop:J,processing:H,sessionId:Q,modelSessionId:B,availability:X,annotation:z,onRemoveDrawing:G,allowFiles:U=!0,placeholder:K,draft:Y}){let F=yB.useRef(null),W=e1(),q=w5((O)=>O.composerDrafts[W]??""),N=w5((O)=>Y?(O.viewBuilderDrafts??{})[Y.id]:void 0),A=Y?N??Y.initialValue:q,V=Y5(A),D=g2((O)=>O.attachments[J8(W,Q)]??D70),[L,j]=yB.useState(!1),M=D.some((O)=>O.kind!=="text"&&O.status==="uploading"),_=D.some((O)=>O.kind==="text"||O.status==="ready"||O.status==="draft"),E=A.trim().length>0||_,C=wB(E,M,X),R=(O)=>{if(V.current=O,Y)Y.onChange(O);else w5.getState().setComposerDraft(W,O)},T=(O)=>{if(U)uh({workspaceId:W,sessionId:Q},O)},I=yB.useRef(!1),y=(O)=>{if(O.kind==="drawing"&&G){G(O.localId);return}w1.getState().removeAttachment(W,O.localId)},S=async()=>{if(!C||I.current)return;I.current=!0;try{if(await z?.finish(),await Z(V.current),!Y)V.current="",w5.getState().setComposerDraft(W,"")}finally{I.current=!1}};return M5.jsxs(ih,{composerRef:$,onSubmit:(O)=>{O.preventDefault(),S()},onDragOver:(O)=>{if(!O.dataTransfer.types.includes("Files"))return;if(O.preventDefault(),U)j(!0)},onDragLeave:(O)=>{if(!U)return;if(O.currentTarget.contains(O.relatedTarget))return;j(!1)},onDrop:(O)=>{if(!O.dataTransfer.types.includes("Files"))return;O.preventDefault(),j(!1),T(Array.from(O.dataTransfer.files))},className:B0(L&&"ring-2 ring-ring/60"),children:[D.length>0&&M5.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:D.toSorted((O,k)=>Df[O.kind]-Df[k.kind]).map((O)=>O.kind==="text"?M5.jsx(EB,{label:O.label,onRemove:()=>y(O)},O.localId):O.kind==="drawing"?M5.jsx(bv,{attachment:O,onRemove:()=>y(O)},O.localId):M5.jsx(kv,{attachment:O,onRemove:()=>y(O)},O.localId))}),M5.jsx(rh,{textareaRef:$,id:"chat-input",name:"message",value:A,onChange:(O)=>R(O.target.value),onKeyDown:(O)=>{if(O.key==="Enter"&&!O.shiftKey)O.preventDefault(),S()},onPaste:(O)=>{let k=Array.from(O.clipboardData?.files??[]);if(k.length===0)return;O.preventDefault(),T(k)},placeholder:H?"Queue a follow-up":K??"Do anything",rows:1}),M5.jsxs(ah,{children:[U&&M5.jsx("input",{ref:F,type:"file",multiple:!0,hidden:!0,onChange:(O)=>{T(Array.from(O.target.files??[])),O.target.value=""}}),M5.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[U&&M5.jsxs(Q5,{children:[M5.jsx(B5,{render:M5.jsx(j0,{type:"button",variant:"ghost",size:"icon",onClick:()=>F.current?.click(),"aria-label":"Attach files",children:M5.jsx(sU,{stroke:1.6,className:"size-4.5!"})})}),M5.jsx(X5,{children:"Attach files"})]}),z&&M5.jsxs(Q5,{children:[M5.jsx(B5,{render:M5.jsx(j0,{type:"button",variant:"ghost",size:"icon",onClick:z.onToggle,className:B0(z.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":z.active,children:M5.jsx(vJ,{stroke:1.5})})}),M5.jsx(X5,{children:"Draw annotation"})]})]}),M5.jsx(Af,{sessionId:B}),H?M5.jsxs(Q5,{children:[M5.jsx(B5,{render:M5.jsx(j0,{type:"button",size:"icon",onClick:J,"aria-label":"Stop agent",children:M5.jsx(Lf,{})})}),M5.jsx(X5,{children:"Stop answering"})]}):M5.jsx(oh,{label:"Send message",hasContent:E,busy:M,availability:X})]})]})}var D70=[],Df={file:0,drawing:1,text:2};var y$=P(c(),1);function dL({className:$,prompt:Z,disabled:J=!1,onSelect:H}){let Q=Z.icon;return y$.jsxs(j0,{type:"button",size:"sm",disabled:J,onClick:()=>H(Z),className:B0("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[y$.jsx(Q,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),y$.jsx("span",{children:Z.label})]})}function Pf({prompts:$,disabled:Z=!1,onSelect:J}){return y$.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 @md:grid-cols-3",children:$.map((H,Q)=>{return y$.jsx(dL,{prompt:H,disabled:Z,onSelect:J,className:B0("h-full w-fit @md:w-full",Q===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",Q===1&&"@md:-rotate-1",Q===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},H.prompt)})})}var G5=P(c(),1),lL="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",L70=[{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.",lL],icon:_f},{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.",lL],icon:jf},{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.",lL],icon:tU}],M70={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:_F};function Of({isViewBuilderDraft:$,hasSentMessageFromMoi:Z,isWorkspacePendingAnalysis:J}){if($)return"view-builder";if(!Z)return"welcome";if(J)return"explore-workspace";return"empty"}function Tf({agent:$,kind:Z,hasWorkspaceApplets:J,disabled:H=!1,onSelectPrompt:Q,onNavigate:B}){switch(Z){case"view-builder":return G5.jsx(P70,{agent:$});case"welcome":return G5.jsx(_70,{agent:$,disabled:H,showExamples:!J,onSelectPrompt:Q,onNavigate:B});case"explore-workspace":return G5.jsx(j70,{agent:$,disabled:H,onSelectPrompt:Q});case"empty":return G5.jsx(O70,{agent:$})}}function OF({agent:$,children:Z,className:J}){return G5.jsxs("div",{className:B0("flex flex-1 flex-col items-center justify-center self-center",J),children:[G5.jsx(l9,{preset:$,color:"secondary",expression:"idle",className:"mb-2",animated:!0}),Z]})}function P70({agent:$}){return G5.jsx(OF,{agent:$,className:"text-center text-muted-foreground",children:G5.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 _70({agent:$,disabled:Z=!1,showExamples:J=!0,onSelectPrompt:H,onNavigate:Q}){return G5.jsx(OF,{agent:$,className:"@container w-full max-w-md min-w-0",children:G5.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[G5.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[G5.jsx("p",{children:"moi is the personal workspace built for you by your agent. It grows and adapts to your needs."}),G5.jsxs("p",{children:["Ask the"," ",G5.jsx(PF,{Icon:xB,destination:"agent",onNavigate:Q,children:"Agent"})," ","to build widgets on the"," ",G5.jsx(PF,{Icon:jF,destination:"overview",onNavigate:Q,children:"Overview"})," ","page, or more complex tools as separate"," ",G5.jsx(PF,{Icon:rJ,destination:"views",onNavigate:Q,children:"Views"}),". Use"," ",G5.jsx(PF,{Icon:hB,destination:"scratchpad",onNavigate:Q,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),J&&G5.jsx("p",{children:"Try an example:"})]}),J&&G5.jsx(Pf,{prompts:L70,disabled:Z,onSelect:H})]})})}function j70({agent:$,disabled:Z=!1,onSelectPrompt:J}){return G5.jsx(OF,{agent:$,children:G5.jsxs("div",{className:"flex flex-col items-center gap-4",children:[G5.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:G5.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),G5.jsx(dL,{prompt:M70,disabled:Z,onSelect:J})]})})}function O70({agent:$}){return G5.jsx(OF,{agent:$,className:"text-center text-muted-foreground",children:G5.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 PF({Icon:$,children:Z,destination:J,onNavigate:H}){return G5.jsxs("button",{type:"button","data-welcome-destination":J,onClick:()=>H(J),className:"inline-flex cursor-pointer items-center gap-0.5 align-bottom font-medium text-foreground",children:[G5.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),Z]})}var vB=P(m(),1);var g1=P(c(),1);function Ef({label:$}){return g1.jsx("div",{className:"flex h-7 items-center px-2.5 text-sm font-medium",children:$})}function T70($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function C70({active:$,canArchive:Z,confirmingArchive:J,onArchive:H,onRequestArchive:Q,onSelect:B,session:X,workspaceId:z}){let G=vB.useRef(!1),[U,K]=vB.useState(!1),Y=g2((N)=>WQ(N.activity,z,X.sessionId)),F=T70(X);function W(){Q(X.sessionId)}async function q(){if(G.current)return;G.current=!0,K(!0);try{await H(X.sessionId)}catch{K5.add({title:"Couldn’t archive chat",type:"error"})}finally{G.current=!1,K(!1)}}return g1.jsxs("div",{className:"group/chat relative",children:[g1.jsx(H9,{className:B0("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>B(X.sessionId),children:g1.jsx("div",{className:B0("flex min-w-0 flex-1 overflow-hidden",(Y||U)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!J&&"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)]",J&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:g1.jsxs("span",{className:B0("flex min-w-0 items-baseline gap-1.5",(Y||U)&&"-mr-4",J?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[g1.jsx("span",{className:"min-w-0 truncate",children:X.summary}),F&&g1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F})]})})}),Y&&g1.jsx(H8,{className:B0("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",(J||U)&&"hidden")}),Z&&g1.jsx("div",{className:B0("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!J&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",U&&"opacity-100!"),children:J?g1.jsx(j0,{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:U,onClick:q,onPointerDown:(N)=>N.stopPropagation(),children:"Confirm"}):g1.jsxs(Q5,{children:[g1.jsx(B5,{render:g1.jsx(j0,{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:U,onClick:W,onPointerDown:(N)=>N.stopPropagation(),children:g1.jsx(wf,{stroke:1.75})})}),g1.jsx(X5,{side:"right",children:"Archive chat"})]})})]})}function w70($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function Cf($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function E70($,Z){let J=Cf(Z)-Cf($);if(J===0)return"Today";if(J===1)return"Yesterday";if(J>=2&&J<=5)return`${J} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function S70($,Z=new Date){let J=new Map;for(let H of $.slice().sort((Q,B)=>B.lastModified-Q.lastModified)){let Q=new Date(H.lastModified),B=w70(Q),X=J.get(B);if(X){X.sessions.push(H);continue}J.set(B,{key:B,label:E70(Q,Z),sessions:[H]})}return[...J.values()]}function Sf({isViewBuilder:$=!1}){if($)return g1.jsx(Ef,{label:"Build a new view"});return g1.jsx(R70,{})}function R70(){let $=e1(),[Z,J]=j6(),H=Z??null,[Q,B]=vB.useState(null),{data:X=[]}=yY($),z=i9($).data?.supportsArchiving===!0,G=xv($),U=g2((N)=>qE(N.activity,$,H));if(X.length===0)return g1.jsx(Ef,{label:"New chat"});let Y=X.find((N)=>N.sessionId===H)?.summary??"New chat",F=S70(X);function W(N){if(!N)B(null)}async function q(N){B(null),await G.mutateAsync(N);let A=w1.getState();if(A.clearAttachments($,N),A.clearPreviewsForSession($,N),H===N)J(null)}return g1.jsxs(o9,{onOpenChange:W,children:[g1.jsx(n9,{render:g1.jsxs(j0,{className:"group max-w-full min-w-0 shrink",variant:"ghost",size:"sm",children:[g1.jsx("span",{className:"max-w-64 min-w-0 truncate",children:Y}),U?g1.jsx(H8,{className:"size-4!",stroke:2}):g1.jsx(ZJ,{className:"text-muted-foreground group-hover:text-foreground",stroke:1.75})]})}),g1.jsxs(s9,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:[g1.jsxs(H9,{className:"shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!",onClick:()=>J(null),children:[g1.jsx(TF,{size:16,stroke:1.75}),"New chat"]}),F.length>0&&g1.jsxs(g1.Fragment,{children:[g1.jsx(dg,{className:"shrink-0"}),g1.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:F.map((N)=>g1.jsxs(J7,{children:[g1.jsx(UF,{children:N.label}),N.sessions.map((A)=>g1.jsx(C70,{session:A,active:H===A.sessionId,canArchive:z,confirmingArchive:Q===A.sessionId,onSelect:J,onArchive:q,onRequestArchive:B,workspaceId:$},A.sessionId))]},N.key))})]})]})]})}var nl=P(m(),1);function n1(){}function CF(){}function Rf($,Z){let J=Z||{};return($[$.length-1]===""?[...$,""]:$).join((J.padRight?" ":"")+","+(J.padLeft===!1?"":" ")).trim()}var I70=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,b70=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k70={};function wF($,Z){return((Z||k70).jsx?b70:I70).test($)}var y70=/[ \t\n\f\r]/g;function iL($){return typeof $==="object"?$.type==="text"?If($.value):!1:If($)}function If($){return $.replace(y70,"")===""}class Q7{constructor($,Z,J){if(this.normal=Z,this.property=$,J)this.space=J}}Q7.prototype.normal={};Q7.prototype.property={};Q7.prototype.space=void 0;function rL($,Z){let J={},H={};for(let Q of $)Object.assign(J,Q.property),Object.assign(H,Q.normal);return new Q7(J,H,Z)}function gB($){return $.toLowerCase()}class u2{constructor($,Z){this.attribute=Z,this.property=$}}u2.prototype.attribute="";u2.prototype.booleanish=!1;u2.prototype.boolean=!1;u2.prototype.commaOrSpaceSeparated=!1;u2.prototype.commaSeparated=!1;u2.prototype.defined=!1;u2.prototype.mustUseProperty=!1;u2.prototype.number=!1;u2.prototype.overloadedBoolean=!1;u2.prototype.property="";u2.prototype.spaceSeparated=!1;u2.prototype.space=void 0;var fB={};C5(fB,{spaceSeparated:()=>F5,overloadedBoolean:()=>EF,number:()=>E0,commaSeparated:()=>B7,commaOrSpaceSeparated:()=>d4,booleanish:()=>r5,boolean:()=>T1});var x70=0,T1=x$(),r5=x$(),EF=x$(),E0=x$(),F5=x$(),B7=x$(),d4=x$();function x$(){return 2**++x70}var aL=Object.keys(fB);class aJ extends u2{constructor($,Z,J,H){let Q=-1;super($,Z);if(bf(this,"space",H),typeof J==="number")while(++Q<aL.length){let B=aL[Q];bf(this,aL[Q],(J&fB[B])===fB[B])}}}aJ.prototype.defined=!0;function bf($,Z,J){if(J)$[Z]=J}function x8($){let Z={},J={};for(let[H,Q]of Object.entries($.properties)){let B=new aJ(H,$.transform($.attributes||{},H),Q,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(H))B.mustUseProperty=!0;Z[H]=B,J[gB(H)]=H,J[gB(B.attribute)]=H}return new Q7(Z,J,$.space)}var oL=x8({properties:{ariaActiveDescendant:null,ariaAtomic:r5,ariaAutoComplete:null,ariaBusy:r5,ariaChecked:r5,ariaColCount:E0,ariaColIndex:E0,ariaColSpan:E0,ariaControls:F5,ariaCurrent:null,ariaDescribedBy:F5,ariaDetails:null,ariaDisabled:r5,ariaDropEffect:F5,ariaErrorMessage:null,ariaExpanded:r5,ariaFlowTo:F5,ariaGrabbed:r5,ariaHasPopup:null,ariaHidden:r5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:F5,ariaLevel:E0,ariaLive:null,ariaModal:r5,ariaMultiLine:r5,ariaMultiSelectable:r5,ariaOrientation:null,ariaOwns:F5,ariaPlaceholder:null,ariaPosInSet:E0,ariaPressed:r5,ariaReadOnly:r5,ariaRelevant:null,ariaRequired:r5,ariaRoleDescription:F5,ariaRowCount:E0,ariaRowIndex:E0,ariaRowSpan:E0,ariaSelected:r5,ariaSetSize:E0,ariaSort:null,ariaValueMax:E0,ariaValueMin:E0,ariaValueNow:E0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function SF($,Z){return Z in $?$[Z]:Z}function RF($,Z){return SF($,Z.toLowerCase())}var kf=x8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:B7,acceptCharset:F5,accessKey:F5,action:null,allow:null,allowFullScreen:T1,allowPaymentRequest:T1,allowUserMedia:T1,alt:null,as:null,async:T1,autoCapitalize:null,autoComplete:F5,autoFocus:T1,autoPlay:T1,blocking:F5,capture:null,charSet:null,checked:T1,cite:null,className:F5,cols:E0,colSpan:null,content:null,contentEditable:r5,controls:T1,controlsList:F5,coords:E0|B7,crossOrigin:null,data:null,dateTime:null,decoding:null,default:T1,defer:T1,dir:null,dirName:null,disabled:T1,download:EF,draggable:r5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:T1,formTarget:null,headers:F5,height:E0,hidden:EF,high:E0,href:null,hrefLang:null,htmlFor:F5,httpEquiv:F5,id:null,imageSizes:null,imageSrcSet:null,inert:T1,inputMode:null,integrity:null,is:null,isMap:T1,itemId:null,itemProp:F5,itemRef:F5,itemScope:T1,itemType:F5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:T1,low:E0,manifest:null,max:null,maxLength:E0,media:null,method:null,min:null,minLength:E0,multiple:T1,muted:T1,name:null,nonce:null,noModule:T1,noValidate:T1,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:T1,optimum:E0,pattern:null,ping:F5,placeholder:null,playsInline:T1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:T1,referrerPolicy:null,rel:F5,required:T1,reversed:T1,rows:E0,rowSpan:E0,sandbox:F5,scope:null,scoped:T1,seamless:T1,selected:T1,shadowRootClonable:T1,shadowRootDelegatesFocus:T1,shadowRootMode:null,shape:null,size:E0,sizes:null,slot:null,span:E0,spellCheck:r5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E0,step:null,style:null,tabIndex:E0,target:null,title:null,translate:null,type:null,typeMustMatch:T1,useMap:null,value:r5,width:E0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:F5,axis:null,background:null,bgColor:null,border:E0,borderColor:null,bottomMargin:E0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:T1,declare:T1,event:null,face:null,frame:null,frameBorder:null,hSpace:E0,leftMargin:E0,link:null,longDesc:null,lowSrc:null,marginHeight:E0,marginWidth:E0,noResize:T1,noHref:T1,noShade:T1,noWrap:T1,object:null,profile:null,prompt:null,rev:null,rightMargin:E0,rules:null,scheme:null,scrolling:r5,standby:null,summary:null,text:null,topMargin:E0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:T1,disableRemotePlayback:T1,prefix:null,property:null,results:E0,security:null,unselectable:null},space:"html",transform:RF});var yf=x8({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:d4,accentHeight:E0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E0,amplitude:E0,arabicForm:null,ascent:E0,attributeName:null,attributeType:null,azimuth:E0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E0,by:null,calcMode:null,capHeight:E0,className:F5,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:E0,diffuseConstant:E0,direction:null,display:null,dur:null,divisor:E0,dominantBaseline:null,download:T1,dx:null,dy:null,edgeMode:null,editable:null,elevation:E0,enableBackground:null,end:null,event:null,exponent:E0,externalResourcesRequired:null,fill:null,fillOpacity:E0,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:B7,g2:B7,glyphName:B7,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E0,horizOriginX:E0,horizOriginY:E0,id:null,ideographic:E0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E0,k:E0,k1:E0,k2:E0,k3:E0,k4:E0,kernelMatrix:d4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E0,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:E0,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:E0,overlineThickness:E0,paintOrder:null,panose1:null,path:null,pathLength:E0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:F5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E0,pointsAtY:E0,pointsAtZ:E0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:d4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:d4,rev:d4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:d4,requiredFeatures:d4,requiredFonts:d4,requiredFormats:d4,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:E0,specularExponent:E0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E0,strikethroughThickness:E0,string:null,stroke:null,strokeDashArray:d4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E0,strokeOpacity:E0,strokeWidth:null,style:null,surfaceScale:E0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:d4,tabIndex:E0,tableValues:null,target:null,targetX:E0,targetY:E0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:d4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E0,underlineThickness:E0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E0,values:null,vAlphabetic:E0,vMathematical:E0,vectorEffect:null,vHanging:E0,vIdeographic:E0,version:null,vertAdvY:E0,vertOriginX:E0,vertOriginY:E0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:SF});var nL=x8({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 sL=x8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:RF});var tL=x8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var eL={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 h70=/[A-Z]/g,xf=/-[a-z]/g,v70=/^data[-\w.:]+$/i;function $M($,Z){let J=gB(Z),H=Z,Q=u2;if(J in $.normal)return $.property[$.normal[J]];if(J.length>4&&J.slice(0,4)==="data"&&v70.test(Z)){if(Z.charAt(4)==="-"){let B=Z.slice(5).replace(xf,f70);H="data"+B.charAt(0).toUpperCase()+B.slice(1)}else{let B=Z.slice(4);if(!xf.test(B)){let X=B.replace(h70,g70);if(X.charAt(0)!=="-")X="-"+X;Z="data"+X}}Q=aJ}return new Q(H,Z)}function g70($){return"-"+$.toLowerCase()}function f70($){return $.charAt(1).toUpperCase()}var hf=rL([oL,kf,nL,sL,tL],"html"),IF=rL([oL,yf,nL,sL,tL],"svg");function vf($){return $.join(" ").trim()}var Zm=P(sf(),1);var bF=tf("end"),oJ=tf("start");function tf($){return Z;function Z(J){let H=J&&J.position&&J.position[$]||{};if(typeof H.line==="number"&&H.line>0&&typeof H.column==="number"&&H.column>0)return{line:H.line,column:H.column,offset:typeof H.offset==="number"&&H.offset>-1?H.offset:void 0}}}function HM($){let Z=oJ($),J=bF($);if(Z&&J)return{start:Z,end:J}}function X7($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return ef($.position);if("start"in $||"end"in $)return ef($);if("line"in $||"column"in $)return QM($);return""}function QM($){return $m($&&$.line)+":"+$m($&&$.column)}function ef($){return QM($&&$.start)+"-"+QM($&&$.end)}function $m($){return $&&typeof $==="number"?$:1}class K2 extends Error{constructor($,Z,J){super();if(typeof Z==="string")J=Z,Z=void 0;let H="",Q={},B=!1;if(Z)if("line"in Z&&"column"in Z)Q={place:Z};else if("start"in Z&&"end"in Z)Q={place:Z};else if("type"in Z)Q={ancestors:[Z],place:Z.position};else Q={...Z};if(typeof $==="string")H=$;else if(!Q.cause&&$)B=!0,H=$.message,Q.cause=$;if(!Q.ruleId&&!Q.source&&typeof J==="string"){let z=J.indexOf(":");if(z===-1)Q.ruleId=J;else Q.source=J.slice(0,z),Q.ruleId=J.slice(z+1)}if(!Q.place&&Q.ancestors&&Q.ancestors){let z=Q.ancestors[Q.ancestors.length-1];if(z)Q.place=z.position}let X=Q.place&&"start"in Q.place?Q.place.start:Q.place;this.ancestors=Q.ancestors||void 0,this.cause=Q.cause||void 0,this.column=X?X.column:void 0,this.fatal=void 0,this.file="",this.message=H,this.line=X?X.line:void 0,this.name=X7(Q.place)||"1:1",this.place=Q.place||void 0,this.reason=this.message,this.ruleId=Q.ruleId||void 0,this.source=Q.source||void 0,this.stack=B&&Q.cause&&typeof Q.cause.stack==="string"?Q.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K2.prototype.file="";K2.prototype.name="";K2.prototype.reason="";K2.prototype.message="";K2.prototype.stack="";K2.prototype.column=void 0;K2.prototype.line=void 0;K2.prototype.ancestors=void 0;K2.prototype.cause=void 0;K2.prototype.fatal=void 0;K2.prototype.place=void 0;K2.prototype.ruleId=void 0;K2.prototype.source=void 0;var BM={}.hasOwnProperty,Y$0=new Map,F$0=/[A-Z]/g,W$0=new Set(["table","tbody","thead","tfoot","tr"]),q$0=new Set(["td","th"]),Jm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XM($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let J=Z.filePath||void 0,H;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");H=_$0(J,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");H=P$0(J,Z.jsx,Z.jsxs)}let Q={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:H,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:J,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?IF:hf,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},B=Hm(Q,$,void 0);if(B&&typeof B!=="string")return B;return Q.create($,Q.Fragment,{children:B||void 0},void 0)}function Hm($,Z,J){if(Z.type==="element")return N$0($,Z,J);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return V$0($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return D$0($,Z,J);if(Z.type==="mdxjsEsm")return A$0($,Z);if(Z.type==="root")return L$0($,Z,J);if(Z.type==="text")return M$0($,Z)}function N$0($,Z,J){let H=$.schema,Q=H;if(Z.tagName.toLowerCase()==="svg"&&H.space==="html")Q=IF,$.schema=Q;$.ancestors.push(Z);let B=Bm($,Z.tagName,!1),X=j$0($,Z),z=GM($,Z);if(W$0.has(Z.tagName))z=z.filter(function(G){return typeof G==="string"?!iL(G):!0});return Qm($,X,B,Z),zM(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,B,X,J)}function V$0($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let H=Z.data.estree.body[0];return n1(H.type==="ExpressionStatement"),$.evaluater.evaluateExpression(H.expression)}uB($,Z.position)}function A$0($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);uB($,Z.position)}function D$0($,Z,J){let H=$.schema,Q=H;if(Z.name==="svg"&&H.space==="html")Q=IF,$.schema=Q;$.ancestors.push(Z);let B=Z.name===null?$.Fragment:Bm($,Z.name,!0),X=O$0($,Z),z=GM($,Z);return Qm($,X,B,Z),zM(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,B,X,J)}function L$0($,Z,J){let H={};return zM(H,GM($,Z)),$.create(Z,$.Fragment,H,J)}function M$0($,Z){return Z.value}function Qm($,Z,J,H){if(typeof J!=="string"&&J!==$.Fragment&&$.passNode)Z.node=H}function zM($,Z){if(Z.length>0){let J=Z.length>1?Z:Z[0];if(J)$.children=J}}function P$0($,Z,J){return H;function H(Q,B,X,z){let U=Array.isArray(X.children)?J:Z;return z?U(B,X,z):U(B,X)}}function _$0($,Z){return J;function J(H,Q,B,X){let z=Array.isArray(B.children),G=oJ(H);return Z(Q,B,X,z,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function j$0($,Z){let J={},H,Q;for(Q in Z.properties)if(Q!=="children"&&BM.call(Z.properties,Q)){let B=T$0($,Q,Z.properties[Q]);if(B){let[X,z]=B;if($.tableCellAlignToStyle&&X==="align"&&typeof z==="string"&&q$0.has(Z.tagName))H=z;else J[X]=z}}if(H){let B=J.style||(J.style={});B[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=H}return J}function O$0($,Z){let J={};for(let H of Z.attributes)if(H.type==="mdxJsxExpressionAttribute")if(H.data&&H.data.estree&&$.evaluater){let B=H.data.estree.body[0];n1(B.type==="ExpressionStatement");let X=B.expression;n1(X.type==="ObjectExpression");let z=X.properties[0];n1(z.type==="SpreadElement"),Object.assign(J,$.evaluater.evaluateExpression(z.argument))}else uB($,Z.position);else{let Q=H.name,B;if(H.value&&typeof H.value==="object")if(H.value.data&&H.value.data.estree&&$.evaluater){let z=H.value.data.estree.body[0];n1(z.type==="ExpressionStatement"),B=$.evaluater.evaluateExpression(z.expression)}else uB($,Z.position);else B=H.value===null?!0:H.value;J[Q]=B}return J}function GM($,Z){let J=[],H=-1,Q=$.passKeys?new Map:Y$0;while(++H<Z.children.length){let B=Z.children[H],X;if($.passKeys){let G=B.type==="element"?B.tagName:B.type==="mdxJsxFlowElement"||B.type==="mdxJsxTextElement"?B.name:void 0;if(G){let U=Q.get(G)||0;X=G+"-"+U,Q.set(G,U+1)}}let z=Hm($,B,X);if(z!==void 0)J.push(z)}return J}function T$0($,Z,J){let H=$M($.schema,Z);if(J===null||J===void 0||typeof J==="number"&&Number.isNaN(J))return;if(Array.isArray(J))J=H.commaSeparated?Rf(J):vf(J);if(H.property==="style"){let Q=typeof J==="object"?J:C$0($,String(J));if($.stylePropertyNameCase==="css")Q=w$0(Q);return["style",Q]}return[$.elementAttributeNameCase==="react"&&H.space?eL[H.property]||H.property:H.attribute,J]}function C$0($,Z){try{return Zm.default(Z,{reactCompat:!0})}catch(J){if($.ignoreInvalidStyle)return{};let H=J,Q=new K2("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:H,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw Q.file=$.filePath||void 0,Q.url=Jm+"#cannot-parse-style-attribute",Q}}function Bm($,Z,J){let H;if(!J)H={type:"Literal",value:Z};else if(Z.includes(".")){let Q=Z.split("."),B=-1,X;while(++B<Q.length){let z=wF(Q[B])?{type:"Identifier",name:Q[B]}:{type:"Literal",value:Q[B]};X=X?{type:"MemberExpression",object:X,property:z,computed:Boolean(B&&z.type==="Literal"),optional:!1}:z}n1(X,"always a result"),H=X}else H=wF(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(H.type==="Literal"){let Q=H.value;return BM.call($.components,Q)?$.components[Q]:Q}if($.evaluater)return $.evaluater.evaluateExpression(H);uB($)}function uB($,Z){let J=new K2("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw J.file=$.filePath||void 0,J.url=Jm+"#cannot-handle-mdx-estrees-without-createevaluater",J}function w$0($){let Z={},J;for(J in $)if(BM.call($,J))Z[E$0(J)]=$[J];return Z}function E$0($){let Z=$.replace(F$0,S$0);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function S$0($){return"-"+$.toLowerCase()}var pB={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 HH=P(c(),1),Eu=P(m(),1);var R$0={};function v$($,Z){let J=Z||R$0,H=typeof J.includeImageAlt==="boolean"?J.includeImageAlt:!0,Q=typeof J.includeHtml==="boolean"?J.includeHtml:!0;return zm($,H,Q)}function zm($,Z,J){if(I$0($)){if("value"in $)return $.type==="html"&&!J?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return Xm($.children,Z,J)}if(Array.isArray($))return Xm($,Z,J);return""}function Xm($,Z,J){let H=[],Q=-1;while(++Q<$.length)H[Q]=zm($[Q],Z,J);return H.join("")}function I$0($){return Boolean($&&typeof $==="object")}var Gm=document.createElement("i");function nJ($){let Z="&"+$+";";Gm.innerHTML=Z;let J=Gm.textContent;if(J.charCodeAt(J.length-1)===59&&$!=="semi")return!1;return J===Z?!1:J}function Z2($,Z,J,H){let Q=$.length,B=0,X;if(Z<0)Z=-Z>Q?0:Q+Z;else Z=Z>Q?Q:Z;if(J=J>0?J:0,H.length<1e4)X=Array.from(H),X.unshift(Z,J),$.splice(...X);else{if(J)$.splice(Z,J);while(B<H.length)X=H.slice(B,B+1e4),X.unshift(Z,0),$.splice(...X),B+=1e4,Z+=1e4}}function T4($,Z){if($.length>0)return Z2($,$.length,0,Z),$;return Z}var Um={}.hasOwnProperty;function kF($){let Z={},J=-1;while(++J<$.length)b$0(Z,$[J]);return Z}function b$0($,Z){let J;for(J in Z){let Q=(Um.call($,J)?$[J]:void 0)||($[J]={}),B=Z[J],X;if(B)for(X in B){if(!Um.call(Q,X))Q[X]=[];let z=B[X];k$0(Q[X],Array.isArray(z)?z:z?[z]:[])}}}function k$0($,Z){let J=-1,H=[];while(++J<Z.length)(Z[J].add==="after"?$:H).push(Z[J]);Z2($,0,0,H)}function yF($,Z){let J=Number.parseInt($,Z);if(J<9||J===11||J>13&&J<32||J>126&&J<160||J>55295&&J<57344||J>64975&&J<65008||(J&65535)===65535||(J&65535)===65534||J>1114111)return"�";return String.fromCodePoint(J)}function G4($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var V2=z7(/[A-Za-z]/),a5=z7(/[\dA-Za-z]/),Km=z7(/[#-'*+\--9=?A-Z^-~]/);function g$($){return $!==null&&($<32||$===127)}var cB=z7(/\d/),Ym=z7(/[\dA-Fa-f]/),Fm=z7(/[!-/:-@[-`{-~]/);function u0($){return $!==null&&$<-2}function x1($){return $!==null&&($<0||$===32)}function Q1($){return $===-2||$===-1||$===32}var f$=z7(/\p{P}|\p{S}/u),t9=z7(/\s/);function z7($){return Z;function Z(J){return J!==null&&J>-1&&$.test(String.fromCharCode(J))}}function h8($){let Z=[],J=-1,H=0,Q=0;while(++J<$.length){let B=$.charCodeAt(J),X="";if(B===37&&a5($.charCodeAt(J+1))&&a5($.charCodeAt(J+2)))Q=2;else if(B<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(B)))X=String.fromCharCode(B)}else if(B>55295&&B<57344){let z=$.charCodeAt(J+1);if(B<56320&&z>56319&&z<57344)X=String.fromCharCode(B,z),Q=1;else X="�"}else X=String.fromCharCode(B);if(X)Z.push($.slice(H,J),encodeURIComponent(X)),H=J+Q+1,X="";if(Q)J+=Q,Q=0}return Z.join("")+$.slice(H)}function $1($,Z,J,H){let Q=H?H-1:Number.POSITIVE_INFINITY,B=0;return X;function X(G){if(Q1(G))return $.enter(J),z(G);return Z(G)}function z(G){if(Q1(G)&&B++<Q)return $.consume(G),z;return $.exit(J),Z(G)}}var Wm={tokenize:y$0};function y$0($){let Z=$.attempt(this.parser.constructs.contentInitial,H,Q),J;return Z;function H(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),$1($,Z,"linePrefix")}function Q(z){return $.enter("paragraph"),B(z)}function B(z){let G=$.enter("chunkText",{contentType:"text",previous:J});if(J)J.next=G;return J=G,X(z)}function X(z){if(z===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(z);return}if(u0(z))return $.consume(z),$.exit("chunkText"),B;return $.consume(z),X}}var Nm={tokenize:x$0},qm={tokenize:h$0};function x$0($){let Z=this,J=[],H=0,Q,B,X;return z;function z(L){if(H<J.length){let j=J[H];return Z.containerState=j[1],$.attempt(j[0].continuation,G,U)(L)}return U(L)}function G(L){if(H++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,Q)D();let j=Z.events.length,M=j,_;while(M--)if(Z.events[M][0]==="exit"&&Z.events[M][1].type==="chunkFlow"){_=Z.events[M][1].end;break}V(H);let E=j;while(E<Z.events.length)Z.events[E][1].end={..._},E++;return Z2(Z.events,M+1,0,Z.events.slice(j)),Z.events.length=E,U(L)}return z(L)}function U(L){if(H===J.length){if(!Q)return F(L);if(Q.currentConstruct&&Q.currentConstruct.concrete)return q(L);Z.interrupt=Boolean(Q.currentConstruct&&!Q._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(qm,K,Y)(L)}function K(L){if(Q)D();return V(H),F(L)}function Y(L){return Z.parser.lazy[Z.now().line]=H!==J.length,X=Z.now().offset,q(L)}function F(L){return Z.containerState={},$.attempt(qm,W,q)(L)}function W(L){return H++,J.push([Z.currentConstruct,Z.containerState]),F(L)}function q(L){if(L===null){if(Q)D();V(0),$.consume(L);return}return Q=Q||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:Q,contentType:"flow",previous:B}),N(L)}function N(L){if(L===null){A($.exit("chunkFlow"),!0),V(0),$.consume(L);return}if(u0(L))return $.consume(L),A($.exit("chunkFlow")),H=0,Z.interrupt=void 0,z;return $.consume(L),N}function A(L,j){let M=Z.sliceStream(L);if(j)M.push(null);if(L.previous=B,B)B.next=L;if(B=L,Q.defineSkip(L.start),Q.write(M),Z.parser.lazy[L.start.line]){let _=Q.events.length;while(_--)if(Q.events[_][1].start.offset<X&&(!Q.events[_][1].end||Q.events[_][1].end.offset>X))return;let E=Z.events.length,C=E,R,T;while(C--)if(Z.events[C][0]==="exit"&&Z.events[C][1].type==="chunkFlow"){if(R){T=Z.events[C][1].end;break}R=!0}V(H),_=E;while(_<Z.events.length)Z.events[_][1].end={...T},_++;Z2(Z.events,C+1,0,Z.events.slice(E)),Z.events.length=_}}function V(L){let j=J.length;while(j-- >L){let M=J[j];Z.containerState=M[1],M[0].exit.call(Z,$)}J.length=L}function D(){Q.write([null]),B=void 0,Q=void 0,Z.containerState._closeFlow=void 0}}function h$0($,Z,J){return $1($,$.attempt(this.parser.constructs.document,Z,J),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function I3($){if($===null||x1($)||t9($))return 1;if(f$($))return 2}function G7($,Z,J){let H=[],Q=-1;while(++Q<$.length){let B=$[Q].resolveAll;if(B&&!H.includes(B))Z=B(Z,J),H.push(B)}return Z}var dB={name:"attention",resolveAll:v$0,tokenize:g$0};function v$0($,Z){let J=-1,H,Q,B,X,z,G,U,K;while(++J<$.length)if($[J][0]==="enter"&&$[J][1].type==="attentionSequence"&&$[J][1]._close){H=J;while(H--)if($[H][0]==="exit"&&$[H][1].type==="attentionSequence"&&$[H][1]._open&&Z.sliceSerialize($[H][1]).charCodeAt(0)===Z.sliceSerialize($[J][1]).charCodeAt(0)){if(($[H][1]._close||$[J][1]._open)&&($[J][1].end.offset-$[J][1].start.offset)%3&&!(($[H][1].end.offset-$[H][1].start.offset+$[J][1].end.offset-$[J][1].start.offset)%3))continue;G=$[H][1].end.offset-$[H][1].start.offset>1&&$[J][1].end.offset-$[J][1].start.offset>1?2:1;let Y={...$[H][1].end},F={...$[J][1].start};if(Vm(Y,-G),Vm(F,G),X={type:G>1?"strongSequence":"emphasisSequence",start:Y,end:{...$[H][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...$[J][1].start},end:F},B={type:G>1?"strongText":"emphasisText",start:{...$[H][1].end},end:{...$[J][1].start}},Q={type:G>1?"strong":"emphasis",start:{...X.start},end:{...z.end}},$[H][1].end={...X.start},$[J][1].start={...z.end},U=[],$[H][1].end.offset-$[H][1].start.offset)U=T4(U,[["enter",$[H][1],Z],["exit",$[H][1],Z]]);if(U=T4(U,[["enter",Q,Z],["enter",X,Z],["exit",X,Z],["enter",B,Z]]),U=T4(U,G7(Z.parser.constructs.insideSpan.null,$.slice(H+1,J),Z)),U=T4(U,[["exit",B,Z],["enter",z,Z],["exit",z,Z],["exit",Q,Z]]),$[J][1].end.offset-$[J][1].start.offset)K=2,U=T4(U,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);else K=0;Z2($,H-1,J-H+3,U),J=H+U.length-K-2;break}}J=-1;while(++J<$.length)if($[J][1].type==="attentionSequence")$[J][1].type="data";return $}function g$0($,Z){let J=this.parser.constructs.attentionMarkers.null,H=this.previous,Q=I3(H),B;return X;function X(G){return B=G,$.enter("attentionSequence"),z(G)}function z(G){if(G===B)return $.consume(G),z;let U=$.exit("attentionSequence"),K=I3(G),Y=!K||K===2&&Q||J.includes(G),F=!Q||Q===2&&K||J.includes(H);return U._open=Boolean(B===42?Y:Y&&(Q||!F)),U._close=Boolean(B===42?F:F&&(K||!Y)),Z(G)}}function Vm($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var UM={name:"autolink",tokenize:f$0};function f$0($,Z,J){let H=0;return Q;function Q(W){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),B}function B(W){if(V2(W))return $.consume(W),X;if(W===64)return J(W);return U(W)}function X(W){if(W===43||W===45||W===46||a5(W))return H=1,z(W);return U(W)}function z(W){if(W===58)return $.consume(W),H=0,G;if((W===43||W===45||W===46||a5(W))&&H++<32)return $.consume(W),z;return H=0,U(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||g$(W))return J(W);return $.consume(W),G}function U(W){if(W===64)return $.consume(W),K;if(Km(W))return $.consume(W),U;return J(W)}function K(W){return a5(W)?Y(W):J(W)}function Y(W){if(W===46)return $.consume(W),H=0,K;if(W===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;return F(W)}function F(W){if((W===45||a5(W))&&H++<63){let q=W===45?F:Y;return $.consume(W),q}return J(W)}}var e9={partial:!0,tokenize:m$0};function m$0($,Z,J){return H;function H(B){return Q1(B)?$1($,Q,"linePrefix")(B):Q(B)}function Q(B){return B===null||u0(B)?Z(B):J(B)}}var xF={continuation:{tokenize:p$0},exit:c$0,name:"blockQuote",tokenize:u$0};function u$0($,Z,J){let H=this;return Q;function Q(X){if(X===62){let z=H.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(X),$.exit("blockQuoteMarker"),B}return J(X)}function B(X){if(Q1(X))return $.enter("blockQuotePrefixWhitespace"),$.consume(X),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(X)}}function p$0($,Z,J){let H=this;return Q;function Q(X){if(Q1(X))return $1($,B,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X);return B(X)}function B(X){return $.attempt(xF,Z,J)(X)}}function c$0($){$.exit("blockQuote")}var hF={name:"characterEscape",tokenize:d$0};function d$0($,Z,J){return H;function H(B){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(B),$.exit("escapeMarker"),Q}function Q(B){if(Fm(B))return $.enter("characterEscapeValue"),$.consume(B),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return J(B)}}var vF={name:"characterReference",tokenize:l$0};function l$0($,Z,J){let H=this,Q=0,B,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"),U;return $.enter("characterReferenceValue"),B=31,X=a5,K(Y)}function U(Y){if(Y===88||Y===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(Y),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),B=6,X=Ym,K;return $.enter("characterReferenceValue"),B=7,X=cB,K(Y)}function K(Y){if(Y===59&&Q){let F=$.exit("characterReferenceValue");if(X===a5&&!nJ(H.sliceSerialize(F)))return J(Y);return $.enter("characterReferenceMarker"),$.consume(Y),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(X(Y)&&Q++<B)return $.consume(Y),K;return J(Y)}}var Am={partial:!0,tokenize:r$0},gF={concrete:!0,name:"codeFenced",tokenize:i$0};function i$0($,Z,J){let H=this,Q={partial:!0,tokenize:M},B=0,X=0,z;return G;function G(_){return U(_)}function U(_){let E=H.events[H.events.length-1];return B=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,z=_,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),K(_)}function K(_){if(_===z)return X++,$.consume(_),K;if(X<3)return J(_);return $.exit("codeFencedFenceSequence"),Q1(_)?$1($,Y,"whitespace")(_):Y(_)}function Y(_){if(_===null||u0(_))return $.exit("codeFencedFence"),H.interrupt?Z(_):$.check(Am,N,j)(_);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),F(_)}function F(_){if(_===null||u0(_))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),Y(_);if(Q1(_))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),$1($,W,"whitespace")(_);if(_===96&&_===z)return J(_);return $.consume(_),F}function W(_){if(_===null||u0(_))return Y(_);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),q(_)}function q(_){if(_===null||u0(_))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),Y(_);if(_===96&&_===z)return J(_);return $.consume(_),q}function N(_){return $.attempt(Q,j,A)(_)}function A(_){return $.enter("lineEnding"),$.consume(_),$.exit("lineEnding"),V}function V(_){return B>0&&Q1(_)?$1($,D,"linePrefix",B+1)(_):D(_)}function D(_){if(_===null||u0(_))return $.check(Am,N,j)(_);return $.enter("codeFlowValue"),L(_)}function L(_){if(_===null||u0(_))return $.exit("codeFlowValue"),D(_);return $.consume(_),L}function j(_){return $.exit("codeFenced"),Z(_)}function M(_,E,C){let R=0;return T;function T(k){return _.enter("lineEnding"),_.consume(k),_.exit("lineEnding"),I}function I(k){return _.enter("codeFencedFence"),Q1(k)?$1(_,y,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):y(k)}function y(k){if(k===z)return _.enter("codeFencedFenceSequence"),S(k);return C(k)}function S(k){if(k===z)return R++,_.consume(k),S;if(R>=X)return _.exit("codeFencedFenceSequence"),Q1(k)?$1(_,O,"whitespace")(k):O(k);return C(k)}function O(k){if(k===null||u0(k))return _.exit("codeFencedFence"),E(k);return C(k)}}}function r$0($,Z,J){let H=this;return Q;function Q(X){if(X===null)return J(X);return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),B}function B(X){return H.parser.lazy[H.now().line]?J(X):Z(X)}}var lB={name:"codeIndented",tokenize:o$0},a$0={partial:!0,tokenize:n$0};function o$0($,Z,J){let H=this;return Q;function Q(U){return $.enter("codeIndented"),$1($,B,"linePrefix",5)(U)}function B(U){let K=H.events[H.events.length-1];return K&&K[1].type==="linePrefix"&&K[2].sliceSerialize(K[1],!0).length>=4?X(U):J(U)}function X(U){if(U===null)return G(U);if(u0(U))return $.attempt(a$0,X,G)(U);return $.enter("codeFlowValue"),z(U)}function z(U){if(U===null||u0(U))return $.exit("codeFlowValue"),X(U);return $.consume(U),z}function G(U){return $.exit("codeIndented"),Z(U)}}function n$0($,Z,J){let H=this;return Q;function Q(X){if(H.parser.lazy[H.now().line])return J(X);if(u0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q;return $1($,B,"linePrefix",5)(X)}function B(X){let z=H.events[H.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?Z(X):u0(X)?Q(X):J(X)}}var KM={name:"codeText",previous:t$0,resolve:s$0,tokenize:e$0};function s$0($){let Z=$.length-4,J=3,H,Q;if(($[J][1].type==="lineEnding"||$[J][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){H=J;while(++H<Z)if($[H][1].type==="codeTextData"){$[J][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",J+=2,Z-=2;break}}H=J-1,Z++;while(++H<=Z)if(Q===void 0){if(H!==Z&&$[H][1].type!=="lineEnding")Q=H}else if(H===Z||$[H][1].type==="lineEnding"){if($[Q][1].type="codeTextData",H!==Q+2)$[Q][1].end=$[H-1][1].end,$.splice(Q+2,H-Q-2),Z-=H-Q-2,H=Q+2;Q=void 0}return $}function t$0($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function e$0($,Z,J){let H=this,Q=0,B,X;return z;function z(F){return $.enter("codeText"),$.enter("codeTextSequence"),G(F)}function G(F){if(F===96)return $.consume(F),Q++,G;return $.exit("codeTextSequence"),U(F)}function U(F){if(F===null)return J(F);if(F===32)return $.enter("space"),$.consume(F),$.exit("space"),U;if(F===96)return X=$.enter("codeTextSequence"),B=0,Y(F);if(u0(F))return $.enter("lineEnding"),$.consume(F),$.exit("lineEnding"),U;return $.enter("codeTextData"),K(F)}function K(F){if(F===null||F===32||F===96||u0(F))return $.exit("codeTextData"),U(F);return $.consume(F),K}function Y(F){if(F===96)return $.consume(F),B++,Y;if(B===Q)return $.exit("codeTextSequence"),$.exit("codeText"),Z(F);return X.type="codeTextData",K(F)}}class YM{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 J=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(J<this.left.length)return this.left.slice($,J);if($>this.left.length)return this.right.slice(this.right.length-J+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-J+this.left.length).reverse())}splice($,Z,J){let H=Z||0;this.setCursor(Math.trunc($));let Q=this.right.splice(this.right.length-H,Number.POSITIVE_INFINITY);if(J)iB(this.left,J);return Q.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),iB(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),iB(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);iB(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);iB(this.left,Z.reverse())}}}function iB($,Z){let J=0;if(Z.length<1e4)$.push(...Z);else while(J<Z.length)$.push(...Z.slice(J,J+1e4)),J+=1e4}function fF($){let Z={},J=-1,H,Q,B,X,z,G,U,K=new YM($);while(++J<K.length){while(J in Z)J=Z[J];if(H=K.get(J),J&&H[1].type==="chunkFlow"&&K.get(J-1)[1].type==="listItemPrefix"){if(G=H[1]._tokenizer.events,B=0,B<G.length&&G[B][1].type==="lineEndingBlank")B+=2;if(B<G.length&&G[B][1].type==="content")while(++B<G.length){if(G[B][1].type==="content")break;if(G[B][1].type==="chunkText")G[B][1]._isInFirstContentOfListItem=!0,B++}}if(H[0]==="enter"){if(H[1].contentType)Object.assign(Z,$Z0(K,J)),J=Z[J],U=!0}else if(H[1]._container){B=J,Q=void 0;while(B--)if(X=K.get(B),X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="enter"){if(Q)K.get(Q)[1].type="lineEndingBlank";X[1].type="lineEnding",Q=B}}else if(X[1].type==="linePrefix"||X[1].type==="listItemIndent");else break;if(Q)H[1].end={...K.get(Q)[1].start},z=K.slice(Q,J),z.unshift(H),K.splice(Q,J-Q+1,z)}}return Z2($,0,Number.POSITIVE_INFINITY,K.slice(0)),!U}function $Z0($,Z){let J=$.get(Z)[1],H=$.get(Z)[2],Q=Z-1,B=[],X=J._tokenizer;if(!X){if(X=H.parser[J.contentType](J.start),J._contentTypeTextTrailing)X._contentTypeTextTrailing=!0}let z=X.events,G=[],U={},K,Y,F=-1,W=J,q=0,N=0,A=[N];while(W){while($.get(++Q)[1]!==W);if(B.push(Q),!W._tokenizer){if(K=H.sliceStream(W),!W.next)K.push(null);if(Y)X.defineSkip(W.start);if(W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=!0;if(X.write(K),W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=void 0}Y=W,W=W.next}W=J;while(++F<z.length)if(z[F][0]==="exit"&&z[F-1][0]==="enter"&&z[F][1].type===z[F-1][1].type&&z[F][1].start.line!==z[F][1].end.line)N=F+1,A.push(N),W._tokenizer=void 0,W.previous=void 0,W=W.next;if(X.events=[],W)W._tokenizer=void 0,W.previous=void 0;else A.pop();F=A.length;while(F--){let V=z.slice(A[F],A[F+1]),D=B.pop();G.push([D,D+V.length-1]),$.splice(D,2,V)}G.reverse(),F=-1;while(++F<G.length)U[q+G[F][0]]=q+G[F][1],q+=G[F][1]-G[F][0]-1;return U}var FM={resolve:JZ0,tokenize:HZ0},ZZ0={partial:!0,tokenize:QZ0};function JZ0($){return fF($),$}function HZ0($,Z){let J;return H;function H(z){return $.enter("content"),J=$.enter("chunkContent",{contentType:"content"}),Q(z)}function Q(z){if(z===null)return B(z);if(u0(z))return $.check(ZZ0,X,B)(z);return $.consume(z),Q}function B(z){return $.exit("chunkContent"),$.exit("content"),Z(z)}function X(z){return $.consume(z),$.exit("chunkContent"),J.next=$.enter("chunkContent",{contentType:"content",previous:J}),J=J.next,Q}}function QZ0($,Z,J){let H=this;return Q;function Q(X){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),$1($,B,"linePrefix")}function B(X){if(X===null||u0(X))return J(X);let z=H.events[H.events.length-1];if(!H.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return Z(X);return $.interrupt(H.parser.constructs.flow,J,Z)(X)}}function mF($,Z,J,H,Q,B,X,z,G){let U=G||Number.POSITIVE_INFINITY,K=0;return Y;function Y(V){if(V===60)return $.enter(H),$.enter(Q),$.enter(B),$.consume(V),$.exit(B),F;if(V===null||V===32||V===41||g$(V))return J(V);return $.enter(H),$.enter(X),$.enter(z),$.enter("chunkString",{contentType:"string"}),N(V)}function F(V){if(V===62)return $.enter(B),$.consume(V),$.exit(B),$.exit(Q),$.exit(H),Z;return $.enter(z),$.enter("chunkString",{contentType:"string"}),W(V)}function W(V){if(V===62)return $.exit("chunkString"),$.exit(z),F(V);if(V===null||V===60||u0(V))return J(V);return $.consume(V),V===92?q:W}function q(V){if(V===60||V===62||V===92)return $.consume(V),W;return W(V)}function N(V){if(!K&&(V===null||V===41||x1(V)))return $.exit("chunkString"),$.exit(z),$.exit(X),$.exit(H),Z(V);if(K<U&&V===40)return $.consume(V),K++,N;if(V===41)return $.consume(V),K--,N;if(V===null||V===32||V===40||g$(V))return J(V);return $.consume(V),V===92?A:N}function A(V){if(V===40||V===41||V===92)return $.consume(V),N;return N(V)}}function uF($,Z,J,H,Q,B){let X=this,z=0,G;return U;function U(W){return $.enter(H),$.enter(Q),$.consume(W),$.exit(Q),$.enter(B),K}function K(W){if(z>999||W===null||W===91||W===93&&!G||W===94&&!z&&"_hiddenFootnoteSupport"in X.parser.constructs)return J(W);if(W===93)return $.exit(B),$.enter(Q),$.consume(W),$.exit(Q),$.exit(H),Z;if(u0(W))return $.enter("lineEnding"),$.consume(W),$.exit("lineEnding"),K;return $.enter("chunkString",{contentType:"string"}),Y(W)}function Y(W){if(W===null||W===91||W===93||u0(W)||z++>999)return $.exit("chunkString"),K(W);if($.consume(W),!G)G=!Q1(W);return W===92?F:Y}function F(W){if(W===91||W===92||W===93)return $.consume(W),z++,Y;return Y(W)}}function pF($,Z,J,H,Q,B){let X;return z;function z(F){if(F===34||F===39||F===40)return $.enter(H),$.enter(Q),$.consume(F),$.exit(Q),X=F===40?41:F,G;return J(F)}function G(F){if(F===X)return $.enter(Q),$.consume(F),$.exit(Q),$.exit(H),Z;return $.enter(B),U(F)}function U(F){if(F===X)return $.exit(B),G(X);if(F===null)return J(F);if(u0(F))return $.enter("lineEnding"),$.consume(F),$.exit("lineEnding"),$1($,U,"linePrefix");return $.enter("chunkString",{contentType:"string"}),K(F)}function K(F){if(F===X||F===null||u0(F))return $.exit("chunkString"),U(F);return $.consume(F),F===92?Y:K}function Y(F){if(F===X||F===92)return $.consume(F),K;return K(F)}}function m$($,Z){let J;return H;function H(Q){if(u0(Q))return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),J=!0,H;if(Q1(Q))return $1($,H,J?"linePrefix":"lineSuffix")(Q);return Z(Q)}}var WM={name:"definition",tokenize:XZ0},BZ0={partial:!0,tokenize:zZ0};function XZ0($,Z,J){let H=this,Q;return B;function B(W){return $.enter("definition"),X(W)}function X(W){return uF.call(H,$,z,J,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function z(W){if(Q=G4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)),W===58)return $.enter("definitionMarker"),$.consume(W),$.exit("definitionMarker"),G;return J(W)}function G(W){return x1(W)?m$($,U)(W):U(W)}function U(W){return mF($,K,J,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function K(W){return $.attempt(BZ0,Y,Y)(W)}function Y(W){return Q1(W)?$1($,F,"whitespace")(W):F(W)}function F(W){if(W===null||u0(W))return $.exit("definition"),H.parser.defined.push(Q),Z(W);return J(W)}}function zZ0($,Z,J){return H;function H(z){return x1(z)?m$($,Q)(z):J(z)}function Q(z){return pF($,B,J,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function B(z){return Q1(z)?$1($,X,"whitespace")(z):X(z)}function X(z){return z===null||u0(z)?Z(z):J(z)}}var qM={name:"hardBreakEscape",tokenize:GZ0};function GZ0($,Z,J){return H;function H(B){return $.enter("hardBreakEscape"),$.consume(B),Q}function Q(B){if(u0(B))return $.exit("hardBreakEscape"),Z(B);return J(B)}}var NM={name:"headingAtx",resolve:UZ0,tokenize:KZ0};function UZ0($,Z){let J=$.length-2,H=3,Q,B;if($[H][1].type==="whitespace")H+=2;if(J-2>H&&$[J][1].type==="whitespace")J-=2;if($[J][1].type==="atxHeadingSequence"&&(H===J-1||J-4>H&&$[J-2][1].type==="whitespace"))J-=H+1===J?2:4;if(J>H)Q={type:"atxHeadingText",start:$[H][1].start,end:$[J][1].end},B={type:"chunkText",start:$[H][1].start,end:$[J][1].end,contentType:"text"},Z2($,H,J-H+1,[["enter",Q,Z],["enter",B,Z],["exit",B,Z],["exit",Q,Z]]);return $}function KZ0($,Z,J){let H=0;return Q;function Q(K){return $.enter("atxHeading"),B(K)}function B(K){return $.enter("atxHeadingSequence"),X(K)}function X(K){if(K===35&&H++<6)return $.consume(K),X;if(K===null||x1(K))return $.exit("atxHeadingSequence"),z(K);return J(K)}function z(K){if(K===35)return $.enter("atxHeadingSequence"),G(K);if(K===null||u0(K))return $.exit("atxHeading"),Z(K);if(Q1(K))return $1($,z,"whitespace")(K);return $.enter("atxHeadingText"),U(K)}function G(K){if(K===35)return $.consume(K),G;return $.exit("atxHeadingSequence"),z(K)}function U(K){if(K===null||K===35||x1(K))return $.exit("atxHeadingText"),z(K);return $.consume(K),U}}var Dm=["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"],VM=["pre","script","style","textarea"];var AM={concrete:!0,name:"htmlFlow",resolveTo:WZ0,tokenize:qZ0},YZ0={partial:!0,tokenize:VZ0},FZ0={partial:!0,tokenize:NZ0};function WZ0($){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 qZ0($,Z,J){let H=this,Q,B,X,z,G;return U;function U(x){return K(x)}function K(x){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(x),Y}function Y(x){if(x===33)return $.consume(x),F;if(x===47)return $.consume(x),B=!0,N;if(x===63)return $.consume(x),Q=3,H.interrupt?Z:w;if(V2(x))return $.consume(x),X=String.fromCharCode(x),A;return J(x)}function F(x){if(x===45)return $.consume(x),Q=2,W;if(x===91)return $.consume(x),Q=5,z=0,q;if(V2(x))return $.consume(x),Q=4,H.interrupt?Z:w;return J(x)}function W(x){if(x===45)return $.consume(x),H.interrupt?Z:w;return J(x)}function q(x){if(x==="CDATA[".charCodeAt(z++)){if($.consume(x),z===6)return H.interrupt?Z:y;return q}return J(x)}function N(x){if(V2(x))return $.consume(x),X=String.fromCharCode(x),A;return J(x)}function A(x){if(x===null||x===47||x===62||x1(x)){let l=x===47,s=X.toLowerCase();if(!l&&!B&&VM.includes(s))return Q=1,H.interrupt?Z(x):y(x);if(Dm.includes(X.toLowerCase())){if(Q=6,l)return $.consume(x),V;return H.interrupt?Z(x):y(x)}return Q=7,H.interrupt&&!H.parser.lazy[H.now().line]?J(x):B?D(x):L(x)}if(x===45||a5(x))return $.consume(x),X+=String.fromCharCode(x),A;return J(x)}function V(x){if(x===62)return $.consume(x),H.interrupt?Z:y;return J(x)}function D(x){if(Q1(x))return $.consume(x),D;return T(x)}function L(x){if(x===47)return $.consume(x),T;if(x===58||x===95||V2(x))return $.consume(x),j;if(Q1(x))return $.consume(x),L;return T(x)}function j(x){if(x===45||x===46||x===58||x===95||a5(x))return $.consume(x),j;return M(x)}function M(x){if(x===61)return $.consume(x),_;if(Q1(x))return $.consume(x),M;return L(x)}function _(x){if(x===null||x===60||x===61||x===62||x===96)return J(x);if(x===34||x===39)return $.consume(x),G=x,E;if(Q1(x))return $.consume(x),_;return C(x)}function E(x){if(x===G)return $.consume(x),G=null,R;if(x===null||u0(x))return J(x);return $.consume(x),E}function C(x){if(x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||x1(x))return M(x);return $.consume(x),C}function R(x){if(x===47||x===62||Q1(x))return L(x);return J(x)}function T(x){if(x===62)return $.consume(x),I;return J(x)}function I(x){if(x===null||u0(x))return y(x);if(Q1(x))return $.consume(x),I;return J(x)}function y(x){if(x===45&&Q===2)return $.consume(x),b;if(x===60&&Q===1)return $.consume(x),h;if(x===62&&Q===4)return $.consume(x),i;if(x===63&&Q===3)return $.consume(x),w;if(x===93&&Q===5)return $.consume(x),f;if(u0(x)&&(Q===6||Q===7))return $.exit("htmlFlowData"),$.check(YZ0,r,S)(x);if(x===null||u0(x))return $.exit("htmlFlowData"),S(x);return $.consume(x),y}function S(x){return $.check(FZ0,O,r)(x)}function O(x){return $.enter("lineEnding"),$.consume(x),$.exit("lineEnding"),k}function k(x){if(x===null||u0(x))return S(x);return $.enter("htmlFlowData"),y(x)}function b(x){if(x===45)return $.consume(x),w;return y(x)}function h(x){if(x===47)return $.consume(x),X="",v;return y(x)}function v(x){if(x===62){let l=X.toLowerCase();if(VM.includes(l))return $.consume(x),i;return y(x)}if(V2(x)&&X.length<8)return $.consume(x),X+=String.fromCharCode(x),v;return y(x)}function f(x){if(x===93)return $.consume(x),w;return y(x)}function w(x){if(x===62)return $.consume(x),i;if(x===45&&Q===2)return $.consume(x),w;return y(x)}function i(x){if(x===null||u0(x))return $.exit("htmlFlowData"),r(x);return $.consume(x),i}function r(x){return $.exit("htmlFlow"),Z(x)}}function NZ0($,Z,J){let H=this;return Q;function Q(X){if(u0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),B;return J(X)}function B(X){return H.parser.lazy[H.now().line]?J(X):Z(X)}}function VZ0($,Z,J){return H;function H(Q){return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),$.attempt(e9,Z,J)}}var DM={name:"htmlText",tokenize:AZ0};function AZ0($,Z,J){let H=this,Q,B,X;return z;function z(w){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(w),G}function G(w){if(w===33)return $.consume(w),U;if(w===47)return $.consume(w),M;if(w===63)return $.consume(w),L;if(V2(w))return $.consume(w),C;return J(w)}function U(w){if(w===45)return $.consume(w),K;if(w===91)return $.consume(w),B=0,q;if(V2(w))return $.consume(w),D;return J(w)}function K(w){if(w===45)return $.consume(w),W;return J(w)}function Y(w){if(w===null)return J(w);if(w===45)return $.consume(w),F;if(u0(w))return X=Y,h(w);return $.consume(w),Y}function F(w){if(w===45)return $.consume(w),W;return Y(w)}function W(w){return w===62?b(w):w===45?F(w):Y(w)}function q(w){if(w==="CDATA[".charCodeAt(B++))return $.consume(w),B===6?N:q;return J(w)}function N(w){if(w===null)return J(w);if(w===93)return $.consume(w),A;if(u0(w))return X=N,h(w);return $.consume(w),N}function A(w){if(w===93)return $.consume(w),V;return N(w)}function V(w){if(w===62)return b(w);if(w===93)return $.consume(w),V;return N(w)}function D(w){if(w===null||w===62)return b(w);if(u0(w))return X=D,h(w);return $.consume(w),D}function L(w){if(w===null)return J(w);if(w===63)return $.consume(w),j;if(u0(w))return X=L,h(w);return $.consume(w),L}function j(w){return w===62?b(w):L(w)}function M(w){if(V2(w))return $.consume(w),_;return J(w)}function _(w){if(w===45||a5(w))return $.consume(w),_;return E(w)}function E(w){if(u0(w))return X=E,h(w);if(Q1(w))return $.consume(w),E;return b(w)}function C(w){if(w===45||a5(w))return $.consume(w),C;if(w===47||w===62||x1(w))return R(w);return J(w)}function R(w){if(w===47)return $.consume(w),b;if(w===58||w===95||V2(w))return $.consume(w),T;if(u0(w))return X=R,h(w);if(Q1(w))return $.consume(w),R;return b(w)}function T(w){if(w===45||w===46||w===58||w===95||a5(w))return $.consume(w),T;return I(w)}function I(w){if(w===61)return $.consume(w),y;if(u0(w))return X=I,h(w);if(Q1(w))return $.consume(w),I;return R(w)}function y(w){if(w===null||w===60||w===61||w===62||w===96)return J(w);if(w===34||w===39)return $.consume(w),Q=w,S;if(u0(w))return X=y,h(w);if(Q1(w))return $.consume(w),y;return $.consume(w),O}function S(w){if(w===Q)return $.consume(w),Q=void 0,k;if(w===null)return J(w);if(u0(w))return X=S,h(w);return $.consume(w),S}function O(w){if(w===null||w===34||w===39||w===60||w===61||w===96)return J(w);if(w===47||w===62||x1(w))return R(w);return $.consume(w),O}function k(w){if(w===47||w===62||x1(w))return R(w);return J(w)}function b(w){if(w===62)return $.consume(w),$.exit("htmlTextData"),$.exit("htmlText"),Z;return J(w)}function h(w){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(w),$.exit("lineEnding"),v}function v(w){return Q1(w)?$1($,f,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):f(w)}function f(w){return $.enter("htmlTextData"),X(w)}}var u$={name:"labelEnd",resolveAll:PZ0,resolveTo:_Z0,tokenize:jZ0},DZ0={tokenize:OZ0},LZ0={tokenize:TZ0},MZ0={tokenize:CZ0};function PZ0($){let Z=-1,J=[];while(++Z<$.length){let H=$[Z][1];if(J.push($[Z]),H.type==="labelImage"||H.type==="labelLink"||H.type==="labelEnd"){let Q=H.type==="labelImage"?4:2;H.type="data",Z+=Q}}if($.length!==J.length)Z2($,0,$.length,J);return $}function _Z0($,Z){let J=$.length,H=0,Q,B,X,z;while(J--)if(Q=$[J][1],B){if(Q.type==="link"||Q.type==="labelLink"&&Q._inactive)break;if($[J][0]==="enter"&&Q.type==="labelLink")Q._inactive=!0}else if(X){if($[J][0]==="enter"&&(Q.type==="labelImage"||Q.type==="labelLink")&&!Q._balanced){if(B=J,Q.type!=="labelLink"){H=2;break}}}else if(Q.type==="labelEnd")X=J;let G={type:$[B][1].type==="labelLink"?"link":"image",start:{...$[B][1].start},end:{...$[$.length-1][1].end}},U={type:"label",start:{...$[B][1].start},end:{...$[X][1].end}},K={type:"labelText",start:{...$[B+H+2][1].end},end:{...$[X-2][1].start}};return z=[["enter",G,Z],["enter",U,Z]],z=T4(z,$.slice(B+1,B+H+3)),z=T4(z,[["enter",K,Z]]),z=T4(z,G7(Z.parser.constructs.insideSpan.null,$.slice(B+H+4,X-3),Z)),z=T4(z,[["exit",K,Z],$[X-2],$[X-1],["exit",U,Z]]),z=T4(z,$.slice(X+1)),z=T4(z,[["exit",G,Z]]),Z2($,B,$.length,z),$}function jZ0($,Z,J){let H=this,Q=H.events.length,B,X;while(Q--)if((H.events[Q][1].type==="labelImage"||H.events[Q][1].type==="labelLink")&&!H.events[Q][1]._balanced){B=H.events[Q][1];break}return z;function z(F){if(!B)return J(F);if(B._inactive)return Y(F);return X=H.parser.defined.includes(G4(H.sliceSerialize({start:B.end,end:H.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(F),$.exit("labelMarker"),$.exit("labelEnd"),G}function G(F){if(F===40)return $.attempt(DZ0,K,X?K:Y)(F);if(F===91)return $.attempt(LZ0,K,X?U:Y)(F);return X?K(F):Y(F)}function U(F){return $.attempt(MZ0,K,Y)(F)}function K(F){return Z(F)}function Y(F){return B._balanced=!0,J(F)}}function OZ0($,Z,J){return H;function H(Y){return $.enter("resource"),$.enter("resourceMarker"),$.consume(Y),$.exit("resourceMarker"),Q}function Q(Y){return x1(Y)?m$($,B)(Y):B(Y)}function B(Y){if(Y===41)return K(Y);return mF($,X,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(Y)}function X(Y){return x1(Y)?m$($,G)(Y):K(Y)}function z(Y){return J(Y)}function G(Y){if(Y===34||Y===39||Y===40)return pF($,U,J,"resourceTitle","resourceTitleMarker","resourceTitleString")(Y);return K(Y)}function U(Y){return x1(Y)?m$($,K)(Y):K(Y)}function K(Y){if(Y===41)return $.enter("resourceMarker"),$.consume(Y),$.exit("resourceMarker"),$.exit("resource"),Z;return J(Y)}}function TZ0($,Z,J){let H=this;return Q;function Q(z){return uF.call(H,$,B,X,"reference","referenceMarker","referenceString")(z)}function B(z){return H.parser.defined.includes(G4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)))?Z(z):J(z)}function X(z){return J(z)}}function CZ0($,Z,J){return H;function H(B){return $.enter("reference"),$.enter("referenceMarker"),$.consume(B),$.exit("referenceMarker"),Q}function Q(B){if(B===93)return $.enter("referenceMarker"),$.consume(B),$.exit("referenceMarker"),$.exit("reference"),Z;return J(B)}}var LM={name:"labelStartImage",resolveAll:u$.resolveAll,tokenize:wZ0};function wZ0($,Z,J){let H=this;return Q;function Q(z){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(z),$.exit("labelImageMarker"),B}function B(z){if(z===91)return $.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelImage"),X;return J(z)}function X(z){return z===94&&"_hiddenFootnoteSupport"in H.parser.constructs?J(z):Z(z)}}var MM={name:"labelStartLink",resolveAll:u$.resolveAll,tokenize:EZ0};function EZ0($,Z,J){let H=this;return Q;function Q(X){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(X),$.exit("labelMarker"),$.exit("labelLink"),B}function B(X){return X===94&&"_hiddenFootnoteSupport"in H.parser.constructs?J(X):Z(X)}}var rB={name:"lineEnding",tokenize:SZ0};function SZ0($,Z){return J;function J(H){return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),$1($,Z,"linePrefix")}}var p$={name:"thematicBreak",tokenize:RZ0};function RZ0($,Z,J){let H=0,Q;return B;function B(U){return $.enter("thematicBreak"),X(U)}function X(U){return Q=U,z(U)}function z(U){if(U===Q)return $.enter("thematicBreakSequence"),G(U);if(H>=3&&(U===null||u0(U)))return $.exit("thematicBreak"),Z(U);return J(U)}function G(U){if(U===Q)return $.consume(U),H++,G;return $.exit("thematicBreakSequence"),Q1(U)?$1($,z,"whitespace")(U):z(U)}}var U4={continuation:{tokenize:yZ0},exit:hZ0,name:"list",tokenize:kZ0},IZ0={partial:!0,tokenize:vZ0},bZ0={partial:!0,tokenize:xZ0};function kZ0($,Z,J){let H=this,Q=H.events[H.events.length-1],B=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[1],!0).length:0,X=0;return z;function z(W){let q=H.containerState.type||(W===42||W===43||W===45?"listUnordered":"listOrdered");if(q==="listUnordered"?!H.containerState.marker||W===H.containerState.marker:cB(W)){if(!H.containerState.type)H.containerState.type=q,$.enter(q,{_container:!0});if(q==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(p$,J,U)(W):U(W);if(!H.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return J(W)}function G(W){if(cB(W)&&++X<10)return $.consume(W),G;if((!H.interrupt||X<2)&&(H.containerState.marker?W===H.containerState.marker:W===41||W===46))return $.exit("listItemValue"),U(W);return J(W)}function U(W){return $.enter("listItemMarker"),$.consume(W),$.exit("listItemMarker"),H.containerState.marker=H.containerState.marker||W,$.check(e9,H.interrupt?J:K,$.attempt(IZ0,F,Y))}function K(W){return H.containerState.initialBlankLine=!0,B++,F(W)}function Y(W){if(Q1(W))return $.enter("listItemPrefixWhitespace"),$.consume(W),$.exit("listItemPrefixWhitespace"),F;return J(W)}function F(W){return H.containerState.size=B+H.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(W)}}function yZ0($,Z,J){let H=this;return H.containerState._closeFlow=void 0,$.check(e9,Q,B);function Q(z){return H.containerState.furtherBlankLines=H.containerState.furtherBlankLines||H.containerState.initialBlankLine,$1($,Z,"listItemIndent",H.containerState.size+1)(z)}function B(z){if(H.containerState.furtherBlankLines||!Q1(z))return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,X(z);return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,$.attempt(bZ0,Z,X)(z)}function X(z){return H.containerState._closeFlow=!0,H.interrupt=void 0,$1($,$.attempt(U4,Z,J),"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function xZ0($,Z,J){let H=this;return $1($,Q,"listItemIndent",H.containerState.size+1);function Q(B){let X=H.events[H.events.length-1];return X&&X[1].type==="listItemIndent"&&X[2].sliceSerialize(X[1],!0).length===H.containerState.size?Z(B):J(B)}}function hZ0($){$.exit(this.containerState.type)}function vZ0($,Z,J){let H=this;return $1($,Q,"listItemPrefixWhitespace",H.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function Q(B){let X=H.events[H.events.length-1];return!Q1(B)&&X&&X[1].type==="listItemPrefixWhitespace"?Z(B):J(B)}}var cF={name:"setextUnderline",resolveTo:gZ0,tokenize:fZ0};function gZ0($,Z){let J=$.length,H,Q,B;while(J--)if($[J][0]==="enter"){if($[J][1].type==="content"){H=J;break}if($[J][1].type==="paragraph")Q=J}else{if($[J][1].type==="content")$.splice(J,1);if(!B&&$[J][1].type==="definition")B=J}let X={type:"setextHeading",start:{...$[H][1].start},end:{...$[$.length-1][1].end}};if($[Q][1].type="setextHeadingText",B)$.splice(Q,0,["enter",X,Z]),$.splice(B+1,0,["exit",$[H][1],Z]),$[H][1].end={...$[B][1].end};else $[H][1]=X;return $.push(["exit",X,Z]),$}function fZ0($,Z,J){let H=this,Q;return B;function B(U){let K=H.events.length,Y;while(K--)if(H.events[K][1].type!=="lineEnding"&&H.events[K][1].type!=="linePrefix"&&H.events[K][1].type!=="content"){Y=H.events[K][1].type==="paragraph";break}if(!H.parser.lazy[H.now().line]&&(H.interrupt||Y))return $.enter("setextHeadingLine"),Q=U,X(U);return J(U)}function X(U){return $.enter("setextHeadingLineSequence"),z(U)}function z(U){if(U===Q)return $.consume(U),z;return $.exit("setextHeadingLineSequence"),Q1(U)?$1($,G,"lineSuffix")(U):G(U)}function G(U){if(U===null||u0(U))return $.exit("setextHeadingLine"),Z(U);return J(U)}}var Lm={tokenize:mZ0};function mZ0($){let Z=this,J=$.attempt(e9,H,$.attempt(this.parser.constructs.flowInitial,Q,$1($,$.attempt(this.parser.constructs.flow,Q,$.attempt(FM,Q)),"linePrefix")));return J;function H(B){if(B===null){$.consume(B);return}return $.enter("lineEndingBlank"),$.consume(B),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,J}function Q(B){if(B===null){$.consume(B);return}return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),Z.currentConstruct=void 0,J}}var Mm={resolveAll:Om()},Pm=jm("string"),_m=jm("text");function jm($){return{resolveAll:Om($==="text"?uZ0:void 0),tokenize:Z};function Z(J){let H=this,Q=this.parser.constructs[$],B=J.attempt(Q,X,z);return X;function X(K){return U(K)?B(K):z(K)}function z(K){if(K===null){J.consume(K);return}return J.enter("data"),J.consume(K),G}function G(K){if(U(K))return J.exit("data"),B(K);return J.consume(K),G}function U(K){if(K===null)return!0;let Y=Q[K],F=-1;if(Y)while(++F<Y.length){let W=Y[F];if(!W.previous||W.previous.call(H,H.previous))return!0}return!1}}}function Om($){return Z;function Z(J,H){let Q=-1,B;while(++Q<=J.length)if(B===void 0){if(J[Q]&&J[Q][1].type==="data")B=Q,Q++}else if(!J[Q]||J[Q][1].type!=="data"){if(Q!==B+2)J[B][1].end=J[Q-1][1].end,J.splice(B+2,Q-B-2),Q=B+2;B=void 0}return $?$(J,H):J}}function uZ0($,Z){let J=0;while(++J<=$.length)if((J===$.length||$[J][1].type==="lineEnding")&&$[J-1][1].type==="data"){let H=$[J-1][1],Q=Z.sliceStream(H),B=Q.length,X=-1,z=0,G;while(B--){let U=Q[B];if(typeof U==="string"){X=U.length;while(U.charCodeAt(X-1)===32)z++,X--;if(X)break;X=-1}else if(U===-2)G=!0,z++;else if(U===-1);else{B++;break}}if(Z._contentTypeTextTrailing&&J===$.length)z=0;if(z){let U={type:J===$.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:B?X:H.start._bufferIndex+X,_index:H.start._index+B,line:H.end.line,column:H.end.column-z,offset:H.end.offset-z},end:{...H.end}};if(H.end={...U.start},H.start.offset===H.end.offset)Object.assign(H,U);else $.splice(J,0,["enter",U,Z],["exit",U,Z]),J+=2}J++}return $}var PM={};C5(PM,{text:()=>rZ0,string:()=>iZ0,insideSpan:()=>aZ0,flowInitial:()=>dZ0,flow:()=>lZ0,document:()=>pZ0,disable:()=>nZ0,contentInitial:()=>cZ0,attentionMarkers:()=>oZ0});var pZ0={[42]:U4,[43]:U4,[45]:U4,[48]:U4,[49]:U4,[50]:U4,[51]:U4,[52]:U4,[53]:U4,[54]:U4,[55]:U4,[56]:U4,[57]:U4,[62]:xF},cZ0={[91]:WM},dZ0={[-2]:lB,[-1]:lB,[32]:lB},lZ0={[35]:NM,[42]:p$,[45]:[cF,p$],[60]:AM,[61]:cF,[95]:p$,[96]:gF,[126]:gF},iZ0={[38]:vF,[92]:hF},rZ0={[-5]:rB,[-4]:rB,[-3]:rB,[33]:LM,[38]:vF,[42]:dB,[60]:[UM,DM],[91]:MM,[92]:[qM,hF],[93]:u$,[95]:dB,[96]:KM},aZ0={null:[dB,Mm]},oZ0={null:[42,95]},nZ0={null:[]};function Tm($,Z,J){let H={_bufferIndex:-1,_index:0,line:J&&J.line||1,column:J&&J.column||1,offset:J&&J.offset||0},Q={},B=[],X=[],z=[],G=!0,U={attempt:R(E),check:R(C),consume:j,enter:M,exit:_,interrupt:R(C,{interrupt:!0})},K={code:null,containerState:{},defineSkip:V,events:[],now:A,parser:$,previous:null,sliceSerialize:q,sliceStream:N,write:W},Y=Z.tokenize.call(K,U),F;if(Z.resolveAll)B.push(Z);return K;function W(S){if(X=T4(X,S),D(),X[X.length-1]!==null)return[];return T(Z,0),K.events=G7(B,K.events,K),K.events}function q(S,O){return tZ0(N(S),O)}function N(S){return sZ0(X,S)}function A(){let{_bufferIndex:S,_index:O,line:k,column:b,offset:h}=H;return{_bufferIndex:S,_index:O,line:k,column:b,offset:h}}function V(S){Q[S.line]=S.column,y()}function D(){let S;while(H._index<X.length){let O=X[H._index];if(typeof O==="string"){if(S=H._index,H._bufferIndex<0)H._bufferIndex=0;while(H._index===S&&H._bufferIndex<O.length)L(O.charCodeAt(H._bufferIndex))}else L(O)}}function L(S){G=void 0,F=S,Y=Y(S)}function j(S){if(u0(S))H.line++,H.column=1,H.offset+=S===-3?2:1,y();else if(S!==-1)H.column++,H.offset++;if(H._bufferIndex<0)H._index++;else if(H._bufferIndex++,H._bufferIndex===X[H._index].length)H._bufferIndex=-1,H._index++;K.previous=S,G=!0}function M(S,O){let k=O||{};return k.type=S,k.start=A(),K.events.push(["enter",k,K]),z.push(k),k}function _(S){let O=z.pop();return O.end=A(),K.events.push(["exit",O,K]),O}function E(S,O){T(S,O.from)}function C(S,O){O.restore()}function R(S,O){return k;function k(b,h,v){let f,w,i,r;return Array.isArray(b)?l(b):("tokenize"in b)?l([b]):x(b);function x(o){return Z0;function Z0(H0){let G0=H0!==null&&o[H0],X0=H0!==null&&o.null,Y0=[...Array.isArray(G0)?G0:G0?[G0]:[],...Array.isArray(X0)?X0:X0?[X0]:[]];return l(Y0)(H0)}}function l(o){if(f=o,w=0,o.length===0)return v;return s(o[w])}function s(o){return Z0;function Z0(H0){if(r=I(),i=o,!o.partial)K.currentConstruct=o;if(o.name&&K.parser.constructs.disable.null.includes(o.name))return d(H0);return o.tokenize.call(O?Object.assign(Object.create(K),O):K,U,p,d)(H0)}}function p(o){return G=!0,S(i,r),h}function d(o){if(G=!0,r.restore(),++w<f.length)return s(f[w]);return v}}}function T(S,O){if(S.resolveAll&&!B.includes(S))B.push(S);if(S.resolve)Z2(K.events,O,K.events.length-O,S.resolve(K.events.slice(O),K));if(S.resolveTo)K.events=S.resolveTo(K.events,K)}function I(){let S=A(),O=K.previous,k=K.currentConstruct,b=K.events.length,h=Array.from(z);return{from:b,restore:v};function v(){H=S,K.previous=O,K.currentConstruct=k,K.events.length=b,z=h,y()}}function y(){if(H.line in Q&&H.column<2)H.column=Q[H.line],H.offset+=Q[H.line]-1}}function sZ0($,Z){let J=Z.start._index,H=Z.start._bufferIndex,Q=Z.end._index,B=Z.end._bufferIndex,X;if(J===Q)X=[$[J].slice(H,B)];else{if(X=$.slice(J,Q),H>-1){let z=X[0];if(typeof z==="string")X[0]=z.slice(H);else X.shift()}if(B>0)X.push($[Q].slice(0,B))}return X}function tZ0($,Z){let J=-1,H=[],Q;while(++J<$.length){let B=$[J],X;if(typeof B==="string")X=B;else switch(B){case-5:{X="\r";break}case-4:{X=`
|
|
19
|
-
`;break}case-3:{X=`\r
|
|
20
|
-
`;break}case-2:{X=Z?" ":"\t";break}case-1:{if(!Z&&Q)continue;X=" ";break}default:X=String.fromCharCode(B)}Q=B===-2,H.push(X)}return H.join("")}function _M($){let H={constructs:kF([PM,...($||{}).extensions||[]]),content:Q(Wm),defined:[],document:Q(Nm),flow:Q(Lm),lazy:{},string:Q(Pm),text:Q(_m)};return H;function Q(B){return X;function X(z){return Tm(H,B,z)}}}function jM($){while(!fF($));return $}var Cm=/[\0\t\n\r]/g;function OM(){let $=1,Z="",J=!0,H;return Q;function Q(B,X,z){let G=[],U,K,Y,F,W;if(B=Z+(typeof B==="string"?B.toString():new TextDecoder(X||void 0).decode(B)),Y=0,Z="",J){if(B.charCodeAt(0)===65279)Y++;J=void 0}while(Y<B.length){if(Cm.lastIndex=Y,U=Cm.exec(B),F=U&&U.index!==void 0?U.index:B.length,W=B.charCodeAt(F),!U){Z=B.slice(Y);break}if(W===10&&Y===F&&H)G.push(-3),H=void 0;else{if(H)G.push(-5),H=void 0;if(Y<F)G.push(B.slice(Y,F)),$+=F-Y;switch(W){case 0:{G.push(65533),$++;break}case 9:{K=Math.ceil($/4)*4,G.push(-2);while($++<K)G.push(-1);break}case 10:{G.push(-4),$=1;break}default:H=!0,$=1}}Y=F+1}if(z){if(H)G.push(-5);if(Z)G.push(Z);G.push(null)}return G}}var eZ0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wm($){return $.replace(eZ0,$J0)}function $J0($,Z,J){if(Z)return Z;if(J.charCodeAt(0)===35){let Q=J.charCodeAt(1),B=Q===120||Q===88;return yF(J.slice(B?2:1),B?16:10)}return nJ(J)||$}var Sm={}.hasOwnProperty;function TM($,Z,J){if(Z&&typeof Z==="object")J=Z,Z=void 0;return ZJ0(J)(jM(_M(J).document().write(OM()($,Z,!0))))}function ZJ0($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:B(e),autolinkProtocol:R,autolinkEmail:R,atxHeading:B(N0),blockQuote:B(H0),characterEscape:R,characterReference:R,codeFenced:B(G0),codeFencedFenceInfo:X,codeFencedFenceMeta:X,codeIndented:B(G0,X),codeText:B(X0,X),codeTextData:R,data:R,codeFlowValue:R,definition:B(Y0),definitionDestinationString:X,definitionLabelString:X,definitionTitleString:X,emphasis:B(A0),hardBreakEscape:B(F0),hardBreakTrailing:B(F0),htmlFlow:B(n,X),htmlFlowData:R,htmlText:B(n,X),htmlTextData:R,image:B(a),label:X,link:B(e),listItem:B(Q0),listItemValue:F,listOrdered:B($0,Y),listUnordered:B($0),paragraph:B(_0),reference:x,referenceString:X,resourceDestinationString:X,resourceTitleString:X,setextHeading:B(N0),strong:B(M0),thematicBreak:B(L0)},exit:{atxHeading:G(),atxHeadingSequence:M,autolink:G(),autolinkEmail:Z0,autolinkProtocol:o,blockQuote:G(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:s,characterReferenceMarkerNumeric:s,characterReferenceValue:p,characterReference:d,codeFenced:G(A),codeFencedFence:N,codeFencedFenceInfo:W,codeFencedFenceMeta:q,codeFlowValue:T,codeIndented:G(V),codeText:G(k),codeTextData:T,data:T,definition:G(),definitionDestinationString:j,definitionLabelString:D,definitionTitleString:L,emphasis:G(),hardBreakEscape:G(y),hardBreakTrailing:G(y),htmlFlow:G(S),htmlFlowData:T,htmlText:G(O),htmlTextData:T,image:G(h),label:f,labelText:v,lineEnding:I,link:G(b),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:l,resourceDestinationString:w,resourceTitleString:i,resource:r,setextHeading:G(C),setextHeadingLineSequence:E,setextHeadingText:_,strong:G(),thematicBreak:G()}};Rm(Z,($||{}).mdastExtensions||[]);let J={};return H;function H(g){let u={type:"root",children:[]},t={stack:[u],tokenStack:[],config:Z,enter:z,exit:U,buffer:X,resume:K,data:J},W0=[],I0=-1;while(++I0<g.length)if(g[I0][1].type==="listOrdered"||g[I0][1].type==="listUnordered")if(g[I0][0]==="enter")W0.push(I0);else{let c0=W0.pop();I0=Q(g,c0,I0)}I0=-1;while(++I0<g.length){let c0=Z[g[I0][0]];if(Sm.call(c0,g[I0][1].type))c0[g[I0][1].type].call(Object.assign({sliceSerialize:g[I0][2].sliceSerialize},t),g[I0][1])}if(t.tokenStack.length>0){let c0=t.tokenStack[t.tokenStack.length-1];(c0[1]||Em).call(t,void 0,c0[0])}u.position={start:U7(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:U7(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},I0=-1;while(++I0<Z.transforms.length)u=Z.transforms[I0](u)||u;return u}function Q(g,u,t){let W0=u-1,I0=-1,c0=!1,f0,T0,x0,J1;while(++W0<=t){let W1=g[W0];switch(W1[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(W1[0]==="enter")I0++;else I0--;J1=void 0;break}case"lineEndingBlank":{if(W1[0]==="enter"){if(f0&&!J1&&!I0&&!x0)x0=W0;J1=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:J1=void 0}if(!I0&&W1[0]==="enter"&&W1[1].type==="listItemPrefix"||I0===-1&&W1[0]==="exit"&&(W1[1].type==="listUnordered"||W1[1].type==="listOrdered")){if(f0){let d0=W0;T0=void 0;while(d0--){let v0=g[d0];if(v0[1].type==="lineEnding"||v0[1].type==="lineEndingBlank"){if(v0[0]==="exit")continue;if(T0)g[T0][1].type="lineEndingBlank",c0=!0;v0[1].type="lineEnding",T0=d0}else if(v0[1].type==="linePrefix"||v0[1].type==="blockQuotePrefix"||v0[1].type==="blockQuotePrefixWhitespace"||v0[1].type==="blockQuoteMarker"||v0[1].type==="listItemIndent");else break}if(x0&&(!T0||x0<T0))f0._spread=!0;f0.end=Object.assign({},T0?g[T0][1].start:W1[1].end),g.splice(T0||W0,0,["exit",f0,W1[2]]),W0++,t++}if(W1[1].type==="listItemPrefix"){let d0={type:"listItem",_spread:!1,start:Object.assign({},W1[1].start),end:void 0};f0=d0,g.splice(W0,0,["enter",d0,W1[2]]),W0++,t++,x0=void 0,J1=!0}}}return g[u][1]._spread=c0,t}function B(g,u){return t;function t(W0){if(z.call(this,g(W0),W0),u)u.call(this,W0)}}function X(){this.stack.push({type:"fragment",children:[]})}function z(g,u,t){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([u,t||void 0]),g.position={start:U7(u.start),end:void 0}}function G(g){return u;function u(t){if(g)g.call(this,t);U.call(this,t)}}function U(g,u){let t=this.stack.pop(),W0=this.tokenStack.pop();if(!W0)throw Error("Cannot close `"+g.type+"` ("+X7({start:g.start,end:g.end})+"): it’s not open");else if(W0[0].type!==g.type)if(u)u.call(this,g,W0[0]);else(W0[1]||Em).call(this,g,W0[0]);t.position.end=U7(g.end)}function K(){return v$(this.stack.pop())}function Y(){this.data.expectingFirstListItemValue=!0}function F(g){if(this.data.expectingFirstListItemValue){let u=this.stack[this.stack.length-2];u.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function W(){let g=this.resume(),u=this.stack[this.stack.length-1];u.lang=g}function q(){let g=this.resume(),u=this.stack[this.stack.length-1];u.meta=g}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function A(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function V(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g.replace(/(\r?\n|\r)$/g,"")}function D(g){let u=this.resume(),t=this.stack[this.stack.length-1];t.label=u,t.identifier=G4(this.sliceSerialize(g)).toLowerCase()}function L(){let g=this.resume(),u=this.stack[this.stack.length-1];u.title=g}function j(){let g=this.resume(),u=this.stack[this.stack.length-1];u.url=g}function M(g){let u=this.stack[this.stack.length-1];if(!u.depth){let t=this.sliceSerialize(g).length;u.depth=t}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function E(g){let u=this.stack[this.stack.length-1];u.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function R(g){let t=this.stack[this.stack.length-1].children,W0=t[t.length-1];if(!W0||W0.type!=="text")W0=V0(),W0.position={start:U7(g.start),end:void 0},t.push(W0);this.stack.push(W0)}function T(g){let u=this.stack.pop();u.value+=this.sliceSerialize(g),u.position.end=U7(g.end)}function I(g){let u=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=u.children[u.children.length-1];t.position.end=U7(g.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(u.type))R.call(this,g),T.call(this,g)}function y(){this.data.atHardBreak=!0}function S(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function O(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function k(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function b(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let u=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=u,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function h(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let u=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=u,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function v(g){let u=this.sliceSerialize(g),t=this.stack[this.stack.length-2];t.label=wm(u),t.identifier=G4(u).toLowerCase()}function f(){let g=this.stack[this.stack.length-1],u=this.resume(),t=this.stack[this.stack.length-1];if(this.data.inReference=!0,t.type==="link"){let W0=g.children;t.children=W0}else t.alt=u}function w(){let g=this.resume(),u=this.stack[this.stack.length-1];u.url=g}function i(){let g=this.resume(),u=this.stack[this.stack.length-1];u.title=g}function r(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function l(g){let u=this.resume(),t=this.stack[this.stack.length-1];t.label=u,t.identifier=G4(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function s(g){this.data.characterReferenceType=g.type}function p(g){let u=this.sliceSerialize(g),t=this.data.characterReferenceType,W0;if(t)W0=yF(u,t==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else W0=nJ(u);let I0=this.stack[this.stack.length-1];I0.value+=W0}function d(g){let u=this.stack.pop();u.position.end=U7(g.end)}function o(g){T.call(this,g);let u=this.stack[this.stack.length-1];u.url=this.sliceSerialize(g)}function Z0(g){T.call(this,g);let u=this.stack[this.stack.length-1];u.url="mailto:"+this.sliceSerialize(g)}function H0(){return{type:"blockquote",children:[]}}function G0(){return{type:"code",lang:null,meta:null,value:""}}function X0(){return{type:"inlineCode",value:""}}function Y0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function A0(){return{type:"emphasis",children:[]}}function N0(){return{type:"heading",depth:0,children:[]}}function F0(){return{type:"break"}}function n(){return{type:"html",value:""}}function a(){return{type:"image",title:null,url:"",alt:null}}function e(){return{type:"link",title:null,url:"",children:[]}}function $0(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function Q0(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function _0(){return{type:"paragraph",children:[]}}function M0(){return{type:"strong",children:[]}}function V0(){return{type:"text",value:""}}function L0(){return{type:"thematicBreak"}}}function U7($){return{line:$.line,column:$.column,offset:$.offset}}function Rm($,Z){let J=-1;while(++J<Z.length){let H=Z[J];if(Array.isArray(H))Rm($,H);else JJ0($,H)}}function JJ0($,Z){let J;for(J in Z)if(Sm.call(Z,J))switch(J){case"canContainEols":{let H=Z[J];if(H)$[J].push(...H);break}case"transforms":{let H=Z[J];if(H)$[J].push(...H);break}case"enter":case"exit":{let H=Z[J];if(H)Object.assign($[J],H);break}}}function Em($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+X7({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+X7({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+X7({start:Z.start,end:Z.end})+") is still open")}function dF($){let Z=this;Z.parser=J;function J(H){return TM(H,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var lF=-1,sJ=0,c$=1,tJ=2,aB=3,oB=4,nB=5,sB=6,iF=7,rF=8;var Im=typeof self==="object"?self:globalThis,HJ0=($,Z)=>{let J=(Q,B)=>{return $.set(B,Q),Q},H=(Q)=>{if($.has(Q))return $.get(Q);let[B,X]=Z[Q];switch(B){case sJ:case lF:return J(X,Q);case c$:{let z=J([],Q);for(let G of X)z.push(H(G));return z}case tJ:{let z=J({},Q);for(let[G,U]of X)z[H(G)]=H(U);return z}case aB:return J(new Date(X),Q);case oB:{let{source:z,flags:G}=X;return J(new RegExp(z,G),Q)}case nB:{let z=J(new Map,Q);for(let[G,U]of X)z.set(H(G),H(U));return z}case sB:{let z=J(new Set,Q);for(let G of X)z.add(H(G));return z}case iF:{let{name:z,message:G}=X;return J(new Im[z](G),Q)}case rF:return J(BigInt(X),Q);case"BigInt":return J(Object(BigInt(X)),Q);case"ArrayBuffer":return J(new Uint8Array(X).buffer,X);case"DataView":{let{buffer:z}=new Uint8Array(X);return J(new DataView(z),X)}}return J(new Im[B](X),Q)};return H},CM=($)=>HJ0(new Map,$)(0);var eJ="",{toString:QJ0}={},{keys:BJ0}=Object,tB=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[sJ,Z];let J=QJ0.call($).slice(8,-1);switch(J){case"Array":return[c$,eJ];case"Object":return[tJ,eJ];case"Date":return[aB,eJ];case"RegExp":return[oB,eJ];case"Map":return[nB,eJ];case"Set":return[sB,eJ];case"DataView":return[c$,J]}if(J.includes("Array"))return[c$,J];if(J.includes("Error"))return[iF,J];return[tJ,J]},aF=([$,Z])=>$===sJ&&(Z==="function"||Z==="symbol"),XJ0=($,Z,J,H)=>{let Q=(X,z)=>{let G=H.push(X)-1;return J.set(z,G),G},B=(X)=>{if(J.has(X))return J.get(X);let[z,G]=tB(X);switch(z){case sJ:{let K=X;switch(G){case"bigint":z=rF,K=X.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);K=null;break;case"undefined":return Q([lF],X)}return Q([z,K],X)}case c$:{if(G){let F=X;if(G==="DataView")F=new Uint8Array(X.buffer);else if(G==="ArrayBuffer")F=new Uint8Array(X);return Q([G,[...F]],X)}let K=[],Y=Q([z,K],X);for(let F of X)K.push(B(F));return Y}case tJ:{if(G)switch(G){case"BigInt":return Q([G,X.toString()],X);case"Boolean":case"Number":case"String":return Q([G,X.valueOf()],X)}if(Z&&"toJSON"in X)return B(X.toJSON());let K=[],Y=Q([z,K],X);for(let F of BJ0(X))if($||!aF(tB(X[F])))K.push([B(F),B(X[F])]);return Y}case aB:return Q([z,X.toISOString()],X);case oB:{let{source:K,flags:Y}=X;return Q([z,{source:K,flags:Y}],X)}case nB:{let K=[],Y=Q([z,K],X);for(let[F,W]of X)if($||!(aF(tB(F))||aF(tB(W))))K.push([B(F),B(W)]);return Y}case sB:{let K=[],Y=Q([z,K],X);for(let F of X)if($||!aF(tB(F)))K.push(B(F));return Y}}let{message:U}=X;return Q([z,{name:G,message:U}],X)};return B},wM=($,{json:Z,lossy:J}={})=>{let H=[];return XJ0(!(Z||J),!!Z,new Map,H)($),H};var $H=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?CM(wM($,Z)):structuredClone($):($,Z)=>CM(wM($,Z));function zJ0($,Z){let J=[{type:"text",value:"↩"}];if(Z>1)J.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return J}function GJ0($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function bm($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=$.options.footnoteBackContent||zJ0,H=$.options.footnoteBackLabel||GJ0,Q=$.options.footnoteLabel||"Footnotes",B=$.options.footnoteLabelTagName||"h2",X=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],G=-1;while(++G<$.footnoteOrder.length){let U=$.footnoteById.get($.footnoteOrder[G]);if(!U)continue;let K=$.all(U),Y=String(U.identifier).toUpperCase(),F=h8(Y.toLowerCase()),W=0,q=[],N=$.footnoteCounts.get(Y);while(N!==void 0&&++W<=N){if(q.length>0)q.push({type:"text",value:" "});let D=typeof J==="string"?J:J(G,W);if(typeof D==="string")D={type:"text",value:D};q.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+F+(W>1?"-"+W:""),dataFootnoteBackref:"",ariaLabel:typeof H==="string"?H:H(G,W),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}let A=K[K.length-1];if(A&&A.type==="element"&&A.tagName==="p"){let D=A.children[A.children.length-1];if(D&&D.type==="text")D.value+=" ";else A.children.push({type:"text",value:" "});A.children.push(...q)}else K.push(...q);let V={type:"element",tagName:"li",properties:{id:Z+"fn-"+F},children:$.wrap(K,!0)};$.patch(U,V),z.push(V)}if(z.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:B,properties:{...$H(X),id:"footnote-label"},children:[{type:"text",value:Q}]},{type:"text",value:`
|
|
21
|
-
`},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
|
|
22
|
-
`}]}}var $3=function($){if($===null||$===void 0)return FJ0;if(typeof $==="function")return oF($);if(typeof $==="object")return Array.isArray($)?UJ0($):KJ0($);if(typeof $==="string")return YJ0($);throw Error("Expected function, string, or object as test")};function UJ0($){let Z=[],J=-1;while(++J<$.length)Z[J]=$3($[J]);return oF(H);function H(...Q){let B=-1;while(++B<Z.length)if(Z[B].apply(this,Q))return!0;return!1}}function KJ0($){let Z=$;return oF(J);function J(H){let Q=H,B;for(B in $)if(Q[B]!==Z[B])return!1;return!0}}function YJ0($){return oF(Z);function Z(J){return J&&J.type===$}}function oF($){return Z;function Z(J,H,Q){return Boolean(WJ0(J)&&$.call(this,J,typeof H==="number"?H:void 0,Q||void 0))}}function FJ0(){return!0}function WJ0($){return $!==null&&typeof $==="object"&&"type"in $}function km($){return $}var ym=[],nF=!0,d$=!1,sF="skip";function eB($,Z,J,H){let Q;if(typeof Z==="function"&&typeof J!=="function")H=J,J=Z;else Q=Z;let B=$3(Q),X=H?-1:1;z($,void 0,[])();function z(G,U,K){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(F,"name",{value:"node ("+km(G.type+(W?"<"+W+">":""))+")"})}return F;function F(){let W=ym,q,N,A;if(!Z||B(G,U,K[K.length-1]||void 0)){if(W=qJ0(J(G,K)),W[0]===d$)return W}if("children"in G&&G.children){let V=G;if(V.children&&W[0]!==sF){N=(H?V.children.length:-1)+X,A=K.concat(V);while(N>-1&&N<V.children.length){let D=V.children[N];if(q=z(D,N,A)(),q[0]===d$)return q;N=typeof q[1]==="number"?q[1]:N+X}}}return W}}}function qJ0($){if(Array.isArray($))return $;if(typeof $==="number")return[nF,$];return $===null||$===void 0?ym:[$]}function b3($,Z,J,H){let Q,B,X;if(typeof Z==="function"&&typeof J!=="function")B=void 0,X=Z,Q=J;else B=Z,X=J,Q=H;eB($,B,z,Q);function z(G,U){let K=U[U.length-1],Y=K?K.children.indexOf(G):void 0;return X(G,Y,K)}}function xm($,Z){let J={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,J),$.applyData(Z,J)}function hm($,Z){let J={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,J),[$.applyData(Z,J),{type:"text",value:`
|
|
23
|
-
`}]}function vm($,Z){let J=Z.value?Z.value+`
|
|
24
|
-
`:"",H={},Q=Z.lang?Z.lang.split(/\s+/):[];if(Q.length>0)H.className=["language-"+Q[0]];let B={type:"element",tagName:"code",properties:H,children:[{type:"text",value:J}]};if(Z.meta)B.data={meta:Z.meta};return $.patch(Z,B),B=$.applyData(Z,B),B={type:"element",tagName:"pre",properties:{},children:[B]},$.patch(Z,B),B}function gm($,Z){let J={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function fm($,Z){let J={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function mm($,Z){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=String(Z.identifier).toUpperCase(),Q=h8(H.toLowerCase()),B=$.footnoteOrder.indexOf(H),X,z=$.footnoteCounts.get(H);if(z===void 0)z=0,$.footnoteOrder.push(H),X=$.footnoteOrder.length;else X=B+1;z+=1,$.footnoteCounts.set(H,z);let G={type:"element",tagName:"a",properties:{href:"#"+J+"fn-"+Q,id:J+"fnref-"+Q+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(X)}]};$.patch(Z,G);let U={type:"element",tagName:"sup",properties:{},children:[G]};return $.patch(Z,U),$.applyData(Z,U)}function um($,Z){let J={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function pm($,Z){if($.options.allowDangerousHtml){let J={type:"raw",value:Z.value};return $.patch(Z,J),$.applyData(Z,J)}return}function tF($,Z){let J=Z.referenceType,H="]";if(J==="collapsed")H+="[]";else if(J==="full")H+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+H}];let Q=$.all(Z),B=Q[0];if(B&&B.type==="text")B.value="["+B.value;else Q.unshift({type:"text",value:"["});let X=Q[Q.length-1];if(X&&X.type==="text")X.value+=H;else Q.push({type:"text",value:H});return Q}function cm($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return tF($,Z);let Q={src:h8(H.url||""),alt:Z.alt};if(H.title!==null&&H.title!==void 0)Q.title=H.title;let B={type:"element",tagName:"img",properties:Q,children:[]};return $.patch(Z,B),$.applyData(Z,B)}function dm($,Z){let J={src:h8(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)J.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let H={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,H),$.applyData(Z,H)}function lm($,Z){let J={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,J);let H={type:"element",tagName:"code",properties:{},children:[J]};return $.patch(Z,H),$.applyData(Z,H)}function im($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return tF($,Z);let Q={href:h8(H.url||"")};if(H.title!==null&&H.title!==void 0)Q.title=H.title;let B={type:"element",tagName:"a",properties:Q,children:$.all(Z)};return $.patch(Z,B),$.applyData(Z,B)}function rm($,Z){let J={href:h8(Z.url)};if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let H={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function am($,Z,J){let H=$.all(Z),Q=J?NJ0(J):om(Z),B={},X=[];if(typeof Z.checked==="boolean"){let K=H[0],Y;if(K&&K.type==="element"&&K.tagName==="p")Y=K;else Y={type:"element",tagName:"p",properties:{},children:[]},H.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:[]}),B.className=["task-list-item"]}let z=-1;while(++z<H.length){let K=H[z];if(Q||z!==0||K.type!=="element"||K.tagName!=="p")X.push({type:"text",value:`
|
|
25
|
-
`});if(K.type==="element"&&K.tagName==="p"&&!Q)X.push(...K.children);else X.push(K)}let G=H[H.length-1];if(G&&(Q||G.type!=="element"||G.tagName!=="p"))X.push({type:"text",value:`
|
|
26
|
-
`});let U={type:"element",tagName:"li",properties:B,children:X};return $.patch(Z,U),$.applyData(Z,U)}function NJ0($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let J=$.children,H=-1;while(!Z&&++H<J.length)Z=om(J[H])}return Z}function om($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function nm($,Z){let J={},H=$.all(Z),Q=-1;if(typeof Z.start==="number"&&Z.start!==1)J.start=Z.start;while(++Q<H.length){let X=H[Q];if(X.type==="element"&&X.tagName==="li"&&X.properties&&Array.isArray(X.properties.className)&&X.properties.className.includes("task-list-item")){J.className=["contains-task-list"];break}}let B={type:"element",tagName:Z.ordered?"ol":"ul",properties:J,children:$.wrap(H,!0)};return $.patch(Z,B),$.applyData(Z,B)}function sm($,Z){let J={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function tm($,Z){let J={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,J),$.applyData(Z,J)}function em($,Z){let J={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function $u($,Z){let J=$.all(Z),H=J.shift(),Q=[];if(H){let X={type:"element",tagName:"thead",properties:{},children:$.wrap([H],!0)};$.patch(Z.children[0],X),Q.push(X)}if(J.length>0){let X={type:"element",tagName:"tbody",properties:{},children:$.wrap(J,!0)},z=oJ(Z.children[1]),G=bF(Z.children[Z.children.length-1]);if(z&&G)X.position={start:z,end:G};Q.push(X)}let B={type:"element",tagName:"table",properties:{},children:$.wrap(Q,!0)};return $.patch(Z,B),$.applyData(Z,B)}function Zu($,Z,J){let H=J?J.children:void 0,B=(H?H.indexOf(Z):1)===0?"th":"td",X=J&&J.type==="table"?J.align:void 0,z=X?X.length:Z.children.length,G=-1,U=[];while(++G<z){let Y=Z.children[G],F={},W=X?X[G]:void 0;if(W)F.align=W;let q={type:"element",tagName:B,properties:F,children:[]};if(Y)q.children=$.all(Y),$.patch(Y,q),q=$.applyData(Y,q);U.push(q)}let K={type:"element",tagName:"tr",properties:{},children:$.wrap(U,!0)};return $.patch(Z,K),$.applyData(Z,K)}function Ju($,Z){let J={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Qu($){let Z=String($),J=/\r?\n|\r/g,H=J.exec(Z),Q=0,B=[];while(H)B.push(Hu(Z.slice(Q,H.index),Q>0,!0),H[0]),Q=H.index+H[0].length,H=J.exec(Z);return B.push(Hu(Z.slice(Q),Q>0,!1)),B.join("")}function Hu($,Z,J){let H=0,Q=$.length;if(Z){let B=$.codePointAt(H);while(B===9||B===32)H++,B=$.codePointAt(H)}if(J){let B=$.codePointAt(Q-1);while(B===9||B===32)Q--,B=$.codePointAt(Q-1)}return Q>H?$.slice(H,Q):""}function Bu($,Z){let J={type:"text",value:Qu(String(Z.value))};return $.patch(Z,J),$.applyData(Z,J)}function Xu($,Z){let J={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,J),$.applyData(Z,J)}var zu={blockquote:xm,break:hm,code:vm,delete:gm,emphasis:fm,footnoteReference:mm,heading:um,html:pm,imageReference:cm,image:dm,inlineCode:lm,linkReference:im,link:rm,listItem:am,list:nm,paragraph:sm,root:tm,strong:em,table:$u,tableCell:Ju,tableRow:Zu,text:Bu,thematicBreak:Xu,toml:eF,yaml:eF,definition:eF,footnoteDefinition:eF};function eF(){return}var EM={}.hasOwnProperty,VJ0={};function Uu($,Z){let J=Z||VJ0,H=new Map,Q=new Map,B=new Map,X={...zu,...J.handlers},z={all:U,applyData:DJ0,definitionById:H,footnoteById:Q,footnoteCounts:B,footnoteOrder:[],handlers:X,one:G,options:J,patch:AJ0,wrap:MJ0};return b3($,function(K){if(K.type==="definition"||K.type==="footnoteDefinition"){let Y=K.type==="definition"?H:Q,F=String(K.identifier).toUpperCase();if(!Y.has(F))Y.set(F,K)}}),z;function G(K,Y){let F=K.type,W=z.handlers[F];if(EM.call(z.handlers,F)&&W)return W(z,K,Y);if(z.options.passThrough&&z.options.passThrough.includes(F)){if("children"in K){let{children:N,...A}=K,V=$H(A);return V.children=z.all(K),V}return $H(K)}return(z.options.unknownHandler||LJ0)(z,K,Y)}function U(K){let Y=[];if("children"in K){let F=K.children,W=-1;while(++W<F.length){let q=z.one(F[W],K);if(q){if(W&&F[W-1].type==="break"){if(!Array.isArray(q)&&q.type==="text")q.value=Gu(q.value);if(!Array.isArray(q)&&q.type==="element"){let N=q.children[0];if(N&&N.type==="text")N.value=Gu(N.value)}}if(Array.isArray(q))Y.push(...q);else Y.push(q)}}}return Y}}function AJ0($,Z){if($.position)Z.position=HM($)}function DJ0($,Z){let J=Z;if($&&$.data){let H=$.data.hName,Q=$.data.hChildren,B=$.data.hProperties;if(typeof H==="string")if(J.type==="element")J.tagName=H;else{let X="children"in J?J.children:[J];J={type:"element",tagName:H,properties:{},children:X}}if(J.type==="element"&&B)Object.assign(J.properties,$H(B));if("children"in J&&J.children&&Q!==null&&Q!==void 0)J.children=Q}return J}function LJ0($,Z){let J=Z.data||{},H="value"in Z&&!(EM.call(J,"hProperties")||EM.call(J,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function MJ0($,Z){let J=[],H=-1;if(Z)J.push({type:"text",value:`
|
|
27
|
-
`});while(++H<$.length){if(H)J.push({type:"text",value:`
|
|
28
|
-
`});J.push($[H])}if(Z&&$.length>0)J.push({type:"text",value:`
|
|
29
|
-
`});return J}function Gu($){let Z=0,J=$.charCodeAt(Z);while(J===9||J===32)Z++,J=$.charCodeAt(Z);return $.slice(Z)}function $W($,Z){let J=Uu($,Z),H=J.one($,void 0),Q=bm(J),B=Array.isArray(H)?{type:"root",children:H}:H||{type:"root",children:[]};if(Q)n1("children"in B),B.children.push({type:"text",value:`
|
|
30
|
-
`},Q);return B}function ZW($,Z){if($&&"run"in $)return async function(J,H){let Q=$W(J,{file:H,...Z});await $.run(Q,H)};return function(J,H){return $W(J,{file:H,...$||Z})}}function SM($){if($)throw $}var QW=P(Du(),1);function $X($){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 RM(){let $=[],Z={run:J,use:H};return Z;function J(...Q){let B=-1,X=Q.pop();if(typeof X!=="function")throw TypeError("Expected function as last argument, not "+X);z(null,...Q);function z(G,...U){let K=$[++B],Y=-1;if(G){X(G);return}while(++Y<Q.length)if(U[Y]===null||U[Y]===void 0)U[Y]=Q[Y];if(Q=U,K)Lu(K,z)(...U);else X(null,...U)}}function H(Q){if(typeof Q!=="function")throw TypeError("Expected `middelware` to be a function, not "+Q);return $.push(Q),Z}}function Lu($,Z){let J;return H;function H(...X){let z=$.length>X.length,G;if(z)X.push(Q);try{G=$.apply(this,X)}catch(U){let K=U;if(z&&J)throw K;return Q(K)}if(!z)if(G&&G.then&&typeof G.then==="function")G.then(B,Q);else if(G instanceof Error)Q(G);else B(G)}function Q(X,...z){if(!J)J=!0,Z(X,...z)}function B(X){Q(null,X)}}var Q9={basename:PJ0,dirname:_J0,extname:jJ0,join:OJ0,sep:"/"};function PJ0($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');ZX($);let J=0,H=-1,Q=$.length,B;if(Z===void 0||Z.length===0||Z.length>$.length){while(Q--)if($.codePointAt(Q)===47){if(B){J=Q+1;break}}else if(H<0)B=!0,H=Q+1;return H<0?"":$.slice(J,H)}if(Z===$)return"";let X=-1,z=Z.length-1;while(Q--)if($.codePointAt(Q)===47){if(B){J=Q+1;break}}else{if(X<0)B=!0,X=Q+1;if(z>-1)if($.codePointAt(Q)===Z.codePointAt(z--)){if(z<0)H=Q}else z=-1,H=X}if(J===H)H=X;else if(H<0)H=$.length;return $.slice(J,H)}function _J0($){if(ZX($),$.length===0)return".";let Z=-1,J=$.length,H;while(--J)if($.codePointAt(J)===47){if(H){Z=J;break}}else if(!H)H=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function jJ0($){ZX($);let Z=$.length,J=-1,H=0,Q=-1,B=0,X;while(Z--){let z=$.codePointAt(Z);if(z===47){if(X){H=Z+1;break}continue}if(J<0)X=!0,J=Z+1;if(z===46){if(Q<0)Q=Z;else if(B!==1)B=1}else if(Q>-1)B=-1}if(Q<0||J<0||B===0||B===1&&Q===J-1&&Q===H+1)return"";return $.slice(Q,J)}function OJ0(...$){let Z=-1,J;while(++Z<$.length)if(ZX($[Z]),$[Z])J=J===void 0?$[Z]:J+"/"+$[Z];return J===void 0?".":TJ0(J)}function TJ0($){ZX($);let Z=$.codePointAt(0)===47,J=CJ0($,!Z);if(J.length===0&&!Z)J=".";if(J.length>0&&$.codePointAt($.length-1)===47)J+="/";return Z?"/"+J:J}function CJ0($,Z){let J="",H=0,Q=-1,B=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(Q===X-1||B===1);else if(Q!==X-1&&B===2){if(J.length<2||H!==2||J.codePointAt(J.length-1)!==46||J.codePointAt(J.length-2)!==46){if(J.length>2){if(G=J.lastIndexOf("/"),G!==J.length-1){if(G<0)J="",H=0;else J=J.slice(0,G),H=J.length-1-J.lastIndexOf("/");Q=X,B=0;continue}}else if(J.length>0){J="",H=0,Q=X,B=0;continue}}if(Z)J=J.length>0?J+"/..":"..",H=2}else{if(J.length>0)J+="/"+$.slice(Q+1,X);else J=$.slice(Q+1,X);H=X-Q-1}Q=X,B=0}else if(z===46&&B>-1)B++;else B=-1}return J}function ZX($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var Mu={cwd:wJ0};function wJ0(){return"/"}function ZH($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function Pu($){if(typeof $==="string")$=new URL($);else if(!ZH($)){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 EJ0($)}function EJ0($){if($.hostname!==""){let H=TypeError('File URL host must be "localhost" or empty on darwin');throw H.code="ERR_INVALID_FILE_URL_HOST",H}let Z=$.pathname,J=-1;while(++J<Z.length)if(Z.codePointAt(J)===37&&Z.codePointAt(J+1)===50){let H=Z.codePointAt(J+2);if(H===70||H===102){let Q=TypeError("File URL path must not include encoded / characters");throw Q.code="ERR_INVALID_FILE_URL_PATH",Q}}return decodeURIComponent(Z)}var IM=["history","path","basename","stem","extname","dirname"];class JH{constructor($){let Z;if(!$)Z={};else if(ZH($))Z={path:$};else if(typeof $==="string"||SJ0($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":Mu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<IM.length){let Q=IM[J];if(Q in Z&&Z[Q]!==void 0&&Z[Q]!==null)this[Q]=Q==="history"?[...Z[Q]]:Z[Q]}let H;for(H in Z)if(!IM.includes(H))this[H]=Z[H]}get basename(){return typeof this.path==="string"?Q9.basename(this.path):void 0}set basename($){kM($,"basename"),bM($,"basename"),this.path=Q9.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?Q9.dirname(this.path):void 0}set dirname($){_u(this.basename,"dirname"),this.path=Q9.join($||"",this.basename)}get extname(){return typeof this.path==="string"?Q9.extname(this.path):void 0}set extname($){if(bM($,"extname"),_u(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=Q9.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(ZH($))$=Pu($);if(kM($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?Q9.basename(this.path,this.extname):void 0}set stem($){kM($,"stem"),bM($,"stem"),this.path=Q9.join(this.dirname||"",$+(this.extname||""))}fail($,Z,J){let H=this.message($,Z,J);throw H.fatal=!0,H}info($,Z,J){let H=this.message($,Z,J);return H.fatal=void 0,H}message($,Z,J){let H=new K2($,Z,J);if(this.path)H.name=this.path+":"+H.name,H.file=this.path;return H.fatal=!1,this.messages.push(H),H}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function bM($,Z){if($&&$.includes(Q9.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+Q9.sep+"`")}function kM($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function _u($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function SJ0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var ju=function($){let H=this.constructor.prototype,Q=H[$],B=function(){return Q.apply(B,arguments)};return Object.setPrototypeOf(B,H),B};var RJ0={}.hasOwnProperty;class vM extends ju{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=RM()}copy(){let $=new vM,Z=-1;while(++Z<this.attachers.length){let J=this.attachers[Z];$.use(...J)}return $.data(QW.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return hM("data",this.frozen),this.namespace[$]=Z,this;return RJ0.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return hM("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,...J]=this.attachers[this.freezeIndex];if(J[0]===!1)continue;if(J[0]===!0)J[0]=void 0;let H=Z.call($,...J);if(typeof H==="function")this.transformers.use(H)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=HW($),J=this.parser||this.Parser;return yM("parse",J),J(String(Z),Z)}process($,Z){let J=this;return this.freeze(),yM("process",this.parser||this.Parser),xM("process",this.compiler||this.Compiler),Z?H(void 0,Z):new Promise(H);function H(Q,B){let X=HW($),z=J.parse(X);J.run(z,X,function(U,K,Y){if(U||!K||!Y)return G(U);let F=K,W=J.stringify(F,Y);if(bJ0(W))Y.value=W;else Y.result=W;G(U,Y)});function G(U,K){if(U||!K)B(U);else if(Q)Q(K);else n1(Z,"`done` is defined if `resolve` is not"),Z(void 0,K)}}}processSync($){let Z=!1,J;return this.freeze(),yM("processSync",this.parser||this.Parser),xM("processSync",this.compiler||this.Compiler),this.process($,H),Tu("processSync","process",Z),n1(J,"we either bailed on an error or have a tree"),J;function H(Q,B){Z=!0,SM(Q),J=B}}run($,Z,J){Ou($),this.freeze();let H=this.transformers;if(!J&&typeof Z==="function")J=Z,Z=void 0;return J?Q(void 0,J):new Promise(Q);function Q(B,X){n1(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=HW(Z);H.run($,z,G);function G(U,K,Y){let F=K||$;if(U)X(U);else if(B)B(F);else n1(J,"`done` is defined if `resolve` is not"),J(void 0,F,Y)}}}runSync($,Z){let J=!1,H;return this.run($,Z,Q),Tu("runSync","run",J),n1(H,"we either bailed on an error or have a tree"),H;function Q(B,X){SM(B),H=X,J=!0}}stringify($,Z){this.freeze();let J=HW(Z),H=this.compiler||this.Compiler;return xM("stringify",H),Ou($),H($,J)}use($,...Z){let J=this.attachers,H=this.namespace;if(hM("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,Z);else if(typeof $==="object")if(Array.isArray($))X($);else B($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function Q(G){if(typeof G==="function")z(G,[]);else if(typeof G==="object")if(Array.isArray(G)){let[U,...K]=G;z(U,K)}else B(G);else throw TypeError("Expected usable value, not `"+G+"`")}function B(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)H.settings=QW.default(!0,H.settings,G.settings)}function X(G){let U=-1;if(G===null||G===void 0);else if(Array.isArray(G))while(++U<G.length){let K=G[U];Q(K)}else throw TypeError("Expected a list of plugins, not `"+G+"`")}function z(G,U){let K=-1,Y=-1;while(++K<J.length)if(J[K][0]===G){Y=K;break}if(Y===-1)J.push([G,...U]);else if(U.length>0){let[F,...W]=U,q=J[Y][1];if($X(q)&&$X(F))F=QW.default(!0,q,F);J[Y]=[G,F,...W]}}}}var gM=new vM().freeze();function yM($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function xM($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function hM($,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 Ou($){if(!$X($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function Tu($,Z,J){if(!J)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function HW($){return IJ0($)?$:new JH($)}function IJ0($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function bJ0($){return typeof $==="string"||kJ0($)}function kJ0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var yJ0="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cu=[],wu={allowDangerousHtml:!0},xJ0=/^(https?|ircs?|mailto|xmpp)$/i,hJ0=[{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 BW($){let Z=vJ0($),J=gJ0($);return fJ0(Z.runSync(Z.parse(J),J),$)}function vJ0($){let Z=$.rehypePlugins||Cu,J=$.remarkPlugins||Cu,H=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...wu}:wu;return gM().use(dF).use(J).use(ZW,H).use(Z)}function gJ0($){let Z=$.children||"",J=new JH;if(typeof Z==="string")J.value=Z;else CF("Unexpected value `"+Z+"` for `children` prop, expected `string`");return J}function fJ0($,Z){let{allowedElements:J,allowElement:H,components:Q,disallowedElements:B,skipHtml:X,unwrapDisallowed:z}=Z,G=Z.urlTransform||XW;for(let K of hJ0)if(Object.hasOwn(Z,K.from))CF("Unexpected `"+K.from+"` prop, "+(K.to?"use `"+K.to+"` instead":"remove it")+" (see <"+yJ0+"#"+K.id+"> for more info)");if(J&&B)CF("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return b3($,U),XM($,{Fragment:HH.Fragment,components:Q,ignoreInvalidStyle:!0,jsx:HH.jsx,jsxs:HH.jsxs,passKeys:!0,passNode:!0});function U(K,Y,F){if(K.type==="raw"&&F&&typeof Y==="number"){if(X)F.children.splice(Y,1);else F.children[Y]={type:"text",value:K.value};return Y}if(K.type==="element"){let W;for(W in pB)if(Object.hasOwn(pB,W)&&Object.hasOwn(K.properties,W)){let q=K.properties[W],N=pB[W];if(N===null||N.includes(K.tagName))K.properties[W]=G(String(q||""),W,K)}}if(K.type==="element"){let W=J?!J.includes(K.tagName):B?B.includes(K.tagName):!1;if(!W&&H&&typeof Y==="number")W=!H(K,Y,F);if(W&&F&&typeof Y==="number"){if(z&&K.children)F.children.splice(Y,1,...K.children);else F.children.splice(Y,1);return Y}}}}function XW($){let Z=$.indexOf(":"),J=$.indexOf("?"),H=$.indexOf("#"),Q=$.indexOf("/");if(Z===-1||Q!==-1&&Z>Q||J!==-1&&Z>J||H!==-1&&Z>H||xJ0.test($.slice(0,Z)))return $;return""}var zW=function($,Z,J){let H=$3(J);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(H($.children[Z],Z,$))return $.children[Z];return};var k3=function($){if($===null||$===void 0)return pJ0;if(typeof $==="string")return uJ0($);if(typeof $==="object")return mJ0($);if(typeof $==="function")return fM($);throw Error("Expected function, string, or array as `test`")};function mJ0($){let Z=[],J=-1;while(++J<$.length)Z[J]=k3($[J]);return fM(H);function H(...Q){let B=-1;while(++B<Z.length)if(Z[B].apply(this,Q))return!0;return!1}}function uJ0($){return fM(Z);function Z(J){return J.tagName===$}}function fM($){return Z;function Z(J,H,Q){return Boolean(cJ0(J)&&$.call(this,J,typeof H==="number"?H:void 0,Q||void 0))}}function pJ0($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function cJ0($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var Su=/\n/g,Ru=/[\t ]+/g,mM=k3("br"),Iu=k3(nJ0),dJ0=k3("p"),bu=k3("tr"),lJ0=k3(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",oJ0,sJ0]),ku=k3(["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 uM($,Z){let J=Z||{},H="children"in $?$.children:[],Q=ku($),B=hu($,{whitespace:J.whitespace||"normal",breakBefore:!1,breakAfter:!1}),X=[];if($.type==="text"||$.type==="comment")X.push(...xu($,{whitespace:B,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<H.length)X.push(...yu(H[z],$,{whitespace:B,breakBefore:z?void 0:Q,breakAfter:z<H.length-1?mM(H[z+1]):Q}));let G=[],U;z=-1;while(++z<X.length){let K=X[z];if(typeof K==="number"){if(U!==void 0&&K>U)U=K}else if(K){if(U!==void 0&&U>-1)G.push(`
|
|
31
|
-
`.repeat(U)||" ");U=-1,G.push(K)}}return G.join("")}function yu($,Z,J){if($.type==="element")return iJ0($,Z,J);if($.type==="text")return J.whitespace==="normal"?xu($,J):rJ0($);return[]}function iJ0($,Z,J){let H=hu($,J),Q=$.children||[],B=-1,X=[];if(lJ0($))return X;let z,G;if(mM($))G=`
|
|
32
|
-
`;else if(bu($)&&zW(Z,$,bu))G=`
|
|
33
|
-
`;else if(dJ0($))z=2,G=2;else if(ku($))z=1,G=1;while(++B<Q.length)X=X.concat(yu(Q[B],$,{whitespace:H,breakBefore:B?void 0:z,breakAfter:B<Q.length-1?mM(Q[B+1]):G}));if(Iu($)&&zW(Z,$,Iu))X.push("\t");if(z)X.unshift(z);if(G)X.push(G);return X}function xu($,Z){let J=String($.value),H=[],Q=[],B=0;while(B<=J.length){Su.lastIndex=B;let G=Su.exec(J),U=G&&"index"in G?G.index:J.length;H.push(aJ0(J.slice(B,U).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),B===0?Z.breakBefore:!0,U===J.length?Z.breakAfter:!0)),B=U+1}let X=-1,z;while(++X<H.length)if(H[X].charCodeAt(H[X].length-1)===8203||X<H.length-1&&H[X+1].charCodeAt(0)===8203)Q.push(H[X]),z=void 0;else if(H[X]){if(typeof z==="number")Q.push(z);Q.push(H[X]),z=0}else if(X===0||X===H.length-1)Q.push(0);return Q}function rJ0($){return[String($.value)]}function aJ0($,Z,J){let H=[],Q=0,B;while(Q<$.length){Ru.lastIndex=Q;let X=Ru.exec($);if(B=X?X.index:$.length,!Q&&!B&&X&&!Z)H.push("");if(Q!==B)H.push($.slice(Q,B));Q=X?B+X[0].length:B}if(Q!==B&&!J)H.push("");return H.join(" ")}function hu($,Z){if($.type==="element"){let J=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return J.wrap?"pre-wrap":"pre";case"td":case"th":return J.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function oJ0($){return Boolean(($.properties||{}).hidden)}function nJ0($){return $.tagName==="td"||$.tagName==="th"}function sJ0($){return $.tagName==="dialog"&&!($.properties||{}).open}function tJ0($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",Q="[a-zA-Z_]\\w*::",B="<[^<>]+>",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)",U={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})"/})]},K={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(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["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"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],A=["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"],V=["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"],j={type:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:A},M={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},_=[M,Y,z,J,$.C_BLOCK_COMMENT_MODE,K,U],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:_.concat([{begin:/\(/,end:/\)/,keywords:j,contains:_.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:j,relevance:0},{begin:W,returnBegin:!0,contains:[F],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[U,K]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,K,z,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,K,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(E,C,M,_,[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:j,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function vu($){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"]},J=tJ0($),H=J.keywords;return H.type=[...H.type,...Z.type],H.literal=[...H.literal,...Z.literal],H.built_in=[...H.built_in,...Z.built_in],H._hints=Z._hints,J.name="Arduino",J.aliases=["ino"],J.supersetOf="cpp",J}function gu($){let Z=$.regex,J={},H={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[J]}]};Object.assign(J,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},H]});let Q={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},B=$.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,J,Q]};Q.contains.push(z);let G={match:/\\"/},U={className:"string",begin:/'/,end:/'/},K={match:/\\'/},Y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,J]},F=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],W=$.SHEBANG({binary:`(${F.join("|")})`,relevance:10}),q={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],A=["true","false"],V={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],L=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["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:N,literal:A,built_in:[...D,...L,"set","shopt",...j,...M]},contains:[W,$.SHEBANG(),q,Y,B,X,V,z,G,U,K,J]}}function fu($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",Q="[a-zA-Z_]\\w*::",B="<[^<>]+>",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)",U={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})"/})]},K={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(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",A={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"},V=[Y,z,J,$.C_BLOCK_COMMENT_MODE,K,U],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:V.concat([{begin:/\(/,end:/\)/,keywords:A,contains:V.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:A,relevance:0},{begin:W,returnBegin:!0,contains:[$.inherit(F,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,K,z,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,K,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C",aliases:["h"],keywords:A,disableAutodetect:!0,illegal:"</",contains:[].concat(D,L,V,[Y,{begin:$.IDENT_RE+"::",keywords:A},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:Y,strings:U,keywords:A}}}function mu($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",Q="[a-zA-Z_]\\w*::",B="<[^<>]+>",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)",U={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})"/})]},K={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(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["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"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],A=["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"],V=["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"],j={type:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:A},M={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},_=[M,Y,z,J,$.C_BLOCK_COMMENT_MODE,K,U],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:_.concat([{begin:/\(/,end:/\)/,keywords:j,contains:_.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:j,relevance:0},{begin:W,returnBegin:!0,contains:[F],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[U,K]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,K,z,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,K,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(E,C,M,_,[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:j,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function uu($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],J=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],H=["default","false","null","true"],Q=["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"],B=["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:Q.concat(B),built_in:Z,literal:H},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},U={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},K={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},Y=$.inherit(K,{illegal:/\n/}),F={className:"subst",begin:/\{/,end:/\}/,keywords:X},W=$.inherit(F,{illegal:/\n/}),q={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,W]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},F]},A=$.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},W]});F.contains=[N,q,K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.C_BLOCK_COMMENT_MODE],W.contains=[A,q,Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let V={variants:[U,N,q,K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},L=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",j={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"}},V,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:"("+L+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:X,contains:[{beginKeywords:J.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:[V,G,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},j]}}var eJ0=($)=>{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_-]*/}}},$H0=["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"],ZH0=["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"],JH0=[...$H0,...ZH0],HH0=["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(),QH0=["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(),BH0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),XH0=["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 pu($){let Z=$.regex,J=eJ0($),H={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},Q="and or not only",B=/@-?\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:[J.BLOCK_COMMENT,H,J.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},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+QH0.join("|")+")"},{begin:":(:)?("+BH0.join("|")+")"}]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+XH0.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[J.BLOCK_COMMENT,J.HEXCOLOR,J.IMPORTANT,J.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}]},J.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:B},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:HH0.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,J.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+JH0.join("|")+")\\b"}]}}function cu($){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 du($){let B={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:B,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:B,illegal:/["']/}]}]}}function lu($){let Z=$.regex,J=/[_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(J,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function iu($){let Z=$.regex,J={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},H=$.COMMENT();H.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let Q={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},B={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:[H,B,Q,X,J,"self"],relevance:0},G=/[A-Za-z0-9_-]+/,U=/"(\\"|[^"])*"/,K=/'[^']*'/,Y=Z.either(G,U,K),F=Z.concat(Y,"(\\s*\\.\\s*",Y,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[H,{className:"section",begin:/\[+/,end:/\]+/},{begin:F,className:"attr",starts:{end:/$/,contains:[H,z,B,Q,X,J]}}]}}var QH="[0-9](_*[0-9])*",GW=`\\.(${QH})`,UW="[0-9a-fA-F](_*[0-9a-fA-F])*",ru={className:"number",variants:[{begin:`(\\b(${QH})((${GW})|\\.)?|(${GW}))[eE][+-]?(${QH})[fFdD]?\\b`},{begin:`\\b(${QH})((${GW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${GW})[fFdD]?\\b`},{begin:`\\b(${QH})[fFdD]\\b`},{begin:`\\b0[xX]((${UW})\\.?|(${UW})?\\.(${UW}))[pP][+-]?(${QH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${UW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function au($,Z,J){if(J===-1)return"";return $.replace(Z,(H)=>{return au($,Z,J-1)})}function ou($){let Z=$.regex,J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+au("(?:<"+"[À-ʸ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"]},U={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},K={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:[K,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+H+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:G,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,ru,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},ru,U]}}var zH0=["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"],GH0=["true","false","null","undefined","NaN","Infinity"],nu=["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"],su=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tu=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],UH0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],KH0=[].concat(tu,nu,su);function eu($){let Z=$.regex,J=(v,{after:f})=>{let w="</"+v[0].slice(1);return v.input.indexOf(w,f)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",Q={begin:"<>",end:"</>"},B=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,f)=>{let w=v[0].length+v.index,i=v.input[w];if(i==="<"||i===","){f.ignoreMatch();return}if(i===">"){if(!J(v,{after:w}))f.ignoreMatch()}let r,x=v.input.substring(w);if(r=x.match(/^\s*=/)){f.ignoreMatch();return}if(r=x.match(/^\s+extends\s+/)){if(r.index===0){f.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:zH0,literal:GH0,built_in:KH0,"variable.language":UH0},G="[0-9](_?[0-9])*",U="\\.([0-9](_?[0-9])*)",K="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},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},A={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,F]},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]},L=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,A,{match:/\$\d+/},Y];F.contains=L.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(L)});let j=[].concat(D,F.contains),M=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(j)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},E={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"}}]},C={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:{_:[...nu,...su]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={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:[_],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function y(v){return Z.concat("(?!",v.join("|"),")")}let S={match:Z.concat(/\b/,y([...tu,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},O={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},k={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",h={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,A,D,{match:/\$\d+/},Y,C,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},h,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.REGEXP_MODE,{className:"function",begin:b,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:Q.begin,end:Q.end},{match:B},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},S,I,E,k,{match:/\$[(.]/}]}}function $p($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},J={match:/[{}[\],:]/,className:"punctuation",relevance:0},H=["true","false","null"],Q={scope:"literal",beginKeywords:H.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:H},contains:[Z,J,$.QUOTE_STRING_MODE,Q,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var BH="[0-9](_*[0-9])*",KW=`\\.(${BH})`,YW="[0-9a-fA-F](_*[0-9a-fA-F])*",YH0={className:"number",variants:[{begin:`(\\b(${BH})((${KW})|\\.)?|(${KW}))[eE][+-]?(${BH})[fFdD]?\\b`},{begin:`\\b(${BH})((${KW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${KW})[fFdD]?\\b`},{begin:`\\b(${BH})[fFdD]\\b`},{begin:`\\b0[xX]((${YW})\\.?|(${YW})?\\.(${YW}))[pP][+-]?(${BH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${YW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Zp($){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"},J={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},H={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},Q={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},B={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},X={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[B,Q]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,B,Q]}]};Q.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"]}]},U=YH0,K=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),Y={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},F=Y;return F.variants[1].contains=[Y],Y.variants[1].contains=[F],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,K,J,H,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,K],relevance:0},$.C_LINE_COMMENT_MODE,K,z,G,X,$.C_NUMBER_MODE]},K]},{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:`
|
|
34
|
-
`},U]}}var FH0=($)=>{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_-]*/}}},WH0=["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"],qH0=["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"],NH0=[...WH0,...qH0],VH0=["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(),Jp=["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(),Hp=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),AH0=["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(),DH0=Jp.concat(Hp).sort().reverse();function Qp($){let Z=FH0($),J=DH0,H="and or not only",Q="[\\w-]+",B="([\\w-]+|@\\{[\\w-]+\\})",X=[],z=[],G=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},U=function(L,j,M){return{className:L,begin:j,relevance:M}},K={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:VH0.join(" ")},Y={begin:"\\(",end:"\\)",contains:z,keywords:K,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,U("variable","@@?[\\w-]+",10),U("variable","@\\{[\\w-]+\\}"),U("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let F=z.concat({begin:/\{/,end:/\}/,contains:X}),W={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},q={begin:B+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+AH0.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:K,returnEnd:!0,contains:z,relevance:0}},A={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:F}},V={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:B,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,W,U("keyword","all\\b"),U("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+NH0.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,U("selector-tag",B,0),U("selector-id","#"+B),U("selector-class","\\."+B,0),U("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Jp.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Hp.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:F},{begin:"!important"},Z.FUNCTION_DISPATCH]},D={begin:`[\\w-]+:(:)?(${J.join("|")})`,returnBegin:!0,contains:[V]};return X.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,N,A,D,q,V,W,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:X}}function Bp($){let H={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},Q=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[H],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:Q.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:Q}].concat(Q)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[H],relevance:5}])}}function Xp($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},J={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},H={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,J]},Q={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},B={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,J,H,Q,B,X]}}function zp($){let Z=$.regex,J={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},H={begin:"^[-\\*]{3,}",end:"$"},Q={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}]},B={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}]},U={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},K={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},Y=$.inherit(U,{contains:[]}),F=$.inherit(K,{contains:[]});U.contains.push(F),K.contains.push(Y);let W=[J,G];return[U,K,Y,F].forEach((V)=>{V.contains=V.contains.concat(W)}),W=W.concat(U,K),{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}]}]},J,B,U,K,{className:"quote",begin:"^>\\s+",contains:W,end:"$"},Q,H,G,X,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Gp($){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+"},J=/[a-zA-Z@][a-zA-Z0-9_]*/,z={"variable.language":["this","super"],$pattern:J,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:J,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 Up($){let Z=$.regex,J=["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"],H=/[dualxmsipngr]{0,12}/,Q={$pattern:/[\w.]+/,keyword:J.join(" ")},B={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:Q},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]},U={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},K=[$.BACKSLASH_ESCAPE,B,G],Y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],F=(N,A,V="\\1")=>{let D=V==="\\1"?V:Z.concat(V,A);return Z.concat(Z.concat("(?:",N,")"),A,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,V,H)},W=(N,A,V)=>{return Z.concat(Z.concat("(?:",N,")"),A,/(?:\\.|[^\\\/])*?/,V,H)},q=[G,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),X,{className:"string",contains:K,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}]},U,{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:F("s|tr|y",Z.either(...Y,{capture:!0}))},{begin:F("s|tr|y","\\(","\\)")},{begin:F("s|tr|y","\\[","\\]")},{begin:F("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,U]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return B.contains=q,X.contains=q,{name:"Perl",aliases:["pl","pm"],keywords:Q,contains:q}}function Kp($){let Z=$.regex,J=/(?![A-Za-z0-9])(?![$])/,H=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,J),Q=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,J),B=Z.concat(/[A-Z]+/,J),X={scope:"variable",match:"\\$+"+H},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},G={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},U=$.inherit($.APOS_STRING_MODE,{illegal:null}),K=$.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":(O,k)=>{k.data._beginMatch=O[1]||O[2]},"on:end":(O,k)=>{if(k.data._beginMatch!==O[1])k.ignoreMatch()}},F=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),W=`[
|
|
35
|
-
]`,q={scope:"string",variants:[K,U,Y,F]},N={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},A=["false","null","true"],V=["__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"],j={keyword:V,literal:((O)=>{let k=[];return O.forEach((b)=>{if(k.push(b),b.toLowerCase()===b)k.push(b.toUpperCase());else k.push(b.toLowerCase())}),k})(A),built_in:D},M=(O)=>{return O.map((k)=>{return k.replace(/\|\d+$/,"")})},_={variants:[{match:[/new/,Z.concat(`[
|
|
36
|
-
]`,"+"),Z.concat("(?!",M(D).join("\\b|"),"\\b)"),Q],scope:{1:"keyword",4:"title.class"}}]},E=Z.concat(H,"\\b(?!\\()"),C={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[Q,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[Q,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[Q,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:Z.concat(H,Z.lookahead(":"),Z.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[R,X,C,$.C_BLOCK_COMMENT_MODE,q,N,_]},I={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",M(V).join("\\b|"),"|",M(D).join("\\b|"),"\\b)"),H,Z.concat(`[
|
|
37
|
-
]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(I);let y=[R,C,$.C_BLOCK_COMMENT_MODE,q,N,_],S={begin:Z.concat(/#\[\s*\\?/,Z.either(Q,B)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:A,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:A,keyword:["new","array"]},contains:["self",...y]},...y,{scope:"meta",variants:[{match:Q},{match:B}]}]};return{case_insensitive:!1,keywords:j,contains:[S,$.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,I,C,{match:[/const/,/\s/,H],scope:{1:"keyword",3:"variable.constant"}},_,{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:j,contains:["self",S,X,C,$.C_BLOCK_COMMENT_MODE,q,N]}]},{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]},q,N]}}function Yp($){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 Fp($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Wp($){let Z=$.regex,J=/[\p{XID_Start}_]\p{XID_Continue}*/u,H=["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:H,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:/^(>>>|\.\.\.) /},U={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},K={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,K,U]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G,K,U]},{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,K,U]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,K,U]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},F="[0-9](_?[0-9])*",W="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",q=`\\b|${H.join("|")}`,N={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]?(?=${q})`},{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]?(?=${q})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${q})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${q})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${q})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${q})`}]},A={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:z,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},V={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",G,N,Y,$.HASH_COMMENT_MODE]}]};return U.contains=[Y,N,G],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[G,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},Y,A,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,J],scope:{1:"keyword",3:"title.function"},contains:[V]},{variants:[{match:[/\bclass/,/\s+/,J,/\s*/,/\(\s*/,J,/\s*\)/]},{match:[/\bclass/,/\s+/,J]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,V,Y]}]}}function qp($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Np($){let Z=$.regex,J=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,H=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]?/),Q=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,B=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:J,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:J},{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:[Q,H]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,H]},{scope:{1:"punctuation",2:"number"},match:[B,H]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,H]}]},{scope:{3:"operator"},match:[J,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:Q},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:B},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Vp($){let Z=$.regex,J="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",H=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),Q=Z.concat(H,/(::\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:">"},U=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],K={className:"subst",begin:/#\{/,end:/\}/,keywords:X},Y={className:"string",contains:[$.BACKSLASH_ESCAPE,K],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,K]})]}]},F="[1-9](_?[0-9])*|0",W="[0-9](_?[0-9])*",q={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"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:X}]},_=[Y,{variants:[{match:[/class\s+/,Q,/\s+<\s+/,Q]},{match:[/\b(class|module)\s+/,Q]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:X},{match:[/(include|extend)\s+/,Q],scope:{2:"title.class"},keywords:X},{relevance:0,match:[Q,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:H,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[Y,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},q,{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,K],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,U),relevance:0}].concat(G,U);K.contains=_,N.contains=_;let E="[>?]>",C="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",R="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",T=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+E+"|"+C+"|"+R+")(?=[ ])",starts:{end:"$",keywords:X,contains:_}}];return U.unshift(G),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:X,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(T).concat(U).concat(_)}}function Ap($){let Z=$.regex,J=/(r#)?/,H=Z.concat(J,$.UNDERSCORE_IDENT_RE),Q=Z.concat(J,$.IDENT_RE),B={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,Q,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"],U=["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!"],K=["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:K,keyword:z,literal:G,built_in:U},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+/,H],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,H],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,H,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:U,type:K}},{className:"punctuation",begin:"->"},B]}}var LH0=($)=>{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_-]*/}}},MH0=["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"],PH0=["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"],_H0=[...MH0,...PH0],jH0=["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(),OH0=["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(),TH0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),CH0=["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 Dp($){let Z=LH0($),J=TH0,H=OH0,Q="@[a-z-]+",B="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("+_H0.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+H.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+J.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+CH0.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:jH0.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 Lp($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Mp($){let Z=$.regex,J=$.COMMENT("--","$"),H={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},Q={begin:/"/,end:/"/,contains:[{match:/""/}]},B=["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"],U=["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"],K=["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"],F=["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=K,q=[...U,...G].filter((M)=>{return!K.includes(M)}),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},A={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},V={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((_)=>{return _.replace(/\s+/,"\\s+")})),/\b/)}let L={scope:"keyword",match:D(F),relevance:0};function j(M,{exceptions:_,when:E}={}){let C=E;return _=_||[],M.map((R)=>{if(R.match(/\|\d+$/)||_.includes(R))return R;else if(C(R))return`${R}|0`;else return R})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(q,{when:(M)=>M.length<3}),literal:B,type:z,built_in:Y},contains:[{scope:"type",match:D(X)},L,V,N,H,Q,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,J,A]}}function Op($){if(!$)return null;if(typeof $==="string")return $;return $.source}function JX($){return P5("(?=",$,")")}function P5(...$){return $.map((J)=>Op(J)).join("")}function wH0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function C4(...$){return"("+(wH0($).capture?"":"?:")+$.map((H)=>Op(H)).join("|")+")"}var dM=($)=>P5(/\b/,$,/\w$/.test($)?/\b/:/\B/),EH0=["Protocol","Type"].map(dM),Pp=["init","self"].map(dM),SH0=["Any","Self"],pM=["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"],_p=["false","nil","true"],RH0=["assignment","associativity","higherThan","left","lowerThan","none","right"],IH0=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],jp=["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"],Tp=C4(/[/=\-+!*%<>&|^~?]/,/[\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]/),Cp=C4(Tp,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),cM=P5(Tp,Cp,"*"),wp=C4(/[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]/),WW=C4(wp,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Z3=P5(wp,WW,"*"),FW=P5(/[A-Z]/,WW,"*"),bH0=["attached","autoclosure",P5(/convention\(/,C4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",P5(/objc\(/,Z3,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],kH0=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ep($){let Z={match:/\s+/,relevance:0},J=$.COMMENT("/\\*","\\*/",{contains:["self"]}),H=[$.C_LINE_COMMENT_MODE,J],Q={match:[/\./,C4(...EH0,...Pp)],className:{2:"keyword"}},B={match:P5(/\./,C4(...pM)),relevance:0},X=pM.filter((F0)=>typeof F0==="string").concat(["_|0"]),z=pM.filter((F0)=>typeof F0!=="string").concat(SH0).map(dM),G={variants:[{className:"keyword",match:C4(...z,...Pp)}]},U={$pattern:C4(/\b\w+/,/#\w+/),keyword:X.concat(IH0),literal:_p},K=[Q,B,G],Y={match:P5(/\./,C4(...jp)),relevance:0},F={className:"built_in",match:P5(/\b/,C4(...jp),/(?=\()/)},W=[Y,F],q={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:cM},{match:`\\.(\\.|${Cp})+`}]},A=[q,N],V="([0-9]_*)+",D="([0-9a-fA-F]_*)+",L={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/}]},j=(F0="")=>({className:"subst",variants:[{match:P5(/\\/,F0,/[0\\tnr"']/)},{match:P5(/\\/,F0,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(F0="")=>({className:"subst",match:P5(/\\/,F0,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(F0="")=>({className:"subst",label:"interpol",begin:P5(/\\/,F0,/\(/),end:/\)/}),E=(F0="")=>({begin:P5(F0,/"""/),end:P5(/"""/,F0),contains:[j(F0),M(F0),_(F0)]}),C=(F0="")=>({begin:P5(F0,/"/),end:P5(/"/,F0),contains:[j(F0),_(F0)]}),R={className:"string",variants:[E(),E("#"),E("##"),E("###"),C(),C("#"),C("##"),C("###")]},T=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],I={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},y=(F0)=>{let n=P5(F0,/\//),a=P5(/\//,F0);return{begin:n,end:a,contains:[...T,{scope:"comment",begin:`#(?!.*${a})`,end:/$/}]}},S={scope:"regexp",variants:[y("###"),y("##"),y("#"),I]},O={match:P5(/`/,Z3,/`/)},k={className:"variable",match:/\$\d+/},b={className:"variable",match:`\\$${WW}+`},h=[O,k,b],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:kH0,contains:[...A,L,R]}]}},f={scope:"keyword",match:P5(/@/,C4(...bH0),JX(C4(/\(/,/\s+/)))},w={scope:"meta",match:P5(/@/,Z3)},i=[v,f,w],r={match:JX(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:P5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,WW,"+")},{className:"type",match:FW,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:P5(/\s+&\s+/,JX(FW)),relevance:0}]},x={begin:/</,end:/>/,keywords:U,contains:[...H,...K,...i,q,r]};r.contains.push(x);let l={match:P5(Z3,/\s*:/),keywords:"_|0",relevance:0},s={begin:/\(/,end:/\)/,relevance:0,keywords:U,contains:["self",l,...H,S,...K,...W,...A,L,R,...h,...i,r]},p={begin:/</,end:/>/,keywords:"repeat each",contains:[...H,r]},d={begin:C4(JX(P5(Z3,/\s*:/)),JX(P5(Z3,/\s+/,Z3,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Z3}]},o={begin:/\(/,end:/\)/,keywords:U,contains:[d,...H,...K,...A,L,R,...i,r,s],endsParent:!0,illegal:/["']/},Z0={match:[/(func|macro)/,/\s+/,C4(O.match,Z3,cM)],className:{1:"keyword",3:"title.function"},contains:[p,o,Z],illegal:[/\[/,/%/]},H0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[p,o,Z],illegal:/\[|%/},G0={match:[/operator/,/\s+/,cM],className:{1:"keyword",3:"title"}},X0={begin:[/precedencegroup/,/\s+/,FW],className:{1:"keyword",3:"title"},contains:[r],keywords:[...RH0,..._p],end:/}/},Y0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},A0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},N0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Z3,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:U,contains:[p,...K,{begin:/:/,end:/\{/,keywords:U,contains:[{scope:"title.class.inherited",match:FW},...K],relevance:0}]};for(let F0 of R.variants){let n=F0.contains.find((e)=>e.label==="interpol");n.keywords=U;let a=[...K,...W,...A,L,R,...h];n.contains=[...a,{begin:/\(/,end:/\)/,contains:["self",...a]}]}return{name:"Swift",keywords:U,contains:[...H,Z0,H0,Y0,A0,N0,G0,X0,{beginKeywords:"import",end:/$/,contains:[...H],relevance:0},S,...K,...W,...A,L,R,...h,...i,r,s]}}var Sp=["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"],Rp=["true","false","null","undefined","NaN","Infinity"],Ip=["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"],bp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],kp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],yp=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],xp=[].concat(kp,Ip,bp);function yH0($){let Z=$.regex,J=(v,{after:f})=>{let w="</"+v[0].slice(1);return v.input.indexOf(w,f)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",Q={begin:"<>",end:"</>"},B=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,f)=>{let w=v[0].length+v.index,i=v.input[w];if(i==="<"||i===","){f.ignoreMatch();return}if(i===">"){if(!J(v,{after:w}))f.ignoreMatch()}let r,x=v.input.substring(w);if(r=x.match(/^\s*=/)){f.ignoreMatch();return}if(r=x.match(/^\s+extends\s+/)){if(r.index===0){f.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Sp,literal:Rp,built_in:xp,"variable.language":yp},G="[0-9](_?[0-9])*",U="\\.([0-9](_?[0-9])*)",K="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},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},A={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,F]},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]},L=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,A,{match:/\$\d+/},Y];F.contains=L.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(L)});let j=[].concat(D,F.contains),M=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(j)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},E={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"}}]},C={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:{_:[...Ip,...bp]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={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:[_],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function y(v){return Z.concat("(?!",v.join("|"),")")}let S={match:Z.concat(/\b/,y([...kp,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},O={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},k={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",h={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,A,D,{match:/\$\d+/},Y,C,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},h,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.REGEXP_MODE,{className:"function",begin:b,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:Q.begin,end:Q.end},{match:B},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},S,I,E,k,{match:/\$[(.]/}]}}function hp($){let Z=$.regex,J=yH0($),H="[A-Za-z$_][0-9A-Za-z$_]*",Q=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],B={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},X={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:Q},contains:[J.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"],U={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Sp.concat(G),literal:Rp,built_in:xp.concat(Q),"variable.language":yp},K={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},Y=(N,A,V)=>{let D=N.contains.findIndex((L)=>L.label===A);if(D===-1)throw Error("can not find mode to replace");N.contains.splice(D,1,V)};Object.assign(J.keywords,U),J.exports.PARAMS_CONTAINS.push(K);let F=J.contains.find((N)=>N.scope==="attr"),W=Object.assign({},F,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});J.exports.PARAMS_CONTAINS.push([J.exports.CLASS_REFERENCE,F,W]),J.contains=J.contains.concat([K,B,X,W]),Y(J,"shebang",$.SHEBANG()),Y(J,"use_strict",z);let q=J.contains.find((N)=>N.label==="func.def");return q.relevance=0,Object.assign(J,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),J}function vp($){let Z=$.regex,J={className:"string",begin:/"(""|[^/n])"C\b/},H={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},Q=/\d{1,2}\/\d{1,2}\/\d{4}/,B=/\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(B,Q),/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,X,/ *#/)},{begin:Z.concat(/# */,Z.either(B,Q),/ +/,Z.either(X,z),/ *#/)}]},U={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])|[%&])?/}]},K={className:"label",begin:/^\w+:/},Y=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),F=$.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:[J,H,G,U,K,Y,F,{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:[F]}]}}function gp($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let J=$.COMMENT(/;;/,/$/),H=["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"],Q={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},B={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"},U={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:H},contains:[J,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},B,X,Q,$.QUOTE_STRING_MODE,G,U,z]}}function fp($){let Z=$.regex,J=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),H=/[\p{L}0-9._:-]+/u,Q={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},B={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},X=$.inherit(B,{begin:/\(/,end:/\)/}),z=$.inherit($.APOS_STRING_MODE,{className:"string"}),G=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),U={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:H,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[Q]},{begin:/'/,end:/'/,contains:[Q]},{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:[B,G,z,X,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[B,X,G,z]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},Q,{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:[U],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[U],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Z.concat(/</,Z.lookahead(Z.concat(J,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:J,relevance:0,starts:U}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(J,/>/))),contains:[{className:"name",begin:J,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function mp($){let H={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},Q={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},B={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,Q]},z=$.inherit(X,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),G="[0-9]{4}(-[0-9][0-9]){0,2}",U="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",K="(\\.[0-9]*)?",Y="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",F={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},q={begin:/\{/,end:/\}/,contains:[W],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[W],illegal:"\\n",relevance:0},A=[H,{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"}},F,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},q,N,B,X],V=[...A];return V.pop(),V.push(z),W.contains=V,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:A}}var lM={arduino:vu,bash:gu,c:fu,cpp:mu,csharp:uu,css:pu,diff:cu,go:du,graphql:lu,ini:iu,java:ou,javascript:eu,json:$p,kotlin:Zp,less:Qp,lua:Bp,makefile:Xp,markdown:zp,objectivec:Gp,perl:Up,php:Kp,"php-template":Yp,plaintext:Fp,python:Wp,"python-repl":qp,r:Np,ruby:Vp,rust:Ap,scss:Dp,shell:Lp,sql:Mp,swift:Ep,typescript:hp,vbnet:vp,wasm:gp,xml:fp,yaml:mp};var Kc=P(Uc(),1);var Yc=Kc.default;var Fc={},OQ0="hljs-";function tM($){let Z=Yc.newInstance();if($)B($);return{highlight:J,highlightAuto:H,listLanguages:Q,register:B,registerAlias:X,registered:z};function J(G,U,K){n1(typeof G==="string","expected `string` as `name`"),n1(typeof U==="string","expected `string` as `value`");let Y=K||Fc,F=typeof Y.prefix==="string"?Y.prefix:OQ0;if(!Z.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");Z.configure({__emitter:Wc,classPrefix:F});let W=Z.highlight(U,{ignoreIllegals:!0,language:G});if(W.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:W.errorRaised});let q=W._emitter.root,N=q.data;return N.language=W.language,N.relevance=W.relevance,q}function H(G,U){n1(typeof G==="string","expected `string` as `value`");let Y=(U||Fc).subset||Q(),F=-1,W=0,q;while(++F<Y.length){let N=Y[F];if(!Z.getLanguage(N))continue;let A=J(N,G,U);if(A.data&&A.data.relevance!==void 0&&A.data.relevance>W)W=A.data.relevance,q=A}return q||{type:"root",children:[],data:{language:void 0,relevance:W}}}function Q(){return Z.listLanguages()}function B(G,U){if(typeof G==="string")n1(U!==void 0,"expected `grammar`"),Z.registerLanguage(G,U);else{let K;for(K in G)if(Object.hasOwn(G,K))Z.registerLanguage(K,G[K])}}function X(G,U){if(typeof G==="string")n1(U!==void 0),Z.registerAliases(typeof U==="string"?U:[...U],{languageName:G});else{let K;for(K in G)if(Object.hasOwn(G,K)){let Y=G[K];Z.registerAliases(typeof Y==="string"?Y:[...Y],{languageName:K})}}}function z(G){return Boolean(Z.getLanguage(G))}}class Wc{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],J=Z.children[Z.children.length-1];if(J&&J.type==="text")J.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let J=this.stack[this.stack.length-1],H=$.root.children;if(Z)J.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:H});else J.children.push(...H)}openNode($){let Z=this,J=$.split(".").map(function(B,X){return X?B+"_".repeat(X):Z.options.classPrefix+B}),H=this.stack[this.stack.length-1],Q={type:"element",tagName:"span",properties:{className:J},children:[]};H.children.push(Q),this.stack.push(Q)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var TQ0={};function AW($){let Z=$||TQ0,J=Z.aliases,H=Z.detect||!1,Q=Z.languages||lM,B=Z.plainText,X=Z.prefix,z=Z.subset,G="hljs",U=tM(Q);if(J)U.registerAlias(J);if(X){let K=X.indexOf("-");G=K===-1?X:X.slice(0,K)}return function(K,Y){b3(K,"element",function(F,W,q){if(F.tagName!=="code"||!q||q.type!=="element"||q.tagName!=="pre")return;let N=CQ0(F);if(N===!1||!N&&!H||N&&B&&B.includes(N))return;if(!Array.isArray(F.properties.className))F.properties.className=[];if(!F.properties.className.includes(G))F.properties.className.unshift(G);let A=uM(F,{whitespace:"pre"}),V;try{V=N?U.highlight(N,A,{prefix:X}):U.highlightAuto(A,{prefix:X,subset:z})}catch(D){let L=D;if(N&&/Unknown language/.test(L.message)){Y.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[q,F],cause:L,place:F.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw L}if(!N&&V.data&&V.data.language)F.properties.className.push("language-"+V.data.language);if(V.children.length>0)F.children=V.children})}}function CQ0($){let Z=$.properties.className,J=-1;if(!Array.isArray(Z))return;let H;while(++J<Z.length){let Q=String(Z[J]);if(Q==="no-highlight"||Q==="nohighlight")return!1;if(!H&&Q.slice(0,5)==="lang-")H=Q.slice(5);if(!H&&Q.slice(0,9)==="language-")H=Q.slice(9)}return H}function eM($,Z){let J=String($);if(typeof Z!=="string")throw TypeError("Expected character");let H=0,Q=J.indexOf(Z);while(Q!==-1)H++,Q=J.indexOf(Z,Q+Z.length);return H}function $P($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ZP($,Z,J){let Q=$3((J||{}).ignore||[]),B=wQ0(Z),X=-1;while(++X<B.length)eB($,"text",z);function z(U,K){let Y=-1,F;while(++Y<K.length){let W=K[Y],q=F?F.children:void 0;if(Q(W,q?q.indexOf(W):void 0,F))return;F=W}if(F)return G(U,K)}function G(U,K){let Y=K[K.length-1],F=B[X][0],W=B[X][1],q=0,A=Y.children.indexOf(U),V=!1,D=[];F.lastIndex=0;let L=F.exec(U.value);while(L){let j=L.index,M={index:L.index,input:L.input,stack:[...K,U]},_=W(...L,M);if(typeof _==="string")_=_.length>0?{type:"text",value:_}:void 0;if(_===!1)F.lastIndex=j+1;else{if(q!==j)D.push({type:"text",value:U.value.slice(q,j)});if(Array.isArray(_))D.push(..._);else if(_)D.push(_);q=j+L[0].length,V=!0}if(!F.global)break;L=F.exec(U.value)}if(V){if(q<U.value.length)D.push({type:"text",value:U.value.slice(q)});Y.children.splice(A,1,...D)}else D=[U];return A+D.length}}function wQ0($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let J=!$[0]||Array.isArray($[0])?$:[$],H=-1;while(++H<J.length){let Q=J[H];Z.push([EQ0(Q[0]),SQ0(Q[1])])}return Z}function EQ0($){return typeof $==="string"?new RegExp($P($),"g"):$}function SQ0($){return typeof $==="function"?$:function(){return $}}var JP="phrasing",HP=["autolink","link","image","label"];function BP(){return{transforms:[xQ0],enter:{literalAutolink:RQ0,literalAutolinkEmail:QP,literalAutolinkHttp:QP,literalAutolinkWww:QP},exit:{literalAutolink:yQ0,literalAutolinkEmail:kQ0,literalAutolinkHttp:IQ0,literalAutolinkWww:bQ0}}}function XP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:JP,notInConstruct:HP},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:JP,notInConstruct:HP},{character:":",before:"[ps]",after:"\\/",inConstruct:JP,notInConstruct:HP}]}}function RQ0($){this.enter({type:"link",title:null,url:"",children:[]},$)}function QP($){this.config.enter.autolinkProtocol.call(this,$)}function IQ0($){this.config.exit.autolinkProtocol.call(this,$)}function bQ0($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];n1(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function kQ0($){this.config.exit.autolinkEmail.call(this,$)}function yQ0($){this.exit($)}function xQ0($){ZP($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hQ0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,vQ0]],{ignore:["link","linkReference"]})}function hQ0($,Z,J,H,Q){let B="";if(!qc(Q))return!1;if(/^w/i.test(Z))J=Z+J,Z="",B="http://";if(!gQ0(J))return!1;let X=fQ0(J+H);if(!X[0])return!1;let z={type:"link",title:null,url:B+Z+X[0],children:[{type:"text",value:Z+X[0]}]};if(X[1])return[z,{type:"text",value:X[1]}];return z}function vQ0($,Z,J,H){if(!qc(H,!0)||/[-\d_]$/.test(J))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+J,children:[{type:"text",value:Z+"@"+J}]}}function gQ0($){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 fQ0($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let J=Z[0],H=J.indexOf(")"),Q=eM($,"("),B=eM($,")");while(H!==-1&&Q>B)$+=J.slice(0,H+1),J=J.slice(H+1),H=J.indexOf(")"),B++;return[$,J]}function qc($,Z){let J=$.input.charCodeAt($.index-1);return($.index===0||t9(J)||f$(J))&&(!Z||J!==47)}Nc.peek=aQ0;function mQ0(){this.buffer()}function uQ0($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function pQ0(){this.buffer()}function cQ0($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function dQ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];n1(J.type==="footnoteReference"),J.identifier=G4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function lQ0($){this.exit($)}function iQ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];n1(J.type==="footnoteDefinition"),J.identifier=G4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function rQ0($){this.exit($)}function aQ0(){return"["}function Nc($,Z,J,H){let Q=J.createTracker(H),B=Q.move("[^"),X=J.enter("footnoteReference"),z=J.enter("reference");return B+=Q.move(J.safe(J.associationId($),{after:"]",before:B})),z(),X(),B+=Q.move("]"),B}function zP(){return{enter:{gfmFootnoteCallString:mQ0,gfmFootnoteCall:uQ0,gfmFootnoteDefinitionLabelString:pQ0,gfmFootnoteDefinition:cQ0},exit:{gfmFootnoteCallString:dQ0,gfmFootnoteCall:lQ0,gfmFootnoteDefinitionLabelString:iQ0,gfmFootnoteDefinition:rQ0}}}function GP($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:J,footnoteReference:Nc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function J(H,Q,B,X){let z=B.createTracker(X),G=z.move("[^"),U=B.enter("footnoteDefinition"),K=B.enter("label");if(G+=z.move(B.safe(B.associationId(H),{before:G,after:"]"})),K(),G+=z.move("]:"),H.children&&H.children.length>0)z.shift(4),G+=z.move((Z?`
|
|
38
|
-
`:" ")+B.indentLines(B.containerFlow(H,z.current()),Z?Vc:oQ0));return U(),G}}function oQ0($,Z,J){return Z===0?$:Vc($,Z,J)}function Vc($,Z,J){return(J?"":" ")+$}var nQ0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ac.peek=eQ0;function UP(){return{canContainEols:["delete"],enter:{strikethrough:sQ0},exit:{strikethrough:tQ0}}}function KP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nQ0}],handlers:{delete:Ac}}}function sQ0($){this.enter({type:"delete",children:[]},$)}function tQ0($){this.exit($)}function Ac($,Z,J,H){let Q=J.createTracker(H),B=J.enter("strikethrough"),X=Q.move("~~");return X+=J.containerPhrasing($,{...Q.current(),before:X,after:"~"}),X+=Q.move("~~"),B(),X}function eQ0(){return"~"}function $B0($){return $.length}function Lc($,Z){let J=Z||{},H=(J.align||[]).concat(),Q=J.stringLength||$B0,B=[],X=[],z=[],G=[],U=0,K=-1;while(++K<$.length){let N=[],A=[],V=-1;if($[K].length>U)U=$[K].length;while(++V<$[K].length){let D=ZB0($[K][V]);if(J.alignDelimiters!==!1){let L=Q(D);if(A[V]=L,G[V]===void 0||L>G[V])G[V]=L}N.push(D)}X[K]=N,z[K]=A}let Y=-1;if(typeof H==="object"&&"length"in H)while(++Y<U)B[Y]=Dc(H[Y]);else{let N=Dc(H);while(++Y<U)B[Y]=N}Y=-1;let F=[],W=[];while(++Y<U){let N=B[Y],A="",V="";if(N===99)A=":",V=":";else if(N===108)A=":";else if(N===114)V=":";let D=J.alignDelimiters===!1?1:Math.max(1,G[Y]-A.length-V.length),L=A+"-".repeat(D)+V;if(J.alignDelimiters!==!1){if(D=A.length+D+V.length,D>G[Y])G[Y]=D;W[Y]=D}F[Y]=L}X.splice(1,0,F),z.splice(1,0,W),K=-1;let q=[];while(++K<X.length){let N=X[K],A=z[K];Y=-1;let V=[];while(++Y<U){let D=N[Y]||"",L="",j="";if(J.alignDelimiters!==!1){let M=G[Y]-(A[Y]||0),_=B[Y];if(_===114)L=" ".repeat(M);else if(_===99)if(M%2)L=" ".repeat(M/2+0.5),j=" ".repeat(M/2-0.5);else L=" ".repeat(M/2),j=L;else j=" ".repeat(M)}if(J.delimiterStart!==!1&&!Y)V.push("|");if(J.padding!==!1&&!(J.alignDelimiters===!1&&D==="")&&(J.delimiterStart!==!1||Y))V.push(" ");if(J.alignDelimiters!==!1)V.push(L);if(V.push(D),J.alignDelimiters!==!1)V.push(j);if(J.padding!==!1)V.push(" ");if(J.delimiterEnd!==!1||Y!==U-1)V.push("|")}q.push(J.delimiterEnd===!1?V.join("").replace(/ +$/,""):V.join(""))}return q.join(`
|
|
39
|
-
`)}function ZB0($){return $===null||$===void 0?"":String($)}function Dc($){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 Mc($,Z,J,H){let Q=J.enter("blockquote"),B=J.createTracker(H);B.move("> "),B.shift(2);let X=J.indentLines(J.containerFlow($,B.current()),JB0);return Q(),X}function JB0($,Z,J){return">"+(J?"":" ")+$}function _c($,Z){return Pc($,Z.inConstruct,!0)&&!Pc($,Z.notInConstruct,!1)}function Pc($,Z,J){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return J;let H=-1;while(++H<Z.length)if($.includes(Z[H]))return!0;return!1}function YP($,Z,J,H){let Q=-1;while(++Q<J.unsafe.length)if(J.unsafe[Q].character===`
|
|
40
|
-
`&&_c(J.stack,J.unsafe[Q]))return/[ \t]/.test(H.before)?"":" ";return"\\\n"}function jc($,Z){let J=String($),H=J.indexOf(Z),Q=H,B=0,X=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(H!==-1){if(H===Q){if(++B>X)X=B}else B=1;Q=H+Z.length,H=J.indexOf(Z,Q)}return X}function Oc($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function Tc($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function Cc($,Z,J,H){let Q=Tc(J),B=$.value||"",X=Q==="`"?"GraveAccent":"Tilde";if(Oc($,J)){let Y=J.enter("codeIndented"),F=J.indentLines(B,HB0);return Y(),F}let z=J.createTracker(H),G=Q.repeat(Math.max(jc(B,Q)+1,3)),U=J.enter("codeFenced"),K=z.move(G);if($.lang){let Y=J.enter(`codeFencedLang${X}`);K+=z.move(J.safe($.lang,{before:K,after:" ",encode:["`"],...z.current()})),Y()}if($.lang&&$.meta){let Y=J.enter(`codeFencedMeta${X}`);K+=z.move(" "),K+=z.move(J.safe($.meta,{before:K,after:`
|
|
41
|
-
`,encode:["`"],...z.current()})),Y()}if(K+=z.move(`
|
|
42
|
-
`),B)K+=z.move(B+`
|
|
43
|
-
`);return K+=z.move(G),U(),K}function HB0($,Z,J){return(J?"":" ")+$}function GH($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function wc($,Z,J,H){let Q=GH(J),B=Q==='"'?"Quote":"Apostrophe",X=J.enter("definition"),z=J.enter("label"),G=J.createTracker(H),U=G.move("[");if(U+=G.move(J.safe(J.associationId($),{before:U,after:"]",...G.current()})),U+=G.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(J.safe($.url,{before:U,after:">",...G.current()})),U+=G.move(">");else z=J.enter("destinationRaw"),U+=G.move(J.safe($.url,{before:U,after:$.title?" ":`
|
|
44
|
-
`,...G.current()}));if(z(),$.title)z=J.enter(`title${B}`),U+=G.move(" "+Q),U+=G.move(J.safe($.title,{before:U,after:Q,...G.current()})),U+=G.move(Q),z();return X(),U}function Ec($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function Y7($){return"&#x"+$.toString(16).toUpperCase()+";"}function UH($,Z,J){let H=I3($),Q=I3(Z);if(H===void 0)return Q===void 0?J==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:Q===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(H===1)return Q===void 0?{inside:!1,outside:!1}:Q===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return Q===void 0?{inside:!1,outside:!1}:Q===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}FP.peek=QB0;function FP($,Z,J,H){let Q=Ec(J),B=J.enter("emphasis"),X=J.createTracker(H),z=X.move(Q),G=X.move(J.containerPhrasing($,{after:Q,before:z,...X.current()})),U=G.charCodeAt(0),K=UH(H.before.charCodeAt(H.before.length-1),U,Q);if(K.inside)G=Y7(U)+G.slice(1);let Y=G.charCodeAt(G.length-1),F=UH(H.after.charCodeAt(0),Y,Q);if(F.inside)G=G.slice(0,-1)+Y7(Y);let W=X.move(Q);return B(),J.attentionEncodeSurroundingInfo={after:F.outside,before:K.outside},z+G+W}function QB0($,Z,J){return J.options.emphasis||"*"}function Sc($,Z){let J=!1;return b3($,function(H){if("value"in H&&/\r?\n|\r/.test(H.value)||H.type==="break")return J=!0,d$}),Boolean((!$.depth||$.depth<3)&&v$($)&&(Z.options.setext||J))}function Rc($,Z,J,H){let Q=Math.max(Math.min(6,$.depth||1),1),B=J.createTracker(H);if(Sc($,J)){let K=J.enter("headingSetext"),Y=J.enter("phrasing"),F=J.containerPhrasing($,{...B.current(),before:`
|
|
45
|
-
`,after:`
|
|
46
|
-
`});return Y(),K(),F+`
|
|
47
|
-
`+(Q===1?"=":"-").repeat(F.length-(Math.max(F.lastIndexOf("\r"),F.lastIndexOf(`
|
|
48
|
-
`))+1))}let X="#".repeat(Q),z=J.enter("headingAtx"),G=J.enter("phrasing");B.move(X+" ");let U=J.containerPhrasing($,{before:"# ",after:`
|
|
49
|
-
`,...B.current()});if(/^[\t ]/.test(U))U=Y7(U.charCodeAt(0))+U.slice(1);if(U=U?X+" "+U:X,J.options.closeAtx)U+=" "+X;return G(),z(),U}WP.peek=BB0;function WP($){return $.value||""}function BB0(){return"<"}qP.peek=XB0;function qP($,Z,J,H){let Q=GH(J),B=Q==='"'?"Quote":"Apostrophe",X=J.enter("image"),z=J.enter("label"),G=J.createTracker(H),U=G.move("![");if(U+=G.move(J.safe($.alt,{before:U,after:"]",...G.current()})),U+=G.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(J.safe($.url,{before:U,after:">",...G.current()})),U+=G.move(">");else z=J.enter("destinationRaw"),U+=G.move(J.safe($.url,{before:U,after:$.title?" ":")",...G.current()}));if(z(),$.title)z=J.enter(`title${B}`),U+=G.move(" "+Q),U+=G.move(J.safe($.title,{before:U,after:Q,...G.current()})),U+=G.move(Q),z();return U+=G.move(")"),X(),U}function XB0(){return"!"}NP.peek=zB0;function NP($,Z,J,H){let Q=$.referenceType,B=J.enter("imageReference"),X=J.enter("label"),z=J.createTracker(H),G=z.move("!["),U=J.safe($.alt,{before:G,after:"]",...z.current()});G+=z.move(U+"]["),X();let K=J.stack;J.stack=[],X=J.enter("reference");let Y=J.safe(J.associationId($),{before:G,after:"]",...z.current()});if(X(),J.stack=K,B(),Q==="full"||!U||U!==Y)G+=z.move(Y+"]");else if(Q==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function zB0(){return"!"}VP.peek=GB0;function VP($,Z,J){let H=$.value||"",Q="`",B=-1;while(new RegExp("(^|[^`])"+Q+"([^`]|$)").test(H))Q+="`";if(/[^ \r\n]/.test(H)&&(/^[ \r\n]/.test(H)&&/[ \r\n]$/.test(H)||/^`|`$/.test(H)))H=" "+H+" ";while(++B<J.unsafe.length){let X=J.unsafe[B],z=J.compilePattern(X),G;if(!X.atBreak)continue;while(G=z.exec(H)){let U=G.index;if(H.charCodeAt(U)===10&&H.charCodeAt(U-1)===13)U--;H=H.slice(0,U)+" "+H.slice(G.index+1)}}return Q+H+Q}function GB0(){return"`"}function AP($,Z){let J=v$($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(J===$.url||"mailto:"+J===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}DP.peek=UB0;function DP($,Z,J,H){let Q=GH(J),B=Q==='"'?"Quote":"Apostrophe",X=J.createTracker(H),z,G;if(AP($,J)){let K=J.stack;J.stack=[],z=J.enter("autolink");let Y=X.move("<");return Y+=X.move(J.containerPhrasing($,{before:Y,after:">",...X.current()})),Y+=X.move(">"),z(),J.stack=K,Y}z=J.enter("link"),G=J.enter("label");let U=X.move("[");if(U+=X.move(J.containerPhrasing($,{before:U,after:"](",...X.current()})),U+=X.move("]("),G(),!$.url&&$.title||/[\0- \u007F]/.test($.url))G=J.enter("destinationLiteral"),U+=X.move("<"),U+=X.move(J.safe($.url,{before:U,after:">",...X.current()})),U+=X.move(">");else G=J.enter("destinationRaw"),U+=X.move(J.safe($.url,{before:U,after:$.title?" ":")",...X.current()}));if(G(),$.title)G=J.enter(`title${B}`),U+=X.move(" "+Q),U+=X.move(J.safe($.title,{before:U,after:Q,...X.current()})),U+=X.move(Q),G();return U+=X.move(")"),z(),U}function UB0($,Z,J){return AP($,J)?"<":"["}LP.peek=KB0;function LP($,Z,J,H){let Q=$.referenceType,B=J.enter("linkReference"),X=J.enter("label"),z=J.createTracker(H),G=z.move("["),U=J.containerPhrasing($,{before:G,after:"]",...z.current()});G+=z.move(U+"]["),X();let K=J.stack;J.stack=[],X=J.enter("reference");let Y=J.safe(J.associationId($),{before:G,after:"]",...z.current()});if(X(),J.stack=K,B(),Q==="full"||!U||U!==Y)G+=z.move(Y+"]");else if(Q==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function KB0(){return"["}function KH($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function Ic($){let Z=KH($),J=$.options.bulletOther;if(!J)return Z==="*"?"-":"*";if(J!=="*"&&J!=="+"&&J!=="-")throw Error("Cannot serialize items with `"+J+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(J===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+J+"`) to be different");return J}function bc($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function DW($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function kc($,Z,J,H){let Q=J.enter("list"),B=J.bulletCurrent,X=$.ordered?bc(J):KH(J),z=$.ordered?X==="."?")":".":Ic(J),G=Z&&J.bulletLastUsed?X===J.bulletLastUsed:!1;if(!$.ordered){let K=$.children?$.children[0]:void 0;if((X==="*"||X==="-")&&K&&(!K.children||!K.children[0])&&J.stack[J.stack.length-1]==="list"&&J.stack[J.stack.length-2]==="listItem"&&J.stack[J.stack.length-3]==="list"&&J.stack[J.stack.length-4]==="listItem"&&J.indexStack[J.indexStack.length-1]===0&&J.indexStack[J.indexStack.length-2]===0&&J.indexStack[J.indexStack.length-3]===0)G=!0;if(DW(J)===X&&K){let Y=-1;while(++Y<$.children.length){let F=$.children[Y];if(F&&F.type==="listItem"&&F.children&&F.children[0]&&F.children[0].type==="thematicBreak"){G=!0;break}}}}if(G)X=z;J.bulletCurrent=X;let U=J.containerFlow($,H);return J.bulletLastUsed=X,J.bulletCurrent=B,Q(),U}function yc($){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 xc($,Z,J,H){let Q=yc(J),B=J.bulletCurrent||KH(J);if(Z&&Z.type==="list"&&Z.ordered)B=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(J.options.incrementListMarker===!1?0:Z.children.indexOf($))+B;let X=B.length+1;if(Q==="tab"||Q==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))X=Math.ceil(X/4)*4;let z=J.createTracker(H);z.move(B+" ".repeat(X-B.length)),z.shift(X);let G=J.enter("listItem"),U=J.indentLines(J.containerFlow($,z.current()),K);return G(),U;function K(Y,F,W){if(F)return(W?"":" ".repeat(X))+Y;return(W?B:B+" ".repeat(X-B.length))+Y}}function hc($,Z,J,H){let Q=J.enter("paragraph"),B=J.enter("phrasing"),X=J.containerPhrasing($,H);return B(),Q(),X}var MP=$3(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vc($,Z,J,H){return($.children.some(function(X){return MP(X)})?J.containerPhrasing:J.containerFlow).call(J,$,H)}function gc($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}PP.peek=YB0;function PP($,Z,J,H){let Q=gc(J),B=J.enter("strong"),X=J.createTracker(H),z=X.move(Q+Q),G=X.move(J.containerPhrasing($,{after:Q,before:z,...X.current()})),U=G.charCodeAt(0),K=UH(H.before.charCodeAt(H.before.length-1),U,Q);if(K.inside)G=Y7(U)+G.slice(1);let Y=G.charCodeAt(G.length-1),F=UH(H.after.charCodeAt(0),Y,Q);if(F.inside)G=G.slice(0,-1)+Y7(Y);let W=X.move(Q+Q);return B(),J.attentionEncodeSurroundingInfo={after:F.outside,before:K.outside},z+G+W}function YB0($,Z,J){return J.options.strong||"*"}function fc($,Z,J,H){return J.safe($.value,H)}function mc($){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 uc($,Z,J){let H=(DW(J)+(J.options.ruleSpaces?" ":"")).repeat(mc(J));return J.options.ruleSpaces?H.slice(0,-1):H}var BX={blockquote:Mc,break:YP,code:Cc,definition:wc,emphasis:FP,hardBreak:YP,heading:Rc,html:WP,image:qP,imageReference:NP,inlineCode:VP,link:DP,linkReference:LP,list:kc,listItem:xc,paragraph:hc,root:vc,strong:PP,text:fc,thematicBreak:uc};function jP(){return{enter:{table:FB0,tableData:pc,tableHeader:pc,tableRow:qB0},exit:{codeText:NB0,table:WB0,tableData:_P,tableHeader:_P,tableRow:_P}}}function FB0($){let Z=$._align;n1(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(J){return J==="none"?null:J}),children:[]},$),this.data.inTable=!0}function WB0($){this.exit($),this.data.inTable=void 0}function qB0($){this.enter({type:"tableRow",children:[]},$)}function _P($){this.exit($)}function pc($){this.enter({type:"tableCell",children:[]},$)}function NB0($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,VB0);let J=this.stack[this.stack.length-1];n1(J.type==="inlineCode"),J.value=Z,this.exit($)}function VB0($,Z){return Z==="|"?Z:$}function OP($){let Z=$||{},J=Z.tableCellPadding,H=Z.tablePipeAlign,Q=Z.stringLength,B=J?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
50
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:F,table:X,tableCell:G,tableRow:z}};function X(W,q,N,A){return U(K(W,N,A),W.align)}function z(W,q,N,A){let V=Y(W,N,A),D=U([V]);return D.slice(0,D.indexOf(`
|
|
51
|
-
`))}function G(W,q,N,A){let V=N.enter("tableCell"),D=N.enter("phrasing"),L=N.containerPhrasing(W,{...A,before:B,after:B});return D(),V(),L}function U(W,q){return Lc(W,{align:q,alignDelimiters:H,padding:J,stringLength:Q})}function K(W,q,N){let A=W.children,V=-1,D=[],L=q.enter("table");while(++V<A.length)D[V]=Y(A[V],q,N);return L(),D}function Y(W,q,N){let A=W.children,V=-1,D=[],L=q.enter("tableRow");while(++V<A.length)D[V]=G(A[V],W,q,N);return L(),D}function F(W,q,N){let A=BX.inlineCode(W,q,N);if(N.stack.includes("tableCell"))A=A.replace(/\|/g,"\\$&");return A}}function TP(){return{exit:{taskListCheckValueChecked:cc,taskListCheckValueUnchecked:cc,paragraph:AB0}}}function CP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:DB0}}}function cc($){let Z=this.stack[this.stack.length-2];n1(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function AB0($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let J=this.stack[this.stack.length-1];n1(J.type==="paragraph");let H=J.children[0];if(H&&H.type==="text"){let Q=Z.children,B=-1,X;while(++B<Q.length){let z=Q[B];if(z.type==="paragraph"){X=z;break}}if(X===J){if(H.value=H.value.slice(1),H.value.length===0)J.children.shift();else if(J.position&&H.position&&typeof H.position.start.offset==="number")H.position.start.column++,H.position.start.offset++,J.position.start=Object.assign({},H.position.start)}}}this.exit($)}function DB0($,Z,J,H){let Q=$.children[0],B=typeof $.checked==="boolean"&&Q&&Q.type==="paragraph",X="["+($.checked?"x":" ")+"] ",z=J.createTracker(H);if(B)z.move(X);let G=BX.listItem($,Z,J,{...H,...z.current()});if(B)G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,U);return G;function U(K){return K+X}}function wP(){return[BP(),zP(),UP(),jP(),TP()]}function EP($){return{extensions:[XP(),GP($),KP(),OP($),CP()]}}var LB0={tokenize:OB0,partial:!0},dc={tokenize:TB0,partial:!0},lc={tokenize:CB0,partial:!0},ic={tokenize:wB0,partial:!0},MB0={tokenize:EB0,partial:!0},rc={name:"wwwAutolink",tokenize:_B0,previous:oc},ac={name:"protocolAutolink",tokenize:jB0,previous:nc},y3={name:"emailAutolink",tokenize:PB0,previous:sc},J3={};function RP(){return{text:J3}}var r$=48;while(r$<123)if(J3[r$]=y3,r$++,r$===58)r$=65;else if(r$===91)r$=97;J3[43]=y3;J3[45]=y3;J3[46]=y3;J3[95]=y3;J3[72]=[y3,ac];J3[104]=[y3,ac];J3[87]=[y3,rc];J3[119]=[y3,rc];function PB0($,Z,J){let H=this,Q,B;return X;function X(Y){if(!SP(Y)||!sc.call(H,H.previous)||IP(H.events))return J(Y);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(Y)}function z(Y){if(SP(Y))return $.consume(Y),z;if(Y===64)return $.consume(Y),G;return J(Y)}function G(Y){if(Y===46)return $.check(MB0,K,U)(Y);if(Y===45||Y===95||a5(Y))return B=!0,$.consume(Y),G;return K(Y)}function U(Y){return $.consume(Y),Q=!0,G}function K(Y){if(B&&Q&&V2(H.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(Y);return J(Y)}}function _B0($,Z,J){let H=this;return Q;function Q(X){if(X!==87&&X!==119||!oc.call(H,H.previous)||IP(H.events))return J(X);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(LB0,$.attempt(dc,$.attempt(lc,B),J),J)(X)}function B(X){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(X)}}function jB0($,Z,J){let H=this,Q="",B=!1;return X;function X(Y){if((Y===72||Y===104)&&nc.call(H,H.previous)&&!IP(H.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),Q+=String.fromCodePoint(Y),$.consume(Y),z;return J(Y)}function z(Y){if(V2(Y)&&Q.length<5)return Q+=String.fromCodePoint(Y),$.consume(Y),z;if(Y===58){let F=Q.toLowerCase();if(F==="http"||F==="https")return $.consume(Y),G}return J(Y)}function G(Y){if(Y===47){if($.consume(Y),B)return U;return B=!0,G}return J(Y)}function U(Y){return Y===null||g$(Y)||x1(Y)||t9(Y)||f$(Y)?J(Y):$.attempt(dc,$.attempt(lc,K),J)(Y)}function K(Y){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(Y)}}function OB0($,Z,J){let H=0;return Q;function Q(X){if((X===87||X===119)&&H<3)return H++,$.consume(X),Q;if(X===46&&H===3)return $.consume(X),B;return J(X)}function B(X){return X===null?J(X):Z(X)}}function TB0($,Z,J){let H,Q,B;return X;function X(U){if(U===46||U===95)return $.check(ic,G,z)(U);if(U===null||x1(U)||t9(U)||U!==45&&f$(U))return G(U);return B=!0,$.consume(U),X}function z(U){if(U===95)H=!0;else Q=H,H=void 0;return $.consume(U),X}function G(U){if(Q||H||!B)return J(U);return Z(U)}}function CB0($,Z){let J=0,H=0;return Q;function Q(X){if(X===40)return J++,$.consume(X),Q;if(X===41&&H<J)return B(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(ic,Z,B)(X);if(X===null||x1(X)||t9(X))return Z(X);return $.consume(X),Q}function B(X){if(X===41)H++;return $.consume(X),Q}}function wB0($,Z,J){return H;function H(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),H;if(z===38)return $.consume(z),B;if(z===93)return $.consume(z),Q;if(z===60||z===null||x1(z)||t9(z))return Z(z);return J(z)}function Q(z){if(z===null||z===40||z===91||x1(z)||t9(z))return Z(z);return H(z)}function B(z){return V2(z)?X(z):J(z)}function X(z){if(z===59)return $.consume(z),H;if(V2(z))return $.consume(z),X;return J(z)}}function EB0($,Z,J){return H;function H(B){return $.consume(B),Q}function Q(B){return a5(B)?J(B):Z(B)}}function oc($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||x1($)}function nc($){return!V2($)}function sc($){return!($===47||SP($))}function SP($){return $===43||$===45||$===46||$===95||a5($)}function IP($){let Z=$.length,J=!1;while(Z--){let H=$[Z][1];if((H.type==="labelLink"||H.type==="labelImage")&&!H._balanced){J=!0;break}if(H._gfmAutolinkLiteralWalkedInto){J=!1;break}}if($.length>0&&!J)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return J}var SB0={tokenize:hB0,partial:!0};function bP(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:kB0,continuation:{tokenize:yB0},exit:xB0}},text:{[91]:{name:"gfmFootnoteCall",tokenize:bB0},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:RB0,resolveTo:IB0}}}}function RB0($,Z,J){let H=this,Q=H.events.length,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),X;while(Q--){let G=H.events[Q][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 J(G);let U=G4(H.sliceSerialize({start:X.end,end:H.now()}));if(U.codePointAt(0)!==94||!B.includes(U.slice(1)))return J(G);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(G),$.exit("gfmFootnoteCallLabelMarker"),Z(G)}}function IB0($,Z){let J=$.length,H;while(J--)if($[J][1].type==="labelImage"&&$[J][0]==="enter"){H=$[J][1];break}$[J+1][1].type="data",$[J+3][1].type="gfmFootnoteCallLabelMarker";let Q={type:"gfmFootnoteCall",start:Object.assign({},$[J+3][1].start),end:Object.assign({},$[$.length-1][1].end)},B={type:"gfmFootnoteCallMarker",start:Object.assign({},$[J+3][1].end),end:Object.assign({},$[J+3][1].end)};B.end.column++,B.end.offset++,B.end._bufferIndex++;let X={type:"gfmFootnoteCallString",start:Object.assign({},B.end),end:Object.assign({},$[$.length-1][1].start)},z={type:"chunkString",contentType:"string",start:Object.assign({},X.start),end:Object.assign({},X.end)},G=[$[J+1],$[J+2],["enter",Q,Z],$[J+3],$[J+4],["enter",B,Z],["exit",B,Z],["enter",X,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z],$[$.length-2],$[$.length-1],["exit",Q,Z]];return $.splice(J,$.length-J+1,...G),$}function bB0($,Z,J){let H=this,Q=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),B=0,X;return z;function z(Y){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),G}function G(Y){if(Y!==94)return J(Y);return $.enter("gfmFootnoteCallMarker"),$.consume(Y),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",U}function U(Y){if(B>999||Y===93&&!X||Y===null||Y===91||x1(Y))return J(Y);if(Y===93){$.exit("chunkString");let F=$.exit("gfmFootnoteCallString");if(!Q.includes(G4(H.sliceSerialize(F))))return J(Y);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!x1(Y))X=!0;return B++,$.consume(Y),Y===92?K:U}function K(Y){if(Y===91||Y===92||Y===93)return $.consume(Y),B++,U;return U(Y)}}function kB0($,Z,J){let H=this,Q=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),B,X=0,z;return G;function G(q){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),U}function U(q){if(q===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",K;return J(q)}function K(q){if(X>999||q===93&&!z||q===null||q===91||x1(q))return J(q);if(q===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return B=G4(H.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),F}if(!x1(q))z=!0;return X++,$.consume(q),q===92?Y:K}function Y(q){if(q===91||q===92||q===93)return $.consume(q),X++,K;return K(q)}function F(q){if(q===58){if($.enter("definitionMarker"),$.consume(q),$.exit("definitionMarker"),!Q.includes(B))Q.push(B);return $1($,W,"gfmFootnoteDefinitionWhitespace")}return J(q)}function W(q){return Z(q)}}function yB0($,Z,J){return $.check(e9,Z,$.attempt(SB0,Z,J))}function xB0($){$.exit("gfmFootnoteDefinition")}function hB0($,Z,J){let H=this;return $1($,Q,"gfmFootnoteDefinitionIndent",5);function Q(B){let X=H.events[H.events.length-1];return X&&X[1].type==="gfmFootnoteDefinitionIndent"&&X[2].sliceSerialize(X[1],!0).length===4?Z(B):J(B)}}function kP($){let J=($||{}).singleTilde,H={name:"strikethrough",tokenize:B,resolveAll:Q};if(J===null||J===void 0)J=!0;return{text:{[126]:H},insideSpan:{null:[H]},attentionMarkers:{null:[126]}};function Q(X,z){let G=-1;while(++G<X.length)if(X[G][0]==="enter"&&X[G][1].type==="strikethroughSequenceTemporary"&&X[G][1]._close){let U=G;while(U--)if(X[U][0]==="exit"&&X[U][1].type==="strikethroughSequenceTemporary"&&X[U][1]._open&&X[G][1].end.offset-X[G][1].start.offset===X[U][1].end.offset-X[U][1].start.offset){X[G][1].type="strikethroughSequence",X[U][1].type="strikethroughSequence";let K={type:"strikethrough",start:Object.assign({},X[U][1].start),end:Object.assign({},X[G][1].end)},Y={type:"strikethroughText",start:Object.assign({},X[U][1].end),end:Object.assign({},X[G][1].start)},F=[["enter",K,z],["enter",X[U][1],z],["exit",X[U][1],z],["enter",Y,z]],W=z.parser.constructs.insideSpan.null;if(W)Z2(F,F.length,0,G7(W,X.slice(U+1,G),z));Z2(F,F.length,0,[["exit",Y,z],["enter",X[G][1],z],["exit",X[G][1],z],["exit",K,z]]),Z2(X,U-1,G-U+3,F),G=U+F.length-2;break}}G=-1;while(++G<X.length)if(X[G][1].type==="strikethroughSequenceTemporary")X[G][1].type="data";return X}function B(X,z,G){let U=this.previous,K=this.events,Y=0;return F;function F(q){if(U===126&&K[K.length-1][1].type!=="characterEscape")return G(q);return X.enter("strikethroughSequenceTemporary"),W(q)}function W(q){let N=I3(U);if(q===126){if(Y>1)return G(q);return X.consume(q),Y++,W}if(Y<2&&!J)return G(q);let A=X.exit("strikethroughSequenceTemporary"),V=I3(q);return A._open=!V||V===2&&Boolean(N),A._close=!N||N===2&&Boolean(V),z(q)}}}class yP{constructor(){this.map=[]}add($,Z,J){vB0(this,$,Z,J)}consume($){if(this.map.sort(function(Q,B){return Q[0]-B[0]}),this.map.length===0)return;let Z=this.map.length,J=[];while(Z>0)Z-=1,J.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];J.push($.slice()),$.length=0;let H=J.pop();while(H){for(let Q of H)$.push(Q);H=J.pop()}this.map.length=0}}function vB0($,Z,J,H){let Q=0;if(J===0&&H.length===0)return;while(Q<$.map.length){if($.map[Q][0]===Z){$.map[Q][1]+=J,$.map[Q][2].push(...H);return}Q+=1}$.map.push([Z,J,H])}function tc($,Z){let J=!1,H=[];while(Z<$.length){let Q=$[Z];if(J){if(Q[0]==="enter"){if(Q[1].type==="tableContent")H.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(Q[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let B=H.length-1;H[B]=H[B]==="left"?"center":"right"}}else if(Q[1].type==="tableDelimiterRow")break}else if(Q[0]==="enter"&&Q[1].type==="tableDelimiterRow")J=!0;Z+=1}return H}function xP(){return{flow:{null:{name:"table",tokenize:gB0,resolveAll:fB0}}}}function gB0($,Z,J){let H=this,Q=0,B=0,X;return z;function z(T){let I=H.events.length-1;while(I>-1){let O=H.events[I][1].type;if(O==="lineEnding"||O==="linePrefix")I--;else break}let y=I>-1?H.events[I][1].type:null,S=y==="tableHead"||y==="tableRow"?_:G;if(S===_&&H.parser.lazy[H.now().line])return J(T);return S(T)}function G(T){return $.enter("tableHead"),$.enter("tableRow"),U(T)}function U(T){if(T===124)return K(T);return X=!0,B+=1,K(T)}function K(T){if(T===null)return J(T);if(u0(T)){if(B>1)return B=0,H.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(T),$.exit("lineEnding"),W;return J(T)}if(Q1(T))return $1($,K,"whitespace")(T);if(B+=1,X)X=!1,Q+=1;if(T===124)return $.enter("tableCellDivider"),$.consume(T),$.exit("tableCellDivider"),X=!0,K;return $.enter("data"),Y(T)}function Y(T){if(T===null||T===124||x1(T))return $.exit("data"),K(T);return $.consume(T),T===92?F:Y}function F(T){if(T===92||T===124)return $.consume(T),Y;return Y(T)}function W(T){if(H.interrupt=!1,H.parser.lazy[H.now().line])return J(T);if($.enter("tableDelimiterRow"),X=!1,Q1(T))return $1($,q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T);return q(T)}function q(T){if(T===45||T===58)return A(T);if(T===124)return X=!0,$.enter("tableCellDivider"),$.consume(T),$.exit("tableCellDivider"),N;return M(T)}function N(T){if(Q1(T))return $1($,A,"whitespace")(T);return A(T)}function A(T){if(T===58)return B+=1,X=!0,$.enter("tableDelimiterMarker"),$.consume(T),$.exit("tableDelimiterMarker"),V;if(T===45)return B+=1,V(T);if(T===null||u0(T))return j(T);return M(T)}function V(T){if(T===45)return $.enter("tableDelimiterFiller"),D(T);return M(T)}function D(T){if(T===45)return $.consume(T),D;if(T===58)return X=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(T),$.exit("tableDelimiterMarker"),L;return $.exit("tableDelimiterFiller"),L(T)}function L(T){if(Q1(T))return $1($,j,"whitespace")(T);return j(T)}function j(T){if(T===124)return q(T);if(T===null||u0(T)){if(!X||Q!==B)return M(T);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(T)}return M(T)}function M(T){return J(T)}function _(T){return $.enter("tableRow"),E(T)}function E(T){if(T===124)return $.enter("tableCellDivider"),$.consume(T),$.exit("tableCellDivider"),E;if(T===null||u0(T))return $.exit("tableRow"),Z(T);if(Q1(T))return $1($,E,"whitespace")(T);return $.enter("data"),C(T)}function C(T){if(T===null||T===124||x1(T))return $.exit("data"),E(T);return $.consume(T),T===92?R:C}function R(T){if(T===92||T===124)return $.consume(T),C;return C(T)}}function fB0($,Z){let J=-1,H=!0,Q=0,B=[0,0,0,0],X=[0,0,0,0],z=!1,G=0,U,K,Y,F=new yP;while(++J<$.length){let W=$[J],q=W[1];if(W[0]==="enter"){if(q.type==="tableHead"){if(z=!1,G!==0)ec(F,Z,G,U,K),K=void 0,G=0;U={type:"table",start:Object.assign({},q.start),end:Object.assign({},q.end)},F.add(J,0,[["enter",U,Z]])}else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(H=!0,Y=void 0,B=[0,0,0,0],X=[0,J+1,0,0],z)z=!1,K={type:"tableBody",start:Object.assign({},q.start),end:Object.assign({},q.end)},F.add(J,0,[["enter",K,Z]]);Q=q.type==="tableDelimiterRow"?2:K?3:1}else if(Q&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller")){if(H=!1,X[2]===0){if(B[1]!==0)X[0]=X[1],Y=LW(F,Z,B,Q,void 0,Y),B=[0,0,0,0];X[2]=J}}else if(q.type==="tableCellDivider")if(H)H=!1;else{if(B[1]!==0)X[0]=X[1],Y=LW(F,Z,B,Q,void 0,Y);B=X,X=[B[1],J,0,0]}}else if(q.type==="tableHead")z=!0,G=J;else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(G=J,B[1]!==0)X[0]=X[1],Y=LW(F,Z,B,Q,J,Y);else if(X[1]!==0)Y=LW(F,Z,X,Q,J,Y);Q=0}else if(Q&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller"))X[3]=J}if(G!==0)ec(F,Z,G,U,K);F.consume(Z.events),J=-1;while(++J<Z.events.length){let W=Z.events[J];if(W[0]==="enter"&&W[1].type==="table")W[1]._align=tc(Z.events,J)}return $}function LW($,Z,J,H,Q,B){let X=H===1?"tableHeader":H===2?"tableDelimiter":"tableData",z="tableContent";if(J[0]!==0)B.end=Object.assign({},YH(Z.events,J[0])),$.add(J[0],0,[["exit",B,Z]]);let G=YH(Z.events,J[1]);if(B={type:X,start:Object.assign({},G),end:Object.assign({},G)},$.add(J[1],0,[["enter",B,Z]]),J[2]!==0){let U=YH(Z.events,J[2]),K=YH(Z.events,J[3]),Y={type:"tableContent",start:Object.assign({},U),end:Object.assign({},K)};if($.add(J[2],0,[["enter",Y,Z]]),H!==2){let F=Z.events[J[2]],W=Z.events[J[3]];if(F[1].end=Object.assign({},W[1].end),F[1].type="chunkText",F[1].contentType="text",J[3]>J[2]+1){let q=J[2]+1,N=J[3]-J[2]-1;$.add(q,N,[])}}$.add(J[3]+1,0,[["exit",Y,Z]])}if(Q!==void 0)B.end=Object.assign({},YH(Z.events,Q)),$.add(Q,0,[["exit",B,Z]]),B=void 0;return B}function ec($,Z,J,H,Q){let B=[],X=YH(Z.events,J);if(Q)Q.end=Object.assign({},X),B.push(["exit",Q,Z]);H.end=Object.assign({},X),B.push(["exit",H,Z]),$.add(J+1,0,B)}function YH($,Z){let J=$[Z],H=J[0]==="enter"?"start":"end";return J[1][H]}var mB0={name:"tasklistCheck",tokenize:uB0};function hP(){return{text:{[91]:mB0}}}function uB0($,Z,J){let H=this;return Q;function Q(G){if(H.previous!==null||!H._gfmTasklistFirstContentOfListItem)return J(G);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),B}function B(G){if(x1(G))return $.enter("taskListCheckValueUnchecked"),$.consume(G),$.exit("taskListCheckValueUnchecked"),X;if(G===88||G===120)return $.enter("taskListCheckValueChecked"),$.consume(G),$.exit("taskListCheckValueChecked"),X;return J(G)}function X(G){if(G===93)return $.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return J(G)}function z(G){if(u0(G))return Z(G);if(Q1(G))return $.check({tokenize:pB0},Z,J)(G);return J(G)}}function pB0($,Z,J){return $1($,H,"whitespace");function H(Q){return Q===null?J(Q):Z(Q)}}function $d($){return kF([RP(),bP(),kP($),xP(),hP()])}var cB0={};function MW($){let Z=this,J=$||cB0,H=Z.data(),Q=H.micromarkExtensions||(H.micromarkExtensions=[]),B=H.fromMarkdownExtensions||(H.fromMarkdownExtensions=[]),X=H.toMarkdownExtensions||(H.toMarkdownExtensions=[]);Q.push($d(J)),B.push(wP()),X.push(EP(J))}var a$=P(c(),1),dB0=[MW],lB0=[AW],iB0={code({node:$,className:Z,children:J,...H}){return a$.jsx("code",{className:B0("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",Z),...H,children:J})},pre({children:$}){return a$.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:a$.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 Zd({size:$="sm",content:Z}){let J=e1(),{base:H}=i2();return a$.jsx("div",{className:B0("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:a$.jsx(BW,{remarkPlugins:dB0,rehypePlugins:lB0,components:iB0,urlTransform:(Q,B,X)=>{if(X.tagName==="a"&&B==="href"&&Q.startsWith("moi:"))try{return B$(Q,{apiBase:`/api/workspaces/${encodeURIComponent(J)}`,workspacePath:o8(J,H)})}catch{return""}return XW(Q)},children:Z})})}function Jd({content:$}){return a$.jsx(BW,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var Q_=P(m(),1);var Hd="/airtable-hsa66v6q.png";var Qd="/apollo-2ed5dy2d.png";var Bd="/asana-tvgtwbx2.png";var Xd="/atlassian-b3tq39hs.png";var zd="/box-w3n36t5g.png";var vP="/chrome-tspm94rw.svg";var Gd="/clickup-qqrqqvqb.png";var Ud="/cloudflare-j9p931v6.png";var Kd="/context7-8ht0xjfy.png";var Yd="/datadog-70ne3yzt.png";var Fd="/discord-vejhptwx.png";var Wd="/dropbox-4m5s9mgr.png";var qd="/elevenlabs-2nzzej1t.png";var Nd="/exa-qqj3vr0x.png";var Vd="/figma-y9898rry.png";var Ad="/firecrawl-w2t8nehx.png";var Dd="/github-av5r5y3e.png";var Ld="/gitlab-4pv5vm6b.png";var Md="/gmail-sg6a5v3x.png";var Pd="/googlecalendar-nqhh2v7r.png";var _d="/googledrive-6s8xyab7.png";var jd="/grafana-1yfsnwr6.png";var Od="/granola-7j3b0nk2.png";var Td="/hubspot-hghcmc2t.png";var Cd="/huggingface-kxzaxj83.png";var wd="/intercom-td763jt8.png";var Ed="/linear-v9s3az2d.png";var Sd="/monday-jdbs4wwf.png";var Rd="/mongodb-emzxvhd5.png";var Id="/neon-zj4qar44.png";var bd="/notion-w034c0b8.png";var kd="/paper-zbt34fab.png";var yd="/paypal-kwwf7xsc.png";var xd="/perplexity-4y63rxvj.png";var hd="/postgresql-qsspbsr1.png";var vd="/posthog-sphppc4w.png";var gd="/puppeteer-2xjt1a9b.png";var fd="/railway-834de8d2.png";var md="/redis-spm6w2m1.png";var ud="/salesforce-1mk56v4z.png";var pd="/sentry-hdwpmvek.png";var cd="/shopify-90dadaav.png";var dd="/slack-1c1wj62s.png";var ld="/snowflake-hfpykpgy.png";var id="/stripe-zrfaqbj3.png";var rd="/supabase-4vg33zf2.png";var ad="/telegram-v6tjyrs7.png";var od="/twilio-dpyjdwpj.png";var nd="/vercel-7d0ssw28.png";var sd="/zapier-p67qfch0.png";var cX0={airtable:Hd,apollo:Qd,asana:Bd,atlassian:Xd,box:zd,chrome:vP,"chrome-devtools":vP,clickup:Gd,cloudflare:Ud,context7:Kd,datadog:Yd,discord:Fd,dropbox:Wd,elevenlabs:qd,exa:Nd,figma:Vd,firecrawl:Ad,github:Dd,gitlab:Ld,gmail:Md,googlecalendar:Pd,googledrive:_d,grafana:jd,granola:Od,hubspot:Td,huggingface:Cd,intercom:wd,linear:Ed,monday:Sd,mongodb:Rd,neon:Id,notion:bd,paper:kd,paypal:yd,perplexity:xd,postgresql:hd,posthog:vd,puppeteer:gd,railway:fd,redis:md,salesforce:ud,sentry:pd,shopify:cd,slack:dd,snowflake:ld,stripe:id,supabase:rd,telegram:ad,twilio:od,vercel:nd,zapier:sd},dX0={"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 td($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function PW($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var lX0=new Map(Object.entries(cX0).map(([$,Z])=>[PW($),Z])),iX0=new Map(Object.entries(dX0).map(([$,Z])=>[PW($),PW(Z)]));function _W($){let Z=PW(td($));return lX0.get(iX0.get(Z)??Z)}function jW($){return td($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var gP=P(c(),1);function XX({open:$,children:Z}){return gP.jsx(j4,{initial:!1,children:$&&gP.jsx(z5.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 ed=P(m(),1);var Jl=P(c(),1),rX0=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function $l($,Z){if($.name!=="Read"||!Z)return null;let J=$.input,H=typeof J.file_path==="string"?J.file_path:null;if(!H||!rX0.test(H))return null;let Q=Z.endsWith("/")?Z:`${Z}/`;if(!H.startsWith(Q))return null;return H.slice(Q.length)}function Zl({relPath:$}){let Z=e1(),[J,H]=ed.useState(!1);if(J)return null;let Q=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return Jl.jsx("img",{src:Q,alt:$,loading:"lazy",onError:()=>H(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var KX=P(m(),1);var Ql=P(c(),1),aX0=B0("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 Hl({children:$,active:Z=!0,className:J}){return Ql.jsx("span",{className:B0(J,Z&&aX0),children:$})}var zX=P(c(),1);function OW({className:$}){return zX.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:[zX.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"}),zX.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 A2=P(c(),1),TW="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function WH({isFirst:$,isLast:Z,marker:J,loading:H=!1,isError:Q=!1,children:B}){let X=J!=null||H;return A2.jsxs("div",{className:"relative flex gap-2.5",children:[A2.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&A2.jsx("span",{className:B0("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"h-1":"h-2.5")}),!Z&&A2.jsx("span",{className:B0("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"top-[26px]":"top-5")}),J?A2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:J}):H?A2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:A2.jsx(k5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):A2.jsx("span",{className:B0("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",Q?"bg-destructive":"bg-border")})]}),B]})}function GX({open:$}){return A2.jsx(z5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:B0("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:A2.jsx(R$,{size:12,stroke:1.75})})}function FH({children:$,className:Z}){return A2.jsx("span",{className:B0("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function Bl({icon:$,size:Z=12,stroke:J=1.75}){return A2.jsx(FH,{children:A2.jsx($,{size:Z,stroke:J,className:"text-muted-foreground"})})}function Xl({src:$}){if(!$)return A2.jsx(FH,{children:A2.jsx(OW,{className:"size-3 text-muted-foreground"})});return A2.jsx(FH,{children:A2.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var Bz0=Ul(),fP=Vl();function Xz0($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function zz0($){try{return fP($,Xz0)}catch{return null}}function Al($){return $.split("/").pop()??$}var Gz0=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),Uz0=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),Kz0=/^[A-Za-z_][A-Za-z0-9_]*=/;function Yz0($){if(/^-[a-zA-Z]*c$/.test($))return!0;let Z=$.toLowerCase();return Z==="--command"||Z==="-command"}function Fz0($){let Z=zz0($);if(!Z||Z.length<3)return null;let J=(B)=>{let X=Z[B];return typeof X==="string"?X:null},H=0,Q=()=>{while(Kz0.test(J(H)??""))H++};if(Q(),Al(J(H)??"")==="env")H++,Q();if(!Gz0.has(Al(J(H)??"")))return null;H++;while(H<Z.length){let B=J(H);if(B===null)return null;if(Yz0(B)){if(H+2!==Z.length)return null;return J(H+1)?.trim()||null}if(!B.startsWith("-")&&!B.startsWith("+"))return null;H+=Uz0.has(B)?2:1}return null}function Wz0($){let Z=$;for(let J=0;J<3;J++){let H=Fz0(Z);if(H===null)return Z;Z=H}return Z}function qz0($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function n$($){return qz0(Wz0($))}function qH($,Z){let J=n$($);return J?Z(`$ ${J}`):""}var Nz0=/^[A-Za-z]:\//;function Vz0($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(Nz0,(Z)=>Z.toUpperCase())}var Az0=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var Dl=/^\/([A-Za-z]:)?$/;function Dz0(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var mP=function(...$){$=$.map((H)=>Vz0(H));let Z="",J=!1;for(let H=$.length-1;H>=-1&&!J;H--){let Q=H>=0?$[H]:Dz0();if(!Q||Q.length===0)continue;Z=`${Q}/${Z}`,J=uP(Q)}if(Z=Ll(Z,!J),J&&!uP(Z))return`/${Z}`;return Z.length>0?Z:"."};function Ll($,Z){let J="",H=0,Q=-1,B=0,X=null;for(let z=0;z<=$.length;++z){if(z<$.length)X=$[z];else if(X==="/")break;else X="/";if(X==="/"){if(Q===z-1||B===1);else if(B===2){if(J.length<2||H!==2||J[J.length-1]!=="."||J[J.length-2]!=="."){if(J.length>2){let G=J.lastIndexOf("/");if(G===-1)J="",H=0;else J=J.slice(0,G),H=J.length-1-J.lastIndexOf("/");Q=z,B=0;continue}else if(J.length>0){J="",H=0,Q=z,B=0;continue}}if(Z)J+=J.length>0?"/..":"..",H=2}else{if(J.length>0)J+=`/${$.slice(Q+1,z)}`;else J=$.slice(Q+1,z);H=z-Q-1}Q=z,B=0}else if(X==="."&&B!==-1)++B;else B=-1}return J}var uP=function($){return Az0.test($)};var pP=function($,Z){let J=mP($).replace(Dl,"$1").split("/"),H=mP(Z).replace(Dl,"$1").split("/");if(H[0][1]===":"&&J[0][1]===":"&&J[0]!==H[0])return H.join("/");let Q=[...J];for(let B of Q){if(H[0]!==B)break;J.shift(),H.shift()}return[...J.map(()=>".."),...H].join("/")};function NH($){return $.input??{}}function N1($,Z){let J=$[Z];return typeof J==="string"?J:""}function Ml($){return(Z)=>Z.replace(/\/[^\s"']+/g,(J)=>{if(!$)return J;let H=pP($,J);return H.startsWith("..")?J:H})}function s$($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let J=Math.floor(Z/60),H=Z%60;return H?`${J}m ${H}s`:`${J}m`}var Lz0={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function Mz0($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function Pz0($,Z){let J=$.name,H=NH($);if(J==="Bash")return qH(N1(H,"command"),Z);if(J==="Read"||J==="Write"||J==="Edit")return Z(N1(H,"file_path"));if(J==="Glob")return Z(N1(H,"pattern"));if(J==="Grep")return`/${N1(H,"pattern")}/ ${Z(N1(H,"path"))}`;if(J==="WebSearch")return N1(H,"query");if(J==="WebFetch")return N1(H,"url");if(J==="ToolSearch"){let Q=N1(H,"query");if(Q.startsWith("select:"))return Q.slice(7).split(",").map(Mz0).join(", ");return Q}return""}var UX={displayName:($)=>Lz0[$.name]??$.name,brief:Pz0};var cP={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"},_l={read:"Read",listFiles:"List files",search:"Search"};function jl($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let J=Z[0],H=J?.type;if(!H||!(H in _l))return null;if(Z.some((Q)=>Q?.type!==H))return null;return J}var Pl={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function _z0($){if($.name==="exec"){let Z=jl($.input);if(Z?.type)return _l[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in Pl)return Pl[Z]}return cP[$.name]??$.name}function jz0($,Z){let J=$.name,H=NH($);if(J==="exec"){let Q=jl(H);if(Q?.type==="read")return Z(Q.path||Q.name||"");if(Q?.type==="search")return[Q.query&&`/${Q.query}/`,Q.path&&Z(Q.path)].filter(Boolean).join(" ");if(Q?.type==="listFiles")return Q.path?Z(Q.path):"";return qH(N1(H,"command"),Z)}if(J==="apply_patch"){let Q=H.changes;if(Array.isArray(Q))return Q.map((X)=>X&&typeof X==="object"?X.path:void 0).filter((X)=>typeof X==="string").map(Z).join(", ");return""}if(J==="web_search"){let Q=H.queries;if(Array.isArray(Q)&&Q.length>0)return Q.filter((B)=>typeof B==="string").join(" · ");return N1(H,"query")||[N1(H,"url"),N1(H,"pattern")].filter(Boolean).join(" · ")}if(J==="update_plan"){let Q=H.plan;return typeof Q==="string"?Q.split(`
|
|
52
|
-
`)[0]:""}if(J==="subagent"){if(N1(H,"action")==="close_agent")return"";return N1(H,"prompt")}if(J==="subagent_activity")return N1(H,"kind");if(J==="generate_image")return N1(H,"prompt").split(`
|
|
53
|
-
`)[0];if(J==="read_mcp_resource")return N1(H,"uri");if(J==="list_mcp_resources"||J==="list_mcp_resource_templates")return N1(H,"server");return""}var Ol={displayName:_z0,brief:jz0};function Tl($){let Z=$.indexOf(":"),J=(Z>0?$.slice(0,Z):$).trim(),H=Z>0?$.slice(Z+1).trim():"",Q=J.match(/^(.*?)\s*\(([^)]*)\)$/);if(!Q)return{action:J,qualifier:"",detail:H};return{action:Q[1].trim(),qualifier:Q[2].trim(),detail:H}}var Oz0={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 Tz0($){let{action:Z}=Tl($.name),J=Oz0[Z];if(J)return J;let H=Z.replace(/_/g," ");return H.charAt(0).toUpperCase()+H.slice(1)}function Cz0($,Z){let{action:J,qualifier:H,detail:Q}=Tl($.name),B=Q||H;if(!B)return"";return J==="terminal"?`$ ${n$(B)}`:Z(B)}var Cl={displayName:Tz0,brief:Cz0};var wz0={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 Ez0($,Z){let J=$.name,H=NH($);if(J==="read"||J==="write"||J==="edit")return Z(N1(H,"path"));if(J==="apply_patch"){let Q=H.changes;if(Array.isArray(Q)&&Q.length>0){let z=Q.map((G)=>G&&typeof G==="object"?N1(G,"path"):"").filter(Boolean);if(z.length===1)return Z(z[0]);if(z.length>1)return`${z.length} files`}let B=N1(H,"patch")||N1(H,"input"),X=B.split(`
|
|
54
|
-
`).find((z)=>z.startsWith("*** "))??B.split(`
|
|
55
|
-
`)[0];return Z(X??"")}if(J==="exec"||J==="bash"){let Q=N1(H,"command")||N1(H,"code");return qH(Q,Z)}if(J==="ls"||J==="find"||J==="grep")return Z(N1(H,"path")||N1(H,"pattern"));if(J==="process"){let Q=N1(H,"action"),B=N1(H,"name");return[Q,B].filter(Boolean).join(" ")||Z(n$(N1(H,"command")))}if(J==="web_search"||J==="x_search")return N1(H,"query");if(J==="web_fetch")return N1(H,"url");if(J==="memory_search")return N1(H,"query");if(J==="memory_get")return N1(H,"key")||N1(H,"name");if(J==="sessions_history"||J==="sessions_send"||J==="sessions_yield")return N1(H,"sessionKey")||N1(H,"agentId");if(J==="sessions_list"||J==="agents_list")return N1(H,"agentId");if(J==="subagents"||J==="sessions_spawn")return N1(H,"task")||N1(H,"agentId");if(J==="image"||J==="image_generate")return N1(H,"prompt")||Z(N1(H,"path"));if(J==="message")return N1(H,"recipient")||N1(H,"to");if(J==="update_plan"){let Q=H.plan;if(Array.isArray(Q)){let X=Q.find((z)=>!!z&&typeof z==="object"&&z.status==="in_progress")?.step??Q[0]?.step;if(typeof X==="string")return X}return""}return""}var wl={displayName:($)=>wz0[$.name]??UX.displayName($),brief:($,Z)=>Ez0($,Z)||UX.brief($,Z)};function dP($){if(!($.name==="Bash"||$.name==="exec"||$.name==="bash"))return null;let J=$.input??{},H=typeof J.command==="string"?J.command:"";if(!H)return null;let B=n$(H).match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!B)return null;return{server:B[1],tool:B[2],rest:(B[3]??"").trim()}}function lP($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let J=Z.slice(5),H=J.indexOf("__");if(H<=0)return null;return{server:J.slice(0,H),tool:J.slice(H+2),rest:""}}function iP($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in cP)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 rP($,Z){let J=Z.toLowerCase();return["-","_","."].find((Q)=>J.startsWith($.toLowerCase()+Q))?Z.slice($.length+1):Z}var Sz0={"claude-code":UX,openclaw:wl,codex:Ol,hermes:Cl};function El($){return Sz0[$.provider??"claude-code"]}function Sl($){return El($).displayName($)}function Rl($,Z){return El($).brief($,Ml(Z))}var J2=P(c(),1),Il=[bl,kl,aP];function Rz0(){let[$,Z]=KX.useState(0);KX.useEffect(()=>{let H=setInterval(()=>Z((Q)=>(Q+1)%Il.length),600);return()=>clearInterval(H)},[]);let J=Il[$];return J2.jsx(FH,{className:"size-5",children:J2.jsx(J,{size:16,stroke:1.75,className:"text-foreground"})})}function yl({call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:Q}){let[B,X]=KX.useState(!1),z=$.subagent,G=$.input??{},U=z?.description??G.description??"Subtask",K=z?.status,Y=$.state==="error"||K==="failed",F=$.state==="running"||K==="running",W=z?.usage?.toolUses,q=z?.usage?.durationMs,A=(F&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(W!=null?`Took ${W} step${W===1?"":"s"}`:null),V=(z?.transcript??[]).flatMap((j)=>j.parts),D=typeof $.output==="string"?$.output:"",L=V.length>0||!!D;return J2.jsx(WH,{isFirst:J,isLast:H,marker:F?J2.jsx(Rz0,{}):J2.jsx(FH,{className:"size-5",children:J2.jsx(aP,{size:16,stroke:1.75,className:"text-foreground"})}),isError:Y,children:J2.jsxs("div",{className:"min-w-0 flex-1",children:[J2.jsxs("button",{type:"button",title:`Agent: ${U}`,onClick:()=>L&&X((j)=>!j),className:B0("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",L?"cursor-pointer":"cursor-default"),children:[J2.jsxs("span",{className:"flex w-full items-center gap-2",children:[J2.jsxs(Hl,{active:F,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",U]}),!F&&q!=null&&J2.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:s$(q)}),K==="failed"&&J2.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),K==="stopped"&&J2.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),L&&J2.jsx(GX,{open:B})]}),A&&J2.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:A})]}),L&&J2.jsx(XX,{open:B,children:J2.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[V.length>0&&J2.jsx("div",{className:"py-1.5 pr-2 pl-3",children:Q(V,Z)}),D&&J2.jsx("div",{className:B0("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",V.length>0&&"border-t border-border"),children:D})]})})]})})}var t$=P(m(),1);var dl=P(m(),1);var nP=new Set(["<",">","{","}","[","]"]),$_=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"]),Iz0=new Set([...$_,"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"]),gl=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...nP]),bz0={keywords:$_,onCommentStart:pl,onCommentEnd:pz0};function kz0($){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 yz0($,Z){if($[Z]!=="<")return!1;let J=0,H=!1;for(let Q=Z;Q<$.length;Q++){let B=$[Q];if(B==="<"){J++;continue}if(B===">"){if(J--,J===0){let X=Q+1;while(X<$.length&&/\s/.test($[X]))X++;if(!(H&&$[X]==="("))return!1;let z=$.slice(X,X+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(J===0)continue;if(/[$A-Za-z_]/.test(B)){H=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(B))continue;return!1}return!1}var SW=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[VH,xz0,F7,oP,EW,hz0,vz0,H3,xl,sP,hl]=SW.map(($,Z)=>Z);function YX($){return/^[^\S\r\n]+$/g.test($)}function gz0($){return gl.has($)}var fz0={"&":"&","<":"<",">":">",'"':""","'":"'"};function mz0($){if(!/[&<>"']/.test($))return $;return $.replace(/[&<>"']/g,(Z)=>fz0[Z])}function RW($){return/^[\w_]+$/.test($)||fl($)}function vl($){let Z=$[0];return RW(Z)&&Z===Z.toUpperCase()||$==="null"}function fl($){return/[^\u0000-\u007f]/.test($)}function ml($){return/^[a-zA-Z]$/.test($)}function ul($){return ml($)||fl($)}function AH($){return ul($[0])&&($.length===1||RW($.slice(1)))}function tP($){return $==="`"}function eP($){return $==='"'||$==="'"}function uz0($){return eP($)||tP($)}function pl($,Z){let J=$+Z;if(J==="/*")return 2;return J==="//"?1:0}function pz0($,Z){return $+Z==="*/"?2:Z===`
|
|
56
|
-
`?1:0}function cz0($){return $[0]==="/"&&!pl($[0],$[1])}function dz0($,Z){let J=Z+1;while(J<$.length&&/\s/.test($[J]))J++;return $[J]===":"}function lz0($,Z){let J={...bz0,...Z},H=!!(Z&&Z.keywords instanceof Set),Q=kz0($),B=H?J.keywords:Q?Iz0:$_,{onCommentStart:X,onCommentEnd:z}=J,G=J.typeKeywords instanceof Set?J.typeKeywords:null,U="",K=-1,Y=[-1,""],F=[-2,""],W=[],q=!1,N=0,A=!1,V=0,D=()=>q&&!A&&!N,L=()=>N&&!D(),j=()=>!N&&D()&&!A&&V>0,M=null,_=0,E=!1,C=0,R=0,T=()=>M!==null,I=()=>E,y=()=>R>C,S=()=>R>0&&R===C,O=()=>T()||y();function k(h){let v=h===`
|
|
57
|
-
`;if(L()){if(T())return F7;let[,w]=Y;if(AH(h)){if(w==="<"||w==="</")return hz0}}if(j())return vz0;if(T()||y())return F7;else if(G&&G.has(h))return Y[1]==="."?VH:oP;else if(B.has(h))return Y[1]==="."?VH:xz0;else if(v)return sP;else if(YX(h))return hl;else if(h.split("").every(gz0))return H3;else if(vl(h))return L()?VH:oP;else{if(AH(h)){let w=Y[1]==="."&&AH(F[1]);if(!O()&&!w)return VH;if(w)return EW}return F7}}let b=(h,v)=>{if(v)U=v;if(U){K=typeof h==="number"?h:k(U);let f=[K,U];if(K!==hl&&K!==sP)F=Y,Y=f;W.push(f)}U=""};for(let h=0;h<$.length;h++){let v=$[h],f=$[h-1],w=$[h+1],i=f+v,r=v+w;if(typeof J.onQuote==="function"&&v==="'"&&!T()&&!j()&&!y()){let d=J.onQuote(v,h,$);if(typeof d==="number"&&d>=1&&!Number.isNaN(d)){let o=Math.min(d,$.length-h),Z0=h+o;b(),U=$.slice(h,Z0),b(VH),h=Z0-1;continue}}if(eP(v)&&!j()&&!y()){b();let d=!1;if(f!=="\\"){if(M&&v===M)M=null,d=!0;else if(!M)M=v,_=W.length}if(b(F7,v),J.quotedKeys&&d&&dz0($,h))for(let o=_;o<W.length;o++)W[o][0]=EW;continue}if(!y()){if(f!=="\\n"&&tP(v)){b(),b(F7,v),R++;continue}}if(y()){if(f!=="\\n"&&tP(v)){if(R>0){b(),R--,b(F7,v);continue}}if(r==="${"){C++,b(F7),b(H3,r),h++;continue}}if(S()&&v==="}"){b(),C--,b(H3,v);continue}if(D()){if(v==="{"){b(),b(H3,v),A=!0;continue}}if(q){if(!N&&v==="<"){if(b(),w==="/")N=2,U=r,h++;else N=1,U=v;b(H3);continue}if(N){if(v===">"&&!"/=".includes(f)){if(b(),N===1)N=0,V++;else N=0,q=!1;b(H3,v);continue}if(r==="/>"||r==="</"){if(U!=="<"&&U!=="/")b();if(r==="/>")N=0;else V--;if(!V)q=!1;U=r,h++,b(H3);continue}if(v==="<"){b(),U=v,b(H3);continue}if(w==="-"&&!O()&&!j()){if(U){b(EW,U+v+w),h++;continue}}if(w==="="&&!O()){if(!YX(v)){if(YX(U))b();let d=U+v;if(AH(d)){b(EW,d);continue}}}}}if(!N&&(v==="<"&&ul(w)||r==="</")){let d=h-1;while(d>=0&&/\s/.test($[d]))d--;let o=d>=0?$[d]:"",[Z0,H0]=Y,G0=!1,X0=!1;if(U&&!YX(U)){let N0=U;if(vl(N0)||N0==="true"||N0==="false")G0=!0;else if(B.has(N0)&&AH(N0))X0=!0;else if(AH(N0))G0=!0}let Y0=v==="<"&&/[$\w\]\)]/.test(o)&&(G0||!X0&&(Z0===VH||Z0===oP||Z0===H3&&(H0===")"||H0==="]"))),A0=v==="<"&&yz0($,h);if(!Y0&&!A0)N=w==="/"?2:1;if(v==="<"&&(w==="/"||ml(w))){if(!Y0&&!A0&&!O()&&!j()&&!I())q=!0}}let x=uz0(v),l=y(),s=!q&&cz0(r),p=j();if(x||l||eP(M))U+=v;else if(s){b();let[d,o]=Y;if(s&&d!==-1&&!(d===H3&&o!==")"||d===xl)){U=v,b();continue}E=!0;let Z0=h++,H0=()=>h>=$.length,G0=()=>H0()||$[h]===`
|
|
58
|
-
`,X0=!1,Y0=!1;for(;!G0();h++){let A0=$[h],N0=$[h-1]==="\\";if(!N0&&A0==="[")Y0=!0;if(!N0&&A0==="]")Y0=!1;if(A0==="/"&&!Y0&&!N0){X0=!0;while(Z0!==h&&/^[a-z]$/.test($[h+1])&&!G0())h++;break}}if(E=!1,Z0!==h&&X0)U=$.slice(Z0,h+1),b(F7);else U=v,b(),h=Z0}else if(X(v,w)){b();let d=h,o=X(v,w);if(o){for(;h<$.length;h++)if(z($[h-1],$[h])==o)break}U=$.slice(d,h+1),b(xl)}else if(v===" "||v===`
|
|
59
|
-
`)if(v===" "&&(YX(U)||!U||p)){let d=h+1;while($[d]===" ")d++;if(U+=$.slice(h,d),h=d-1,$[d]==="<")b()}else b(),U=v,b();else if(A&&v==="}")b(),U=v,b(),A=!1;else if(p&&!nP.has(v)||y()||(RW(v)===RW(U[U.length-1])||D())&&!gl.has(v))U+=v;else{if(i==="</")U=i;if(b(),i!=="</")U=v;if(r==="</"||r==="/>")U=r,b(),h++;else if(nP.has(v))b()}}return b(),W}function iz0($,Z){let J=[],H=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,Q=0,B=(U,K)=>{let Y=H?H(K,Q):"";return Q++,{type:"element",tagName:"span",children:U,properties:{className:Y?`sh__line ${Y}`:"sh__line"}}};function X(U){let K=U.map(([,F])=>F).join(""),Y=U.map(([F,W])=>{let q=SW[F];return{type:"element",tagName:"span",children:[{type:"text",value:W}],properties:{className:`sh__token--${q}`,style:{color:`var(--sh-${q})`}}}});J.push(B(Y,K))}let z=[],G=!1;for(let U=0;U<$.length;U++){let K=$[U],[Y,F]=K,W=U===$.length-1;if(Y!==sP){if(F.includes(`
|
|
60
|
-
`)){let q=F.split(`
|
|
61
|
-
`);for(let N=0;N<q.length;N++)if(z.push([Y,q[N]]),N<q.length-1)X(z),z.length=0}else z.push(K);G=!1}else{if(G)X([]);else X(z),z.length=0;if(W)X([]);G=!0}}if(z.length)X(z);return J}var rz0=($)=>{let Z=`class="${$.className}"`;if($.style){let J=Object.entries($.style).map(([H,Q])=>`${H}:${Q}`).join(";");Z+=` style="${J}"`}return Z};function az0($){return $.map((Z)=>{let{tagName:J}=Z,H=Z.children.map((Q)=>{let{tagName:B,children:X,properties:z}=Q;return`<${B} ${rz0(z)}>${mz0(X[0].value)}</${B}>`}).join("");return`<${J} class="${Z.properties.className}">${H}</${J}>`}).join(`
|
|
62
|
-
`)}function cl($,Z){let J=lz0($,Z),H=iz0(J,Z);return az0(H)}var IV1={TokenTypes:SW,TokenMap:new Map(SW.map(($,Z)=>[$,Z]))};var Z_=P(c(),1),oz0=B0("[--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 ll({code:$,className:Z}){let J=dl.useMemo(()=>cl($),[$]);return Z_.jsx("pre",{className:B0("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",oz0,Z),children:Z_.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:J}})})}var nz0={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 sz0($){let Z=$.split(/[\\/]/).pop()??"",J=Z.lastIndexOf("."),H=J>0?Z.slice(J+1).toLowerCase():"";return nz0[H]??null}function tz0($){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 ez0($){let Z=$.split(`
|
|
63
|
-
`);if(!Z.some((J)=>/^\s*\d+\t/.test(J)))return $;return Z.map((J)=>J.replace(/^\s*\d+\t/,"")).join(`
|
|
64
|
-
`)}function il($,Z){let J=$.input??{},H=typeof J.file_path==="string"?J.file_path:typeof J.path==="string"?J.path:"",Q=H?sz0(H):null,B=$.name==="Read"||$.name==="read",X=$.name==="Write"||$.name==="write";if(Q&&B&&Z)return{kind:"highlight",code:ez0(Z),label:Q};if(Q&&X&&typeof J.content==="string"&&J.content)return{kind:"highlight",code:J.content,label:Q};let z=tz0(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var w4=P(c(),1),J_="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function rl({call:$,output:Z,isError:J}){let[H,Q]=t$.useState(!1),B=t$.useMemo(()=>J?{kind:"plain"}:il($,Z),[$,Z,J]);if(B.kind==="plain")return w4.jsx("div",{className:B0("rounded-lg border",J?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:w4.jsx("pre",{className:B0(J_,"break-all whitespace-pre-wrap",J?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return w4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[w4.jsx($G0,{raw:H,onRaw:Q,label:B.label,copyText:H?Z:B.code}),H?w4.jsx("pre",{className:B0(J_,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):w4.jsx(ll,{code:B.code,className:B0(J_,"text-muted-foreground")})]})}function $G0({raw:$,onRaw:Z,label:J,copyText:H}){return w4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,J],[!0,"raw"]].map(([B,X])=>w4.jsx(j0,{type:"button",variant:$===B?"outline":"ghost",size:"sm",onClick:()=>Z(B),className:"rounded-full text-xs uppercase",children:X},X)),w4.jsx("div",{className:"flex-1"}),w4.jsx(ZG0,{text:H})]})}function ZG0({text:$}){let[Z,J]=t$.useState(!1);return t$.useEffect(()=>{if(!Z)return;let Q=setTimeout(()=>J(!1),1500);return()=>clearTimeout(Q)},[Z]),w4.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>J(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?w4.jsx(O8,{stroke:1.75}):w4.jsx(aU,{stroke:1.75})})}var m1=P(c(),1);function IW({parts:$,cwd:Z=null,processing:J=!1}){let H=$.filter((Q)=>Q.type==="reasoning"||Q.type==="tool-call");return m1.jsx("div",{className:"flex flex-col",children:H.map((Q,B)=>{let X=B===H.length-1,z={isFirst:B===0,isLast:X};if(Q.type==="reasoning")return m1.jsx(JG0,{text:Q.text,durationMs:Q.durationMs,inProgress:J&&X,...z},B);return m1.jsx(HG0,{call:Q.call,cwd:Z,...z},Q.call.toolCallId||B)})})}function H_({isFirst:$,isLast:Z,call:J,leading:H,marker:Q,name:B,brief:X,preview:z}){let[G,U]=Q_.useState(!1),K=J.state==="error",Y=J.state==="running"||J.state==="pending",F=K?J.errorText??"":typeof J.output==="string"?J.output:"",W=!!(F||K||z),q=X?`${B}: ${X}`:B;return m1.jsx(WH,{isFirst:$,isLast:Z,marker:Q,loading:Y,isError:K,children:m1.jsxs("div",{className:"min-w-0 flex-1",children:[m1.jsxs("button",{type:"button",title:q,onClick:()=>W&&U((N)=>!N),className:B0(TW,W?"cursor-pointer":"cursor-default"),children:[H,m1.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:B}),X&&m1.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:X}),Y&&Q&&m1.jsx(k5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&m1.jsx(GX,{open:G})]}),W&&m1.jsx(XX,{open:G,children:m1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(F||K)&&m1.jsx(rl,{call:J,output:F,isError:K})]})})]})})}function JG0({isFirst:$,isLast:Z,text:J,inProgress:H=!1,durationMs:Q}){let[B,X]=Q_.useState(!1);if(!J){let U=Q===void 0?"Thought":`Thought for ${s$(Q)}`;return m1.jsx(WH,{isFirst:$,isLast:Z,loading:H,children:m1.jsx("div",{className:B0(TW,"min-w-0 flex-1 cursor-default"),children:m1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:H?"Thinking":U})})})}let z=H?"Thinking":"Thought",G=H||B;return m1.jsx(WH,{isFirst:$,isLast:Z,loading:H,children:m1.jsxs("div",{className:"min-w-0 flex-1",children:[m1.jsxs("button",{type:"button","aria-expanded":G,onClick:()=>X((U)=>!U),className:B0(TW,"cursor-pointer"),children:[m1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),m1.jsx(GX,{open:G})]}),m1.jsx(XX,{open:G,children:m1.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:m1.jsx(Jd,{content:J})})})]})})}function HG0({call:$,cwd:Z,isFirst:J,isLast:H}){if($.caller==="subagent")return m1.jsx(yl,{call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:(X,z)=>m1.jsx(IW,{parts:X,cwd:z})});if($.name==="Skill"&&$.skill){let X=$.state==="success";return m1.jsx(H_,{isFirst:J,isLast:H,call:$,marker:X?m1.jsx(Bl,{icon:al,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let Q=dP($)??lP($)??iP($);if(Q){let X=rP(Q.server,Q.tool);return m1.jsx(H_,{isFirst:J,isLast:H,call:$,marker:m1.jsx(Xl,{src:_W(Q.server)}),name:jW(Q.server),brief:Q.rest?`${X} ${Q.rest}`:X})}let B=$.state==="error"?null:$l($,Z);return m1.jsx(H_,{isFirst:J,isLast:H,call:$,leading:m1.jsx(QG0,{call:$}),name:Sl($),brief:Rl($,Z),preview:B?m1.jsx(Zl,{relPath:B}):void 0})}function QG0({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return m1.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var h1=P(c(),1);function sl($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function BG0($){let Z=[];for(let J of $)if(sl(J)){let H=Z[Z.length-1];if(H&&H.kind==="run")H.parts.push(J);else Z.push({kind:"run",parts:[J]})}else Z.push({kind:"single",part:J});return Z}function bW({parts:$,cwd:Z,processing:J=!1}){let H=BG0($);return h1.jsx("div",{className:"flex flex-col",children:H.map((Q,B)=>{let X=B===0?"":"mt-3",z=B===H.length-1;return h1.jsx("div",{className:X,children:Q.kind==="run"?h1.jsx(IW,{parts:Q.parts,cwd:Z,processing:J&&z}):h1.jsx(KG0,{part:Q.part})},B)})})}function XG0($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function zG0($){let Z=-1;for(let H=$.length-1;H>=0;H--)if(sl($[H])){Z=H;break}if(Z<0)return null;let J=$.slice(Z+1);if(!XG0(J))return null;return{work:$.slice(0,Z+1),response:J}}function GG0({parts:$,cwd:Z,durationMs:J,defaultOpen:H}){let Q=J===void 0?"Worked":`Worked for ${s$(J)}`;return h1.jsxs(BY,{defaultOpen:H,className:"group/collapsible",children:[h1.jsxs(XY,{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:[h1.jsx("span",{children:Q}),h1.jsx(R$,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),h1.jsx(zY,{className:"overflow-hidden pt-2",children:h1.jsx(bW,{parts:$,cwd:Z})})]})}function UG0({parts:$,cwd:Z,processing:J=!1,durationMs:H}){let Q=J?null:zG0($);return h1.jsx("div",{className:"w-full min-w-0",children:J?h1.jsx(bW,{parts:$,cwd:Z,processing:!0}):Q?h1.jsxs("div",{className:"flex flex-col gap-3",children:[h1.jsx(GG0,{parts:Q.work,cwd:Z,durationMs:H}),h1.jsx(bW,{parts:Q.response,cwd:Z})]}):h1.jsx(bW,{parts:$,cwd:Z})})}var tl=nl.memo(function({turn:Z,processing:J=!1}){let H=i1().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let Q=Z.parts.filter((z)=>z.type==="file-attachment"),B=Z.parts.filter((z)=>z.type==="text-attachment"),X=Z.parts.filter((z)=>z.type==="text").map((z)=>z.type==="text"?z.text:"").join(`
|
|
65
|
-
`);if(!X&&Q.length===0&&B.length===0)return null;return h1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[B.map((z,G)=>h1.jsx(EB,{label:z.label},`text-attachment:${G}`)),Q.map((z,G)=>h1.jsx(el,{mediaType:z.mediaType,previewUrl:z.previewUrl,label:z.label},G)),X&&h1.jsx("p",{className:B0("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:X})]})}return h1.jsx(UG0,{parts:Z.parts,cwd:H,processing:J,durationMs:Z.meta?.durationMs})});function KG0({part:$}){switch($.type){case"text-attachment":return h1.jsx(EB,{label:$.label});case"text":return h1.jsx(Zd,{content:$.text});case"tool-call":return h1.jsx(IW,{parts:[$],cwd:null});case"file-attachment":return h1.jsx(el,{mediaType:$.mediaType,previewUrl:$.previewUrl,label:$.label});case"source-url":return h1.jsx(ol,{url:$.url,title:$.title});case"source-document":return h1.jsx(ol,{url:"#",title:$.title});case"data":return h1.jsx(YG0,{name:$.name,data:$.data});case"reasoning":return null}}function el({mediaType:$,previewUrl:Z,label:J}){if($.startsWith("image/")&&Z)return h1.jsx("img",{src:Z,alt:J??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return h1.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:[h1.jsx(WJ,{size:16,stroke:1.75}),h1.jsx("span",{className:"truncate",children:J??$})]})}function ol({url:$,title:Z}){return h1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function YG0({name:$,data:Z}){return h1.jsxs("details",{children:[h1.jsxs("summary",{className:"cursor-pointer list-none text-xs text-muted-foreground marker:hidden [&::-webkit-details-marker]:hidden",children:["data:",$]}),h1.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 _5=P(c(),1),FG0=[],WG0=[];function kW({agent:$,active:Z=!0,focusRequest:J=0,docked:H=!1,chatLoaded:Q,hasWorkspaceApplets:B,view:X,previewTurn:z,sessionId:G,processing:U,composerBanner:K,agentAvailability:Y,annotation:F,send:W,stop:q,onNavigateFromWelcome:N,onClose:A,builderDraft:V}){let D=e1(),L=l4.useRef(null),j=l4.useRef(null),M=V?.sessionId??G??null,_=V?null:G??null,E=V?FG0:X.turns,C=w5((d)=>d.hasSentMessageFromMoi),R=w5((d)=>(d.workspaceIdsPendingAnalysis??[]).includes(D)),T=g2((d)=>(d.attachments[J8(D,M)]??[]).some((o)=>o.kind!=="text"&&o.status==="uploading")),I=!wB(!0,T,Y),y=V?null:z,S=V?WG0:X.notices,O=l4.useMemo(()=>eh(E),[E]),k=l4.useMemo(()=>th(O,y),[O,y]),b=l4.useMemo(()=>Zv(k,S),[k,S]),h=k.length>0?k[k.length-1].id:null,v=V?!1:U,f=!!V||Q&&b.length===0&&!v,w=Q&&!f,i=Of({isViewBuilderDraft:!!V,hasSentMessageFromMoi:C,isWorkspacePendingAnalysis:R}),{atBottom:r,scrollToBottom:x,scrollToTop:l}=nh(j,M);l4.useLayoutEffect(()=>{if(f&&i!=="empty")l()},[f,i,l]),l4.useEffect(()=>{if(Z)AL(L.current)},[Z,J]);let s=l4.useCallback(async(d,o)=>{if(V)await V.onSubmit(d);else W(d,o);x()},[V,W,x]),p=l4.useCallback((d)=>{if(I)return;s(d.prompt,{directives:d.context})},[s,I]);return _5.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[_5.jsxs("header",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+40px)] min-w-0 items-center justify-between pr-2 pb-2 pl-2",children:[_5.jsx("div",{className:"min-w-0 flex-1",children:_5.jsx(Sf,{isViewBuilder:!!V})}),A&&H&&_5.jsxs(Q5,{children:[_5.jsx(B5,{render:_5.jsx(j0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Undock agent",children:_5.jsx($i,{className:"size-5! text-muted-foreground",stroke:1.5})})}),_5.jsx(X5,{children:"Undock agent"})]}),!V&&A&&!H&&_5.jsx(j0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Close chat",children:_5.jsx(o5,{stroke:2})})]}),_5.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[_5.jsx("div",{ref:j,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:_5.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[f&&_5.jsx(Tf,{agent:$,kind:i,hasWorkspaceApplets:B,disabled:I,onSelectPrompt:p,onNavigate:N}),w&&b.map((d)=>d.kind==="notice"?_5.jsx(qG0,{notice:d.notice},`notice:${d.notice.id}`):_5.jsx(tl,{turn:d.turn,processing:v&&d.turn.id===h},d.turn.id)),w&&_5.jsx("div",{className:"mt-auto -ml-3 pt-2",children:_5.jsx(l9,{preset:$,color:"primary",animated:v,expression:v?"thinking":void 0})})]})}),w&&!r&&E.length>0&&_5.jsx(j0,{type:"button",variant:"outline",size:"icon",onClick:()=>x("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:_5.jsx(ZJ,{stroke:1.5})})]}),_5.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:_5.jsxs("div",{className:B0("@container flex w-full flex-col transition-[padding]",K&&"gap-2 rounded-t-lg rounded-b-2xl p-2",K?.tone==="default"&&"bg-accent",K?.tone==="error"&&"bg-destructive/10"),children:[K?.content,_5.jsx(Mf,{composerRef:L,onSend:s,onStop:q,processing:v,sessionId:M,modelSessionId:_,availability:Y,annotation:V?void 0:F,onRemoveDrawing:V?.onRemoveDrawing??F?.onRemove,allowFiles:!V,placeholder:V?"Drop in the details":void 0,draft:V?{id:V.builderId,initialValue:V.initialValue,onChange:V.onChange}:void 0})]})})]})}function qG0({notice:$}){let Z=DL($);if(!Z)return null;return _5.jsx("div",{className:"flex justify-center",children:_5.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var x3=P(c(),1);function Zi({agent:$,loading:Z,open:J,onOpenChange:H,onOpenChangeComplete:Q,children:B}){let X=()=>H(!1);return x3.jsxs(q6,{open:J,onOpenChange:(G,U)=>{if(!G&&(U.reason==="outside-press"||U.reason==="focus-out")){U.cancel();return}H(G)},onOpenChangeComplete:Q,children:[x3.jsx(N6,{render:x3.jsx("div",{className:"fixed right-3 bottom-3",children:x3.jsx(z5.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:J?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:x3.jsx("button",{type:"button",className:"group block cursor-pointer p-0 drop-shadow-[0_0_4px_var(--background)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":"Agent",children:x3.jsx(l9,{preset:$,color:"primary",animated:Z,size:Z?80:64,expression:Z?"thinking":void 0,className:B0("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")})})})})}),x3.jsx(V6,{side:"top",sideOffset:({anchor:G})=>-G.height,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:B(X)})]})}var h3=P(c(),1);function yW({actions:$,className:Z,title:J,children:H,onClose:Q,ref:B}){return h3.jsxs(z5.div,{ref:B,className:B0("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-popover text-popover-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad)",H&&"pb-0",Z),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:[h3.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[h3.jsx("p",{className:"text-sm font-medium",children:J}),h3.jsxs("div",{className:"flex items-center gap-2",children:[$,h3.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Q,"aria-label":"Close panel",children:h3.jsx(o5,{stroke:1.75})})]})]}),H&&h3.jsx("div",{className:"flex-1 pb-(--page-pad)",children:H})]})}var W5=P(c(),1),NG0=Object.entries(m6),VG0=Object.entries(yK),AG0=Object.entries(nQ),DG0=Object.entries(sQ),LG0="relative w-full rounded-lg text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50";function xW({children:$,className:Z,gridClassName:J,label:H}){return W5.jsxs("div",{className:B0("flex flex-col gap-2",Z),children:[W5.jsx("p",{className:"text-xs font-medium",children:H}),W5.jsx("div",{role:"group","aria-label":H,className:B0("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",J),children:$})]})}function hW({active:$,children:Z,className:J,onSelect:H,style:Q}){return W5.jsxs("button",{type:"button","aria-pressed":$,onClick:H,className:B0(LG0,"flex items-center gap-2 p-3",J,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:Q,children:[W5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&W5.jsx(hK,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function Ji({onClose:$,ref:Z}){KY();let{layout:J,setLayout:H}=i1(),Q=$9(J.theme);function B(X){H({theme:{...Q,...X}})}return W5.jsx(yW,{ref:Z,title:"Theme",onClose:$,className:"@4xl/workspace:max-w-5xl",children:W5.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:[W5.jsx(xW,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:NG0.map(([X,z])=>W5.jsx(hW,{active:X===Q.font,onSelect:()=>B({font:X}),style:{fontFamily:z.sans},children:W5.jsx("span",{className:"text-sm font-medium",children:z.label})},X))}),W5.jsx(xW,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:VG0.map(([X,z])=>W5.jsx(hW,{active:X===Q.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>B({color:X}),style:J9({...Q,color:X}),children:W5.jsxs("div",{className:"flex gap-2",children:[W5.jsx("span",{className:B0("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"}),W5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),W5.jsx(xW,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:AG0.map(([X,z])=>W5.jsx(hW,{active:X===Q.radius,onSelect:()=>B({radius:X}),style:J9({...Q,radius:X}),children:W5.jsxs("div",{className:"flex items-center gap-2",children:[W5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),W5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),W5.jsx(xW,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:DG0.map(([X,z])=>W5.jsx(hW,{active:X===Q.agent,onSelect:()=>B({agent:X}),children:W5.jsxs("div",{className:"flex items-center gap-2",children:[W5.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:W5.jsx(l9,{preset:X,color:"primary",size:28})}),W5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))})]})})}var pq=P(m(),1);var Bi=P(m(),1);function Hi($){return J5({queryKey:S0.appletThumbnails($),queryFn:async()=>(await q1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...p4})}function Qi($){let Z=U1();return H5({mutationFn:(J)=>P4(`/api/workspaces/${$}/applet-thumbnails`,g5("PUT",J),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.appletThumbnails($)}),Z.invalidateQueries({queryKey:S0.preview($)})}})}var MG0=1000,PG0=3,_G0=10800000,jG0=1000,OG0="1000px-3x-webp-q80-v1",TG0=5000,CG0=1000,wG0=1e4,EG0=100,SG0=5000;function RG0($){return Math.min(PG0,MG0/Math.max($.offsetWidth,$.offsetHeight))}function IG0($){return`${OG0}:${$??""}`}function bG0($,Z,J=Date.now()){if(!$||$.revision!==Z)return!0;let H=Date.parse($.capturedAt);return!Number.isFinite(H)||J-H>=_G0}function kG0($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=jG0}var yG0=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});function xG0($,Z=EG0){let J=$.getBoundingClientRect(),H=J.top-Z,Q=J.bottom+Z,B=J.left-Z,X=J.right+Z;return(z)=>{if(z.nodeType!==1)return!0;let G=z,U=G.getBoundingClientRect();if(U.width===0&&U.height===0)return G.ownerDocument?.defaultView?.getComputedStyle(G).display!=="none";return U.bottom>H&&U.top<Q&&U.right>B&&U.left<X}}function hG0($,Z,J=SG0){let H=J,Q=(B)=>{for(let X of B.children){if(!Z(X))continue;if(--H<0)return!0;if(Q(X))return!0}return!1};return Q($)}async function vG0($,Z){let{createContext:J,destroyContext:H,domToDataUrl:Q}=await import("/chunk-efdyz6xp.js"),B=xG0($);if(hG0($,B))return null;let X=async()=>{let z=await J($,{scale:RG0($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:CG0,filter:B,...Z&&{onCreateForeignObjectSvg:(G)=>{let U=document.createElement("style");U.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",G.append(U)}}});try{return await Q(z)}finally{H(z)}};return Promise.race([X(),yG0(wG0)])}async function gG0($,Z,J,H,Q=vG0,B=Date.now()){let X=[];for(let z of J){if(H())return null;let G=IG0(z.revision),U=Z.find((W)=>W.kind===$&&W.id===z.id);if(!bG0(U,G,B)){X.push({id:z.id,revision:G});continue}if(kG0(U,G)){X.push({id:z.id,revision:G});continue}if(!z.element){X.push({id:z.id,revision:G,image:null});continue}let K=performance.now(),Y=await Q(z.element,$==="widget").catch(()=>null),F=Math.round(performance.now()-K);if(H())return null;X.push({id:z.id,revision:G,image:Y,captureMs:F})}return X}function vW({kind:$,enabled:Z,targets:J}){let H=e1(),Q=Hi(H).data,B=Qi(H),X=Y5(J),z=Y5(Q??[]),G=Y5(B.mutate),U=J.map((Y)=>`${Y.id}@${Y.revision??""}`).join(`
|
|
66
|
-
`),K=Q!==void 0;Bi.useEffect(()=>{if(!Z||!K||U==="")return;let Y=!1,F=0,W,q=()=>{F+=1;let N=F;if(W!==void 0)clearTimeout(W);if(document.visibilityState!=="visible")return;W=setTimeout(async()=>{W=void 0;let A=await gG0($,z.current,X.current.map((V)=>({...V,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(i6($==="view"?"views":"widgets",V.id))}"]`)})),()=>Y||F!==N||document.visibilityState!=="visible");if(!A||Y||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:A})},TG0)};return document.addEventListener("visibilitychange",q),q(),()=>{if(Y=!0,W!==void 0)clearTimeout(W);document.removeEventListener("visibilitychange",q)}},[Z,$,K,z,G,U,X])}var xi=P(m(),1);var Xi=P(c(),1);function gW({className:$,...Z}){return Xi.jsx("div",{"data-slot":"skeleton",className:a0("animate-pulse rounded-lg bg-accent",$),...Z})}var I2=P(c(),1);function fG0($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function mG0({name:$,status:Z}){let J=_W($),H="size-full rounded-lg ring-2 ring-background";return I2.jsxs("span",{className:"relative size-10 shrink-0",children:[J?I2.jsx("img",{src:J,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):I2.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:I2.jsx(OW,{className:"size-5"})}),Z!=="connected"&&I2.jsx(zi,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function Gi($){return[...$].sort((Z,J)=>Number(J.status==="connected")-Number(Z.status==="connected"))}function Ui({icon:$,children:Z}){return I2.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,I2.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function Ki({server:$}){return I2.jsxs(Ui,{icon:I2.jsx(mG0,{name:$.name,status:$.status}),children:[I2.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:jW($.name)}),I2.jsx("span",{className:"text-sm text-muted-foreground",children:fG0($.status)})]})}function Yi(){return I2.jsxs(Ui,{icon:I2.jsx(gW,{className:"size-10 shrink-0 rounded-lg"}),children:[I2.jsx(gW,{className:"h-4 w-36 max-w-full"}),I2.jsx(gW,{className:"h-4 w-20"})]})}function B_({children:$}){return I2.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function Fi($,Z){return J5({queryKey:S0.mcp($),queryFn:()=>q1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var i4=P(c(),1);function DH({title:$,description:Z,children:J}){return i4.jsxs("div",{className:"flex flex-col gap-6",children:[i4.jsxs("header",{className:"flex flex-col gap-0.5",children:[i4.jsx("h2",{className:"text-lg font-medium",children:$}),Z&&i4.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),J]})}function LH({label:$,children:Z}){return i4.jsxs("section",{className:"flex flex-col gap-2",children:[$&&i4.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),i4.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border",children:Z})]})}function FX({title:$,description:Z,control:J}){return i4.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[i4.jsxs("div",{className:"flex min-w-0 flex-col",children:[i4.jsx("span",{className:"text-sm font-medium",children:$}),Z&&i4.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),J&&i4.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:J})]})}var K4=P(c(),1),uG0=Array.from({length:4},($,Z)=>Z);function pG0({connectors:$}){if($.isPending)return K4.jsx("div",{role:"status","aria-label":"Loading connectors",children:K4.jsx(B_,{children:uG0.map((Z)=>K4.jsx(Yi,{},Z))})});if($.isError)return K4.jsxs(Wi,{children:[K4.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),K4.jsx(j0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return K4.jsxs(Wi,{children:[K4.jsx(fW,{size:24,stroke:1.5,className:"text-muted-foreground"}),K4.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return K4.jsx(B_,{children:Gi($.data).map((Z)=>K4.jsx(Ki,{server:Z},Z.name))})}function Wi({children:$}){return K4.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 qi(){let{workspaceId:$}=i1(),Z=Fi($,!0);return K4.jsx(DH,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:K4.jsx(pG0,{connectors:Z})})}var U_=P(m(),1);var qX={};C5(qX,{Thumb:()=>Pi,Root:()=>Li});var e$=P(m(),1);var mW=P(m(),1),X_=mW.createContext(void 0);function Ni(){let $=mW.useContext(X_);if($===void 0)throw Error(y0(63));return $}var Vi="data-checked",Ai="data-unchecked";var uW={...C2,checked($){if($)return{[Vi]:""};return{[Ai]:""}}};var Di=P(m(),1);function pW($,Z,J,H=!0,Q){let[B,X]=Di.useState(),z=t0(Q?`${Q}-label`:void 0),G=$??Z??B;return J0(()=>{let U=$||Z||!H?void 0:dG0(J.current,z);if(B!==U)X(U)}),G}function dG0($,Z){let J=lG0($);if(!J)return;if(!J.id&&Z)J.id=Z;return J.id||void 0}function lG0($){if(!$)return;let Z=$.parentElement;if(Z&&Z.tagName==="LABEL")return Z;let J=$.id;if(J){let Q=$.nextElementSibling;if(Q&&Q.htmlFor===J)return Q}let H=$.labels;return H&&H[0]}var WX=P(c(),1),Li=e$.forwardRef(function(Z,J){let{checked:H,className:Q,defaultChecked:B,"aria-labelledby":X,form:z,id:G,inputRef:U,name:K,nativeButton:Y=!1,onCheckedChange:F,readOnly:W=!1,required:q=!1,disabled:N=!1,render:A,uncheckedValue:V,value:D,style:L,...j}=Z,{clearErrors:M}=Z4(),{state:_,setTouched:E,setDirty:C,validityData:R,setFilled:T,setFocused:I,validationMode:y,disabled:S,name:O,validation:k}=l5(),{labelId:b}=i5(),h=S||N,v=O??K,f=e$.useRef(null),w=x2(f,U,k.inputRef),i=e$.useRef(null),r=t0(),x=E6({id:G}),l=Y?void 0:x,[s,p]=J4({controlled:H,default:Boolean(B),name:"Switch",state:"checked"});w6(i,r,s,void 0,!h,K),J0(()=>{T(s)},[s,T]),h9(s,()=>{M(v),C(s!==R.initialValue),k.change(s)});let{getButtonProps:d,buttonRef:o}=T5({disabled:h,native:Y}),Z0=pW(X,b,f,!Y,l),H0={id:Y?x:r,role:"switch","aria-checked":s,"aria-readonly":W||void 0,"aria-required":q||void 0,"aria-labelledby":Z0,onFocus(){if(!h)I(!0)},onBlur(){let A0=f.current;if(!A0||h)return;if(E(!0),I(!1),y==="onBlur")k.commit(A0.checked)},onClick(A0){if(W||h)return;A0.preventDefault();let N0=f.current;if(!N0)return;gJ(N0,A0)}},G0={...k.getValidationProps(h),checked:s,disabled:h,form:z,id:l,name:v,required:q,style:v?wz:u8,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:w,onChange(A0){if(A0.nativeEvent.defaultPrevented)return;if(W){A0.preventDefault();return}let N0=A0.currentTarget.checked,F0=R0(K0.none,A0.nativeEvent);if(F?.(N0,F0),F0.isCanceled)return;p(N0)},onClick(A0){A0.stopPropagation()},onFocus(){i.current?.focus()},...D!==void 0?{value:D}:L1},X0=e$.useMemo(()=>({..._,checked:s,disabled:h,readOnly:W,required:q}),[_,s,h,W,q]),Y0=z0("span",Z,{state:X0,ref:[J,i,o],props:[H0,j,d,(A0)=>k.getValidationProps(h,A0)],stateAttributesMapping:uW});return WX.jsxs(X_.Provider,{value:X0,children:[Y0,!s&&v&&V!==void 0&&WX.jsx("input",{type:"hidden",form:z,name:v,value:V,disabled:h}),WX.jsx("input",{...G0,suppressHydrationWarning:!0})]})});var Mi=P(m(),1);var Pi=Mi.forwardRef(function(Z,J){let{render:H,className:Q,style:B,...X}=Z,z=Ni();return z0("span",Z,{state:z,ref:J,stateAttributesMapping:uW,props:X})});var z_=P(c(),1);function _i({className:$,...Z}){return z_.jsx(qX.Root,{"data-slot":"switch",className:a0('peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-sm border border-transparent p-px transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:bg-primary data-unchecked:bg-accent data-disabled:cursor-not-allowed data-disabled:opacity-50 [:where([class~="group/field-label"]:has(:focus-visible))_&]:border-transparent [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:z_.jsx(qX.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-xs bg-background shadow-xs ring-0 transition-transform data-checked:translate-x-full data-checked:bg-white data-unchecked:translate-x-0"})})}var G_=["app-settings"];function ji(){let $=U1();return W2((Z)=>{if(Z.type==="settings:updated")$.setQueryData(G_,Z.settings)}),J5({queryKey:G_,queryFn:()=>q1("/api/settings"),staleTime:30000})}function Oi(){let $=U1();return H5({mutationFn:(Z)=>q1("/api/settings",g5("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(G_,Z)}})}function Ti($){return J5({queryKey:S0.env($),queryFn:()=>q1(`/api/workspaces/${$}/env`),...p4})}function Ci($){let Z=U1();return H5({mutationFn:(J)=>q1(`/api/workspaces/${$}/env`,g5("PUT",J)),onSuccess:(J)=>{Z.setQueryData(S0.env($),J)}})}function wi($){let Z=U1();return H5({mutationFn:(J)=>P4(`/api/workspaces/${$}/config`,g5("PUT",{name:J}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all})}})}function Ei($){let Z=U1();return H5({scope:{id:`workspace-icon:${$}`},mutationFn:async(J)=>{if(J.kind==="set"){await P4(`/api/workspaces/${$}/config`,g5("PUT",{icon:J.icon}),"Failed to save icon");return}if(J.kind==="reset"){await P4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon");return}await q1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":J.file.type||"application/octet-stream"},body:J.file})},onMutate:(J)=>{if(J.kind!=="set")return;let H={icon:J.icon};Z.setQueryData(S0.layout($),(Q)=>Q?{...Q,...H}:Q),Z.setQueryData(S0.all,(Q)=>Q?.map((B)=>B.id===$?{...B,...H}:B))},onError:(J,H)=>{if(H.kind!=="set")return;Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all,exact:!0})},onSuccess:()=>{Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all})}})}function Si($){let Z=U1();return W2((J)=>{if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:S0.env($)})}),{env:Ti($),update:Ci($)}}var p5=P(c(),1),iG0={dotenv:".env",custom:"secret",both:"override"},rG0=/^[A-Za-z_][A-Za-z0-9_]*$/;function Ri(){let{workspaceId:$}=i1(),{env:Z,update:J}=Si($),[H,Q]=U_.useState(""),[B,X]=U_.useState(""),z=rG0.test(H),G=z&&B.length>0&&!J.isPending,U=()=>{if(!G)return;J.mutate({set:{[H]:B}},{onSuccess:()=>{Q(""),X("")}})},K=Z.data?.vars??[],Y=Z.data?.files.reduce((W,q)=>W+q.count,0)??0,F=Z.data?.files.length??0;return p5.jsxs(DH,{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:[p5.jsxs(LH,{label:"Variables",children:[Z.isLoading?p5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:p5.jsx(k5,{className:"size-4 animate-spin",stroke:1.75})}):K.length===0?p5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):K.map((W)=>{let q=W.source!=="dotenv";return p5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[p5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),p5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),p5.jsx("span",{className:B0("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:iG0[W.source]}),!q&&p5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),p5.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>J.mutate({remove:[W.key]}),disabled:!q,"aria-label":`Delete ${W.key}`,className:"disabled:invisible",children:p5.jsx(cW,{stroke:1.75})})]},W.key)}),p5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[p5.jsx(N$,{value:H,onChange:(W)=>Q(W.target.value),placeholder:"NEW_KEY","aria-invalid":H.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),p5.jsx(N$,{value:B,onChange:(W)=>X(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")U()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),p5.jsxs(j0,{variant:"outline",size:"sm",onClick:U,disabled:!G,children:[J.isPending?p5.jsx(k5,{stroke:1.75,className:"animate-spin"}):p5.jsx(f2,{stroke:1.75}),"Add"]})]})]}),p5.jsx(LH,{label:"From .env files",children:p5.jsx(FX,{title:"Inherit .env files",description:F>0?`Discovered ${Y} ${Y===1?"key":"keys"} across ${F} ${F===1?"file":"files"} in this space.`:"No .env files found in this space.",control:p5.jsx(_i,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(W)=>J.mutate({inheritDotenv:W})})})})]})}var B9={};C5(B9,{createHandle:()=>ki,Viewport:()=>EU,Trigger:()=>bi,Title:()=>SU,Root:()=>Ii,Portal:()=>TU,Popup:()=>OU,Handle:()=>dW,Description:()=>MU,Close:()=>LU,Backdrop:()=>DU});function Ii($){return wU("alert-dialog",$)}var bi=RU;class dW extends XJ{}function ki(){return new dW}var Y4=P(c(),1);function lW({...$}){return Y4.jsx(B9.Root,{"data-slot":"alert-dialog",...$})}function iW({...$}){return Y4.jsx(B9.Trigger,{"data-slot":"alert-dialog-trigger",...$})}function aG0({...$}){return Y4.jsx(j8,{portal:B9.Portal,"data-slot":"alert-dialog-portal",...$})}function oG0({className:$,...Z}){return Y4.jsx(B9.Backdrop,{"data-slot":"alert-dialog-overlay",className:a0("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function rW({className:$,size:Z="default",...J}){return Y4.jsxs(aG0,{children:[Y4.jsx(oG0,{}),Y4.jsx(B9.Popup,{"data-slot":"alert-dialog-content","data-size":Z,className:a0("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm 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",$),...J})]})}function aW({className:$,...Z}){return Y4.jsx("div",{"data-slot":"alert-dialog-header",className:a0("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",$),...Z})}function oW({className:$,...Z}){return Y4.jsx("div",{"data-slot":"alert-dialog-footer",className:a0("-mx-6 -mb-6 flex flex-col-reverse gap-2 rounded-b-xl p-6 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",$),...Z})}function nW({className:$,...Z}){return Y4.jsx(B9.Title,{"data-slot":"alert-dialog-title",className:a0('text-base font-medium sm:group-data-[size=default]/alert-dialog-content:[:where([class~="group/alert-dialog-content"]):has([data-slot=alert-dialog-media])_&]:col-start-2',$),...Z})}function sW({className:$,...Z}){return Y4.jsx(B9.Description,{"data-slot":"alert-dialog-description",className:a0("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}function tW({className:$,...Z}){return Y4.jsx(j0,{"data-slot":"alert-dialog-action",className:a0($),...Z})}function eW({className:$,variant:Z="outline",size:J="default",...H}){return Y4.jsx(B9.Close,{"data-slot":"alert-dialog-cancel",className:a0($),render:Y4.jsx(j0,{variant:Z,size:J}),...H})}var Y2=P(c(),1);function yi(){let{cloudDemo:$}=T8(),{name:Z,cwd:J,workspaceId:H}=i1(),[,Q]=q8(),B=ER(),X=Z??J??"this space",z=()=>{B.mutate(H,{onSuccess:()=>Q("/")})};return Y2.jsxs(DH,{title:"General",description:"Basic details for this space.",children:[Y2.jsx(LH,{children:Y2.jsx(FX,{title:"Path",control:Y2.jsx(N$,{value:J??"","aria-label":"Workspace path",title:J??void 0,className:"w-56",readOnly:!0})})}),!$&&Y2.jsx(LH,{label:"Danger zone",children:Y2.jsx(FX,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:Y2.jsxs(lW,{children:[Y2.jsx(iW,{render:Y2.jsx(j0,{type:"button",variant:"destructive",size:"sm"}),disabled:B.isPending,children:"Remove"}),Y2.jsxs(rW,{children:[Y2.jsxs(aW,{children:[Y2.jsxs(nW,{children:["Remove “",X,"” from your workspaces?"]}),Y2.jsx(sW,{children:"This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time."})]}),B.isError&&Y2.jsx("p",{className:"text-xs text-destructive",children:B.error.message}),Y2.jsxs(oW,{children:[Y2.jsx(eW,{disabled:B.isPending,children:"Cancel"}),Y2.jsxs(tW,{type:"button",variant:"destructive",onClick:z,disabled:B.isPending,children:[B.isPending&&Y2.jsx(k5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})]})]})]})})})]})}var r4=P(c(),1),nG0=[{id:"general",label:"General",icon:S6},{id:"connectors",label:"Connectors",icon:fW},{id:"environment",label:"Environment",icon:nU}];function $q({children:$}){let[Z,J]=xi.useState("general");return r4.jsxs(O6,{children:[$,r4.jsxs(zJ,{className:"flex h-[min(680px,90vh)] w-[880px] gap-0 overflow-hidden p-0 sm:max-w-[94vw]",children:[r4.jsx(T6,{className:"sr-only",children:"Space settings"}),r4.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r bg-muted p-3",children:[r4.jsx("p",{className:"px-2.5 pt-4 pb-2 text-xs text-muted-foreground",children:"Settings"}),nG0.map((H)=>r4.jsxs(j0,{type:"button",variant:Z===H.id?"secondary":"ghost",size:"sm",onClick:()=>J(H.id),className:"justify-start",children:[r4.jsx(H.icon,{stroke:1.75}),H.label]},H.id))]}),r4.jsx("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:r4.jsxs("div",{className:"px-8 py-7",children:[Z==="general"&&r4.jsx(yi,{}),Z==="connectors"&&r4.jsx(qi,{}),Z==="environment"&&r4.jsx(Ri,{})]})})]})]})}var di=P(m(),1);var hi=P(m(),1);var vi=P(c(),1);function Zq({className:$,onBlur:Z,onFocus:J,onKeyDown:H,onValueChange:Q,onValueCommit:B,selectOnFocus:X,...z}){let G=hi.useRef(null);function U(F){let W=G.current!==null;if(G.current=null,Z?.(F),!F.defaultPrevented&&W)B?.(F.currentTarget.value)}function K(F){if(G.current=F.currentTarget.value,X){let W=F.currentTarget;W.select(),requestAnimationFrame(()=>{W.scrollLeft=0})}J?.(F)}function Y(F){if(H?.(F),F.defaultPrevented)return;if(F.key==="Enter")F.preventDefault(),F.currentTarget.blur();else if(F.key==="Escape"){F.preventDefault();let W=G.current??F.currentTarget.value;G.current=null,F.currentTarget.value=W,Q?.(W),F.currentTarget.blur()}}return vi.jsx(hQ,{"data-slot":"inline-input",className:B0("-ml-2 [field-sizing:content] w-auto max-w-full min-w-0 rounded-md bg-transparent px-2 py-0.5 text-sm shadow-none outline-none focus:[field-sizing:fixed] focus:w-full focus-visible:border-ring focus-visible:bg-accent disabled:pointer-events-none",$),onBlur:U,onChange:(F)=>Q?.(F.target.value),onFocus:K,onKeyDown:Y,...z})}function Jq($){return J5({queryKey:S0.views($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/views`)).views},...p4})}function gi($){return H5({mutationFn:({viewId:Z,title:J})=>q1(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,g5("PATCH",{title:J}),"Failed to rename view")})}function fi($){return H5({mutationFn:(Z)=>P4(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,{method:"DELETE"},"Failed to delete view")})}function Hq($,Z){let J=$??[];if(J.findIndex((Q)=>Q.id===Z.id)===-1)return[...J,Z];return J.map((Q)=>Q.id===Z.id&&Q.updatedAt<=Z.updatedAt?Z:Q)}function Qq($){let Z=U1();return W2((J)=>{if(J.type==="view-builder:updated"&&J.workspaceId===$)Z.setQueryData(S0.viewBuilders($),(H)=>Hq(H,J.builder));else if(J.type==="view-builder:deleted"&&J.workspaceId===$)Z.setQueryData(S0.viewBuilders($),(H)=>(H??[]).filter((Q)=>Q.id!==J.builderId))}),J5({queryKey:S0.viewBuilders($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/view-builders`)).builders},...p4})}function mi($){let Z=U1();return H5({mutationFn:()=>q1(`/api/workspaces/${$}/view-builders`,g5("POST"),"Failed to create view builder"),onSuccess:(J)=>{Z.setQueryData(S0.viewBuilders($),(H)=>Hq(H,J))}})}function ui($){let Z=U1();return H5({mutationFn:({builderId:J,requirements:H})=>q1(`/api/workspaces/${$}/view-builders/${J}`,g5("PATCH",{input:{requirements:H}}),"Failed to save view requirements"),onSuccess:(J)=>{Z.setQueryData(S0.viewBuilders($),(H)=>Hq(H,J))}})}function pi($){let Z=U1();return H5({mutationFn:({builderId:J,requirements:H,...Q})=>q1(`/api/workspaces/${$}/view-builders/${J}/submit`,g5("POST",{input:{requirements:H},availableIcons:vQ,...Q}),"Failed to start view builder"),onSuccess:(J)=>{Z.setQueryData(S0.viewBuilders($),(H)=>Hq(H,J))}})}function ci($){let Z=U1();return H5({mutationFn:(J)=>P4(`/api/workspaces/${$}/view-builders/${J}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:(J,H)=>{Z.setQueryData(S0.viewBuilders($),(Q)=>(Q??[]).filter((B)=>B.id!==H))}})}function NX($){return $.config.title||$.id}function VX($,Z){let J=Z.find((H)=>H.viewId===$.id);return A$($.config.icon)??A$(J?.icon)??rJ}var C1=P(c(),1);function sG0({outlined:$,onClick:Z}){return C1.jsxs("button",{type:"button","aria-label":"Create new view",onClick:Z,className:B0("group flex w-20 shrink-0 cursor-pointer flex-col items-center gap-2 text-sm",$?"text-foreground":"text-muted-foreground"),children:[C1.jsx("div",{className:B0("size-16 rounded-2xl squircle",$&&"shadow-xs transition-shadow duration-300 ease-out group-hover:shadow-2xl"),children:C1.jsx("div",{className:B0("flex size-full items-center justify-center rounded-2xl squircle",$?"bg-background text-foreground":"bg-accent"),children:C1.jsx(f2,{size:32,stroke:1.25})})}),C1.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:"New view"})]})}function tG0({view:$,Icon:Z,onOpen:J}){let{workspaceId:H}=i1(),Q=gi(H),B=fi(H),X=NX($),[z,G]=di.useState(!1);function U(){G(!0)}function K(Y){let F=Y.trim();if(!F||F===X)return;Q.mutate({viewId:$.id,title:F},{onError:(W)=>{K5.add({title:"Couldn’t rename view",description:W.message,type:"error"})}})}return C1.jsxs("div",{className:"group/item relative w-20 shrink-0",children:[C1.jsxs("button",{type:"button","aria-label":`Open ${X}`,onClick:J,className:"group flex w-20 cursor-pointer flex-col items-center gap-2 text-sm text-foreground",children:[C1.jsx("div",{className:"size-16 rounded-2xl transition-shadow duration-300 ease-out squircle group-hover:shadow-xl group-hover/item:shadow-xl",children:C1.jsx("div",{"data-vivid":!0,className:"flex size-full items-center justify-center rounded-2xl bg-primary text-primary-foreground inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)] squircle",children:C1.jsx(Z,{size:32,stroke:1.25})})}),C1.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:z?"":X})]}),z&&C1.jsx(Zq,{autoFocus:!0,selectOnFocus:!0,"aria-label":`Rename ${X}`,defaultValue:X,onBlur:()=>G(!1),onValueCommit:K,className:"absolute top-18 left-0 m-0 h-auto w-20 max-w-20 min-w-0 rounded-xs px-1 py-0 text-center text-xs leading-snug font-medium"}),C1.jsxs(lW,{children:[C1.jsxs(o9,{children:[C1.jsx(n9,{render:C1.jsx(j0,{type:"button",variant:"outline",size:"icon-xs","aria-label":`View actions for ${X}`,className:"absolute -top-1 right-1 border-0 opacity-0 shadow-xs transition-opacity group-hover/item:opacity-100 group-hover/item:delay-400 focus-visible:opacity-100 data-popup-open:opacity-100",children:C1.jsx(oU,{stroke:1.75})})}),C1.jsxs(s9,{align:"end",className:"min-w-32",children:[C1.jsxs(H9,{onClick:U,disabled:Q.isPending,children:[C1.jsx(TF,{stroke:1.75}),"Rename"]}),C1.jsxs(H9,{nativeButton:!0,render:C1.jsx(iW,{}),disabled:B.isPending,onClick:()=>B.reset(),className:"w-full",children:[C1.jsx(cW,{stroke:1.75}),"Delete"]})]})]}),C1.jsxs(rW,{children:[C1.jsxs(aW,{children:[C1.jsxs(nW,{children:["Delete “",X,"”?"]}),C1.jsx(sW,{children:"This deletes the view and its source code. Related data and shared files stay in the workspace."})]}),B.isError&&C1.jsx("p",{className:"text-xs text-destructive",children:B.error.message}),C1.jsxs(oW,{children:[C1.jsx(eW,{disabled:B.isPending,children:"Cancel"}),C1.jsxs(tW,{type:"button",variant:"destructive",disabled:B.isPending,onClick:()=>B.mutate($.id),children:[B.isPending&&C1.jsx(k5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Delete view"]})]})]})]})]})}function li({views:$,builders:Z,onOpenView:J,onCreateView:H,showOnboarding:Q}){let B=$.length===0;return C1.jsxs("div",{className:"relative no-scrollbar flex size-full items-center overflow-hidden bg-muted",children:[B&&C1.jsx("div",{className:"pointer-events-none absolute inset-0 texture-checker [mask-image:linear-gradient(to_right,transparent_40%,black_80%)]","aria-hidden":!0}),C1.jsx("h2",{className:"relative pr-6 pl-12 text-2xl font-semibold text-foreground",children:"Views"}),C1.jsxs("div",{className:"relative no-scrollbar flex scroll-fade-x gap-2 overflow-x-auto px-6 pt-4 [--scroll-fade-reveal:16px]",children:[$.map((X)=>C1.jsx(tG0,{view:X,Icon:VX(X,Z),onOpen:()=>J(X.id)},X.id)),C1.jsx(sG0,{outlined:B,onClick:H})]}),B&&Q&&C1.jsx("p",{className:"relative mr-8 ml-auto max-w-56 text-right text-sm text-muted-foreground",children:"Create new views when you need separate pages for focused tasks"})]})}var ri=P(c(),1),eG0={[KL.id]:($)=>ri.jsx(li,{views:$.views,builders:$.builders,onOpenView:$.onOpenView,onCreateView:$.onCreateView,showOnboarding:$.showOnboarding})};function ii($,Z){if(!r9($))return;return eG0[$](Z)}function ai($,Z,J,H){let Q=$.reduce((B,X)=>Math.max(B,X.y+X.h),0);for(let B=0;B<=Q+J;B++)for(let X=0;X<=H-Z;X++)if(!$.some((G)=>!(X+Z<=G.x||G.x+G.w<=X||B+J<=G.y||G.y+G.h<=B)))return{x:X,y:B};return{x:0,y:Q}}function AX($,Z=[],J=4){let H=[];for(let Q of $){let{x:B,y:X}=Q.x!==void 0&&Q.y!==void 0?{x:Q.x,y:Q.y}:ai([...Z,...H],Q.w,Q.h,J);H.push({i:Q.id,x:B,y:X,w:Q.w,h:Q.h})}return H}function Bq($,Z,J){return ai($,Z,J,4)}function oi($,Z){let J=new Map(Z.map((H)=>[H.id,H]));return $.map((H)=>{let Q=J.get(H.i);return Q?{...H,x:Q.x,y:Q.y}:H})}var K_=P(m(),1),Xq=new Map;function $U0($){let Z=window.__moiAppletCss?.get($)??"",J=Xq.get($);if(!J){let B=document.createElement("style");B.dataset.appletStyle=$,document.head.appendChild(B),J={el:B,refs:0},Xq.set($,J)}if(J.el.textContent!==Z)J.el.textContent=Z;J.refs++;let H=J,Q=!1;return()=>{if(Q)return;if(Q=!0,H.refs--,H.refs<=0)H.el.remove(),Xq.delete($)}}function ZU0($){let Z=Xq.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function zq($,Z,J=!1){K_.useInsertionEffect(()=>$U0($),[$,Z]),K_.useInsertionEffect(()=>{if(J)ZU0($)},[$,J,Z])}var Y_=P(c(),1);function ni({segment:$,name:Z,version:J,children:H}){let Q=e1(),B=i6($,Z);return zq(MY($,Q,Z),J),Y_.jsx("div",{"data-applet":B,className:"size-full",children:Y_.jsx(DQ,{appletId:B,children:H})})}var si=P(m(),1);var MH=P(c(),1);class DX extends si.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),Z8(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
|
|
67
|
-
`)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return MH.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[MH.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[MH.jsx(NG,{size:16,stroke:1.75}),"Widget crashed"]}),MH.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var W7=P(c(),1);function ti({name:$}){let Z=e1(),J=Vh($);return W7.jsxs(j4,{mode:"wait",initial:!1,children:[J.status==="ready"&&W7.jsx(z5.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:W7.jsx(DX,{name:$,kind:"widget",workspaceId:Z,resetKey:J.version,children:W7.jsx(ni,{segment:"widgets",name:$,version:J.version,children:W7.jsx(J.Component,{})})})},J.version),J.status==="error"&&W7.jsx(z5.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:J.error},`err-${J.version}`)]})}var $r=P(m(),1);var q7=P(c(),1);function Gq({customizing:$,hidden:Z,widgetId:J,onRemove:H,children:Q}){let B=Ih(),X=!J||!r9(J);return q7.jsxs(z5.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:[q7.jsx("div",{"data-widget-chrome":!0,"data-vivid":X?!0:void 0,style:X?J9(B,"widget"):void 0,className:B0("absolute inset-0 overflow-hidden rounded-2xl text-foreground squircle",$&&"pointer-events-none"),children:Q}),$&&H&&q7.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:q7.jsx(j0,{size:"icon-sm",variant:"outline",className:"rounded-full","aria-label":Z?"Restore widget":"Hide widget",onPointerDown:(z)=>z.stopPropagation(),onClick:H,children:Z?q7.jsx(f2,{stroke:1.75}):q7.jsx(ei,{stroke:1.75})})})]})}var v3=P(c(),1),JU0={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},HU0={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"},QU0={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},BU0={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function Zr({items:$,renderItem:Z,onCreateWidget:J,onClose:H,onRestore:Q,ref:B}){let X=$r.useMemo(()=>AX($),[$]);return v3.jsx(yW,{ref:B,title:"Widgets",actions:v3.jsxs(j0,{type:"button",variant:"secondary",size:"sm",onClick:J,children:[v3.jsx(f2,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),onClose:H,className:"max-h-[60vh]",children:X.length>0&&v3.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:v3.jsx(j4,{children:X.map((z)=>v3.jsx(z5.div,{layoutId:z.i,className:B0(JU0[z.x],HU0[z.y],QU0[z.w],BU0[z.h]),transition:{type:"spring",duration:0.35,bounce:0},children:v3.jsx(Gq,{customizing:!0,widgetId:z.i,onRemove:()=>Q(z.i),hidden:!0,children:Z(z.i)})},z.i))})})})}var Oq=P(m(),1);var E4=P(m(),1);var Z1=P(m(),1),PH=P(m(),1),G8=P(m(),1),jr=P(c(),1),Kq=P(m(),1),Yq=P(m(),1),v1=P(c(),1),XU0=Object.defineProperty,zU0=($,Z)=>{for(var J in Z)XU0($,J,{get:Z[J],enumerable:!0})},g3={};zU0(g3,{ActiveEmoji:()=>fr,Empty:()=>gr,List:()=>xr,Loading:()=>vr,Root:()=>Er,Search:()=>Sr,SkinTone:()=>mr,SkinToneSelector:()=>hr,Viewport:()=>Rr});var Ar="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",q_=["none","light","medium-light","medium","medium-dark","dark"];function F_($){return $.charAt(0).toUpperCase()+$.slice(1)}var X9=2,F4=null;function Jr($){try{F4??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!F4||(queueMicrotask(()=>{F4&&(F4=null)}),F4.canvas.width=X9,F4.canvas.height=X9,F4.font=`2px ${Ar}`,F4.textBaseline="middle",F4.measureText($).width>=X9*2))return!1;F4.fillStyle="#00f",F4.fillText($,0,0);let Z=F4.getImageData(0,0,X9,X9).data;F4.clearRect(0,0,X9,X9),F4.fillStyle="#f00",F4.fillText($,0,0);let J=F4.getImageData(0,0,X9,X9).data;for(let H=0;H<X9*X9*4;H+=4)if(Z[H]!==J[H]||Z[H+1]!==J[H+1]||Z[H+2]!==J[H+2])return!1;return!0}function Hr($,Z,J){try{let H=$.getItem(Z);if(!H)throw Error(`No value found for "${Z}".`);let Q=JSON.parse(H);return J(Q)}catch{return null}}function Dr($,Z,J){$.setItem(Z,JSON.stringify(J))}function Qr($){return(Z)=>Z===void 0?void 0:$(Z)}function Br($){return(Z)=>Z===null?null:$(Z)}function p2($){if(typeof $!="string")throw Error();return $}function Uq($){if(typeof $!="number")throw Error();return $}function Lr($){if(typeof $!="boolean")throw Error();return $}function N7($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let J={};for(let H in $){let Q=Z[H];Q===void 0&&$[H](void 0),J[H]=$[H](Q)}return J}}function W_($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var Mr=($,Z)=>`${$}/${Z}/data.json`,Pr=($,Z)=>`${$}/${Z}/messages.json`,GU0=["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"],Xr="en",_r=($)=>`frimousse/data/${$}`,zr="frimousse/metadata";async function Gr($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function UU0($,Z,J){let[{emojis:H,emojisEtag:Q},{messages:B,messagesEtag:X}]=await Promise.all([fetch(Mr($,Z),{signal:J}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(Pr($,Z),{signal:J}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:H,messages:B,emojisEtag:Q,messagesEtag:X}}async function KU0($,Z,J){let[H,Q]=await Promise.all([Gr(Mr($,Z),J),Gr(Pr($,Z),J)]);return{emojisEtag:H,messagesEtag:Q}}function YU0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,J)=>{let H=q_[J.tone];return Z[H]=J.emoji,Z},{}):void 0}async function Ur($,Z,J){let{emojis:H,emojisEtag:Q,messages:B,messagesEtag:X}=await UU0($,Z,J),z=B.subgroups.find((q)=>q.key==="country-flag"||q.key==="subdivision-flag"),G=B.groups.filter((q)=>q.key!=="component"),U=H.filter((q)=>("group"in q)),K=G.map((q)=>({index:q.order,label:F_(q.message)})),Y=B.skinTones.reduce((q,N)=>(q[N.key]=F_(N.message),q),{}),F=U.map((q)=>({emoji:q.emoji,category:q.group,version:q.version,label:F_(q.label),tags:q.tags??[],countryFlag:z&&q.subgroup===z.order||void 0,skins:YU0(q)})),W={locale:Z,emojis:F,categories:K,skinTones:Y};return Dr(localStorage,_r(Z),{data:W,metadata:{emojisEtag:Q,messagesEtag:X}}),W}function FU0($,Z){let J=new Map;for(let X of $)J.has(X.version)||J.set(X.version,X.emoji);let H=[...J.keys()].sort((X,z)=>z-X),Q=H[0]??0,B=Jr("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:B};for(let X of H){let z=J.get(X);if(Jr(z))return{emojiVersion:X,countryFlags:B}}return{emojiVersion:Q,countryFlags:B}}var WU0=N7({emojiVersion:Uq,countryFlags:Lr}),qU0=N7({data:N7({locale:p2,emojis:W_(N7({emoji:p2,category:Uq,label:p2,version:Uq,tags:W_(p2),countryFlag:Qr(Lr),skins:Qr(N7({light:p2,"medium-light":p2,medium:p2,"medium-dark":p2,dark:p2}))})),categories:W_(N7({index:Uq,label:p2})),skinTones:N7({light:p2,"medium-light":p2,medium:p2,"medium-dark":p2,dark:p2})}),metadata:N7({emojisEtag:Br(p2),messagesEtag:Br(p2)})});async function NU0({locale:$,emojiVersion:Z,emojibaseUrl:J,signal:H}){let Q=typeof J=="string"?J:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,B=Hr(sessionStorage,zr,WU0),X=Hr(localStorage,_r($),qU0),z;if(!X)z=await Ur(Q,$,H);else if(B)z=X.data;else try{let{emojisEtag:U,messagesEtag:K}=await KU0(Q,$,H);z=!U||!K||U!==X.metadata.emojisEtag||K!==X.metadata.messagesEtag?await Ur(Q,$,H):X.data}catch{z=X.data}B??=FU0(z.emojis,Z),Dr(sessionStorage,zr,B);let G=z.emojis.filter((U)=>{let K=U.version<=B.emojiVersion;return U.countryFlag?K&&B.countryFlags:K});return{locale:$,emojis:G,categories:z.categories,skinTones:z.skinTones}}function Kr($){return GU0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${Xr}" instead.`),Xr)}function Yr($){return q_.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function VU0($,Z){let J=[];if(Z<=0)return J;for(let H=0,Q=$.length;H<Q;H+=Z)J.push($.slice(H,H+Z));return J}function AU0($,Z){if(!Z)return $;let J=Z.toLowerCase().trim(),H=new WeakMap;return $.filter((Q)=>{let B=0;Q.label.toLowerCase().includes(J)&&(B+=10);for(let X of Q.tags)X.toLowerCase().includes(J)&&(B+=1);return B>0?(H.set(Q,B),!0):!1}).sort((Q,B)=>(H.get(B)??0)-(H.get(Q)??0))}function DU0($,Z,J,H){let Q=AU0($.emojis,H),B=[],X=[],z=[],G={},U=0,K=0;for(let Y of Q)G[Y.category]||(G[Y.category]=[]),G[Y.category].push({emoji:J&&J!=="none"&&Y.skins?Y.skins[J]:Y.emoji,label:Y.label});for(let Y of $.categories){let F=G[Y.index];if(!F||F.length===0)continue;let W=VU0(Array.from(F),Z).map((q)=>({categoryIndex:U,emojis:q}));B.push(...W),X.push({label:Y.label,rowsCount:W.length,startRowIndex:K}),z.push(K),U++,K+=W.length}return{count:Q.length,categories:X,categoriesStartRowIndices:z,rows:B,skinTones:$.skinTones}}function LU0($){let Z={},J=null,H=null,Q=new Set,B=()=>{if(J){Z=J,J=null;for(let U of Q)U(Z)}H=null},X=()=>J??Z,z=(U)=>{J??=Z,Object.assign(J,typeof U=="function"?U(X()):U),H||(H=requestAnimationFrame(B))},G=(U)=>(Q.add(U),()=>Q.delete(U));return Z=$(z,X),{get:X,set:z,subscribe:G}}function MU0($){let[Z]=G8.useState($);return Z}function PU0($){let Z=G8.createContext(null);return{useStore:()=>{let J=G8.useContext(Z);if(!J)throw Error($);return J},Provider:({store:J,children:H})=>jr.jsx(Z.Provider,{value:J,children:H})}}function z8($,Z,J=Object.is){let[H,Q]=G8.useState(()=>Z($.get()));return G8.useEffect(()=>$.subscribe(()=>{let B=Z($.get());Q((X)=>J(X,B)?X:B)}),[$,Z,J]),G8.useDebugValue(H),H}function Q3($,Z,J){let H=G8.useCallback((Q)=>Q[Z],[Z]);return z8($,H,J)}var Fr=2;function _U0($,Z,J,H,Q){let B=0;return LU0((X,z)=>({locale:Z,columns:J,sticky:H,skinTone:Q,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 U=z(),K=G?.data??U.data,Y=G?.categoryHeaderHeight??U.categoryHeaderHeight,F=G?.rowHeight??U.rowHeight,W=G?.viewportHeight??U.viewportHeight;if(!K||K.rows.length===0||!Y||!F||!W)return X({...G,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let q=0,N=0;for(let C of K.categories)if(N++*Y+C.startRowIndex*F<B)q+=Y;else break;let A=K.categories.length*Y+K.rows.length*F,V=Math.floor(Fr*F/2),D=Math.ceil(Fr*F/2),L=Math.min(B-q-V,A-W),j=L+W+D,M=Math.max(0,Math.floor(L/F)),_=Math.min(K.rows.length-1,Math.ceil(j/F)),E=K.rows[M]?.categoryIndex;return X(E===void 0&&G?G:{...G,viewportStartCategoryIndex:E,viewportStartRowIndex:M,viewportEndRowIndex:_})},onDataChange:(G)=>{z().updateViewportState({data:G,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(G)=>{X({search:G,interaction:G?"keyboard":"none"})},onActiveEmojiChange:(G,U,K)=>{if(X({interaction:G,activeColumnIndex:U,activeRowIndex:K}),G!=="keyboard")return;let{listRef:Y,viewportRef:F,sticky:W,rowHeight:q,viewportHeight:N,categoryHeaderHeight:A}=z(),V=Y?.current,D=F?.current;if(!V||!D||!q||!A||!N)return;let L=K;L===0&&D.scrollTo({top:0,behavior:"instant"});let j=V.querySelector(`[aria-rowindex="${L}"]`);if(!(j instanceof HTMLElement))return;let M=j.offsetTop,_=getComputedStyle(j),E=Number.parseFloat(_.scrollMarginTop),C=Number.parseFloat(_.scrollMarginBottom),R=B+E;W&&M<B+N/2&&(R+=A);let T=R+N-C;(M<R||M+q>T)&&D.scrollTo({top:Math.max(M<R+A?M-Math.max(W?A:0,E):M-N+q+C,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,U)=>{z().updateViewportState({viewportWidth:G,viewportHeight:U})},onViewportScroll:(G)=>{B=G,z().updateViewportState()}}))}var{useStore:a4,Provider:jU0}=PU0("EmojiPicker.Root is missing.");function OU0($){return $.search}function N_($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function TU0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function CU0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function Or($){return $.data?.rows.length}function wU0($){return $.data?.categories.length}function EU0($){return $.data?.categoriesStartRowIndices}function SU0($){return $.data?.skinTones}function Tr($,Z){return $?.emoji===Z?.emoji}function RU0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((J,H)=>Tr(J,Z?.emojis[H]))}var LX="",Wr=/\p{Emoji_Modifier_Base}/u,IU0=/\uFE0F$/,bU0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,kU0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function yU0($,Z){if(!$.split(LX).some((H)=>Wr.test(H)))return $;let J=$.split(LX).map((H)=>H.replace(bU0,"")).join(LX);return Z==="none"?J:J.split(LX).map((H,Q,B)=>{let X=B.length>1;return!Wr.test(H)||X&&H==="\uD83E\uDD1D"?H:H.replace(IU0,"")+kU0[Z]}).join(LX)}function xU0($){return q_.map((Z)=>({skinTone:Z,emoji:yU0($,Z)}))}function Cr(){let $=a4(),Z=z8($,N_,Tr);return PH.useDeferredValue(Z)}function wr($="✋"){let Z=a4(),J=Q3(Z,"skinTone"),H=PH.useMemo(()=>xU0($),[$]),Q=PH.useCallback((B)=>{Z.set({skinTone:B})},[]);return[J,Q,H]}function V_($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let J=Object.keys($),H=Object.keys(Z);return J.length!==H.length?!1:J.every((Q)=>(Q in Z)&&$[Q]===Z[Q])}function hU0(...$){}function vU0($,Z){let J=null;if(typeof window.requestIdleCallback=="function")J=window.requestIdleCallback($,Z);else{let H=Date.now();J=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-H))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(J):window.clearTimeout(J)}}var z9=typeof window<"u"?Kq.useLayoutEffect:Kq.useEffect;function gU0($){let Z=Yq.useRef($);return z9(()=>{Z.current=$}),Yq.useCallback((...J)=>Z.current(...J),[])}function fU0({emojiVersion:$,emojibaseUrl:Z}){let[J,H]=Z1.useState(void 0),Q=a4(),B=Q3(Q,"locale"),X=Q3(Q,"columns"),z=Q3(Q,"skinTone"),G=Q3(Q,"search");return Z1.useEffect(()=>{let U=new AbortController,K=U.signal;return NU0({locale:B,emojiVersion:$,emojibaseUrl:Z,signal:K}).then((Y)=>{H(Y)}).catch((Y)=>{K.aborted||console.error(Y)}),()=>{U.abort()}},[$,Z,B]),Z1.useEffect(()=>{if(J)return vU0(()=>{Q.get().onDataChange(DU0(J,X,z,G))},{timeout:100})},[J,X,z,G]),null}var Er=Z1.forwardRef(({locale:$="en",columns:Z=9,skinTone:J="none",onEmojiSelect:H=hU0,emojiVersion:Q,emojibaseUrl:B,onFocusCapture:X,onBlurCapture:z,children:G,style:U,sticky:K=!0,...Y},F)=>{let W=gU0(H),q=MU0(()=>_U0(W,Kr($),Z,K,Yr(J))),[N,A]=Z1.useState(!1),V=Z1.useRef(null),D=Z1.useCallback((M)=>{M&&(V.current=M,q.set({rootRef:V}))},[]);z9(()=>{q.set({locale:Kr($)})},[$]),z9(()=>{q.set({columns:Z})},[Z]),z9(()=>{q.set({sticky:K})},[K]),z9(()=>{q.set({skinTone:Yr(J)})},[J]);let L=Z1.useCallback((M)=>{X?.(M);let{searchRef:_,viewportRef:E}=q.get(),C=M.target===_?.current||M.target.hasAttribute("frimousse-search"),R=M.target===E?.current||M.target.hasAttribute("frimousse-viewport");M.isDefaultPrevented()||(A(C||R),M.isDefaultPrevented()||(A(C||R),R?q.get().onActiveEmojiChange("keyboard",0,0):C&&q.get().search===""&&q.set({interaction:"none"})))},[X]),j=Z1.useCallback((M)=>{z?.(M),!M.isDefaultPrevented()&&!M.currentTarget.contains(M.relatedTarget)&&A(!1)},[z]);return z9(()=>{N||q.get().onActiveEmojiReset()},[N]),Z1.useImperativeHandle(F,()=>V.current),Z1.useEffect(()=>{if(!N)return;function M(_){if(_.defaultPrevented||!_.key.startsWith("Arrow")&&_.key!=="Enter")return;let{data:E,onEmojiSelect:C,onActiveEmojiChange:R,interaction:T,activeColumnIndex:I,activeRowIndex:y}=q.get();if(_.key==="Enter"){let S=N_(q.get());S&&(_.preventDefault(),C(S))}if(_.key.startsWith("Arrow")){let S=I,O=y;if(_.preventDefault(),T!=="none"){if(E?.rows&&E.rows.length>0)switch(_.key){case"ArrowLeft":{if(S===0){let k=O-1,b=E.rows[k];b&&(O=k,S=b.emojis.length-1)}else S-=1;break}case"ArrowRight":{if(S===E.rows[O].emojis.length-1){let k=O+1;E.rows[k]&&(O=k,S=0)}else S+=1;break}case"ArrowUp":{let k=E.rows[O-1];k&&(O-=1,k.emojis[S]||(S=k.emojis.length-1));break}case"ArrowDown":{let k=E.rows[O+1];k&&(O+=1,k.emojis[S]||(S=k.emojis.length-1));break}}R("keyboard",S,O)}else R("keyboard",0,0)}}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[N]),z9(()=>{let M=null,_=null,E=null,C=null,R=q.subscribe((O)=>{V.current&&(M!==O.viewportWidth&&(M=O.viewportWidth,V.current.style.setProperty("--frimousse-viewport-width",`${O.viewportWidth}px`)),_!==O.viewportHeight&&(_=O.viewportHeight,V.current.style.setProperty("--frimousse-viewport-height",`${O.viewportHeight}px`)),E!==O.rowHeight&&(E=O.rowHeight,V.current.style.setProperty("--frimousse-row-height",`${O.rowHeight}px`)),C!==O.categoryHeaderHeight&&(C=O.categoryHeaderHeight,V.current.style.setProperty("--frimousse-category-header-height",`${O.categoryHeaderHeight}px`)))}),{viewportWidth:T,viewportHeight:I,rowHeight:y,categoryHeaderHeight:S}=q.get();return T&&V.current.style.setProperty("--frimousse-viewport-width",`${T}px`),I&&V.current.style.setProperty("--frimousse-viewport-height",`${I}px`),y&&V.current.style.setProperty("--frimousse-row-height",`${y}px`),S&&V.current.style.setProperty("--frimousse-category-header-height",`${S}px`),R},[]),v1.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:j,onFocusCapture:L,...Y,ref:D,style:{"--frimousse-emoji-font":Ar,...U},children:v1.jsxs(jU0,{store:q,children:[v1.jsx(fU0,{emojiVersion:Q,emojibaseUrl:B}),G]})})}),Sr=Z1.forwardRef(({value:$,defaultValue:Z,onChange:J,...H},Q)=>{let B=a4(),X=Z1.useRef(null),z=Z1.useCallback((Y)=>{Y&&(X.current=Y,B.set({searchRef:X}))},[]),G=typeof $=="string",U=Z1.useRef(G);Z1.useEffect(()=>{U.current=G},[G]),z9(()=>{B.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),z9(()=>{typeof $=="string"&&B.get().onSearchChange($)},[$]);let K=Z1.useCallback((Y)=>{J?.(Y),Y.isDefaultPrevented()||B.get().onSearchChange(Y.target.value)},[J]);return Z1.useImperativeHandle(Q,()=>X.current),v1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...H,defaultValue:Z,onChange:K,ref:z,value:$})}),mU0=Z1.memo(()=>{let $=Cr();return $?v1.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}),Rr=Z1.forwardRef(({children:$,onScroll:Z,onKeyDown:J,style:H,...Q},B)=>{let X=a4(),z=Z1.useRef(null),G=Z1.useCallback((F)=>{F&&(z.current=F,X.set({viewportRef:z}))},[]),U=z8(X,Or),K=z8(X,wU0),Y=Z1.useCallback((F)=>{Z?.(F),X.get().onViewportScroll(F.currentTarget.scrollTop)},[Z]);return z9(()=>{if(!z.current)return;let F=new ResizeObserver(([W])=>{let q=W?.borderBoxSize[0]?.inlineSize??0,N=W?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:A,viewportHeight:V,viewportWidth:D}=X.get();(V!==N||D!==q)&&A(q,N)});return F.observe(z.current),X.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{F.disconnect()}},[]),Z1.useImperativeHandle(B,()=>z.current),v1.jsxs("div",{"frimousse-viewport":"",...Q,onScroll:Y,ref:G,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof U=="number"&&typeof K=="number"?`var(--frimousse-viewport-width, auto) calc(${U} * var(--frimousse-row-height) + ${K} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...H},children:[v1.jsx(mU0,{}),$]})});function Ir($,Z,J){return{emoji:{...$,isActive:J},role:"gridcell","aria-colindex":Z,"aria-selected":J||void 0,"aria-label":$.label,"data-active":J?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function br($,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 kr($,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 yr($,Z=!1,J=!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:J?"sticky":void 0,top:0}}}function qr($,Z,J,H){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${J} * var(--frimousse-row-height) + ${H} * var(--frimousse-category-header-height))`}}}function Nr($,Z,J){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...J},role:"grid"}}function uU0($){$.preventDefault()}var pU0=Z1.memo(({Emoji:$,emoji:Z,columnIndex:J,rowIndex:H})=>{let Q=a4(),B=z8(Q,(U)=>N_(U)?.emoji===Z.emoji),X=Z1.useCallback(()=>{Q.get().onEmojiSelect(Z)},[Z]),z=Z1.useCallback(()=>{Q.get().onActiveEmojiChange("pointer",J,H)},[J,H]),G=Z1.useCallback(()=>{Q.get().onActiveEmojiReset()},[]);return v1.jsx($,{...Ir(Z,J,B),onClick:X,onPointerDown:uU0,onPointerEnter:z,onPointerLeave:G})}),cU0=Z1.memo(({Row:$,Emoji:Z,rowIndex:J})=>{let H=a4(),Q=z8(H,(B)=>B.data?.rows[J],RU0);return Q?v1.jsx($,{...br(J),children:Q.emojis.map((B,X)=>v1.jsx(pU0,{Emoji:Z,columnIndex:X,emoji:B,rowIndex:J},B.label))}):null}),dU0=Z1.memo(({CategoryHeader:$,categoryIndex:Z})=>{let J=a4(),H=z8(J,(B)=>B.data?.categories[Z],V_),Q=Q3(J,"sticky");return H?v1.jsx("div",{...kr(Z,H),children:v1.jsx($,{...yr({label:H.label},!1,Q)})}):null}),Vr=Z1.memo(({CategoryHeader:$,Row:Z,Emoji:J})=>{let H=Z1.useRef(null),Q=a4(),B=Q3(Q,"columns"),X=Z1.useMemo(()=>Array(B).fill({emoji:"\uD83D\uDE42",label:""}),[B]),z=Z1.useMemo(()=>({label:"Category"}),[]),G=Z1.useRef(null),U=Z1.useRef(null);return z9(()=>{let K=H.current?.parentElement?.parentElement;if(!K||!G.current||!U.current)return;let Y=new ResizeObserver((q)=>{for(let N of q){let A=N.contentRect.height,{onRowHeightChange:V,onCategoryHeaderHeightChange:D,rowHeight:L,categoryHeaderHeight:j}=Q.get();N.target===G.current&&L!==A&&V(A),N.target===U.current&&j!==A&&D(A)}});Y.observe(K),Y.observe(G.current),Y.observe(U.current);let{onRowHeightChange:F,onCategoryHeaderHeightChange:W}=Q.get();return F(G.current.clientHeight),W(U.current.clientHeight),()=>{Y.disconnect()}},[]),v1.jsxs("div",{"aria-hidden":!0,ref:H,style:{height:0,visibility:"hidden"},children:[v1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:v1.jsx(Z,{...br(-1,!0),children:X.map((K,Y)=>v1.jsx(J,{...Ir(K,Y,!1)},Y))})}),v1.jsx("div",{...kr(-1),children:v1.jsx("div",{"frimousse-category-header-sizer":"",ref:U,children:v1.jsx($,{...yr(z,!0)})})})]})});function lU0({category:$,...Z}){return v1.jsx("div",{...Z,children:$.label})}function iU0({emoji:$,...Z}){return v1.jsx("button",{type:"button",...Z,children:$.emoji})}function rU0({...$}){return v1.jsx("div",{...$})}var xr=Z1.forwardRef(({style:$,components:Z,...J},H)=>{let Q=a4(),B=Z1.useRef(null),X=Z1.useCallback((V)=>{V&&(B.current=V,Q.set({listRef:B}))},[]),z=Z?.CategoryHeader??lU0,G=Z?.Emoji??iU0,U=Z?.Row??rU0,K=Q3(Q,"columns"),Y=Q3(Q,"viewportStartRowIndex"),F=Q3(Q,"viewportEndRowIndex"),W=z8(Q,Or),q=z8(Q,EU0,V_),N=Z1.useMemo(()=>q?.filter((V)=>V<Y).length??0,[q,Y]),A=q?.length??0;return Z1.useImperativeHandle(H,()=>B.current),!W||!q||A===0?v1.jsx("div",{...Nr(K,0,$),...J,children:v1.jsx("div",{...qr(0,0,0,0),children:v1.jsx(Vr,{CategoryHeader:z,Emoji:G,Row:U})})}):v1.jsx("div",{...Nr(K,W,$),...J,ref:X,children:v1.jsxs("div",{...qr(W,A,Y,N),children:[v1.jsx(Vr,{CategoryHeader:z,Emoji:G,Row:U}),Array.from({length:F-Y+1},(V,D)=>{let L=Y+D,j=q.indexOf(L);return v1.jsxs(Z1.Fragment,{children:[j>=0&&v1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),v1.jsx(cU0,{Emoji:G,Row:U,rowIndex:L})]},L)}),Array.from({length:A},(V,D)=>v1.jsx(dU0,{CategoryHeader:z,categoryIndex:D},D))]})})}),hr=Z1.forwardRef(({emoji:$,onClick:Z,"aria-label":J="Change skin tone",...H},Q)=>{let B=a4(),X=z8(B,SU0,V_),[z,G,U]=wr($),K=Z1.useMemo(()=>Math.max(0,U.findIndex((A)=>A.skinTone===z)),[z,U]),Y=U[K],F=U[(K+1)%U.length].skinTone,W=z==="none"?void 0:X?.[z],q=F==="none"?void 0:X?.[F],N=Z1.useCallback((A)=>{Z?.(A),A.isDefaultPrevented()||G(F)},[Z,G,F]);return v1.jsx("button",{type:"button",...H,"aria-label":J+(q?` (${q})`:""),"aria-live":"polite","aria-valuetext":W,"frimousse-skin-tone-selector":"",onClick:N,ref:Q,children:Y.emoji})});function vr({children:$,...Z}){let J=a4();return z8(J,CU0)?v1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function aU0({children:$}){let Z=a4(),J=z8(Z,OU0);return $({search:J})}function gr({children:$,...Z}){let J=a4();return z8(J,TU0)?v1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?v1.jsx(aU0,{children:$}):$}):null}function fr({children:$}){let Z=Cr();return $({emoji:Z})}function mr({children:$,emoji:Z}){let[J,H,Q]=wr(Z);return $({skinTone:J,setSkinTone:H,skinToneVariations:Q})}Er.displayName="EmojiPicker.Root";Sr.displayName="EmojiPicker.Search";Rr.displayName="EmojiPicker.Viewport";xr.displayName="EmojiPicker.List";vr.displayName="EmojiPicker.Loading";gr.displayName="EmojiPicker.Empty";hr.displayName="EmojiPicker.SkinToneSelector";fr.displayName="EmojiPicker.ActiveEmoji";mr.displayName="EmojiPicker.SkinTone";var PX={};C5(PX,{Root:()=>ir,Indicator:()=>rr});var G9=P(m(),1);function ur($){if(!$)return null;for(let Z of $.elements){let J=Z.tagName;if(J==="BUTTON"||J==="INPUT"){let H=Z;if(H.type==="submit")return H}}return null}var pr="data-checked",cr="data-unchecked";function Fq($){return{checked(Z){if($.indeterminate)return{};if(Z)return{[pr]:""};return{[cr]:""}},...C2}}var Wq=P(m(),1),nU0=Wq.createContext(void 0);function dr(){return Wq.useContext(nU0)}var qq=P(m(),1),A_=qq.createContext(void 0);function lr(){let $=qq.useContext(A_);if($===void 0)throw Error(y0(14));return $}var MX=P(c(),1),sU0="data-parent",ir=G9.forwardRef(function(Z,J){let{checked:H,className:Q,defaultChecked:B=!1,"aria-labelledby":X,disabled:z=!1,form:G,id:U,indeterminate:K=!1,inputRef:Y,name:F,onCheckedChange:W,parent:q=!1,readOnly:N=!1,render:A,required:V=!1,uncheckedValue:D,value:L,nativeButton:j=!1,style:M,..._}=Z,{clearErrors:E}=Z4(),{disabled:C,name:R,setDirty:T,setFilled:I,setFocused:y,setTouched:S,state:O,validationMode:k,validityData:b,validation:h}=l5(),v=UJ(),{labelId:f,registerControlId:w,getDescriptionProps:i}=i5(),r=dr(),x=r?.allValues===void 0?void 0:r.parent,l=x!==void 0,s=C||v.disabled||r?.disabled||z,p=R??F,d=L??p,o=t0(),Z0=r?.registerControlId!==w,H0=E6({id:U||void 0,enabled:Z0}),G0=j?H0:o,X0={};if(l){if(q)X0=x.getParentProps();else if(d!==void 0)X0=x.getChildProps(d)}let{checked:Y0=H,indeterminate:A0=K,onCheckedChange:N0,...F0}=X0,n=r?.value,a=G9.useRef(null),{getButtonProps:e,buttonRef:$0}=T5({disabled:s,native:j}),Q0=r?.validation??h,[_0,M0]=J4({controlled:d!==void 0&&n!==void 0&&!q?n.includes(d):Y0,default:B,name:"Checkbox",state:"checked"}),V0=l?Boolean(Y0):_0,L0=l?A0||K:K;w6(a,o,_0,void 0,!r&&!s,F);let g=x?.registerChildId,u=G9.useRef(null),t=Q0.registerInput,W0=r?d:void 0,I0=G9.useCallback((v0)=>t(v0,{controlRef:a,value:W0}),[t,W0]),c0=x2(Y,u,q?void 0:I0),f0=pW(X,f,u,!j,H0);J0(()=>{if(u.current)u.current.indeterminate=L0;if(!r)I(_0)},[_0,L0,r,I]),h9(_0,()=>{if(r)return;E(p),T(_0!==b.initialValue),Q0.change(_0)});let T0=X2({checked:_0,disabled:s,form:G,name:q?void 0:p,id:j?void 0:H0,required:V,ref:c0,style:p?wz:u8,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(v0){if(v0.nativeEvent.defaultPrevented)return;if(N){v0.preventDefault();return}let S1=v0.currentTarget.checked,B1=R0(K0.none,v0.nativeEvent);if(W?.(S1,B1),B1.isCanceled)return;if(N0?.(S1,B1),B1.isCanceled)return;if(M0(S1),d!==void 0&&r!==void 0&&!q&&!l){let s1=S1?[...r.value,d]:r.value.filter((C0)=>C0!==d);r.setValue(s1,B1)}},onClick(v0){v0.stopPropagation()},onFocus(){a.current?.focus()}},L!==void 0?{value:(r?_0&&L:L)||""}:L1,i,(v0)=>Q0.getValidationProps(s,v0));G9.useEffect(()=>{if(!x||d===void 0)return;let v0=x.disabledStatesRef.current;return v0.set(d,s),()=>{v0.delete(d)}},[x,s,d]);let x0=G9.useMemo(()=>({...O,checked:V0,disabled:s,readOnly:N,required:V,indeterminate:L0}),[O,V0,s,N,V,L0]),J1=Fq(x0),W1=z0("span",Z,{state:x0,ref:[$0,a,J],props:[{id:G0,role:"checkbox","aria-checked":L0?"mixed":V0,"aria-readonly":N||void 0,"aria-required":V||void 0,"aria-labelledby":f0,[sU0]:q?"":void 0,onFocus(){if(!s)y(!0)},onBlur(){let v0=u.current;if(!v0)return;if(S(!0),y(!1),k==="onBlur")Q0.commit(r?n:v0.checked)},onKeyDown(v0){if(v0.key!=="Enter")return;if(v0.preventBaseUIHandler(),v0.defaultPrevented)return;let S1=u.current?.form??null,B1=v0.currentTarget,s1=v0.nativeEvent,C0=v0.preventDefault,p0=s1.preventDefault,i0=!1;v0.preventDefault=()=>{i0=!0,C0.call(v0)},s1.preventDefault=()=>{i0=!0,p0.call(s1)},p0.call(s1),I1(B1).queueMicrotask(()=>{if(v0.preventDefault=C0,s1.preventDefault=p0,!i0)ur(S1)?.click()})},onClick(v0){if(N||s)return;v0.preventDefault();let S1=u.current;if(!S1)return;gJ(S1,v0)}},_,F0,e,i,(v0)=>Q0.getValidationProps(s,v0)],stateAttributesMapping:J1}),d0=W1.props.id;return J0(()=>{if(!g||q||d===void 0||d0===void 0)return;return g(d,d0)},[g,q,d,d0]),MX.jsxs(A_.Provider,{value:x0,children:[W1,!_0&&!r&&p&&!q&&D!==void 0&&MX.jsx("input",{type:"hidden",form:G,name:p,value:D,disabled:s}),MX.jsx("input",{...T0,suppressHydrationWarning:!0})]})});var Nq=P(m(),1);var rr=Nq.forwardRef(function(Z,J){let{render:H,className:Q,style:B,keepMounted:X=!1,...z}=Z,G=lr(),U=G.checked||G.indeterminate,{mounted:K,transitionStatus:Y,setMounted:F}=j2(U),W=Nq.useRef(null),q={...G,transitionStatus:Y};q5({batch:!0,enabled:!U,open:U,ref:W,onComplete(){if(!U)F(!1)}});let A={...Fq(G),...Q2},V=X||K,D=z0("span",Z,{ref:[J,W],state:q,stateAttributesMapping:A,props:z});if(!V)return null;return D});var Vq=P(c(),1);function ar({className:$,...Z}){return Vq.jsx(PX.Root,{"data-slot":"checkbox",className:a0('peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground [:where([class~="group/field"]):has(:disabled)_&]:opacity-50 [:where([class~="group/field-label"]):has(:focus-visible)_&]:not-data-checked:border-border [:where([class~="group/field-label"]):has(:focus-visible)_&]:data-checked:border-primary [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:Vq.jsx(PX.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:Vq.jsx(O8,{stroke:2})})})}var ZZ={};C5(ZZ,{Tab:()=>tr,Root:()=>sr,Panel:()=>Ya,List:()=>Va,Indicator:()=>Ua});var H2=P(m(),1);var Aq=P(m(),1),D_=Aq.createContext(void 0);function V7(){let $=Aq.useContext(D_);if($===void 0)throw Error(y0(64));return $}var or="data-activation-direction";var B3={tabActivationDirection:($)=>({[or]:$})};var L_=P(c(),1),sr=H2.forwardRef(function(Z,J){let{className:H,defaultValue:Q=0,onValueChange:B,orientation:X="horizontal",render:z,value:G,style:U,...K}=Z,Y=Z.defaultValue!==void 0,F=H2.useRef([]),[W,q]=H2.useState(()=>new Map),[N,A]=J4({controlled:G,default:Q,name:"Tabs",state:"value"}),V=G!==void 0,[D,L]=H2.useState(()=>new Map),j=H2.useRef(void 0),M=H2.useCallback((o)=>M_(D,o),[D]),[_,E]=H2.useState(()=>({previousValue:N,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:R}=_,T=R,I=!1;if(C!==N)T=nr(C,N,X,D),I=C!=null&&N!=null&&M(N)==null;let y=I?C:N,S=C!==y||R!==T;J0(()=>{if(!S)return;E({previousValue:y,tabActivationDirection:T})},[y,S,T]);let O=U0((o,Z0)=>{let H0=nr(N,o,X,D);if(Z0.activationDirection=H0,B?.(o,Z0),Z0.isCanceled)return;A(o)}),k=U0((o,Z0)=>{B?.(o,R0(Z0,void 0,void 0,{activationDirection:"none"}))}),b=U0((o,Z0)=>{return q((H0)=>{let G0=new Map(H0);return G0.set(o,Z0),G0}),()=>{q((H0)=>{if(H0.get(o)!==Z0)return H0;let G0=new Map(H0);return G0.delete(o),G0})}}),h=H2.useCallback((o)=>{return W.get(o)},[W]),v=H2.useCallback((o)=>{for(let Z0 of D.values())if(o===Z0.value)return Z0.id;return},[D]),f=H2.useMemo(()=>({getTabElementBySelectedValue:M,getTabIdByPanelValue:v,getTabPanelIdByValue:h,onValueChange:O,orientation:X,registerMountedTabPanel:b,setTabMap:L,tabActivationDirection:T,value:N}),[M,v,h,O,X,b,L,T,N]),w=H2.useMemo(()=>{for(let o of D.values())if(o.value===N)return o;return},[D,N]),i=H2.useMemo(()=>{for(let o of D.values())if(!o.disabled)return o.value;return},[D]),r=H2.useRef(!Y),x=H2.useRef(Q),l=H2.useRef(Y),s=H2.useRef(!1);J0(()=>{if(V)return;function o(X0,Y0){A(X0),E({previousValue:X0,tabActivationDirection:"none"}),k(X0,Y0),r.current=!1}if(D.size===0){if(s.current&&N!==null&&!j.current?.isConnected)o(null,K0.missing);return}s.current=!0,j.current=D.keys().next().value;let Z0=w?.disabled,H0=w==null&&N!==null;if(!Z0&&N===x.current)l.current=!1;if(l.current&&Z0&&N===x.current)return;let G0=r.current;if(Z0||H0){let X0=i??null;if(N===X0){r.current=!1;return}let Y0=K0.missing;if(G0)Y0=K0.initial;else if(Z0)Y0=K0.disabled;o(X0,Y0);return}if(G0&&w!=null)k(N,K0.initial),r.current=!1},[i,V,k,w,A,D,N]);let d=z0("div",Z,{state:{orientation:X,tabActivationDirection:T},ref:J,props:K,stateAttributesMapping:B3});return L_.jsx(D_.Provider,{value:f,children:L_.jsx(e6,{elementsRef:F,children:d})})});function M_($,Z){for(let[J,H]of $.entries())if(Z===H.value)return J;return null}function nr($,Z,J,H){if($==null||Z==null)return"none";let[Q,B,X]=J==="horizontal"?["left","left","right"]:["top","up","down"],z=M_(H,$),G=M_(H,Z);if(z==null||G==null){if(z!==G&&(typeof $==="number"||typeof $==="string")&&typeof $===typeof Z)return Z>$?X:B;return"none"}let U=z.getBoundingClientRect()[Q],K=G.getBoundingClientRect()[Q];if(K<U)return B;if(K>U)return X;return"none"}var f3=P(m(),1);var _X="data-composite-item-active";var Dq=P(m(),1),P_=Dq.createContext(void 0);function Lq(){let $=Dq.useContext(P_);if($===void 0)throw Error(y0(65));return $}var tr=f3.forwardRef(function(Z,J){let{className:H,disabled:Q=!1,render:B,value:X,id:z,nativeButton:G=!0,style:U,...K}=Z,{value:Y,getTabPanelIdByValue:F,onValueChange:W,orientation:q,tabActivationDirection:N}=V7(),{activateOnFocus:A,registerTabResizeObserverElement:V,tabsListElement:D}=Lq(),{highlightedIndex:L,onHighlightedIndexChange:j}=uJ(),M=t0(z),_=f3.useMemo(()=>({disabled:Q,id:M,value:X}),[Q,M,X]),{compositeProps:E,compositeRef:C,index:R}=XF({metadata:_}),T=X===Y,I=f3.useRef(!1),y=f3.useRef(null),S=U0((s)=>{y.current?.(),y.current=s?V(s):null});J0(()=>{if(I.current){I.current=!1;return}if(!(T&&R>-1&&L!==R))return;let s=D;if(s!=null){let p=p1(m0(s));if(p&&b0(s,p))return}if(!Q)j(R)},[T,R,L,j,Q,D]);let{getButtonProps:O,buttonRef:k}=T5({disabled:Q,native:G,focusableWhenDisabled:!0}),b=F(X),h=f3.useRef(!1),v=f3.useRef(!1);function f(s){W(X,R0(K0.none,s.nativeEvent,void 0,{activationDirection:"none"}))}function w(s){if(T||Q)return;f(s)}function i(s){if(T||Q)return;if(A&&(!h.current||v.current))f(s)}function r(s){if(T||Q)return;h.current=!0,v.current=s.button===0;let p=m0(s.currentTarget);function d(){h.current=!1,v.current=!1,p.removeEventListener("pointerup",d),p.removeEventListener("pointercancel",d)}p.addEventListener("pointerup",d),p.addEventListener("pointercancel",d)}return z0("button",Z,{state:{disabled:Q,active:T,orientation:q,tabActivationDirection:N},ref:[J,k,C,S],props:[E,{role:"tab","aria-controls":b,"aria-selected":T,id:M,onClick:w,onFocus:i,onPointerDown:r,[_X]:T?"":void 0,onKeyDownCapture(){I.current=!0}},K,O],stateAttributesMapping:B3})});var _H=P(m(),1);var er="--active-tab-left",$a="--active-tab-right",Za="--active-tab-top",Ja="--active-tab-bottom",Ha="--active-tab-width",Qa="--active-tab-height";var Mq=P(c(),1),Ba,$K0={...B3,activeTabPosition:()=>null,activeTabSize:()=>null},Xa=2,Ua=_H.forwardRef(function(Z,J){let{className:H,render:Q,renderBeforeHydration:B=!1,style:X,...z}=Z,{getTabElementBySelectedValue:G,orientation:U,tabActivationDirection:K,value:Y}=V7(),{tabsListElement:F,registerIndicatorUpdateListener:W}=Lq(),q=xO();_H.useEffect(()=>{return W(q)},[W,q]);let N=0,A=0,V=0,D=0,L=0,j=0,M=!1;if(Y!=null&&F!=null){let y=G(Y);if(y!=null){M=!0;let{width:S,height:O}=kZ(y),{width:k,height:b}=kZ(F),h=y.getBoundingClientRect(),v=F.getBoundingClientRect(),f=k>0?v.width/k:1,w=b>0?v.height/b:1,i=ZK0(y,F);N=i.left,V=i.top;let r=(h.left-v.left)/f+F.scrollLeft-F.clientLeft,x=(h.top-v.top)/w+F.scrollTop-F.clientTop,l=JK0(y);if(Math.abs(r-l.x-N)<=Xa&&Math.abs(x-l.y-V)<=Xa)N=r,V=x;L=S,j=O,A=F.scrollWidth-N-L,D=F.scrollHeight-V-j}}let _=M?{left:N,right:A,top:V,bottom:D}:null,E=M?{width:L,height:j}:null,C=M?{[er]:`${N}px`,[$a]:`${A}px`,[Za]:`${V}px`,[Ja]:`${D}px`,[Ha]:`${L}px`,[Qa]:`${j}px`}:void 0,R=M&&L>0&&j>0,I=z0("span",Z,{state:{orientation:U,activeTabPosition:_,activeTabSize:E,tabActivationDirection:K},ref:J,props:[{role:"presentation",style:C,hidden:!R},z,{suppressHydrationWarning:!0}],stateAttributesMapping:$K0});if(Y==null)return null;return Mq.jsxs(_H.Fragment,{children:[I,B&&(Ba||(Ba=Mq.jsx(LF,{script:AF})))]})});function ZK0($,Z){let J=za($),H=za(Z),Q=J.left-H.left-Z.clientLeft,B=J.top-H.top-Z.clientTop,X=P8($);while(P1(X)&&X!==Z&&!M8(X))Q-=X.scrollLeft,B-=X.scrollTop,X=P8(X);return{left:Q,top:B}}function za($){let Z=0,J=0,H=$;while(H!=null){Z+=H.offsetLeft,J+=H.offsetTop;let Q=H.offsetParent;if(Q!=null)Z+=Q.clientLeft,J+=Q.clientTop;H=Q}return{left:Z,top:J}}function JK0($){let Z=I1($).getComputedStyle($),{x:J,y:H}=bz($,Z),Q=J,B=H,{translate:X}=Z;if(X&&X!=="none"){let z=X.split(" ");Q+=Ga(z[0],$.offsetWidth),B+=Ga(z[1],$.offsetHeight)}return{x:Q,y:B}}function Ga($,Z){if(!$)return 0;let J=parseFloat($);if(!Number.isFinite(J))return 0;return $.endsWith("%")?J/100*Z:J}var Pq=P(m(),1);var Ka="data-index";var Xj1=n4.startingStyle,zj1=n4.endingStyle;var QK0={...B3,...Q2},Ya=Pq.forwardRef(function(Z,J){let{className:H,value:Q,render:B,keepMounted:X=!1,style:z,...G}=Z,{value:U,getTabIdByPanelValue:K,orientation:Y,tabActivationDirection:F,registerMountedTabPanel:W}=V7(),q=t0(),{ref:N,index:A}=X4(),V=Q===U,{mounted:D,transitionStatus:L,setMounted:j}=j2(V),M=!D,_=K(Q),E={hidden:M,orientation:Y,tabActivationDirection:F,transitionStatus:L},C=Pq.useRef(null),R=z0("div",Z,{state:E,ref:[J,N,C],props:[{"aria-labelledby":_,hidden:M,id:q,role:"tabpanel",tabIndex:V?0:-1,inert:L8(!V),[Ka]:A},G],stateAttributesMapping:QK0});if(q5({open:V,ref:C,onComplete(){if(!V)j(!1)}}),J0(()=>{if(q==null||M&&!X)return;return W(Q,q)},[M,X,Q,q,W]),!(X||D))return null;return R});var U9=P(m(),1);var qa=P(m(),1);var $Z=P(m(),1);function Fa($){let{loopFocus:Z=!0,orientation:J="both",grid:H,onLoop:Q,direction:B,highlightedIndex:X,onHighlightedIndexChange:z,rootRef:G,enableHomeAndEndKeys:U=!1,stopEventPropagation:K,disabledIndices:Y,modifierKeys:F=r2}=$,[W,q]=$Z.useState(0),N=H!=null,A=$Z.useRef(null),V=x2(A,G),D=$Z.useRef([]),L=$Z.useRef(!1),j=$Z.useRef(null),M=X??W,_=U0((I,y=!1)=>{if(j.current=D.current[I]??null,(z??q)(I),y){let S=D.current[I];KA(A.current,S,B,J)}}),E=U0((I)=>{if(I.size===0)return;if(L.current){let k=D.current,b=k.indexOf(j.current);if(b===-1){let h=k[M];if(!h||W3(k,M,Y))_(BK0(k,Y));else j.current=h}else if(b!==M)_(b);return}L.current=!0;let y=Array.from(I.keys()),S=y.find((k)=>k?.hasAttribute(_X))??null,O=S?I.get(S)?.index??-1:-1;if(O!==-1)_(O);else if(W3(y,M,Y)){let k=A8(y,{disabledIndices:Y});if(!$6(y,k))_(k)}KA(A.current,S,B,J)});J0(()=>{if(Y==null||X!=null||!L.current)return;let I=D.current;if(W3(I,M,Y)){let y=A8(I,{disabledIndices:Y});if(!$6(I,y))_(y)}},[Y,X,M,D,_]);let C=U0((I,y,S)=>{if(!Q)return S;return Q(I,y,S,D)}),R=U0((I)=>{let y=I.key===iZ||I.key===rZ;if(!n8.has(I.key)||!U&&y)return;if(XK0(I,F))return;if(!A.current)return;let O=B==="rtl",k=O?dZ:lZ,b=O?lZ:dZ,h=J==="vertical"?cZ:k,v=J==="vertical"?pZ:b,f=M1(I.nativeEvent);if(f!=null&&UA(f)&&!fg(f)){let{selectionStart:s,selectionEnd:p,value:d}=f;if(s==null||I.shiftKey||s!==p)return;if(I.key!==v&&s<d.length)return;if(I.key!==h&&s>0)return}let w=M,i=p7(D,Y),r=MZ(D,Y);if(H!=null)w=H({disabledIndices:Y,elementsRef:D,event:I,highlightedIndex:M,loopFocus:Z,maxIndex:r,minIndex:i,onLoop:C,orientation:J,rtl:O});let x=J!=="vertical"&&I.key===k||J!=="horizontal"&&I.key===cZ,l=J!=="vertical"&&I.key===b||J!=="horizontal"&&I.key===pZ;if(U){if(I.key===iZ)w=i;else if(I.key===rZ)w=r}if(w===M&&(x||l))if(Z&&w===r&&x){if(w=i,Q)w=Q(I,M,w,D)}else if(Z&&w===i&&l){if(w=r,Q)w=Q(I,M,w,D)}else w=A8(D.current,{startingIndex:w,decrement:l,disabledIndices:Y});if(w!==M&&!$6(D.current,w)){if(K)I.stopPropagation();if(N||y||x||l)I.preventDefault();_(w,!0),queueMicrotask(()=>{D.current[w]?.focus()})}});return{props:{ref:V,onFocus(I){let y=A.current,S=M1(I.nativeEvent);if(!y||S==null||!UA(S))return;S.setSelectionRange(0,S.value.length)},onKeyDown:R},highlightedIndex:M,onHighlightedIndexChange:_,elementsRef:D,onMapChange:E,relayKeyboardEvent:R}}function BK0($,Z){let J=-1;for(let H=0;H<$.length;H+=1){let Q=$[H];if(!Q||W3($,H,Z))continue;if(Q.hasAttribute(_X))return H;if(J===-1)J=H}return Math.max(J,0)}function XK0($,Z){for(let J of ZS){if(Z.includes(J))continue;if($.getModifierState(J))return!0}return!1}var __=P(c(),1);function Na($){let{render:Z,className:J,style:H,refs:Q=r2,props:B=r2,state:X=L1,stateAttributesMapping:z,highlightedIndex:G,onHighlightedIndexChange:U,orientation:K,grid:Y,loopFocus:F,onLoop:W,enableHomeAndEndKeys:q,onMapChange:N,stopEventPropagation:A=!0,rootRef:V,disabledIndices:D,modifierKeys:L,highlightItemOnHover:j=!1,tag:M="div",..._}=$,E=g4(),{props:C,highlightedIndex:R,onHighlightedIndexChange:T,elementsRef:I,onMapChange:y,relayKeyboardEvent:S}=Fa({grid:Y,loopFocus:F,onLoop:W,orientation:K,highlightedIndex:G,onHighlightedIndexChange:U,rootRef:V,stopEventPropagation:A,enableHomeAndEndKeys:q,direction:E,disabledIndices:D,modifierKeys:L}),O=z0(M,$,{state:X,ref:Q,props:[C,...B,_],stateAttributesMapping:z}),k=qa.useMemo(()=>({highlightedIndex:R,onHighlightedIndexChange:T,highlightItemOnHover:j,relayKeyboardEvent:S}),[R,T,j,S]);return __.jsx(Wa.Provider,{value:k,children:__.jsx(e6,{elementsRef:I,onMapChange:(b)=>{N?.(b),y(b)},children:O})})}var j_=P(c(),1),Va=U9.forwardRef(function(Z,J){let{activateOnFocus:H=!1,className:Q,loopFocus:B=!0,render:X,style:z,...G}=Z,{orientation:U,setTabMap:K,tabActivationDirection:Y}=V7(),[F,W]=U9.useState(0),[q,N]=U9.useState(null),A=U9.useRef(new Set),V=U9.useRef(new Set),D=U9.useRef(null);J0(()=>{if(typeof ResizeObserver>"u")return;let C=new ResizeObserver(()=>{A.current.forEach((R)=>{R()})});if(D.current=C,q)C.observe(q);return V.current.forEach((R)=>{C.observe(R)}),()=>{C.disconnect(),D.current=null}},[q]);let L=U0((C)=>{return A.current.add(C),()=>{A.current.delete(C)}}),j=U0((C)=>{return V.current.add(C),D.current?.observe(C),()=>{V.current.delete(C),D.current?.unobserve(C)}}),M={orientation:U,tabActivationDirection:Y},_={"aria-orientation":U==="vertical"?"vertical":void 0,role:"tablist"},E=U9.useMemo(()=>({activateOnFocus:H,registerIndicatorUpdateListener:L,registerTabResizeObserverElement:j,tabsListElement:q}),[H,L,j,q]);return j_.jsx(P_.Provider,{value:E,children:j_.jsx(Na,{render:X,className:Q,style:z,state:M,refs:[J,N],props:[_,G],stateAttributesMapping:B3,highlightedIndex:F,enableHomeAndEndKeys:!0,loopFocus:B,orientation:U,onHighlightedIndexChange:W,onMapChange:K,disabledIndices:r2})})});var jX=P(c(),1);function Aa({className:$,orientation:Z="horizontal",...J}){return jX.jsx(ZZ.Root,{"data-slot":"tabs","data-orientation":Z,orientation:Z,className:a0("group/tabs flex gap-2 data-horizontal:flex-col",$),...J})}var zK0=JJ("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-accent",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Da({className:$,variant:Z="default",...J}){return jX.jsx(ZZ.List,{"data-slot":"tabs-list","data-variant":Z,className:a0(zK0({variant:Z}),$),...J})}function _q({className:$,...Z}){return jX.jsx(ZZ.Tab,{"data-slot":"tabs-trigger",className:a0("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground data-active:ring-1 data-active:ring-border","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",$),...Z})}function jq({className:$,...Z}){return jX.jsx(ZZ.Panel,{"data-slot":"tabs-content",className:a0("flex-1 text-sm outline-none",$),...Z})}var La=["\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","☕"],O_="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var V1=P(c(),1),GK0=32,Ma=4,UK0=12,Ca="flex pt-4 pb-2 items-center bg-background px-3 text-xs font-medium text-muted-foreground",wa=E4.createContext(null);function Pa($,Z){if(Z)return{...$,background:"theme"};if($.type==="emoji")return{type:"emoji",value:$.value};return{type:"glyph",value:$.value}}function KK0({category:$,className:Z,...J}){return V1.jsx("div",{...J,className:B0(Ca,Z),children:$.label})}function _a({className:$,...Z}){return V1.jsx("div",{className:B0("flex flex-wrap content-start gap-1",$),...Z})}function T_({className:$,selected:Z=!1,...J}){return V1.jsx(j0,{type:"button",variant:"ghost",size:"icon","aria-pressed":Z,className:B0("shrink-0 data-active:bg-accent",Z&&"bg-accent",$),...J})}function YK0({children:$,className:Z,...J}){return V1.jsx("div",{...J,className:B0("flex h-8 gap-1 px-1.5",Z),children:$})}function FK0({emoji:$,...Z}){let J=E4.useContext(wa);return V1.jsx(T_,{selected:J===$.emoji,className:O_,...Z,children:V1.jsx("span",{className:"text-xl leading-none",children:$.emoji})})}function Ea(){let{layout:$,workspaceId:Z}=i1(),{icon:J}=$,H=Ei(Z),[Q,B]=E4.useState(J?.type??"glyph"),[X,z]=E4.useState(!J||J.type!=="upload"&&J.background==="theme"),G=J?.type==="upload"?void 0:J,[U,K]=E4.useState(""),[Y,F]=E4.useState(13),[W,q]=E4.useState(null),[N,A]=E4.useState(!1),V=E4.useRef(null),D=(M)=>{let _=Pa(M,X);H.mutate({kind:"set",icon:_})},L=(M)=>{H.mutate({kind:"upload",file:M})},j=(M)=>{if(z(M),G){let _=Pa(G,M);H.mutate({kind:"set",icon:_})}};return E4.useEffect(()=>{if(!W)return;let M=(E)=>{let C=Math.max(1,Math.floor((E-UK0+Ma)/(GK0+Ma)));F((R)=>R===C?R:C)};M(W.clientWidth);let _=new ResizeObserver(([E])=>{M(E?.contentRect.width??W.clientWidth)});return _.observe(W),()=>_.disconnect()},[W]),V1.jsxs(Aa,{value:Q,onValueChange:(M)=>B(M),className:"min-w-0 gap-4",children:[V1.jsxs("div",{className:"flex items-center justify-between gap-4",children:[V1.jsxs(Da,{"aria-label":"Icon source",children:[V1.jsx(_q,{value:"glyph",children:"Icon"}),V1.jsx(_q,{value:"emoji",children:"Emoji"}),V1.jsx(_q,{value:"upload",children:"Upload"})]}),J&&V1.jsxs(j0,{type:"button",variant:"ghost",onClick:()=>{z(!0),H.mutate({kind:"reset"})},className:"text-muted-foreground",children:[V1.jsx(ja,{"data-icon":"inline-start",stroke:1.5}),"Reset"]})]}),V1.jsx(jq,{value:"emoji",className:"flex-none",children:V1.jsx(wa,{value:G?.type==="emoji"?G.value:null,children:V1.jsxs(g3.Root,{onEmojiSelect:(M)=>D({type:"emoji",value:M.emoji}),emojibaseUrl:"/vendor/emojibase",columns:Y,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[V1.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[V1.jsx(g3.Search,{placeholder:"Search emoji",onChange:(M)=>K(M.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-md bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),V1.jsx(g3.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),V1.jsxs(g3.Viewport,{ref:q,className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[V1.jsxs(g3.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[V1.jsx(k5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),U.trim()===""&&V1.jsxs("div",{className:"border-b border-dashed border-border",children:[V1.jsx("p",{className:B0("sticky top-0",Ca),children:"Favorites"}),V1.jsx(_a,{className:"px-1.5 pb-1.5",children:La.map((M)=>V1.jsx(T_,{onClick:()=>D({type:"emoji",value:M}),selected:G?.type==="emoji"&&G.value===M,className:O_,children:V1.jsx("span",{className:"text-xl leading-none",children:M})},M))})]}),V1.jsxs(g3.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[V1.jsx(Oa,{size:20,stroke:1.5}),"No emoji found"]}),V1.jsx(g3.List,{className:"select-none",components:{CategoryHeader:KK0,Row:YK0,Emoji:FK0}})]})]})})}),V1.jsx(jq,{value:"glyph",className:"scrollbar-thin h-72 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:V1.jsx(_a,{children:xb.map(({id:M,Icon:_})=>V1.jsx(T_,{"aria-label":M,onClick:()=>D({type:"glyph",value:M}),selected:G?.type==="glyph"&&G.value===M,className:"text-muted-foreground aria-pressed:text-accent-foreground",children:V1.jsx(_,{stroke:1.75})},M))})}),V1.jsx(jq,{value:"upload",className:"flex-none",children:V1.jsxs("button",{type:"button",onClick:()=>V.current?.click(),onDragOver:(M)=>{M.preventDefault(),A(!0)},onDragLeave:()=>A(!1),onDrop:(M)=>{M.preventDefault(),A(!1);let _=M.dataTransfer.files?.[0];if(_)L(_)},className:B0("flex h-72 w-full flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",N?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[V1.jsx(Ta,{size:24,stroke:1.5}),V1.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),V1.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]})}),Q!=="upload"&&V1.jsxs("label",{htmlFor:"workspace-icon-theme-background",className:"flex w-fit cursor-pointer items-center gap-2 text-sm font-medium",children:[V1.jsx(ar,{id:"workspace-icon-theme-background",checked:X,onCheckedChange:j}),"Use theme background"]}),H.error&&V1.jsx("p",{className:"text-xs text-destructive","aria-live":"polite",children:H.error.message}),V1.jsx("input",{ref:V,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(M)=>{let _=M.target.files?.[0];if(_)L(_);M.target.value=""}})]})}var X3=P(c(),1);function Sa(){let{layout:$,name:Z,provider:J,workspaceId:H}=i1(),Q=Z??"Workspace",B=wi(H),[X,z]=Oq.useState(Q);Oq.useEffect(()=>z(Q),[Q]);function G(U){let K=U.trim();if(z(K),K!==Q)B.mutate(K===""?null:K)}return X3.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[X3.jsxs(q6,{children:[X3.jsx(N6,{render:X3.jsx("button",{type:"button","aria-label":"Change workspace icon",className:"group inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-lg p-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:X3.jsx(u6,{icon:$.icon,workspaceType:J,workspaceTheme:$.theme,className:"size-full rounded-lg"})})}),X3.jsx(V6,{align:"start",sideOffset:8,className:"w-[min(32rem,calc(100vw-2rem))] gap-4 rounded-2xl p-6",children:X3.jsx(Ea,{})})]}),X3.jsx(Zq,{"aria-label":"Workspace name",value:X,onValueChange:z,onValueCommit:G,className:"min-w-0 truncate text-3xl font-semibold md:text-3xl"})]})}var vX=P(m(),1);function D7($){let{margin:Z,containerPadding:J,containerWidth:H,cols:Q}=$;return(H-Z[0]*(Q-1)-J[0]*2)/Q}function K9($,Z,J){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*J)}function TX($,Z,J,H,Q,B,X){let{margin:z,containerPadding:G,rowHeight:U}=$,K=D7($),Y,F,W,q;if(X)Y=Math.round(X.width),F=Math.round(X.height);else Y=K9(H,K,z[0]),F=K9(Q,U,z[1]);if(B)W=Math.round(B.top),q=Math.round(B.left);else if(X)W=Math.round(X.top),q=Math.round(X.left);else W=Math.round((U+z[1])*J+G[1]),q=Math.round((K+z[0])*Z+G[0]);if(!B&&!X){if(Number.isFinite(H)){let A=Math.round((K+z[0])*(Z+H)+G[0])-q-Y;if(A!==z[0])Y+=A-z[0]}if(Number.isFinite(Q)){let A=Math.round((U+z[1])*(J+Q)+G[1])-W-F;if(A!==z[1])F+=A-z[1]}}return{top:W,left:q,width:Y,height:F}}function Ia($,Z,J,H,Q){let{margin:B,containerPadding:X,cols:z,rowHeight:G,maxRows:U}=$,K=D7($),Y=Math.round((J-X[0])/(K+B[0])),F=Math.round((Z-X[1])/(G+B[1]));return Y=OX(Y,0,z-H),F=OX(F,0,U-Q),{x:Y,y:F}}function CX($,Z,J){let{margin:H,containerPadding:Q,rowHeight:B}=$,X=D7($),z=Math.round((J-Q[0])/(X+H[0])),G=Math.round((Z-Q[1])/(B+H[1]));return{x:z,y:G}}function ba($,Z,J){let{margin:H,rowHeight:Q}=$,B=D7($),X=Math.max(1,Math.round((Z+H[0])/(B+H[0]))),z=Math.max(1,Math.round((J+H[1])/(Q+H[1])));return{w:X,h:z}}function OX($,Z,J){return Math.max(Math.min($,J),Z)}function Cq($,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 L7($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&Cq(H,Z))return H}return}function C_($,Z){return $.filter((J)=>Cq(J,Z))}function WK0($,Z){if(Z==="horizontal")return w_($);if(Z==="vertical")return Tq($);if(Z==="wrap")return Tq($);return[...$]}function Tq($){return[...$].sort((Z,J)=>{if(Z.y!==J.y)return Z.y-J.y;return Z.x-J.x})}function w_($){return[...$].sort((Z,J)=>{if(Z.x!==J.x)return Z.x-J.x;return Z.y-J.y})}function wX($){let Z=0;for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0){let Q=H.y+H.h;if(Q>Z)Z=Q}}return Z}function M7($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&H.i===Z)return H}return}function EX($){return $.filter((Z)=>Z.static===!0)}function m3($){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 jH($){let Z=Array($.length);for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0)Z[J]=m3(H)}return Z}function qK0($,Z){let J=Array($.length);for(let H=0;H<$.length;H++){let Q=$[H];if(Q!==void 0)if(Z.i===Q.i)J[H]=Z;else J[H]=Q}return J}function ka($,Z,J){let H=M7($,Z);if(!H)return[[...$],null];return H=J(m3(H)),[qK0($,H),H]}function E_($,Z){let J=EX($);for(let H=0;H<$.length;H++){let Q=$[H];if(Q===void 0)continue;if(Q.x+Q.w>Z.cols)Q.x=Z.cols-Q.w;if(Q.x<0)Q.x=0,Q.w=Z.cols;if(!Q.static)J.push(Q);else while(L7(J,Q))Q.y++}return $}function A7($,Z,J,H,Q,B,X,z,G){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===H&&Z.x===J)return[...$];let{x:U,y:K}=Z;if(typeof J==="number")Z.x=J;if(typeof H==="number")Z.y=H;Z.moved=!0;let Y=WK0($,X);if(X==="vertical"&&typeof H==="number"?K>=H:X==="horizontal"&&typeof J==="number"?U>=J:!1)Y=Y.reverse();let W=C_(Y,Z),q=W.length>0;if(q&&G)return jH($);if(q&&B)return Z.x=U,Z.y=K,Z.moved=!1,$;let N=[...$];for(let A=0;A<W.length;A++){let V=W[A];if(V===void 0)continue;if(V.moved)continue;if(V.static)N=Ra(N,V,Z,Q,X);else N=Ra(N,Z,V,Q,X)}return N}function Ra($,Z,J,H,Q,B){let X=Q==="horizontal",z=Q==="vertical",G=Z.static;if(H){H=!1;let Y={x:X?Math.max(Z.x-J.w,0):J.x,y:z?Math.max(Z.y-J.h,0):J.y,w:J.w,h:J.h,i:"-1"},F=L7($,Y),W=F!==void 0&&F.y+F.h>Z.y,q=F!==void 0&&Z.x+Z.w>F.x;if(!F)return A7($,J,X?Y.x:void 0,z?Y.y:void 0,H,G,Q);if(W&&z)return A7($,J,void 0,J.y+1,H,G,Q);if(W&&Q===null)return Z.y=J.y,J.y=J.y+J.h,[...$];if(q&&X)return A7($,Z,J.x,void 0,H,G,Q)}let U=X?J.x+1:void 0,K=z?J.y+1:void 0;if(U===void 0&&K===void 0)return[...$];return A7($,J,U,K,H,G,Q)}function OH($,Z,J){return Math.max(Z,Math.min(J,$))}var NK0={name:"gridBounds",constrainPosition($,Z,J,{cols:H,maxRows:Q}){return{x:OH(Z,0,Math.max(0,H-$.w)),y:OH(J,0,Math.max(0,Q-$.h))}},constrainSize($,Z,J,H,{cols:Q,maxRows:B}){let X=H==="w"||H==="nw"||H==="sw"?$.x+$.w:Q-$.x,z=H==="n"||H==="nw"||H==="ne"?$.y+$.h:B-$.y;return{w:OH(Z,1,Math.max(1,X)),h:OH(J,1,Math.max(1,z))}}},VK0={name:"minMaxSize",constrainSize($,Z,J){return{w:OH(Z,$.minW??1,$.maxW??1/0),h:OH(J,$.minH??1,$.maxH??1/0)}}};var S_=[NK0,VK0];function SX($,Z,J,H,Q){let B={x:J,y:H};for(let X of $)if(X.constrainPosition)B=X.constrainPosition(Z,B.x,B.y,Q);if(Z.constraints){for(let X of Z.constraints)if(X.constrainPosition)B=X.constrainPosition(Z,B.x,B.y,Q)}return B}function ya($,Z,J,H,Q,B){let X={w:J,h:H};for(let z of $)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,Q,B);if(Z.constraints){for(let z of Z.constraints)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,Q,B)}return X}function Eq({top:$,left:Z,width:J,height:H}){let Q=`translate(${Z}px,${$}px)`;return{transform:Q,WebkitTransform:Q,MozTransform:Q,msTransform:Q,OTransform:Q,width:`${J}px`,height:`${H}px`,position:"absolute"}}function R_({top:$,left:Z,width:J,height:H}){return{top:`${$}px`,left:`${Z}px`,width:`${J}px`,height:`${H}px`,position:"absolute"}}function I_($){return $*100+"%"}function AK0($,Z,J,H){return $+J>H?Z:J}function xa($,Z,J){return $<0?Z:J}function DK0($){return Math.max(0,$)}function wq($){return Math.max(0,$)}var b_=($,Z,J)=>{let{left:H,height:Q,width:B}=Z,X=$.top-(Q-$.height);return{left:H,width:B,height:xa(X,$.height,Q),top:wq(X)}},k_=($,Z,J)=>{let{top:H,left:Q,height:B,width:X}=Z;return{top:H,height:B,width:AK0($.left,$.width,X,J),left:DK0(Q)}},y_=($,Z,J)=>{let{top:H,height:Q,width:B}=Z,X=$.left+$.width-B;if(X<0)return{height:Q,width:$.left+$.width,top:wq(H),left:0};return{height:Q,width:B,top:wq(H),left:X}},x_=($,Z,J)=>{let{top:H,left:Q,height:B,width:X}=Z;return{width:X,left:Q,height:xa(H,$.height,B),top:wq(H)}},LK0=($,Z,J)=>b_($,k_($,Z,J)),MK0=($,Z,J)=>b_($,y_($,Z)),PK0=($,Z,J)=>x_($,k_($,Z,J)),_K0=($,Z,J)=>x_($,y_($,Z)),jK0={n:b_,ne:LK0,e:k_,se:PK0,s:x_,sw:_K0,w:y_,nw:MK0};function ha($,Z,J,H){let Q=jK0[$];if(!Q)return J;return Q(Z,{...Z,...J},H)}var OK0={type:"transform",scale:1,calcStyle($){return Eq($)}};var va=OK0,ga={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},fa={enabled:!0,bounded:!1,threshold:3},ma={enabled:!0,handles:["se"]},ua={enabled:!1,defaultItem:{w:1,h:1}};function h_($,Z,J,H,Q){let B=H==="x"?"w":"h";Z[H]+=1;let X=$.findIndex((G)=>G.i===Z.i),z=Q??EX($).length>0;for(let G=X+1;G<$.length;G++){let U=$[G];if(U===void 0)continue;if(U.static)continue;if(!z&&U.y>Z.y+Z.h)break;if(Cq(Z,U))h_($,U,J+Z[B],H,z)}Z[H]=J}function TK0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(H,Z.y);while(Z.y>0&&!L7($,Z))Z.y--;let Q;while((Q=L7($,Z))!==void 0)h_(J,Z,Q.y+Q.h,"y");return Z.y=Math.max(Z.y,0),Z}function CK0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!L7($,Z))Z.x--;let Q;while((Q=L7($,Z))!==void 0)if(h_(H,Z,Q.x+Q.w,"x"),Z.x+Z.w>J){Z.x=J-Z.w,Z.y++;while(Z.x>0&&!L7($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var RX={type:"vertical",allowOverlap:!1,compact($,Z){let J=EX($),H=wX(J),Q=Tq($),B=Array($.length);for(let X=0;X<Q.length;X++){let z=Q[X];if(z===void 0)continue;let G=m3(z);if(!G.static)G=TK0(J,G,Q,H),H=Math.max(H,G.y+G.h),J.push(G);let U=$.indexOf(z);B[U]=G,G.moved=!1}return B}},v_={type:"horizontal",allowOverlap:!1,compact($,Z){let J=EX($),H=w_($),Q=Array($.length);for(let B=0;B<H.length;B++){let X=H[B];if(X===void 0)continue;let z=m3(X);if(!z.static)z=CK0(J,z,Z,H),J.push(z);let G=$.indexOf(X);Q[G]=z,z.moved=!1}return Q}},g_={type:null,allowOverlap:!1,compact($,Z){return jH($)}},wK0={...RX,allowOverlap:!0,compact($,Z){return jH($)}},EK0={...v_,allowOverlap:!0,compact($,Z){return jH($)}},SK0={...g_,allowOverlap:!0};function f_($,Z=!1,J=!1){let H;if(Z)if($==="vertical")H=wK0;else if($==="horizontal")H=EK0;else H=SK0;else if($==="vertical")H=RX;else if($==="horizontal")H=v_;else H=g_;if(J)return{...H,preventCollision:J};return H}var Y9=P(m(),1);function RK0($){let Z=typeof globalThis.getComputedStyle==="function"?globalThis.getComputedStyle($):null;if(!Z)return $.clientWidth;let J=(Q)=>{let B=Number.parseFloat(Q);return Number.isFinite(B)?B:0},H=Number.parseFloat(Z.width);if(Number.isFinite(H))return Math.max(0,H);return Math.max(0,$.clientWidth-J(Z.paddingLeft)-J(Z.paddingRight))}function m_($={}){let{measureBeforeMount:Z=!1,initialWidth:J=1280}=$,[H,Q]=Y9.useState(J),[B,X]=Y9.useState(!Z),z=Y9.useRef(null),G=Y9.useRef(null),U=Y9.useCallback(()=>{let K=z.current;if(K){let Y=Math.round(RK0(K));if(Q((F)=>F===Y?F:Y),!B)X(!0)}},[B]);return Y9.useEffect(()=>{let K=z.current;if(!K)return;if(U(),typeof ResizeObserver<"u"){let Y=null;return G.current=new ResizeObserver((F)=>{let W=F[0];if(W){let q=Math.round(W.contentRect.width);if(Y!==null)cancelAnimationFrame(Y);Y=requestAnimationFrame(()=>{Q((N)=>N===q?N:q),Y=null})}}),G.current.observe(K),()=>{if(Y!==null)cancelAnimationFrame(Y);if(G.current)G.current.disconnect(),G.current=null}}return()=>{if(G.current)G.current.disconnect(),G.current=null}},[U]),{width:H,mounted:B,containerRef:z,measureWidth:U}}var g0=P(m(),1),fo=P(vq(),1),mo=P(ho(),1);var p3=P(c(),1),JZ=P(ca(),1);function Xj($){let{children:Z,cols:J,containerWidth:H,margin:Q,containerPadding:B,rowHeight:X,maxRows:z,isDraggable:G,isResizable:U,isBounded:K,static:Y,useCSSTransforms:F=!0,usePercentages:W=!1,transformScale:q=1,positionStrategy:N,dragThreshold:A=0,droppingPosition:V,className:D="",style:L,handle:j="",cancel:M="",x:_,y:E,w:C,h:R,minW:T=1,maxW:I=1/0,minH:y=1,maxH:S=1/0,i:O,resizeHandles:k,resizeHandle:b,constraints:h=S_,layoutItem:v,layout:f=[],onDragStart:w,onDrag:i,onDragStop:r,onResizeStart:x,onResize:l,onResizeStop:s}=$,[p,d]=g0.useState(!1),[o,Z0]=g0.useState(!1),H0=g0.useRef(null),G0=g0.useRef({left:0,top:0}),X0=g0.useRef({top:0,left:0,width:0,height:0}),Y0=g0.useRef(void 0),A0=g0.useRef(f);A0.current=f;let N0=g0.useRef(null),F0=g0.useRef(null),n=g0.useRef(!1),a=g0.useRef({x:0,y:0}),e=g0.useRef(!1),$0=g0.useMemo(()=>({cols:J,containerPadding:B,containerWidth:H,margin:Q,maxRows:z,rowHeight:X}),[J,B,H,Q,z,X]),Q0=g0.useMemo(()=>({cols:J,maxRows:z,containerWidth:H,containerHeight:0,rowHeight:X,margin:Q,layout:[]}),[J,z,H,X,Q]),_0=g0.useCallback(()=>({...Q0,layout:A0.current}),[Q0]),M0=g0.useMemo(()=>v??{i:O,x:_,y:E,w:C,h:R,minW:T,maxW:I,minH:y,maxH:S},[v,O,_,E,C,R,T,I,y,S]),V0=g0.useCallback((C0)=>{if(N?.calcStyle)return N.calcStyle(C0);if(F)return Eq(C0);let p0=R_(C0);if(W)return{...p0,left:I_(C0.left/H),width:I_(C0.width/H)};return p0},[N,F,W,H]),L0=g0.useCallback((C0,{node:p0})=>{if(!w)return;let{offsetParent:i0}=p0;if(!i0)return;let o0=i0.getBoundingClientRect(),A1=p0.getBoundingClientRect(),D1=A1.left/q,u1=o0.left/q,q0=A1.top/q,P0=o0.top/q,l0;if(N?.calcDragPosition){let r0=C0;l0=N.calcDragPosition(r0.clientX,r0.clientY,r0.clientX-A1.left,r0.clientY-A1.top)}else l0={left:D1-u1+i0.scrollLeft,top:q0-P0+i0.scrollTop};if(G0.current=l0,A>0){let r0=C0;a.current={x:r0.clientX,y:r0.clientY},n.current=!0,e.current=!1,d(!0);return}d(!0);let z1=CX($0,l0.top,l0.left),{x:O1,y:k0}=SX(h,M0,z1.x,z1.y,_0());w(O,O1,k0,{e:C0,node:p0,newPosition:l0})},[w,q,$0,N,A,h,M0,_0,O]),g=g0.useCallback((C0,{node:p0,deltaX:i0,deltaY:o0})=>{if(!i||!p)return;let A1=C0;if(n.current&&!e.current){let O1=A1.clientX-a.current.x,k0=A1.clientY-a.current.y;if(Math.hypot(O1,k0)<A)return;if(e.current=!0,n.current=!1,w){let h0=CX($0,G0.current.top,G0.current.left),{x:G1,y:R1}=SX(h,M0,h0.x,h0.y,_0());w(O,G1,R1,{e:C0,node:p0,newPosition:G0.current})}}let D1=G0.current.top+o0,u1=G0.current.left+i0;if(K){let{offsetParent:O1}=p0;if(O1){let k0=O1.clientHeight-K9(R,X,Q[1]);D1=OX(D1,0,k0);let r0=D7($0),h0=H-K9(C,r0,Q[0]);u1=OX(u1,0,h0)}}let q0={top:D1,left:u1};G0.current=q0;let P0=CX($0,D1,u1),{x:l0,y:z1}=SX(h,M0,P0.x,P0.y,_0());i(O,l0,z1,{e:C0,node:p0,newPosition:q0})},[i,w,p,A,K,R,X,Q,$0,H,C,O,h,M0,_0]),u=g0.useCallback((C0,{node:p0})=>{if(!r||!p)return;let i0=n.current;if(n.current=!1,e.current=!1,a.current={x:0,y:0},i0){d(!1),G0.current={left:0,top:0};return}let{left:o0,top:A1}=G0.current,D1={top:A1,left:o0};d(!1),G0.current={left:0,top:0};let u1=CX($0,A1,o0),{x:q0,y:P0}=SX(h,M0,u1.x,u1.y,_0());r(O,q0,P0,{e:C0,node:p0,newPosition:D1})},[r,p,$0,h,M0,_0,O]);N0.current=L0,F0.current=g;let t=g0.useCallback((C0,{node:p0,size:i0,handle:o0},A1,D1)=>{let u1=D1==="onResizeStart"?x:D1==="onResize"?l:s;if(!u1)return;let q0;if(p0)q0=ha(o0,A1,i0,H);else q0={...i0,top:A1.top,left:A1.left};X0.current=q0;let P0=ba($0,q0.width,q0.height),{w:l0,h:z1}=ya(h,M0,P0.w,P0.h,o0,_0());u1(O,l0,z1,{e:C0.nativeEvent??C0,node:p0,size:q0,handle:o0})},[x,l,s,H,$0,O,h,M0,_0]),W0=g0.useCallback((C0,p0)=>{Z0(!0);let i0=TX($0,_,E,C,R),o0={...p0,handle:p0.handle};t(C0,o0,i0,"onResizeStart")},[t,$0,_,E,C,R]),I0=g0.useCallback((C0,p0)=>{let i0=TX($0,_,E,C,R),o0={...p0,handle:p0.handle};t(C0,o0,i0,"onResize")},[t,$0,_,E,C,R]),c0=g0.useCallback((C0,p0)=>{Z0(!1),X0.current={top:0,left:0,width:0,height:0};let i0=TX($0,_,E,C,R),o0={...p0,handle:p0.handle};t(C0,o0,i0,"onResizeStop")},[t,$0,_,E,C,R]);g0.useEffect(()=>{if(!V)return;let C0=H0.current;if(!C0)return;let p0=Y0.current||{left:0,top:0},i0=p&&(V.left!==p0.left||V.top!==p0.top);if(!p){let o0={node:C0,deltaX:V.left,deltaY:V.top,lastX:0,lastY:0,x:V.left,y:V.top};N0.current?.(V.e,o0)}else if(i0){let o0=V.left-G0.current.left,A1=V.top-G0.current.top,D1={node:C0,deltaX:o0,deltaY:A1,lastX:G0.current.left,lastY:G0.current.top,x:V.left,y:V.top};F0.current?.(V.e,D1)}Y0.current=V},[V,p,O]);let f0=TX($0,_,E,C,R,p?G0.current:null,o?X0.current:null),T0=g0.default.Children.only(Z),x0=D7($0),J1=[K9(T,x0,Q[0]),K9(y,X,Q[1])],W1=[K9(I,x0,Q[0]),K9(S,X,Q[1])],d0=T0.props,v0=d0.className,S1=d0.style,B1=g0.default.cloneElement(T0,{ref:H0,className:zj("react-grid-item",v0,D,{static:Y,resizing:o,"react-draggable":G,"react-draggable-dragging":p,dropping:Boolean(V),cssTransforms:F}),style:{...L,...S1,...V0(f0)}}),s1=b;return B1=p3.jsx(mo.Resizable,{draggableOpts:{disabled:!U},className:U?void 0:"react-resizable-hide",width:f0.width,height:f0.height,minConstraints:J1,maxConstraints:W1,onResizeStart:W0,onResize:I0,onResizeStop:c0,transformScale:q,resizeHandles:k,handle:s1,children:B1}),B1=p3.jsx(fo.DraggableCore,{disabled:!G,onStart:L0,onDrag:g,onStop:u,handle:j,cancel:".react-resizable-handle"+(M?","+M:""),scale:q,nodeRef:H0,children:B1}),B1}var u3=()=>{},vo="react-grid-layout",uo=!1;try{uo=/firefox/i.test(navigator.userAgent)}catch{}function uF0($,Z){let J=g0.default.Children.toArray($),H=g0.default.Children.toArray(Z);if(J.length!==H.length)return!1;for(let Q=0;Q<J.length;Q++){let B=J[Q],X=H[Q];if(B?.key!==X?.key)return!1}return!0}function go($,Z,J,H){let Q=[],B=new Set;g0.default.Children.forEach(Z,(z)=>{if(!g0.default.isValidElement(z)||z.key===null)return;let G=String(z.key);B.add(G);let U=$.find((K)=>K.i===G);if(U)Q.push(m3(U));else{let Y=z.props["data-grid"];if(Y)Q.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 Q.push({i:G,x:0,y:wX(Q),w:1,h:1})}});let X=E_(Q,{cols:J});return H.compact(X,J)}function hX($){let{children:Z,width:J,gridConfig:H,dragConfig:Q,resizeConfig:B,dropConfig:X,positionStrategy:z=va,compactor:G,constraints:U=S_,layout:K=[],droppingItem:Y,autoSize:F=!0,className:W="",style:q={},innerRef:N,onLayoutChange:A=u3,onDragStart:V=u3,onDrag:D=u3,onDragStop:L=u3,onResizeStart:j=u3,onResize:M=u3,onResizeStop:_=u3,onDrop:E=u3,onDropDragOver:C=u3}=$,R=g0.useMemo(()=>({...ga,...H}),[H]),T=g0.useMemo(()=>({...fa,...Q}),[Q]),I=g0.useMemo(()=>({...ma,...B}),[B]),y=g0.useMemo(()=>({...ua,...X}),[X]),{cols:S,rowHeight:O,maxRows:k,margin:b,containerPadding:h}=R,{enabled:v,bounded:f,handle:w,cancel:i,threshold:r}=T,{enabled:x,handles:l,handleComponent:s}=I,{enabled:p,defaultItem:d,onDragOver:o}=y,Z0=G??f_("vertical"),H0=Z0.type,G0=Z0.allowOverlap,X0=Z0.preventCollision??!1,Y0=g0.useMemo(()=>Y??{i:"__dropping-elem__",...d},[Y,d]),A0=z.type==="transform",N0=z.scale,F0=h??b,[n,a]=g0.useState(!1),[e,$0]=g0.useState(()=>go(K,Z,S,Z0)),[Q0,_0]=g0.useState(null),[M0,V0]=g0.useState(!1),[L0,g]=g0.useState(null),[u,t]=g0.useState(),W0=g0.useRef(null),I0=g0.useRef(null),c0=g0.useRef(null),f0=g0.useRef(0),T0=g0.useRef(e),x0=g0.useRef(K),J1=g0.useRef(Z),W1=g0.useRef(H0),d0=g0.useRef(e);d0.current=e,g0.useEffect(()=>{if(a(!0),!JZ.deepEqual(e,K))A(e)},[]),g0.useEffect(()=>{if(Q0)return;if(L0)return;let k0=!JZ.deepEqual(K,x0.current),r0=!uF0(Z,J1.current),h0=H0!==W1.current;if(k0||r0||h0){let R1=go(k0?K:e,Z,S,Z0);if(!JZ.deepEqual(R1,e))$0(R1)}x0.current=K,J1.current=Z,W1.current=H0},[K,Z,S,H0,Z0,Q0,L0,e]),g0.useEffect(()=>{if(!Q0&&!JZ.deepEqual(e,T0.current)){T0.current=e;let k0=e.filter((r0)=>r0.i!==Y0.i);A(k0)}},[e,Q0,A,Y0.i]);let v0=g0.useMemo(()=>{if(!F)return;let k0=wX(e),r0=F0[1];return k0*O+(k0-1)*b[1]+r0*2+"px"},[F,e,O,b,F0]),S1=g0.useCallback((k0,r0,h0,G1)=>{let R1=d0.current,k1=M7(R1,k0);if(!k1)return;let h5={w:k1.w,h:k1.h,x:k1.x,y:k1.y,i:k0};W0.current=m3(k1),c0.current=R1,_0(h5),V(R1,k1,k1,null,G1.e,G1.node)},[V]),B1=g0.useCallback((k0,r0,h0,G1)=>{let R1=d0.current,k1=W0.current,h5=M7(R1,k0);if(!h5)return;let L2={w:h5.w,h:h5.h,x:h5.x,y:h5.y,i:k0},v5=A7(R1,h5,r0,h0,!0,X0,H0,S,G0);D(v5,k1,h5,L2,G1.e,G1.node),$0(Z0.compact(v5,S)),_0(L2)},[X0,H0,S,G0,Z0,D]),s1=g0.useCallback((k0,r0,h0,G1)=>{if(!Q0)return;let R1=d0.current,k1=W0.current,h5=M7(R1,k0);if(!h5)return;let L2=A7(R1,h5,r0,h0,!0,X0,H0,S,G0),v5=Z0.compact(L2,S);L(v5,k1,h5,null,G1.e,G1.node);let l2=c0.current;if(W0.current=null,c0.current=null,_0(null),$0(v5),l2&&!JZ.deepEqual(l2,v5))A(v5)},[Q0,X0,H0,S,G0,Z0,L,A]),C0=g0.useCallback((k0,r0,h0,G1)=>{let R1=d0.current,k1=M7(R1,k0);if(!k1)return;I0.current=m3(k1),c0.current=R1,V0(!0),j(R1,k1,k1,null,G1.e,G1.node)},[j]),p0=g0.useCallback((k0,r0,h0,G1)=>{let R1=d0.current,k1=I0.current,{handle:h5}=G1,L2=!1,v5,l2,[dX,K3]=ka(R1,k0,(m5)=>{if(v5=m5.x,l2=m5.y,["sw","w","nw","n","ne"].includes(h5)){if(["sw","nw","w"].includes(h5))v5=m5.x+(m5.w-r0),r0=m5.x!==v5&&v5<0?m5.w:r0,v5=v5<0?0:v5;if(["ne","n","nw"].includes(h5))l2=m5.y+(m5.h-h0),h0=m5.y!==l2&&l2<0?m5.h:h0,l2=l2<0?0:l2;L2=!0}if(X0&&!G0){if(C_(R1,{...m5,w:r0,h:h0,x:v5??m5.x,y:l2??m5.y}).filter((iX)=>iX.i!==m5.i).length>0)l2=m5.y,h0=m5.h,v5=m5.x,r0=m5.w,L2=!1}return m5.w=r0,m5.h=h0,m5});if(!K3)return;let hH=dX;if(L2&&v5!==void 0&&l2!==void 0)hH=A7(dX,K3,v5,l2,!0,X0,H0,S,G0);let lX={w:K3.w,h:K3.h,x:K3.x,y:K3.y,i:k0,static:!0};M(hH,k1,K3,lX,G1.e,G1.node),$0(Z0.compact(hH,S)),_0(lX)},[X0,H0,S,G0,Z0,M]),i0=g0.useCallback((k0,r0,h0,G1)=>{let R1=d0.current,k1=I0.current,h5=M7(R1,k0),L2=Z0.compact(R1,S);_(L2,k1,h5??null,null,G1.e,G1.node);let v5=c0.current;if(I0.current=null,c0.current=null,_0(null),V0(!1),$0(L2),v5&&!JZ.deepEqual(v5,L2))A(L2)},[S,Z0,_,A]),o0=g0.useCallback(()=>{let k0=d0.current;if(!k0.some((G1)=>G1.i===Y0.i)){g(null),_0(null),t(void 0);return}let h0=Z0.compact(k0.filter((G1)=>G1.i!==Y0.i),S);$0(h0),g(null),_0(null),t(void 0)},[Y0.i,S,Z0]),A1=g0.useCallback((k0)=>{if(k0.preventDefault(),k0.stopPropagation(),uo&&!k0.nativeEvent.target?.classList.contains(vo))return!1;let r0=o?o(k0.nativeEvent):C(k0);if(r0===!1){if(L0)o0();return!1}let{dragOffsetX:h0=0,dragOffsetY:G1=0,...R1}=r0??{},k1={...Y0,...R1},h5=k0.currentTarget.getBoundingClientRect(),L2={cols:S,margin:b,maxRows:k,rowHeight:O,containerWidth:J,containerPadding:F0},v5=D7(L2),l2=K9(k1.w,v5,b[0]),dX=K9(k1.h,O,b[1]),K3=l2/2,hH=dX/2,lX=k0.clientX-h5.left+h0-K3,m5=k0.clientY-h5.top+G1-hH,HN=Math.max(0,lX),iX=Math.max(0,m5),rX={left:HN/N0,top:iX/N0,e:k0.nativeEvent};if(!L0){let QN=Ia(L2,iX,HN,k1.w,k1.h);g(p3.jsx("div",{},k1.i)),t(rX);let xs=d0.current.filter((hs)=>hs.i!==k1.i);$0([...xs,{...k1,x:QN.x,y:QN.y,static:!1,isDraggable:!0}])}else if(u){if(u.left!==rX.left||u.top!==rX.top)t(rX)}},[L0,u,Y0,o,C,o0,N0,S,b,k,O,J,F0]),D1=g0.useCallback((k0)=>{if(k0.preventDefault(),k0.stopPropagation(),f0.current--,f0.current<0)f0.current=0;if(f0.current===0)o0()},[o0]),u1=g0.useCallback((k0)=>{k0.preventDefault(),k0.stopPropagation(),f0.current++},[]),q0=g0.useCallback((k0)=>{k0.preventDefault(),k0.stopPropagation();let r0=d0.current,h0=r0.find((G1)=>G1.i===Y0.i);f0.current=0,o0(),E(r0,h0,k0.nativeEvent)},[Y0.i,o0,E]),P0=g0.useCallback((k0,r0)=>{if(!k0||!k0.key)return null;let h0=M7(e,String(k0.key));if(!h0)return null;let G1=typeof h0.isDraggable==="boolean"?h0.isDraggable:!h0.static&&v,R1=typeof h0.isResizable==="boolean"?h0.isResizable:!h0.static&&x,k1=h0.resizeHandles||[...l],h5=G1&&f&&h0.isBounded!==!1,L2=s;return p3.jsx(Xj,{containerWidth:J,cols:S,margin:b,containerPadding:F0,maxRows:k,rowHeight:O,cancel:i,handle:w,onDragStart:S1,onDrag:B1,onDragStop:s1,onResizeStart:C0,onResize:p0,onResizeStop:i0,isDraggable:G1,isResizable:R1,isBounded:h5,useCSSTransforms:A0&&n,usePercentages:!n,transformScale:N0,positionStrategy:z,dragThreshold:r,w:h0.w,h:h0.h,x:h0.x,y:h0.y,i:h0.i,minH:h0.minH,minW:h0.minW,maxH:h0.maxH,maxW:h0.maxW,static:h0.static,droppingPosition:r0?u:void 0,resizeHandles:k1,resizeHandle:L2,constraints:U,layoutItem:h0,layout:e,children:k0},h0.i)},[e,J,S,b,F0,k,O,i,w,S1,B1,s1,C0,p0,i0,v,x,f,A0,n,N0,z,r,u,l,s,U]),l0=()=>{if(!Q0)return null;return p3.jsx(Xj,{w:Q0.w,h:Q0.h,x:Q0.x,y:Q0.y,i:Q0.i,className:`react-grid-placeholder ${M0?"placeholder-resizing":""}`,containerWidth:J,cols:S,margin:b,containerPadding:F0,maxRows:k,rowHeight:O,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:A0,transformScale:N0,constraints:U,layout:e,children:p3.jsx("div",{})})},z1=zj(vo,W),O1={height:v0,...q};return p3.jsxs("div",{ref:N,className:z1,style:O1,onDrop:p?q0:void 0,onDragLeave:p?D1:void 0,onDragEnter:p?u1:void 0,onDragOver:p?A1:void 0,children:[g0.default.Children.map(Z,(k0)=>{if(!g0.default.isValidElement(k0))return null;return P0(k0)}),p&&L0&&P0(L0,!0),l0()]})}var Y8=P(c(),1),Gj="moi:empty-state",po={type:"spring",duration:0.35,bounce:0};function cF0({items:$,customizing:Z,emptyState:J,renderItem:H,onMove:Q,onRemove:B}){let[X,z]=vX.useState(()=>AX($)),[G,U]=vX.useState($),{width:K,containerRef:Y,mounted:F}=m_({measureBeforeMount:!0});if(G!==$)U($),z((N)=>{let A=new Map(N.map((L)=>[L.i,L])),V=$.filter((L)=>A.has(L.id)).map((L)=>({...A.get(L.id),w:L.w,h:L.h})),D=new Set(V.map((L)=>L.i));return[...V,...AX($.filter((L)=>!D.has(L.id)),V)]});let W=J?[...X,{i:Gj,x:0,y:X.reduce((N,A)=>Math.max(N,A.y+A.h),0),w:4,h:2,static:!0}]:X,q=vX.useCallback((N)=>{let A=N.filter((V)=>V.i!==Gj);z(A),Q?.(A.map((V)=>({id:V.i,x:V.x,y:V.y})))},[Q]);return Y8.jsx("div",{ref:Y,className:"w-full",children:F&&Y8.jsxs(hX,{width:K,layout:W,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:RX,onLayoutChange:q,children:[X.map((N)=>Y8.jsx("div",{children:Y8.jsx(z5.div,{layoutId:N.i,"data-applet-thumbnail":i6("widgets",N.i),className:"size-full",transition:po,children:Y8.jsx(Gq,{customizing:Z,widgetId:N.i,onRemove:B?()=>B(N.i):void 0,children:H(N.i)})})},N.i)),J&&Y8.jsx("div",{children:Y8.jsx(z5.div,{layout:!0,className:"size-full",transition:po,children:J})},Gj)]})})}function co({items:$,customizing:Z,header:J,emptyState:H,bottomInset:Q=0,renderItem:B,onMove:X,onRemove:z}){return Y8.jsxs("div",{className:"size-full overflow-y-auto p-4",children:[Y8.jsx("div",{className:"mx-auto h-32 w-full max-w-(--column-w)",children:J}),Y8.jsx(z5.div,{className:"mx-auto flex min-h-0 w-full max-w-(--column-w) flex-col gap-2",animate:{marginBottom:Q},transition:{type:"spring",duration:0.3,bounce:0},children:($.length>0||H)&&Y8.jsx(cF0,{items:$,customizing:Z,emptyState:H,renderItem:B,onMove:X,onRemove:z})})]})}var c1=P(c(),1);function dF0({onCreateWidget:$,showOnboarding:Z}){return c1.jsxs("div",{className:"relative grid size-full grid-cols-4 grid-rows-2 gap-2 overflow-hidden",children:[c1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:c1.jsx("div",{className:"flex size-full items-start justify-start bg-radial-[at_top_left] from-muted from-40% to-transparent p-12",children:c1.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Widgets"})})}),c1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),c1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),c1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:Z&&c1.jsx("div",{className:"flex size-full items-end justify-end",children:c1.jsx("span",{className:"m-8 max-w-56 text-right text-sm text-muted-foreground",children:"Widgets can surface information, read data, and perform actions"})})}),c1.jsxs(j0,{type:"button",variant:"outline",className:B0("absolute inset-0 m-auto h-fit w-fit","flex-col gap-1 rounded-2xl border-0 py-4 pr-12 pl-12! text-xs shadow-sm transition-shadow duration-300 ease-out squircle hover:bg-background hover:shadow-lg [&_svg]:size-8"),onClick:$,children:[c1.jsx(f2,{"data-icon":"inline-start",stroke:1}),"New widget"]})]})}function Uj({Icon:$,label:Z,active:J,className:H,...Q}){return c1.jsx(j0,{type:"button",variant:J?"default":"secondary",className:B0("relative h-16 w-24 rounded-lg px-4 py-0 text-xs [&_svg]:size-5",H),"aria-pressed":J,...Q,children:c1.jsx(j4,{mode:"popLayout",initial:!1,children:c1.jsxs(z5.span,{className:"flex flex-col items-center gap-1.5",variants:{from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.2,bounce:0},children:[J?c1.jsx(O8,{stroke:1.5}):c1.jsx($,{stroke:1.5}),c1.jsx("span",{children:J?"Done":Z})]},J?"done":"action")})})}function lF0({customizing:$,theming:Z,onCustomizingChange:J,onThemingChange:H}){return c1.jsxs("div",{className:"flex size-full items-center gap-4",children:[c1.jsx(Sa,{}),c1.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c1.jsx(Uj,{Icon:lo,label:"Customize",active:$,onClick:()=>J(!$)}),c1.jsx(Uj,{Icon:uq,label:"Theme",active:Z,onClick:()=>H(!Z)}),c1.jsx($q,{children:c1.jsx(w3,{render:c1.jsx(Uj,{Icon:S6,label:"Settings"})})})]})]})}function iF0(){let[$,Z]=pq.useState(0);return[pq.useCallback((H)=>{if(!H)return;let Q=new ResizeObserver(([B])=>{let X=B.borderBoxSize?.[0];Z(X?X.blockSize:B.contentRect.height)});return Q.observe(H),()=>Q.disconnect()},[]),$]}function io({onCreateWidget:$,onCreateView:Z,onOpenView:J,customizing:H,theming:Q,onThemingChange:B,onCustomizingChange:X,widgets:z,views:G,builders:U}){let{layout:K,setLayout:Y}=i1(),F=w5((T)=>T.hasSentMessageFromMoi),W=new Map(z.map((T)=>[T.id,T])),q=new Set(K.widgetGrid.map((T)=>T.i)),N=K.widgetGrid.filter((T)=>W.has(T.i)).map((T)=>{let I=W.get(T.i);return{id:T.i,w:I.config.colSpan,h:I.config.rowSpan,x:T.x,y:T.y}}),A=z.filter((T)=>!q.has(T.id)).map((T)=>({id:T.id,w:T.config.colSpan,h:T.config.rowSpan})),V=!H&&N.every((T)=>r9(T.id)),D=!F&&z.every((T)=>r9(T.id)),[L,j]=iF0(),M=H;vW({kind:"widget",enabled:!H,targets:N.filter((T)=>!r9(T.id)).map((T)=>({id:T.id,revision:W.get(T.id)?.revision}))});function _(T){let I=ii(T,{views:G,builders:U,onOpenView:J,onCreateView:Z,showOnboarding:D});if(I)return I;return c1.jsx(ti,{name:T})}function E(T){Y({widgetGrid:K.widgetGrid.filter((I)=>I.i!==T)})}function C(T){let I=W.get(T);if(!I)return;let y=K.widgetGrid.map((O)=>{let k=W.get(O.i);return{...O,w:k?.config.colSpan??1,h:k?.config.rowSpan??1}}),S=Bq(y,I.config.colSpan,I.config.rowSpan);Y({widgetGrid:[...K.widgetGrid,{i:T,x:S.x,y:S.y}]})}function R(T){Y({widgetGrid:oi(K.widgetGrid,T)})}return c1.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:c1.jsxs(KU,{children:[c1.jsx(co,{items:N,customizing:H,header:c1.jsx(lF0,{customizing:H,theming:Q,onCustomizingChange:X,onThemingChange:B}),emptyState:V?c1.jsx(dF0,{onCreateWidget:$,showOnboarding:D}):void 0,bottomInset:M?j:0,renderItem:_,onMove:R,onRemove:E}),c1.jsx(j4,{children:H&&c1.jsx(Zr,{ref:L,items:A,renderItem:_,onCreateWidget:$,onClose:()=>X(!1),onRestore:C})})]})})}var ao=P(c(),1);function ro({children:$}){return ao.jsx("header",{className:B0("@container relative flex shrink-0 items-center gap-1 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 oo=!0;var rF0=64;function no($,Z=[]){let J=QL($),H=J.attachments.map(BL);return(Qh(J.text).trim()||(H.length?H:Z).filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,rF0).trimEnd()}function cq($,Z,J={}){if("id"in $){let X={source:J.source,...$.kind==="image"?{purpose:J.purpose}:{}};return{attachment:{type:"upload",uploadId:$.id,...X},part:{type:"file-attachment",mediaType:$.mediaType,label:$.filename,...X,previewUrl:$.kind==="image"?Z:void 0}}}let{source:H,label:Q,text:B}=$;return{attachment:{type:"text",source:H,label:Q,text:B},part:Hh({type:"text",source:H,label:Q,text:B})}}function so($){return{attachments:$.map((Z)=>Z.attachment),parts:$.map((Z)=>Z.part)}}async function to($,Z){let J=NY(Z);if(J)throw Error(J);return so(await Promise.all(Z.map(async(H)=>{if(H.type==="text")return cq(H);let Q=await TB($,H.file??H.path);return cq(Q,`/api/workspaces/${$}/uploads/${Q.id}`,{source:H.source})})))}function dq($){return so($.flatMap((Z)=>{if(Z.kind==="text")return[cq(Z)];if(!Z.upload)return[];return[cq({...Z.upload,filename:Z.label,mediaType:Z.mediaType},Z.previewUrl,{source:Z.source,purpose:Z.kind==="drawing"?Z.purpose:void 0})]}))}function lq($){return!$?.applet&&!$?.preparedAttachments}function iq($,Z,J){if(!lq(J))return[];return(w1.getState().attachments[J8($,Z)]??[]).filter((Q)=>Q.kind==="text"||Q.status==="ready"&&Q.upload)}function rq({queryClient:$,workspaceId:Z,sessionId:J,parts:H}){let Q=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(S0.events(Z,J),(B)=>RG(B??qQ(),{kind:"turn",turn:{id:Q,role:"user",origin:{kind:"user-input"},parts:H,timestamp:new Date().toISOString()}})),w1.getState().setActivity(Z,J,"running"),w1.getState().setError(Z,J,null),Q}function aq({queryClient:$,workspaceId:Z,sessionId:J,text:H,filenames:Q=[]}){let B=no(H,Q);if(!B)return;$.setQueryData(S0.sessions(Z),(X)=>[{sessionId:J,summary:B,lastModified:Date.now()},...(X??[]).filter((z)=>z.sessionId!==J)])}function oq($,Z,J,H){let Q=$?.models,B=!Z||!Q||Q.some((Y)=>Y.value===Z)?Z:void 0,X=$?.provider==="codex"?hY($.models,Z):Q?.find((Y)=>Y.value===(B??"default")),z=$?.provider==="codex"&&X?X.resolvedModel??X.value:B,G=J&&(!X||(X.supportedEffortLevels??[]).includes(J))?J:void 0,U=H===void 0||!X||X.supportsFastMode?H:!1,K=oo&&$?.supportsStreaming?!0:void 0;return{model:z,effort:G,...U!==void 0?{fastMode:U}:{},stream:K}}var $n=P(m(),1);function eo($){if($.status==="available")return null;if($.status==="checking")return"The agent is still connecting";if($.status==="disconnected")return"This workspace is disconnected from moi";if($.status==="login-required")return"Sign in to the agent to send this message";return"The agent is unavailable in this workspace"}function aF0($,Z,J,H="shared"){let Q=new Set,B=!1,X=()=>Z.getQueryData(K$($,H))?.sessionId??null;async function z(G){if(B)return;let U=(D)=>{K5.add({title:"Couldn’t send message",description:D,type:"error"}),Z8($,{source:"runtime",message:`sendChatMessage() from ${G.source}: ${D}`})},K=eo(J().agentAvailability);if(K){U(K);return}let Y=X(),F=!0,W,q=()=>{if(F=!1,A(),Q.delete(N),W)K5.close(W)},N=()=>{if(!F)return;q(),K5.add({title:"Message canceled",description:"The active chat changed before attachments were ready",type:"info"})},A=Z.getQueryCache().subscribe(()=>{if(X()!==Y)N()});if(Q.add(N),J().sessionId!==Y){N();return}J().revealChat();let V;try{if(G.attachments.some((j)=>j.type==="file"))W=K5.add({title:"Preparing attachments…",type:"loading",timeout:0});if(V=await to($,G.attachments),!F)return;let D=J(),L=eo(D.agentAvailability);if(L)throw Error(L);if(D.sessionId!==Y){N();return}}catch(D){if(F)q(),U(D instanceof Error?D.message:"Couldn’t prepare the attachments");return}q();try{J().send(G.message,{applet:{source:G.source},preparedAttachments:V})}catch(D){U(D instanceof Error?D.message:"Something went wrong while sending this message")}}return{handle:z,dispose(){B=!0;for(let G of Q)G()}}}function Zn($){let Z=e1(),J=U1(),H=M4(),Q=Y5($);$n.useLayoutEffect(()=>{let B=aF0(Z,J,()=>Q.current,H?"browser-tab":"shared"),X=AY(Z).on("sendChatMessage",(z)=>{B.handle(z)});return()=>{X(),B.dispose()}},[Z,J,Q,H])}function Jn($,Z){let J=e1();DY(J,"addChatAttachment",(H)=>{ch({workspaceId:J,sessionId:$},H),Z()})}var c3=P(m(),1);var Qn=P(m(),1);var Hn=new Map;function oF0($){let Z=Hn.get($)??[];return Hn.delete($),Z}function nF0($,Z=[]){return[...oF0($),...Z]}function sF0($,Z){if(!$.startsWith("views/"))return;return Object.keys(Z).length>0?Z:void 0}function tF0($,Z,J){if($.startsWith("views/"))return Z?.find((H)=>H.id===$.slice(6))?.config.title||void 0;if($.startsWith("view-builders/"))return J?.find((H)=>H.id===$.slice(14))?.title||void 0;return}function Bn({activeTab:$,appletParams:Z}){let J=e1(),H=Jq(J).data,Q=Qq(J).data;return Qn.useCallback((B={})=>{let X=nF0(J,B.directives??[]),z=sF0($,Z);return{activeTab:$,tabTitle:tF0($,H,Q),...z?{tabParams:z}:{},...B.applet?{applet:B.applet}:{},...X.length>0?{directives:X}:{}}},[J,$,Z,H,Q])}function eF0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function Xn($){let Z=eF0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var $W0=qQ();function zn($){let Z=e1(),J=U1(),{layout:H}=i1(),[Q,B]=j6(),X=M4(),z=i9(Z).data,G=yY(Z).data,U=Boolean(Q)&&G!==void 0&&!G.some((T)=>T.sessionId===Q),K=U?null:Q??null;c3.useEffect(()=>{if(U)B(null)},[B,U]);let Y=Bn($),F=g2((T)=>K?T.activity[`${Z}:${K}`]??"idle":"idle"),W=hZ(F),q=g2((T)=>K?T.errors[`${Z}:${K}`]??null:null),N=hv(Z,K),{refetch:A}=N,V=c3.useCallback(()=>void A(),[A]),D=N.data??$W0,L=G!==void 0&&(K===null||N.data!==void 0),j=g2((T)=>NE(T.previews,Z,K).root),M=c3.useMemo(()=>Xn(j),[j]),_=xY(Z,K).data,E=c3.useCallback((T,I)=>{let y=T.trim(),S=iq(Z,K,I);if(!y&&S.length===0&&!I?.preparedAttachments?.attachments.length)return;let O=I?.preparedAttachments??dq(S),k=NY(O.attachments);if(k){K5.add({title:"Couldn’t send message",description:k,type:"error"});return}let b=K,h=!1;if(!b){if(b=crypto.randomUUID(),h=!0,!lq(I))w1.getState().renameSession(Z,K,b);B(b),aq({queryClient:J,workspaceId:Z,sessionId:b,text:y,filenames:S.map((o)=>o.label)})}let v=[...O.parts];if(y)v.push({type:"text",text:y});let f=rq({queryClient:J,workspaceId:Z,sessionId:b,parts:v}),w=_?.model??H.selectedModel,i=_?.effort??H.selectedEffort,r=_?.fastMode??H.selectedFastMode,{model:x,effort:l,fastMode:s,stream:p}=oq(z,w,i,r),{attachments:d}=O;if(WU({type:"chat",workspaceId:Z,content:y,sessionId:b,isNew:h,selectedSessionScope:X?"browser-tab":"shared",optimisticId:f,model:x,effort:l,fastMode:s,stream:p,context:Y(I),...d.length>0?{attachments:d}:{}}),w5.getState().markMessageSentFromMoi(Z),h)J.invalidateQueries({queryKey:S0.preview(Z)});if(lq(I))w1.getState().clearAttachments(Z,K)},[K,Z,J,H.selectedModel,H.selectedEffort,H.selectedFastMode,Y,_?.model,_?.effort,_?.fastMode,B,X,z]),C=c3.useCallback(()=>{if(!K)return;w1.getState().setError(Z,K,null)},[K,Z]),R=c3.useCallback(()=>{if(!W||!K)return;WU({type:"stop",workspaceId:Z,sessionId:K})},[W,K,Z]);return{view:D,chatLoaded:L,previewTurn:M,sessionId:K,processing:W,error:q,loadError:N.error?.message??null,retryLoad:V,send:E,stop:R,selectSession:B,dismissError:C}}var Un=P(m(),1);var c2=P(m(),1);function Gn({active:$,builderId:Z,sessionId:J,source:H,workspaceId:Q,onEditingStart:B,onContinueInChat:X}){let z=c2.useRef(`sketch:${Z}`),G=c2.useRef(0),U=c2.useRef(null),K=c2.useRef(null),Y=c2.useRef(!0),[F,W]=c2.useState(!1),q=Y5(B),N=Y5(X),A=c2.useCallback((C)=>{if(!Y.current)return;if(!C){G.current+=1,U.current=null,K.current=null,w1.getState().removeAttachment(Q,z.current);return}CB({workspaceId:Q,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:C})},[J,H,Q]),V=c2.useCallback((C)=>{if(!C)return K.current??Promise.resolve();if(C===U.current){if(w1.getState().attachments[J8(Q,J)]?.some((y)=>y.localId===z.current&&y.kind!=="text"&&(y.status==="ready"||y.status==="uploading")))return K.current??Promise.resolve()}U.current=C;let R=++G.current,T=EY({workspaceId:Q,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:C,isCurrent:()=>G.current===R});return K.current=T,T},[J,H,Q]),D=CY({mode:"sketch",onChange:A,onEditingStart:()=>q.current()}),{controls:L}=D,j=c2.useCallback(async()=>{await V(await L.flush())},[L,V]),M=c2.useCallback(async()=>{await V(await L.deactivate())},[L,V]),_=c2.useCallback(async()=>{if(F)return;W(!0);try{await M(),N.current()}finally{W(!1)}},[F,M,N]),E=c2.useCallback(async()=>{Y.current=!1,G.current+=1,U.current=null,K.current=null,w1.getState().removeAttachment(Q,z.current);try{await L.cancel()}finally{Y.current=!0}},[L,Q]);return c2.useEffect(()=>{if(!$&&L.active)M()},[$,L.active,M]),{...D,continuing:F,continueInChat:_,prepareForSend:j,resetDocument:E}}var S5=P(c(),1);function Kn({ref:$,active:Z,builder:J,chatDocked:H,workspaceId:Q,onEditingStart:B,onContinueInChat:X,onOpenChat:z,onDiscard:G}){let U=Gn({active:Z&&J.status==="draft",builderId:J.id,sessionId:J.sessionId,source:H$(J.id),workspaceId:Q,onEditingStart:B,onContinueInChat:X});switch(Un.useImperativeHandle($,()=>({prepareSketchForSend:U.prepareForSend,resetSketch:U.resetDocument}),[U.prepareForSend,U.resetDocument]),J.status){case"ready":return null;case"draft":case"waiting":case"building":return S5.jsx(ZW0,{active:Z,chatDocked:H,error:J.error,sketch:U,status:J.status,onDiscard:G,onOpenChat:z})}}function ZW0({active:$,chatDocked:Z,error:J,sketch:H,status:Q,onDiscard:B,onOpenChat:X}){let z=Q==="draft";return S5.jsxs("div",{className:B0("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[z&&S5.jsx(JW0,{chatDocked:Z,sketch:H}),S5.jsx("div",{inert:z?void 0:!0,className:B0("absolute inset-0",Q==="building"&&"pointer-events-none opacity-50",Q==="waiting"&&"invisible"),children:S5.jsx(OY,{...H.layerProps,children:z&&S5.jsx(wY,{controls:H.controls,title:"Sketch the view",busy:H.continuing,onComplete:()=>void H.continueInChat()})})}),S5.jsx("div",{"aria-hidden":!0,className:B0("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",Q==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),Q==="building"&&S5.jsx(QW0,{controls:H.controls}),Q==="waiting"&&S5.jsx(HW0,{error:J,onDiscard:B,onOpenChat:X})]})}function JW0({chatDocked:$,sketch:Z}){let{controls:J,targetRef:H}=Z,{hasStrokes:Q}=OB(J);return S5.jsx("div",{ref:H,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:!J.active&&!Q&&S5.jsxs("div",{className:B0("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:[S5.jsx(vJ,{size:56,stroke:0.5}),S5.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function HW0({error:$,onDiscard:Z,onOpenChat:J}){return S5.jsx(Yn,{children:S5.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:[S5.jsxs("div",{className:"flex flex-col gap-1",children:[S5.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),S5.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),S5.jsxs("div",{className:"flex gap-2",children:[S5.jsx(j0,{onClick:J,children:"Open chat"}),S5.jsx(j0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function QW0({controls:$}){let{hasStrokes:Z}=OB($);return S5.jsx(Yn,{children:!Z&&S5.jsx(H8,{className:"size-6 text-muted-foreground"})})}function Yn({children:$,className:Z}){return S5.jsx("div",{className:B0("relative flex min-h-0 flex-1 items-center justify-center texture-checker-20",Z),children:$})}var o4=P(m(),1);function Fn($,{activeId:Z,available:J,now:H}){let Q=[];if(Z!==null&&J.has(Z))Q.push({id:Z,releasedAt:null});for(let B of $){if(B.id===Z||!J.has(B.id))continue;let X=B.releasedAt??H;if(H-X>=60000)continue;if(Q.length>=4)break;Q.push({id:B.id,releasedAt:X})}return Q}function Wn($,Z){let J=null;for(let{releasedAt:H}of $){if(H===null)continue;let Q=H+60000;if(J===null||Q<J)J=Q}return J===null?null:Math.max(0,J-Z)}function qn($,Z){return $.length===Z.length&&$.every((J,H)=>{let Q=Z[H];return J.id===Q.id&&J.releasedAt===Q.releasedAt})}var D2=P(c(),1),Vn=o4.memo(function({views:Z,activeViewId:J,params:H}){let Q=BW0(J,Z),B=new Set(Q.map((X)=>X.id));return D2.jsx("div",{className:B0("relative min-h-0 flex-1 overflow-hidden",!J&&"hidden"),children:Z.filter((X)=>B.has(X.id)).map((X)=>D2.jsx(XW0,{view:X,active:X.id===J,params:H},X.id))})});function BW0($,Z){let[J,H]=o4.useState([]),Q=Y5(Z),B=Z.map((z)=>z.id).join(`
|
|
68
|
-
`),X=o4.useCallback(()=>{H((z)=>{let G=Fn(z,{activeId:$,available:new Set(Q.current.map((U)=>U.id)),now:Date.now()});return qn(z,G)?z:G})},[$,Q]);return o4.useEffect(()=>{X()},[B,X]),o4.useEffect(()=>{let z=Wn(J,Date.now());if(z===null)return;let G=setTimeout(X,z);return()=>clearTimeout(G)},[X,J]),J}function XW0({view:$,active:Z,params:J}){let H=e1(),Q=Ah($.id),{current:B,outgoing:X}=GW0(Q,Z),[z,G]=o4.useState(J);if(Z&&z!==J)G(J);zq(MY("views",H,$.id),B?.version??Q.version,Z);let U=Q.status==="error";return vW({kind:"view",enabled:Z&&Boolean(B)&&!U,targets:[{id:$.id,revision:$.revision}]}),D2.jsxs(D2.Fragment,{children:[Z&&U&&D2.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:Q.error}),Z&&!U&&!B&&D2.jsx(UW0,{}),B&&!U&&D2.jsxs(o4.Activity,{mode:Z?"visible":"hidden",children:[X&&D2.jsx(Nn,{view:$,build:X,params:z},X.version),D2.jsx(Nn,{view:$,build:B,params:z,entering:X!==null,current:!0},B.version)]})]})}function Nn({view:$,build:Z,params:J,entering:H,current:Q=!1}){let B=e1(),X=i6("views",$.id);return D2.jsx("div",{"data-applet-thumbnail":Q?X:void 0,"data-applet":X,className:B0("absolute inset-0 isolate",H&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:D2.jsx("div",{className:"size-full overflow-auto",children:D2.jsx(DX,{name:$.id,kind:"view",workspaceId:B,resetKey:Z.version,children:D2.jsx(DQ,{appletId:X,active:Q,children:D2.jsx(Z.Component,{params:J})})})})})}var zW0=200;function GW0($,Z){let[J,H]=o4.useState({current:null,outgoing:null});if($.status==="ready"&&J.current?.version!==$.version){let Q={Component:$.Component,version:$.version};H((B)=>({current:Q,outgoing:Z?B.current:null}))}return o4.useEffect(()=>{if(!J.outgoing)return;let Q=setTimeout(()=>H((B)=>({...B,outgoing:null})),zW0);return()=>clearTimeout(Q)},[J.outgoing]),J}function UW0(){return D2.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:D2.jsx(H8,{className:"text-muted-foreground"})})}function An(){let $=U1(),{workspaceId:Z,layout:J}=i1(),[,H]=j6(),Q=M4(),B=i9(Z).data,X=mi(Z),z=ui(Z),G=pi(Z),U=ci(Z);return{create:()=>X.mutateAsync(),save:(q,N)=>z.mutateAsync({builderId:q,requirements:N}),submit:async(q,N)=>{let A=N.trim(),V=iq(Z,q.sessionId);if(!A&&V.length===0)return;aq({queryClient:$,workspaceId:Z,sessionId:q.sessionId,text:A,filenames:V.map((R)=>R.label)});let D=dq(V),L=[...D.parts];if(A)L.push({type:"text",text:A});let j=rq({queryClient:$,workspaceId:Z,sessionId:q.sessionId,parts:L});H(q.sessionId);let{model:M,effort:_,fastMode:E,stream:C}=oq(B,J.selectedModel,J.selectedEffort,J.selectedFastMode);try{await G.mutateAsync({builderId:q.id,requirements:A,optimisticId:j,selectedSessionScope:Q?"browser-tab":"shared",...V.length>0?{attachments:D.attachments}:{},model:M,effort:_,fastMode:E,stream:C}),w1.getState().clearAttachments(Z,q.sessionId)}catch(R){throw w1.getState().setActivity(Z,q.sessionId,"idle"),w1.getState().setError(Z,q.sessionId,R instanceof Error?R.message:"Could not start view builder"),R}},discard:(q)=>U.mutateAsync(q)}}var j7=P(m(),1);function Dn({builders:$,onSave:Z}){let J=j7.useRef(new Map),H=Y5($),Q=Y5(Z),B=j7.useCallback((z)=>{let G=J.current.get(z);if(G)clearTimeout(G);J.current.delete(z),w5.getState().setViewBuilderDraft(z,null)},[]),X=j7.useCallback((z,G)=>{w5.getState().setViewBuilderDraft(z,G);let U=J.current.get(z);if(U)clearTimeout(U);J.current.set(z,setTimeout(()=>{J.current.delete(z);let K=H.current.find((Y)=>Y.id===z);if(!K||K.status!=="draft")return;Q.current(z,G).catch(()=>{K5.add({title:"Couldn’t save view description",type:"error"})})},500))},[H,Q]);return j7.useEffect(()=>{for(let z of $)if(z.status!=="draft")B(z.id)},[$,B]),j7.useEffect(()=>()=>{for(let z of J.current.values())clearTimeout(z)},[]),{change:X,clear:B}}var SH=P(m(),1);function Kj($){let Z=document.documentElement,J=getComputedStyle(Z).getPropertyValue($).trim(),H=Number.parseFloat(J);if(!Number.isFinite(H))return 0;return J.endsWith("rem")?H*Number.parseFloat(getComputedStyle(Z).fontSize):H}function Ln(){let $=SH.useRef(null),[Z,J]=SH.useState(null);return SH.useLayoutEffect(()=>{let H=$.current;if(!H)return;let Q=(X)=>{let z=Kj("--column-w"),G=Kj("--chat-min"),U=Kj("--chat-max"),K={fits:X-G>=z,workspaceMinWidth:z,chatMinWidth:G,chatMaxWidth:U};J((Y)=>Y?.fits===K.fits&&Y.workspaceMinWidth===K.workspaceMinWidth&&Y.chatMinWidth===K.chatMinWidth&&Y.chatMaxWidth===K.chatMaxWidth?Y:K)};Q(H.getBoundingClientRect().width);let B=()=>Q(H.getBoundingClientRect().width);return window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}function Mn($,Z){if(Z)return{status:"disconnected"};return $??{status:"checking"}}var Pn=P(c(),1);function Yj({agentUnavailable:$,chatError:Z,skillUpdate:J}){return $??Z??J}function O7({className:$,...Z}){return Pn.jsx("div",{...Z,className:B0("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var HZ=P(c(),1);function Fj({error:$,onDismiss:Z,onRetry:J}){return HZ.jsxs(O7,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[HZ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),J&&HZ.jsx(j0,{type:"button",variant:"ghost",size:"sm",onClick:J,children:"Retry"}),Z&&HZ.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:HZ.jsx(o5,{stroke:1.75})})]})}var Wj=P(m(),1);var I4=P(c(),1);function Cn({availability:$,login:Z,onStartLogin:J}){switch($.status){case"login-required":return I4.jsx(KW0,{login:Z,onStartLogin:J});case"disconnected":return I4.jsx(_n,{icon:Tn,children:"Reconnecting to moi…"});case"unavailable":return I4.jsx(_n,{icon:jn,children:$.reason})}}function KW0({login:$,onStartLogin:Z}){let[J,H]=Wj.useState(!1),[Q,B]=Wj.useState(null),X=$?.state==="failed"?$.reason:null,z=Q??X,G=async()=>{let U=window.open("about:blank","moi-agent-login");if(U)U.opener=null;H(!0),B(null);try{let K=await Z();if(K.url){if(!U)throw Error("Allow pop-ups, then try again");U.location.href=K.url}else U?.close()}catch(K){U?.close(),B(K instanceof Error?K.message:"Could not start sign-in")}finally{H(!1)}};return I4.jsxs(O7,{role:"alert",className:"flex items-center gap-2",children:[I4.jsx(On,{size:20,stroke:1.5}),I4.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[I4.jsx("div",{className:"wrap-break-word",children:"Log in to your agent to send messages"}),z&&I4.jsx("div",{className:"wrap-break-word text-destructive",children:z})]}),I4.jsxs(j0,{type:"button",size:"sm",onClick:()=>void G(),disabled:J,children:[J&&I4.jsx(k5,{stroke:1.75,className:"animate-spin"}),"Log in"]})]})}function _n({icon:$,children:Z}){return I4.jsxs(O7,{role:"alert",className:"flex items-center gap-2",children:[I4.jsx($,{size:20,stroke:1.5}),I4.jsx("div",{className:"min-w-0 flex-1 wrap-break-word",children:Z})]})}var d2=P(c(),1);function En({error:$,pendingAction:Z,onUpdate:J,onDismiss:H}){if(!$&&Z==="auto")return d2.jsxs(O7,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[d2.jsx(k5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),d2.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let Q=Z!==null;return d2.jsxs(O7,{role:$?"alert":"status",className:B0("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[d2.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[d2.jsx(wn,{size:20,stroke:1.5,className:"shrink-0"}),$?d2.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):d2.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),d2.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",onClick:H,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:d2.jsx(o5,{stroke:1.75})}),d2.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[d2.jsxs(j0,{type:"button",variant:"default",size:"sm",onClick:()=>J("auto"),disabled:Q,className:"@xl:order-2",children:[Z==="auto"&&d2.jsx(k5,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),d2.jsxs(j0,{type:"button",variant:"secondary",size:"sm",onClick:()=>J("once"),disabled:Q,className:"@xl:order-3",children:[Z==="once"&&d2.jsx(k5,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var T7=P(m(),1);function qj($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function YW0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function FW0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function Sn($){let Z=jh($),{isPending:J,mutate:H,reset:Q}=Oh($),B=ji(),{mutate:X}=Oi(),z=B.data!==void 0,G=B.data?.autoUpdateSkills??!1,U=T7.useCallback(()=>X({autoUpdateSkills:!0}),[X]),[K,Y]=T7.useState(()=>qj($)),F=K.workspaceId===$?K:qj($);T7.useEffect(()=>{Y(qj($)),Q()},[$,Q]);let W=T7.useCallback((A)=>{if(J)return;if(A==="auto")U();Y({workspaceId:$,phase:"active",pendingAction:A,error:null}),H(void 0,{onSuccess:()=>{Y((V)=>V.workspaceId===$?{...V,phase:"dismissed",pendingAction:null,error:null}:V)},onError:(V)=>{Y((D)=>D.workspaceId===$&&D.phase!=="dismissed"?{...D,phase:"active",pendingAction:null,error:V.message}:D)}})},[U,J,H,$]),q=Z.data?.updateAvailable??!1;return T7.useEffect(()=>{if(z&&FW0({updateAvailable:q,autoUpdateEnabled:G,updatePending:J,phase:F.phase}))W("auto")},[G,F.phase,W,z,q,J]),{bannerProps:z&&YW0({updateAvailable:q,autoUpdateEnabled:G,phase:F.phase})?{error:F.error,pendingAction:F.pendingAction,onUpdate:W,onDismiss:()=>{Y((A)=>A.workspaceId===$?{...A,phase:"dismissed",pendingAction:null,error:null}:A)}}:null}}var gX=P(c(),1);function Rn($,{chatError:Z,onDismissChatError:J,chatLoadError:H,onRetryChatLoad:Q}){let{data:B,error:X}=i9($),z=B?.availability,{bannerProps:G}=Sn($),U=Mn(z,Boolean(X)),K=U.status==="checking"||U.status==="available"?void 0:U,Y=K?{tone:"default",content:gX.jsx(Cn,{availability:K,login:B?.login,onStartLogin:()=>_h($)})}:void 0,F;if(H)F={tone:"error",content:gX.jsx(Fj,{error:H,onRetry:Q})};else if(Z)F={tone:"error",content:gX.jsx(Fj,{error:Z,onDismiss:J})};let W=G?{tone:"default",content:gX.jsx(En,{...G})}:void 0,q=Yj({agentUnavailable:Y,chatError:F,skillUpdate:W}),N=Yj({agentUnavailable:Y,skillUpdate:W});return{agentAvailability:U,composerBanner:q,builderComposerBanner:N}}var WW0=_Y();function fX($){return jY($)}function C7($,Z,J){if($==="agent"||$==="overview"||$==="scratchpad")return!0;let H=Q$($);if(H)return J.some((B)=>B.id===H);let Q=VQ($);return Q?Z.some((B)=>B.id===Q):!1}function mX($,Z,J){let H=$.open.filter((Q)=>C7(Q,Z,J));return H.length>0?H:WW0.open}function In($,Z,J,H,Q){if($!==null&&!(Q&&$==="agent"))return $;let B=mX(Z,J,H),X=Q?B.filter((z)=>z!=="agent"):B;return X.includes(Z.active)?Z.active:X[0]??"overview"}var F8=P(m(),1);var nq=P(m(),1);var bn=($)=>`moi:collab:${$}:tabs`;function qW0($,Z){try{let J=sessionStorage.getItem(bn($));return J?jY(JSON.parse(J)):Z}catch{return Z}}function NW0($,Z){try{sessionStorage.setItem(bn($),JSON.stringify(Z))}catch{}}function kn($,Z,J){let[H,Q]=nq.useState(()=>Z?qW0($,J):J),B=nq.useCallback((X)=>{Q(X),NW0($,X)},[$]);return[Z?H:J,B]}var yn=new Map;function hn({views:$,builders:Z,split:J}){let{layout:H,setLayout:Q,workspaceId:B}=i1(),X=M4(),[,z]=q8(),G=i2(),{base:U}=G,K=k7(G).slice(o8(B,U).length+1),Y=AQ(Xz(G)),F=F8.useMemo(()=>LE(Y),[Y]),[W,q]=kn(B,X,fX(H.tabs)),N=fX(W),A=Y5(N),V=F8.useMemo(()=>{let S=yn.get(B);if(!S)yn.set(B,S=new Map);return S},[B]),D=_3(K),L=D?null:IG(K),j=In(D??L,N,$,Z,J),M=Boolean(K)&&!L&&(!D||!C7(D,$,Z)),_=D===j&&!M,E=F8.useCallback((S)=>{if(A.current=S,X)q(S);else Q({tabs:S})},[Q,A,X,q]),C=F8.useCallback((S,O={})=>{let k=window.location.pathname+AQ(window.location.search),b=`${U}${S}`;if(k!==b||window.location.hash)z(S,O)},[U,z]),R=F8.useCallback((S,O={})=>{C(V.get(S)??gZ(B,{tab:S,search:""}),O)},[C,V,B]),T=F8.useCallback((S)=>{let O=B$(S,{apiBase:`/api/workspaces/${encodeURIComponent(B)}`,workspacePath:o8(B)});if(S.startsWith("moi:/files/")||!S.startsWith("moi:")){window.location.assign(O);return}let k=aV(S);if(!C7(k.tab,$,Z))throw Error("This destination is unavailable in this workspace");C(O)},[Z,C,$,B]),I=F8.useCallback((S)=>{let O=S instanceof Error?S.message:"Navigation failed";K5.add({type:"error",title:"Could not navigate",description:O}),Z8(B,{source:"runtime",message:O})},[B]);DY(B,"navigate",(S)=>{try{T(S)}catch(O){I(O)}}),xn(B,T),F8.useEffect(()=>{if(M)return;if(L)C(gZ(B,{tab:L,search:Y}),{replace:!0});else if(!K||D==="agent"&&J)R(j,{replace:!0})},[j,C,L,R,K,D,Y,J,M,B]),F8.useEffect(()=>{if(!_)return;V.set(j,gZ(B,{tab:j,search:Y}));let S=A.current,O=S.open.includes(j)?S.open:[...S.open,j];if(O!==S.open||S.active!==j)E({open:O,active:j})},[j,_,V,Y,E,A,B]);let y=F8.useCallback((S)=>{if(S.defaultPrevented||S.button!==0||S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;let O=S.target instanceof Element?S.target.closest("a[href]"):null;if(!(O instanceof HTMLAnchorElement)||O.hasAttribute("download")||O.target&&O.target!=="_self")return;let k=new URL(O.href),b=o8(B,U)+"/";if(k.origin!==window.location.origin||!k.pathname.startsWith(b))return;if(k.hash)return;let h=_3(k.pathname.slice(b.length));if(!h)return;S.preventDefault();try{if(!C7(h,$,Z))throw Error("This destination is unavailable in this workspace");C(gZ(B,{tab:h,search:AQ(k.search)}))}catch(v){I(v)}},[U,Z,C,I,$,B]);return{tabsState:N,activeTab:j,appletParams:F,navigateToTab:R,setTabs:E,isUnavailable:M,onNavigationClick:y}}var x5=P(c(),1),VW0=JJ([V$({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 AW0({items:$}){return x5.jsxs(o9,{children:[x5.jsx(n9,{render:x5.jsx(j0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:x5.jsx(f2,{stroke:1.75})})}),x5.jsx(s9,{align:"start",className:"min-w-48",children:x5.jsx(J7,{children:$.map((Z)=>x5.jsxs(H9,{onClick:Z.onClick,className:"font-medium",children:[x5.jsx(Z.Icon,{stroke:2}),Z.label]},Z.key))})})]})}function vn($){let{tab:Z,active:J}=$,H=$.preview===!0;return x5.jsxs("button",{type:"button","aria-hidden":H||void 0,"aria-label":Z.label,disabled:H,tabIndex:H?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:VW0({active:J,dragging:$.preview?!1:$.state.isDragging,preview:H}),...$.preview?{}:$.state.dragHandleProps,children:[x5.jsxs("div",{className:B0("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.loading?x5.jsx(H8,{"data-icon":"inline-start",className:"shrink-0"}):x5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2,className:"size-4 shrink-0"}),x5.jsx("span",{className:B0("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&&x5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:H?-1:void 0,className:B0("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",H&&"pointer-events-none"),onClick:$.preview?void 0:(Q)=>{Q.stopPropagation(),$.onClose(Z.key)},children:x5.jsx(o5,{stroke:1.75,className:"size-4 shrink-0"})})]})}function gn({tabs:$,active:Z,createItems:J,onSelect:H,onClose:Q,onReorder:B}){return x5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[x5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:x5.jsx(oK,{items:$,getId:(X)=>X.key,isItemDragDisabled:(X)=>X.reorderable===!1,className:"flex w-max items-center gap-1",onReorder:(X)=>B(X),renderPlaceholder:()=>x5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(X)=>x5.jsx(vn,{tab:X,active:Z===X.key,preview:!0}),renderItem:(X,z)=>x5.jsx(vn,{tab:X,active:Z===X.key,state:z,onSelect:H,onClose:Q})})}),x5.jsx("div",{className:"shrink-0",children:x5.jsx(AW0,{items:J})})]})}var R7=P(m(),1);var yH=P(c(),1),b1=P(m(),1);function DW0($,Z){let J=getComputedStyle($),H=parseFloat(J.fontSize);return Z*H}function LW0($,Z){let J=getComputedStyle($.ownerDocument.documentElement),H=parseFloat(J.fontSize);return Z*H}function MW0($){return $/100*window.innerHeight}function PW0($){return $/100*window.innerWidth}function _W0($){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 uX({groupSize:$,panelElement:Z,styleProp:J}){let H,[Q,B]=_W0(J);switch(B){case"%":{H=Q/100*$;break}case"px":{H=Q;break}case"rem":{H=LW0(Z,Q);break}case"em":{H=DW0(Z,Q);break}case"vh":{H=MW0(Q);break}case"vw":{H=PW0(Q);break}}return H}function b4($){return parseFloat($.toFixed(3))}function xH({group:$}){let{orientation:Z,panels:J}=$;return J.reduce((H,Q)=>(H+=Z==="horizontal"?Q.element.offsetWidth:Q.element.offsetHeight,H),0)}function Vj($){let{panels:Z}=$,J=xH({group:$});return J===0?Z.map((H)=>({groupResizeBehavior:H.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:H.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:H.panelConstraints.disabled,minSize:0,maxSize:100,panelId:H.id})):Z.map((H)=>{let{element:Q,panelConstraints:B}=H,X=0;if(B.collapsedSize!==void 0){let K=uX({groupSize:J,panelElement:Q,styleProp:B.collapsedSize});X=b4(K/J*100)}let z;if(B.defaultSize!==void 0){let K=uX({groupSize:J,panelElement:Q,styleProp:B.defaultSize});z=b4(K/J*100)}let G=0;if(B.minSize!==void 0){let K=uX({groupSize:J,panelElement:Q,styleProp:B.minSize});G=b4(K/J*100)}let U=100;if(B.maxSize!==void 0){let K=uX({groupSize:J,panelElement:Q,styleProp:B.maxSize});U=b4(K/J*100)}return{groupResizeBehavior:B.groupResizeBehavior,collapsedSize:X,collapsible:B.collapsible===!0,defaultSize:z,disabled:B.disabled,minSize:G,maxSize:U,panelId:H.id}})}function j5($,Z="Assertion error"){if(!$)throw Error(Z)}function Aj($,Z){return Array.from(Z).sort($==="horizontal"?jW0:OW0)}function jW0($,Z){let J=$.element.offsetLeft-Z.element.offsetLeft;return J!==0?J:$.element.offsetWidth-Z.element.offsetWidth}function OW0($,Z){let J=$.element.offsetTop-Z.element.offsetTop;return J!==0?J:$.element.offsetHeight-Z.element.offsetHeight}function Hs($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function Qs($,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 TW0({orientation:$,rects:Z,targetRect:J}){let H={x:J.x+J.width/2,y:J.y+J.height/2},Q,B=Number.MAX_VALUE;for(let X of Z){let{x:z,y:G}=Qs(H,X),U=$==="horizontal"?z:G;U<B&&(B=U,Q=X)}return j5(Q,"No rect found"),Q}var sq;function CW0(){return sq===void 0&&(typeof matchMedia=="function"?sq=!!matchMedia("(pointer:coarse)").matches:sq=!1),sq}function Bs($){let{element:Z,orientation:J,panels:H,separators:Q}=$,B=Aj(J,Array.from(Z.children).filter(Hs).map((q)=>({element:q}))).map(({element:q})=>q),X=[],z=!1,G=!1,U=-1,K=-1,Y=0,F,W=[];{let q=-1;for(let N of B)N.hasAttribute("data-panel")&&(q++,N.hasAttribute("data-disabled")||(Y++,U===-1&&(U=q),K=q))}if(Y>1){let q=-1;for(let N of B)if(N.hasAttribute("data-panel")){q++;let A=H.find((V)=>V.element===N);if(A){if(F){let V=F.element.getBoundingClientRect(),D=N.getBoundingClientRect(),L;if(G){let j=J==="horizontal"?new DOMRect(V.right,V.top,0,V.height):new DOMRect(V.left,V.bottom,V.width,0),M=J==="horizontal"?new DOMRect(D.left,D.top,0,D.height):new DOMRect(D.left,D.top,D.width,0);switch(W.length){case 0:{L=[j,M];break}case 1:{let _=W[0],E=TW0({orientation:J,rects:[V,D],targetRect:_.element.getBoundingClientRect()});L=[_,E===V?M:j];break}default:{L=W;break}}}else W.length?L=W:L=[J==="horizontal"?new DOMRect(V.right,D.top,D.left-V.right,D.height):new DOMRect(D.left,V.bottom,D.width,D.top-V.bottom)];for(let j of L){let M="width"in j?j:j.element.getBoundingClientRect(),_=CW0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(M.width<_){let C=_-M.width;M=new DOMRect(M.x-C/2,M.y,M.width+C,M.height)}if(M.height<_){let C=_-M.height;M=new DOMRect(M.x,M.y-C/2,M.width,M.height+C)}let E=q<=U||q>K;!z&&!E&&X.push({group:$,groupSize:xH({group:$}),panels:[F,A],separator:"width"in j?void 0:j,rect:M}),z=!1}}G=!1,F=A,W=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(z=!0);let A=Q.find((V)=>V.element===N);A?W.push(A):(F=void 0,W=[])}else G=!0}return X}class Dj{#$={};addListener($,Z){let J=this.#$[$];return J===void 0?this.#$[$]=[Z]:J.includes(Z)||J.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let J=this.#$[$];if(J!==void 0)if(J.length===1)J[0].call(null,Z);else{let H=!1,Q=null,B=Array.from(J);for(let X=0;X<B.length;X++){let z=B[X];try{z.call(null,Z)}catch(G){Q===null&&(H=!0,Q=G)}}if(H)throw Q}}removeAllListeners(){this.#$={}}removeListener($,Z){let J=this.#$[$];if(J!==void 0){let H=J.indexOf(Z);H>=0&&J.splice(H,1)}}}var bH={cursorFlags:0,state:"inactive"},Lj=new Dj;function BZ(){return bH}function wW0($){return Lj.addListener("change",$)}function EW0($){let Z=bH,J={...bH};J.cursorFlags=$,bH=J,Lj.emit("change",{prev:Z,next:J})}function kH($){let Z=bH;bH=$,Lj.emit("change",{prev:Z,next:$})}var SW0=($)=>$,Nj=()=>{},Xs=1,zs=2,Gs=4,Us=8,fn=3,mn=12,tq;function un(){return tq===void 0&&(tq=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(tq=!0)),tq}function RW0({cursorFlags:$,groups:Z,state:J}){let H=0,Q=0;switch(J){case"active":case"hover":Z.forEach((B)=>{if(!B.mutableState.disableCursor)switch(B.orientation){case"horizontal":{H++;break}case"vertical":{Q++;break}}})}if(!(H===0&&Q===0)){switch(J){case"active":{if($&&un()){let B=($&Xs)!==0,X=($&zs)!==0,z=($&Gs)!==0,G=($&Us)!==0;if(B)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 un()?H>0&&Q>0?"move":H>0?"ew-resize":"ns-resize":H>0&&Q>0?"grab":H>0?"col-resize":"row-resize"}}var pn=new WeakMap;function Mj($){if(!$.defaultView||!$.adoptedStyleSheets)return;let{prevStyle:Z,styleSheet:J}=pn.get($)??{};J===void 0&&(J=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(J):$.adoptedStyleSheets=[...$.adoptedStyleSheets,J]));let H=BZ();switch(H.state){case"active":case"hover":{let Q=RW0({cursorFlags:H.cursorFlags,groups:H.hitRegions.map((X)=>X.group),state:H.state}),B=`*, *:hover {cursor: ${Q} !important; }`;if(Z===B)return;Z=B,Q?J.cssRules.length===0?J.insertRule(B):J.replaceSync(B):J.cssRules.length===1&&J.deleteRule(0);break}case"inactive":{Z=void 0,J.cssRules.length===1&&J.deleteRule(0);break}}pn.set($,{prevStyle:Z,styleSheet:J})}var G3=new Map,Ks=new Dj;function IW0($){G3=new Map(G3),G3.delete($)}function cn($,Z){for(let[J]of G3)if(J.id===$)return J}function w7($,Z){for(let[J,H]of G3)if(J.id===$)return H;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function E7(){return G3}function Pj($,Z){return Ks.addListener("groupChange",(J)=>{J.group.id===$&&Z(J)})}function d3($,Z,J){let H=G3.get($);G3=new Map(G3),G3.set($,Z),Ks.emit("groupChange",{group:$,isUserInteraction:J?.isUserInteraction===!0,prev:H,next:Z})}function Ys($){let Z=BZ(),J=E7(),H=!1;switch(Z.state){case"active":kH({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(Mj($),H=!0,Z.hitRegions.forEach((Q)=>{if(!J.has(Q.group))return;let B=w7(Q.group.id,!0);d3(Q.group,B,{isUserInteraction:!0})}))}return H}function dn($){$.defaultPrevented||Ys($.currentTarget)}function bW0($,Z,J){let H,Q={x:1/0,y:1/0};for(let B of Z){let X=Qs(J,B.rect);switch($){case"horizontal":{X.x<=Q.x&&(H=B,Q=X);break}case"vertical":{X.y<=Q.y&&(H=B,Q=X);break}}}return H?{distance:Q,hitRegion:H}:void 0}function kW0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function yW0($,Z){if($===Z)throw Error("Cannot compare node with itself");let J={a:an($),b:an(Z)},H;for(;J.a.at(-1)===J.b.at(-1);)H=J.a.pop(),J.b.pop();j5(H,"Stacking order can only be calculated for elements with a common ancestor");let Q={a:rn(ln(J.a)),b:rn(ln(J.b))};if(Q.a===Q.b){let B=H.childNodes,X={a:J.a.at(-1),b:J.b.at(-1)},z=B.length;for(;z--;){let G=B[z];if(G===X.a)return 1;if(G===X.b)return-1}}return Math.sign(Q.a-Q.b)}var xW0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function hW0($){let Z=getComputedStyle(Fs($)??$).display;return Z==="flex"||Z==="inline-flex"}function vW0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||hW0($))||+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"||xW0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function ln($){let Z=$.length;for(;Z--;){let J=$[Z];if(j5(J,"Missing node"),vW0(J))return J}return null}function rn($){return $&&Number(getComputedStyle($).zIndex)||0}function an($){let Z=[];for(;$;)Z.push($),$=Fs($);return Z}function Fs($){let{parentNode:Z}=$;return kW0(Z)?Z.host:Z}function gW0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function fW0({groupElement:$,hitRegion:Z,pointerEventTarget:J}){if(!Hs(J)||J.contains($)||$.contains(J))return!0;if(yW0(J,$)>0){let H=J;for(;H;){if(H.contains($))return!0;if(gW0(H.getBoundingClientRect(),Z))return!1;H=H.parentElement}}return!0}function _j($,Z){let J=[];return Z.forEach((H,Q)=>{if(Q.disabled)return;let B=Bs(Q),X=bW0(Q.orientation,B,{x:$.clientX,y:$.clientY});X&&X.distance.x<=0&&X.distance.y<=0&&fW0({groupElement:Q.element,hitRegion:X.hitRegion.rect,pointerEventTarget:$.target})&&J.push(X.hitRegion)}),J}function mW0($,Z){if($.length!==Z.length)return!1;for(let J=0;J<$.length;J++)if($[J]!=Z[J])return!1;return!0}function q4($,Z,J=0){return Math.abs(b4($)-b4(Z))<=J}function z3($,Z){return q4($,Z)?0:$>Z?1:-1}function IH({overrideDisabledPanels:$,panelConstraints:Z,prevSize:J,size:H}){let{collapsedSize:Q=0,collapsible:B,disabled:X,maxSize:z=100,minSize:G=0}=Z;if(X&&!$)return J;if(z3(H,G)<0)if(B){let U=(Q+G)/2;z3(H,U)<0?H=Q:H=G}else H=G;return H=Math.min(z,H),H=b4(H),H}function cX({delta:$,initialLayout:Z,panelConstraints:J,pivotIndices:H,prevLayout:Q,trigger:B}){if(q4($,0))return Z;let X=B==="imperative-api",z=Object.values(Z),G=Object.values(Q),U=[...z],[K,Y]=H;j5(K!=null,"Invalid first pivot index"),j5(Y!=null,"Invalid second pivot index");let F=0;switch(B){case"keyboard":{{let N=$<0?Y:K,A=J[N];j5(A,`Panel constraints not found for index ${N}`);let{collapsedSize:V=0,collapsible:D,minSize:L=0}=A;if(D){let j=z[N];if(j5(j!=null,`Previous layout not found for panel index ${N}`),q4(j,V)){let M=L-j;z3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}{let N=$<0?K:Y,A=J[N];j5(A,`No panel constraints found for index ${N}`);let{collapsedSize:V=0,collapsible:D,minSize:L=0}=A;if(D){let j=z[N];if(j5(j!=null,`Previous layout not found for panel index ${N}`),q4(j,L)){let M=j-V;z3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}break}default:{let N=$<0?Y:K,A=J[N];j5(A,`Panel constraints not found for index ${N}`);let V=z[N],{collapsible:D,collapsedSize:L,minSize:j}=A;if(D&&z3(V,j)<0)if($>0){let M=j-L,_=M/2,E=V+$;z3(E,j)<0&&($=z3($,_)<=0?0:M)}else{let M=j-L,_=100-M/2,E=V-$;z3(E,j)<0&&($=z3(100+$,_)>0?0:-M)}break}}{let N=$<0?1:-1,A=$<0?Y:K,V=0;for(;;){let L=z[A];j5(L!=null,`Previous layout not found for panel index ${A}`);let j=IH({overrideDisabledPanels:X,panelConstraints:J[A],prevSize:L,size:100})-L;if(V+=j,A+=N,A<0||A>=J.length)break}let D=Math.min(Math.abs($),Math.abs(V));$=$<0?0-D:D}{let N=$<0?K:Y;for(;N>=0&&N<J.length;){let A=Math.abs($)-Math.abs(F),V=z[N];j5(V!=null,`Previous layout not found for panel index ${N}`);let D=V-A,L=IH({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:V,size:D});if(!q4(V,L)&&(F+=V-L,U[N]=L,F.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?N--:N++}}if(mW0(G,U))return Q;{let N=$<0?Y:K,A=z[N];j5(A!=null,`Previous layout not found for panel index ${N}`);let V=A+F,D=IH({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:A,size:V});if(U[N]=D,!q4(D,V)){let L=V-D,j=$<0?Y:K;for(;j>=0&&j<J.length;){let M=U[j];j5(M!=null,`Previous layout not found for panel index ${j}`);let _=M+L,E=IH({overrideDisabledPanels:X,panelConstraints:J[j],prevSize:M,size:_});if(q4(M,E)||(L-=E-M,U[j]=E),q4(L,0))break;$>0?j--:j++}}}let W=Object.values(U).reduce((N,A)=>A+N,0);if(!q4(W,100,0.1))return Q;let q=Object.keys(Q);return U.reduce((N,A,V)=>(N[q[V]]=A,N),{})}function XZ($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if(Z[J]===void 0||z3($[J],Z[J])!==0)return!1;return!0}function zZ({layout:$,panelConstraints:Z}){let J=Object.values($),H=[...J],Q=H.reduce((z,G)=>z+G,0);if(H.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${H.map((z)=>`${z}%`).join(", ")}`);if(!q4(Q,100)&&H.length>0)for(let z=0;z<Z.length;z++){let G=H[z];j5(G!=null,`No layout data found for index ${z}`);let U=100/Q*G;H[z]=U}let B=0;for(let z=0;z<Z.length;z++){let G=J[z];j5(G!=null,`No layout data found for index ${z}`);let U=H[z];j5(U!=null,`No layout data found for index ${z}`);let K=IH({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:U});U!=K&&(B+=U-K,H[z]=K)}if(!q4(B,0))for(let z=0;z<Z.length;z++){let G=H[z];j5(G!=null,`No layout data found for index ${z}`);let U=G+B,K=IH({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:U});if(G!==K&&(B-=K-G,H[z]=K,q4(B,0)))break}let X=Object.keys($);return H.reduce((z,G,U)=>(z[X[U]]=G,z),{})}function Ws({groupId:$,panelId:Z}){let J=()=>{let G=E7();for(let[U,{defaultLayoutDeferred:K,derivedPanelConstraints:Y,layout:F,groupSize:W,separatorToPanels:q}]of G)if(U.id===$)return{defaultLayoutDeferred:K,derivedPanelConstraints:Y,group:U,groupSize:W,layout:F,separatorToPanels:q};throw Error(`Group ${$} not found`)},H=()=>{let G=J().derivedPanelConstraints.find((U)=>U.panelId===Z);if(G!==void 0)return G;throw Error(`Panel constraints not found for Panel ${Z}`)},Q=()=>{let G=J().group.panels.find((U)=>U.id===Z);if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},B=()=>{let G=J().layout[Z];if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},X=({nextSize:G,panels:U,prevLayout:K,derivedPanelConstraints:Y})=>{let F=B(),W=U.findIndex((A)=>A.id===Z),q=W===0,N=W===U.length-1;if(N&&G<F&&(q||U.slice(0,W).every((A,V)=>{let D=Y[V];return D?.collapsible&&q4(D.collapsedSize,K[D.panelId])}))){let A=U.slice(0,W).reduce((V,D)=>V+K[D.id],0);return{...K,[Z]:b4(100-A)}}return cX({delta:N?F-G:G-F,initialLayout:K,panelConstraints:Y,pivotIndices:N?[W-1,W]:[W,W+1],prevLayout:K,trigger:"imperative-api"})},z=(G)=>{let U=B();if(G===U)return;let{defaultLayoutDeferred:K,derivedPanelConstraints:Y,group:F,groupSize:W,layout:q,separatorToPanels:N}=J(),A=X({nextSize:G,panels:F.panels,prevLayout:q,derivedPanelConstraints:Y}),V=zZ({layout:A,panelConstraints:Y});XZ(q,V)||d3(F,{defaultLayoutDeferred:K,derivedPanelConstraints:Y,groupSize:W,layout:V,separatorToPanels:N})};return{collapse:()=>{let{collapsible:G,collapsedSize:U}=H(),{mutableValues:K}=Q(),Y=B();G&&Y!==U&&(K.expandToSize=Y,z(U))},expand:()=>{let{collapsible:G,collapsedSize:U,minSize:K}=H(),{mutableValues:Y}=Q(),F=B();if(G&&F===U){let W=Y.expandToSize??K;W===0&&(W=1),z(W)}},getSize:()=>{let{group:G}=J(),U=B(),{element:K}=Q(),Y=G.orientation==="horizontal"?K.offsetWidth:K.offsetHeight;return{asPercentage:U,inPixels:Y}},isCollapsed:()=>{let{collapsible:G,collapsedSize:U}=H(),K=B();return G&&q4(U,K)},resize:(G)=>{let{group:U}=J(),{element:K}=Q(),Y=xH({group:U}),F=uX({groupSize:Y,panelElement:K,styleProp:G}),W=b4(F/Y*100);z(W)}}}function on($){if($.defaultPrevented)return;let Z=E7();_j($,Z).forEach((J)=>{if(J.separator&&!J.separator.disableDoubleClick){let H=J.panels.find((Q)=>Q.panelConstraints.defaultSize!==void 0);if(H){let Q=H.panelConstraints.defaultSize,B=Ws({groupId:J.group.id,panelId:H.id});B&&Q!==void 0&&(B.resize(Q),$.preventDefault())}}})}function eq($){let Z=E7();for(let[J]of Z)if(J.separators.some((H)=>H.element===$))return J;throw Error("Could not find parent Group for separator element")}function qs({groupId:$}){let Z=()=>{let J=E7();for(let[H,Q]of J)if(H.id===$)return{group:H,...Q};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:J,layout:H}=Z();return J?{}:H},setLayout(J){let{defaultLayoutDeferred:H,derivedPanelConstraints:Q,group:B,groupSize:X,layout:z,separatorToPanels:G}=Z(),U=zZ({layout:J,panelConstraints:Q});return H?z:(XZ(z,U)||d3(B,{defaultLayoutDeferred:H,derivedPanelConstraints:Q,groupSize:X,layout:U,separatorToPanels:G}),U)}}}function QZ($,Z){let J=eq($),H=w7(J.id,!0),Q=J.separators.find((K)=>K.element===$);j5(Q,"Matching separator not found");let B=H.separatorToPanels.get(Q);j5(B,"Matching panels not found");let X=B.map((K)=>J.panels.indexOf(K)),z=qs({groupId:J.id}).getLayout(),G=cX({delta:Z,initialLayout:z,panelConstraints:H.derivedPanelConstraints,pivotIndices:X,prevLayout:z,trigger:"keyboard"}),U=zZ({layout:G,panelConstraints:H.derivedPanelConstraints});XZ(z,U)||d3(J,{defaultLayoutDeferred:H.defaultLayoutDeferred,derivedPanelConstraints:H.derivedPanelConstraints,groupSize:H.groupSize,layout:U,separatorToPanels:H.separatorToPanels},{isUserInteraction:!0})}function nn($){if($.defaultPrevented)return;let Z=$.currentTarget,J=eq(Z);if(!J.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),J.orientation==="vertical"&&QZ(Z,5);break}case"ArrowLeft":{$.preventDefault(),J.orientation==="horizontal"&&QZ(Z,-5);break}case"ArrowRight":{$.preventDefault(),J.orientation==="horizontal"&&QZ(Z,5);break}case"ArrowUp":{$.preventDefault(),J.orientation==="vertical"&&QZ(Z,-5);break}case"End":{$.preventDefault(),QZ(Z,100);break}case"Enter":{$.preventDefault();let H=eq(Z),Q=w7(H.id,!0),{derivedPanelConstraints:B,layout:X,separatorToPanels:z}=Q,G=H.separators.find((F)=>F.element===Z);j5(G,"Matching separator not found");let U=z.get(G);j5(U,"Matching panels not found");let K=U[0],Y=B.find((F)=>F.panelId===K.id);if(j5(Y,"Panel metadata not found"),Y.collapsible){let F=X[K.id],W=Y.collapsedSize===F?H.mutableState.expandedPanelSizes[K.id]??Y.minSize:Y.collapsedSize;QZ(Z,W-F)}break}case"F6":{$.preventDefault();let H=eq(Z).separators.map((X)=>X.element),Q=Array.from(H).findIndex((X)=>X===$.currentTarget);j5(Q!==null,"Index not found");let B=$.shiftKey?Q>0?Q-1:H.length-1:Q+1<H.length?Q+1:0;H[B].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),QZ(Z,-100);break}}}function sn($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=E7(),J=_j($,Z),H=new Map,Q=!1;J.forEach((B)=>{B.separator&&(Q||(Q=!0,B.separator.element.focus({focusVisible:!1,preventScroll:!0})));let X=Z.get(B.group);X&&H.set(B.group,X.layout)}),kH({cursorFlags:0,hitRegions:J,initialLayoutMap:H,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),J.length&&$.preventDefault()}function Ns({document:$,event:Z,hitRegions:J,initialLayoutMap:H,mountedGroups:Q,pointerDownAtPoint:B,prevCursorFlags:X}){let z=0;J.forEach((U)=>{let{group:K,groupSize:Y}=U,{orientation:F,panels:W}=K,{disableCursor:q}=K.mutableState,N=0;B?F==="horizontal"?N=(Z.clientX-B.x)/Y*100:N=(Z.clientY-B.y)/Y*100:F==="horizontal"?N=Z.clientX<0?-100:100:N=Z.clientY<0?-100:100;let A=H.get(K),V=Q.get(K);if(!A||!V)return;let{defaultLayoutDeferred:D,derivedPanelConstraints:L,groupSize:j,layout:M,separatorToPanels:_}=V;if(L&&M&&_){let E=cX({delta:N,initialLayout:A,panelConstraints:L,pivotIndices:U.panels.map((C)=>W.indexOf(C)),prevLayout:M,trigger:"mouse-or-touch"});if(XZ(E,M)){if(N!==0&&!q)switch(F){case"horizontal":{z|=N<0?Xs:zs;break}case"vertical":{z|=N<0?Gs:Us;break}}}else d3(U.group,{defaultLayoutDeferred:D,derivedPanelConstraints:L,groupSize:j,layout:E,separatorToPanels:_})}});let G=0;Z.movementX===0?G|=X&fn:G|=z&fn,Z.movementY===0?G|=X&mn:G|=z&mn,EW0(G),Mj($)}function tn($){let Z=E7(),J=BZ();switch(J.state){case"active":Ns({document:$.currentTarget,event:$,hitRegions:J.hitRegions,initialLayoutMap:J.initialLayoutMap,mountedGroups:Z,prevCursorFlags:J.cursorFlags})}}function en($){if($.defaultPrevented)return;let Z=BZ(),J=E7();switch(Z.state){case"active":{if($.buttons===0){kH({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((H)=>{if(!J.has(H.group))return;let Q=w7(H.group.id,!0);d3(H.group,Q,{isUserInteraction:!0})});return}for(let H of Z.hitRegions)if(H.separator){let{element:Q}=H.separator;Q.isConnected&&!Q.hasPointerCapture?.($.pointerId)&&Q.setPointerCapture?.($.pointerId)}Ns({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:J,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let H=_j($,J);H.length===0?Z.state!=="inactive"&&kH({cursorFlags:0,state:"inactive"}):kH({cursorFlags:0,hitRegions:H,state:"hover"}),Mj($.currentTarget);break}}}function $s($){if($.relatedTarget instanceof HTMLIFrameElement)switch(BZ().state){case"hover":kH({cursorFlags:0,state:"inactive"})}}function Zs($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;Ys($.currentTarget)&&$.preventDefault()}function Js($){let Z=0,J=0,H={};for(let B of $)if(B.defaultSize!==void 0){Z++;let X=b4(B.defaultSize);J+=X,H[B.panelId]=X}else H[B.panelId]=void 0;let Q=$.length-Z;if(Q!==0){let B=b4((100-J)/Q);for(let X of $)X.defaultSize===void 0&&(H[X.panelId]=B)}return H}function uW0($,Z,J){if(!J[0])return;let H=$.panels.find((G)=>G.element===Z);if(!H||!H.onResize)return;let Q=xH({group:$}),B=$.orientation==="horizontal"?H.element.offsetWidth:H.element.offsetHeight,X=H.mutableValues.prevSize,z={asPercentage:b4(B/Q*100),inPixels:B};H.mutableValues.prevSize=z,H.onResize(z,H.id,X)}function pW0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function cW0($,Z){return $.length!==Z.length?!1:$.every((J,H)=>pW0(J,Z[H]))}function dW0({group:$,nextGroupSize:Z,prevGroupSize:J,prevLayout:H}){if(J<=0||Z<=0||J===Z)return H;let Q=0,B=0,X=!1,z=new Map,G=[];for(let Y of $.panels){let F=H[Y.id]??0;switch(Y.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{X=!0;let W=F/100*J,q=b4(W/Z*100);z.set(Y.id,q),Q+=q;break}case"preserve-relative-size":default:{G.push(Y.id),B+=F;break}}}if(!X||G.length===0)return H;let U=100-Q,K={...H};if(z.forEach((Y,F)=>{K[F]=Y}),B>0)for(let Y of G){let F=H[Y]??0;K[Y]=b4(F/B*U)}else{let Y=b4(U/G.length);for(let F of G)K[F]=Y}return K}function lW0($,Z){let J=$.map((Q)=>Q.id),H=Object.keys(Z);if(J.length!==H.length)return!1;for(let Q of J)if(!H.includes(Q))return!1;return!0}var RH=new Map;function iW0($){let Z=!0;j5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let J=$.element.ownerDocument.defaultView.ResizeObserver,H=new Set,Q=new Set,B=new J((q)=>{for(let N of q){let{borderBoxSize:A,target:V}=N;if(V===$.element){if(Z){let D=xH({group:$});if(D===0)return;let L=w7($.id);if(!L)return;let j=Vj($),M=L.defaultLayoutDeferred?Js(j):L.layout,_=dW0({group:$,nextGroupSize:D,prevGroupSize:L.groupSize,prevLayout:M}),E=zZ({layout:_,panelConstraints:j});if(!L.defaultLayoutDeferred&&XZ(L.layout,E)&&cW0(L.derivedPanelConstraints,j)&&L.groupSize===D)continue;d3($,{defaultLayoutDeferred:!1,derivedPanelConstraints:j,groupSize:D,layout:E,separatorToPanels:L.separatorToPanels})}}else uW0($,V,A)}});B.observe($.element),$.panels.forEach((q)=>{j5(!H.has(q.id),`Panel ids must be unique; id "${q.id}" was used more than once`),H.add(q.id),q.onResize&&B.observe(q.element)});let X=xH({group:$}),z=Vj($),G=$.panels.map(({id:q})=>q).join(","),U=$.mutableState.defaultLayout;U&&(lW0($.panels,U)||(U=void 0));let K=$.mutableState.layouts[G]??U??Js(z),Y=zZ({layout:K,panelConstraints:z}),F=$.element.ownerDocument;RH.set(F,(RH.get(F)??0)+1);let W=new Map;return Bs($).forEach((q)=>{q.separator&&W.set(q.separator,q.panels)}),d3($,{defaultLayoutDeferred:X===0,derivedPanelConstraints:z,groupSize:X,layout:Y,separatorToPanels:W}),$.separators.forEach((q)=>{j5(!Q.has(q.id),`Separator ids must be unique; id "${q.id}" was used more than once`),Q.add(q.id),q.element.addEventListener("keydown",nn)}),RH.get(F)===1&&(F.addEventListener("contextmenu",dn,!0),F.addEventListener("dblclick",on,!0),F.addEventListener("pointerdown",sn,!0),F.addEventListener("pointerleave",tn),F.addEventListener("pointermove",en),F.addEventListener("pointerout",$s),F.addEventListener("pointerup",Zs,!0)),function(){Z=!1,RH.set(F,Math.max(0,(RH.get(F)??0)-1)),IW0($),$.separators.forEach((q)=>{q.element.removeEventListener("keydown",nn)}),RH.get(F)||(F.removeEventListener("contextmenu",dn,!0),F.removeEventListener("dblclick",on,!0),F.removeEventListener("pointerdown",sn,!0),F.removeEventListener("pointerleave",tn),F.removeEventListener("pointermove",en),F.removeEventListener("pointerout",$s),F.removeEventListener("pointerup",Zs,!0)),B.disconnect()}}function rW0(){let[$,Z]=b1.useState({}),J=b1.useCallback(()=>Z({}),[]);return[$,J]}function jj($){let Z=b1.useId();return`${$??Z}`}var GZ=typeof window<"u"?b1.useLayoutEffect:b1.useEffect;function pX($){let Z=b1.useRef($);return GZ(()=>{Z.current=$},[$]),b1.useCallback((...J)=>Z.current?.(...J),[Z])}function Oj(...$){return pX((Z)=>{$.forEach((J)=>{if(J)switch(typeof J){case"function":{J(Z);break}case"object":{J.current=Z;break}}})})}function Tj($){let Z=b1.useRef({...$});return GZ(()=>{for(let J in $)Z.current[J]=$[J]},[$]),Z.current}var Vs=b1.createContext(null);function aW0($,Z){let J=b1.useRef({getLayout:()=>({}),setLayout:SW0});b1.useImperativeHandle(Z,()=>J.current,[]),GZ(()=>{Object.assign(J.current,qs({groupId:$}))})}function Cj({children:$,className:Z,defaultLayout:J,disableCursor:H,disabled:Q,elementRef:B,groupRef:X,id:z,onLayoutChange:G,onLayoutChanged:U,orientation:K="horizontal",resizeTargetMinimumSize:Y={coarse:20,fine:10},style:F,...W}){let q=b1.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=pX((I)=>{XZ(q.current.onLayoutChange,I)||(q.current.onLayoutChange=I,G?.(I))}),A=pX((I,y)=>{XZ(q.current.onLayoutChanged,I)||(q.current.onLayoutChanged=I,U?.(I,{isUserInteraction:y}))}),V=jj(z),D=b1.useRef(null),[L,j]=rW0(),M=b1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:Y,separators:[]}),_=Oj(D,B);aW0(V,X);let E=pX((I,y)=>{let S=BZ(),O=cn(I),k=w7(I);if(k){let b=!1;switch(S.state){case"active":{b=S.hitRegions.some((h)=>h.group===O);break}}return{flexGrow:k.layout[y]??1,pointerEvents:b?"none":void 0}}if(J?.[y])return{flexGrow:J?.[y]}}),C=Tj({defaultLayout:J,disableCursor:H}),R=b1.useMemo(()=>({get disableCursor(){return!!C.disableCursor},getPanelStyles:E,id:V,orientation:K,registerPanel:(I)=>{let y=M.current;return y.panels=Aj(K,[...y.panels,I]),j(),()=>{y.panels=y.panels.filter((S)=>S!==I),j()}},registerSeparator:(I)=>{let y=M.current;return y.separators=Aj(K,[...y.separators,I]),j(),()=>{y.separators=y.separators.filter((S)=>S!==I),j()}},updatePanelProps:(I,{disabled:y})=>{let S=M.current.panels.find((b)=>b.id===I);S&&(S.panelConstraints.disabled=y);let O=cn(V),k=w7(V);O&&k&&d3(O,{...k,derivedPanelConstraints:Vj(O)})},updateSeparatorProps:(I,{disabled:y,disableDoubleClick:S})=>{let O=M.current.separators.find((k)=>k.id===I);O&&(O.disabled=y,O.disableDoubleClick=S)}}),[E,V,j,K,C]),T=b1.useRef(null);return GZ(()=>{let I=D.current;if(I===null)return;let y=M.current,S;if(C.defaultLayout!==void 0&&Object.keys(C.defaultLayout).length===y.panels.length){S={};for(let w of y.panels){let i=C.defaultLayout[w.id];i!==void 0&&(S[w.id]=i)}}let O={disabled:!!Q,element:I,id:V,mutableState:{defaultLayout:S,disableCursor:!!C.disableCursor,expandedPanelSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:K,panels:y.panels,resizeTargetMinimumSize:y.resizeTargetMinimumSize,separators:y.separators};T.current=O;let k=iW0(O),{defaultLayoutDeferred:b,derivedPanelConstraints:h,layout:v}=w7(O.id,!0);!b&&h.length>0&&(N(v),A(v,!1));let f=Pj(V,(w)=>{let{defaultLayoutDeferred:i,derivedPanelConstraints:r,layout:x}=w.next;if(i||r.length===0)return;let l=O.panels.map(({id:p})=>p).join(",");O.mutableState.layouts[l]=x,r.forEach((p)=>{if(p.collapsible){let{layout:d}=w.prev??{};if(d){let o=q4(p.collapsedSize,x[p.panelId]),Z0=q4(p.collapsedSize,d[p.panelId]);o&&!Z0&&(O.mutableState.expandedPanelSizes[p.panelId]=d[p.panelId])}}});let s=BZ().state!=="active";N(x),s&&A(x,w.isUserInteraction)});return()=>{T.current=null,k(),f()}},[Q,V,A,N,K,L,C]),b1.useEffect(()=>{let I=T.current;I&&(I.mutableState.defaultLayout=J,I.mutableState.disableCursor=!!H)}),yH.jsx(Vs.Provider,{value:R,children:yH.jsx("div",{...W,className:Z,"data-group":!0,"data-testid":V,id:V,ref:_,style:{height:"100%",width:"100%",overflow:"hidden",...F,display:"flex",flexDirection:K==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:K==="horizontal"?"pan-y":"pan-x"},children:$})})}Cj.displayName="Group";function wj(){let $=b1.useContext(Vs);return j5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function oW0($,Z){let{id:J}=wj(),H=b1.useRef({collapse:Nj,expand:Nj,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Nj});b1.useImperativeHandle(Z,()=>H.current,[]),GZ(()=>{Object.assign(H.current,Ws({groupId:J,panelId:$}))})}function Ej({children:$,className:Z,collapsedSize:J="0%",collapsible:H=!1,defaultSize:Q,disabled:B,elementRef:X,groupResizeBehavior:z="preserve-relative-size",id:G,maxSize:U="100%",minSize:K="0%",onResize:Y,panelRef:F,style:W,...q}){let N=!!G,A=jj(G),V=Tj({disabled:B}),D=b1.useRef(null),L=Oj(D,X),{getPanelStyles:j,id:M,orientation:_,registerPanel:E,updatePanelProps:C}=wj(),R=Y!==null,T=pX((O,k,b)=>{Y?.(O,G,b)});GZ(()=>{let O=D.current;if(O!==null){let k={element:O,id:A,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:R?T:void 0,panelConstraints:{groupResizeBehavior:z,collapsedSize:J,collapsible:H,defaultSize:Q,disabled:V.disabled,maxSize:U,minSize:K}};return E(k)}},[z,J,H,Q,R,A,N,U,K,T,E,V]),b1.useEffect(()=>{C(A,{disabled:B})},[B,A,C]),oW0(A,F);let I=()=>{let O=j(M,A);if(O)return JSON.stringify(O)},y=b1.useSyncExternalStore((O)=>Pj(M,O),I,I),S;return y?S=JSON.parse(y):Q!==void 0?S={flexGrow:void 0,flexShrink:void 0,flexBasis:Q}:S={flexGrow:1},yH.jsx("div",{...q,"data-disabled":B||void 0,"data-panel":!0,"data-testid":A,id:A,ref:L,style:{...nW0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...S},children:yH.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:_==="horizontal"?"pan-y":"pan-x"},children:$})})}Ej.displayName="Panel";var nW0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function sW0({layout:$,panelConstraints:Z,panelId:J,panelIndex:H}){let Q,B,X=$[J],z=Z.find((G)=>G.panelId===J);if(z){let G=z.maxSize,U=z.collapsible?z.collapsedSize:z.minSize,K=[H,H+1];B=zZ({layout:cX({delta:U-X,initialLayout:$,panelConstraints:Z,pivotIndices:K,prevLayout:$}),panelConstraints:Z})[J],Q=zZ({layout:cX({delta:G-X,initialLayout:$,panelConstraints:Z,pivotIndices:K,prevLayout:$}),panelConstraints:Z})[J]}return{valueControls:J,valueMax:Q,valueMin:B,valueNow:X}}function Sj({children:$,className:Z,disabled:J,disableDoubleClick:H,elementRef:Q,id:B,style:X,...z}){let G=jj(B),U=Tj({disabled:J,disableDoubleClick:H}),[K,Y]=b1.useState({}),[F,W]=b1.useState("inactive"),[q,N]=b1.useState(!1),A=b1.useRef(null),V=Oj(A,Q),{disableCursor:D,id:L,orientation:j,registerSeparator:M,updateSeparatorProps:_}=wj(),E=j==="horizontal"?"vertical":"horizontal";GZ(()=>{let T=A.current;if(T!==null){let I={disabled:U.disabled,disableDoubleClick:U.disableDoubleClick,element:T,id:G},y=M(I),S=wW0((k)=>{W(k.next.state!=="inactive"&&k.next.hitRegions.some((b)=>b.separator===I)?k.next.state:"inactive")}),O=Pj(L,(k)=>{let{derivedPanelConstraints:b,layout:h,separatorToPanels:v}=k.next,f=v.get(I);if(f){let w=f[0],i=b.findIndex((r)=>r.panelId===w.id);Y(sW0({layout:h,panelConstraints:b,panelId:w.id,panelIndex:i}))}});return()=>{S(),O(),y()}}},[L,G,M,U]),b1.useEffect(()=>{_(G,{disabled:J,disableDoubleClick:H})},[J,H,G,_]);let C;J&&!D&&(C="not-allowed");let R;if(J)R="disabled";else switch(F){case"active":{R="active";break}default:q?R="focus":R=F}return yH.jsx("div",{...z,"aria-controls":K.valueControls,"aria-disabled":J||void 0,"aria-orientation":E,"aria-valuemax":K.valueMax,"aria-valuemin":K.valueMin,"aria-valuenow":K.valueNow,children:$,className:Z,"data-separator":R,"data-testid":G,id:G,onBlur:()=>N(!1),onFocus:()=>N(!0),ref:V,role:"separator",style:{flexBasis:"auto",cursor:C,...X,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:J?void 0:0})}Sj.displayName="Separator";var $N=P(c(),1);function As({className:$,...Z}){return $N.jsx(Cj,{"data-slot":"resizable-panel-group",className:a0("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function Rj({...$}){return $N.jsx(Ej,{"data-slot":"resizable-panel",...$})}function Ds({showDivider:$=!0,className:Z,...J}){return $N.jsx(Sj,{"data-slot":"resizable-handle",className:a0("relative flex 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]: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",$?"w-px bg-border aria-[orientation=horizontal]:h-px":"w-0 aria-[orientation=horizontal]:h-0",Z),...J})}var S7=P(c(),1);function Ls({workspace:$,chat:Z,open:J,workspaceMinWidth:H,chatMinWidth:Q,chatMaxWidth:B,chatWidth:X,onCollapse:z,onChatWidthChange:G}){let U=R7.useRef(null),K=R7.useRef(null),[Y,F]=R7.useState(!1),W=Math.min(Math.max(X,Q),B),[q]=R7.useState(()=>J?W:0);return R7.useLayoutEffect(()=>{let N=U.current;if(!N)return;if(J)N.resize(W);else N.collapse()},[W,J]),S7.jsxs(As,{orientation:"horizontal",className:B0("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:(N,A)=>{if(!Y&&K.current===null)K.current=requestAnimationFrame(()=>{F(!0)});if(A.isUserInteraction)requestAnimationFrame(()=>{let V=U.current;if(!V)return;let D=V.getSize();if(D.inPixels>0)G(Math.round(D.inPixels))})},children:[S7.jsx(Rj,{id:"workspace",className:"overflow-visible!",minSize:H,children:S7.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),S7.jsx(Ds,{"aria-label":"Resize chat",showDivider:!1,hidden:!J,disabled:!J}),S7.jsx(Rj,{id:"chat","aria-hidden":!J,inert:!J,collapsible:!0,collapsedSize:0,defaultSize:q,minSize:Q,maxSize:B,groupResizeBehavior:"preserve-pixel-size",panelRef:U,onResize:(N,A,V)=>{if(J&&N.inPixels===0&&V&&V.inPixels>0)z()},className:B0("overflow-hidden!",Y&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",J?"opacity-100":"opacity-0"),children:S7.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var UZ=P(c(),1);function Ms({onOpenOverview:$}){return UZ.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[UZ.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[UZ.jsx(_F,{size:56,stroke:0.5,"aria-hidden":!0}),UZ.jsx("p",{className:"text-sm",children:"There's no such page in this workspace"})]}),UZ.jsx(j0,{variant:"secondary",onClick:$,children:"Back to overview"})]})}var j1=P(c(),1),eW0=F2.lazy(()=>import("/chunk-3a48fyf7.js").then(($)=>({default:$.Scratchpad}))),Os=($)=>A$($.icon)??rJ;function Ps($,Z,J,H,Q,B){if($==="agent")return{key:$,Icon:xB,label:"Agent",closable:H,loading:Q};if($==="overview")return{key:$,Icon:jF,label:"Overview",closable:!1,reorderable:!1};if($==="scratchpad")return{key:$,Icon:hB,label:"Scratchpad",closable:H};let X=Q$($),z=X?J.find((K)=>K.id===X):null;if(z)return{key:$,Icon:Os(z),label:z.title||z.viewId||"New view",closable:H,loading:B(z.sessionId)};let G=VQ($),U=G?Z.find((K)=>K.id===G):null;return U?{key:$,Icon:VX(U,J),label:NX(U),closable:H}:null}function $q0($,Z,J){let H=new Set(Z),Q=0;return $.map((B)=>H.has(B)?J[Q++]:B)}function Zq0({onOpenTheme:$}){let{layout:Z,name:J,provider:H}=i1(),[Q,B]=F2.useState(!1);return j1.jsx($q,{children:j1.jsxs(o9,{children:[j1.jsxs(n9,{className:"flex min-w-0 cursor-pointer items-center gap-2 rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":`${J??"Workspace"} menu`,onPointerEnter:()=>B(!0),onPointerLeave:()=>B(!1),children:[j1.jsx(u6,{icon:Q?{...Z.icon,type:"glyph",value:"dots"}:Z.icon,workspaceType:H,workspaceTheme:Z.theme,className:"size-5 rounded-sm"}),J&&j1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:J})]}),j1.jsx(s9,{align:"start",sideOffset:6,className:"w-36",children:j1.jsxs(J7,{children:[j1.jsxs(H9,{onClick:$,children:[j1.jsx(uq,{stroke:1.75}),"Theme"]}),j1.jsxs(H9,{nativeButton:!0,render:j1.jsx(w3,{}),className:"w-full",children:[j1.jsx(S6,{stroke:1.75}),"Settings"]})]})})]})})}function Ts({widgets:$,views:Z,builders:J}){let{layout:H,setLayout:Q,workspaceId:B}=i1(),X=$9(H.theme),z=An(),{ref:G,fits:U,constraints:K}=Ln(),[Y,F]=F2.useState("idle"),[W,q]=F2.useState(!1),[N,A]=F2.useState(0),V=F2.useRef(new Map),D=w5((q0)=>q0.dockedChatWidth),L=w5((q0)=>q0.setDockedChatWidth),j=g2((q0)=>q0.activity),M=SG(j,B),_=Dn({builders:J,onSave:(q0,P0)=>z.save(q0,P0)});px(H.theme);let E=mX(fX(H.tabs),Z,J).some((q0)=>q0!=="agent"),C=$.some((q0)=>!r9(q0.id)),R=C||Z.length>0,I=H.layoutMode==="split"&&E&&U?"split":"fullscreen",y=I==="split",{tabsState:S,activeTab:O,appletParams:k,navigateToTab:b,setTabs:h,isUnavailable:v,onNavigationClick:f}=hn({views:Z,builders:J,split:y}),{view:w,chatLoaded:i,previewTurn:r,sessionId:x,processing:l,error:s,loadError:p,retryLoad:d,send:o,stop:Z0,selectSession:H0,dismissError:G0}=zn({activeTab:O,appletParams:k}),{composerBanner:X0,builderComposerBanner:Y0,agentAvailability:A0}=Rn(B,{chatError:s,onDismissChatError:G0,chatLoadError:p,onRetryChatLoad:d}),N0=mX(S,Z,J),F0=N0.filter((q0)=>q0!=="agent"),n=new Set(S.open),a=(q0)=>{Q({layoutMode:q0})},e=y?F0:N0,$0=N0.length>1,Q0=e.map((q0)=>Ps(q0,Z,J,$0||Q$(q0)!==null,M,(P0)=>WQ(j,B,P0))).filter((q0)=>Boolean(q0)),_0=VQ(O),M0=_0?Z.find((q0)=>q0.id===_0):void 0,V0=Q$(O),L0=V0?J.find((q0)=>q0.id===V0):void 0,g=L0?.status==="draft"&&!WQ(j,B,L0.sessionId)?L0:void 0,u=g?.id,t=Y==="idle"&&(O==="overview"&&C||M0!==void 0),{controls:W0,docked:I0,layerProps:c0,popup:f0,targetRef:T0}=dh({workspaceId:B,sessionId:x,activeTab:O,mode:I,available:t,closePopup:()=>q(!1),openPopup:()=>q(!0)});F2.useEffect(()=>{if(S.open.filter((l0)=>C7(l0,Z,J)).length===S.open.length)return;let P0=mX(S,Z,J);h({open:P0,active:P0.includes(S.active)?S.active:P0[0]})},[J,h,S,Z]),F2.useEffect(()=>{let q0=new Map;for(let h0 of J){if(h0.status!=="ready"||!h0.viewId)continue;if(!Z.some((G1)=>G1.id===h0.viewId))continue;q0.set(H$(h0.id),vZ(h0.viewId))}if(q0.size===0)return;let P0=q0.get(O);if(P0)b(P0,{replace:!0});let l0=new Set(q0.values()),z1=new Map([...q0].map(([h0,G1])=>[G1,h0])),O1=[],k0=!1;for(let h0 of S.open){let G1=z1.get(h0);if(l0.has(h0)&&G1&&S.open.includes(G1)){k0=!0;continue}let R1=q0.get(h0),k1=R1??h0;if(R1)k0=!0;if(!O1.includes(k1))O1.push(k1)}if(!k0)return;let r0=q0.get(S.active)??S.active;h({open:O1.length>0?O1:["overview"],active:r0})},[O,J,b,h,S,Z]),F2.useEffect(()=>{if(I!=="fullscreen"||O==="agent")q(!1)},[O,I]),F2.useEffect(()=>{if(!u)return;if(I==="fullscreen")q(!0);A((q0)=>q0+1)},[u,I]);let x0=(q0)=>{if(b(q0),q0==="agent")q(!1),A((P0)=>P0+1)},J1=()=>{z.create().then((q0)=>x0(H$(q0.id)))},W1=(q0)=>{if(q0==="views"){let P0=Z[0];if(P0)x0(vZ(P0.id));else J1()}else x0(q0);q(!1)};W2((q0)=>{if(q0.type==="view:deleted"&&q0.workspaceId===B&&O===vZ(q0.name))x0("overview")});let d0=(q0)=>{if(q0==="overview")return;let P0=Q$(q0),l0=P0?J.find((h0)=>h0.id===P0):void 0;if(!$0&&!l0||!n.has(q0))return;let z1=S.open.filter((h0)=>h0!==q0);if(z1.length===0)z1=["overview"];let O1=e.indexOf(q0),k0=e[O1+1]??e[O1-1]??z1.find((h0)=>C7(h0,Z,J))??"overview",r0=S.active===q0||!z1.includes(S.active)?k0:S.active;if(h({open:z1,active:r0}),O===q0)b(k0);if(l0?.status==="draft")V.current.get(l0.id)?.resetSketch(),_.clear(l0.id),z.discard(l0.id)},v0=(q0)=>{let P0=H$(q0.id);if(n.has(P0)){let l0=S.open.filter((z1)=>z1!==P0);if(l0.length===0)l0=["overview"];if(h({open:l0,active:S.active===P0?l0[0]:S.active}),O===P0)b(l0[0])}V.current.get(q0.id)?.resetSketch(),_.clear(q0.id),z.discard(q0.id)},S1=(q0)=>{let P0=$q0(S.open,e,q0);if(P0===S.open)return;h({open:P0,active:S.active})},B1=(q0)=>{if(q0!==void 0)w5.getState().setComposerDraft(B,q0);if(I==="fullscreen"&&O!=="agent"){if(q(!0),W)A((P0)=>P0+1);return}A((P0)=>P0+1)};Zn({sessionId:x,send:o,revealChat:B1,agentAvailability:A0}),Jn(x,B1);let s1=[...!y&&!n.has("agent")?[{key:"agent",Icon:xB,label:"Agent",onClick:()=>x0("agent")}]:[],...!n.has("scratchpad")?[{key:"scratchpad",Icon:hB,label:"Scratchpad",onClick:()=>x0("scratchpad")}]:[],...Z.map((q0)=>({view:q0,tab:vZ(q0.id)})).filter(({tab:q0})=>!n.has(q0)).map(({view:q0,tab:P0})=>({key:P0,Icon:VX(q0,J),label:NX(q0),onClick:()=>x0(P0)})),...J.filter((q0)=>q0.status!=="ready").map((q0)=>({builder:q0,tab:H$(q0.id)})).filter(({tab:q0})=>!n.has(q0)).map(({builder:q0,tab:P0})=>({key:P0,Icon:Os(q0),label:q0.title||q0.viewId||"New view",onClick:()=>x0(P0)})),{key:"create-view",Icon:_s,label:"New view",onClick:J1}],C0=F2.useCallback((q0)=>{if(g)_.change(g.id,q0)},[g,_]),p0=F2.useCallback(()=>{if(g)V.current.get(g.id)?.resetSketch()},[g]),i0=F2.useCallback(async(q0)=>{if(!g)return;await V.current.get(g.id)?.prepareSketchForSend(),await z.submit(g,q0),_.clear(g.id)},[g,z,_]),o0=g?{sessionId:g.sessionId,builderId:g.id,initialValue:g.input.requirements,onChange:C0,onRemoveDrawing:p0,onSubmit:i0}:void 0,A1=j1.jsx(kW,{agent:X.agent,active:I==="split",focusRequest:N,chatLoaded:i,hasWorkspaceApplets:R,view:w,previewTurn:r,sessionId:x,processing:l,composerBanner:g?Y0:X0,agentAvailability:A0,send:o,stop:Z0,onNavigateFromWelcome:W1,onClose:()=>a("fullscreen"),annotation:I0,builderDraft:o0,docked:!0}),D1=j1.jsx(kW,{agent:X.agent,active:I==="fullscreen"&&O==="agent",focusRequest:N,chatLoaded:i,hasWorkspaceApplets:R,view:w,previewTurn:r,sessionId:x,processing:l,composerBanner:X0,agentAvailability:A0,send:o,stop:Z0,onNavigateFromWelcome:W1}),u1=j1.jsxs("div",{className:B0("@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",I==="split"&&"rounded-xl"),children:[j1.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[j1.jsxs("div",{ref:T0,inert:W0.active||void 0,"aria-hidden":W0.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?j1.jsx(Ms,{onOpenOverview:()=>x0("overview")}):O==="agent"?D1:O==="overview"?j1.jsx(io,{customizing:Y==="customizing",theming:Y==="theming",onThemingChange:(q0)=>F(q0?"theming":"idle"),onCustomizingChange:(q0)=>F(q0?"customizing":"idle"),widgets:$,views:Z,builders:J,onOpenView:(q0)=>x0(vZ(q0)),onCreateView:J1,onCreateWidget:()=>{H0(null),B1("Create widget")}}):O==="scratchpad"?j1.jsx(F2.Suspense,{fallback:null,children:j1.jsx(eW0,{})}):null,J.filter((q0)=>q0.status!=="ready").map((q0)=>j1.jsx(Kn,{ref:(P0)=>{if(P0)V.current.set(q0.id,P0);else V.current.delete(q0.id)},active:!v&&L0?.id===q0.id,builder:q0,chatDocked:I==="split",workspaceId:B,onEditingStart:()=>{if(I==="fullscreen")q(!1)},onContinueInChat:B1,onOpenChat:()=>{H0(q0.sessionId),B1()},onDiscard:()=>v0(q0)},q0.id)),j1.jsx(Vn,{views:Z,activeViewId:v?null:M0?.id??null,params:k})]}),j1.jsx(OY,{...c0,children:j1.jsx(wY,{controls:W0,title:"Draw annotation",busy:W0.finishing,onComplete:()=>void W0.finish()})})]}),j1.jsx(j4,{children:Y==="theming"&&j1.jsx(Ji,{onClose:()=>F("idle")})}),j1.jsxs(ro,{children:[j1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[j1.jsx(Zq0,{onOpenTheme:()=>F("theming")}),j1.jsx(gn,{tabs:Q0,active:O,createItems:s1,onSelect:x0,onClose:d0,onReorder:S1})]}),j1.jsx(MA,{workspaceId:B,describeTab:(q0)=>Ps(q0,Z,J,!1,!1,()=>!1),onOpenTab:x0}),E&&U&&I==="fullscreen"&&j1.jsxs(Q5,{children:[j1.jsx(B5,{render:j1.jsx(j0,{variant:"ghost",size:"icon-sm",onClick:()=>a("split"),"aria-label":"Dock agent",className:"text-muted-foreground",children:j1.jsx(js,{stroke:1.75})})}),j1.jsx(X5,{children:"Dock agent"})]})]})]});return j1.jsxs("div",{onClick:f,className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[j1.jsx("div",{ref:G,className:"flex min-h-0 flex-1",children:E&&U&&K?j1.jsx(Ls,{...K,workspace:u1,chat:A1,open:I==="split",chatWidth:D,onCollapse:()=>a("fullscreen"),onChatWidthChange:L}):u1}),I==="fullscreen"&&O!=="agent"&&E&&j1.jsx(Zi,{agent:X.agent,loading:M,open:W,onOpenChange:q,onOpenChangeComplete:(q0)=>{if(q0)A((P0)=>P0+1)},children:(q0)=>j1.jsx(kW,{agent:X.agent,active:W,focusRequest:N,chatLoaded:i,hasWorkspaceApplets:R,view:w,previewTurn:r,sessionId:x,processing:l,composerBanner:g?Y0:X0,agentAvailability:A0,send:o,stop:Z0,onNavigateFromWelcome:W1,onClose:q0,annotation:f0,builderDraft:o0})})]})}var ws=P(m(),1);var ZN=P(m(),1);function Jq0($){return new Map($.map((Z)=>[Z.id,{w:Z.config.colSpan,h:Z.config.rowSpan}]))}function Hq0($,Z,J){let H=new Set($.map((K)=>K.i)),Q=Z.filter((K)=>{let Y=J.get(K.id);if(!Y)return!H.has(K.id);if(!H.has(K.id))return!1;return Y.w!==K.config.colSpan||Y.h!==K.config.rowSpan});if(Q.length===0)return null;let B=new Set(Q.map((K)=>K.id)),X=new Map(Z.map((K)=>[K.id,K.config])),z=$.filter((K)=>!B.has(K.i)&&X.has(K.i)).map((K)=>{let Y=X.get(K.i);return{...K,w:Y.colSpan,h:Y.rowSpan}}),G=z.map(({i:K,x:Y,y:F})=>({i:K,x:Y,y:F})),U=[...z];for(let K of Q){let Y=Bq(U,K.config.colSpan,K.config.rowSpan);G.push({i:K.id,...Y}),U.push({i:K.id,...Y,w:K.config.colSpan,h:K.config.rowSpan})}return G}function Cs($,Z,J,H){let Q=ZN.useRef(null);ZN.useEffect(()=>{if(!Z)return;let B=Jq0(Z);if(Q.current?.workspaceId!==$){Q.current={workspaceId:$,sizes:B};return}let X=Hq0(J.widgetGrid,Z,Q.current.sizes);if(Q.current={workspaceId:$,sizes:B},X)H({widgetGrid:X})},[$,Z,J.widgetGrid,H])}function Es($){let{layout:Z,setLayout:J}=i1(),H=J5({queryKey:S0.widgets($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/widgets`)).widgets},...p4}),Q=ws.useMemo(()=>Ch(H.data??[]),[H.data]);return Cs($,H.data?Q:void 0,Z,J),{...H,data:Q}}var l3=P(c(),1);function Rs({id:$}){let{experimental:Z}=T8();return l3.jsx(Ss,{id:$,children:l3.jsx(bh,{id:$,children:l3.jsx(tV,{workspaceId:$,enabled:Z.collab,children:l3.jsx(Qq0,{id:$})})})})}function Qq0({id:$}){let Z=M4(),J=U1(),[H]=j6(),{isLoading:Q}=i1(),B=Es($),X=Jq($),z=Qq($);Dh(),W2((U)=>{if(U.type==="theme:updated"||U.type==="workspace:updated")J.invalidateQueries({queryKey:S0.layout($)});else if(U.type==="widget-layout:updated"||U.type==="widget:updated")J.invalidateQueries({queryKey:S0.widgets($)});else if(U.type==="view-layout:updated"||U.type==="view:updated")J.invalidateQueries({queryKey:S0.views($)})});let G=Q||H===void 0||B.isLoading||X.isLoading||z.isLoading;return l3.jsx(nK,{children:G?l3.jsx("div",{className:"flex h-full items-center justify-center",children:l3.jsx($h,{sprite:"moi",effect:"chaos"})}):l3.jsx(Ts,{widgets:B.data,views:X.data??[],builders:z.data??[]},Z?"browser-tab":"shared")})}var U3=P(c(),1),Is=null;function Bq0(){if(!Is)return U3.jsx(SO,{to:"/"});return U3.jsx(JN.Suspense,{fallback:null,children:U3.jsx(Is,{})})}function bs(){let[,$]=q8();return JN.useEffect(()=>{return SA((Z)=>$(`/workspace/${Z}`)),()=>SA(null)},[$]),U3.jsxs(EO,{children:[U3.jsx(zz,{path:"/",component:ax}),U3.jsx(zz,{path:"/dev/*?",component:Bq0}),U3.jsx(zz,{path:"/workspace/:id/*?",children:(Z)=>U3.jsx(Rs,{id:Z.id},Z.id)})]})}var I7=P(c(),1),ys=new VN;DR(ys);KE();function XR1($){function Z(){return I7.jsx(XN,{client:ys,children:I7.jsxs(CG,{children:[I7.jsx(jN,{children:I7.jsx(bs,{})}),I7.jsx(ww,{})]})})}ks.createRoot($).render(I7.jsx(Z,{}))}export{XR1 as mount};
|