@engenty/wizards-runtime 0.20.6 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/apps/runtime/dist/agents/studio-assistant.js +7 -3
- package/apps/runtime/dist/agents/subscription.js +4 -17
- package/apps/runtime/dist/app.js +4 -1
- package/apps/runtime/dist/cli/clients.js +6 -24
- package/apps/runtime/dist/cli/connect.js +2 -1
- package/apps/runtime/dist/cli/environment.js +3 -0
- package/apps/runtime/dist/cli/machine.js +1 -70
- package/apps/runtime/dist/cli/main.js +2 -1
- package/apps/runtime/dist/cli/ollama.js +1 -179
- package/apps/runtime/dist/cli/setup.js +8 -6
- package/apps/runtime/dist/docs/dev/licensing.md +15 -9
- package/apps/runtime/dist/docs/user-guide/command-line.md +3 -0
- package/apps/runtime/dist/elements/outside.js +2 -1
- package/apps/runtime/dist/engine/code-step.js +1 -1
- package/apps/runtime/dist/engine/decide.js +2 -2
- package/apps/runtime/dist/engine/input.js +1 -1
- package/apps/runtime/dist/engine/runner.js +1 -1
- package/apps/runtime/dist/engine/steps.js +27 -8
- package/apps/runtime/dist/engine/surface.js +1 -1
- package/apps/runtime/dist/engine/template.js +1 -1
- package/apps/runtime/dist/env.js +1 -0
- package/apps/runtime/dist/harness/clients.js +10 -1
- package/apps/runtime/dist/harness/index.js +15 -69
- package/apps/runtime/dist/harness/types.js +3 -2
- package/apps/runtime/dist/local-call.js +6 -0
- package/apps/runtime/dist/local-models.js +53 -157
- package/apps/runtime/dist/mcp/bridge.js +12 -55
- package/apps/runtime/dist/mcp/elements.js +39 -4
- package/apps/runtime/dist/mcp/handler.js +12 -0
- package/apps/runtime/dist/mcp/run-pages.js +238 -0
- package/apps/runtime/dist/mcp/run-tasks.js +157 -0
- package/apps/runtime/dist/mcp/runs.js +129 -0
- package/apps/runtime/dist/mcp/tools.js +4 -95
- package/apps/runtime/dist/models.js +74 -27
- package/apps/runtime/dist/prompts/mcp.md +4 -1
- package/apps/runtime/dist/render/downloads.js +1 -1
- package/apps/runtime/dist/render/shaped.js +1 -1
- package/apps/runtime/dist/routes/model-setup.js +77 -0
- package/apps/runtime/dist/routes/studio.js +8 -251
- package/apps/runtime/dist/services/space-categories.js +1 -1
- package/apps/runtime/dist/services/work-ai.js +10 -4
- package/apps/runtime/dist/texts.js +4 -6
- package/apps/runtime/dist/tools/connections.js +3 -0
- package/apps/runtime/dist/tools/harness.js +124 -0
- package/apps/web/dist/assets/AboutDialog-BSdAA4Wi.js +1 -0
- package/apps/web/dist/assets/{BlockEditor-CgjXTWly.js → BlockEditor-0noqMcAl.js} +1 -1
- package/apps/web/dist/assets/Bundle-Ctrq7lHH.js +1 -0
- package/apps/web/dist/assets/CapabilitiesPage-CZlVhBmU.js +2 -0
- package/apps/web/dist/assets/ChangelogDialog-BLCYV4jT.js +1 -0
- package/apps/web/dist/assets/{CodeEditor-2LyHbSre.js → CodeEditor-CpRn9BZq.js} +1 -1
- package/apps/web/dist/assets/ConnectorsSection-B4rRDlFo.js +1 -0
- package/apps/web/dist/assets/EditorPage-CXN-_zzG.js +3 -0
- package/apps/web/dist/assets/FlowPreview-DjQvcWxs.js +1 -0
- package/apps/web/dist/assets/LangSwitch-BuzsLp16.js +1 -0
- package/apps/web/dist/assets/LocalModels-BDfP2v5-.js +1 -0
- package/apps/web/dist/assets/Marketplace-4baBNzEc.js +2 -0
- package/apps/web/dist/assets/NewWizardChannels-B_xHm-bI.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-BmZAY4zi.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-fZq3WiTk.js +1 -0
- package/apps/web/dist/assets/ProtocolSection-v9wIxisg.js +1 -0
- package/apps/web/dist/assets/PublicRunner-BCh0VzAT.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-CO3ndR23.js → ReadOnly-13stkvNz.js} +1 -1
- package/apps/web/dist/assets/Results-4gmguYzH.js +1 -0
- package/apps/web/dist/assets/RunDrawer-CeEldWRn.js +1 -0
- package/apps/web/dist/assets/SettingsPage-BsKRRlfP.js +2 -0
- package/apps/web/dist/assets/SetupPage-FgA5Kl8z.js +1 -0
- package/apps/web/dist/assets/SharePage-BlBW4oxl.js +1 -0
- package/apps/web/dist/assets/SkillEditor-9QSskfmY.js +1 -0
- package/apps/web/dist/assets/Skills-DdUAyNhR.js +9 -0
- package/apps/web/dist/assets/SpacePage-CHkNPuqt.js +2 -0
- package/apps/web/dist/assets/StudioHome-BwPD-inc.js +1 -0
- package/apps/web/dist/assets/TableEditor-Du1DhbEC.js +7 -0
- package/apps/web/dist/assets/UpdateCheck-DPr9NXq_.js +2 -0
- package/apps/web/dist/assets/brand-DY3lzrOd.js +2 -0
- package/apps/web/dist/assets/changelog-BSdb22c3.js +1 -0
- package/apps/web/dist/assets/code-editor-Bep_LzQ5.js +2 -0
- package/apps/web/dist/assets/host-DiZQ_uws.js +1 -0
- package/apps/web/dist/assets/host-Dw-sMUSd.js +54 -0
- package/apps/web/dist/assets/i18n-DVrYWJaj.js +55 -0
- package/apps/web/dist/assets/index-C2gxK14s.css +1 -0
- package/apps/web/dist/assets/index-lQ4JYHYQ.js +102 -0
- package/apps/web/dist/assets/oss-credits-BHy69wkx.js +1 -0
- package/apps/web/dist/assets/{read-aloud-CRFt5q6k.js → read-aloud-CBycd8TA.js} +1 -1
- package/apps/web/dist/assets/{session-RDdtfee2.js → session-BYLtgklo.js} +1 -1
- package/apps/web/dist/assets/terminal-DmGdMags.js +16 -0
- package/apps/web/dist/assets/texts-ClKS2xhh.js +1 -0
- package/apps/web/dist/assets/theme-DFDOMsVo.js +14 -0
- package/apps/web/dist/assets/ui-CW2I3ecu.js +1 -0
- package/apps/web/dist/assets/ui-DfVpZYIW.js +16 -0
- package/apps/web/dist/assets/{useMutation-BSffqL6W.js → useMutation-BnkuLlQC.js} +1 -1
- package/apps/web/dist/assets/viewers-C6FfRwG1.js +2 -0
- package/apps/web/dist/index.html +18 -16
- package/apps/web/dist/mcp/flow.html +129 -129
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.js +1 -1
- package/node_modules/@engenty/chatviews/dist/chat/a2ui.d.ts +48 -0
- package/node_modules/@engenty/chatviews/dist/chat/a2ui.js +514 -0
- package/node_modules/@engenty/chatviews/dist/chat/check.d.ts +18 -0
- package/node_modules/@engenty/chatviews/dist/chat/check.js +97 -0
- package/node_modules/@engenty/chatviews/dist/chat/index.d.ts +3 -0
- package/node_modules/@engenty/chatviews/dist/chat/index.js +4 -0
- package/node_modules/@engenty/chatviews/dist/chat/library.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/chat/library.js +314 -0
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.js +1 -1
- package/node_modules/@engenty/chatviews/dist/react/chat.d.ts +33 -0
- package/node_modules/@engenty/chatviews/dist/react/chat.js +150 -0
- package/node_modules/@engenty/chatviews/dist/react/field-looks.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/field-looks.js +47 -0
- package/node_modules/@engenty/chatviews/dist/react/markdown.d.ts +5 -0
- package/node_modules/@engenty/chatviews/dist/react/markdown.js +11 -0
- package/node_modules/@engenty/chatviews/dist/react/no-devtools.d.ts +0 -0
- package/node_modules/@engenty/chatviews/dist/react/no-devtools.js +8 -0
- package/node_modules/@engenty/chatviews/dist/react/surface.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/surface.js +552 -0
- package/node_modules/@engenty/chatviews/dist/react/texts.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/texts.js +42 -0
- package/node_modules/@engenty/chatviews/dist/react/ui.d.ts +112 -0
- package/node_modules/@engenty/chatviews/dist/react/ui.js +212 -0
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.js +1 -1
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.js +1 -1
- package/node_modules/@engenty/chatviews/package.json +19 -0
- package/node_modules/@engenty/decision-model/dist/client.d.ts +76 -0
- package/node_modules/@engenty/decision-model/dist/client.js +188 -0
- package/node_modules/@engenty/decision-model/dist/index.d.ts +6 -0
- package/node_modules/@engenty/decision-model/dist/index.js +5 -0
- package/node_modules/@engenty/decision-model/dist/local.d.ts +11 -0
- package/node_modules/@engenty/decision-model/dist/local.js +116 -0
- package/node_modules/@engenty/decision-model/dist/resolve.d.ts +26 -0
- package/node_modules/@engenty/decision-model/dist/resolve.js +53 -0
- package/node_modules/@engenty/decision-model/dist/types.d.ts +80 -0
- package/node_modules/@engenty/decision-model/dist/types.js +6 -0
- package/node_modules/@engenty/decision-model/dist/validate.d.ts +9 -0
- package/node_modules/@engenty/decision-model/dist/validate.js +50 -0
- package/node_modules/@engenty/decision-model/dist/ways.d.ts +42 -0
- package/node_modules/@engenty/decision-model/dist/ways.js +72 -0
- package/node_modules/@engenty/decision-model/package.json +9 -0
- package/node_modules/@engenty/local-models/dist/bridge/index.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/bridge/index.js +117 -0
- package/node_modules/@engenty/local-models/dist/clients/antigravity.d.ts +37 -0
- package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/antigravity.js +68 -17
- package/node_modules/@engenty/local-models/dist/clients/claude.js +1 -0
- package/node_modules/@engenty/local-models/dist/clients/client.d.ts +3 -1
- package/node_modules/@engenty/local-models/dist/clients/client.js +1 -1
- package/node_modules/@engenty/local-models/dist/clients/codex.js +1 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +2 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.js +13 -1
- package/node_modules/@engenty/local-models/dist/clients/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/clients/index.js +4 -2
- package/node_modules/@engenty/local-models/dist/clients/model.d.ts +4 -1
- package/node_modules/@engenty/local-models/dist/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/index.js +2 -1
- package/node_modules/@engenty/local-models/dist/lmstudio/api.d.ts +49 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/api.js +101 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/load.d.ts +12 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/load.js +100 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/server.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/server.js +29 -0
- package/node_modules/@engenty/local-models/dist/mlx/helper.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/mlx/helper.js +149 -0
- package/node_modules/@engenty/local-models/dist/mlx/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/mlx/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/mlx/server.d.ts +19 -0
- package/node_modules/@engenty/local-models/dist/mlx/server.js +82 -0
- package/node_modules/@engenty/local-models/dist/mlx/store.d.ts +16 -0
- package/node_modules/@engenty/local-models/dist/mlx/store.js +153 -0
- package/node_modules/@engenty/local-models/dist/ollama/api.d.ts +4 -37
- package/node_modules/@engenty/local-models/dist/ollama/api.js +1 -18
- package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/ollama/index.js +2 -1
- package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +2 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.js +1 -1
- package/node_modules/@engenty/local-models/dist/ollama/server.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/server.js +45 -0
- package/node_modules/@engenty/local-models/dist/probe.d.ts +11 -8
- package/node_modules/@engenty/local-models/dist/probe.js +16 -32
- package/node_modules/@engenty/local-models/dist/servers/index.d.ts +6 -0
- package/node_modules/@engenty/local-models/dist/servers/index.js +12 -0
- package/node_modules/@engenty/local-models/dist/servers/server.d.ts +84 -0
- package/node_modules/@engenty/local-models/dist/servers/server.js +38 -0
- package/node_modules/@engenty/local-models/package.json +5 -1
- package/node_modules/@engenty/model-setup/dist/catalog.d.ts +36 -0
- package/node_modules/@engenty/model-setup/dist/catalog.js +81 -0
- package/node_modules/@engenty/model-setup/dist/index.d.ts +3 -0
- package/node_modules/@engenty/model-setup/dist/index.js +3 -0
- package/node_modules/@engenty/model-setup/dist/offered.d.ts +7 -0
- package/node_modules/@engenty/model-setup/dist/offered.js +64 -0
- package/node_modules/@engenty/model-setup/dist/react/client.d.ts +46 -0
- package/node_modules/@engenty/model-setup/dist/react/client.js +147 -0
- package/node_modules/@engenty/model-setup/dist/react/columns.d.ts +78 -0
- package/node_modules/@engenty/model-setup/dist/react/columns.js +99 -0
- package/node_modules/@engenty/model-setup/dist/react/host.d.ts +31 -0
- package/node_modules/@engenty/model-setup/dist/react/host.js +48 -0
- package/node_modules/@engenty/model-setup/dist/react/index.d.ts +7 -0
- package/node_modules/@engenty/model-setup/dist/react/index.js +7 -0
- package/node_modules/@engenty/model-setup/dist/react/keys.d.ts +48 -0
- package/node_modules/@engenty/model-setup/dist/react/keys.js +74 -0
- package/node_modules/@engenty/model-setup/dist/react/local-models.d.ts +23 -0
- package/node_modules/@engenty/model-setup/dist/react/local-models.js +134 -0
- package/node_modules/@engenty/model-setup/dist/react/servers.d.ts +4 -0
- package/node_modules/@engenty/model-setup/dist/react/servers.js +13 -0
- package/node_modules/@engenty/model-setup/dist/react/terminal.d.ts +13 -0
- package/node_modules/@engenty/model-setup/dist/react/terminal.js +79 -0
- package/node_modules/@engenty/model-setup/dist/react/tone.d.ts +13 -0
- package/node_modules/@engenty/model-setup/dist/react/tone.js +66 -0
- package/node_modules/@engenty/model-setup/dist/server/apps.d.ts +12 -0
- package/node_modules/@engenty/model-setup/dist/server/apps.js +22 -0
- package/node_modules/@engenty/model-setup/dist/server/clients.d.ts +55 -0
- package/node_modules/@engenty/model-setup/dist/server/clients.js +96 -0
- package/node_modules/@engenty/model-setup/dist/server/index.d.ts +8 -0
- package/node_modules/@engenty/model-setup/dist/server/index.js +8 -0
- package/node_modules/@engenty/model-setup/dist/server/install.d.ts +24 -0
- package/node_modules/@engenty/model-setup/dist/server/install.js +68 -0
- package/node_modules/@engenty/model-setup/dist/server/lmstudio.d.ts +9 -0
- package/node_modules/@engenty/model-setup/dist/server/lmstudio.js +52 -0
- package/node_modules/@engenty/model-setup/dist/server/local-models.d.ts +47 -0
- package/node_modules/@engenty/model-setup/dist/server/local-models.js +164 -0
- package/node_modules/@engenty/model-setup/dist/server/models.d.ts +12 -0
- package/node_modules/@engenty/model-setup/dist/server/models.js +16 -0
- package/node_modules/@engenty/model-setup/dist/server/ollama.d.ts +22 -0
- package/node_modules/@engenty/model-setup/dist/server/ollama.js +146 -0
- package/node_modules/@engenty/model-setup/dist/server/routes.d.ts +51 -0
- package/node_modules/@engenty/model-setup/dist/server/routes.js +211 -0
- package/node_modules/@engenty/model-setup/dist/server/server-apps.d.ts +14 -0
- package/node_modules/@engenty/model-setup/dist/server/server-apps.js +24 -0
- package/node_modules/@engenty/model-setup/dist/server/terminal.d.ts +43 -0
- package/node_modules/@engenty/model-setup/dist/server/terminal.js +222 -0
- package/node_modules/@engenty/model-setup/dist/texts.d.ts +222 -0
- package/node_modules/@engenty/model-setup/dist/texts.js +222 -0
- package/node_modules/@engenty/model-setup/dist/types.d.ts +111 -0
- package/node_modules/@engenty/model-setup/dist/types.js +2 -0
- package/node_modules/@engenty/model-setup/package.json +12 -0
- package/node_modules/@engenty/search-index/dist/catalog-lexical.d.ts +14 -0
- package/node_modules/@engenty/search-index/dist/catalog-lexical.js +165 -0
- package/node_modules/@engenty/search-index/dist/catalog-rank.d.ts +33 -0
- package/node_modules/@engenty/search-index/dist/catalog-rank.js +99 -0
- package/node_modules/@engenty/search-index/dist/catalog-search.d.ts +40 -0
- package/node_modules/@engenty/search-index/dist/catalog-search.js +161 -0
- package/node_modules/@engenty/search-index/dist/chunks.d.ts +17 -0
- package/node_modules/@engenty/search-index/dist/chunks.js +164 -0
- package/node_modules/@engenty/search-index/dist/contracts.d.ts +135 -0
- package/node_modules/@engenty/search-index/dist/contracts.js +9 -0
- package/node_modules/@engenty/search-index/dist/embedder.d.ts +31 -0
- package/node_modules/@engenty/search-index/dist/embedder.js +82 -0
- package/node_modules/@engenty/search-index/dist/embedders/gemini.d.ts +11 -0
- package/node_modules/@engenty/search-index/dist/embedders/gemini.js +54 -0
- package/node_modules/@engenty/search-index/dist/embedders/index.d.ts +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/index.js +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/ollama.d.ts +12 -0
- package/node_modules/@engenty/search-index/dist/embedders/ollama.js +43 -0
- package/node_modules/@engenty/search-index/dist/embedders/openai.d.ts +11 -0
- package/node_modules/@engenty/search-index/dist/embedders/openai.js +36 -0
- package/node_modules/@engenty/search-index/dist/embedders/shared.d.ts +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/shared.js +26 -0
- package/node_modules/@engenty/search-index/dist/embedders/ways.d.ts +16 -0
- package/node_modules/@engenty/search-index/dist/embedders/ways.js +90 -0
- package/node_modules/@engenty/search-index/dist/index.d.ts +10 -0
- package/node_modules/@engenty/search-index/dist/index.js +10 -0
- package/node_modules/@engenty/search-index/dist/payload.d.ts +13 -0
- package/node_modules/@engenty/search-index/dist/payload.js +51 -0
- package/node_modules/@engenty/search-index/dist/registry.d.ts +25 -0
- package/node_modules/@engenty/search-index/dist/registry.js +56 -0
- package/node_modules/@engenty/search-index/dist/scoring.d.ts +10 -0
- package/node_modules/@engenty/search-index/dist/scoring.js +45 -0
- package/node_modules/@engenty/search-index/dist/strategy.d.ts +6 -0
- package/node_modules/@engenty/search-index/dist/strategy.js +25 -0
- package/node_modules/@engenty/search-index/package.json +10 -0
- package/node_modules/@engenty/tool-harness/dist/harness.d.ts +70 -0
- package/node_modules/@engenty/tool-harness/dist/harness.js +170 -0
- package/node_modules/@engenty/tool-harness/dist/index.d.ts +5 -0
- package/node_modules/@engenty/tool-harness/dist/index.js +5 -0
- package/node_modules/@engenty/tool-harness/dist/judge.d.ts +8 -0
- package/node_modules/@engenty/tool-harness/dist/judge.js +39 -0
- package/node_modules/@engenty/tool-harness/dist/levels.d.ts +18 -0
- package/node_modules/@engenty/tool-harness/dist/levels.js +47 -0
- package/node_modules/@engenty/tool-harness/dist/model.d.ts +6 -0
- package/node_modules/@engenty/tool-harness/dist/model.js +60 -0
- package/node_modules/@engenty/tool-harness/dist/schema.d.ts +26 -0
- package/node_modules/@engenty/tool-harness/dist/schema.js +57 -0
- package/node_modules/@engenty/tool-harness/package.json +9 -0
- package/node_modules/@engenty/wizards-shared/dist/catalog-prompt.js +2 -1
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +10 -10
- package/node_modules/@engenty/wizards-shared/dist/definition.js +4 -4
- package/node_modules/@engenty/wizards-shared/dist/run-schema.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -1
- package/node_modules/@engenty/wizards-shared/dist/run.js +4 -0
- package/node_modules/@engenty/wizards-shared/dist/store.js +2 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-agents.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-agents.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-text.js +2 -2
- package/package.json +11 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/runtime/dist/harness/terminal.js +0 -201
- package/apps/web/dist/assets/AboutDialog-BRUwrfQH.js +0 -1
- package/apps/web/dist/assets/Bundle-C0u5HUZL.js +0 -1
- package/apps/web/dist/assets/CapabilitiesPage-C30knXsS.js +0 -2
- package/apps/web/dist/assets/ChangelogDialog-BkZQOAdl.js +0 -1
- package/apps/web/dist/assets/ConnectorsSection-CmXQD7zu.js +0 -1
- package/apps/web/dist/assets/EditorPage-LEbyNWmG.js +0 -3
- package/apps/web/dist/assets/FlowPreview-BXf4EKjU.js +0 -1
- package/apps/web/dist/assets/LangSwitch-BLB7dDce.js +0 -1
- package/apps/web/dist/assets/Marketplace-B3NoH5Va.js +0 -2
- package/apps/web/dist/assets/NewWizardChannels-CSn-9zHr.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-B4wPfClS.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-RawpCO9J.js +0 -1
- package/apps/web/dist/assets/ProtocolSection-s4mEL_pu.js +0 -1
- package/apps/web/dist/assets/PublicRunner-COatyxMi.js +0 -1
- package/apps/web/dist/assets/Results-CC1-mElv.js +0 -1
- package/apps/web/dist/assets/RunDrawer-DkmSXhad.js +0 -1
- package/apps/web/dist/assets/SettingsPage-DKs_fkNL.js +0 -2
- package/apps/web/dist/assets/SetupPage-RvmKCzF2.js +0 -1
- package/apps/web/dist/assets/SharePage-Drntg_oj.js +0 -1
- package/apps/web/dist/assets/SkillEditor-Ca_bzmjD.js +0 -1
- package/apps/web/dist/assets/Skills-BcgxuD15.js +0 -9
- package/apps/web/dist/assets/SpacePage-aZqYFttF.js +0 -2
- package/apps/web/dist/assets/StudioHome-Doua9Lyl.js +0 -1
- package/apps/web/dist/assets/TableEditor-Dbq3HZZS.js +0 -7
- package/apps/web/dist/assets/UpdateCheck-B7etUbUf.js +0 -2
- package/apps/web/dist/assets/brand-BIT7AumL.js +0 -2
- package/apps/web/dist/assets/changelog-BW79cVbx.js +0 -1
- package/apps/web/dist/assets/code-editor-CufyaUFC.js +0 -2
- package/apps/web/dist/assets/host-BXSxBoOH.js +0 -69
- package/apps/web/dist/assets/i18n-WXeVnv7i.js +0 -55
- package/apps/web/dist/assets/index-D1iL3986.css +0 -1
- package/apps/web/dist/assets/index-kDKA6ddy.js +0 -102
- package/apps/web/dist/assets/oss-credits-B3PXhamW.js +0 -1
- package/apps/web/dist/assets/theme-23bNrOQh.js +0 -14
- package/apps/web/dist/assets/ui-DkEhb2Rt.js +0 -16
- package/apps/web/dist/assets/viewers-CmGDpBjn.js +0 -2
- /package/apps/web/dist/assets/{host-BrP-ENHg.css → terminal-BrP-ENHg.css} +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,c as n,i as r,n as i,r as a,s as o,t as s}from"./esm-CpFD3UPd.js";import{n as c,t as l}from"./jsx-runtime-C3cWAN_r.js";import{_ as u}from"./ui-CW2I3ecu.js";import"./ui-DfVpZYIW.js";var d=e(c(),1),f=e(l(),1),p=208,m=42,h=26,g=22,_=132;function v({data:e}){let t=e.icon;return(0,f.jsxs)(`div`,{style:{width:p,height:m},className:u(`flex cursor-default items-center gap-2.5 rounded-xl px-2.5`,e.optional?`border border-ink-4 border-dashed`:`bg-paper-2 ring-1 ring-border-soft`),children:[(0,f.jsx)(a,{type:`target`,position:n.Top}),(0,f.jsx)(a,{type:`target`,id:`in`,position:n.Right}),(0,f.jsx)(`span`,{className:u(`inline-flex size-6 shrink-0 items-center justify-center rounded-md`,e.tone),children:(0,f.jsx)(t,{className:`size-3.5`})}),(0,f.jsx)(`span`,{className:`truncate font-medium text-[0.8125rem] text-ink`,children:e.title}),(0,f.jsx)(a,{type:`source`,position:n.Bottom}),(0,f.jsx)(a,{type:`source`,id:`out`,position:n.Right})]})}function y({sourceX:e,sourceY:t,targetX:n,targetY:r,label:a,markerEnd:o}){let c=Math.max(e,n)+g,l=[`M ${e} ${t}`,`H ${c-8}`,`Q ${c} ${t} ${c} ${t+8}`,`V ${r-8}`,`Q ${c} ${r} ${c-8} ${r}`,`H ${n}`].join(` `);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s,{path:l,markerEnd:o,style:{strokeDasharray:`5 4`}}),(0,f.jsx)(i,{children:(0,f.jsx)(`div`,{style:{width:_,transform:`translate(${c+8}px, ${(t+r)/2}px) translateY(-50%)`},className:`absolute text-[0.6875rem] text-ink-2 leading-snug`,children:a})})]})}var b={step:v},x={branch:y};function S(e){let t={markerEnd:{type:o.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}},n=e.map((e,t)=>({id:e.id,type:`step`,position:{x:0,y:t*68},data:{title:e.title,icon:e.icon,tone:e.tone,optional:e.optional},draggable:!1})),r=[],i=!1;return e.forEach((n,a)=>{let o=e[a+1];for(let[a,o]of(n.branches??[]).entries())e.some(e=>e.id===o.to)&&(i=!0,r.push({id:`b-${n.id}-${a}`,type:`branch`,source:n.id,sourceHandle:`out`,target:o.to,targetHandle:`in`,label:o.when,...t}));o&&r.push({id:`n-${n.id}`,type:`straight`,source:n.id,target:o.id,...t})}),{nodes:n,edges:r,width:p+(i?162:0),height:e.length*68-h}}function C({steps:e}){let{nodes:n,edges:i,width:a,height:o}=(0,d.useMemo)(()=>S(e),[e]);return e.length?(0,f.jsx)(`div`,{className:`max-w-full`,style:{width:a,height:o+4},children:(0,f.jsx)(r,{children:(0,f.jsx)(t,{nodes:n,edges:i,nodeTypes:b,edgeTypes:x,defaultViewport:{x:1,y:2,zoom:1},minZoom:1,maxZoom:1,nodesConnectable:!1,nodesDraggable:!1,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,proOptions:{hideAttribution:!0}})})}):null}export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,at as n,c as r,et as i,j as a,r as o,s}from"./i18n-DVrYWJaj.js";import{n as c,t as l}from"./jsx-runtime-C3cWAN_r.js";import{t as u}from"./media-gjOIWMWK.js";import{_ as d,d as f}from"./ui-CW2I3ecu.js";import{g as p}from"./session-BYLtgklo.js";import"./ui-DfVpZYIW.js";var m=e(c(),1),h=e(l(),1),g=`cubic-bezier(0.3, 0.7, 0.2, 1)`,_=`(max-width: 639px)`;function v({tone:e=`ground`,ink:t}){let n=r(),a=p(),s=o();return s?(0,h.jsx)(y,{langs:[`en`,s],value:n,onPick:e=>{i(e)&&a(e)},tone:e,ink:t}):null}function y({langs:e,value:t,onPick:r,tone:i=`ground`,ink:a,label:o}){let c=u(_),l=(0,m.useRef)({}),[f,p]=(0,m.useState)(null),v=e=>o?o(e):n(e),y=e.join(`|`);(0,m.useLayoutEffect)(()=>{let e=()=>{let e={};for(let[t,n]of Object.entries(l.current))e[t]=n?Math.ceil(n.getBoundingClientRect().width):0;p(e)};e(),document.fonts?.ready.then(e)},[y]);let b=e=>f?(f[e===t&&!c?`${e}-full`:`${e}-short`]??0)+24:void 0,x=f?e.slice(0,e.indexOf(t)).reduce((e,t)=>e+(b(t)??0),0):0,S=`300ms ${g}`,C=i===`ground`;return(0,h.jsxs)(`fieldset`,{className:d(`relative inline-flex items-center rounded-full border-0 p-0.5 ring-1`,C?`bg-white/10 ring-white/15`:`bg-paper-2 ring-border-soft`),children:[(0,h.jsx)(`legend`,{className:`sr-only`,children:s(`nav.language`)}),f?(0,h.jsx)(`span`,{"aria-hidden":`true`,className:d(`absolute top-0.5 bottom-0.5 left-0.5 rounded-full shadow-sm motion-reduce:transition-none`,C?`bg-white`:`bg-card`),style:{width:b(t),transform:`translateX(${x}px)`,transition:`transform ${S}, width ${S}`}}):null,e.map(e=>{let n=e===t;return(0,h.jsxs)(`button`,{"aria-pressed":n,className:d(`relative h-7 cursor-pointer overflow-hidden whitespace-nowrap rounded-full font-medium text-[0.75rem] motion-reduce:transition-none`,C?n?`text-[oklch(32%_0.15_262)]`:`text-white/70`:n?`text-ink`:`text-ink-3`),lang:e,onClick:()=>{n||r(e)},style:{width:b(e),transition:`width ${S}, color ${S}`,...C&&n&&a?{color:a}:{}},title:v(e),type:`button`,children:[[v(e),e.toUpperCase()].map((e,t)=>{let r=n&&!c?t===0:t===1;return(0,h.jsx)(`span`,{"aria-hidden":!r,className:`absolute inset-0 grid place-items-center motion-reduce:transition-none`,style:{opacity:+!!r,transition:`opacity 220ms ${g}`},children:e},`${t}:${e}`)}),(0,h.jsx)(`span`,{ref:t=>{l.current[`${e}-full`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:v(e)}),(0,h.jsx)(`span`,{ref:t=>{l.current[`${e}-short`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:e.toUpperCase()}),(0,h.jsx)(`span`,{className:`invisible px-3`,children:n?v(e):e.toUpperCase()})]},e)})]})}function b(){let e=r(),n=p();return(0,h.jsx)(f,{className:`w-44`,value:e,onChange:e=>{i(e)&&n(e)},options:t.map(e=>({value:e,label:a[e]}))})}export{y as n,v as r,b as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$t as t,Yt as n,en as r}from"./host-Dw-sMUSd.js";import{$ as i,ar as a,zr as o}from"./ui-DfVpZYIW.js";import{n as s,t as c}from"./jsx-runtime-C3cWAN_r.js";var l=e(s(),1),u=e(c(),1),d=e=>[`models`,`local`,e];function f(e,t=!0){return a({queryKey:d(e),queryFn:()=>i.get(`/api/studio/local/servers/${e}`),enabled:t,retry:!1,refetchInterval:e=>r(e.state.data)?1500:!1})}function p({server:e,...r}){let i=o(),{data:a}=f(e),s=a?.installed.map(e=>e.name).join(` `);return(0,l.useEffect)(()=>{s!==void 0&&i.invalidateQueries({queryKey:[`models`],exact:!0})},[s,i]),(0,u.jsx)(n,{children:(0,u.jsx)(t,{...r,state:a,onState:t=>i.setQueryData(d(e),t)})})}export{f as n,p as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FlowPreview-DjQvcWxs.js","assets/rolldown-runtime-XKyaHtl9.js","assets/esm-CpFD3UPd.js","assets/jsx-runtime-C3cWAN_r.js","assets/with-selector-DNNxLmGI.js","assets/react-dom-BwXff0Px.js","assets/ui-CW2I3ecu.js","assets/texts-ClKS2xhh.js","assets/ui-DfVpZYIW.js","assets/marked.esm-BfGIZK7F.js","assets/i18n-DVrYWJaj.js","assets/preload-helper-Cj7BV335.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as n,J as r,V as i,b as a,bt as o,ft as s,n as c,nt as l,ot as u,pt as d,s as f,wt as p}from"./i18n-DVrYWJaj.js";import{$ as m,Bn as h,Cn as g,Ln as _,Or as ee,Sn as v,Un as y,Vn as b,Z as x,_r as S,an as C,ar as w,bn as te,cn as ne,ft as re,hr as T,mn as ie,on as E,or as ae,rr as D,vr as O,zr as oe}from"./ui-DfVpZYIW.js";import{t as se}from"./useMutation-BnkuLlQC.js";import{d as k,n as A,s as j,u as ce}from"./marked.esm-BfGIZK7F.js";import{n as le,r as ue,t as de}from"./volume-2-Br71vpS5.js";import{t as fe}from"./eye-CG1LzvNI.js";import{n as M,t as pe}from"./list-checks-D1zkXlZa.js";import{t as me}from"./plug-CHvl1GhO.js";import{n as he,t as ge}from"./jsx-runtime-C3cWAN_r.js";import{n as _e,p as ve}from"./brand-DY3lzrOd.js";import{c as ye,s as be}from"./engenty-Cy7MbUxR.js";import{_ as N,f as P,i as xe,n as Se,r as F,t as I}from"./ui-CW2I3ecu.js";import{b as Ce,h as we,m as Te,u as Ee,y as De}from"./session-BYLtgklo.js";import{t as Oe}from"./preload-helper-Cj7BV335.js";var ke=class extends T{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:S(t,n.data),hasPreviousPage:O(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function Ae(e,t){return ae(e,ke,t)}var je={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};je.node;var L=k(je),Me={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Me.node;var R=k(Me),Ne={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Ne.node;var Pe=k(Ne),Fe={name:`circle-euro`,size:24,node:[[`path`,{d:`M15 9.4a4 4 0 1 0 0 5.2`,key:`1makmb`}],[`path`,{d:`M7 12h5`,key:`gblrwe`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Fe.node;var Ie=k(Fe),Le={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};Le.node;var z=k(Le),Re={name:`cloud-off`,size:24,node:[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Re.node;var ze=k(Re),Be={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};Be.node;var Ve=k(Be),He={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};He.node;var B=k(He),Ue={name:`git-fork`,size:24,node:[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]};Ue.node;var V=k(Ue),We={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};We.node;var H=k(We),Ge={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Ge.node;var Ke=k(Ge),qe={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};qe.node;var Je=k(qe),Ye={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};Ye.node;var Xe=k(Ye),Ze={name:`scan-text`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}]]};Ze.node;var Qe=k(Ze),$e={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};$e.node;var U=k($e),et={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};et.node;var tt=k(et),nt={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};nt.node;var rt=k(nt),W=t(he(),1);function it(){return w({queryKey:[`config`],queryFn:async()=>{let e=await m.get(`/api/config`);return re(e.publicUrl),e},staleTime:6e4})}function at(){let e=we(),t=it();return e.data?.features??t.data?.features??De()}function ot(e){return Ce(at(),e)}var st=[`text`,`web`,`browser`,`documents`,`image`,`video`,`speech`,`listening`,`code`,`connectors`,`motion-graphics`],ct=new Set([`html`,`md`,`txt`,`csv`,`json`]),lt=new Set([`code`]),ut=new Set([`web_search`,`browser`,`sandbox`,`image`]),dt=new Set([`web_fetch`,`http`]),ft=/\{\{\s*memory\b/;function pt(e){switch(e.type){case`agent`:return[e.instructions];case`tool`:return[...e.call?[JSON.stringify(e.call.input)]:[],...Object.values(e.data?.params??{}).map(e=>e.includes(`{{`)?e:`{{${r(e)}}}`)];case`code`:return[...Object.values(e.code.input),...Object.values(e.data?.params??{})].map(e=>e.includes(`{{`)?e:`{{${r(e)}}}`);case`decision`:return[e.instructions];case`generate`:return[e.prompt,e.options?.style??``];case`motion-graphics`:return[e.brief];case`widget`:case`surface`:return Object.values(e.data).map(e=>`{{${r(e)}}}`);case`form`:return Object.values(e.data??{}).map(e=>`{{${r(e)}}}`);default:return[]}}function mt(e,t){return e.steps.slice(t+1).some(e=>e.type===`agent`||e.type===`decision`||e.type===`generate`||e.type===`motion-graphics`)}function ht(e,t){let i=[],a=(t,n)=>{let r=i.find(e=>e.need===t);r?r.hard||=n:i.push({stepId:e.id,need:t,hard:n})},c=t.steps.indexOf(e);for(let t of pt(e))ft.test(t)&&a(`memory`,!0),o(t).some(e=>e.startsWith(`lists.`))&&a(`lists`,!0);switch(e.type){case`form`:(e.timeout||e.remind)&&a(`wait`,!0),Object.values(e.data??{}).some(e=>u(r(e)))&&a(`lists`,!0);for(let n of e.fields){switch(n.kind){case`audio`:a(`field:audio`,!!n.required);break;case`connection`:a(`field:connection`,!0);break;case`slot`:a(`field:slot`,!0);break;case`list`:a(`lists`,!0);break;case`location`:a(`field:location`,!1);break;case`image`:a(`field:image`,!1);break;case`file`:mt(t,c)?a(`field:file-read`,!0):a(`field:file`,!1)}n.optionsFrom&&u(r(n.optionsFrom).split(`.`).slice(0,2).join(`.`))&&a(`lists`,!0)}break;case`tool`:{let t=e.call&&`tool`in e.call?s(e.call.tool):null;t&&a(`plugin:${t.plugin}`,!0);break}case`agent`:for(let t of e.tools){let e=s(t);e?a(`plugin:${e.plugin}`,!0):n(t)?a(`wizard-code`,!0):dt.has(t)||lt.has(t)||(ut.has(t)?a(`tool:${t}`,!0):a(`tool:${t}`,!1))}e.connections?.length&&a(`connections`,!0),e.foreach&&(u(r(e.foreach))?a(`lists`,!0):a(`each`,!1));break;case`generate`:e.asset!==`document`&&e.asset!==`dashboard`&&a(`asset:${e.asset}`,!0);break;case`motion-graphics`:a(`motion-graphics`,!0);break;case`widget`:a(e.video?`widget:video`:`widget`,!0);break;case`surface`:Object.values(e.data).some(e=>u(r(e)))&&a(`lists`,!0);break;case`wait`:a(`wait`,!0);break;case`review`:e.show.some(e=>u(e))&&a(`lists`,!0),(e.timeout||e.remind||e.approve)&&a(`wait`,!0);break;case`result`:for(let n of e.deliverables){if(u(n.from)){a(`lists`,!0);continue}let e=t.steps.find(e=>e.id===n.from);if(e?.type!==`agent`&&e?.type!==`decision`&&(e?.type!==`generate`||e.asset!==`document`&&e.asset!==`dashboard`))continue;let r=n.formats.some(e=>ct.has(e));for(let t of n.formats)ct.has(t)||(t!==`pdf`||e?.type!==`agent`&&e?.type!==`decision`)&&a(`format:${t}`,t!==`pdf`&&!r)}}return i}function gt(e){let t=e.steps.flatMap(t=>ht(t,e));e.lists?.length&&!t.some(e=>e.need===`lists`)&&t.push({stepId:e.steps[0]?.id??``,need:`lists`,hard:!0}),e.connections?.length&&!t.some(e=>e.need===`connections`)&&t.push({stepId:e.steps[0]?.id??``,need:`connections`,hard:!0});let n=yt(e);return{fit:t.some(e=>e.hard&&n.has(e.stepId))?`no`:t.length?`less`:`full`,notes:t}}function _t(e){switch(e){case`tool:web_search`:case`tool:web_fetch`:return`web`;case`tool:browser`:return`browser`;case`tool:sandbox`:case`wizard-code`:return`code`;case`tool:image`:case`asset:image`:return`image`;case`asset:video`:case`motion-graphics`:case`widget:video`:return`video`;case`asset:voice`:return`speech`;case`field:audio`:return`listening`;case`tool:http`:case`connections`:case`field:connection`:return`connectors`;case`field:image`:case`field:file`:case`field:file-read`:return`documents`;default:return null}}function vt(e){let t=gt(e),n=yt(e),r=new Set,i=new Set,a=new Set,o=new Set;for(let e of t.notes){if(e.need.startsWith(`plugin:`)){a.add(e.need.slice(7));continue}if(e.need.startsWith(`format:`)){o.add(e.need.slice(7));continue}let t=_t(e.need);t&&(e.hard&&n.has(e.stepId)?r.add(t):i.add(t))}for(let e of r)i.delete(e);return{...t,missing:[...r],optional:[...i],needs:[...a].sort(),without:[...o]}}function yt(e){return e.steps.length?bt(e,e.steps[0].id,{}):new Set}function bt(e,t,n){let r=new Map(e.steps.map((e,t)=>[e.id,t])),i=r.get(t)??0,a=t=>{let i=[];for(let a of e.steps[t].next??[]){if(l(a))continue;let t=a.goto===`end`?e.steps.length:r.get(a.goto)??-1;if(a.ask||!p(a.when).every(e=>e in n))t>=0&&i.push(t);else if(d(a,n))return t>=0?[...i,t]:i}return i.push(xt(e,t,r)),i},o=t=>{if(t===i)return!1;let n=new Set([i]),r=[i];for(;r.length;){let i=r.shift();if(i>=e.steps.length)return!0;for(let e of a(i))e!==t&&!n.has(e)&&(n.add(e),r.push(e))}return!1};return new Set(e.steps.filter((e,t)=>!o(t)).map(e=>e.id))}function xt(e,t,n){let r=e.steps[t].next?.find(l)?.goto;return r===void 0?t+1:r===`end`?e.steps.length:n.get(r)??t+1}new Set(i);var St=[`text`,`document`,`table`,`image`,`video`,`audio`,`dashboard`],Ct=[`any`,`trades`,`gastronomy`,`hospitality`,`realEstate`,`retail`,`health`,`professional`,`agency`,`events`,`publicSector`],wt=[`marketing`,`sales`,`accounting`,`service`,`research`,`hr`,`operations`,`website`,`visuals`,`inquiries`,`advice`],Tt=[`free`,`pro`],Et={"format.text":`Text`,"format.document":`Document (PDF, Word)`,"format.table":`Table`,"format.image":`Image`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Any industry`,"industry.trades":`Trades`,"industry.gastronomy":`Food service`,"industry.hospitality":`Hotels & tourism`,"industry.realEstate":`Real estate`,"industry.retail":`Retail`,"industry.health":`Health`,"industry.professional":`Professional services`,"industry.agency":`Agency & marketing`,"industry.events":`Events`,"industry.publicSector":`Associations & public sector`,"useCase.marketing":`Marketing & social media`,"useCase.sales":`Offers & sales`,"useCase.accounting":`Accounting & receipts`,"useCase.service":`Customer service`,"useCase.research":`Research & analysis`,"useCase.hr":`HR & applications`,"useCase.operations":`Planning & operations`,"useCase.website":`Website helpers`,"useCase.visuals":`Images & video`,"useCase.inquiries":`Inquiries & bookings`,"useCase.advice":`Advice & pricing`,"capability.text":`Writes text`,"capability.web":`Web search`,"capability.browser":`Drives a browser`,"capability.documents":`Reads documents & photos`,"capability.image":`Makes images`,"capability.video":`Makes video`,"capability.speech":`Speech output`,"capability.listening":`Understands voice notes`,"capability.code":`Runs code`,"capability.connectors":`Connected accounts & systems`,"capability.motion-graphics":`Motion graphics with Claude Code (on your subscription)`,"cost.low":`low cost`,"cost.medium":`medium cost`,"cost.high":`high cost`,"plan.free":`Free`,"plan.pro":`Pro`,"outline.otherwise":`otherwise`,"outline.and":`{first} and {second}`,"outline.or":`{first} or {second}`,"outline.not":`not {condition}`,"outline.with":`with {name}`,"outline.without":`without {name}`,"outline.contains":`{name} contains {value}`},Dt={en:Et,de:{"format.text":`Text`,"format.document":`Dokument (PDF, Word)`,"format.table":`Tabelle`,"format.image":`Bild`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Jede Branche`,"industry.trades":`Handwerk`,"industry.gastronomy":`Gastronomie`,"industry.hospitality":`Hotel & Tourismus`,"industry.realEstate":`Immobilien`,"industry.retail":`Handel`,"industry.health":`Gesundheit`,"industry.professional":`Kanzlei & Beratung`,"industry.agency":`Agentur & Marketing`,"industry.events":`Veranstaltungen`,"industry.publicSector":`Vereine & Öffentliches`,"useCase.marketing":`Marketing & Social Media`,"useCase.sales":`Angebote & Verkauf`,"useCase.accounting":`Buchhaltung & Belege`,"useCase.service":`Kundenservice`,"useCase.research":`Recherche & Analyse`,"useCase.hr":`Personal & Bewerbungen`,"useCase.operations":`Planung & Abläufe`,"useCase.website":`Helfer für die Website`,"useCase.visuals":`Bilder & Video`,"useCase.inquiries":`Anfragen & Termine`,"useCase.advice":`Beratung & Preise`,"capability.text":`Text schreiben`,"capability.web":`Websuche`,"capability.browser":`Browser bedienen`,"capability.documents":`Dokumente & Fotos lesen`,"capability.image":`Bilder erzeugen`,"capability.video":`Videos erzeugen`,"capability.speech":`Sprachausgabe`,"capability.listening":`Sprachnotizen verstehen`,"capability.code":`Code ausführen`,"capability.connectors":`Verbundene Konten & Systeme`,"capability.motion-graphics":`Motion-Grafik mit Claude Code (auf deinem Abo)`,"cost.low":`günstig`,"cost.medium":`mittel`,"cost.high":`teuer`,"plan.free":`Kostenlos`,"plan.pro":`Pro`,"outline.otherwise":`sonst`,"outline.and":`{first} und {second}`,"outline.or":`{first} oder {second}`,"outline.not":`nicht {condition}`,"outline.with":`mit {name}`,"outline.without":`ohne {name}`,"outline.contains":`{name} enthält {value}`}};function Ot(e,t,n,r){let i=`${e}.${t}`;return i in Et?a(Dt,i,n,r):t}function kt(e,t){return e?`connection`in e?`${e.connection} · ${e.action}`:e.tool:t?t.sql.replace(/\s+/g,` `).slice(0,90):``}function At(e){switch(e.type){case`form`:return pe;case`agent`:return ue;case`tool`:return me;case`code`:return b;case`decision`:return V;case`generate`:return e.asset===`image`?M:e.asset===`video`?E:e.asset===`dashboard`?Ke:j;case`widget`:return L;case`surface`:return Je;case`motion-graphics`:return z;case`review`:return fe;case`wait`:return H;case`result`:return B}return C}var jt={form:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,decision:`bg-ember-tint text-ember-strong`,tool:`bg-ember-tint text-ember-strong`,code:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,surface:`bg-ember-veil text-ember-strong`,"motion-graphics":`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,wait:`bg-cobalt-tint text-cobalt`,result:`bg-paper-2 text-ink-2`},Mt={m:`wait.minutes`,h:`wait.hours`,d:`wait.days`};function Nt(e){let t=/^(\d+)([mhd])$/.exec(e??``);return t?t[0]===`1d`?f(`wait.day`):f(Mt[t[2]],{n:t[1]}):null}function Pt(e){if(e.signal){let{key:t,name:n,timeout:r}=e.signal,i=n===`message.received`?f(`inspector.waitFromPerson`):n===`mail.received`?t.startsWith(`thread:`)?f(`wait.mailThread`):f(`wait.mail`,{key:t}):f(`wait.signal`,{key:t});return r?f(`wait.signalTimeout`,{waits:i,time:Nt(r)??r}):i}let t=Nt(e.for);if(t)return t;let n=Date.parse(e.until??``),r=Number.isNaN(n)?e.until??``:new Intl.DateTimeFormat(c,{dateStyle:`medium`,timeStyle:`short`}).format(n);return f(`wait.until`,{date:r})}function Ft(e){return f(`type.${e.type}`)}var It=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`,`code`];function Lt(e){return It.includes(e)?f(`tool.${e}`):e}function Rt(e){switch(e.type){case`form`:return e.fields.map(e=>e.label).join(` · `);case`agent`:return e.tools.map(Lt).join(` · `)||e.instructions.slice(0,90);case`tool`:return kt(e.call,e.data);case`code`:return e.code.entry;case`decision`:return e.output.fields.map(e=>e.description??e.id).join(` · `);case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`surface`:return e.candidates?e.candidates.map(e=>e.id).join(` · `):Object.keys(e.data).join(`, `);case`motion-graphics`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?f(`editor.reviewEditable`):null,e.regenerate?f(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`wait`:return Pt(e);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var zt=e({MarketplaceCards:()=>pn}),G=t(ge(),1),Bt=(0,W.lazy)(()=>Oe(()=>import(`./FlowPreview-DjQvcWxs.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Vt={useCase:``,industry:``,format:``,capability:``,plan:``,version:``},K=(e,t)=>Ot(e,t,c),Ht={en:Pe,de:Ie};function Ut(e){if(e<1)return 1;let t=10**Math.floor(Math.log10(e));return Math.round(e/t)*t}function Wt(e){return e.credits?f(`market.credits`,{n:Ut(e.credits.credits)}):K(`cost`,e.costTier)}var Gt={text:rt,document:j,table:ne,image:M,video:E,audio:y,dashboard:R};function q({format:e,className:t}){let n=Gt[e],r=K(`format`,e);return(0,G.jsx)(`span`,{title:r,className:`inline-flex`,children:(0,G.jsx)(n,{className:t,"aria-label":r,role:`img`})})}var Kt=[`low`,`medium`,`high`];function J({entry:e}){let t=Kt.indexOf(e.costTier)+1,n=Ht[c];return(0,G.jsxs)(`span`,{title:Wt(e),className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex shrink-0`,children:Kt.slice(0,t).map((e,t)=>(0,G.jsx)(`span`,{className:N(`rounded-full bg-(--coin-bg,var(--color-card))`,t>0&&`-ml-1.5`),children:(0,G.jsx)(n,{className:`size-4`})},e))}),K(`cost`,e.costTier)]})}function qt(){return(0,G.jsx)(F,{tone:`ember`,title:f(`market.proHint`),children:f(`market.pro`)})}function Jt({plugin:e}){return(0,G.jsx)(F,{icon:(0,G.jsx)(Xe,{className:`size-3.5`}),title:f(`market.fromPlugin`,{name:e.name}),children:e.name})}function Y({entry:e,onOpen:t,why:n}){let r=e.usable&&e.missing.length>0&&!e.needs?.length;return(0,G.jsxs)(Se,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:N(`relative flex min-h-[124px] cursor-pointer flex-col gap-5 p-4 text-left transition sm:min-h-[136px] sm:p-5 hover:shadow-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,(!e.usable||!!e.needs?.length)&&`opacity-60`),children:[(0,G.jsx)(`span`,{className:N(`-top-4 pointer-events-none absolute right-4`,r&&`opacity-60`),children:(0,G.jsx)(_e,{kind:e.avatar,costume:e.costume,size:68})}),(0,G.jsxs)(`div`,{className:N(`min-w-0 pr-20`,r&&`opacity-60`),children:[(0,G.jsxs)(`div`,{className:`font-display font-semibold text-[0.9375rem]`,children:[e.title,e.plan===`pro`?(0,G.jsx)(`span`,{className:`ml-1.5 inline-flex align-middle`,children:(0,G.jsx)(qt,{})}):null,e.starred?(0,G.jsx)(U,{className:`ml-1.5 inline size-3.5 fill-amber align-[-2px] text-amber`,"aria-label":f(`market.starred`)}):null]}),e.featured?(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(F,{tone:`ember`,children:f(`market.recommended`)})}):null,(0,G.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:e.pitch})]}),(0,G.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-x-3 gap-y-1.5 text-[0.75rem] text-ink-3`,children:[n?(0,G.jsx)(F,{children:n}):null,e.plugin?(0,G.jsx)(Jt,{plugin:e.plugin}):null,e.needs?.length?(0,G.jsx)(F,{tone:`warn`,children:f(`market.needsPro`,{list:e.needs.join(`, `)})}):e.usable&&e.missing.length?(0,G.jsx)(Qt,{missing:e.missing}):e.usable?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(_,{className:`size-3.5`}),` `,f(`market.minutes`,{n:e.effort.minutes})]}),(0,G.jsx)(J,{entry:e}),e.optional?.length?(0,G.jsx)(F,{title:f(`market.optionalHint`,{list:Z(e.optional)}),children:f(`market.without`,{list:Z(e.optional)})}):null,(0,G.jsx)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,children:e.formats.map(e=>(0,G.jsx)(q,{format:e,className:`size-4`},e))})]}):(0,G.jsx)(F,{tone:`warn`,children:f(`market.needsUpdate`)})]})]})}function X({title:e,children:t}){return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:e}),t]})}var Z=e=>e.map(e=>K(`capability`,e)).join(`, `),Yt={text:`text`,documents:`text`,image:`image`,video:`video`,speech:`speech`,listening:`listening`,"motion-graphics":`claude`};function Xt(e,t){let n=Z(e),r=e.includes(`motion-graphics`),i=e.filter(e=>e!==`motion-graphics`);if(r&&t&&!i.length)return{path:null,action:`market.setUpModels`,hint:f(`market.motionCloud`)};let a=r&&!t?`motion-graphics`:i[0],o=a?Yt[a]:void 0;return{path:o?`/settings/models?show=${o}`:`/settings/models`,action:a===`motion-graphics`?`market.setUpClaude`:`market.setUpModels`,hint:a===`motion-graphics`?f(`market.motionHint`):f(`market.missingHint`,{list:n})}}function Zt(e){return Xt(e,we().data?.mode===`managed`)}function Qt({missing:e}){let t=D(),n=Zt(e);return(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,G.jsx)(`span`,{title:n.hint,className:`min-w-0 rounded-xl bg-amber-tint px-2.5 py-1 font-medium text-[0.75rem] text-ink-2 leading-snug [overflow-wrap:anywhere]`,children:n.path?f(`market.missing`,{list:Z(e)}):f(`market.motionCloudShort`)}),n.path?(0,G.jsx)(I,{size:`sm`,variant:`secondary`,onClick:e=>{e.stopPropagation(),t(n.path)},onKeyDown:e=>e.stopPropagation(),children:f(n.action)}):null]})}var $t={text:te,web:le,browser:v,documents:Qe,image:M,video:E,speech:de,listening:g,code:tt,connectors:me,"motion-graphics":z};function en(e){switch(e.type){case`form`:return pe;case`agent`:return ue;case`decision`:return V;case`generate`:return e.asset===`image`?M:e.asset===`video`?E:e.asset===`voice`?de:e.asset===`dashboard`?R:j;case`widget`:return e.video?z:L;case`surface`:return L;case`motion-graphics`:return z;case`review`:return fe;case`wait`:return H;case`result`:return B}return C}function tn(e){let t=new Set;for(let[n,r]of e.entries())for(let i of r.branches??[]){let r=i.to===`end`?e.length:e.findIndex(e=>e.id===i.to);for(let i=n+1;i<r;i++)t.add(e[i].id)}return t}function nn(e){let t=tn(e);return e.map(e=>({id:e.id,title:e.title,icon:en(e),tone:jt[e.type]??`bg-paper-2 text-ink-2`,optional:t.has(e.id),branches:e.branches}))}function Q({title:e,children:t}){return(0,G.jsx)(`span`,{title:e,className:`inline-flex items-center gap-2 border-border border-l px-4 first:border-l-0 first:pl-0`,children:t})}function rn({icon:e,children:t,more:n}){return(0,G.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,G.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-[0.875rem] text-ink leading-snug`,children:t}),n?(0,G.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 leading-snug`,children:n}):null]})]})}function an({className:e,children:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)({above:!1,below:!1});(0,W.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let t=e.scrollTop>1,n=e.scrollTop+e.clientHeight<e.scrollHeight-1;i(e=>e.above===t&&e.below===n?e:{above:t,below:n})};t(),e.addEventListener(`scroll`,t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),()=>{e.removeEventListener(`scroll`,t),r.disconnect()}},[]);let a=`linear-gradient(to bottom, ${r.above?`transparent`:`black`} 0, black 28px, black calc(100% - 44px), ${r.below?`transparent`:`black`} 100%)`;return(0,G.jsx)(`div`,{ref:n,className:e,style:{maskImage:a,WebkitMaskImage:a},children:(0,G.jsx)(`div`,{children:t})})}var on=2e4;function $({id:e,fallback:t,onClose:n,onUse:r,busy:i}){let a=oe(),o=D(),s=w({queryKey:[`marketplace-entry`,e,c],queryFn:({signal:t})=>m.get(`/api/studio/marketplace/${encodeURIComponent(e)}?lang=${c}`,AbortSignal.any([t,AbortSignal.timeout(on)])),enabled:!!e,retry:!1}),l=s.data??t,u=Zt(l?.missing??[]),d=se({mutationFn:t=>{let n=`/api/studio/marketplace/${encodeURIComponent(e)}/star`;return t?m.put(n):m.del(n)},onSuccess:()=>Promise.all([a.invalidateQueries({queryKey:[`marketplace`]}),a.invalidateQueries({queryKey:[`marketplace-entry`,e]})])}),p=ve()===`dark`,h=be[ye[l?.avatar||`round`]],g=p?`var(--card)`:`color-mix(in oklch, ${h??`var(--ink-4)`} 14%, var(--paper-2))`;return(0,G.jsx)(xe,{open:!!e,onClose:n,wide:!0,bare:!0,children:l?(0,G.jsxs)(`div`,{className:`relative flex max-h-[calc(100dvh-48px)] flex-col rounded-2xl bg-card shadow-overlay max-sm:h-dvh max-sm:max-h-none max-sm:rounded-none`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":f(`common.close`),onClick:n,className:`sm:-top-3.5 sm:-right-3.5 absolute top-3 right-3 z-20 flex size-9 items-center justify-center rounded-full bg-card text-ink-2 shadow-elevated ring-1 ring-border-soft transition hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,children:(0,G.jsx)(A,{className:`size-4`})}),(0,G.jsxs)(`header`,{className:`relative shrink-0 border-border-soft border-b px-5 pt-5 pb-4 text-ink sm:rounded-t-2xl sm:px-7`,style:{background:g,"--coin-bg":g},children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden sm:rounded-t-2xl`,children:(0,G.jsx)(`span`,{className:N(`-top-28 -right-10 absolute size-80 rounded-full bg-white blur-3xl`,p?`opacity-[0.14]`:`opacity-80`)})}),(0,G.jsx)(`div`,{className:`-bottom-5 absolute right-9 z-10 max-sm:hidden`,children:(0,G.jsx)(_e,{kind:l.avatar,costume:l.costume,size:104})}),(0,G.jsxs)(`div`,{className:`relative sm:pr-36`,children:[(0,G.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight max-sm:pr-10`,children:l.title}),(0,G.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-snug`,children:s.data?.description||l.pitch})]}),l.usable?(0,G.jsxs)(`div`,{className:`-mx-5 sm:-mx-7 relative mt-3.5 flex flex-wrap items-center gap-y-2 border-border-soft border-t px-5 pt-3 font-medium text-[0.875rem] sm:px-7 sm:pr-40`,children:[(0,G.jsxs)(Q,{title:f(`market.duration`),children:[(0,G.jsx)(_,{className:`size-4 text-ink-3`}),f(`market.minutes`,{n:l.effort.minutes})]}),(0,G.jsx)(Q,{title:f(`market.cost`),children:(0,G.jsx)(J,{entry:l})}),(0,G.jsx)(Q,{title:f(`market.result`),children:l.formats.map(e=>(0,G.jsx)(q,{format:e,className:`size-4`},e))})]}):null]}),l.usable?(0,G.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-7 gap-y-6 px-5 pt-6 max-sm:overflow-y-auto max-sm:pb-4 sm:grid-cols-[230px_minmax(0,1fr)] sm:grid-rows-[minmax(0,1fr)] sm:px-7`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-5 sm:min-h-0 sm:overflow-y-auto`,children:[(0,G.jsx)(X,{title:f(`market.duration`),children:(0,G.jsx)(rn,{icon:(0,G.jsx)(_,{className:`size-4 text-moss`}),more:f(`market.durationHint`,{n:l.effort.fields}),children:f(`market.minutes`,{n:l.effort.minutes})})}),(0,G.jsx)(X,{title:f(`market.cost`),children:(0,G.jsx)(rn,{icon:(0,G.jsx)(Ve,{className:`size-4 text-amber`}),more:l.credits?f(`market.creditsHint`):void 0,children:(0,G.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,G.jsx)(J,{entry:l}),l.credits?(0,G.jsx)(`span`,{className:`text-ink-2`,children:f(`market.creditsRange`,{n:Ut(l.credits.credits)})}):null]})})}),(0,G.jsx)(X,{title:f(`market.result`),children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s.isLoading?(0,G.jsx)(P,{className:`size-4 text-ink-3`}):null,(s.data?.results??[]).map(e=>(0,G.jsx)(rn,{icon:(0,G.jsx)(q,{format:e.kind,className:`size-4 text-ember-strong`}),more:e.formats.map(e=>e.toUpperCase()).join(` · `),children:e.title},e.title))]})}),(0,G.jsxs)(X,{title:f(`market.needs`),children:[(0,G.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.capabilities.map(e=>{let t=$t[e],n=l.missing.includes(e),r=l.optional?.includes(e);return(0,G.jsxs)(`li`,{className:N(`flex items-center gap-2.5 text-[0.875rem]`,n?`text-ink-3`:`text-ink-2`),children:[(0,G.jsx)(t,{className:N(`size-4 shrink-0`,n?`text-rose`:r?`text-amber`:`text-cobalt`)}),K(`capability`,e),n?(0,G.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:f(`market.unavailable`)}):r?(0,G.jsx)(`span`,{className:`text-[0.75rem] text-amber`,children:f(`market.optional`)}):null]},e)})}),l.missing.length?(0,G.jsx)(`p`,{className:`mt-2.5 text-[0.8125rem] text-ink-3 leading-snug`,children:u.hint}):null]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col sm:min-h-0`,children:[(0,G.jsx)(`div`,{className:`mb-1.5 shrink-0 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:f(`market.steps`)}),(0,G.jsx)(an,{className:`-mr-2 overscroll-contain pt-1 pr-2 pl-1 sm:min-h-0 sm:flex-1 sm:overflow-y-auto`,children:s.isLoading?(0,G.jsx)(P,{className:`size-5 text-ink-3`}):s.isError?(0,G.jsxs)(`div`,{className:`flex flex-col items-start gap-2 text-[0.875rem] text-ink-2`,children:[(0,G.jsx)(`p`,{children:f(`market.detailFailed`)}),(0,G.jsx)(I,{variant:`secondary`,size:`sm`,busy:s.isFetching,onClick:()=>void s.refetch(),children:f(`market.retry`)})]}):(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(P,{className:`size-5 text-ink-3`}),children:(0,G.jsx)(Bt,{steps:nn(s.data?.outline??[])})})})]})]}):(0,G.jsx)(`div`,{className:`flex-1 px-5 pt-6 sm:px-7`,children:(0,G.jsx)(`p`,{className:`rounded-lg bg-amber-tint p-3 text-[0.875rem] text-ink-2`,children:f(`market.needsUpdateHint`)})}),(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2 px-5 pt-4 pb-5 max-sm:border-border-soft max-sm:border-t sm:px-7 sm:pb-6`,children:[l.plugin?(0,G.jsx)(`span`,{className:`mr-auto flex items-center`,children:(0,G.jsx)(Jt,{plugin:l.plugin})}):(0,G.jsxs)(I,{variant:`ghost`,className:`mr-auto`,title:f(`market.starHint`),"aria-pressed":l.starred,busy:d.isPending,onClick:()=>d.mutate(!l.starred),children:[(0,G.jsx)(U,{className:N(`size-4`,l.starred&&`fill-amber text-amber`)}),(0,G.jsx)(`span`,{className:`max-sm:sr-only`,children:f(l.starred?`market.starred`:`market.star`)})]}),(0,G.jsx)(I,{variant:`secondary`,onClick:n,children:f(`common.close`)}),l.usable&&l.missing.length&&u.path?(0,G.jsx)(I,{variant:`secondary`,onClick:()=>o(u.path),children:f(u.action)}):null,r?(0,G.jsx)(I,{disabled:!l.usable||l.missing.length>0||!!l.needs?.length,title:l.needs?.length?f(`market.needsProHint`,{list:l.needs.join(`, `)}):l.missing.length?u.hint:l.optional?.length?f(`market.optionalHint`,{list:Z(l.optional)}):void 0,busy:i,onClick:()=>r(l),children:f(`market.use`)}):null]})]}):(0,G.jsx)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 rounded-2xl bg-card p-8 text-[0.875rem] text-ink-2 shadow-overlay`,children:s.isLoading?(0,G.jsx)(P,{className:`size-6 text-ink-3`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{children:f(`market.notFound`)}),(0,G.jsx)(I,{variant:`secondary`,onClick:n,children:f(`common.close`)})]})})})}function sn({name:e,value:t,options:n,onChange:r}){let[i,a]=(0,W.useState)(!1),o=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(!i)return;let e=e=>{o.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let s=n.find(e=>e.value===t);return(0,G.jsxs)(`div`,{ref:o,className:`relative`,children:[(0,G.jsxs)(`div`,{className:N(`flex h-8 items-center rounded-full text-[0.8125rem] transition`,s?`bg-ember-tint text-ink`:`text-ink-2 hover:bg-paper-2 hover:text-ink`,i&&!s&&`bg-paper-2 text-ink`),children:[(0,G.jsx)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":i,onClick:()=>a(!i),className:N(`flex h-full items-center gap-1.5 rounded-full pl-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,s?`pr-1`:`pr-2.5`),children:s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,G.jsx)(`span`,{className:`font-medium`,children:s.label})]}):(0,G.jsxs)(G.Fragment,{children:[e,(0,G.jsx)(h,{className:N(`size-3.5 transition`,i&&`rotate-180`)})]})}),s?(0,G.jsx)(`button`,{type:`button`,"aria-label":`${e}: ${f(`market.reset`)}`,onClick:()=>r(``),className:`mr-1 flex size-6 items-center justify-center rounded-full text-ink-3 hover:bg-card hover:text-ink`,children:(0,G.jsx)(A,{className:`size-3.5`})}):null]}),i?(0,G.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`absolute top-full left-0 z-30 mt-1.5 max-h-80 min-w-60 overflow-y-auto rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:n.map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.value===t,disabled:!e.count||e.unavailable,onClick:()=>{r(e.value===t?``:e.value),a(!1)},className:N(`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[0.875rem] transition coarse:py-2.5`,e.count&&!e.unavailable?`text-ink-2 hover:bg-paper-2 hover:text-ink`:`text-ink-4`,e.value===t&&`font-medium text-ink`),children:[e.icon,(0,G.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:e.label}),e.value===t?(0,G.jsx)(ce,{className:`size-4 text-ember`}):e.unavailable?(0,G.jsx)(`span`,{className:`whitespace-nowrap text-[0.75rem] text-ink-4`,children:f(`market.unavailable`)}):(0,G.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:e.count})]},e.value))}):null]})}function cn(e,t){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var ln=60;function un({query:e,onUse:t,busy:n,limit:r=6}){let[i,a]=(0,W.useState)(null),o=cn(e.trim(),250),s=w({queryKey:[`marketplace`,c,o,`hits`,r],queryFn:()=>m.get(`/api/studio/marketplace?${new URLSearchParams({lang:c,limit:String(r),offset:`0`,q:o})}`),enabled:!!o,placeholderData:ee}),l=o?s.data?.entries??[]:[];return l.length?(0,G.jsxs)(`section`,{className:`mt-10`,children:[(0,G.jsxs)(`h2`,{className:`mb-5 flex items-center gap-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:[f(`market.hits`),s.isFetching?(0,G.jsx)(P,{className:`size-3.5`}):null]}),(0,G.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:l.map(e=>(0,G.jsx)(Y,{entry:e,onOpen:()=>a(e.id)},e.id))}),(0,G.jsx)($,{id:i,fallback:l.find(e=>e.id===i)??null,onClose:()=>a(null),onUse:t,busy:n})]}):null}function dn(){let e=w({queryKey:[`marketplace`,c,`fit`],queryFn:()=>m.get(`/api/studio/marketplace?${new URLSearchParams({lang:c,limit:`12`,offset:`0`,fit:`1`})}`)});return e.data?.context&&e.data.entries.some(e=>e.fit)?e.data:null}function fn({page:e,organization:t,onUse:n,busy:r,onAll:i}){let[a,o]=(0,W.useState)(null),s=e.context??{sector:null,sectorName:null},c=e.entries,l=e=>e.fit===`sector`||e.fit===`industry`?s.sectorName:e.fit===`wish`?f(`market.fitWish`):null;return(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`h2`,{className:`mt-16 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:f(`market.fitTitle`,{organization:t})}),(0,G.jsx)(`p`,{className:`mt-2 mb-5 text-center text-[0.875rem] text-ink-3`,children:s.sectorName?f(`market.fitLine`,{sector:s.sectorName}):f(`market.fitLinePlain`)}),(0,G.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:c.map((e,t)=>(0,G.jsx)(`div`,{className:N(`contents`,t>=4&&`max-sm:hidden`,t>=8&&`sm:max-lg:hidden`),children:(0,G.jsx)(Y,{entry:e,why:l(e),onOpen:()=>o(e.id)})},e.id))}),(0,G.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,G.jsx)(I,{variant:`secondary`,onClick:i,children:f(`market.fitAll`,{n:e.all||e.total})})}),(0,G.jsx)($,{id:a,fallback:c.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:n,busy:r})]})}function pn({entries:e}){let t=oe(),n=D(),{space:r}=Ee(),i=Te()&&!!r&&!r?.readOnly,[a,o]=(0,W.useState)(null),s=se({mutationFn:e=>m.post(`/api/studio/wizards`,{spaceId:r.id,starterId:e,lang:c}),onSuccess:async({id:e})=>{await t.invalidateQueries({queryKey:x.spaces()}),await t.invalidateQueries({queryKey:[`wizards`]}),o(null),n(`/edit/${e}`)}});return(0,G.jsxs)(`div`,{className:`@container mt-3`,children:[(0,G.jsx)(`div`,{className:`flex flex-col gap-4 @xl:grid @xl:grid-cols-2`,children:e.map(e=>(0,G.jsx)(Y,{entry:e,onOpen:()=>o(e.id)},e.id))}),s.error?(0,G.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:s.error.message}):null,(0,G.jsx)($,{id:a,fallback:e.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:i?e=>!s.isPending&&s.mutate(e.id):void 0,busy:s.isPending})]})}function mn({onUse:e,busy:t,open:n,search:r,onGuestOpen:i}){let[a,o]=(0,W.useState)(``);(0,W.useEffect)(()=>{r&&o(r.text)},[r]);let[s,l]=(0,W.useState)(Vt),u=ot(`kernel`),[d,p]=(0,W.useState)(!1),[h,g]=(0,W.useState)(n??null),_=cn(a.trim(),250),v=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=v.current;_&&e&&window.matchMedia(`(max-width: 639px)`).matches&&e.scrollIntoView({behavior:`smooth`,block:`start`})},[_]);let y=Ae({queryKey:[`marketplace`,c,_,s,d],queryFn:({pageParam:e})=>{let t=new URLSearchParams({lang:c,limit:String(ln),offset:String(e)});_&&t.set(`q`,_);for(let[e,n]of Object.entries(s))n&&t.set(e,n);return d&&t.set(`starred`,`1`),m.get(`/api/${i?`guest`:`studio`}/marketplace?${t}`)},initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.entries.length,0);return n<e.total?n:void 0},placeholderData:ee}),b=y.data?.pages[0],x=y.data?.pages.flatMap(e=>e.entries)??[],S=b?.all??0,C=a.trim()!==_||y.isFetching&&!y.isFetchingNextPage,w=(e,t,n,r)=>n.filter(t=>b?.facets[e]?.[t]!==void 0).map(n=>({value:n,label:K(t,n),icon:r?.(n),count:(b?.facets[e])[n]??0,unavailable:e===`capability`&&te.has(n)})),te=new Set(b?.unavailable??[]),ne=w(`useCase`,`useCase`,wt),re=[{key:`industry`,name:f(`market.industry`),options:w(`industry`,`industry`,Ct)},{key:`format`,name:f(`market.format`),options:w(`format`,`format`,St,e=>(0,G.jsx)(q,{format:e,className:`size-4 text-ink-3`}))},{key:`plan`,name:f(`market.plan`),options:w(`plan`,`plan`,Tt)},{key:`capability`,name:f(`market.capability`),options:w(`capability`,`capability`,st,e=>{let t=$t[e];return(0,G.jsx)(t,{className:`size-4 text-ink-3`})})},...u&&Object.keys(b?.facets.version??{}).length?[{key:`version`,name:f(`market.version`),options:Object.entries(b?.facets.version??{}).sort(([e],[t])=>t.localeCompare(e,void 0,{numeric:!0})).map(([e,t])=>({value:e,label:e,count:t??0}))}]:[]],T=!!a.trim()||d||Object.values(s).some(Boolean),E=()=>{l(Vt),o(``),p(!1)};if(y.isLoading)return(0,G.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,G.jsx)(P,{className:`size-6 text-ink-3`})});let ae=b?.offline?(0,G.jsxs)(`p`,{className:`mt-4 flex items-center justify-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,G.jsx)(ze,{className:`size-4 shrink-0`}),f(`market.offline`)]}):null;if(!S&&!T)return ae;let D=a?(0,G.jsx)(`button`,{type:`button`,"aria-label":f(`market.reset`),onClick:()=>o(``),className:`-mr-1.5 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3 hover:bg-paper-2 hover:text-ink`,children:(0,G.jsx)(A,{className:`size-4`})}):null,O=e=>N(`inline-flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-full px-2.5 text-[0.78125rem] transition`,e?`bg-card font-medium text-ink shadow-soft ring-1 ring-border-soft`:`text-ink-3 hover:bg-card/60 hover:text-ink`);return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`label`,{ref:v,className:`relative mx-auto flex h-10 max-w-md scroll-mt-4 items-center gap-2.5 rounded-full bg-card px-4 shadow-soft ring-1 ring-border-soft transition focus-within:ring-2 focus-within:ring-focus sm:h-11`,children:[C?(0,G.jsx)(P,{className:`size-4 shrink-0 text-ink-3`}):(0,G.jsx)(ie,{className:`size-4 shrink-0 text-ink-3`}),(0,G.jsx)(`input`,{type:`search`,value:a,onChange:e=>o(e.target.value),placeholder:f(`market.search`),"aria-label":f(`market.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),D]}),ae,(0,G.jsxs)(`div`,{className:`max-sm:-mx-3 mt-4 flex gap-1 max-sm:overflow-x-auto max-sm:px-3 max-sm:[scrollbar-width:none] sm:flex-wrap sm:justify-center max-sm:[&::-webkit-scrollbar]:hidden`,children:[[{value:``,label:f(`market.all`)},...ne].map(e=>(0,G.jsx)(`button`,{type:`button`,"aria-pressed":!d&&s.useCase===e.value,onClick:()=>{p(!1),l({...s,useCase:e.value})},className:O(!d&&s.useCase===e.value),children:e.label},e.value)),i?null:(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":d,onClick:()=>p(!d),className:O(d),children:[(0,G.jsx)(U,{className:N(`size-3.5`,d&&`fill-amber text-amber`)}),f(`market.starred`)]})]}),(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-1 gap-y-2 sm:mt-6`,children:[d?null:re.map(e=>(0,G.jsx)(sn,{name:e.name,value:s[e.key],options:e.options,onChange:t=>l({...s,[e.key]:t})},e.key)),(0,G.jsxs)(`span`,{className:`ml-auto flex items-center gap-3 whitespace-nowrap pl-2 text-[0.8125rem] text-ink-3`,children:[T?(0,G.jsxs)(`button`,{type:`button`,onClick:E,className:`inline-flex items-center gap-1 text-ember-strong underline-offset-2 hover:underline`,children:[(0,G.jsx)(A,{className:`size-3.5 max-sm:size-4`}),(0,G.jsx)(`span`,{className:`max-sm:sr-only`,children:f(`market.resetShort`)})]}):null,T?(0,G.jsx)(`span`,{className:`tabular-nums sm:hidden`,children:f(`market.countOfShort`,{n:b?.total??0,all:S})}):null,(0,G.jsx)(`span`,{className:N(`tabular-nums`,T&&`max-sm:hidden`),children:T?f(`market.countOf`,{n:b?.total??0,all:S}):f(`market.count`,{n:S})})]})]}),x.length?(0,G.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:x.map(e=>(0,G.jsx)(Y,{entry:e,onOpen:()=>i?i(e):g(e.id)},e.id))}):(0,G.jsxs)(`div`,{className:`py-10 text-center text-[0.875rem] text-ink-3`,children:[(0,G.jsx)(`p`,{children:f(d?`market.noneStarred`:`market.none`)}),(0,G.jsx)(I,{variant:`ghost`,className:`mt-2`,onClick:E,children:f(`market.reset`)})]}),y.hasNextPage?(0,G.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,G.jsx)(I,{variant:`secondary`,busy:y.isFetchingNextPage,onClick:()=>void y.fetchNextPage(),children:f(`market.more`)})}):null,(0,G.jsx)($,{id:h,fallback:x.find(e=>e.id===h)??null,onClose:()=>g(null),onUse:e,busy:t})]})}export{ze as A,Xe as C,V as D,H as E,R as M,L as N,B as O,Ae as P,U as S,Ke as T,vt as _,zt as a,at as b,cn as c,Rt as d,Lt as f,_t as g,Ot as h,un as i,z as j,Ve as k,jt as l,Pt as m,mn as n,qt as o,Ft as p,fn as r,dn as s,$ as t,At as u,it as v,Je as w,rt as x,ot as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{y as t}from"./index-lQ4JYHYQ.js";import{Un as n,on as r,wn as i}from"./ui-DfVpZYIW.js";import{i as a,u as o}from"./marked.esm-BfGIZK7F.js";import{n as s}from"./volume-2-Br71vpS5.js";import{t as c}from"./list-checks-D1zkXlZa.js";import{er as l,tr as u}from"./host-Dw-sMUSd.js";import{t as d}from"./phone-CG7Bz_ZL.js";import{n as f,t as p}from"./jsx-runtime-C3cWAN_r.js";import{_ as m}from"./ui-CW2I3ecu.js";import{s as h}from"./i18n-DVrYWJaj.js";var g=e(f(),1),_=e(p(),1),v=[{id:`steps`,group:`web`,runner:`steps`,label:`new.ch.steps`,icon:c},{id:`chat`,group:`web`,runner:`chat`,label:`new.ch.chat`,icon:u},{id:`talk`,group:`web`,runner:`talk`,label:`new.ch.talk`,icon:n},{id:`video`,group:`web`,runner:`video`,label:`new.ch.video`,icon:r},{id:`call`,group:`phone`,runner:`call`,label:`new.ch.call`,icon:d},{id:`wacall`,group:`phone`,runner:`call`,label:`new.ch.whatsapp`,icon:null},{id:`sms`,group:`message`,runner:`sms`,label:`new.ch.sms`,icon:i},{id:`whatsapp`,group:`message`,runner:`whatsapp`,label:`new.ch.whatsapp`,icon:null}],y=[{id:`web`,label:`new.web`,icon:s},{id:`phone`,label:`new.phone`,icon:d},{id:`message`,label:`new.messages`,icon:l}],b=v.filter(e=>t.enabled.includes(e.id)).map(e=>e.id),x=e=>v.filter(t=>e.includes(t.id));function S(e){return e.length===b.length&&b.every(t=>e.includes(t))}function C(e){let n=x(e),r=[...new Set(n.map(e=>e.runner))];return{default:n.find(e=>e.group===`web`)?.runner??r[0]??t.default,enabled:r}}var w=e=>e.map(e=>h(e.label));function T(e){return v.find(t=>t.runner===e)}function E(e){return v.filter(t=>t.id!==`wacall`&&e.includes(t.runner)).map(e=>e.id)}function D(e){let t=x(e),n=y.flatMap(e=>{let n=w(t.filter(t=>t.group===e.id));return n.length?[e.id===`web`?n.join(`, `):`${h(e.label)}: ${n.join(`, `)}`]:[]});return`${h(`new.runsAs`)}: ${n.join(` · `)}`}function O(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function k({channel:e,className:t}){let n=e.icon;return n?(0,_.jsx)(n,{className:t??`size-4`}):(0,_.jsx)(`span`,{"aria-hidden":`true`,className:`font-semibold text-[0.625rem] tracking-wide`,children:`WA`})}function A(e){let t=new Set(e?.map(e=>e.id)??[`steps`,`chat`]);return v.filter(e=>t.has(e.runner))}function j({value:e,onChange:t,runners:n,without:r,disabled:i}){let a=A(n).filter(e=>!r?.includes(e.id)),s=t=>e.includes(t.id),c=n=>{i||s(n)&&e.length===1||t(s(n)?e.filter(e=>e!==n.id):[...e,n.id])},l=t=>{let n=y.find(e=>e.id===t),r=a.filter(e=>e.group===t);if(!(n&&r.length))return null;let l=n.icon;return(0,_.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,_.jsxs)(`legend`,{className:`flex items-center gap-1.5 px-2 pt-2 pb-1 text-[0.75rem] text-ink-3`,children:[(0,_.jsx)(l,{className:`size-3.5`}),` `,h(n.label)]}),r.map(t=>(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`label`,{className:m(`flex h-10 w-full cursor-pointer items-center gap-2.5 rounded-lg px-2 text-[0.875rem] transition hover:bg-accent has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus coarse:h-11`,s(t)&&`bg-paper-2`),children:[(0,_.jsx)(`span`,{className:`flex w-5 justify-center text-ink-3`,children:(0,_.jsx)(k,{channel:t})}),(0,_.jsx)(`span`,{className:`flex-1`,children:h(t.label)}),(0,_.jsx)(`input`,{type:`checkbox`,className:`sr-only`,"aria-label":h(t.label),checked:s(t),disabled:i,"aria-disabled":s(t)&&e.length===1,onChange:()=>c(t)}),(0,_.jsx)(`span`,{"aria-hidden":`true`,className:m(`flex size-[1.125rem] items-center justify-center rounded-md ring-1`,s(t)?`bg-ink text-paper ring-ink`:`ring-border`),children:s(t)?(0,_.jsx)(o,{className:`size-3`,strokeWidth:3}):null})]}),t.id===`call`&&s(t)?(0,_.jsx)(`p`,{className:`px-2 pb-1.5 pl-9 text-[0.75rem] text-ink-3`,children:h(`new.callHandoff`)}):null]},t.id))]})};return(0,_.jsxs)(`div`,{className:`grid gap-x-4 sm:grid-cols-2`,children:[l(`web`),(0,_.jsxs)(`div`,{className:`flex flex-col`,children:[l(`phone`),l(`message`)]})]})}function M({value:e,onChange:t,runners:n,className:r}){let[i,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(0),l=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!i)return;let e=e=>{l.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]);let u=A(n),d=y.filter(e=>u.some(t=>t.group===e.id)),f=t=>e.includes(t.id);return(0,_.jsxs)(`div`,{ref:l,className:m(`relative flex flex-wrap items-center gap-1.5`,r),children:[(0,_.jsx)(`span`,{className:`mr-0.5 px-1 text-[0.8125rem] text-ink-3`,children:h(`new.runsAs`)}),d.map(e=>{let t=w(u.filter(t=>t.group===e.id&&f(t))),n=e.icon;return(0,_.jsxs)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":`${h(e.label)}: ${t.length?t.join(`, `):h(`new.off`)}`,onClick:e=>{let t=e.currentTarget;c(t.offsetLeft+t.offsetWidth/2),o(e=>!e)},className:m(`inline-flex h-9 items-center justify-center gap-1.5 rounded-full font-medium text-[0.8125rem] transition coarse:h-11`,t.length?`bg-ink px-3 text-paper`:`w-9 text-ink-3 ring-1 ring-border hover:text-ink coarse:w-11`),children:[(0,_.jsx)(n,{className:`size-4 shrink-0`}),t.length?(0,_.jsx)(`span`,{className:`truncate`,children:O(t)}):null]},e.id)}),(0,_.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":h(`new.where`),onClick:e=>{let t=e.currentTarget;c(t.offsetLeft+t.offsetWidth/2),o(e=>!e)},className:`inline-flex size-9 items-center justify-center rounded-full text-ink-3 ring-1 ring-border transition hover:text-ink coarse:size-11`,children:(0,_.jsx)(a,{className:`size-4`})}),i?(0,_.jsxs)(`div`,{role:`dialog`,"aria-label":h(`new.where`),style:{transformOrigin:`${s}px top`},className:`absolute top-full left-0 z-20 mt-2 w-[min(32rem,calc(100vw-2rem))] animate-unfold rounded-2xl bg-card p-3 text-left shadow-overlay ring-1 ring-border`,children:[(0,_.jsx)(`p`,{className:`px-2 pt-1 font-semibold text-[0.9375rem]`,children:h(`new.where`)}),(0,_.jsx)(j,{value:e,onChange:t,runners:n})]}):null]})}export{D as a,S as c,M as i,C as l,k as n,T as o,j as r,E as s,y as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,s as n}from"./i18n-DVrYWJaj.js";import{c as r,n as i,o as a,r as o,s,t as c}from"./Marketplace-4baBNzEc.js";import{$ as l,Gn as u,Or as d,Qn as f,Xt as p,Z as m,Zn as h,ar as g,d as _,f as v,l as y,m as b,mt as x,p as S,rr as C,s as ee,u as te,zr as ne}from"./ui-DfVpZYIW.js";import{t as w}from"./useMutation-BnkuLlQC.js";import{i as re}from"./marked.esm-BfGIZK7F.js";import{n as ie,t as T}from"./jsx-runtime-C3cWAN_r.js";import{n as ae}from"./brand-DY3lzrOd.js";import{h as oe,i as E,m as D,t as se,u as O}from"./session-BYLtgklo.js";import{Wt as ce}from"./host-Dw-sMUSd.js";import{_ as k,g as le,i as A,r as j,t as M}from"./ui-CW2I3ecu.js";import{t as N}from"./upload-BZThm-R6.js";import{a as ue,c as P,i as de,l as fe}from"./NewWizardChannels-B_xHm-bI.js";var F=[[`id`,8],[`toolId`,10],[`moduleId`,7],[`pluginId`,6],[`title`,6],[`description`,4],[`tags`,3],[`path`,3],[`inputSchema`,2],[`outputSchema`,2],[`request`,1],[`response`,1]];function I(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase()}function L(e){return I(e).split(/[^a-z0-9]+/).map(e=>e.trim()).filter(e=>e.length>1)}function R(e){return e==null?``:Array.isArray(e)?e.map(R).filter(Boolean).join(` `):typeof e==`object`?Object.values(e).map(R).filter(Boolean).join(` `):String(e)}function z(e,t){let n=t.map(([t,n])=>({text:R(e[t]),weight:n})).filter(e=>e.text.length>0);return{fields:n,tokens:n.flatMap(e=>L(e.text))}}function B(e){let t=[e];if(e.length<5)return t;if(e.endsWith(`ing`)){let n=e.slice(0,-3);n.length>=3&&t.push(n,`${n}e`)}else if(e.endsWith(`ies`)&&e.length>=6)t.push(`${e.slice(0,-3)}y`);else if(e.endsWith(`es`))t.push(e.slice(0,-2),e.slice(0,-1));else if(e.endsWith(`ed`)){let n=e.slice(0,-2);t.push(n,`${n}e`)}else e.endsWith(`s`)&&!e.endsWith(`ss`)&&t.push(e.slice(0,-1));return[...new Set(t)]}function V(e,t){if(e===t)return 1;let n=0;for(let r of B(e))for(let i of B(t))r===i?n=Math.max(n,r===e&&i===t?1:.75):(r.length>=2&&i.startsWith(r)&&(n=Math.max(n,.55*(r.length/i.length))),i.length>=4&&r.startsWith(i)&&(n=Math.max(n,.4*(i.length/r.length))));return n}function H(e,t){return e.reduce((e,n)=>e+V(t,n),0)}function U(e,t,n=F){if(!t?.trim())return 0;let r=L(t);if(r.length===0)return 0;let i=z(e,n);return i.tokens.length===0?0:r.reduce((e,t)=>H(i.tokens,t)===0?e:e+i.fields.reduce((e,n)=>{let r=L(n.text),i=H(r,t);if(i===0)return e;let a=i*2.2/(i+1.2+r.length/16);return e+n.weight*a},0),0)}var W=new Set(L(`aber als also am an auch auf aus bei bin bitte brauche brauchen braucht das dass dem den der
|
|
2
|
+
des die dies diese dieser doch du ein eine einem einen einer eines er es etwas fuer für gerne
|
|
3
|
+
habe haben hat ich ihr im in ist kann können koennen mache machen mag mein meine meinem meinen
|
|
4
|
+
meiner mich mir mit möchte moechte nach nicht noch nur oder sich sie sind soll suche suchen
|
|
5
|
+
sucht um und uns unser unsere vom von vor was wie will wir wird wo wollen zu zum zur
|
|
6
|
+
a about an and are as at be can do for from have how i in is it like looking me my need of on
|
|
7
|
+
or our that the this to want we what which who with would you your`)),G=e=>e.replace(/ß/g,`ss`);function pe(e){let t=L(G(e)),n=t.filter(e=>!W.has(e));return n.length?n:t}var K=e=>e.trim().split(/\s+/).filter(Boolean).length>=3,q=e(ie(),1),J=e(T(),1);function me({variant:e=`secondary`,label:t=n(`home.import`)}){let r=C(),i=ne(),{space:a}=O(),o=D(),s=(0,q.useRef)(null),c=w({mutationFn:e=>l.upload(`/api/studio/spaces/${a.id}/wizards/import`,e),onSuccess:async({id:e})=>{await i.invalidateQueries({queryKey:m.spaces()}),await i.invalidateQueries({queryKey:[`wizards`]}),r(`/edit/${e}`)}}),u=c.error instanceof p?c.error.body?.issues??[]:[];return!o||a?.readOnly?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(M,{variant:e,busy:c.isPending,disabled:!a,onClick:()=>s.current?.click(),children:[(0,J.jsx)(N,{className:`size-4`}),` `,t]}),(0,J.jsx)(`input`,{ref:s,hidden:!0,type:`file`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&c.mutate(t)}}),(0,J.jsxs)(A,{open:c.isError,onClose:c.reset,title:n(`import.failed`),children:[(0,J.jsx)(`p`,{className:`text-[0.875rem] text-ink-2`,children:c.error?.message}),u.length?(0,J.jsx)(`ul`,{className:`mt-3 flex list-disc flex-col gap-1 pl-5 text-[0.8125rem] text-ink-2`,children:u.slice(0,8).map(e=>(0,J.jsx)(`li`,{children:e.message},e.message))}):null,(0,J.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,J.jsx)(M,{variant:`secondary`,onClick:c.reset,children:n(`common.close`)})})]})]})}var Y=10,X=3;async function he(e,n){let r=await fetch(x(`/api/studio/wizards/${e}/files/${encodeURIComponent(n.name)}`),{method:`PUT`,credentials:`include`,headers:{"content-type":n.type||`application/octet-stream`,"accept-language":t},body:n});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??r.statusText)}}function ge(e,t){let n=pe(t);if(!n.length)return[];let r=e.map(e=>({w:e,score:U({title:e.title,summary:e.description},n.join(` `),[[`title`,10],[`summary`,6]])})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score),i=K(t)?(r[0]?.score??0)*.4:0;return r.filter(e=>e.score>=i).slice(0,X).map(e=>e.w)}function _e({wish:e,spaceId:i,busy:o,onTake:s,onMore:u}){let f=C(),[p,m]=(0,q.useState)(null),h=r(e.trim(),300),_=g({queryKey:[`wizards`,i,`similar`],queryFn:()=>l.get(`/api/studio/spaces/${i}/wizards`)}),v=g({queryKey:[`marketplace`,t,h,`similar`],queryFn:()=>l.get(`/api/studio/marketplace?${new URLSearchParams({lang:t,limit:String(Y),offset:`0`,q:h})}`),enabled:h.length>=3,placeholderData:d});if(h.length<3)return null;let y=ge(_.data??[],h),b=(v.data?.entries??[]).slice(0,Y-y.length),x=(v.data?.total??0)-b.length;if(!(y.length||b.length))return null;let S=`flex items-center gap-3 rounded-xl bg-card py-2 pr-2 pl-3.5 ring-1 ring-border-soft`;return(0,J.jsxs)(`section`,{className:`mt-5`,children:[(0,J.jsx)(`h2`,{className:`mb-2 px-1 text-[0.8125rem] text-ink-3`,children:n(`new.similar`)}),(0,J.jsxs)(`ul`,{className:`flex flex-col gap-1.5`,children:[y.map(e=>(0,J.jsxs)(`li`,{className:S,children:[(0,J.jsx)(j,{children:n(`new.yours`)}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>f(`/edit/${e.id}`),className:`min-w-0 flex-1 text-left`,children:[(0,J.jsx)(`span`,{className:`block truncate font-medium text-[0.9375rem]`,children:e.title}),(0,J.jsx)(`span`,{className:`block truncate text-[0.8125rem] text-ink-3`,children:e.description})]}),(0,J.jsx)(M,{variant:`secondary`,size:`sm`,onClick:()=>f(`/edit/${e.id}`),children:n(`new.open`)})]},e.id)),b.map(e=>(0,J.jsxs)(`li`,{className:S,children:[(0,J.jsx)(j,{children:n(`new.template`)}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>m(e.id),className:`min-w-0 flex-1 text-left`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.title}),e.plan===`pro`?(0,J.jsx)(a,{}):null]}),(0,J.jsx)(`span`,{className:`block truncate text-[0.8125rem] text-ink-3`,children:e.pitch})]}),(0,J.jsx)(M,{variant:`secondary`,size:`sm`,disabled:o,onClick:()=>s(e),children:n(`new.take`)})]},e.id))]}),x>0?(0,J.jsx)(`button`,{type:`button`,onClick:()=>u(h),className:`mt-2 px-1 text-[0.875rem] text-ink-2 hover:text-ink coarse:min-h-11`,children:n(`new.more`,{n:x})}):null,(0,J.jsx)(c,{id:p,fallback:b.find(e=>e.id===p)??null,onClose:()=>m(null),onUse:s,busy:o})]})}function ve(){ce({ownInput:!0});let e=C(),r=ne(),{space:a}=O(),c=D(),d=oe(),p=s(),[x,ie]=(0,q.useState)(!1),[T]=h(),[A,j]=(0,q.useState)(()=>T.get(`wish`)??E()??``),N=(0,q.useRef)(E()!==null),[F,I]=(0,q.useState)([`steps`]),[L,R]=(0,q.useState)([]),[z,B]=(0,q.useState)(!1),[V,H]=(0,q.useState)(null),U=(0,q.useRef)(null),W=(0,q.useRef)(null),G=(0,q.useRef)(null),[pe]=b(),K=S(A,j,{deviceId:pe.deviceId}),Y=g({queryKey:[`runners`],queryFn:()=>l.get(`/api/studio/runners`)}),X=e=>{let t=e.map(te);R(e=>[...e.filter(e=>!t.some(t=>t.name===e.name)),...t])},[ge,ve]=(0,q.useState)(new Map),[ye,be]=(0,q.useState)(null);(0,q.useEffect)(()=>{let e=new Map(L.map(e=>[e,URL.createObjectURL(e)]));return ve(e),()=>{for(let t of e.values())URL.revokeObjectURL(t)}},[L]);let xe=L.map(e=>({name:e.name,mime:e.type,size:e.size,url:ge.get(e)})),Z=w({mutationFn:e=>l.post(`/api/studio/wizards`,{spaceId:a.id,starterId:e,lang:t}),onSuccess:async({id:t})=>{await r.invalidateQueries({queryKey:m.spaces()}),await r.invalidateQueries({queryKey:[`wizards`]}),e(`/edit/${t}`)}}),Q=w({mutationFn:async()=>{let e=G.current??(await l.post(`/api/studio/wizards`,{spaceId:a.id,lang:t})).id;G.current=e,P(F)||await l.patch(`/api/studio/wizards/${e}`,{runners:fe(F)});for(let t of L)await he(e,t);return e},onSuccess:async t=>{se(),await r.invalidateQueries({queryKey:m.spaces()}),await r.invalidateQueries({queryKey:[`wizards`]});let i=A.trim();P(F)||(i+=`\n\n${ue(F)}`),L.length&&(i+=`\n\n${n(`editor.attached`)}: ${L.map(e=>e.name).join(`, `)}`),e(`/edit/${t}?prompt=${encodeURIComponent(i)}`)}}),Se=()=>{A.trim()&&a&&!Q.isPending&&(K.listening&&K.stop(),Q.mutate())};if((0,q.useEffect)(()=>{N.current&&a&&c&&!a.readOnly&&A.trim()&&(N.current=!1,Q.mutate())},[a,c,A,Q]),!c||a?.readOnly)return(0,J.jsx)(f,{to:`/`,replace:!0});let $=Q.error??Z.error;return(0,J.jsxs)(`div`,{className:`animate-rise md:pt-4`,children:[(0,J.jsxs)(`div`,{className:`mx-auto max-w-2xl`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,J.jsx)(`div`,{className:`size-[84px] md:size-auto`,children:(0,J.jsx)(`div`,{className:`origin-top-left scale-[0.56] md:scale-100`,children:(0,J.jsx)(ae,{kind:`sprout`,size:150,fluffy:!0})})}),(0,J.jsx)(`h1`,{className:`mt-1 font-display font-semibold text-[1.5rem] leading-tight tracking-tight md:mt-2 md:text-[2.375rem]`,children:n(`new.title`)}),(0,J.jsx)(`p`,{className:`mt-2 max-w-lg text-[0.9375rem] text-ink-3 leading-relaxed`,children:n(`new.lead`)})]}),(0,J.jsx)(de,{value:F,onChange:I,runners:Y.data,className:`mt-4 px-1 md:mt-8`}),(0,J.jsxs)(`div`,{className:k(`relative mt-3 rounded-2xl bg-card p-2 shadow-elevated ring-1 ring-border-soft focus-within:ring-focus`,z&&`ring-2 ring-focus`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),B(!0))},onDragLeave:()=>B(!1),onDrop:e=>{e.preventDefault(),B(!1),X(Array.from(e.dataTransfer.files).map(y))},children:[L.length?(0,J.jsx)(`ul`,{className:`flex flex-wrap gap-2 px-2 pt-2 pb-1`,children:xe.map((e,t)=>(0,J.jsx)(v,{file:e,onOpen:()=>be(t),onRemove:()=>R(e=>e.filter((e,n)=>n!==t))},`${e.name}-${t}`))}):null,(0,J.jsx)(_,{files:xe,at:ye,onAt:be}),(0,J.jsx)(le,{autoFocus:!0,minRows:4,value:A,onChange:e=>j(e.target.value),onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&(e.preventDefault(),X(t.map(y)))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&Se()},placeholder:K.listening?n(`editor.listening`):n(`new.placeholder`),className:`border-0 bg-transparent text-[1rem] shadow-none focus:ring-0`}),(0,J.jsxs)(`div`,{className:`@container flex items-center gap-2 px-1 pb-1`,children:[(0,J.jsx)(`button`,{type:`button`,"aria-label":n(`editor.attach`),title:n(`editor.attach`),onClick:()=>W.current?.click(),className:`inline-flex size-10 shrink-0 items-center justify-center rounded-full border border-border text-ink transition hover:bg-paper-2 coarse:size-11`,children:(0,J.jsx)(re,{className:`size-4`})}),(0,J.jsx)(`input`,{ref:W,type:`file`,multiple:!0,hidden:!0,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,X(t)}}),K.supported?(0,J.jsx)(ee,{speech:K,labelled:!0}):null,(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.75rem] text-ink-4`,children:z?n(`new.dropHint`):null}),(0,J.jsxs)(M,{size:`md`,onClick:Se,busy:Q.isPending,disabled:!A.trim()||Z.isPending,children:[n(`new.build`),` `,(0,J.jsx)(u,{className:`size-4`})]})]})]}),(0,J.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-ink-3`,children:n(`new.hint`)}),K.error?(0,J.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:K.error===`denied`?n(`editor.micDenied`):K.error}):null,$?(0,J.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-rose`,children:$.message}):null,a?(0,J.jsx)(_e,{wish:A,spaceId:a.id,busy:Z.isPending||Q.isPending,onTake:e=>!Z.isPending&&Z.mutate(e.id),onMore:e=>{H({text:e}),U.current?.scrollIntoView({behavior:`smooth`,block:`start`})}}):null]}),p&&!x?(0,J.jsx)(`div`,{className:`mx-auto max-w-5xl`,children:(0,J.jsx)(o,{page:p,organization:d.data?.tenant.name??``,busy:Z.isPending,onUse:e=>a&&!Z.isPending&&Z.mutate(e.id),onAll:()=>ie(!0)})}):null,(0,J.jsxs)(`section`,{ref:U,className:k(`mx-auto max-w-5xl scroll-mt-6`,p&&!x&&!V&&`hidden`),children:[(0,J.jsx)(`h2`,{className:`mt-16 mb-5 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:n(`new.orStarter`)}),(0,J.jsx)(i,{open:T.get(`starter`),search:V,busy:Z.isPending,onUse:e=>a&&!Z.isPending&&Z.mutate(e.id)})]}),(0,J.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,J.jsx)(me,{variant:`ghost`,label:n(`new.import`)})})]})}export{ve as NewWizardPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./useMutation-BnkuLlQC.js";import{$ as n,Gn as r,Z as i,Zn as a,ar as o,m as s,p as c,rr as ee,s as l,zr as te}from"./ui-DfVpZYIW.js";import{s as u,u as d}from"./marked.esm-BfGIZK7F.js";import{t as ne}from"./upload-BZThm-R6.js";import{n as f,t as p}from"./jsx-runtime-C3cWAN_r.js";import{c as m,n as re}from"./brand-DY3lzrOd.js";import{t as h}from"./logo-xL-sneZz.js";import{n as g,s as _}from"./i18n-DVrYWJaj.js";import{_ as v}from"./ui-CW2I3ecu.js";import{_ as y,h as ie,i as ae,n as b,u as oe}from"./session-BYLtgklo.js";import{r as se}from"./LangSwitch-BuzsLp16.js";var x=new Set([`gmail.com`,`googlemail.com`,`gmx.at`,`gmx.de`,`gmx.net`,`web.de`,`outlook.com`,`hotmail.com`,`live.com`,`icloud.com`,`me.com`,`yahoo.com`,`yahoo.de`,`aon.at`,`a1.net`,`chello.at`,`t-online.de`,`proton.me`,`protonmail.com`]),ce={website:`Website`,blog:`Blog`,linkedin:`LinkedIn`,instagram:`Instagram`,facebook:`Facebook`,youtube:`YouTube`,x:`X`,xing:`XING`,tiktok:`TikTok`},le=[[`linkedin`,/(^|\.)linkedin\.com$/],[`instagram`,/(^|\.)instagram\.com$/],[`facebook`,/(^|\.)(facebook|fb)\.com$/],[`youtube`,/(^|\.)(youtube\.com|youtu\.be)$/],[`x`,/(^|\.)(x|twitter)\.com$/],[`xing`,/(^|\.)xing\.com$/],[`tiktok`,/(^|\.)tiktok\.com$/]];function ue(e){let t=e.trim();if(!t||/\s/.test(t))return null;try{let e=new URL(/^https?:\/\//i.test(t)?t:`https://${t}`);return e.hostname.includes(`.`)?e.href:null}catch{return null}}function de(e){let t=ue(e);if(!t)return`website`;let{hostname:n,pathname:r}=new URL(t),i=n.toLowerCase().replace(/^www\./,``);for(let[e,t]of le)if(t.test(i))return e;return/^blog\./.test(i)||/^\/blog(\/|$)/.test(r)||/(^|\.)(medium|substack)\.com$/.test(i)?`blog`:`website`}var S=[{id:`bakeries`,industry:`gastronomy`,name:{de:`Bäckereien`,en:`Bakeries`},words:[`bäckerei`,`bäcker`,`backstube`,`brot`,`gebäck`,`konditorei`,`bakery`,`bread`,`pastry`]},{id:`cafes`,industry:`gastronomy`,name:{de:`Cafés`,en:`Cafés`},words:[`café`,`cafe`,`kaffeehaus`,`kaffee`,`coffee`,`espresso`]},{id:`restaurants`,industry:`gastronomy`,name:{de:`Restaurants`,en:`Restaurants`},words:[`restaurant`,`gasthaus`,`gasthof`,`wirtshaus`,`pizzeria`,`küche`,`speisekarte`,`menu`,`bistro`]},{id:`hotels`,industry:`hospitality`,name:{de:`Hotels und Pensionen`,en:`Hotels and guesthouses`},words:[`hotel`,`pension`,`zimmer`,`übernachtung`,`ferienwohnung`,`guesthouse`,`booking`,`rooms`]},{id:`architects`,industry:`professional`,name:{de:`Architekturbüros`,en:`Architects`},words:[`architekt`,`architektur`,`planung`,`entwurf`,`architect`,`architecture`]},{id:`lawFirms`,industry:`professional`,name:{de:`Kanzleien`,en:`Law firms`},words:[`rechtsanwalt`,`anwalt`,`kanzlei`,`recht`,`notar`,`law firm`,`lawyer`,`attorney`,`legal`]},{id:`taxAdvisors`,industry:`professional`,name:{de:`Steuerberatung`,en:`Tax advisors`},words:[`steuerberatung`,`steuerberater`,`steuer`,`buchhaltung`,`lohnverrechnung`,`bilanz`,`tax`,`accounting`,`bookkeeping`]},{id:`consultants`,industry:`professional`,name:{de:`Beratung`,en:`Consultants`},words:[`beratung`,`berater`,`consulting`,`coaching`,`consultant`]},{id:`physiotherapy`,industry:`health`,name:{de:`Physiotherapie`,en:`Physiotherapy`},words:[`physiotherapie`,`physio`,`massage`,`therapie`,`physiotherapy`]},{id:`practices`,industry:`health`,name:{de:`Arztpraxen`,en:`Doctors’ practices`},words:[`arzt`,`ärztin`,`praxis`,`ordination`,`zahnarzt`,`doctor`,`clinic`,`dentist`]},{id:`hairdressers`,industry:`retail`,name:{de:`Friseur und Kosmetik`,en:`Hair and beauty`},words:[`friseur`,`frisör`,`kosmetik`,`nagelstudio`,`beauty`,`hairdresser`,`salon`]},{id:`joiners`,industry:`trades`,name:{de:`Tischlereien`,en:`Joiners`},words:[`tischlerei`,`tischler`,`schreiner`,`möbel`,`holz`,`joinery`,`carpenter`,`furniture`]},{id:`electricians`,industry:`trades`,name:{de:`Elektrotechnik`,en:`Electricians`},words:[`elektriker`,`elektro`,`elektrotechnik`,`photovoltaik`,`electrician`,`electrical`]},{id:`plumbing`,industry:`trades`,name:{de:`Installateure`,en:`Plumbing and heating`},words:[`installateur`,`sanitär`,`heizung`,`klima`,`plumber`,`plumbing`,`heating`]},{id:`windows`,industry:`trades`,name:{de:`Fensterbau`,en:`Window makers`},words:[`fenster`,`türen`,`fensterbau`,`sonnenschutz`,`windows`,`doors`]},{id:`construction`,industry:`trades`,name:{de:`Bau und Handwerk`,en:`Building and trades`},words:[`bau`,`baumeister`,`maler`,`dachdecker`,`handwerk`,`construction`,`builder`,`painter`,`roofer`]},{id:`realEstate`,industry:`realEstate`,name:{de:`Immobilien`,en:`Real estate`},words:[`immobilien`,`makler`,`wohnung`,`miete`,`hausverwaltung`,`real estate`,`property`,`estate agent`]},{id:`onlineShops`,industry:`retail`,name:{de:`Online-Shops`,en:`Online shops`},words:[`online-shop`,`onlineshop`,`shop`,`versand`,`e-commerce`,`webshop`,`online store`]},{id:`retail`,industry:`retail`,name:{de:`Handel`,en:`Retail`},words:[`geschäft`,`handel`,`laden`,`boutique`,`retail`,`store`]},{id:`agencies`,industry:`agency`,name:{de:`Agenturen`,en:`Agencies`},words:[`agentur`,`werbung`,`marketing`,`design`,`kommunikation`,`agency`,`advertising`,`branding`]},{id:`photographers`,industry:`agency`,name:{de:`Fotografie`,en:`Photographers`},words:[`fotograf`,`fotografie`,`foto`,`photographer`,`photography`]},{id:`events`,industry:`events`,name:{de:`Veranstaltungen`,en:`Events`},words:[`event`,`veranstaltung`,`hochzeit`,`catering`,`konferenz`,`wedding`,`conference`]},{id:`itServices`,industry:`professional`,name:{de:`IT-Dienstleister`,en:`IT services`},words:[`it-dienstleister`,`it-service`,`software`,`webentwicklung`,`hosting`,`netzwerk`,`development`,`web design`]},{id:`cleaning`,industry:`trades`,name:{de:`Reinigung`,en:`Cleaning`},words:[`reinigung`,`gebäudereinigung`,`putz`,`cleaning`,`janitorial`]},{id:`footballClubs`,industry:`any`,name:{de:`Fußballvereine`,en:`Football clubs`},words:[`fußball`,`fussball`,`fc`,`sv`,`kicker`,`football`,`soccer`]},{id:`sportsClubs`,industry:`any`,name:{de:`Sportvereine`,en:`Sports clubs`},words:[`sportverein`,`verein`,`turnen`,`tennis`,`laufen`,`sport`,`club`]},{id:`musicClubs`,industry:`events`,name:{de:`Musikvereine und Chöre`,en:`Music clubs and choirs`},words:[`musikverein`,`blasmusik`,`chor`,`kapelle`,`orchester`,`band`,`choir`,`music`]},{id:`fireBrigades`,industry:`publicSector`,name:{de:`Feuerwehren`,en:`Fire brigades`},words:[`feuerwehr`,`rettung`,`rotes kreuz`,`fire brigade`,`rescue`]},{id:`schools`,industry:`publicSector`,name:{de:`Schulen und Bildung`,en:`Schools and education`},words:[`schule`,`kurs`,`weiterbildung`,`akademie`,`nachhilfe`,`school`,`course`,`training`]},{id:`municipalities`,industry:`publicSector`,name:{de:`Gemeinden`,en:`Municipalities`},words:[`gemeinde`,`stadt`,`bürgerservice`,`amt`,`municipality`,`council`,`town`]},{id:`associations`,industry:`any`,name:{de:`Vereine und Initiativen`,en:`Associations`},words:[`verein`,`initiative`,`ehrenamt`,`verband`,`association`,`nonprofit`,`charity`]}],C=e=>S.find(t=>t.id===e)??null;function fe(e,t=3){let n=` ${e.toLowerCase().normalize(`NFC`).replace(/[^\p{L}\p{N}-]+/gu,` `)} `;return S.map(e=>({id:e.id,score:e.words.reduce((e,t)=>e+(n.includes(` ${t}`)?Math.min(3,t.length/4):0),0)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,t).map(e=>e.id)}var w=e(f(),1),T=e(p(),1),pe=`oklch(50% 0.2 262)`,E=`oklch(32% 0.15 262)`,D=`oklch(90% 0.1 80)`,me={"--on":`white`,"--dot":D,"--ink-2":`oklch(96% 0.02 262)`,"--ink-3":`oklch(90% 0.035 262)`,"--moss":`oklch(90% 0.14 150)`,"--rose":`oklch(89% 0.09 45)`},O={kind:1,organization:1,site:2,details:3,know:4,space:5},he=e=>e!==null&&Object.hasOwn(O,e),ge=`w-full rounded-[18px] border border-white/30 bg-white/15 px-6 py-5 text-[1.375rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function _e(){return(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,T.jsx)(h,{size:28}),(0,T.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,T.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,T.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function k({children:e,busy:t,onClick:n,type:i=`button`}){return(0,T.jsxs)(`button`,{type:i,disabled:t,onClick:n,className:`inline-flex h-13 cursor-pointer items-center gap-2.5 rounded-full bg-white px-7 font-semibold text-[1rem] transition hover:bg-white/90 disabled:cursor-default disabled:opacity-70`,style:{color:E},children:[e,(0,T.jsx)(r,{className:`size-[18px]`})]})}function A({children:e,onClick:t}){return(0,T.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer font-semibold text-[0.9375rem] text-white/85 transition hover:text-white`,children:e})}function j({step:e,total:t=4}){return(0,T.jsx)(`span`,{className:`ml-auto inline-flex gap-1.5`,role:`img`,"aria-label":_(`onboard.step`,{n:e,total:t}),children:Array.from({length:t},(e,t)=>t+1).map(t=>(0,T.jsx)(`span`,{className:v(`size-2 rounded-full`,t===e?`bg-white`:`bg-white/40`)},t))})}var ve=[{kind:`personal`,label:`onboard.kindPersonal`,sub:`onboard.kindPersonalSub`},{kind:`club`,label:`onboard.kindClub`,sub:`onboard.kindClubSub`},{kind:`small`,label:`onboard.kindSmall`,sub:`onboard.kindSmallSub`},{kind:`corp`,label:`onboard.kindCorp`,sub:`onboard.kindCorpSub`}];function ye(e){let t=(e.split(`@`)[1]??``).trim().toLowerCase();return t?x.has(t)?{kind:`personal`,domain:t}:/(verein|club|klub|^sv-|^fc-|^ff-|feuerwehr|musik|chor)/.test(t)?{kind:`club`,domain:t}:{kind:`small`,domain:t}:{kind:null,domain:t}}var be={club:[`0-50`,`50-250`,`250-1000`,`1000+`],small:[`1`,`2-9`,`10-49`],corp:[`50-249`,`250-999`,`1000+`]},M=e=>Number(e).toLocaleString(g),xe=e=>{if(e===`1`)return _(`onboard.justMe`);if(e.endsWith(`+`))return`${M(e.slice(0,-1))}+`;let[t,n]=e.split(`-`);return t===`0`?`≤ ${M(n)}`:`${M(t)}–${M(n)}`},Se=[`sport`,`culture`,`social`,`education`,`environment`,`rescue`,`other`],Ce=[`chair`,`board`,`treasurer`,`secretary`,`member`],we=[`management`,`it`,`marketing`,`sales`,`operations`,`other`],Te=`w-full rounded-[14px] border border-white/30 bg-white/15 px-4 py-3 text-[1.0625rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function Ee({picked:e,label:t,sub:n,onClick:r}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:r,className:v(`flex cursor-pointer flex-col gap-1 rounded-[18px] border px-5 py-4 text-left transition`,e?`border-white bg-white/25`:`border-white/30 bg-white/10 hover:bg-white/15`),children:[(0,T.jsx)(`span`,{className:`font-display font-semibold text-[1.125rem]`,children:t}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:n})]})}function N({label:e,options:t,value:n,text:r,onChange:i}){return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:e}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":n===e,onClick:()=>i(e),className:v(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,n===e?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:n===e?{color:E}:void 0,children:r(e)},e))})]})}function P(e,t,n){let r=`${De}${e}:${t}`,[i,a]=(0,w.useState)(()=>{try{let e=sessionStorage.getItem(r);return e===null?n:JSON.parse(e)}catch{return n}});return(0,w.useEffect)(()=>{try{sessionStorage.setItem(r,JSON.stringify(i))}catch{}},[r,i]),[i,a]}var De=`wizards.onboarding:`;function Oe(){try{for(let e of Object.keys(sessionStorage))e.startsWith(De)&&sessionStorage.removeItem(e)}catch{}}function F(){return m(pe),ie().data?.onboarding===`welcome`?(0,T.jsx)(Me,{}):(0,T.jsx)(I,{})}function I(){let e=ie(),r=te(),s=ee(),{space:c}=oe(),l=e.data?.user.id??``,f=e.data?.onboarding===`organization`,p=f?4:5,m=e.data?.startingName?null:e.data?.tenant.name??null,[h,y]=P(l,`organization`,``),[b,x]=P(l,`line`,null),[le,S]=P(l,`ticked`,null),[C,O]=P(l,`own`,[``]),[M,De]=(0,w.useState)(null),[F,I]=(0,w.useState)([]),Me=(0,w.useRef)(null),[Pe]=(0,w.useState)(ae),[B]=(0,w.useState)(()=>f?{kind:null,domain:``}:ye(e.data?.user.email??``)),[V,Fe]=P(l,`profile`,{kind:B.kind,size:null,sector:``,role:null,need:``,questions:``,phone:``}),[Ie,Le]=a(),H=Ie.get(`page`),U=he(H)&&(H===`kind`||V.kind)&&!(f&&H===`space`)?H:`kind`,W=e=>Le(t=>{let n=new URLSearchParams(t);return n.set(`page`,e),n}),G=e=>Fe(t=>({...t,...e})),K=V.kind===`personal`,q=m??(h.trim()||null),J=o({queryKey:[`onboarding`,`suggest`],queryFn:()=>n.get(`/api/studio/onboarding/suggest`),enabled:!f&&!m&&!!V.kind&&!K,staleTime:1/0}).data?.site??null;(0,w.useEffect)(()=>{J&&!h&&y(J.name)},[J,h,y]);let Re=o({queryKey:[`onboarding`,`find`,q],queryFn:()=>n.post(`/api/studio/onboarding/find`,{name:q,lang:g}),enabled:U===`site`&&!K&&!!q,staleTime:1/0}),Y=Re.data?.addresses??[],X=le??Y.filter((e,t)=>e.kind!==`website`||!Y.slice(0,t).some(e=>e.kind===`website`)).map(e=>e.url),ze=C.map(e=>e.trim()).filter(e=>ue(e)),Z=[...X,...ze],Be=!K&&Re.isSuccess&&Y.length===0,[Ve,He]=P(l,`anyway`,!1),Ue=b!==null||Be&&!ze.length&&!Ve,We=t({mutationFn:()=>n.put(`/api/studio/organization/profile`,{kind:V.kind,size:V.size,sector:V.sector.trim()||null,role:V.role,need:V.need.trim()||null,questions:(V.questions??``).trim()||null,phone:V.phone.trim()||null,website:Z.find(e=>de(e)===`website`)??null,links:Z})}),Ge=t({mutationFn:e=>n.put(`/api/studio/organization`,{name:e})}),Ke=()=>{W(`site`),r.invalidateQueries({queryKey:[`organization`]}),r.invalidateQueries({queryKey:[`me`]})},Q=t({mutationFn:e=>n.post(`/api/studio/spaces/${c?.id}/website`,{urls:e,lang:g}),onSuccess:async e=>{let t=e?.sectors?.[0];t&&Fe(e=>e.sector?e:{...e,sector:t}),De(e??{name:``,about:!1,colors:0,fonts:0,logo:!1,facts:0,assets:0}),await r.invalidateQueries({queryKey:i.spaces()})}}),qe=t({mutationFn:e=>n.patch(`/api/studio/spaces/${c?.id}`,{brand:{about:e}}),onSuccess:()=>r.invalidateQueries({queryKey:i.spaces()})}),$=t({mutationFn:()=>n.post(`/api/studio/onboarding/done`),onSuccess:async()=>{Oe(),await r.invalidateQueries({queryKey:[`me`]}),s(`/new`,{replace:!0})}}),Je=e.data?.user.name??``,Ye=Je.includes(`@`)?``:Je.split(` `)[0],Xe=f&&m?_(`onboard.kickerNew`,{organization:m}):Ye?_(`onboard.kicker1`,{name:Ye}):_(`onboard.kicker1Anon`),Ze=(e,t)=>q&&!K?_(e,{organization:q}):_(t),Qe=async e=>{if(e&&c){for(let t of Array.from(e)){I(e=>[...e,{name:t.name,state:`uploading`}]);try{await n.upload(`/api/studio/spaces/${c.id}/files?kind=document`,t),I(e=>e.map(e=>e.name===t.name?{...e,state:`done`}:e))}catch{I(e=>e.map(e=>e.name===t.name?{...e,state:`failed`}:e))}}await r.invalidateQueries({queryKey:i.spaces()})}},$e=M?[M.about?_(`onboard.readAbout`):``,M.colors?_(`onboard.readColors`,{n:M.colors}):``,M.fonts?_(`onboard.readFonts`,{n:M.fonts}):``,M.logo?_(`onboard.readLogo`):``,M.facts?_(`onboard.readFacts`,{n:M.facts}):``,M.assets?_(`onboard.readAssets`,{n:M.assets}):``].join(``):``,et=[...new Set([...M?.sectors??[],...fe(`${q??``} ${b??``} ${V.questions??``}`,4)])].slice(0,4),tt=e=>`${window.location.host}/studio/${je(e)}`;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(se,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:[(0,T.jsx)(re,{kind:`drop`,size:240,fluffy:!0,coat:`fur`}),Pe?(0,T.jsxs)(`figure`,{className:`w-full max-w-sm rounded-[18px] bg-white/15 px-5 py-4`,children:[(0,T.jsx)(`figcaption`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:_(`onboard.wish`)}),(0,T.jsx)(`blockquote`,{className:`mt-1.5 line-clamp-6 whitespace-pre-line break-words text-[1rem] leading-relaxed`,children:Pe}),(0,T.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-white/75`,children:_(`onboard.wishNext`)})]}):null]}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[U===`kind`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),V.kind&&W(V.kind===`personal`||m?`site`:`organization`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:_(`onboard.kind`)}),(0,T.jsx)(z,{children:f&&m?_(`onboard.kindSubOrganization`,{organization:m}):_(`onboard.kindSub`)}),B.kind?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:_(`onboard.guess`,{domain:B.domain,kind:_(ve.find(e=>e.kind===B.kind)?.label??`onboard.kindSmall`)})}):null,(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:ve.map(e=>(0,T.jsx)(Ee,{picked:V.kind===e.kind,label:_(e.label),sub:_(e.sub),onClick:()=>G({kind:e.kind,size:e.kind===V.kind?V.size:null})},e.kind))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,children:_(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:p})]})]}):null,U===`organization`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=h.trim();t?Ge.mutate(t,{onSuccess:Ke}):W(`site`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:_(`onboard.organization`)}),(0,T.jsx)(z,{children:_(`onboard.organizationSub`)}),(0,T.jsx)(`input`,{value:h,onChange:e=>y(e.target.value),placeholder:_(`onboard.organizationPlaceholder`),maxLength:80,"aria-label":_(`onboard.organization`),className:ge}),h.trim()?(0,T.jsxs)(`p`,{className:`-mt-2 text-[0.9375rem] text-white/85`,children:[J&&h===J.name?`${_(`onboard.nameFrom`,{domain:new URL(J.url).host})} `:``,_(`onboard.address`),` `,(0,T.jsx)(`span`,{className:`font-mono text-[0.875rem]`,style:{color:D},children:tt(h)})]}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:Ge.isPending,children:_(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:p})]})]}):null,U===`site`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:K?_(`onboard.kicker2Personal`):Ze(`onboard.kicker2Named`,`onboard.kicker2`)}),(0,T.jsx)(R,{children:K?_(`onboard.linksPersonal`):Be&&!Ve&&q?_(`onboard.noneFound`,{name:q}):q?_(`onboard.siteNamed`,{organization:q}):_(`onboard.site`)}),(0,T.jsx)(z,{children:K?_(`onboard.linksPersonalSub`):Be&&!Ve&&q?_(`onboard.noneFoundSub`,{name:q}):Re.isPending?_(`onboard.searching`,{name:q??``}):_(`onboard.foundSub`)}),Ue?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=(b??``).trim();t?qe.mutate(t,{onSuccess:()=>W(`details`)}):W(`details`)},children:[(0,T.jsx)(ke,{value:b??``,onChange:x,rows:4,label:_(`onboard.line`),placeholder:_(K?`onboard.linePlaceholderPersonal`:`onboard.linePlaceholder`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>{x(null),He(!0),O(e=>e.length?e:[``])},className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,_(`onboard.addressAfterAll`)]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:qe.isPending,children:_(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:_(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:p})]})]}):(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),M?W(`details`):Z.length&&!Q.isPending&&Q.mutate(Z)},children:[Y.length?(0,T.jsx)(`div`,{className:`flex flex-col gap-2`,children:Y.map(e=>(0,T.jsx)(Ae,{address:e,picked:X.includes(e.url),onToggle:()=>S(X.includes(e.url)?X.filter(t=>t!==e.url):[...X,e.url])},e.url))}):null,!K&&Y.length?(0,T.jsx)(`p`,{className:`-mb-2 text-[0.9375rem] text-white/85`,children:_(`onboard.own`)}):null,C.map((e,t)=>(0,T.jsxs)(`div`,{className:`relative`,children:[(0,T.jsx)(`input`,{value:e,onChange:e=>O(n=>n.map((n,r)=>r===t?e.target.value:n)),placeholder:_(K?`onboard.linkPlaceholderPersonal`:`onboard.ownPlaceholder`),autoCapitalize:`none`,"aria-label":_(`onboard.own`),className:v(Te,`pr-28`)}),ue(e)?(0,T.jsx)(`span`,{className:`-translate-y-1/2 absolute top-1/2 right-3 rounded-full bg-white/20 px-2.5 py-0.5 font-semibold text-[0.75rem]`,children:ce[de(e)]}):null]},t)),C.length+Y.length<10?(0,T.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>[...e,``]),className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,_(`onboard.addAddress`)]}):null,M?(0,T.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.9375rem] text-(color:--moss)`,children:[(0,T.jsx)(d,{className:`size-4`}),M.name?_(`onboard.readDone`,{name:M.name,details:$e}):_(`onboard.readKept`,{n:Z.length})]}):Q.isError?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-(color:--rose)`,children:_(`onboard.readFailed`)}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[M?(0,T.jsx)(k,{type:`submit`,children:_(`onboard.continue`)}):(0,T.jsx)(k,{type:`submit`,busy:Q.isPending,children:Q.isPending?_(`onboard.reading`):_(`onboard.read`)}),(0,T.jsx)(A,{onClick:()=>x(``),children:_(`onboard.line`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:_(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:p})]})]})]}):null,U===`details`&&V.kind?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),We.mutate(),W(`know`)},children:[(0,T.jsx)(L,{children:K||!q?Xe:q}),(0,T.jsx)(R,{small:!0,children:K?_(`onboard.personalTitle`):q?_(`onboard.aboutOrganization`,{organization:q}):_(V.kind===`club`?`onboard.clubTitle`:`onboard.businessTitle`)}),K?(0,T.jsx)(ke,{value:V.need,onChange:e=>G({need:e}),rows:4,label:_(`onboard.personalTitle`),placeholder:_(`onboard.personalPlaceholder`)}):null,V.kind===`club`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:_(`onboard.clubKind`),options:Se,value:V.sector,text:e=>_(`onboard.club.${e}`),onChange:e=>G({sector:e})}),(0,T.jsx)(N,{label:_(`onboard.members`),options:be.club,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(N,{label:_(`onboard.yourRole`),options:Ce,value:V.role,text:e=>_(`onboard.role.${e}`),onChange:e=>G({role:e})})]}):null,V.kind===`small`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:_(`onboard.people`),options:be.small,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et})]}):null,V.kind===`corp`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:_(`onboard.people`),options:be.corp,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et}),(0,T.jsx)(N,{label:_(`onboard.yourRole`),options:we,value:V.role,text:e=>_(`onboard.role.${e}`),onChange:e=>G({role:e})}),(0,T.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[(0,T.jsxs)(`span`,{children:[_(`onboard.phone`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:_(`onboard.phoneWhy`)})]}),(0,T.jsx)(`input`,{type:`tel`,value:V.phone,onChange:e=>G({phone:e.target.value.replace(/[^+0-9 ()/.-]/g,``)}),placeholder:`+43 …`,maxLength:40,autoComplete:`tel`,className:Te})]})]}):null,K?null:(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsxs)(`span`,{className:`text-[0.9375rem] text-white/85`,children:[_(`onboard.questions`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:_(`onboard.optional`)})]}),(0,T.jsx)(ke,{value:V.questions??``,onChange:e=>G({questions:e}),rows:3,label:_(`onboard.questions`),placeholder:_(`onboard.questionsPlaceholder`)}),(0,T.jsx)(`span`,{className:`text-[0.8125rem] text-white/70`,children:_(`onboard.questionsHint`)})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:We.isPending,children:_(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>window.history.state?.idx>0?s(-1):W(`site`),children:_(`onboard.back`)}),(0,T.jsx)(j,{step:3,total:p})]})]}):null,U===`know`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker3Named`,`onboard.kicker3`)}),(0,T.jsx)(R,{children:_(`onboard.know`)}),(0,T.jsx)(z,{children:_(`onboard.knowSub`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>Me.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),Qe(e.dataTransfer.files)},className:`flex cursor-pointer flex-col items-center gap-2 rounded-[18px] border-2 border-white/45 border-dashed bg-white/10 px-6 py-7 text-center transition hover:bg-white/15`,children:[(0,T.jsx)(ne,{className:`size-7`}),(0,T.jsx)(`span`,{className:`font-semibold text-[1.0625rem]`,children:_(`onboard.drop`)}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:`PDF · Word · Excel · Markdown`}),(0,T.jsx)(`input`,{ref:Me,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{Qe(e.target.files),e.target.value=``}})]}),F.length?(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:F.map(e=>(0,T.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl bg-white/15 px-3.5 py-2.5 text-[0.875rem]`,children:[(0,T.jsx)(u,{className:`size-4 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,T.jsx)(`span`,{className:v(`text-white/80`,e.state===`failed`?`text-(color:--rose)`:``),children:e.state===`uploading`?_(`onboard.uploading`):e.state===`done`?_(`onboard.uploaded`):_(`onboard.uploadFailed`)})]},e.name))}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:F.some(e=>e.state===`uploading`)||$.isPending,onClick:()=>f?$.mutate():W(`space`),children:_(f?`onboard.buildFirst`:`onboard.continue`)}),F.length||f?null:(0,T.jsx)(A,{onClick:()=>W(`space`),children:_(`onboard.skip`)}),(0,T.jsx)(j,{step:4,total:p})]})]}):null,U===`space`&&!f?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker4Named`,`onboard.kicker4`)}),(0,T.jsx)(R,{children:q&&!K?_(`onboard.spaceNamed`,{organization:q}):_(`onboard.space`)}),(0,T.jsx)(z,{children:_(`onboard.spaceSub`,{space:c?.name??``})}),(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[[`partInfo`,`partInfoText`,!!(M||b)],[`partKnow`,`partKnowText`,F.some(e=>e.state===`done`)],[`partData`,`partDataText`,!1],[`partResults`,`partResultsText`,!1]].map(([e,t,n])=>(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-2xl border border-white/20 bg-white/10 px-4.5 py-4`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2 font-semibold text-[1rem]`,children:[n?(0,T.jsx)(d,{className:`size-4 text-(color:--moss)`}):null,_(`onboard.${e}`)]}),(0,T.jsx)(`span`,{className:`text-[0.84375rem] text-white/85 leading-snug`,children:_(`onboard.${t}`)})]},e))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:$.isPending,onClick:()=>$.mutate(),children:_(`onboard.build`)}),(0,T.jsx)(j,{step:5,total:p})]})]}):null]},U)]}),(0,T.jsxs)(`footer`,{className:`mx-auto flex w-full max-w-6xl items-center justify-between pb-6 text-[0.75rem] text-white/55 sm:pb-8`,children:[(0,T.jsx)(`span`,{children:`engenty.wizards`}),(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})}function L({children:e}){return(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:e})}function R({children:e,small:t}){return(0,T.jsx)(`h1`,{className:v(`font-display font-bold leading-[1.05] tracking-[-0.02em]`,t?`text-[2.25rem] sm:text-[2.75rem]`:`text-[2.5rem] sm:text-[3.25rem]`),children:e})}function z({children:e}){return(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:e})}function ke({value:e,onChange:t,rows:n,label:r,placeholder:i}){let[a]=s(),o=c(e,t,{deviceId:a.deviceId});return(0,T.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[18px] border border-white/30 bg-white/15 px-4 pt-3 pb-3 focus-within:border-white/60`,children:[(0,T.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:o.listening?_(`editor.listening`):i,rows:n,maxLength:4e3,"aria-label":r,className:`w-full resize-none bg-transparent text-[1.0625rem] text-white leading-relaxed outline-none placeholder:text-white/55`}),o.supported?(0,T.jsx)(`div`,{className:`self-end`,style:{"--ink":`white`,"--border":`rgb(255 255 255 / 0.55)`},children:(0,T.jsx)(l,{speech:o,labelled:!0})}):null]})}function Ae({address:e,picked:t,onToggle:n}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:n,className:v(`flex cursor-pointer items-center gap-3.5 rounded-[14px] border px-4 py-2.5 text-left transition`,t?`border-white bg-white/22`:`border-white/30 bg-white/8 hover:bg-white/12`),children:[(0,T.jsx)(`span`,{className:v(`flex size-5 shrink-0 items-center justify-center rounded-md border-2`,t?`border-white bg-white`:`border-white/60`),style:t?{color:E}:void 0,children:t?(0,T.jsx)(d,{className:`size-3.5`,strokeWidth:3}):null}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-[0.6875rem] text-white/70 uppercase tracking-[0.1em]`,children:ce[e.kind]}),(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.9375rem]`,children:e.url.replace(/^https?:\/\/(www\.)?/,``).replace(/\/$/,``)}),(0,T.jsx)(`span`,{className:`truncate text-[0.8125rem] text-white/80`,children:e.title})]}),(0,T.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-white/70 max-sm:hidden`,children:_(e.source===`email`?`onboard.fromEmail`:`onboard.fromWeb`)})]})}function je(e){return e.toLowerCase().replace(/['’]/g,``).replace(/ä/g,`ae`).replace(/ö/g,`oe`).replace(/ü/g,`ue`).replace(/ß/g,`ss`).normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,35).replace(/-+$/,``)}function Me(){let e=ie(),r=te(),i=ee(),a=y(),s=e.data?.tenant,c=o({queryKey:[`organization`,s?.id],queryFn:()=>n.get(`/api/studio/organization`),enabled:!!s}),l=t({mutationFn:()=>n.post(`/api/studio/onboarding/done`),onSuccess:async()=>{await r.invalidateQueries({queryKey:[`me`]}),i(`/`,{replace:!0})}});if(!(e.data&&s))return null;let u=s.name??``,d=e.data.user.name,ne=d.includes(`@`)?``:d.split(` `)[0],f=e.data.organizations.find(e=>e.id===s.id)?.invitedBy?.name,p=c.data?.members.find(t=>t.role===`owner`&&t.userId!==e.data?.user.id)?.name,m=s.role!==`member`,h=s.slug?`${window.location.host}/studio/${s.slug}`:null;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(se,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsx)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:(0,T.jsx)(re,{kind:`drop`,size:240,fluffy:!0,coat:`fur`})}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:ne?_(`onboard.kicker1`,{name:ne}):_(`onboard.kicker1Anon`)}),(0,T.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:_(`welcome.title`,{organization:u})}),(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:f?_(`welcome.invited`,{name:f}):p?_(`welcome.setUp`,{name:p,organization:u}):_(`welcome.plain`)}),(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-[18px] bg-white/12 ring-1 ring-white/20`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3.5 px-4.5 py-3.5`,children:[(0,T.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl font-bold font-display`,style:{background:D,color:E},children:b(u)}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`truncate font-semibold text-[1.0625rem]`,children:u}),h?(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.8125rem] text-white/75`,children:h}):null]}),(0,T.jsx)(`span`,{className:`rounded-full bg-white/20 px-2.5 py-1 font-semibold text-[0.75rem]`,children:_(`organization.role.${s.role}`)})]}),a.data?.some(e=>e.wizardCount>0)?a.data.map(e=>(0,T.jsxs)(`div`,{className:`flex justify-between gap-3 border-white/15 border-t px-4.5 py-2.5 text-[0.9375rem]`,children:[(0,T.jsx)(`span`,{className:`truncate`,children:e.name}),(0,T.jsx)(`span`,{className:`shrink-0 text-white/75`,children:_(`welcome.wizards`,{n:e.wizardCount})})]},e.id)):(0,T.jsx)(`p`,{className:`border-white/15 border-t px-4.5 py-3 text-[0.9375rem] text-white/80`,children:_(`welcome.noWizards`)})]}),(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:_(m?`welcome.canBuild`:`welcome.canMember`)}),(0,T.jsx)(`div`,{className:`flex flex-wrap items-center gap-5`,children:(0,T.jsx)(k,{busy:l.isPending,onClick:()=>l.mutate(),children:_(`welcome.go`)})})]})]})]})}function Ne({value:e,onChange:t,suggested:n}){let[r,i]=(0,w.useState)(!1),a=C(e),o=[...new Set([...a?[a.id]:[],...n])].slice(0,4),s=e=>C(e)?.name[g===`de`?`de`:`en`]??e;return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:_(`onboard.sector`)}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.map(n=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":e===n,onClick:()=>t(n),className:v(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,e===n?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:e===n?{color:E}:void 0,children:s(n)},n)),(0,T.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>i(e=>!e),className:`cursor-pointer rounded-full border border-white/40 border-dashed px-4 py-2 text-[0.9375rem] hover:bg-white/15`,children:_(`onboard.sectorOther`)})]}),r?(0,T.jsxs)(`select`,{value:a?e:``,onChange:e=>{t(e.target.value),i(!1)},"aria-label":_(`onboard.sector`),className:v(Te,`[&>option]:text-black`),children:[(0,T.jsx)(`option`,{value:``,children:_(`onboard.sectorPick`)}),[...S].sort((e,t)=>s(e.id).localeCompare(s(t.id),g)).map(e=>(0,T.jsx)(`option`,{value:e.id,children:s(e.id)},e.id))]}):null,a?(0,T.jsxs)(`span`,{className:`text-[0.8125rem] text-white/75`,children:[_(`onboard.sectorHint`),` `,(0,T.jsx)(`b`,{style:{color:D},children:_(`onboard.catalog`,{sector:s(a.id)})})]}):null]})}export{F as OnboardingPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{P as t}from"./Marketplace-4baBNzEc.js";import{t as n}from"./useMutation-BnkuLlQC.js";import{$ as r,Bn as i,C as a,Hn as o,Ln as s,S as c,Yn as l,Z as u,Zn as d,a as f,ar as p,sn as m,zr as h}from"./ui-DfVpZYIW.js";import{m as g}from"./Skills-DdUAyNhR.js";import{d as _}from"./marked.esm-BfGIZK7F.js";import{Gn as v,Wn as y}from"./host-Dw-sMUSd.js";import{n as b,t as x}from"./jsx-runtime-C3cWAN_r.js";import{n as S,s as C}from"./i18n-DVrYWJaj.js";import{_ as w,d as T,f as E,h as ee,i as D,m as O,r as k,t as A}from"./ui-CW2I3ecu.js";import{d as j,u as te}from"./session-BYLtgklo.js";import{s as ne}from"./ConnectorsSection-B4rRDlFo.js";var M={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};M.node;var N=_(M),P=e(b(),1),F={not_connected:`protocol.refused.not_connected`,no_action:`protocol.refused.no_action`,not_in_grant:`protocol.refused.not_in_grant`,denied:`protocol.refused.denied`,declined:`protocol.refused.declined`,nobody:`protocol.refused.nobody`,needs_approval:`protocol.refused.needs_approval`,ai_step_writes:`protocol.refused.ai_step_writes`,not_allowed_recipient:`protocol.refused.not_allowed_recipient`,channel_not_fixed:`protocol.refused.channel_not_fixed`,run_limit:`protocol.refused.run_limit`,day_limit:`protocol.refused.day_limit`,calls_per_run:`protocol.refused.calls_per_run`,calls_per_day:`protocol.refused.calls_per_day`,run_ended:`protocol.refused.run_ended`,paused:`protocol.refused.paused`,may_have_happened:`protocol.refused.may_have_happened`},I={"run.cancelled":`protocol.why.runStopped`,"run.done":`protocol.why.runDone`,"run.failed":`protocol.why.runFailed`},L={read:`protocol.kind.read`,write:`protocol.kind.write`,destructive:`protocol.kind.destructive`,send:`protocol.kind.send`},re={read:`protocol.verb.read`,write:`protocol.verb.write`,destructive:`protocol.verb.destructive`,send:`protocol.verb.send`},R={refused_write:`work.critical.refused_write`,outside_audience:`work.critical.outside_audience`,host_not_in_grant:`work.critical.host_not_in_grant`,limit_reached:`work.critical.limit_reached`,sign_in_failed:`work.critical.sign_in_failed`,first_use:`work.critical.first_use`,rule_changed:`work.critical.rule_changed`},z={grant:`protocol.rule.grant`,audience:`protocol.rule.audience`,actions:`protocol.rule.actions`,ai_step_writes:`protocol.rule.ai_step_writes`,destructive:`protocol.rule.destructive`,policy:`protocol.rule.policy`,read:`protocol.rule.read`,own_job:`protocol.rule.own_job`,autonomous_mode:`protocol.rule.autonomous_mode`,guest_send:`protocol.rule.guest_send`,run:`protocol.rule.run`,paused:`protocol.rule.paused`,limits:`protocol.rule.limits`},B={admins:`protocol.audience.admins`,members:`protocol.audience.members`,all:`protocol.audience.all`};function V(e){return e in L}function H(e){return V(e)?C(L[e]):e}function ie(e){return V(e)?C(re[e]):e}function U(e){return e&&e in R?C(R[e]):``}function W(e){if(!e)return C(`protocol.rule.none`);if(e.startsWith(`rules.`))return C(`protocol.rule.rules`,{kind:H(e.slice(6))});let t=z[e]??z[e.split(`.`)[0]??``];return t?C(t):e}function G(e,t,n){return e===`run_ended`&&t&&t in I?C(I[t]):e&&e!==`denied`&&e in F?C(F[e]):t===`audience`?n&&n in B?C(`protocol.why.audienceFor`,{audience:C(B[n])}):C(`protocol.why.audience`):t===`actions`?C(`protocol.why.actions`):t===`grant`?C(`protocol.refused.not_in_grant`):t?.startsWith(`rules.`)?C(`protocol.why.rule`):C(`protocol.refused.denied`)}var ae={waiting_input:`runs.status.waiting_input`,sleeping:`runs.status.sleeping`,waiting_signal:`runs.status.waiting_signal`,running:`runs.status.running`,done:`runs.status.done`,failed:`runs.status.failed`,cancelled:`protocol.detail.runStopped`};function oe(e){let t=ae[e];return t?C(t):e}function se(e){return e===`running`||e===`waiting_input`||e===`sleeping`||e===`waiting_signal`}function ce(e){let{outcome:t,result:n,rule:r}=e;return n===null&&t!==`deny`?{tone:`held`,text:C(`protocol.outcome.running`)}:n===`ok`?{tone:`done`,text:C(t===`ask`?`protocol.outcome.doneApproved`:`protocol.outcome.done`)}:n===`already_done`?{tone:`done`,text:C(`protocol.outcome.alreadyDone`)}:n===`needs_approval`?{tone:`held`,text:C(`protocol.outcome.held`)}:n===`sign_in_failed`?{tone:`failed`,text:C(`protocol.outcome.signInFailed`)}:n===`nobody`||n===`not_connected`?{tone:`failed`,text:C(`protocol.outcome.notDone`,{why:C(F[n])})}:t===`deny`||n===`declined`?{tone:`refused`,text:C(`protocol.outcome.refused`,{why:G(n,r)})}:{tone:`failed`,text:C(`protocol.outcome.failed`,{error:n??``})}}function le(e){switch(e.kind){case`guest`:return C(`protocol.who.guest`);case`person`:return e.name??C(`protocol.who.person`);case`admin`:return e.name?C(`protocol.who.adminNamed`,{name:e.name}):C(`protocol.who.admin`);case`goose`:return e.name?C(`protocol.who.gooseFor`,{name:e.name}):C(`protocol.who.goose`);case`plugin`:return C(`protocol.who.plugin`,{name:e.id??``});case`runtime`:return C(`protocol.who.runtime`);case`step`:return e.for?e.for.kind===`guest`?C(`protocol.who.stepForGuest`):C(`protocol.who.stepFor`,{name:e.for.name??C(`protocol.who.person`)}):C(`protocol.who.step`);default:return e.kind}}function ue(e){return e.runId?e.wizardName?C(e.runMode===`test`?`protocol.where.testRunOf`:`protocol.where.runOf`,{wizard:e.wizardName}):C(`protocol.where.run`):e.chatId?e.chatTitle?C(`protocol.where.chatNamed`,{title:e.chatTitle}):C(`protocol.where.chat`):e.who.kind===`goose`?C(`protocol.where.goose`):e.who.kind===`plugin`?C(`protocol.where.plugin`):``}function de(e){let{connectionId:t}=e;return e.connectionName?e.connectorName&&!e.connectionName.includes(e.connectorName)?`${e.connectorName} · ${e.connectionName}`:e.connectionName:t.startsWith(`host:`)?C(`protocol.connection.host`,{host:t.slice(5)}):t===`mail:server`?C(`protocol.connection.serverMail`):t===`rwx`?C(`protocol.connection.rwx`):e.connectorName?`${e.connectorName} · ${t}`:t}function fe(e){switch(e.actionId){case`change_rules`:return e.input?.fields&&`paused`in e.input.fields?C(e.input.sample===`paused: yes`?`protocol.action.paused`:`protocol.action.resumed`):e.input?.fields&&Object.keys(e.input.fields).join()===`limits`?C(`protocol.action.limits`):C(`protocol.action.changeRules`);case`http_request`:return C(`protocol.action.request`);case`read_secret`:return C(`protocol.action.readSecret`);case`pull_stream`:return C(`protocol.action.pullStream`);case`send_message`:return e.actionName??C(`protocol.action.sendMail`);default:return e.actionName??e.actionId}}function pe(e,t){let n={who:t.who,connection:t.connection,verb:ie(e.action.kind)};return e.outcome===`allow`?C(`protocol.ask.allow`,n):e.outcome===`ask`?C(e.admins?`protocol.ask.askAdmins`:`protocol.ask.askPerson`,n):C(`protocol.ask.deny`,{...n,why:G(e.refused??null,e.rule,t.audience)})}function me(e){return e.fixedChannel?C(`protocol.ask.fixedChannel`):null}var K=e(x(),1);function he(){let[e,t]=d(),{space:n}=te(),i=j(),a=e.get(`show`),s=i&&(a===`ask`||a===`notify`)?a:null,c=e=>t(e?{show:e}:{},{replace:!0}),l=e.get(`connection`)??``,u=p({queryKey:[`broker-choices`,n?.id],queryFn:()=>r.get(`/api/studio/spaces/${n?.id}/broker/choices`),enabled:!!n&&i});return n?i?(0,K.jsxs)(`div`,{className:`flex flex-col gap-9 pb-20`,children:[(0,K.jsx)(q,{spaceId:n.id,connection:l,action:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(A,{variant:`secondary`,size:`sm`,onClick:()=>c(`ask`),children:[(0,K.jsx)(y,{className:`size-4`}),` `,C(`protocol.ask.title`)]}),(0,K.jsx)(A,{variant:`secondary`,size:`sm`,onClick:()=>c(`notify`),"aria-label":C(`protocol.notify.title`),title:C(`protocol.notify.title`),children:(0,K.jsx)(o,{className:`size-4`})})]})}),(0,K.jsxs)(D,{open:s===`ask`,onClose:()=>c(null),wide:!0,title:C(`protocol.ask.title`),children:[(0,K.jsx)(`p`,{className:`-mt-2 mb-4 text-[0.875rem] text-ink-3`,children:C(`protocol.ask.hint`)}),(0,K.jsx)(we,{choices:u.data,spaceId:n.id})]}),(0,K.jsxs)(D,{open:s===`notify`,onClose:()=>c(null),title:C(`protocol.notify.title`),children:[(0,K.jsx)(`p`,{className:`-mt-2 mb-4 text-[0.875rem] text-ink-3`,children:C(`protocol.notify.hint`)}),(0,K.jsx)(Ee,{space:n})]})]}):(0,K.jsx)(`div`,{className:`flex flex-col gap-9 pb-20`,children:(0,K.jsx)(q,{spaceId:n.id,own:!0,connection:l})}):null}var ge={hour:36e5,day:864e5,week:6048e5,month:2592e6},_e=[`guest`,`person`,`admin`,`goose`,`plugin`,`step`,`runtime`],ve=50;function ye(e,t=300){let[n,r]=(0,P.useState)(e);return(0,P.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function q({spaceId:e,own:n=!1,connection:i=``,action:o}){let[s,l]=(0,P.useState)(`all`),[u,d]=(0,P.useState)(``),[f,p]=(0,P.useState)(i),[m,h]=(0,P.useState)(`week`),[g,_]=(0,P.useState)(``),v=ye(g).trim(),[y,b]=(0,P.useState)(null),x=ne(e).data?.connections??[],S=t({queryKey:[`broker-log`,e,{outcome:s,who:u,connection:f,range:m,q:v}],initialPageParam:null,queryFn:({pageParam:t})=>{let n=new URLSearchParams({limit:String(ve)});return s===`refused`?n.set(`refused`,`true`):s===`critical`?n.set(`critical`,`true`):s===`held`&&n.set(`result`,`needs_approval`),u&&n.set(`who`,u),f&&n.set(`connection`,f),m!==`all`&&n.set(`since`,new Date(Date.now()-ge[m]).toISOString()),v&&n.set(`q`,v),t&&n.set(`cursor`,t),r.get(`/api/studio/spaces/${e}/broker/log?${n}`)},getNextPageParam:e=>e.next}),D=S.data?.pages.flatMap(e=>e.lines)??[],O=s!==`all`||u!==``||f!==``||m!==`all`||v!==``,k=new Set(x.map(e=>e.id));return(0,K.jsx)(a,{title:C(`capabilities.protocol`),hint:C(n?`protocol.own.hint`:`protocol.hint`),action:o,plain:!0,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-3`,children:(0,K.jsx)(ee,{value:s,onChange:l,label:C(`protocol.filter.outcome`),options:[{id:`all`,label:C(`protocol.filter.all`)},{id:`refused`,label:C(`protocol.filter.refused`)},{id:`critical`,label:C(`protocol.filter.critical`)},{id:`held`,label:C(`protocol.filter.held`)}]})}),(0,K.jsxs)(`div`,{className:w(`grid gap-2`,n?`sm:grid-cols-2`:`sm:grid-cols-3`),children:[n?null:(0,K.jsx)(T,{value:u,onChange:d,placeholder:C(`protocol.filter.everyone`),options:_e.map(e=>({value:e,label:C(`protocol.filter.who.${e}`)}))}),(0,K.jsx)(T,{value:f,onChange:p,placeholder:C(`protocol.filter.everyConnection`),options:x.map(e=>({value:e.id,label:e.connector?`${e.connector.name} · ${e.name}`:e.name}))}),(0,K.jsx)(T,{value:m,onChange:e=>h(e),options:[`hour`,`day`,`week`,`month`,`all`].map(e=>({value:e,label:C(`protocol.range.${e}`)}))})]}),(0,K.jsx)(c,{value:g,onChange:_,placeholder:C(n?`protocol.own.search`:`protocol.search`),busy:S.isFetching&&!S.isFetchingNextPage}),S.error?(0,K.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:S.error.message}):S.isPending?(0,K.jsx)(`div`,{className:`flex justify-center py-12`,children:(0,K.jsx)(E,{className:`text-ink-3`})}):D.length===0?(0,K.jsx)(`p`,{className:`py-12 text-center text-[0.9375rem] text-ink-3`,children:C(O?`protocol.emptyFiltered`:n?`protocol.own.empty`:`protocol.empty`)}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:D.map(t=>(0,K.jsx)(`li`,{children:(0,K.jsx)(be,{line:t,spaceId:e,open:y===t.id,onToggle:()=>b(y===t.id?null:t.id),ofSpace:k.has(t.connectionId)})},t.id))}),S.hasNextPage?(0,K.jsx)(`div`,{className:`flex justify-center`,children:(0,K.jsx)(A,{variant:`quiet`,size:`sm`,busy:S.isFetchingNextPage,onClick:()=>void S.fetchNextPage(),children:C(`protocol.more`)})}):null]})})}var J={done:g,refused:N,held:s,failed:m},Y={done:`text-moss`,refused:`text-rose`,held:`text-ember`,failed:`text-ink-3`};function X(e,t=!1){return new Date(e).toLocaleString(S,{dateStyle:t?`medium`:`short`,timeStyle:t?`medium`:`short`})}function be({line:e,spaceId:t,open:n,onToggle:r,ofSpace:a}){let o=ce(e),s=J[o.tone],c=ue(e),l=e.critical||o.tone===`refused`;return(0,K.jsxs)(`div`,{className:w(`rounded-xl bg-card ring-1 transition`,e.critical?`ring-ember/50`:o.tone===`refused`?`ring-rose/40`:`ring-border-soft`),children:[(0,K.jsxs)(`button`,{type:`button`,onClick:r,"aria-expanded":n,className:`flex w-full items-start gap-3 px-3.5 py-3 text-left`,children:[(0,K.jsx)(s,{className:w(`mt-0.5 size-4 shrink-0`,Y[o.tone])}),(0,K.jsxs)(`span`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,K.jsxs)(`span`,{className:`text-[0.9375rem] text-ink leading-snug`,children:[(0,K.jsx)(`b`,{className:`font-medium`,children:le(e.who)}),` · `,H(e.kind),`: `,fe(e),` · `,de(e)]}),(0,K.jsxs)(`span`,{className:`text-[0.8125rem] text-ink-3 leading-snug`,children:[X(e.at),c?` · ${c}`:``,` · `,(0,K.jsx)(`span`,{className:w(l&&Y[o.tone],l&&`font-medium`),children:o.text})]})]}),e.critical?(0,K.jsx)(`span`,{className:`shrink-0`,children:(0,K.jsx)(k,{tone:`ember`,icon:(0,K.jsx)(v,{className:`size-3`}),title:U(e.criticalKind),children:C(`protocol.critical`)})}):null,(0,K.jsx)(i,{className:w(`mt-0.5 size-4 shrink-0 text-ink-4 transition-transform`,n&&`rotate-180`)})]}),n?(0,K.jsx)(xe,{line:e,spaceId:t,ofSpace:a}):null]})}function Z({label:e,children:t}){return(0,K.jsxs)(`div`,{className:`grid gap-0.5 sm:grid-cols-[11rem_minmax(0,1fr)] sm:gap-3`,children:[(0,K.jsx)(`dt`,{className:`text-[0.8125rem] text-ink-3`,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0 break-words text-[0.875rem] text-ink-2`,children:t})]})}function xe({line:e,spaceId:t,ofSpace:i}){let a=p({queryKey:[`broker-line`,t,e.id],queryFn:()=>r.get(`/api/studio/spaces/${t}/broker/log/${e.id}`)}),o=a.data?.run,s=j(),c=h(),l=n({mutationFn:()=>r.post(`/api/runs/${e.runId}/cancel`),onSuccess:()=>c.invalidateQueries({queryKey:[`broker-line`,t]})}),u=e.input,d=Object.keys(u?.fields??{}),m=e.connectionId.startsWith(`host:`);return(0,K.jsxs)(`div`,{className:`border-border-soft border-t px-3.5 py-3`,children:[(0,K.jsxs)(`dl`,{className:`grid gap-2`,children:[(0,K.jsxs)(Z,{label:C(`protocol.detail.when`),children:[X(e.at,!0),` · `,C(`protocol.detail.duration`,{ms:e.durationMs})]}),e.critical?(0,K.jsx)(Z,{label:C(`protocol.critical`),children:U(e.criticalKind)}):null,(0,K.jsxs)(Z,{label:C(`protocol.detail.input`),children:[d.length?C(`protocol.detail.inputFields`,{fields:d.join(`, `),size:u?.size??0}):C(`protocol.detail.inputEmpty`),u?.sample?(0,K.jsx)(`span`,{className:`mt-0.5 block font-mono text-[0.8125rem] text-ink-3`,children:u.sample}):null]}),(0,K.jsx)(Z,{label:C(`protocol.detail.result`),children:e.resultSize===null?C(`protocol.detail.resultNone`):C(`protocol.detail.resultSize`,{size:e.resultSize})}),(0,K.jsxs)(Z,{label:C(`protocol.detail.rule`),children:[W(e.rule),e.reason?(0,K.jsx)(`span`,{className:`mt-0.5 block text-[0.8125rem] text-ink-3`,children:e.reason}):null]}),o?(0,K.jsx)(Z,{label:C(`protocol.detail.run`),children:oe(o.status)}):null,e.runId?(0,K.jsx)(Z,{label:C(`protocol.detail.grant`),children:a.isPending?(0,K.jsx)(E,{className:`size-4 text-ink-3`}):i?C(`protocol.detail.grantSpace`):o?.grant?m?o.grant.hosts.length?C(`protocol.detail.grantHosts`,{hosts:o.grant.hosts.join(`, `)}):C(`protocol.detail.grantNoHosts`):o.grant.actions?.length?C(`protocol.detail.grantActions`,{actions:o.grant.actions.join(`, `)}):C(`protocol.detail.grantNoActions`):C(`protocol.detail.grantNone`)}):null]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[e.runId&&e.wizardId?(0,K.jsx)(Q,{to:`/edit/${e.wizardId}?run=${e.runId}`,children:C(`protocol.detail.openRun`)}):null,e.chatId?(0,K.jsx)(Q,{to:`/work/c/${e.chatId}`,children:C(`protocol.detail.openChat`)}):null,i?(0,K.jsx)(Q,{to:`/capabilities/connectors?show=${e.connectionId}`,children:C(`protocol.detail.openConnection`)}):null,s&&o&&se(o.status)?(0,K.jsx)(`span`,{className:`sm:ml-auto`,children:(0,K.jsx)(A,{variant:`danger`,size:`sm`,busy:l.isPending,onClick:async()=>{await f(C(`protocol.detail.stopRunAsk`),{detail:C(`protocol.detail.stopRunDetail`),action:C(`protocol.detail.stopRun`)})&&l.mutate()},children:C(`protocol.detail.stopRun`)})}):null]}),l.error?(0,K.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:l.error.message}):null]})}function Q({to:e,children:t}){return(0,K.jsx)(l,{to:e,className:`inline-flex h-8 items-center rounded-full bg-paper-2 px-3 font-medium text-[0.8125rem] text-ink transition hover:bg-paper-3 coarse:h-11 coarse:px-4`,children:t})}function Se(e,t){if(e.startsWith(`person:`)){let n=t.people.find(t=>`person:${t.id}`===e);return{who:n&&n.role!==`member`?`admin`:`person`}}return e.startsWith(`step:`)?{who:`step`,for:e.slice(5)}:{who:e}}function Ce(e,t){return e.startsWith(`person:`)?t.people.find(t=>`person:${t.id}`===e)?.name??``:C(e===`guest`?`protocol.ask.who.guest`:e===`goose`?`protocol.ask.who.goose`:`protocol.ask.who.step`)}function we({choices:e,spaceId:t}){let[n,i]=(0,P.useState)(``),[a,o]=(0,P.useState)(``),[s,c]=(0,P.useState)(``),[l,u]=(0,P.useState)(`run`),d=e?.connections.find(e=>e.id===a),f=d?.actions.find(e=>e.id===s),m=n.startsWith(`step:`)?`run`:l,h=!!(e&&n&&d&&f),g=p({queryKey:[`broker-ask`,t,n,a,s,m],queryFn:()=>{let i=new URLSearchParams({...Se(n,e),resource:a,action:s,in:m});return r.get(`/api/studio/spaces/${t}/broker/ask?${i}`)},enabled:h});if(!e)return(0,K.jsx)(`div`,{className:`flex justify-center py-12`,children:(0,K.jsx)(E,{className:`text-ink-3`})});let _=[...e.people.map(e=>({value:`person:${e.id}`,label:e.role===`member`?e.name:C(`protocol.who.adminNamed`,{name:e.name})})),{value:`guest`,label:C(`protocol.ask.who.guest`)},{value:`goose`,label:C(`protocol.ask.who.goose`)},{value:`step:guest`,label:C(`protocol.ask.who.stepGuest`)},{value:`step:person`,label:C(`protocol.ask.who.stepPerson`)}];return(0,K.jsx)(K.Fragment,{children:e.connections.length===0?(0,K.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:C(`protocol.ask.noConnections`)}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)($,{label:C(`protocol.ask.who`),children:(0,K.jsx)(T,{value:n,onChange:e=>i(e),placeholder:C(`protocol.ask.choose`),options:_})}),(0,K.jsx)($,{label:C(`protocol.ask.connection`),children:(0,K.jsx)(T,{value:a,onChange:e=>{o(e),c(``)},placeholder:C(`protocol.ask.choose`),options:e.connections.map(e=>({value:e.id,label:e.connector?`${e.connector.name} · ${e.name}`:e.name}))})}),(0,K.jsx)($,{label:C(`protocol.ask.action`),children:(0,K.jsx)(T,{value:s,onChange:c,placeholder:C(`protocol.ask.choose`),options:(d?.actions??[]).map(e=>({value:e.id,label:`${e.name} (${H(e.kind)})`}))})}),(0,K.jsx)($,{label:C(`protocol.ask.where`),children:(0,K.jsx)(T,{value:m,onChange:e=>u(e),options:[{value:`run`,label:C(`protocol.ask.inRun`)},{value:`chat`,label:C(`protocol.ask.inChat`),disabled:n.startsWith(`step:`)}]})})]}),(0,K.jsx)(`div`,{className:`rounded-xl bg-paper-2 px-4 py-3.5`,children:h?g.error?(0,K.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:g.error.message}):g.data?(0,K.jsx)(Te,{answer:g.data,who:Ce(n,e),connection:d?d.connector?`${d.connector.name} · ${d.name}`:d.name:``,audience:d?.audience}):(0,K.jsx)(E,{className:`size-4 text-ink-3`}):(0,K.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:C(`protocol.ask.pick`)})})]})})}function Te({answer:e,who:t,connection:n,audience:r}){let i=e.outcome===`allow`?`done`:e.outcome===`ask`?`held`:`refused`,a=J[i],o=me(e);return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(a,{className:w(`mt-1 size-4 shrink-0`,Y[i])}),(0,K.jsxs)(`div`,{className:`grid min-w-0 gap-1.5`,children:[(0,K.jsx)(`p`,{className:`font-medium text-[0.9375rem] text-ink leading-snug`,children:pe(e,{who:t,connection:n,audience:r})}),o?(0,K.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:o}):null,(0,K.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:C(`protocol.ask.rule`,{rule:W(e.rule)})}),(0,K.jsx)(`div`,{children:(0,K.jsx)(Q,{to:`/capabilities/connectors?show=${e.connection.id}`,children:C(`protocol.ask.change`)})})]})]})}function $({label:e,children:t}){return(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`span`,{className:`font-medium text-[0.8125rem] text-ink-2`,children:e}),t]})}function Ee({space:e}){let t=h(),[n,i]=(0,P.useState)(!1),[a,o]=(0,P.useState)(null),s=e.notify??{bell:!0,mail:`hourly`},c=async n=>{i(!0),o(null);try{await r.patch(`/api/studio/spaces/${e.id}`,{notify:n}),await t.invalidateQueries({queryKey:u.spaces()})}catch(e){o(e.message)}finally{i(!1)}},l=e.readOnly||n;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(De,{label:C(`protocol.notify.bell`),hint:C(`protocol.notify.bellHint`),checked:s.bell,disabled:l,onChange:e=>void c({...s,bell:e})}),(0,K.jsx)(De,{label:C(`protocol.notify.mail`),hint:C(`protocol.notify.mailHint`),checked:s.mail===`hourly`,disabled:l,onChange:e=>void c({...s,mail:e?`hourly`:`off`})}),a?(0,K.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:a}):null]})}function De({label:e,hint:t,checked:n,disabled:r,onChange:i}){return(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`font-medium text-[0.9375rem] text-ink`,children:e}),(0,K.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:t})]}),(0,K.jsx)(O,{checked:n,onChange:i,label:e,disabled:r})]})}export{he as n,N as r,Ee as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,Gn as n,Qn as r,Zt as i,ar as a,bt as o,ht as s,ir as c,mt as l,nr as u,ot as d,rr as f,yt as p}from"./ui-DfVpZYIW.js";import{d as m,n as h}from"./marked.esm-BfGIZK7F.js";import{T as g,_,d as v,f as ee,g as y,h as b,m as x,n as te,p as S,v as C}from"./theme-DFDOMsVo.js";import{n as w,t as T}from"./jsx-runtime-C3cWAN_r.js";import{f as ne,n as E,r as D,t as re}from"./brand-DY3lzrOd.js";import{a as O,et as k,l as A,s as j}from"./i18n-DVrYWJaj.js";import{s as ie,u as M}from"./read-aloud-CBycd8TA.js";import{_ as N,f as P,o as F,t as I}from"./ui-CW2I3ecu.js";import{n as L}from"./LangSwitch-BuzsLp16.js";var R={name:`bookmark`,size:24,node:[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]};R.node;var ae=m(R),oe={name:`square-plus`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]],aliases:[`plus-square`]};oe.node;var se=m(oe),z=e(w(),1);function ce(){if(window.self===window.top)return null;let e=new URLSearchParams(window.location.search).get(`embed`);return e===`inline`||e===`modal`||e===`popout`?e:null}var B=ce(),le=B?new URLSearchParams(window.location.search).get(`page`):null,V=new URLSearchParams(window.location.search).get(`theme`),H=V?`?theme=${encodeURIComponent(V)}`:``,U=(e,t={})=>window.parent.postMessage({type:`engenty-wizard:${e}`,...t},`*`),ue=()=>U(`close`);function de(e){(0,z.useEffect)(()=>{if(B===`inline`&&!e){let e=document.documentElement;document.getElementById(`root`)?.style.setProperty(`min-height`,`0`),e.style.overflow=`hidden`;let t=new ResizeObserver(()=>U(`height`,{height:Math.ceil(e.getBoundingClientRect().height)}));return t.observe(e),()=>t.disconnect()}if(B===`modal`||B===`popout`){let e=e=>{e.key===`Escape`&&!document.querySelector(`dialog[open]`)&&U(`close`)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}},[e])}var W=e(T(),1),G=`wizards.runner.translate`,K=new Set;function fe(){try{return localStorage.getItem(G)===`on`}catch{return!1}}function pe(e){try{localStorage.setItem(G,e?`on`:`off`)}catch{}for(let e of K)e()}function me(){return(0,z.useSyncExternalStore)(e=>(K.add(e),()=>K.delete(e)),fe)}function he(e){let n=me(),[r]=(0,z.useState)(()=>A()),i=e?.lang??`en`,o=e?.translatable&&r&&r!==i?r:null,s=o&&n?o:i,c=e?.token,l=a({queryKey:[`public-translation`,c,s],enabled:!!(c&&s!==i),queryFn:()=>t.post(`/api/public/wizards/${c}/translation${H}`,{lang:s}),staleTime:1/0,retry:!1}),u=a({queryKey:[`public-texts`,c,s],enabled:!(!c||k(s)),queryFn:()=>t.get(`/api/public/wizards/${c}/texts/${s}`),staleTime:1/0,retry:!1}),d=!k(s),f=s===i||l.data&&(!d||u.data),p=s!==i&&(l.isError||d&&u.isError),m=f&&!p?s:i,h=(0,z.useMemo)(()=>!k(m)&&u.data?.lang===m?{lang:u.data.lang,runner:u.data.runner,notes:u.data.notes}:null,[m,u.data]);if((0,z.useEffect)(()=>{e&&O(m,h)},[e,m,h]),(0,z.useEffect)(()=>()=>O(null),[]),!e)return null;let g=m!==i&&l.data?l.data:null;return{own:i,other:o,shown:m,wizard:g??e,translating:s!==i&&!f&&!p,failed:!!p,translated:!!g,machine:g?.translation?.machine??!1,pick:e=>pe(e!==i)}}function q({page:e,tone:t=`ground`}){if(!e?.other)return null;let n=e.translating?e.other:e.shown;return(0,W.jsx)(L,{langs:[e.own,e.other],value:n,onPick:e.pick,tone:t})}function J({page:e,small:t}){if(!e)return null;let n=t?`truncate text-[0.75rem]`:`text-[0.8125rem]`;return e.failed?(0,W.jsx)(`p`,{className:N(`text-ink-3`,n),children:j(`translation.failed`)}):e.translated?(0,W.jsxs)(`p`,{className:N(`text-ink-3`,n),children:[e.machine?(0,W.jsxs)(W.Fragment,{children:[j(`translation.machine`),` · `]}):null,(0,W.jsx)(`button`,{type:`button`,className:`underline-offset-4 hover:text-ink hover:underline coarse:min-h-11`,onClick:()=>e.pick(e.own),children:j(`translation.showOriginal`)})]}):null}function ge(e,n){let r=(0,z.useRef)(null),i=n&&!n.translating?n.translated?n.shown:null:void 0;(0,z.useEffect)(()=>{if(!e||i===void 0)return;let n=`${e}:${i}`;r.current!==n&&(r.current=n,t.post(`/api/runs/${e}/lang`,{lang:i}).catch(()=>void 0))},[e,i])}function _e(e,t){(0,z.useEffect)(()=>{if(!e||!t)return;let n=l(`/api/public/wizards/${e}`),r=[{rel:`manifest`,href:`${n}/manifest.webmanifest`},{rel:`apple-touch-icon`,href:`${n}/icons/apple-touch-icon.png`},{rel:`icon`,href:`${n}/icons/favicon.png`,type:`image/png`}].flatMap(({rel:e,href:t,type:n})=>{let r=document.querySelector(`link[rel="${e}"]`);if(!r)return[];let i={href:r.getAttribute(`href`),type:r.getAttribute(`type`)};return r.setAttribute(`href`,t),n&&r.setAttribute(`type`,n),[{link:r,before:i}]}),i=document.createElement(`meta`);return i.name=`apple-mobile-web-app-title`,i.content=t,document.head.appendChild(i),()=>{for(let{link:e,before:t}of r)for(let[n,r]of Object.entries(t))r===null?e.removeAttribute(n):e.setAttribute(n,r);i.remove()}},[e,t])}var ve=/iPhone|iPad|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,Y=ve||/Android/.test(navigator.userAgent);function ye(){let[e,t]=(0,z.useState)(()=>window.wizardInstall??null),[n,r]=(0,z.useState)(!1);if((0,z.useEffect)(()=>{let e=()=>t(window.wizardInstall??null);return window.addEventListener(`wizard-install`,e),()=>window.removeEventListener(`wizard-install`,e)},[]),window.matchMedia(`(display-mode: standalone)`).matches||navigator.standalone===!0||Y&&!e&&!ve)return null;let i=/Mac/.test(navigator.platform),a=j(Y?`install.ios`:i?`install.bookmark.mac`:`install.bookmark.pc`);return(0,W.jsxs)(`div`,{className:`mt-6 flex flex-col items-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>{Y&&e?(e.prompt(),window.wizardInstall=null,t(null)):r(e=>!e)},className:`inline-flex items-center gap-1.5 underline-offset-4 hover:text-ink hover:underline coarse:min-h-11`,children:[Y?(0,W.jsx)(se,{className:`size-4`}):(0,W.jsx)(ae,{className:`size-4`}),j(Y?`install.add`:`install.bookmark`)]}),n?(0,W.jsx)(`p`,{className:`max-w-xs leading-relaxed`,children:a}):null]})}function be({brand:e,toggle:t=!0,start:n}){return(0,W.jsx)(`header`,{className:`safe-top`,children:(0,W.jsxs)(`div`,{className:`relative flex h-14 items-center justify-center px-5`,children:[n?(0,W.jsx)(`div`,{className:`absolute left-3`,children:n}):null,e.logoUrl?(0,W.jsx)(`img`,{src:l(e.logoUrl),alt:e.name,className:`h-7 max-w-[160px] object-contain`}):e.name?(0,W.jsx)(`span`,{className:`max-w-[60%] truncate font-display font-semibold text-[0.9375rem] text-ink-2 tracking-tight`,children:e.name}):null,t?(0,W.jsx)(`div`,{className:`absolute right-3`,children:(0,W.jsx)(D,{})}):null]})})}function xe({siteKey:e,onToken:t}){let n=(0,z.useRef)(null);return(0,z.useEffect)(()=>{let r=()=>{n.current&&window.turnstile&&!n.current.childElementCount&&window.turnstile.render(n.current,{sitekey:e,callback:t,appearance:`interaction-only`})};if(window.turnstile){r();return}let i=document.createElement(`script`);i.src=`https://challenges.cloudflare.com/turnstile/v0/api.js`,i.async=!0,i.onload=r,document.head.appendChild(i)},[e,t]),(0,W.jsx)(`div`,{ref:n,className:`mt-4 flex justify-center`})}function Se({token:e}){return!/iPhone|iPad|iPod|Android/.test(navigator.userAgent)||s||B?null:(0,W.jsxs)(`a`,{href:p(`${window.location.origin}${d}/w/${e}`),className:`mt-3 inline-flex items-center gap-1.5 text-[0.8125rem] text-ink-3 underline-offset-4 hover:text-ink hover:underline coarse:min-h-11`,children:[(0,W.jsx)(g,{className:`size-4`}),` `,j(`install.app`)]})}var X=e=>`wz.run.${e}`,Z=()=>u().state?.elsewhere===!0,Ce=s&&new URLSearchParams(window.location.search).get(`start`)===`1`,Q=B===`inline`?`min-h-80`:`min-h-dvh`;function $(e,n,r){let i=f(),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(null),[l,u]=(0,z.useState)(null),d=(()=>{try{return localStorage.getItem(X(e.token))}catch{return null}})();return{busy:a,error:s,captcha:l,setCaptcha:u,start:async()=>{o(!0),c(null);try{let{runId:a}=await t.post(`/api/public/wizards/${e.token}/runs`,{turnstileToken:l??void 0,embedded:B!==null,origin:le??void 0,lang:r??void 0});try{localStorage.setItem(X(e.token),a)}catch{}i(`${n}/${a}`,{replace:Ce})}catch(e){c(e.message),o(!1)}},resume:d?()=>i(`${n}/${d}`):null}}function we({wizard:e,page:t}){let{busy:r,error:i,captcha:a,setCaptcha:o,start:c,resume:l}=$(e,`/w/${e.token}`,t?.translated?t.shown:null),u=Z(),d=Ce&&e.available&&!e.turnstileSiteKey,f=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{d&&!f.current&&(f.current=!0,c())},[d]),d&&!i?(0,W.jsx)(`div`,{className:`flex min-h-[60dvh] items-center justify-center text-ink-4`,children:(0,W.jsx)(P,{})}):(0,W.jsxs)(`div`,{className:`mx-auto flex max-w-lg animate-rise flex-col items-center px-6 pt-6 pb-12 text-center sm:pt-16 sm:pb-16`,children:[u?(0,W.jsx)(`p`,{className:`mb-6 rounded-xl bg-paper-2 px-5 py-3 text-[0.875rem] text-ink-2`,children:j(`run.elsewhere`)}):null,(0,W.jsx)(E,{kind:e.avatar,costume:e.costume,size:190,fluffy:!0}),(0,W.jsx)(`h1`,{className:`wizard-title mt-2 text-balance font-display font-semibold text-[1.875rem] leading-[1.1] tracking-tight sm:text-[2.125rem]`,children:e.title}),e.description?(0,W.jsx)(`p`,{className:`mt-3 text-[1rem] text-ink-2 leading-relaxed`,children:e.description}):null,(0,W.jsx)(`div`,{className:`mt-3`,children:(0,W.jsx)(J,{page:t})}),e.available?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(I,{size:`lg`,className:`mt-10 min-w-48`,busy:r,disabled:!!e.turnstileSiteKey&&!a,onClick:c,children:[j(`run.start`),` `,(0,W.jsx)(n,{className:`size-4`})]}),e.turnstileSiteKey?(0,W.jsx)(xe,{siteKey:e.turnstileSiteKey,onToken:o}):null,l?(0,W.jsx)(`button`,{type:`button`,onClick:l,className:`mt-4 text-[0.875rem] text-ink-3 underline-offset-4 hover:text-ink hover:underline coarse:min-h-11`,children:j(`run.resume`)}):null,(0,W.jsx)(Te,{wizard:e,current:`steps`}),B||s?null:(0,W.jsx)(ye,{}),(0,W.jsx)(Se,{token:e.token})]}):(0,W.jsx)(`p`,{className:`mt-10 rounded-xl bg-paper-2 px-5 py-4 text-[0.9375rem] text-ink-2`,children:e.unavailableReason??j(`run.unavailable`)}),i?(0,W.jsx)(`p`,{className:`mt-4 text-[0.875rem] text-rose`,children:i}):null]})}function Te({wizard:e,current:t}){let n=e.runners.filter(e=>e.id!==t&&e.kind===`page`&&e.url);return n.length?(0,W.jsx)(`p`,{className:`mt-4 flex flex-wrap justify-center gap-x-4 text-[0.875rem] text-ink-3`,children:n.map(e=>(0,W.jsx)(`a`,{href:e.url??void 0,className:`underline-offset-4 hover:text-ink hover:underline coarse:min-h-11`,children:j(`run.orAs`,{label:e.label})},e.id))}):null}function Ee({wizard:e,page:t}){let n=C();return(0,W.jsx)(`header`,{className:`safe-top shrink-0 border-border-soft border-b`,children:(0,W.jsxs)(`div`,{className:`mx-auto flex h-16 w-full max-w-[760px] items-center gap-3 pr-2 pl-4 sm:pr-4 sm:pl-6`,children:[(0,W.jsx)(`span`,{className:N(n?.speaking&&`animate-breathe`),children:(0,W.jsx)(E,{kind:e.avatar,costume:e.costume,size:38})}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`truncate font-display font-semibold text-[1rem] leading-tight tracking-tight`,children:e.title}),e.brand.name?(0,W.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.brand.name}):null,(0,W.jsx)(J,{page:t,small:!0})]}),e.brand.logoUrl&&B!==`popout`?(0,W.jsx)(`img`,{src:l(e.brand.logoUrl),alt:e.brand.name,className:`h-6 max-w-[120px] object-contain max-sm:hidden`}):null,(0,W.jsx)(q,{page:t,tone:`surface`}),B?null:(0,W.jsx)(D,{}),B===`popout`?(0,W.jsx)(F,{label:j(`common.close`),onClick:ue,children:(0,W.jsx)(h,{className:`size-5`})}):null]})})}function De({door:e,wizard:t,page:r,header:i,footer:a}){let{busy:o,error:s,captcha:c,setCaptcha:l,start:u,resume:d}=$(t,`/w/${t.token}/${e}`,r?.translated?r.shown:null),f=Z(),p=[];return f&&p.push({key:`elsewhere`,who:`bot`,node:j(`run.elsewhere`)}),p.push({key:`hello`,who:`bot`,node:t.description||t.title}),e!==`chat`&&p.push({key:e,who:`bot`,node:j(e===`video`?`video.hint`:`talk.joinHint`)}),t.available||p.push({key:`unavailable`,who:`bot`,node:t.unavailableReason??j(`run.unavailable`)}),s&&p.push({key:`error`,who:`bot`,node:s,tone:`error`}),t.available&&p.push(_(`start`,(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(b,{primary:!0,busy:o,disabled:!!t.turnstileSiteKey&&!c,onClick:()=>void u(),children:[j(`run.start`),` `,(0,W.jsx)(n,{className:`size-4`})]}),d?(0,W.jsx)(b,{onClick:d,children:j(`run.resume`)}):null,t.turnstileSiteKey?(0,W.jsx)(xe,{siteKey:t.turnstileSiteKey,onToken:l}):null]}))),(0,W.jsxs)(S,{header:i,footer:a,children:[(0,W.jsx)(y,{avatar:t.avatar,costume:t.costume,lines:p}),(0,W.jsx)(x,{})]})}function Oe({className:e}){return(0,W.jsx)(`footer`,{className:N(`text-center text-ink-4`,e),children:(0,W.jsx)(`a`,{href:`${d}/`,target:B?`_blank`:void 0,rel:`noreferrer`,className:`inline-block hover:text-ink-2`,children:j(`run.madeWith`).replace(`engenty wizards`,re.name)})})}function ke({chat:e=!1,steps:n=!1,talk:l=!1,video:u=!1}){let{token:p,runId:m}=c(),h=f(),g=a({queryKey:[`public`,p,H],queryFn:()=>t.get(`/api/public/wizards/${p}${H}`),retry:(e,t)=>i(t)&&e<3}),_=g.data?.runners??[],y=!g.data||_.some(e=>e.id===`talk`),b=!g.data||_.some(e=>e.id===`video`),x=!g.data||_.some(e=>e.id===`chat`)||l&&y||u&&b,S=_[0]?.id,C=e||B===`popout`||!n&&!m&&x&&(S===`chat`||S===`talk`||S===`video`),w=u&&b||!n&&!e&&!l&&S===`video`,T=!w&&(l&&y||!n&&!e&&S===`talk`),D=w?`video`:T?`talk`:`chat`,O=he(g.data);ge(m,O),te(g.data?.brand.theme),ne(g.data?.avatar),_e(p,g.data?.title),de(C);let k=O?.wizard.title??g.data?.title;(0,z.useEffect)(()=>{k&&(document.title=k)},[k]);let A=(0,z.useCallback)(e=>{try{p&&localStorage.getItem(X(p))===m&&localStorage.removeItem(X(p))}catch{}h(e,{replace:!0,state:{elsewhere:!0}})},[h,p,m]);if((0,z.useEffect)(()=>{p&&m&&o(`run`,{token:p,runId:m})},[p,m]),g.isLoading)return(0,W.jsx)(`div`,{className:N(`flex items-center justify-center text-ink-4`,Q),children:(0,W.jsx)(P,{})});if(e&&g.data&&!x||l&&g.data&&!y||u&&g.data&&!b)return(0,W.jsx)(r,{to:`/w/${p}`,replace:!0});if(!g.data){let e=i(g.error);return(0,W.jsxs)(`div`,{className:N(`flex flex-col items-center justify-center gap-4 px-6 text-center`,Q),children:[(0,W.jsx)(E,{kind:`pebble`,size:80}),(0,W.jsx)(`p`,{className:`max-w-xs text-ink-3`,children:j(e?`common.offline`:`run.notFound`)}),e?(0,W.jsx)(I,{variant:`secondary`,onClick:()=>void g.refetch(),children:j(`common.retry`)}):null]})}let F=O?.wizard??g.data,L=O?.translating?(0,W.jsxs)(`div`,{className:N(`flex flex-col items-center justify-center gap-3 text-ink-3`,Q),children:[(0,W.jsx)(P,{}),(0,W.jsx)(`p`,{className:`text-[0.875rem]`,children:j(`translation.working`)})]}):null;if(C){let e=(0,W.jsx)(Ee,{wizard:F,page:O}),t=s?(0,W.jsx)(`div`,{className:`safe-bottom`}):(0,W.jsx)(Oe,{className:`pb-[max(0.375rem,env(safe-area-inset-bottom))] text-[0.6875rem]`});return(0,W.jsxs)(`div`,{className:`wizard-page flex h-dvh flex-col`,children:[(0,W.jsx)(v,{effects:g.data.brand.theme.effects}),B||s?null:(0,W.jsx)(M,{}),L??(m?(0,W.jsx)(ee,{runId:m,talk:T,call:w?`video`:T?`audio`:!1,onRestart:()=>h(`/w/${p}/${D}`),onNotFound:()=>A(`/w/${p}/${D}`),header:w||T?void 0:e,footer:t}):(0,W.jsx)(De,{wizard:F,page:O,header:e,footer:t,door:D}))]})}return(0,W.jsxs)(`div`,{className:N(`wizard-page flex flex-col`,Q),children:[(0,W.jsx)(v,{effects:g.data.brand.theme.effects}),B||s?null:(0,W.jsx)(M,{}),B===`inline`||s?null:(0,W.jsx)(be,{brand:g.data.brand,toggle:!B,start:(0,W.jsx)(q,{page:O})}),B===`inline`||s?(0,W.jsx)(`div`,{className:`flex justify-end px-3 pt-2`,children:(0,W.jsx)(q,{page:O,tone:`surface`})}):null,m&&(O?.translated||O?.failed)?(0,W.jsx)(`div`,{className:`flex justify-center px-5`,children:(0,W.jsx)(J,{page:O})}):null,(0,W.jsx)(`div`,{className:`flex-1`,children:L??(m?(0,W.jsx)(ie,{runId:m,onRestart:()=>h(`/w/${p}`),onNotFound:()=>A(`/w/${p}`)}):(0,W.jsx)(we,{wizard:F,page:O}))}),s?(0,W.jsx)(`div`,{className:`safe-bottom`}):(0,W.jsx)(`footer`,{className:`safe-bottom pt-6 text-center text-[0.75rem] text-ink-4`,children:(0,W.jsx)(`a`,{href:`${d}/`,target:B?`_blank`:void 0,rel:`noreferrer`,className:`inline-block py-3.5 hover:text-ink-2`,children:j(`run.madeWith`).replace(`engenty wizards`,re.name)})})]})}export{be as BrandHeader,ke as PublicRunner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./jsx-runtime-C3cWAN_r.js";import{d as n}from"./marked.esm-BfGIZK7F.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./jsx-runtime-C3cWAN_r.js";import{d as n}from"./marked.esm-BfGIZK7F.js";import{or as r}from"./host-Dw-sMUSd.js";import{s as i}from"./i18n-DVrYWJaj.js";var a={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]};a.node;var o=n(a),s=e(t(),1);function c(e){return i(e.origin===`local`?`readonly.space`:`readonly.server`)}function l({children:e}){return(0,s.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-amber-tint px-4 py-3 font-medium text-[0.875rem] text-ink leading-relaxed`,children:[(0,s.jsx)(r,{className:`mt-0.5 size-4 shrink-0 text-amber`}),(0,s.jsx)(`p`,{className:`min-w-0`,children:e})]})}export{c as n,o as r,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,C as n,ar as r,mn as i,xn as a}from"./ui-DfVpZYIW.js";import{n as o,t as s}from"./jsx-runtime-C3cWAN_r.js";import{n as c,s as l}from"./i18n-DVrYWJaj.js";import{s as u}from"./read-aloud-CBycd8TA.js";import{An as d}from"./host-Dw-sMUSd.js";import{n as f}from"./RunDrawer-CeEldWRn.js";import{a as p,d as m,n as h,r as g,s as _}from"./ui-CW2I3ecu.js";var v=e(o(),1),y=e(s(),1),b=`results-search`,x={q:``,mode:``,days:0};function S(e,n,i){let a=new URLSearchParams;n&&a.set(`wizard`,n),i.q.trim()&&a.set(`q`,i.q.trim()),i.mode&&a.set(`mode`,i.mode),i.days&&a.set(`days`,String(i.days));let o=a.toString();return r({queryKey:[`results`,e,o],queryFn:()=>t.get(`/api/studio/spaces/${e}/results${o&&`?${o}`}`),enabled:!!e,placeholderData:e=>e,refetchInterval:15e3})}function C({data:e,wizardId:t,onWizard:n,filter:r,onFilter:a}){let[o,s]=(0,v.useState)(r.q);return d({icon:i,label:l(`space.resultsSearch`),run:()=>{let e=document.getElementById(b);e?.scrollIntoView({block:`center`,behavior:`smooth`}),e?.focus()}}),(0,v.useEffect)(()=>{if(o===r.q)return;let e=setTimeout(()=>a({...r,q:o}),250);return()=>clearTimeout(e)},[o,r,a]),(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,y.jsx)(m,{value:t??``,onChange:e=>n(e||null),options:[{value:``,label:l(`space.resultsAllWizards`)},...e.wizards.filter(e=>e.results||e.id===t).map(e=>({value:e.id,label:`${e.title} (${e.results})`}))],className:`w-56 max-sm:w-full`}),(0,y.jsxs)(`div`,{className:`relative min-w-0 flex-1 basis-56`,children:[(0,y.jsx)(i,{className:`-translate-y-1/2 pointer-events-none absolute top-1/2 left-3 size-4 text-ink-3`}),(0,y.jsx)(_,{type:`search`,value:o,onChange:e=>s(e.target.value),id:b,placeholder:l(`space.resultsSearch`),"aria-label":l(`space.resultsSearch`),className:`w-full pl-9`})]}),(0,y.jsx)(m,{value:r.mode,onChange:e=>a({...r,mode:e}),options:[{value:``,label:l(`space.resultsModeAll`)},{value:`live`,label:`Live`},{value:`test`,label:`Test`}],className:`w-32`}),(0,y.jsx)(m,{value:String(r.days),onChange:e=>a({...r,days:Number(e)}),options:[{value:`0`,label:l(`space.resultsAnyTime`)},{value:`1`,label:l(`space.resultsDay`)},{value:`7`,label:l(`space.resultsDays`,{n:7})},{value:`30`,label:l(`space.resultsDays`,{n:30})}],className:`w-44`})]})}function w({data:e,wizardId:t,onWizard:r,filter:i,onFilter:o}){let[s,d]=(0,v.useState)(null),m=t=>e.wizards.find(e=>e.id===t)?.title??``,_=new Intl.DateTimeFormat(c,{dateStyle:`medium`,timeStyle:`short`});return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(n,{title:t?m(t):l(`space.resultsAll`),hint:l(`space.resultsHint`),plain:!0,children:[(0,y.jsx)(C,{data:e,wizardId:t,onWizard:r,filter:i,onFilter:o}),e.runs.length?(0,y.jsx)(h,{className:`flex flex-col p-1.5`,children:e.runs.map(e=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>d(e),className:`flex items-center gap-3 rounded-lg px-3 py-2.5 text-left transition hover:bg-accent`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-[0.875rem]`,children:t?_.format(new Date(e.doneAt)):m(e.wizardId)}),(0,y.jsxs)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:[t?null:`${_.format(new Date(e.doneAt))} · `,l(`space.resultCredits`,{n:e.credits})]})]}),e.assets?(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[0.75rem] text-ink-3 tabular-nums`,title:l(`space.resultFiles`,{n:e.assets}),children:[(0,y.jsx)(a,{className:`size-3.5`}),e.assets]}):null,e.mode===`test`?(0,y.jsx)(g,{children:l(`run.testChip`)}):(0,y.jsxs)(g,{tone:`live`,children:[`Live v`,e.version]})]},e.id))}):(0,y.jsx)(h,{children:(0,y.jsx)(p,{children:i.q.trim()||i.mode||i.days?l(`space.resultsNone`):l(`space.resultsEmpty`)})})]}),s?(0,y.jsx)(f,{header:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-[0.875rem]`,children:m(s.wizardId)}),s.mode===`test`?(0,y.jsx)(g,{children:l(`run.testChip`)}):(0,y.jsxs)(g,{tone:`live`,children:[`Live v`,s.version]})]}),onClose:()=>d(null),children:(0,y.jsx)(u,{runId:s.id,compact:!0,studio:!0},s.id)}):null]})}export{w as n,S as r,x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./list-ordered-B7aUqZdk.js";import{Tn as n}from"./ui-DfVpZYIW.js";import{$n as r}from"./host-Dw-sMUSd.js";import{d as i,n as a}from"./marked.esm-BfGIZK7F.js";import{n as o,t as s}from"./jsx-runtime-C3cWAN_r.js";import{s as c}from"./i18n-DVrYWJaj.js";import{_ as l,o as u}from"./ui-CW2I3ecu.js";var d={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};d.node;var f=i(d),p=e(o(),1),m=e(s(),1),h=`wizards.runDrawer.width`,g=`wizards.runDrawer.wide`,_=680,v=400,y=()=>Math.max(v,window.innerWidth-120);function b(e){try{return localStorage.getItem(e)}catch{return null}}function x(e,t){try{localStorage.setItem(e,t)}catch{}}function S(){let[e,t]=(0,p.useState)(()=>{let e=Number(b(h));return e?Math.min(Math.max(e,v),y()):_}),[n,r]=(0,p.useState)(()=>b(g)===`1`),i=(0,p.useCallback)(e=>{let n=Math.round(Math.min(Math.max(e,v),y()));t(n),x(h,String(n))},[]);return{width:e,wide:n,toggleWide:()=>{r(!n),x(g,n?`0`:`1`)},onPointerDown:t=>{t.preventDefault();let n=t.clientX,r=e,a=e=>i(r+n-e.clientX),o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`)};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)},onKeyDown:t=>{let n=t.shiftKey?64:16;t.key===`ArrowLeft`?(t.preventDefault(),i(e+n)):t.key===`ArrowRight`&&(t.preventDefault(),i(e-n))},reset:()=>i(_)}}function C({look:e,onChange:n,ways:i=[`steps`,`chat`]}){let a=[{id:`steps`,label:c(`chat.steps`),Icon:t},{id:`chat`,label:c(`chat.chat`),Icon:r}].filter(e=>i.includes(e.id));return(0,m.jsx)(`fieldset`,{"aria-label":c(`chat.view`),className:`m-0 flex min-w-0 rounded-full border-0 bg-paper-2 p-0.5`,children:a.map(({id:t,label:r,Icon:i})=>(0,m.jsxs)(`button`,{type:`button`,"aria-pressed":e===t,title:r,onClick:()=>n(t),className:l(`inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 font-medium text-[0.75rem] transition coarse:h-9`,e===t?`bg-card text-ink shadow-soft`:`text-ink-3 hover:text-ink`),children:[(0,m.jsx)(i,{className:`size-3.5`}),(0,m.jsx)(`span`,{className:l(e!==t&&`sr-only`),children:r})]},t))})}function w({header:e,actions:t,onClose:r,children:i}){let o=S();return(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex justify-end bg-[oklch(20%_0.01_60/0.22)] backdrop-blur-[1px]`,onClick:r,children:(0,m.jsxs)(`div`,{className:l(`relative flex h-full w-full animate-rise flex-col bg-background shadow-overlay`,!o.wide&&`sm:w-[var(--drawer)]`),style:{"--drawer":`${o.width}px`},onClick:e=>e.stopPropagation(),children:[o.wide?null:(0,m.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":c(`editor.resize`),"aria-valuenow":o.width,tabIndex:0,title:c(`editor.resize`),onPointerDown:o.onPointerDown,onKeyDown:o.onKeyDown,onDoubleClick:o.reset,className:`group -left-2.5 absolute inset-y-0 z-10 hidden w-5 cursor-col-resize outline-none sm:block`,children:(0,m.jsx)(`span`,{className:`-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 h-8 w-1 rounded-full bg-ink-4/20 transition group-hover:bg-ember/60 group-focus-visible:bg-ember group-active:h-12 group-active:bg-ember`})}),(0,m.jsxs)(`div`,{className:`kb-hide flex h-14 shrink-0 items-center gap-3 px-4`,children:[(0,m.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:e}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t,(0,m.jsx)(u,{label:c(o.wide?`runDrawer.shrink`:`runDrawer.expand`),onClick:o.toggleWide,className:`max-sm:hidden`,children:o.wide?(0,m.jsx)(f,{className:`size-4`}):(0,m.jsx)(n,{className:`size-4`})}),(0,m.jsx)(u,{label:c(`editor.close`),onClick:r,children:(0,m.jsx)(a,{className:`size-5`})})]})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:i})]})})}export{w as n,C as t};
|