vibe64 0.1.72 → 0.1.73
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/dist/assets/{GithubBrowserTabs-D8twaXtF.js → GithubBrowserTabs-__1ieC1c.js} +1 -1
- package/dist/assets/GithubBrowserTabs-__1ieC1c.js.br +0 -0
- package/dist/assets/GithubBrowserTabs-__1ieC1c.js.gz +0 -0
- package/dist/assets/LocalDatabaseServer-dK29B76L.js +2 -0
- package/dist/assets/LocalDatabaseServer-dK29B76L.js.br +0 -0
- package/dist/assets/LocalDatabaseServer-dK29B76L.js.gz +0 -0
- package/dist/assets/{Vibe64DashboardPageHeader-Bd4WMiDV.js → Vibe64DashboardPageHeader-DH1YCSF1.js} +1 -1
- package/dist/assets/Vibe64DashboardPageHeader-DH1YCSF1.js.br +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-DH1YCSF1.js.gz +0 -0
- package/dist/assets/{Vibe64DatabaseWorkspace-CprnbQkL.js → Vibe64DatabaseWorkspace-csnEOYGD.js} +1 -1
- package/dist/assets/Vibe64DatabaseWorkspace-csnEOYGD.js.br +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-csnEOYGD.js.gz +0 -0
- package/dist/assets/{Vibe64FileArea-CcKMG84N.js → Vibe64FileArea-CeiAmwiT.js} +1 -1
- package/dist/assets/Vibe64FileArea-CeiAmwiT.js.br +0 -0
- package/dist/assets/Vibe64FileArea-CeiAmwiT.js.gz +0 -0
- package/dist/assets/{Vibe64OutputControls-D0l0i_kq.js → Vibe64OutputControls-nFkMTVFI.js} +1 -1
- package/dist/assets/Vibe64OutputControls-nFkMTVFI.js.br +0 -0
- package/dist/assets/Vibe64OutputControls-nFkMTVFI.js.gz +0 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-EkT8pmMV.js → Vibe64RepositoryWorkspace-BcGZsRIF.js} +1 -1
- package/dist/assets/Vibe64RepositoryWorkspace-BcGZsRIF.js.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-BcGZsRIF.js.gz +0 -0
- package/dist/assets/{Vibe64SessionFiles-Qk_kv1Q8.js → Vibe64SessionFiles-BrNoYV6c.js} +1 -1
- package/dist/assets/Vibe64SessionFiles-BrNoYV6c.js.br +0 -0
- package/dist/assets/Vibe64SessionFiles-BrNoYV6c.js.gz +0 -0
- package/dist/assets/{Vibe64SessionSourceEditor-oYTMnob5.js → Vibe64SessionSourceEditor-Pz9DR_lm.js} +1 -1
- package/dist/assets/Vibe64SessionSourceEditor-Pz9DR_lm.js.br +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-Pz9DR_lm.js.gz +0 -0
- package/dist/assets/{Vibe64UiStoryboardView-BZh1b5Xt.js → Vibe64UiStoryboardView-D8Z-WkVp.js} +1 -1
- package/dist/assets/Vibe64UiStoryboardView-D8Z-WkVp.js.br +0 -0
- package/dist/assets/Vibe64UiStoryboardView-D8Z-WkVp.js.gz +0 -0
- package/dist/assets/{_pageId_-xB2NWBqF.js → _pageId_-DsnrOQFl.js} +1 -1
- package/dist/assets/{_sessionId_-g78evnUW.js → _sessionId_-DI83WzOB.js} +1 -1
- package/dist/assets/_sessionId_-DI83WzOB.js.br +0 -0
- package/dist/assets/_sessionId_-DI83WzOB.js.gz +0 -0
- package/dist/assets/{_sessionTool_-cw3WaYPb.js → _sessionTool_-BkRFpBKI.js} +1 -1
- package/dist/assets/{access-oIeDSza-.js → access-CD1NLU2z.js} +1 -1
- package/dist/assets/access-CD1NLU2z.js.br +0 -0
- package/dist/assets/access-CD1NLU2z.js.gz +0 -0
- package/dist/assets/{app-0jq6SFSn.js → app-NJHCyI2M.js} +1 -1
- package/dist/assets/app-NJHCyI2M.js.br +0 -0
- package/dist/assets/app-NJHCyI2M.js.gz +0 -0
- package/dist/assets/{changes-Db1dzMsx.js → changes-Bg5fn535.js} +1 -1
- package/dist/assets/{client-DW9uggbF.js → client-B5-KiJ_k.js} +2 -2
- package/dist/assets/client-B5-KiJ_k.js.br +0 -0
- package/dist/assets/client-B5-KiJ_k.js.gz +0 -0
- package/dist/assets/{client-Lmbw-Ygm.js → client-DHAysNQ_.js} +2 -2
- package/dist/assets/client-DHAysNQ_.js.br +0 -0
- package/dist/assets/client-DHAysNQ_.js.gz +0 -0
- package/dist/assets/{dashboard-CUnY0-1W.js → dashboard-Bzs2mNSD.js} +1 -1
- package/dist/assets/{english-definitions-DovEdEkp.js → english-definitions-jEDFqPtl.js} +1 -1
- package/dist/assets/english-definitions-jEDFqPtl.js.br +0 -0
- package/dist/assets/english-definitions-jEDFqPtl.js.gz +0 -0
- package/dist/assets/{env-CZritO-9.js → env-CuVAcxrg.js} +1 -1
- package/dist/assets/env-CuVAcxrg.js.br +0 -0
- package/dist/assets/env-CuVAcxrg.js.gz +0 -0
- package/dist/assets/{error-o4gXqrKI.js → error-vtsBf2sc.js} +1 -1
- package/dist/assets/error-vtsBf2sc.js.br +0 -0
- package/dist/assets/error-vtsBf2sc.js.gz +0 -0
- package/dist/assets/{fileTypes-Bqlch7JV.js → fileTypes-BtIfp_s4.js} +1 -1
- package/dist/assets/fileTypes-BtIfp_s4.js.br +0 -0
- package/dist/assets/fileTypes-BtIfp_s4.js.gz +0 -0
- package/dist/assets/{health-LP0Mz2qB.js → health-hZ8hCq4g.js} +1 -1
- package/dist/assets/health-hZ8hCq4g.js.br +0 -0
- package/dist/assets/health-hZ8hCq4g.js.gz +0 -0
- package/dist/assets/{history-DkjaInmh.js → history-BUD8OO2u.js} +1 -1
- package/dist/assets/history-BUD8OO2u.js.br +0 -0
- package/dist/assets/history-BUD8OO2u.js.gz +0 -0
- package/dist/assets/{index-C_LlHM8w.js → index-DW2-Y5r1.js} +4 -4
- package/dist/assets/index-DW2-Y5r1.js.br +0 -0
- package/dist/assets/index-DW2-Y5r1.js.gz +0 -0
- package/dist/assets/{integrations-C6_N7WwF.js → integrations-mJUuC1tA.js} +1 -1
- package/dist/assets/integrations-mJUuC1tA.js.br +0 -0
- package/dist/assets/{integrations-C6_N7WwF.js.gz → integrations-mJUuC1tA.js.gz} +0 -0
- package/dist/assets/{issues-DAJzymvp.js → issues-D6TrPRr_.js} +1 -1
- package/dist/assets/issues-D6TrPRr_.js.br +0 -0
- package/dist/assets/issues-D6TrPRr_.js.gz +0 -0
- package/dist/assets/{learning-6W-aGxBH.js → learning-DSNeeTtU.js} +1 -1
- package/dist/assets/{pages-BePUPkVf.js → pages-DpJxIaJ-.js} +1 -1
- package/dist/assets/{pages-C31UYhFG.js → pages-cUFHVIQj.js} +1 -1
- package/dist/assets/pages-cUFHVIQj.js.br +1 -0
- package/dist/assets/pages-cUFHVIQj.js.gz +0 -0
- package/dist/assets/{project-Bw_8Bd8D.js → project-D45_Rd6Y.js} +6 -6
- package/dist/assets/project-D45_Rd6Y.js.br +0 -0
- package/dist/assets/project-D45_Rd6Y.js.gz +0 -0
- package/dist/assets/{project-files-CdcCb8jL.js → project-files-DgvpUk1M.js} +1 -1
- package/dist/assets/project-files-DgvpUk1M.js.br +0 -0
- package/dist/assets/project-files-DgvpUk1M.js.gz +0 -0
- package/dist/assets/{project-shared-ShellOutlet-CVomMDvt.js → project-shared-ShellOutlet-eIh5yfRJ.js} +1 -1
- package/dist/assets/project-shared-ShellOutlet-eIh5yfRJ.js.br +0 -0
- package/dist/assets/project-shared-ShellOutlet-eIh5yfRJ.js.gz +0 -0
- package/dist/assets/{project-shared-VBottomSheet-Bu53ETe9.js → project-shared-VBottomSheet-XWVEiPmQ.js} +1 -1
- package/dist/assets/project-shared-VBottomSheet-XWVEiPmQ.js.br +0 -0
- package/dist/assets/project-shared-VBottomSheet-XWVEiPmQ.js.gz +0 -0
- package/dist/assets/{project-shared-VToolbar-Bd4xlEK-.js → project-shared-VToolbar-DKJZQDcP.js} +1 -1
- package/dist/assets/project-shared-VToolbar-DKJZQDcP.js.br +0 -0
- package/dist/assets/project-shared-VToolbar-DKJZQDcP.js.gz +0 -0
- package/dist/assets/{project-shared-pageNames-BVgvVg71.js → project-shared-pageNames-CWXyQBuT.js} +1 -1
- package/dist/assets/project-shared-pageNames-CWXyQBuT.js.br +0 -0
- package/dist/assets/project-shared-pageNames-CWXyQBuT.js.gz +0 -0
- package/dist/assets/{publish-a6jL_LlB.js → publish-BKAvPixQ.js} +1 -1
- package/dist/assets/publish-BKAvPixQ.js.br +0 -0
- package/dist/assets/publish-BKAvPixQ.js.gz +0 -0
- package/dist/assets/{pull-requests-DoyqPC5b.js → pull-requests-DycdPcXY.js} +1 -1
- package/dist/assets/pull-requests-DycdPcXY.js.br +0 -0
- package/dist/assets/pull-requests-DycdPcXY.js.gz +0 -0
- package/dist/assets/{repository-MUZOzMUA.js → repository-BugUartC.js} +1 -1
- package/dist/assets/{session-CtbSoHK-.js → session-B4iZufWI.js} +1 -1
- package/dist/assets/session-B4iZufWI.js.br +0 -0
- package/dist/assets/session-B4iZufWI.js.gz +0 -0
- package/dist/assets/{settings-BdbR3bEK.js → settings-BrO7TeLW.js} +1 -1
- package/dist/assets/settings-BrO7TeLW.js.br +0 -0
- package/dist/assets/settings-BrO7TeLW.js.gz +0 -0
- package/dist/assets/{useArchivedVibe64Sessions-DXTj9b9K.js → useArchivedVibe64Sessions-DdavJ9tr.js} +1 -1
- package/dist/assets/useArchivedVibe64Sessions-DdavJ9tr.js.br +0 -0
- package/dist/assets/useArchivedVibe64Sessions-DdavJ9tr.js.gz +0 -0
- package/dist/assets/{vibe64AttachmentDownload-BODXLh6N.js → vibe64AttachmentDownload-DjRt5OfX.js} +1 -1
- package/dist/assets/{vibe64SavedEnvValues-BbuzhsJf.js → vibe64SavedEnvValues-YEXrs2xe.js} +1 -1
- package/dist/assets/{vue-flow-core-6H3SH19E.js → vue-flow-core-DzmtR5x-.js} +1 -1
- package/dist/assets/vue-flow-core-DzmtR5x-.js.br +0 -0
- package/dist/assets/vue-flow-core-DzmtR5x-.js.gz +0 -0
- package/dist/index.html +2 -2
- package/docs/colleague-usage/workspace-preparation.md +9 -1
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
- package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/connectors-catalog/locales/en.json +2 -2
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/patterns/event-delivery/PATTERN.md +1 -1
- package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
- package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/CHANGELOG.md +2 -0
- package/node_modules/@jskit-ai/kernel/package.json +1 -1
- package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/payments-core/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/realtime/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/patterns/realtime-application/PATTERN.md +2 -2
- package/node_modules/@jskit-ai/resource-core/package.json +1 -1
- package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +496 -490
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +6 -6
- package/package.json +13 -13
- package/server.bundle.mjs +27597 -27582
- package/dist/assets/GithubBrowserTabs-D8twaXtF.js.br +0 -0
- package/dist/assets/GithubBrowserTabs-D8twaXtF.js.gz +0 -0
- package/dist/assets/LocalDatabaseServer-BjJgeNye.js +0 -2
- package/dist/assets/LocalDatabaseServer-BjJgeNye.js.br +0 -0
- package/dist/assets/LocalDatabaseServer-BjJgeNye.js.gz +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-Bd4WMiDV.js.br +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-Bd4WMiDV.js.gz +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-CprnbQkL.js.br +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-CprnbQkL.js.gz +0 -0
- package/dist/assets/Vibe64FileArea-CcKMG84N.js.br +0 -0
- package/dist/assets/Vibe64FileArea-CcKMG84N.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-D0l0i_kq.js.br +0 -0
- package/dist/assets/Vibe64OutputControls-D0l0i_kq.js.gz +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-EkT8pmMV.js.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-EkT8pmMV.js.gz +0 -0
- package/dist/assets/Vibe64SessionFiles-Qk_kv1Q8.js.br +0 -0
- package/dist/assets/Vibe64SessionFiles-Qk_kv1Q8.js.gz +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-oYTMnob5.js.br +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-oYTMnob5.js.gz +0 -0
- package/dist/assets/Vibe64UiStoryboardView-BZh1b5Xt.js.br +0 -0
- package/dist/assets/Vibe64UiStoryboardView-BZh1b5Xt.js.gz +0 -0
- package/dist/assets/_sessionId_-g78evnUW.js.br +0 -0
- package/dist/assets/_sessionId_-g78evnUW.js.gz +0 -0
- package/dist/assets/access-oIeDSza-.js.br +0 -0
- package/dist/assets/access-oIeDSza-.js.gz +0 -0
- package/dist/assets/app-0jq6SFSn.js.br +0 -0
- package/dist/assets/app-0jq6SFSn.js.gz +0 -0
- package/dist/assets/client-DW9uggbF.js.br +0 -0
- package/dist/assets/client-DW9uggbF.js.gz +0 -0
- package/dist/assets/client-Lmbw-Ygm.js.br +0 -0
- package/dist/assets/client-Lmbw-Ygm.js.gz +0 -0
- package/dist/assets/english-definitions-DovEdEkp.js.br +0 -0
- package/dist/assets/english-definitions-DovEdEkp.js.gz +0 -0
- package/dist/assets/env-CZritO-9.js.br +0 -0
- package/dist/assets/env-CZritO-9.js.gz +0 -0
- package/dist/assets/error-o4gXqrKI.js.br +0 -0
- package/dist/assets/error-o4gXqrKI.js.gz +0 -0
- package/dist/assets/fileTypes-Bqlch7JV.js.br +0 -0
- package/dist/assets/fileTypes-Bqlch7JV.js.gz +0 -0
- package/dist/assets/health-LP0Mz2qB.js.br +0 -0
- package/dist/assets/health-LP0Mz2qB.js.gz +0 -0
- package/dist/assets/history-DkjaInmh.js.br +0 -0
- package/dist/assets/history-DkjaInmh.js.gz +0 -0
- package/dist/assets/index-C_LlHM8w.js.br +0 -0
- package/dist/assets/index-C_LlHM8w.js.gz +0 -0
- package/dist/assets/integrations-C6_N7WwF.js.br +0 -0
- package/dist/assets/issues-DAJzymvp.js.br +0 -0
- package/dist/assets/issues-DAJzymvp.js.gz +0 -0
- package/dist/assets/pages-C31UYhFG.js.br +0 -0
- package/dist/assets/pages-C31UYhFG.js.gz +0 -0
- package/dist/assets/project-Bw_8Bd8D.js.br +0 -0
- package/dist/assets/project-Bw_8Bd8D.js.gz +0 -0
- package/dist/assets/project-files-CdcCb8jL.js.br +0 -0
- package/dist/assets/project-files-CdcCb8jL.js.gz +0 -0
- package/dist/assets/project-shared-ShellOutlet-CVomMDvt.js.br +0 -0
- package/dist/assets/project-shared-ShellOutlet-CVomMDvt.js.gz +0 -0
- package/dist/assets/project-shared-VBottomSheet-Bu53ETe9.js.br +0 -0
- package/dist/assets/project-shared-VBottomSheet-Bu53ETe9.js.gz +0 -0
- package/dist/assets/project-shared-VToolbar-Bd4xlEK-.js.br +0 -0
- package/dist/assets/project-shared-VToolbar-Bd4xlEK-.js.gz +0 -0
- package/dist/assets/project-shared-pageNames-BVgvVg71.js.br +0 -0
- package/dist/assets/project-shared-pageNames-BVgvVg71.js.gz +0 -0
- package/dist/assets/publish-a6jL_LlB.js.br +0 -0
- package/dist/assets/publish-a6jL_LlB.js.gz +0 -0
- package/dist/assets/pull-requests-DoyqPC5b.js.br +0 -0
- package/dist/assets/pull-requests-DoyqPC5b.js.gz +0 -0
- package/dist/assets/session-CtbSoHK-.js.br +0 -0
- package/dist/assets/session-CtbSoHK-.js.gz +0 -0
- package/dist/assets/settings-BdbR3bEK.js.br +0 -0
- package/dist/assets/settings-BdbR3bEK.js.gz +0 -0
- package/dist/assets/useArchivedVibe64Sessions-DXTj9b9K.js.br +0 -0
- package/dist/assets/useArchivedVibe64Sessions-DXTj9b9K.js.gz +0 -0
- package/dist/assets/vue-flow-core-6H3SH19E.js.br +0 -0
- package/dist/assets/vue-flow-core-6H3SH19E.js.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pages-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pages-DpJxIaJ-.js","assets/project-shared-route-block-DbL-SuOj.js","assets/app-NJHCyI2M.js","assets/project-shared-ShellOutlet-eIh5yfRJ.js","assets/project-shared-VToolbar-DKJZQDcP.js","assets/project-shared-VToolbar-CY3-1Sb0.css","assets/project-shared-ShellOutlet-DfKYI6ZS.css","assets/app-BavZ6hrk.css","assets/learning-DSNeeTtU.js","assets/project-D45_Rd6Y.js","assets/project-shared-VBottomSheet-XWVEiPmQ.js","assets/project-shared-VBottomSheet-BEV2Ihna.css","assets/project-shared-pageNames-CWXyQBuT.js","assets/project-DTGwAgqm.css","assets/dashboard-Bzs2mNSD.js","assets/_sessionTool_-BkRFpBKI.js","assets/_sessionTool_-DiYoi-BF.css","assets/access-CD1NLU2z.js","assets/access-BH1OsqPS.css","assets/changes-Bg5fn535.js","assets/Vibe64RepositoryWorkspace-BcGZsRIF.js","assets/libesm-CR-iGldz.js","assets/Vibe64DashboardPageHeader-DH1YCSF1.js","assets/Vibe64DashboardPageHeader-2JX76yfq.css","assets/Vibe64RepositoryWorkspace-BWu6OV32.css","assets/env-CuVAcxrg.js","assets/vibe64AttachmentDownload-DjRt5OfX.js","assets/contracts-CNUMi5L0.js","assets/vibe64SavedEnvValues-YEXrs2xe.js","assets/env-i_R_LXlE.css","assets/health-hZ8hCq4g.js","assets/health-xnU0lci9.css","assets/history-BUD8OO2u.js","assets/useArchivedVibe64Sessions-DdavJ9tr.js","assets/history-BSIuLgnI.css","assets/_sessionId_-DI83WzOB.js","assets/Vibe64SessionFiles-BrNoYV6c.js","assets/Vibe64FileArea-CeiAmwiT.js","assets/fileTypes-BtIfp_s4.js","assets/fileTypes-c-LysNzr.css","assets/Vibe64FileArea-ZEzsvLt2.css","assets/Vibe64SessionSourceEditor-Pz9DR_lm.js","assets/dist-CDa9Iec1.js","assets/client-DHAysNQ_.js","assets/Vibe64SessionSourceEditor-l0R5uY2U.css","assets/Vibe64SessionFiles-BKWcpSXz.css","assets/_sessionId_-7PyIUeUr.css","assets/integrations-mJUuC1tA.js","assets/english-definitions-jEDFqPtl.js","assets/integrations-sQuGZtOl.css","assets/issues-D6TrPRr_.js","assets/GithubBrowserTabs-__1ieC1c.js","assets/issues-D46llNv-.css","assets/pages-cUFHVIQj.js","assets/pages-DpVxXdGt.css","assets/_pageId_-DsnrOQFl.js","assets/project-files-DgvpUk1M.js","assets/project-files-DjEn-Hp2.css","assets/publish-BKAvPixQ.js","assets/publish-BIY5aZgD.css","assets/pull-requests-DycdPcXY.js","assets/pull-requests-DtqrTix0.css","assets/repository-BugUartC.js","assets/session-B4iZufWI.js","assets/session-BJhq3K2n.css","assets/settings-BrO7TeLW.js","assets/settings-BKZcbISO.css","assets/xterm-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __esmMin=(fn,res,err)=>()=>{if(err)throw err[0];try{return fn&&(res=fn(fn=0)),res}catch(e){throw err=[e],e}};var __commonJSMin=(cb,mod)=>()=>(mod||(cb((mod={exports:{}}).exports,mod),cb=null),mod.exports);var __exportAll=(all,no_symbols)=>{let target={};for(var name in all){__defProp(target,name,{get:all[name],enumerable:true})}if(!no_symbols){__defProp(target,Symbol.toStringTag,{value:`Module`})}return target};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===`object`||typeof from===`function`){for(var keys=__getOwnPropNames(from),i=0,n=keys.length,key;i<n;i++){key=keys[i];if(!__hasOwnProp.call(to,key)&&key!==except){__defProp(to,key,{get:(k=>from[k]).bind(null,key),enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}}}return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule||!__hasOwnProp.call(mod,`default`)?__defProp(target,`default`,{value:mod,enumerable:true}):target,mod));var __toCommonJS=mod=>__hasOwnProp.call(mod,`module.exports`)?mod[`module.exports`]:__copyProps(__defProp({},`__esModule`,{value:true}),mod);(function polyfill(){const relList=document.createElement(`link`).relList;if(relList&&relList.supports&&relList.supports(`modulepreload`))return;for(const link of document.querySelectorAll(`link[rel="modulepreload"]`))processPreload(link);new MutationObserver(mutations=>{for(const mutation of mutations){if(mutation.type!==`childList`)continue;for(const node of mutation.addedNodes)if(node.tagName===`LINK`&&node.rel===`modulepreload`)processPreload(node)}}).observe(document,{childList:true,subtree:true});function getFetchOpts(link){const fetchOpts={};if(link.integrity)fetchOpts.integrity=link.integrity;if(link.referrerPolicy)fetchOpts.referrerPolicy=link.referrerPolicy;if(link.crossOrigin===`use-credentials`)fetchOpts.credentials=`include`;else if(link.crossOrigin===`anonymous`)fetchOpts.credentials=`omit`;else fetchOpts.credentials=`same-origin`;return fetchOpts}function processPreload(link){if(link.ep)return;link.ep=true;const fetchOpts=getFetchOpts(link);fetch(link.href,fetchOpts)}})();function makeMap(str){const map=Object.create(null);for(const key of str.split(`,`))map[key]=1;return val=>val in map}var EMPTY_OBJ={};var EMPTY_ARR=[];var NOOP=()=>{};var NO=()=>false;var isOn$1=key=>key.charCodeAt(0)===111&&key.charCodeAt(1)===110&&(key.charCodeAt(2)>122||key.charCodeAt(2)<97);var isModelListener=key=>key.startsWith(`onUpdate:`);var extend=Object.assign;var remove=(arr,el)=>{const i=arr.indexOf(el);if(i>-1)arr.splice(i,1)};var hasOwnProperty$1=Object.prototype.hasOwnProperty;var hasOwn$1=(val,key)=>hasOwnProperty$1.call(val,key);var isArray$2=Array.isArray;var isMap=val=>toTypeString(val)===`[object Map]`;var isSet=val=>toTypeString(val)===`[object Set]`;var isDate=val=>toTypeString(val)===`[object Date]`;var isFunction$2=val=>typeof val===`function`;var isString$1=val=>typeof val===`string`;var isSymbol$1=val=>typeof val===`symbol`;var isObject$2=val=>val!==null&&typeof val===`object`;var isPromise=val=>{return(isObject$2(val)||isFunction$2(val))&&isFunction$2(val.then)&&isFunction$2(val.catch)};var objectToString$1=Object.prototype.toString;var toTypeString=value=>objectToString$1.call(value);var toRawType=value=>{return toTypeString(value).slice(8,-1)};var isPlainObject$6=val=>toTypeString(val)===`[object Object]`;var isIntegerKey=key=>isString$1(key)&&key!==`NaN`&&key[0]!==`-`&&``+parseInt(key,10)===key;var isReservedProp=makeMap(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`);var cacheStringFunction=fn=>{const cache=Object.create(null);return(str=>{return cache[str]||(cache[str]=fn(str))})};var camelizeRE=/-\w/g;var camelize=cacheStringFunction(str=>{return str.replace(camelizeRE,c=>c.slice(1).toUpperCase())});var hyphenateRE=/\B([A-Z])/g;var hyphenate=cacheStringFunction(str=>str.replace(hyphenateRE,`-$1`).toLowerCase());var capitalize=cacheStringFunction(str=>{return str.charAt(0).toUpperCase()+str.slice(1)});var toHandlerKey=cacheStringFunction(str=>{return str?`on${capitalize(str)}`:``});var hasChanged=(value,oldValue)=>!Object.is(value,oldValue);var invokeArrayFns=(fns,...arg)=>{for(let i=0;i<fns.length;i++)fns[i](...arg)};var def=(obj,key,value,writable=false)=>{Object.defineProperty(obj,key,{configurable:true,enumerable:false,writable,value})};var looseToNumber=val=>{const n=parseFloat(val);return isNaN(n)?val:n};var toNumber=val=>{const n=isString$1(val)?Number(val):NaN;return isNaN(n)?val:n};var _globalThis;var getGlobalThis=()=>{return _globalThis||(_globalThis=typeof globalThis!==`undefined`?globalThis:typeof self!==`undefined`?self:typeof window!==`undefined`?window:typeof global!==`undefined`?global:{})};function normalizeStyle(value){if(isArray$2(value)){const res={};for(let i=0;i<value.length;i++){const item=value[i];const normalized=isString$1(item)?parseStringStyle(item):normalizeStyle(item);if(normalized)for(const key in normalized)res[key]=normalized[key]}return res}else if(isString$1(value)||isObject$2(value))return value}var listDelimiterRE=/;(?![^(]*\))/g;var propertyDelimiterRE=/:([^]+)/;var styleCommentRE=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function parseStringStyle(cssText){const ret={};cssText.replace(styleCommentRE,match=>match.startsWith(`/*`)?``:match).split(listDelimiterRE).forEach(item=>{if(item){const tmp=item.split(propertyDelimiterRE);tmp.length>1&&(ret[tmp[0].trim()]=tmp[1].trim())}});return ret}function normalizeClass(value){let res=``;if(isString$1(value))res=value;else if(isArray$2(value))for(let i=0;i<value.length;i++){const normalized=normalizeClass(value[i]);if(normalized)res+=normalized+` `}else if(isObject$2(value)){for(const name in value)if(value[name])res+=name+` `}return res.trim()}function normalizeProps(props){if(!props)return null;let{class:klass,style}=props;if(klass&&!isString$1(klass))props.class=normalizeClass(klass);if(style)props.style=normalizeStyle(style);return props}var specialBooleanAttrs=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;var isSpecialBooleanAttr=makeMap(specialBooleanAttrs);var isBooleanAttr=makeMap(specialBooleanAttrs+`,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function includeBooleanAttr(value){return!!value||value===``}function looseCompareArrays(a,b,seen){if(a.length!==b.length)return false;let equal=true;for(let i=0;equal&&i<a.length;i++)equal=looseEqual(a[i],b[i],seen);return equal}function looseCompareCollections(a,b,seen){if(a.size!==b.size)return false;const candidates=Array.from(b);const matched=new Uint8Array(candidates.length);for(const item of a){let index=-1;for(let i=0;i<candidates.length;i++)if(!matched[i]&&looseEqual(item,candidates[i],seen)){index=i;break}if(index<0)return false;matched[index]=1}return true}function looseCompareObjects(a,b,seen){let aValidType=isMap(a);let bValidType=isMap(b);if(aValidType||bValidType)return aValidType&&bValidType?looseCompareCollections(a,b,seen):false;aValidType=isSet(a);bValidType=isSet(b);if(aValidType||bValidType)return aValidType&&bValidType?looseCompareCollections(a,b,seen):false;if(Object.keys(a).length!==Object.keys(b).length)return false;for(const key in a){const aHasKey=a.hasOwnProperty(key);const bHasKey=b.hasOwnProperty(key);if(aHasKey&&!bHasKey||!aHasKey&&bHasKey||!looseEqual(a[key],b[key],seen))return false}return String(a)===String(b)}function looseCompareNested(a,b,seen,compare){if(!seen)seen=[new Map,new Map];const[seenA,seenB]=seen;if(seenA.has(a)||seenB.has(b))return seenA.get(a)===b&&seenB.get(b)===a;seenA.set(a,b);seenB.set(b,a);const equal=compare(a,b,seen);seenA.delete(a);seenB.delete(b);return equal}function looseEqual(a,b,seen){if(a===b)return true;let aValidType=isDate(a);let bValidType=isDate(b);if(aValidType||bValidType)return aValidType&&bValidType?a.getTime()===b.getTime():false;aValidType=isSymbol$1(a);bValidType=isSymbol$1(b);if(aValidType||bValidType)return a===b;aValidType=isArray$2(a);bValidType=isArray$2(b);if(aValidType||bValidType)return aValidType&&bValidType?looseCompareNested(a,b,seen,looseCompareArrays):false;aValidType=isObject$2(a);bValidType=isObject$2(b);if(aValidType||bValidType){if(!aValidType||!bValidType)return false;return looseCompareNested(a,b,seen,looseCompareObjects)}return String(a)===String(b)}function looseIndexOf(arr,val){return arr.findIndex(item=>looseEqual(item,val))}var isRef$1=val=>{return!!(val&&val[`__v_isRef`]===true)};var toDisplayString=val=>{return isString$1(val)?val:val==null?``:isArray$2(val)||isObject$2(val)&&(val.toString===objectToString$1||!isFunction$2(val.toString))?isRef$1(val)?toDisplayString(val.value):JSON.stringify(val,replacer,2):String(val)};var replacer=(_key,val)=>{if(isRef$1(val))return replacer(_key,val.value);else if(isMap(val))return{[`Map(${val.size})`]:[...val.entries()].reduce((entries,[key,val2],i)=>{entries[stringifySymbol(key,i)+` =>`]=val2;return entries},{})};else if(isSet(val))return{[`Set(${val.size})`]:[...val.values()].map(v=>stringifySymbol(v))};else if(isSymbol$1(val))return stringifySymbol(val);else if(isObject$2(val)&&!isArray$2(val)&&!isPlainObject$6(val))return String(val);return val};var stringifySymbol=(v,i=``)=>{var _a;return isSymbol$1(v)?`Symbol(${(_a=v.description)!=null?_a:i})`:v};function normalizeCssVarValue(value){if(value==null)return`initial`;if(typeof value===`string`)return value===``?` `:value;if(typeof value!==`number`||!Number.isFinite(value)){}return String(value)}var activeEffectScope;var EffectScope=class{constructor(detached=false){this.detached=detached;this._active=true;this._on=0;this.effects=[];this.cleanups=[];this._isPaused=false;this._warnOnRun=true;this.__v_skip=true;if(!detached&&activeEffectScope){if(activeEffectScope.active){this.parent=activeEffectScope;this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1}else{this._active=false;this._warnOnRun=false}}}get active(){return this._active}pause(){if(this._active){this._isPaused=true;let i,l;if(this.scopes){const scopes=this.scopes.slice();for(i=0,l=scopes.length;i<l;i++)scopes[i].pause()}for(i=0,l=this.effects.length;i<l;i++)this.effects[i].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=false;let i,l;if(this.scopes){const scopes=this.scopes.slice();for(i=0,l=scopes.length;i<l;i++)scopes[i].resume()}const effects=this.effects.slice();for(i=0,l=effects.length;i<l;i++)effects[i].resume()}}}run(fn){if(this._active){const currentEffectScope=activeEffectScope;try{activeEffectScope=this;return fn()}finally{activeEffectScope=currentEffectScope}}}on(){if(++this._on===1){this.prevScope=activeEffectScope;activeEffectScope=this}}off(){if(this._on>0&&--this._on===0){if(activeEffectScope===this)activeEffectScope=this.prevScope;else{let current=activeEffectScope;while(current){if(current.prevScope===this){current.prevScope=this.prevScope;break}current=current.prevScope}}this.prevScope=void 0}}stop(fromParent){if(this._active){this._active=false;let i,l;for(i=0,l=this.effects.length;i<l;i++)this.effects[i].stop();this.effects.length=0;for(i=0,l=this.cleanups.length;i<l;i++)this.cleanups[i]();this.cleanups.length=0;if(this.scopes){const scopes=this.scopes.slice();for(i=0,l=scopes.length;i<l;i++)scopes[i].stop(true);this.scopes.length=0}if(!this.detached&&this.parent&&!fromParent){const last=this.parent.scopes.pop();if(last&&last!==this){this.parent.scopes[this.index]=last;last.index=this.index}}this.parent=void 0}}};function effectScope(detached){return new EffectScope(detached)}function getCurrentScope(){return activeEffectScope}function onScopeDispose(fn,failSilently=false){if(activeEffectScope)activeEffectScope.cleanups.push(fn)}var activeSub;var pausedQueueEffects=new WeakSet;var ReactiveEffect=class{constructor(fn){this.fn=fn;this.deps=void 0;this.depsTail=void 0;this.flags=5;this.next=void 0;this.cleanup=void 0;this.scheduler=void 0;if(activeEffectScope){if(activeEffectScope.active)activeEffectScope.effects.push(this);else this.flags&=-2}}pause(){this.flags|=64}resume(){if(this.flags&64){this.flags&=-65;if(pausedQueueEffects.has(this)){pausedQueueEffects.delete(this);this.trigger()}}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))batch(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2;cleanupEffect(this);prepareDeps(this);const prevEffect=activeSub;const prevShouldTrack=shouldTrack;activeSub=this;shouldTrack=true;try{return this.fn()}finally{cleanupDeps(this);activeSub=prevEffect;shouldTrack=prevShouldTrack;this.flags&=-3}}stop(){if(this.flags&1){for(let link=this.deps;link;link=link.nextDep)removeSub(link);this.deps=this.depsTail=void 0;cleanupEffect(this);this.onStop&&this.onStop();this.flags&=-2}}trigger(){if(this.flags&64)pausedQueueEffects.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(isDirty(this))this.run()}get dirty(){return isDirty(this)}};var batchDepth=0;var batchedSub;var batchedComputed;function batch(sub,isComputed=false){sub.flags|=8;if(isComputed){sub.next=batchedComputed;batchedComputed=sub;return}sub.next=batchedSub;batchedSub=sub}function startBatch(){batchDepth++}function endBatch(){if(--batchDepth>0)return;if(batchedComputed){let e=batchedComputed;batchedComputed=void 0;while(e){const next=e.next;e.next=void 0;e.flags&=-9;e=next}}let error;while(batchedSub){let e=batchedSub;batchedSub=void 0;while(e){const next=e.next;e.next=void 0;e.flags&=-9;if(e.flags&1)try{e.trigger()}catch(err){if(!error)error=err}e=next}}if(error)throw error}function prepareDeps(sub){for(let link=sub.deps;link;link=link.nextDep){link.version=-1;link.prevActiveLink=link.dep.activeLink;link.dep.activeLink=link}}function cleanupDeps(sub){let head;let tail=sub.depsTail;let link=tail;while(link){const prev=link.prevDep;if(link.version===-1){if(link===tail)tail=prev;removeSub(link);removeDep(link)}else head=link;link.dep.activeLink=link.prevActiveLink;link.prevActiveLink=void 0;link=prev}sub.deps=head;sub.depsTail=tail}function isDirty(sub){for(let link=sub.deps;link;link=link.nextDep)if(link.dep.version!==link.version||link.dep.computed&&(refreshComputed(link.dep.computed)||link.dep.version!==link.version))return true;if(sub._dirty)return true;return false}function refreshComputed(computed){if(computed.flags&4&&!(computed.flags&16))return;computed.flags&=-17;if(computed.globalVersion===globalVersion)return;computed.globalVersion=globalVersion;if(!computed.isSSR&&computed.flags&128&&(!computed.deps&&!computed._dirty||!isDirty(computed)))return;computed.flags|=2;const dep=computed.dep;const prevSub=activeSub;const prevShouldTrack=shouldTrack;activeSub=computed;shouldTrack=true;try{prepareDeps(computed);const value=computed.fn(computed._value);if(dep.version===0||hasChanged(value,computed._value)){computed.flags|=128;computed._value=value;dep.version++}}catch(err){dep.version++;throw err}finally{activeSub=prevSub;shouldTrack=prevShouldTrack;cleanupDeps(computed);computed.flags&=-3}}function removeSub(link,soft=false){const{dep,prevSub,nextSub}=link;if(prevSub){prevSub.nextSub=nextSub;link.prevSub=void 0}if(nextSub){nextSub.prevSub=prevSub;link.nextSub=void 0}if(dep.subs===link){dep.subs=prevSub;if(!prevSub&&dep.computed){dep.computed.flags&=-5;for(let l=dep.computed.deps;l;l=l.nextDep)removeSub(l,true)}}if(!soft&&!--dep.sc&&dep.map)dep.map.delete(dep.key)}function removeDep(link){const{prevDep,nextDep}=link;if(prevDep){prevDep.nextDep=nextDep;link.prevDep=void 0}if(nextDep){nextDep.prevDep=prevDep;link.nextDep=void 0}}var shouldTrack=true;var trackStack=[];function pauseTracking(){trackStack.push(shouldTrack);shouldTrack=false}function resetTracking(){const last=trackStack.pop();shouldTrack=last===void 0?true:last}function cleanupEffect(e){const{cleanup}=e;e.cleanup=void 0;if(cleanup){const prevSub=activeSub;activeSub=void 0;try{cleanup()}finally{activeSub=prevSub}}}var globalVersion=0;var Link=class{constructor(sub,dep){this.sub=sub;this.dep=dep;this.version=dep.version;this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};var Dep=class{constructor(computed){this.computed=computed;this.version=0;this.activeLink=void 0;this.subs=void 0;this.map=void 0;this.key=void 0;this.sc=0;this.__v_skip=true}track(debugInfo){if(!activeSub||!shouldTrack||activeSub===this.computed)return;let link=this.activeLink;if(link===void 0||link.sub!==activeSub){link=this.activeLink=new Link(activeSub,this);if(!activeSub.deps)activeSub.deps=activeSub.depsTail=link;else{link.prevDep=activeSub.depsTail;activeSub.depsTail.nextDep=link;activeSub.depsTail=link}addSub(link)}else if(link.version===-1){link.version=this.version;if(link.nextDep){const next=link.nextDep;next.prevDep=link.prevDep;if(link.prevDep)link.prevDep.nextDep=next;link.prevDep=activeSub.depsTail;link.nextDep=void 0;activeSub.depsTail.nextDep=link;activeSub.depsTail=link;if(activeSub.deps===link)activeSub.deps=next}}return link}trigger(debugInfo){this.version++;globalVersion++;this.notify(debugInfo)}notify(debugInfo){startBatch();try{for(let link=this.subs;link;link=link.prevSub)if(link.sub.notify())link.sub.dep.notify()}finally{endBatch()}}};function addSub(link){link.dep.sc++;if(link.sub.flags&4){const computed=link.dep.computed;if(computed&&!link.dep.subs){computed.flags|=20;for(let l=computed.deps;l;l=l.nextDep)addSub(l)}const currentTail=link.dep.subs;if(currentTail!==link){link.prevSub=currentTail;if(currentTail)currentTail.nextSub=link}link.dep.subs=link}}var targetMap=new WeakMap;var ITERATE_KEY=Symbol(``);var MAP_KEY_ITERATE_KEY=Symbol(``);var ARRAY_ITERATE_KEY=Symbol(``);function track(target,type,key){if(shouldTrack&&activeSub){let depsMap=targetMap.get(target);if(!depsMap)targetMap.set(target,depsMap=new Map);let dep=depsMap.get(key);if(!dep){depsMap.set(key,dep=new Dep);dep.map=depsMap;dep.key=key}dep.track()}}function trigger(target,type,key,newValue,oldValue,oldTarget){const depsMap=targetMap.get(target);if(!depsMap){globalVersion++;return}const run=dep=>{if(dep)dep.trigger()};startBatch();if(type===`clear`)depsMap.forEach(run);else{const targetIsArray=isArray$2(target);const isArrayIndex=targetIsArray&&isIntegerKey(key);if(targetIsArray&&key===`length`){const newLength=Number(newValue);depsMap.forEach((dep,key2)=>{if(key2===`length`||key2===ARRAY_ITERATE_KEY||!isSymbol$1(key2)&&key2>=newLength)run(dep)})}else{if(key!==void 0||depsMap.has(void 0))run(depsMap.get(key));if(isArrayIndex)run(depsMap.get(ARRAY_ITERATE_KEY));switch(type){case`add`:if(!targetIsArray){run(depsMap.get(ITERATE_KEY));if(isMap(target))run(depsMap.get(MAP_KEY_ITERATE_KEY))}else if(isArrayIndex)run(depsMap.get(`length`));break;case`delete`:if(!targetIsArray){run(depsMap.get(ITERATE_KEY));if(isMap(target))run(depsMap.get(MAP_KEY_ITERATE_KEY))}break;case`set`:if(isMap(target))run(depsMap.get(ITERATE_KEY))}}}endBatch()}function getDepFromReactive(object,key){const depMap=targetMap.get(object);return depMap&&depMap.get(key)}function reactiveReadArray(array){const raw=toRaw(array);if(raw===array)return raw;track(raw,`iterate`,ARRAY_ITERATE_KEY);if(isShallow(array))return raw;if(!isReadonly(array))return raw.map(toReactive);return isReactive(array)?raw.map(item=>toReadonly(toReactive(item))):raw.map(toReadonly)}function shallowReadArray(arr){track(arr=toRaw(arr),`iterate`,ARRAY_ITERATE_KEY);return arr}function toWrapped(target,item){if(isReadonly(target))return isReactive(target)?toReadonly(toReactive(item)):toReadonly(item);return toReactive(item)}var arrayInstrumentations={__proto__:null,[Symbol.iterator](){return iterator(this,Symbol.iterator,item=>toWrapped(this,item))},concat(...args){return reactiveReadArray(this).concat(...args.map(x=>isArray$2(x)?reactiveReadArray(x):x))},entries(){return iterator(this,`entries`,value=>{value[1]=toWrapped(this,value[1]);return value})},every(fn,thisArg){return apply$1(this,`every`,fn,thisArg,void 0,arguments)},filter(fn,thisArg){return apply$1(this,`filter`,fn,thisArg,v=>v.map(item=>toWrapped(this,item)),arguments)},find(fn,thisArg){return apply$1(this,`find`,fn,thisArg,item=>toWrapped(this,item),arguments)},findIndex(fn,thisArg){return apply$1(this,`findIndex`,fn,thisArg,void 0,arguments)},findLast(fn,thisArg){return apply$1(this,`findLast`,fn,thisArg,item=>toWrapped(this,item),arguments)},findLastIndex(fn,thisArg){return apply$1(this,`findLastIndex`,fn,thisArg,void 0,arguments)},forEach(fn,thisArg){return apply$1(this,`forEach`,fn,thisArg,void 0,arguments)},includes(...args){return searchProxy(this,`includes`,args)},indexOf(...args){return searchProxy(this,`indexOf`,args)},join(separator){return reactiveReadArray(this).join(separator)},lastIndexOf(...args){return searchProxy(this,`lastIndexOf`,args)},map(fn,thisArg){return apply$1(this,`map`,fn,thisArg,void 0,arguments)},pop(){return noTracking(this,`pop`)},push(...args){return noTracking(this,`push`,args)},reduce(fn,...args){return reduce(this,`reduce`,fn,args)},reduceRight(fn,...args){return reduce(this,`reduceRight`,fn,args)},shift(){return noTracking(this,`shift`)},some(fn,thisArg){return apply$1(this,`some`,fn,thisArg,void 0,arguments)},splice(...args){return noTracking(this,`splice`,args)},toReversed(){return reactiveReadArray(this).toReversed()},toSorted(comparer){return reactiveReadArray(this).toSorted(comparer)},toSpliced(...args){return reactiveReadArray(this).toSpliced(...args)},unshift(...args){return noTracking(this,`unshift`,args)},values(){return iterator(this,`values`,item=>toWrapped(this,item))}};function iterator(self,method,wrapValue){const arr=shallowReadArray(self);const methodFn=arr[method];const iter=methodFn.call(arr);if(arr!==self&&!isShallow(self)){if(iter[Symbol.toStringTag]===`Array Iterator`){const wrapped=Object.create(Object.getPrototypeOf(iter));wrapped.next=()=>wrapResult(iter.next(),wrapValue);if(methodFn!==arrayProto[method])Object.defineProperties(wrapped,{return:{get(){const fn=iter.return;return typeof fn===`function`?fn.bind(iter):fn}},throw:{get(){const fn=iter.throw;return typeof fn===`function`?fn.bind(iter):fn}}});return wrapped}iter._next=iter.next;iter.next=()=>wrapResult(iter._next(),wrapValue)}return iter}function wrapResult(result,wrapValue){if(!result.done)result.value=wrapValue(result.value);return result}var arrayProto=Array.prototype;function apply$1(self,method,fn,thisArg,wrappedRetFn,args){const arr=shallowReadArray(self);const needsWrap=arr!==self&&!isShallow(self);const methodFn=arr[method];if(methodFn!==arrayProto[method]){const result2=methodFn.apply(self,args);return needsWrap?toReactive(result2):result2}let wrappedFn=fn;if(arr!==self){if(needsWrap)wrappedFn=function(item,index){return fn.call(this,toWrapped(self,item),index,self)};else if(fn.length>2)wrappedFn=function(item,index){return fn.call(this,item,index,self)}}const result=methodFn.call(arr,wrappedFn,thisArg);return needsWrap&&wrappedRetFn?wrappedRetFn(result):result}function reduce(self,method,fn,args){const arr=shallowReadArray(self);const needsWrap=arr!==self&&!isShallow(self);let wrappedFn=fn;let wrapInitialAccumulator=false;if(arr!==self){if(needsWrap){wrapInitialAccumulator=args.length===0;wrappedFn=function(acc,item,index){if(wrapInitialAccumulator){wrapInitialAccumulator=false;acc=toWrapped(self,acc)}return fn.call(this,acc,toWrapped(self,item),index,self)}}else if(fn.length>3)wrappedFn=function(acc,item,index){return fn.call(this,acc,item,index,self)}}const result=arr[method](wrappedFn,...args);return wrapInitialAccumulator?toWrapped(self,result):result}function searchProxy(self,method,args){const arr=toRaw(self);track(arr,`iterate`,ARRAY_ITERATE_KEY);const res=arr[method](...args);if((res===-1||res===false)&&isProxy(args[0])){args[0]=toRaw(args[0]);return arr[method](...args)}return res}function noTracking(self,method,args=[]){pauseTracking();startBatch();const res=toRaw(self)[method].apply(self,args);endBatch();resetTracking();return res}var isNonTrackableKeys=makeMap(`__proto__,__v_isRef,__isVue`);var builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).filter(key=>key!==`arguments`&&key!==`caller`).map(key=>Symbol[key]).filter(isSymbol$1));function hasOwnProperty(key){if(!isSymbol$1(key))key=String(key);const obj=toRaw(this);track(obj,`has`,key);return obj.hasOwnProperty(key)}var BaseReactiveHandler=class{constructor(_isReadonly=false,_isShallow=false){this._isReadonly=_isReadonly;this._isShallow=_isShallow}get(target,key,receiver){if(key===`__v_skip`)return target[`__v_skip`];const isReadonly2=this._isReadonly,isShallow2=this._isShallow;if(key===`__v_isReactive`)return!isReadonly2;else if(key===`__v_isReadonly`)return isReadonly2;else if(key===`__v_isShallow`)return isShallow2;else if(key===`__v_raw`){if(receiver===(isReadonly2?isShallow2?shallowReadonlyMap:readonlyMap:isShallow2?shallowReactiveMap:reactiveMap).get(target)||Object.getPrototypeOf(target)===Object.getPrototypeOf(receiver))return target;return}const targetIsArray=isArray$2(target);if(!isReadonly2){let fn;if(targetIsArray&&(fn=arrayInstrumentations[key]))return fn;if(key===`hasOwnProperty`)return hasOwnProperty}const res=Reflect.get(target,key,isRef(target)?target:receiver);if(isSymbol$1(key)?builtInSymbols.has(key):isNonTrackableKeys(key))return res;if(!isReadonly2)track(target,`get`,key);if(isShallow2)return res;if(isRef(res)){const value=targetIsArray&&isIntegerKey(key)?res:res.value;return isReadonly2&&isObject$2(value)?readonly(value):value}if(isObject$2(res))return isReadonly2?readonly(res):reactive(res);return res}};var MutableReactiveHandler=class extends BaseReactiveHandler{constructor(isShallow2=false){super(false,isShallow2)}set(target,key,value,receiver){let oldValue=target[key];const isArrayWithIntegerKey=isArray$2(target)&&isIntegerKey(key);if(!this._isShallow){const isOldValueReadonly=isReadonly(oldValue);if(!isShallow(value)&&!isReadonly(value)){oldValue=toRaw(oldValue);value=toRaw(value)}if(!isArrayWithIntegerKey&&isRef(oldValue)&&!isRef(value)){if(isOldValueReadonly)return true;else{oldValue.value=value;return true}}}const hadKey=isArrayWithIntegerKey?Number(key)<target.length:hasOwn$1(target,key);const result=Reflect.set(target,key,value,isRef(target)?target:receiver);if(target===toRaw(receiver)&&result){if(!hadKey)trigger(target,`add`,key,value);else if(hasChanged(value,oldValue))trigger(target,`set`,key,value,oldValue)}return result}deleteProperty(target,key){const hadKey=hasOwn$1(target,key);const oldValue=target[key];const result=Reflect.deleteProperty(target,key);if(result&&hadKey)trigger(target,`delete`,key,void 0,oldValue);return result}has(target,key){const result=Reflect.has(target,key);if(!isSymbol$1(key)||!builtInSymbols.has(key))track(target,`has`,key);return result}ownKeys(target){track(target,`iterate`,isArray$2(target)?`length`:ITERATE_KEY);return Reflect.ownKeys(target)}};var ReadonlyReactiveHandler=class extends BaseReactiveHandler{constructor(isShallow2=false){super(true,isShallow2)}set(target,key){return true}deleteProperty(target,key){return true}};var mutableHandlers=new MutableReactiveHandler;var readonlyHandlers=new ReadonlyReactiveHandler;var shallowReactiveHandlers=new MutableReactiveHandler(true);var shallowReadonlyHandlers=new ReadonlyReactiveHandler(true);var toShallow=value=>value;var getProto=v=>Reflect.getPrototypeOf(v);function createIterableMethod(method,isReadonly2,isShallow2){return function(...args){const target=this[`__v_raw`];const rawTarget=toRaw(target);const targetIsMap=isMap(rawTarget);const isPair=method===`entries`||method===Symbol.iterator&&targetIsMap;const isKeyOnly=method===`keys`&&targetIsMap;const innerIterator=target[method](...args);const wrap=isShallow2?toShallow:isReadonly2?toReadonly:toReactive;!isReadonly2&&track(rawTarget,`iterate`,isKeyOnly?MAP_KEY_ITERATE_KEY:ITERATE_KEY);return extend(Object.create(innerIterator),{next(){const{value,done}=innerIterator.next();return done?{value,done}:{value:isPair?[wrap(value[0]),wrap(value[1])]:wrap(value),done}}})}}function createReadonlyMethod(type){return function(...args){return type===`delete`?false:type===`clear`?void 0:this}}function createInstrumentations(readonly,shallow){const instrumentations={get(key){const target=this[`__v_raw`];const rawTarget=toRaw(target);const rawKey=toRaw(key);if(!readonly){if(hasChanged(key,rawKey))track(rawTarget,`get`,key);track(rawTarget,`get`,rawKey)}const{has}=getProto(rawTarget);const wrap=shallow?toShallow:readonly?toReadonly:toReactive;if(has.call(rawTarget,key))return wrap(target.get(key));else if(has.call(rawTarget,rawKey))return wrap(target.get(rawKey));else if(target!==rawTarget)target.get(key)},get size(){const target=this[`__v_raw`];!readonly&&track(toRaw(target),`iterate`,ITERATE_KEY);return target.size},has(key){const target=this[`__v_raw`];const rawTarget=toRaw(target);const rawKey=toRaw(key);if(!readonly){if(hasChanged(key,rawKey))track(rawTarget,`has`,key);track(rawTarget,`has`,rawKey)}return key===rawKey?target.has(key):target.has(key)||target.has(rawKey)},forEach(callback,thisArg){const observed=this;const target=observed[`__v_raw`];const rawTarget=toRaw(target);const wrap=shallow?toShallow:readonly?toReadonly:toReactive;!readonly&&track(rawTarget,`iterate`,ITERATE_KEY);return target.forEach((value,key)=>{return callback.call(thisArg,wrap(value),wrap(key),observed)})}};extend(instrumentations,readonly?{add:createReadonlyMethod(`add`),set:createReadonlyMethod(`set`),delete:createReadonlyMethod(`delete`),clear:createReadonlyMethod(`clear`)}:{add(value){const target=toRaw(this);const proto=getProto(target);const rawValue=toRaw(value);const valueToAdd=!shallow&&!isShallow(value)&&!isReadonly(value)?rawValue:value;if(!(proto.has.call(target,valueToAdd)||hasChanged(value,valueToAdd)&&proto.has.call(target,value)||hasChanged(rawValue,valueToAdd)&&proto.has.call(target,rawValue))){target.add(valueToAdd);trigger(target,`add`,valueToAdd,valueToAdd)}return this},set(key,value){if(!shallow&&!isShallow(value)&&!isReadonly(value))value=toRaw(value);const target=toRaw(this);const{has,get}=getProto(target);let hadKey=has.call(target,key);if(!hadKey){key=toRaw(key);hadKey=has.call(target,key)}const oldValue=get.call(target,key);target.set(key,value);if(!hadKey)trigger(target,`add`,key,value);else if(hasChanged(value,oldValue))trigger(target,`set`,key,value,oldValue);return this},delete(key){const target=toRaw(this);const{has,get}=getProto(target);let hadKey=has.call(target,key);if(!hadKey){key=toRaw(key);hadKey=has.call(target,key)}const oldValue=get?get.call(target,key):void 0;const result=target.delete(key);if(hadKey)trigger(target,`delete`,key,void 0,oldValue);return result},clear(){const target=toRaw(this);const hadItems=target.size!==0;const oldTarget=void 0;const result=target.clear();if(hadItems)trigger(target,`clear`,void 0,void 0,oldTarget);return result}});[`keys`,`values`,`entries`,Symbol.iterator].forEach(method=>{instrumentations[method]=createIterableMethod(method,readonly,shallow)});return instrumentations}function createInstrumentationGetter(isReadonly2,shallow){const instrumentations=createInstrumentations(isReadonly2,shallow);return(target,key,receiver)=>{if(key===`__v_isReactive`)return!isReadonly2;else if(key===`__v_isReadonly`)return isReadonly2;else if(key===`__v_isShallow`)return shallow;else if(key===`__v_raw`)return target;return Reflect.get(hasOwn$1(instrumentations,key)&&key in target?instrumentations:target,key,receiver)}}var mutableCollectionHandlers={get:createInstrumentationGetter(false,false)};var shallowCollectionHandlers={get:createInstrumentationGetter(false,true)};var readonlyCollectionHandlers={get:createInstrumentationGetter(true,false)};var shallowReadonlyCollectionHandlers={get:createInstrumentationGetter(true,true)};var reactiveMap=new WeakMap;var shallowReactiveMap=new WeakMap;var readonlyMap=new WeakMap;var shallowReadonlyMap=new WeakMap;function targetTypeMap(rawType){switch(rawType){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function reactive(target){if(isReadonly(target))return target;return createReactiveObject(target,false,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function shallowReactive(target){return createReactiveObject(target,false,shallowReactiveHandlers,shallowCollectionHandlers,shallowReactiveMap)}function readonly(target){return createReactiveObject(target,true,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function shallowReadonly(target){return createReactiveObject(target,true,shallowReadonlyHandlers,shallowReadonlyCollectionHandlers,shallowReadonlyMap)}function createReactiveObject(target,isReadonly2,baseHandlers,collectionHandlers,proxyMap){if(!isObject$2(target))return target;if(target[`__v_raw`]&&!(isReadonly2&&target[`__v_isReactive`]))return target;if(target[`__v_skip`]||!Object.isExtensible(target))return target;const existingProxy=proxyMap.get(target);if(existingProxy)return existingProxy;const targetType=targetTypeMap(toRawType(target));if(targetType===0)return target;const proxy=new Proxy(target,targetType===2?collectionHandlers:baseHandlers);proxyMap.set(target,proxy);return proxy}function isReactive(value){if(isReadonly(value))return isReactive(value[`__v_raw`]);return!!(value&&value[`__v_isReactive`])}function isReadonly(value){return!!(value&&value[`__v_isReadonly`])}function isShallow(value){return!!(value&&value[`__v_isShallow`])}function isProxy(value){return value?!!value[`__v_raw`]:false}function toRaw(observed){const raw=observed&&observed[`__v_raw`];return raw?toRaw(raw):observed}function markRaw(value){if(!hasOwn$1(value,`__v_skip`)&&Object.isExtensible(value))def(value,`__v_skip`,true);return value}var toReactive=value=>isObject$2(value)?reactive(value):value;var toReadonly=value=>isObject$2(value)?readonly(value):value;function isRef(r){return r?r[`__v_isRef`]===true:false}function ref(value){return createRef(value,false)}function shallowRef(value){return createRef(value,true)}function createRef(rawValue,shallow){if(isRef(rawValue))return rawValue;return new RefImpl(rawValue,shallow)}var RefImpl=class{constructor(value,isShallow2){this.dep=new Dep;this[`__v_isRef`]=true;this[`__v_isShallow`]=false;this._rawValue=isShallow2?value:toRaw(value);this._value=isShallow2?value:toReactive(value);this[`__v_isShallow`]=isShallow2}get value(){this.dep.track();return this._value}set value(newValue){const oldValue=this._rawValue;const useDirectValue=this[`__v_isShallow`]||isShallow(newValue)||isReadonly(newValue);newValue=useDirectValue?newValue:toRaw(newValue);if(hasChanged(newValue,oldValue)){this._rawValue=newValue;this._value=useDirectValue?newValue:toReactive(newValue);this.dep.trigger()}}};function unref(ref2){return isRef(ref2)?ref2.value:ref2}function toValue(source){return isFunction$2(source)?source():unref(source)}var shallowUnwrapHandlers={get:(target,key,receiver)=>key===`__v_raw`?target:unref(Reflect.get(target,key,receiver)),set:(target,key,value,receiver)=>{const oldValue=target[key];if(isRef(oldValue)&&!isRef(value)){oldValue.value=value;return true}else return Reflect.set(target,key,value,receiver)}};function proxyRefs(objectWithRefs){return isReactive(objectWithRefs)?objectWithRefs:new Proxy(objectWithRefs,shallowUnwrapHandlers)}var CustomRefImpl=class{constructor(factory){this[`__v_isRef`]=true;this._value=void 0;const dep=this.dep=new Dep;const{get,set}=factory(dep.track.bind(dep),dep.trigger.bind(dep));this._get=get;this._set=set}get value(){return this._value=this._get()}set value(newVal){this._set(newVal)}};function customRef(factory){return new CustomRefImpl(factory)}function toRefs(object){const ret=isArray$2(object)?new Array(object.length):{};for(const key in object)ret[key]=propertyToRef(object,key);return ret}var ObjectRefImpl=class{constructor(_object,key,_defaultValue){this._object=_object;this._defaultValue=_defaultValue;this[`__v_isRef`]=true;this._value=void 0;this._key=isSymbol$1(key)?key:String(key);this._raw=toRaw(_object);let shallow=true;let obj=_object;if(!isArray$2(_object)||isSymbol$1(this._key)||!isIntegerKey(this._key))do shallow=!isProxy(obj)||isShallow(obj);while(shallow&&(obj=obj[`__v_raw`]));this._shallow=shallow}get value(){let val=this._object[this._key];if(this._shallow)val=unref(val);return this._value=val===void 0?this._defaultValue:val}set value(newVal){if(this._shallow&&isRef(this._raw[this._key])){const nestedRef=this._object[this._key];if(isRef(nestedRef)){nestedRef.value=newVal;return}}this._object[this._key]=newVal}get dep(){return getDepFromReactive(this._raw,this._key)}};var GetterRefImpl=class{constructor(_getter){this._getter=_getter;this[`__v_isRef`]=true;this[`__v_isReadonly`]=true;this._value=void 0}get value(){return this._value=this._getter()}};function toRef(source,key,defaultValue){if(isRef(source))return source;else if(isFunction$2(source))return new GetterRefImpl(source);else if(isObject$2(source)&&arguments.length>1)return propertyToRef(source,key,defaultValue);else return ref(source)}function propertyToRef(source,key,defaultValue){return new ObjectRefImpl(source,key,defaultValue)}var ComputedRefImpl=class{constructor(fn,setter,isSSR){this.fn=fn;this.setter=setter;this._value=void 0;this.dep=new Dep(this);this.__v_isRef=true;this.deps=void 0;this.depsTail=void 0;this.flags=16;this.globalVersion=globalVersion-1;this.next=void 0;this.effect=this;this[`__v_isReadonly`]=!setter;this.isSSR=isSSR}notify(){this.flags|=16;if(!(this.flags&8)&&activeSub!==this){batch(this,true);return true}}get value(){const link=this.dep.track();refreshComputed(this);if(link)link.version=this.dep.version;return this._value}set value(newValue){if(this.setter)this.setter(newValue)}};function computed$1(getterOrOptions,debugOptions,isSSR=false){let getter;let setter;if(isFunction$2(getterOrOptions))getter=getterOrOptions;else{getter=getterOrOptions.get;setter=getterOrOptions.set}return new ComputedRefImpl(getter,setter,isSSR)}var INITIAL_WATCHER_VALUE={};var cleanupMap=new WeakMap;var activeWatcher=void 0;function onWatcherCleanup(cleanupFn,failSilently=false,owner=activeWatcher){if(owner){let cleanups=cleanupMap.get(owner);if(!cleanups)cleanupMap.set(owner,cleanups=[]);cleanups.push(cleanupFn)}}function watch$1(source,cb,options=EMPTY_OBJ){const{immediate,deep,once,scheduler,augmentJob,call}=options;const reactiveGetter=source2=>{if(deep)return source2;if(isShallow(source2)||deep===false||deep===0)return traverse(source2,1);return traverse(source2)};let effect;let getter;let cleanup;let boundCleanup;let forceTrigger=false;let isMultiSource=false;if(isRef(source)){getter=()=>source.value;forceTrigger=isShallow(source)}else if(isReactive(source)){getter=()=>reactiveGetter(source);forceTrigger=true}else if(isArray$2(source)){isMultiSource=true;forceTrigger=source.some(s=>isReactive(s)||isShallow(s));getter=()=>source.map(s=>{if(isRef(s))return s.value;else if(isReactive(s))return reactiveGetter(s);else if(isFunction$2(s))return call?call(s,2):s()})}else if(isFunction$2(source)){if(cb)getter=call?()=>call(source,2):source;else getter=()=>{if(cleanup){pauseTracking();try{cleanup()}finally{resetTracking()}}const currentEffect=activeWatcher;activeWatcher=effect;try{return call?call(source,3,[boundCleanup]):source(boundCleanup)}finally{activeWatcher=currentEffect}}}else getter=NOOP;if(cb&&deep){const baseGetter=getter;const depth=deep===true?Infinity:deep;getter=()=>traverse(baseGetter(),depth)}const scope=getCurrentScope();const watchHandle=()=>{effect.stop();if(scope&&scope.active)remove(scope.effects,effect)};if(once&&cb){const _cb=cb;cb=(...args)=>{try{return _cb(...args)}finally{watchHandle()}}}let oldValue=isMultiSource?new Array(source.length).fill(INITIAL_WATCHER_VALUE):INITIAL_WATCHER_VALUE;const job=immediateFirstRun=>{if(!(effect.flags&1)||!effect.dirty&&!immediateFirstRun)return;if(cb){const newValue=effect.run();if(immediateFirstRun||deep||forceTrigger||(isMultiSource?newValue.some((v,i)=>hasChanged(v,oldValue[i])):hasChanged(newValue,oldValue))){const currentWatcher=activeWatcher;pauseTracking();try{if(cleanup)cleanup();activeWatcher=effect;const args=[newValue,oldValue===INITIAL_WATCHER_VALUE?void 0:isMultiSource&&oldValue[0]===INITIAL_WATCHER_VALUE?[]:oldValue,boundCleanup];oldValue=newValue;call?call(cb,3,args):cb(...args)}finally{activeWatcher=currentWatcher;resetTracking()}}}else effect.run()};if(augmentJob)augmentJob(job);effect=new ReactiveEffect(getter);effect.scheduler=scheduler?()=>scheduler(job,false):job;boundCleanup=fn=>onWatcherCleanup(fn,false,effect);cleanup=effect.onStop=()=>{const cleanups=cleanupMap.get(effect);if(cleanups){if(call)call(cleanups,4);else for(const cleanup2 of cleanups)cleanup2();cleanupMap.delete(effect)}};if(cb){if(immediate)job(true);else oldValue=effect.run()}else if(scheduler)scheduler(job.bind(null,true),true);else effect.run();watchHandle.pause=effect.pause.bind(effect);watchHandle.resume=effect.resume.bind(effect);watchHandle.stop=watchHandle;return watchHandle}function traverse(value,depth=Infinity,seen){if(depth<=0||!isObject$2(value)||value[`__v_skip`])return value;seen=seen||new Map;if((seen.get(value)||0)>=depth)return value;seen.set(value,depth);depth--;if(isRef(value))traverse(value.value,depth,seen);else if(isArray$2(value))for(let i=0;i<value.length;i++)traverse(value[i],depth,seen);else if(isSet(value)||isMap(value))value.forEach(v=>{traverse(v,depth,seen)});else if(isPlainObject$6(value)){for(const key in value)traverse(value[key],depth,seen);for(const key of Object.getOwnPropertySymbols(value))if(Object.prototype.propertyIsEnumerable.call(value,key))traverse(value[key],depth,seen)}return value}function callWithErrorHandling(fn,instance,type,args){try{return args?fn(...args):fn()}catch(err){handleError(err,instance,type)}}function callWithAsyncErrorHandling(fn,instance,type,args){if(isFunction$2(fn)){const res=callWithErrorHandling(fn,instance,type,args);if(res&&isPromise(res))res.catch(err=>{handleError(err,instance,type)});return res}if(isArray$2(fn)){const values=[];for(let i=0;i<fn.length;i++)values.push(callWithAsyncErrorHandling(fn[i],instance,type,args));return values}}function handleError(err,instance,type,throwInDev=true){const contextVNode=instance?instance.vnode:null;const{errorHandler,throwUnhandledErrorInProduction}=instance&&instance.appContext.config||EMPTY_OBJ;if(instance){let cur=instance.parent;const exposedInstance=instance.proxy;const errorInfo=`https://vuejs.org/error-reference/#runtime-${type}`;while(cur){const errorCapturedHooks=cur.ec;if(errorCapturedHooks){for(let i=0;i<errorCapturedHooks.length;i++)if(errorCapturedHooks[i](err,exposedInstance,errorInfo)===false)return}cur=cur.parent}if(errorHandler){pauseTracking();callWithErrorHandling(errorHandler,null,10,[err,exposedInstance,errorInfo]);resetTracking();return}}logError(err,type,contextVNode,throwInDev,throwUnhandledErrorInProduction)}function logError(err,type,contextVNode,throwInDev=true,throwInProd=false){if(throwInProd)throw err;else console.error(err)}var queue=[];var flushIndex=-1;var pendingPostFlushCbs=[];var activePostFlushCbs=null;var postFlushIndex=0;var resolvedPromise=Promise.resolve();var currentFlushPromise=null;function nextTick$1(fn){const p=currentFlushPromise||resolvedPromise;return fn?p.then(this?fn.bind(this):fn):p}function findInsertionIndex$1(id){let start=flushIndex+1;let end=queue.length;while(start<end){const middle=start+end>>>1;const middleJob=queue[middle];const middleJobId=getId(middleJob);if(middleJobId<id||middleJobId===id&&middleJob.flags&2)start=middle+1;else end=middle}return start}function queueJob(job){if(!(job.flags&1)){const jobId=getId(job);const lastJob=queue[queue.length-1];if(!lastJob||!(job.flags&2)&&jobId>=getId(lastJob))queue.push(job);else queue.splice(findInsertionIndex$1(jobId),0,job);job.flags|=1;queueFlush()}}function queueFlush(){if(!currentFlushPromise)currentFlushPromise=resolvedPromise.then(flushJobs)}function queuePostFlushCb(cb){if(!isArray$2(cb)){if(activePostFlushCbs&&cb.id===-1)activePostFlushCbs.splice(postFlushIndex+1,0,cb);else if(!(cb.flags&1)){pendingPostFlushCbs.push(cb);cb.flags|=1}}else for(let i=0;i<cb.length;i++)pendingPostFlushCbs.push(cb[i]);queueFlush()}function flushPreFlushCbs(instance,minUid,seen,i=flushIndex+1){for(;i<queue.length;i++){const cb=queue[i];if(cb&&cb.flags&2){if(instance&&cb.id!==instance.uid||minUid!==void 0&&!(cb.id>=minUid))continue;queue.splice(i,1);i=instance?i-1:flushIndex;if(cb.flags&4)cb.flags&=-2;cb();if(!(cb.flags&4))cb.flags&=-2}}}function flushPostFlushCbs(seen,skip,minUid=0){if(pendingPostFlushCbs.length){let cbs=pendingPostFlushCbs;let kept=0;if(skip){cbs=[];for(let i=0;i<pendingPostFlushCbs.length;i++){const cb=pendingPostFlushCbs[i];if(cb.i!==void 0?!cb.i||cb.i.uid<minUid:skip.has(cb))pendingPostFlushCbs[kept++]=cb;else cbs.push(cb)}}const deduped=[...new Set(cbs)].sort((a,b)=>getId(a)-getId(b));pendingPostFlushCbs.length=kept;if(activePostFlushCbs){for(let i=0;i<deduped.length;i++)activePostFlushCbs.push(deduped[i]);return}activePostFlushCbs=deduped;for(postFlushIndex=0;postFlushIndex<activePostFlushCbs.length;postFlushIndex++){const cb=activePostFlushCbs[postFlushIndex];if(cb.flags&4)cb.flags&=-2;if(!(cb.flags&8))cb();cb.flags&=-2}activePostFlushCbs=null;postFlushIndex=0}}var isFlushing=false;function flushOnAppMount(fn,minUid){if(isFlushing){fn();return}const queued=minUid===void 0?void 0:new Set(pendingPostFlushCbs);fn();isFlushing=true;try{flushPreFlushCbs(void 0,minUid);flushPostFlushCbs(void 0,queued,minUid)}finally{isFlushing=false}}var getId=job=>job.id==null?job.flags&2?-1:Infinity:job.id;function flushJobs(seen){try{for(flushIndex=0;flushIndex<queue.length;flushIndex++){const job=queue[flushIndex];if(job&&!(job.flags&8)){if(job.flags&4)job.flags&=-2;callWithErrorHandling(job,job.i,job.i?15:14);if(!(job.flags&4))job.flags&=-2}}}finally{for(;flushIndex<queue.length;flushIndex++){const job=queue[flushIndex];if(job)job.flags&=-2}flushIndex=-1;queue.length=0;flushPostFlushCbs(seen);currentFlushPromise=null;if(queue.length||pendingPostFlushCbs.length)flushJobs(seen)}}var currentRenderingInstance=null;var currentScopeId=null;function setCurrentRenderingInstance(instance){const prev=currentRenderingInstance;currentRenderingInstance=instance;currentScopeId=instance&&instance.type.__scopeId||null;return prev}function withCtx(fn,ctx=currentRenderingInstance,isNonScopedSlot){if(!ctx)return fn;if(fn._n)return fn;const renderFnWithContext=(...args)=>{if(renderFnWithContext._d)setBlockTracking(-1);const prevInstance=setCurrentRenderingInstance(ctx);const prevStackSize=blockStack.length;let res;try{res=fn(...args)}finally{for(let i=blockStack.length;i>prevStackSize;i--)closeBlock();setCurrentRenderingInstance(prevInstance);if(renderFnWithContext._d)setBlockTracking(1)}return res};renderFnWithContext._n=true;renderFnWithContext._c=true;renderFnWithContext._d=true;return renderFnWithContext}function withDirectives(vnode,directives){if(currentRenderingInstance===null)return vnode;const instance=getComponentPublicInstance(currentRenderingInstance);const bindings=vnode.dirs||(vnode.dirs=[]);for(let i=0;i<directives.length;i++){let[dir,value,arg,modifiers=EMPTY_OBJ]=directives[i];if(dir){if(isFunction$2(dir))dir={mounted:dir,updated:dir};if(dir.deep)traverse(value);bindings.push({dir,instance,value,oldValue:void 0,arg,modifiers})}}return vnode}function invokeDirectiveHook(vnode,prevVNode,instance,name){const bindings=vnode.dirs;const oldBindings=prevVNode&&prevVNode.dirs;for(let i=0;i<bindings.length;i++){const binding=bindings[i];if(oldBindings)binding.oldValue=oldBindings[i].value;let hook=binding.dir[name];if(hook){pauseTracking();callWithAsyncErrorHandling(hook,instance,8,[vnode.el,binding,vnode,prevVNode]);resetTracking()}}}function provide(key,value){if(currentInstance){let provides=currentInstance.provides;const parentProvides=currentInstance.parent&¤tInstance.parent.provides;if(parentProvides===provides)provides=currentInstance.provides=Object.create(parentProvides);provides[key]=value}}function inject$1(key,defaultValue,treatDefaultAsFactory=false){const instance=getCurrentInstance$1();if(instance||currentApp){let provides=currentApp?currentApp._context.provides:instance?instance.parent==null||instance.ce?instance.vnode.appContext&&instance.vnode.appContext.provides:instance.parent.provides:void 0;if(provides&&key in provides)return provides[key];else if(arguments.length>1)return treatDefaultAsFactory&&isFunction$2(defaultValue)?defaultValue.call(instance&&instance.proxy):defaultValue}}function hasInjectionContext(){return!!(getCurrentInstance$1()||currentApp)}var ssrContextKey=Symbol.for(`v-scx`);var useSSRContext=()=>{{const ctx=inject$1(ssrContextKey);if(!ctx){}return ctx}};function watchEffect(effect,options){return doWatch(effect,null,options)}function watchSyncEffect(effect,options){return doWatch(effect,null,{flush:`sync`})}function watch(source,cb,options){return doWatch(source,cb,options)}function doWatch(source,cb,options=EMPTY_OBJ){const{immediate,deep,flush,once}=options;const baseWatchOptions=extend({},options);const runsImmediately=cb&&immediate||!cb&&flush!==`post`;let ssrCleanup;if(isInSSRComponentSetup){if(flush===`sync`){const ctx=useSSRContext();ssrCleanup=ctx.__watcherHandles||(ctx.__watcherHandles=[])}else if(!runsImmediately){const watchStopHandle=()=>{};watchStopHandle.stop=NOOP;watchStopHandle.resume=NOOP;watchStopHandle.pause=NOOP;return watchStopHandle}}const instance=currentInstance;baseWatchOptions.call=(fn,type,args)=>callWithAsyncErrorHandling(fn,instance,type,args);let isPre=false;if(flush===`post`)baseWatchOptions.scheduler=job=>{job.i=instance;queuePostRenderEffect(job,instance&&instance.suspense)};else if(flush!==`sync`){isPre=true;baseWatchOptions.scheduler=(job,isFirstRun)=>{if(isFirstRun)job();else queueJob(job)}}baseWatchOptions.augmentJob=job=>{if(cb)job.flags|=4;if(isPre){job.flags|=2;if(instance){job.id=instance.uid;job.i=instance}}};const watchHandle=watch$1(source,cb,baseWatchOptions);if(isInSSRComponentSetup){if(ssrCleanup)ssrCleanup.push(watchHandle);else if(runsImmediately)watchHandle()}return watchHandle}function instanceWatch(source,value,options){const publicThis=this.proxy;const getter=isString$1(source)?source.includes(`.`)?createPathGetter(publicThis,source):()=>publicThis[source]:source.bind(publicThis,publicThis);let cb;if(isFunction$2(value))cb=value;else{cb=value.handler;options=value}const reset=setCurrentInstance(this);const res=doWatch(getter,cb.bind(publicThis),options);reset();return res}function createPathGetter(ctx,path){const segments=path.split(`.`);return()=>{let cur=ctx;for(let i=0;i<segments.length&&cur;i++)cur=cur[segments[i]];return cur}}var pendingMounts=new WeakMap;var TeleportEndKey=Symbol(`_vte`);var isTeleport=type=>type.__isTeleport;var isTeleportDisabled=props=>props&&(props.disabled||props.disabled===``);var isTeleportDeferred=props=>props&&(props.defer||props.defer===``);var isTargetSVG=target=>typeof SVGElement!==`undefined`&&target instanceof SVGElement;var isTargetMathML=target=>typeof MathMLElement===`function`&&target instanceof MathMLElement;var resolveTarget=(props,select)=>{const targetSelector=props&&props.to;if(isString$1(targetSelector)){if(!select)return null;else return select(targetSelector)}else return targetSelector};var TeleportImpl={name:`Teleport`,__isTeleport:true,process(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized,internals){const{mc:mountChildren,pc:patchChildren,pbc:patchBlockChildren,o:{insert,querySelector,createText,createComment,parentNode}}=internals;const disabled=isTeleportDisabled(n2.props);let{dynamicChildren}=n2;const mount=(vnode,container2,anchor2)=>{if(vnode.shapeFlag&16)mountChildren(vnode.children,container2,anchor2,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)};const mountToTarget=(vnode=n2)=>{const disabled2=isTeleportDisabled(vnode.props);const target=vnode.target=resolveTarget(vnode.props,querySelector);const targetAnchor=prepareAnchor(target,vnode,createText,insert);if(target){if(namespace!==`svg`&&isTargetSVG(target))namespace=`svg`;else if(namespace!==`mathml`&&isTargetMathML(target))namespace=`mathml`;if(parentComponent&&parentComponent.isCE)(parentComponent.ce._teleportTargets||(parentComponent.ce._teleportTargets=new Set)).add(target);if(!disabled2){mount(vnode,target,targetAnchor);updateCssVars(vnode,false)}}};const queuePendingMount=vnode=>{const mountJob=()=>{if(pendingMounts.get(vnode)!==mountJob)return;pendingMounts.delete(vnode);if(isTeleportDisabled(vnode.props)){const mountContainer=parentNode(vnode.el)||container;mount(vnode,mountContainer,vnode.anchor);updateCssVars(vnode,true)}mountToTarget(vnode)};pendingMounts.set(vnode,mountJob);queuePostRenderEffect(mountJob,parentSuspense)};if(n1==null){const placeholder=n2.el=createText(``);const mainAnchor=n2.anchor=createText(``);insert(placeholder,container,anchor);insert(mainAnchor,container,anchor);if(isTeleportDeferred(n2.props)||parentSuspense&&parentSuspense.pendingBranch){queuePendingMount(n2);return}if(disabled){mount(n2,container,mainAnchor);updateCssVars(n2,true)}mountToTarget()}else{n2.el=n1.el;const mainAnchor=n2.anchor=n1.anchor;const pendingMount=pendingMounts.get(n1);if(pendingMount){pendingMount.flags|=8;pendingMounts.delete(n1);queuePendingMount(n2);return}n2.targetStart=n1.targetStart;const target=n2.target=n1.target;const targetAnchor=n2.targetAnchor=n1.targetAnchor;const wasDisabled=isTeleportDisabled(n1.props);const currentContainer=wasDisabled?container:target;const currentAnchor=wasDisabled?mainAnchor:targetAnchor;if(namespace===`svg`||isTargetSVG(target))namespace=`svg`;else if(namespace===`mathml`||isTargetMathML(target))namespace=`mathml`;if(dynamicChildren){patchBlockChildren(n1.dynamicChildren,dynamicChildren,currentContainer,parentComponent,parentSuspense,namespace,slotScopeIds);traverseStaticChildren(n1,n2,true)}else if(!optimized)patchChildren(n1,n2,currentContainer,currentAnchor,parentComponent,parentSuspense,namespace,slotScopeIds,false);if(disabled){if(!wasDisabled)moveTeleport(n2,container,mainAnchor,internals,1);else if(n2.props&&n1.props&&n2.props.to!==n1.props.to)n2.props.to=n1.props.to}else if((n2.props&&n2.props.to)!==(n1.props&&n1.props.to)){const nextTarget=resolveTarget(n2.props,querySelector);if(nextTarget){n2.target=nextTarget;moveTeleport(n2,nextTarget,null,internals,0)}}else if(wasDisabled)moveTeleport(n2,target,targetAnchor,internals,1);updateCssVars(n2,disabled)}},remove(vnode,parentComponent,parentSuspense,{um:unmount,o:{remove:hostRemove}},doRemove){const{shapeFlag,children,anchor,targetStart,targetAnchor,target,props}=vnode;const disabled=isTeleportDisabled(props);const shouldRemove=doRemove||!disabled;const pendingMount=pendingMounts.get(vnode);if(pendingMount){pendingMount.flags|=8;pendingMounts.delete(vnode)}if(target){hostRemove(targetStart);hostRemove(targetAnchor)}doRemove&&hostRemove(anchor);if(!pendingMount&&(disabled||target)&&shapeFlag&16)for(let i=0;i<children.length;i++){const child=children[i];unmount(child,parentComponent,parentSuspense,shouldRemove,!!child.dynamicChildren)}},move:moveTeleport,hydrate:hydrateTeleport};function moveTeleport(vnode,container,parentAnchor,{o:{insert},m:move},moveType=2){if(moveType===0){if(vnode.targetStart)insert(vnode.targetStart,container,parentAnchor);insert(vnode.targetAnchor,container,parentAnchor);parentAnchor=vnode.targetAnchor}const{el,anchor,shapeFlag,children,props}=vnode;const isReorder=moveType===2;if(isReorder)insert(el,container,parentAnchor);if(!pendingMounts.has(vnode)&&(!isReorder||isTeleportDisabled(props))){if(shapeFlag&16)for(let i=0;i<children.length;i++)move(children[i],container,parentAnchor,2)}if(isReorder)insert(anchor,container,parentAnchor)}function hydrateTeleport(node,vnode,parentComponent,parentSuspense,slotScopeIds,optimized,{o:{nextSibling,parentNode,querySelector,insert,createText}},hydrateChildren){function hydrateAnchor(target2,targetNode){let targetAnchor=targetNode;while(targetAnchor){if(targetAnchor&&targetAnchor.nodeType===8){if(targetAnchor.data===`teleport start anchor`)vnode.targetStart=targetAnchor;else if(targetAnchor.data===`teleport anchor`){vnode.targetAnchor=targetAnchor;target2._lpa=vnode.targetAnchor&&nextSibling(vnode.targetAnchor);break}}targetAnchor=nextSibling(targetAnchor)}}function hydrateDisabledTeleport(node2,vnode2){vnode2.anchor=hydrateChildren(nextSibling(node2),vnode2,parentNode(node2),parentComponent,parentSuspense,slotScopeIds,optimized)}const target=vnode.target=resolveTarget(vnode.props,querySelector);const disabled=isTeleportDisabled(vnode.props);if(target){const targetNode=target._lpa||target.firstChild;if(vnode.shapeFlag&16){if(disabled){hydrateDisabledTeleport(node,vnode);hydrateAnchor(target,targetNode);if(!vnode.targetAnchor)prepareAnchor(target,vnode,createText,insert,parentNode(node)===target?node:null)}else{vnode.anchor=nextSibling(node);hydrateAnchor(target,targetNode);if(!vnode.targetAnchor)prepareAnchor(target,vnode,createText,insert);hydrateChildren(targetNode&&nextSibling(targetNode),vnode,target,parentComponent,parentSuspense,slotScopeIds,optimized)}}updateCssVars(vnode,disabled)}else if(disabled){if(vnode.shapeFlag&16){hydrateDisabledTeleport(node,vnode);vnode.targetStart=node;vnode.targetAnchor=nextSibling(node)}}return vnode.anchor&&nextSibling(vnode.anchor)}var Teleport=TeleportImpl;function updateCssVars(vnode,isDisabled){const ctx=vnode.ctx;if(ctx&&ctx.ut){let node,anchor;if(isDisabled){node=vnode.el;anchor=vnode.anchor}else{node=vnode.targetStart;anchor=vnode.targetAnchor}while(node&&node!==anchor){if(node.nodeType===1)node.setAttribute(`data-v-owner`,ctx.uid);node=node.nextSibling}ctx.ut()}}function prepareAnchor(target,vnode,createText,insert,anchor=null){const targetStart=vnode.targetStart=createText(``);const targetAnchor=vnode.targetAnchor=createText(``);targetStart[TeleportEndKey]=targetAnchor;if(target){insert(targetStart,target,anchor);insert(targetAnchor,target,anchor)}return targetAnchor}var leaveCbKey=Symbol(`_leaveCb`);var enterCbKey$1=Symbol(`_enterCb`);function useTransitionState(){const state={isMounted:false,isLeaving:false,isUnmounting:false,leavingVNodes:new Map};onMounted(()=>{state.isMounted=true});onBeforeUnmount(()=>{state.isUnmounting=true});return state}var TransitionHookValidator=[Function,Array];var BaseTransitionPropsValidators={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator};var BaseTransitionImpl={name:`BaseTransition`,props:BaseTransitionPropsValidators,setup(props,{slots}){const instance=getCurrentInstance$1();const state=useTransitionState();return()=>{const children=slots.default&&getTransitionRawChildren(slots.default(),true);const child=children&&children.length?findNonCommentChild(children):instance.subTree?createCommentVNode():void 0;if(!child)return;const rawProps=toRaw(props);const{mode}=rawProps;if(state.isLeaving)return emptyPlaceholder(child);const innerChild=getInnerChild$1(child);if(!innerChild)return emptyPlaceholder(child);let enterHooks=resolveTransitionHooks(innerChild,rawProps,state,instance,hooks=>enterHooks=hooks);if(innerChild.type!==Comment)setTransitionHooks(innerChild,enterHooks);let oldInnerChild=instance.subTree&&getInnerChild$1(instance.subTree);if(oldInnerChild&&oldInnerChild.type!==Comment&&!isSameVNodeType(oldInnerChild,innerChild)&&getTransitionRoot(instance.subTree)){let leavingHooks=resolveTransitionHooks(oldInnerChild,rawProps,state,instance);setTransitionHooks(oldInnerChild,leavingHooks);if(mode===`out-in`&&innerChild.type!==Comment){state.isLeaving=true;leavingHooks.afterLeave=()=>{state.isLeaving=false;if(!(instance.job.flags&8))instance.update();delete leavingHooks.afterLeave;oldInnerChild=void 0};return emptyPlaceholder(child)}else if(mode===`in-out`&&innerChild.type!==Comment)leavingHooks.delayLeave=(el,earlyRemove,delayedLeave)=>{const leavingVNodesCache=getLeavingNodesForType(state,oldInnerChild);leavingVNodesCache[String(oldInnerChild.key)]=oldInnerChild;el[leaveCbKey]=()=>{earlyRemove();el[leaveCbKey]=void 0;delete enterHooks.delayedLeave;oldInnerChild=void 0};enterHooks.delayedLeave=()=>{delayedLeave();delete enterHooks.delayedLeave;oldInnerChild=void 0}};else oldInnerChild=void 0}else if(oldInnerChild)oldInnerChild=void 0;return child}}};function findNonCommentChild(children){let child=children[0];if(children.length>1){for(const c of children)if(c.type!==Comment){child=c;break}}return child}var BaseTransition=BaseTransitionImpl;function getLeavingNodesForType(state,vnode){const{leavingVNodes}=state;let leavingVNodesCache=leavingVNodes.get(vnode.type);if(!leavingVNodesCache){leavingVNodesCache=Object.create(null);leavingVNodes.set(vnode.type,leavingVNodesCache)}return leavingVNodesCache}function resolveTransitionHooks(vnode,props,state,instance,postClone){const{appear,mode,persisted=false,onBeforeEnter,onEnter,onAfterEnter,onEnterCancelled,onBeforeLeave,onLeave,onAfterLeave,onLeaveCancelled,onBeforeAppear,onAppear,onAfterAppear,onAppearCancelled}=props;const key=String(vnode.key);const leavingVNodesCache=getLeavingNodesForType(state,vnode);const callHook=(hook,args)=>{hook&&callWithAsyncErrorHandling(hook,instance,9,args)};const callAsyncHook=(hook,args)=>{const done=args[1];callHook(hook,args);if(isArray$2(hook)){if(hook.every(hook2=>hook2.length<=1))done()}else if(hook.length<=1)done()};const hooks={mode,persisted,beforeEnter(el){let hook=onBeforeEnter;if(!state.isMounted){if(appear)hook=onBeforeAppear||onBeforeEnter;else return}if(el[leaveCbKey])el[leaveCbKey](true);const leavingVNode=leavingVNodesCache[key];if(leavingVNode&&isSameVNodeType(vnode,leavingVNode)){let leavingCb=leavingVNode.el[leaveCbKey];if(!leavingCb){const leavingRoot=getTransitionRoot(leavingVNode);leavingCb=leavingRoot&&leavingRoot.el[leaveCbKey]}if(leavingCb)leavingCb()}callHook(hook,[el])},enter(el){if(leavingVNodesCache[key]===vnode)return;let hook=onEnter;let afterHook=onAfterEnter;let cancelHook=onEnterCancelled;if(!state.isMounted){if(appear){hook=onAppear||onEnter;afterHook=onAfterAppear||onAfterEnter;cancelHook=onAppearCancelled||onEnterCancelled}else return}let called=false;el[enterCbKey$1]=cancelled=>{if(called)return;called=true;if(cancelled)callHook(cancelHook,[el]);else callHook(afterHook,[el]);if(hooks.delayedLeave)hooks.delayedLeave();el[enterCbKey$1]=void 0};const done=el[enterCbKey$1].bind(null,false);if(hook)callAsyncHook(hook,[el,done]);else done()},leave(el,remove){const key2=String(vnode.key);if(el[enterCbKey$1])el[enterCbKey$1](true);if(state.isUnmounting)return remove();callHook(onBeforeLeave,[el]);let called=false;el[leaveCbKey]=cancelled=>{if(called)return;called=true;remove();if(cancelled)callHook(onLeaveCancelled,[el]);else callHook(onAfterLeave,[el]);el[leaveCbKey]=void 0;if(leavingVNodesCache[key2]===vnode)delete leavingVNodesCache[key2]};const done=el[leaveCbKey].bind(null,false);leavingVNodesCache[key2]=vnode;if(onLeave)callAsyncHook(onLeave,[el,done]);else done()},clone(vnode2){const hooks2=resolveTransitionHooks(vnode2,props,state,instance,postClone);if(postClone)postClone(hooks2);return hooks2}};return hooks}function emptyPlaceholder(vnode){if(isKeepAlive(vnode)){vnode=cloneVNode(vnode);vnode.children=null;return vnode}}function getInnerChild$1(vnode){if(!isKeepAlive(vnode)){if(isTeleport(vnode.type)&&vnode.children)return findNonCommentChild(vnode.children);return vnode}if(vnode.component)return vnode.component.subTree;const{shapeFlag,children}=vnode;if(children){if(shapeFlag&16)return children[0];if(shapeFlag&32&&isFunction$2(children.default))return children.default()}}function setTransitionHooks(vnode,hooks){if(vnode.shapeFlag&6&&vnode.component){vnode.transition=hooks;const subTree=vnode.component.subTree;setTransitionHooks(isTeleport(subTree.type)?getInnerChild$1(subTree)||subTree:subTree,hooks)}else if(vnode.shapeFlag&128){vnode.ssContent.transition=hooks.clone(vnode.ssContent);vnode.ssFallback.transition=hooks.clone(vnode.ssFallback)}else{vnode.transition=hooks;if(vnode.type===Fragment&&isArray$2(vnode.children)){const child=filterSingleRoot(vnode.children,false);if(child)setTransitionHooks(child,hooks)}}}function getTransitionRawChildren(children,keepComment=false,parentKey){let ret=[];let keyedFragmentCount=0;for(let i=0;i<children.length;i++){let child=children[i];const key=parentKey==null?child.key:String(parentKey)+String(child.key!=null?child.key:i);if(child.type===Fragment){if(child.patchFlag&128)keyedFragmentCount++;ret=ret.concat(getTransitionRawChildren(child.children,keepComment,key))}else if(keepComment||child.type!==Comment)ret.push(key!=null?cloneVNode(child,{key}):child)}if(keyedFragmentCount>1)for(let i=0;i<ret.length;i++)ret[i].patchFlag=-2;return ret}function getTransitionRoot(vnode){if(vnode.component)return getTransitionRoot(vnode.component.subTree);if(vnode.type===Fragment){const child=isArray$2(vnode.children)&&filterSingleRoot(vnode.children,false);return child?getTransitionRoot(child):void 0}if(vnode.type!==Comment)return vnode}function defineComponent$1(options,extraOptions){return isFunction$2(options)?(()=>extend({name:options.name},extraOptions,{setup:options}))():options}function useId(){const i=getCurrentInstance$1();if(i)return(i.appContext.config.idPrefix||`v`)+`-`+i.ids[0]+i.ids[1]++;return``}function markAsyncBoundary(instance){instance.ids=[instance.ids[0]+instance.ids[2]+++`-`,0,0]}function isTemplateRefKey(refs,key){let desc;return!!((desc=Object.getOwnPropertyDescriptor(refs,key))&&!desc.configurable)}var pendingSetRefMap=new WeakMap;function setRef(rawRef,oldRawRef,parentSuspense,vnode,isUnmount=false){if(isArray$2(rawRef)){rawRef.forEach((r,i)=>setRef(r,oldRawRef&&(isArray$2(oldRawRef)?oldRawRef[i]:oldRawRef),parentSuspense,vnode,isUnmount));return}if(isAsyncWrapper(vnode)&&!isUnmount){if(vnode.shapeFlag&512&&vnode.type.__asyncResolved&&vnode.component.subTree.component)setRef(rawRef,oldRawRef,parentSuspense,vnode.component.subTree);return}const refValue=vnode.shapeFlag&4?getComponentPublicInstance(vnode.component):vnode.el;const value=isUnmount?null:refValue;const{i:owner,r:ref}=rawRef;const oldRef=oldRawRef&&oldRawRef.r;const refs=owner.refs===EMPTY_OBJ?owner.refs={}:owner.refs;const setupState=owner.setupState;const rawSetupState=toRaw(setupState);const canSetSetupRef=setupState===EMPTY_OBJ?NO:key=>{if(isTemplateRefKey(refs,key))return false;return hasOwn$1(rawSetupState,key)};const canSetRef=(ref2,key)=>{if(key&&isTemplateRefKey(refs,key))return false;return true};if(oldRef!=null&&oldRef!==ref){invalidatePendingSetRef(oldRawRef);if(isString$1(oldRef)){refs[oldRef]=null;if(canSetSetupRef(oldRef))setupState[oldRef]=null}else if(isRef(oldRef)){const oldRawRefAtom=oldRawRef;if(canSetRef(oldRef,oldRawRefAtom.k))oldRef.value=null;if(oldRawRefAtom.k)refs[oldRawRefAtom.k]=null}}if(isFunction$2(ref))callWithErrorHandling(ref,owner,12,[value,refs]);else{const _isString=isString$1(ref);const _isRef=isRef(ref);if(_isString||_isRef){const doSet=()=>{if(rawRef.f){const existing=_isString?canSetSetupRef(ref)?setupState[ref]:refs[ref]:canSetRef(ref)||!rawRef.k?ref.value:refs[rawRef.k];if(isUnmount)isArray$2(existing)&&remove(existing,refValue);else if(!isArray$2(existing)){if(_isString){refs[ref]=[refValue];if(canSetSetupRef(ref))setupState[ref]=refs[ref]}else{const newVal=[refValue];if(canSetRef(ref,rawRef.k))ref.value=newVal;if(rawRef.k)refs[rawRef.k]=newVal}}else if(!existing.includes(refValue))existing.push(refValue)}else if(_isString){refs[ref]=value;if(canSetSetupRef(ref))setupState[ref]=value}else if(_isRef){if(canSetRef(ref,rawRef.k))ref.value=value;if(rawRef.k)refs[rawRef.k]=value}};if(value){const job=()=>{doSet();pendingSetRefMap.delete(rawRef)};job.id=-1;pendingSetRefMap.set(rawRef,job);queuePostRenderEffect(job,parentSuspense)}else{invalidatePendingSetRef(rawRef);doSet()}}}}function invalidatePendingSetRef(rawRef){const pendingSetRef=pendingSetRefMap.get(rawRef);if(pendingSetRef){pendingSetRef.flags|=8;pendingSetRefMap.delete(rawRef)}}var isComment=node=>node.nodeType===8;var requestIdleCallback$1=getGlobalThis().requestIdleCallback||(cb=>setTimeout(cb,1));var cancelIdleCallback$1=getGlobalThis().cancelIdleCallback||(id=>clearTimeout(id));function forEachElement(node,cb){if(isComment(node)&&node.data===`[`){let depth=1;let next=node.nextSibling;while(next){if(next.nodeType===1){if(cb(next)===false)break}else if(isComment(next)){if(next.data===`]`){if(--depth===0)break}else if(next.data===`[`)depth++}next=next.nextSibling}}else cb(node)}var isAsyncWrapper=i=>!!i.type.__asyncLoader;function defineAsyncComponent(source){if(isFunction$2(source))source={loader:source};const{loader,loadingComponent,errorComponent,delay=200,hydrate:hydrateStrategy,timeout,suspensible=true,onError:userOnError}=source;let pendingRequest=null;let resolvedComp;let retries=0;const retry=()=>{retries++;pendingRequest=null;return load()};const load=()=>{let thisRequest;return pendingRequest||(thisRequest=pendingRequest=loader().catch(err=>{err=err instanceof Error?err:new Error(String(err));if(userOnError)return new Promise((resolve,reject)=>{const userRetry=()=>resolve(retry());const userFail=()=>reject(err);userOnError(err,userRetry,userFail,retries+1)});else throw err}).then(comp=>{if(thisRequest!==pendingRequest&&pendingRequest)return pendingRequest;if(comp&&(comp.__esModule||comp[Symbol.toStringTag]===`Module`))comp=comp.default;resolvedComp=comp;return comp}))};return defineComponent$1({name:`AsyncComponentWrapper`,__asyncLoader:load,__asyncHydrate(el,instance,hydrate){const wasConnected=el.isConnected;let patched=false;(instance.bu||(instance.bu=[])).push(()=>patched=true);const performHydrate=()=>{if(patched)return;if(!el.parentNode||wasConnected&&!el.isConnected)return;hydrate()};const doHydrate=hydrateStrategy?()=>{const teardown=hydrateStrategy(performHydrate,cb=>forEachElement(el,cb));if(teardown)(instance.bum||(instance.bum=[])).push(teardown)}:performHydrate;if(resolvedComp)doHydrate();else load().then(()=>!instance.isUnmounted&&doHydrate())},get __asyncResolved(){return resolvedComp},setup(){const instance=currentInstance;markAsyncBoundary(instance);if(resolvedComp)return()=>createInnerComp(resolvedComp,instance);const onError=err=>{pendingRequest=null;handleError(err,instance,13,!errorComponent)};if(suspensible&&instance.suspense||isInSSRComponentSetup)return load().then(comp=>{return()=>createInnerComp(comp,instance)}).catch(err=>{onError(err);return()=>errorComponent?createVNode(errorComponent,{error:err}):null});const loaded=ref(false);const error=ref();const delayed=ref(!!delay);let timeoutTimer;let delayTimer;onUnmounted(()=>{if(timeoutTimer!=null)clearTimeout(timeoutTimer);if(delayTimer!=null)clearTimeout(delayTimer)});if(delay)delayTimer=setTimeout(()=>{if(instance.isUnmounted)return;delayed.value=false},delay);if(timeout!=null)timeoutTimer=setTimeout(()=>{if(instance.isUnmounted)return;if(!loaded.value&&!error.value){const err=new Error(`Async component timed out after ${timeout}ms.`);onError(err);error.value=err}},timeout);load().then(()=>{if(instance.isUnmounted)return;loaded.value=true;if(instance.parent&&isKeepAlive(instance.parent.vnode))instance.parent.update()}).catch(err=>{if(instance.isUnmounted){pendingRequest=null;return}onError(err);error.value=err});return()=>{if(loaded.value&&resolvedComp)return createInnerComp(resolvedComp,instance);else if(error.value&&errorComponent)return createVNode(errorComponent,{error:error.value});else if(loadingComponent&&!delayed.value)return createInnerComp(loadingComponent,instance)}}})}function createInnerComp(comp,parent){const{ref:ref2,props,children,ce}=parent.vnode;const vnode=createVNode(comp,props,children);vnode.ref=ref2;vnode.ce=ce;delete parent.vnode.ce;return vnode}var isKeepAlive=vnode=>vnode.type.__isKeepAlive;function onActivated(hook,target){registerKeepAliveHook(hook,`a`,target)}function onDeactivated(hook,target){registerKeepAliveHook(hook,`da`,target)}function registerKeepAliveHook(hook,type,target=currentInstance){const wrappedHook=hook.__wdc||(hook.__wdc=()=>{let current=target;while(current){if(current.isDeactivated)return;current=current.parent}return hook()});injectHook(type,wrappedHook,target);if(target){let current=target.parent;while(current&¤t.parent){if(isKeepAlive(current.parent.vnode))injectToKeepAliveRoot(wrappedHook,type,target,current);current=current.parent}}}function injectToKeepAliveRoot(hook,type,target,keepAliveRoot){const injected=injectHook(type,hook,keepAliveRoot,true);onUnmounted(()=>{remove(keepAliveRoot[type],injected)},target)}function injectHook(type,hook,target=currentInstance,prepend=false){if(target){const hooks=target[type]||(target[type]=[]);const wrappedHook=hook.__weh||(hook.__weh=(...args)=>{pauseTracking();const reset=setCurrentInstance(target);const res=callWithAsyncErrorHandling(hook,target,type,args);reset();resetTracking();return res});if(prepend)hooks.unshift(wrappedHook);else hooks.push(wrappedHook);return wrappedHook}}var createHook=lifecycle=>(hook,target=currentInstance)=>{if(!isInSSRComponentSetup||lifecycle===`sp`)injectHook(lifecycle,(...args)=>hook(...args),target)};var onBeforeMount=createHook(`bm`);var onMounted=createHook(`m`);var onBeforeUpdate=createHook(`bu`);var onUpdated=createHook(`u`);var onBeforeUnmount=createHook(`bum`);var onUnmounted=createHook(`um`);var onServerPrefetch=createHook(`sp`);var onRenderTriggered=createHook(`rtg`);var onRenderTracked=createHook(`rtc`);function onErrorCaptured(hook,target=currentInstance){injectHook(`ec`,hook,target)}var COMPONENTS=`components`;function resolveComponent(name,maybeSelfReference){return resolveAsset(COMPONENTS,name,true,maybeSelfReference)||name}var NULL_DYNAMIC_COMPONENT=Symbol.for(`v-ndc`);function resolveDynamicComponent(component){if(isString$1(component))return resolveAsset(COMPONENTS,component,false)||component;else return component||NULL_DYNAMIC_COMPONENT}function resolveAsset(type,name,warnMissing=true,maybeSelfReference=false){const instance=currentRenderingInstance||currentInstance;if(instance){const Component=instance.type;if(type===COMPONENTS){const selfName=getComponentName(Component,false);if(selfName&&(selfName===name||selfName===camelize(name)||selfName===capitalize(camelize(name))))return Component}const res=resolve(instance[type]||Component[type],name)||resolve(instance.appContext[type],name);if(!res&&maybeSelfReference)return Component;return res}}function resolve(registry,name){return registry&&(registry[name]||registry[camelize(name)]||registry[capitalize(camelize(name))])}function renderList(source,renderItem,cache,index){let ret;const cached=cache&&cache[index];const sourceIsArray=isArray$2(source);if(sourceIsArray||isString$1(source)){const sourceIsReactiveArray=sourceIsArray&&isReactive(source);let needsWrap=false;let isReadonlySource=false;if(sourceIsReactiveArray){needsWrap=!isShallow(source);isReadonlySource=isReadonly(source);source=shallowReadArray(source)}ret=new Array(source.length);for(let i=0,l=source.length;i<l;i++)ret[i]=renderItem(needsWrap?isReadonlySource?toReadonly(toReactive(source[i])):toReactive(source[i]):source[i],i,void 0,cached&&cached[i])}else if(typeof source===`number`){if(!Number.isInteger(source)||source<0)ret=[];else{ret=new Array(source);for(let i=0;i<source;i++)ret[i]=renderItem(i+1,i,void 0,cached&&cached[i])}}else if(isObject$2(source)){if(source[Symbol.iterator])ret=Array.from(source,(item,i)=>renderItem(item,i,void 0,cached&&cached[i]));else{const keys=Object.keys(source);ret=new Array(keys.length);for(let i=0,l=keys.length;i<l;i++){const key=keys[i];ret[i]=renderItem(source[key],key,i,cached&&cached[i])}}}else ret=[];if(cache)cache[index]=ret;return ret}function createSlots(slots,dynamicSlots){for(let i=0;i<dynamicSlots.length;i++){const slot=dynamicSlots[i];if(isArray$2(slot))for(let j=0;j<slot.length;j++)slots[slot[j].name]=slot[j].fn;else if(slot)slots[slot.name]=slot.key?(...args)=>{const res=slot.fn(...args);if(res)res.key=slot.key;return res}:slot.fn}return slots}function renderSlot(slots,name,props,fallback,noSlotted,branchKey){if(props==null)props={};if(currentRenderingInstance.ce||currentRenderingInstance.parent&&isAsyncWrapper(currentRenderingInstance.parent)&¤tRenderingInstance.parent.ce){const slotProps=branchKey!=null&&props.key==null?extend({},props,{key:branchKey}):props;const hasProps=Object.keys(slotProps).length>0;if(name!=="default")slotProps.name=name;return openBlock(),createBlock(Fragment,null,[createVNode(`slot`,slotProps,fallback&&fallback())],hasProps?-2:64)}let slot=slots[name];if(slot&&slot._c)slot._d=false;const prevStackSize=blockStack.length;openBlock();let rendered;try{const validSlotContent=slot&&ensureValidVNode$1(slot(props));const slotKey=props.key||branchKey||validSlotContent&&validSlotContent.key;rendered=createBlock(Fragment,{key:(slotKey&&!isSymbol$1(slotKey)?slotKey:`_${name}`)+(!validSlotContent&&fallback?`_fb`:``)},validSlotContent||(fallback?fallback():[]),validSlotContent&&slots._===1?64:-2)}catch(err){for(let i=blockStack.length;i>prevStackSize;i--)closeBlock();throw err}finally{if(slot&&slot._c)slot._d=true}if(!noSlotted&&rendered.scopeId)rendered.slotScopeIds=[rendered.scopeId+`-s`];return rendered}function ensureValidVNode$1(vnodes){return vnodes.some(child=>{if(!isVNode(child))return true;if(child.type===Comment)return false;if(child.type===Fragment&&!ensureValidVNode$1(child.children))return false;return true})?vnodes:null}function toHandlers(obj,preserveCaseIfNecessary){const ret={};for(const key in obj)ret[preserveCaseIfNecessary&&/[A-Z]/.test(key)?`on:${key}`:toHandlerKey(key)]=obj[key];return ret}var getPublicInstance=i=>{if(!i)return null;if(isStatefulComponent(i))return getComponentPublicInstance(i);return getPublicInstance(i.parent)};var publicPropertiesMap=extend(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>getPublicInstance(i.parent),$root:i=>getPublicInstance(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>resolveMergedOptions(i),$forceUpdate:i=>i.f||(i.f=()=>{queueJob(i.update)}),$nextTick:i=>i.n||(i.n=nextTick$1.bind(i.proxy)),$watch:i=>instanceWatch.bind(i)});var hasSetupBinding=(state,key)=>state!==EMPTY_OBJ&&!state.__isScriptSetup&&hasOwn$1(state,key);var PublicInstanceProxyHandlers={get({_:instance},key){if(key===`__v_skip`)return true;const{ctx,setupState,data,props,accessCache,type,appContext}=instance;if(key[0]!==`$`){const n=accessCache[key];if(n!==void 0)switch(n){case 1:return setupState[key];case 2:return data[key];case 4:return ctx[key];case 3:return props[key]}else if(hasSetupBinding(setupState,key)){accessCache[key]=1;return setupState[key]}else if(data!==EMPTY_OBJ&&hasOwn$1(data,key)){accessCache[key]=2;return data[key]}else if(hasOwn$1(props,key)){accessCache[key]=3;return props[key]}else if(ctx!==EMPTY_OBJ&&hasOwn$1(ctx,key)){accessCache[key]=4;return ctx[key]}else if(shouldCacheAccess)accessCache[key]=0}const publicGetter=publicPropertiesMap[key];let cssModule,globalProperties;if(publicGetter){if(key===`$attrs`)track(instance.attrs,`get`,``);return publicGetter(instance)}else if((cssModule=type.__cssModules)&&(cssModule=cssModule[key]))return cssModule;else if(ctx!==EMPTY_OBJ&&hasOwn$1(ctx,key)){accessCache[key]=4;return ctx[key]}else if(globalProperties=appContext.config.globalProperties,hasOwn$1(globalProperties,key))return globalProperties[key]},set({_:instance},key,value){const{data,setupState,ctx}=instance;if(hasSetupBinding(setupState,key)){setupState[key]=value;return true}else if(data!==EMPTY_OBJ&&hasOwn$1(data,key)){data[key]=value;return true}else if(hasOwn$1(instance.props,key))return false;if(key[0]===`$`&&key.slice(1)in instance)return false;else ctx[key]=value;return true},has({_:{data,setupState,accessCache,ctx,appContext,props,type}},key){let cssModules;return!!(accessCache[key]||data!==EMPTY_OBJ&&key[0]!==`$`&&hasOwn$1(data,key)||hasSetupBinding(setupState,key)||hasOwn$1(props,key)||hasOwn$1(ctx,key)||hasOwn$1(publicPropertiesMap,key)||hasOwn$1(appContext.config.globalProperties,key)||(cssModules=type.__cssModules)&&cssModules[key])},defineProperty(target,key,descriptor){if(descriptor.get!=null)target._.accessCache[key]=0;else if(hasOwn$1(descriptor,`value`))this.set(target,key,descriptor.value,null);return Reflect.defineProperty(target,key,descriptor)}};function useSlots(){return getContext(`useSlots`).slots}function useAttrs(){return getContext(`useAttrs`).attrs}function getContext(calledFunctionName){const i=getCurrentInstance$1();return i.setupContext||(i.setupContext=createSetupContext(i))}function normalizePropsOrEmits(props){return isArray$2(props)?props.reduce((normalized,p)=>(normalized[p]=null,normalized),{}):props}function mergeModels(a,b){if(!a||!b)return a||b;if(isArray$2(a)&&isArray$2(b))return a.concat(b);return extend({},normalizePropsOrEmits(a),normalizePropsOrEmits(b))}function createPropsRestProxy(props,excludedKeys){const ret={};for(const key in props)if(!excludedKeys.includes(key))Object.defineProperty(ret,key,{enumerable:true,get:()=>props[key]});return ret}var shouldCacheAccess=true;function applyOptions(instance){const options=resolveMergedOptions(instance);const publicThis=instance.proxy;const ctx=instance.ctx;shouldCacheAccess=false;if(options.beforeCreate)callHook$1(options.beforeCreate,instance,`bc`);const{data:dataOptions,computed:computedOptions,methods,watch:watchOptions,provide:provideOptions,inject:injectOptions,created,beforeMount,mounted,beforeUpdate,updated,activated,deactivated,beforeDestroy,beforeUnmount,destroyed,unmounted,render,renderTracked,renderTriggered,errorCaptured,serverPrefetch,expose,inheritAttrs,components,directives,filters}=options;const checkDuplicateProperties=null;if(injectOptions)resolveInjections(injectOptions,ctx,checkDuplicateProperties);if(methods)for(const key in methods){const methodHandler=methods[key];if(isFunction$2(methodHandler))ctx[key]=methodHandler.bind(publicThis)}if(dataOptions){const data=dataOptions.call(publicThis,publicThis);if(!isObject$2(data)){}else instance.data=reactive(data)}shouldCacheAccess=true;if(computedOptions)for(const key in computedOptions){const opt=computedOptions[key];const get=isFunction$2(opt)?opt.bind(publicThis,publicThis):isFunction$2(opt.get)?opt.get.bind(publicThis,publicThis):NOOP;const set=!isFunction$2(opt)&&isFunction$2(opt.set)?opt.set.bind(publicThis):NOOP;const c=computed({get,set});Object.defineProperty(ctx,key,{enumerable:true,configurable:true,get:()=>c.value,set:v=>c.value=v})}if(watchOptions)for(const key in watchOptions)createWatcher(watchOptions[key],ctx,publicThis,key);if(provideOptions){const provides=isFunction$2(provideOptions)?provideOptions.call(publicThis):provideOptions;Reflect.ownKeys(provides).forEach(key=>{provide(key,provides[key])})}if(created)callHook$1(created,instance,`c`);function registerLifecycleHook(register,hook){if(isArray$2(hook))hook.forEach(_hook=>register(_hook.bind(publicThis)));else if(hook)register(hook.bind(publicThis))}registerLifecycleHook(onBeforeMount,beforeMount);registerLifecycleHook(onMounted,mounted);registerLifecycleHook(onBeforeUpdate,beforeUpdate);registerLifecycleHook(onUpdated,updated);registerLifecycleHook(onActivated,activated);registerLifecycleHook(onDeactivated,deactivated);registerLifecycleHook(onErrorCaptured,errorCaptured);registerLifecycleHook(onRenderTracked,renderTracked);registerLifecycleHook(onRenderTriggered,renderTriggered);registerLifecycleHook(onBeforeUnmount,beforeUnmount);registerLifecycleHook(onUnmounted,unmounted);registerLifecycleHook(onServerPrefetch,serverPrefetch);if(isArray$2(expose)){if(expose.length){const exposed=instance.exposed||(instance.exposed={});expose.forEach(key=>{Object.defineProperty(exposed,key,{get:()=>publicThis[key],set:val=>publicThis[key]=val,enumerable:true})})}else if(!instance.exposed)instance.exposed={}}if(render&&instance.render===NOOP)instance.render=render;if(inheritAttrs!=null)instance.inheritAttrs=inheritAttrs;if(components)instance.components=components;if(directives)instance.directives=directives;if(serverPrefetch)markAsyncBoundary(instance)}function resolveInjections(injectOptions,ctx,checkDuplicateProperties=NOOP){if(isArray$2(injectOptions))injectOptions=normalizeInject(injectOptions);for(const key in injectOptions){const opt=injectOptions[key];let injected;if(isObject$2(opt)){if(`default`in opt)injected=inject$1(opt.from||key,opt.default,true);else injected=inject$1(opt.from||key)}else injected=inject$1(opt);if(isRef(injected))Object.defineProperty(ctx,key,{enumerable:true,configurable:true,get:()=>injected.value,set:v=>injected.value=v});else ctx[key]=injected}}function callHook$1(hook,instance,type){callWithAsyncErrorHandling(isArray$2(hook)?hook.map(h=>h.bind(instance.proxy)):hook.bind(instance.proxy),instance,type)}function createWatcher(raw,ctx,publicThis,key){let getter=key.includes(`.`)?createPathGetter(publicThis,key):()=>publicThis[key];if(isString$1(raw)){const handler=ctx[raw];if(isFunction$2(handler))watch(getter,handler)}else if(isFunction$2(raw))watch(getter,raw.bind(publicThis));else if(isObject$2(raw)){if(isArray$2(raw))raw.forEach(r=>createWatcher(r,ctx,publicThis,key));else{const handler=isFunction$2(raw.handler)?raw.handler.bind(publicThis):ctx[raw.handler];if(isFunction$2(handler))watch(getter,handler,raw)}}}function resolveMergedOptions(instance){const base=instance.type;const{mixins,extends:extendsOptions}=base;const{mixins:globalMixins,optionsCache:cache,config:{optionMergeStrategies}}=instance.appContext;const cached=cache.get(base);let resolved;if(cached)resolved=cached;else if(!globalMixins.length&&!mixins&&!extendsOptions)resolved=base;else{resolved={};if(globalMixins.length)globalMixins.forEach(m=>mergeOptions$1(resolved,m,optionMergeStrategies,true));mergeOptions$1(resolved,base,optionMergeStrategies)}if(isObject$2(base))cache.set(base,resolved);return resolved}function mergeOptions$1(to,from,strats,asMixin=false){const{mixins,extends:extendsOptions}=from;if(extendsOptions)mergeOptions$1(to,extendsOptions,strats,true);if(mixins)mixins.forEach(m=>mergeOptions$1(to,m,strats,true));for(const key in from)if(asMixin&&key===`expose`){}else{const strat=internalOptionMergeStrats[key]||strats&&strats[key];to[key]=strat?strat(to[key],from[key]):from[key]}return to}var internalOptionMergeStrats={data:mergeDataFn,props:mergeEmitsOrPropsOptions,emits:mergeEmitsOrPropsOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray,created:mergeAsArray,beforeMount:mergeAsArray,mounted:mergeAsArray,beforeUpdate:mergeAsArray,updated:mergeAsArray,beforeDestroy:mergeAsArray,beforeUnmount:mergeAsArray,destroyed:mergeAsArray,unmounted:mergeAsArray,activated:mergeAsArray,deactivated:mergeAsArray,errorCaptured:mergeAsArray,serverPrefetch:mergeAsArray,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject};function mergeDataFn(to,from){if(!from)return to;if(!to)return from;return function mergedDataFn(){return extend(isFunction$2(to)?to.call(this,this):to,isFunction$2(from)?from.call(this,this):from)}}function mergeInject(to,from){return mergeObjectOptions(normalizeInject(to),normalizeInject(from))}function normalizeInject(raw){if(isArray$2(raw)){const res={};for(let i=0;i<raw.length;i++)res[raw[i]]=raw[i];return res}return raw}function mergeAsArray(to,from){return to?[...new Set([].concat(to,from))]:from}function mergeObjectOptions(to,from){return to?extend(Object.create(null),to,from):from}function mergeEmitsOrPropsOptions(to,from){if(to){if(isArray$2(to)&&isArray$2(from))return[...new Set([...to,...from])];return extend(Object.create(null),normalizePropsOrEmits(to),normalizePropsOrEmits(from!=null?from:{}))}else return from}function mergeWatchOptions(to,from){if(!to)return from;if(!from)return to;const merged=extend(Object.create(null),to);for(const key in from)merged[key]=mergeAsArray(to[key],from[key]);return merged}function createAppContext(){return{app:null,config:{isNativeTag:NO,performance:false,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var uid$1=0;function createAppAPI(render,hydrate){return function createApp(rootComponent,rootProps=null){if(!isFunction$2(rootComponent))rootComponent=extend({},rootComponent);if(rootProps!=null&&!isObject$2(rootProps))rootProps=null;const context=createAppContext();const installedPlugins=new WeakSet;const pluginCleanupFns=[];let isMounted=false;const app=context.app={_uid:uid$1++,_component:rootComponent,_props:rootProps,_container:null,_context:context,_instance:null,version:version$1,get config(){return context.config},set config(v){},use(plugin,...options){if(installedPlugins.has(plugin)){}else if(plugin&&isFunction$2(plugin.install)){installedPlugins.add(plugin);plugin.install(app,...options)}else if(isFunction$2(plugin)){installedPlugins.add(plugin);plugin(app,...options)}return app},mixin(mixin){if(!context.mixins.includes(mixin))context.mixins.push(mixin);return app},component(name,component){if(!component)return context.components[name];context.components[name]=component;return app},directive(name,directive){if(!directive)return context.directives[name];context.directives[name]=directive;return app},mount(rootContainer,isHydrate,namespace){if(!isMounted){const vnode=app._ceVNode||createVNode(rootComponent,rootProps);vnode.appContext=context;if(namespace===true)namespace=`svg`;else if(namespace===false)namespace=void 0;if(isHydrate&&hydrate)hydrate(vnode,rootContainer);else render(vnode,rootContainer,namespace);isMounted=true;app._container=rootContainer;rootContainer.__vue_app__=app;return getComponentPublicInstance(vnode.component)}},onUnmount(cleanupFn){pluginCleanupFns.push(cleanupFn)},unmount(){if(isMounted){callWithAsyncErrorHandling(pluginCleanupFns,app._instance,16);render(null,app._container);delete app._container.__vue_app__}},provide(key,value){context.provides[key]=value;return app},runWithContext(fn){const lastApp=currentApp;currentApp=app;try{return fn()}finally{currentApp=lastApp}}};return app}}var currentApp=null;function useModel(props,name,options=EMPTY_OBJ){const i=getCurrentInstance$1();const camelizedName=camelize(name);const hyphenatedName=hyphenate(name);const modifiers=getModelModifiers(props,camelizedName);const res=customRef((track,trigger)=>{let localValue;let prevSetValue=EMPTY_OBJ;let prevEmittedValue;watchSyncEffect(()=>{const propValue=props[camelizedName];if(hasChanged(localValue,propValue)){localValue=propValue;trigger()}});return{get(){track();return options.get?options.get(localValue):localValue},set(value){const emittedValue=options.set?options.set(value):value;if(!hasChanged(emittedValue,localValue)&&!(prevSetValue!==EMPTY_OBJ&&hasChanged(value,prevSetValue)))return;const rawProps=i.vnode.props;const hasVModel=!!(rawProps&&(name in rawProps||camelizedName in rawProps||hyphenatedName in rawProps)&&(`onUpdate:${name}`in rawProps||`onUpdate:${camelizedName}`in rawProps||`onUpdate:${hyphenatedName}`in rawProps));if(!hasVModel){localValue=value;trigger()}i.emit(`update:${name}`,emittedValue);if(hasChanged(value,prevSetValue)&&(hasChanged(value,emittedValue)&&!hasChanged(emittedValue,prevEmittedValue)||hasVModel&&prevSetValue!==EMPTY_OBJ&&!hasChanged(emittedValue,localValue)))trigger();prevSetValue=value;prevEmittedValue=emittedValue}}});res[Symbol.iterator]=()=>{let i2=0;return{next(){if(i2<2)return{value:i2++?modifiers||EMPTY_OBJ:res,done:false};else return{done:true}}}};return res}var getModelModifiers=(props,modelName)=>{return modelName===`modelValue`||modelName===`model-value`?props.modelModifiers:props[`${modelName}Modifiers`]||props[`${camelize(modelName)}Modifiers`]||props[`${hyphenate(modelName)}Modifiers`]};function emit(instance,event,...rawArgs){if(instance.isUnmounted)return;const props=instance.vnode.props||EMPTY_OBJ;let args=rawArgs;const isModelListener=event.startsWith(`update:`);const modifiers=isModelListener&&getModelModifiers(props,event.slice(7));if(modifiers){if(modifiers.trim)args=rawArgs.map(a=>isString$1(a)?a.trim():a);if(modifiers.number)args=args.map(looseToNumber)}let handlerName;let handler=props[handlerName=toHandlerKey(event)]||props[handlerName=toHandlerKey(camelize(event))];if(!handler&&isModelListener)handler=props[handlerName=toHandlerKey(hyphenate(event))];if(handler)callWithAsyncErrorHandling(handler,instance,6,args);const onceHandler=props[handlerName+`Once`];if(onceHandler){if(!instance.emitted)instance.emitted={};else if(instance.emitted[handlerName])return;instance.emitted[handlerName]=true;callWithAsyncErrorHandling(onceHandler,instance,6,args)}}var mixinEmitsCache=new WeakMap;function normalizeEmitsOptions(comp,appContext,asMixin=false){const cache=asMixin?mixinEmitsCache:appContext.emitsCache;const cached=cache.get(comp);if(cached!==void 0)return cached;const raw=comp.emits;let normalized={};let hasExtends=false;if(!isFunction$2(comp)){const extendEmits=raw2=>{const normalizedFromExtend=normalizeEmitsOptions(raw2,appContext,true);if(normalizedFromExtend){hasExtends=true;extend(normalized,normalizedFromExtend)}};if(!asMixin&&appContext.mixins.length)appContext.mixins.forEach(extendEmits);if(comp.extends)extendEmits(comp.extends);if(comp.mixins)comp.mixins.forEach(extendEmits)}if(!raw&&!hasExtends){if(isObject$2(comp))cache.set(comp,null);return null}if(isArray$2(raw))raw.forEach(key=>normalized[key]=null);else extend(normalized,raw);if(isObject$2(comp))cache.set(comp,normalized);return normalized}function isEmitListener(options,key){if(!options||!isOn$1(key))return false;key=key.slice(2);key=key===`Once`?key:key.replace(/Once$/,``);return hasOwn$1(options,key[0].toLowerCase()+key.slice(1))||hasOwn$1(options,hyphenate(key))||hasOwn$1(options,key)}function renderComponentRoot(instance){const{type:Component,vnode,proxy,withProxy,propsOptions:[propsOptions],slots,attrs,emit,render,renderCache,props,data,setupState,ctx,inheritAttrs}=instance;const prev=setCurrentRenderingInstance(instance);let result;let fallthroughAttrs;try{if(vnode.shapeFlag&4){const proxyToUse=withProxy||proxy;const thisProxy=proxyToUse;result=normalizeVNode(render.call(thisProxy,proxyToUse,renderCache,props,setupState,data,ctx));fallthroughAttrs=attrs}else{const render2=Component;result=normalizeVNode(render2.length>1?render2(props,{attrs,slots,emit}):render2(props,null));fallthroughAttrs=Component.props?attrs:getFunctionalFallthrough(attrs)}}catch(err){blockStack.length=0;handleError(err,instance,1);result=createVNode(Comment)}let root=result;if(fallthroughAttrs&&inheritAttrs!==false){const keys=Object.keys(fallthroughAttrs);const{shapeFlag}=root;if(keys.length){if(shapeFlag&7){if(propsOptions&&keys.some(isModelListener))fallthroughAttrs=filterModelListeners(fallthroughAttrs,propsOptions);root=cloneVNode(root,fallthroughAttrs,false,true)}}}if(vnode.dirs){root=cloneVNode(root,null,false,true);root.dirs=root.dirs?root.dirs.concat(vnode.dirs):vnode.dirs}if(vnode.transition)setTransitionHooks(isTeleport(root.type)?getInnerChild$1(root)||root:root,vnode.transition);result=root;setCurrentRenderingInstance(prev);return result}function filterSingleRoot(children,recurse=true){let singleRoot;for(let i=0;i<children.length;i++){const child=children[i];if(isVNode(child)){if(child.type!==Comment||child.children===`v-if`){if(singleRoot)return;else singleRoot=child}}else return}return singleRoot}var getFunctionalFallthrough=attrs=>{let res;for(const key in attrs)if(key===`class`||key===`style`||isOn$1(key))(res||(res={}))[key]=attrs[key];return res};var filterModelListeners=(attrs,props)=>{const res={};for(const key in attrs)if(!isModelListener(key)||!(key.slice(9)in props))res[key]=attrs[key];return res};function shouldUpdateComponent(prevVNode,nextVNode,optimized){const{props:prevProps,children:prevChildren,component}=prevVNode;const{props:nextProps,children:nextChildren,patchFlag}=nextVNode;const emits=component.emitsOptions;if(nextVNode.dirs||nextVNode.transition)return true;if(optimized&&patchFlag>=0){if(patchFlag&1024)return true;if(patchFlag&16){if(!prevProps)return!!nextProps;return hasPropsChanged(prevProps,nextProps,emits)}else if(patchFlag&8){const dynamicProps=nextVNode.dynamicProps;for(let i=0;i<dynamicProps.length;i++){const key=dynamicProps[i];if(hasPropValueChanged(nextProps,prevProps,key)&&!isEmitListener(emits,key))return true}}}else{if(prevChildren||nextChildren){if(!nextChildren||!nextChildren.$stable)return true}if(prevProps===nextProps)return false;if(!prevProps)return!!nextProps;if(!nextProps)return true;return hasPropsChanged(prevProps,nextProps,emits)}return false}function hasPropsChanged(prevProps,nextProps,emitsOptions){const nextKeys=Object.keys(nextProps);if(nextKeys.length!==Object.keys(prevProps).length)return true;for(let i=0;i<nextKeys.length;i++){const key=nextKeys[i];if(!hasOwn$1(prevProps,key)||hasPropValueChanged(nextProps,prevProps,key)&&!isEmitListener(emitsOptions,key))return true}return false}function hasPropValueChanged(nextProps,prevProps,key){const nextProp=nextProps[key];const prevProp=prevProps[key];if(key===`style`&&isObject$2(nextProp)&&isObject$2(prevProp))return!looseEqual(nextProp,prevProp);return nextProp!==prevProp}function updateHOCHostEl({vnode,parent,suspense},el){while(parent){const root=parent.subTree;if(root.suspense&&root.suspense.activeBranch===vnode){root.suspense.vnode.el=root.el=el;vnode=root}if(root===vnode){(vnode=parent.vnode).el=el;parent=parent.parent}else break}if(suspense&&suspense.activeBranch===vnode)suspense.vnode.el=el}var internalObjectProto={};var createInternalObject=()=>Object.create(internalObjectProto);var isInternalObject=obj=>Object.getPrototypeOf(obj)===internalObjectProto;function initProps(instance,rawProps,isStateful,isSSR=false){const props={};const attrs=createInternalObject();instance.propsDefaults=Object.create(null);setFullProps(instance,rawProps,props,attrs);for(const key in instance.propsOptions[0])if(!(key in props))props[key]=void 0;if(isStateful)instance.props=isSSR?props:shallowReactive(props);else if(!instance.type.props)instance.props=attrs;else instance.props=props;instance.attrs=attrs}function updateProps(instance,rawProps,rawPrevProps,optimized){const{props,attrs,vnode:{patchFlag}}=instance;const rawCurrentProps=toRaw(props);const[options]=instance.propsOptions;let hasAttrsChanged=false;if((optimized||patchFlag>0)&&!(patchFlag&16)){if(patchFlag&8){const propsToUpdate=instance.vnode.dynamicProps;for(let i=0;i<propsToUpdate.length;i++){let key=propsToUpdate[i];if(isEmitListener(instance.emitsOptions,key))continue;const value=rawProps[key];if(options){if(hasOwn$1(attrs,key)){if(value!==attrs[key]){attrs[key]=value;hasAttrsChanged=true}}else{const camelizedKey=camelize(key);props[camelizedKey]=resolvePropValue(options,rawCurrentProps,camelizedKey,value,instance,false)}}else if(value!==attrs[key]){attrs[key]=value;hasAttrsChanged=true}}}}else{if(setFullProps(instance,rawProps,props,attrs))hasAttrsChanged=true;let kebabKey;for(const key in rawCurrentProps)if(!rawProps||!hasOwn$1(rawProps,key)&&((kebabKey=hyphenate(key))===key||!hasOwn$1(rawProps,kebabKey))){if(options){if(rawPrevProps&&(rawPrevProps[key]!==void 0||rawPrevProps[kebabKey]!==void 0))props[key]=resolvePropValue(options,rawCurrentProps,key,void 0,instance,true)}else delete props[key]}if(attrs!==rawCurrentProps){for(const key in attrs)if(!rawProps||!hasOwn$1(rawProps,key)&&true){delete attrs[key];hasAttrsChanged=true}}}if(hasAttrsChanged)trigger(instance.attrs,`set`,``)}function setFullProps(instance,rawProps,props,attrs){const[options,needCastKeys]=instance.propsOptions;let hasAttrsChanged=false;let rawCastValues;if(rawProps)for(let key in rawProps){if(isReservedProp(key))continue;const value=rawProps[key];let camelKey;if(options&&hasOwn$1(options,camelKey=camelize(key))){if(!needCastKeys||!needCastKeys.includes(camelKey))props[camelKey]=value;else(rawCastValues||(rawCastValues={}))[camelKey]=value}else if(!isEmitListener(instance.emitsOptions,key)){if(!(key in attrs)||value!==attrs[key]){attrs[key]=value;hasAttrsChanged=true}}}if(needCastKeys){const rawCurrentProps=toRaw(props);const castValues=rawCastValues||EMPTY_OBJ;for(let i=0;i<needCastKeys.length;i++){const key=needCastKeys[i];props[key]=resolvePropValue(options,rawCurrentProps,key,castValues[key],instance,!hasOwn$1(castValues,key))}}return hasAttrsChanged}function resolvePropValue(options,props,key,value,instance,isAbsent){const opt=options[key];if(opt!=null){const hasDefault=hasOwn$1(opt,`default`);if(hasDefault&&value===void 0){const defaultValue=opt.default;if(opt.type!==Function&&!opt.skipFactory&&isFunction$2(defaultValue)){const{propsDefaults}=instance;if(key in propsDefaults)value=propsDefaults[key];else{const reset=setCurrentInstance(instance);value=propsDefaults[key]=defaultValue.call(null,props);reset()}}else value=defaultValue;if(instance.ce)instance.ce._setProp(key,value)}if(opt[0]){if(isAbsent&&!hasDefault)value=false;else if(opt[1]&&(value===``||value===hyphenate(key)))value=true}}return value}var mixinPropsCache=new WeakMap;function normalizePropsOptions(comp,appContext,asMixin=false){const cache=asMixin?mixinPropsCache:appContext.propsCache;const cached=cache.get(comp);if(cached)return cached;const raw=comp.props;const normalized={};const needCastKeys=[];let hasExtends=false;if(!isFunction$2(comp)){const extendProps=raw2=>{hasExtends=true;const[props,keys]=normalizePropsOptions(raw2,appContext,true);extend(normalized,props);if(keys)needCastKeys.push(...keys)};if(!asMixin&&appContext.mixins.length)appContext.mixins.forEach(extendProps);if(comp.extends)extendProps(comp.extends);if(comp.mixins)comp.mixins.forEach(extendProps)}if(!raw&&!hasExtends){if(isObject$2(comp))cache.set(comp,EMPTY_ARR);return EMPTY_ARR}if(isArray$2(raw))for(let i=0;i<raw.length;i++){const normalizedKey=camelize(raw[i]);if(validatePropName(normalizedKey))normalized[normalizedKey]=EMPTY_OBJ}else if(raw)for(const key in raw){const normalizedKey=camelize(key);if(validatePropName(normalizedKey)){const opt=raw[key];const prop=normalized[normalizedKey]=isArray$2(opt)||isFunction$2(opt)?{type:opt}:extend({},opt);const propType=prop.type;let shouldCast=false;let shouldCastTrue=true;if(isArray$2(propType))for(let index=0;index<propType.length;++index){const type=propType[index];const typeName=isFunction$2(type)&&type.name;if(typeName===`Boolean`){shouldCast=true;break}else if(typeName===`String`)shouldCastTrue=false}else shouldCast=isFunction$2(propType)&&propType.name===`Boolean`;prop[0]=shouldCast;prop[1]=shouldCastTrue;if(shouldCast||hasOwn$1(prop,`default`))needCastKeys.push(normalizedKey)}}const res=[normalized,needCastKeys];if(isObject$2(comp))cache.set(comp,res);return res}function validatePropName(key){if(key[0]!==`$`&&!isReservedProp(key))return true;return false}var isInternalKey=key=>key===`_`||key===`_ctx`||key===`$stable`;var normalizeSlotValue=value=>isArray$2(value)?value.map(normalizeVNode):[normalizeVNode(value)];var normalizeSlot$1=(key,rawSlot,ctx)=>{if(rawSlot._n)return rawSlot;const normalized=withCtx((...args)=>{return normalizeSlotValue(rawSlot(...args))},ctx);normalized._c=false;return normalized};var normalizeObjectSlots=(rawSlots,slots,instance)=>{const ctx=rawSlots._ctx;for(const key in rawSlots){if(isInternalKey(key))continue;const value=rawSlots[key];if(isFunction$2(value))slots[key]=normalizeSlot$1(key,value,ctx);else if(value!=null){const normalized=normalizeSlotValue(value);slots[key]=()=>normalized}}};var normalizeVNodeSlots=(instance,children)=>{const normalized=normalizeSlotValue(children);instance.slots.default=()=>normalized};var assignSlots=(slots,children,optimized)=>{for(const key in children)if(optimized||!isInternalKey(key))slots[key]=children[key]};var initSlots=(instance,children,optimized)=>{const slots=instance.slots=createInternalObject();if(instance.vnode.shapeFlag&32){const type=children._;if(type){assignSlots(slots,children,optimized);if(optimized)def(slots,`_`,type,true)}else normalizeObjectSlots(children,slots)}else if(children)normalizeVNodeSlots(instance,children)};var updateSlots=(instance,children,optimized)=>{const{vnode,slots}=instance;let needDeletionCheck=true;let deletionComparisonTarget=EMPTY_OBJ;if(vnode.shapeFlag&32){const type=children._;if(type){if(optimized&&type===1)needDeletionCheck=false;else assignSlots(slots,children,optimized)}else{needDeletionCheck=!children.$stable;normalizeObjectSlots(children,slots)}deletionComparisonTarget=children}else if(children){normalizeVNodeSlots(instance,children);deletionComparisonTarget={default:1}}if(needDeletionCheck){for(const key in slots)if(!isInternalKey(key)&&deletionComparisonTarget[key]==null)delete slots[key]}};var queuePostRenderEffect=queueEffectWithSuspense;function createRenderer(options){return baseCreateRenderer(options)}function baseCreateRenderer(options,createHydrationFns){const target=getGlobalThis();target.__VUE__=true;const{insert:hostInsert,remove:hostRemove,patchProp:hostPatchProp,createElement:hostCreateElement,createText:hostCreateText,createComment:hostCreateComment,setText:hostSetText,setElementText:hostSetElementText,parentNode:hostParentNode,nextSibling:hostNextSibling,setScopeId:hostSetScopeId=NOOP,insertStaticContent:hostInsertStaticContent}=options;const patch=(n1,n2,container,anchor=null,parentComponent=null,parentSuspense=null,namespace=void 0,slotScopeIds=null,optimized=!!n2.dynamicChildren)=>{if(n1===n2)return;if(n1&&!isSameVNodeType(n1,n2)){anchor=getNextHostNode(n1);unmount(n1,parentComponent,parentSuspense,true);n1=null}if(n2.patchFlag===-2){optimized=false;n2.dynamicChildren=null}if(n2.dynamicChildren&&n1&&n1.dynamicChildren&&n1.dynamicChildren.hasOnce){if(n2.dynamicChildren===EMPTY_ARR)n2.dynamicChildren=[];n2.dynamicChildren.hasOnce=true}const{type,ref,shapeFlag}=n2;switch(type){case Text:processText(n1,n2,container,anchor);break;case Comment:processCommentNode(n1,n2,container,anchor);break;case Static:if(n1==null)mountStaticNode(n2,container,anchor,namespace);break;case Fragment:processFragment(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);break;default:if(shapeFlag&1)processElement(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);else if(shapeFlag&6)processComponent(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);else if(shapeFlag&64)type.process(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized,internals);else if(shapeFlag&128)type.process(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized,internals)}if(ref!=null&&parentComponent)setRef(ref,n1&&n1.ref,parentSuspense,n2||n1,!n2);else if(ref==null&&n1&&n1.ref!=null)setRef(n1.ref,null,parentSuspense,n1,true)};const processText=(n1,n2,container,anchor)=>{if(n1==null)hostInsert(n2.el=hostCreateText(n2.children),container,anchor);else{const el=n2.el=n1.el;if(n2.children!==n1.children)hostSetText(el,n2.children)}};const processCommentNode=(n1,n2,container,anchor)=>{if(n1==null)hostInsert(n2.el=hostCreateComment(n2.children||``),container,anchor);else n2.el=n1.el};const mountStaticNode=(n2,container,anchor,namespace)=>{[n2.el,n2.anchor]=hostInsertStaticContent(n2.children,container,anchor,namespace,n2.el,n2.anchor)};const moveStaticNode=({el,anchor},container,nextSibling)=>{let next;while(el&&el!==anchor){next=hostNextSibling(el);hostInsert(el,container,nextSibling);el=next}hostInsert(anchor,container,nextSibling)};const removeStaticNode=({el,anchor})=>{let next;while(el&&el!==anchor){next=hostNextSibling(el);hostRemove(el);el=next}hostRemove(anchor)};const processElement=(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)=>{if(n2.type===`svg`)namespace=`svg`;else if(n2.type===`math`)namespace=`mathml`;if(n1==null)mountElement(n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);else{const customElement=n1.el&&n1.el._isVueCE?n1.el:null;try{if(customElement)customElement._beginPatch();patchElement(n1,n2,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)}finally{if(customElement)customElement._endPatch()}}};const mountElement=(vnode,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)=>{let el;let vnodeHook;const{props,shapeFlag,transition,dirs}=vnode;el=vnode.el=hostCreateElement(vnode.type,namespace,props&&props.is,props);if(shapeFlag&8)hostSetElementText(el,vnode.children);else if(shapeFlag&16)mountChildren(vnode.children,el,null,parentComponent,parentSuspense,resolveChildrenNamespace(vnode,namespace),slotScopeIds,optimized);if(dirs)invokeDirectiveHook(vnode,null,parentComponent,`created`);setScopeId(el,vnode,vnode.scopeId,slotScopeIds,parentComponent);if(props){for(const key in props)if(key!==`value`&&!isReservedProp(key))hostPatchProp(el,key,null,props[key],namespace,parentComponent);if(`value`in props)hostPatchProp(el,`value`,null,props.value,namespace);if(vnodeHook=props.onVnodeBeforeMount)invokeVNodeHook(vnodeHook,parentComponent,vnode)}if(dirs)invokeDirectiveHook(vnode,null,parentComponent,`beforeMount`);const needCallTransitionHooks=needTransition(parentSuspense,transition);if(needCallTransitionHooks)transition.beforeEnter(el);hostInsert(el,container,anchor);if((vnodeHook=props&&props.onVnodeMounted)||needCallTransitionHooks||dirs)queuePostRenderEffect(()=>{try{vnodeHook&&invokeVNodeHook(vnodeHook,parentComponent,vnode);needCallTransitionHooks&&transition.enter(el);dirs&&invokeDirectiveHook(vnode,null,parentComponent,`mounted`)}finally{}},parentSuspense)};const setScopeId=(el,vnode,scopeId,slotScopeIds,parentComponent)=>{if(scopeId)hostSetScopeId(el,scopeId);if(slotScopeIds)for(let i=0;i<slotScopeIds.length;i++)hostSetScopeId(el,slotScopeIds[i]);if(parentComponent){let subTree=parentComponent.subTree;if(vnode===subTree||isSuspense(subTree.type)&&(subTree.ssContent===vnode||subTree.ssFallback===vnode)){const parentVNode=parentComponent.vnode;setScopeId(el,parentVNode,parentVNode.scopeId,parentVNode.slotScopeIds,parentComponent.parent)}}};const mountChildren=(children,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized,start=0)=>{for(let i=start;i<children.length;i++){const child=children[i]=optimized?cloneIfMounted(children[i]):normalizeVNode(children[i]);patch(null,child,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)}};const patchElement=(n1,n2,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)=>{const el=n2.el=n1.el;let{patchFlag,dynamicChildren,dirs}=n2;patchFlag|=n1.patchFlag&16;const oldProps=n1.props||EMPTY_OBJ;const newProps=n2.props||EMPTY_OBJ;let vnodeHook;parentComponent&&toggleRecurse(parentComponent,false);if(vnodeHook=newProps.onVnodeBeforeUpdate)invokeVNodeHook(vnodeHook,parentComponent,n2,n1);if(dirs)invokeDirectiveHook(n2,n1,parentComponent,`beforeUpdate`);parentComponent&&toggleRecurse(parentComponent,true);if(dynamicChildren&&(!n1.dynamicChildren||n1.dynamicChildren.length!==dynamicChildren.length)){patchFlag=0;optimized=false;dynamicChildren=null}if(oldProps.innerHTML&&newProps.innerHTML==null||oldProps.textContent&&newProps.textContent==null)hostSetElementText(el,``);if(dynamicChildren)patchBlockChildren(n1.dynamicChildren,dynamicChildren,el,parentComponent,parentSuspense,resolveChildrenNamespace(n2,namespace),slotScopeIds);else if(!optimized)patchChildren(n1,n2,el,null,parentComponent,parentSuspense,resolveChildrenNamespace(n2,namespace),slotScopeIds,false);if(patchFlag>0){if(patchFlag&16)patchProps(el,oldProps,newProps,parentComponent,namespace);else{if(patchFlag&2){if(oldProps.class!==newProps.class)hostPatchProp(el,`class`,null,newProps.class,namespace)}if(patchFlag&4)hostPatchProp(el,`style`,oldProps.style,newProps.style,namespace);if(patchFlag&8){const propsToUpdate=n2.dynamicProps;for(let i=0;i<propsToUpdate.length;i++){const key=propsToUpdate[i];const prev=oldProps[key];const next=newProps[key];if(next!==prev||key===`value`)hostPatchProp(el,key,prev,next,namespace,parentComponent)}}}if(patchFlag&1){if(n1.children!==n2.children)hostSetElementText(el,n2.children)}}else if(!optimized&&dynamicChildren==null)patchProps(el,oldProps,newProps,parentComponent,namespace);if((vnodeHook=newProps.onVnodeUpdated)||dirs)queuePostRenderEffect(()=>{vnodeHook&&invokeVNodeHook(vnodeHook,parentComponent,n2,n1);dirs&&invokeDirectiveHook(n2,n1,parentComponent,`updated`)},parentSuspense)};const patchBlockChildren=(oldChildren,newChildren,fallbackContainer,parentComponent,parentSuspense,namespace,slotScopeIds)=>{for(let i=0;i<newChildren.length;i++){const oldVNode=oldChildren[i];const newVNode=newChildren[i];const oldEl=oldVNode.el||resolveAsyncComponentPlaceholder(oldVNode);const container=oldEl&&(oldVNode.type===Fragment||!isSameVNodeType(oldVNode,newVNode)||oldVNode.shapeFlag&198)?hostParentNode(oldEl):fallbackContainer;patch(oldVNode,newVNode,container,null,parentComponent,parentSuspense,namespace,slotScopeIds,true)}};const patchProps=(el,oldProps,newProps,parentComponent,namespace)=>{if(oldProps!==newProps){if(oldProps!==EMPTY_OBJ){for(const key in oldProps)if(!isReservedProp(key)&&!(key in newProps))hostPatchProp(el,key,oldProps[key],null,namespace,parentComponent)}for(const key in newProps){if(isReservedProp(key))continue;const next=newProps[key];const prev=oldProps[key];if(next!==prev&&key!==`value`)hostPatchProp(el,key,prev,next,namespace,parentComponent)}if(`value`in newProps)hostPatchProp(el,`value`,oldProps.value,newProps.value,namespace)}};const processFragment=(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)=>{const fragmentStartAnchor=n2.el=n1?n1.el:hostCreateText(``);const fragmentEndAnchor=n2.anchor=n1?n1.anchor:hostCreateText(``);let{patchFlag,dynamicChildren,slotScopeIds:fragmentSlotScopeIds}=n2;if(fragmentSlotScopeIds)slotScopeIds=slotScopeIds?slotScopeIds.concat(fragmentSlotScopeIds):fragmentSlotScopeIds;if(n1==null){hostInsert(fragmentStartAnchor,container,anchor);hostInsert(fragmentEndAnchor,container,anchor);mountChildren(n2.children||[],container,fragmentEndAnchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)}else if(patchFlag>0&&patchFlag&64&&dynamicChildren&&n1.dynamicChildren&&n1.dynamicChildren.length===dynamicChildren.length){patchBlockChildren(n1.dynamicChildren,dynamicChildren,container,parentComponent,parentSuspense,namespace,slotScopeIds);if(n2.key!=null||parentComponent&&n2===parentComponent.subTree)traverseStaticChildren(n1,n2,true)}else patchChildren(n1,n2,container,fragmentEndAnchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)};const processComponent=(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)=>{n2.slotScopeIds=slotScopeIds;if(n1==null){if(n2.shapeFlag&512)parentComponent.ctx.activate(n2,container,anchor,namespace,optimized);else mountComponent(n2,container,anchor,parentComponent,parentSuspense,namespace,optimized)}else updateComponent(n1,n2,optimized)};const mountComponent=(initialVNode,container,anchor,parentComponent,parentSuspense,namespace,optimized)=>{const instance=initialVNode.component=createComponentInstance(initialVNode,parentComponent,parentSuspense);if(isKeepAlive(initialVNode))instance.ctx.renderer=internals;setupComponent(instance,false,optimized);if(instance.asyncDep){parentSuspense&&parentSuspense.registerDep(instance,setupRenderEffect,optimized,namespace);if(!initialVNode.el){const placeholder=instance.subTree=createVNode(Comment);processCommentNode(null,placeholder,container,anchor);initialVNode.placeholder=placeholder.el}}else setupRenderEffect(instance,initialVNode,container,anchor,parentSuspense,namespace,optimized)};const updateComponent=(n1,n2,optimized)=>{const instance=n2.component=n1.component;if(shouldUpdateComponent(n1,n2,optimized)){if(instance.asyncDep&&!instance.asyncResolved){n2.el=n1.el;n2.placeholder=n1.placeholder;updateComponentPreRender(instance,n2,optimized);return}else{instance.next=n2;instance.update()}}else{n2.el=n1.el;n2.placeholder=n1.placeholder;instance.vnode=n2}};const setupRenderEffect=(instance,initialVNode,container,anchor,parentSuspense,namespace,optimized)=>{const componentUpdateFn=()=>{if(!instance.isMounted){let vnodeHook;const{el,props}=initialVNode;const{bm,m,parent,root,type}=instance;const isAsyncWrapperVNode=isAsyncWrapper(initialVNode);toggleRecurse(instance,false);if(bm)invokeArrayFns(bm);if(!isAsyncWrapperVNode&&(vnodeHook=props&&props.onVnodeBeforeMount))invokeVNodeHook(vnodeHook,parent,initialVNode);toggleRecurse(instance,true);if(el&&hydrateNode){const hydrateSubTree=()=>{instance.subTree=renderComponentRoot(instance);hydrateNode(el,instance.subTree,instance,parentSuspense,null)};if(isAsyncWrapperVNode&&type.__asyncHydrate)type.__asyncHydrate(el,instance,hydrateSubTree);else hydrateSubTree()}else{if(root.ce&&root.ce._hasShadowRoot())root.ce._injectChildStyle(type,instance.parent?instance.parent.type:void 0);const subTree=instance.subTree=renderComponentRoot(instance);patch(null,subTree,container,anchor,instance,parentSuspense,namespace);initialVNode.el=subTree.el}if(m)queuePostRenderEffect(m,parentSuspense);if(!isAsyncWrapperVNode&&(vnodeHook=props&&props.onVnodeMounted)){const scopedInitialVNode=initialVNode;queuePostRenderEffect(()=>invokeVNodeHook(vnodeHook,parent,scopedInitialVNode),parentSuspense)}if(initialVNode.shapeFlag&256||parent&&isAsyncWrapper(parent.vnode)&&parent.vnode.shapeFlag&256)instance.a&&queuePostRenderEffect(instance.a,parentSuspense);instance.isMounted=true;initialVNode=container=anchor=null}else{let{next,bu,u,parent,vnode}=instance;{const nonHydratedAsyncRoot=locateNonHydratedAsyncRoot(instance);if(nonHydratedAsyncRoot){if(next){next.el=vnode.el;updateComponentPreRender(instance,next,optimized)}nonHydratedAsyncRoot.asyncDep.then(()=>{queuePostRenderEffect(()=>{if(!instance.isUnmounted)update()},parentSuspense)});return}}let originNext=next;let vnodeHook;toggleRecurse(instance,false);if(next){next.el=vnode.el;updateComponentPreRender(instance,next,optimized)}else next=vnode;if(bu)invokeArrayFns(bu);if(vnodeHook=next.props&&next.props.onVnodeBeforeUpdate)invokeVNodeHook(vnodeHook,parent,next,vnode);toggleRecurse(instance,true);const nextTree=renderComponentRoot(instance);const prevTree=instance.subTree;instance.subTree=nextTree;patch(prevTree,nextTree,hostParentNode(prevTree.el),getNextHostNode(prevTree),instance,parentSuspense,namespace);next.el=nextTree.el;if(originNext===null)updateHOCHostEl(instance,nextTree.el);if(u)queuePostRenderEffect(u,parentSuspense);if(vnodeHook=next.props&&next.props.onVnodeUpdated)queuePostRenderEffect(()=>invokeVNodeHook(vnodeHook,parent,next,vnode),parentSuspense)}};instance.scope.on();const effect=instance.effect=new ReactiveEffect(componentUpdateFn);instance.scope.off();const update=instance.update=effect.run.bind(effect);const job=instance.job=effect.runIfDirty.bind(effect);job.i=instance;job.id=instance.uid;effect.scheduler=()=>queueJob(job);toggleRecurse(instance,true);update()};const updateComponentPreRender=(instance,nextVNode,optimized)=>{nextVNode.component=instance;const prevProps=instance.vnode.props;instance.vnode=nextVNode;instance.next=null;updateProps(instance,nextVNode.props,prevProps,optimized);updateSlots(instance,nextVNode.children,optimized);pauseTracking();flushPreFlushCbs(instance);resetTracking()};const patchChildren=(n1,n2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized=false)=>{const c1=n1&&n1.children;const prevShapeFlag=n1?n1.shapeFlag:0;const c2=n2.children;const{patchFlag,shapeFlag}=n2;if(patchFlag>0){if(patchFlag&128){patchKeyedChildren(c1,c2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);return}else if(patchFlag&256){patchUnkeyedChildren(c1,c2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);return}}if(shapeFlag&8){if(prevShapeFlag&16)unmountChildren(c1,parentComponent,parentSuspense);if(c2!==c1)hostSetElementText(container,c2)}else if(prevShapeFlag&16){if(shapeFlag&16)patchKeyedChildren(c1,c2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);else unmountChildren(c1,parentComponent,parentSuspense,true)}else{if(prevShapeFlag&8)hostSetElementText(container,``);if(shapeFlag&16)mountChildren(c2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)}};const patchUnkeyedChildren=(c1,c2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)=>{c1=c1||EMPTY_ARR;c2=c2||EMPTY_ARR;const oldLength=c1.length;const newLength=c2.length;const commonLength=Math.min(oldLength,newLength);let i=0;for(;i<commonLength;i++){const nextChild=c2[i]=optimized?cloneIfMounted(c2[i]):normalizeVNode(c2[i]);patch(c1[i],nextChild,container,null,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)}if(oldLength>newLength)unmountChildren(c1,parentComponent,parentSuspense,true,false,commonLength);else mountChildren(c2,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized,commonLength)};const patchKeyedChildren=(c1,c2,container,parentAnchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized)=>{let i=0;const l2=c2.length;let e1=c1.length-1;let e2=l2-1;while(i<=e1&&i<=e2){const n1=c1[i];const n2=c2[i]=optimized?cloneIfMounted(c2[i]):normalizeVNode(c2[i]);if(isSameVNodeType(n1,n2))patch(n1,n2,container,null,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);else break;i++}while(i<=e1&&i<=e2){const n1=c1[e1];const n2=c2[e2]=optimized?cloneIfMounted(c2[e2]):normalizeVNode(c2[e2]);if(isSameVNodeType(n1,n2))patch(n1,n2,container,null,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);else break;e1--;e2--}if(i>e1){if(i<=e2){const nextPos=e2+1;const anchor=nextPos<l2?c2[nextPos].el:parentAnchor;while(i<=e2){patch(null,c2[i]=optimized?cloneIfMounted(c2[i]):normalizeVNode(c2[i]),container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);i++}}}else if(i>e2)while(i<=e1){unmount(c1[i],parentComponent,parentSuspense,true);i++}else{const s1=i;const s2=i;const keyToNewIndexMap=new Map;for(i=s2;i<=e2;i++){const nextChild=c2[i]=optimized?cloneIfMounted(c2[i]):normalizeVNode(c2[i]);if(nextChild.key!=null)keyToNewIndexMap.set(nextChild.key,i)}let j;let patched=0;const toBePatched=e2-s2+1;let moved=false;let maxNewIndexSoFar=0;const newIndexToOldIndexMap=new Array(toBePatched);for(i=0;i<toBePatched;i++)newIndexToOldIndexMap[i]=0;for(i=s1;i<=e1;i++){const prevChild=c1[i];if(patched>=toBePatched){unmount(prevChild,parentComponent,parentSuspense,true);continue}let newIndex;if(prevChild.key!=null)newIndex=keyToNewIndexMap.get(prevChild.key);else for(j=s2;j<=e2;j++)if(newIndexToOldIndexMap[j-s2]===0&&isSameVNodeType(prevChild,c2[j])){newIndex=j;break}if(newIndex===void 0)unmount(prevChild,parentComponent,parentSuspense,true);else{newIndexToOldIndexMap[newIndex-s2]=i+1;if(newIndex>=maxNewIndexSoFar)maxNewIndexSoFar=newIndex;else moved=true;patch(prevChild,c2[newIndex],container,null,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);patched++}}const increasingNewIndexSequence=moved?getSequence(newIndexToOldIndexMap):EMPTY_ARR;j=increasingNewIndexSequence.length-1;for(i=toBePatched-1;i>=0;i--){const nextIndex=s2+i;const nextChild=c2[nextIndex];const anchorVNode=c2[nextIndex+1];const anchor=nextIndex+1<l2?anchorVNode.el||resolveAsyncComponentPlaceholder(anchorVNode):parentAnchor;if(newIndexToOldIndexMap[i]===0)patch(null,nextChild,container,anchor,parentComponent,parentSuspense,namespace,slotScopeIds,optimized);else if(moved){if(j<0||i!==increasingNewIndexSequence[j])move(nextChild,container,anchor,2);else j--}}}};const move=(vnode,container,anchor,moveType,parentSuspense=null)=>{const{el,type,transition,children,shapeFlag}=vnode;if(shapeFlag&6){move(vnode.component.subTree,container,anchor,moveType);return}if(shapeFlag&128){vnode.suspense.move(container,anchor,moveType);return}if(shapeFlag&64){type.move(vnode,container,anchor,internals);return}if(type===Fragment){hostInsert(el,container,anchor);for(let i=0;i<children.length;i++)move(children[i],container,anchor,moveType);hostInsert(vnode.anchor,container,anchor);return}if(type===Static){moveStaticNode(vnode,container,anchor);return}if(moveType!==2&&shapeFlag&1&&transition){if(moveType===0){if(transition.persisted&&!el[leaveCbKey])hostInsert(el,container,anchor);else{transition.beforeEnter(el);hostInsert(el,container,anchor);queuePostRenderEffect(()=>transition.enter(el),parentSuspense)}}else{const{leave,delayLeave,afterLeave}=transition;const remove2=()=>{if(vnode.ctx.isUnmounted)hostRemove(el);else hostInsert(el,container,anchor)};const performLeave=()=>{const wasLeaving=el._isLeaving||!!el[leaveCbKey];if(el._isLeaving)el[leaveCbKey](true);if(transition.persisted&&!wasLeaving)remove2();else leave(el,()=>{remove2();afterLeave&&afterLeave()})};if(delayLeave)delayLeave(el,remove2,performLeave);else performLeave()}}else hostInsert(el,container,anchor)};const unmount=(vnode,parentComponent,parentSuspense,doRemove=false,optimized=false)=>{const{type,props,ref,children,dynamicChildren,shapeFlag,patchFlag,dirs,cacheIndex,memo}=vnode;if(patchFlag===-2||dynamicChildren&&dynamicChildren.hasOnce)optimized=false;if(ref!=null){pauseTracking();setRef(ref,null,parentSuspense,vnode,true);resetTracking()}if(cacheIndex!=null&&(!vnode.ctx||vnode.ctx===parentComponent))parentComponent.renderCache[cacheIndex]=void 0;if(shapeFlag&256){parentComponent.ctx.deactivate(vnode);return}const shouldInvokeDirs=shapeFlag&1&&dirs;const shouldInvokeVnodeHook=!isAsyncWrapper(vnode);let vnodeHook;if(shouldInvokeVnodeHook&&(vnodeHook=props&&props.onVnodeBeforeUnmount))invokeVNodeHook(vnodeHook,parentComponent,vnode);if(shapeFlag&6)unmountComponent(vnode.component,parentSuspense,doRemove);else{if(shapeFlag&128){vnode.suspense.unmount(parentSuspense,doRemove);return}if(shouldInvokeDirs)invokeDirectiveHook(vnode,null,parentComponent,`beforeUnmount`);if(shapeFlag&64)vnode.type.remove(vnode,parentComponent,parentSuspense,internals,doRemove);else if(dynamicChildren&&!dynamicChildren.hasOnce&&(type!==Fragment||patchFlag>0&&patchFlag&64))unmountChildren(dynamicChildren,parentComponent,parentSuspense,false,true);else if(type===Fragment&&patchFlag&384||!optimized&&shapeFlag&16)unmountChildren(children,parentComponent,parentSuspense);if(doRemove)remove(vnode)}const shouldInvalidateMemo=memo!=null&&cacheIndex==null;if(shouldInvokeVnodeHook&&(vnodeHook=props&&props.onVnodeUnmounted)||shouldInvokeDirs||shouldInvalidateMemo)queuePostRenderEffect(()=>{vnodeHook&&invokeVNodeHook(vnodeHook,parentComponent,vnode);shouldInvokeDirs&&invokeDirectiveHook(vnode,null,parentComponent,`unmounted`);if(shouldInvalidateMemo)vnode.el=null},parentSuspense)};const remove=vnode=>{const{type,el,anchor,transition}=vnode;const isFragment=type===Fragment;if(isFragment&&!transition){removeFragment(el,anchor);return}if(type===Static){removeStaticNode(vnode);if(transition&&!transition.persisted&&transition.afterLeave)transition.afterLeave();return}const leavingNode=isFragment?getTransitionRoot(vnode):vnode;const performRemove=()=>{if(isFragment){if(hostParentNode(el))removeFragment(el,anchor)}else hostRemove(el);if(transition&&!transition.persisted&&transition.afterLeave)transition.afterLeave()};if(leavingNode&&leavingNode.shapeFlag&1&&transition&&!transition.persisted){const{leave,delayLeave}=transition;const leavingEl=leavingNode.el;const performLeave=()=>leave(leavingEl,performRemove);if(delayLeave)delayLeave(leavingEl,performRemove,performLeave);else performLeave()}else performRemove()};const removeFragment=(cur,end)=>{let next;while(cur!==end){next=hostNextSibling(cur);hostRemove(cur);cur=next}hostRemove(end)};const unmountComponent=(instance,parentSuspense,doRemove)=>{const{bum,scope,job,subTree,um,m,a}=instance;invalidateMount(m);invalidateMount(a);if(bum)invokeArrayFns(bum);scope.stop();if(job){job.flags|=8;unmount(subTree,instance,parentSuspense,doRemove)}else if(instance.vnode.el&&subTree){subTree.transition=instance.vnode.transition;unmount(subTree,instance,parentSuspense,doRemove)}if(um)queuePostRenderEffect(um,parentSuspense);queuePostRenderEffect(()=>{instance.isUnmounted=true},parentSuspense)};const unmountChildren=(children,parentComponent,parentSuspense,doRemove=false,optimized=false,start=0)=>{for(let i=start;i<children.length;i++)unmount(children[i],parentComponent,parentSuspense,doRemove,optimized)};const getNextHostNode=vnode=>{if(vnode.shapeFlag&6)return getNextHostNode(vnode.component.subTree);if(vnode.shapeFlag&128)return vnode.suspense.next();const el=hostNextSibling(vnode.anchor||vnode.el);const teleportEnd=el&&el[TeleportEndKey];return teleportEnd?hostNextSibling(teleportEnd):el};const render=(vnode,container,namespace)=>{flushOnAppMount(()=>{if(vnode==null){if(container._vnode)unmount(container._vnode,null,null,true)}else patch(container._vnode||null,vnode,container,null,null,null,namespace);container._vnode=vnode},vnode&&container._vnode?void 0:vnode&&vnode.component?vnode.component.uid:getNextUid())};const internals={p:patch,um:unmount,m:move,r:remove,mt:mountComponent,mc:mountChildren,pc:patchChildren,pbc:patchBlockChildren,n:getNextHostNode,o:options};let hydrate;let hydrateNode;if(createHydrationFns)[hydrate,hydrateNode]=createHydrationFns(internals);return{render,hydrate,createApp:createAppAPI(render,hydrate)}}function resolveChildrenNamespace({type,props},currentNamespace){return currentNamespace===`svg`&&type===`foreignObject`||currentNamespace===`mathml`&&type===`annotation-xml`&&props&&props.encoding&&props.encoding.includes(`html`)?void 0:currentNamespace}function toggleRecurse({effect,job},allowed){if(allowed){effect.flags|=32;job.flags|=4}else{effect.flags&=-33;job.flags&=-5}}function needTransition(parentSuspense,transition){return(!parentSuspense||parentSuspense&&!parentSuspense.pendingBranch)&&transition&&!transition.persisted}function traverseStaticChildren(n1,n2,shallow=false){const ch1=n1.children;const ch2=n2.children;if(isArray$2(ch1)&&isArray$2(ch2))for(let i=0;i<ch1.length;i++){const c1=ch1[i];let c2=ch2[i];if(c2.shapeFlag&1&&!c2.dynamicChildren){if(c2.patchFlag<=0||c2.patchFlag===32){c2=ch2[i]=cloneIfMounted(ch2[i]);c2.el=c1.el}if(!shallow&&c2.patchFlag!==-2)traverseStaticChildren(c1,c2)}if(c2.type===Text){if(c2.patchFlag===-1)c2=ch2[i]=cloneIfMounted(c2);c2.el=c1.el}if(c2.type===Comment&&!c2.el)c2.el=c1.el}}function getSequence(arr){const p=arr.slice();const result=[0];let i,j,u,v,c;const len=arr.length;for(i=0;i<len;i++){const arrI=arr[i];if(arrI!==0){j=result[result.length-1];if(arr[j]<arrI){p[i]=j;result.push(i);continue}u=0;v=result.length-1;while(u<v){c=u+v>>1;if(arr[result[c]]<arrI)u=c+1;else v=c}if(arrI<arr[result[u]]){if(u>0)p[i]=result[u-1];result[u]=i}}}u=result.length;v=result[u-1];while(u-->0){result[u]=v;v=p[v]}return result}function locateNonHydratedAsyncRoot(instance){const subComponent=instance.subTree.component;if(subComponent){if(subComponent.asyncDep&&!subComponent.asyncResolved)return subComponent;else return locateNonHydratedAsyncRoot(subComponent)}}function invalidateMount(hooks){if(hooks)for(let i=0;i<hooks.length;i++)hooks[i].flags|=8}function resolveAsyncComponentPlaceholder(anchorVnode){if(anchorVnode.placeholder)return anchorVnode.placeholder;const instance=anchorVnode.component;if(instance)return resolveAsyncComponentPlaceholder(instance.subTree);return null}var isSuspense=type=>type.__isSuspense;function queueEffectWithSuspense(fn,suspense){if(suspense&&suspense.pendingBranch){if(isArray$2(fn))suspense.effects.push(...fn);else suspense.effects.push(fn)}else queuePostFlushCb(fn)}var Fragment=Symbol.for(`v-fgt`);var Text=Symbol.for(`v-txt`);var Comment=Symbol.for(`v-cmt`);var Static=Symbol.for(`v-stc`);var blockStack=[];var currentBlock=null;function openBlock(disableTracking=false){blockStack.push(currentBlock=disableTracking?null:[])}function closeBlock(){blockStack.pop();currentBlock=blockStack[blockStack.length-1]||null}var isBlockTreeEnabled=1;function setBlockTracking(value,inVOnce=false){isBlockTreeEnabled+=value;if(value<0&¤tBlock&&inVOnce)currentBlock.hasOnce=true}function setupBlock(vnode){vnode.dynamicChildren=isBlockTreeEnabled>0?currentBlock||EMPTY_ARR:null;closeBlock();if(isBlockTreeEnabled>0&¤tBlock)currentBlock.push(vnode);return vnode}function createElementBlock(type,props,children,patchFlag,dynamicProps,shapeFlag){return setupBlock(createBaseVNode(type,props,children,patchFlag,dynamicProps,shapeFlag,true))}function createBlock(type,props,children,patchFlag,dynamicProps){return setupBlock(createVNode(type,props,children,patchFlag,dynamicProps,true))}function isVNode(value){return value?value.__v_isVNode===true:false}function isSameVNodeType(n1,n2){return n1.type===n2.type&&n1.key===n2.key}var normalizeKey=({key})=>key!=null?key:null;var normalizeRef=({ref,ref_key,ref_for})=>{if(typeof ref===`number`)ref=``+ref;return ref!=null?isString$1(ref)||isRef(ref)||isFunction$2(ref)?{i:currentRenderingInstance,r:ref,k:ref_key,f:!!ref_for}:ref:null};function createBaseVNode(type,props=null,children=null,patchFlag=0,dynamicProps=null,shapeFlag=type===Fragment?0:1,isBlockNode=false,needFullChildrenNormalization=false){const vnode={__v_isVNode:true,__v_skip:true,type,props,key:props&&normalizeKey(props),ref:props&&normalizeRef(props),scopeId:currentScopeId,slotScopeIds:null,children,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag,patchFlag,dynamicProps,dynamicChildren:null,appContext:null,ctx:currentRenderingInstance};if(needFullChildrenNormalization){normalizeChildren(vnode,children);if(shapeFlag&128)type.normalize(vnode)}else if(children)vnode.shapeFlag|=isString$1(children)?8:16;if(isBlockTreeEnabled>0&&!isBlockNode&¤tBlock&&(vnode.patchFlag>0||shapeFlag&6)&&vnode.patchFlag!==32)currentBlock.push(vnode);return vnode}var createVNode=_createVNode;function _createVNode(type,props=null,children=null,patchFlag=0,dynamicProps=null,isBlockNode=false){if(!type||type===NULL_DYNAMIC_COMPONENT)type=Comment;if(isVNode(type)){const cloned=cloneVNode(type,props,true);if(children)normalizeChildren(cloned,children);if(isBlockTreeEnabled>0&&!isBlockNode&¤tBlock){if(cloned.shapeFlag&6)currentBlock[currentBlock.indexOf(type)]=cloned;else currentBlock.push(cloned)}cloned.patchFlag=-2;return cloned}if(isClassComponent(type))type=type.__vccOpts;if(props){props=guardReactiveProps(props);let{class:klass,style}=props;if(klass&&!isString$1(klass))props.class=normalizeClass(klass);if(isObject$2(style)){if(isProxy(style)&&!isArray$2(style))style=extend({},style);props.style=normalizeStyle(style)}}const shapeFlag=isString$1(type)?1:isSuspense(type)?128:isTeleport(type)?64:isObject$2(type)?4:isFunction$2(type)?2:0;return createBaseVNode(type,props,children,patchFlag,dynamicProps,shapeFlag,isBlockNode,true)}function guardReactiveProps(props){if(!props)return null;return isProxy(props)||isInternalObject(props)?extend({},props):props}function cloneVNode(vnode,extraProps,mergeRef=false,cloneTransition=false){const{props,ref,patchFlag,children,transition}=vnode;const mergedProps=extraProps?mergeProps(props||{},extraProps):props;const cloned={__v_isVNode:true,__v_skip:true,type:vnode.type,props:mergedProps,key:mergedProps&&normalizeKey(mergedProps),ref:extraProps&&extraProps.ref?mergeRef&&ref?isArray$2(ref)?ref.concat(normalizeRef(extraProps)):[ref,normalizeRef(extraProps)]:normalizeRef(extraProps):ref,scopeId:vnode.scopeId,slotScopeIds:vnode.slotScopeIds,children,target:vnode.target,targetStart:vnode.targetStart,targetAnchor:vnode.targetAnchor,staticCount:vnode.staticCount,shapeFlag:vnode.shapeFlag,patchFlag:extraProps&&vnode.type!==Fragment?patchFlag===-1?16:patchFlag|16:patchFlag,dynamicProps:vnode.dynamicProps,dynamicChildren:vnode.dynamicChildren,appContext:vnode.appContext,dirs:vnode.dirs,transition,component:vnode.component,suspense:vnode.suspense,ssContent:vnode.ssContent&&cloneVNode(vnode.ssContent),ssFallback:vnode.ssFallback&&cloneVNode(vnode.ssFallback),placeholder:vnode.placeholder,el:vnode.el,anchor:vnode.anchor,ctx:vnode.ctx,ce:vnode.ce,cacheIndex:vnode.cacheIndex};if(transition&&cloneTransition)setTransitionHooks(cloned,transition.clone(cloned));return cloned}function createTextVNode(text=` `,flag=0){return createVNode(Text,null,text,flag)}function createStaticVNode(content,numberOfNodes){const vnode=createVNode(Static,null,content);vnode.staticCount=numberOfNodes;return vnode}function createCommentVNode(text=``,asBlock=false){return asBlock?(openBlock(),createBlock(Comment,null,text)):createVNode(Comment,null,text)}function normalizeVNode(child){if(child==null||typeof child===`boolean`)return createVNode(Comment);else if(isArray$2(child))return createVNode(Fragment,null,child.slice());else if(isVNode(child))return cloneIfMounted(child);else return createVNode(Text,null,String(child))}function cloneIfMounted(child){return child.el===null&&child.patchFlag!==-1||child.memo?child:cloneVNode(child)}function normalizeChildren(vnode,children){let type=0;const{shapeFlag}=vnode;if(children==null)children=null;else if(isArray$2(children))type=16;else if(typeof children===`object`){if(shapeFlag&65){const slot=children.default;if(slot){slot._c&&(slot._d=false);normalizeChildren(vnode,slot());slot._c&&(slot._d=true)}return}else{type=32;const slotFlag=children._;if(!slotFlag&&!isInternalObject(children))children._ctx=currentRenderingInstance;else if(slotFlag===3&¤tRenderingInstance){if(currentRenderingInstance.slots._===1)children._=1;else{children._=2;vnode.patchFlag|=1024}}}}else if(isFunction$2(children)){if(shapeFlag&65){normalizeChildren(vnode,{default:children});return}children={default:children,_ctx:currentRenderingInstance};type=32}else{children=String(children);if(shapeFlag&64){type=16;children=[createTextVNode(children)]}else type=8}vnode.children=children;vnode.shapeFlag|=type}function mergeProps(...args){const ret={};for(let i=0;i<args.length;i++){const toMerge=args[i];for(const key in toMerge)if(key===`class`){if(ret.class!==toMerge.class)ret.class=normalizeClass([ret.class,toMerge.class])}else if(key===`style`)ret.style=normalizeStyle([ret.style,toMerge.style]);else if(isOn$1(key)){const existing=ret[key];const incoming=toMerge[key];if(incoming&&existing!==incoming&&!(isArray$2(existing)&&existing.includes(incoming)))ret[key]=existing?[].concat(existing,incoming):incoming;else if(incoming==null&&existing==null&&!isModelListener(key))ret[key]=incoming}else if(key!==``)ret[key]=toMerge[key]}return ret}function invokeVNodeHook(hook,instance,vnode,prevVNode=null){callWithAsyncErrorHandling(hook,instance,7,[vnode,prevVNode])}var emptyAppContext=createAppContext();var uid=0;function getNextUid(){return uid}function createComponentInstance(vnode,parent,suspense){const type=vnode.type;const appContext=(parent?parent.appContext:vnode.appContext)||emptyAppContext;const instance={uid:uid++,vnode,type,parent,appContext,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new EffectScope(true),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:parent?parent.provides:Object.create(appContext.provides),ids:parent?parent.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:normalizePropsOptions(type,appContext),emitsOptions:normalizeEmitsOptions(type,appContext),emit:null,emitted:null,propsDefaults:EMPTY_OBJ,inheritAttrs:type.inheritAttrs,ctx:EMPTY_OBJ,data:EMPTY_OBJ,props:EMPTY_OBJ,attrs:EMPTY_OBJ,slots:EMPTY_OBJ,refs:EMPTY_OBJ,setupState:EMPTY_OBJ,setupContext:null,suspense,suspenseId:suspense?suspense.pendingId:0,asyncDep:null,asyncResolved:false,isMounted:false,isUnmounted:false,isDeactivated:false,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};instance.ctx={_:instance};instance.root=parent?parent.root:instance;instance.emit=emit.bind(null,instance);if(vnode.ce)vnode.ce(instance);return instance}var currentInstance=null;var getCurrentInstance$1=()=>currentInstance||currentRenderingInstance;var internalSetCurrentInstance;var setInSSRSetupState;{const g=getGlobalThis();const registerGlobalSetter=(key,setter)=>{let setters;if(!(setters=g[key]))setters=g[key]=[];setters.push(setter);return v=>{if(setters.length>1)setters.forEach(set=>set(v));else setters[0](v)}};internalSetCurrentInstance=registerGlobalSetter(`__VUE_INSTANCE_SETTERS__`,v=>currentInstance=v);setInSSRSetupState=registerGlobalSetter(`__VUE_SSR_SETTERS__`,v=>isInSSRComponentSetup=v)}var setCurrentInstance=instance=>{const prev=currentInstance;internalSetCurrentInstance(instance);instance.scope.on();return()=>{instance.scope.off();internalSetCurrentInstance(prev)}};var unsetCurrentInstance=()=>{currentInstance&¤tInstance.scope.off();internalSetCurrentInstance(null)};function isStatefulComponent(instance){return instance.vnode.shapeFlag&4}var isInSSRComponentSetup=false;function setupComponent(instance,isSSR=false,optimized=false){isSSR&&setInSSRSetupState(isSSR);const{props,children}=instance.vnode;const isStateful=isStatefulComponent(instance);initProps(instance,props,isStateful,isSSR);initSlots(instance,children,optimized||isSSR);const setupResult=isStateful?setupStatefulComponent(instance,isSSR):void 0;isSSR&&setInSSRSetupState(false);return setupResult}function setupStatefulComponent(instance,isSSR){const Component=instance.type;instance.accessCache=Object.create(null);instance.proxy=new Proxy(instance.ctx,PublicInstanceProxyHandlers);const{setup}=Component;if(setup){pauseTracking();const setupContext=instance.setupContext=setup.length>1?createSetupContext(instance):null;const reset=setCurrentInstance(instance);const setupResult=callWithErrorHandling(setup,instance,0,[instance.props,setupContext]);const isAsyncSetup=isPromise(setupResult);resetTracking();reset();if((isAsyncSetup||instance.sp)&&!isAsyncWrapper(instance))markAsyncBoundary(instance);if(isAsyncSetup){setupResult.then(unsetCurrentInstance,unsetCurrentInstance);if(isSSR)return setupResult.then(resolvedResult=>{setInSSRSetupState(true);try{handleSetupResult(instance,resolvedResult,isSSR)}finally{setInSSRSetupState(false)}}).catch(e=>{handleError(e,instance,0)});else instance.asyncDep=setupResult}else handleSetupResult(instance,setupResult,isSSR)}else finishComponentSetup(instance,isSSR)}function handleSetupResult(instance,setupResult,isSSR){if(isFunction$2(setupResult)){if(instance.type.__ssrInlineRender)instance.ssrRender=setupResult;else instance.render=setupResult}else if(isObject$2(setupResult))instance.setupState=proxyRefs(setupResult);finishComponentSetup(instance,isSSR)}var compile;var installWithProxy;function finishComponentSetup(instance,isSSR,skipOptions){const Component=instance.type;if(!instance.render){if(!isSSR&&compile&&!Component.render){const template=Component.template||resolveMergedOptions(instance).template;if(template){const{isCustomElement,compilerOptions}=instance.appContext.config;const{delimiters,compilerOptions:componentCompilerOptions}=Component;const finalCompilerOptions=extend(extend({isCustomElement,delimiters},compilerOptions),componentCompilerOptions);Component.render=compile(template,finalCompilerOptions)}}instance.render=Component.render||NOOP;if(installWithProxy)installWithProxy(instance)}{const reset=setCurrentInstance(instance);pauseTracking();try{applyOptions(instance)}finally{resetTracking();reset()}}}var attrsProxyHandlers={get(target,key){track(target,`get`,``);return target[key]}};function createSetupContext(instance){const expose=exposed=>{instance.exposed=exposed||{}};return{attrs:new Proxy(instance.attrs,attrsProxyHandlers),slots:instance.slots,emit:instance.emit,expose}}function getComponentPublicInstance(instance){if(instance.exposed)return instance.exposeProxy||(instance.exposeProxy=new Proxy(proxyRefs(markRaw(instance.exposed)),{get(target,key){if(key in target)return target[key];else if(key in publicPropertiesMap)return publicPropertiesMap[key](instance)},has(target,key){return key in target||key in publicPropertiesMap}}));else return instance.proxy}function getComponentName(Component,includeInferred=true){return isFunction$2(Component)?Component.displayName||Component.name:Component.name||includeInferred&&Component.__name}function isClassComponent(value){return isFunction$2(value)&&`__vccOpts`in value}var computed=(getterOrOptions,debugOptions)=>{return computed$1(getterOrOptions,debugOptions,isInSSRComponentSetup)};function h$1(type,propsOrChildren,children){try{setBlockTracking(-1);const l=arguments.length;if(l===2){if(isObject$2(propsOrChildren)&&!isArray$2(propsOrChildren)){if(isVNode(propsOrChildren))return createVNode(type,null,[propsOrChildren]);return createVNode(type,propsOrChildren)}else return createVNode(type,null,propsOrChildren)}else{if(l>3)children=Array.prototype.slice.call(arguments,2);else if(l===3&&isVNode(children))children=[children];return createVNode(type,propsOrChildren,children)}}finally{setBlockTracking(1)}}function isMemoSame(cached,memo){const prev=cached.memo;if(prev.length!=memo.length)return false;for(let i=0;i<prev.length;i++)if(hasChanged(prev[i],memo[i]))return false;if(isBlockTreeEnabled>0&¤tBlock)currentBlock.push(cached);return true}var version$1=`3.5.44`;var warn=NOOP;var policy=void 0;var tt$1=typeof window!==`undefined`&&window.trustedTypes;if(tt$1)try{policy=tt$1.createPolicy(`vue`,{createHTML:val=>val})}catch(e){}var unsafeToTrustedHTML=policy?val=>policy.createHTML(val):val=>val;var svgNS=`http://www.w3.org/2000/svg`;var mathmlNS=`http://www.w3.org/1998/Math/MathML`;var doc=typeof document!==`undefined`?document:null;var templateContainer=doc&&doc.createElement(`template`);var nodeOps={insert:(child,parent,anchor)=>{parent.insertBefore(child,anchor||null)},remove:child=>{const parent=child.parentNode;if(parent)parent.removeChild(child)},createElement:(tag,namespace,is,props)=>{const el=namespace===`svg`?doc.createElementNS(svgNS,tag):namespace===`mathml`?doc.createElementNS(mathmlNS,tag):is?doc.createElement(tag,{is}):doc.createElement(tag);if(tag===`select`&&props&&props.multiple!=null)el.setAttribute(`multiple`,props.multiple);return el},createText:text=>doc.createTextNode(text),createComment:text=>doc.createComment(text),setText:(node,text)=>{node.nodeValue=text},setElementText:(el,text)=>{el.textContent=text},parentNode:node=>node.parentNode,nextSibling:node=>node.nextSibling,querySelector:selector=>doc.querySelector(selector),setScopeId(el,id){el.setAttribute(id,``)},insertStaticContent(content,parent,anchor,namespace,start,end){const before=anchor?anchor.previousSibling:parent.lastChild;if(start&&(start===end||start.nextSibling))while(true){parent.insertBefore(start.cloneNode(true),anchor);if(start===end||!(start=start.nextSibling))break}else{templateContainer.innerHTML=unsafeToTrustedHTML(namespace===`svg`?`<svg>${content}</svg>`:namespace===`mathml`?`<math>${content}</math>`:content);const template=templateContainer.content;if(namespace===`svg`||namespace===`mathml`){const wrapper=template.firstChild;while(wrapper.firstChild)template.appendChild(wrapper.firstChild);template.removeChild(wrapper)}parent.insertBefore(template,anchor)}return[before?before.nextSibling:parent.firstChild,anchor?anchor.previousSibling:parent.lastChild]}};var TRANSITION=`transition`;var ANIMATION=`animation`;var vtcKey=Symbol(`_vtc`);var DOMTransitionPropsValidators={name:String,type:String,css:{type:Boolean,default:true},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};var TransitionPropsValidators=extend({},BaseTransitionPropsValidators,DOMTransitionPropsValidators);var decorate$1=t=>{t.displayName=`Transition`;t.props=TransitionPropsValidators;return t};var Transition=decorate$1((props,{slots})=>h$1(BaseTransition,resolveTransitionProps(props),slots));var callHook=(hook,args=[])=>{if(isArray$2(hook))hook.forEach(h2=>h2(...args));else if(hook)hook(...args)};var hasExplicitCallback=hook=>{return hook?isArray$2(hook)?hook.some(h2=>h2.length>1):hook.length>1:false};function resolveTransitionProps(rawProps){const baseProps={};for(const key in rawProps)if(!(key in DOMTransitionPropsValidators))baseProps[key]=rawProps[key];if(rawProps.css===false)return baseProps;const{name=`v`,type,duration,enterFromClass=`${name}-enter-from`,enterActiveClass=`${name}-enter-active`,enterToClass=`${name}-enter-to`,appearFromClass=enterFromClass,appearActiveClass=enterActiveClass,appearToClass=enterToClass,leaveFromClass=`${name}-leave-from`,leaveActiveClass=`${name}-leave-active`,leaveToClass=`${name}-leave-to`}=rawProps;const durations=normalizeDuration(duration);const enterDuration=durations&&durations[0];const leaveDuration=durations&&durations[1];const{onBeforeEnter,onEnter,onEnterCancelled,onLeave,onLeaveCancelled,onBeforeAppear=onBeforeEnter,onAppear=onEnter,onAppearCancelled=onEnterCancelled}=baseProps;const finishEnter=(el,isAppear,done,isCancelled)=>{el._enterCancelled=isCancelled;removeTransitionClass(el,isAppear?appearToClass:enterToClass);removeTransitionClass(el,isAppear?appearActiveClass:enterActiveClass);done&&done()};const finishLeave=(el,done)=>{el._isLeaving=false;removeTransitionClass(el,leaveFromClass);removeTransitionClass(el,leaveToClass);removeTransitionClass(el,leaveActiveClass);done&&done()};const makeEnterHook=isAppear=>{return(el,done)=>{const hook=isAppear?onAppear:onEnter;const resolve=()=>finishEnter(el,isAppear,done);callHook(hook,[el,resolve]);nextFrame(()=>{removeTransitionClass(el,isAppear?appearFromClass:enterFromClass);addTransitionClass(el,isAppear?appearToClass:enterToClass);if(!hasExplicitCallback(hook))whenTransitionEnds(el,type,enterDuration,resolve)})}};return extend(baseProps,{onBeforeEnter(el){callHook(onBeforeEnter,[el]);addTransitionClass(el,enterFromClass);addTransitionClass(el,enterActiveClass)},onBeforeAppear(el){callHook(onBeforeAppear,[el]);addTransitionClass(el,appearFromClass);addTransitionClass(el,appearActiveClass)},onEnter:makeEnterHook(false),onAppear:makeEnterHook(true),onLeave(el,done){el._isLeaving=true;const resolve=()=>finishLeave(el,done);addTransitionClass(el,leaveFromClass);if(!el._enterCancelled){forceReflow(el);addTransitionClass(el,leaveActiveClass)}else{addTransitionClass(el,leaveActiveClass);forceReflow(el)}nextFrame(()=>{if(!el._isLeaving)return;removeTransitionClass(el,leaveFromClass);addTransitionClass(el,leaveToClass);if(!hasExplicitCallback(onLeave))whenTransitionEnds(el,type,leaveDuration,resolve)});callHook(onLeave,[el,resolve])},onEnterCancelled(el){finishEnter(el,false,void 0,true);callHook(onEnterCancelled,[el])},onAppearCancelled(el){finishEnter(el,true,void 0,true);callHook(onAppearCancelled,[el])},onLeaveCancelled(el){finishLeave(el);callHook(onLeaveCancelled,[el])}})}function normalizeDuration(duration){if(duration==null)return null;else if(isObject$2(duration))return[NumberOf(duration.enter),NumberOf(duration.leave)];else{const n=NumberOf(duration);return[n,n]}}function NumberOf(val){return toNumber(val)}function addTransitionClass(el,cls){cls.split(/\s+/).forEach(c=>c&&el.classList.add(c));(el[vtcKey]||(el[vtcKey]=new Set)).add(cls)}function removeTransitionClass(el,cls){cls.split(/\s+/).forEach(c=>c&&el.classList.remove(c));const _vtc=el[vtcKey];if(_vtc){_vtc.delete(cls);if(!_vtc.size)el[vtcKey]=void 0}}function nextFrame(cb){requestAnimationFrame(()=>{requestAnimationFrame(cb)})}var endId=0;function whenTransitionEnds(el,expectedType,explicitTimeout,resolve){const id=el._endId=++endId;const resolveIfNotStale=()=>{if(id===el._endId)resolve()};if(explicitTimeout!=null)return setTimeout(resolveIfNotStale,explicitTimeout);const{type,timeout,propCount}=getTransitionInfo(el,expectedType);if(!type)return resolve();const endEvent=type+`end`;let ended=0;const end=()=>{el.removeEventListener(endEvent,onEnd);resolveIfNotStale()};const onEnd=e=>{if(e.target===el&&++ended>=propCount)end()};setTimeout(()=>{if(ended<propCount)end()},timeout+1);el.addEventListener(endEvent,onEnd)}function getTransitionInfo(el,expectedType){const styles=window.getComputedStyle(el);const getStyleProperties=key=>(styles[key]||``).split(`, `);const transitionDelays=getStyleProperties(`${TRANSITION}Delay`);const transitionDurations=getStyleProperties(`${TRANSITION}Duration`);const transitionTimeout=getTimeout(transitionDelays,transitionDurations);const animationDelays=getStyleProperties(`${ANIMATION}Delay`);const animationDurations=getStyleProperties(`${ANIMATION}Duration`);const animationTimeout=getTimeout(animationDelays,animationDurations);let type=null;let timeout=0;let propCount=0;if(expectedType===TRANSITION){if(transitionTimeout>0){type=TRANSITION;timeout=transitionTimeout;propCount=transitionDurations.length}}else if(expectedType===ANIMATION){if(animationTimeout>0){type=ANIMATION;timeout=animationTimeout;propCount=animationDurations.length}}else{timeout=Math.max(transitionTimeout,animationTimeout);type=timeout>0?transitionTimeout>animationTimeout?TRANSITION:ANIMATION:null;propCount=type?type===TRANSITION?transitionDurations.length:animationDurations.length:0}const hasTransform=type===TRANSITION&&/\b(?:transform|all)(?:,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());return{type,timeout,propCount,hasTransform}}function getTimeout(delays,durations){while(delays.length<durations.length)delays=delays.concat(delays);return Math.max(...durations.map((d,i)=>toMs(d)+toMs(delays[i])))}function toMs(s){if(s===`auto`)return 0;return Number(s.slice(0,-1).replace(`,`,`.`))*1e3}function forceReflow(el){return(el?el.ownerDocument:document).body.offsetHeight}function patchClass(el,value,isSVG){const transitionClasses=el[vtcKey];if(transitionClasses)value=(value?[value,...transitionClasses]:[...transitionClasses]).join(` `);if(value==null)el.removeAttribute(`class`);else if(isSVG)el.setAttribute(`class`,value);else el.className=value}var vShowOriginalDisplay=Symbol(`_vod`);var vShowHidden=Symbol(`_vsh`);var vShow={name:`show`,beforeMount(el,{value},{transition}){el[vShowOriginalDisplay]=el.style.display===`none`?``:el.style.display;if(transition&&value)transition.beforeEnter(el);else setDisplay(el,value)},mounted(el,{value},{transition}){if(transition&&value)transition.enter(el)},updated(el,{value,oldValue},{transition}){if(!value===!oldValue)return;if(transition){if(value){transition.beforeEnter(el);setDisplay(el,true);transition.enter(el)}else transition.leave(el,()=>{setDisplay(el,false)})}else setDisplay(el,value)},beforeUnmount(el,{value}){setDisplay(el,value)}};function setDisplay(el,value){el.style.display=value?el[vShowOriginalDisplay]:`none`;el[vShowHidden]=!value}var CSS_VAR_TEXT=Symbol(``);function useCssVars(getter){const instance=getCurrentInstance$1();if(!instance)return;const updateTeleports=instance.ut=(vars=getter(instance.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach(node=>setVarsOnNode(node,vars))};const setVars=()=>{const vars=getter(instance.proxy);if(instance.ce)setVarsOnNode(instance.ce,vars);else setVarsOnVNode(instance.subTree,vars);updateTeleports(vars)};onBeforeUpdate(()=>{queuePostFlushCb(setVars)});onMounted(()=>{watch(setVars,NOOP,{flush:`post`});const ob=new MutationObserver(setVars);ob.observe(instance.subTree.el.parentNode,{childList:true});onUnmounted(()=>ob.disconnect())})}function setVarsOnVNode(vnode,vars){if(vnode.shapeFlag&128){const suspense=vnode.suspense;vnode=suspense.activeBranch;if(suspense.pendingBranch&&!suspense.isHydrating)suspense.effects.push(()=>{setVarsOnVNode(suspense.activeBranch,vars)})}while(vnode.component)vnode=vnode.component.subTree;if(vnode.shapeFlag&1&&vnode.el)setVarsOnNode(vnode.el,vars);else if(vnode.type===Fragment)vnode.children.forEach(c=>setVarsOnVNode(c,vars));else if(vnode.type===Static){let{el,anchor}=vnode;while(el){setVarsOnNode(el,vars);if(el===anchor)break;el=el.nextSibling}}}function setVarsOnNode(el,vars){if(el.nodeType===1){const style=el.style;let cssText=``;for(const key in vars){const value=normalizeCssVarValue(vars[key]);style.setProperty(`--${key}`,value);cssText+=`--${key}: ${value};`}style[CSS_VAR_TEXT]=cssText}}var displayRE=/(?:^|;)\s*display\s*:/;function patchStyle(el,prev,next){const style=el.style;const isCssString=isString$1(next);let hasControlledDisplay=false;if(next&&!isCssString){if(prev){if(!isString$1(prev)){for(const key in prev)if(next[key]==null)setStyle(style,key,``)}else for(const prevStyle of prev.split(`;`)){const key=prevStyle.slice(0,prevStyle.indexOf(`:`)).trim();if(next[key]==null)setStyle(style,key,``)}}for(const key in next){if(key===`display`)hasControlledDisplay=true;const value=next[key];if(value!=null){if(!shouldPreserveTextareaResizeStyle(el,key,!isString$1(prev)&&prev?prev[key]:void 0,value))setStyle(style,key,value)}else setStyle(style,key,``)}}else if(isCssString){if(prev!==next){const cssVarText=style[CSS_VAR_TEXT];if(cssVarText)next+=`;`+cssVarText;style.cssText=next;hasControlledDisplay=displayRE.test(next)}}else if(prev)el.removeAttribute(`style`);if(vShowOriginalDisplay in el){if(!isCssString||prev!==next)el[vShowOriginalDisplay]=hasControlledDisplay?style.display:``;if(el[vShowHidden])style.display=`none`}}var importantRE=/\s*!important$/;function setStyle(style,name,val){if(isArray$2(val))val.forEach(v=>setStyle(style,name,v));else{if(val==null)val=``;if(name.startsWith(`--`)){if(importantRE.test(val))style.setProperty(name,val.replace(importantRE,``),`important`);else style.setProperty(name,val)}else{const prefixed=autoPrefix(style,name);if(importantRE.test(val))style.setProperty(hyphenate(prefixed),val.replace(importantRE,``),`important`);else style[prefixed]=val}}}var prefixes=[`Webkit`,`Moz`,`ms`];var prefixCache={};function autoPrefix(style,rawName){const cached=prefixCache[rawName];if(cached)return cached;let name=camelize(rawName);if(name!==`filter`&&name in style)return prefixCache[rawName]=name;name=capitalize(name);for(let i=0;i<prefixes.length;i++){const prefixed=prefixes[i]+name;if(prefixed in style)return prefixCache[rawName]=prefixed}return rawName}function shouldPreserveTextareaResizeStyle(el,key,prev,next){return el.tagName===`TEXTAREA`&&(key===`width`||key===`height`)&&isString$1(next)&&prev===next}var xlinkNS=`http://www.w3.org/1999/xlink`;function patchAttr(el,key,value,isSVG,instance,isBoolean=isSpecialBooleanAttr(key)){if(isSVG&&key.startsWith(`xlink:`)){if(value==null)el.removeAttributeNS(xlinkNS,key.slice(6,key.length));else el.setAttributeNS(xlinkNS,key,value)}else if(value==null||isBoolean&&!includeBooleanAttr(value))el.removeAttribute(key);else el.setAttribute(key,isBoolean?``:isSymbol$1(value)?String(value):value)}function patchDOMProp(el,key,value,parentComponent,attrName){if(key===`innerHTML`||key===`textContent`){if(value!=null)el[key]=key===`innerHTML`?unsafeToTrustedHTML(value):value;return}const tag=el.tagName;if(key===`value`&&tag!==`PROGRESS`&&!tag.includes(`-`)){const oldValue=tag===`OPTION`?el.getAttribute(`value`)||``:el.value;const newValue=value==null?el.type===`checkbox`?`on`:``:String(value);if(oldValue!==newValue||!(`_value`in el))el.value=newValue;if(value==null)el.removeAttribute(key);el._value=value;return}let needRemove=false;if(value===``||value==null){const type=typeof el[key];if(type===`boolean`)value=includeBooleanAttr(value);else if(value==null&&type===`string`){value=``;needRemove=true}else if(type===`number`){value=0;needRemove=true}}try{el[key]=value}catch(e){}needRemove&&el.removeAttribute(attrName||key)}function addEventListener$1(el,event,handler,options){el.addEventListener(event,handler,options)}function removeEventListener$1(el,event,handler,options){el.removeEventListener(event,handler,options)}var veiKey=Symbol(`_vei`);function patchEvent(el,rawName,prevValue,nextValue,instance=null){const invokers=el[veiKey]||(el[veiKey]={});const existingInvoker=invokers[rawName];if(nextValue&&existingInvoker)existingInvoker.value=nextValue;else{const[name,options]=parseName(rawName);if(nextValue)addEventListener$1(el,name,invokers[rawName]=createInvoker(nextValue,instance),options);else if(existingInvoker){removeEventListener$1(el,name,existingInvoker,options);invokers[rawName]=void 0}}}var optionsModifierRE=/(Once|Passive|Capture)$/;var optionsModifierEventRE=/^on:?(?:Once|Passive|Capture)$/;function parseName(name){let options;let m;while((m=name.match(optionsModifierRE))&&!optionsModifierEventRE.test(name)){if(!options)options={};name=name.slice(0,name.length-m[1].length);options[m[1].toLowerCase()]=true}return[name[2]===`:`?name.slice(3):hyphenate(name.slice(2)),options]}var cachedNow=0;var p=Promise.resolve();var getNow=()=>cachedNow||(p.then(()=>cachedNow=0),cachedNow=Date.now());function createInvoker(initialValue,instance){const invoker=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=invoker.attached)return;const value=invoker.value;if(isArray$2(value)){const originalStop=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{originalStop.call(e);e._stopped=true};const handlers=value.slice();const args=[e];for(let i=0;i<handlers.length;i++){if(e._stopped)break;const handler=handlers[i];if(handler)callWithAsyncErrorHandling(handler,instance,5,args)}}else callWithAsyncErrorHandling(value,instance,5,[e])};invoker.value=initialValue;invoker.attached=getNow();return invoker}var isNativeOn=key=>key.charCodeAt(0)===111&&key.charCodeAt(1)===110&&key.charCodeAt(2)>96&&key.charCodeAt(2)<123;var patchProp=(el,key,prevValue,nextValue,namespace,parentComponent)=>{const isSVG=namespace===`svg`;if(key===`class`)patchClass(el,nextValue,isSVG);else if(key===`style`)patchStyle(el,prevValue,nextValue);else if(isOn$1(key)){if(!isModelListener(key))patchEvent(el,key,prevValue,nextValue,parentComponent)}else if(key[0]===`.`?(key=key.slice(1),true):key[0]===`^`?(key=key.slice(1),false):shouldSetAsProp(el,key,nextValue,isSVG)){patchDOMProp(el,key,nextValue);if(!el.tagName.includes(`-`)&&(key===`value`||key===`checked`||key===`selected`))patchAttr(el,key,nextValue,isSVG,parentComponent,key!==`value`)}else if(el._isVueCE&&(shouldSetAsPropForVueCE(el,key)||el._def.__asyncLoader&&(/[A-Z]/.test(key)||!isString$1(nextValue))))patchDOMProp(el,camelize(key),nextValue,parentComponent,key);else{if(key===`true-value`)el._trueValue=nextValue;else if(key===`false-value`)el._falseValue=nextValue;patchAttr(el,key,nextValue,isSVG)}};function shouldSetAsProp(el,key,value,isSVG){if(isSVG){if(key===`innerHTML`||key===`textContent`)return true;if(key in el&&isNativeOn(key)&&isFunction$2(value))return true;return false}if(key===`spellcheck`||key===`draggable`||key===`translate`||key===`autocorrect`)return false;if(key===`sandbox`&&el.tagName===`IFRAME`)return false;if(key===`form`)return false;if(key===`list`&&el.tagName===`INPUT`)return false;if(key===`type`&&el.tagName===`TEXTAREA`)return false;if(key===`width`||key===`height`){const tag=el.tagName;if(tag===`IMG`||tag===`VIDEO`||tag===`CANVAS`||tag===`SOURCE`)return false}if(isNativeOn(key)&&isString$1(value))return false;return key in el}function shouldSetAsPropForVueCE(el,key){const props=el._def.props;if(!props)return false;const camelKey=camelize(key);return Array.isArray(props)?props.some(prop=>camelize(prop)===camelKey):Object.keys(props).some(prop=>camelize(prop)===camelKey)}var positionMap=new WeakMap;var newPositionMap=new WeakMap;var moveCbKey=Symbol(`_moveCb`);var enterCbKey=Symbol(`_enterCb`);var pendingGroups=new WeakMap;var decorate=t=>{delete t.props.mode;return t};var TransitionGroup=decorate({name:`TransitionGroup`,props:extend({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(props,{slots}){const instance=getCurrentInstance$1();const state=useTransitionState();let prevChildren;let children;let origins;let moves;const willMove=()=>{if(moves===void 0)moves=prevChildren.length>0&&hasCSSTransform(prevChildren[0].el,instance.vnode.el,resolveMoveClass(props));return moves};onUpdated(()=>{pendingGroups.delete(instance);if(!willMove()){prevChildren=[];origins=void 0;return}const moveClass=resolveMoveClass(props);prevChildren.forEach(callPendingCbs);const shift=origins&&getOriginShift(origins,instance.vnode.el);origins=void 0;prevChildren.forEach(c=>recordPosition(c,shift));const movedChildren=prevChildren.filter(applyTranslation);forceReflow(instance.vnode.el);movedChildren.forEach(c=>{const el=c.el;const style=el.style;addTransitionClass(el,moveClass);style.transform=style.webkitTransform=style.transitionDuration=``;const cb=el[moveCbKey]=e=>{if(e&&e.target!==el)return;if(!e||e.propertyName.endsWith(`transform`)){el.removeEventListener(`transitionend`,cb);el[moveCbKey]=null;removeTransitionClass(el,moveClass)}};el.addEventListener(`transitionend`,cb)});prevChildren=[]});return()=>{const rawProps=toRaw(props);const cssTransitionProps=resolveTransitionProps(rawProps);let tag=rawProps.tag||Fragment;prevChildren=[];moves=void 0;if(children)for(let i=0;i<children.length;i++){const child=children[i];if(child.el&&child.el instanceof Element&&!child.el[vShowHidden]){prevChildren.push(child);setTransitionHooks(child,resolveTransitionHooks(child,cssTransitionProps,state,instance));positionMap.set(child,getPosition(child.el))}}children=slots.default?getTransitionRawChildren(slots.default()):[];for(let i=0;i<children.length;i++){const child=children[i];if(child.key!=null)setTransitionHooks(child,resolveTransitionHooks(child,cssTransitionProps,state,instance))}if(prevChildren.length){origins=getOrigins(instance);pendingGroups.set(instance,willMove)}return createVNode(tag,null,children)}}});function callPendingCbs(c){const el=c.el;if(el[moveCbKey])el[moveCbKey]();if(el[enterCbKey])el[enterCbKey]()}function resolveMoveClass(props){return props.moveClass||`${props.name||`v`}-move`}function recordPosition(c,shift){newPositionMap.set(c,getPosition(c.el,shift))}function applyTranslation(c){const oldPos=positionMap.get(c);const newPos=newPositionMap.get(c);const dx=oldPos.left-newPos.left;const dy=oldPos.top-newPos.top;if(dx||dy){const el=c.el;const s=el.style;const rect=el.getBoundingClientRect();let scaleX=1;let scaleY=1;if(el.offsetWidth)scaleX=rect.width/el.offsetWidth;if(el.offsetHeight)scaleY=rect.height/el.offsetHeight;if(!Number.isFinite(scaleX)||scaleX===0)scaleX=1;if(!Number.isFinite(scaleY)||scaleY===0)scaleY=1;if(Math.abs(scaleX-1)<.01)scaleX=1;if(Math.abs(scaleY-1)<.01)scaleY=1;s.transform=s.webkitTransform=`translate(${dx/scaleX}px,${dy/scaleY}px)`;s.transitionDuration=`0s`;return c}}function getPosition(el,shift){const rect=el.getBoundingClientRect();return{left:rect.left-(shift?shift.left:0),top:rect.top-(shift?shift.top:0)}}function getOrigins(instance){let origins;for(let group=instance.parent;group;group=group.parent){const willMove=pendingGroups.get(group);if(willMove){const item=findItem(group.vnode.el,instance.vnode.el);if(item)(origins||(origins=[])).push(extend(getPosition(item),{item,willMove}))}}return origins}function findItem(root,node){const container=root.nodeType===1?root:root.parentNode;while(node&&node.parentNode!==container)node=node.parentNode;if(node&&node.nodeType===1)return node}function getOriginShift(origins,root){const origin=origins.find(o=>o.willMove()&&o.item.contains(root));return origin&&getPosition(origin.item,origin)}function hasCSSTransform(el,root,moveClass){const clone=el.cloneNode();const _vtc=el[vtcKey];if(_vtc)_vtc.forEach(cls=>{cls.split(/\s+/).forEach(c=>c&&clone.classList.remove(c))});moveClass.split(/\s+/).forEach(c=>c&&clone.classList.add(c));clone.style.display=`none`;const container=root.nodeType===1?root:root.parentNode;container.appendChild(clone);const{hasTransform}=getTransitionInfo(clone);container.removeChild(clone);return hasTransform}var getModelAssigner=vnode=>{const fn=vnode.props[`onUpdate:modelValue`]||false;return isArray$2(fn)?value=>invokeArrayFns(fn,value):fn};function onCompositionStart(e){e.target.composing=true}function onCompositionEnd(e){const target=e.target;if(target.composing){target.composing=false;target.dispatchEvent(new Event(`input`))}}var assignKey=Symbol(`_assign`);var initialValueKey=Symbol(`_initialValue`);function castValue(value,trim,number){if(trim)value=value.trim();if(number)value=looseToNumber(value);return value}var vModelText={created(el,{modifiers:{lazy,trim,number}},vnode){if(el.parentNode){if(el.type===`text`)el[initialValueKey]=el.defaultValue.replace(/[\r\n]/g,``);else if(el.type===`textarea`)el[initialValueKey]=el.defaultValue.replace(/\r\n?/g,`
|
|
3
|
-
`)}el[assignKey]=getModelAssigner(vnode);const castToNumber=number||vnode.props&&vnode.props.type===`number`;addEventListener$1(el,lazy?`change`:`input`,e=>{if(e.target.composing)return;el[assignKey](castValue(el.value,trim,castToNumber))});if(trim||castToNumber)addEventListener$1(el,`change`,()=>{el.value=castValue(el.value,trim,castToNumber)});if(!lazy){addEventListener$1(el,`compositionstart`,onCompositionStart);addEventListener$1(el,`compositionend`,onCompositionEnd);addEventListener$1(el,`change`,onCompositionEnd)}},mounted(el,{value,modifiers:{trim,number}}){const newValue=value==null?``:value;const initialValue=el[initialValueKey];delete el[initialValueKey];if(initialValue!==void 0&&(el.type===`text`||el.type===`textarea`)&&el.value!==initialValue)el[assignKey](castValue(el.value,trim,number));else el.value=newValue},beforeUpdate(el,{value,oldValue,modifiers:{lazy,trim,number}},vnode){el[assignKey]=getModelAssigner(vnode);if(el.composing)return;const elValue=(number||el.type===`number`)&&!/^0\d/.test(el.value)?looseToNumber(el.value):el.value;const newValue=value==null?``:value;if(elValue===newValue)return;const rootNode=el.getRootNode();if((rootNode instanceof Document||rootNode instanceof ShadowRoot)&&rootNode.activeElement===el&&el.type!==`range`){if(lazy&&value===oldValue)return;if(trim&&el.value.trim()===newValue)return}el.value=newValue}};var vModelSelect={deep:true,created(el,{value,modifiers:{number}},vnode){el._modelValue=value;addEventListener$1(el,`change`,()=>{const selectedVal=Array.prototype.filter.call(el.options,o=>o.selected).map(o=>number?looseToNumber(getValue(o)):getValue(o));const multiple=el.multiple;const assignedValue=multiple?isSet(el._modelValue)?new Set(selectedVal):selectedVal:selectedVal[0];const pending=el._pendingValue=[multiple,multiple?isArray$2(assignedValue)?selectedVal.slice():selectedVal:assignedValue];try{el[assignKey](assignedValue)}finally{nextTick$1(()=>{if(el._pendingValue===pending)el._pendingValue=void 0})}});el[assignKey]=getModelAssigner(vnode)},mounted(el,{value}){setSelected(el,value)},beforeUpdate(el,{value},vnode){el._modelValue=value;el[assignKey]=getModelAssigner(vnode)},updated(el,{value}){const pending=el._pendingValue;el._pendingValue=void 0;if(!pending||pending[0]!==el.multiple||!isSameSelectValue(value,pending[1],pending[0]))setSelected(el,value)}};function isSameSelectValue(value,assignedValue,multiple){if(!multiple)return looseEqual(value,assignedValue);if(isArray$2(value))return looseEqual(value,assignedValue);if(isSet(value)){if(value.size!==assignedValue.length)return false;for(const item of assignedValue)if(!value.has(item))return false;return true}return false}function setSelected(el,value){const isMultiple=el.multiple;const isArrayValue=isArray$2(value);if(isMultiple&&!isArrayValue&&!isSet(value))return;for(let i=0,l=el.options.length;i<l;i++){const option=el.options[i];const optionValue=getValue(option);if(isMultiple){if(isArrayValue){const optionType=typeof optionValue;if(optionType===`string`||optionType===`number`)option.selected=value.some(v=>String(v)===String(optionValue));else option.selected=looseIndexOf(value,optionValue)>-1}else option.selected=value.has(optionValue)}else if(looseEqual(getValue(option),value)){if(el.selectedIndex!==i)el.selectedIndex=i;return}}if(!isMultiple&&el.selectedIndex!==-1)el.selectedIndex=-1}function getValue(el){return`_value`in el?el._value:el.value}var systemModifiers=[`ctrl`,`shift`,`alt`,`meta`];var modifierGuards={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,modifiers)=>systemModifiers.some(m=>e[`${m}Key`]&&!modifiers.includes(m))};var withModifiers=(fn,modifiers)=>{if(!fn)return fn;const cache=fn._withMods||(fn._withMods={});const cacheKey=modifiers.join(`.`);return cache[cacheKey]||(cache[cacheKey]=((event,...args)=>{for(let i=0;i<modifiers.length;i++){const guard=modifierGuards[modifiers[i]];if(guard&&guard(event,modifiers))return}return fn(event,...args)}))};var keyNames={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`};var withKeys=(fn,modifiers)=>{const cache=fn._withKeys||(fn._withKeys={});const cacheKey=modifiers.join(`.`);return cache[cacheKey]||(cache[cacheKey]=(event=>{if(!(`key`in event))return;const eventKey=hyphenate(event.key);if(modifiers.some(k=>k===eventKey||keyNames[k]===eventKey))return fn(event)}))};var rendererOptions=extend({patchProp},nodeOps);var renderer;function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions))}var createApp=((...args)=>{const app=ensureRenderer().createApp(...args);const{mount}=app;app.mount=containerOrSelector=>{const container=normalizeContainer(containerOrSelector);if(!container)return;const component=app._component;if(!isFunction$2(component)&&!component.render&&!component.template)component.template=container.innerHTML;if(container.nodeType===1)container.textContent=``;const proxy=mount(container,false,resolveRootNamespace(container));if(container instanceof Element){container.removeAttribute(`v-cloak`);container.setAttribute(`data-v-app`,``)}return proxy};return app});function resolveRootNamespace(container){if(container instanceof SVGElement)return`svg`;if(typeof MathMLElement===`function`&&container instanceof MathMLElement)return`mathml`}function normalizeContainer(container){if(isString$1(container))return document.querySelector(container);return container}var IS_CLIENT=typeof window!==`undefined`;var activePinia;var setActivePinia=pinia=>activePinia=pinia;var piniaSymbol=Symbol();function isPlainObject$5(o){return o&&typeof o===`object`&&Object.prototype.toString.call(o)===`[object Object]`&&typeof o.toJSON!==`function`}var _global=(()=>typeof window===`object`&&window.window===window?window:typeof self===`object`&&self.self===self?self:typeof global===`object`&&global.global===global?global:typeof globalThis===`object`?globalThis:{HTMLElement:null})();function bom(blob,{autoBom=false}={}){if(autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type))return new Blob([String.fromCharCode(65279),blob],{type:blob.type});return blob}function download(url,name,opts){const xhr=new XMLHttpRequest;xhr.open(`GET`,url);xhr.responseType=`blob`;xhr.onload=function(){saveAs(xhr.response,name,opts)};xhr.onerror=function(){console.error(`could not download file`)};xhr.send()}function corsEnabled(url){const xhr=new XMLHttpRequest;xhr.open(`HEAD`,url,false);try{xhr.send()}catch(e){}return xhr.status>=200&&xhr.status<=299}function click(node){try{node.dispatchEvent(new MouseEvent(`click`))}catch(e){const evt=new MouseEvent(`click`,{bubbles:true,cancelable:true,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,button:0,relatedTarget:null});node.dispatchEvent(evt)}}var _navigator=typeof navigator===`object`?navigator:{userAgent:``};var isMacOSWebView=(()=>/Macintosh/.test(_navigator.userAgent)&&/AppleWebKit/.test(_navigator.userAgent)&&!/Safari/.test(_navigator.userAgent))();var saveAs=!IS_CLIENT?()=>{}:typeof HTMLAnchorElement!==`undefined`&&`download`in HTMLAnchorElement.prototype&&!isMacOSWebView?downloadSaveAs:`msSaveOrOpenBlob`in _navigator?msSaveAs:fileSaverSaveAs;function downloadSaveAs(blob,name=`download`,opts){const a=document.createElement(`a`);a.download=name;a.rel=`noopener`;if(typeof blob===`string`){a.href=blob;if(a.origin!==location.origin)if(corsEnabled(a.href))download(blob,name,opts);else{a.target=`_blank`;click(a)}else click(a)}else{a.href=URL.createObjectURL(blob);setTimeout(function(){URL.revokeObjectURL(a.href)},4e4);setTimeout(function(){click(a)},0)}}function msSaveAs(blob,name=`download`,opts){if(typeof blob===`string`)if(corsEnabled(blob))download(blob,name,opts);else{const a=document.createElement(`a`);a.href=blob;a.target=`_blank`;setTimeout(function(){click(a)})}else navigator.msSaveOrOpenBlob(bom(blob,opts),name)}function fileSaverSaveAs(blob,name,opts,popup){popup=popup||open(``,`_blank`);if(popup)popup.document.title=popup.document.body.innerText=`downloading...`;if(typeof blob===`string`)return download(blob,name,opts);const force=blob.type===`application/octet-stream`;const isSafari=/constructor/i.test(String(_global.HTMLElement))||`safari`in _global;const isChromeIOS=/CriOS\/[\d]+/.test(navigator.userAgent);if((isChromeIOS||force&&isSafari||isMacOSWebView)&&typeof FileReader!==`undefined`){const reader=new FileReader;reader.onloadend=function(){let url=reader.result;if(typeof url!==`string`){popup=null;throw new Error(`Wrong reader.result type`)}url=isChromeIOS?url:url.replace(/^data:[^;]*;/,`data:attachment/file;`);if(popup)popup.location.href=url;else location.assign(url);popup=null};reader.readAsDataURL(blob)}else{const url=URL.createObjectURL(blob);if(popup)popup.location.assign(url);else location.href=url;popup=null;setTimeout(function(){URL.revokeObjectURL(url)},4e4)}}var{assign:assign$1}=Object;function createPinia(){const scope=effectScope(true);const state=scope.run(()=>ref({}));let _p=[];let toBeInstalled=[];const pinia=markRaw({install(app){setActivePinia(pinia);pinia._a=app;app.provide(piniaSymbol,pinia);app.config.globalProperties.$pinia=pinia;toBeInstalled.forEach(plugin=>_p.push(plugin));toBeInstalled=[]},use(plugin){if(!this._a)toBeInstalled.push(plugin);else _p.push(plugin);return this},_p,_a:null,_e:scope,_s:new Map,state});return pinia}var noop$4=()=>{};function addSubscription(subscriptions,callback,detached,onCleanup=noop$4){subscriptions.add(callback);const removeSubscription=()=>{subscriptions.delete(callback)&&onCleanup()};if(!detached&&getCurrentScope())onScopeDispose(removeSubscription);return removeSubscription}function triggerSubscriptions(subscriptions,...args){subscriptions.forEach(callback=>{callback(...args)})}var fallbackRunWithContext=fn=>fn();var ACTION_MARKER=Symbol();var ACTION_NAME=Symbol();function mergeReactiveObjects(target,patchToApply){if(target instanceof Map&&patchToApply instanceof Map)patchToApply.forEach((value,key)=>target.set(key,value));else if(target instanceof Set&&patchToApply instanceof Set)patchToApply.forEach(target.add,target);for(const key in patchToApply){if(!Object.hasOwn(patchToApply,key))continue;const subPatch=patchToApply[key];const targetValue=target[key];if(isPlainObject$5(targetValue)&&isPlainObject$5(subPatch)&&Object.hasOwn(target,key)&&!isRef(subPatch)&&!isReactive(subPatch))target[key]=mergeReactiveObjects(targetValue,subPatch);else target[key]=subPatch}return target}var skipHydrateSymbol=Symbol();function shouldHydrate(obj){return!obj||typeof obj!==`object`||!Object.hasOwn(obj,skipHydrateSymbol)}var{assign:assign$2}=Object;function isComputed(o){return!!(isRef(o)&&o.effect)}function createOptionsStore(id,options,pinia,hot){const{state,actions,getters}=options;const initialState=pinia.state.value[id];let store;function setup(){if(!initialState&&true)pinia.state.value[id]=state?state():{};const localState=toRefs(pinia.state.value[id]);return assign$2(localState,actions,Object.keys(getters||{}).reduce((computedGetters,name)=>{computedGetters[name]=markRaw(computed(()=>{setActivePinia(pinia);const store=pinia._s.get(id);return getters[name].call(store,store)}));return computedGetters},{}))}store=createSetupStore(id,setup,options,pinia,hot,true);return store}function createSetupStore($id,setup,options={},pinia,hot,isOptionsStore){let scope;const optionsForPlugin=assign$2({actions:{}},options);const $subscribeOptions={deep:true};let isListening;let isSyncListening;let subscriptions=new Set;let actionSubscriptions=new Set;let debuggerEvents;const initialState=pinia.state.value[$id];if(!isOptionsStore&&!initialState&&true)pinia.state.value[$id]={};let activeListener;function $patch(partialStateOrMutator){let subscriptionMutation;isListening=isSyncListening=false;if(typeof partialStateOrMutator===`function`){partialStateOrMutator(pinia.state.value[$id]);subscriptionMutation={type:`patch function`,storeId:$id,events:debuggerEvents}}else{mergeReactiveObjects(pinia.state.value[$id],partialStateOrMutator);subscriptionMutation={type:`patch object`,payload:partialStateOrMutator,storeId:$id,events:debuggerEvents}}const myListenerId=activeListener=Symbol();nextTick$1().then(()=>{if(activeListener===myListenerId)isListening=true});isSyncListening=true;triggerSubscriptions(subscriptions,subscriptionMutation,pinia.state.value[$id])}const $reset=isOptionsStore?function $reset(){const{state}=options;const newState=state?state():{};this.$patch($state=>{assign$2($state,newState)})}:noop$4;function $dispose(){scope.stop();subscriptions.clear();actionSubscriptions.clear();pinia._s.delete($id)}const action=(fn,name=``)=>{if(ACTION_MARKER in fn){fn[ACTION_NAME]=name;return fn}const wrappedAction=function(){setActivePinia(pinia);const args=Array.from(arguments);const afterCallbackSet=new Set;const onErrorCallbackSet=new Set;function after(callback){afterCallbackSet.add(callback)}function onError(callback){onErrorCallbackSet.add(callback)}triggerSubscriptions(actionSubscriptions,{args,name:wrappedAction[ACTION_NAME],store,after,onError});let ret;try{ret=fn.apply(this&&this.$id===$id?this:store,args)}catch(error){triggerSubscriptions(onErrorCallbackSet,error);throw error}if(ret instanceof Promise)return ret.then(value=>{triggerSubscriptions(afterCallbackSet,value);return value}).catch(error=>{triggerSubscriptions(onErrorCallbackSet,error);return Promise.reject(error)});triggerSubscriptions(afterCallbackSet,ret);return ret};wrappedAction[ACTION_MARKER]=true;wrappedAction[ACTION_NAME]=name;return wrappedAction};const partialStore={_p:pinia,$id,$onAction:addSubscription.bind(null,actionSubscriptions),$patch,$reset,$subscribe(callback,options={}){if(subscriptions.has(callback))return noop$4;const removeSubscription=addSubscription(subscriptions,callback,options.detached,()=>stopWatcher());const stopWatcher=scope.run(()=>watch(()=>pinia.state.value[$id],state=>{if(options.flush===`sync`?isSyncListening:isListening)callback({storeId:$id,type:`direct`,events:debuggerEvents},state)},assign$2({},$subscribeOptions,options)));return removeSubscription},$dispose};const store=reactive(partialStore);pinia._s.set($id,store);const setupStore=(pinia._a&&pinia._a.runWithContext||fallbackRunWithContext)(()=>pinia._e.run(()=>(scope=effectScope()).run(()=>setup({action}))));for(const key in setupStore){const prop=setupStore[key];if(isRef(prop)&&!isComputed(prop)||isReactive(prop)){if(!isOptionsStore){if(initialState&&shouldHydrate(prop))if(isRef(prop))prop.value=initialState[key];else{if(prop instanceof Set||prop instanceof Map)prop.clear();mergeReactiveObjects(prop,initialState[key])}pinia.state.value[$id][key]=prop}}else if(typeof prop===`function`){setupStore[key]=action(prop,key);optionsForPlugin.actions[key]=prop}}assign$2(store,setupStore);assign$2(toRaw(store),setupStore);Object.defineProperty(store,"$state",{get:()=>pinia.state.value[$id],set:state=>{$patch($state=>{assign$2($state,state)})}});pinia._p.forEach(extender=>{const extensions=scope.run(()=>extender({store,app:pinia._a,pinia,options:optionsForPlugin}));assign$2(store,extensions)});if(initialState&&isOptionsStore&&options.hydrate)options.hydrate(store.$state,initialState);isListening=true;isSyncListening=true;return store}function defineStore(id,setup,setupOptions){let options;const isSetupStore=typeof setup===`function`;options=isSetupStore?setupOptions:setup;function useStore(pinia,hot){const hasContext=hasInjectionContext();pinia=pinia||(hasContext?inject$1(piniaSymbol,null):null);if(pinia)setActivePinia(pinia);pinia=activePinia;if(!pinia._s.has(id)){if(isSetupStore)createSetupStore(id,setup,options,pinia);else createOptionsStore(id,options,pinia)}return pinia._s.get(id)}useStore.$id=id;return useStore}var VUE_QUERY_CLIENT=`VUE_QUERY_CLIENT`;function getClientKey(key){const suffix=key?`:${key}`:``;return`${VUE_QUERY_CLIENT}${suffix}`}function updateState(state,update){Object.keys(state).forEach(key=>{state[key]=update[key]})}function _cloneDeep(value,customize,currentKey=``,currentLevel=0){if(customize){const result=customize(value,currentKey,currentLevel);if(result===void 0&&isRef(value))return result;if(result!==void 0)return result}if(Array.isArray(value))return value.map((val,index)=>_cloneDeep(val,customize,String(index),currentLevel+1));if(typeof value===`object`&&isPlainObject$4(value)){const entries=Object.entries(value).map(([key,val])=>[key,_cloneDeep(val,customize,key,currentLevel+1)]);return Object.fromEntries(entries)}return value}function cloneDeep(value,customize){return _cloneDeep(value,customize)}function cloneDeepUnref(obj,unrefGetters=false){return cloneDeep(obj,(val,key,level)=>{if(level===1&&key===`queryKey`)return cloneDeepUnref(val,true);if(unrefGetters&&isFunction$1(val))return cloneDeepUnref(val(),unrefGetters);if(isRef(val))return cloneDeepUnref(unref(val),unrefGetters)})}function isPlainObject$4(value){if(Object.prototype.toString.call(value)!==`[object Object]`)return false;const prototype=Object.getPrototypeOf(value);return prototype===null||prototype===Object.prototype}function isFunction$1(value){return typeof value===`function`}function useQueryClient(id=``){if(!hasInjectionContext())throw new Error(`vue-query hooks can only be used inside setup() function or functions that support injection context.`);const key=getClientKey(id);const queryClient=inject$1(key);if(!queryClient)throw new Error(`No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.`);return queryClient}var defaultTimeoutProvider={setTimeout:(callback,delay)=>setTimeout(callback,delay),clearTimeout:timeoutId=>clearTimeout(timeoutId),setInterval:(callback,delay)=>setInterval(callback,delay),clearInterval:intervalId=>clearInterval(intervalId)};var TimeoutManager=class{#provider=defaultTimeoutProvider;#providerCalled=false;setTimeoutProvider(provider){this.#provider=provider}setTimeout(callback,delay){return this.#provider.setTimeout(callback,delay)}clearTimeout(timeoutId){this.#provider.clearTimeout(timeoutId)}setInterval(callback,delay){return this.#provider.setInterval(callback,delay)}clearInterval(intervalId){this.#provider.clearInterval(intervalId)}};var timeoutManager=new TimeoutManager;function systemSetTimeoutZero(callback){setTimeout(callback,0)}var isServer$1=typeof window===`undefined`||`Deno`in globalThis;function noop$3(){}function functionalUpdate(updater,input){return typeof updater===`function`?updater(input):updater}function isValidTimeout(value){return typeof value===`number`&&value>=0&&value!==Infinity}function timeUntilStale(updatedAt,staleTime){return Math.max(updatedAt+(staleTime||0)-Date.now(),0)}function resolveQueryValue(value,query){return typeof value===`function`?value(query):value}function matchQuery(filters,query){const{type=`all`,exact,fetchStatus,predicate,queryKey,stale}=filters;if(queryKey){if(exact){if(query.queryHash!==hashQueryKeyByOptions(queryKey,query.options))return false}else if(!partialMatchKey(query.queryKey,queryKey))return false}if(type!==`all`){const isActive=query.isActive();if(type===`active`&&!isActive)return false;if(type===`inactive`&&isActive)return false}if(typeof stale===`boolean`&&query.isStale()!==stale)return false;if(fetchStatus&&fetchStatus!==query.state.fetchStatus)return false;if(predicate&&!predicate(query))return false;return true}function matchMutation(filters,mutation){const{exact,status,predicate,mutationKey}=filters;if(mutationKey){if(!mutation.options.mutationKey)return false;if(exact){if(hashKey(mutation.options.mutationKey)!==hashKey(mutationKey))return false}else if(!partialMatchKey(mutation.options.mutationKey,mutationKey))return false}if(status&&mutation.state.status!==status)return false;if(predicate&&!predicate(mutation))return false;return true}function hashQueryKeyByOptions(queryKey,options){return(options?.queryKeyHashFn||hashKey)(queryKey)}function hashKey(queryKey){return JSON.stringify(queryKey,(_,val)=>isPlainObject$3(val)?Object.keys(val).sort().reduce((result,key)=>{result[key]=val[key];return result},{}):val)}function partialMatchKey(a,b){if(a===b)return true;if(typeof a!==typeof b)return false;if(a&&b&&typeof a===`object`&&typeof b===`object`){if(Array.isArray(a)&&Array.isArray(b)){if(b.length>a.length)return false;for(let i=0;i<b.length;i++)if(!partialMatchKey(a[i],b[i]))return false;return true}const bKeys=Object.keys(b);for(const key of bKeys)if(!partialMatchKey(a[key],b[key]))return false;return true}return false}var hasOwn=Object.prototype.hasOwnProperty;function replaceEqualDeep(a,b,depth=0){if(a===b)return a;if(depth>500)return b;const array=isPlainArray(a)&&isPlainArray(b);if(!array&&!(isPlainObject$3(a)&&isPlainObject$3(b)))return b;const aSize=(array?a:Object.keys(a)).length;const bItems=array?b:Object.keys(b);const bSize=bItems.length;const copy=array?new Array(bSize):{};let equalItems=0;for(let i=0;i<bSize;i++){const key=array?i:bItems[i];const aItem=a[key];const bItem=b[key];if(aItem===bItem){copy[key]=aItem;if(array?i<aSize:hasOwn.call(a,key))equalItems++;continue}if(aItem===null||bItem===null||typeof aItem!==`object`||typeof bItem!==`object`){copy[key]=bItem;continue}const v=replaceEqualDeep(aItem,bItem,depth+1);copy[key]=v;if(v===aItem)equalItems++}return aSize===bSize&&equalItems===aSize?a:copy}function shallowEqualObjects(a,b){if(!b||Object.keys(a).length!==Object.keys(b).length)return false;for(const key in a)if(a[key]!==b[key])return false;return true}function isPlainArray(value){return Array.isArray(value)&&value.length===Object.keys(value).length}function isPlainObject$3(o){if(!hasObjectPrototype(o))return false;const objectPrototype=Object.getPrototypeOf(o);const ctor=objectPrototype?.constructor;if(ctor===void 0)return true;if(typeof ctor!==`function`)return false;const prot=ctor.prototype;if(!hasObjectPrototype(prot))return false;if(!prot.hasOwnProperty(`isPrototypeOf`))return false;if(objectPrototype!==Object.prototype)return false;return true}function hasObjectPrototype(o){return Object.prototype.toString.call(o)===`[object Object]`}function sleep$1(timeout){return new Promise(resolve=>{timeoutManager.setTimeout(resolve,timeout)})}function replaceData(prevData,data,options){if(typeof options.structuralSharing===`function`)return options.structuralSharing(prevData,data);else if(options.structuralSharing!==false)return replaceEqualDeep(prevData,data);return data}function addToEnd(items,item,max=0){const newItems=[...items,item];return max&&newItems.length>max?newItems.slice(1):newItems}function addToStart(items,item,max=0){const newItems=[item,...items];return max&&newItems.length>max?newItems.slice(0,-1):newItems}var skipToken=Symbol();function ensureQueryFn(options,fetchOptions){if(!options.queryFn&&fetchOptions?.initialPromise)return()=>fetchOptions.initialPromise;if(!options.queryFn||options.queryFn===skipToken)return()=>Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));return options.queryFn}function shouldThrowError(throwOnError,params){if(typeof throwOnError===`function`)return throwOnError(...params);return!!throwOnError}function addConsumeAwareSignal(object,getSignal,onCancelled){let consumed=false;let signal;Object.defineProperty(object,"signal",{enumerable:true,get:()=>{signal??=getSignal();if(consumed)return signal;consumed=true;if(signal.aborted)onCancelled();else signal.addEventListener(`abort`,onCancelled,{once:true});return signal}});return object}var isServerFn=()=>isServer$1;var isServer=()=>isServerFn();var environmentManager={isServer,setIsServer(isServerValue){isServerFn=isServerValue}};var Subscribable=class{constructor(){this.listeners=new Set;this.subscribe=this.subscribe.bind(this)}subscribe(listener){this.listeners.add(listener);this.onSubscribe();return()=>{this.listeners.delete(listener);this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var FocusManager=class extends Subscribable{#focused;#cleanup;#setup;constructor(){super();this.#setup=onFocus=>{if(typeof window!==`undefined`&&window.addEventListener){const listener=()=>onFocus();window.addEventListener(`visibilitychange`,listener,false);return()=>{window.removeEventListener(`visibilitychange`,listener)}}}}onSubscribe(){if(!this.#cleanup)this.setEventListener(this.#setup)}onUnsubscribe(){if(!this.hasListeners()){this.#cleanup?.();this.#cleanup=void 0}}setEventListener(setup){this.#setup=setup;this.#cleanup?.();this.#cleanup=setup(focused=>{if(typeof focused===`boolean`)this.setFocused(focused);else this.onFocus()})}setFocused(focused){if(this.#focused!==focused){this.#focused=focused;this.onFocus()}}onFocus(){const isFocused=this.isFocused();this.listeners.forEach(listener=>{listener(isFocused)})}isFocused(){if(typeof this.#focused===`boolean`)return this.#focused;return globalThis.document?.visibilityState!==`hidden`}};var focusManager=new FocusManager;var defaultScheduler=systemSetTimeoutZero;function createNotifyManager(){let queue=[];let transactions=0;let notifyFn=callback=>{callback()};let batchNotifyFn=callback=>{callback()};let scheduleFn=defaultScheduler;const schedule=callback=>{if(transactions)queue.push(callback);else scheduleFn(()=>{notifyFn(callback)})};const flush=()=>{const originalQueue=queue;queue=[];if(originalQueue.length)scheduleFn(()=>{batchNotifyFn(()=>{originalQueue.forEach(callback=>{notifyFn(callback)})})})};return{batch:callback=>{let result;transactions++;try{result=callback()}finally{transactions--;if(!transactions)flush()}return result},batchCalls:callback=>{return(...args)=>{schedule(()=>{callback(...args)})}},schedule,setNotifyFunction:fn=>{notifyFn=fn},setBatchNotifyFunction:fn=>{batchNotifyFn=fn},setScheduler:fn=>{scheduleFn=fn}}}var notifyManager=createNotifyManager();var OnlineManager=class extends Subscribable{#online=true;#cleanup;#setup;constructor(){super();this.#setup=onOnline=>{if(typeof window!==`undefined`&&window.addEventListener){const onlineListener=()=>onOnline(true);const offlineListener=()=>onOnline(false);window.addEventListener(`online`,onlineListener,false);window.addEventListener(`offline`,offlineListener,false);return()=>{window.removeEventListener(`online`,onlineListener);window.removeEventListener(`offline`,offlineListener)}}}}onSubscribe(){if(!this.#cleanup)this.setEventListener(this.#setup)}onUnsubscribe(){if(!this.hasListeners()){this.#cleanup?.();this.#cleanup=void 0}}setEventListener(setup){this.#setup=setup;this.#cleanup?.();this.#cleanup=setup(this.setOnline.bind(this))}setOnline(online){if(this.#online!==online){this.#online=online;this.listeners.forEach(listener=>{listener(online)})}}isOnline(){return this.#online}};var onlineManager=new OnlineManager;function defaultRetryDelay(failureCount){return Math.min(1e3*2**failureCount,3e4)}function canFetch(networkMode){return(networkMode??`online`)===`online`?onlineManager.isOnline():true}var CancelledError=class extends Error{constructor(options){super(`CancelledError`);this.revert=options?.revert;this.silent=options?.silent}};function createRetryer(config){let isRetryCancelled=false;let failureCount=0;let continueFn;let status=`pending`;let promiseResolve;let promiseReject;const promise=new Promise((resolve,reject)=>{promiseResolve=resolve;promiseReject=reject});promise.catch(noop$3);const isResolved=()=>status!==`pending`;const cancel=cancelOptions=>{if(!isResolved()){const error=new CancelledError(cancelOptions);reject(error);config.onCancel?.(error)}};const cancelRetry=()=>{isRetryCancelled=true};const continueRetry=()=>{isRetryCancelled=false};const canContinue=()=>focusManager.isFocused()&&(config.networkMode===`always`||onlineManager.isOnline())&&config.canRun();const canStart=()=>canFetch(config.networkMode)&&config.canRun();const resolve=value=>{if(!isResolved()){continueFn?.();status=`resolved`;promiseResolve(value)}};const reject=value=>{if(!isResolved()){continueFn?.();status=`rejected`;promiseReject(value)}};const pause=()=>{return new Promise(continueResolve=>{continueFn=value=>{if(isResolved()||canContinue())continueResolve(value)};config.onPause?.()}).then(()=>{continueFn=void 0;if(!isResolved())config.onContinue?.()})};const run=()=>{if(isResolved())return;let promiseOrValue;const initialPromise=failureCount===0?config.initialPromise:void 0;try{promiseOrValue=initialPromise??config.fn()}catch(error){promiseOrValue=Promise.reject(error)}Promise.resolve(promiseOrValue).then(resolve).catch(error=>{if(isResolved())return;const retry=config.retry??(isServer()?0:3);const retryDelay=config.retryDelay??defaultRetryDelay;const delay=typeof retryDelay===`function`?retryDelay(failureCount,error):retryDelay;const shouldRetry=retry===true||typeof retry===`number`&&failureCount<retry||typeof retry===`function`&&retry(failureCount,error);if(isRetryCancelled||!shouldRetry){reject(error);return}failureCount++;config.onFail?.(failureCount,error);sleep$1(delay).then(()=>{return canContinue()?void 0:pause()}).then(()=>{if(isRetryCancelled)reject(error);else run()})})};return{promise,status:()=>status,cancel,continue:()=>{continueFn?.();return promise},cancelRetry,continueRetry,canStart,start:()=>{if(canStart())run();else pause().then(run);return promise}}}var Removable=class{#gcTimeout;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout();if(isValidTimeout(this.gcTime))this.#gcTimeout=timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime(newGcTime){this.gcTime=Math.max(this.gcTime||0,newGcTime??(isServer()?Infinity:3e5))}clearGcTimeout(){if(this.#gcTimeout!==void 0){timeoutManager.clearTimeout(this.#gcTimeout);this.#gcTimeout=void 0}}};function infiniteQueryBehavior(pages){return{onFetch:(context,query)=>{const options=context.options;const direction=context.fetchOptions?.meta?.fetchMore?.direction;const oldPages=context.state.data?.pages||[];const oldPageParams=context.state.data?.pageParams||[];let result={pages:[],pageParams:[]};let currentPage=0;const fetchFn=async()=>{let cancelled=false;const addSignalProperty=object=>{addConsumeAwareSignal(object,()=>context.signal,()=>cancelled=true)};const queryFn=ensureQueryFn(context.options,context.fetchOptions);const fetchPage=async(data,param,previous)=>{if(cancelled)return Promise.reject(context.signal.reason);if(param==null&&data.pages.length)return Promise.resolve(data);const createQueryFnContext=()=>{const queryFnContext={client:context.client,queryKey:context.queryKey,pageParam:param,direction:previous?`backward`:`forward`,meta:context.options.meta};addSignalProperty(queryFnContext);return queryFnContext};const queryFnContext=createQueryFnContext();const page=await queryFn(queryFnContext);const{maxPages}=context.options;const addTo=previous?addToStart:addToEnd;return{pages:addTo(data.pages,page,maxPages),pageParams:addTo(data.pageParams,param,maxPages)}};if(direction&&oldPages.length){const previous=direction===`backward`;const pageParamFn=previous?getPreviousPageParam:getNextPageParam;const oldData={pages:oldPages,pageParams:oldPageParams};result=await fetchPage(oldData,pageParamFn(options,oldData),previous)}else{const remainingPages=pages??oldPages.length;do{const param=currentPage===0?oldPageParams[0]??options.initialPageParam:getNextPageParam(options,result);if(currentPage>0&¶m==null)break;result=await fetchPage(result,param);currentPage++}while(currentPage<remainingPages)}return result};if(context.options.persister)context.fetchFn=()=>{return context.options.persister?.(fetchFn,{client:context.client,queryKey:context.queryKey,meta:context.options.meta,signal:context.signal},query)};else context.fetchFn=fetchFn}}}function getNextPageParam(options,{pages,pageParams}){const lastIndex=pages.length-1;return pages.length>0?options.getNextPageParam(pages[lastIndex],pages,pageParams[lastIndex],pageParams):void 0}function getPreviousPageParam(options,{pages,pageParams}){return pages.length>0?options.getPreviousPageParam?.(pages[0],pages,pageParams[0],pageParams):void 0}var Query=class extends Removable{#queryType;#initialState;#revertState;#cache;#client;#retryer;#defaultOptions;#abortSignalConsumed;constructor(config){super();this.#abortSignalConsumed=false;this.#defaultOptions=config.defaultOptions;this.setOptions(config.options);this.observers=[];this.#client=config.client;this.#cache=this.#client.getQueryCache();this.queryKey=config.queryKey;this.queryHash=config.queryHash;this.#initialState=getDefaultState$1(this.options);this.state=config.state??this.#initialState;this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#queryType}get promise(){return this.#retryer?.promise}setOptions(options){this.options={...this.#defaultOptions,...options};if(options?._type)this.#queryType=options._type;this.updateGcTime(this.options.gcTime);if(this.state&&this.state.data===void 0){const defaultState=getDefaultState$1(this.options);if(defaultState.data!==void 0){this.setState(successState(defaultState.data,defaultState.dataUpdatedAt));this.#initialState=defaultState}}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus===`idle`)this.#cache.remove(this)}setData(newData,options){const data=replaceData(this.state.data,newData,this.options);this.#dispatch({data,type:`success`,dataUpdatedAt:options?.updatedAt,manual:options?.manual});return data}setState(state){this.#dispatch({type:`setState`,state})}cancel(options){const promise=this.#retryer?.promise;this.#retryer?.cancel(options);return promise?promise.then(noop$3).catch(noop$3):Promise.resolve()}destroy(){super.destroy();this.cancel({silent:true})}get resetState(){return this.#initialState}reset(){this.destroy();this.setState(this.resetState)}isActive(){return this.observers.some(observer=>resolveQueryValue(observer.options.enabled,this)!==false)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===skipToken||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(observer=>resolveQueryValue(observer.options.staleTime,this)===`static`);return false}isStale(){if(this.getObserversCount()>0)return this.observers.some(observer=>observer.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime(staleTime=0){if(this.state.data===void 0)return true;if(staleTime===`static`)return false;if(this.state.isInvalidated)return true;return!timeUntilStale(this.state.dataUpdatedAt,staleTime)}onFocus(){this.observers.find(x=>x.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:false});this.#retryer?.continue()}onOnline(){this.observers.find(x=>x.shouldFetchOnReconnect())?.refetch({cancelRefetch:false});this.#retryer?.continue()}addObserver(observer){if(!this.observers.includes(observer)){this.observers.push(observer);this.clearGcTimeout();this.#cache.notify({type:`observerAdded`,query:this,observer})}}removeObserver(observer){const index=this.observers.indexOf(observer);if(index!==-1){this.observers.splice(index,1);if(!this.observers.length){if(this.#retryer){if(this.#abortSignalConsumed||this.state.fetchStatus===`paused`&&this.state.status===`pending`)this.#retryer.cancel({revert:true});else this.#retryer.cancelRetry()}this.scheduleGc()}this.#cache.notify({type:`observerRemoved`,query:this,observer})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#dispatch({type:`invalidate`})}async fetch(options,fetchOptions){if(this.state.fetchStatus!==`idle`&&this.#retryer?.status()!==`rejected`){if(this.state.data!==void 0&&fetchOptions?.cancelRefetch)this.cancel({silent:true});else if(this.#retryer){this.#retryer.continueRetry();return this.#retryer.promise}}if(options)this.setOptions(options);if(!this.options.queryFn){const observer=this.observers.find(x=>x.options.queryFn);if(observer)this.setOptions(observer.options)}const abortController=new AbortController;const addSignalProperty=object=>{Object.defineProperty(object,"signal",{enumerable:true,get:()=>{this.#abortSignalConsumed=true;return abortController.signal}})};const fetchFn=()=>{const queryFn=ensureQueryFn(this.options,fetchOptions);const createQueryFnContext=()=>{const queryFnContext={client:this.#client,queryKey:this.queryKey,meta:this.meta};addSignalProperty(queryFnContext);return queryFnContext};const queryFnContext=createQueryFnContext();this.#abortSignalConsumed=false;if(this.options.persister)return this.options.persister(queryFn,queryFnContext,this);return queryFn(queryFnContext)};const createFetchContext=()=>{const context={fetchOptions,options:this.options,queryKey:this.queryKey,client:this.#client,state:this.state,fetchFn};addSignalProperty(context);return context};const context=createFetchContext();(this.#queryType===`infinite`?infiniteQueryBehavior(this.options.pages):this.options.behavior)?.onFetch(context,this);this.#revertState=this.state;if(this.state.fetchStatus===`idle`||this.state.fetchMeta!==context.fetchOptions?.meta)this.#dispatch({type:`fetch`,meta:context.fetchOptions?.meta});const retryer=this.#retryer=createRetryer({initialPromise:fetchOptions?.initialPromise,fn:context.fetchFn,onCancel:error=>{if(error instanceof CancelledError&&error.revert)this.setState({...this.#revertState,fetchStatus:`idle`});abortController.abort()},onFail:(failureCount,error)=>{this.#dispatch({type:`failed`,failureCount,error})},onPause:()=>{this.#dispatch({type:`pause`})},onContinue:()=>{this.#dispatch({type:`continue`})},retry:context.options.retry,retryDelay:context.options.retryDelay,networkMode:context.options.networkMode,canRun:()=>true});try{const data=await retryer.start();if(data===void 0)throw new Error(`${this.queryHash} data is undefined`);this.setData(data);this.#cache.config.onSuccess?.(data,this);this.#cache.config.onSettled?.(data,this.state.error,this);return data}catch(error){if(error instanceof CancelledError){if(error.silent)return this.#retryer.promise;else if(error.revert){if(this.state.data===void 0)throw error;return this.state.data}}this.#dispatch({type:`error`,error});this.#cache.config.onError?.(error,this);this.#cache.config.onSettled?.(this.state.data,error,this);throw error}finally{if(this.#retryer===retryer)this.#retryer=void 0;this.scheduleGc()}}#dispatch(action){const reducer=state=>{switch(action.type){case`failed`:return{...state,fetchFailureCount:action.failureCount,fetchFailureReason:action.error};case`pause`:return{...state,fetchStatus:`paused`};case`continue`:return{...state,fetchStatus:`fetching`};case`fetch`:return{...state,...fetchState(state.data,this.options),fetchMeta:action.meta??null};case`success`:const newState={...state,...successState(action.data,action.dataUpdatedAt),dataUpdateCount:state.dataUpdateCount+1,...!action.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};this.#revertState=action.manual?newState:void 0;return newState;case`error`:const error=action.error;return{...state,error,errorUpdateCount:state.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:state.fetchFailureCount+1,fetchFailureReason:error,fetchStatus:`idle`,status:`error`,isInvalidated:true};case`invalidate`:return{...state,isInvalidated:true};case`setState`:return{...state,...action.state}}};this.state=reducer(this.state);notifyManager.batch(()=>{this.observers.slice().forEach(observer=>{observer.onQueryUpdate()});this.#cache.notify({query:this,type:`updated`,action})})}};function fetchState(data,options){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(options.networkMode)?`fetching`:`paused`,...data===void 0&&{error:null,status:`pending`}}}function successState(data,dataUpdatedAt){return{data,dataUpdatedAt:dataUpdatedAt??Date.now(),error:null,isInvalidated:false,status:`success`}}function getDefaultState$1(options){const data=typeof options.initialData===`function`?options.initialData():options.initialData;const hasData=data!==void 0;const initialDataUpdatedAt=hasData?typeof options.initialDataUpdatedAt===`function`?options.initialDataUpdatedAt():options.initialDataUpdatedAt:0;return{data,dataUpdateCount:0,dataUpdatedAt:hasData?initialDataUpdatedAt??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:false,status:hasData?`success`:`pending`,fetchStatus:`idle`}}var QueryObserver=class extends Subscribable{#client;#currentQuery=void 0;#currentQueryInitialState=void 0;#currentResult=void 0;#currentResultState;#currentResultOptions;#selectError;#selectFn;#selectResult;#lastQueryWithDefinedData;#staleTimeoutId;#refetchIntervalId;#currentRefetchInterval;#trackedProps=new Set;constructor(client,options){super();this.options=options;this.#client=client;this.#selectError=null;this.bindMethods();this.setOptions(options)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){this.#currentQuery.addObserver(this);if(shouldFetchOnMount(this.#currentQuery,this.options))this.#executeFetch();else this.updateResult();this.#updateTimers()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.#currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.#currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set;this.#clearStaleTimeout();this.#clearRefetchInterval();this.#currentQuery.removeObserver(this)}setOptions(options){const prevOptions=this.options;const prevQuery=this.#currentQuery;this.options=this.#client.defaultQueryOptions(options);if(this.options.enabled!==void 0&&typeof this.options.enabled!==`boolean`&&typeof this.options.enabled!==`function`&&typeof resolveQueryValue(this.options.enabled,this.#currentQuery)!==`boolean`)throw new Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#updateQuery();this.#currentQuery.setOptions(this.options);if(prevOptions._defaulted&&!shallowEqualObjects(this.options,prevOptions))this.#client.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#currentQuery,observer:this});const mounted=this.hasListeners();if(mounted&&shouldFetchOptionally(this.#currentQuery,prevQuery,this.options,prevOptions))this.#executeFetch();this.updateResult();if(mounted&&(this.#currentQuery!==prevQuery||resolveQueryValue(this.options.enabled,this.#currentQuery)!==resolveQueryValue(prevOptions.enabled,this.#currentQuery)||resolveQueryValue(this.options.staleTime,this.#currentQuery)!==resolveQueryValue(prevOptions.staleTime,this.#currentQuery)))this.#updateStaleTimeout();const nextRefetchInterval=this.#computeRefetchInterval();if(mounted&&(this.#currentQuery!==prevQuery||resolveQueryValue(this.options.enabled,this.#currentQuery)!==resolveQueryValue(prevOptions.enabled,this.#currentQuery)||nextRefetchInterval!==this.#currentRefetchInterval))this.#updateRefetchInterval(nextRefetchInterval)}getOptimisticResult(options){const query=this.#client.getQueryCache().build(this.#client,options);const result=this.createResult(query,options);if(!shallowEqualObjects(this.getCurrentResult(),result)){this.#currentResult=result;this.#currentResultOptions=this.options;this.#currentResultState=this.#currentQuery.state}return result}getCurrentResult(){return this.#currentResult}trackResult(result,onPropTracked){return new Proxy(result,{get:(target,key)=>{this.trackProp(key);onPropTracked?.(key);return Reflect.get(target,key)}})}trackProp(key){this.#trackedProps.add(key)}getCurrentQuery(){return this.#currentQuery}refetch({...options}={}){return this.fetch({...options})}fetchOptimistic(options){const defaultedOptions=this.#client.defaultQueryOptions(options);const query=this.#client.getQueryCache().build(this.#client,defaultedOptions);let unsubscribe=()=>{};let resolveEarly;const cachePromise=new Promise(resolve=>{resolveEarly=resolve;unsubscribe=this.#client.getQueryCache().subscribe(event=>{if(event.type===`updated`&&event.query.queryHash===query.queryHash&&query.state.data!==void 0){unsubscribe();resolve(this.createResult(query,defaultedOptions))}})});return Promise.race([query.fetch().then(()=>{const result=this.createResult(query,defaultedOptions);resolveEarly?.(result);return result}).finally(()=>{unsubscribe()}),cachePromise])}fetch(fetchOptions){return this.#executeFetch({...fetchOptions,cancelRefetch:fetchOptions.cancelRefetch??true}).then(()=>{this.updateResult();return this.#currentResult})}#executeFetch(fetchOptions){this.#updateQuery();let promise=this.#currentQuery.fetch(this.options,fetchOptions);if(!fetchOptions?.throwOnError)promise=promise.catch(noop$3);return promise}#shouldScheduleTimer(timeout){return!isServer()&&resolveQueryValue(this.options.enabled,this.#currentQuery)!==false&&isValidTimeout(timeout)}#updateStaleTimeout(){this.#clearStaleTimeout();const staleTime=resolveQueryValue(this.options.staleTime,this.#currentQuery);if(this.#currentResult.isStale||!this.#shouldScheduleTimer(staleTime))return;const timeout=timeUntilStale(this.#currentResult.dataUpdatedAt,staleTime)+1;this.#staleTimeoutId=timeoutManager.setTimeout(()=>{if(!this.#currentResult.isStale)this.updateResult()},timeout)}#computeRefetchInterval(){return resolveQueryValue(this.options.refetchInterval,this.#currentQuery)??false}#updateRefetchInterval(nextInterval){this.#clearRefetchInterval();this.#currentRefetchInterval=nextInterval;if(this.#currentRefetchInterval===0||!this.#shouldScheduleTimer(this.#currentRefetchInterval))return;this.#refetchIntervalId=timeoutManager.setInterval(()=>{if(this.options.refetchIntervalInBackground||focusManager.isFocused())this.#executeFetch()},this.#currentRefetchInterval)}#updateTimers(){this.#updateStaleTimeout();this.#updateRefetchInterval(this.#computeRefetchInterval())}#clearStaleTimeout(){if(this.#staleTimeoutId!==void 0){timeoutManager.clearTimeout(this.#staleTimeoutId);this.#staleTimeoutId=void 0}}#clearRefetchInterval(){if(this.#refetchIntervalId!==void 0){timeoutManager.clearInterval(this.#refetchIntervalId);this.#refetchIntervalId=void 0}}createResult(query,options){const prevQuery=this.#currentQuery;const prevOptions=this.options;const prevResult=this.#currentResult;const prevResultState=this.#currentResultState;const prevResultOptions=this.#currentResultOptions;const queryInitialState=query!==prevQuery?query.state:this.#currentQueryInitialState;const{state}=query;let newState={...state};let isPlaceholderData=false;let data;if(options._optimisticResults){const mounted=this.hasListeners();const fetchOnMount=!mounted&&shouldFetchOnMount(query,options);const fetchOptionally=mounted&&shouldFetchOptionally(query,prevQuery,options,prevOptions);if(fetchOnMount||fetchOptionally)newState={...newState,...fetchState(state.data,query.options)};if(options._optimisticResults===`isRestoring`)newState.fetchStatus=`idle`}let{error,errorUpdatedAt,status}=newState;data=newState.data;let skipSelect=false;if(options.placeholderData!==void 0&&data===void 0&&status===`pending`){let placeholderData;if(prevResult?.isPlaceholderData&&options.placeholderData===prevResultOptions?.placeholderData){placeholderData=prevResult.data;skipSelect=true}else placeholderData=typeof options.placeholderData===`function`?options.placeholderData(this.#lastQueryWithDefinedData?.state.data,this.#lastQueryWithDefinedData):options.placeholderData;if(placeholderData!==void 0){status=`success`;data=replaceData(prevResult?.data,placeholderData,options);isPlaceholderData=true}}if(options.select&&data!==void 0&&!skipSelect){if(prevResult&&data===prevResultState?.data&&options.select===this.#selectFn)data=this.#selectResult;else try{this.#selectFn=options.select;data=options.select(data);data=replaceData(prevResult?.data,data,options);this.#selectResult=data;this.#selectError=null}catch(selectError){this.#selectError=selectError}}else if(data===void 0)this.#selectError=null;if(this.#selectError){error=this.#selectError;data=this.#selectResult;errorUpdatedAt=Date.now();status=`error`;isPlaceholderData=false}const isFetching=newState.fetchStatus===`fetching`;const isPending=status===`pending`;const isError=status===`error`;const isLoading=isPending&&isFetching;const hasData=data!==void 0;return{status,fetchStatus:newState.fetchStatus,isPending,isSuccess:status===`success`,isError,isInitialLoading:isLoading,isLoading,data,dataUpdatedAt:newState.dataUpdatedAt,error,errorUpdatedAt,failureCount:newState.fetchFailureCount,failureReason:newState.fetchFailureReason,errorUpdateCount:newState.errorUpdateCount,isFetched:query.isFetched(),isFetchedAfterMount:newState.dataUpdateCount>queryInitialState.dataUpdateCount||newState.errorUpdateCount>queryInitialState.errorUpdateCount,isFetching,isRefetching:isFetching&&!isPending,isLoadingError:isError&&!hasData,isPaused:newState.fetchStatus===`paused`,isPlaceholderData,isRefetchError:isError&&hasData,isStale:isStale(query,options),refetch:this.refetch,isEnabled:resolveQueryValue(options.enabled,query)!==false}}updateResult(){const prevResult=this.#currentResult;const nextResult=this.createResult(this.#currentQuery,this.options);this.#currentResultState=this.#currentQuery.state;this.#currentResultOptions=this.options;if(this.#currentResultState.data!==void 0)this.#lastQueryWithDefinedData=this.#currentQuery;if(shallowEqualObjects(nextResult,prevResult))return;this.#currentResult=nextResult;const shouldNotifyListeners=()=>{if(!prevResult)return true;const{notifyOnChangeProps}=this.options;const notifyOnChangePropsValue=typeof notifyOnChangeProps===`function`?notifyOnChangeProps():notifyOnChangeProps;if(notifyOnChangePropsValue===`all`||!notifyOnChangePropsValue&&!this.#trackedProps.size)return true;const includedProps=new Set(notifyOnChangePropsValue??this.#trackedProps);if(this.options.throwOnError)includedProps.add(`error`);return Object.keys(this.#currentResult).some(key=>{const typedKey=key;return this.#currentResult[typedKey]!==prevResult[typedKey]&&includedProps.has(typedKey)})};const notifyListeners=shouldNotifyListeners();notifyManager.batch(()=>{if(notifyListeners)this.listeners.forEach(listener=>{listener(this.#currentResult)});this.#client.getQueryCache().notify({query:this.#currentQuery,type:`observerResultsUpdated`})})}#updateQuery(){const query=this.#client.getQueryCache().build(this.#client,this.options);if(query===this.#currentQuery)return;const prevQuery=this.#currentQuery;this.#currentQuery=query;this.#currentQueryInitialState=query.state;if(this.hasListeners()){prevQuery?.removeObserver(this);query.addObserver(this)}}onQueryUpdate(){this.updateResult();if(this.hasListeners())this.#updateTimers()}};function shouldLoadOnMount(query,options){return resolveQueryValue(options.enabled,query)!==false&&query.state.data===void 0&&!(query.state.status===`error`&&resolveQueryValue(options.retryOnMount,query)===false)}function shouldFetchOnMount(query,options){return shouldLoadOnMount(query,options)||query.state.data!==void 0&&shouldFetchOn(query,options,options.refetchOnMount)}function shouldFetchOn(query,options,field){if(resolveQueryValue(options.enabled,query)!==false&&resolveQueryValue(options.staleTime,query)!==`static`){const value=resolveQueryValue(field,query);return value===`always`||value!==false&&isStale(query,options)}return false}function shouldFetchOptionally(query,prevQuery,options,prevOptions){return(query!==prevQuery||resolveQueryValue(prevOptions.enabled,query)===false)&&(!options.suspense||query.state.status!==`error`)&&isStale(query,options)}function isStale(query,options){return resolveQueryValue(options.enabled,query)!==false&&query.isStaleByTime(resolveQueryValue(options.staleTime,query))}var Mutation=class extends Removable{#client;#observers;#mutationCache;#retryer;constructor(config){super();this.#client=config.client;this.mutationId=config.mutationId;this.#mutationCache=config.mutationCache;this.#observers=[];this.state=config.state||getDefaultState();this.setOptions(config.options);this.scheduleGc()}setOptions(options){this.options=options;this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(observer){if(!this.#observers.includes(observer)){this.#observers.push(observer);this.clearGcTimeout();this.#mutationCache.notify({type:`observerAdded`,mutation:this,observer})}}removeObserver(observer){this.#observers=this.#observers.filter(x=>x!==observer);this.scheduleGc();this.#mutationCache.notify({type:`observerRemoved`,mutation:this,observer})}optionalRemove(){if(!this.#observers.length){if(this.state.status===`pending`)this.scheduleGc();else this.#mutationCache.remove(this)}}continue(){return this.#retryer?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(variables){const onContinue=()=>{this.#dispatch({type:`continue`})};const mutationFnContext={client:this.#client,meta:this.options.meta,mutationKey:this.options.mutationKey};const retryer=this.#retryer=createRetryer({fn:()=>{if(!this.options.mutationFn)return Promise.reject(new Error(`No mutationFn found`));return this.options.mutationFn(variables,mutationFnContext)},onFail:(failureCount,error)=>{this.#dispatch({type:`failed`,failureCount,error})},onPause:()=>{this.#dispatch({type:`pause`})},onContinue,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#mutationCache.canRun(this)});const restored=this.state.status===`pending`;const isPaused=!retryer.canStart();try{if(restored)onContinue();else{this.#dispatch({type:`pending`,variables,isPaused});if(this.#mutationCache.config.onMutate)await this.#mutationCache.config.onMutate(variables,this,mutationFnContext);const context=await this.options.onMutate?.(variables,mutationFnContext);if(context!==this.state.context)this.#dispatch({type:`pending`,context,variables,isPaused})}const data=await retryer.start();await this.#mutationCache.config.onSuccess?.(data,variables,this.state.context,this,mutationFnContext);await this.options.onSuccess?.(data,variables,this.state.context,mutationFnContext);await this.#mutationCache.config.onSettled?.(data,null,this.state.variables,this.state.context,this,mutationFnContext);await this.options.onSettled?.(data,null,variables,this.state.context,mutationFnContext);this.#dispatch({type:`success`,data});return data}catch(error){try{await this.#mutationCache.config.onError?.(error,variables,this.state.context,this,mutationFnContext)}catch(e){Promise.reject(e)}try{await this.options.onError?.(error,variables,this.state.context,mutationFnContext)}catch(e){Promise.reject(e)}try{await this.#mutationCache.config.onSettled?.(void 0,error,this.state.variables,this.state.context,this,mutationFnContext)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,error,variables,this.state.context,mutationFnContext)}catch(e){Promise.reject(e)}this.#dispatch({type:`error`,error});throw error}finally{if(this.#retryer===retryer)this.#retryer=void 0;this.#mutationCache.runNext(this)}}#dispatch(action){const reducer=state=>{switch(action.type){case`failed`:return{...state,failureCount:action.failureCount,failureReason:action.error};case`pause`:return{...state,isPaused:true};case`continue`:return{...state,isPaused:false};case`pending`:return{...state,context:action.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:action.isPaused,status:`pending`,variables:action.variables,submittedAt:Date.now()};case`success`:return{...state,data:action.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:false};case`error`:return{...state,data:void 0,error:action.error,failureCount:state.failureCount+1,failureReason:action.error,isPaused:false,status:`error`}}};this.state=reducer(this.state);notifyManager.batch(()=>{this.#observers.forEach(observer=>{observer.onMutationUpdate(action)});this.#mutationCache.notify({mutation:this,type:`updated`,action})})}};function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:false,status:`idle`,variables:void 0,submittedAt:0}}var MutationCache$1=class extends Subscribable{#mutations;#scopes;#mutationId;constructor(config={}){super();this.config=config;this.#mutations=new Set;this.#scopes=new Map;this.#mutationId=0}build(client,options,state){const mutation=new Mutation({client,mutationCache:this,mutationId:++this.#mutationId,options:client.defaultMutationOptions(options),state});this.add(mutation);return mutation}add(mutation){this.#mutations.add(mutation);const scope=scopeFor(mutation);if(typeof scope===`string`){const scopedMutations=this.#scopes.get(scope);if(scopedMutations)scopedMutations.push(mutation);else this.#scopes.set(scope,[mutation])}this.notify({type:`added`,mutation})}remove(mutation){if(this.#mutations.delete(mutation)){const scope=scopeFor(mutation);if(typeof scope===`string`){const scopedMutations=this.#scopes.get(scope);if(scopedMutations){if(scopedMutations.length>1){const index=scopedMutations.indexOf(mutation);if(index!==-1)scopedMutations.splice(index,1)}else if(scopedMutations[0]===mutation)this.#scopes.delete(scope)}}}this.notify({type:`removed`,mutation})}canRun(mutation){const scope=scopeFor(mutation);if(typeof scope===`string`){const firstPendingMutation=this.#scopes.get(scope)?.find(m=>m.state.status===`pending`);return!firstPendingMutation||firstPendingMutation===mutation}else return true}runNext(mutation){const scope=scopeFor(mutation);if(typeof scope===`string`)return(this.#scopes.get(scope)?.find(m=>m!==mutation&&m.state.isPaused))?.continue()??Promise.resolve();else return Promise.resolve()}clear(){notifyManager.batch(()=>{this.#mutations.forEach(mutation=>{this.notify({type:`removed`,mutation})});this.#mutations.clear();this.#scopes.clear()})}getAll(){return Array.from(this.#mutations)}find(filters){const defaultedFilters={exact:true,...filters};return this.getAll().find(mutation=>matchMutation(defaultedFilters,mutation))}findAll(filters={}){return this.getAll().filter(mutation=>matchMutation(filters,mutation))}notify(event){notifyManager.batch(()=>{this.listeners.forEach(listener=>{listener(event)})})}resumePausedMutations(){const pausedMutations=this.getAll().filter(x=>x.state.isPaused);return notifyManager.batch(()=>Promise.all(pausedMutations.map(mutation=>mutation.continue().catch(noop$3))))}};function scopeFor(mutation){return mutation.options.scope?.id}var MutationObserver$1=class extends Subscribable{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super();this.#client=client;this.setOptions(options);this.bindMethods();this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this);this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options);if(!shallowEqualObjects(this.options,prevOptions))this.#client.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#currentMutation,observer:this});if(prevOptions?.mutationKey&&this.options.mutationKey&&hashKey(prevOptions.mutationKey)!==hashKey(this.options.mutationKey))this.reset();else if(this.#currentMutation?.state.status===`pending`)this.#currentMutation.setOptions(this.options)}onSubscribe(){if(this.listeners.size===1&&this.#currentMutation){this.#currentMutation.addObserver(this);this.#updateResult()}}onUnsubscribe(){if(!this.hasListeners())this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult();this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this);this.#currentMutation=void 0;this.#updateResult();this.#notify()}mutate(variables,options){this.#mutateOptions=options;this.#currentMutation?.removeObserver(this);this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options);this.#currentMutation.addObserver(this);return this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??getDefaultState();this.#currentResult={...state,isPending:state.status===`pending`,isSuccess:state.status===`success`,isError:state.status===`error`,isIdle:state.status===`idle`,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.batch(()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables;const onMutateResult=this.#currentResult.context;const context={client:this.#client,meta:this.options.meta,mutationKey:this.options.mutationKey};if(action?.type===`success`){try{this.#mutateOptions.onSuccess?.(action.data,variables,onMutateResult,context)}catch(e){Promise.reject(e)}try{this.#mutateOptions.onSettled?.(action.data,null,variables,onMutateResult,context)}catch(e){Promise.reject(e)}}else if(action?.type===`error`){try{this.#mutateOptions.onError?.(action.error,variables,onMutateResult,context)}catch(e){Promise.reject(e)}try{this.#mutateOptions.onSettled?.(void 0,action.error,variables,onMutateResult,context)}catch(e){Promise.reject(e)}}}this.listeners.forEach(listener=>{listener(this.#currentResult)})})}};var QueryCache$1=class extends Subscribable{#queries;constructor(config={}){super();this.config=config;this.#queries=new Map}build(client,options,state){const queryKey=options.queryKey;const queryHash=options.queryHash??hashQueryKeyByOptions(queryKey,options);let query=this.get(queryHash);if(!query){query=new Query({client,queryKey,queryHash,options:client.defaultQueryOptions(options),state,defaultOptions:client.getQueryDefaults(queryKey)});this.add(query)}return query}add(query){if(!this.#queries.has(query.queryHash)){this.#queries.set(query.queryHash,query);this.notify({type:`added`,query})}}remove(query){const queryInMap=this.#queries.get(query.queryHash);if(queryInMap){query.destroy();if(queryInMap===query)this.#queries.delete(query.queryHash);this.notify({type:`removed`,query})}}clear(){notifyManager.batch(()=>{this.getAll().forEach(query=>{this.remove(query)})})}get(queryHash){return this.#queries.get(queryHash)}getAll(){return[...this.#queries.values()]}find(filters){const defaultedFilters={exact:true,...filters};return this.getAll().find(query=>matchQuery(defaultedFilters,query))}findAll(filters={}){const queries=this.getAll();return Object.keys(filters).length>0?queries.filter(query=>matchQuery(filters,query)):queries}notify(event){notifyManager.batch(()=>{this.listeners.forEach(listener=>{listener(event)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(query=>{query.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(query=>{query.onOnline()})})}};var QueryClient$1=class{#queryCache;#mutationCache;#defaultOptions;#queryDefaults;#mutationDefaults;#mountCount;#unsubscribeFocus;#unsubscribeOnline;constructor(config={}){this.#queryCache=config.queryCache||new QueryCache$1;this.#mutationCache=config.mutationCache||new MutationCache$1;this.#defaultOptions=config.defaultOptions||{};this.#queryDefaults=new Map;this.#mutationDefaults=new Map;this.#mountCount=0}mount(){this.#mountCount++;if(this.#mountCount!==1)return;this.#unsubscribeFocus=focusManager.subscribe(async focused=>{if(focused){await this.resumePausedMutations();this.#queryCache.onFocus()}});this.#unsubscribeOnline=onlineManager.subscribe(async online=>{if(online){await this.resumePausedMutations();this.#queryCache.onOnline()}})}unmount(){this.#mountCount--;if(this.#mountCount!==0)return;this.#unsubscribeFocus?.();this.#unsubscribeFocus=void 0;this.#unsubscribeOnline?.();this.#unsubscribeOnline=void 0}isFetching(filters){return this.#queryCache.findAll({...filters,fetchStatus:`fetching`}).length}isMutating(filters){return this.#mutationCache.findAll({...filters,status:`pending`}).length}getQueryData(queryKey){const options=this.defaultQueryOptions({queryKey});return this.#queryCache.get(options.queryHash)?.state.data}ensureQueryData(options){const defaultedOptions=this.defaultQueryOptions(options);const query=this.#queryCache.build(this,defaultedOptions);const cachedData=query.state.data;if(cachedData===void 0)return this.fetchQuery(options);if(options.revalidateIfStale&&query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime,query)))this.prefetchQuery(defaultedOptions);return Promise.resolve(cachedData)}getQueriesData(filters){return this.#queryCache.findAll(filters).map(({queryKey,state})=>{return[queryKey,state.data]})}setQueryData(queryKey,updater,options){const defaultedOptions=this.defaultQueryOptions({queryKey});const prevData=this.#queryCache.get(defaultedOptions.queryHash)?.state.data;const data=functionalUpdate(updater,prevData);if(data===void 0)return;return this.#queryCache.build(this,defaultedOptions).setData(data,{...options,manual:true})}setQueriesData(filters,updater,options){return notifyManager.batch(()=>this.#queryCache.findAll(filters).map(({queryKey})=>[queryKey,this.setQueryData(queryKey,updater,options)]))}getQueryState(queryKey){const options=this.defaultQueryOptions({queryKey});return this.#queryCache.get(options.queryHash)?.state}removeQueries(filters){const queryCache=this.#queryCache;notifyManager.batch(()=>{queryCache.findAll(filters).forEach(query=>{queryCache.remove(query)})})}resetQueries(filters,options){const queryCache=this.#queryCache;return notifyManager.batch(()=>{const matched=queryCache.findAll(filters);const queriesToRefetch=new Set(matched);matched.forEach(query=>{query.reset()});return this.refetchQueries({type:`active`,predicate:query=>queriesToRefetch.has(query)},options)})}cancelQueries(filters,cancelOptions={}){const defaultedCancelOptions={revert:true,...cancelOptions};const promises=notifyManager.batch(()=>this.#queryCache.findAll(filters).map(query=>query.cancel(defaultedCancelOptions)));return Promise.all(promises).then(noop$3).catch(noop$3)}invalidateQueries(filters,options={}){return notifyManager.batch(()=>{this.#queryCache.findAll(filters).forEach(query=>{query.invalidate()});if(filters?.refetchType===`none`)return Promise.resolve();return this.refetchQueries({...filters,type:filters?.refetchType??filters?.type??`active`},options)})}refetchQueries(filters,options={}){const fetchOptions={...options,cancelRefetch:options.cancelRefetch??true};const promises=notifyManager.batch(()=>this.#queryCache.findAll(filters).filter(query=>!query.isDisabled()&&!query.isStatic()).map(query=>{let promise=query.fetch(void 0,fetchOptions);if(!fetchOptions.throwOnError)promise=promise.catch(noop$3);return query.state.fetchStatus===`paused`?Promise.resolve():promise}));return Promise.all(promises).then(noop$3)}async query(options){const defaultedOptions=this.defaultQueryOptions(options);if(defaultedOptions.retry===void 0)defaultedOptions.retry=false;const query=this.#queryCache.build(this,defaultedOptions);const queryData=query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime,query))?await query.fetch(defaultedOptions):query.state.data;const select=defaultedOptions.select;if(select)return select(queryData);return queryData}fetchQuery(options){const defaultedOptions=this.defaultQueryOptions(options);if(defaultedOptions.retry===void 0)defaultedOptions.retry=false;const query=this.#queryCache.build(this,defaultedOptions);return query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime,query))?query.fetch(defaultedOptions):Promise.resolve(query.state.data)}prefetchQuery(options){return this.fetchQuery(options).then(noop$3).catch(noop$3)}infiniteQuery(options){options._type=`infinite`;return this.query(options)}fetchInfiniteQuery(options){options._type=`infinite`;return this.fetchQuery(options)}prefetchInfiniteQuery(options){return this.fetchInfiniteQuery(options).then(noop$3).catch(noop$3)}ensureInfiniteQueryData(options){options._type=`infinite`;return this.ensureQueryData(options)}resumePausedMutations(){if(onlineManager.isOnline())return this.#mutationCache.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#queryCache}getMutationCache(){return this.#mutationCache}getDefaultOptions(){return this.#defaultOptions}setDefaultOptions(options){this.#defaultOptions=options}setQueryDefaults(queryKey,options){this.#queryDefaults.set(hashKey(queryKey),{queryKey,defaultOptions:options})}getQueryDefaults(queryKey){const defaults=[...this.#queryDefaults.values()];const result={};defaults.forEach(queryDefault=>{if(partialMatchKey(queryKey,queryDefault.queryKey))Object.assign(result,queryDefault.defaultOptions)});return result}setMutationDefaults(mutationKey,options){this.#mutationDefaults.set(hashKey(mutationKey),{mutationKey,defaultOptions:options})}getMutationDefaults(mutationKey){const defaults=[...this.#mutationDefaults.values()];const result={};defaults.forEach(queryDefault=>{if(partialMatchKey(mutationKey,queryDefault.mutationKey))Object.assign(result,queryDefault.defaultOptions)});return result}defaultQueryOptions(options){if(options._defaulted)return options;const defaultedOptions={...this.#defaultOptions.queries,...this.getQueryDefaults(options.queryKey),...options,_defaulted:true};if(!defaultedOptions.queryHash)defaultedOptions.queryHash=hashQueryKeyByOptions(defaultedOptions.queryKey,defaultedOptions);if(defaultedOptions.refetchOnReconnect===void 0)defaultedOptions.refetchOnReconnect=defaultedOptions.networkMode!==`always`;if(defaultedOptions.throwOnError===void 0)defaultedOptions.throwOnError=!!defaultedOptions.suspense;if(!defaultedOptions.networkMode&&defaultedOptions.persister)defaultedOptions.networkMode=`offlineFirst`;if(defaultedOptions.queryFn===skipToken)defaultedOptions.enabled=false;return defaultedOptions}defaultMutationOptions(options){if(options?._defaulted)return options;return{...this.#defaultOptions.mutations,...options?.mutationKey&&this.getMutationDefaults(options.mutationKey),...options,_defaulted:true}}clear(){this.#queryCache.clear();this.#mutationCache.clear()}};var QueryCache=class extends QueryCache$1{find(filters){return super.find(cloneDeepUnref(filters))}findAll(filters={}){return super.findAll(cloneDeepUnref(filters))}};var MutationCache=class extends MutationCache$1{find(filters){return super.find(cloneDeepUnref(filters))}findAll(filters={}){return super.findAll(cloneDeepUnref(filters))}};var QueryClient=class extends QueryClient$1{constructor(config={}){const vueQueryConfig={defaultOptions:config.defaultOptions,queryCache:config.queryCache||new QueryCache,mutationCache:config.mutationCache||new MutationCache};super(vueQueryConfig);this.isRestoring=ref(false)}isFetching(filters={}){return super.isFetching(cloneDeepUnref(filters))}isMutating(filters={}){return super.isMutating(cloneDeepUnref(filters))}getQueryData(queryKey){return super.getQueryData(cloneDeepUnref(queryKey))}ensureQueryData(options){return super.ensureQueryData(cloneDeepUnref(options))}getQueriesData(filters){return super.getQueriesData(cloneDeepUnref(filters))}setQueryData(queryKey,updater,options={}){return super.setQueryData(cloneDeepUnref(queryKey),updater,cloneDeepUnref(options))}setQueriesData(filters,updater,options={}){return super.setQueriesData(cloneDeepUnref(filters),updater,cloneDeepUnref(options))}getQueryState(queryKey){return super.getQueryState(cloneDeepUnref(queryKey))}removeQueries(filters={}){return super.removeQueries(cloneDeepUnref(filters))}resetQueries(filters={},options={}){return super.resetQueries(cloneDeepUnref(filters),cloneDeepUnref(options))}cancelQueries(filters={},options={}){return super.cancelQueries(cloneDeepUnref(filters),cloneDeepUnref(options))}invalidateQueries(filters={},options={}){const filtersCloned=cloneDeepUnref(filters);const optionsCloned=cloneDeepUnref(options);super.invalidateQueries({...filtersCloned,refetchType:`none`},optionsCloned);if(filtersCloned.refetchType===`none`)return Promise.resolve();const refetchFilters={...filtersCloned,type:filtersCloned.refetchType??filtersCloned.type??`active`};return nextTick$1().then(()=>{return super.refetchQueries(refetchFilters,optionsCloned)})}refetchQueries(filters={},options={}){return super.refetchQueries(cloneDeepUnref(filters),cloneDeepUnref(options))}query(options){return super.query(cloneDeepUnref(options))}fetchQuery(options){return super.fetchQuery(cloneDeepUnref(options))}prefetchQuery(options){return super.prefetchQuery(cloneDeepUnref(options))}infiniteQuery(options){return super.infiniteQuery(cloneDeepUnref(options))}fetchInfiniteQuery(options){return super.fetchInfiniteQuery(cloneDeepUnref(options))}prefetchInfiniteQuery(options){return super.prefetchInfiniteQuery(cloneDeepUnref(options))}setDefaultOptions(options){super.setDefaultOptions(cloneDeepUnref(options))}setQueryDefaults(queryKey,options){super.setQueryDefaults(cloneDeepUnref(queryKey),cloneDeepUnref(options))}getQueryDefaults(queryKey){return super.getQueryDefaults(cloneDeepUnref(queryKey))}setMutationDefaults(mutationKey,options){super.setMutationDefaults(cloneDeepUnref(mutationKey),cloneDeepUnref(options))}getMutationDefaults(mutationKey){return super.getMutationDefaults(cloneDeepUnref(mutationKey))}};var VueQueryPlugin={install:(app,options={})=>{const clientKey=getClientKey(options.queryClientKey);let client;if(`queryClient`in options&&options.queryClient)client=options.queryClient;else{const clientConfig=`queryClientConfig`in options?options.queryClientConfig:void 0;client=new QueryClient(clientConfig)}if(!environmentManager.isServer())client.mount();let persisterUnmount=()=>{};if(options.clientPersister){if(client.isRestoring)client.isRestoring.value=true;const[unmount,promise]=options.clientPersister(client);persisterUnmount=unmount;promise.then(()=>{if(client.isRestoring)client.isRestoring.value=false;options.clientPersisterOnSuccess?.(client)})}const cleanup=()=>{client.unmount();persisterUnmount()};if(app.onUnmount)app.onUnmount(cleanup);else{const originalUnmount=app.unmount;app.unmount=function vueQueryUnmount(){cleanup();originalUnmount()}}if(false)app.mixin({beforeCreate(){if(!this._provided){const provideCache={};Object.defineProperty(this,"_provided",{get:()=>provideCache,set:v=>Object.assign(provideCache,v)})}this._provided[clientKey]=client}});else app.provide(clientKey,client)}};function useBaseQuery(Observer,options,queryClient){const client=queryClient||useQueryClient();const defaultedOptions=computed(()=>{let resolvedOptions=options;if(typeof resolvedOptions===`function`)resolvedOptions=resolvedOptions();const clonedOptions=cloneDeepUnref(resolvedOptions);if(typeof clonedOptions.enabled===`function`)clonedOptions.enabled=clonedOptions.enabled();const defaulted=client.defaultQueryOptions(clonedOptions);defaulted._optimisticResults=client.isRestoring?.value?`isRestoring`:`optimistic`;return defaulted});const observer=new Observer(client,defaultedOptions.value);const state=defaultedOptions.value.shallow?shallowReactive(observer.getCurrentResult()):reactive(observer.getCurrentResult());let unsubscribe=()=>{};if(client.isRestoring)watch(client.isRestoring,isRestoring=>{if(!isRestoring){unsubscribe();unsubscribe=observer.subscribe(result=>{updateState(state,result)})}},{immediate:true});const updater=()=>{observer.setOptions(defaultedOptions.value);updateState(state,observer.getCurrentResult())};watch(defaultedOptions,updater);onScopeDispose(()=>{unsubscribe()});const refetch=(...args)=>{updater();return state.refetch(...args)};const suspense=()=>{return new Promise((resolve,reject)=>{let stopWatch=()=>{};const run=()=>{if(defaultedOptions.value.enabled!==false){observer.setOptions(defaultedOptions.value);const optimisticResult=observer.getOptimisticResult(defaultedOptions.value);if(optimisticResult.isStale){stopWatch();observer.fetchOptimistic(defaultedOptions.value).then(resolve,error=>{if(shouldThrowError(defaultedOptions.value.throwOnError,[error,observer.getCurrentQuery()]))reject(error);else resolve(observer.getCurrentResult())})}else{stopWatch();resolve(optimisticResult)}}};run();stopWatch=watch(defaultedOptions,run)})};watch(()=>state.error,error=>{if(state.isError&&!state.isFetching&&shouldThrowError(defaultedOptions.value.throwOnError,[error,observer.getCurrentQuery()]))throw error});const readonlyState=defaultedOptions.value.shallow?shallowReadonly(state):readonly(state);const object=toRefs(readonlyState);for(const key in state)if(typeof state[key]===`function`)object[key]=state[key];object.suspense=suspense;object.refetch=refetch;return object}function useQuery(options,queryClient){return useBaseQuery(QueryObserver,options,queryClient)}function useMutation(options,queryClient){const client=queryClient||useQueryClient();const defaultedOptions=computed(()=>{const resolvedOptions=typeof options===`function`?options():options;return client.defaultMutationOptions(cloneDeepUnref(resolvedOptions))});const observer=new MutationObserver$1(client,defaultedOptions.value);const state=defaultedOptions.value.shallow?shallowReactive(observer.getCurrentResult()):reactive(observer.getCurrentResult());const unsubscribe=observer.subscribe(result=>{updateState(state,result)});const mutate=(...args)=>{observer.mutate(args[0],args[1]).catch(()=>{})};watch(defaultedOptions,()=>{observer.setOptions(defaultedOptions.value)});onScopeDispose(()=>{unsubscribe()});const readonlyState=defaultedOptions.value.shallow?shallowReadonly(state):readonly(state);const resultRefs=toRefs(readonlyState);watch(()=>state.error,error=>{if(error&&shouldThrowError(defaultedOptions.value.throwOnError,[error]))throw error});return{...resultRefs,mutate,mutateAsync:state.mutate,reset:state.reset}}var isAbsolutePath=path=>path.startsWith(`/`);function isRouteComponent$1(component){return typeof component===`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent$1(obj.default)}var assign=Object.assign;function applyToParams(fn,params){const newParams={};for(const key in params){const value=params[key];newParams[key]=isArray$1(value)?value.map(fn):fn(value)}return newParams}var noop$2=()=>{};var isArray$1=Array.isArray;function mergeOptions(defaults,partialOptions){const options={};for(const key in defaults)options[key]=key in partialOptions?partialOptions[key]:defaults[key];return options}var NavigationFailureSymbol=Symbol(``);var NavigationFailureType=function(NavigationFailureType){NavigationFailureType[NavigationFailureType[`aborted`]=4]=`aborted`;NavigationFailureType[NavigationFailureType[`cancelled`]=8]=`cancelled`;NavigationFailureType[NavigationFailureType[`duplicated`]=16]=`duplicated`;return NavigationFailureType}({});function createRouterError(type,params){return assign(new Error,{type,[NavigationFailureSymbol]:true},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}var matchedRouteKey=Symbol(``);var viewDepthKey=Symbol(``);var routerKey=Symbol(``);var routeLocationKey=Symbol(``);var routerViewLocationKey=Symbol(``);function useRouter$1(){return inject$1(routerKey)}function useRoute$1(_name){return inject$1(routeLocationKey)}var isBrowser=typeof document!==`undefined`;var HASH_RE=/#/g;var AMPERSAND_RE=/&/g;var SLASH_RE=/\//g;var EQUAL_RE=/=/g;var IM_RE=/\?/g;var PLUS_RE=/\+/g;var ENC_BRACKET_OPEN_RE=/%5B/g;var ENC_BRACKET_CLOSE_RE=/%5D/g;var ENC_CARET_RE=/%5E/g;var ENC_BACKTICK_RE=/%60/g;var ENC_CURLY_OPEN_RE=/%7B/g;var ENC_PIPE_RE=/%7C/g;var ENC_CURLY_CLOSE_RE=/%7D/g;var ENC_SPACE_RE=/%20/g;function commonEncode(text){return text==null?``:encodeURI(``+text).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text){return commonEncode(text).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text){return commonEncode(text).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,`%3D`)}function encodePath(text){return commonEncode(text).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text){return encodePath(text).replace(SLASH_RE,`%2F`)}function decode$2(text){if(text==null)return null;try{return decodeURIComponent(``+text)}catch{}return``+text}var TRAILING_SLASH_RE=/\/$/;var removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery,location,currentLocation=`/`){let path,query={},searchString=``,hash=``;const hashPos=location.indexOf(`#`);let searchPos=location.indexOf(`?`);searchPos=hashPos>=0&&searchPos>hashPos?-1:searchPos;if(searchPos>=0){path=location.slice(0,searchPos);searchString=location.slice(searchPos,hashPos>0?hashPos:location.length);query=parseQuery(searchString.slice(1))}if(hashPos>=0){path=path||location.slice(0,hashPos);hash=location.slice(hashPos,location.length)}path=resolveRelativePath(path!=null?path:location,currentLocation);return{fullPath:path+searchString+hash,path,query,hash:decode$2(hash)}}function stringifyURL(stringifyQuery,location){const query=location.query?stringifyQuery(location.query):``;return location.path+(query&&`?`)+query+(location.hash||``)}function stripBase(pathname,base){if(!base||!pathname.toLowerCase().startsWith(base.toLowerCase()))return pathname;return pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery,a,b){const aLastIndex=a.matched.length-1;const bLastIndex=b.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a.matched[aLastIndex],b.matched[bLastIndex])&&isSameRouteLocationParams(a.params,b.params)&&stringifyQuery(a.query)===stringifyQuery(b.query)&&a.hash===b.hash}function isSameRouteRecord(a,b){return(a.aliasOf||a)===(b.aliasOf||b)}function isSameRouteLocationParams(a,b){if(Object.keys(a).length!==Object.keys(b).length)return false;for(var key in a)if(!isSameRouteLocationParamsValue(a[key],b[key]))return false;return true}function isSameRouteLocationParamsValue(a,b){return isArray$1(a)?isEquivalentArray(a,b):isArray$1(b)?isEquivalentArray(b,a):(a&&a.valueOf())===(b&&b.valueOf())}function isEquivalentArray(a,b){return isArray$1(b)?a.length===b.length&&a.every((value,i)=>value===b[i]):a.length===1&&a[0]===b}function resolveRelativePath(to,from){if(isAbsolutePath(to))return to;if(!to)return from;const fromSegments=from.split(`/`);const toSegments=to.split(`/`);const lastToSegment=toSegments[toSegments.length-1];if(lastToSegment===`..`||lastToSegment===`.`)toSegments.push(``);let position=fromSegments.length-1;let toPosition;let segment;for(toPosition=0;toPosition<toSegments.length;toPosition++){segment=toSegments[toPosition];if(segment===`.`)continue;if(segment===`..`){if(position>1)position--}else break}return fromSegments.slice(0,position).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}var START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};function normalizeBase(base){if(!base){if(isBrowser){const baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`;base=base.replace(/^\w+:\/\/[^/]+/,``)}else base=`/`}if(base[0]!==`/`&&base[0]!==`#`)base=`/`+base;return removeTrailingSlash(base)}var BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location){return base.replace(BEFORE_HASH_RE,`#`)+location}function getElementPosition(el,offset){const docRect=document.documentElement.getBoundingClientRect();const elRect=el.getBoundingClientRect();return{behavior:offset.behavior,left:elRect.left-docRect.left-(offset.left||0),top:elRect.top-docRect.top-(offset.top||0)}}var computeScrollPosition=()=>history.scrollRestoration===`manual`?{left:window.scrollX,top:window.scrollY}:null;function scrollToPosition(position){let scrollToOptions;if(`el`in position){const positionEl=position.el;const isIdSelector=typeof positionEl===`string`&&positionEl.startsWith(`#`);const el=typeof positionEl===`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el)return;scrollToOptions=getElementPosition(el,position)}else scrollToOptions=position;if(`scrollBehavior`in document.documentElement.style)window.scrollTo(scrollToOptions);else window.scrollTo(scrollToOptions.left!=null?scrollToOptions.left:window.scrollX,scrollToOptions.top!=null?scrollToOptions.top:window.scrollY)}function getScrollKey(path,delta){return(history.state?history.state.position-delta:-1)+path}var scrollPositions=new Map;function saveScrollPosition(key){scrollPositions.set(key,computeScrollPosition())}function getSavedScrollPosition(key){const scroll=scrollPositions.get(key);scrollPositions.delete(key);return scroll}function isRouteLocation(route){return typeof route===`string`||route&&typeof route===`object`}function isRouteName(name){return typeof name===`string`||typeof name===`symbol`}function parseQuery(search){const query={};if(search===``||search===`?`)return query;const searchParams=(search[0]===`?`?search.slice(1):search).split(`&`);for(let i=0;i<searchParams.length;++i){const searchParam=searchParams[i].replace(PLUS_RE,` `);const eqPos=searchParam.indexOf(`=`);const key=decode$2(eqPos<0?searchParam:searchParam.slice(0,eqPos));const value=eqPos<0?null:decode$2(searchParam.slice(eqPos+1));if(key in query){let currentValue=query[key];if(!isArray$1(currentValue))currentValue=query[key]=[currentValue];currentValue.push(value)}else query[key]=value}return query}function stringifyQuery(query){let search=``;for(let key in query){const value=query[key];key=encodeQueryKey(key);if(value==null){if(value!==void 0)search+=(search.length?`&`:``)+key;continue}(isArray$1(value)?value.map(v=>v&&encodeQueryValue(v)):[value&&encodeQueryValue(value)]).forEach(value=>{if(value!==void 0){search+=(search.length?`&`:``)+key;if(value!=null)search+=`=`+value}})}return search}function normalizeQuery(query){const normalizedQuery={};for(const key in query){const value=query[key];if(value!==void 0)normalizedQuery[key]=isArray$1(value)?value.map(v=>v==null?null:``+v):value==null?value:``+value}return normalizedQuery}function useCallbacks(){let handlers=[];function add(handler){handlers.push(handler);return()=>{const i=handlers.indexOf(handler);if(i>-1)handlers.splice(i,1)}}function reset(){handlers=[]}return{add,list:()=>handlers.slice(),reset}}function guardToPromiseFn(guard,to,from,record,name,runWithContext=fn=>fn()){const enterCallbackArray=record&&(record.enterCallbacks[name]=record.enterCallbacks[name]||[]);return()=>new Promise((resolve,reject)=>{const next=valid=>{if(valid===false)reject(createRouterError(4,{from,to}));else if(valid instanceof Error)reject(valid);else if(isRouteLocation(valid))reject(createRouterError(2,{from:to,to:valid}));else{if(enterCallbackArray&&record.enterCallbacks[name]===enterCallbackArray&&typeof valid===`function`)enterCallbackArray.push(valid);resolve()}};const guardReturn=runWithContext(()=>guard.call(record&&record.instances[name],to,from,next));let guardCall=Promise.resolve(guardReturn);if(guard.length<3)guardCall=guardCall.then(next);guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to,from,runWithContext=fn=>fn()){const guards=[];for(const record of matched)for(const name in record.components){let rawComponent=record.components[name];if(guardType!==`beforeRouteEnter`&&!record.instances[name])continue;if(isRouteComponent$1(rawComponent)){const guard=(rawComponent.__vccOpts||rawComponent)[guardType];guard&&guards.push(guardToPromiseFn(guard,to,from,record,name,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);const resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name]=resolved;record.components[name]=resolvedComponent;const guard=(resolvedComponent.__vccOpts||resolvedComponent)[guardType];return guard&&guardToPromiseFn(guard,to,from,record,name,runWithContext)()}))}}return guards}function loadRouteLocation(route){return route.matched.every(record=>record.redirect)?Promise.reject(new Error(`Cannot load a route that redirects.`)):Promise.all(route.matched.map(record=>record.components&&Promise.all(Object.keys(record.components).reduce((promises,name)=>{const rawComponent=record.components[name];if(typeof rawComponent===`function`&&!(`displayName`in rawComponent))promises.push(rawComponent().then(resolved=>{if(!resolved)return Promise.reject(new Error(`Couldn't resolve component "${name}" at "${record.path}". Ensure you passed a function that returns a promise.`));const resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name]=resolved;record.components[name]=resolvedComponent}));return promises},[])))).then(()=>route)}function extractChangingRecords(to,from){const leavingRecords=[];const updatingRecords=[];const enteringRecords=[];const len=Math.max(from.matched.length,to.matched.length);for(let i=0;i<len;i++){const recordFrom=from.matched[i];if(recordFrom){if(to.matched.find(record=>isSameRouteRecord(record,recordFrom)))updatingRecords.push(recordFrom);else leavingRecords.push(recordFrom)}const recordTo=to.matched[i];if(recordTo){if(!from.matched.find(record=>isSameRouteRecord(record,recordTo)))enteringRecords.push(recordTo)}}return[leavingRecords,updatingRecords,enteringRecords]}var createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location){const{pathname,search,hash}=location;const hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1;let pathFromHash=hash.slice(slicePos);if(pathFromHash[0]!==`/`)pathFromHash=`/`+pathFromHash;return stripBase(pathFromHash,``)}return stripBase(pathname,base)+search+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[];let teardowns=[];let pauseState=null;const popStateHandler=({state})=>{const to=createCurrentLocation(base,location);const from=currentLocation.value;const fromState=historyState.value;let delta=0;if(state){currentLocation.value=to;historyState.value=state;if(pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:`pop`,direction:delta?delta>0?`forward`:`back`:``})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);const teardown=()=>{const index=listeners.indexOf(callback);if(index>-1)listeners.splice(index,1)};teardowns.push(teardown);return teardown}function beforeUnloadListener(){const{history}=window;if(!history.state)return;history.replaceState(assign({},history.state,{scroll:computeScrollPosition()}),``)}function destroy(){for(const teardown of teardowns)teardown();teardowns=[];window.removeEventListener(`popstate`,popStateHandler);window.removeEventListener(`pagehide`,beforeUnloadListener)}window.addEventListener(`popstate`,popStateHandler);window.addEventListener(`pagehide`,beforeUnloadListener);return{pauseListeners,listen,destroy}}function buildState(back,current,forward,replaced=false){return{back,current,forward,replaced,position:window.history.length,scroll:null}}function useHistoryStateNavigation(base){const{history,location}=window;const currentLocation={value:createCurrentLocation(base,location)};const historyState={value:history.state};if(!historyState.value)changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history.length-1,replaced:true,scroll:null},true);function changeLocation(to,state,replace){const hashIndex=base.indexOf(`#`);const url=hashIndex>-1?(location.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to:createBaseLocation()+base+to;try{history[replace?`replaceState`:`pushState`](state,``,url);historyState.value=state}catch(err){console.error(err);location[replace?`replace`:`assign`](url)}}function replace(to,data){changeLocation(to,assign({},history.state,buildState(historyState.value.back,to,historyState.value.forward,true),data,{position:historyState.value.position}),true);currentLocation.value=to}function push(to,data){const currentState=assign({},historyState.value,history.state,{forward:to,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,true);changeLocation(to,assign({},buildState(currentLocation.value,to,null),{position:currentState.position+1},data),false);currentLocation.value=to}return{location:currentLocation,state:historyState,push,replace}}function createWebHistory(base){base=normalizeBase(base);const historyNavigation=useHistoryStateNavigation(base);const historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta,triggerListeners=true){if(!triggerListeners)historyListeners.pauseListeners();history.go(delta)}const routerHistory=assign({location:``,base,go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);Object.defineProperty(routerHistory,"location",{enumerable:true,get:()=>historyNavigation.location.value});Object.defineProperty(routerHistory,"state",{enumerable:true,get:()=>historyNavigation.state.value});return routerHistory}var ROOT_TOKEN={type:0,value:``};var VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!isAbsolutePath(path))throw new Error(`Invalid path "${path}"`);function crash(message){throw new Error(`ERR (${state})/"${buffer}": ${message}`)}let state=0;let previousState=state;const tokens=[];let segment;function finalizeSegment(){if(segment)tokens.push(segment);segment=[]}let i=0;let char;let buffer=``;let customRe=``;function consumeBuffer(){if(!buffer)return;if(state===0)segment.push({type:0,value:buffer});else if(state===1||state===2||state===3){if(segment.length>1&&(char===`*`||char===`+`))crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);segment.push({type:1,value:buffer,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})}else crash(`Invalid state to consume buffer`);buffer=``}function addCharToBuffer(){buffer+=char}while(i<path.length){char=path[i++];switch(state){case 0:if(char===`\\`){previousState=state;state=4}else if(char===`/`){if(buffer)consumeBuffer();finalizeSegment()}else if(char===`:`){consumeBuffer();state=1}else addCharToBuffer();break;case 4:addCharToBuffer();state=previousState;break;case 1:if(char===`(`)state=2;else if(VALID_PARAM_RE.test(char))addCharToBuffer();else{consumeBuffer();state=0;if(char!==`*`&&char!==`?`&&char!==`+`)i--}break;case 2:if(char===`)`){if(customRe[customRe.length-1]==`\\`)customRe=customRe.slice(0,-1)+char;else state=3}else customRe+=char;break;case 3:consumeBuffer();state=0;if(char!==`*`&&char!==`?`&&char!==`+`)i--;customRe=``;break;default:crash(`Unknown state`)}}if(state===2)crash(`Unfinished custom RegExp for param "${buffer}"`);consumeBuffer();finalizeSegment();return tokens}var BASE_PARAM_PATTERN=`[^/]+?`;var BASE_PATH_PARSER_OPTIONS={sensitive:false,strict:false,start:true,end:true};var REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(segments,extraOptions){const options=assign({},BASE_PATH_PARSER_OPTIONS,extraOptions);const score=[];let pattern=options.start?`^`:``;const keys=[];for(const segment of segments){const segmentScores=segment.length?[]:[90];if(options.strict&&!segment.length)pattern+=`/`;for(let tokenIndex=0;tokenIndex<segment.length;tokenIndex++){const token=segment[tokenIndex];let subSegmentScore=40+(options.sensitive?.25:0);if(token.type===0){if(!tokenIndex)pattern+=`/`;pattern+=token.value.replace(REGEX_CHARS_RE,`\\$&`);subSegmentScore+=40}else if(token.type===1){const{value,repeatable,optional,regexp}=token;keys.push({name:value,repeatable,optional});const re=regexp?regexp:BASE_PARAM_PATTERN;if(re!==BASE_PARAM_PATTERN){subSegmentScore+=10;try{new RegExp(`(${re})`)}catch(err){throw new Error(`Invalid custom RegExp for param "${value}" (${re}): `+err.message)}}let subPattern=repeatable?`((?:${re})(?:/(?:${re}))*)`:`(${re})`;if(!tokenIndex)subPattern=optional&&segment.length<2?`(?:/${subPattern})`:`/`+subPattern;if(optional)subPattern+=`?`;pattern+=subPattern;subSegmentScore+=20;if(optional)subSegmentScore+=-8;if(repeatable)subSegmentScore+=-20;if(re===`.*`)subSegmentScore+=-50}segmentScores.push(subSegmentScore)}score.push(segmentScores)}if(options.strict&&options.end){const i=score.length-1;score[i][score[i].length-1]+=.7000000000000001}if(!options.strict)pattern+=`/?`;if(options.end)pattern+=`$`;else if(options.strict&&!pattern.endsWith(`/`))pattern+=`(?:/|$)`;const re=new RegExp(pattern,options.sensitive?``:`i`);function parse(path){const match=path.match(re);const params={};if(!match)return null;for(let i=1;i<match.length;i++){const value=match[i]||``;const key=keys[i-1];params[key.name]=value&&key.repeatable?value.split(`/`):value}return params}function stringify(params){let path=``;let avoidDuplicatedSlash=false;for(const segment of segments){if(!avoidDuplicatedSlash||!path.endsWith(`/`))path+=`/`;avoidDuplicatedSlash=false;for(const token of segment)if(token.type===0)path+=token.value;else if(token.type===1){const{value,repeatable,optional}=token;const param=value in params?params[value]:``;if(isArray$1(param)&&!repeatable)throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);const text=isArray$1(param)?param.join(`/`):param;if(!text){if(optional){if(segment.length<2){if(path.endsWith(`/`))path=path.slice(0,-1);else avoidDuplicatedSlash=true}}else throw new Error(`Missing required param "${value}"`)}path+=text}}return path||`/`}return{re,score,keys,parse,stringify}}function compareScoreArray(a,b){let i=0;while(i<a.length&&i<b.length){const diff=b[i]-a[i];if(diff)return diff;i++}if(a.length<b.length)return a.length===1&&a[0]===80?-1:1;else if(a.length>b.length)return b.length===1&&b[0]===80?1:-1;return 0}function comparePathParserScore(a,b){let i=0;const aScore=a.score;const bScore=b.score;while(i<aScore.length&&i<bScore.length){const comp=compareScoreArray(aScore[i],bScore[i]);if(comp)return comp;i++}if(Math.abs(bScore.length-aScore.length)===1){if(isLastScoreNegative(aScore))return 1;if(isLastScoreNegative(bScore))return-1}return bScore.length-aScore.length}function isLastScoreNegative(score){const last=score[score.length-1];return score.length>0&&last[last.length-1]<0}var PATH_PARSER_OPTIONS_DEFAULTS={strict:false,end:true,sensitive:false};function createRouteRecordMatcher(record,parent,options){const parser=tokensToParser(tokenizePath(record.path),options);const matcher=assign(parser,{record,parent,children:[],alias:[]});if(parent){if(!matcher.record.aliasOf===!parent.record.aliasOf)parent.children.push(matcher)}return matcher}function createRouterMatcher(routes,globalOptions){const matchers=[];const matcherMap=new Map;globalOptions=mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS,globalOptions);function getRecordMatcher(name){return matcherMap.get(name)}function addRoute(record,parent,originalRecord){const isRootAdd=!originalRecord;const mainNormalizedRecord=normalizeRouteRecord(record);mainNormalizedRecord.aliasOf=originalRecord&&originalRecord.record;const options=mergeOptions(globalOptions,record);const normalizedRecords=[mainNormalizedRecord];if(`alias`in record){const aliases=typeof record.alias===`string`?[record.alias]:record.alias;for(const alias of aliases)normalizedRecords.push(normalizeRouteRecord(assign({},mainNormalizedRecord,{components:originalRecord?originalRecord.record.components:mainNormalizedRecord.components,path:alias,aliasOf:originalRecord?originalRecord.record:mainNormalizedRecord})))}let matcher;let originalMatcher;for(const normalizedRecord of normalizedRecords){const{path}=normalizedRecord;if(parent&&!isAbsolutePath(path)){const parentPath=parent.record.path;const connectingSlash=parentPath[parentPath.length-1]===`/`?``:`/`;normalizedRecord.path=parent.record.path+(path&&connectingSlash+path)}matcher=createRouteRecordMatcher(normalizedRecord,parent,options);if(originalRecord)originalRecord.alias.push(matcher);else{originalMatcher=originalMatcher||matcher;if(originalMatcher!==matcher)originalMatcher.alias.push(matcher);if(isRootAdd&&record.name&&!isAliasRecord(matcher))removeRoute(record.name)}if(isMatchable(matcher))insertMatcher(matcher);if(mainNormalizedRecord.children){const children=mainNormalizedRecord.children;for(let i=0;i<children.length;i++)addRoute(children[i],matcher,originalRecord&&originalRecord.children[i])}originalRecord=originalRecord||matcher}return originalMatcher?()=>{removeRoute(originalMatcher)}:noop$2}function removeRoute(matcherRef){if(isRouteName(matcherRef)){const matcher=matcherMap.get(matcherRef);if(matcher){matcherMap.delete(matcherRef);matchers.splice(matchers.indexOf(matcher),1);matcher.children.forEach(removeRoute);matcher.alias.forEach(removeRoute)}}else{const index=matchers.indexOf(matcherRef);if(index>-1){matchers.splice(index,1);if(matcherRef.record.name)matcherMap.delete(matcherRef.record.name);matcherRef.children.forEach(removeRoute);matcherRef.alias.forEach(removeRoute)}}}function getRoutes(){return matchers}function insertMatcher(matcher){const index=findInsertionIndex(matcher,matchers);matchers.splice(index,0,matcher);if(matcher.record.name&&!isAliasRecord(matcher))matcherMap.set(matcher.record.name,matcher)}function resolve(location,currentLocation){let matcher;let params={};let path;let name;if(`name`in location&&location.name){matcher=matcherMap.get(location.name);if(!matcher)throw createRouterError(1,{location});name=matcher.record.name;params=assign(pickParams(currentLocation.params,matcher.keys.filter(k=>!k.optional).concat(matcher.parent?matcher.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),location.params&&pickParams(location.params,matcher.keys.map(k=>k.name)));path=matcher.stringify(params)}else if(location.path!=null){path=location.path;matcher=matchers.find(m=>m.re.test(path));if(matcher){params=matcher.parse(path);name=matcher.record.name;matcher.keys.forEach(key=>{if(key.optional&&!params[key.name])delete params[key.name]})}}else{matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m=>m.re.test(currentLocation.path));if(!matcher)throw createRouterError(1,{location,currentLocation});name=matcher.record.name;params=assign({},currentLocation.params,location.params);path=matcher.stringify(params)}const matched=[];let parentMatcher=matcher;while(parentMatcher){matched.unshift(parentMatcher.record);parentMatcher=parentMatcher.parent}return{name,path,params,matched,meta:mergeMetaFields(matched)}}routes.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0;matcherMap.clear()}return{addRoute,resolve,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function pickParams(params,keys){const newParams={};for(const key of keys)if(key in params)newParams[key]=params[key];return newParams}function normalizeRouteRecord(record){const normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};Object.defineProperty(normalized,"mods",{value:{}});return normalized}function normalizeRecordProps(record){const propsObject={};const props=record.props||false;if(`component`in record)propsObject.default=props;else for(const name in record.components)propsObject[name]=typeof props===`object`?props[name]:props;return propsObject}function isAliasRecord(record){while(record){if(record.record.aliasOf)return true;record=record.parent}return false}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign(meta,record.meta),{})}function findInsertionIndex(matcher,matchers){let lower=0;let upper=matchers.length;while(lower!==upper){const mid=lower+upper>>1;if(comparePathParserScore(matcher,matchers[mid])<0)upper=mid;else lower=mid+1}const insertionAncestor=getInsertionAncestor(matcher);if(insertionAncestor)upper=matchers.lastIndexOf(insertionAncestor,upper-1);return upper}function getInsertionAncestor(matcher){let ancestor=matcher;while(ancestor=ancestor.parent)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function useLink$1(props){const router=inject$1(routerKey);const currentRoute=inject$1(routeLocationKey);const route=computed(()=>{const to=unref(props.to);return router.resolve(to)});const activeRecordIndex=computed(()=>{const{matched}=route.value;const{length}=matched;const routeMatched=matched[length-1];const currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;const index=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index>-1)return index;const parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index});const isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params));const isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate(e={}){if(guardEvent(e)){const p=router[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$2);if(props.viewTransition&&typeof document!==`undefined`&&`startViewTransition`in document)document.startViewTransition(()=>p);return p}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}var RouterLink=defineComponent$1({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:true},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:useLink$1,setup(props,{slots}){const link=reactive(useLink$1(props));const{options}=inject$1(routerKey);const elClass=computed(()=>({[getLinkClass(props.activeClass,options.linkActiveClass,`router-link-active`)]:link.isActive,[getLinkClass(props.exactActiveClass,options.linkExactActiveClass,`router-link-exact-active`)]:link.isExactActive}));return()=>{const children=slots.default&&preferSingleVNode(slots.default(link));return props.custom?children:h$1(`a`,{"aria-current":link.isExactActive?props.ariaCurrentValue:null,href:link.href,onClick:link.navigate,class:elClass.value},children)}}});function guardEvent(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(e.button!==void 0&&e.button!==0)return;if(e.currentTarget&&e.currentTarget.getAttribute){const target=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target))return}if(e.preventDefault)e.preventDefault();return true}function includesParams(outer,inner){for(const key in inner){const innerValue=inner[key];const outerValue=outer[key];if(isArray$1(innerValue)){if(!isArray$1(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value,i)=>value.valueOf()!==outerValue[i].valueOf()))return false}else if(innerValue!==outerValue)return false}return true}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}var getLinkClass=(propClass,globalClass,defaultClass)=>propClass!=null?propClass:globalClass!=null?globalClass:defaultClass;var RouterViewImpl=defineComponent$1({name:`RouterView`,inheritAttrs:false,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){const injectedRoute=inject$1(routerViewLocationKey);const routeToDisplay=computed(()=>props.route||injectedRoute.value);const injectedDepth=inject$1(viewDepthKey,0);const depth=computed(()=>{let initialDepth=unref(injectedDepth);const{matched}=routeToDisplay.value;let matchedRoute;while((matchedRoute=matched[initialDepth])&&!matchedRoute.components)initialDepth++;return initialDepth});const matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1));provide(matchedRouteKey,matchedRouteRef);provide(routerViewLocationKey,routeToDisplay);const viewRef=ref();watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance,to,name],[oldInstance,from,_oldName])=>{if(to){to.instances[name]=instance;if(from&&from!==to&&instance&&instance===oldInstance){if(!to.leaveGuards.size)to.leaveGuards=from.leaveGuards;if(!to.updateGuards.size)to.updateGuards=from.updateGuards}}if(instance&&to&&(!from||!isSameRouteRecord(to,from)||!oldInstance))(to.enterCallbacks[name]||[]).forEach(callback=>callback(instance))},{flush:`post`});return()=>{const route=routeToDisplay.value;const currentName=props.name;const matchedRoute=matchedRouteRef.value;const ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});const routePropsOption=matchedRoute.props[currentName];const routeProps=routePropsOption?routePropsOption===true?route.params:typeof routePropsOption===`function`?routePropsOption(route):routePropsOption:null;const onVnodeUnmounted=vnode=>{if(vnode.component.isUnmounted)matchedRoute.instances[currentName]=null};const component=h$1(ViewComponent,assign({},routeProps,attrs,{onVnodeUnmounted,ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data){if(!slot)return null;const slotContent=slot(data);return slotContent.length===1?slotContent[0]:slotContent}var RouterView=RouterViewImpl;function createRouter(options){const matcher=createRouterMatcher(options.routes,options);const parseQuery$1=options.parseQuery||parseQuery;const stringifyQuery$1=options.stringifyQuery||stringifyQuery;const routerHistory=options.history;const beforeGuards=useCallbacks();const beforeResolveGuards=useCallbacks();const afterGuards=useCallbacks();const currentRoute=shallowRef(START_LOCATION_NORMALIZED);const routesVersion=shallowRef(0);let pendingLocation=START_LOCATION_NORMALIZED;if(isBrowser&&options.scrollBehavior&&`scrollRestoration`in history)history.scrollRestoration=`manual`;const normalizeParams=applyToParams.bind(null,paramValue=>``+paramValue);const encodeParams=applyToParams.bind(null,encodeParam);const decodeParams=applyToParams.bind(null,decode$2);function addRoute(parentOrRoute,route){let parent;let record;if(isRouteName(parentOrRoute)){parent=matcher.getRecordMatcher(parentOrRoute);record=route}else record=parentOrRoute;const removeRoute=matcher.addRoute(record,parent);routesVersion.value++;return()=>{removeRoute();routesVersion.value++}}function removeRoute(name){const recordMatcher=matcher.getRecordMatcher(name);if(recordMatcher){matcher.removeRoute(recordMatcher);routesVersion.value++}}function clearRoutes(){matcher.clearRoutes();routesVersion.value++}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name){return!!matcher.getRecordMatcher(name)}function resolve(rawLocation,currentLocation){routesVersion.value;if(typeof rawLocation===`string`){currentLocation=currentLocation||(rawLocation.startsWith(`/`)?START_LOCATION_NORMALIZED:currentRoute.value);const locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path);const matchedRoute=matcher.resolve({path:locationNormalized.path},currentLocation);const href=routerHistory.createHref(locationNormalized.fullPath);return assign(locationNormalized,matchedRoute,{params:decodeParams(matchedRoute.params),redirectedFrom:void 0,href})}currentLocation=assign({},currentLocation||(rawLocation.path!=null&&rawLocation.path.startsWith(`/`)&&!(`name`in rawLocation&&rawLocation.name)?START_LOCATION_NORMALIZED:currentRoute.value));let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{const targetParams=assign({},rawLocation.params);for(const key in targetParams)if(targetParams[key]==null)delete targetParams[key];matcherLocation=assign({},rawLocation,{params:encodeParams(targetParams)});currentLocation.params=encodeParams(currentLocation.params)}const matchedRoute=matcher.resolve(matcherLocation,currentLocation);const hash=rawLocation.hash||``;matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));const fullPath=stringifyURL(stringifyQuery$1,assign({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path}));const href=routerHistory.createHref(fullPath);return assign({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to){return typeof to===`string`?parseURL(parseQuery$1,to,currentRoute.value.path):assign({},to)}function checkCanceledNavigation(to,from){if(pendingLocation!==to)return createRouterError(8,{from,to})}function push(to){return pushWithRedirect(to)}function replace(to){return push(assign(locationAsObject(to),{replace:true}))}function handleRedirectRecord(to,from){const lastMatched=to.matched[to.matched.length-1];if(lastMatched&&lastMatched.redirect){const{redirect}=lastMatched;let newTargetLocation=typeof redirect===`function`?redirect(to,from):redirect;if(typeof newTargetLocation===`string`){newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation};newTargetLocation.params={}}return assign({query:to.query,hash:to.hash,params:newTargetLocation.path!=null?{}:to.params},newTargetLocation)}}function pushWithRedirect(to,redirectedFrom){const targetLocation=pendingLocation=resolve(to);const from=currentRoute.value;const data=to.state;const force=to.force;const replace=to.replace===true;const shouldRedirect=handleRedirectRecord(targetLocation,from);if(shouldRedirect)return pushWithRedirect(assign(locationAsObject(shouldRedirect),{state:typeof shouldRedirect===`object`?assign({},data,shouldRedirect.state):data,force,replace}),redirectedFrom||targetLocation);const toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;if(!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)){failure=createRouterError(16,{to:toLocation,from});handleScroll(from,from,true,false)}return(failure?Promise.resolve(failure):navigate(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,2)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure=>{if(failure){if(isNavigationFailure(failure,2))return pushWithRedirect(assign({replace},locationAsObject(failure.to),{state:typeof failure.to===`object`?assign({},data,failure.to.state):data,force}),redirectedFrom||toLocation)}else failure=finalizeNavigation(toLocation,from,true,replace,data);triggerAfterEach(toLocation,from,failure);return failure})}function checkCanceledNavigationAndReject(to,from){const error=checkCanceledNavigation(to,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn){const app=installedApps.values().next().value;return app&&typeof app.runWithContext===`function`?app.runWithContext(fn):fn()}function navigate(to,from){let guards;const[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to,from);for(const record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});const canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to,from);guards.push(canceledNavigationCheck);return runGuardQueue(guards).then(()=>{guards=[];for(const guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to,from));guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to,from);for(const record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).then(()=>{guards=[];for(const record of enteringRecords)if(record.beforeEnter){if(isArray$1(record.beforeEnter))for(const beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to,from));else guards.push(guardToPromiseFn(record.beforeEnter,to,from))}guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).then(()=>{to.matched.forEach(record=>record.enterCallbacks={});guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to,from,runWithContext);guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).then(()=>{guards=[];for(const guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to,from));guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,8)?err:Promise.reject(err))}function triggerAfterEach(to,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace,data){const error=checkCanceledNavigation(toLocation,from);if(error)return error;const isFirstNavigation=from===START_LOCATION_NORMALIZED;const state=!isBrowser?{}:history.state;if(isPush){if(replace||isFirstNavigation)routerHistory.replace(toLocation.fullPath,assign({scroll:isFirstNavigation&&state&&state.scroll},data));else routerHistory.push(toLocation.fullPath,data)}currentRoute.value=toLocation;handleScroll(toLocation,from,isPush,isFirstNavigation);markAsReady()}let removeHistoryListener;function setupListeners(){if(removeHistoryListener)return;removeHistoryListener=routerHistory.listen((to,_from,info)=>{if(!router.listening)return;const toLocation=resolve(to);const shouldRedirect=handleRedirectRecord(toLocation,router.currentRoute.value);if(shouldRedirect){pushWithRedirect(assign(shouldRedirect,{replace:true,force:true}),toLocation).catch(noop$2);return}pendingLocation=toLocation;const from=currentRoute.value;if(isBrowser&&info.delta)saveScrollPosition(getScrollKey(from.fullPath,info.delta));navigate(toLocation,from).catch(error=>{if(isNavigationFailure(error,12))return error;if(isNavigationFailure(error,2)){pushWithRedirect(assign(locationAsObject(error.to),{force:true}),toLocation).then(failure=>{if(isNavigationFailure(failure,20)&&!info.delta&&info.type===`pop`)routerHistory.go(-1,false)}).catch(noop$2);return Promise.reject()}if(info.delta)routerHistory.go(-info.delta,false);return triggerError(error,toLocation,from)}).then(failure=>{failure=failure||finalizeNavigation(toLocation,from,false);if(failure){if(info.delta&&!isNavigationFailure(failure,8))routerHistory.go(-info.delta,false);else if(info.type===`pop`&&isNavigationFailure(failure,20))routerHistory.go(-1,false)}triggerAfterEach(toLocation,from,failure)}).catch(noop$2)})}let readyHandlers=useCallbacks();let errorListeners=useCallbacks();let ready;function triggerError(error,to,from){markAsReady(error);const list=errorListeners.list();if(list.length)list.forEach(handler=>handler(error,to,from));else console.error(error);return Promise.reject(error)}function isReady(){if(ready&¤tRoute.value!==START_LOCATION_NORMALIZED)return Promise.resolve();return new Promise((resolve,reject)=>{readyHandlers.add([resolve,reject])})}function markAsReady(err){if(!ready){ready=!err;setupListeners();readyHandlers.list().forEach(([resolve,reject])=>err?reject(err):resolve());readyHandlers.reset()}return err}function handleScroll(to,from,isPush,isFirstNavigation){const{scrollBehavior}=options;if(!isBrowser||!scrollBehavior)return Promise.resolve();const scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick$1().then(()=>scrollBehavior(to,from,scrollPosition)).then(position=>to===currentRoute.value&&position&&scrollToPosition(position)).catch(err=>to===currentRoute.value&&triggerError(err,to,from))}const go=delta=>routerHistory.go(delta);let started;const installedApps=new Set;const router={currentRoute,listening:true,addRoute,removeRoute,clearRoutes,hasRoute,getRoutes,resolve,options,push,replace,go,back:()=>go(-1),forward:()=>go(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app){app.component(`RouterLink`,RouterLink);app.component(`RouterView`,RouterView);app.config.globalProperties.$router=router;Object.defineProperty(app.config.globalProperties,"$route",{enumerable:true,get:()=>unref(currentRoute)});if(isBrowser&&!started&¤tRoute.value===START_LOCATION_NORMALIZED){started=true;push(routerHistory.location).catch(err=>{})}const reactiveRoute={};for(const key in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key,{get:()=>currentRoute.value[key],enumerable:true});app.provide(routerKey,router);app.provide(routeLocationKey,shallowReactive(reactiveRoute));app.provide(routerViewLocationKey,currentRoute);const unmountApp=app.unmount;installedApps.add(app);app.unmount=function(){installedApps.delete(app);if(installedApps.size<1){pendingLocation=START_LOCATION_NORMALIZED;removeHistoryListener&&removeHistoryListener();removeHistoryListener=null;currentRoute.value=START_LOCATION_NORMALIZED;started=false;ready=false}unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router}function escapeRegExp(value){return String(value||``).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var TRANSACTION_OUTCOMES=Object.freeze([`none`,`pending`,`committed`,`rolledBack`,`unknown`]);function normalizeTransactionOutcome(value){return TRANSACTION_OUTCOMES.includes(value)?value:``}function normalizeText$1(value,{fallback=``}={}){return String(value||``).trim()||fallback}function toText(value){return String(value??``).trim()}function hasValue(value){if(value==null)return false;if(typeof value===`string`)return normalizeText$1(value).length>0;return true}function normalizeBoolean(value){if(typeof value===`boolean`)return value;if(typeof value===`number`){if(value===1)return true;if(value===0)return false}const normalized=normalizeText$1(value).toLowerCase();if(normalized===`true`||normalized===`1`||normalized===`yes`||normalized===`y`)return true;if(normalized===`false`||normalized===`0`||normalized===`no`||normalized===`n`)return false;throw new TypeError(`Boolean field must be true or false.`)}function normalizeLowerText(value,{fallback=``}={}){return normalizeText$1(value,{fallback}).toLowerCase()}function normalizeObject(value,{fallback={}}={}){if(!isRecord(value))return{...fallback};return value}function isRecord(value){return Boolean(value&&typeof value===`object`&&!Array.isArray(value))}function normalizeArray(value){return Array.isArray(value)?value:[]}function normalizeUniqueTextList(value,{acceptSingle=false}={}){const source=Array.isArray(value)?value:acceptSingle?[value]:[];return Array.from(new Set(source.map(entry=>normalizeText$1(entry)).filter(Boolean)))}function normalizePositiveInteger(value,{fallback=0}={}){const numeric=Number(value);if(!Number.isInteger(numeric)||numeric<1)return fallback;return numeric}function normalizeCanonicalRecordIdText(value,{fallback=null}={}){if(value==null)return fallback;const normalized=String(value).trim();return/^[1-9][0-9]*$/.test(normalized)?normalized:fallback}function normalizeRecordId(value,{fallback=null}={}){if(value==null)return fallback;if(typeof value===`string`)return normalizeCanonicalRecordIdText(value,{fallback});if(typeof value===`number`){if(!Number.isSafeInteger(value)||value<1)return fallback;return normalizeCanonicalRecordIdText(value,{fallback})}if(typeof value===`bigint`){if(value<1n)return fallback;return normalizeCanonicalRecordIdText(value,{fallback})}return fallback}function normalizeSurfacePagesRoot(pagesRootLike){const rawPagesRoot=String(pagesRootLike||``).trim();if(!rawPagesRoot||rawPagesRoot===`/`)return``;return rawPagesRoot.replace(/\\/g,`/`).replace(/\/{2,}/g,`/`).replace(/^\/+|\/+$/g,``)}function normalizeRouteSegment(segmentLike){const segment=String(segmentLike||``).trim();if(!segment)return``;const dynamicMatch=segment.match(/^\[([^\]]+)\]$/);if(dynamicMatch){const paramName=String(dynamicMatch[1]||``).trim();if(!paramName)return``;return`:${paramName}`}return segment}function deriveSurfaceRouteBaseFromPagesRoot(pagesRootLike){const normalizedPagesRoot=normalizeSurfacePagesRoot(pagesRootLike);if(!normalizedPagesRoot)return`/`;const segments=normalizedPagesRoot.split(`/`).map(segment=>normalizeRouteSegment(segment)).filter(Boolean);if(segments.length<1)return`/`;return`/${segments.join(`/`)}`}function createSurfaceRegistry(options={}){const rawSurfaces=options.surfaces;if(!rawSurfaces||typeof rawSurfaces!==`object`)throw new Error(`createSurfaceRegistry requires a surfaces object.`);const normalizedEntries=Object.entries(rawSurfaces).map(([key,value])=>{const sourceDefinition=normalizeObject(value);const normalizedId=normalizeLowerText(sourceDefinition.id||key);if(!normalizedId)return null;const pagesRoot=normalizeSurfacePagesRoot(sourceDefinition.pagesRoot);if(!Object.prototype.hasOwnProperty.call(sourceDefinition,`pagesRoot`)&&pagesRoot===``)throw new Error(`Surface "${normalizedId}" requires pagesRoot (use "" for root).`);return[normalizedId,Object.freeze({...sourceDefinition,id:normalizedId,pagesRoot,routeBase:deriveSurfaceRouteBaseFromPagesRoot(pagesRoot),enabled:sourceDefinition.enabled!==false})]}).filter(Boolean);if(normalizedEntries.length<1)throw new Error(`createSurfaceRegistry requires at least one surface definition.`);const SURFACE_REGISTRY=Object.freeze(Object.fromEntries(normalizedEntries));const fallbackSurfaceId=normalizedEntries[0][0];const requestedDefaultSurfaceId=normalizeLowerText(options.defaultSurfaceId);const DEFAULT_SURFACE_ID=SURFACE_REGISTRY[requestedDefaultSurfaceId]?requestedDefaultSurfaceId:fallbackSurfaceId;function resolveRegisteredSurfaceId(value){const normalized=normalizeLowerText(value);if(SURFACE_REGISTRY[normalized])return normalized;return DEFAULT_SURFACE_ID}function resolveSurfacePagesRoot(surfaceId){return SURFACE_REGISTRY[resolveRegisteredSurfaceId(surfaceId)]?.pagesRoot||``}function resolveSurfaceRouteBase(surfaceId){return SURFACE_REGISTRY[resolveRegisteredSurfaceId(surfaceId)]?.routeBase||`/`}function listSurfaceDefinitions(){return Object.values(SURFACE_REGISTRY)}return Object.freeze({SURFACE_REGISTRY,DEFAULT_SURFACE_ID,resolveRegisteredSurfaceId,resolveSurfacePagesRoot,resolveSurfaceRouteBase,listSurfaceDefinitions})}var API_BASE_PATH=`/api`;var BOOTSTRAP_PATH=`${API_BASE_PATH}/bootstrap`;function normalizePathname$1(pathname){const rawValue=String(pathname||`/`).trim();if(!rawValue)return`/`;const withoutQuery=rawValue.split(`?`)[0].split(`#`)[0];const squashed=(withoutQuery.startsWith(`/`)?withoutQuery:`/${withoutQuery}`).replace(/\/{2,}/g,`/`);if(squashed===`/`)return`/`;return squashed.replace(/\/+$/,``)||`/`}function matchesPathPrefix(pathname,prefix){const normalizedPathname=normalizePathname$1(pathname);const normalizedPrefix=normalizePathname$1(prefix);return normalizedPathname===normalizedPrefix||normalizedPathname.startsWith(`${normalizedPrefix}/`)}function compileSurfaceRouteMatcher(routeBase){const normalizedRouteBase=normalizePathname$1(routeBase);const segments=normalizedRouteBase.split(`/`).filter(Boolean);if(segments.length<1)return Object.freeze({routeBase:`/`,segmentCount:0,staticSegmentCount:0,test(pathname){return normalizePathname$1(pathname).startsWith(`/`)}});const patternSegments=segments.map(segment=>segment.startsWith(`:`)&&segment.length>1?`[^/]+`:escapeRegExp(segment));const pattern=new RegExp(`^/${patternSegments.join(`/`)}(?:$|/)`);const staticSegmentCount=segments.filter(segment=>!(segment.startsWith(`:`)&&segment.length>1)).length;return Object.freeze({routeBase:normalizedRouteBase,segmentCount:segments.length,staticSegmentCount,test(pathname){return pattern.test(normalizePathname$1(pathname))}})}function compareSurfaceRouteSpecificity(left,right){const staticDiff=right.staticSegmentCount-left.staticSegmentCount;if(staticDiff!==0)return staticDiff;const segmentDiff=right.segmentCount-left.segmentCount;if(segmentDiff!==0)return segmentDiff;const lengthDiff=String(right.routeBase||``).length-String(left.routeBase||``).length;if(lengthDiff!==0)return lengthDiff;return String(left.id||``).localeCompare(String(right.id||``))}function createSurfacePathHelpers({defaultSurfaceId,surfaceDefinitions,apiBasePath=API_BASE_PATH}){const normalizedDefaultSurfaceId=normalizeLowerText(defaultSurfaceId);if(!normalizedDefaultSurfaceId)throw new Error(`createSurfacePathHelpers requires defaultSurfaceId.`);if(!Array.isArray(surfaceDefinitions))throw new Error(`createSurfacePathHelpers requires a surfaceDefinitions array.`);const normalizedApiBasePath=normalizePathname$1(apiBasePath);const routedSurfaces=surfaceDefinitions.map(definition=>{const surfaceId=normalizeLowerText(definition?.id);if(!surfaceId)return null;const matcher=compileSurfaceRouteMatcher(definition.routeBase||`/`);return{id:surfaceId,routeBase:matcher.routeBase,segmentCount:matcher.segmentCount,staticSegmentCount:matcher.staticSegmentCount,matcher}}).filter(Boolean).sort(compareSurfaceRouteSpecificity);function matchSurface(pathname){return routedSurfaces.find(surface=>surface.matcher.test(pathname))?.id||normalizedDefaultSurfaceId}function resolveApiNamespace(pathname){if(!matchesPathPrefix(pathname,normalizedApiBasePath))return``;const versionMatch=pathname.slice(normalizedApiBasePath.length).match(/^\/v[0-9]+(?:$|\/)/);if(!versionMatch)return normalizedApiBasePath;return normalizePathname$1(`${normalizedApiBasePath}${versionMatch[0]}`)}function resolveSurfaceFromPathname(pathname){const normalizedPathname=normalizePathname$1(pathname);const apiNamespace=resolveApiNamespace(normalizedPathname);if(!apiNamespace)return matchSurface(normalizedPathname);return matchSurface(normalizePathname$1(normalizedPathname.slice(apiNamespace.length)))}return Object.freeze({resolveSurfaceFromPathname})}var EXTERNAL_LINK_PATTERN=/^[A-Za-z][A-Za-z0-9+.-]*:/;function isExternalLinkTarget(target=``){const normalizedTarget=String(target||``).trim();if(!normalizedTarget)return false;if(normalizedTarget.startsWith(`//`))return true;return EXTERNAL_LINK_PATTERN.test(normalizedTarget)}function splitPathQueryHash(target=``){const normalizedTarget=String(target||``).trim();if(!normalizedTarget)return Object.freeze({pathname:``,search:``,hash:``});const hashIndex=normalizedTarget.indexOf(`#`);const beforeHash=hashIndex>=0?normalizedTarget.slice(0,hashIndex):normalizedTarget;const hash=hashIndex>=0?normalizedTarget.slice(hashIndex):``;const queryIndex=beforeHash.indexOf(`?`);const pathname=queryIndex>=0?beforeHash.slice(0,queryIndex):beforeHash;const search=queryIndex>=0?beforeHash.slice(queryIndex):``;return Object.freeze({pathname,search,hash})}function resolveLinkPath(basePath=`/`,relativePath=`/`){const normalizedRelativePath=String(relativePath||``).trim();if(isExternalLinkTarget(normalizedRelativePath))return normalizedRelativePath;const normalizedBasePath=normalizePathname$1(basePath||`/`);if(!normalizedRelativePath)return normalizedBasePath;const{pathname,search,hash}=splitPathQueryHash(normalizedRelativePath);if(!pathname)return`${normalizedBasePath}${search}${hash}`;const normalizedPathname=normalizePathname$1(pathname.startsWith(`/`)?pathname:`/${pathname}`);return`${normalizedBasePath===`/`?normalizedPathname:normalizedPathname===`/`?normalizedBasePath:`${normalizedBasePath}${normalizedPathname}`}${search}${hash}`}function splitPathAndHash(path=``){const normalizedPath=String(path||``).trim();const hashIndex=normalizedPath.indexOf(`#`);if(hashIndex<0)return{pathWithoutHash:normalizedPath,hash:``};return{pathWithoutHash:normalizedPath.slice(0,hashIndex),hash:normalizedPath.slice(hashIndex)}}function splitPathQueryAndHash(path=``){const{pathWithoutHash,hash}=splitPathAndHash(path);const queryIndex=pathWithoutHash.indexOf(`?`);if(queryIndex<0)return{pathname:pathWithoutHash,queryString:``,hash};return{pathname:pathWithoutHash.slice(0,queryIndex),queryString:pathWithoutHash.slice(queryIndex+1),hash}}function appendQueryString(path=``,queryString=``){const normalizedPath=String(path||``).trim();if(!normalizedPath)return``;const normalizedQuery=String(queryString||``).trim().replace(/^\?+/,``);if(!normalizedQuery)return normalizedPath;const{pathWithoutHash,hash}=splitPathAndHash(normalizedPath);return`${pathWithoutHash}${pathWithoutHash.includes(`?`)?`&`:`?`}${normalizedQuery}${hash}`}function queryStringToObject(queryString=``){const normalizedQueryString=String(queryString||``).trim().replace(/^\?+/,``);if(!normalizedQueryString)return;const params=new URLSearchParams(normalizedQueryString);const query={};for(const[key,value]of params.entries()){if(!Object.prototype.hasOwnProperty.call(query,key)){query[key]=value;continue}if(Array.isArray(query[key])){query[key].push(value);continue}query[key]=[query[key],value]}return query}function redirectToChild(childTarget=``){const normalizedChildTarget=String(childTarget||``).trim();return function redirectToChildRoute(to){const resolvedTarget=resolveLinkPath(String(to.path||`/`),normalizedChildTarget);const{pathname,queryString,hash}=splitPathQueryAndHash(resolvedTarget);return{path:pathname||`/`,query:queryStringToObject(queryString)??to.query,hash:hash||String(to.hash||``)}}}var dashboard_vue_definePage_vue_lang_default={redirect:redirectToChild(`env`)};function _mergeRouteRecord(main,...routeRecords){return routeRecords.reduce((acc,routeRecord)=>{const meta=Object.assign({},acc.meta,routeRecord.meta);const alias=[].concat(acc.alias||[],routeRecord.alias||[]);Object.assign(acc,routeRecord);acc.meta=meta;acc.alias=alias;return acc},main)}var scriptRel=`modulepreload`;var assetsURL=function(dep){return`/`+dep};var seen$1={};var isCssPreloadUrl=function isCssPreloadUrl(url){return url.pathname.endsWith(`.css`)};var preloadOnce=function preloadOnce(seen,href,preload){if(href in seen)return seen[href];const promise=preload();if(!promise){seen[href]=void 0;return}const preloadPromise=promise.then(()=>{seen[href]=void 0},err=>{seen[href]=void 0;throw err});seen[href]=preloadPromise;return preloadPromise};var __vitePreload=function preload(baseModule,deps,importerUrl){let promise=Promise.resolve();if(true&&deps&&deps.length>0){let preloadedHrefs;const cspNonceMeta=document.querySelector(`meta[property=csp-nonce]`);const cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute(`nonce`);function allSettled(promises){return Promise.all(promises.map(p=>Promise.resolve(p).then(value=>({status:`fulfilled`,value}),reason=>({status:`rejected`,reason}))))}function importMetaResolve(specifier){if(import.meta.resolve)return new URL(import.meta.resolve(specifier));return new URL(specifier,import.meta.url)}promise=allSettled(deps.map(depString=>{depString=assetsURL(depString,importerUrl);const dep=importMetaResolve(depString);const isCss=isCssPreloadUrl(dep);return preloadOnce(seen$1,dep.href,()=>{if(preloadedHrefs===void 0){preloadedHrefs={all:new Set,styles:new Set};const links=document.getElementsByTagName(`link`);for(let i=links.length-1;i>=0;i--){const link=links[i];preloadedHrefs.all.add(link.href);if(link.rel===`stylesheet`)preloadedHrefs.styles.add(link.href)}}if((isCss?preloadedHrefs.styles:preloadedHrefs.all).has(dep.href))return;const link=document.createElement(`link`);link.rel=isCss?`stylesheet`:scriptRel;if(!isCss)link.as=`script`;link.crossOrigin=``;link.href=dep.href;if(cspNonce)link.setAttribute(`nonce`,cspNonce);document.body.appendChild(link);if(isCss)return new Promise((res,rej)=>{link.addEventListener(`load`,res);link.addEventListener(`error`,()=>rej(new Error(`Unable to preload CSS for ${dep}`)))})})}).filter(p=>p!==void 0))}function handlePreloadError(err){const e=new Event(`vite:preloadError`,{cancelable:true});e.payload=err;window.dispatchEvent(e);if(!e.defaultPrevented)throw err}return promise.then(res=>{for(const item of res||[]){if(item.status!==`rejected`)continue;handlePreloadError(item.reason)}return baseModule().catch(handlePreloadError)})};var routes=[{path:`/`,name:`/`,component:()=>__vitePreload(()=>import(`./pages-BePUPkVf.js`),__vite__mapDeps([0,1])),meta:{"jskit":{"scope":`global`}}},{path:`/app`,children:[{path:``,name:`/app/`,component:()=>__vitePreload(()=>import(`./app-0jq6SFSn.js`),__vite__mapDeps([2,3,4,5,6,1,7])),meta:{"jskit":{"surface":`app`}}},{path:`learning`,name:`/app/learning`,component:()=>__vitePreload(()=>import(`./learning-6W-aGxBH.js`),__vite__mapDeps([8,9,3,4,5,6,10,11,1,12,13])),meta:{"jskit":{"surface":`app`}}},{path:`project`,children:[{path:`:slug`,name:`/app/project/[slug]`,component:()=>__vitePreload(()=>import(`./project-Bw_8Bd8D.js`).then(n=>n.n),__vite__mapDeps([9,3,4,5,6,10,11,1,12,13])),children:[_mergeRouteRecord({path:`dashboard`,name:`/app/project/[slug]/dashboard`,component:()=>__vitePreload(()=>import(`./dashboard-CUnY0-1W.js`),__vite__mapDeps([14,9,3,4,5,6,10,11,1,12,13])),children:[{path:`:sessionTool`,name:`/app/project/[slug]/dashboard/[sessionTool]`,component:()=>__vitePreload(()=>import(`./_sessionTool_-cw3WaYPb.js`),__vite__mapDeps([15,12,16]))},{path:`access`,children:[{path:``,name:`/app/project/[slug]/dashboard/access/`,component:()=>__vitePreload(()=>import(`./access-oIeDSza-.js`),__vite__mapDeps([17,9,3,4,5,6,10,11,1,12,13,18]))}]},{path:`changes`,children:[{path:``,name:`/app/project/[slug]/dashboard/changes/`,component:()=>__vitePreload(()=>import(`./changes-Db1dzMsx.js`),__vite__mapDeps([19,20,9,3,4,5,6,10,11,1,12,13,21,22,23,24]))}]},{path:`env`,children:[{path:``,name:`/app/project/[slug]/dashboard/env/`,component:()=>__vitePreload(()=>import(`./env-CZritO-9.js`),__vite__mapDeps([25,9,3,4,5,6,10,11,1,12,13,26,22,23,27,28,29]))}]},{path:`health`,children:[{path:``,name:`/app/project/[slug]/dashboard/health/`,component:()=>__vitePreload(()=>import(`./health-LP0Mz2qB.js`),__vite__mapDeps([30,22,23,31]))}]},{path:`history`,children:[{path:``,name:`/app/project/[slug]/dashboard/history/`,component:()=>__vitePreload(()=>import(`./history-DkjaInmh.js`),__vite__mapDeps([32,9,3,4,5,6,10,11,1,12,13,22,23,33,34]))},{path:`:sessionId`,name:`/app/project/[slug]/dashboard/history/[sessionId]`,component:()=>__vitePreload(()=>import(`./_sessionId_-g78evnUW.js`),__vite__mapDeps([35,9,3,4,5,6,10,11,1,12,13,36,37,38,39,26,40,41,42,43,21,44,45,33,46]))}]},{path:`integrations`,children:[{path:``,name:`/app/project/[slug]/dashboard/integrations/`,component:()=>__vitePreload(()=>import(`./integrations-C6_N7WwF.js`),__vite__mapDeps([47,9,3,4,5,6,10,11,1,12,13,48,28,27,49]))}]},{path:`issues`,children:[{path:``,name:`/app/project/[slug]/dashboard/issues/`,component:()=>__vitePreload(()=>import(`./issues-DAJzymvp.js`),__vite__mapDeps([50,9,3,4,5,6,10,11,1,12,13,51,52]))}]},{path:`pages`,children:[{path:``,name:`/app/project/[slug]/dashboard/pages/`,component:()=>__vitePreload(()=>import(`./pages-C31UYhFG.js`),__vite__mapDeps([53,9,3,4,5,6,10,11,1,12,13,22,23,54]))},{path:`:pageId`,name:`/app/project/[slug]/dashboard/pages/[pageId]`,component:()=>__vitePreload(()=>import(`./_pageId_-xB2NWBqF.js`),__vite__mapDeps([55,9,3,4,5,6,10,11,1,12,13]))}]},{path:`project-files`,children:[{path:``,name:`/app/project/[slug]/dashboard/project-files/`,component:()=>__vitePreload(()=>import(`./project-files-CdcCb8jL.js`),__vite__mapDeps([56,37,4,5,9,3,6,10,11,1,12,13,38,39,26,40,22,23,57]))}]},{path:`publish`,children:[{path:``,name:`/app/project/[slug]/dashboard/publish/`,component:()=>__vitePreload(()=>import(`./publish-a6jL_LlB.js`),__vite__mapDeps([58,9,3,4,5,6,10,11,1,12,13,22,23,59]))}]},{path:`pull-requests`,children:[{path:``,name:`/app/project/[slug]/dashboard/pull-requests/`,component:()=>__vitePreload(()=>import(`./pull-requests-DoyqPC5b.js`),__vite__mapDeps([60,9,3,4,5,6,10,11,1,12,13,51,61]))}]},{path:`repository`,children:[{path:``,name:`/app/project/[slug]/dashboard/repository/`,component:()=>__vitePreload(()=>import(`./repository-MUZOzMUA.js`),__vite__mapDeps([62,20,9,3,4,5,6,10,11,1,12,13,21,22,23,24]))}]},{path:`session`,children:[{path:``,name:`/app/project/[slug]/dashboard/session/`,component:()=>__vitePreload(()=>import(`./session-CtbSoHK-.js`),__vite__mapDeps([63,9,3,4,5,6,10,11,1,12,13,22,23,64]))}]},{path:`settings`,children:[{path:``,name:`/app/project/[slug]/dashboard/settings/`,component:()=>__vitePreload(()=>import(`./settings-BdbR3bEK.js`),__vite__mapDeps([65,9,3,4,5,6,10,11,1,12,13,66]))}]}]},dashboard_vue_definePage_vue_lang_default)],meta:{"jskit":{"surface":`app`}}}]}]}];function consoleWarn(message){warn(`Vuetify: ${message}`)}function consoleError(message){warn(`Vuetify error: ${message}`)}function deprecate(original,replacement){replacement=Array.isArray(replacement)?replacement.slice(0,-1).map(s=>`'${s}'`).join(`, `)+` or '${replacement.at(-1)}'`:`'${replacement}'`;warn(`[Vuetify UPGRADE] '${original}' is deprecated, use ${replacement} instead.`)}var IN_BROWSER$1=typeof window!==`undefined`;var SUPPORTS_TOUCH$1=IN_BROWSER$1&&(`ontouchstart`in window||window.navigator.maxTouchPoints>0);var SUPPORTS_MATCH_MEDIA$1=IN_BROWSER$1&&`matchMedia`in window&&typeof window.matchMedia===`function`;var SUPPORTS_OBSERVER=IN_BROWSER$1&&`ResizeObserver`in window;var SUPPORTS_INTERSECTION_OBSERVER=IN_BROWSER$1&&`IntersectionObserver`in window;var SUPPORTS_MUTATION_OBSERVER=IN_BROWSER$1&&`MutationObserver`in window;var __LOGGER_ENABLED__=typeof{}.VITE_LOGGER_ENABLED!==`undefined`&&{}.VITE_LOGGER_ENABLED===`true`;var SETTER_KEY=`__VUE_INSTANCE_SETTERS__`;var seen=null;function onInstance(value){seen=isNullOrUndefined(value)?null:value}function subscribe(){const holders=globalThis[SETTER_KEY];if(!isArray(holders))return;holders.push(onInstance)}subscribe();function getInstanceCompat(){if(!isNull(seen))return seen;return getCurrentInstance$1()}function instanceExists(){return!isNull(getInstanceCompat())}function isFunction(item){return typeof item===`function`}function isString(item){return typeof item===`string`}function isNumber(item){return typeof item===`number`}function isBoolean(item){return typeof item===`boolean`}function isObject$1(item){return typeof item===`object`&&item!==null&&!Array.isArray(item)}function isArray(item){return Array.isArray(item)}function isElement(item){return typeof Element!==`undefined`&&item instanceof Element}function isNull(item){return item===null}function isNullOrUndefined(item){return item==null}function isUndefined(item){return item===void 0}function isSymbol(item){return typeof item===`symbol`}function isNaN$1(item){return isNumber(item)&&Number.isNaN(item)}var UNSAFE_KEYS=new Set([`__proto__`,`constructor`,`prototype`]);function isPlainObject$2(value){if(typeof value!==`object`||value===null||Array.isArray(value))return false;const proto=Object.getPrototypeOf(value);return proto===Object.prototype||proto===null}function mergeDeep$1(target,...sources){const out={};for(const key in target)if(Object.hasOwn(target,key))out[key]=target[key];for(const source of sources){if(!isObject$1(source))continue;for(const key in source){if(UNSAFE_KEYS.has(key))continue;if(!Object.hasOwn(source,key))continue;const sourceValue=source[key];if(isUndefined(sourceValue))continue;const targetValue=out[key];out[key]=isPlainObject$2(sourceValue)&&isPlainObject$2(targetValue)?mergeDeep$1(targetValue,sourceValue):sourceValue}}return out}var idCounter=0;function useId$1(){if(instanceExists())return useId();return`v0-${idCounter++}`}function clamp$2(value,min=0,max=1){if(!Number.isFinite(value))return min;return Math.max(min,Math.min(max,value))}function range(length,start=0){return Array.from({length},(_,index)=>start+index)}function pxToNumber(value,fallback=0){if(!isString(value))return fallback;const parsed=Number.parseFloat(value);return isNaN$1(parsed)?fallback:parsed}function resolveIds(ids,getter){const result=[];for(const id of ids){const item=getter(id);if(!isUndefined(item))result.push(item)}return result}var COMBINING_MARKS=/[\u0300-\u036F]/g;var FINAL_SIGMA=/ς/g;function lower(str){return str.toLowerCase().replace(FINAL_SIGMA,`σ`)}var SPECIAL_LETTERS={ł:`l`,ø:`o`,đ:`d`,ð:`d`,þ:`th`,ħ:`h`,ŧ:`t`,ŋ:`n`,ß:`ss`,æ:`ae`,œ:`oe`,ı:`i`,Ł:`L`,Ø:`O`,Đ:`D`,Ð:`D`,Þ:`Th`,Ħ:`H`,Ŧ:`T`,Ŋ:`N`,ẞ:`Ss`,Æ:`Ae`,Œ:`Oe`};var SPECIAL_LETTER=new RegExp(`[${Object.keys(SPECIAL_LETTERS).join(``)}]`,`g`);function fold(str){return str.normalize(`NFD`).replace(COMBINING_MARKS,``).replace(SPECIAL_LETTER,char=>SPECIAL_LETTERS[char])}function foldWithMap(str,ignoreCase,foldAccents){let folded=``;const map=[];let index=0;for(const char of str){const raw=ignoreCase?lower(char):char;const chunk=foldAccents?fold(raw):raw;folded+=chunk;for(let unit=0;unit<chunk.length;unit++)map.push(index);index+=char.length}map.push(str.length);return{folded,map}}function collect(haystack,needle,matchAll){const ranges=[];let index=haystack.indexOf(needle);while(index!==-1){ranges.push([index,index+needle.length]);if(!matchAll)break;index=haystack.indexOf(needle,index+needle.length)}return ranges}function remap(map,start,end){const sourceStart=map[start];let sourceEnd=map[end];if(end>0&&map[end]===map[end-1]){let index=end;const current=map[end];while(index<map.length&&map[index]===current)index++;sourceEnd=map[index]}return[sourceStart,sourceEnd]}function project(ranges,map){const projected=[];for(const[start,end]of ranges){const span=remap(map,start,end);const last=projected.at(-1);if(!last||last[0]!==span[0]||last[1]!==span[1])projected.push(span)}return projected}function search(text,query,ignoreCase,foldQuery,foldTarget,matchAll){const folded=foldQuery?fold(query):query;const needle=ignoreCase?lower(folded):folded;if(needle.length===0)return[];if(!foldTarget){if(!ignoreCase)return collect(text,needle,matchAll);const lowered=lower(text);if(lowered.length===text.length)return collect(lowered,needle,matchAll)}const{folded:haystack,map}=foldWithMap(text,ignoreCase,foldTarget);return project(collect(haystack,needle,matchAll),map)}function mergeRanges(a,b){const combined=[...a,...b].toSorted((x,y)=>x[0]-y[0]||x[1]-y[1]);const merged=[];for(const range of combined){const last=merged.at(-1);if(last&&range[0]<last[1])continue;merged.push(range)}return merged}function findMatchRanges(text,query,options={}){const{ignoreCase=false,ignoreAccents=false,matchAll=false}=options;const foldQuery=ignoreAccents===true||ignoreAccents===`query`;const foldTarget=ignoreAccents===true||ignoreAccents===`target`;if(foldQuery===foldTarget)return search(text,query,ignoreCase,foldQuery,foldTarget,matchAll);const merged=mergeRanges(search(text,query,ignoreCase,false,false,true),search(text,query,ignoreCase,foldQuery,foldTarget,true));return matchAll?merged:merged.slice(0,1)}var V0Error=class extends Error{name=`V0Error`;code;key;plugin;palette;seed;variant;adapter;prefix;constructor(message,details){const{cause,...rest}=details;super(message,isUndefined(cause)?void 0:{cause});this.code=details.code;for(const[key,value]of Object.entries(rest)){if(UNSAFE_KEYS.has(key))continue;this[key]=value}}};function useContext(key,defaultValue){const context=inject$1(key,defaultValue);if(isUndefined(context))throw new V0Error(`Context "${String(key)}" not found. Ensure it's provided by an ancestor.`,{code:`V0_CONTEXT_MISSING`,key});return context}function provideContext(key,context,app){if(app)app.provide(key,context);else provide(key,context);return context}function createContext(keyOrOptions,defaultValue){if(isString(keyOrOptions)||isSymbol(keyOrOptions)){const _key=keyOrOptions;function _provideContext(context,app){return provideContext(_key,context,app)}function _useContext(){return useContext(_key,defaultValue)}return[_useContext,_provideContext]}const suffix=isObject$1(keyOrOptions)?keyOrOptions.suffix:void 0;function _provideContext(key,context,app){return provideContext(suffix?`${key}:${suffix}`:key,context,app)}function _useContext(key,defaultValue){return useContext(suffix?`${key}:${suffix}`:key,defaultValue)}return[_useContext,_provideContext]}function createTrinity(keyOrUseContext,provideContextOrContext,maybeContext){if(isString(keyOrUseContext)){const[useContext,provideContext]=createContext(keyOrUseContext);const context=provideContextOrContext;return[useContext,(_context=context,app)=>provideContext(_context,app),context]}const provideContext=provideContextOrContext;const context=maybeContext;return[keyOrUseContext,(_context=context,app)=>provideContext(_context,app),context]}var INSTALLED=Symbol.for(`v0:installed-plugins`);function getInstalled(app){const ctx=app._context;return ctx[INSTALLED]??=new Map}function bindPluginContext(app,namespace,context){const record=getInstalled(app).get(namespace);if(record)record.context=context}function createPlugin(options){return{install(app){app.runWithContext(()=>{const installed=getInstalled(app);if(installed.has(options.namespace))return;installed.set(options.namespace,{namespace:options.namespace,devtools:options.devtools===true,inspect:options.inspect});options.provide(app);options.setup?.(app);if(options.devtools);})}}}function deriveKey(namespace){return namespace.startsWith(`v0:`)?namespace.slice(3):namespace}function getPersistedStorage(){return useContext(`v0:storage`)}function createPluginContext(defaultNamespace,factory,config){function createXContext(_options={}){const{namespace=defaultNamespace,persist:_persist,devtools:_devtools,...options}=_options;const context=factory(options);return createTrinity(namespace,context)}function createXPlugin(_options={}){const{namespace=defaultNamespace,persist:shouldPersist,devtools,...options}=_options;const enabled=devtools??config?.devtools??false;const inspect=config?.inspect;let context;return createPlugin({namespace,devtools:enabled,inspect:inspect?context=>inspect(context):void 0,provide:app=>{const[,provide,ctx]=createXContext({...options,namespace});context=ctx;provide(context,app);bindPluginContext(app,namespace,context);if(shouldPersist&&config?.restore){const storage=getPersistedStorage();const key=deriveKey(namespace);const saved=storage.get(key);if(!isNullOrUndefined(saved.value))config.restore(context,saved.value)}},setup:config?.setup||shouldPersist?app=>{const ctx=context;config?.setup?.(ctx,app,options);if(shouldPersist&&config?.persist){const storage=getPersistedStorage();const key=deriveKey(namespace);const stored=storage.get(key);const stop=watch(()=>config.persist(ctx),val=>{stored.value=val});app.onUnmount(stop)}}:void 0})}function useX(namespace=defaultNamespace){if(config?.fallback){if(!hasInjectionContext())return config.fallback(namespace);const provided=inject$1(namespace,void 0);if(!isUndefined(provided))return provided;return config.fallback(namespace)}return useContext(namespace)}return[createXContext,createXPlugin,useX]}var LoggerAdapter=class{};var V0LoggerAdapter=class extends LoggerAdapter{prefix;colors;timestamps;constructor(options={}){super();this.prefix=options.prefix||`v0`;this.colors=options.colors!==false;this.timestamps=options.timestamps!==false}debug(message,...args){this.log(`debug`,`debug`,message,...args)}info(message,...args){this.log(`info`,`info`,message,...args)}warn(message,...args){this.log(`warn`,`warn`,message,...args)}error(message,...args){this.log(`error`,`error`,message,...args)}trace(message,...args){this.log(`trace`,`trace`,message,...args)}fatal(message,...args){this.log(`fatal`,`error`,message,...args)}format(level,message,...args){return[[this.timestamps?this.timestamp():``,`[${this.prefix} ${level.toLowerCase()}]`,message].filter(Boolean).join(` `),...args]}timestamp(){if(!IN_BROWSER$1)return new Date().toISOString();return new Date().toTimeString().split(` `)[0]??``}style(level){if(!this.colors||!IN_BROWSER$1)return``;return{trace:`color: #64748b`,debug:`color: #3b82f6`,info:`color: #10b981`,warn:`color: #f59e0b`,error:`color: #ef4444`,fatal:`color: #dc2626; font-weight: bold`,silent:``}[level]||``}log(level,method,message,...args){const[formattedMessage,...restArgs]=this.format(level,message,...args);const style=this.style(level);if(IN_BROWSER$1&&style&&isFunction(console[method]))console[method](`%c${formattedMessage}`,style,...restArgs);else if(isFunction(console[method]))console[method](formattedMessage,...restArgs)}};function createLogger(options={}){const{adapter=new V0LoggerAdapter({prefix:options.prefix}),level:initialLevel=`info`,enabled:initialEnabled=__LOGGER_ENABLED__}=options;let currentLevel=initialLevel;let isEnabled=initialEnabled;function value(level){return{trace:0,debug:1,info:2,warn:3,error:4,fatal:5,silent:6}[level]??2}function can(level){if(!isEnabled)return false;return value(level)>=value(currentLevel)}function format(message){return message}function debug(message,...args){if(can(`debug`))adapter.debug(format(message),...args)}function info(message,...args){if(can(`info`))adapter.info(format(message),...args)}function warn(message,...args){if(can(`warn`))adapter.warn(format(message),...args)}function error(message,...args){if(can(`error`))adapter.error(format(message),...args)}function trace(message,...args){if(can(`trace`))adapter.trace?.(format(message),...args)}function fatal(message,...args){if(can(`fatal`))adapter.fatal?.(format(message),...args)}function level(newLevel){currentLevel=newLevel}function current(){return currentLevel}function enabled(){return isEnabled}function enable(){isEnabled=true}function disable(){isEnabled=false}return{debug,info,warn,error,trace,fatal,level,current,enabled,enable,disable,adapter}}var NAMESPACE=`v0:logger`;function createFallbackLogger(namespace=NAMESPACE){function format(message,type){return`[${namespace} ${type}] ${message}`}return{debug:(message,...args)=>console.debug(format(message,`debug`),...args),info:(message,...args)=>console.info(format(message,`info`),...args),warn:(message,...args)=>console.warn(format(message,`warn`),...args),error:(message,...args)=>console.error(format(message,`error`),...args),trace:(message,...args)=>console.trace(format(message,`trace`),...args),fatal:(message,...args)=>console.error(format(message,`fatal`),...args),level:()=>{},current:()=>`info`,enabled:()=>true,enable:()=>{},disable:()=>{},adapter:new V0LoggerAdapter({prefix:namespace})}}var[createLoggerContext,createLoggerPlugin,useLoggerContext]=createPluginContext(NAMESPACE,options=>createLogger(options),{fallback:ns=>createFallbackLogger(ns),inspect:ctx=>({level:ctx.current(),enabled:ctx.enabled(),adapter:ctx.adapter.constructor.name}),setup:(context,_app,_options)=>{}});function createScopedLogger(logger,scope){const tag=`[${scope}]`;function wrap(method){return(message,...args)=>method(`${tag} ${message}`,...args)}return{...logger,debug:wrap(logger.debug),info:wrap(logger.info),warn:wrap(logger.warn),error:wrap(logger.error),trace:wrap(logger.trace),fatal:wrap(logger.fatal)}}function useLogger(scope){const logger=useLoggerContext();return isUndefined(scope)||!scope.trim()?logger:createScopedLogger(logger,scope)}function bound(index,max){if(index===Infinity)return max;return clamp$2(Math.trunc(index),0,max)}function createRegistry(options={}){const logger=useLogger();const{events=false,reactive=false}=options;const collection=reactive?shallowReactive(new Map):new Map;const catalog=new Map;const directory=new Map;const cache=new Map;const listeners=new Map;const minted=new WeakSet;const order=[];const version=shallowRef(0);let indexDependentCount=0;let needsReindex=false;let scheduled=false;let minDirtyIndex=Infinity;let maxDirtyIndex=-Infinity;let isBatching=false;let structural=false;let batched=[];let isDisposing=false;function dispatch(event,data){const cbs=listeners.get(event);if(!cbs)return;for(const cb of cbs)cb(data)}function emit(event,data=void 0){if(!events)return;if(isBatching){batched.push({event,data});return}dispatch(event,data)}function on(event,cb){if(!events){logger.warn(`Events are disabled. Initialize with \`createRegistry({ events: true })\` to enable.`);return}if(!listeners.has(event))listeners.set(event,new Set);listeners.get(event).add(cb)}function off(event,cb){if(!events){logger.warn(`Events are disabled. Initialize with \`createRegistry({ events: true })\` to enable.`);return}listeners.get(event)?.delete(cb)}function dispose(){if(isDisposing)return;isDisposing=true;try{clear()}finally{listeners.clear();isDisposing=false}}function get(id){return collection.get(id)}function upsert(id,patch={},event){if(needsReindex)reindex();const existing=get(id);if(!existing)return register({...patch,id});const hasValue=Object.hasOwn(patch,`value`);let value=existing.value;let valueIsIndex=existing.valueIsIndex;if(hasValue){if(isUndefined(patch.value)){value=existing.index;valueIsIndex=true}else{value=patch.value;valueIsIndex=false}if(valueIsIndex!==existing.valueIsIndex){if(valueIsIndex)indexDependentCount++;else indexDependentCount--}if(!Object.is(value,existing.value)){unassign(existing.value,id);assign(value,id)}}Object.assign(existing,patch,{id,index:existing.index,value,valueIsIndex,unregister:existing.unregister});collection.set(id,existing);cache.clear();emit(`update:ticket`,existing);if(event)emit(event,existing);return existing}function browse(value){if(needsReindex)reindex();const bucket=catalog.get(value);return bucket?bucket.slice():void 0}function lookup(index){if(needsReindex)reindex();return directory.get(index)}function has(id){return collection.has(id)}function assign(value,id){const bucket=catalog.get(value);if(bucket){if(!bucket.includes(id))bucket.push(id)}else catalog.set(value,[id])}function unassign(value,id){const bucket=catalog.get(value);if(!bucket)return;const next=bucket.filter(v=>v!==id);if(next.length===0)catalog.delete(value);else catalog.set(value,next)}function keys(){if(reactive)version.value;const cached=cache.get(`keys`);if(!isUndefined(cached))return cached;const out=order.map(ticket=>ticket.id);cache.set(`keys`,out);return out}function values(){if(reactive)version.value;const cached=cache.get(`values`);if(!isUndefined(cached))return cached;const out=order.slice();cache.set(`values`,out);return out}function entries(){if(reactive)version.value;const cached=cache.get(`entries`);if(!isUndefined(cached))return cached;const out=order.map(ticket=>[ticket.id,ticket]);cache.set(`entries`,out);return out}function clear(){order.length=0;catalog.clear();directory.clear();indexDependentCount=0;needsReindex=false;minDirtyIndex=Infinity;maxDirtyIndex=-Infinity;cache.clear();collection.clear();invalidate();emit(`clear:registry`)}function invalidate(){cache.clear();if(isBatching){structural=true;return}version.value++}function defer(){needsReindex=true;if(isBatching||scheduled)return;scheduled=true;queuePostFlushCb(()=>{scheduled=false;if(!needsReindex)return;try{reindex()}catch(error){logger.error(`deferred reindex threw`,error)}})}function batch(fn){if(isBatching)return fn();isBatching=true;structural=false;batched=[];try{return fn()}finally{try{if(needsReindex)reindex()}finally{isBatching=false;const queue=batched;const bump=structural;batched=[];structural=false;cache.clear();try{for(const{event,data}of queue)dispatch(event,data)}finally{if(bump)version.value++}}}}function reindex(){const size=order.length;const start=minDirtyIndex===Infinity?0:minDirtyIndex;const end=maxDirtyIndex===-Infinity?size-1:Math.min(maxDirtyIndex,size-1);const full=start===0&&end===size-1;invalidate();if(full){catalog.clear();directory.clear()}else for(let i=start;i<=end;i++){const ticket=order[i];directory.delete(ticket.index);if(ticket.valueIsIndex)unassign(ticket.value,ticket.id)}for(let i=start;i<=end;i++){const ticket=order[i];if(ticket.valueIsIndex){ticket.value=i;assign(ticket.value,ticket.id)}else if(full)assign(ticket.value,ticket.id);ticket.index=i;directory.set(i,ticket.id)}needsReindex=false;minDirtyIndex=Infinity;maxDirtyIndex=-Infinity;emit(`reindex:registry`)}function register(registration={}){if(needsReindex)reindex();const size=collection.size;const auto=isNullOrUndefined(registration.id);const id=registration.id??useId$1();if(has(id)){logger.warn(`Ticket "${id}" already exists. Use \`upsert()\` to update or check \`has()\` before registering.`);return get(id)}const valueIsUndefined=isUndefined(registration.value);const index=size;const value=valueIsUndefined?index:registration.value;const valueIsIndex=registration.valueIsIndex??valueIsUndefined;if(valueIsIndex)indexDependentCount++;const input={unregister:()=>unregister(id),...registration,id,index,value,valueIsIndex};const ticket=reactive?shallowReactive(input):input;if(auto)minted.add(ticket);order.push(ticket);directory.set(ticket.index,ticket.id);assign(ticket.value,ticket.id);cache.clear();collection.set(ticket.id,ticket);invalidate();emit(`register:ticket`,ticket);return ticket}function unregister(id){const ticket=collection.get(id);if(!ticket)return;if(ticket.valueIsIndex)indexDependentCount--;let orderPos=ticket.index;if(order[orderPos]!==ticket)orderPos=order.indexOf(ticket);if(orderPos!==-1)order.splice(orderPos,1);directory.delete(ticket.index);unassign(ticket.value,ticket.id);cache.clear();collection.delete(ticket.id);const shifted=ticket.index<collection.size;const willReindex=indexDependentCount>0&&shifted;if(!willReindex)invalidate();if(shifted){minDirtyIndex=Math.min(minDirtyIndex,ticket.index);if(willReindex)reindex();else defer()}emit(`unregister:ticket`,ticket)}function onboard(registrations){return batch(()=>registrations.map(registration=>register(registration)))}function toInput(ticket){const input={...ticket};delete input.index;delete input.valueIsIndex;delete input.unregister;if(minted.has(ticket))delete input.id;if(ticket.valueIsIndex)delete input.value;return input}function offboard(ids){const removed=[];const removedIds=new Set;for(const id of ids){if(removedIds.has(id))continue;const ticket=collection.get(id);if(ticket){removed.push(ticket);removedIds.add(id)}}if(removed.length===0)return[];batch(()=>{let w=0;for(const ticket of order)if(!removedIds.has(ticket.id))order[w++]=ticket;order.length=w;let lowest=Infinity;for(const ticket of removed){if(ticket.valueIsIndex)indexDependentCount--;lowest=Math.min(lowest,ticket.index);directory.delete(ticket.index);unassign(ticket.value,ticket.id)}invalidate();for(const ticket of removed)collection.delete(ticket.id);for(const ticket of removed)emit(`unregister:ticket`,ticket);if(lowest<collection.size){minDirtyIndex=Math.min(minDirtyIndex,lowest);if(indexDependentCount>0)reindex();else defer()}});return removed.map(ticket=>toInput(ticket))}function move(id,toIndex){if(needsReindex)reindex();const ticket=collection.get(id);if(!ticket)return void 0;const size=collection.size;const target=bound(toIndex,size-1);const from=ticket.index;if(from===target)return ticket;return batch(()=>{order.splice(from,1);order.splice(target,0,ticket);minDirtyIndex=Math.min(from,target);maxDirtyIndex=Math.max(from,target);reindex();emit(`update:ticket`,ticket);return ticket})}function reorder(ids){if(needsReindex)reindex();if(ids.length!==collection.size)return;const seen=new Set;const next=[];for(const id of ids){if(seen.has(id))return;const ticket=collection.get(id);if(!ticket)return;seen.add(id);next.push(ticket)}batch(()=>{for(const[i,ticket]of next.entries())order[i]=ticket;minDirtyIndex=0;maxDirtyIndex=-Infinity;reindex()})}function seek(direction=`first`,from,predicate){if(collection.size===0)return void 0;if(needsReindex)reindex();const n=order.length;if(!predicate&&isUndefined(from))return direction===`first`?order[0]:order.at(-1);const index=isUndefined(from)?void 0:bound(from,n-1);if(direction===`last`){const start=isUndefined(index)?n-1:index;for(let i=start;i>=0;i--){const ticket=order[i];if(!predicate||predicate(ticket))return ticket}}else{const start=isUndefined(index)?0:index;for(let i=start;i<n;i++){const ticket=order[i];if(!predicate||predicate(ticket))return ticket}}}return{collection,emit,on,off,dispose,has,keys,clear,browse,entries,values,lookup,get,upsert,register,unregister,reindex,move,reorder,seek,batch,onboard,offboard,get size(){return collection.size}}}function createModel(_options={}){const{disabled=false,enroll=true,multiple=false,...options}=_options;const registry=createRegistry(options);const selectedIds=shallowReactive(new Set);const selectedItems=computed(()=>new Set(resolveIds(selectedIds,registry.get)));const selectedValues=computed(()=>{const out=new Set;for(const item of selectedItems.value)out.add(toValue(item.value));return out});function select(id){if(toValue(disabled))return;const item=registry.get(id);if(!item||toValue(item.disabled))return;if(!toValue(multiple))selectedIds.clear();selectedIds.add(id)}function unselect(id){if(toValue(disabled))return;const item=registry.get(id);if(!item||toValue(item.disabled))return;selectedIds.delete(id)}function toggle(id){if(toValue(disabled))return;if(selected(id))unselect(id);else select(id)}function selected(id){return selectedIds.has(id)}function apply(values,_options){const value=values[0];let written=false;for(const id of selectedIds){const item=registry.get(id);if(!item||!isRef(item.value))continue;if(!isUndefined(value))item.value.value=value;written=true}if(written)return;if(!toValue(multiple))selectedIds.clear();if(isUndefined(value))return;const id=registry.browse(toRaw(value))?.values().next().value;if(!isUndefined(id))select(id)}function register(registration={}){const id=registration.id??useId$1();const item={disabled:false,unregister:()=>unregister(id),...registration,isSelected:toRef(()=>selected(id)),id};const ticket=registry.register(item);if(toValue(enroll)&&!toValue(disabled)&&!toValue(ticket.disabled))select(id);return ticket}function unregister(id){selectedIds.delete(id);registry.unregister(id)}function onboard(registrations){return registry.batch(()=>registrations.map(r=>register(r)))}function offboard(ids){for(const id of ids)selectedIds.delete(id);return registry.offboard(ids)}function reset(){selectedIds.clear()}function clear(){reset();registry.clear()}function dispose(){reset();registry.dispose()}return{...registry,disabled,selectedIds,selectedItems,selectedValues,register,onboard,unregister,offboard,clear,dispose,reset,select,unselect,toggle,selected,apply,get size(){return registry.size}}}function createSelection(_options={}){const{enroll=false,mandatory=false,multiple=false,...options}=_options;const model=createModel({...options,multiple,enroll:false});function seek(direction=`first`,from){return model.seek(direction,from,ticket=>!toValue(ticket.disabled))}function mandate(){if(!toValue(mandatory)||model.size===0||model.selectedIds.size>0)return;const ticket=seek(`first`);if(ticket)model.select(ticket.id)}function drain(id){if(toValue(model.disabled))return;if(toValue(mandatory)&&model.selectedIds.size===1)return;model.selectedIds.delete(id)}function unselect(id){if(toValue(model.disabled))return;const item=model.get(id);if(!item||toValue(item.disabled))return;drain(id)}function toggle(id){if(toValue(model.disabled))return;if(model.selectedIds.has(id))unselect(id);else model.select(id)}function apply(values,options){const isMultiple=options?.multiple??toValue(multiple);const currentIds=new Set(model.selectedIds);const targetIds=new Set;if(isMultiple){for(const value of values){const ids=model.browse(toRaw(value));if(isUndefined(ids))continue;for(const id of ids){const ticket=model.get(id);if(!ticket||toValue(ticket.disabled))continue;targetIds.add(id)}}if(toValue(mandatory)&&targetIds.size===0)return;for(const id of currentIds)if(!targetIds.has(id))model.selectedIds.delete(id);for(const id of targetIds)model.selectedIds.add(id)}else{for(const value of values){const ids=model.browse(toRaw(value));if(isUndefined(ids))continue;for(const id of ids)targetIds.add(id)}const next=targetIds.values().next().value;const last=currentIds.values().next().value;if(!isUndefined(last))drain(last);if(!isUndefined(next))model.select(next)}}function register(registration={}){const id=registration.id??useId$1();const decorated={select:()=>model.select(id),unselect:()=>unselect(id),toggle:()=>toggle(id),...registration,id};const ticket=model.register(decorated);if(toValue(enroll)&&!toValue(model.disabled)&&!toValue(ticket.disabled))model.select(ticket.id);if(toValue(mandatory)===`force`)mandate();return ticket}function onboard(registrations){const tickets=model.batch(()=>registrations.map(registration=>register(registration)));if(toValue(mandatory)===`force`)mandate();return tickets}function offboard(ids){return model.offboard(ids).map(input=>{const rest={...input};delete rest.select;delete rest.unselect;delete rest.toggle;return rest})}return{...model,multiple,register,onboard,offboard,unselect,toggle,apply,mandate,seek,get size(){return model.size}}}function createSingle(_options={}){const{mandatory=false,...options}=_options;const registry=createSelection({...options,mandatory,multiple:false});const selectedId=toRef(()=>registry.selectedIds.values().next().value);const selectedItem=toRef(()=>registry.selectedItems.value.values().next().value);const selectedIndex=toRef(()=>selectedItem.value?.index??-1);const selectedValue=toRef(()=>selectedItem.value?.value);return{...registry,selectedId,selectedItem,selectedIndex,selectedValue,get size(){return registry.size}}}function createTokens(tokens={},options={}){const logger=useLogger();const registry=createRegistry({...options,events:true});const cache=new Map;function invalidate(){cache.clear()}registry.on(`register:ticket`,invalidate);registry.on(`unregister:ticket`,invalidate);registry.on(`update:ticket`,invalidate);registry.on(`reindex:registry`,invalidate);registry.on(`clear:registry`,invalidate);registry.onboard(flatten(tokens,options.prefix,!!options.flat));function isAlias(token){return isString(token)&&token.length>2&&token[0]===`{`&&token.at(-1)===`}`}function isTokenAlias(value){return isObject$1(value)&&`$value`in value}function resolve(token,visited=new Set){const cacheKey=isString(token)?token:JSON.stringify(token);if(cache.has(cacheKey))return cache.get(cacheKey);const reference=isTokenAlias(token)?token.$value:token;const isAliasReference=isString(reference)&&isAlias(reference);if(isTokenAlias(token)&&!isAliasReference){cache.set(cacheKey,reference);return reference}const clean=isAliasReference?reference.slice(1,-1):String(reference);if(visited.has(clean)){logger.warn(`Circular alias detected for "${clean}"`);cache.set(cacheKey,void 0);return}visited.add(clean);let found=registry.get(clean);let segments=[];if(!found&&clean.includes(`.`)){const parts=clean.split(`.`);for(let i=parts.length-1;i>0;i--){const prefix=parts.slice(0,i).join(`.`);const suffix=parts.slice(i);const candidate=registry.get(prefix);if(!isUndefined(candidate?.value)){found=candidate;segments=suffix;break}}}if(isUndefined(found?.value)){if(isAliasReference)logger.warn(`Alias not found for "${String(reference)}"`);cache.set(cacheKey,void 0);return}let current=found.value;if(segments.length>0){if(isTokenAlias(current))current=current.$value;for(const segment of segments){if(!isObject$1(current)||UNSAFE_KEYS.has(segment)||!Object.prototype.hasOwnProperty.call(current,segment)){current=void 0;break}current=current[segment];if(isTokenAlias(current))current=current.$value}if(isUndefined(current)){logger.warn(`Path not found inside "${clean}": ${segments.join(`.`)}`);cache.set(cacheKey,void 0);return}}else if(isTokenAlias(current))current=current.$value;const result=isString(current)&&isAlias(current)?resolve(current,visited):current;cache.set(cacheKey,result);return result}return{...registry,resolve,isAlias,get size(){return registry.size}}}function flatten(tokens,prefix=``,flat=false){const flattened=[];const stack=[{tokens,prefix,flat}];while(stack.length>0){const{tokens:currentTokens,prefix:currentPrefix,flat}=stack.pop();const meta={};for(const k in currentTokens){if(!Object.hasOwn(currentTokens,k))continue;if(k.startsWith(`$`))meta[k]=currentTokens[k]}if(Object.keys(meta).length>0&¤tPrefix)flattened.push({id:currentPrefix,value:meta});for(const key in currentTokens){if(!Object.hasOwn(currentTokens,key))continue;if(UNSAFE_KEYS.has(key))continue;if(key.startsWith(`$`))continue;const value=currentTokens[key];const id=currentPrefix?`${currentPrefix}.${key}`:key;if(!isObject$1(value)){flattened.push({id,value});continue}if(`$value`in value){flattened.push({id,value});const inner=value.$value;if(isObject$1(inner)&&!flat)for(const innerKey in inner){if(!Object.hasOwn(inner,innerKey))continue;if(UNSAFE_KEYS.has(innerKey))continue;if(innerKey.startsWith(`$`))continue;const child=inner[innerKey];const childId=`${id}.${innerKey}`;if(!isObject$1(child))flattened.push({id:childId,value:child});else if(`$value`in child)flattened.push({id:childId,value:child});else stack.push({tokens:child,prefix:childId,flat})}continue}if(flat){flattened.push({id,value});continue}stack.push({tokens:value,prefix:id,flat})}}return flattened}var LocaleAdapter=class{};var V0LocaleAdapter=class extends LocaleAdapter{context;constructor(context){super();this.context=context}t(key,...params){const found=this.lookup(key,params);return isUndefined(found)?this.interpolate(key,params):found}ti(key,...params){return this.lookup(key,params)}n(value){const locale=this.context.selectedId.value;if(!IN_BROWSER$1||!locale)return value.toString();return new Intl.NumberFormat(String(locale)).format(value)}lookup(key,params){const locale=this.context.selectedId.value;if(!locale)return void 0;const message=this.context.tokens.get(`${locale}.${key}`)?.value;if(isString(message))return this.interpolate(this.resolve(locale,message),params);if(this.context.fallbackLocale){const fb=this.context.tokens.get(`${this.context.fallbackLocale}.${key}`)?.value;if(isString(fb))return this.interpolate(this.resolve(this.context.fallbackLocale,fb),params)}}resolve(locale,str,visited=new Set){return str.replace(/{([a-zA-Z0-9.\-_]+)}/g,(match,key)=>{const[prefix,...rest]=key.split(`.`);const target=this.context.has(prefix)?prefix:locale;const path=`${target}.${this.context.has(prefix)?rest.join(`.`):key}`;if(visited.has(path))return match;const resolved=this.context.tokens.get(path)?.value;if(isString(resolved))return this.resolve(target,resolved,new Set(visited).add(path));return match})}interpolate(message,args){let result=message;let rest=args;if(rest.length>0&&isObject$1(rest[0])){const variables=rest[0];result=result.replace(/{([a-zA-Z][a-zA-Z0-9_]*)}/g,(match,name)=>{return isUndefined(variables[name])?match:String(variables[name])});rest=rest.slice(1)}result=result.replace(/\{(\d+)\}/g,(match,index)=>{const i=Number.parseInt(index,10);if(!isUndefined(rest[i]))return String(rest[i]);return match});return result}};function createLocale$1(_options={}){const{adapter:externalAdapter,messages={},fallback:fallbackLocale,...options}=_options;const tokens=createTokens(messages);const registry=createSingle({...options,reactive:true});for(const id in messages){registry.register({id});if(id===options.default&&!registry.selectedId.value)registry.select(id)}const adapter=externalAdapter??new V0LocaleAdapter({tokens,selectedId:registry.selectedId,fallbackLocale,has:id=>registry.has(id)});function t(key,...params){return adapter.t(key,...params)}function ti(key,...params){return adapter.ti(key,...params)}function n(value){return adapter.n(value)}function register(registration={}){const{messages:msgs,...rest}=registration;if(msgs&&rest.id&&!registry.has(rest.id))tokens.onboard(flatten({[rest.id]:msgs}));return registry.register(rest)}return{...registry,t,ti,n,register,adapter,get size(){return registry.size}}}function toArray$1(value){return isNullOrUndefined(value)?[]:isArray(value)?value:[value]}function useEventListener(target,event,listener,options){const cleanups=[];function cleanup(){for(const fn of cleanups)fn();cleanups.length=0}function register(el,event,listener,options){el.addEventListener(event,listener,options);return()=>el.removeEventListener(event,listener,options)}const stopWatcher=watch(()=>[toValue(target),toValue(event),unref(listener),toValue(options)],([el,events,listeners,opts])=>{cleanup();if(!el)return;const eventList=toArray$1(events);const listenerList=toArray$1(listeners);for(const event of eventList)for(const listenerFn of listenerList)cleanups.push(register(el,event,listenerFn,opts))},{immediate:true,flush:`post`});function stop(){stopWatcher();cleanup()}onScopeDispose(stop,true);return stop}function useWindowEventListener(event,listener,options){return IN_BROWSER$1?useEventListener(window,event,listener,options):()=>{}}function fromInstance(instance){const el=instance.$el;if(isElement(el))return el;let tree=instance.$?.subTree;while(!isNullOrUndefined(tree?.component))tree=tree.component.subTree;const end=tree?.anchor;if(isNullOrUndefined(end))return void 0;let node=(tree?.el)?.nextSibling;while(!isNullOrUndefined(node)&&node!==end){if(isElement(node))return node;node=node.nextSibling}}function toElement(target){if(!target)return void 0;if(isElement(target))return target;const raw=isFunction(target)?target():isObject$1(target)&&`value`in target?target.value:target;if(!raw)return void 0;if(isElement(raw))return raw;if(isObject$1(raw)&&`$el`in raw)return fromInstance(raw)}function createHydration(){const isHydrated=shallowRef(false);const isSettled=shallowRef(false);function hydrate(){isHydrated.value=true}function settle(){isSettled.value=true}return{isHydrated:shallowReadonly(isHydrated),isSettled:shallowReadonly(isSettled),hydrate,settle}}function createFallbackHydration(){return{isHydrated:shallowReadonly(shallowRef(true)),isSettled:shallowReadonly(shallowRef(true)),hydrate:()=>{},settle:()=>{}}}var[createHydrationContext,createHydrationPlugin,useHydration$1]=createPluginContext(`v0:hydration`,()=>createHydration(),{fallback:()=>createFallbackHydration(),setup:(context,app)=>{const{mount}=app;app.mount=(...args)=>{const vm=mount(...args);nextTick$1().then(()=>{context.hydrate();nextTick$1().then(()=>context.settle())});app.mount=mount;return vm}}});function createObserver(target,userCallback,config){const{isHydrated}=useHydration$1();const resolved=toRef(()=>toElement(target));const observer=shallowRef(void 0);const isPaused=shallowRef(false);const isActive=toRef(()=>!!observer.value&&!isPaused.value);function invoke(entries){config.onEntry?.(entries);userCallback(entries);if(config.once){if(config.shouldStop?config.shouldStop(entries):true)stop()}}function setup(){if(isNull(observer.value))return;const el=resolved.value;if(!isHydrated.value||!config.supports||!isElement(el)||isPaused.value)return;observer.value=config.create(invoke);config.observe(observer.value,el);if(config.immediate){const entries=config.immediate(el);if(config.onceIncludesImmediate)invoke(entries);else{config.onEntry?.(entries);userCallback(entries)}}}watch(resolved,(el,oldEl)=>{if(oldEl||observer.value)cleanup();if(isHydrated.value&&isElement(el))setup()},{immediate:true});let stopHydrationWatch;if(!isHydrated.value)stopHydrationWatch=watch(()=>isHydrated.value,hydrated=>{if(hydrated&&isElement(resolved.value)&&!observer.value){setup();stopHydrationWatch?.();stopHydrationWatch=void 0}});function cleanup(){if(observer.value){observer.value.disconnect();observer.value=void 0}}function pause(){isPaused.value=true;config.onPause?.();observer.value?.disconnect()}function resume(){isPaused.value=false;setup()}function stop(){stopHydrationWatch?.();stopHydrationWatch=void 0;cleanup();observer.value=null}onScopeDispose(stop,true);return{isActive:shallowReadonly(isActive),isPaused:shallowReadonly(isPaused),pause,resume,stop}}function measure(el){const rect=el.getBoundingClientRect();const style=getComputedStyle(el);const padding={top:pxToNumber(style.paddingTop),left:pxToNumber(style.paddingLeft),right:pxToNumber(style.paddingRight),bottom:pxToNumber(style.paddingBottom)};const paddingX=padding.left+padding.right;const paddingY=padding.top+padding.bottom;const borderX=pxToNumber(style.borderLeftWidth)+pxToNumber(style.borderRightWidth);const borderY=pxToNumber(style.borderTopWidth)+pxToNumber(style.borderBottomWidth);const outer=style.boxSizing===`border-box`;const resolvedX=pxToNumber(style.width,rect.width);const resolvedY=pxToNumber(style.height,rect.height);const width={border:outer?resolvedX:resolvedX+paddingX+borderX,content:Math.max(0,outer?resolvedX-paddingX-borderX:resolvedX)};const height={border:outer?resolvedY:resolvedY+paddingY+borderY,content:Math.max(0,outer?resolvedY-paddingY-borderY:resolvedY)};const vertical=isString(style.writingMode)&&style.writingMode.startsWith(`vertical`);const inline=vertical?height:width;const block=vertical?width:height;return{contentRect:{width:width.content,height:height.content,top:padding.top,left:padding.left},borderBoxSize:[{inlineSize:inline.border,blockSize:block.border}],contentBoxSize:[{inlineSize:inline.content,blockSize:block.content}],target:el}}function useResizeObserver(target,callback,options={}){return createObserver(target,callback,{supports:SUPPORTS_OBSERVER,once:options.once,create:cb=>new ResizeObserver(entries=>{cb(entries.map(e=>{const sizes=e.borderBoxSize&&e.contentBoxSize?e:measure(e.target);return{contentRect:{width:e.contentRect.width,height:e.contentRect.height,top:e.contentRect.top,left:e.contentRect.left},borderBoxSize:sizes.borderBoxSize,contentBoxSize:sizes.contentBoxSize,target:e.target}}))}),observe:(obs,el)=>obs.observe(el,{box:options.box??`content-box`}),immediate:options.immediate?el=>[measure(el)]:void 0})}function useElementSize(target){const width=shallowRef(0);const height=shallowRef(0);const{pause:_pause,resume,stop,isActive,isPaused}=useResizeObserver(target,entries=>{const entry=entries[0];if(entry){width.value=entry.contentRect.width;height.value=entry.contentRect.height}},{immediate:true});function pause(){width.value=0;height.value=0;_pause()}return{width:shallowReadonly(width),height:shallowReadonly(height),isActive:shallowReadonly(isActive),isPaused:shallowReadonly(isPaused),pause,resume,stop}}function useTimer(handler,options={}){const{duration=1e3,repeat=false}=options;function resolveDuration(){return toValue(duration)}const remaining=shallowRef(resolveDuration());const isActive=shallowRef(false);const isPaused=shallowRef(false);let timeoutId;let trackingId;let startedAt=0;let budget=remaining.value;function clearTimer(){if(!isUndefined(timeoutId)){globalThis.clearTimeout(timeoutId);timeoutId=void 0}}function startTracking(){stopTracking();if(!IN_BROWSER$1)return;trackingId=globalThis.setInterval(()=>{if(!isActive.value||isPaused.value)return;const elapsed=Date.now()-startedAt;remaining.value=Math.max(0,budget-elapsed)},100)}function stopTracking(){if(!isUndefined(trackingId)){globalThis.clearInterval(trackingId);trackingId=void 0}}function fire(){clearTimer();stopTracking();handler();if(repeat)begin(resolveDuration());else{isActive.value=false;remaining.value=0}}function begin(ms){clearTimer();stopTracking();budget=ms;startedAt=Date.now();remaining.value=ms;isActive.value=true;isPaused.value=false;timeoutId=globalThis.setTimeout(fire,ms);startTracking()}function start(){const ms=resolveDuration();if(ms<0)return;begin(ms)}function stop(){clearTimer();stopTracking();isActive.value=false;isPaused.value=false;remaining.value=resolveDuration()}function pause(){if(!isActive.value||isPaused.value)return;const elapsed=Date.now()-startedAt;budget=Math.max(0,budget-elapsed);remaining.value=budget;clearTimer();stopTracking();isPaused.value=true}function resume(){if(!isPaused.value)return;isPaused.value=false;startedAt=Date.now();timeoutId=globalThis.setTimeout(fire,budget);startTracking()}onScopeDispose(()=>{clearTimer();stopTracking()},true);return{start,stop,pause,resume,remaining,isActive,isPaused}}function useIntersectionObserver(target,callback,options={}){const isIntersecting=shallowRef(false);return{...createObserver(target,callback,{supports:SUPPORTS_INTERSECTION_OBSERVER,once:options.once,create:cb=>new IntersectionObserver(entries=>{cb(entries.map(e=>({boundingClientRect:e.boundingClientRect,intersectionRatio:e.intersectionRatio,intersectionRect:e.intersectionRect,isIntersecting:e.isIntersecting,rootBounds:e.rootBounds,target:e.target,time:e.time})))},{root:options.root??null,rootMargin:options.rootMargin??`0px`,threshold:options.threshold??0}),observe:(obs,el)=>obs.observe(el),onEntry:entries=>{const latest=entries.at(-1);if(latest)isIntersecting.value=latest.isIntersecting},onPause:()=>{isIntersecting.value=false},shouldStop:entries=>entries.at(-1)?.isIntersecting??false,immediate:options.immediate?el=>{return[{boundingClientRect:el.getBoundingClientRect(),intersectionRatio:0,intersectionRect:new DOMRect(0,0,0,0),isIntersecting:false,rootBounds:null,target:el,time:performance.now()}]}:void 0}),isIntersecting:shallowReadonly(isIntersecting)}}function useElementIntersection(target,options={}){const isIntersecting=shallowRef(false);const intersectionRatio=shallowRef(0);const{pause:_pause,resume,stop,isActive,isPaused}=useIntersectionObserver(target,entries=>{const entry=entries.at(-1);if(entry){isIntersecting.value=entry.isIntersecting;intersectionRatio.value=entry.intersectionRatio}},{immediate:true,...options});function pause(){isIntersecting.value=false;intersectionRatio.value=0;_pause()}return{isIntersecting:shallowReadonly(isIntersecting),intersectionRatio:shallowReadonly(intersectionRatio),isActive,isPaused,pause,resume,stop}}function merge(ranges){const sorted=ranges.filter(span=>span[0]<span[1]).toSorted((a,b)=>a[0]-b[0]);const merged=[];for(const span of sorted){const last=merged.at(-1);if(last&&span[0]<=last[1])last[1]=Math.max(last[1],span[1]);else merged.push([span[0],span[1]])}return merged}function chunk$1(text,ranges){const chunks=[];let cursor=0;for(const[start,end]of ranges){if(cursor<start)chunks.push({text:text.slice(cursor,start),match:false});chunks.push({text:text.slice(start,end),match:true});cursor=end}if(cursor<text.length)chunks.push({text:text.slice(cursor),match:false});return chunks}function find(text,query,options){const spans=[];for(const term of toArray$1(query).filter(Boolean))spans.push(...findMatchRanges(text,term,options));return merge(spans)}function toHighlight(text,query,options={}){const _text=toValue(text);const _query=toValue(query);const _matches=toValue(options.matches);const matchAll=toValue(options.matchAll)??false;const ignoreCase=toValue(options.ignoreCase)??false;const ignoreAccents=toValue(options.ignoreAccents)??false;if(_matches?.length)return chunk$1(_text,merge(_matches));if(_query){const ranges=find(_text,_query,{matchAll,ignoreCase,ignoreAccents});return ranges.length>0?chunk$1(_text,ranges):[{text:_text,match:false}]}return[{text:_text,match:false}]}var BREAKPOINT_ORDER=[`xs`,`sm`,`md`,`lg`,`xl`,`xxl`];function createDefaultBreakpoints(){return{mobileBreakpoint:`lg`,breakpoints:{xs:0,sm:600,md:840,lg:1145,xl:1545,xxl:2138}}}function createBreakpoints(_options={}){const{ssr,...options}=_options;const defaults=createDefaultBreakpoints();const{mobileBreakpoint,breakpoints}=mergeDeep$1(defaults,options);const sorted=Object.entries(breakpoints).toSorted((a,b)=>a[1]-b[1]);const names=sorted.map(([n])=>n);const mb=isNumber(mobileBreakpoint)?mobileBreakpoint:breakpoints[mobileBreakpoint]??breakpoints.md;const initialWidth=ssr?ssr.clientWidth:IN_BROWSER$1?window.innerWidth:0;const initialHeight=ssr?ssr.clientHeight??0:IN_BROWSER$1?window.innerHeight:0;const name=shallowRef(`xs`);const width=shallowRef(initialWidth);const height=shallowRef(initialHeight);const isMobile=shallowRef(false);const xs=shallowRef(false);const sm=shallowRef(false);const md=shallowRef(false);const lg=shallowRef(false);const xl=shallowRef(false);const xxl=shallowRef(false);const smAndUp=shallowRef(false);const mdAndUp=shallowRef(false);const lgAndUp=shallowRef(false);const xlAndUp=shallowRef(false);const smAndDown=shallowRef(false);const mdAndDown=shallowRef(false);const lgAndDown=shallowRef(false);const xlAndDown=shallowRef(false);function resolve(value,media){let current=`xs`;for(let i=sorted.length-1;i>=0;i--){const px=sorted[i][1];if(media?window.matchMedia(`(min-width: ${px}px)`).matches:value>=px){current=sorted[i][0];break}}const index=names.indexOf(current);const mobile=isNumber(mb)?media?!window.matchMedia(`(min-width: ${mb}px)`).matches:value<mb:index<names.indexOf(mobileBreakpoint);return{current,index,mobile}}function apply({current,mobile}){const index=BREAKPOINT_ORDER.indexOf(current);name.value=current;isMobile.value=mobile;xs.value=current===`xs`;sm.value=current===`sm`;md.value=current===`md`;lg.value=current===`lg`;xl.value=current===`xl`;xxl.value=current===`xxl`;smAndUp.value=index>=1;mdAndUp.value=index>=2;lgAndUp.value=index>=3;xlAndUp.value=index>=4;smAndDown.value=index<=1;mdAndDown.value=index<=2;lgAndDown.value=index<=3;xlAndDown.value=index<=4}apply(resolve(initialWidth,!ssr&&IN_BROWSER$1&&SUPPORTS_MATCH_MEDIA$1));let listening=false;function listen(){if(listening||!IN_BROWSER$1)return;listening=true;useWindowEventListener(`resize`,()=>{update()},{passive:true})}function update(){if(!IN_BROWSER$1)return;listen();width.value=window.innerWidth;height.value=window.innerHeight;apply(resolve(width.value,SUPPORTS_MATCH_MEDIA$1))}if(!ssr)listen();return{breakpoints,mobileBreakpoint,name:readonly(name),width:readonly(width),height:readonly(height),isMobile:readonly(isMobile),xs:readonly(xs),sm:readonly(sm),md:readonly(md),lg:readonly(lg),xl:readonly(xl),xxl:readonly(xxl),smAndUp:readonly(smAndUp),mdAndUp:readonly(mdAndUp),lgAndUp:readonly(lgAndUp),xlAndUp:readonly(xlAndUp),smAndDown:readonly(smAndDown),mdAndDown:readonly(mdAndDown),lgAndDown:readonly(lgAndDown),xlAndDown:readonly(xlAndDown),ssr:!!ssr,update}}var RtlAdapter=class{dispose};var V0RtlAdapter=class extends RtlAdapter{setup(app,context,target){if(IN_BROWSER$1){if(isNull(target))return;const targetEl=target instanceof HTMLElement?target:isString(target)?document.querySelector(target):document.documentElement;if(!targetEl)return;targetEl.dir=context.isRtl.value?`rtl`:`ltr`;this.dispose=watch(context.isRtl,value=>{targetEl.dir=value?`rtl`:`ltr`})}else{const head=app._context?.provides?.usehead??app._context?.provides?.head;if(head?.push){const entry=head.push({htmlAttrs:{dir:context.isRtl.value?`rtl`:`ltr`}});const stop=watch(context.isRtl,rtl=>entry.patch?.({htmlAttrs:{dir:rtl?`rtl`:`ltr`}}));this.dispose=()=>{stop();entry.dispose?.()}}}}};function createRtl$1(options={}){const adapter=options.adapter??new V0RtlAdapter;const isRtl=shallowRef(options.default??false);function toggle(){isRtl.value=!isRtl.value}return{isRtl,toggle,adapter,dispose:()=>adapter.dispose?.()}}var IN_BROWSER=typeof window!==`undefined`;var SUPPORTS_INTERSECTION=IN_BROWSER&&`IntersectionObserver`in window;var SUPPORTS_TOUCH=IN_BROWSER&&(`ontouchstart`in window||window.navigator.maxTouchPoints>0);var SUPPORTS_EYE_DROPPER=IN_BROWSER&&`EyeDropper`in window;var SUPPORTS_MATCH_MEDIA=IN_BROWSER&&`matchMedia`in window&&isFunction(window.matchMedia);var PREFERS_REDUCED_MOTION=()=>SUPPORTS_MATCH_MEDIA&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;var IS_WEBKIT=IN_BROWSER&&CSS?.supports?.(`-webkit-backdrop-filter`,`none`);var SUPPORTS_FIELD_SIZING=IN_BROWSER&&CSS?.supports?.(`field-sizing`,`content`);function getNestedValue(obj,path,fallback){const last=path.length-1;if(last<0)return isUndefined(obj)?fallback:obj;for(let i=0;i<last;i++){if(isNullOrUndefined(obj))return fallback;obj=obj[path[i]]}if(isNullOrUndefined(obj))return fallback;return obj[path[last]]===void 0?fallback:obj[path[last]]}function getObjectValueByPath(obj,path,fallback){if(isNullOrUndefined(obj)||!path||!isString(path))return fallback;if(!isUndefined(obj[path]))return obj[path];path=path.replace(/\[(\w+)\]/g,`.$1`);path=path.replace(/^\./,``);return getNestedValue(obj,path.split(`.`),fallback)}function getPropertyFromItem(item,property,fallback){if(property===true)return isUndefined(item)?fallback:item;if(isNullOrUndefined(property)||isBoolean(property))return fallback;if(item!==Object(item)){if(!isFunction(property))return fallback;const value=property(item,fallback);return typeof value===`undefined`?fallback:value}if(isString(property))return getObjectValueByPath(item,property,fallback);if(Array.isArray(property))return getNestedValue(item,property,fallback);if(!isFunction(property))return fallback;const value=property(item,fallback);return typeof value===`undefined`?fallback:value}function isPercentage(value){return isString(value)&&value.endsWith(`%`)}function resolveSize(value,spanSize=0){return isPercentage(value)?parseFloat(value)/100*spanSize:parseFloat(String(value))||0}function convertToUnit(str,unit=`px`){if(isNullOrUndefined(str)||str===``)return;const num=Number(str);if(isNaN(num))return String(str);else if(!isFinite(num))return;else return`${num}${unit}`}function isPlainObject$1(obj){let proto;return!!obj&&typeof obj===`object`&&((proto=Object.getPrototypeOf(obj))===Object.prototype||!proto)}function refElement(obj){if(obj&&`$el`in obj){const el=obj.$el;if(el?.nodeType===Node.TEXT_NODE)return el.nextElementSibling;return el}return obj}var keyCodes=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34,shift:16});var keyValues=Object.freeze({enter:`Enter`,tab:`Tab`,delete:`Delete`,esc:`Escape`,space:`Space`,up:`ArrowUp`,down:`ArrowDown`,left:`ArrowLeft`,right:`ArrowRight`,end:`End`,home:`Home`,del:`Delete`,backspace:`Backspace`,insert:`Insert`,pageup:`PageUp`,pagedown:`PageDown`,shift:`Shift`});function keys$1(o){return Object.keys(o)}function has(obj,key){return key.every(k=>obj.hasOwnProperty(k))}function pick$1(obj,paths){const found={};for(const key of paths)if(Object.prototype.hasOwnProperty.call(obj,key))found[key]=obj[key];return found}function pickWithRest(obj,paths,exclude){const found=Object.create(null);const rest=Object.create(null);for(const key in obj)if(paths.some(path=>path instanceof RegExp?path.test(key):path===key)&&!exclude?.some(path=>path===key))found[key]=obj[key];else rest[key]=obj[key];return[found,rest]}function omit(obj,exclude){const clone={...obj};exclude.forEach(prop=>delete clone[prop]);return clone}var onRE=/^on[^a-z]/;var isOn=key=>onRE.test(key);var bubblingEvents=[`onAfterscriptexecute`,`onAnimationcancel`,`onAnimationend`,`onAnimationiteration`,`onAnimationstart`,`onAuxclick`,`onBeforeinput`,`onBeforescriptexecute`,`onChange`,`onClick`,`onCompositionend`,`onCompositionstart`,`onCompositionupdate`,`onContextmenu`,`onCopy`,`onCut`,`onDblclick`,`onFocusin`,`onFocusout`,`onFullscreenchange`,`onFullscreenerror`,`onGesturechange`,`onGestureend`,`onGesturestart`,`onGotpointercapture`,`onInput`,`onKeydown`,`onKeypress`,`onKeyup`,`onLostpointercapture`,`onMousedown`,`onMousemove`,`onMouseout`,`onMouseover`,`onMouseup`,`onMousewheel`,`onPaste`,`onPointercancel`,`onPointerdown`,`onPointerenter`,`onPointerleave`,`onPointermove`,`onPointerout`,`onPointerover`,`onPointerup`,`onReset`,`onSelect`,`onSubmit`,`onTouchcancel`,`onTouchend`,`onTouchmove`,`onTouchstart`,`onTransitioncancel`,`onTransitionend`,`onTransitionrun`,`onTransitionstart`,`onWheel`];var compositionIgnoreKeys=[`ArrowUp`,`ArrowDown`,`ArrowRight`,`ArrowLeft`,`Enter`,`Escape`,`Tab`,` `];function isComposingIgnoreKey(e){return e.isComposing&&compositionIgnoreKeys.includes(e.key)}function filterInputAttrs(attrs){const[events,props]=pickWithRest(attrs,[onRE]);const inputEvents=omit(events,bubblingEvents);const[rootAttrs,inputAttrs]=pickWithRest(props,[`class`,`style`,`id`,`inert`,/^data-/]);Object.assign(rootAttrs,events);Object.assign(inputAttrs,inputEvents);return[rootAttrs,inputAttrs]}function wrapInArray(v){return isNullOrUndefined(v)?[]:Array.isArray(v)?v:[v]}function debounce(fn,delay){let timeoutId=0;const wrap=(...args)=>{clearTimeout(timeoutId);timeoutId=setTimeout(()=>fn(...args),unref(delay))};wrap.clear=()=>{clearTimeout(timeoutId)};wrap.immediate=fn;return wrap}function clamp$1(value,min=0,max=1){return Math.max(min,Math.min(max,value))}function padEnd(str,length,char=`0`){return str+char.repeat(Math.max(0,length-str.length))}function padStart(str,length,char=`0`){return char.repeat(Math.max(0,length-str.length))+str}function chunk(str,size=1){const chunked=[];let index=0;while(index<str.length){chunked.push(str.substr(index,size));index+=size}return chunked}function humanReadableFileSize(bytes,base=1e3){if(bytes<base)return`${bytes} B`;const prefix=base===1024?[`Ki`,`Mi`,`Gi`]:[`k`,`M`,`G`];let unit=-1;while(Math.abs(bytes)>=base&&unit<prefix.length-1){bytes/=base;++unit}return`${bytes.toFixed(1)} ${prefix[unit]}B`}function mergeDeep(source={},target={},arrayFn,targetCondition){const out={};for(const key in source)out[key]=source[key];for(const key in target){const targetProperty=target[key];if(targetCondition&&!targetCondition(key,targetProperty))continue;const sourceProperty=source[key];if(isPlainObject$1(sourceProperty)&&isPlainObject$1(targetProperty)){out[key]=mergeDeep(sourceProperty,targetProperty,arrayFn,targetCondition);continue}if(arrayFn&&Array.isArray(sourceProperty)&&Array.isArray(targetProperty)){out[key]=arrayFn(sourceProperty,targetProperty);continue}out[key]=targetProperty}return out}function flattenFragments(nodes){return nodes.map(node=>{if(node.type===Fragment)return flattenFragments(node.children);else return node}).flat()}function toKebabCase(str=``){if(toKebabCase.cache.has(str))return toKebabCase.cache.get(str);const kebab=str.replace(/[^a-z]/gi,`-`).replace(/\B([A-Z])/g,`-$1`).toLowerCase();toKebabCase.cache.set(str,kebab);return kebab}toKebabCase.cache=new Map;function findChildrenWithProvide(key,vnode){if(!vnode||typeof vnode!==`object`)return[];if(Array.isArray(vnode))return vnode.map(child=>findChildrenWithProvide(key,child)).flat(1);else if(vnode.suspense)return findChildrenWithProvide(key,vnode.ssContent);else if(Array.isArray(vnode.children))return vnode.children.map(child=>findChildrenWithProvide(key,child)).flat(1);else if(vnode.component){if(Object.getOwnPropertyDescriptor(vnode.component.provides,key))return[vnode.component];else if(vnode.component.subTree)return findChildrenWithProvide(key,vnode.component.subTree).flat(1)}return[]}var CircularBuffer=class{#arr=[];#pointer=0;constructor(size){this.size=size}get isFull(){return this.#arr.length===this.size}push(val){this.#arr[this.#pointer]=val;this.#pointer=(this.#pointer+1)%this.size}values(){return this.#arr.slice(this.#pointer).concat(this.#arr.slice(0,this.#pointer))}clear(){this.#arr.length=0;this.#pointer=0}};function destructComputed(getter){const base=computed(getter);const obj={};for(const key in base.value)obj[key]=toRef(()=>base.value[key]);return obj}function includes(arr,val){return arr.includes(val)}function eventName(propName){return propName[2].toLowerCase()+propName.slice(3)}var EventProp=()=>[Function,Array];function hasEvent(props,name){name=`on`+capitalize(name);return!!(props[name]||props[`${name}Once`]||props[`${name}Capture`]||props[`${name}OnceCapture`]||props[`${name}CaptureOnce`])}function callEvent(handler,...args){if(Array.isArray(handler))for(const h of handler)h(...args);else if(isFunction(handler))handler(...args)}function focusableChildren(el,filterByTabIndex=true){const targets=[`button`,`[href]`,`input:not([type="hidden"])`,`select`,`textarea`,`details:not(:has(> summary))`,`details > summary`,`[tabindex]`,`[contenteditable]:not([contenteditable="false"])`,`audio[controls]`,`video[controls]`].map(s=>`${s}${filterByTabIndex?`:not([tabindex="-1"])`:``}:not([disabled], [inert])`).join(`, `);let elements;try{elements=[...el.querySelectorAll(targets)]}catch(err){consoleError(String(err));return[]}return elements.filter(x=>!x.closest(`[inert]`)).filter(x=>!!x.offsetParent||x.getClientRects().length>0).filter(x=>!x.parentElement?.closest(`details:not([open])`)||x.tagName===`SUMMARY`&&x.parentElement?.tagName===`DETAILS`)}function getActiveElement(){let active=document.activeElement;while(active?.shadowRoot?.activeElement)active=active.shadowRoot.activeElement;return active}function getNextElement(elements,location,condition){let _el;let idx=elements.indexOf(getActiveElement());if(idx<0){const focusTargetRole=(location===`prev`?elements.at(-1):elements[0])?.getAttribute(`role`)??``;if([`option`,`listbox`].includes(focusTargetRole))idx=elements.findIndex(el=>el.getAttribute(`role`)===`option`&&el.getAttribute(`aria-selected`)===`true`)}const inc=location===`next`?1:-1;do{idx+=inc;_el=elements[idx]}while((!_el||!_el.offsetParent||!(condition?.(_el)??true))&&idx<elements.length&&idx>=0);return _el}function focusChild(el,location,options){const focusable=focusableChildren(el);if(isNullOrUndefined(location)){const active=getActiveElement();if(el===active||!el.contains(active))focusable[0]?.focus(options)}else if(location===`first`)focusable[0]?.focus(options);else if(location===`last`)focusable.at(-1)?.focus(options);else if(isNumber(location))focusable[location]?.focus(options);else{const _el=getNextElement(focusable,location);if(_el)_el.focus(options);else focusChild(el,location===`next`?`first`:`last`,options)}}function noop$1(){}function matchesSelector(el,selector){if(!(IN_BROWSER&&typeof CSS!==`undefined`&&typeof CSS.supports!==`undefined`&&CSS.supports(`selector(${selector})`)))return null;try{return!!el&&el.matches(selector)}catch(err){return null}}function isAutofill(e){return!e.isTrusted||!!matchesSelector(e.target,`:autofill`)||!!matchesSelector(e.target,`:-webkit-autofill`)}function ensureValidVNode(vnodes){return vnodes.some(child=>{if(!isVNode(child))return true;if(child.type===Comment)return false;return child.type!==Fragment||ensureValidVNode(child.children)})?vnodes:null}function defer(timeout,cb){if(!IN_BROWSER||timeout===0){cb();return()=>{}}const timeoutId=window.setTimeout(cb,timeout);return()=>window.clearTimeout(timeoutId)}function templateRef(){const el=shallowRef();const fn=target=>{el.value=target};Object.defineProperty(fn,"value",{enumerable:true,get:()=>el.value,set:val=>el.value=val});Object.defineProperty(fn,"el",{enumerable:true,get:()=>refElement(el.value)});return fn}function checkPrintable(e){const isPrintableChar=e.key.length===1;const noModifier=!e.ctrlKey&&!e.metaKey&&!e.altKey;return isPrintableChar&&noModifier}function isPrimitive(value){return isString(value)||isNumber(value)||isBoolean(value)||typeof value===`bigint`}function escapeForRegex(sign){return`\\^$*+?.()|{}[]`.includes(sign)?`\\${sign}`:sign}function camelizeProps(props){const out={};for(const prop in props)out[camelize(prop)]=props[prop];return out}function onlyDefinedProps(props){const booleanAttributes=[`checked`,`disabled`];return Object.fromEntries(Object.entries(props).filter(([key,v])=>booleanAttributes.includes(key)?!!v:!isUndefined(v)))}var block=[`top`,`bottom`];var inline=[`start`,`end`,`left`,`right`];function parseAnchor(anchor,isRtl){let[side,align]=anchor.split(` `);if(!align)align=includes(block,side)?`start`:includes(inline,side)?`top`:`center`;return{side:toPhysical(side,isRtl),align:toPhysical(align,isRtl)}}function toPhysical(str,isRtl){if(str===`start`)return isRtl?`right`:`left`;if(str===`end`)return isRtl?`left`:`right`;return str}function flipSide(anchor){return{side:{center:`center`,top:`bottom`,bottom:`top`,left:`right`,right:`left`}[anchor.side],align:anchor.align}}function flipAlign(anchor){return{side:anchor.side,align:{center:`center`,top:`bottom`,bottom:`top`,left:`right`,right:`left`}[anchor.align]}}function flipCorner(anchor){return{side:anchor.align,align:anchor.side}}function getAxis(anchor){return includes(block,anchor.side)?`y`:`x`}var Box=class{constructor(args){if(isElement(args)){const pageScale=document.body.currentCSSZoom??1;const factor=1+(1-pageScale)/pageScale;const{x,y,width,height}=args.getBoundingClientRect();this.x=x*factor;this.y=y*factor;this.width=width*factor;this.height=height*factor}else{this.x=args.x;this.y=args.y;this.width=args.width;this.height=args.height}}get top(){return this.y}get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}};function getOverflow(a,b){return{x:{before:Math.max(0,b.left-a.left),after:Math.max(0,a.right-b.right)},y:{before:Math.max(0,b.top-a.top),after:Math.max(0,a.bottom-b.bottom)}}}function getTargetBox(target){if(Array.isArray(target)){const pageScale=document.body.currentCSSZoom??1;const factor=1+(1-pageScale)/pageScale;return new Box({x:target[0]*factor,y:target[1]*factor,width:0*factor,height:0*factor})}else return new Box(target)}function getElementBox(el){if(el===document.documentElement){if(!visualViewport)return new Box({x:0,y:0,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight});else{const localWidth=document.body.clientWidth;const pageScale=document.body.currentCSSZoom??(localWidth?document.documentElement.clientWidth/localWidth:1);return new Box({x:visualViewport.scale>1||IS_WEBKIT?0:visualViewport.offsetLeft,y:visualViewport.scale>1||IS_WEBKIT?0:visualViewport.offsetTop,width:document.documentElement.clientWidth/pageScale,height:document.documentElement.clientHeight/pageScale})}}else return new Box(el)}function nullifyTransforms(el){const rect=new Box(el);const style=getComputedStyle(el);const tx=style.transform;if(tx){let ta,sx,sy,dx,dy;if(tx.startsWith(`matrix3d(`)){ta=tx.slice(9,-1).split(/, /);sx=Number(ta[0]);sy=Number(ta[5]);dx=Number(ta[12]);dy=Number(ta[13])}else if(tx.startsWith(`matrix(`)){ta=tx.slice(7,-1).split(/, /);sx=Number(ta[0]);sy=Number(ta[3]);dx=Number(ta[4]);dy=Number(ta[5])}else return new Box(rect);const to=style.transformOrigin;const x=rect.x-dx-(1-sx)*parseFloat(to);const y=rect.y-dy-(1-sy)*parseFloat(to.slice(to.indexOf(` `)+1));const w=sx?rect.width/sx:el.offsetWidth+1;const h=sy?rect.height/sy:el.offsetHeight+1;return new Box({x,y,width:w,height:h})}else return new Box(rect)}function animate(el,keyframes,options){if(typeof el.animate===`undefined`)return{finished:Promise.resolve()};let animation;try{animation=el.animate(keyframes,options)}catch(err){return{finished:Promise.resolve()}}if(typeof animation.finished===`undefined`)animation.finished=new Promise(resolve=>{animation.onfinish=()=>{resolve(animation)}});return animation}var handlers=new WeakMap;function bindProps(el,props){Object.keys(props).forEach(k=>{if(isOn(k)){const name=eventName(k);const handler=handlers.get(el);if(isNullOrUndefined(props[k]))handler?.forEach(v=>{const[n,fn]=v;if(n===name){el.removeEventListener(name,fn);handler.delete(v)}});else if(!handler||![...handler].some(v=>v[0]===name&&v[1]===props[k])){el.addEventListener(name,props[k]);const _handler=handler||new Set;_handler.add([name,props[k]]);if(!handlers.has(el))handlers.set(el,_handler)}}else if(isNullOrUndefined(props[k]))el.removeAttribute(k);else el.setAttribute(k,props[k])})}function unbindProps(el,props){Object.keys(props).forEach(k=>{if(isOn(k)){const name=eventName(k);const handler=handlers.get(el);handler?.forEach(v=>{const[n,fn]=v;if(n===name){el.removeEventListener(name,fn);handler.delete(v)}})}else el.removeAttribute(k)})}var mainTRC=2.4;var Rco=.2126729;var Gco=.7151522;var Bco=.072175;var normBG=.55;var normTXT=.58;var revTXT=.57;var revBG=.62;var blkThrs=.03;var blkClmp=1.45;var deltaYmin=5e-4;var scaleBoW=1.25;var scaleWoB=1.25;var loConThresh=.078;var loConFactor=12.82051282051282;var loConOffset=.06;var loClip=.001;function APCAcontrast(text,background){const Rtxt=(text.r/255)**mainTRC;const Gtxt=(text.g/255)**mainTRC;const Btxt=(text.b/255)**mainTRC;const Rbg=(background.r/255)**mainTRC;const Gbg=(background.g/255)**mainTRC;const Bbg=(background.b/255)**mainTRC;let Ytxt=Rtxt*Rco+Gtxt*Gco+Btxt*Bco;let Ybg=Rbg*Rco+Gbg*Gco+Bbg*Bco;if(Ytxt<=blkThrs)Ytxt+=(blkThrs-Ytxt)**blkClmp;if(Ybg<=blkThrs)Ybg+=(blkThrs-Ybg)**blkClmp;if(Math.abs(Ybg-Ytxt)<deltaYmin)return 0;let outputContrast;if(Ybg>Ytxt){const SAPC=(Ybg**normBG-Ytxt**normTXT)*scaleBoW;outputContrast=SAPC<loClip?0:SAPC<loConThresh?SAPC-SAPC*loConFactor*loConOffset:SAPC-loConOffset}else{const SAPC=(Ybg**revBG-Ytxt**revTXT)*scaleWoB;outputContrast=SAPC>-.001?0:SAPC>-.078?SAPC-SAPC*loConFactor*loConOffset:SAPC+loConOffset}return outputContrast*100}var delta=.20689655172413793;var cielabForwardTransform=t=>t>delta**3?Math.cbrt(t):t/(3*delta**2)+4/29;var cielabReverseTransform=t=>t>delta?t**3:3*delta**2*(t-4/29);function fromXYZ$1(xyz){const transform=cielabForwardTransform;const transformedY=transform(xyz[1]);return[116*transformedY-16,500*(transform(xyz[0]/.95047)-transformedY),200*(transformedY-transform(xyz[2]/1.08883))]}function toXYZ$1(lab){const transform=cielabReverseTransform;const Ln=(lab[0]+16)/116;return[transform(Ln+lab[1]/500)*.95047,transform(Ln),transform(Ln-lab[2]/200)*1.08883]}var srgbForwardMatrix=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];var srgbForwardTransform=C=>C<=.0031308?C*12.92:1.055*C**(1/2.4)-.055;var srgbReverseMatrix=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]];var srgbReverseTransform=C=>C<=.04045?C/12.92:((C+.055)/1.055)**2.4;function fromXYZ(xyz){const rgb=Array(3);const transform=srgbForwardTransform;const matrix=srgbForwardMatrix;for(let i=0;i<3;++i)rgb[i]=Math.round(clamp$1(transform(matrix[i][0]*xyz[0]+matrix[i][1]*xyz[1]+matrix[i][2]*xyz[2]))*255);return{r:rgb[0],g:rgb[1],b:rgb[2]}}function toXYZ({r,g,b}){const xyz=[0,0,0];const transform=srgbReverseTransform;const matrix=srgbReverseMatrix;r=transform(r/255);g=transform(g/255);b=transform(b/255);for(let i=0;i<3;++i)xyz[i]=matrix[i][0]*r+matrix[i][1]*g+matrix[i][2]*b;return xyz}function isCssColor(color){return!!color&&/^(#|var\(--|(rgb|hsl)a?\()/.test(color)}function isParsableColor(color){return isCssColor(color)&&!/^((rgb|hsl)a?\()?var\(--/.test(color)}var cssColorRe=/^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/;var mappers={rgb:(r,g,b,a)=>({r,g,b,a}),rgba:(r,g,b,a)=>({r,g,b,a}),hsl:(h,s,l,a)=>HSLtoRGB({h,s,l,a}),hsla:(h,s,l,a)=>HSLtoRGB({h,s,l,a}),hsv:(h,s,v,a)=>HSVtoRGB({h,s,v,a}),hsva:(h,s,v,a)=>HSVtoRGB({h,s,v,a})};function parseColor(color){if(isNumber(color)){if(isNaN(color)||color<0||color>16777215)consoleWarn(`'${color}' is not a valid hex color`);return{r:(color&16711680)>>16,g:(color&65280)>>8,b:color&255}}else if(isString(color)&&cssColorRe.test(color)){const{groups}=color.match(cssColorRe);const{fn,values}=groups;const realValues=values.split(/,\s*|\s*\/\s*|\s+/).map((v,i)=>{if(v.endsWith(`%`)||i>0&&i<3&&[`hsl`,`hsla`,`hsv`,`hsva`].includes(fn))return parseFloat(v)/100;else return parseFloat(v)});return mappers[fn](...realValues)}else if(isString(color)){let hex=color.startsWith(`#`)?color.slice(1):color;if([3,4].includes(hex.length))hex=hex.split(``).map(char=>char+char).join(``);else if(![6,8].includes(hex.length))consoleWarn(`'${color}' is not a valid hex(a) color`);const int=parseInt(hex,16);if(isNaN(int)||int<0||int>4294967295)consoleWarn(`'${color}' is not a valid hex(a) color`);return HexToRGB(hex)}else if(isObject$1(color)){if(has(color,[`r`,`g`,`b`]))return color;else if(has(color,[`h`,`s`,`l`]))return HSVtoRGB(HSLtoHSV(color));else if(has(color,[`h`,`s`,`v`]))return HSVtoRGB(color)}throw new TypeError(`Invalid color: ${isNullOrUndefined(color)?color:String(color)||color.constructor.name}\nExpected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`)}function HSVtoRGB(hsva){const{h,s,v,a}=hsva;const f=n=>{const k=(n+h/60)%6;return v-v*s*Math.max(Math.min(k,4-k,1),0)};const rgb=[f(5),f(3),f(1)].map(v=>Math.round(v*255));return{r:rgb[0],g:rgb[1],b:rgb[2],a}}function HSLtoRGB(hsla){return HSVtoRGB(HSLtoHSV(hsla))}function HSLtoHSV(hsl){const{h,s,l,a}=hsl;const v=l+s*Math.min(l,1-l);return{h,s:v===0?0:2-2*l/v,v,a}}function toHex(v){const h=Math.round(v).toString(16);return(`00`.substr(0,2-h.length)+h).toUpperCase()}function RGBtoHex({r,g,b,a}){return`#${[toHex(r),toHex(g),toHex(b),isNumber(a)?toHex(Math.round(a*255)):``].join(``)}`}function HexToRGB(hex){hex=parseHex(hex);let[r,g,b,a]=chunk(hex,2).map(c=>parseInt(c,16));a=isNumber(a)?a/255:a;return{r,g,b,a}}function parseHex(hex){if(hex.startsWith(`#`))hex=hex.slice(1);hex=hex.replace(/([^0-9a-f])/gi,`F`);if(hex.length===3||hex.length===4)hex=hex.split(``).map(x=>x+x).join(``);if(hex.length!==6)hex=padEnd(padEnd(hex,6),8,`F`);return hex}function lighten(value,amount){const lab=fromXYZ$1(toXYZ(value));lab[0]=lab[0]+amount*10;return fromXYZ(toXYZ$1(lab))}function darken(value,amount){const lab=fromXYZ$1(toXYZ(value));lab[0]=lab[0]-amount*10;return fromXYZ(toXYZ$1(lab))}function getLuma(color){const rgb=parseColor(color);return toXYZ(rgb)[1]}function hasLightForeground(color){const blackContrast=Math.abs(APCAcontrast(parseColor(0),parseColor(color)));return Math.abs(APCAcontrast(parseColor(16777215),parseColor(color)))>Math.min(blackContrast,50)}function propsFactory(props,source){return defaults=>{return Object.keys(props).reduce((obj,prop)=>{const definition=isObject$1(props[prop])?props[prop]:{type:props[prop]};if(defaults&&prop in defaults)obj[prop]={...definition,default:defaults[prop]};else obj[prop]=definition;if(source&&!obj[prop].source)obj[prop].source=source;return obj},{})}}var makeComponentProps=propsFactory({class:[String,Array,Object],style:{type:[String,Array,Object],default:null}},`component`);function getCurrentInstance(name,message){const vm=getCurrentInstance$1();if(!vm)throw new Error(`[Vuetify] ${name} ${message||`must be called from inside a setup function`}`);return vm}function getCurrentInstanceName(name=`composables`){const vm=getCurrentInstance(name).type;return toKebabCase(vm?.aliasName||vm?.name)}function injectSelf(key,vm=getCurrentInstance(`injectSelf`)){const{provides}=vm;if(provides&&key in provides)return provides[key]}var DefaultsSymbol=Symbol.for(`vuetify:defaults`);var RootDefaultsSymbol=Symbol.for(`vuetify:defaults:root`);function createDefaults(options){return ref(options)}function injectDefaults(){const defaults=inject$1(DefaultsSymbol);if(!defaults)throw new Error(`[Vuetify] Could not find defaults instance`);return defaults}function provideDefaults(defaults,options){const injectedDefaults=injectDefaults();const injectedRoot=inject$1(RootDefaultsSymbol,null);const providedDefaults=ref(defaults);const newDefaults=computed(()=>{if(unref(options?.disabled))return injectedDefaults.value;const scoped=unref(options?.scoped);const reset=unref(options?.reset);const root=unref(options?.root);if(!providedDefaults.value&&!(scoped||reset||root))return injectedDefaults.value;let properties=mergeDeep(providedDefaults.value,{prev:injectedDefaults.value});if(scoped)return properties;if(reset||root){const len=Number(reset||Infinity);const rootDefaults=isString(root)?properties.prev?.[root]:void 0;if(root&&injectedRoot?.value)properties=injectedRoot.value;for(let i=0;i<=len;i++){if(!properties||!(`prev`in properties))break;properties=properties.prev}if(properties&&rootDefaults)properties=mergeDeep(mergeDeep(properties,{prev:properties}),rootDefaults);return properties}return properties.prev?mergeDeep(properties.prev,properties,void 0,(_,v)=>v!==void 0):properties});provide(DefaultsSymbol,newDefaults);return newDefaults}function injectNestedDefaults(name){const vm=getCurrentInstance(`injectNestedDefaults`);const defaults=injectDefaults();const self=vm.props._as??vm.type.name;return toRef(()=>defaults.value?.[self]?.[name])}function propIsDefined(vnode,prop){return vnode.props&&(typeof vnode.props[prop]!==`undefined`||typeof vnode.props[toKebabCase(prop)]!==`undefined`)}function internalUseDefaults(props={},name,defaults=injectDefaults()){const vm=getCurrentInstance(`useDefaults`);name=name??vm.type.name??vm.type.__name;if(!name)throw new Error(`[Vuetify] Could not determine component name`);const componentDefaults=computed(()=>defaults.value?.[props._as??name]);const _props=new Proxy(props,{get(target,prop){const propValue=Reflect.get(target,prop);if(prop===`class`||prop===`style`)return[componentDefaults.value?.[prop],propValue].filter(v=>v!=null);if(propIsDefined(vm.vnode,prop))return propValue;const _componentDefault=componentDefaults.value?.[prop];if(_componentDefault!==void 0)return _componentDefault;const _globalDefault=defaults.value?.global?.[prop];if(_globalDefault!==void 0)return _globalDefault;return propValue}});const _subcomponentDefaults=shallowRef();watchEffect(()=>{if(componentDefaults.value){const subComponents=Object.entries(componentDefaults.value).filter(([key])=>key.startsWith(key[0].toUpperCase()));_subcomponentDefaults.value=subComponents.length?Object.fromEntries(subComponents):void 0}else _subcomponentDefaults.value=void 0});function provideSubDefaults(){const injected=injectSelf(DefaultsSymbol,vm);provide(DefaultsSymbol,computed(()=>{return _subcomponentDefaults.value?mergeDeep(injected?.value??{},_subcomponentDefaults.value):injected?.value}))}return{props:_props,provideSubDefaults}}function defineComponent(options){options._setup=options._setup??options.setup;if(!options.name){consoleWarn(`The component is missing an explicit name, unable to generate default prop value`);return options}if(options._setup){options.props=propsFactory(options.props??{},options.name)();const propKeys=Object.keys(options.props).filter(key=>key!==`class`&&key!==`style`);options.filterProps=function filterProps(props){return pick$1(props,propKeys)};options.props._as=String;options.setup=function setup(props,ctx){const defaults=injectDefaults();if(!defaults.value)return options._setup(props,ctx);const{props:_props,provideSubDefaults}=internalUseDefaults(props,props._as??options.name,defaults);const setupBindings=options._setup(_props,ctx);provideSubDefaults();return setupBindings}}return options}function genericComponent(exposeDefaults=true){return options=>(exposeDefaults?defineComponent:defineComponent$1)(options)}function createSimpleFunctional(klass,tag=`div`,name){return genericComponent()({name:name??capitalize(camelize(klass.replace(/__/g,`-`))),props:{tag:{type:String,default:tag},...makeComponentProps()},setup(props,{slots}){return()=>{return h$1(props.tag,{class:[klass,props.class],style:props.style},slots.default?.())}}})}function updateRecursionCache(a,b,cache,result){if(!cache||isPrimitive(a)||isPrimitive(b))return;const visitedObject=cache.get(a);if(visitedObject)visitedObject.set(b,result);else{const newCacheItem=new WeakMap;newCacheItem.set(b,result);cache.set(a,newCacheItem)}}function findCachedComparison(a,b,cache){if(!cache||isPrimitive(a)||isPrimitive(b))return null;const r1=cache.get(a)?.get(b);if(isBoolean(r1))return r1;const r2=cache.get(b)?.get(a);if(isBoolean(r2))return r2;return null}function deepEqual$1(a,b,recursionCache=new WeakMap){if(a===b)return true;if(a instanceof Date&&b instanceof Date&&a.getTime()!==b.getTime())return false;if(a!==Object(a)||b!==Object(b))return false;const props=Object.keys(a);if(props.length!==Object.keys(b).length)return false;const cachedComparisonResult=findCachedComparison(a,b,recursionCache);if(cachedComparisonResult)return cachedComparisonResult;updateRecursionCache(a,b,recursionCache,true);return props.every(p=>deepEqual$1(a[p],b[p],recursionCache))}function attachedRoot(node){if(!isFunction(node.getRootNode)){while(node.parentNode)node=node.parentNode;if(node!==document)return null;return document}const root=node.getRootNode();if(root!==document&&root.getRootNode({composed:true})!==document)return null;return root}var standardEasing=`cubic-bezier(0.4, 0, 0.2, 1)`;var deceleratedEasing=`cubic-bezier(0.0, 0, 0.2, 1)`;var acceleratedEasing=`cubic-bezier(0.4, 0, 1, 1)`;var easingPatterns={linear:t=>t,easeInQuad:t=>t**2,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t**2:-1+(4-2*t)*t,easeInCubic:t=>t**3,easeOutCubic:t=>--t**3+1,easeInOutCubic:t=>t<.5?4*t**3:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t**4,easeOutQuart:t=>1- --t**4,easeInOutQuart:t=>t<.5?8*t**4:1-8*--t**4,easeInQuint:t=>t**5,easeOutQuint:t=>1+--t**5,easeInOutQuint:t=>t<.5?16*t**5:1+16*--t**5,instant:t=>1};function getScrollParent(el,includeHidden=false){while(el){if(includeHidden?isPotentiallyScrollable(el):hasScrollbar(el))return el;el=el.parentElement}return document.scrollingElement}function getScrollParents(el,stopAt){const elements=[];if(stopAt&&el&&!stopAt.contains(el))return elements;while(el){if(hasScrollbar(el))elements.push(el);if(el===stopAt)break;el=el.parentElement}return elements}function hasScrollbar(el){if(!el||el.nodeType!==Node.ELEMENT_NODE)return false;const style=window.getComputedStyle(el);const hasVerticalScrollbar=style.overflowY===`scroll`||style.overflowY===`auto`&&el.scrollHeight>el.clientHeight;const hasHorizontalScrollbar=style.overflowX===`scroll`||style.overflowX===`auto`&&el.scrollWidth>el.clientWidth;return hasVerticalScrollbar||hasHorizontalScrollbar}function isPotentiallyScrollable(el){if(!el||el.nodeType!==Node.ELEMENT_NODE)return false;const style=window.getComputedStyle(el);return[`scroll`,`auto`].includes(style.overflowY)}function isFixedPosition(el){while(el){if(window.getComputedStyle(el).position===`fixed`)return true;el=el.offsetParent}return false}function useRender(render){const vm=getCurrentInstance(`useRender`);vm.render=render}function throttle(fn,delay,options={leading:true,trailing:true}){let timeoutId=0;let lastExec=0;let throttling=false;let start=0;function clear(){clearTimeout(timeoutId);throttling=false;start=0}const wrap=(...args)=>{clearTimeout(timeoutId);const now=Date.now();if(!start)start=now;const elapsed=now-Math.max(start,lastExec);function invoke(){lastExec=Date.now();timeoutId=setTimeout(clear,delay);fn(...args)}if(!throttling){throttling=true;if(options.leading)invoke()}else if(elapsed>=delay)invoke();else if(options.trailing)timeoutId=setTimeout(invoke,delay-elapsed)};wrap.clear=clear;wrap.immediate=fn;return wrap}var IconValue=[String,Function,Object,Array];var IconSymbol=Symbol.for(`vuetify:icons`);var makeIconProps=propsFactory({icon:{type:IconValue},tag:{type:[String,Object,Function],required:true}},`icon`);var VComponentIcon=genericComponent()({name:`VComponentIcon`,props:makeIconProps(),setup(props,{slots}){return()=>{const Icon=props.icon;return createVNode(props.tag,null,{default:()=>[props.icon?createVNode(Icon,null,null):slots.default?.()]})}}});var VSvgIcon=defineComponent({name:`VSvgIcon`,inheritAttrs:false,props:makeIconProps(),setup(props,{attrs}){return()=>{return createVNode(props.tag,mergeProps(attrs,{"style":null}),{default:()=>[createBaseVNode(`svg`,{"class":`v-icon__svg`,"xmlns":`http://www.w3.org/2000/svg`,"viewBox":`0 0 24 24`,"role":`img`,"aria-hidden":`true`},[Array.isArray(props.icon)?props.icon.map(path=>Array.isArray(path)?createBaseVNode(`path`,{"d":path[0],"fill-opacity":path[1]},null):createBaseVNode(`path`,{"d":path},null)):createBaseVNode(`path`,{"d":props.icon},null)])]})}}});var VLigatureIcon=defineComponent({name:`VLigatureIcon`,props:makeIconProps(),setup(props){return()=>{return createVNode(props.tag,null,{default:()=>[props.icon]})}}});var VClassIcon=defineComponent({name:`VClassIcon`,props:makeIconProps(),setup(props){return()=>{return createVNode(props.tag,{"class":normalizeClass(props.icon)},null)}}});var useIcon=props=>{const icons=inject$1(IconSymbol);if(!icons)throw new Error(`Missing Vuetify Icons provide!`);return{iconData:computed(()=>{const iconAlias=toValue(props);if(!iconAlias)return{component:VComponentIcon};let icon=iconAlias;if(isString(icon)){icon=icon.trim();if(icon.startsWith(`$`))icon=icons.aliases?.[icon.slice(1)]}if(!icon)consoleWarn(`Could not find aliased icon "${iconAlias}"`);if(Array.isArray(icon))return{component:VSvgIcon,icon};else if(!isString(icon))return{component:VComponentIcon,icon};const iconSetName=Object.keys(icons.sets).find(setName=>isString(icon)&&icon.startsWith(`${setName}:`));const iconName=iconSetName?icon.slice(iconSetName.length+1):icon;return{component:icons.sets[iconSetName??icons.defaultSet].component,icon:iconName}})}};var aliases={collapse:`mdi-chevron-up`,complete:`mdi-check`,cancel:`mdi-close-circle`,close:`mdi-close`,delete:`mdi-close-circle`,clear:`mdi-close-circle`,success:`mdi-check-circle`,info:`mdi-information`,warning:`mdi-alert-circle`,error:`mdi-close-circle`,prev:`mdi-chevron-left`,next:`mdi-chevron-right`,checkboxOn:`mdi-checkbox-marked`,checkboxOff:`mdi-checkbox-blank-outline`,checkboxIndeterminate:`mdi-minus-box`,delimiter:`mdi-circle`,sortAsc:`mdi-arrow-up`,sortDesc:`mdi-arrow-down`,expand:`mdi-chevron-down`,menu:`mdi-menu`,subgroup:`mdi-menu-down`,dropdown:`mdi-menu-down`,radioOn:`mdi-radiobox-marked`,radioOff:`mdi-radiobox-blank`,edit:`mdi-pencil`,ratingEmpty:`mdi-star-outline`,ratingFull:`mdi-star`,ratingHalf:`mdi-star-half-full`,loading:`mdi-cached`,first:`mdi-page-first`,last:`mdi-page-last`,unfold:`mdi-unfold-more-horizontal`,file:`mdi-paperclip`,plus:`mdi-plus`,minus:`mdi-minus`,calendar:`mdi-calendar`,clock:`mdi-clock-outline`,treeviewCollapse:`mdi-menu-down`,treeviewExpand:`mdi-menu-right`,tableGroupCollapse:`mdi-chevron-down`,tableGroupExpand:`mdi-chevron-right`,eyeDropper:`mdi-eyedropper`,upload:`mdi-cloud-upload`,color:`mdi-palette`,command:`mdi-apple-keyboard-command`,ctrl:`mdi-apple-keyboard-control`,space:`mdi-keyboard-space`,shift:`mdi-apple-keyboard-shift`,alt:`mdi-apple-keyboard-option`,enter:`mdi-keyboard-return`,arrowup:`mdi-arrow-up`,arrowdown:`mdi-arrow-down`,arrowleft:`mdi-arrow-left`,arrowright:`mdi-arrow-right`,backspace:`mdi-backspace`,play:`mdi-play`,pause:`mdi-pause`,fullscreen:`mdi-fullscreen`,fullscreenExit:`mdi-fullscreen-exit`,volumeHigh:`mdi-volume-high`,volumeMedium:`mdi-volume-medium`,volumeLow:`mdi-volume-low`,volumeOff:`mdi-volume-variant-off`,search:`mdi-magnify`};var mdi={component:props=>h$1(VClassIcon,{...props,class:`mdi`})};function genDefaults$3(){return{svg:{component:VSvgIcon},class:{component:VClassIcon}}}function createIcons(options){const sets=genDefaults$3();const defaultSet=options?.defaultSet??`mdi`;if(defaultSet===`mdi`&&!sets.mdi)sets.mdi=mdi;return mergeDeep({defaultSet,sets,aliases:{...aliases,vuetify:[`M8.2241 14.2009L12 21L22 3H14.4459L8.2241 14.2009Z`,[`M7.26303 12.4733L7.00113 12L2 3H12.5261C12.5261 3 12.5261 3 12.5261 3L7.26303 12.4733Z`,.6]],"vuetify-outline":`svg:M7.26 12.47 12.53 3H2L7.26 12.47ZM14.45 3 8.22 14.2 12 21 22 3H14.45ZM18.6 5 12 16.88 10.51 14.2 15.62 5ZM7.26 8.35 5.4 5H9.13L7.26 8.35Z`,"vuetify-play":[`m6.376 13.184-4.11-7.192C1.505 4.66 2.467 3 4.003 3h8.532l-.953 1.576-.006.01-.396.677c-.429.732-.214 1.507.194 2.015.404.503 1.092.878 1.869.806a3.72 3.72 0 0 1 1.005.022c.276.053.434.143.523.237.138.146.38.635-.25 2.09-.893 1.63-1.553 1.722-1.847 1.677-.213-.033-.468-.158-.756-.406a4.95 4.95 0 0 1-.8-.927c-.39-.564-1.04-.84-1.66-.846-.625-.006-1.316.27-1.693.921l-.478.826-.911 1.506Z`,[`M9.093 11.552c.046-.079.144-.15.32-.148a.53.53 0 0 1 .43.207c.285.414.636.847 1.046 1.2.405.35.914.662 1.516.754 1.334.205 2.502-.698 3.48-2.495l.014-.028.013-.03c.687-1.574.774-2.852-.005-3.675-.37-.391-.861-.586-1.333-.676a5.243 5.243 0 0 0-1.447-.044c-.173.016-.393-.073-.54-.257-.145-.18-.127-.316-.082-.392l.393-.672L14.287 3h5.71c1.536 0 2.499 1.659 1.737 2.992l-7.997 13.996c-.768 1.344-2.706 1.344-3.473 0l-3.037-5.314 1.377-2.278.004-.006.004-.007.481-.831Z`,.6]]}},options)}function useToggleScope(source,fn){let scope;function start(){scope=effectScope();scope.run(()=>fn.length?fn(()=>{scope?.stop();start()}):fn())}watch(source,active=>{if(active&&!scope)start();else if(!active){scope?.stop();scope=void 0}},{immediate:true});onScopeDispose(()=>{scope?.stop()})}function useProxiedModel(props,prop,defaultValue,transformIn=v=>v,transformOut=v=>v){const vm=getCurrentInstance(`useProxiedModel`);const internal=ref(!isUndefined(props[prop])?props[prop]:defaultValue);const kebabProp=toKebabCase(prop);const isControlled=kebabProp!==prop?computed(()=>{props[prop];return!!((vm.vnode.props?.hasOwnProperty(prop)||vm.vnode.props?.hasOwnProperty(kebabProp))&&(vm.vnode.props?.hasOwnProperty(`onUpdate:${prop}`)||vm.vnode.props?.hasOwnProperty(`onUpdate:${kebabProp}`)))}):computed(()=>{props[prop];return!!(vm.vnode.props?.hasOwnProperty(prop)&&vm.vnode.props?.hasOwnProperty(`onUpdate:${prop}`))});useToggleScope(()=>!isControlled.value,()=>{watch(()=>props[prop],val=>{internal.value=val})});const model=computed({get(){const externalValue=props[prop];return transformIn(isControlled.value?externalValue:internal.value)},set(internalValue){const newValue=transformOut(internalValue);const value=toRaw(isControlled.value?props[prop]:internal.value);if(value===newValue||transformIn(value)===internalValue)return;internal.value=newValue;vm?.emit(`update:${prop}`,newValue)}});Object.defineProperty(model,"externalValue",{get:()=>isControlled.value?props[prop]:internal.value});return model}var en_default$15={badge:`Badge`,open:`Open`,close:`Close`,dismiss:`Dismiss`,confirmEdit:{ok:`OK`,cancel:`Cancel`},dataIterator:{noResultsText:`No matching records found`,loadingText:`Loading items...`},dataTable:{itemsPerPageText:`Rows per page:`,ariaLabel:{sortDescending:`Sorted descending.`,sortAscending:`Sorted ascending.`,sortNone:`Not sorted.`,activateNone:`Activate to remove sorting.`,activateDescending:`Activate to sort descending.`,activateAscending:`Activate to sort ascending.`,selectRow:`Select row`,selectAll:`Select all`,selectGroup:`Select group`},sortBy:`Sort by`},dataFooter:{itemsPerPageText:`Items per page:`,itemsPerPageAll:`All`,nextPage:`Next page`,prevPage:`Previous page`,firstPage:`First page`,lastPage:`Last page`,pageText:`{0}-{1} of {2}`},dateRangeInput:{divider:`to`},monthPicker:{title:`Select month`,itemsSelected:`{0} selected`,header:`Enter month`,range:{title:`Enter months`},ariaLabel:{previousYear:`Previous year`,nextYear:`Next year`,selectYear:`Select year`,currentMonth:`Current month, {0}`}},datePicker:{itemsSelected:`{0} selected`,range:{title:`Select dates`,header:`Enter dates`},title:`Select date`,header:`Enter date`,input:{placeholder:`Enter date`},ariaLabel:{previousMonth:`Previous month`,nextMonth:`Next month`,selectYear:`Select year`,previousYear:`Previous year`,nextYear:`Next year`,selectMonth:`Select month`,selectDate:`{0}`,currentDate:`Today, {0}`}},noDataText:`No data available`,carousel:{prev:`Previous visual`,next:`Next visual`,ariaLabel:{delimiter:`Carousel slide {0} of {1}`}},calendar:{moreEvents:`{0} more`,today:`Today`},heatmap:{less:`Less`,more:`More`},input:{clear:`Clear {0}`,prependAction:`{0} prepended action`,appendAction:`{0} appended action`,otp:`Enter verification code`},fileInput:{counter:`{0} files`,counterSize:`{0} files ({1} in total)`},fileUpload:{title:`Drag and drop files here`,divider:`or`,browse:`Browse Files`},timePicker:{am:`AM`,pm:`PM`,title:`Select Time`,hour:`Hour`,minute:`Minute`,second:`Second`,notAllowed:`Value is not allowed`},pagination:{ariaLabel:{root:`Pagination Navigation`,next:`Next page`,previous:`Previous page`,page:`Go to page {0}`,currentPage:`Page {0}, Current page`,first:`First page`,last:`Last page`}},stepper:{next:`Next`,prev:`Previous`},rating:{ariaLabel:{item:`Rating {0} of {1}`}},rangeSlider:{ariaLabel:{start:`Minimum`,end:`Maximum`}},splitBtn:{menu:`More options`},loading:`Loading...`,infiniteScroll:{loadMore:`Load more`,empty:`No more`},rules:{required:`This field is required`,email:`Please enter a valid email`,number:`This field can only contain numbers`,integer:`This field can only contain integer values`,capital:`This field can only contain uppercase letters`,maxLength:`You must enter a maximum of {0} characters`,minLength:`You must enter a minimum of {0} characters`,strictLength:`The length of the entered field is invalid`,exclude:`The {0} character is not allowed`,notEmpty:`Please choose at least one value`,pattern:`Invalid format`},command:{search:`Type a command or search...`},hotkey:{then:`then`,ctrl:`Ctrl`,command:`Command`,space:`Space`,shift:`Shift`,alt:`Alt`,enter:`Enter`,escape:`Escape`,upArrow:`Up Arrow`,downArrow:`Down Arrow`,leftArrow:`Left Arrow`,rightArrow:`Right Arrow`,backspace:`Backspace`,option:`Option`,plus:`plus`,shortcut:`Keyboard shortcut, {0}`,or:`or`},media:{play:`Play`,pause:`Pause`,seek:`Seek`,volume:`Volume`,mute:`Mute`,unmute:`Unmute`,enterFullscreen:`Full screen`,exitFullscreen:`Exit full screen`},colorPicker:{ariaLabel:{eyedropper:`Select color with eyedropper`,hueSlider:`Hue`,alphaSlider:`Alpha`,redInput:`Red value`,greenInput:`Green value`,blueInput:`Blue value`,alphaInput:`Alpha value`,hueInput:`Hue value`,saturationInput:`Saturation value`,lightnessInput:`Lightness value`,hexInput:`HEX value`,hexaInput:`HEX with alpha value`,changeFormat:`Change color format`}}};var LANG_PREFIX=`$vuetify.`;var replace=(str,params)=>{return str.replace(/\{(\d+)\}/g,(match,index)=>{return String(params[Number(index)])})};function selectLocale(bundle,locale){if(!bundle.has(locale))bundle.register({id:locale});if(bundle.selectedId.value!==locale)bundle.select(locale)}function createBundle(locale,fallbackLocale,catalogs){const bundle=createLocale$1({fallback:fallbackLocale,messages:catalogs});selectLocale(bundle,locale);return bundle}var createTranslateFunction=(current,fallback,messages)=>{let lastEditCount=0;const snapshot=computed(()=>({key:++lastEditCount,current:current.value,fallback:fallback.value,messages:JSON.parse(JSON.stringify(messages.value))}));let cache;const bundle=computed(()=>{const{key,current,fallback,messages}=snapshot.value;if(cache?.key!==key)cache={key,bundle:createBundle(current,fallback,messages)};return cache.bundle});return(key,...params)=>{if(!key.startsWith(LANG_PREFIX))return replace(key,params);const found=bundle.value.ti(key.slice(9),...params);if(!isString(found)){consoleError(`Translation key "${key}" not found in fallback`);return key}return found}};function createNumberFunction(current,fallback){return(value,options)=>{return new Intl.NumberFormat([current.value,fallback.value],options).format(value)}}function inferDecimalSeparator(current,fallback){return createNumberFunction(current,fallback)(.1).includes(`,`)?`,`:`.`}function inferNumericGroupSeparator(current,fallback){return new Intl.NumberFormat([current.value,fallback.value],{useGrouping:true}).formatToParts(1e4).find(p=>p.type===`group`)?.value??`\xA0`}function useProvided(props,prop,provided){const internal=useProxiedModel(props,prop,props[prop]??provided.value);internal.value=props[prop]??provided.value;watch(provided,v=>{if(props[prop]==null)internal.value=provided.value});return internal}function createProvideFunction(state){return props=>{const current=useProvided(props,`locale`,state.current);const fallback=useProvided(props,`fallback`,state.fallback);const messages=useProvided(props,`messages`,state.messages);return{name:`vuetify`,current,fallback,messages,decimalSeparator:toRef(()=>inferDecimalSeparator(current,fallback)),numericGroupSeparator:toRef(()=>inferNumericGroupSeparator(current,fallback)),t:createTranslateFunction(current,fallback,messages),n:createNumberFunction(current,fallback),provide:createProvideFunction({current,fallback,messages})}}}function createVuetifyAdapter(options){const current=shallowRef(options?.locale??`en`);const fallback=shallowRef(options?.fallback??`en`);const messages=ref({en:en_default$15,...options?.messages});return{name:`vuetify`,current,fallback,messages,decimalSeparator:toRef(()=>options?.decimalSeparator??inferDecimalSeparator(current,fallback)),numericGroupSeparator:toRef(()=>options?.numericGroupSeparator??inferNumericGroupSeparator(current,fallback)),t:createTranslateFunction(current,fallback,messages),n:createNumberFunction(current,fallback),provide:createProvideFunction({current,fallback,messages})}}var LocaleSymbol=Symbol.for(`vuetify:locale`);function createLocale(options){const i18n=options?.adapter?.name?options.adapter:createVuetifyAdapter(options);const rtl=createRtl(i18n,options);return{...i18n,...rtl}}function useLocale(){const locale=inject$1(LocaleSymbol);if(!locale)throw new Error(`[Vuetify] Could not find injected locale instance`);return locale}function genDefaults$2(){return{af:false,ar:true,bg:false,ca:false,ckb:true,cs:false,de:false,el:false,en:false,es:false,et:false,fa:true,fi:false,fr:false,hr:false,hu:false,he:true,id:false,it:false,ja:false,km:false,ko:false,lv:false,lt:false,nl:false,no:false,pl:false,pt:false,ro:false,ru:false,sk:false,sl:false,srCyrl:false,srLatn:false,sv:false,th:false,tr:false,az:false,uk:false,vi:false,zhHans:false,zhHant:false}}function createRtl(i18n,options){const rtl=ref(options?.rtl?{...options.rtl}:genDefaults$2());const direction=createRtl$1();watch(()=>rtl.value[i18n.current.value]??false,value=>{direction.isRtl.value=value},{flush:`sync`,immediate:true});return{isRtl:readonly(direction.isRtl),rtl,rtlClasses:toRef(()=>`v-locale--is-${direction.isRtl.value?`rtl`:`ltr`}`)}}function useRtl(){const locale=inject$1(LocaleSymbol);if(!locale)throw new Error(`[Vuetify] Could not find injected rtl instance`);return{isRtl:locale.isRtl,rtlClasses:locale.rtlClasses}}function weekInfo(locale){const code=locale.slice(-2).toUpperCase();switch(true){case locale===`GB-alt-variant`:return{firstDay:0,firstWeekSize:4};case locale===`001`:return{firstDay:1,firstWeekSize:1};case`AG AS BD BR BS BT BW BZ CA CO DM DO ET GT GU HK HN ID IL IN JM JP KE
|
|
3
|
+
`)}el[assignKey]=getModelAssigner(vnode);const castToNumber=number||vnode.props&&vnode.props.type===`number`;addEventListener$1(el,lazy?`change`:`input`,e=>{if(e.target.composing)return;el[assignKey](castValue(el.value,trim,castToNumber))});if(trim||castToNumber)addEventListener$1(el,`change`,()=>{el.value=castValue(el.value,trim,castToNumber)});if(!lazy){addEventListener$1(el,`compositionstart`,onCompositionStart);addEventListener$1(el,`compositionend`,onCompositionEnd);addEventListener$1(el,`change`,onCompositionEnd)}},mounted(el,{value,modifiers:{trim,number}}){const newValue=value==null?``:value;const initialValue=el[initialValueKey];delete el[initialValueKey];if(initialValue!==void 0&&(el.type===`text`||el.type===`textarea`)&&el.value!==initialValue)el[assignKey](castValue(el.value,trim,number));else el.value=newValue},beforeUpdate(el,{value,oldValue,modifiers:{lazy,trim,number}},vnode){el[assignKey]=getModelAssigner(vnode);if(el.composing)return;const elValue=(number||el.type===`number`)&&!/^0\d/.test(el.value)?looseToNumber(el.value):el.value;const newValue=value==null?``:value;if(elValue===newValue)return;const rootNode=el.getRootNode();if((rootNode instanceof Document||rootNode instanceof ShadowRoot)&&rootNode.activeElement===el&&el.type!==`range`){if(lazy&&value===oldValue)return;if(trim&&el.value.trim()===newValue)return}el.value=newValue}};var vModelSelect={deep:true,created(el,{value,modifiers:{number}},vnode){el._modelValue=value;addEventListener$1(el,`change`,()=>{const selectedVal=Array.prototype.filter.call(el.options,o=>o.selected).map(o=>number?looseToNumber(getValue(o)):getValue(o));const multiple=el.multiple;const assignedValue=multiple?isSet(el._modelValue)?new Set(selectedVal):selectedVal:selectedVal[0];const pending=el._pendingValue=[multiple,multiple?isArray$2(assignedValue)?selectedVal.slice():selectedVal:assignedValue];try{el[assignKey](assignedValue)}finally{nextTick$1(()=>{if(el._pendingValue===pending)el._pendingValue=void 0})}});el[assignKey]=getModelAssigner(vnode)},mounted(el,{value}){setSelected(el,value)},beforeUpdate(el,{value},vnode){el._modelValue=value;el[assignKey]=getModelAssigner(vnode)},updated(el,{value}){const pending=el._pendingValue;el._pendingValue=void 0;if(!pending||pending[0]!==el.multiple||!isSameSelectValue(value,pending[1],pending[0]))setSelected(el,value)}};function isSameSelectValue(value,assignedValue,multiple){if(!multiple)return looseEqual(value,assignedValue);if(isArray$2(value))return looseEqual(value,assignedValue);if(isSet(value)){if(value.size!==assignedValue.length)return false;for(const item of assignedValue)if(!value.has(item))return false;return true}return false}function setSelected(el,value){const isMultiple=el.multiple;const isArrayValue=isArray$2(value);if(isMultiple&&!isArrayValue&&!isSet(value))return;for(let i=0,l=el.options.length;i<l;i++){const option=el.options[i];const optionValue=getValue(option);if(isMultiple){if(isArrayValue){const optionType=typeof optionValue;if(optionType===`string`||optionType===`number`)option.selected=value.some(v=>String(v)===String(optionValue));else option.selected=looseIndexOf(value,optionValue)>-1}else option.selected=value.has(optionValue)}else if(looseEqual(getValue(option),value)){if(el.selectedIndex!==i)el.selectedIndex=i;return}}if(!isMultiple&&el.selectedIndex!==-1)el.selectedIndex=-1}function getValue(el){return`_value`in el?el._value:el.value}var systemModifiers=[`ctrl`,`shift`,`alt`,`meta`];var modifierGuards={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,modifiers)=>systemModifiers.some(m=>e[`${m}Key`]&&!modifiers.includes(m))};var withModifiers=(fn,modifiers)=>{if(!fn)return fn;const cache=fn._withMods||(fn._withMods={});const cacheKey=modifiers.join(`.`);return cache[cacheKey]||(cache[cacheKey]=((event,...args)=>{for(let i=0;i<modifiers.length;i++){const guard=modifierGuards[modifiers[i]];if(guard&&guard(event,modifiers))return}return fn(event,...args)}))};var keyNames={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`};var withKeys=(fn,modifiers)=>{const cache=fn._withKeys||(fn._withKeys={});const cacheKey=modifiers.join(`.`);return cache[cacheKey]||(cache[cacheKey]=(event=>{if(!(`key`in event))return;const eventKey=hyphenate(event.key);if(modifiers.some(k=>k===eventKey||keyNames[k]===eventKey))return fn(event)}))};var rendererOptions=extend({patchProp},nodeOps);var renderer;function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions))}var createApp=((...args)=>{const app=ensureRenderer().createApp(...args);const{mount}=app;app.mount=containerOrSelector=>{const container=normalizeContainer(containerOrSelector);if(!container)return;const component=app._component;if(!isFunction$2(component)&&!component.render&&!component.template)component.template=container.innerHTML;if(container.nodeType===1)container.textContent=``;const proxy=mount(container,false,resolveRootNamespace(container));if(container instanceof Element){container.removeAttribute(`v-cloak`);container.setAttribute(`data-v-app`,``)}return proxy};return app});function resolveRootNamespace(container){if(container instanceof SVGElement)return`svg`;if(typeof MathMLElement===`function`&&container instanceof MathMLElement)return`mathml`}function normalizeContainer(container){if(isString$1(container))return document.querySelector(container);return container}var IS_CLIENT=typeof window!==`undefined`;var activePinia;var setActivePinia=pinia=>activePinia=pinia;var piniaSymbol=Symbol();function isPlainObject$5(o){return o&&typeof o===`object`&&Object.prototype.toString.call(o)===`[object Object]`&&typeof o.toJSON!==`function`}var _global=(()=>typeof window===`object`&&window.window===window?window:typeof self===`object`&&self.self===self?self:typeof global===`object`&&global.global===global?global:typeof globalThis===`object`?globalThis:{HTMLElement:null})();function bom(blob,{autoBom=false}={}){if(autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type))return new Blob([String.fromCharCode(65279),blob],{type:blob.type});return blob}function download(url,name,opts){const xhr=new XMLHttpRequest;xhr.open(`GET`,url);xhr.responseType=`blob`;xhr.onload=function(){saveAs(xhr.response,name,opts)};xhr.onerror=function(){console.error(`could not download file`)};xhr.send()}function corsEnabled(url){const xhr=new XMLHttpRequest;xhr.open(`HEAD`,url,false);try{xhr.send()}catch(e){}return xhr.status>=200&&xhr.status<=299}function click(node){try{node.dispatchEvent(new MouseEvent(`click`))}catch(e){const evt=new MouseEvent(`click`,{bubbles:true,cancelable:true,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,button:0,relatedTarget:null});node.dispatchEvent(evt)}}var _navigator=typeof navigator===`object`?navigator:{userAgent:``};var isMacOSWebView=(()=>/Macintosh/.test(_navigator.userAgent)&&/AppleWebKit/.test(_navigator.userAgent)&&!/Safari/.test(_navigator.userAgent))();var saveAs=!IS_CLIENT?()=>{}:typeof HTMLAnchorElement!==`undefined`&&`download`in HTMLAnchorElement.prototype&&!isMacOSWebView?downloadSaveAs:`msSaveOrOpenBlob`in _navigator?msSaveAs:fileSaverSaveAs;function downloadSaveAs(blob,name=`download`,opts){const a=document.createElement(`a`);a.download=name;a.rel=`noopener`;if(typeof blob===`string`){a.href=blob;if(a.origin!==location.origin)if(corsEnabled(a.href))download(blob,name,opts);else{a.target=`_blank`;click(a)}else click(a)}else{a.href=URL.createObjectURL(blob);setTimeout(function(){URL.revokeObjectURL(a.href)},4e4);setTimeout(function(){click(a)},0)}}function msSaveAs(blob,name=`download`,opts){if(typeof blob===`string`)if(corsEnabled(blob))download(blob,name,opts);else{const a=document.createElement(`a`);a.href=blob;a.target=`_blank`;setTimeout(function(){click(a)})}else navigator.msSaveOrOpenBlob(bom(blob,opts),name)}function fileSaverSaveAs(blob,name,opts,popup){popup=popup||open(``,`_blank`);if(popup)popup.document.title=popup.document.body.innerText=`downloading...`;if(typeof blob===`string`)return download(blob,name,opts);const force=blob.type===`application/octet-stream`;const isSafari=/constructor/i.test(String(_global.HTMLElement))||`safari`in _global;const isChromeIOS=/CriOS\/[\d]+/.test(navigator.userAgent);if((isChromeIOS||force&&isSafari||isMacOSWebView)&&typeof FileReader!==`undefined`){const reader=new FileReader;reader.onloadend=function(){let url=reader.result;if(typeof url!==`string`){popup=null;throw new Error(`Wrong reader.result type`)}url=isChromeIOS?url:url.replace(/^data:[^;]*;/,`data:attachment/file;`);if(popup)popup.location.href=url;else location.assign(url);popup=null};reader.readAsDataURL(blob)}else{const url=URL.createObjectURL(blob);if(popup)popup.location.assign(url);else location.href=url;popup=null;setTimeout(function(){URL.revokeObjectURL(url)},4e4)}}var{assign:assign$1}=Object;function createPinia(){const scope=effectScope(true);const state=scope.run(()=>ref({}));let _p=[];let toBeInstalled=[];const pinia=markRaw({install(app){setActivePinia(pinia);pinia._a=app;app.provide(piniaSymbol,pinia);app.config.globalProperties.$pinia=pinia;toBeInstalled.forEach(plugin=>_p.push(plugin));toBeInstalled=[]},use(plugin){if(!this._a)toBeInstalled.push(plugin);else _p.push(plugin);return this},_p,_a:null,_e:scope,_s:new Map,state});return pinia}var noop$4=()=>{};function addSubscription(subscriptions,callback,detached,onCleanup=noop$4){subscriptions.add(callback);const removeSubscription=()=>{subscriptions.delete(callback)&&onCleanup()};if(!detached&&getCurrentScope())onScopeDispose(removeSubscription);return removeSubscription}function triggerSubscriptions(subscriptions,...args){subscriptions.forEach(callback=>{callback(...args)})}var fallbackRunWithContext=fn=>fn();var ACTION_MARKER=Symbol();var ACTION_NAME=Symbol();function mergeReactiveObjects(target,patchToApply){if(target instanceof Map&&patchToApply instanceof Map)patchToApply.forEach((value,key)=>target.set(key,value));else if(target instanceof Set&&patchToApply instanceof Set)patchToApply.forEach(target.add,target);for(const key in patchToApply){if(!Object.hasOwn(patchToApply,key))continue;const subPatch=patchToApply[key];const targetValue=target[key];if(isPlainObject$5(targetValue)&&isPlainObject$5(subPatch)&&Object.hasOwn(target,key)&&!isRef(subPatch)&&!isReactive(subPatch))target[key]=mergeReactiveObjects(targetValue,subPatch);else target[key]=subPatch}return target}var skipHydrateSymbol=Symbol();function shouldHydrate(obj){return!obj||typeof obj!==`object`||!Object.hasOwn(obj,skipHydrateSymbol)}var{assign:assign$2}=Object;function isComputed(o){return!!(isRef(o)&&o.effect)}function createOptionsStore(id,options,pinia,hot){const{state,actions,getters}=options;const initialState=pinia.state.value[id];let store;function setup(){if(!initialState&&true)pinia.state.value[id]=state?state():{};const localState=toRefs(pinia.state.value[id]);return assign$2(localState,actions,Object.keys(getters||{}).reduce((computedGetters,name)=>{computedGetters[name]=markRaw(computed(()=>{setActivePinia(pinia);const store=pinia._s.get(id);return getters[name].call(store,store)}));return computedGetters},{}))}store=createSetupStore(id,setup,options,pinia,hot,true);return store}function createSetupStore($id,setup,options={},pinia,hot,isOptionsStore){let scope;const optionsForPlugin=assign$2({actions:{}},options);const $subscribeOptions={deep:true};let isListening;let isSyncListening;let subscriptions=new Set;let actionSubscriptions=new Set;let debuggerEvents;const initialState=pinia.state.value[$id];if(!isOptionsStore&&!initialState&&true)pinia.state.value[$id]={};let activeListener;function $patch(partialStateOrMutator){let subscriptionMutation;isListening=isSyncListening=false;if(typeof partialStateOrMutator===`function`){partialStateOrMutator(pinia.state.value[$id]);subscriptionMutation={type:`patch function`,storeId:$id,events:debuggerEvents}}else{mergeReactiveObjects(pinia.state.value[$id],partialStateOrMutator);subscriptionMutation={type:`patch object`,payload:partialStateOrMutator,storeId:$id,events:debuggerEvents}}const myListenerId=activeListener=Symbol();nextTick$1().then(()=>{if(activeListener===myListenerId)isListening=true});isSyncListening=true;triggerSubscriptions(subscriptions,subscriptionMutation,pinia.state.value[$id])}const $reset=isOptionsStore?function $reset(){const{state}=options;const newState=state?state():{};this.$patch($state=>{assign$2($state,newState)})}:noop$4;function $dispose(){scope.stop();subscriptions.clear();actionSubscriptions.clear();pinia._s.delete($id)}const action=(fn,name=``)=>{if(ACTION_MARKER in fn){fn[ACTION_NAME]=name;return fn}const wrappedAction=function(){setActivePinia(pinia);const args=Array.from(arguments);const afterCallbackSet=new Set;const onErrorCallbackSet=new Set;function after(callback){afterCallbackSet.add(callback)}function onError(callback){onErrorCallbackSet.add(callback)}triggerSubscriptions(actionSubscriptions,{args,name:wrappedAction[ACTION_NAME],store,after,onError});let ret;try{ret=fn.apply(this&&this.$id===$id?this:store,args)}catch(error){triggerSubscriptions(onErrorCallbackSet,error);throw error}if(ret instanceof Promise)return ret.then(value=>{triggerSubscriptions(afterCallbackSet,value);return value}).catch(error=>{triggerSubscriptions(onErrorCallbackSet,error);return Promise.reject(error)});triggerSubscriptions(afterCallbackSet,ret);return ret};wrappedAction[ACTION_MARKER]=true;wrappedAction[ACTION_NAME]=name;return wrappedAction};const partialStore={_p:pinia,$id,$onAction:addSubscription.bind(null,actionSubscriptions),$patch,$reset,$subscribe(callback,options={}){if(subscriptions.has(callback))return noop$4;const removeSubscription=addSubscription(subscriptions,callback,options.detached,()=>stopWatcher());const stopWatcher=scope.run(()=>watch(()=>pinia.state.value[$id],state=>{if(options.flush===`sync`?isSyncListening:isListening)callback({storeId:$id,type:`direct`,events:debuggerEvents},state)},assign$2({},$subscribeOptions,options)));return removeSubscription},$dispose};const store=reactive(partialStore);pinia._s.set($id,store);const setupStore=(pinia._a&&pinia._a.runWithContext||fallbackRunWithContext)(()=>pinia._e.run(()=>(scope=effectScope()).run(()=>setup({action}))));for(const key in setupStore){const prop=setupStore[key];if(isRef(prop)&&!isComputed(prop)||isReactive(prop)){if(!isOptionsStore){if(initialState&&shouldHydrate(prop))if(isRef(prop))prop.value=initialState[key];else{if(prop instanceof Set||prop instanceof Map)prop.clear();mergeReactiveObjects(prop,initialState[key])}pinia.state.value[$id][key]=prop}}else if(typeof prop===`function`){setupStore[key]=action(prop,key);optionsForPlugin.actions[key]=prop}}assign$2(store,setupStore);assign$2(toRaw(store),setupStore);Object.defineProperty(store,"$state",{get:()=>pinia.state.value[$id],set:state=>{$patch($state=>{assign$2($state,state)})}});pinia._p.forEach(extender=>{const extensions=scope.run(()=>extender({store,app:pinia._a,pinia,options:optionsForPlugin}));assign$2(store,extensions)});if(initialState&&isOptionsStore&&options.hydrate)options.hydrate(store.$state,initialState);isListening=true;isSyncListening=true;return store}function defineStore(id,setup,setupOptions){let options;const isSetupStore=typeof setup===`function`;options=isSetupStore?setupOptions:setup;function useStore(pinia,hot){const hasContext=hasInjectionContext();pinia=pinia||(hasContext?inject$1(piniaSymbol,null):null);if(pinia)setActivePinia(pinia);pinia=activePinia;if(!pinia._s.has(id)){if(isSetupStore)createSetupStore(id,setup,options,pinia);else createOptionsStore(id,options,pinia)}return pinia._s.get(id)}useStore.$id=id;return useStore}var VUE_QUERY_CLIENT=`VUE_QUERY_CLIENT`;function getClientKey(key){const suffix=key?`:${key}`:``;return`${VUE_QUERY_CLIENT}${suffix}`}function updateState(state,update){Object.keys(state).forEach(key=>{state[key]=update[key]})}function _cloneDeep(value,customize,currentKey=``,currentLevel=0){if(customize){const result=customize(value,currentKey,currentLevel);if(result===void 0&&isRef(value))return result;if(result!==void 0)return result}if(Array.isArray(value))return value.map((val,index)=>_cloneDeep(val,customize,String(index),currentLevel+1));if(typeof value===`object`&&isPlainObject$4(value)){const entries=Object.entries(value).map(([key,val])=>[key,_cloneDeep(val,customize,key,currentLevel+1)]);return Object.fromEntries(entries)}return value}function cloneDeep(value,customize){return _cloneDeep(value,customize)}function cloneDeepUnref(obj,unrefGetters=false){return cloneDeep(obj,(val,key,level)=>{if(level===1&&key===`queryKey`)return cloneDeepUnref(val,true);if(unrefGetters&&isFunction$1(val))return cloneDeepUnref(val(),unrefGetters);if(isRef(val))return cloneDeepUnref(unref(val),unrefGetters)})}function isPlainObject$4(value){if(Object.prototype.toString.call(value)!==`[object Object]`)return false;const prototype=Object.getPrototypeOf(value);return prototype===null||prototype===Object.prototype}function isFunction$1(value){return typeof value===`function`}function useQueryClient(id=``){if(!hasInjectionContext())throw new Error(`vue-query hooks can only be used inside setup() function or functions that support injection context.`);const key=getClientKey(id);const queryClient=inject$1(key);if(!queryClient)throw new Error(`No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.`);return queryClient}var defaultTimeoutProvider={setTimeout:(callback,delay)=>setTimeout(callback,delay),clearTimeout:timeoutId=>clearTimeout(timeoutId),setInterval:(callback,delay)=>setInterval(callback,delay),clearInterval:intervalId=>clearInterval(intervalId)};var TimeoutManager=class{#provider=defaultTimeoutProvider;#providerCalled=false;setTimeoutProvider(provider){this.#provider=provider}setTimeout(callback,delay){return this.#provider.setTimeout(callback,delay)}clearTimeout(timeoutId){this.#provider.clearTimeout(timeoutId)}setInterval(callback,delay){return this.#provider.setInterval(callback,delay)}clearInterval(intervalId){this.#provider.clearInterval(intervalId)}};var timeoutManager=new TimeoutManager;function systemSetTimeoutZero(callback){setTimeout(callback,0)}var isServer$1=typeof window===`undefined`||`Deno`in globalThis;function noop$3(){}function functionalUpdate(updater,input){return typeof updater===`function`?updater(input):updater}function isValidTimeout(value){return typeof value===`number`&&value>=0&&value!==Infinity}function timeUntilStale(updatedAt,staleTime){return Math.max(updatedAt+(staleTime||0)-Date.now(),0)}function resolveQueryValue(value,query){return typeof value===`function`?value(query):value}function matchQuery(filters,query){const{type=`all`,exact,fetchStatus,predicate,queryKey,stale}=filters;if(queryKey){if(exact){if(query.queryHash!==hashQueryKeyByOptions(queryKey,query.options))return false}else if(!partialMatchKey(query.queryKey,queryKey))return false}if(type!==`all`){const isActive=query.isActive();if(type===`active`&&!isActive)return false;if(type===`inactive`&&isActive)return false}if(typeof stale===`boolean`&&query.isStale()!==stale)return false;if(fetchStatus&&fetchStatus!==query.state.fetchStatus)return false;if(predicate&&!predicate(query))return false;return true}function matchMutation(filters,mutation){const{exact,status,predicate,mutationKey}=filters;if(mutationKey){if(!mutation.options.mutationKey)return false;if(exact){if(hashKey(mutation.options.mutationKey)!==hashKey(mutationKey))return false}else if(!partialMatchKey(mutation.options.mutationKey,mutationKey))return false}if(status&&mutation.state.status!==status)return false;if(predicate&&!predicate(mutation))return false;return true}function hashQueryKeyByOptions(queryKey,options){return(options?.queryKeyHashFn||hashKey)(queryKey)}function hashKey(queryKey){return JSON.stringify(queryKey,(_,val)=>isPlainObject$3(val)?Object.keys(val).sort().reduce((result,key)=>{result[key]=val[key];return result},{}):val)}function partialMatchKey(a,b){if(a===b)return true;if(typeof a!==typeof b)return false;if(a&&b&&typeof a===`object`&&typeof b===`object`){if(Array.isArray(a)&&Array.isArray(b)){if(b.length>a.length)return false;for(let i=0;i<b.length;i++)if(!partialMatchKey(a[i],b[i]))return false;return true}const bKeys=Object.keys(b);for(const key of bKeys)if(!partialMatchKey(a[key],b[key]))return false;return true}return false}var hasOwn=Object.prototype.hasOwnProperty;function replaceEqualDeep(a,b,depth=0){if(a===b)return a;if(depth>500)return b;const array=isPlainArray(a)&&isPlainArray(b);if(!array&&!(isPlainObject$3(a)&&isPlainObject$3(b)))return b;const aSize=(array?a:Object.keys(a)).length;const bItems=array?b:Object.keys(b);const bSize=bItems.length;const copy=array?new Array(bSize):{};let equalItems=0;for(let i=0;i<bSize;i++){const key=array?i:bItems[i];const aItem=a[key];const bItem=b[key];if(aItem===bItem){copy[key]=aItem;if(array?i<aSize:hasOwn.call(a,key))equalItems++;continue}if(aItem===null||bItem===null||typeof aItem!==`object`||typeof bItem!==`object`){copy[key]=bItem;continue}const v=replaceEqualDeep(aItem,bItem,depth+1);copy[key]=v;if(v===aItem)equalItems++}return aSize===bSize&&equalItems===aSize?a:copy}function shallowEqualObjects(a,b){if(!b||Object.keys(a).length!==Object.keys(b).length)return false;for(const key in a)if(a[key]!==b[key])return false;return true}function isPlainArray(value){return Array.isArray(value)&&value.length===Object.keys(value).length}function isPlainObject$3(o){if(!hasObjectPrototype(o))return false;const objectPrototype=Object.getPrototypeOf(o);const ctor=objectPrototype?.constructor;if(ctor===void 0)return true;if(typeof ctor!==`function`)return false;const prot=ctor.prototype;if(!hasObjectPrototype(prot))return false;if(!prot.hasOwnProperty(`isPrototypeOf`))return false;if(objectPrototype!==Object.prototype)return false;return true}function hasObjectPrototype(o){return Object.prototype.toString.call(o)===`[object Object]`}function sleep$1(timeout){return new Promise(resolve=>{timeoutManager.setTimeout(resolve,timeout)})}function replaceData(prevData,data,options){if(typeof options.structuralSharing===`function`)return options.structuralSharing(prevData,data);else if(options.structuralSharing!==false)return replaceEqualDeep(prevData,data);return data}function addToEnd(items,item,max=0){const newItems=[...items,item];return max&&newItems.length>max?newItems.slice(1):newItems}function addToStart(items,item,max=0){const newItems=[item,...items];return max&&newItems.length>max?newItems.slice(0,-1):newItems}var skipToken=Symbol();function ensureQueryFn(options,fetchOptions){if(!options.queryFn&&fetchOptions?.initialPromise)return()=>fetchOptions.initialPromise;if(!options.queryFn||options.queryFn===skipToken)return()=>Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));return options.queryFn}function shouldThrowError(throwOnError,params){if(typeof throwOnError===`function`)return throwOnError(...params);return!!throwOnError}function addConsumeAwareSignal(object,getSignal,onCancelled){let consumed=false;let signal;Object.defineProperty(object,"signal",{enumerable:true,get:()=>{signal??=getSignal();if(consumed)return signal;consumed=true;if(signal.aborted)onCancelled();else signal.addEventListener(`abort`,onCancelled,{once:true});return signal}});return object}var isServerFn=()=>isServer$1;var isServer=()=>isServerFn();var environmentManager={isServer,setIsServer(isServerValue){isServerFn=isServerValue}};var Subscribable=class{constructor(){this.listeners=new Set;this.subscribe=this.subscribe.bind(this)}subscribe(listener){this.listeners.add(listener);this.onSubscribe();return()=>{this.listeners.delete(listener);this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var FocusManager=class extends Subscribable{#focused;#cleanup;#setup;constructor(){super();this.#setup=onFocus=>{if(typeof window!==`undefined`&&window.addEventListener){const listener=()=>onFocus();window.addEventListener(`visibilitychange`,listener,false);return()=>{window.removeEventListener(`visibilitychange`,listener)}}}}onSubscribe(){if(!this.#cleanup)this.setEventListener(this.#setup)}onUnsubscribe(){if(!this.hasListeners()){this.#cleanup?.();this.#cleanup=void 0}}setEventListener(setup){this.#setup=setup;this.#cleanup?.();this.#cleanup=setup(focused=>{if(typeof focused===`boolean`)this.setFocused(focused);else this.onFocus()})}setFocused(focused){if(this.#focused!==focused){this.#focused=focused;this.onFocus()}}onFocus(){const isFocused=this.isFocused();this.listeners.forEach(listener=>{listener(isFocused)})}isFocused(){if(typeof this.#focused===`boolean`)return this.#focused;return globalThis.document?.visibilityState!==`hidden`}};var focusManager=new FocusManager;var defaultScheduler=systemSetTimeoutZero;function createNotifyManager(){let queue=[];let transactions=0;let notifyFn=callback=>{callback()};let batchNotifyFn=callback=>{callback()};let scheduleFn=defaultScheduler;const schedule=callback=>{if(transactions)queue.push(callback);else scheduleFn(()=>{notifyFn(callback)})};const flush=()=>{const originalQueue=queue;queue=[];if(originalQueue.length)scheduleFn(()=>{batchNotifyFn(()=>{originalQueue.forEach(callback=>{notifyFn(callback)})})})};return{batch:callback=>{let result;transactions++;try{result=callback()}finally{transactions--;if(!transactions)flush()}return result},batchCalls:callback=>{return(...args)=>{schedule(()=>{callback(...args)})}},schedule,setNotifyFunction:fn=>{notifyFn=fn},setBatchNotifyFunction:fn=>{batchNotifyFn=fn},setScheduler:fn=>{scheduleFn=fn}}}var notifyManager=createNotifyManager();var OnlineManager=class extends Subscribable{#online=true;#cleanup;#setup;constructor(){super();this.#setup=onOnline=>{if(typeof window!==`undefined`&&window.addEventListener){const onlineListener=()=>onOnline(true);const offlineListener=()=>onOnline(false);window.addEventListener(`online`,onlineListener,false);window.addEventListener(`offline`,offlineListener,false);return()=>{window.removeEventListener(`online`,onlineListener);window.removeEventListener(`offline`,offlineListener)}}}}onSubscribe(){if(!this.#cleanup)this.setEventListener(this.#setup)}onUnsubscribe(){if(!this.hasListeners()){this.#cleanup?.();this.#cleanup=void 0}}setEventListener(setup){this.#setup=setup;this.#cleanup?.();this.#cleanup=setup(this.setOnline.bind(this))}setOnline(online){if(this.#online!==online){this.#online=online;this.listeners.forEach(listener=>{listener(online)})}}isOnline(){return this.#online}};var onlineManager=new OnlineManager;function defaultRetryDelay(failureCount){return Math.min(1e3*2**failureCount,3e4)}function canFetch(networkMode){return(networkMode??`online`)===`online`?onlineManager.isOnline():true}var CancelledError=class extends Error{constructor(options){super(`CancelledError`);this.revert=options?.revert;this.silent=options?.silent}};function createRetryer(config){let isRetryCancelled=false;let failureCount=0;let continueFn;let status=`pending`;let promiseResolve;let promiseReject;const promise=new Promise((resolve,reject)=>{promiseResolve=resolve;promiseReject=reject});promise.catch(noop$3);const isResolved=()=>status!==`pending`;const cancel=cancelOptions=>{if(!isResolved()){const error=new CancelledError(cancelOptions);reject(error);config.onCancel?.(error)}};const cancelRetry=()=>{isRetryCancelled=true};const continueRetry=()=>{isRetryCancelled=false};const canContinue=()=>focusManager.isFocused()&&(config.networkMode===`always`||onlineManager.isOnline())&&config.canRun();const canStart=()=>canFetch(config.networkMode)&&config.canRun();const resolve=value=>{if(!isResolved()){continueFn?.();status=`resolved`;promiseResolve(value)}};const reject=value=>{if(!isResolved()){continueFn?.();status=`rejected`;promiseReject(value)}};const pause=()=>{return new Promise(continueResolve=>{continueFn=value=>{if(isResolved()||canContinue())continueResolve(value)};config.onPause?.()}).then(()=>{continueFn=void 0;if(!isResolved())config.onContinue?.()})};const run=()=>{if(isResolved())return;let promiseOrValue;const initialPromise=failureCount===0?config.initialPromise:void 0;try{promiseOrValue=initialPromise??config.fn()}catch(error){promiseOrValue=Promise.reject(error)}Promise.resolve(promiseOrValue).then(resolve).catch(error=>{if(isResolved())return;const retry=config.retry??(isServer()?0:3);const retryDelay=config.retryDelay??defaultRetryDelay;const delay=typeof retryDelay===`function`?retryDelay(failureCount,error):retryDelay;const shouldRetry=retry===true||typeof retry===`number`&&failureCount<retry||typeof retry===`function`&&retry(failureCount,error);if(isRetryCancelled||!shouldRetry){reject(error);return}failureCount++;config.onFail?.(failureCount,error);sleep$1(delay).then(()=>{return canContinue()?void 0:pause()}).then(()=>{if(isRetryCancelled)reject(error);else run()})})};return{promise,status:()=>status,cancel,continue:()=>{continueFn?.();return promise},cancelRetry,continueRetry,canStart,start:()=>{if(canStart())run();else pause().then(run);return promise}}}var Removable=class{#gcTimeout;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout();if(isValidTimeout(this.gcTime))this.#gcTimeout=timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime(newGcTime){this.gcTime=Math.max(this.gcTime||0,newGcTime??(isServer()?Infinity:3e5))}clearGcTimeout(){if(this.#gcTimeout!==void 0){timeoutManager.clearTimeout(this.#gcTimeout);this.#gcTimeout=void 0}}};function infiniteQueryBehavior(pages){return{onFetch:(context,query)=>{const options=context.options;const direction=context.fetchOptions?.meta?.fetchMore?.direction;const oldPages=context.state.data?.pages||[];const oldPageParams=context.state.data?.pageParams||[];let result={pages:[],pageParams:[]};let currentPage=0;const fetchFn=async()=>{let cancelled=false;const addSignalProperty=object=>{addConsumeAwareSignal(object,()=>context.signal,()=>cancelled=true)};const queryFn=ensureQueryFn(context.options,context.fetchOptions);const fetchPage=async(data,param,previous)=>{if(cancelled)return Promise.reject(context.signal.reason);if(param==null&&data.pages.length)return Promise.resolve(data);const createQueryFnContext=()=>{const queryFnContext={client:context.client,queryKey:context.queryKey,pageParam:param,direction:previous?`backward`:`forward`,meta:context.options.meta};addSignalProperty(queryFnContext);return queryFnContext};const queryFnContext=createQueryFnContext();const page=await queryFn(queryFnContext);const{maxPages}=context.options;const addTo=previous?addToStart:addToEnd;return{pages:addTo(data.pages,page,maxPages),pageParams:addTo(data.pageParams,param,maxPages)}};if(direction&&oldPages.length){const previous=direction===`backward`;const pageParamFn=previous?getPreviousPageParam:getNextPageParam;const oldData={pages:oldPages,pageParams:oldPageParams};result=await fetchPage(oldData,pageParamFn(options,oldData),previous)}else{const remainingPages=pages??oldPages.length;do{const param=currentPage===0?oldPageParams[0]??options.initialPageParam:getNextPageParam(options,result);if(currentPage>0&¶m==null)break;result=await fetchPage(result,param);currentPage++}while(currentPage<remainingPages)}return result};if(context.options.persister)context.fetchFn=()=>{return context.options.persister?.(fetchFn,{client:context.client,queryKey:context.queryKey,meta:context.options.meta,signal:context.signal},query)};else context.fetchFn=fetchFn}}}function getNextPageParam(options,{pages,pageParams}){const lastIndex=pages.length-1;return pages.length>0?options.getNextPageParam(pages[lastIndex],pages,pageParams[lastIndex],pageParams):void 0}function getPreviousPageParam(options,{pages,pageParams}){return pages.length>0?options.getPreviousPageParam?.(pages[0],pages,pageParams[0],pageParams):void 0}var Query=class extends Removable{#queryType;#initialState;#revertState;#cache;#client;#retryer;#defaultOptions;#abortSignalConsumed;constructor(config){super();this.#abortSignalConsumed=false;this.#defaultOptions=config.defaultOptions;this.setOptions(config.options);this.observers=[];this.#client=config.client;this.#cache=this.#client.getQueryCache();this.queryKey=config.queryKey;this.queryHash=config.queryHash;this.#initialState=getDefaultState$1(this.options);this.state=config.state??this.#initialState;this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#queryType}get promise(){return this.#retryer?.promise}setOptions(options){this.options={...this.#defaultOptions,...options};if(options?._type)this.#queryType=options._type;this.updateGcTime(this.options.gcTime);if(this.state&&this.state.data===void 0){const defaultState=getDefaultState$1(this.options);if(defaultState.data!==void 0){this.setState(successState(defaultState.data,defaultState.dataUpdatedAt));this.#initialState=defaultState}}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus===`idle`)this.#cache.remove(this)}setData(newData,options){const data=replaceData(this.state.data,newData,this.options);this.#dispatch({data,type:`success`,dataUpdatedAt:options?.updatedAt,manual:options?.manual});return data}setState(state){this.#dispatch({type:`setState`,state})}cancel(options){const promise=this.#retryer?.promise;this.#retryer?.cancel(options);return promise?promise.then(noop$3).catch(noop$3):Promise.resolve()}destroy(){super.destroy();this.cancel({silent:true})}get resetState(){return this.#initialState}reset(){this.destroy();this.setState(this.resetState)}isActive(){return this.observers.some(observer=>resolveQueryValue(observer.options.enabled,this)!==false)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===skipToken||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(observer=>resolveQueryValue(observer.options.staleTime,this)===`static`);return false}isStale(){if(this.getObserversCount()>0)return this.observers.some(observer=>observer.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime(staleTime=0){if(this.state.data===void 0)return true;if(staleTime===`static`)return false;if(this.state.isInvalidated)return true;return!timeUntilStale(this.state.dataUpdatedAt,staleTime)}onFocus(){this.observers.find(x=>x.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:false});this.#retryer?.continue()}onOnline(){this.observers.find(x=>x.shouldFetchOnReconnect())?.refetch({cancelRefetch:false});this.#retryer?.continue()}addObserver(observer){if(!this.observers.includes(observer)){this.observers.push(observer);this.clearGcTimeout();this.#cache.notify({type:`observerAdded`,query:this,observer})}}removeObserver(observer){const index=this.observers.indexOf(observer);if(index!==-1){this.observers.splice(index,1);if(!this.observers.length){if(this.#retryer){if(this.#abortSignalConsumed||this.state.fetchStatus===`paused`&&this.state.status===`pending`)this.#retryer.cancel({revert:true});else this.#retryer.cancelRetry()}this.scheduleGc()}this.#cache.notify({type:`observerRemoved`,query:this,observer})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#dispatch({type:`invalidate`})}async fetch(options,fetchOptions){if(this.state.fetchStatus!==`idle`&&this.#retryer?.status()!==`rejected`){if(this.state.data!==void 0&&fetchOptions?.cancelRefetch)this.cancel({silent:true});else if(this.#retryer){this.#retryer.continueRetry();return this.#retryer.promise}}if(options)this.setOptions(options);if(!this.options.queryFn){const observer=this.observers.find(x=>x.options.queryFn);if(observer)this.setOptions(observer.options)}const abortController=new AbortController;const addSignalProperty=object=>{Object.defineProperty(object,"signal",{enumerable:true,get:()=>{this.#abortSignalConsumed=true;return abortController.signal}})};const fetchFn=()=>{const queryFn=ensureQueryFn(this.options,fetchOptions);const createQueryFnContext=()=>{const queryFnContext={client:this.#client,queryKey:this.queryKey,meta:this.meta};addSignalProperty(queryFnContext);return queryFnContext};const queryFnContext=createQueryFnContext();this.#abortSignalConsumed=false;if(this.options.persister)return this.options.persister(queryFn,queryFnContext,this);return queryFn(queryFnContext)};const createFetchContext=()=>{const context={fetchOptions,options:this.options,queryKey:this.queryKey,client:this.#client,state:this.state,fetchFn};addSignalProperty(context);return context};const context=createFetchContext();(this.#queryType===`infinite`?infiniteQueryBehavior(this.options.pages):this.options.behavior)?.onFetch(context,this);this.#revertState=this.state;if(this.state.fetchStatus===`idle`||this.state.fetchMeta!==context.fetchOptions?.meta)this.#dispatch({type:`fetch`,meta:context.fetchOptions?.meta});const retryer=this.#retryer=createRetryer({initialPromise:fetchOptions?.initialPromise,fn:context.fetchFn,onCancel:error=>{if(error instanceof CancelledError&&error.revert)this.setState({...this.#revertState,fetchStatus:`idle`});abortController.abort()},onFail:(failureCount,error)=>{this.#dispatch({type:`failed`,failureCount,error})},onPause:()=>{this.#dispatch({type:`pause`})},onContinue:()=>{this.#dispatch({type:`continue`})},retry:context.options.retry,retryDelay:context.options.retryDelay,networkMode:context.options.networkMode,canRun:()=>true});try{const data=await retryer.start();if(data===void 0)throw new Error(`${this.queryHash} data is undefined`);this.setData(data);this.#cache.config.onSuccess?.(data,this);this.#cache.config.onSettled?.(data,this.state.error,this);return data}catch(error){if(error instanceof CancelledError){if(error.silent)return this.#retryer.promise;else if(error.revert){if(this.state.data===void 0)throw error;return this.state.data}}this.#dispatch({type:`error`,error});this.#cache.config.onError?.(error,this);this.#cache.config.onSettled?.(this.state.data,error,this);throw error}finally{if(this.#retryer===retryer)this.#retryer=void 0;this.scheduleGc()}}#dispatch(action){const reducer=state=>{switch(action.type){case`failed`:return{...state,fetchFailureCount:action.failureCount,fetchFailureReason:action.error};case`pause`:return{...state,fetchStatus:`paused`};case`continue`:return{...state,fetchStatus:`fetching`};case`fetch`:return{...state,...fetchState(state.data,this.options),fetchMeta:action.meta??null};case`success`:const newState={...state,...successState(action.data,action.dataUpdatedAt),dataUpdateCount:state.dataUpdateCount+1,...!action.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};this.#revertState=action.manual?newState:void 0;return newState;case`error`:const error=action.error;return{...state,error,errorUpdateCount:state.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:state.fetchFailureCount+1,fetchFailureReason:error,fetchStatus:`idle`,status:`error`,isInvalidated:true};case`invalidate`:return{...state,isInvalidated:true};case`setState`:return{...state,...action.state}}};this.state=reducer(this.state);notifyManager.batch(()=>{this.observers.slice().forEach(observer=>{observer.onQueryUpdate()});this.#cache.notify({query:this,type:`updated`,action})})}};function fetchState(data,options){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(options.networkMode)?`fetching`:`paused`,...data===void 0&&{error:null,status:`pending`}}}function successState(data,dataUpdatedAt){return{data,dataUpdatedAt:dataUpdatedAt??Date.now(),error:null,isInvalidated:false,status:`success`}}function getDefaultState$1(options){const data=typeof options.initialData===`function`?options.initialData():options.initialData;const hasData=data!==void 0;const initialDataUpdatedAt=hasData?typeof options.initialDataUpdatedAt===`function`?options.initialDataUpdatedAt():options.initialDataUpdatedAt:0;return{data,dataUpdateCount:0,dataUpdatedAt:hasData?initialDataUpdatedAt??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:false,status:hasData?`success`:`pending`,fetchStatus:`idle`}}var QueryObserver=class extends Subscribable{#client;#currentQuery=void 0;#currentQueryInitialState=void 0;#currentResult=void 0;#currentResultState;#currentResultOptions;#selectError;#selectFn;#selectResult;#lastQueryWithDefinedData;#staleTimeoutId;#refetchIntervalId;#currentRefetchInterval;#trackedProps=new Set;constructor(client,options){super();this.options=options;this.#client=client;this.#selectError=null;this.bindMethods();this.setOptions(options)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){this.#currentQuery.addObserver(this);if(shouldFetchOnMount(this.#currentQuery,this.options))this.#executeFetch();else this.updateResult();this.#updateTimers()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.#currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.#currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set;this.#clearStaleTimeout();this.#clearRefetchInterval();this.#currentQuery.removeObserver(this)}setOptions(options){const prevOptions=this.options;const prevQuery=this.#currentQuery;this.options=this.#client.defaultQueryOptions(options);if(this.options.enabled!==void 0&&typeof this.options.enabled!==`boolean`&&typeof this.options.enabled!==`function`&&typeof resolveQueryValue(this.options.enabled,this.#currentQuery)!==`boolean`)throw new Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#updateQuery();this.#currentQuery.setOptions(this.options);if(prevOptions._defaulted&&!shallowEqualObjects(this.options,prevOptions))this.#client.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#currentQuery,observer:this});const mounted=this.hasListeners();if(mounted&&shouldFetchOptionally(this.#currentQuery,prevQuery,this.options,prevOptions))this.#executeFetch();this.updateResult();if(mounted&&(this.#currentQuery!==prevQuery||resolveQueryValue(this.options.enabled,this.#currentQuery)!==resolveQueryValue(prevOptions.enabled,this.#currentQuery)||resolveQueryValue(this.options.staleTime,this.#currentQuery)!==resolveQueryValue(prevOptions.staleTime,this.#currentQuery)))this.#updateStaleTimeout();const nextRefetchInterval=this.#computeRefetchInterval();if(mounted&&(this.#currentQuery!==prevQuery||resolveQueryValue(this.options.enabled,this.#currentQuery)!==resolveQueryValue(prevOptions.enabled,this.#currentQuery)||nextRefetchInterval!==this.#currentRefetchInterval))this.#updateRefetchInterval(nextRefetchInterval)}getOptimisticResult(options){const query=this.#client.getQueryCache().build(this.#client,options);const result=this.createResult(query,options);if(!shallowEqualObjects(this.getCurrentResult(),result)){this.#currentResult=result;this.#currentResultOptions=this.options;this.#currentResultState=this.#currentQuery.state}return result}getCurrentResult(){return this.#currentResult}trackResult(result,onPropTracked){return new Proxy(result,{get:(target,key)=>{this.trackProp(key);onPropTracked?.(key);return Reflect.get(target,key)}})}trackProp(key){this.#trackedProps.add(key)}getCurrentQuery(){return this.#currentQuery}refetch({...options}={}){return this.fetch({...options})}fetchOptimistic(options){const defaultedOptions=this.#client.defaultQueryOptions(options);const query=this.#client.getQueryCache().build(this.#client,defaultedOptions);let unsubscribe=()=>{};let resolveEarly;const cachePromise=new Promise(resolve=>{resolveEarly=resolve;unsubscribe=this.#client.getQueryCache().subscribe(event=>{if(event.type===`updated`&&event.query.queryHash===query.queryHash&&query.state.data!==void 0){unsubscribe();resolve(this.createResult(query,defaultedOptions))}})});return Promise.race([query.fetch().then(()=>{const result=this.createResult(query,defaultedOptions);resolveEarly?.(result);return result}).finally(()=>{unsubscribe()}),cachePromise])}fetch(fetchOptions){return this.#executeFetch({...fetchOptions,cancelRefetch:fetchOptions.cancelRefetch??true}).then(()=>{this.updateResult();return this.#currentResult})}#executeFetch(fetchOptions){this.#updateQuery();let promise=this.#currentQuery.fetch(this.options,fetchOptions);if(!fetchOptions?.throwOnError)promise=promise.catch(noop$3);return promise}#shouldScheduleTimer(timeout){return!isServer()&&resolveQueryValue(this.options.enabled,this.#currentQuery)!==false&&isValidTimeout(timeout)}#updateStaleTimeout(){this.#clearStaleTimeout();const staleTime=resolveQueryValue(this.options.staleTime,this.#currentQuery);if(this.#currentResult.isStale||!this.#shouldScheduleTimer(staleTime))return;const timeout=timeUntilStale(this.#currentResult.dataUpdatedAt,staleTime)+1;this.#staleTimeoutId=timeoutManager.setTimeout(()=>{if(!this.#currentResult.isStale)this.updateResult()},timeout)}#computeRefetchInterval(){return resolveQueryValue(this.options.refetchInterval,this.#currentQuery)??false}#updateRefetchInterval(nextInterval){this.#clearRefetchInterval();this.#currentRefetchInterval=nextInterval;if(this.#currentRefetchInterval===0||!this.#shouldScheduleTimer(this.#currentRefetchInterval))return;this.#refetchIntervalId=timeoutManager.setInterval(()=>{if(this.options.refetchIntervalInBackground||focusManager.isFocused())this.#executeFetch()},this.#currentRefetchInterval)}#updateTimers(){this.#updateStaleTimeout();this.#updateRefetchInterval(this.#computeRefetchInterval())}#clearStaleTimeout(){if(this.#staleTimeoutId!==void 0){timeoutManager.clearTimeout(this.#staleTimeoutId);this.#staleTimeoutId=void 0}}#clearRefetchInterval(){if(this.#refetchIntervalId!==void 0){timeoutManager.clearInterval(this.#refetchIntervalId);this.#refetchIntervalId=void 0}}createResult(query,options){const prevQuery=this.#currentQuery;const prevOptions=this.options;const prevResult=this.#currentResult;const prevResultState=this.#currentResultState;const prevResultOptions=this.#currentResultOptions;const queryInitialState=query!==prevQuery?query.state:this.#currentQueryInitialState;const{state}=query;let newState={...state};let isPlaceholderData=false;let data;if(options._optimisticResults){const mounted=this.hasListeners();const fetchOnMount=!mounted&&shouldFetchOnMount(query,options);const fetchOptionally=mounted&&shouldFetchOptionally(query,prevQuery,options,prevOptions);if(fetchOnMount||fetchOptionally)newState={...newState,...fetchState(state.data,query.options)};if(options._optimisticResults===`isRestoring`)newState.fetchStatus=`idle`}let{error,errorUpdatedAt,status}=newState;data=newState.data;let skipSelect=false;if(options.placeholderData!==void 0&&data===void 0&&status===`pending`){let placeholderData;if(prevResult?.isPlaceholderData&&options.placeholderData===prevResultOptions?.placeholderData){placeholderData=prevResult.data;skipSelect=true}else placeholderData=typeof options.placeholderData===`function`?options.placeholderData(this.#lastQueryWithDefinedData?.state.data,this.#lastQueryWithDefinedData):options.placeholderData;if(placeholderData!==void 0){status=`success`;data=replaceData(prevResult?.data,placeholderData,options);isPlaceholderData=true}}if(options.select&&data!==void 0&&!skipSelect){if(prevResult&&data===prevResultState?.data&&options.select===this.#selectFn)data=this.#selectResult;else try{this.#selectFn=options.select;data=options.select(data);data=replaceData(prevResult?.data,data,options);this.#selectResult=data;this.#selectError=null}catch(selectError){this.#selectError=selectError}}else if(data===void 0)this.#selectError=null;if(this.#selectError){error=this.#selectError;data=this.#selectResult;errorUpdatedAt=Date.now();status=`error`;isPlaceholderData=false}const isFetching=newState.fetchStatus===`fetching`;const isPending=status===`pending`;const isError=status===`error`;const isLoading=isPending&&isFetching;const hasData=data!==void 0;return{status,fetchStatus:newState.fetchStatus,isPending,isSuccess:status===`success`,isError,isInitialLoading:isLoading,isLoading,data,dataUpdatedAt:newState.dataUpdatedAt,error,errorUpdatedAt,failureCount:newState.fetchFailureCount,failureReason:newState.fetchFailureReason,errorUpdateCount:newState.errorUpdateCount,isFetched:query.isFetched(),isFetchedAfterMount:newState.dataUpdateCount>queryInitialState.dataUpdateCount||newState.errorUpdateCount>queryInitialState.errorUpdateCount,isFetching,isRefetching:isFetching&&!isPending,isLoadingError:isError&&!hasData,isPaused:newState.fetchStatus===`paused`,isPlaceholderData,isRefetchError:isError&&hasData,isStale:isStale(query,options),refetch:this.refetch,isEnabled:resolveQueryValue(options.enabled,query)!==false}}updateResult(){const prevResult=this.#currentResult;const nextResult=this.createResult(this.#currentQuery,this.options);this.#currentResultState=this.#currentQuery.state;this.#currentResultOptions=this.options;if(this.#currentResultState.data!==void 0)this.#lastQueryWithDefinedData=this.#currentQuery;if(shallowEqualObjects(nextResult,prevResult))return;this.#currentResult=nextResult;const shouldNotifyListeners=()=>{if(!prevResult)return true;const{notifyOnChangeProps}=this.options;const notifyOnChangePropsValue=typeof notifyOnChangeProps===`function`?notifyOnChangeProps():notifyOnChangeProps;if(notifyOnChangePropsValue===`all`||!notifyOnChangePropsValue&&!this.#trackedProps.size)return true;const includedProps=new Set(notifyOnChangePropsValue??this.#trackedProps);if(this.options.throwOnError)includedProps.add(`error`);return Object.keys(this.#currentResult).some(key=>{const typedKey=key;return this.#currentResult[typedKey]!==prevResult[typedKey]&&includedProps.has(typedKey)})};const notifyListeners=shouldNotifyListeners();notifyManager.batch(()=>{if(notifyListeners)this.listeners.forEach(listener=>{listener(this.#currentResult)});this.#client.getQueryCache().notify({query:this.#currentQuery,type:`observerResultsUpdated`})})}#updateQuery(){const query=this.#client.getQueryCache().build(this.#client,this.options);if(query===this.#currentQuery)return;const prevQuery=this.#currentQuery;this.#currentQuery=query;this.#currentQueryInitialState=query.state;if(this.hasListeners()){prevQuery?.removeObserver(this);query.addObserver(this)}}onQueryUpdate(){this.updateResult();if(this.hasListeners())this.#updateTimers()}};function shouldLoadOnMount(query,options){return resolveQueryValue(options.enabled,query)!==false&&query.state.data===void 0&&!(query.state.status===`error`&&resolveQueryValue(options.retryOnMount,query)===false)}function shouldFetchOnMount(query,options){return shouldLoadOnMount(query,options)||query.state.data!==void 0&&shouldFetchOn(query,options,options.refetchOnMount)}function shouldFetchOn(query,options,field){if(resolveQueryValue(options.enabled,query)!==false&&resolveQueryValue(options.staleTime,query)!==`static`){const value=resolveQueryValue(field,query);return value===`always`||value!==false&&isStale(query,options)}return false}function shouldFetchOptionally(query,prevQuery,options,prevOptions){return(query!==prevQuery||resolveQueryValue(prevOptions.enabled,query)===false)&&(!options.suspense||query.state.status!==`error`)&&isStale(query,options)}function isStale(query,options){return resolveQueryValue(options.enabled,query)!==false&&query.isStaleByTime(resolveQueryValue(options.staleTime,query))}var Mutation=class extends Removable{#client;#observers;#mutationCache;#retryer;constructor(config){super();this.#client=config.client;this.mutationId=config.mutationId;this.#mutationCache=config.mutationCache;this.#observers=[];this.state=config.state||getDefaultState();this.setOptions(config.options);this.scheduleGc()}setOptions(options){this.options=options;this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(observer){if(!this.#observers.includes(observer)){this.#observers.push(observer);this.clearGcTimeout();this.#mutationCache.notify({type:`observerAdded`,mutation:this,observer})}}removeObserver(observer){this.#observers=this.#observers.filter(x=>x!==observer);this.scheduleGc();this.#mutationCache.notify({type:`observerRemoved`,mutation:this,observer})}optionalRemove(){if(!this.#observers.length){if(this.state.status===`pending`)this.scheduleGc();else this.#mutationCache.remove(this)}}continue(){return this.#retryer?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(variables){const onContinue=()=>{this.#dispatch({type:`continue`})};const mutationFnContext={client:this.#client,meta:this.options.meta,mutationKey:this.options.mutationKey};const retryer=this.#retryer=createRetryer({fn:()=>{if(!this.options.mutationFn)return Promise.reject(new Error(`No mutationFn found`));return this.options.mutationFn(variables,mutationFnContext)},onFail:(failureCount,error)=>{this.#dispatch({type:`failed`,failureCount,error})},onPause:()=>{this.#dispatch({type:`pause`})},onContinue,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#mutationCache.canRun(this)});const restored=this.state.status===`pending`;const isPaused=!retryer.canStart();try{if(restored)onContinue();else{this.#dispatch({type:`pending`,variables,isPaused});if(this.#mutationCache.config.onMutate)await this.#mutationCache.config.onMutate(variables,this,mutationFnContext);const context=await this.options.onMutate?.(variables,mutationFnContext);if(context!==this.state.context)this.#dispatch({type:`pending`,context,variables,isPaused})}const data=await retryer.start();await this.#mutationCache.config.onSuccess?.(data,variables,this.state.context,this,mutationFnContext);await this.options.onSuccess?.(data,variables,this.state.context,mutationFnContext);await this.#mutationCache.config.onSettled?.(data,null,this.state.variables,this.state.context,this,mutationFnContext);await this.options.onSettled?.(data,null,variables,this.state.context,mutationFnContext);this.#dispatch({type:`success`,data});return data}catch(error){try{await this.#mutationCache.config.onError?.(error,variables,this.state.context,this,mutationFnContext)}catch(e){Promise.reject(e)}try{await this.options.onError?.(error,variables,this.state.context,mutationFnContext)}catch(e){Promise.reject(e)}try{await this.#mutationCache.config.onSettled?.(void 0,error,this.state.variables,this.state.context,this,mutationFnContext)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,error,variables,this.state.context,mutationFnContext)}catch(e){Promise.reject(e)}this.#dispatch({type:`error`,error});throw error}finally{if(this.#retryer===retryer)this.#retryer=void 0;this.#mutationCache.runNext(this)}}#dispatch(action){const reducer=state=>{switch(action.type){case`failed`:return{...state,failureCount:action.failureCount,failureReason:action.error};case`pause`:return{...state,isPaused:true};case`continue`:return{...state,isPaused:false};case`pending`:return{...state,context:action.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:action.isPaused,status:`pending`,variables:action.variables,submittedAt:Date.now()};case`success`:return{...state,data:action.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:false};case`error`:return{...state,data:void 0,error:action.error,failureCount:state.failureCount+1,failureReason:action.error,isPaused:false,status:`error`}}};this.state=reducer(this.state);notifyManager.batch(()=>{this.#observers.forEach(observer=>{observer.onMutationUpdate(action)});this.#mutationCache.notify({mutation:this,type:`updated`,action})})}};function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:false,status:`idle`,variables:void 0,submittedAt:0}}var MutationCache$1=class extends Subscribable{#mutations;#scopes;#mutationId;constructor(config={}){super();this.config=config;this.#mutations=new Set;this.#scopes=new Map;this.#mutationId=0}build(client,options,state){const mutation=new Mutation({client,mutationCache:this,mutationId:++this.#mutationId,options:client.defaultMutationOptions(options),state});this.add(mutation);return mutation}add(mutation){this.#mutations.add(mutation);const scope=scopeFor(mutation);if(typeof scope===`string`){const scopedMutations=this.#scopes.get(scope);if(scopedMutations)scopedMutations.push(mutation);else this.#scopes.set(scope,[mutation])}this.notify({type:`added`,mutation})}remove(mutation){if(this.#mutations.delete(mutation)){const scope=scopeFor(mutation);if(typeof scope===`string`){const scopedMutations=this.#scopes.get(scope);if(scopedMutations){if(scopedMutations.length>1){const index=scopedMutations.indexOf(mutation);if(index!==-1)scopedMutations.splice(index,1)}else if(scopedMutations[0]===mutation)this.#scopes.delete(scope)}}}this.notify({type:`removed`,mutation})}canRun(mutation){const scope=scopeFor(mutation);if(typeof scope===`string`){const firstPendingMutation=this.#scopes.get(scope)?.find(m=>m.state.status===`pending`);return!firstPendingMutation||firstPendingMutation===mutation}else return true}runNext(mutation){const scope=scopeFor(mutation);if(typeof scope===`string`)return(this.#scopes.get(scope)?.find(m=>m!==mutation&&m.state.isPaused))?.continue()??Promise.resolve();else return Promise.resolve()}clear(){notifyManager.batch(()=>{this.#mutations.forEach(mutation=>{this.notify({type:`removed`,mutation})});this.#mutations.clear();this.#scopes.clear()})}getAll(){return Array.from(this.#mutations)}find(filters){const defaultedFilters={exact:true,...filters};return this.getAll().find(mutation=>matchMutation(defaultedFilters,mutation))}findAll(filters={}){return this.getAll().filter(mutation=>matchMutation(filters,mutation))}notify(event){notifyManager.batch(()=>{this.listeners.forEach(listener=>{listener(event)})})}resumePausedMutations(){const pausedMutations=this.getAll().filter(x=>x.state.isPaused);return notifyManager.batch(()=>Promise.all(pausedMutations.map(mutation=>mutation.continue().catch(noop$3))))}};function scopeFor(mutation){return mutation.options.scope?.id}var MutationObserver$1=class extends Subscribable{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super();this.#client=client;this.setOptions(options);this.bindMethods();this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this);this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options);if(!shallowEqualObjects(this.options,prevOptions))this.#client.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#currentMutation,observer:this});if(prevOptions?.mutationKey&&this.options.mutationKey&&hashKey(prevOptions.mutationKey)!==hashKey(this.options.mutationKey))this.reset();else if(this.#currentMutation?.state.status===`pending`)this.#currentMutation.setOptions(this.options)}onSubscribe(){if(this.listeners.size===1&&this.#currentMutation){this.#currentMutation.addObserver(this);this.#updateResult()}}onUnsubscribe(){if(!this.hasListeners())this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult();this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this);this.#currentMutation=void 0;this.#updateResult();this.#notify()}mutate(variables,options){this.#mutateOptions=options;this.#currentMutation?.removeObserver(this);this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options);this.#currentMutation.addObserver(this);return this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??getDefaultState();this.#currentResult={...state,isPending:state.status===`pending`,isSuccess:state.status===`success`,isError:state.status===`error`,isIdle:state.status===`idle`,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.batch(()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables;const onMutateResult=this.#currentResult.context;const context={client:this.#client,meta:this.options.meta,mutationKey:this.options.mutationKey};if(action?.type===`success`){try{this.#mutateOptions.onSuccess?.(action.data,variables,onMutateResult,context)}catch(e){Promise.reject(e)}try{this.#mutateOptions.onSettled?.(action.data,null,variables,onMutateResult,context)}catch(e){Promise.reject(e)}}else if(action?.type===`error`){try{this.#mutateOptions.onError?.(action.error,variables,onMutateResult,context)}catch(e){Promise.reject(e)}try{this.#mutateOptions.onSettled?.(void 0,action.error,variables,onMutateResult,context)}catch(e){Promise.reject(e)}}}this.listeners.forEach(listener=>{listener(this.#currentResult)})})}};var QueryCache$1=class extends Subscribable{#queries;constructor(config={}){super();this.config=config;this.#queries=new Map}build(client,options,state){const queryKey=options.queryKey;const queryHash=options.queryHash??hashQueryKeyByOptions(queryKey,options);let query=this.get(queryHash);if(!query){query=new Query({client,queryKey,queryHash,options:client.defaultQueryOptions(options),state,defaultOptions:client.getQueryDefaults(queryKey)});this.add(query)}return query}add(query){if(!this.#queries.has(query.queryHash)){this.#queries.set(query.queryHash,query);this.notify({type:`added`,query})}}remove(query){const queryInMap=this.#queries.get(query.queryHash);if(queryInMap){query.destroy();if(queryInMap===query)this.#queries.delete(query.queryHash);this.notify({type:`removed`,query})}}clear(){notifyManager.batch(()=>{this.getAll().forEach(query=>{this.remove(query)})})}get(queryHash){return this.#queries.get(queryHash)}getAll(){return[...this.#queries.values()]}find(filters){const defaultedFilters={exact:true,...filters};return this.getAll().find(query=>matchQuery(defaultedFilters,query))}findAll(filters={}){const queries=this.getAll();return Object.keys(filters).length>0?queries.filter(query=>matchQuery(filters,query)):queries}notify(event){notifyManager.batch(()=>{this.listeners.forEach(listener=>{listener(event)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(query=>{query.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(query=>{query.onOnline()})})}};var QueryClient$1=class{#queryCache;#mutationCache;#defaultOptions;#queryDefaults;#mutationDefaults;#mountCount;#unsubscribeFocus;#unsubscribeOnline;constructor(config={}){this.#queryCache=config.queryCache||new QueryCache$1;this.#mutationCache=config.mutationCache||new MutationCache$1;this.#defaultOptions=config.defaultOptions||{};this.#queryDefaults=new Map;this.#mutationDefaults=new Map;this.#mountCount=0}mount(){this.#mountCount++;if(this.#mountCount!==1)return;this.#unsubscribeFocus=focusManager.subscribe(async focused=>{if(focused){await this.resumePausedMutations();this.#queryCache.onFocus()}});this.#unsubscribeOnline=onlineManager.subscribe(async online=>{if(online){await this.resumePausedMutations();this.#queryCache.onOnline()}})}unmount(){this.#mountCount--;if(this.#mountCount!==0)return;this.#unsubscribeFocus?.();this.#unsubscribeFocus=void 0;this.#unsubscribeOnline?.();this.#unsubscribeOnline=void 0}isFetching(filters){return this.#queryCache.findAll({...filters,fetchStatus:`fetching`}).length}isMutating(filters){return this.#mutationCache.findAll({...filters,status:`pending`}).length}getQueryData(queryKey){const options=this.defaultQueryOptions({queryKey});return this.#queryCache.get(options.queryHash)?.state.data}ensureQueryData(options){const defaultedOptions=this.defaultQueryOptions(options);const query=this.#queryCache.build(this,defaultedOptions);const cachedData=query.state.data;if(cachedData===void 0)return this.fetchQuery(options);if(options.revalidateIfStale&&query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime,query)))this.prefetchQuery(defaultedOptions);return Promise.resolve(cachedData)}getQueriesData(filters){return this.#queryCache.findAll(filters).map(({queryKey,state})=>{return[queryKey,state.data]})}setQueryData(queryKey,updater,options){const defaultedOptions=this.defaultQueryOptions({queryKey});const prevData=this.#queryCache.get(defaultedOptions.queryHash)?.state.data;const data=functionalUpdate(updater,prevData);if(data===void 0)return;return this.#queryCache.build(this,defaultedOptions).setData(data,{...options,manual:true})}setQueriesData(filters,updater,options){return notifyManager.batch(()=>this.#queryCache.findAll(filters).map(({queryKey})=>[queryKey,this.setQueryData(queryKey,updater,options)]))}getQueryState(queryKey){const options=this.defaultQueryOptions({queryKey});return this.#queryCache.get(options.queryHash)?.state}removeQueries(filters){const queryCache=this.#queryCache;notifyManager.batch(()=>{queryCache.findAll(filters).forEach(query=>{queryCache.remove(query)})})}resetQueries(filters,options){const queryCache=this.#queryCache;return notifyManager.batch(()=>{const matched=queryCache.findAll(filters);const queriesToRefetch=new Set(matched);matched.forEach(query=>{query.reset()});return this.refetchQueries({type:`active`,predicate:query=>queriesToRefetch.has(query)},options)})}cancelQueries(filters,cancelOptions={}){const defaultedCancelOptions={revert:true,...cancelOptions};const promises=notifyManager.batch(()=>this.#queryCache.findAll(filters).map(query=>query.cancel(defaultedCancelOptions)));return Promise.all(promises).then(noop$3).catch(noop$3)}invalidateQueries(filters,options={}){return notifyManager.batch(()=>{this.#queryCache.findAll(filters).forEach(query=>{query.invalidate()});if(filters?.refetchType===`none`)return Promise.resolve();return this.refetchQueries({...filters,type:filters?.refetchType??filters?.type??`active`},options)})}refetchQueries(filters,options={}){const fetchOptions={...options,cancelRefetch:options.cancelRefetch??true};const promises=notifyManager.batch(()=>this.#queryCache.findAll(filters).filter(query=>!query.isDisabled()&&!query.isStatic()).map(query=>{let promise=query.fetch(void 0,fetchOptions);if(!fetchOptions.throwOnError)promise=promise.catch(noop$3);return query.state.fetchStatus===`paused`?Promise.resolve():promise}));return Promise.all(promises).then(noop$3)}async query(options){const defaultedOptions=this.defaultQueryOptions(options);if(defaultedOptions.retry===void 0)defaultedOptions.retry=false;const query=this.#queryCache.build(this,defaultedOptions);const queryData=query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime,query))?await query.fetch(defaultedOptions):query.state.data;const select=defaultedOptions.select;if(select)return select(queryData);return queryData}fetchQuery(options){const defaultedOptions=this.defaultQueryOptions(options);if(defaultedOptions.retry===void 0)defaultedOptions.retry=false;const query=this.#queryCache.build(this,defaultedOptions);return query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime,query))?query.fetch(defaultedOptions):Promise.resolve(query.state.data)}prefetchQuery(options){return this.fetchQuery(options).then(noop$3).catch(noop$3)}infiniteQuery(options){options._type=`infinite`;return this.query(options)}fetchInfiniteQuery(options){options._type=`infinite`;return this.fetchQuery(options)}prefetchInfiniteQuery(options){return this.fetchInfiniteQuery(options).then(noop$3).catch(noop$3)}ensureInfiniteQueryData(options){options._type=`infinite`;return this.ensureQueryData(options)}resumePausedMutations(){if(onlineManager.isOnline())return this.#mutationCache.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#queryCache}getMutationCache(){return this.#mutationCache}getDefaultOptions(){return this.#defaultOptions}setDefaultOptions(options){this.#defaultOptions=options}setQueryDefaults(queryKey,options){this.#queryDefaults.set(hashKey(queryKey),{queryKey,defaultOptions:options})}getQueryDefaults(queryKey){const defaults=[...this.#queryDefaults.values()];const result={};defaults.forEach(queryDefault=>{if(partialMatchKey(queryKey,queryDefault.queryKey))Object.assign(result,queryDefault.defaultOptions)});return result}setMutationDefaults(mutationKey,options){this.#mutationDefaults.set(hashKey(mutationKey),{mutationKey,defaultOptions:options})}getMutationDefaults(mutationKey){const defaults=[...this.#mutationDefaults.values()];const result={};defaults.forEach(queryDefault=>{if(partialMatchKey(mutationKey,queryDefault.mutationKey))Object.assign(result,queryDefault.defaultOptions)});return result}defaultQueryOptions(options){if(options._defaulted)return options;const defaultedOptions={...this.#defaultOptions.queries,...this.getQueryDefaults(options.queryKey),...options,_defaulted:true};if(!defaultedOptions.queryHash)defaultedOptions.queryHash=hashQueryKeyByOptions(defaultedOptions.queryKey,defaultedOptions);if(defaultedOptions.refetchOnReconnect===void 0)defaultedOptions.refetchOnReconnect=defaultedOptions.networkMode!==`always`;if(defaultedOptions.throwOnError===void 0)defaultedOptions.throwOnError=!!defaultedOptions.suspense;if(!defaultedOptions.networkMode&&defaultedOptions.persister)defaultedOptions.networkMode=`offlineFirst`;if(defaultedOptions.queryFn===skipToken)defaultedOptions.enabled=false;return defaultedOptions}defaultMutationOptions(options){if(options?._defaulted)return options;return{...this.#defaultOptions.mutations,...options?.mutationKey&&this.getMutationDefaults(options.mutationKey),...options,_defaulted:true}}clear(){this.#queryCache.clear();this.#mutationCache.clear()}};var QueryCache=class extends QueryCache$1{find(filters){return super.find(cloneDeepUnref(filters))}findAll(filters={}){return super.findAll(cloneDeepUnref(filters))}};var MutationCache=class extends MutationCache$1{find(filters){return super.find(cloneDeepUnref(filters))}findAll(filters={}){return super.findAll(cloneDeepUnref(filters))}};var QueryClient=class extends QueryClient$1{constructor(config={}){const vueQueryConfig={defaultOptions:config.defaultOptions,queryCache:config.queryCache||new QueryCache,mutationCache:config.mutationCache||new MutationCache};super(vueQueryConfig);this.isRestoring=ref(false)}isFetching(filters={}){return super.isFetching(cloneDeepUnref(filters))}isMutating(filters={}){return super.isMutating(cloneDeepUnref(filters))}getQueryData(queryKey){return super.getQueryData(cloneDeepUnref(queryKey))}ensureQueryData(options){return super.ensureQueryData(cloneDeepUnref(options))}getQueriesData(filters){return super.getQueriesData(cloneDeepUnref(filters))}setQueryData(queryKey,updater,options={}){return super.setQueryData(cloneDeepUnref(queryKey),updater,cloneDeepUnref(options))}setQueriesData(filters,updater,options={}){return super.setQueriesData(cloneDeepUnref(filters),updater,cloneDeepUnref(options))}getQueryState(queryKey){return super.getQueryState(cloneDeepUnref(queryKey))}removeQueries(filters={}){return super.removeQueries(cloneDeepUnref(filters))}resetQueries(filters={},options={}){return super.resetQueries(cloneDeepUnref(filters),cloneDeepUnref(options))}cancelQueries(filters={},options={}){return super.cancelQueries(cloneDeepUnref(filters),cloneDeepUnref(options))}invalidateQueries(filters={},options={}){const filtersCloned=cloneDeepUnref(filters);const optionsCloned=cloneDeepUnref(options);super.invalidateQueries({...filtersCloned,refetchType:`none`},optionsCloned);if(filtersCloned.refetchType===`none`)return Promise.resolve();const refetchFilters={...filtersCloned,type:filtersCloned.refetchType??filtersCloned.type??`active`};return nextTick$1().then(()=>{return super.refetchQueries(refetchFilters,optionsCloned)})}refetchQueries(filters={},options={}){return super.refetchQueries(cloneDeepUnref(filters),cloneDeepUnref(options))}query(options){return super.query(cloneDeepUnref(options))}fetchQuery(options){return super.fetchQuery(cloneDeepUnref(options))}prefetchQuery(options){return super.prefetchQuery(cloneDeepUnref(options))}infiniteQuery(options){return super.infiniteQuery(cloneDeepUnref(options))}fetchInfiniteQuery(options){return super.fetchInfiniteQuery(cloneDeepUnref(options))}prefetchInfiniteQuery(options){return super.prefetchInfiniteQuery(cloneDeepUnref(options))}setDefaultOptions(options){super.setDefaultOptions(cloneDeepUnref(options))}setQueryDefaults(queryKey,options){super.setQueryDefaults(cloneDeepUnref(queryKey),cloneDeepUnref(options))}getQueryDefaults(queryKey){return super.getQueryDefaults(cloneDeepUnref(queryKey))}setMutationDefaults(mutationKey,options){super.setMutationDefaults(cloneDeepUnref(mutationKey),cloneDeepUnref(options))}getMutationDefaults(mutationKey){return super.getMutationDefaults(cloneDeepUnref(mutationKey))}};var VueQueryPlugin={install:(app,options={})=>{const clientKey=getClientKey(options.queryClientKey);let client;if(`queryClient`in options&&options.queryClient)client=options.queryClient;else{const clientConfig=`queryClientConfig`in options?options.queryClientConfig:void 0;client=new QueryClient(clientConfig)}if(!environmentManager.isServer())client.mount();let persisterUnmount=()=>{};if(options.clientPersister){if(client.isRestoring)client.isRestoring.value=true;const[unmount,promise]=options.clientPersister(client);persisterUnmount=unmount;promise.then(()=>{if(client.isRestoring)client.isRestoring.value=false;options.clientPersisterOnSuccess?.(client)})}const cleanup=()=>{client.unmount();persisterUnmount()};if(app.onUnmount)app.onUnmount(cleanup);else{const originalUnmount=app.unmount;app.unmount=function vueQueryUnmount(){cleanup();originalUnmount()}}if(false)app.mixin({beforeCreate(){if(!this._provided){const provideCache={};Object.defineProperty(this,"_provided",{get:()=>provideCache,set:v=>Object.assign(provideCache,v)})}this._provided[clientKey]=client}});else app.provide(clientKey,client)}};function useBaseQuery(Observer,options,queryClient){const client=queryClient||useQueryClient();const defaultedOptions=computed(()=>{let resolvedOptions=options;if(typeof resolvedOptions===`function`)resolvedOptions=resolvedOptions();const clonedOptions=cloneDeepUnref(resolvedOptions);if(typeof clonedOptions.enabled===`function`)clonedOptions.enabled=clonedOptions.enabled();const defaulted=client.defaultQueryOptions(clonedOptions);defaulted._optimisticResults=client.isRestoring?.value?`isRestoring`:`optimistic`;return defaulted});const observer=new Observer(client,defaultedOptions.value);const state=defaultedOptions.value.shallow?shallowReactive(observer.getCurrentResult()):reactive(observer.getCurrentResult());let unsubscribe=()=>{};if(client.isRestoring)watch(client.isRestoring,isRestoring=>{if(!isRestoring){unsubscribe();unsubscribe=observer.subscribe(result=>{updateState(state,result)})}},{immediate:true});const updater=()=>{observer.setOptions(defaultedOptions.value);updateState(state,observer.getCurrentResult())};watch(defaultedOptions,updater);onScopeDispose(()=>{unsubscribe()});const refetch=(...args)=>{updater();return state.refetch(...args)};const suspense=()=>{return new Promise((resolve,reject)=>{let stopWatch=()=>{};const run=()=>{if(defaultedOptions.value.enabled!==false){observer.setOptions(defaultedOptions.value);const optimisticResult=observer.getOptimisticResult(defaultedOptions.value);if(optimisticResult.isStale){stopWatch();observer.fetchOptimistic(defaultedOptions.value).then(resolve,error=>{if(shouldThrowError(defaultedOptions.value.throwOnError,[error,observer.getCurrentQuery()]))reject(error);else resolve(observer.getCurrentResult())})}else{stopWatch();resolve(optimisticResult)}}};run();stopWatch=watch(defaultedOptions,run)})};watch(()=>state.error,error=>{if(state.isError&&!state.isFetching&&shouldThrowError(defaultedOptions.value.throwOnError,[error,observer.getCurrentQuery()]))throw error});const readonlyState=defaultedOptions.value.shallow?shallowReadonly(state):readonly(state);const object=toRefs(readonlyState);for(const key in state)if(typeof state[key]===`function`)object[key]=state[key];object.suspense=suspense;object.refetch=refetch;return object}function useQuery(options,queryClient){return useBaseQuery(QueryObserver,options,queryClient)}function useMutation(options,queryClient){const client=queryClient||useQueryClient();const defaultedOptions=computed(()=>{const resolvedOptions=typeof options===`function`?options():options;return client.defaultMutationOptions(cloneDeepUnref(resolvedOptions))});const observer=new MutationObserver$1(client,defaultedOptions.value);const state=defaultedOptions.value.shallow?shallowReactive(observer.getCurrentResult()):reactive(observer.getCurrentResult());const unsubscribe=observer.subscribe(result=>{updateState(state,result)});const mutate=(...args)=>{observer.mutate(args[0],args[1]).catch(()=>{})};watch(defaultedOptions,()=>{observer.setOptions(defaultedOptions.value)});onScopeDispose(()=>{unsubscribe()});const readonlyState=defaultedOptions.value.shallow?shallowReadonly(state):readonly(state);const resultRefs=toRefs(readonlyState);watch(()=>state.error,error=>{if(error&&shouldThrowError(defaultedOptions.value.throwOnError,[error]))throw error});return{...resultRefs,mutate,mutateAsync:state.mutate,reset:state.reset}}var isAbsolutePath=path=>path.startsWith(`/`);function isRouteComponent$1(component){return typeof component===`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent$1(obj.default)}var assign=Object.assign;function applyToParams(fn,params){const newParams={};for(const key in params){const value=params[key];newParams[key]=isArray$1(value)?value.map(fn):fn(value)}return newParams}var noop$2=()=>{};var isArray$1=Array.isArray;function mergeOptions(defaults,partialOptions){const options={};for(const key in defaults)options[key]=key in partialOptions?partialOptions[key]:defaults[key];return options}var NavigationFailureSymbol=Symbol(``);var NavigationFailureType=function(NavigationFailureType){NavigationFailureType[NavigationFailureType[`aborted`]=4]=`aborted`;NavigationFailureType[NavigationFailureType[`cancelled`]=8]=`cancelled`;NavigationFailureType[NavigationFailureType[`duplicated`]=16]=`duplicated`;return NavigationFailureType}({});function createRouterError(type,params){return assign(new Error,{type,[NavigationFailureSymbol]:true},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}var matchedRouteKey=Symbol(``);var viewDepthKey=Symbol(``);var routerKey=Symbol(``);var routeLocationKey=Symbol(``);var routerViewLocationKey=Symbol(``);function useRouter$1(){return inject$1(routerKey)}function useRoute$1(_name){return inject$1(routeLocationKey)}var isBrowser=typeof document!==`undefined`;var HASH_RE=/#/g;var AMPERSAND_RE=/&/g;var SLASH_RE=/\//g;var EQUAL_RE=/=/g;var IM_RE=/\?/g;var PLUS_RE=/\+/g;var ENC_BRACKET_OPEN_RE=/%5B/g;var ENC_BRACKET_CLOSE_RE=/%5D/g;var ENC_CARET_RE=/%5E/g;var ENC_BACKTICK_RE=/%60/g;var ENC_CURLY_OPEN_RE=/%7B/g;var ENC_PIPE_RE=/%7C/g;var ENC_CURLY_CLOSE_RE=/%7D/g;var ENC_SPACE_RE=/%20/g;function commonEncode(text){return text==null?``:encodeURI(``+text).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text){return commonEncode(text).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text){return commonEncode(text).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,`%3D`)}function encodePath(text){return commonEncode(text).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text){return encodePath(text).replace(SLASH_RE,`%2F`)}function decode$2(text){if(text==null)return null;try{return decodeURIComponent(``+text)}catch{}return``+text}var TRAILING_SLASH_RE=/\/$/;var removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery,location,currentLocation=`/`){let path,query={},searchString=``,hash=``;const hashPos=location.indexOf(`#`);let searchPos=location.indexOf(`?`);searchPos=hashPos>=0&&searchPos>hashPos?-1:searchPos;if(searchPos>=0){path=location.slice(0,searchPos);searchString=location.slice(searchPos,hashPos>0?hashPos:location.length);query=parseQuery(searchString.slice(1))}if(hashPos>=0){path=path||location.slice(0,hashPos);hash=location.slice(hashPos,location.length)}path=resolveRelativePath(path!=null?path:location,currentLocation);return{fullPath:path+searchString+hash,path,query,hash:decode$2(hash)}}function stringifyURL(stringifyQuery,location){const query=location.query?stringifyQuery(location.query):``;return location.path+(query&&`?`)+query+(location.hash||``)}function stripBase(pathname,base){if(!base||!pathname.toLowerCase().startsWith(base.toLowerCase()))return pathname;return pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery,a,b){const aLastIndex=a.matched.length-1;const bLastIndex=b.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a.matched[aLastIndex],b.matched[bLastIndex])&&isSameRouteLocationParams(a.params,b.params)&&stringifyQuery(a.query)===stringifyQuery(b.query)&&a.hash===b.hash}function isSameRouteRecord(a,b){return(a.aliasOf||a)===(b.aliasOf||b)}function isSameRouteLocationParams(a,b){if(Object.keys(a).length!==Object.keys(b).length)return false;for(var key in a)if(!isSameRouteLocationParamsValue(a[key],b[key]))return false;return true}function isSameRouteLocationParamsValue(a,b){return isArray$1(a)?isEquivalentArray(a,b):isArray$1(b)?isEquivalentArray(b,a):(a&&a.valueOf())===(b&&b.valueOf())}function isEquivalentArray(a,b){return isArray$1(b)?a.length===b.length&&a.every((value,i)=>value===b[i]):a.length===1&&a[0]===b}function resolveRelativePath(to,from){if(isAbsolutePath(to))return to;if(!to)return from;const fromSegments=from.split(`/`);const toSegments=to.split(`/`);const lastToSegment=toSegments[toSegments.length-1];if(lastToSegment===`..`||lastToSegment===`.`)toSegments.push(``);let position=fromSegments.length-1;let toPosition;let segment;for(toPosition=0;toPosition<toSegments.length;toPosition++){segment=toSegments[toPosition];if(segment===`.`)continue;if(segment===`..`){if(position>1)position--}else break}return fromSegments.slice(0,position).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}var START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};function normalizeBase(base){if(!base){if(isBrowser){const baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`;base=base.replace(/^\w+:\/\/[^/]+/,``)}else base=`/`}if(base[0]!==`/`&&base[0]!==`#`)base=`/`+base;return removeTrailingSlash(base)}var BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location){return base.replace(BEFORE_HASH_RE,`#`)+location}function getElementPosition(el,offset){const docRect=document.documentElement.getBoundingClientRect();const elRect=el.getBoundingClientRect();return{behavior:offset.behavior,left:elRect.left-docRect.left-(offset.left||0),top:elRect.top-docRect.top-(offset.top||0)}}var computeScrollPosition=()=>history.scrollRestoration===`manual`?{left:window.scrollX,top:window.scrollY}:null;function scrollToPosition(position){let scrollToOptions;if(`el`in position){const positionEl=position.el;const isIdSelector=typeof positionEl===`string`&&positionEl.startsWith(`#`);const el=typeof positionEl===`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el)return;scrollToOptions=getElementPosition(el,position)}else scrollToOptions=position;if(`scrollBehavior`in document.documentElement.style)window.scrollTo(scrollToOptions);else window.scrollTo(scrollToOptions.left!=null?scrollToOptions.left:window.scrollX,scrollToOptions.top!=null?scrollToOptions.top:window.scrollY)}function getScrollKey(path,delta){return(history.state?history.state.position-delta:-1)+path}var scrollPositions=new Map;function saveScrollPosition(key){scrollPositions.set(key,computeScrollPosition())}function getSavedScrollPosition(key){const scroll=scrollPositions.get(key);scrollPositions.delete(key);return scroll}function isRouteLocation(route){return typeof route===`string`||route&&typeof route===`object`}function isRouteName(name){return typeof name===`string`||typeof name===`symbol`}function parseQuery(search){const query={};if(search===``||search===`?`)return query;const searchParams=(search[0]===`?`?search.slice(1):search).split(`&`);for(let i=0;i<searchParams.length;++i){const searchParam=searchParams[i].replace(PLUS_RE,` `);const eqPos=searchParam.indexOf(`=`);const key=decode$2(eqPos<0?searchParam:searchParam.slice(0,eqPos));const value=eqPos<0?null:decode$2(searchParam.slice(eqPos+1));if(key in query){let currentValue=query[key];if(!isArray$1(currentValue))currentValue=query[key]=[currentValue];currentValue.push(value)}else query[key]=value}return query}function stringifyQuery(query){let search=``;for(let key in query){const value=query[key];key=encodeQueryKey(key);if(value==null){if(value!==void 0)search+=(search.length?`&`:``)+key;continue}(isArray$1(value)?value.map(v=>v&&encodeQueryValue(v)):[value&&encodeQueryValue(value)]).forEach(value=>{if(value!==void 0){search+=(search.length?`&`:``)+key;if(value!=null)search+=`=`+value}})}return search}function normalizeQuery(query){const normalizedQuery={};for(const key in query){const value=query[key];if(value!==void 0)normalizedQuery[key]=isArray$1(value)?value.map(v=>v==null?null:``+v):value==null?value:``+value}return normalizedQuery}function useCallbacks(){let handlers=[];function add(handler){handlers.push(handler);return()=>{const i=handlers.indexOf(handler);if(i>-1)handlers.splice(i,1)}}function reset(){handlers=[]}return{add,list:()=>handlers.slice(),reset}}function guardToPromiseFn(guard,to,from,record,name,runWithContext=fn=>fn()){const enterCallbackArray=record&&(record.enterCallbacks[name]=record.enterCallbacks[name]||[]);return()=>new Promise((resolve,reject)=>{const next=valid=>{if(valid===false)reject(createRouterError(4,{from,to}));else if(valid instanceof Error)reject(valid);else if(isRouteLocation(valid))reject(createRouterError(2,{from:to,to:valid}));else{if(enterCallbackArray&&record.enterCallbacks[name]===enterCallbackArray&&typeof valid===`function`)enterCallbackArray.push(valid);resolve()}};const guardReturn=runWithContext(()=>guard.call(record&&record.instances[name],to,from,next));let guardCall=Promise.resolve(guardReturn);if(guard.length<3)guardCall=guardCall.then(next);guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to,from,runWithContext=fn=>fn()){const guards=[];for(const record of matched)for(const name in record.components){let rawComponent=record.components[name];if(guardType!==`beforeRouteEnter`&&!record.instances[name])continue;if(isRouteComponent$1(rawComponent)){const guard=(rawComponent.__vccOpts||rawComponent)[guardType];guard&&guards.push(guardToPromiseFn(guard,to,from,record,name,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);const resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name]=resolved;record.components[name]=resolvedComponent;const guard=(resolvedComponent.__vccOpts||resolvedComponent)[guardType];return guard&&guardToPromiseFn(guard,to,from,record,name,runWithContext)()}))}}return guards}function loadRouteLocation(route){return route.matched.every(record=>record.redirect)?Promise.reject(new Error(`Cannot load a route that redirects.`)):Promise.all(route.matched.map(record=>record.components&&Promise.all(Object.keys(record.components).reduce((promises,name)=>{const rawComponent=record.components[name];if(typeof rawComponent===`function`&&!(`displayName`in rawComponent))promises.push(rawComponent().then(resolved=>{if(!resolved)return Promise.reject(new Error(`Couldn't resolve component "${name}" at "${record.path}". Ensure you passed a function that returns a promise.`));const resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name]=resolved;record.components[name]=resolvedComponent}));return promises},[])))).then(()=>route)}function extractChangingRecords(to,from){const leavingRecords=[];const updatingRecords=[];const enteringRecords=[];const len=Math.max(from.matched.length,to.matched.length);for(let i=0;i<len;i++){const recordFrom=from.matched[i];if(recordFrom){if(to.matched.find(record=>isSameRouteRecord(record,recordFrom)))updatingRecords.push(recordFrom);else leavingRecords.push(recordFrom)}const recordTo=to.matched[i];if(recordTo){if(!from.matched.find(record=>isSameRouteRecord(record,recordTo)))enteringRecords.push(recordTo)}}return[leavingRecords,updatingRecords,enteringRecords]}var createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location){const{pathname,search,hash}=location;const hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1;let pathFromHash=hash.slice(slicePos);if(pathFromHash[0]!==`/`)pathFromHash=`/`+pathFromHash;return stripBase(pathFromHash,``)}return stripBase(pathname,base)+search+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[];let teardowns=[];let pauseState=null;const popStateHandler=({state})=>{const to=createCurrentLocation(base,location);const from=currentLocation.value;const fromState=historyState.value;let delta=0;if(state){currentLocation.value=to;historyState.value=state;if(pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:`pop`,direction:delta?delta>0?`forward`:`back`:``})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);const teardown=()=>{const index=listeners.indexOf(callback);if(index>-1)listeners.splice(index,1)};teardowns.push(teardown);return teardown}function beforeUnloadListener(){const{history}=window;if(!history.state)return;history.replaceState(assign({},history.state,{scroll:computeScrollPosition()}),``)}function destroy(){for(const teardown of teardowns)teardown();teardowns=[];window.removeEventListener(`popstate`,popStateHandler);window.removeEventListener(`pagehide`,beforeUnloadListener)}window.addEventListener(`popstate`,popStateHandler);window.addEventListener(`pagehide`,beforeUnloadListener);return{pauseListeners,listen,destroy}}function buildState(back,current,forward,replaced=false){return{back,current,forward,replaced,position:window.history.length,scroll:null}}function useHistoryStateNavigation(base){const{history,location}=window;const currentLocation={value:createCurrentLocation(base,location)};const historyState={value:history.state};if(!historyState.value)changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history.length-1,replaced:true,scroll:null},true);function changeLocation(to,state,replace){const hashIndex=base.indexOf(`#`);const url=hashIndex>-1?(location.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to:createBaseLocation()+base+to;try{history[replace?`replaceState`:`pushState`](state,``,url);historyState.value=state}catch(err){console.error(err);location[replace?`replace`:`assign`](url)}}function replace(to,data){changeLocation(to,assign({},history.state,buildState(historyState.value.back,to,historyState.value.forward,true),data,{position:historyState.value.position}),true);currentLocation.value=to}function push(to,data){const currentState=assign({},historyState.value,history.state,{forward:to,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,true);changeLocation(to,assign({},buildState(currentLocation.value,to,null),{position:currentState.position+1},data),false);currentLocation.value=to}return{location:currentLocation,state:historyState,push,replace}}function createWebHistory(base){base=normalizeBase(base);const historyNavigation=useHistoryStateNavigation(base);const historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta,triggerListeners=true){if(!triggerListeners)historyListeners.pauseListeners();history.go(delta)}const routerHistory=assign({location:``,base,go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);Object.defineProperty(routerHistory,"location",{enumerable:true,get:()=>historyNavigation.location.value});Object.defineProperty(routerHistory,"state",{enumerable:true,get:()=>historyNavigation.state.value});return routerHistory}var ROOT_TOKEN={type:0,value:``};var VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!isAbsolutePath(path))throw new Error(`Invalid path "${path}"`);function crash(message){throw new Error(`ERR (${state})/"${buffer}": ${message}`)}let state=0;let previousState=state;const tokens=[];let segment;function finalizeSegment(){if(segment)tokens.push(segment);segment=[]}let i=0;let char;let buffer=``;let customRe=``;function consumeBuffer(){if(!buffer)return;if(state===0)segment.push({type:0,value:buffer});else if(state===1||state===2||state===3){if(segment.length>1&&(char===`*`||char===`+`))crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);segment.push({type:1,value:buffer,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})}else crash(`Invalid state to consume buffer`);buffer=``}function addCharToBuffer(){buffer+=char}while(i<path.length){char=path[i++];switch(state){case 0:if(char===`\\`){previousState=state;state=4}else if(char===`/`){if(buffer)consumeBuffer();finalizeSegment()}else if(char===`:`){consumeBuffer();state=1}else addCharToBuffer();break;case 4:addCharToBuffer();state=previousState;break;case 1:if(char===`(`)state=2;else if(VALID_PARAM_RE.test(char))addCharToBuffer();else{consumeBuffer();state=0;if(char!==`*`&&char!==`?`&&char!==`+`)i--}break;case 2:if(char===`)`){if(customRe[customRe.length-1]==`\\`)customRe=customRe.slice(0,-1)+char;else state=3}else customRe+=char;break;case 3:consumeBuffer();state=0;if(char!==`*`&&char!==`?`&&char!==`+`)i--;customRe=``;break;default:crash(`Unknown state`)}}if(state===2)crash(`Unfinished custom RegExp for param "${buffer}"`);consumeBuffer();finalizeSegment();return tokens}var BASE_PARAM_PATTERN=`[^/]+?`;var BASE_PATH_PARSER_OPTIONS={sensitive:false,strict:false,start:true,end:true};var REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(segments,extraOptions){const options=assign({},BASE_PATH_PARSER_OPTIONS,extraOptions);const score=[];let pattern=options.start?`^`:``;const keys=[];for(const segment of segments){const segmentScores=segment.length?[]:[90];if(options.strict&&!segment.length)pattern+=`/`;for(let tokenIndex=0;tokenIndex<segment.length;tokenIndex++){const token=segment[tokenIndex];let subSegmentScore=40+(options.sensitive?.25:0);if(token.type===0){if(!tokenIndex)pattern+=`/`;pattern+=token.value.replace(REGEX_CHARS_RE,`\\$&`);subSegmentScore+=40}else if(token.type===1){const{value,repeatable,optional,regexp}=token;keys.push({name:value,repeatable,optional});const re=regexp?regexp:BASE_PARAM_PATTERN;if(re!==BASE_PARAM_PATTERN){subSegmentScore+=10;try{new RegExp(`(${re})`)}catch(err){throw new Error(`Invalid custom RegExp for param "${value}" (${re}): `+err.message)}}let subPattern=repeatable?`((?:${re})(?:/(?:${re}))*)`:`(${re})`;if(!tokenIndex)subPattern=optional&&segment.length<2?`(?:/${subPattern})`:`/`+subPattern;if(optional)subPattern+=`?`;pattern+=subPattern;subSegmentScore+=20;if(optional)subSegmentScore+=-8;if(repeatable)subSegmentScore+=-20;if(re===`.*`)subSegmentScore+=-50}segmentScores.push(subSegmentScore)}score.push(segmentScores)}if(options.strict&&options.end){const i=score.length-1;score[i][score[i].length-1]+=.7000000000000001}if(!options.strict)pattern+=`/?`;if(options.end)pattern+=`$`;else if(options.strict&&!pattern.endsWith(`/`))pattern+=`(?:/|$)`;const re=new RegExp(pattern,options.sensitive?``:`i`);function parse(path){const match=path.match(re);const params={};if(!match)return null;for(let i=1;i<match.length;i++){const value=match[i]||``;const key=keys[i-1];params[key.name]=value&&key.repeatable?value.split(`/`):value}return params}function stringify(params){let path=``;let avoidDuplicatedSlash=false;for(const segment of segments){if(!avoidDuplicatedSlash||!path.endsWith(`/`))path+=`/`;avoidDuplicatedSlash=false;for(const token of segment)if(token.type===0)path+=token.value;else if(token.type===1){const{value,repeatable,optional}=token;const param=value in params?params[value]:``;if(isArray$1(param)&&!repeatable)throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);const text=isArray$1(param)?param.join(`/`):param;if(!text){if(optional){if(segment.length<2){if(path.endsWith(`/`))path=path.slice(0,-1);else avoidDuplicatedSlash=true}}else throw new Error(`Missing required param "${value}"`)}path+=text}}return path||`/`}return{re,score,keys,parse,stringify}}function compareScoreArray(a,b){let i=0;while(i<a.length&&i<b.length){const diff=b[i]-a[i];if(diff)return diff;i++}if(a.length<b.length)return a.length===1&&a[0]===80?-1:1;else if(a.length>b.length)return b.length===1&&b[0]===80?1:-1;return 0}function comparePathParserScore(a,b){let i=0;const aScore=a.score;const bScore=b.score;while(i<aScore.length&&i<bScore.length){const comp=compareScoreArray(aScore[i],bScore[i]);if(comp)return comp;i++}if(Math.abs(bScore.length-aScore.length)===1){if(isLastScoreNegative(aScore))return 1;if(isLastScoreNegative(bScore))return-1}return bScore.length-aScore.length}function isLastScoreNegative(score){const last=score[score.length-1];return score.length>0&&last[last.length-1]<0}var PATH_PARSER_OPTIONS_DEFAULTS={strict:false,end:true,sensitive:false};function createRouteRecordMatcher(record,parent,options){const parser=tokensToParser(tokenizePath(record.path),options);const matcher=assign(parser,{record,parent,children:[],alias:[]});if(parent){if(!matcher.record.aliasOf===!parent.record.aliasOf)parent.children.push(matcher)}return matcher}function createRouterMatcher(routes,globalOptions){const matchers=[];const matcherMap=new Map;globalOptions=mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS,globalOptions);function getRecordMatcher(name){return matcherMap.get(name)}function addRoute(record,parent,originalRecord){const isRootAdd=!originalRecord;const mainNormalizedRecord=normalizeRouteRecord(record);mainNormalizedRecord.aliasOf=originalRecord&&originalRecord.record;const options=mergeOptions(globalOptions,record);const normalizedRecords=[mainNormalizedRecord];if(`alias`in record){const aliases=typeof record.alias===`string`?[record.alias]:record.alias;for(const alias of aliases)normalizedRecords.push(normalizeRouteRecord(assign({},mainNormalizedRecord,{components:originalRecord?originalRecord.record.components:mainNormalizedRecord.components,path:alias,aliasOf:originalRecord?originalRecord.record:mainNormalizedRecord})))}let matcher;let originalMatcher;for(const normalizedRecord of normalizedRecords){const{path}=normalizedRecord;if(parent&&!isAbsolutePath(path)){const parentPath=parent.record.path;const connectingSlash=parentPath[parentPath.length-1]===`/`?``:`/`;normalizedRecord.path=parent.record.path+(path&&connectingSlash+path)}matcher=createRouteRecordMatcher(normalizedRecord,parent,options);if(originalRecord)originalRecord.alias.push(matcher);else{originalMatcher=originalMatcher||matcher;if(originalMatcher!==matcher)originalMatcher.alias.push(matcher);if(isRootAdd&&record.name&&!isAliasRecord(matcher))removeRoute(record.name)}if(isMatchable(matcher))insertMatcher(matcher);if(mainNormalizedRecord.children){const children=mainNormalizedRecord.children;for(let i=0;i<children.length;i++)addRoute(children[i],matcher,originalRecord&&originalRecord.children[i])}originalRecord=originalRecord||matcher}return originalMatcher?()=>{removeRoute(originalMatcher)}:noop$2}function removeRoute(matcherRef){if(isRouteName(matcherRef)){const matcher=matcherMap.get(matcherRef);if(matcher){matcherMap.delete(matcherRef);matchers.splice(matchers.indexOf(matcher),1);matcher.children.forEach(removeRoute);matcher.alias.forEach(removeRoute)}}else{const index=matchers.indexOf(matcherRef);if(index>-1){matchers.splice(index,1);if(matcherRef.record.name)matcherMap.delete(matcherRef.record.name);matcherRef.children.forEach(removeRoute);matcherRef.alias.forEach(removeRoute)}}}function getRoutes(){return matchers}function insertMatcher(matcher){const index=findInsertionIndex(matcher,matchers);matchers.splice(index,0,matcher);if(matcher.record.name&&!isAliasRecord(matcher))matcherMap.set(matcher.record.name,matcher)}function resolve(location,currentLocation){let matcher;let params={};let path;let name;if(`name`in location&&location.name){matcher=matcherMap.get(location.name);if(!matcher)throw createRouterError(1,{location});name=matcher.record.name;params=assign(pickParams(currentLocation.params,matcher.keys.filter(k=>!k.optional).concat(matcher.parent?matcher.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),location.params&&pickParams(location.params,matcher.keys.map(k=>k.name)));path=matcher.stringify(params)}else if(location.path!=null){path=location.path;matcher=matchers.find(m=>m.re.test(path));if(matcher){params=matcher.parse(path);name=matcher.record.name;matcher.keys.forEach(key=>{if(key.optional&&!params[key.name])delete params[key.name]})}}else{matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m=>m.re.test(currentLocation.path));if(!matcher)throw createRouterError(1,{location,currentLocation});name=matcher.record.name;params=assign({},currentLocation.params,location.params);path=matcher.stringify(params)}const matched=[];let parentMatcher=matcher;while(parentMatcher){matched.unshift(parentMatcher.record);parentMatcher=parentMatcher.parent}return{name,path,params,matched,meta:mergeMetaFields(matched)}}routes.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0;matcherMap.clear()}return{addRoute,resolve,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function pickParams(params,keys){const newParams={};for(const key of keys)if(key in params)newParams[key]=params[key];return newParams}function normalizeRouteRecord(record){const normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};Object.defineProperty(normalized,"mods",{value:{}});return normalized}function normalizeRecordProps(record){const propsObject={};const props=record.props||false;if(`component`in record)propsObject.default=props;else for(const name in record.components)propsObject[name]=typeof props===`object`?props[name]:props;return propsObject}function isAliasRecord(record){while(record){if(record.record.aliasOf)return true;record=record.parent}return false}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign(meta,record.meta),{})}function findInsertionIndex(matcher,matchers){let lower=0;let upper=matchers.length;while(lower!==upper){const mid=lower+upper>>1;if(comparePathParserScore(matcher,matchers[mid])<0)upper=mid;else lower=mid+1}const insertionAncestor=getInsertionAncestor(matcher);if(insertionAncestor)upper=matchers.lastIndexOf(insertionAncestor,upper-1);return upper}function getInsertionAncestor(matcher){let ancestor=matcher;while(ancestor=ancestor.parent)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function useLink$1(props){const router=inject$1(routerKey);const currentRoute=inject$1(routeLocationKey);const route=computed(()=>{const to=unref(props.to);return router.resolve(to)});const activeRecordIndex=computed(()=>{const{matched}=route.value;const{length}=matched;const routeMatched=matched[length-1];const currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;const index=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index>-1)return index;const parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index});const isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params));const isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate(e={}){if(guardEvent(e)){const p=router[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$2);if(props.viewTransition&&typeof document!==`undefined`&&`startViewTransition`in document)document.startViewTransition(()=>p);return p}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}var RouterLink=defineComponent$1({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:true},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:useLink$1,setup(props,{slots}){const link=reactive(useLink$1(props));const{options}=inject$1(routerKey);const elClass=computed(()=>({[getLinkClass(props.activeClass,options.linkActiveClass,`router-link-active`)]:link.isActive,[getLinkClass(props.exactActiveClass,options.linkExactActiveClass,`router-link-exact-active`)]:link.isExactActive}));return()=>{const children=slots.default&&preferSingleVNode(slots.default(link));return props.custom?children:h$1(`a`,{"aria-current":link.isExactActive?props.ariaCurrentValue:null,href:link.href,onClick:link.navigate,class:elClass.value},children)}}});function guardEvent(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(e.button!==void 0&&e.button!==0)return;if(e.currentTarget&&e.currentTarget.getAttribute){const target=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target))return}if(e.preventDefault)e.preventDefault();return true}function includesParams(outer,inner){for(const key in inner){const innerValue=inner[key];const outerValue=outer[key];if(isArray$1(innerValue)){if(!isArray$1(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value,i)=>value.valueOf()!==outerValue[i].valueOf()))return false}else if(innerValue!==outerValue)return false}return true}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}var getLinkClass=(propClass,globalClass,defaultClass)=>propClass!=null?propClass:globalClass!=null?globalClass:defaultClass;var RouterViewImpl=defineComponent$1({name:`RouterView`,inheritAttrs:false,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){const injectedRoute=inject$1(routerViewLocationKey);const routeToDisplay=computed(()=>props.route||injectedRoute.value);const injectedDepth=inject$1(viewDepthKey,0);const depth=computed(()=>{let initialDepth=unref(injectedDepth);const{matched}=routeToDisplay.value;let matchedRoute;while((matchedRoute=matched[initialDepth])&&!matchedRoute.components)initialDepth++;return initialDepth});const matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1));provide(matchedRouteKey,matchedRouteRef);provide(routerViewLocationKey,routeToDisplay);const viewRef=ref();watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance,to,name],[oldInstance,from,_oldName])=>{if(to){to.instances[name]=instance;if(from&&from!==to&&instance&&instance===oldInstance){if(!to.leaveGuards.size)to.leaveGuards=from.leaveGuards;if(!to.updateGuards.size)to.updateGuards=from.updateGuards}}if(instance&&to&&(!from||!isSameRouteRecord(to,from)||!oldInstance))(to.enterCallbacks[name]||[]).forEach(callback=>callback(instance))},{flush:`post`});return()=>{const route=routeToDisplay.value;const currentName=props.name;const matchedRoute=matchedRouteRef.value;const ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});const routePropsOption=matchedRoute.props[currentName];const routeProps=routePropsOption?routePropsOption===true?route.params:typeof routePropsOption===`function`?routePropsOption(route):routePropsOption:null;const onVnodeUnmounted=vnode=>{if(vnode.component.isUnmounted)matchedRoute.instances[currentName]=null};const component=h$1(ViewComponent,assign({},routeProps,attrs,{onVnodeUnmounted,ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data){if(!slot)return null;const slotContent=slot(data);return slotContent.length===1?slotContent[0]:slotContent}var RouterView=RouterViewImpl;function createRouter(options){const matcher=createRouterMatcher(options.routes,options);const parseQuery$1=options.parseQuery||parseQuery;const stringifyQuery$1=options.stringifyQuery||stringifyQuery;const routerHistory=options.history;const beforeGuards=useCallbacks();const beforeResolveGuards=useCallbacks();const afterGuards=useCallbacks();const currentRoute=shallowRef(START_LOCATION_NORMALIZED);const routesVersion=shallowRef(0);let pendingLocation=START_LOCATION_NORMALIZED;if(isBrowser&&options.scrollBehavior&&`scrollRestoration`in history)history.scrollRestoration=`manual`;const normalizeParams=applyToParams.bind(null,paramValue=>``+paramValue);const encodeParams=applyToParams.bind(null,encodeParam);const decodeParams=applyToParams.bind(null,decode$2);function addRoute(parentOrRoute,route){let parent;let record;if(isRouteName(parentOrRoute)){parent=matcher.getRecordMatcher(parentOrRoute);record=route}else record=parentOrRoute;const removeRoute=matcher.addRoute(record,parent);routesVersion.value++;return()=>{removeRoute();routesVersion.value++}}function removeRoute(name){const recordMatcher=matcher.getRecordMatcher(name);if(recordMatcher){matcher.removeRoute(recordMatcher);routesVersion.value++}}function clearRoutes(){matcher.clearRoutes();routesVersion.value++}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name){return!!matcher.getRecordMatcher(name)}function resolve(rawLocation,currentLocation){routesVersion.value;if(typeof rawLocation===`string`){currentLocation=currentLocation||(rawLocation.startsWith(`/`)?START_LOCATION_NORMALIZED:currentRoute.value);const locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path);const matchedRoute=matcher.resolve({path:locationNormalized.path},currentLocation);const href=routerHistory.createHref(locationNormalized.fullPath);return assign(locationNormalized,matchedRoute,{params:decodeParams(matchedRoute.params),redirectedFrom:void 0,href})}currentLocation=assign({},currentLocation||(rawLocation.path!=null&&rawLocation.path.startsWith(`/`)&&!(`name`in rawLocation&&rawLocation.name)?START_LOCATION_NORMALIZED:currentRoute.value));let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{const targetParams=assign({},rawLocation.params);for(const key in targetParams)if(targetParams[key]==null)delete targetParams[key];matcherLocation=assign({},rawLocation,{params:encodeParams(targetParams)});currentLocation.params=encodeParams(currentLocation.params)}const matchedRoute=matcher.resolve(matcherLocation,currentLocation);const hash=rawLocation.hash||``;matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));const fullPath=stringifyURL(stringifyQuery$1,assign({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path}));const href=routerHistory.createHref(fullPath);return assign({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to){return typeof to===`string`?parseURL(parseQuery$1,to,currentRoute.value.path):assign({},to)}function checkCanceledNavigation(to,from){if(pendingLocation!==to)return createRouterError(8,{from,to})}function push(to){return pushWithRedirect(to)}function replace(to){return push(assign(locationAsObject(to),{replace:true}))}function handleRedirectRecord(to,from){const lastMatched=to.matched[to.matched.length-1];if(lastMatched&&lastMatched.redirect){const{redirect}=lastMatched;let newTargetLocation=typeof redirect===`function`?redirect(to,from):redirect;if(typeof newTargetLocation===`string`){newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation};newTargetLocation.params={}}return assign({query:to.query,hash:to.hash,params:newTargetLocation.path!=null?{}:to.params},newTargetLocation)}}function pushWithRedirect(to,redirectedFrom){const targetLocation=pendingLocation=resolve(to);const from=currentRoute.value;const data=to.state;const force=to.force;const replace=to.replace===true;const shouldRedirect=handleRedirectRecord(targetLocation,from);if(shouldRedirect)return pushWithRedirect(assign(locationAsObject(shouldRedirect),{state:typeof shouldRedirect===`object`?assign({},data,shouldRedirect.state):data,force,replace}),redirectedFrom||targetLocation);const toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;if(!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)){failure=createRouterError(16,{to:toLocation,from});handleScroll(from,from,true,false)}return(failure?Promise.resolve(failure):navigate(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,2)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure=>{if(failure){if(isNavigationFailure(failure,2))return pushWithRedirect(assign({replace},locationAsObject(failure.to),{state:typeof failure.to===`object`?assign({},data,failure.to.state):data,force}),redirectedFrom||toLocation)}else failure=finalizeNavigation(toLocation,from,true,replace,data);triggerAfterEach(toLocation,from,failure);return failure})}function checkCanceledNavigationAndReject(to,from){const error=checkCanceledNavigation(to,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn){const app=installedApps.values().next().value;return app&&typeof app.runWithContext===`function`?app.runWithContext(fn):fn()}function navigate(to,from){let guards;const[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to,from);for(const record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});const canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to,from);guards.push(canceledNavigationCheck);return runGuardQueue(guards).then(()=>{guards=[];for(const guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to,from));guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to,from);for(const record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).then(()=>{guards=[];for(const record of enteringRecords)if(record.beforeEnter){if(isArray$1(record.beforeEnter))for(const beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to,from));else guards.push(guardToPromiseFn(record.beforeEnter,to,from))}guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).then(()=>{to.matched.forEach(record=>record.enterCallbacks={});guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to,from,runWithContext);guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).then(()=>{guards=[];for(const guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to,from));guards.push(canceledNavigationCheck);return runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,8)?err:Promise.reject(err))}function triggerAfterEach(to,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace,data){const error=checkCanceledNavigation(toLocation,from);if(error)return error;const isFirstNavigation=from===START_LOCATION_NORMALIZED;const state=!isBrowser?{}:history.state;if(isPush){if(replace||isFirstNavigation)routerHistory.replace(toLocation.fullPath,assign({scroll:isFirstNavigation&&state&&state.scroll},data));else routerHistory.push(toLocation.fullPath,data)}currentRoute.value=toLocation;handleScroll(toLocation,from,isPush,isFirstNavigation);markAsReady()}let removeHistoryListener;function setupListeners(){if(removeHistoryListener)return;removeHistoryListener=routerHistory.listen((to,_from,info)=>{if(!router.listening)return;const toLocation=resolve(to);const shouldRedirect=handleRedirectRecord(toLocation,router.currentRoute.value);if(shouldRedirect){pushWithRedirect(assign(shouldRedirect,{replace:true,force:true}),toLocation).catch(noop$2);return}pendingLocation=toLocation;const from=currentRoute.value;if(isBrowser&&info.delta)saveScrollPosition(getScrollKey(from.fullPath,info.delta));navigate(toLocation,from).catch(error=>{if(isNavigationFailure(error,12))return error;if(isNavigationFailure(error,2)){pushWithRedirect(assign(locationAsObject(error.to),{force:true}),toLocation).then(failure=>{if(isNavigationFailure(failure,20)&&!info.delta&&info.type===`pop`)routerHistory.go(-1,false)}).catch(noop$2);return Promise.reject()}if(info.delta)routerHistory.go(-info.delta,false);return triggerError(error,toLocation,from)}).then(failure=>{failure=failure||finalizeNavigation(toLocation,from,false);if(failure){if(info.delta&&!isNavigationFailure(failure,8))routerHistory.go(-info.delta,false);else if(info.type===`pop`&&isNavigationFailure(failure,20))routerHistory.go(-1,false)}triggerAfterEach(toLocation,from,failure)}).catch(noop$2)})}let readyHandlers=useCallbacks();let errorListeners=useCallbacks();let ready;function triggerError(error,to,from){markAsReady(error);const list=errorListeners.list();if(list.length)list.forEach(handler=>handler(error,to,from));else console.error(error);return Promise.reject(error)}function isReady(){if(ready&¤tRoute.value!==START_LOCATION_NORMALIZED)return Promise.resolve();return new Promise((resolve,reject)=>{readyHandlers.add([resolve,reject])})}function markAsReady(err){if(!ready){ready=!err;setupListeners();readyHandlers.list().forEach(([resolve,reject])=>err?reject(err):resolve());readyHandlers.reset()}return err}function handleScroll(to,from,isPush,isFirstNavigation){const{scrollBehavior}=options;if(!isBrowser||!scrollBehavior)return Promise.resolve();const scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick$1().then(()=>scrollBehavior(to,from,scrollPosition)).then(position=>to===currentRoute.value&&position&&scrollToPosition(position)).catch(err=>to===currentRoute.value&&triggerError(err,to,from))}const go=delta=>routerHistory.go(delta);let started;const installedApps=new Set;const router={currentRoute,listening:true,addRoute,removeRoute,clearRoutes,hasRoute,getRoutes,resolve,options,push,replace,go,back:()=>go(-1),forward:()=>go(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app){app.component(`RouterLink`,RouterLink);app.component(`RouterView`,RouterView);app.config.globalProperties.$router=router;Object.defineProperty(app.config.globalProperties,"$route",{enumerable:true,get:()=>unref(currentRoute)});if(isBrowser&&!started&¤tRoute.value===START_LOCATION_NORMALIZED){started=true;push(routerHistory.location).catch(err=>{})}const reactiveRoute={};for(const key in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key,{get:()=>currentRoute.value[key],enumerable:true});app.provide(routerKey,router);app.provide(routeLocationKey,shallowReactive(reactiveRoute));app.provide(routerViewLocationKey,currentRoute);const unmountApp=app.unmount;installedApps.add(app);app.unmount=function(){installedApps.delete(app);if(installedApps.size<1){pendingLocation=START_LOCATION_NORMALIZED;removeHistoryListener&&removeHistoryListener();removeHistoryListener=null;currentRoute.value=START_LOCATION_NORMALIZED;started=false;ready=false}unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router}function escapeRegExp(value){return String(value||``).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var TRANSACTION_OUTCOMES=Object.freeze([`none`,`pending`,`committed`,`rolledBack`,`unknown`]);function normalizeTransactionOutcome(value){return TRANSACTION_OUTCOMES.includes(value)?value:``}function normalizeText$1(value,{fallback=``}={}){return String(value||``).trim()||fallback}function toText(value){return String(value??``).trim()}function hasValue(value){if(value==null)return false;if(typeof value===`string`)return normalizeText$1(value).length>0;return true}function normalizeBoolean(value){if(typeof value===`boolean`)return value;if(typeof value===`number`){if(value===1)return true;if(value===0)return false}const normalized=normalizeText$1(value).toLowerCase();if(normalized===`true`||normalized===`1`||normalized===`yes`||normalized===`y`)return true;if(normalized===`false`||normalized===`0`||normalized===`no`||normalized===`n`)return false;throw new TypeError(`Boolean field must be true or false.`)}function normalizeLowerText(value,{fallback=``}={}){return normalizeText$1(value,{fallback}).toLowerCase()}function normalizeObject(value,{fallback={}}={}){if(!isRecord(value))return{...fallback};return value}function isRecord(value){return Boolean(value&&typeof value===`object`&&!Array.isArray(value))}function normalizeArray(value){return Array.isArray(value)?value:[]}function normalizeUniqueTextList(value,{acceptSingle=false}={}){const source=Array.isArray(value)?value:acceptSingle?[value]:[];return Array.from(new Set(source.map(entry=>normalizeText$1(entry)).filter(Boolean)))}function normalizePositiveInteger(value,{fallback=0}={}){const numeric=Number(value);if(!Number.isInteger(numeric)||numeric<1)return fallback;return numeric}function normalizeCanonicalRecordIdText(value,{fallback=null}={}){if(value==null)return fallback;const normalized=String(value).trim();return/^[1-9][0-9]*$/.test(normalized)?normalized:fallback}function normalizeRecordId(value,{fallback=null}={}){if(value==null)return fallback;if(typeof value===`string`)return normalizeCanonicalRecordIdText(value,{fallback});if(typeof value===`number`){if(!Number.isSafeInteger(value)||value<1)return fallback;return normalizeCanonicalRecordIdText(value,{fallback})}if(typeof value===`bigint`){if(value<1n)return fallback;return normalizeCanonicalRecordIdText(value,{fallback})}return fallback}function normalizeSurfacePagesRoot(pagesRootLike){const rawPagesRoot=String(pagesRootLike||``).trim();if(!rawPagesRoot||rawPagesRoot===`/`)return``;return rawPagesRoot.replace(/\\/g,`/`).replace(/\/{2,}/g,`/`).replace(/^\/+|\/+$/g,``)}function normalizeRouteSegment(segmentLike){const segment=String(segmentLike||``).trim();if(!segment)return``;const dynamicMatch=segment.match(/^\[([^\]]+)\]$/);if(dynamicMatch){const paramName=String(dynamicMatch[1]||``).trim();if(!paramName)return``;return`:${paramName}`}return segment}function deriveSurfaceRouteBaseFromPagesRoot(pagesRootLike){const normalizedPagesRoot=normalizeSurfacePagesRoot(pagesRootLike);if(!normalizedPagesRoot)return`/`;const segments=normalizedPagesRoot.split(`/`).map(segment=>normalizeRouteSegment(segment)).filter(Boolean);if(segments.length<1)return`/`;return`/${segments.join(`/`)}`}function createSurfaceRegistry(options={}){const rawSurfaces=options.surfaces;if(!rawSurfaces||typeof rawSurfaces!==`object`)throw new Error(`createSurfaceRegistry requires a surfaces object.`);const normalizedEntries=Object.entries(rawSurfaces).map(([key,value])=>{const sourceDefinition=normalizeObject(value);const normalizedId=normalizeLowerText(sourceDefinition.id||key);if(!normalizedId)return null;const pagesRoot=normalizeSurfacePagesRoot(sourceDefinition.pagesRoot);if(!Object.prototype.hasOwnProperty.call(sourceDefinition,`pagesRoot`)&&pagesRoot===``)throw new Error(`Surface "${normalizedId}" requires pagesRoot (use "" for root).`);return[normalizedId,Object.freeze({...sourceDefinition,id:normalizedId,pagesRoot,routeBase:deriveSurfaceRouteBaseFromPagesRoot(pagesRoot),enabled:sourceDefinition.enabled!==false})]}).filter(Boolean);if(normalizedEntries.length<1)throw new Error(`createSurfaceRegistry requires at least one surface definition.`);const SURFACE_REGISTRY=Object.freeze(Object.fromEntries(normalizedEntries));const fallbackSurfaceId=normalizedEntries[0][0];const requestedDefaultSurfaceId=normalizeLowerText(options.defaultSurfaceId);const DEFAULT_SURFACE_ID=SURFACE_REGISTRY[requestedDefaultSurfaceId]?requestedDefaultSurfaceId:fallbackSurfaceId;function resolveRegisteredSurfaceId(value){const normalized=normalizeLowerText(value);if(SURFACE_REGISTRY[normalized])return normalized;return DEFAULT_SURFACE_ID}function resolveSurfacePagesRoot(surfaceId){return SURFACE_REGISTRY[resolveRegisteredSurfaceId(surfaceId)]?.pagesRoot||``}function resolveSurfaceRouteBase(surfaceId){return SURFACE_REGISTRY[resolveRegisteredSurfaceId(surfaceId)]?.routeBase||`/`}function listSurfaceDefinitions(){return Object.values(SURFACE_REGISTRY)}return Object.freeze({SURFACE_REGISTRY,DEFAULT_SURFACE_ID,resolveRegisteredSurfaceId,resolveSurfacePagesRoot,resolveSurfaceRouteBase,listSurfaceDefinitions})}var API_BASE_PATH=`/api`;var BOOTSTRAP_PATH=`${API_BASE_PATH}/bootstrap`;function normalizePathname$1(pathname){const rawValue=String(pathname||`/`).trim();if(!rawValue)return`/`;const withoutQuery=rawValue.split(`?`)[0].split(`#`)[0];const squashed=(withoutQuery.startsWith(`/`)?withoutQuery:`/${withoutQuery}`).replace(/\/{2,}/g,`/`);if(squashed===`/`)return`/`;return squashed.replace(/\/+$/,``)||`/`}function matchesPathPrefix(pathname,prefix){const normalizedPathname=normalizePathname$1(pathname);const normalizedPrefix=normalizePathname$1(prefix);return normalizedPathname===normalizedPrefix||normalizedPathname.startsWith(`${normalizedPrefix}/`)}function compileSurfaceRouteMatcher(routeBase){const normalizedRouteBase=normalizePathname$1(routeBase);const segments=normalizedRouteBase.split(`/`).filter(Boolean);if(segments.length<1)return Object.freeze({routeBase:`/`,segmentCount:0,staticSegmentCount:0,test(pathname){return normalizePathname$1(pathname).startsWith(`/`)}});const patternSegments=segments.map(segment=>segment.startsWith(`:`)&&segment.length>1?`[^/]+`:escapeRegExp(segment));const pattern=new RegExp(`^/${patternSegments.join(`/`)}(?:$|/)`);const staticSegmentCount=segments.filter(segment=>!(segment.startsWith(`:`)&&segment.length>1)).length;return Object.freeze({routeBase:normalizedRouteBase,segmentCount:segments.length,staticSegmentCount,test(pathname){return pattern.test(normalizePathname$1(pathname))}})}function compareSurfaceRouteSpecificity(left,right){const staticDiff=right.staticSegmentCount-left.staticSegmentCount;if(staticDiff!==0)return staticDiff;const segmentDiff=right.segmentCount-left.segmentCount;if(segmentDiff!==0)return segmentDiff;const lengthDiff=String(right.routeBase||``).length-String(left.routeBase||``).length;if(lengthDiff!==0)return lengthDiff;return String(left.id||``).localeCompare(String(right.id||``))}function createSurfacePathHelpers({defaultSurfaceId,surfaceDefinitions,apiBasePath=API_BASE_PATH}){const normalizedDefaultSurfaceId=normalizeLowerText(defaultSurfaceId);if(!normalizedDefaultSurfaceId)throw new Error(`createSurfacePathHelpers requires defaultSurfaceId.`);if(!Array.isArray(surfaceDefinitions))throw new Error(`createSurfacePathHelpers requires a surfaceDefinitions array.`);const normalizedApiBasePath=normalizePathname$1(apiBasePath);const routedSurfaces=surfaceDefinitions.map(definition=>{const surfaceId=normalizeLowerText(definition?.id);if(!surfaceId)return null;const matcher=compileSurfaceRouteMatcher(definition.routeBase||`/`);return{id:surfaceId,routeBase:matcher.routeBase,segmentCount:matcher.segmentCount,staticSegmentCount:matcher.staticSegmentCount,matcher}}).filter(Boolean).sort(compareSurfaceRouteSpecificity);function matchSurface(pathname){return routedSurfaces.find(surface=>surface.matcher.test(pathname))?.id||normalizedDefaultSurfaceId}function resolveApiNamespace(pathname){if(!matchesPathPrefix(pathname,normalizedApiBasePath))return``;const versionMatch=pathname.slice(normalizedApiBasePath.length).match(/^\/v[0-9]+(?:$|\/)/);if(!versionMatch)return normalizedApiBasePath;return normalizePathname$1(`${normalizedApiBasePath}${versionMatch[0]}`)}function resolveSurfaceFromPathname(pathname){const normalizedPathname=normalizePathname$1(pathname);const apiNamespace=resolveApiNamespace(normalizedPathname);if(!apiNamespace)return matchSurface(normalizedPathname);return matchSurface(normalizePathname$1(normalizedPathname.slice(apiNamespace.length)))}return Object.freeze({resolveSurfaceFromPathname})}var EXTERNAL_LINK_PATTERN=/^[A-Za-z][A-Za-z0-9+.-]*:/;function isExternalLinkTarget(target=``){const normalizedTarget=String(target||``).trim();if(!normalizedTarget)return false;if(normalizedTarget.startsWith(`//`))return true;return EXTERNAL_LINK_PATTERN.test(normalizedTarget)}function splitPathQueryHash(target=``){const normalizedTarget=String(target||``).trim();if(!normalizedTarget)return Object.freeze({pathname:``,search:``,hash:``});const hashIndex=normalizedTarget.indexOf(`#`);const beforeHash=hashIndex>=0?normalizedTarget.slice(0,hashIndex):normalizedTarget;const hash=hashIndex>=0?normalizedTarget.slice(hashIndex):``;const queryIndex=beforeHash.indexOf(`?`);const pathname=queryIndex>=0?beforeHash.slice(0,queryIndex):beforeHash;const search=queryIndex>=0?beforeHash.slice(queryIndex):``;return Object.freeze({pathname,search,hash})}function resolveLinkPath(basePath=`/`,relativePath=`/`){const normalizedRelativePath=String(relativePath||``).trim();if(isExternalLinkTarget(normalizedRelativePath))return normalizedRelativePath;const normalizedBasePath=normalizePathname$1(basePath||`/`);if(!normalizedRelativePath)return normalizedBasePath;const{pathname,search,hash}=splitPathQueryHash(normalizedRelativePath);if(!pathname)return`${normalizedBasePath}${search}${hash}`;const normalizedPathname=normalizePathname$1(pathname.startsWith(`/`)?pathname:`/${pathname}`);return`${normalizedBasePath===`/`?normalizedPathname:normalizedPathname===`/`?normalizedBasePath:`${normalizedBasePath}${normalizedPathname}`}${search}${hash}`}function splitPathAndHash(path=``){const normalizedPath=String(path||``).trim();const hashIndex=normalizedPath.indexOf(`#`);if(hashIndex<0)return{pathWithoutHash:normalizedPath,hash:``};return{pathWithoutHash:normalizedPath.slice(0,hashIndex),hash:normalizedPath.slice(hashIndex)}}function splitPathQueryAndHash(path=``){const{pathWithoutHash,hash}=splitPathAndHash(path);const queryIndex=pathWithoutHash.indexOf(`?`);if(queryIndex<0)return{pathname:pathWithoutHash,queryString:``,hash};return{pathname:pathWithoutHash.slice(0,queryIndex),queryString:pathWithoutHash.slice(queryIndex+1),hash}}function appendQueryString(path=``,queryString=``){const normalizedPath=String(path||``).trim();if(!normalizedPath)return``;const normalizedQuery=String(queryString||``).trim().replace(/^\?+/,``);if(!normalizedQuery)return normalizedPath;const{pathWithoutHash,hash}=splitPathAndHash(normalizedPath);return`${pathWithoutHash}${pathWithoutHash.includes(`?`)?`&`:`?`}${normalizedQuery}${hash}`}function queryStringToObject(queryString=``){const normalizedQueryString=String(queryString||``).trim().replace(/^\?+/,``);if(!normalizedQueryString)return;const params=new URLSearchParams(normalizedQueryString);const query={};for(const[key,value]of params.entries()){if(!Object.prototype.hasOwnProperty.call(query,key)){query[key]=value;continue}if(Array.isArray(query[key])){query[key].push(value);continue}query[key]=[query[key],value]}return query}function redirectToChild(childTarget=``){const normalizedChildTarget=String(childTarget||``).trim();return function redirectToChildRoute(to){const resolvedTarget=resolveLinkPath(String(to.path||`/`),normalizedChildTarget);const{pathname,queryString,hash}=splitPathQueryAndHash(resolvedTarget);return{path:pathname||`/`,query:queryStringToObject(queryString)??to.query,hash:hash||String(to.hash||``)}}}var dashboard_vue_definePage_vue_lang_default={redirect:redirectToChild(`env`)};function _mergeRouteRecord(main,...routeRecords){return routeRecords.reduce((acc,routeRecord)=>{const meta=Object.assign({},acc.meta,routeRecord.meta);const alias=[].concat(acc.alias||[],routeRecord.alias||[]);Object.assign(acc,routeRecord);acc.meta=meta;acc.alias=alias;return acc},main)}var scriptRel=`modulepreload`;var assetsURL=function(dep){return`/`+dep};var seen$1={};var isCssPreloadUrl=function isCssPreloadUrl(url){return url.pathname.endsWith(`.css`)};var preloadOnce=function preloadOnce(seen,href,preload){if(href in seen)return seen[href];const promise=preload();if(!promise){seen[href]=void 0;return}const preloadPromise=promise.then(()=>{seen[href]=void 0},err=>{seen[href]=void 0;throw err});seen[href]=preloadPromise;return preloadPromise};var __vitePreload=function preload(baseModule,deps,importerUrl){let promise=Promise.resolve();if(true&&deps&&deps.length>0){let preloadedHrefs;const cspNonceMeta=document.querySelector(`meta[property=csp-nonce]`);const cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute(`nonce`);function allSettled(promises){return Promise.all(promises.map(p=>Promise.resolve(p).then(value=>({status:`fulfilled`,value}),reason=>({status:`rejected`,reason}))))}function importMetaResolve(specifier){if(import.meta.resolve)return new URL(import.meta.resolve(specifier));return new URL(specifier,import.meta.url)}promise=allSettled(deps.map(depString=>{depString=assetsURL(depString,importerUrl);const dep=importMetaResolve(depString);const isCss=isCssPreloadUrl(dep);return preloadOnce(seen$1,dep.href,()=>{if(preloadedHrefs===void 0){preloadedHrefs={all:new Set,styles:new Set};const links=document.getElementsByTagName(`link`);for(let i=links.length-1;i>=0;i--){const link=links[i];preloadedHrefs.all.add(link.href);if(link.rel===`stylesheet`)preloadedHrefs.styles.add(link.href)}}if((isCss?preloadedHrefs.styles:preloadedHrefs.all).has(dep.href))return;const link=document.createElement(`link`);link.rel=isCss?`stylesheet`:scriptRel;if(!isCss)link.as=`script`;link.crossOrigin=``;link.href=dep.href;if(cspNonce)link.setAttribute(`nonce`,cspNonce);document.body.appendChild(link);if(isCss)return new Promise((res,rej)=>{link.addEventListener(`load`,res);link.addEventListener(`error`,()=>rej(new Error(`Unable to preload CSS for ${dep}`)))})})}).filter(p=>p!==void 0))}function handlePreloadError(err){const e=new Event(`vite:preloadError`,{cancelable:true});e.payload=err;window.dispatchEvent(e);if(!e.defaultPrevented)throw err}return promise.then(res=>{for(const item of res||[]){if(item.status!==`rejected`)continue;handlePreloadError(item.reason)}return baseModule().catch(handlePreloadError)})};var routes=[{path:`/`,name:`/`,component:()=>__vitePreload(()=>import(`./pages-DpJxIaJ-.js`),__vite__mapDeps([0,1])),meta:{"jskit":{"scope":`global`}}},{path:`/app`,children:[{path:``,name:`/app/`,component:()=>__vitePreload(()=>import(`./app-NJHCyI2M.js`),__vite__mapDeps([2,3,4,5,6,1,7])),meta:{"jskit":{"surface":`app`}}},{path:`learning`,name:`/app/learning`,component:()=>__vitePreload(()=>import(`./learning-DSNeeTtU.js`),__vite__mapDeps([8,9,3,4,5,6,10,11,1,12,13])),meta:{"jskit":{"surface":`app`}}},{path:`project`,children:[{path:`:slug`,name:`/app/project/[slug]`,component:()=>__vitePreload(()=>import(`./project-D45_Rd6Y.js`).then(n=>n.n),__vite__mapDeps([9,3,4,5,6,10,11,1,12,13])),children:[_mergeRouteRecord({path:`dashboard`,name:`/app/project/[slug]/dashboard`,component:()=>__vitePreload(()=>import(`./dashboard-Bzs2mNSD.js`),__vite__mapDeps([14,9,3,4,5,6,10,11,1,12,13])),children:[{path:`:sessionTool`,name:`/app/project/[slug]/dashboard/[sessionTool]`,component:()=>__vitePreload(()=>import(`./_sessionTool_-BkRFpBKI.js`),__vite__mapDeps([15,12,16]))},{path:`access`,children:[{path:``,name:`/app/project/[slug]/dashboard/access/`,component:()=>__vitePreload(()=>import(`./access-CD1NLU2z.js`),__vite__mapDeps([17,9,3,4,5,6,10,11,1,12,13,18]))}]},{path:`changes`,children:[{path:``,name:`/app/project/[slug]/dashboard/changes/`,component:()=>__vitePreload(()=>import(`./changes-Bg5fn535.js`),__vite__mapDeps([19,20,9,3,4,5,6,10,11,1,12,13,21,22,23,24]))}]},{path:`env`,children:[{path:``,name:`/app/project/[slug]/dashboard/env/`,component:()=>__vitePreload(()=>import(`./env-CuVAcxrg.js`),__vite__mapDeps([25,9,3,4,5,6,10,11,1,12,13,26,22,23,27,28,29]))}]},{path:`health`,children:[{path:``,name:`/app/project/[slug]/dashboard/health/`,component:()=>__vitePreload(()=>import(`./health-hZ8hCq4g.js`),__vite__mapDeps([30,22,23,31]))}]},{path:`history`,children:[{path:``,name:`/app/project/[slug]/dashboard/history/`,component:()=>__vitePreload(()=>import(`./history-BUD8OO2u.js`),__vite__mapDeps([32,9,3,4,5,6,10,11,1,12,13,22,23,33,34]))},{path:`:sessionId`,name:`/app/project/[slug]/dashboard/history/[sessionId]`,component:()=>__vitePreload(()=>import(`./_sessionId_-DI83WzOB.js`),__vite__mapDeps([35,9,3,4,5,6,10,11,1,12,13,36,37,38,39,26,40,41,42,43,21,44,45,33,46]))}]},{path:`integrations`,children:[{path:``,name:`/app/project/[slug]/dashboard/integrations/`,component:()=>__vitePreload(()=>import(`./integrations-mJUuC1tA.js`),__vite__mapDeps([47,9,3,4,5,6,10,11,1,12,13,48,28,27,49]))}]},{path:`issues`,children:[{path:``,name:`/app/project/[slug]/dashboard/issues/`,component:()=>__vitePreload(()=>import(`./issues-D6TrPRr_.js`),__vite__mapDeps([50,9,3,4,5,6,10,11,1,12,13,51,52]))}]},{path:`pages`,children:[{path:``,name:`/app/project/[slug]/dashboard/pages/`,component:()=>__vitePreload(()=>import(`./pages-cUFHVIQj.js`),__vite__mapDeps([53,9,3,4,5,6,10,11,1,12,13,22,23,54]))},{path:`:pageId`,name:`/app/project/[slug]/dashboard/pages/[pageId]`,component:()=>__vitePreload(()=>import(`./_pageId_-DsnrOQFl.js`),__vite__mapDeps([55,9,3,4,5,6,10,11,1,12,13]))}]},{path:`project-files`,children:[{path:``,name:`/app/project/[slug]/dashboard/project-files/`,component:()=>__vitePreload(()=>import(`./project-files-DgvpUk1M.js`),__vite__mapDeps([56,37,4,5,9,3,6,10,11,1,12,13,38,39,26,40,22,23,57]))}]},{path:`publish`,children:[{path:``,name:`/app/project/[slug]/dashboard/publish/`,component:()=>__vitePreload(()=>import(`./publish-BKAvPixQ.js`),__vite__mapDeps([58,9,3,4,5,6,10,11,1,12,13,22,23,59]))}]},{path:`pull-requests`,children:[{path:``,name:`/app/project/[slug]/dashboard/pull-requests/`,component:()=>__vitePreload(()=>import(`./pull-requests-DycdPcXY.js`),__vite__mapDeps([60,9,3,4,5,6,10,11,1,12,13,51,61]))}]},{path:`repository`,children:[{path:``,name:`/app/project/[slug]/dashboard/repository/`,component:()=>__vitePreload(()=>import(`./repository-BugUartC.js`),__vite__mapDeps([62,20,9,3,4,5,6,10,11,1,12,13,21,22,23,24]))}]},{path:`session`,children:[{path:``,name:`/app/project/[slug]/dashboard/session/`,component:()=>__vitePreload(()=>import(`./session-B4iZufWI.js`),__vite__mapDeps([63,9,3,4,5,6,10,11,1,12,13,22,23,64]))}]},{path:`settings`,children:[{path:``,name:`/app/project/[slug]/dashboard/settings/`,component:()=>__vitePreload(()=>import(`./settings-BrO7TeLW.js`),__vite__mapDeps([65,9,3,4,5,6,10,11,1,12,13,66]))}]}]},dashboard_vue_definePage_vue_lang_default)],meta:{"jskit":{"surface":`app`}}}]}]}];function consoleWarn(message){warn(`Vuetify: ${message}`)}function consoleError(message){warn(`Vuetify error: ${message}`)}function deprecate(original,replacement){replacement=Array.isArray(replacement)?replacement.slice(0,-1).map(s=>`'${s}'`).join(`, `)+` or '${replacement.at(-1)}'`:`'${replacement}'`;warn(`[Vuetify UPGRADE] '${original}' is deprecated, use ${replacement} instead.`)}var IN_BROWSER$1=typeof window!==`undefined`;var SUPPORTS_TOUCH$1=IN_BROWSER$1&&(`ontouchstart`in window||window.navigator.maxTouchPoints>0);var SUPPORTS_MATCH_MEDIA$1=IN_BROWSER$1&&`matchMedia`in window&&typeof window.matchMedia===`function`;var SUPPORTS_OBSERVER=IN_BROWSER$1&&`ResizeObserver`in window;var SUPPORTS_INTERSECTION_OBSERVER=IN_BROWSER$1&&`IntersectionObserver`in window;var SUPPORTS_MUTATION_OBSERVER=IN_BROWSER$1&&`MutationObserver`in window;var __LOGGER_ENABLED__=typeof{}.VITE_LOGGER_ENABLED!==`undefined`&&{}.VITE_LOGGER_ENABLED===`true`;var SETTER_KEY=`__VUE_INSTANCE_SETTERS__`;var seen=null;function onInstance(value){seen=isNullOrUndefined(value)?null:value}function subscribe(){const holders=globalThis[SETTER_KEY];if(!isArray(holders))return;holders.push(onInstance)}subscribe();function getInstanceCompat(){if(!isNull(seen))return seen;return getCurrentInstance$1()}function instanceExists(){return!isNull(getInstanceCompat())}function isFunction(item){return typeof item===`function`}function isString(item){return typeof item===`string`}function isNumber(item){return typeof item===`number`}function isBoolean(item){return typeof item===`boolean`}function isObject$1(item){return typeof item===`object`&&item!==null&&!Array.isArray(item)}function isArray(item){return Array.isArray(item)}function isElement(item){return typeof Element!==`undefined`&&item instanceof Element}function isNull(item){return item===null}function isNullOrUndefined(item){return item==null}function isUndefined(item){return item===void 0}function isSymbol(item){return typeof item===`symbol`}function isNaN$1(item){return isNumber(item)&&Number.isNaN(item)}var UNSAFE_KEYS=new Set([`__proto__`,`constructor`,`prototype`]);function isPlainObject$2(value){if(typeof value!==`object`||value===null||Array.isArray(value))return false;const proto=Object.getPrototypeOf(value);return proto===Object.prototype||proto===null}function mergeDeep$1(target,...sources){const out={};for(const key in target)if(Object.hasOwn(target,key))out[key]=target[key];for(const source of sources){if(!isObject$1(source))continue;for(const key in source){if(UNSAFE_KEYS.has(key))continue;if(!Object.hasOwn(source,key))continue;const sourceValue=source[key];if(isUndefined(sourceValue))continue;const targetValue=out[key];out[key]=isPlainObject$2(sourceValue)&&isPlainObject$2(targetValue)?mergeDeep$1(targetValue,sourceValue):sourceValue}}return out}var idCounter=0;function useId$1(){if(instanceExists())return useId();return`v0-${idCounter++}`}function clamp$2(value,min=0,max=1){if(!Number.isFinite(value))return min;return Math.max(min,Math.min(max,value))}function range(length,start=0){return Array.from({length},(_,index)=>start+index)}function pxToNumber(value,fallback=0){if(!isString(value))return fallback;const parsed=Number.parseFloat(value);return isNaN$1(parsed)?fallback:parsed}function resolveIds(ids,getter){const result=[];for(const id of ids){const item=getter(id);if(!isUndefined(item))result.push(item)}return result}var COMBINING_MARKS=/[\u0300-\u036F]/g;var FINAL_SIGMA=/ς/g;function lower(str){return str.toLowerCase().replace(FINAL_SIGMA,`σ`)}var SPECIAL_LETTERS={ł:`l`,ø:`o`,đ:`d`,ð:`d`,þ:`th`,ħ:`h`,ŧ:`t`,ŋ:`n`,ß:`ss`,æ:`ae`,œ:`oe`,ı:`i`,Ł:`L`,Ø:`O`,Đ:`D`,Ð:`D`,Þ:`Th`,Ħ:`H`,Ŧ:`T`,Ŋ:`N`,ẞ:`Ss`,Æ:`Ae`,Œ:`Oe`};var SPECIAL_LETTER=new RegExp(`[${Object.keys(SPECIAL_LETTERS).join(``)}]`,`g`);function fold(str){return str.normalize(`NFD`).replace(COMBINING_MARKS,``).replace(SPECIAL_LETTER,char=>SPECIAL_LETTERS[char])}function foldWithMap(str,ignoreCase,foldAccents){let folded=``;const map=[];let index=0;for(const char of str){const raw=ignoreCase?lower(char):char;const chunk=foldAccents?fold(raw):raw;folded+=chunk;for(let unit=0;unit<chunk.length;unit++)map.push(index);index+=char.length}map.push(str.length);return{folded,map}}function collect(haystack,needle,matchAll){const ranges=[];let index=haystack.indexOf(needle);while(index!==-1){ranges.push([index,index+needle.length]);if(!matchAll)break;index=haystack.indexOf(needle,index+needle.length)}return ranges}function remap(map,start,end){const sourceStart=map[start];let sourceEnd=map[end];if(end>0&&map[end]===map[end-1]){let index=end;const current=map[end];while(index<map.length&&map[index]===current)index++;sourceEnd=map[index]}return[sourceStart,sourceEnd]}function project(ranges,map){const projected=[];for(const[start,end]of ranges){const span=remap(map,start,end);const last=projected.at(-1);if(!last||last[0]!==span[0]||last[1]!==span[1])projected.push(span)}return projected}function search(text,query,ignoreCase,foldQuery,foldTarget,matchAll){const folded=foldQuery?fold(query):query;const needle=ignoreCase?lower(folded):folded;if(needle.length===0)return[];if(!foldTarget){if(!ignoreCase)return collect(text,needle,matchAll);const lowered=lower(text);if(lowered.length===text.length)return collect(lowered,needle,matchAll)}const{folded:haystack,map}=foldWithMap(text,ignoreCase,foldTarget);return project(collect(haystack,needle,matchAll),map)}function mergeRanges(a,b){const combined=[...a,...b].toSorted((x,y)=>x[0]-y[0]||x[1]-y[1]);const merged=[];for(const range of combined){const last=merged.at(-1);if(last&&range[0]<last[1])continue;merged.push(range)}return merged}function findMatchRanges(text,query,options={}){const{ignoreCase=false,ignoreAccents=false,matchAll=false}=options;const foldQuery=ignoreAccents===true||ignoreAccents===`query`;const foldTarget=ignoreAccents===true||ignoreAccents===`target`;if(foldQuery===foldTarget)return search(text,query,ignoreCase,foldQuery,foldTarget,matchAll);const merged=mergeRanges(search(text,query,ignoreCase,false,false,true),search(text,query,ignoreCase,foldQuery,foldTarget,true));return matchAll?merged:merged.slice(0,1)}var V0Error=class extends Error{name=`V0Error`;code;key;plugin;palette;seed;variant;adapter;prefix;constructor(message,details){const{cause,...rest}=details;super(message,isUndefined(cause)?void 0:{cause});this.code=details.code;for(const[key,value]of Object.entries(rest)){if(UNSAFE_KEYS.has(key))continue;this[key]=value}}};function useContext(key,defaultValue){const context=inject$1(key,defaultValue);if(isUndefined(context))throw new V0Error(`Context "${String(key)}" not found. Ensure it's provided by an ancestor.`,{code:`V0_CONTEXT_MISSING`,key});return context}function provideContext(key,context,app){if(app)app.provide(key,context);else provide(key,context);return context}function createContext(keyOrOptions,defaultValue){if(isString(keyOrOptions)||isSymbol(keyOrOptions)){const _key=keyOrOptions;function _provideContext(context,app){return provideContext(_key,context,app)}function _useContext(){return useContext(_key,defaultValue)}return[_useContext,_provideContext]}const suffix=isObject$1(keyOrOptions)?keyOrOptions.suffix:void 0;function _provideContext(key,context,app){return provideContext(suffix?`${key}:${suffix}`:key,context,app)}function _useContext(key,defaultValue){return useContext(suffix?`${key}:${suffix}`:key,defaultValue)}return[_useContext,_provideContext]}function createTrinity(keyOrUseContext,provideContextOrContext,maybeContext){if(isString(keyOrUseContext)){const[useContext,provideContext]=createContext(keyOrUseContext);const context=provideContextOrContext;return[useContext,(_context=context,app)=>provideContext(_context,app),context]}const provideContext=provideContextOrContext;const context=maybeContext;return[keyOrUseContext,(_context=context,app)=>provideContext(_context,app),context]}var INSTALLED=Symbol.for(`v0:installed-plugins`);function getInstalled(app){const ctx=app._context;return ctx[INSTALLED]??=new Map}function bindPluginContext(app,namespace,context){const record=getInstalled(app).get(namespace);if(record)record.context=context}function createPlugin(options){return{install(app){app.runWithContext(()=>{const installed=getInstalled(app);if(installed.has(options.namespace))return;installed.set(options.namespace,{namespace:options.namespace,devtools:options.devtools===true,inspect:options.inspect});options.provide(app);options.setup?.(app);if(options.devtools);})}}}function deriveKey(namespace){return namespace.startsWith(`v0:`)?namespace.slice(3):namespace}function getPersistedStorage(){return useContext(`v0:storage`)}function createPluginContext(defaultNamespace,factory,config){function createXContext(_options={}){const{namespace=defaultNamespace,persist:_persist,devtools:_devtools,...options}=_options;const context=factory(options);return createTrinity(namespace,context)}function createXPlugin(_options={}){const{namespace=defaultNamespace,persist:shouldPersist,devtools,...options}=_options;const enabled=devtools??config?.devtools??false;const inspect=config?.inspect;let context;return createPlugin({namespace,devtools:enabled,inspect:inspect?context=>inspect(context):void 0,provide:app=>{const[,provide,ctx]=createXContext({...options,namespace});context=ctx;provide(context,app);bindPluginContext(app,namespace,context);if(shouldPersist&&config?.restore){const storage=getPersistedStorage();const key=deriveKey(namespace);const saved=storage.get(key);if(!isNullOrUndefined(saved.value))config.restore(context,saved.value)}},setup:config?.setup||shouldPersist?app=>{const ctx=context;config?.setup?.(ctx,app,options);if(shouldPersist&&config?.persist){const storage=getPersistedStorage();const key=deriveKey(namespace);const stored=storage.get(key);const stop=watch(()=>config.persist(ctx),val=>{stored.value=val});app.onUnmount(stop)}}:void 0})}function useX(namespace=defaultNamespace){if(config?.fallback){if(!hasInjectionContext())return config.fallback(namespace);const provided=inject$1(namespace,void 0);if(!isUndefined(provided))return provided;return config.fallback(namespace)}return useContext(namespace)}return[createXContext,createXPlugin,useX]}var LoggerAdapter=class{};var V0LoggerAdapter=class extends LoggerAdapter{prefix;colors;timestamps;constructor(options={}){super();this.prefix=options.prefix||`v0`;this.colors=options.colors!==false;this.timestamps=options.timestamps!==false}debug(message,...args){this.log(`debug`,`debug`,message,...args)}info(message,...args){this.log(`info`,`info`,message,...args)}warn(message,...args){this.log(`warn`,`warn`,message,...args)}error(message,...args){this.log(`error`,`error`,message,...args)}trace(message,...args){this.log(`trace`,`trace`,message,...args)}fatal(message,...args){this.log(`fatal`,`error`,message,...args)}format(level,message,...args){return[[this.timestamps?this.timestamp():``,`[${this.prefix} ${level.toLowerCase()}]`,message].filter(Boolean).join(` `),...args]}timestamp(){if(!IN_BROWSER$1)return new Date().toISOString();return new Date().toTimeString().split(` `)[0]??``}style(level){if(!this.colors||!IN_BROWSER$1)return``;return{trace:`color: #64748b`,debug:`color: #3b82f6`,info:`color: #10b981`,warn:`color: #f59e0b`,error:`color: #ef4444`,fatal:`color: #dc2626; font-weight: bold`,silent:``}[level]||``}log(level,method,message,...args){const[formattedMessage,...restArgs]=this.format(level,message,...args);const style=this.style(level);if(IN_BROWSER$1&&style&&isFunction(console[method]))console[method](`%c${formattedMessage}`,style,...restArgs);else if(isFunction(console[method]))console[method](formattedMessage,...restArgs)}};function createLogger(options={}){const{adapter=new V0LoggerAdapter({prefix:options.prefix}),level:initialLevel=`info`,enabled:initialEnabled=__LOGGER_ENABLED__}=options;let currentLevel=initialLevel;let isEnabled=initialEnabled;function value(level){return{trace:0,debug:1,info:2,warn:3,error:4,fatal:5,silent:6}[level]??2}function can(level){if(!isEnabled)return false;return value(level)>=value(currentLevel)}function format(message){return message}function debug(message,...args){if(can(`debug`))adapter.debug(format(message),...args)}function info(message,...args){if(can(`info`))adapter.info(format(message),...args)}function warn(message,...args){if(can(`warn`))adapter.warn(format(message),...args)}function error(message,...args){if(can(`error`))adapter.error(format(message),...args)}function trace(message,...args){if(can(`trace`))adapter.trace?.(format(message),...args)}function fatal(message,...args){if(can(`fatal`))adapter.fatal?.(format(message),...args)}function level(newLevel){currentLevel=newLevel}function current(){return currentLevel}function enabled(){return isEnabled}function enable(){isEnabled=true}function disable(){isEnabled=false}return{debug,info,warn,error,trace,fatal,level,current,enabled,enable,disable,adapter}}var NAMESPACE=`v0:logger`;function createFallbackLogger(namespace=NAMESPACE){function format(message,type){return`[${namespace} ${type}] ${message}`}return{debug:(message,...args)=>console.debug(format(message,`debug`),...args),info:(message,...args)=>console.info(format(message,`info`),...args),warn:(message,...args)=>console.warn(format(message,`warn`),...args),error:(message,...args)=>console.error(format(message,`error`),...args),trace:(message,...args)=>console.trace(format(message,`trace`),...args),fatal:(message,...args)=>console.error(format(message,`fatal`),...args),level:()=>{},current:()=>`info`,enabled:()=>true,enable:()=>{},disable:()=>{},adapter:new V0LoggerAdapter({prefix:namespace})}}var[createLoggerContext,createLoggerPlugin,useLoggerContext]=createPluginContext(NAMESPACE,options=>createLogger(options),{fallback:ns=>createFallbackLogger(ns),inspect:ctx=>({level:ctx.current(),enabled:ctx.enabled(),adapter:ctx.adapter.constructor.name}),setup:(context,_app,_options)=>{}});function createScopedLogger(logger,scope){const tag=`[${scope}]`;function wrap(method){return(message,...args)=>method(`${tag} ${message}`,...args)}return{...logger,debug:wrap(logger.debug),info:wrap(logger.info),warn:wrap(logger.warn),error:wrap(logger.error),trace:wrap(logger.trace),fatal:wrap(logger.fatal)}}function useLogger(scope){const logger=useLoggerContext();return isUndefined(scope)||!scope.trim()?logger:createScopedLogger(logger,scope)}function bound(index,max){if(index===Infinity)return max;return clamp$2(Math.trunc(index),0,max)}function createRegistry(options={}){const logger=useLogger();const{events=false,reactive=false}=options;const collection=reactive?shallowReactive(new Map):new Map;const catalog=new Map;const directory=new Map;const cache=new Map;const listeners=new Map;const minted=new WeakSet;const order=[];const version=shallowRef(0);let indexDependentCount=0;let needsReindex=false;let scheduled=false;let minDirtyIndex=Infinity;let maxDirtyIndex=-Infinity;let isBatching=false;let structural=false;let batched=[];let isDisposing=false;function dispatch(event,data){const cbs=listeners.get(event);if(!cbs)return;for(const cb of cbs)cb(data)}function emit(event,data=void 0){if(!events)return;if(isBatching){batched.push({event,data});return}dispatch(event,data)}function on(event,cb){if(!events){logger.warn(`Events are disabled. Initialize with \`createRegistry({ events: true })\` to enable.`);return}if(!listeners.has(event))listeners.set(event,new Set);listeners.get(event).add(cb)}function off(event,cb){if(!events){logger.warn(`Events are disabled. Initialize with \`createRegistry({ events: true })\` to enable.`);return}listeners.get(event)?.delete(cb)}function dispose(){if(isDisposing)return;isDisposing=true;try{clear()}finally{listeners.clear();isDisposing=false}}function get(id){return collection.get(id)}function upsert(id,patch={},event){if(needsReindex)reindex();const existing=get(id);if(!existing)return register({...patch,id});const hasValue=Object.hasOwn(patch,`value`);let value=existing.value;let valueIsIndex=existing.valueIsIndex;if(hasValue){if(isUndefined(patch.value)){value=existing.index;valueIsIndex=true}else{value=patch.value;valueIsIndex=false}if(valueIsIndex!==existing.valueIsIndex){if(valueIsIndex)indexDependentCount++;else indexDependentCount--}if(!Object.is(value,existing.value)){unassign(existing.value,id);assign(value,id)}}Object.assign(existing,patch,{id,index:existing.index,value,valueIsIndex,unregister:existing.unregister});collection.set(id,existing);cache.clear();emit(`update:ticket`,existing);if(event)emit(event,existing);return existing}function browse(value){if(needsReindex)reindex();const bucket=catalog.get(value);return bucket?bucket.slice():void 0}function lookup(index){if(needsReindex)reindex();return directory.get(index)}function has(id){return collection.has(id)}function assign(value,id){const bucket=catalog.get(value);if(bucket){if(!bucket.includes(id))bucket.push(id)}else catalog.set(value,[id])}function unassign(value,id){const bucket=catalog.get(value);if(!bucket)return;const next=bucket.filter(v=>v!==id);if(next.length===0)catalog.delete(value);else catalog.set(value,next)}function keys(){if(reactive)version.value;const cached=cache.get(`keys`);if(!isUndefined(cached))return cached;const out=order.map(ticket=>ticket.id);cache.set(`keys`,out);return out}function values(){if(reactive)version.value;const cached=cache.get(`values`);if(!isUndefined(cached))return cached;const out=order.slice();cache.set(`values`,out);return out}function entries(){if(reactive)version.value;const cached=cache.get(`entries`);if(!isUndefined(cached))return cached;const out=order.map(ticket=>[ticket.id,ticket]);cache.set(`entries`,out);return out}function clear(){order.length=0;catalog.clear();directory.clear();indexDependentCount=0;needsReindex=false;minDirtyIndex=Infinity;maxDirtyIndex=-Infinity;cache.clear();collection.clear();invalidate();emit(`clear:registry`)}function invalidate(){cache.clear();if(isBatching){structural=true;return}version.value++}function defer(){needsReindex=true;if(isBatching||scheduled)return;scheduled=true;queuePostFlushCb(()=>{scheduled=false;if(!needsReindex)return;try{reindex()}catch(error){logger.error(`deferred reindex threw`,error)}})}function batch(fn){if(isBatching)return fn();isBatching=true;structural=false;batched=[];try{return fn()}finally{try{if(needsReindex)reindex()}finally{isBatching=false;const queue=batched;const bump=structural;batched=[];structural=false;cache.clear();try{for(const{event,data}of queue)dispatch(event,data)}finally{if(bump)version.value++}}}}function reindex(){const size=order.length;const start=minDirtyIndex===Infinity?0:minDirtyIndex;const end=maxDirtyIndex===-Infinity?size-1:Math.min(maxDirtyIndex,size-1);const full=start===0&&end===size-1;invalidate();if(full){catalog.clear();directory.clear()}else for(let i=start;i<=end;i++){const ticket=order[i];directory.delete(ticket.index);if(ticket.valueIsIndex)unassign(ticket.value,ticket.id)}for(let i=start;i<=end;i++){const ticket=order[i];if(ticket.valueIsIndex){ticket.value=i;assign(ticket.value,ticket.id)}else if(full)assign(ticket.value,ticket.id);ticket.index=i;directory.set(i,ticket.id)}needsReindex=false;minDirtyIndex=Infinity;maxDirtyIndex=-Infinity;emit(`reindex:registry`)}function register(registration={}){if(needsReindex)reindex();const size=collection.size;const auto=isNullOrUndefined(registration.id);const id=registration.id??useId$1();if(has(id)){logger.warn(`Ticket "${id}" already exists. Use \`upsert()\` to update or check \`has()\` before registering.`);return get(id)}const valueIsUndefined=isUndefined(registration.value);const index=size;const value=valueIsUndefined?index:registration.value;const valueIsIndex=registration.valueIsIndex??valueIsUndefined;if(valueIsIndex)indexDependentCount++;const input={unregister:()=>unregister(id),...registration,id,index,value,valueIsIndex};const ticket=reactive?shallowReactive(input):input;if(auto)minted.add(ticket);order.push(ticket);directory.set(ticket.index,ticket.id);assign(ticket.value,ticket.id);cache.clear();collection.set(ticket.id,ticket);invalidate();emit(`register:ticket`,ticket);return ticket}function unregister(id){const ticket=collection.get(id);if(!ticket)return;if(ticket.valueIsIndex)indexDependentCount--;let orderPos=ticket.index;if(order[orderPos]!==ticket)orderPos=order.indexOf(ticket);if(orderPos!==-1)order.splice(orderPos,1);directory.delete(ticket.index);unassign(ticket.value,ticket.id);cache.clear();collection.delete(ticket.id);const shifted=ticket.index<collection.size;const willReindex=indexDependentCount>0&&shifted;if(!willReindex)invalidate();if(shifted){minDirtyIndex=Math.min(minDirtyIndex,ticket.index);if(willReindex)reindex();else defer()}emit(`unregister:ticket`,ticket)}function onboard(registrations){return batch(()=>registrations.map(registration=>register(registration)))}function toInput(ticket){const input={...ticket};delete input.index;delete input.valueIsIndex;delete input.unregister;if(minted.has(ticket))delete input.id;if(ticket.valueIsIndex)delete input.value;return input}function offboard(ids){const removed=[];const removedIds=new Set;for(const id of ids){if(removedIds.has(id))continue;const ticket=collection.get(id);if(ticket){removed.push(ticket);removedIds.add(id)}}if(removed.length===0)return[];batch(()=>{let w=0;for(const ticket of order)if(!removedIds.has(ticket.id))order[w++]=ticket;order.length=w;let lowest=Infinity;for(const ticket of removed){if(ticket.valueIsIndex)indexDependentCount--;lowest=Math.min(lowest,ticket.index);directory.delete(ticket.index);unassign(ticket.value,ticket.id)}invalidate();for(const ticket of removed)collection.delete(ticket.id);for(const ticket of removed)emit(`unregister:ticket`,ticket);if(lowest<collection.size){minDirtyIndex=Math.min(minDirtyIndex,lowest);if(indexDependentCount>0)reindex();else defer()}});return removed.map(ticket=>toInput(ticket))}function move(id,toIndex){if(needsReindex)reindex();const ticket=collection.get(id);if(!ticket)return void 0;const size=collection.size;const target=bound(toIndex,size-1);const from=ticket.index;if(from===target)return ticket;return batch(()=>{order.splice(from,1);order.splice(target,0,ticket);minDirtyIndex=Math.min(from,target);maxDirtyIndex=Math.max(from,target);reindex();emit(`update:ticket`,ticket);return ticket})}function reorder(ids){if(needsReindex)reindex();if(ids.length!==collection.size)return;const seen=new Set;const next=[];for(const id of ids){if(seen.has(id))return;const ticket=collection.get(id);if(!ticket)return;seen.add(id);next.push(ticket)}batch(()=>{for(const[i,ticket]of next.entries())order[i]=ticket;minDirtyIndex=0;maxDirtyIndex=-Infinity;reindex()})}function seek(direction=`first`,from,predicate){if(collection.size===0)return void 0;if(needsReindex)reindex();const n=order.length;if(!predicate&&isUndefined(from))return direction===`first`?order[0]:order.at(-1);const index=isUndefined(from)?void 0:bound(from,n-1);if(direction===`last`){const start=isUndefined(index)?n-1:index;for(let i=start;i>=0;i--){const ticket=order[i];if(!predicate||predicate(ticket))return ticket}}else{const start=isUndefined(index)?0:index;for(let i=start;i<n;i++){const ticket=order[i];if(!predicate||predicate(ticket))return ticket}}}return{collection,emit,on,off,dispose,has,keys,clear,browse,entries,values,lookup,get,upsert,register,unregister,reindex,move,reorder,seek,batch,onboard,offboard,get size(){return collection.size}}}function createModel(_options={}){const{disabled=false,enroll=true,multiple=false,...options}=_options;const registry=createRegistry(options);const selectedIds=shallowReactive(new Set);const selectedItems=computed(()=>new Set(resolveIds(selectedIds,registry.get)));const selectedValues=computed(()=>{const out=new Set;for(const item of selectedItems.value)out.add(toValue(item.value));return out});function select(id){if(toValue(disabled))return;const item=registry.get(id);if(!item||toValue(item.disabled))return;if(!toValue(multiple))selectedIds.clear();selectedIds.add(id)}function unselect(id){if(toValue(disabled))return;const item=registry.get(id);if(!item||toValue(item.disabled))return;selectedIds.delete(id)}function toggle(id){if(toValue(disabled))return;if(selected(id))unselect(id);else select(id)}function selected(id){return selectedIds.has(id)}function apply(values,_options){const value=values[0];let written=false;for(const id of selectedIds){const item=registry.get(id);if(!item||!isRef(item.value))continue;if(!isUndefined(value))item.value.value=value;written=true}if(written)return;if(!toValue(multiple))selectedIds.clear();if(isUndefined(value))return;const id=registry.browse(toRaw(value))?.values().next().value;if(!isUndefined(id))select(id)}function register(registration={}){const id=registration.id??useId$1();const item={disabled:false,unregister:()=>unregister(id),...registration,isSelected:toRef(()=>selected(id)),id};const ticket=registry.register(item);if(toValue(enroll)&&!toValue(disabled)&&!toValue(ticket.disabled))select(id);return ticket}function unregister(id){selectedIds.delete(id);registry.unregister(id)}function onboard(registrations){return registry.batch(()=>registrations.map(r=>register(r)))}function offboard(ids){for(const id of ids)selectedIds.delete(id);return registry.offboard(ids)}function reset(){selectedIds.clear()}function clear(){reset();registry.clear()}function dispose(){reset();registry.dispose()}return{...registry,disabled,selectedIds,selectedItems,selectedValues,register,onboard,unregister,offboard,clear,dispose,reset,select,unselect,toggle,selected,apply,get size(){return registry.size}}}function createSelection(_options={}){const{enroll=false,mandatory=false,multiple=false,...options}=_options;const model=createModel({...options,multiple,enroll:false});function seek(direction=`first`,from){return model.seek(direction,from,ticket=>!toValue(ticket.disabled))}function mandate(){if(!toValue(mandatory)||model.size===0||model.selectedIds.size>0)return;const ticket=seek(`first`);if(ticket)model.select(ticket.id)}function drain(id){if(toValue(model.disabled))return;if(toValue(mandatory)&&model.selectedIds.size===1)return;model.selectedIds.delete(id)}function unselect(id){if(toValue(model.disabled))return;const item=model.get(id);if(!item||toValue(item.disabled))return;drain(id)}function toggle(id){if(toValue(model.disabled))return;if(model.selectedIds.has(id))unselect(id);else model.select(id)}function apply(values,options){const isMultiple=options?.multiple??toValue(multiple);const currentIds=new Set(model.selectedIds);const targetIds=new Set;if(isMultiple){for(const value of values){const ids=model.browse(toRaw(value));if(isUndefined(ids))continue;for(const id of ids){const ticket=model.get(id);if(!ticket||toValue(ticket.disabled))continue;targetIds.add(id)}}if(toValue(mandatory)&&targetIds.size===0)return;for(const id of currentIds)if(!targetIds.has(id))model.selectedIds.delete(id);for(const id of targetIds)model.selectedIds.add(id)}else{for(const value of values){const ids=model.browse(toRaw(value));if(isUndefined(ids))continue;for(const id of ids)targetIds.add(id)}const next=targetIds.values().next().value;const last=currentIds.values().next().value;if(!isUndefined(last))drain(last);if(!isUndefined(next))model.select(next)}}function register(registration={}){const id=registration.id??useId$1();const decorated={select:()=>model.select(id),unselect:()=>unselect(id),toggle:()=>toggle(id),...registration,id};const ticket=model.register(decorated);if(toValue(enroll)&&!toValue(model.disabled)&&!toValue(ticket.disabled))model.select(ticket.id);if(toValue(mandatory)===`force`)mandate();return ticket}function onboard(registrations){const tickets=model.batch(()=>registrations.map(registration=>register(registration)));if(toValue(mandatory)===`force`)mandate();return tickets}function offboard(ids){return model.offboard(ids).map(input=>{const rest={...input};delete rest.select;delete rest.unselect;delete rest.toggle;return rest})}return{...model,multiple,register,onboard,offboard,unselect,toggle,apply,mandate,seek,get size(){return model.size}}}function createSingle(_options={}){const{mandatory=false,...options}=_options;const registry=createSelection({...options,mandatory,multiple:false});const selectedId=toRef(()=>registry.selectedIds.values().next().value);const selectedItem=toRef(()=>registry.selectedItems.value.values().next().value);const selectedIndex=toRef(()=>selectedItem.value?.index??-1);const selectedValue=toRef(()=>selectedItem.value?.value);return{...registry,selectedId,selectedItem,selectedIndex,selectedValue,get size(){return registry.size}}}function createTokens(tokens={},options={}){const logger=useLogger();const registry=createRegistry({...options,events:true});const cache=new Map;function invalidate(){cache.clear()}registry.on(`register:ticket`,invalidate);registry.on(`unregister:ticket`,invalidate);registry.on(`update:ticket`,invalidate);registry.on(`reindex:registry`,invalidate);registry.on(`clear:registry`,invalidate);registry.onboard(flatten(tokens,options.prefix,!!options.flat));function isAlias(token){return isString(token)&&token.length>2&&token[0]===`{`&&token.at(-1)===`}`}function isTokenAlias(value){return isObject$1(value)&&`$value`in value}function resolve(token,visited=new Set){const cacheKey=isString(token)?token:JSON.stringify(token);if(cache.has(cacheKey))return cache.get(cacheKey);const reference=isTokenAlias(token)?token.$value:token;const isAliasReference=isString(reference)&&isAlias(reference);if(isTokenAlias(token)&&!isAliasReference){cache.set(cacheKey,reference);return reference}const clean=isAliasReference?reference.slice(1,-1):String(reference);if(visited.has(clean)){logger.warn(`Circular alias detected for "${clean}"`);cache.set(cacheKey,void 0);return}visited.add(clean);let found=registry.get(clean);let segments=[];if(!found&&clean.includes(`.`)){const parts=clean.split(`.`);for(let i=parts.length-1;i>0;i--){const prefix=parts.slice(0,i).join(`.`);const suffix=parts.slice(i);const candidate=registry.get(prefix);if(!isUndefined(candidate?.value)){found=candidate;segments=suffix;break}}}if(isUndefined(found?.value)){if(isAliasReference)logger.warn(`Alias not found for "${String(reference)}"`);cache.set(cacheKey,void 0);return}let current=found.value;if(segments.length>0){if(isTokenAlias(current))current=current.$value;for(const segment of segments){if(!isObject$1(current)||UNSAFE_KEYS.has(segment)||!Object.prototype.hasOwnProperty.call(current,segment)){current=void 0;break}current=current[segment];if(isTokenAlias(current))current=current.$value}if(isUndefined(current)){logger.warn(`Path not found inside "${clean}": ${segments.join(`.`)}`);cache.set(cacheKey,void 0);return}}else if(isTokenAlias(current))current=current.$value;const result=isString(current)&&isAlias(current)?resolve(current,visited):current;cache.set(cacheKey,result);return result}return{...registry,resolve,isAlias,get size(){return registry.size}}}function flatten(tokens,prefix=``,flat=false){const flattened=[];const stack=[{tokens,prefix,flat}];while(stack.length>0){const{tokens:currentTokens,prefix:currentPrefix,flat}=stack.pop();const meta={};for(const k in currentTokens){if(!Object.hasOwn(currentTokens,k))continue;if(k.startsWith(`$`))meta[k]=currentTokens[k]}if(Object.keys(meta).length>0&¤tPrefix)flattened.push({id:currentPrefix,value:meta});for(const key in currentTokens){if(!Object.hasOwn(currentTokens,key))continue;if(UNSAFE_KEYS.has(key))continue;if(key.startsWith(`$`))continue;const value=currentTokens[key];const id=currentPrefix?`${currentPrefix}.${key}`:key;if(!isObject$1(value)){flattened.push({id,value});continue}if(`$value`in value){flattened.push({id,value});const inner=value.$value;if(isObject$1(inner)&&!flat)for(const innerKey in inner){if(!Object.hasOwn(inner,innerKey))continue;if(UNSAFE_KEYS.has(innerKey))continue;if(innerKey.startsWith(`$`))continue;const child=inner[innerKey];const childId=`${id}.${innerKey}`;if(!isObject$1(child))flattened.push({id:childId,value:child});else if(`$value`in child)flattened.push({id:childId,value:child});else stack.push({tokens:child,prefix:childId,flat})}continue}if(flat){flattened.push({id,value});continue}stack.push({tokens:value,prefix:id,flat})}}return flattened}var LocaleAdapter=class{};var V0LocaleAdapter=class extends LocaleAdapter{context;constructor(context){super();this.context=context}t(key,...params){const found=this.lookup(key,params);return isUndefined(found)?this.interpolate(key,params):found}ti(key,...params){return this.lookup(key,params)}n(value){const locale=this.context.selectedId.value;if(!IN_BROWSER$1||!locale)return value.toString();return new Intl.NumberFormat(String(locale)).format(value)}lookup(key,params){const locale=this.context.selectedId.value;if(!locale)return void 0;const message=this.context.tokens.get(`${locale}.${key}`)?.value;if(isString(message))return this.interpolate(this.resolve(locale,message),params);if(this.context.fallbackLocale){const fb=this.context.tokens.get(`${this.context.fallbackLocale}.${key}`)?.value;if(isString(fb))return this.interpolate(this.resolve(this.context.fallbackLocale,fb),params)}}resolve(locale,str,visited=new Set){return str.replace(/{([a-zA-Z0-9.\-_]+)}/g,(match,key)=>{const[prefix,...rest]=key.split(`.`);const target=this.context.has(prefix)?prefix:locale;const path=`${target}.${this.context.has(prefix)?rest.join(`.`):key}`;if(visited.has(path))return match;const resolved=this.context.tokens.get(path)?.value;if(isString(resolved))return this.resolve(target,resolved,new Set(visited).add(path));return match})}interpolate(message,args){let result=message;let rest=args;if(rest.length>0&&isObject$1(rest[0])){const variables=rest[0];result=result.replace(/{([a-zA-Z][a-zA-Z0-9_]*)}/g,(match,name)=>{return isUndefined(variables[name])?match:String(variables[name])});rest=rest.slice(1)}result=result.replace(/\{(\d+)\}/g,(match,index)=>{const i=Number.parseInt(index,10);if(!isUndefined(rest[i]))return String(rest[i]);return match});return result}};function createLocale$1(_options={}){const{adapter:externalAdapter,messages={},fallback:fallbackLocale,...options}=_options;const tokens=createTokens(messages);const registry=createSingle({...options,reactive:true});for(const id in messages){registry.register({id});if(id===options.default&&!registry.selectedId.value)registry.select(id)}const adapter=externalAdapter??new V0LocaleAdapter({tokens,selectedId:registry.selectedId,fallbackLocale,has:id=>registry.has(id)});function t(key,...params){return adapter.t(key,...params)}function ti(key,...params){return adapter.ti(key,...params)}function n(value){return adapter.n(value)}function register(registration={}){const{messages:msgs,...rest}=registration;if(msgs&&rest.id&&!registry.has(rest.id))tokens.onboard(flatten({[rest.id]:msgs}));return registry.register(rest)}return{...registry,t,ti,n,register,adapter,get size(){return registry.size}}}function toArray$1(value){return isNullOrUndefined(value)?[]:isArray(value)?value:[value]}function useEventListener(target,event,listener,options){const cleanups=[];function cleanup(){for(const fn of cleanups)fn();cleanups.length=0}function register(el,event,listener,options){el.addEventListener(event,listener,options);return()=>el.removeEventListener(event,listener,options)}const stopWatcher=watch(()=>[toValue(target),toValue(event),unref(listener),toValue(options)],([el,events,listeners,opts])=>{cleanup();if(!el)return;const eventList=toArray$1(events);const listenerList=toArray$1(listeners);for(const event of eventList)for(const listenerFn of listenerList)cleanups.push(register(el,event,listenerFn,opts))},{immediate:true,flush:`post`});function stop(){stopWatcher();cleanup()}onScopeDispose(stop,true);return stop}function useWindowEventListener(event,listener,options){return IN_BROWSER$1?useEventListener(window,event,listener,options):()=>{}}function fromInstance(instance){const el=instance.$el;if(isElement(el))return el;let tree=instance.$?.subTree;while(!isNullOrUndefined(tree?.component))tree=tree.component.subTree;const end=tree?.anchor;if(isNullOrUndefined(end))return void 0;let node=(tree?.el)?.nextSibling;while(!isNullOrUndefined(node)&&node!==end){if(isElement(node))return node;node=node.nextSibling}}function toElement(target){if(!target)return void 0;if(isElement(target))return target;const raw=isFunction(target)?target():isObject$1(target)&&`value`in target?target.value:target;if(!raw)return void 0;if(isElement(raw))return raw;if(isObject$1(raw)&&`$el`in raw)return fromInstance(raw)}function createHydration(){const isHydrated=shallowRef(false);const isSettled=shallowRef(false);function hydrate(){isHydrated.value=true}function settle(){isSettled.value=true}return{isHydrated:shallowReadonly(isHydrated),isSettled:shallowReadonly(isSettled),hydrate,settle}}function createFallbackHydration(){return{isHydrated:shallowReadonly(shallowRef(true)),isSettled:shallowReadonly(shallowRef(true)),hydrate:()=>{},settle:()=>{}}}var[createHydrationContext,createHydrationPlugin,useHydration$1]=createPluginContext(`v0:hydration`,()=>createHydration(),{fallback:()=>createFallbackHydration(),setup:(context,app)=>{const{mount}=app;app.mount=(...args)=>{const vm=mount(...args);nextTick$1().then(()=>{context.hydrate();nextTick$1().then(()=>context.settle())});app.mount=mount;return vm}}});function createObserver(target,userCallback,config){const{isHydrated}=useHydration$1();const resolved=toRef(()=>toElement(target));const observer=shallowRef(void 0);const isPaused=shallowRef(false);const isActive=toRef(()=>!!observer.value&&!isPaused.value);function invoke(entries){config.onEntry?.(entries);userCallback(entries);if(config.once){if(config.shouldStop?config.shouldStop(entries):true)stop()}}function setup(){if(isNull(observer.value))return;const el=resolved.value;if(!isHydrated.value||!config.supports||!isElement(el)||isPaused.value)return;observer.value=config.create(invoke);config.observe(observer.value,el);if(config.immediate){const entries=config.immediate(el);if(config.onceIncludesImmediate)invoke(entries);else{config.onEntry?.(entries);userCallback(entries)}}}watch(resolved,(el,oldEl)=>{if(oldEl||observer.value)cleanup();if(isHydrated.value&&isElement(el))setup()},{immediate:true});let stopHydrationWatch;if(!isHydrated.value)stopHydrationWatch=watch(()=>isHydrated.value,hydrated=>{if(hydrated&&isElement(resolved.value)&&!observer.value){setup();stopHydrationWatch?.();stopHydrationWatch=void 0}});function cleanup(){if(observer.value){observer.value.disconnect();observer.value=void 0}}function pause(){isPaused.value=true;config.onPause?.();observer.value?.disconnect()}function resume(){isPaused.value=false;setup()}function stop(){stopHydrationWatch?.();stopHydrationWatch=void 0;cleanup();observer.value=null}onScopeDispose(stop,true);return{isActive:shallowReadonly(isActive),isPaused:shallowReadonly(isPaused),pause,resume,stop}}function measure(el){const rect=el.getBoundingClientRect();const style=getComputedStyle(el);const padding={top:pxToNumber(style.paddingTop),left:pxToNumber(style.paddingLeft),right:pxToNumber(style.paddingRight),bottom:pxToNumber(style.paddingBottom)};const paddingX=padding.left+padding.right;const paddingY=padding.top+padding.bottom;const borderX=pxToNumber(style.borderLeftWidth)+pxToNumber(style.borderRightWidth);const borderY=pxToNumber(style.borderTopWidth)+pxToNumber(style.borderBottomWidth);const outer=style.boxSizing===`border-box`;const resolvedX=pxToNumber(style.width,rect.width);const resolvedY=pxToNumber(style.height,rect.height);const width={border:outer?resolvedX:resolvedX+paddingX+borderX,content:Math.max(0,outer?resolvedX-paddingX-borderX:resolvedX)};const height={border:outer?resolvedY:resolvedY+paddingY+borderY,content:Math.max(0,outer?resolvedY-paddingY-borderY:resolvedY)};const vertical=isString(style.writingMode)&&style.writingMode.startsWith(`vertical`);const inline=vertical?height:width;const block=vertical?width:height;return{contentRect:{width:width.content,height:height.content,top:padding.top,left:padding.left},borderBoxSize:[{inlineSize:inline.border,blockSize:block.border}],contentBoxSize:[{inlineSize:inline.content,blockSize:block.content}],target:el}}function useResizeObserver(target,callback,options={}){return createObserver(target,callback,{supports:SUPPORTS_OBSERVER,once:options.once,create:cb=>new ResizeObserver(entries=>{cb(entries.map(e=>{const sizes=e.borderBoxSize&&e.contentBoxSize?e:measure(e.target);return{contentRect:{width:e.contentRect.width,height:e.contentRect.height,top:e.contentRect.top,left:e.contentRect.left},borderBoxSize:sizes.borderBoxSize,contentBoxSize:sizes.contentBoxSize,target:e.target}}))}),observe:(obs,el)=>obs.observe(el,{box:options.box??`content-box`}),immediate:options.immediate?el=>[measure(el)]:void 0})}function useElementSize(target){const width=shallowRef(0);const height=shallowRef(0);const{pause:_pause,resume,stop,isActive,isPaused}=useResizeObserver(target,entries=>{const entry=entries[0];if(entry){width.value=entry.contentRect.width;height.value=entry.contentRect.height}},{immediate:true});function pause(){width.value=0;height.value=0;_pause()}return{width:shallowReadonly(width),height:shallowReadonly(height),isActive:shallowReadonly(isActive),isPaused:shallowReadonly(isPaused),pause,resume,stop}}function useTimer(handler,options={}){const{duration=1e3,repeat=false}=options;function resolveDuration(){return toValue(duration)}const remaining=shallowRef(resolveDuration());const isActive=shallowRef(false);const isPaused=shallowRef(false);let timeoutId;let trackingId;let startedAt=0;let budget=remaining.value;function clearTimer(){if(!isUndefined(timeoutId)){globalThis.clearTimeout(timeoutId);timeoutId=void 0}}function startTracking(){stopTracking();if(!IN_BROWSER$1)return;trackingId=globalThis.setInterval(()=>{if(!isActive.value||isPaused.value)return;const elapsed=Date.now()-startedAt;remaining.value=Math.max(0,budget-elapsed)},100)}function stopTracking(){if(!isUndefined(trackingId)){globalThis.clearInterval(trackingId);trackingId=void 0}}function fire(){clearTimer();stopTracking();handler();if(repeat)begin(resolveDuration());else{isActive.value=false;remaining.value=0}}function begin(ms){clearTimer();stopTracking();budget=ms;startedAt=Date.now();remaining.value=ms;isActive.value=true;isPaused.value=false;timeoutId=globalThis.setTimeout(fire,ms);startTracking()}function start(){const ms=resolveDuration();if(ms<0)return;begin(ms)}function stop(){clearTimer();stopTracking();isActive.value=false;isPaused.value=false;remaining.value=resolveDuration()}function pause(){if(!isActive.value||isPaused.value)return;const elapsed=Date.now()-startedAt;budget=Math.max(0,budget-elapsed);remaining.value=budget;clearTimer();stopTracking();isPaused.value=true}function resume(){if(!isPaused.value)return;isPaused.value=false;startedAt=Date.now();timeoutId=globalThis.setTimeout(fire,budget);startTracking()}onScopeDispose(()=>{clearTimer();stopTracking()},true);return{start,stop,pause,resume,remaining,isActive,isPaused}}function useIntersectionObserver(target,callback,options={}){const isIntersecting=shallowRef(false);return{...createObserver(target,callback,{supports:SUPPORTS_INTERSECTION_OBSERVER,once:options.once,create:cb=>new IntersectionObserver(entries=>{cb(entries.map(e=>({boundingClientRect:e.boundingClientRect,intersectionRatio:e.intersectionRatio,intersectionRect:e.intersectionRect,isIntersecting:e.isIntersecting,rootBounds:e.rootBounds,target:e.target,time:e.time})))},{root:options.root??null,rootMargin:options.rootMargin??`0px`,threshold:options.threshold??0}),observe:(obs,el)=>obs.observe(el),onEntry:entries=>{const latest=entries.at(-1);if(latest)isIntersecting.value=latest.isIntersecting},onPause:()=>{isIntersecting.value=false},shouldStop:entries=>entries.at(-1)?.isIntersecting??false,immediate:options.immediate?el=>{return[{boundingClientRect:el.getBoundingClientRect(),intersectionRatio:0,intersectionRect:new DOMRect(0,0,0,0),isIntersecting:false,rootBounds:null,target:el,time:performance.now()}]}:void 0}),isIntersecting:shallowReadonly(isIntersecting)}}function useElementIntersection(target,options={}){const isIntersecting=shallowRef(false);const intersectionRatio=shallowRef(0);const{pause:_pause,resume,stop,isActive,isPaused}=useIntersectionObserver(target,entries=>{const entry=entries.at(-1);if(entry){isIntersecting.value=entry.isIntersecting;intersectionRatio.value=entry.intersectionRatio}},{immediate:true,...options});function pause(){isIntersecting.value=false;intersectionRatio.value=0;_pause()}return{isIntersecting:shallowReadonly(isIntersecting),intersectionRatio:shallowReadonly(intersectionRatio),isActive,isPaused,pause,resume,stop}}function merge(ranges){const sorted=ranges.filter(span=>span[0]<span[1]).toSorted((a,b)=>a[0]-b[0]);const merged=[];for(const span of sorted){const last=merged.at(-1);if(last&&span[0]<=last[1])last[1]=Math.max(last[1],span[1]);else merged.push([span[0],span[1]])}return merged}function chunk$1(text,ranges){const chunks=[];let cursor=0;for(const[start,end]of ranges){if(cursor<start)chunks.push({text:text.slice(cursor,start),match:false});chunks.push({text:text.slice(start,end),match:true});cursor=end}if(cursor<text.length)chunks.push({text:text.slice(cursor),match:false});return chunks}function find(text,query,options){const spans=[];for(const term of toArray$1(query).filter(Boolean))spans.push(...findMatchRanges(text,term,options));return merge(spans)}function toHighlight(text,query,options={}){const _text=toValue(text);const _query=toValue(query);const _matches=toValue(options.matches);const matchAll=toValue(options.matchAll)??false;const ignoreCase=toValue(options.ignoreCase)??false;const ignoreAccents=toValue(options.ignoreAccents)??false;if(_matches?.length)return chunk$1(_text,merge(_matches));if(_query){const ranges=find(_text,_query,{matchAll,ignoreCase,ignoreAccents});return ranges.length>0?chunk$1(_text,ranges):[{text:_text,match:false}]}return[{text:_text,match:false}]}var BREAKPOINT_ORDER=[`xs`,`sm`,`md`,`lg`,`xl`,`xxl`];function createDefaultBreakpoints(){return{mobileBreakpoint:`lg`,breakpoints:{xs:0,sm:600,md:840,lg:1145,xl:1545,xxl:2138}}}function createBreakpoints(_options={}){const{ssr,...options}=_options;const defaults=createDefaultBreakpoints();const{mobileBreakpoint,breakpoints}=mergeDeep$1(defaults,options);const sorted=Object.entries(breakpoints).toSorted((a,b)=>a[1]-b[1]);const names=sorted.map(([n])=>n);const mb=isNumber(mobileBreakpoint)?mobileBreakpoint:breakpoints[mobileBreakpoint]??breakpoints.md;const initialWidth=ssr?ssr.clientWidth:IN_BROWSER$1?window.innerWidth:0;const initialHeight=ssr?ssr.clientHeight??0:IN_BROWSER$1?window.innerHeight:0;const name=shallowRef(`xs`);const width=shallowRef(initialWidth);const height=shallowRef(initialHeight);const isMobile=shallowRef(false);const xs=shallowRef(false);const sm=shallowRef(false);const md=shallowRef(false);const lg=shallowRef(false);const xl=shallowRef(false);const xxl=shallowRef(false);const smAndUp=shallowRef(false);const mdAndUp=shallowRef(false);const lgAndUp=shallowRef(false);const xlAndUp=shallowRef(false);const smAndDown=shallowRef(false);const mdAndDown=shallowRef(false);const lgAndDown=shallowRef(false);const xlAndDown=shallowRef(false);function resolve(value,media){let current=`xs`;for(let i=sorted.length-1;i>=0;i--){const px=sorted[i][1];if(media?window.matchMedia(`(min-width: ${px}px)`).matches:value>=px){current=sorted[i][0];break}}const index=names.indexOf(current);const mobile=isNumber(mb)?media?!window.matchMedia(`(min-width: ${mb}px)`).matches:value<mb:index<names.indexOf(mobileBreakpoint);return{current,index,mobile}}function apply({current,mobile}){const index=BREAKPOINT_ORDER.indexOf(current);name.value=current;isMobile.value=mobile;xs.value=current===`xs`;sm.value=current===`sm`;md.value=current===`md`;lg.value=current===`lg`;xl.value=current===`xl`;xxl.value=current===`xxl`;smAndUp.value=index>=1;mdAndUp.value=index>=2;lgAndUp.value=index>=3;xlAndUp.value=index>=4;smAndDown.value=index<=1;mdAndDown.value=index<=2;lgAndDown.value=index<=3;xlAndDown.value=index<=4}apply(resolve(initialWidth,!ssr&&IN_BROWSER$1&&SUPPORTS_MATCH_MEDIA$1));let listening=false;function listen(){if(listening||!IN_BROWSER$1)return;listening=true;useWindowEventListener(`resize`,()=>{update()},{passive:true})}function update(){if(!IN_BROWSER$1)return;listen();width.value=window.innerWidth;height.value=window.innerHeight;apply(resolve(width.value,SUPPORTS_MATCH_MEDIA$1))}if(!ssr)listen();return{breakpoints,mobileBreakpoint,name:readonly(name),width:readonly(width),height:readonly(height),isMobile:readonly(isMobile),xs:readonly(xs),sm:readonly(sm),md:readonly(md),lg:readonly(lg),xl:readonly(xl),xxl:readonly(xxl),smAndUp:readonly(smAndUp),mdAndUp:readonly(mdAndUp),lgAndUp:readonly(lgAndUp),xlAndUp:readonly(xlAndUp),smAndDown:readonly(smAndDown),mdAndDown:readonly(mdAndDown),lgAndDown:readonly(lgAndDown),xlAndDown:readonly(xlAndDown),ssr:!!ssr,update}}var RtlAdapter=class{dispose};var V0RtlAdapter=class extends RtlAdapter{setup(app,context,target){if(IN_BROWSER$1){if(isNull(target))return;const targetEl=target instanceof HTMLElement?target:isString(target)?document.querySelector(target):document.documentElement;if(!targetEl)return;targetEl.dir=context.isRtl.value?`rtl`:`ltr`;this.dispose=watch(context.isRtl,value=>{targetEl.dir=value?`rtl`:`ltr`})}else{const head=app._context?.provides?.usehead??app._context?.provides?.head;if(head?.push){const entry=head.push({htmlAttrs:{dir:context.isRtl.value?`rtl`:`ltr`}});const stop=watch(context.isRtl,rtl=>entry.patch?.({htmlAttrs:{dir:rtl?`rtl`:`ltr`}}));this.dispose=()=>{stop();entry.dispose?.()}}}}};function createRtl$1(options={}){const adapter=options.adapter??new V0RtlAdapter;const isRtl=shallowRef(options.default??false);function toggle(){isRtl.value=!isRtl.value}return{isRtl,toggle,adapter,dispose:()=>adapter.dispose?.()}}var IN_BROWSER=typeof window!==`undefined`;var SUPPORTS_INTERSECTION=IN_BROWSER&&`IntersectionObserver`in window;var SUPPORTS_TOUCH=IN_BROWSER&&(`ontouchstart`in window||window.navigator.maxTouchPoints>0);var SUPPORTS_EYE_DROPPER=IN_BROWSER&&`EyeDropper`in window;var SUPPORTS_MATCH_MEDIA=IN_BROWSER&&`matchMedia`in window&&isFunction(window.matchMedia);var PREFERS_REDUCED_MOTION=()=>SUPPORTS_MATCH_MEDIA&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;var IS_WEBKIT=IN_BROWSER&&CSS?.supports?.(`-webkit-backdrop-filter`,`none`);var SUPPORTS_FIELD_SIZING=IN_BROWSER&&CSS?.supports?.(`field-sizing`,`content`);function getNestedValue(obj,path,fallback){const last=path.length-1;if(last<0)return isUndefined(obj)?fallback:obj;for(let i=0;i<last;i++){if(isNullOrUndefined(obj))return fallback;obj=obj[path[i]]}if(isNullOrUndefined(obj))return fallback;return obj[path[last]]===void 0?fallback:obj[path[last]]}function getObjectValueByPath(obj,path,fallback){if(isNullOrUndefined(obj)||!path||!isString(path))return fallback;if(!isUndefined(obj[path]))return obj[path];path=path.replace(/\[(\w+)\]/g,`.$1`);path=path.replace(/^\./,``);return getNestedValue(obj,path.split(`.`),fallback)}function getPropertyFromItem(item,property,fallback){if(property===true)return isUndefined(item)?fallback:item;if(isNullOrUndefined(property)||isBoolean(property))return fallback;if(item!==Object(item)){if(!isFunction(property))return fallback;const value=property(item,fallback);return typeof value===`undefined`?fallback:value}if(isString(property))return getObjectValueByPath(item,property,fallback);if(Array.isArray(property))return getNestedValue(item,property,fallback);if(!isFunction(property))return fallback;const value=property(item,fallback);return typeof value===`undefined`?fallback:value}function isPercentage(value){return isString(value)&&value.endsWith(`%`)}function resolveSize(value,spanSize=0){return isPercentage(value)?parseFloat(value)/100*spanSize:parseFloat(String(value))||0}function convertToUnit(str,unit=`px`){if(isNullOrUndefined(str)||str===``)return;const num=Number(str);if(isNaN(num))return String(str);else if(!isFinite(num))return;else return`${num}${unit}`}function isPlainObject$1(obj){let proto;return!!obj&&typeof obj===`object`&&((proto=Object.getPrototypeOf(obj))===Object.prototype||!proto)}function refElement(obj){if(obj&&`$el`in obj){const el=obj.$el;if(el?.nodeType===Node.TEXT_NODE)return el.nextElementSibling;return el}return obj}var keyCodes=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34,shift:16});var keyValues=Object.freeze({enter:`Enter`,tab:`Tab`,delete:`Delete`,esc:`Escape`,space:`Space`,up:`ArrowUp`,down:`ArrowDown`,left:`ArrowLeft`,right:`ArrowRight`,end:`End`,home:`Home`,del:`Delete`,backspace:`Backspace`,insert:`Insert`,pageup:`PageUp`,pagedown:`PageDown`,shift:`Shift`});function keys$1(o){return Object.keys(o)}function has(obj,key){return key.every(k=>obj.hasOwnProperty(k))}function pick$1(obj,paths){const found={};for(const key of paths)if(Object.prototype.hasOwnProperty.call(obj,key))found[key]=obj[key];return found}function pickWithRest(obj,paths,exclude){const found=Object.create(null);const rest=Object.create(null);for(const key in obj)if(paths.some(path=>path instanceof RegExp?path.test(key):path===key)&&!exclude?.some(path=>path===key))found[key]=obj[key];else rest[key]=obj[key];return[found,rest]}function omit(obj,exclude){const clone={...obj};exclude.forEach(prop=>delete clone[prop]);return clone}var onRE=/^on[^a-z]/;var isOn=key=>onRE.test(key);var bubblingEvents=[`onAfterscriptexecute`,`onAnimationcancel`,`onAnimationend`,`onAnimationiteration`,`onAnimationstart`,`onAuxclick`,`onBeforeinput`,`onBeforescriptexecute`,`onChange`,`onClick`,`onCompositionend`,`onCompositionstart`,`onCompositionupdate`,`onContextmenu`,`onCopy`,`onCut`,`onDblclick`,`onFocusin`,`onFocusout`,`onFullscreenchange`,`onFullscreenerror`,`onGesturechange`,`onGestureend`,`onGesturestart`,`onGotpointercapture`,`onInput`,`onKeydown`,`onKeypress`,`onKeyup`,`onLostpointercapture`,`onMousedown`,`onMousemove`,`onMouseout`,`onMouseover`,`onMouseup`,`onMousewheel`,`onPaste`,`onPointercancel`,`onPointerdown`,`onPointerenter`,`onPointerleave`,`onPointermove`,`onPointerout`,`onPointerover`,`onPointerup`,`onReset`,`onSelect`,`onSubmit`,`onTouchcancel`,`onTouchend`,`onTouchmove`,`onTouchstart`,`onTransitioncancel`,`onTransitionend`,`onTransitionrun`,`onTransitionstart`,`onWheel`];var compositionIgnoreKeys=[`ArrowUp`,`ArrowDown`,`ArrowRight`,`ArrowLeft`,`Enter`,`Escape`,`Tab`,` `];function isComposingIgnoreKey(e){return e.isComposing&&compositionIgnoreKeys.includes(e.key)}function filterInputAttrs(attrs){const[events,props]=pickWithRest(attrs,[onRE]);const inputEvents=omit(events,bubblingEvents);const[rootAttrs,inputAttrs]=pickWithRest(props,[`class`,`style`,`id`,`inert`,/^data-/]);Object.assign(rootAttrs,events);Object.assign(inputAttrs,inputEvents);return[rootAttrs,inputAttrs]}function wrapInArray(v){return isNullOrUndefined(v)?[]:Array.isArray(v)?v:[v]}function debounce(fn,delay){let timeoutId=0;const wrap=(...args)=>{clearTimeout(timeoutId);timeoutId=setTimeout(()=>fn(...args),unref(delay))};wrap.clear=()=>{clearTimeout(timeoutId)};wrap.immediate=fn;return wrap}function clamp$1(value,min=0,max=1){return Math.max(min,Math.min(max,value))}function padEnd(str,length,char=`0`){return str+char.repeat(Math.max(0,length-str.length))}function padStart(str,length,char=`0`){return char.repeat(Math.max(0,length-str.length))+str}function chunk(str,size=1){const chunked=[];let index=0;while(index<str.length){chunked.push(str.substr(index,size));index+=size}return chunked}function humanReadableFileSize(bytes,base=1e3){if(bytes<base)return`${bytes} B`;const prefix=base===1024?[`Ki`,`Mi`,`Gi`]:[`k`,`M`,`G`];let unit=-1;while(Math.abs(bytes)>=base&&unit<prefix.length-1){bytes/=base;++unit}return`${bytes.toFixed(1)} ${prefix[unit]}B`}function mergeDeep(source={},target={},arrayFn,targetCondition){const out={};for(const key in source)out[key]=source[key];for(const key in target){const targetProperty=target[key];if(targetCondition&&!targetCondition(key,targetProperty))continue;const sourceProperty=source[key];if(isPlainObject$1(sourceProperty)&&isPlainObject$1(targetProperty)){out[key]=mergeDeep(sourceProperty,targetProperty,arrayFn,targetCondition);continue}if(arrayFn&&Array.isArray(sourceProperty)&&Array.isArray(targetProperty)){out[key]=arrayFn(sourceProperty,targetProperty);continue}out[key]=targetProperty}return out}function flattenFragments(nodes){return nodes.map(node=>{if(node.type===Fragment)return flattenFragments(node.children);else return node}).flat()}function toKebabCase(str=``){if(toKebabCase.cache.has(str))return toKebabCase.cache.get(str);const kebab=str.replace(/[^a-z]/gi,`-`).replace(/\B([A-Z])/g,`-$1`).toLowerCase();toKebabCase.cache.set(str,kebab);return kebab}toKebabCase.cache=new Map;function findChildrenWithProvide(key,vnode){if(!vnode||typeof vnode!==`object`)return[];if(Array.isArray(vnode))return vnode.map(child=>findChildrenWithProvide(key,child)).flat(1);else if(vnode.suspense)return findChildrenWithProvide(key,vnode.ssContent);else if(Array.isArray(vnode.children))return vnode.children.map(child=>findChildrenWithProvide(key,child)).flat(1);else if(vnode.component){if(Object.getOwnPropertyDescriptor(vnode.component.provides,key))return[vnode.component];else if(vnode.component.subTree)return findChildrenWithProvide(key,vnode.component.subTree).flat(1)}return[]}var CircularBuffer=class{#arr=[];#pointer=0;constructor(size){this.size=size}get isFull(){return this.#arr.length===this.size}push(val){this.#arr[this.#pointer]=val;this.#pointer=(this.#pointer+1)%this.size}values(){return this.#arr.slice(this.#pointer).concat(this.#arr.slice(0,this.#pointer))}clear(){this.#arr.length=0;this.#pointer=0}};function destructComputed(getter){const base=computed(getter);const obj={};for(const key in base.value)obj[key]=toRef(()=>base.value[key]);return obj}function includes(arr,val){return arr.includes(val)}function eventName(propName){return propName[2].toLowerCase()+propName.slice(3)}var EventProp=()=>[Function,Array];function hasEvent(props,name){name=`on`+capitalize(name);return!!(props[name]||props[`${name}Once`]||props[`${name}Capture`]||props[`${name}OnceCapture`]||props[`${name}CaptureOnce`])}function callEvent(handler,...args){if(Array.isArray(handler))for(const h of handler)h(...args);else if(isFunction(handler))handler(...args)}function focusableChildren(el,filterByTabIndex=true){const targets=[`button`,`[href]`,`input:not([type="hidden"])`,`select`,`textarea`,`details:not(:has(> summary))`,`details > summary`,`[tabindex]`,`[contenteditable]:not([contenteditable="false"])`,`audio[controls]`,`video[controls]`].map(s=>`${s}${filterByTabIndex?`:not([tabindex="-1"])`:``}:not([disabled], [inert])`).join(`, `);let elements;try{elements=[...el.querySelectorAll(targets)]}catch(err){consoleError(String(err));return[]}return elements.filter(x=>!x.closest(`[inert]`)).filter(x=>!!x.offsetParent||x.getClientRects().length>0).filter(x=>!x.parentElement?.closest(`details:not([open])`)||x.tagName===`SUMMARY`&&x.parentElement?.tagName===`DETAILS`)}function getActiveElement(){let active=document.activeElement;while(active?.shadowRoot?.activeElement)active=active.shadowRoot.activeElement;return active}function getNextElement(elements,location,condition){let _el;let idx=elements.indexOf(getActiveElement());if(idx<0){const focusTargetRole=(location===`prev`?elements.at(-1):elements[0])?.getAttribute(`role`)??``;if([`option`,`listbox`].includes(focusTargetRole))idx=elements.findIndex(el=>el.getAttribute(`role`)===`option`&&el.getAttribute(`aria-selected`)===`true`)}const inc=location===`next`?1:-1;do{idx+=inc;_el=elements[idx]}while((!_el||!_el.offsetParent||!(condition?.(_el)??true))&&idx<elements.length&&idx>=0);return _el}function focusChild(el,location,options){const focusable=focusableChildren(el);if(isNullOrUndefined(location)){const active=getActiveElement();if(el===active||!el.contains(active))focusable[0]?.focus(options)}else if(location===`first`)focusable[0]?.focus(options);else if(location===`last`)focusable.at(-1)?.focus(options);else if(isNumber(location))focusable[location]?.focus(options);else{const _el=getNextElement(focusable,location);if(_el)_el.focus(options);else focusChild(el,location===`next`?`first`:`last`,options)}}function noop$1(){}function matchesSelector(el,selector){if(!(IN_BROWSER&&typeof CSS!==`undefined`&&typeof CSS.supports!==`undefined`&&CSS.supports(`selector(${selector})`)))return null;try{return!!el&&el.matches(selector)}catch(err){return null}}function isAutofill(e){return!e.isTrusted||!!matchesSelector(e.target,`:autofill`)||!!matchesSelector(e.target,`:-webkit-autofill`)}function ensureValidVNode(vnodes){return vnodes.some(child=>{if(!isVNode(child))return true;if(child.type===Comment)return false;return child.type!==Fragment||ensureValidVNode(child.children)})?vnodes:null}function defer(timeout,cb){if(!IN_BROWSER||timeout===0){cb();return()=>{}}const timeoutId=window.setTimeout(cb,timeout);return()=>window.clearTimeout(timeoutId)}function templateRef(){const el=shallowRef();const fn=target=>{el.value=target};Object.defineProperty(fn,"value",{enumerable:true,get:()=>el.value,set:val=>el.value=val});Object.defineProperty(fn,"el",{enumerable:true,get:()=>refElement(el.value)});return fn}function checkPrintable(e){const isPrintableChar=e.key.length===1;const noModifier=!e.ctrlKey&&!e.metaKey&&!e.altKey;return isPrintableChar&&noModifier}function isPrimitive(value){return isString(value)||isNumber(value)||isBoolean(value)||typeof value===`bigint`}function escapeForRegex(sign){return`\\^$*+?.()|{}[]`.includes(sign)?`\\${sign}`:sign}function camelizeProps(props){const out={};for(const prop in props)out[camelize(prop)]=props[prop];return out}function onlyDefinedProps(props){const booleanAttributes=[`checked`,`disabled`];return Object.fromEntries(Object.entries(props).filter(([key,v])=>booleanAttributes.includes(key)?!!v:!isUndefined(v)))}var block=[`top`,`bottom`];var inline=[`start`,`end`,`left`,`right`];function parseAnchor(anchor,isRtl){let[side,align]=anchor.split(` `);if(!align)align=includes(block,side)?`start`:includes(inline,side)?`top`:`center`;return{side:toPhysical(side,isRtl),align:toPhysical(align,isRtl)}}function toPhysical(str,isRtl){if(str===`start`)return isRtl?`right`:`left`;if(str===`end`)return isRtl?`left`:`right`;return str}function flipSide(anchor){return{side:{center:`center`,top:`bottom`,bottom:`top`,left:`right`,right:`left`}[anchor.side],align:anchor.align}}function flipAlign(anchor){return{side:anchor.side,align:{center:`center`,top:`bottom`,bottom:`top`,left:`right`,right:`left`}[anchor.align]}}function flipCorner(anchor){return{side:anchor.align,align:anchor.side}}function getAxis(anchor){return includes(block,anchor.side)?`y`:`x`}var Box=class{constructor(args){if(isElement(args)){const pageScale=document.body.currentCSSZoom??1;const factor=1+(1-pageScale)/pageScale;const{x,y,width,height}=args.getBoundingClientRect();this.x=x*factor;this.y=y*factor;this.width=width*factor;this.height=height*factor}else{this.x=args.x;this.y=args.y;this.width=args.width;this.height=args.height}}get top(){return this.y}get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}};function getOverflow(a,b){return{x:{before:Math.max(0,b.left-a.left),after:Math.max(0,a.right-b.right)},y:{before:Math.max(0,b.top-a.top),after:Math.max(0,a.bottom-b.bottom)}}}function getTargetBox(target){if(Array.isArray(target)){const pageScale=document.body.currentCSSZoom??1;const factor=1+(1-pageScale)/pageScale;return new Box({x:target[0]*factor,y:target[1]*factor,width:0*factor,height:0*factor})}else return new Box(target)}function getElementBox(el){if(el===document.documentElement){if(!visualViewport)return new Box({x:0,y:0,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight});else{const localWidth=document.body.clientWidth;const pageScale=document.body.currentCSSZoom??(localWidth?document.documentElement.clientWidth/localWidth:1);return new Box({x:visualViewport.scale>1||IS_WEBKIT?0:visualViewport.offsetLeft,y:visualViewport.scale>1||IS_WEBKIT?0:visualViewport.offsetTop,width:document.documentElement.clientWidth/pageScale,height:document.documentElement.clientHeight/pageScale})}}else return new Box(el)}function nullifyTransforms(el){const rect=new Box(el);const style=getComputedStyle(el);const tx=style.transform;if(tx){let ta,sx,sy,dx,dy;if(tx.startsWith(`matrix3d(`)){ta=tx.slice(9,-1).split(/, /);sx=Number(ta[0]);sy=Number(ta[5]);dx=Number(ta[12]);dy=Number(ta[13])}else if(tx.startsWith(`matrix(`)){ta=tx.slice(7,-1).split(/, /);sx=Number(ta[0]);sy=Number(ta[3]);dx=Number(ta[4]);dy=Number(ta[5])}else return new Box(rect);const to=style.transformOrigin;const x=rect.x-dx-(1-sx)*parseFloat(to);const y=rect.y-dy-(1-sy)*parseFloat(to.slice(to.indexOf(` `)+1));const w=sx?rect.width/sx:el.offsetWidth+1;const h=sy?rect.height/sy:el.offsetHeight+1;return new Box({x,y,width:w,height:h})}else return new Box(rect)}function animate(el,keyframes,options){if(typeof el.animate===`undefined`)return{finished:Promise.resolve()};let animation;try{animation=el.animate(keyframes,options)}catch(err){return{finished:Promise.resolve()}}if(typeof animation.finished===`undefined`)animation.finished=new Promise(resolve=>{animation.onfinish=()=>{resolve(animation)}});return animation}var handlers=new WeakMap;function bindProps(el,props){Object.keys(props).forEach(k=>{if(isOn(k)){const name=eventName(k);const handler=handlers.get(el);if(isNullOrUndefined(props[k]))handler?.forEach(v=>{const[n,fn]=v;if(n===name){el.removeEventListener(name,fn);handler.delete(v)}});else if(!handler||![...handler].some(v=>v[0]===name&&v[1]===props[k])){el.addEventListener(name,props[k]);const _handler=handler||new Set;_handler.add([name,props[k]]);if(!handlers.has(el))handlers.set(el,_handler)}}else if(isNullOrUndefined(props[k]))el.removeAttribute(k);else el.setAttribute(k,props[k])})}function unbindProps(el,props){Object.keys(props).forEach(k=>{if(isOn(k)){const name=eventName(k);const handler=handlers.get(el);handler?.forEach(v=>{const[n,fn]=v;if(n===name){el.removeEventListener(name,fn);handler.delete(v)}})}else el.removeAttribute(k)})}var mainTRC=2.4;var Rco=.2126729;var Gco=.7151522;var Bco=.072175;var normBG=.55;var normTXT=.58;var revTXT=.57;var revBG=.62;var blkThrs=.03;var blkClmp=1.45;var deltaYmin=5e-4;var scaleBoW=1.25;var scaleWoB=1.25;var loConThresh=.078;var loConFactor=12.82051282051282;var loConOffset=.06;var loClip=.001;function APCAcontrast(text,background){const Rtxt=(text.r/255)**mainTRC;const Gtxt=(text.g/255)**mainTRC;const Btxt=(text.b/255)**mainTRC;const Rbg=(background.r/255)**mainTRC;const Gbg=(background.g/255)**mainTRC;const Bbg=(background.b/255)**mainTRC;let Ytxt=Rtxt*Rco+Gtxt*Gco+Btxt*Bco;let Ybg=Rbg*Rco+Gbg*Gco+Bbg*Bco;if(Ytxt<=blkThrs)Ytxt+=(blkThrs-Ytxt)**blkClmp;if(Ybg<=blkThrs)Ybg+=(blkThrs-Ybg)**blkClmp;if(Math.abs(Ybg-Ytxt)<deltaYmin)return 0;let outputContrast;if(Ybg>Ytxt){const SAPC=(Ybg**normBG-Ytxt**normTXT)*scaleBoW;outputContrast=SAPC<loClip?0:SAPC<loConThresh?SAPC-SAPC*loConFactor*loConOffset:SAPC-loConOffset}else{const SAPC=(Ybg**revBG-Ytxt**revTXT)*scaleWoB;outputContrast=SAPC>-.001?0:SAPC>-.078?SAPC-SAPC*loConFactor*loConOffset:SAPC+loConOffset}return outputContrast*100}var delta=.20689655172413793;var cielabForwardTransform=t=>t>delta**3?Math.cbrt(t):t/(3*delta**2)+4/29;var cielabReverseTransform=t=>t>delta?t**3:3*delta**2*(t-4/29);function fromXYZ$1(xyz){const transform=cielabForwardTransform;const transformedY=transform(xyz[1]);return[116*transformedY-16,500*(transform(xyz[0]/.95047)-transformedY),200*(transformedY-transform(xyz[2]/1.08883))]}function toXYZ$1(lab){const transform=cielabReverseTransform;const Ln=(lab[0]+16)/116;return[transform(Ln+lab[1]/500)*.95047,transform(Ln),transform(Ln-lab[2]/200)*1.08883]}var srgbForwardMatrix=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];var srgbForwardTransform=C=>C<=.0031308?C*12.92:1.055*C**(1/2.4)-.055;var srgbReverseMatrix=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]];var srgbReverseTransform=C=>C<=.04045?C/12.92:((C+.055)/1.055)**2.4;function fromXYZ(xyz){const rgb=Array(3);const transform=srgbForwardTransform;const matrix=srgbForwardMatrix;for(let i=0;i<3;++i)rgb[i]=Math.round(clamp$1(transform(matrix[i][0]*xyz[0]+matrix[i][1]*xyz[1]+matrix[i][2]*xyz[2]))*255);return{r:rgb[0],g:rgb[1],b:rgb[2]}}function toXYZ({r,g,b}){const xyz=[0,0,0];const transform=srgbReverseTransform;const matrix=srgbReverseMatrix;r=transform(r/255);g=transform(g/255);b=transform(b/255);for(let i=0;i<3;++i)xyz[i]=matrix[i][0]*r+matrix[i][1]*g+matrix[i][2]*b;return xyz}function isCssColor(color){return!!color&&/^(#|var\(--|(rgb|hsl)a?\()/.test(color)}function isParsableColor(color){return isCssColor(color)&&!/^((rgb|hsl)a?\()?var\(--/.test(color)}var cssColorRe=/^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/;var mappers={rgb:(r,g,b,a)=>({r,g,b,a}),rgba:(r,g,b,a)=>({r,g,b,a}),hsl:(h,s,l,a)=>HSLtoRGB({h,s,l,a}),hsla:(h,s,l,a)=>HSLtoRGB({h,s,l,a}),hsv:(h,s,v,a)=>HSVtoRGB({h,s,v,a}),hsva:(h,s,v,a)=>HSVtoRGB({h,s,v,a})};function parseColor(color){if(isNumber(color)){if(isNaN(color)||color<0||color>16777215)consoleWarn(`'${color}' is not a valid hex color`);return{r:(color&16711680)>>16,g:(color&65280)>>8,b:color&255}}else if(isString(color)&&cssColorRe.test(color)){const{groups}=color.match(cssColorRe);const{fn,values}=groups;const realValues=values.split(/,\s*|\s*\/\s*|\s+/).map((v,i)=>{if(v.endsWith(`%`)||i>0&&i<3&&[`hsl`,`hsla`,`hsv`,`hsva`].includes(fn))return parseFloat(v)/100;else return parseFloat(v)});return mappers[fn](...realValues)}else if(isString(color)){let hex=color.startsWith(`#`)?color.slice(1):color;if([3,4].includes(hex.length))hex=hex.split(``).map(char=>char+char).join(``);else if(![6,8].includes(hex.length))consoleWarn(`'${color}' is not a valid hex(a) color`);const int=parseInt(hex,16);if(isNaN(int)||int<0||int>4294967295)consoleWarn(`'${color}' is not a valid hex(a) color`);return HexToRGB(hex)}else if(isObject$1(color)){if(has(color,[`r`,`g`,`b`]))return color;else if(has(color,[`h`,`s`,`l`]))return HSVtoRGB(HSLtoHSV(color));else if(has(color,[`h`,`s`,`v`]))return HSVtoRGB(color)}throw new TypeError(`Invalid color: ${isNullOrUndefined(color)?color:String(color)||color.constructor.name}\nExpected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`)}function HSVtoRGB(hsva){const{h,s,v,a}=hsva;const f=n=>{const k=(n+h/60)%6;return v-v*s*Math.max(Math.min(k,4-k,1),0)};const rgb=[f(5),f(3),f(1)].map(v=>Math.round(v*255));return{r:rgb[0],g:rgb[1],b:rgb[2],a}}function HSLtoRGB(hsla){return HSVtoRGB(HSLtoHSV(hsla))}function HSLtoHSV(hsl){const{h,s,l,a}=hsl;const v=l+s*Math.min(l,1-l);return{h,s:v===0?0:2-2*l/v,v,a}}function toHex(v){const h=Math.round(v).toString(16);return(`00`.substr(0,2-h.length)+h).toUpperCase()}function RGBtoHex({r,g,b,a}){return`#${[toHex(r),toHex(g),toHex(b),isNumber(a)?toHex(Math.round(a*255)):``].join(``)}`}function HexToRGB(hex){hex=parseHex(hex);let[r,g,b,a]=chunk(hex,2).map(c=>parseInt(c,16));a=isNumber(a)?a/255:a;return{r,g,b,a}}function parseHex(hex){if(hex.startsWith(`#`))hex=hex.slice(1);hex=hex.replace(/([^0-9a-f])/gi,`F`);if(hex.length===3||hex.length===4)hex=hex.split(``).map(x=>x+x).join(``);if(hex.length!==6)hex=padEnd(padEnd(hex,6),8,`F`);return hex}function lighten(value,amount){const lab=fromXYZ$1(toXYZ(value));lab[0]=lab[0]+amount*10;return fromXYZ(toXYZ$1(lab))}function darken(value,amount){const lab=fromXYZ$1(toXYZ(value));lab[0]=lab[0]-amount*10;return fromXYZ(toXYZ$1(lab))}function getLuma(color){const rgb=parseColor(color);return toXYZ(rgb)[1]}function hasLightForeground(color){const blackContrast=Math.abs(APCAcontrast(parseColor(0),parseColor(color)));return Math.abs(APCAcontrast(parseColor(16777215),parseColor(color)))>Math.min(blackContrast,50)}function propsFactory(props,source){return defaults=>{return Object.keys(props).reduce((obj,prop)=>{const definition=isObject$1(props[prop])?props[prop]:{type:props[prop]};if(defaults&&prop in defaults)obj[prop]={...definition,default:defaults[prop]};else obj[prop]=definition;if(source&&!obj[prop].source)obj[prop].source=source;return obj},{})}}var makeComponentProps=propsFactory({class:[String,Array,Object],style:{type:[String,Array,Object],default:null}},`component`);function getCurrentInstance(name,message){const vm=getCurrentInstance$1();if(!vm)throw new Error(`[Vuetify] ${name} ${message||`must be called from inside a setup function`}`);return vm}function getCurrentInstanceName(name=`composables`){const vm=getCurrentInstance(name).type;return toKebabCase(vm?.aliasName||vm?.name)}function injectSelf(key,vm=getCurrentInstance(`injectSelf`)){const{provides}=vm;if(provides&&key in provides)return provides[key]}var DefaultsSymbol=Symbol.for(`vuetify:defaults`);var RootDefaultsSymbol=Symbol.for(`vuetify:defaults:root`);function createDefaults(options){return ref(options)}function injectDefaults(){const defaults=inject$1(DefaultsSymbol);if(!defaults)throw new Error(`[Vuetify] Could not find defaults instance`);return defaults}function provideDefaults(defaults,options){const injectedDefaults=injectDefaults();const injectedRoot=inject$1(RootDefaultsSymbol,null);const providedDefaults=ref(defaults);const newDefaults=computed(()=>{if(unref(options?.disabled))return injectedDefaults.value;const scoped=unref(options?.scoped);const reset=unref(options?.reset);const root=unref(options?.root);if(!providedDefaults.value&&!(scoped||reset||root))return injectedDefaults.value;let properties=mergeDeep(providedDefaults.value,{prev:injectedDefaults.value});if(scoped)return properties;if(reset||root){const len=Number(reset||Infinity);const rootDefaults=isString(root)?properties.prev?.[root]:void 0;if(root&&injectedRoot?.value)properties=injectedRoot.value;for(let i=0;i<=len;i++){if(!properties||!(`prev`in properties))break;properties=properties.prev}if(properties&&rootDefaults)properties=mergeDeep(mergeDeep(properties,{prev:properties}),rootDefaults);return properties}return properties.prev?mergeDeep(properties.prev,properties,void 0,(_,v)=>v!==void 0):properties});provide(DefaultsSymbol,newDefaults);return newDefaults}function injectNestedDefaults(name){const vm=getCurrentInstance(`injectNestedDefaults`);const defaults=injectDefaults();const self=vm.props._as??vm.type.name;return toRef(()=>defaults.value?.[self]?.[name])}function propIsDefined(vnode,prop){return vnode.props&&(typeof vnode.props[prop]!==`undefined`||typeof vnode.props[toKebabCase(prop)]!==`undefined`)}function internalUseDefaults(props={},name,defaults=injectDefaults()){const vm=getCurrentInstance(`useDefaults`);name=name??vm.type.name??vm.type.__name;if(!name)throw new Error(`[Vuetify] Could not determine component name`);const componentDefaults=computed(()=>defaults.value?.[props._as??name]);const _props=new Proxy(props,{get(target,prop){const propValue=Reflect.get(target,prop);if(prop===`class`||prop===`style`)return[componentDefaults.value?.[prop],propValue].filter(v=>v!=null);if(propIsDefined(vm.vnode,prop))return propValue;const _componentDefault=componentDefaults.value?.[prop];if(_componentDefault!==void 0)return _componentDefault;const _globalDefault=defaults.value?.global?.[prop];if(_globalDefault!==void 0)return _globalDefault;return propValue}});const _subcomponentDefaults=shallowRef();watchEffect(()=>{if(componentDefaults.value){const subComponents=Object.entries(componentDefaults.value).filter(([key])=>key.startsWith(key[0].toUpperCase()));_subcomponentDefaults.value=subComponents.length?Object.fromEntries(subComponents):void 0}else _subcomponentDefaults.value=void 0});function provideSubDefaults(){const injected=injectSelf(DefaultsSymbol,vm);provide(DefaultsSymbol,computed(()=>{return _subcomponentDefaults.value?mergeDeep(injected?.value??{},_subcomponentDefaults.value):injected?.value}))}return{props:_props,provideSubDefaults}}function defineComponent(options){options._setup=options._setup??options.setup;if(!options.name){consoleWarn(`The component is missing an explicit name, unable to generate default prop value`);return options}if(options._setup){options.props=propsFactory(options.props??{},options.name)();const propKeys=Object.keys(options.props).filter(key=>key!==`class`&&key!==`style`);options.filterProps=function filterProps(props){return pick$1(props,propKeys)};options.props._as=String;options.setup=function setup(props,ctx){const defaults=injectDefaults();if(!defaults.value)return options._setup(props,ctx);const{props:_props,provideSubDefaults}=internalUseDefaults(props,props._as??options.name,defaults);const setupBindings=options._setup(_props,ctx);provideSubDefaults();return setupBindings}}return options}function genericComponent(exposeDefaults=true){return options=>(exposeDefaults?defineComponent:defineComponent$1)(options)}function createSimpleFunctional(klass,tag=`div`,name){return genericComponent()({name:name??capitalize(camelize(klass.replace(/__/g,`-`))),props:{tag:{type:String,default:tag},...makeComponentProps()},setup(props,{slots}){return()=>{return h$1(props.tag,{class:[klass,props.class],style:props.style},slots.default?.())}}})}function updateRecursionCache(a,b,cache,result){if(!cache||isPrimitive(a)||isPrimitive(b))return;const visitedObject=cache.get(a);if(visitedObject)visitedObject.set(b,result);else{const newCacheItem=new WeakMap;newCacheItem.set(b,result);cache.set(a,newCacheItem)}}function findCachedComparison(a,b,cache){if(!cache||isPrimitive(a)||isPrimitive(b))return null;const r1=cache.get(a)?.get(b);if(isBoolean(r1))return r1;const r2=cache.get(b)?.get(a);if(isBoolean(r2))return r2;return null}function deepEqual$1(a,b,recursionCache=new WeakMap){if(a===b)return true;if(a instanceof Date&&b instanceof Date&&a.getTime()!==b.getTime())return false;if(a!==Object(a)||b!==Object(b))return false;const props=Object.keys(a);if(props.length!==Object.keys(b).length)return false;const cachedComparisonResult=findCachedComparison(a,b,recursionCache);if(cachedComparisonResult)return cachedComparisonResult;updateRecursionCache(a,b,recursionCache,true);return props.every(p=>deepEqual$1(a[p],b[p],recursionCache))}function attachedRoot(node){if(!isFunction(node.getRootNode)){while(node.parentNode)node=node.parentNode;if(node!==document)return null;return document}const root=node.getRootNode();if(root!==document&&root.getRootNode({composed:true})!==document)return null;return root}var standardEasing=`cubic-bezier(0.4, 0, 0.2, 1)`;var deceleratedEasing=`cubic-bezier(0.0, 0, 0.2, 1)`;var acceleratedEasing=`cubic-bezier(0.4, 0, 1, 1)`;var easingPatterns={linear:t=>t,easeInQuad:t=>t**2,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t**2:-1+(4-2*t)*t,easeInCubic:t=>t**3,easeOutCubic:t=>--t**3+1,easeInOutCubic:t=>t<.5?4*t**3:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t**4,easeOutQuart:t=>1- --t**4,easeInOutQuart:t=>t<.5?8*t**4:1-8*--t**4,easeInQuint:t=>t**5,easeOutQuint:t=>1+--t**5,easeInOutQuint:t=>t<.5?16*t**5:1+16*--t**5,instant:t=>1};function getScrollParent(el,includeHidden=false){while(el){if(includeHidden?isPotentiallyScrollable(el):hasScrollbar(el))return el;el=el.parentElement}return document.scrollingElement}function getScrollParents(el,stopAt){const elements=[];if(stopAt&&el&&!stopAt.contains(el))return elements;while(el){if(hasScrollbar(el))elements.push(el);if(el===stopAt)break;el=el.parentElement}return elements}function hasScrollbar(el){if(!el||el.nodeType!==Node.ELEMENT_NODE)return false;const style=window.getComputedStyle(el);const hasVerticalScrollbar=style.overflowY===`scroll`||style.overflowY===`auto`&&el.scrollHeight>el.clientHeight;const hasHorizontalScrollbar=style.overflowX===`scroll`||style.overflowX===`auto`&&el.scrollWidth>el.clientWidth;return hasVerticalScrollbar||hasHorizontalScrollbar}function isPotentiallyScrollable(el){if(!el||el.nodeType!==Node.ELEMENT_NODE)return false;const style=window.getComputedStyle(el);return[`scroll`,`auto`].includes(style.overflowY)}function isFixedPosition(el){while(el){if(window.getComputedStyle(el).position===`fixed`)return true;el=el.offsetParent}return false}function useRender(render){const vm=getCurrentInstance(`useRender`);vm.render=render}function throttle(fn,delay,options={leading:true,trailing:true}){let timeoutId=0;let lastExec=0;let throttling=false;let start=0;function clear(){clearTimeout(timeoutId);throttling=false;start=0}const wrap=(...args)=>{clearTimeout(timeoutId);const now=Date.now();if(!start)start=now;const elapsed=now-Math.max(start,lastExec);function invoke(){lastExec=Date.now();timeoutId=setTimeout(clear,delay);fn(...args)}if(!throttling){throttling=true;if(options.leading)invoke()}else if(elapsed>=delay)invoke();else if(options.trailing)timeoutId=setTimeout(invoke,delay-elapsed)};wrap.clear=clear;wrap.immediate=fn;return wrap}var IconValue=[String,Function,Object,Array];var IconSymbol=Symbol.for(`vuetify:icons`);var makeIconProps=propsFactory({icon:{type:IconValue},tag:{type:[String,Object,Function],required:true}},`icon`);var VComponentIcon=genericComponent()({name:`VComponentIcon`,props:makeIconProps(),setup(props,{slots}){return()=>{const Icon=props.icon;return createVNode(props.tag,null,{default:()=>[props.icon?createVNode(Icon,null,null):slots.default?.()]})}}});var VSvgIcon=defineComponent({name:`VSvgIcon`,inheritAttrs:false,props:makeIconProps(),setup(props,{attrs}){return()=>{return createVNode(props.tag,mergeProps(attrs,{"style":null}),{default:()=>[createBaseVNode(`svg`,{"class":`v-icon__svg`,"xmlns":`http://www.w3.org/2000/svg`,"viewBox":`0 0 24 24`,"role":`img`,"aria-hidden":`true`},[Array.isArray(props.icon)?props.icon.map(path=>Array.isArray(path)?createBaseVNode(`path`,{"d":path[0],"fill-opacity":path[1]},null):createBaseVNode(`path`,{"d":path},null)):createBaseVNode(`path`,{"d":props.icon},null)])]})}}});var VLigatureIcon=defineComponent({name:`VLigatureIcon`,props:makeIconProps(),setup(props){return()=>{return createVNode(props.tag,null,{default:()=>[props.icon]})}}});var VClassIcon=defineComponent({name:`VClassIcon`,props:makeIconProps(),setup(props){return()=>{return createVNode(props.tag,{"class":normalizeClass(props.icon)},null)}}});var useIcon=props=>{const icons=inject$1(IconSymbol);if(!icons)throw new Error(`Missing Vuetify Icons provide!`);return{iconData:computed(()=>{const iconAlias=toValue(props);if(!iconAlias)return{component:VComponentIcon};let icon=iconAlias;if(isString(icon)){icon=icon.trim();if(icon.startsWith(`$`))icon=icons.aliases?.[icon.slice(1)]}if(!icon)consoleWarn(`Could not find aliased icon "${iconAlias}"`);if(Array.isArray(icon))return{component:VSvgIcon,icon};else if(!isString(icon))return{component:VComponentIcon,icon};const iconSetName=Object.keys(icons.sets).find(setName=>isString(icon)&&icon.startsWith(`${setName}:`));const iconName=iconSetName?icon.slice(iconSetName.length+1):icon;return{component:icons.sets[iconSetName??icons.defaultSet].component,icon:iconName}})}};var aliases={collapse:`mdi-chevron-up`,complete:`mdi-check`,cancel:`mdi-close-circle`,close:`mdi-close`,delete:`mdi-close-circle`,clear:`mdi-close-circle`,success:`mdi-check-circle`,info:`mdi-information`,warning:`mdi-alert-circle`,error:`mdi-close-circle`,prev:`mdi-chevron-left`,next:`mdi-chevron-right`,checkboxOn:`mdi-checkbox-marked`,checkboxOff:`mdi-checkbox-blank-outline`,checkboxIndeterminate:`mdi-minus-box`,delimiter:`mdi-circle`,sortAsc:`mdi-arrow-up`,sortDesc:`mdi-arrow-down`,expand:`mdi-chevron-down`,menu:`mdi-menu`,subgroup:`mdi-menu-down`,dropdown:`mdi-menu-down`,radioOn:`mdi-radiobox-marked`,radioOff:`mdi-radiobox-blank`,edit:`mdi-pencil`,ratingEmpty:`mdi-star-outline`,ratingFull:`mdi-star`,ratingHalf:`mdi-star-half-full`,loading:`mdi-cached`,first:`mdi-page-first`,last:`mdi-page-last`,unfold:`mdi-unfold-more-horizontal`,file:`mdi-paperclip`,plus:`mdi-plus`,minus:`mdi-minus`,calendar:`mdi-calendar`,clock:`mdi-clock-outline`,treeviewCollapse:`mdi-menu-down`,treeviewExpand:`mdi-menu-right`,tableGroupCollapse:`mdi-chevron-down`,tableGroupExpand:`mdi-chevron-right`,eyeDropper:`mdi-eyedropper`,upload:`mdi-cloud-upload`,color:`mdi-palette`,command:`mdi-apple-keyboard-command`,ctrl:`mdi-apple-keyboard-control`,space:`mdi-keyboard-space`,shift:`mdi-apple-keyboard-shift`,alt:`mdi-apple-keyboard-option`,enter:`mdi-keyboard-return`,arrowup:`mdi-arrow-up`,arrowdown:`mdi-arrow-down`,arrowleft:`mdi-arrow-left`,arrowright:`mdi-arrow-right`,backspace:`mdi-backspace`,play:`mdi-play`,pause:`mdi-pause`,fullscreen:`mdi-fullscreen`,fullscreenExit:`mdi-fullscreen-exit`,volumeHigh:`mdi-volume-high`,volumeMedium:`mdi-volume-medium`,volumeLow:`mdi-volume-low`,volumeOff:`mdi-volume-variant-off`,search:`mdi-magnify`};var mdi={component:props=>h$1(VClassIcon,{...props,class:`mdi`})};function genDefaults$3(){return{svg:{component:VSvgIcon},class:{component:VClassIcon}}}function createIcons(options){const sets=genDefaults$3();const defaultSet=options?.defaultSet??`mdi`;if(defaultSet===`mdi`&&!sets.mdi)sets.mdi=mdi;return mergeDeep({defaultSet,sets,aliases:{...aliases,vuetify:[`M8.2241 14.2009L12 21L22 3H14.4459L8.2241 14.2009Z`,[`M7.26303 12.4733L7.00113 12L2 3H12.5261C12.5261 3 12.5261 3 12.5261 3L7.26303 12.4733Z`,.6]],"vuetify-outline":`svg:M7.26 12.47 12.53 3H2L7.26 12.47ZM14.45 3 8.22 14.2 12 21 22 3H14.45ZM18.6 5 12 16.88 10.51 14.2 15.62 5ZM7.26 8.35 5.4 5H9.13L7.26 8.35Z`,"vuetify-play":[`m6.376 13.184-4.11-7.192C1.505 4.66 2.467 3 4.003 3h8.532l-.953 1.576-.006.01-.396.677c-.429.732-.214 1.507.194 2.015.404.503 1.092.878 1.869.806a3.72 3.72 0 0 1 1.005.022c.276.053.434.143.523.237.138.146.38.635-.25 2.09-.893 1.63-1.553 1.722-1.847 1.677-.213-.033-.468-.158-.756-.406a4.95 4.95 0 0 1-.8-.927c-.39-.564-1.04-.84-1.66-.846-.625-.006-1.316.27-1.693.921l-.478.826-.911 1.506Z`,[`M9.093 11.552c.046-.079.144-.15.32-.148a.53.53 0 0 1 .43.207c.285.414.636.847 1.046 1.2.405.35.914.662 1.516.754 1.334.205 2.502-.698 3.48-2.495l.014-.028.013-.03c.687-1.574.774-2.852-.005-3.675-.37-.391-.861-.586-1.333-.676a5.243 5.243 0 0 0-1.447-.044c-.173.016-.393-.073-.54-.257-.145-.18-.127-.316-.082-.392l.393-.672L14.287 3h5.71c1.536 0 2.499 1.659 1.737 2.992l-7.997 13.996c-.768 1.344-2.706 1.344-3.473 0l-3.037-5.314 1.377-2.278.004-.006.004-.007.481-.831Z`,.6]]}},options)}function useToggleScope(source,fn){let scope;function start(){scope=effectScope();scope.run(()=>fn.length?fn(()=>{scope?.stop();start()}):fn())}watch(source,active=>{if(active&&!scope)start();else if(!active){scope?.stop();scope=void 0}},{immediate:true});onScopeDispose(()=>{scope?.stop()})}function useProxiedModel(props,prop,defaultValue,transformIn=v=>v,transformOut=v=>v){const vm=getCurrentInstance(`useProxiedModel`);const internal=ref(!isUndefined(props[prop])?props[prop]:defaultValue);const kebabProp=toKebabCase(prop);const isControlled=kebabProp!==prop?computed(()=>{props[prop];return!!((vm.vnode.props?.hasOwnProperty(prop)||vm.vnode.props?.hasOwnProperty(kebabProp))&&(vm.vnode.props?.hasOwnProperty(`onUpdate:${prop}`)||vm.vnode.props?.hasOwnProperty(`onUpdate:${kebabProp}`)))}):computed(()=>{props[prop];return!!(vm.vnode.props?.hasOwnProperty(prop)&&vm.vnode.props?.hasOwnProperty(`onUpdate:${prop}`))});useToggleScope(()=>!isControlled.value,()=>{watch(()=>props[prop],val=>{internal.value=val})});const model=computed({get(){const externalValue=props[prop];return transformIn(isControlled.value?externalValue:internal.value)},set(internalValue){const newValue=transformOut(internalValue);const value=toRaw(isControlled.value?props[prop]:internal.value);if(value===newValue||transformIn(value)===internalValue)return;internal.value=newValue;vm?.emit(`update:${prop}`,newValue)}});Object.defineProperty(model,"externalValue",{get:()=>isControlled.value?props[prop]:internal.value});return model}var en_default$15={badge:`Badge`,open:`Open`,close:`Close`,dismiss:`Dismiss`,confirmEdit:{ok:`OK`,cancel:`Cancel`},dataIterator:{noResultsText:`No matching records found`,loadingText:`Loading items...`},dataTable:{itemsPerPageText:`Rows per page:`,ariaLabel:{sortDescending:`Sorted descending.`,sortAscending:`Sorted ascending.`,sortNone:`Not sorted.`,activateNone:`Activate to remove sorting.`,activateDescending:`Activate to sort descending.`,activateAscending:`Activate to sort ascending.`,selectRow:`Select row`,selectAll:`Select all`,selectGroup:`Select group`},sortBy:`Sort by`},dataFooter:{itemsPerPageText:`Items per page:`,itemsPerPageAll:`All`,nextPage:`Next page`,prevPage:`Previous page`,firstPage:`First page`,lastPage:`Last page`,pageText:`{0}-{1} of {2}`},dateRangeInput:{divider:`to`},monthPicker:{title:`Select month`,itemsSelected:`{0} selected`,header:`Enter month`,range:{title:`Enter months`},ariaLabel:{previousYear:`Previous year`,nextYear:`Next year`,selectYear:`Select year`,currentMonth:`Current month, {0}`}},datePicker:{itemsSelected:`{0} selected`,range:{title:`Select dates`,header:`Enter dates`},title:`Select date`,header:`Enter date`,input:{placeholder:`Enter date`},ariaLabel:{previousMonth:`Previous month`,nextMonth:`Next month`,selectYear:`Select year`,previousYear:`Previous year`,nextYear:`Next year`,selectMonth:`Select month`,selectDate:`{0}`,currentDate:`Today, {0}`}},noDataText:`No data available`,carousel:{prev:`Previous visual`,next:`Next visual`,ariaLabel:{delimiter:`Carousel slide {0} of {1}`}},calendar:{moreEvents:`{0} more`,today:`Today`},heatmap:{less:`Less`,more:`More`},input:{clear:`Clear {0}`,prependAction:`{0} prepended action`,appendAction:`{0} appended action`,otp:`Enter verification code`},fileInput:{counter:`{0} files`,counterSize:`{0} files ({1} in total)`},fileUpload:{title:`Drag and drop files here`,divider:`or`,browse:`Browse Files`},timePicker:{am:`AM`,pm:`PM`,title:`Select Time`,hour:`Hour`,minute:`Minute`,second:`Second`,notAllowed:`Value is not allowed`},pagination:{ariaLabel:{root:`Pagination Navigation`,next:`Next page`,previous:`Previous page`,page:`Go to page {0}`,currentPage:`Page {0}, Current page`,first:`First page`,last:`Last page`}},stepper:{next:`Next`,prev:`Previous`},rating:{ariaLabel:{item:`Rating {0} of {1}`}},rangeSlider:{ariaLabel:{start:`Minimum`,end:`Maximum`}},splitBtn:{menu:`More options`},loading:`Loading...`,infiniteScroll:{loadMore:`Load more`,empty:`No more`},rules:{required:`This field is required`,email:`Please enter a valid email`,number:`This field can only contain numbers`,integer:`This field can only contain integer values`,capital:`This field can only contain uppercase letters`,maxLength:`You must enter a maximum of {0} characters`,minLength:`You must enter a minimum of {0} characters`,strictLength:`The length of the entered field is invalid`,exclude:`The {0} character is not allowed`,notEmpty:`Please choose at least one value`,pattern:`Invalid format`},command:{search:`Type a command or search...`},hotkey:{then:`then`,ctrl:`Ctrl`,command:`Command`,space:`Space`,shift:`Shift`,alt:`Alt`,enter:`Enter`,escape:`Escape`,upArrow:`Up Arrow`,downArrow:`Down Arrow`,leftArrow:`Left Arrow`,rightArrow:`Right Arrow`,backspace:`Backspace`,option:`Option`,plus:`plus`,shortcut:`Keyboard shortcut, {0}`,or:`or`},media:{play:`Play`,pause:`Pause`,seek:`Seek`,volume:`Volume`,mute:`Mute`,unmute:`Unmute`,enterFullscreen:`Full screen`,exitFullscreen:`Exit full screen`},colorPicker:{ariaLabel:{eyedropper:`Select color with eyedropper`,hueSlider:`Hue`,alphaSlider:`Alpha`,redInput:`Red value`,greenInput:`Green value`,blueInput:`Blue value`,alphaInput:`Alpha value`,hueInput:`Hue value`,saturationInput:`Saturation value`,lightnessInput:`Lightness value`,hexInput:`HEX value`,hexaInput:`HEX with alpha value`,changeFormat:`Change color format`}}};var LANG_PREFIX=`$vuetify.`;var replace=(str,params)=>{return str.replace(/\{(\d+)\}/g,(match,index)=>{return String(params[Number(index)])})};function selectLocale(bundle,locale){if(!bundle.has(locale))bundle.register({id:locale});if(bundle.selectedId.value!==locale)bundle.select(locale)}function createBundle(locale,fallbackLocale,catalogs){const bundle=createLocale$1({fallback:fallbackLocale,messages:catalogs});selectLocale(bundle,locale);return bundle}var createTranslateFunction=(current,fallback,messages)=>{let lastEditCount=0;const snapshot=computed(()=>({key:++lastEditCount,current:current.value,fallback:fallback.value,messages:JSON.parse(JSON.stringify(messages.value))}));let cache;const bundle=computed(()=>{const{key,current,fallback,messages}=snapshot.value;if(cache?.key!==key)cache={key,bundle:createBundle(current,fallback,messages)};return cache.bundle});return(key,...params)=>{if(!key.startsWith(LANG_PREFIX))return replace(key,params);const found=bundle.value.ti(key.slice(9),...params);if(!isString(found)){consoleError(`Translation key "${key}" not found in fallback`);return key}return found}};function createNumberFunction(current,fallback){return(value,options)=>{return new Intl.NumberFormat([current.value,fallback.value],options).format(value)}}function inferDecimalSeparator(current,fallback){return createNumberFunction(current,fallback)(.1).includes(`,`)?`,`:`.`}function inferNumericGroupSeparator(current,fallback){return new Intl.NumberFormat([current.value,fallback.value],{useGrouping:true}).formatToParts(1e4).find(p=>p.type===`group`)?.value??`\xA0`}function useProvided(props,prop,provided){const internal=useProxiedModel(props,prop,props[prop]??provided.value);internal.value=props[prop]??provided.value;watch(provided,v=>{if(props[prop]==null)internal.value=provided.value});return internal}function createProvideFunction(state){return props=>{const current=useProvided(props,`locale`,state.current);const fallback=useProvided(props,`fallback`,state.fallback);const messages=useProvided(props,`messages`,state.messages);return{name:`vuetify`,current,fallback,messages,decimalSeparator:toRef(()=>inferDecimalSeparator(current,fallback)),numericGroupSeparator:toRef(()=>inferNumericGroupSeparator(current,fallback)),t:createTranslateFunction(current,fallback,messages),n:createNumberFunction(current,fallback),provide:createProvideFunction({current,fallback,messages})}}}function createVuetifyAdapter(options){const current=shallowRef(options?.locale??`en`);const fallback=shallowRef(options?.fallback??`en`);const messages=ref({en:en_default$15,...options?.messages});return{name:`vuetify`,current,fallback,messages,decimalSeparator:toRef(()=>options?.decimalSeparator??inferDecimalSeparator(current,fallback)),numericGroupSeparator:toRef(()=>options?.numericGroupSeparator??inferNumericGroupSeparator(current,fallback)),t:createTranslateFunction(current,fallback,messages),n:createNumberFunction(current,fallback),provide:createProvideFunction({current,fallback,messages})}}var LocaleSymbol=Symbol.for(`vuetify:locale`);function createLocale(options){const i18n=options?.adapter?.name?options.adapter:createVuetifyAdapter(options);const rtl=createRtl(i18n,options);return{...i18n,...rtl}}function useLocale(){const locale=inject$1(LocaleSymbol);if(!locale)throw new Error(`[Vuetify] Could not find injected locale instance`);return locale}function genDefaults$2(){return{af:false,ar:true,bg:false,ca:false,ckb:true,cs:false,de:false,el:false,en:false,es:false,et:false,fa:true,fi:false,fr:false,hr:false,hu:false,he:true,id:false,it:false,ja:false,km:false,ko:false,lv:false,lt:false,nl:false,no:false,pl:false,pt:false,ro:false,ru:false,sk:false,sl:false,srCyrl:false,srLatn:false,sv:false,th:false,tr:false,az:false,uk:false,vi:false,zhHans:false,zhHant:false}}function createRtl(i18n,options){const rtl=ref(options?.rtl?{...options.rtl}:genDefaults$2());const direction=createRtl$1();watch(()=>rtl.value[i18n.current.value]??false,value=>{direction.isRtl.value=value},{flush:`sync`,immediate:true});return{isRtl:readonly(direction.isRtl),rtl,rtlClasses:toRef(()=>`v-locale--is-${direction.isRtl.value?`rtl`:`ltr`}`)}}function useRtl(){const locale=inject$1(LocaleSymbol);if(!locale)throw new Error(`[Vuetify] Could not find injected rtl instance`);return{isRtl:locale.isRtl,rtlClasses:locale.rtlClasses}}function weekInfo(locale){const code=locale.slice(-2).toUpperCase();switch(true){case locale===`GB-alt-variant`:return{firstDay:0,firstWeekSize:4};case locale===`001`:return{firstDay:1,firstWeekSize:1};case`AG AS BD BR BS BT BW BZ CA CO DM DO ET GT GU HK HN ID IL IN JM JP KE
|
|
4
4
|
KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PY SA SG SV TH TT TW UM US
|
|
5
5
|
VE VI WS YE ZA ZW`.includes(code):return{firstDay:0,firstWeekSize:1};case`AI AL AM AR AU AZ BA BM BN BY CL CM CN CR CY EC GE HR KG KZ LB LK LV
|
|
6
6
|
MD ME MK MN MY NZ RO RS SI TJ TM TR UA UY UZ VN XK`.includes(code):return{firstDay:1,firstWeekSize:1};case`AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GP GR HU IE IS
|
|
@@ -92,7 +92,7 @@ registerProcessor("${CAPTURE_WORKLET_NAME}", AssistantVoiceCapture);
|
|
|
92
92
|
`)}),{default:withCtx(()=>[goal.value?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass([`assistant-goal__light`,{"assistant-goal__light--running":running.value,"assistant-goal__light--paused":[`paused`,`usageLimited`].includes(goal.value.status)}]),"aria-hidden":`true`},null,2)):createCommentVNode(``,true),createBaseVNode(`span`,_hoisted_1$69,toDisplayString(chipLabel.value),1),elapsed.value&&running.value?(openBlock(),createElementBlock(`span`,_hoisted_2$59,toDisplayString(elapsed.value),1)):createCommentVNode(``,true)]),_:1},16,[`aria-label`,`title`])]),default:withCtx(()=>[createVNode(VCard,{class:`assistant-goal__details pa-3`},{default:withCtx(()=>[createBaseVNode(`strong`,_hoisted_3$51,toDisplayString(label.value),1),(active.value||__props.state.pauseBlocked&&[`blocked`,`usageLimited`].includes(goal.value?.status))&&__props.state.pause?(openBlock(),createBlock(VBtn,{key:0,size:`small`,disabled:__props.state.stopPending,onClick:_cache[0]||(_cache[0]=$event=>__props.state.pause())},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.state.action===`pause`?unref(t)(`jskit.assistant.goal.pausing`):unref(t)(`jskit.assistant.goal.pause`)),1)]),_:1},8,[`disabled`])):createCommentVNode(``,true),[`paused`,`blocked`,`usageLimited`].includes(goal.value?.status)&&__props.state.resume?(openBlock(),createBlock(VBtn,{key:1,size:`small`,disabled:__props.state.pending,onClick:_cache[1]||(_cache[1]=$event=>__props.state.resume())},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.state.action===`resume`?unref(t)(`jskit.assistant.goal.resuming`):unref(t)(`jskit.assistant.goal.resume`)),1)]),_:1},8,[`disabled`])):createCommentVNode(``,true),goal.value&&goal.value.status!==`complete`&&__props.state.cancel?(openBlock(),createBlock(VBtn,{key:2,color:`error`,size:`small`,variant:`text`,disabled:__props.state.stopPending,onClick:cancelGoal},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.state.action===`cancel`?unref(t)(`jskit.assistant.goal.cancelling`):unref(t)(`jskit.assistant.goal.cancel`)),1)]),_:1},8,[`disabled`])):createCommentVNode(``,true),goal.value?(openBlock(),createElementBlock(`p`,_hoisted_4$41,toDisplayString(goal.value.objective),1)):createCommentVNode(``,true),goal.value?.reason?(openBlock(),createElementBlock(`p`,_hoisted_5$39,toDisplayString(goal.value.reason),1)):createCommentVNode(``,true),elapsed.value?(openBlock(),createElementBlock(`p`,_hoisted_6$34,toDisplayString(elapsedText.value),1)):createCommentVNode(``,true),active.value&&!running.value?(openBlock(),createElementBlock(`p`,_hoisted_7$33,toDisplayString(unref(t)(`jskit.assistant.goal.notRunningHint`)),1)):createCommentVNode(``,true),limitHint.value?(openBlock(),createElementBlock(`p`,_hoisted_8$31,toDisplayString(limitHint.value),1)):createCommentVNode(``,true),active.value||goal.value?.status===`paused`?(openBlock(),createElementBlock(`p`,_hoisted_9$30,toDisplayString(__props.state.pauseInterruptsTurn?unref(t)(`jskit.assistant.goal.pauseInterruptsTurn`):unref(t)(`jskit.assistant.goal.pausePreventsTurns`)),1)):createCommentVNode(``,true),goal.value&&goal.value.status!==`complete`&&__props.state.cancel?(openBlock(),createElementBlock(`p`,_hoisted_10$25,toDisplayString(__props.state.cancelInterruptsTurn?unref(t)(`jskit.assistant.goal.cancelInterruptsTurn`):unref(t)(`jskit.assistant.goal.cancelRemovesGoal`)),1)):createCommentVNode(``,true),canSet.value?(openBlock(),createElementBlock(`form`,{key:10,class:`assistant-goal__form mt-2`,onSubmit:withModifiers(setGoal,[`prevent`])},[createVNode(VTextarea,{modelValue:objective.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>objective.value=$event),label:unref(t)(`jskit.assistant.goal.objective`),rows:`2`,"max-rows":`4`,maxlength:`4000`,"auto-grow":``,disabled:__props.state.pending,"hide-details":``},null,8,[`modelValue`,`label`,`disabled`]),__props.state.tokenBudgetSupported!==false?(openBlock(),createBlock(VTextField,{key:0,modelValue:tokenBudget.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>tokenBudget.value=$event),label:unref(t)(`jskit.assistant.goal.tokenBudget`),type:`number`,min:`1`,step:`1`,disabled:__props.state.pending,error:!validBudget.value,"hide-details":``},null,8,[`modelValue`,`label`,`disabled`,`error`])):createCommentVNode(``,true),createVNode(VBtn,{type:`submit`,size:`small`,disabled:__props.state.pending||!objective.value.trim()||!validBudget.value},{default:withCtx(()=>[createTextVNode(toDisplayString(starting.value?unref(t)(`jskit.assistant.goal.starting`):unref(t)(`jskit.assistant.goal.start`)),1)]),_:1},8,[`disabled`])],32)):createCommentVNode(``,true),__props.state.error?(openBlock(),createElementBlock(`p`,_hoisted_11$22,toDisplayString(__props.state.error),1)):createCommentVNode(``,true),renderSlot(_ctx.$slots,`default`,{goal:goal.value},void 0,true)]),_:3})]),_:3},8,[`modelValue`])):createCommentVNode(``,true)}}};var AssistantGoalControl_default=_plugin_vue_export_helper_default(_sfc_main$93,[[`__scopeId`,`data-v-955a8a73`]]);var{t:t$27}=useJskitText();var activePhases=new Set([`queued`,`preparing`,`uploading`,`delivering`]);function itemKey(item={}){return String(item.clientId||item.id||item.attachmentId||item.fileName||`attachment`)}function itemName(item={}){return String(item.fileName||item.file?.name||t$27(`jskit.assistant.attachments.unnamed`))}function itemPhase(item={}){return String(item.phase||item.status||`queued`)}function itemPercent(item={}){if(itemPhase(item)===`ready`)return 100;if(itemPhase(item)===`delivering`)return 100;if(itemPhase(item)===`queued`)return 0;const progressValue=item.percent??item.progress;const directPercent=progressValue===null||progressValue===void 0||progressValue===``?null:Number(progressValue);if(directPercent!==null&&Number.isFinite(directPercent))return Math.min(100,Math.max(0,Math.round(directPercent)));const size=Number(item.size)||0;return size>0&&Number(item.bytesSent)>0?Math.min(100,Math.max(0,Math.round((Number(item.bytesSent)||0)/size*100))):null}function itemProgressVisible(item={}){return activePhases.has(itemPhase(item))}function itemProgressIndeterminate(item={}){return itemProgressVisible(item)&&itemPercent(item)===null}function itemProgressValue(item={}){return itemPercent(item)??0}function itemBytesLabel(item={}){const size=Math.max(0,Number(item.size)||0);const sent=Math.min(Math.max(0,Number(item.bytesSent)||0),size);const percent=itemPercent(item);return percent===null?t$27(`jskit.assistant.attachments.bytes`,{sent:attachmentSizeText(sent),size:attachmentSizeText(size)}):t$27(`jskit.assistant.attachments.bytesPercent`,{sent:attachmentSizeText(sent),size:attachmentSizeText(size),percent})}function itemStatusLabel(item={}){const labels={cancelled:`jskit.assistant.attachments.status.cancelled`,delivering:`jskit.assistant.attachments.status.delivering`,failed:item.failureStage===`preparing`?`jskit.assistant.attachments.status.preparationFailed`:item.failureStage===`handoff`?`jskit.assistant.attachments.status.sendingFailed`:`jskit.assistant.attachments.status.uploadFailed`,preparing:`jskit.assistant.attachments.status.preparing`,queued:`jskit.assistant.attachments.status.queued`,ready:`jskit.assistant.attachments.status.ready`,uploading:`jskit.assistant.attachments.status.uploading`};return t$27(Object.hasOwn(labels,itemPhase(item))?labels[itemPhase(item)]:`jskit.assistant.attachments.status.queued`)}function itemCancelable(item={}){return[`preparing`,`queued`,`uploading`].includes(itemPhase(item))}function itemIcon(item={}){if(itemPhase(item)===`ready`)return`$checkCircle`;if(itemPhase(item)===`failed`)return`$error`;return`$description`}function itemColor(item={}){if(itemPhase(item)===`ready`)return`success`;if(itemPhase(item)===`failed`)return`error`;return`primary`}var _hoisted_1$68=[`aria-busy`,`aria-label`];var _hoisted_2$58={class:`assistant-attachment-queue__summary`};var _hoisted_3$50={class:`assistant-attachment-queue__limit`};var _hoisted_4$40={class:`assistant-attachment-queue__items`};var _hoisted_5$38={class:`assistant-attachment-queue__content`};var _hoisted_6$33={class:`assistant-attachment-queue__primary`};var _hoisted_7$32={class:`assistant-attachment-queue__size`};var _hoisted_8$30={class:`assistant-attachment-queue__secondary`};var _hoisted_9$29={key:0};var _hoisted_10$24={key:0,"aria-hidden":`true`,class:`assistant-attachment-queue__progress assistant-attachment-queue__progress--stationary rounded-pill`};var _hoisted_11$21={key:2,class:`assistant-attachment-queue__error`,role:`alert`};var _hoisted_12$20={class:`assistant-attachment-queue__actions`};var _hoisted_13$19={class:`assistant-attachment-queue__announcement`,"aria-atomic":`true`,"aria-live":`polite`,role:`status`};var _sfc_main$92={__name:`AssistantAttachmentQueue`,props:{previewEnabled:Boolean,items:{default:()=>[],type:Array},joined:{default:true,type:Boolean},maximumFiles:{default:10,type:Number}},emits:[`cancel`,`remove`,`retry`,`preview`,`focus-input`],setup(__props,{emit:__emit}){const{t}=useJskitText();const emit=__emit;const props=__props;const queueRoot=ref(null);const reducedMotion=ref(false);const actionElements=new Map;let reducedMotionMediaQuery=null;const retainedItems=computed(()=>props.items.filter(item=>itemPhase(item)!==`cancelled`));const completedCount=computed(()=>props.items.filter(item=>itemPhase(item)===`ready`).length);const hasUnresolved=computed(()=>props.items.some(item=>activePhases.has(itemPhase(item))));const aggregatePercent=computed(()=>{if(!retainedItems.value.length)return 0;const totalSize=retainedItems.value.reduce((sum,item)=>sum+Math.max(0,Number(item.size)||0),0);if(retainedItems.value.some(item=>activePhases.has(itemPhase(item))&&itemPercent(item)===null))return null;if(totalSize<1)return Math.round(completedCount.value/retainedItems.value.length*100);const sent=retainedItems.value.reduce((sum,item)=>{if(itemPhase(item)===`ready`)return sum+Math.max(0,Number(item.size)||0);return sum+Math.min(Math.max(0,Number(item.bytesSent)||0),Math.max(0,Number(item.size)||0))},0);return Math.min(100,Math.max(0,Math.round(sent/totalSize*100)))});const aggregateLabel=computed(()=>{const total=retainedItems.value.length;const active=props.items.filter(item=>activePhases.has(itemPhase(item))).length;const failed=props.items.filter(item=>itemPhase(item)===`failed`).length;const cancelled=props.items.filter(item=>itemPhase(item)===`cancelled`).length;if(active)return aggregatePercent.value===null?t(`jskit.assistant.attachments.summary.inProgress`,{completed:completedCount.value,total}):t(`jskit.assistant.attachments.summary.percent`,{completed:completedCount.value,total,percent:aggregatePercent.value});if(failed)return t(`jskit.assistant.attachments.summary.needAttention`,{completed:completedCount.value,total,count:failed});if(cancelled)return t(`jskit.assistant.attachments.summary.cancelled`,{completed:completedCount.value,cancelled});return t(`jskit.assistant.attachments.summary.ready`,{completed:completedCount.value,total})});const announcement=computed(()=>{const messages=[];const failed=props.items.filter(item=>itemPhase(item)===`failed`).length;if(failed)messages.push(t(`jskit.assistant.attachments.announcement.needAttention`,{count:failed}));const active=props.items.filter(item=>activePhases.has(itemPhase(item))).length;if(active)messages.push(t(`jskit.assistant.attachments.announcement.inProgress`,{count:active}));const cancelled=props.items.filter(item=>itemPhase(item)===`cancelled`).length;if(cancelled)messages.push(t(`jskit.assistant.attachments.announcement.cancelled`,{count:cancelled}));if(completedCount.value)messages.push(t(`jskit.assistant.attachments.announcement.ready`,{count:completedCount.value}));return messages.join(` `)});function itemProgressStationary(item={}){return reducedMotion.value&&itemProgressVisible(item)&&itemPercent(item)===null}function actionKey(item={},action=``){return`${itemKey(item)}:${action}`}function actionElement(element=null){return element?.$el||null}function setActionElement(item={},action=``,element=null){const key=actionKey(item,action);if(element){actionElements.set(key,element);return}actionElements.delete(key)}function focusItemAction(item={}){for(const action of[`cancel`,`retry`,`remove`]){const target=actionElement(actionElements.get(actionKey(item,action)));if(target&&!target.disabled){target.focus();return true}}return false}async function handleAction(action,item,index){emit(action,item);await nextTick$1();const retainedItem=props.items.find(candidate=>itemKey(candidate)===itemKey(item));if(retainedItem&&focusItemAction(retainedItem))return;const neighbour=props.items[index]||props.items[index-1];if(neighbour&&focusItemAction(neighbour))return;emit(`focus-input`)}function updateReducedMotionPreference(){reducedMotion.value=reducedMotionMediaQuery?.matches===true}if(hasWindowFunction$2(`matchMedia`)){reducedMotionMediaQuery=window.matchMedia(`(prefers-reduced-motion: reduce)`);updateReducedMotionPreference()}const mediaQueryDispatchesEvents=typeof reducedMotionMediaQuery?.addEventListener===`function`;onMounted(()=>{if(!reducedMotionMediaQuery)return;if(mediaQueryDispatchesEvents)reducedMotionMediaQuery.addEventListener(`change`,updateReducedMotionPreference);else reducedMotionMediaQuery.addListener(updateReducedMotionPreference)});onBeforeUnmount(()=>{if(mediaQueryDispatchesEvents)reducedMotionMediaQuery.removeEventListener(`change`,updateReducedMotionPreference);else reducedMotionMediaQuery?.removeListener(updateReducedMotionPreference);reducedMotionMediaQuery=null});return(_ctx,_cache)=>{return __props.items.length?(openBlock(),createElementBlock(`section`,{key:0,ref_key:`queueRoot`,ref:queueRoot,class:normalizeClass([`assistant-attachment-queue`,{"assistant-attachment-queue--standalone":!__props.joined}]),"aria-busy":hasUnresolved.value?`true`:void 0,"aria-label":unref(t)(`jskit.assistant.attachments.queue`)},[createBaseVNode(`header`,_hoisted_2$58,[createBaseVNode(`span`,null,toDisplayString(aggregateLabel.value),1),createBaseVNode(`span`,_hoisted_3$50,toDisplayString(unref(t)(`jskit.assistant.attachments.limit`,{count:retainedItems.value.length,max:__props.maximumFiles})),1)]),createBaseVNode(`ol`,_hoisted_4$40,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.items,(item,index)=>{return openBlock(),createElementBlock(`li`,{key:unref(itemKey)(item),class:normalizeClass([`assistant-attachment-queue__item`,`assistant-attachment-queue__item--${unref(itemPhase)(item)}`])},[createVNode(VIcon,{class:`assistant-attachment-queue__icon`,color:unref(itemColor)(item),icon:unref(itemIcon)(item),size:`18`,"aria-hidden":`true`},null,8,[`color`,`icon`]),createBaseVNode(`div`,_hoisted_5$38,[createBaseVNode(`div`,_hoisted_6$33,[(openBlock(),createBlock(resolveDynamicComponent(item.attachmentId&&__props.previewEnabled?`button`:`span`),{type:item.attachmentId&&__props.previewEnabled?`button`:void 0,class:`assistant-attachment-queue__name`,title:unref(itemName)(item),onClick:$event=>item.attachmentId&&__props.previewEnabled&&emit(`preview`,item.receipt||item)},{default:withCtx(()=>[createTextVNode(toDisplayString(item.receipt?.reference)+` `+toDisplayString(unref(itemName)(item)),1)]),_:2},1032,[`type`,`title`,`onClick`])),createBaseVNode(`span`,_hoisted_7$32,toDisplayString(unref(attachmentSizeText)(item.size)),1)]),createBaseVNode(`div`,_hoisted_8$30,[createBaseVNode(`span`,null,toDisplayString(unref(itemStatusLabel)(item)),1),unref(itemProgressVisible)(item)?(openBlock(),createElementBlock(`span`,_hoisted_9$29,toDisplayString(unref(itemBytesLabel)(item)),1)):createCommentVNode(``,true)]),itemProgressStationary(item)?(openBlock(),createElementBlock(`div`,_hoisted_10$24)):unref(itemProgressVisible)(item)?(openBlock(),createBlock(VProgressLinear,{key:1,"aria-label":unref(t)(`jskit.assistant.attachments.uploadProgress`,{name:unref(itemName)(item)}),class:`assistant-attachment-queue__progress`,color:`primary`,height:`3`,indeterminate:unref(itemProgressIndeterminate)(item),"model-value":unref(itemProgressValue)(item),rounded:``},null,8,[`aria-label`,`indeterminate`,`model-value`])):createCommentVNode(``,true),item.error?(openBlock(),createElementBlock(`span`,_hoisted_11$21,toDisplayString(item.error),1)):createCommentVNode(``,true)]),createBaseVNode(`div`,_hoisted_12$20,[unref(itemCancelable)(item)?(openBlock(),createBlock(VBtn,{key:0,ref_for:true,ref:element=>setActionElement(item,`cancel`,element),"aria-label":unref(t)(`jskit.assistant.attachments.cancelItem`,{name:unref(itemName)(item)}),class:`assistant-attachment-queue__action`,icon:`$cancel`,size:`small`,title:unref(t)(`jskit.assistant.attachments.cancelItem`,{name:unref(itemName)(item)}),type:`button`,variant:`text`,onClick:$event=>handleAction(`cancel`,item,index)},null,8,[`aria-label`,`title`,`onClick`])):createCommentVNode(``,true),unref(itemPhase)(item)===`failed`||unref(itemPhase)(item)===`cancelled`?(openBlock(),createBlock(VBtn,{key:1,ref_for:true,ref:element=>setActionElement(item,`retry`,element),"aria-label":unref(t)(`jskit.assistant.attachments.retryItem`,{name:unref(itemName)(item)}),class:`assistant-attachment-queue__action`,icon:`$refresh`,size:`small`,title:unref(t)(`jskit.assistant.attachments.retryItem`,{name:unref(itemName)(item)}),type:`button`,variant:`text`,onClick:$event=>handleAction(`retry`,item,index)},null,8,[`aria-label`,`title`,`onClick`])):createCommentVNode(``,true),unref(itemPhase)(item)===`ready`||unref(itemPhase)(item)===`failed`||unref(itemPhase)(item)===`cancelled`?(openBlock(),createBlock(VBtn,{key:2,ref_for:true,ref:element=>setActionElement(item,`remove`,element),"aria-label":unref(t)(`jskit.assistant.attachments.removeItem`,{name:unref(itemName)(item)}),class:`assistant-attachment-queue__action`,icon:`$close`,size:`small`,title:unref(t)(`jskit.assistant.attachments.removeItem`,{name:unref(itemName)(item)}),type:`button`,variant:`text`,onClick:$event=>handleAction(`remove`,item,index)},null,8,[`aria-label`,`title`,`onClick`])):createCommentVNode(``,true)])],2)}),128))]),createBaseVNode(`span`,_hoisted_13$19,toDisplayString(announcement.value),1)],10,_hoisted_1$68)):createCommentVNode(``,true)}}};var AssistantAttachmentQueue_default=_plugin_vue_export_helper_default(_sfc_main$92,[[`__scopeId`,`data-v-5a2e2256`]]);var _hoisted_1$67=[`aria-label`];var _hoisted_2$57={class:`assistant-questions__question-fields-header`};var _hoisted_3$49=[`aria-label`];var _sfc_main$91={__name:`AssistantQuestionInputs`,props:mergeModels({questions:{type:Array,default:()=>[]},selectItems:{type:Object,default:()=>({})},choices:{type:Array,default:()=>[]}},{"answers":{type:Object,default:()=>({})},"answersModifiers":{},"choice":{type:String,default:``},"choiceModifiers":{}}),emits:mergeModels([`dismiss`],[`update:answers`,`update:choice`]),setup(__props,{emit:__emit}){const{t}=useJskitText();const answers=useModel(__props,`answers`);const choice=useModel(__props,`choice`);const emit=__emit;return(_ctx,_cache)=>{return __props.questions.length?(openBlock(),createElementBlock(`div`,{key:0,class:`assistant-questions__question-fields`,"aria-label":unref(t)(`jskit.assistant.questions.label`)},[createBaseVNode(`div`,_hoisted_2$57,[createVNode(VBtn,{"aria-label":unref(t)(`jskit.assistant.questions.answerNormally`),class:`ml-auto`,color:`primary`,"prepend-icon":`$edit`,size:`small`,variant:`tonal`,onClick:_cache[0]||(_cache[0]=$event=>emit(`dismiss`))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.questions.answerNormally`)),1)]),_:1},8,[`aria-label`])]),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.questions,question=>{return openBlock(),createElementBlock(`div`,{key:question.name,class:`assistant-questions__question-field`},[question.choices.length?(openBlock(),createBlock(VSelect,{key:0,"model-value":answers.value[question.name],"onUpdate:modelValue":$event=>answers.value={...answers.value,[question.name]:$event},class:`assistant-questions__question-select`,density:`compact`,"hide-details":`auto`,"item-title":`selectLabel`,"item-value":`value`,items:__props.selectItems[question.name]||question.choices,label:unref(t)(`jskit.assistant.questions.fieldLabel`,{number:question.number,label:question.label}),title:question.label,variant:`outlined`},null,8,[`model-value`,`onUpdate:modelValue`,`items`,`label`,`title`])):(openBlock(),createBlock(VTextField,{key:1,"model-value":answers.value[question.name],"onUpdate:modelValue":$event=>answers.value={...answers.value,[question.name]:$event},autocomplete:`off`,density:`compact`,"hide-details":`auto`,label:unref(t)(`jskit.assistant.questions.fieldLabel`,{number:question.number,label:question.label}),title:question.label,variant:`outlined`},null,8,[`model-value`,`onUpdate:modelValue`,`label`,`title`]))])}),128))],8,_hoisted_1$67)):__props.choices.length?(openBlock(),createElementBlock(`div`,{key:1,class:`assistant-questions__answer-choices`,"aria-label":unref(t)(`jskit.assistant.questions.suggestedAnswers`)},[createVNode(VChipGroup,{modelValue:choice.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>choice.value=$event),column:``,"selected-class":`text-primary`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.choices,option=>{return openBlock(),createBlock(VChip,{key:option.value,filter:``,value:option.value,variant:`outlined`},{default:withCtx(()=>[createTextVNode(toDisplayString(option.label),1)]),_:2},1032,[`value`])}),128))]),_:1},8,[`modelValue`])],8,_hoisted_3$49)):createCommentVNode(``,true)}}};var AssistantQuestionInputs_default=_plugin_vue_export_helper_default(_sfc_main$91,[[`__scopeId`,`data-v-cb7844a3`]]);var _hoisted_1$66={class:`assistant-model-control__header`};var _hoisted_2$56={class:`text-title-small`};var _hoisted_3$48={class:`text-body-small`};var _hoisted_4$39=[`aria-label`];var _hoisted_5$37={key:2,class:`assistant-model-control__state`,role:`alert`};var _hoisted_6$32={key:3,class:`assistant-model-control__state`,role:`status`};var _hoisted_7$31={key:4,class:`assistant-model-control__choices`};var _hoisted_8$29=[`aria-label`];var _hoisted_9$28={class:`assistant-model-control__label`};var _hoisted_10$23={class:`assistant-model-control__options`};var _hoisted_11$20=[`aria-label`];var _hoisted_12$19={class:`assistant-model-control__label`};var _hoisted_13$18={key:1,class:`assistant-model-control__options`};var _hoisted_14$15={key:2,class:`assistant-model-control__empty`};var _hoisted_15$14=[`aria-label`];var _hoisted_16$12={class:`assistant-model-control__label`};var _hoisted_17$12={class:`assistant-model-control__options`};var _hoisted_18$12={class:`assistant-model-control__actions`};var _sfc_main$90={__name:`AssistantModelControl`,props:mergeModels({providerRows:{type:Array,default:()=>[]},modelRows:{type:Array,default:()=>[]},variantRows:{type:Array,default:()=>[]},modelProviderId:{type:String,default:``},modelId:{type:String,default:``},variantId:{type:String,default:``},selectionSummary:{type:String,default:``},buttonTitle:{type:String,default:void 0},changesDisabled:Boolean,saving:Boolean,canSave:Boolean,catalogLoading:Boolean,catalogError:{type:String,default:``}},{"modelValue":{type:Boolean,default:false},"modelModifiers":{}}),emits:mergeModels([`select-provider`,`select-model`,`select-variant`,`apply`,`reload`],[`update:modelValue`]),setup(__props,{emit:__emit}){const{t}=useJskitText();const menuOpen=useModel(__props,`modelValue`);const props=__props;const emit=__emit;function selectProvider(value){if(!props.changesDisabled&&!props.saving)emit(`select-provider`,value)}function selectModel(value){if(!props.changesDisabled&&!props.saving)emit(`select-model`,value)}function selectVariant(value){if(!props.changesDisabled&&!props.saving)emit(`select-variant`,value)}return(_ctx,_cache)=>{return openBlock(),createBlock(VMenu,{modelValue:menuOpen.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>menuOpen.value=$event),"close-on-content-click":false,location:`top start`,transition:`scale-transition`},{activator:withCtx(({props:menuProps})=>[createVNode(VBtn,mergeProps(menuProps,{"aria-label":unref(t)(`jskit.assistant.model.chooseAi`),class:`assistant-model-control__button`,density:`comfortable`,icon:`$settings`,rounded:`lg`,size:`small`,title:__props.buttonTitle??unref(t)(`jskit.assistant.model.chooseAi`),type:`button`,variant:`tonal`}),null,16,[`aria-label`,`title`])]),default:withCtx(()=>[createVNode(VSheet,{"aria-label":unref(t)(`jskit.assistant.model.selector`),class:`assistant-model-control`,color:`surface-container`,elevation:2,rounded:`xl`},{default:withCtx(()=>[createBaseVNode(`header`,_hoisted_1$66,[createVNode(VAvatar,{color:`primary`,size:`36`,variant:`tonal`},{default:withCtx(()=>[createVNode(VIcon,{icon:`$psychology`,size:`20`})]),_:1}),createBaseVNode(`div`,null,[createBaseVNode(`strong`,_hoisted_2$56,toDisplayString(unref(t)(`jskit.assistant.model.controls`)),1),createBaseVNode(`span`,_hoisted_3$48,toDisplayString(__props.selectionSummary),1)])]),__props.changesDisabled?(openBlock(),createBlock(VSheet,{key:0,class:`assistant-model-control__view-only`,rounded:`lg`,role:`status`},{default:withCtx(()=>[createVNode(VIcon,{icon:`$schedule`,size:`18`}),createBaseVNode(`span`,null,toDisplayString(unref(t)(`jskit.assistant.model.viewOnly`)),1)]),_:1})):createCommentVNode(``,true),__props.catalogLoading?(openBlock(),createElementBlock(`div`,{key:1,"aria-label":unref(t)(`jskit.assistant.model.loading`),class:`assistant-model-control__loading`},[createVNode(VSkeletonLoader,{type:`text, chip@4, text, chip@4`})],8,_hoisted_4$39)):__props.catalogError?(openBlock(),createElementBlock(`div`,_hoisted_5$37,[createBaseVNode(`span`,null,toDisplayString(__props.catalogError),1),createVNode(VBtn,{size:`small`,variant:`text`,onClick:_cache[0]||(_cache[0]=$event=>emit(`reload`))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.model.tryAgain`)),1)]),_:1})])):!__props.providerRows.length?(openBlock(),createElementBlock(`div`,_hoisted_6$32,toDisplayString(unref(t)(`jskit.assistant.model.noneConfigured`)),1)):(openBlock(),createElementBlock(`div`,_hoisted_7$31,[renderSlot(_ctx.$slots,`before-choices`,{},void 0,true),__props.providerRows.length>1?(openBlock(),createElementBlock(`section`,{key:0,"aria-label":unref(t)(`jskit.assistant.model.provider`),class:`assistant-model-control__section`},[createBaseVNode(`div`,_hoisted_9$28,toDisplayString(unref(t)(`jskit.assistant.model.provider`)),1),createBaseVNode(`div`,_hoisted_10$23,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.providerRows,provider=>{return openBlock(),createBlock(VBtn,{key:provider.id,active:__props.modelProviderId===provider.id,"aria-pressed":__props.modelProviderId===provider.id,class:`assistant-model-control__option`,color:__props.modelProviderId===provider.id?`primary`:void 0,disabled:__props.changesDisabled||__props.saving,rounded:`lg`,size:`small`,type:`button`,variant:__props.modelProviderId===provider.id?`tonal`:`outlined`,onClick:$event=>selectProvider(provider.id)},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(provider.label),1),__props.modelProviderId===provider.id?(openBlock(),createBlock(VIcon,{key:0,icon:`$check`,size:`15`})):createCommentVNode(``,true)]),_:2},1032,[`active`,`aria-pressed`,`color`,`disabled`,`variant`,`onClick`])}),128))])],8,_hoisted_8$29)):createCommentVNode(``,true),createBaseVNode(`section`,{"aria-label":unref(t)(`jskit.assistant.model.model`),class:`assistant-model-control__section`},[createBaseVNode(`div`,_hoisted_12$19,toDisplayString(unref(t)(`jskit.assistant.model.model`)),1),__props.modelRows.length>6?(openBlock(),createBlock(VAutocomplete,{key:0,"auto-select-first":`exact`,"hide-details":``,disabled:__props.changesDisabled||__props.saving,items:__props.modelRows,"item-title":`label`,"item-value":`id`,label:unref(t)(`jskit.assistant.model.chooseModel`),"model-value":__props.modelId,"no-data-text":unref(t)(`jskit.assistant.model.noMatchingModels`),variant:`outlined`,"onUpdate:modelValue":selectModel},null,8,[`disabled`,`items`,`label`,`model-value`,`no-data-text`])):__props.modelRows.length?(openBlock(),createElementBlock(`div`,_hoisted_13$18,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.modelRows,model=>{return openBlock(),createBlock(VBtn,{key:model.id,active:__props.modelId===model.id,"aria-label":model.label,"aria-pressed":__props.modelId===model.id,class:`assistant-model-control__option`,color:__props.modelId===model.id?`primary`:void 0,disabled:__props.changesDisabled||__props.saving,rounded:`lg`,size:`small`,title:__props.changesDisabled?unref(t)(`jskit.assistant.model.waitBeforeChanging`):model.label,type:`button`,variant:__props.modelId===model.id?`tonal`:`outlined`,onClick:$event=>selectModel(model.id)},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(model.label),1),__props.modelId===model.id?(openBlock(),createBlock(VIcon,{key:0,icon:`$check`,size:`15`})):createCommentVNode(``,true)]),_:2},1032,[`active`,`aria-label`,`aria-pressed`,`color`,`disabled`,`title`,`variant`,`onClick`])}),128))])):(openBlock(),createElementBlock(`span`,_hoisted_14$15,toDisplayString(unref(t)(`jskit.assistant.model.noModels`)),1)),renderSlot(_ctx.$slots,`model-note`,{},void 0,true)],8,_hoisted_11$20),renderSlot(_ctx.$slots,`provider-controls`,{},void 0,true),__props.variantRows.length>1?(openBlock(),createElementBlock(`section`,{key:1,"aria-label":unref(t)(`jskit.assistant.model.thinking`),class:`assistant-model-control__section`},[createBaseVNode(`div`,_hoisted_16$12,toDisplayString(unref(t)(`jskit.assistant.model.thinking`)),1),createBaseVNode(`div`,_hoisted_17$12,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.variantRows,variant=>{return openBlock(),createBlock(VBtn,{key:variant.id||`automatic`,active:__props.variantId===variant.id,"aria-pressed":__props.variantId===variant.id,class:`assistant-model-control__option`,color:__props.variantId===variant.id?`primary`:void 0,disabled:__props.changesDisabled||__props.saving,rounded:`lg`,size:`small`,type:`button`,variant:__props.variantId===variant.id?`tonal`:`outlined`,onClick:$event=>selectVariant(variant.id)},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(variant.label),1),__props.variantId===variant.id?(openBlock(),createBlock(VIcon,{key:0,icon:`$check`,size:`15`})):createCommentVNode(``,true)]),_:2},1032,[`active`,`aria-pressed`,`color`,`disabled`,`variant`,`onClick`])}),128))])],8,_hoisted_15$14)):createCommentVNode(``,true)])),createBaseVNode(`footer`,_hoisted_18$12,[renderSlot(_ctx.$slots,`footer`,{},void 0,true),_cache[3]||(_cache[3]=createBaseVNode(`span`,null,null,-1)),createVNode(VBtn,{color:`primary`,disabled:!__props.canSave||__props.saving,size:`small`,variant:`flat`,onClick:_cache[1]||(_cache[1]=$event=>emit(`apply`))},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.saving?unref(t)(`jskit.assistant.model.applying`):unref(t)(`jskit.assistant.model.apply`)),1)]),_:1},8,[`disabled`])])]),_:3},8,[`aria-label`])]),_:3},8,[`modelValue`])}}};var AssistantModelControl_default=_plugin_vue_export_helper_default(_sfc_main$90,[[`__scopeId`,`data-v-4b607837`]]);function displayedConversation(adapter){const saved=adapter.conversation;if(!adapter.delivery&&!saved.previewMessage&&!saved.previewMessages?.length&&!saved.interimReply)return saved;const{previewMessage,previewMessages,interimReply,...display}=saved;let turns=adapter.delivery?adapter.delivery.turns(saved.turns||[]):saved.turns||[];if(interimReply?.text&&interimReply.turnId){const assistant={...interimReply,messageId:interimReply.id,role:`assistant`};turns=turns.map(turn=>turn.turnId!==interimReply.turnId?turn:{...turn,assistant,commentary:(turn.commentary||[]).filter(message=>(message.outputId||message.messageId)!==(interimReply.outputId||interimReply.id)),...Array.isArray(turn.messages)?{messages:turn.messages.filter(message=>message.role!==`assistant`&&(message.outputId||message.messageId)!==(interimReply.outputId||interimReply.id)).concat(assistant)}:{}})}const previews=Array.isArray(previewMessages)?previewMessages:previewMessage?[previewMessage]:[];for(const preview of previews){const messageId=String(preview?.messageId||preview?.id||``).trim();const localDelivery=messageId&&adapter.delivery?.find(messageId);if((!localDelivery||localDelivery.status===`failed`)&&preview?.actions?.send)turns=turns.map(turn=>{const failed=turn.optimistic?.id===messageId&&turn.optimistic.status===`failed`;const unadmitted=turn.user?.receipt===false&&String(turn.user.messageId||turn.user.id||``)===messageId;if(!failed&&!unadmitted)return turn;return{...turn,preview:true,previewMessage:preview,user:{...turn.user,text:String(preview.text||``)}}});const alreadyShown=messageId&&(localDelivery||turns.some(turn=>[turn.system,turn.user,turn.assistant,...turn.thinking||[],...turn.commentary||[],...turn.messages||[]].some(message=>String(message?.messageId||message?.id||``)===messageId&&(message.receipt!==false||turn.preview))));if(messageId&&(preview?.text||preview?.actions?.editing)&&!alreadyShown){const user={messageId,role:`user`,text:String(preview.text||``)};turns=[...turns,{turnId:messageId,user,messages:[user],preview:true,previewMessage:preview,optimistic:{id:messageId,status:`pending`}}]}}return{...display,turns,welcomeMessage:turns.length?``:saved.welcomeMessage}}var _hoisted_1$65=[`aria-label`];var _hoisted_2$55=[`aria-label`];var _hoisted_3$47={class:`assistant-conversation__avatar-size-disc`};var _hoisted_4$38={class:`assistant-conversation__avatar-presentation`};var _hoisted_5$36={class:`assistant-conversation__avatar-tools`};var _hoisted_6$31={class:`assistant-conversation__avatar-size-disc assistant-conversation__avatar-size-disc--minimise`};var _hoisted_7$30={key:0,class:`assistant-conversation__preview-actions`};var _hoisted_8$28={key:1,class:`assistant-conversation__goal`};var _hoisted_9$27=[`accept`,`disabled`];var _hoisted_10$22={key:0,role:`alert`,class:`assistant-conversation__attachment-error`};var _sfc_main$89={__name:`AssistantConversationElement`,props:{adapter:{type:Object,required:true},avatarSize:{type:String,default:`compact`,validator:value=>[`hidden`,`compact`,`standard`,`large`].includes(value)},label:{type:String,default:void 0},configuration:{type:Object,default:()=>({})},configurationFields:{type:Array,default:()=>[]},configurationMode:{type:String,default:`hidden`,validator:value=>[`hidden`,`readonly`,`editable`].includes(value)}},emits:[`update:avatarSize`],setup(__props,{expose:__expose,emit:__emit}){const{t}=useJskitText();const props=__props;const emit=__emit;const slots=useSlots();const container=ref(null);const avatarControls=ref(null);const visibleAvatarSize=ref(`compact`);watch(()=>props.avatarSize,size=>{if(size!==`hidden`)visibleAvatarSize.value=size},{immediate:true});function toggleAvatar(){emit(`update:avatarSize`,props.avatarSize===`hidden`?visibleAvatarSize.value:`hidden`)}const avatarSizes=[{value:`hidden`,height:0},{value:`compact`,height:96},{value:`standard`,height:112},{value:`large`,height:176}];const avatarSpace=ref(0);const avatarHeight=computed(()=>Math.min(avatarSpace.value,avatarSizes.find(size=>size.value===props.avatarSize).height));let avatarObserver;const observedAvatarElements=new Set;function measureAvatarSpace(){const root=container.value;if(!root||!slots.avatar)return;const warning=root.querySelector(`.assistant-transcript__error`);const warningBottom=warning?warning.getBoundingClientRect().bottom-root.getBoundingClientRect().top+root.scrollTop:0;root.style.setProperty(`--assistant-conversation-warning-bottom`,`${warningBottom}px`);const rootStyle=getComputedStyle(root);let occupied=parseFloat(rootStyle.paddingTop)+parseFloat(rootStyle.paddingBottom);for(const element of observedAvatarElements){if(element===root)continue;const style=getComputedStyle(element);occupied+=element.getBoundingClientRect().height+parseFloat(style.marginTop)+parseFloat(style.marginBottom)}avatarSpace.value=Math.max(0,root.clientHeight-occupied-120)}function observeAvatarSpace(){if(!container.value||!slots.avatar){avatarObserver?.disconnect();observedAvatarElements.clear();return}avatarObserver||=new ResizeObserver(measureAvatarSpace);const fixedElements=Array.from(container.value.children).filter(element=>!element.classList.contains(`assistant-conversation__avatar`)&&!element.classList.contains(`assistant-conversation__transcript`));const elements=new Set([container.value,...fixedElements]);if(avatarControls.value)elements.add(avatarControls.value);const warning=container.value.querySelector(`.assistant-transcript__error`);if(warning)elements.add(warning);for(const element of observedAvatarElements)if(!elements.has(element)){avatarObserver.unobserve(element);observedAvatarElements.delete(element)}for(const element of elements)if(!observedAvatarElements.has(element)){avatarObserver.observe(element);observedAvatarElements.add(element)}measureAvatarSpace()}onMounted(observeAvatarSpace);onUpdated(observeAvatarSpace);onBeforeUnmount(()=>avatarObserver?.disconnect());const transcriptSlots=computed(()=>[`welcome`,`attachments`,`system-message`,`message-actions`].filter(name=>slots[name]));const input=ref(null);const fileInput=ref(null);const modelsOpen=ref(false);const delivery=ref(null);const statusId=`assistant-status-${useId()}`;const conversation=computed(()=>displayedConversation(props.adapter));watch([()=>props.adapter.delivery,()=>props.adapter.conversation.turns],([controller,turns])=>{controller?.reconcile(turns||[])},{immediate:true});const pending=computed(()=>Boolean(props.adapter.delivery?.state.sending||props.adapter.composer?.pending));const queueWhileSending=computed(()=>props.adapter.composer?.queueWhileSending===true);const working=computed(()=>conversation.value.working??(!pending.value&&Boolean(props.adapter.composer?.canStop||conversation.value.turns?.some(turn=>turn.pending))));const activity=computed(()=>props.adapter.activity??{label:props.adapter.composer?.stopPending?t(`jskit.assistant.composer.stopping`):pending.value?t(`jskit.assistant.chat.sendingToAssistant`):working.value?t(`jskit.assistant.chat.working`):``});const suggestionPreview=computed(()=>!props.adapter.composer?.draft&&props.adapter.suggestions?.visible?props.adapter.suggestions.preview:``);const attachmentsEnabled=computed(()=>props.adapter.attachments&&props.adapter.attachments.enabled!==false);const attachmentState=computed(()=>({count:attachmentsEnabled.value?props.adapter.attachments.queueItems?.length||0:0,canSubmit:!attachmentsEnabled.value||props.adapter.attachments.canSubmit!==false}));const canSend=computed(()=>(!pending.value||queueWhileSending.value&&attachmentState.value.count===0)&&props.adapter.composer?.canSend&&attachmentState.value.canSubmit);async function resend(id){if(props.adapter.actions?.resend)return props.adapter.actions.resend(id);const controller=props.adapter.delivery;const payload=controller?.find(id)?.payload;const attachments=props.adapter.attachments;try{const response=await controller?.resend(id,{queue:queueWhileSending.value});clearAcceptedAttachments(response,payload,attachments);return response}catch{}}function cancel(id){if(props.adapter.actions?.cancel)return props.adapter.actions.cancel(id);if((props.adapter.delivery?.find(id))?.status!==`failed`)return false;props.adapter.delivery.remove(id);return true}function edit(id){if(props.adapter.actions?.edit)return props.adapter.actions.edit(id);if(!props.adapter.actions?.setDraft)return;const draft=props.adapter.delivery?.edit(id,props.adapter.composer?.draft||``);if(draft!=null){props.adapter.actions.setDraft(draft);input.value?.focus()}}function attachSelectedFiles(event){const files=Array.from(event.target.files||[]);event.target.value=``;if(attachmentsEnabled.value&&props.adapter.attachments.canAddFiles)return props.adapter.attachments.uploadFiles(files)}async function applyModel(){if(await props.adapter.models.apply()!==false)modelsOpen.value=false}function selectSuggestion(value){if(props.adapter.suggestions?.select(value)!==false)input.value?.focus()}function dismissSuggestions(){props.adapter.suggestions?.dismiss();input.value?.focus()}function clearAcceptedAttachments(response,payload,attachments){if(response!==false&&response?.ok!==false&&payload?.attachmentIds?.length)attachments?.clearAttachments({accepted:true,attachmentIds:payload.attachmentIds})}async function submit(){if(!canSend.value)return;const attachments=props.adapter.attachments;const files=attachmentsEnabled.value?props.adapter.attachments.attachments.map(item=>({...item})):[];if(props.adapter.actions?.submit)return props.adapter.actions.submit({configuration:props.configuration,attachments:files});const controller=props.adapter.delivery;if(!controller||!props.adapter.actions?.setDraft)return;const message=String(props.adapter.composer.draft||``).trim()||(files.length?props.adapter.composer.attachmentMessage||t(`jskit.assistant.chat.reviewAttachedFiles`):``);if(!message)return;const payload={...props.adapter.composer.payload,configuration:{...props.configuration},message,...files.length?{attachmentIds:files.map(file=>file.attachmentId),displayAttachments:files}:{}};props.adapter.actions.setDraft(``);try{const response=await controller.send(payload,{queue:queueWhileSending.value});clearAcceptedAttachments(response,payload,attachments);return response}catch{return false}}function stop(){const state=props.adapter.composer;if(!state?.canStop||state.stopDisabled||state.stopPending)return;return props.adapter.actions.stop()}function updateConfiguration(value){if(props.configurationMode!==`editable`||pending.value)return;return props.adapter.actions?.updateConfiguration?.(value)}__expose({focus:()=>input.value?.focus(),submit,stop});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{ref_key:`container`,ref:container,class:normalizeClass([`assistant-conversation`,{"assistant-conversation--error":conversation.value.error}]),"aria-label":__props.label??unref(t)(`jskit.assistant.chat.label`)},[_ctx.$slots.avatar?(openBlock(),createElementBlock(`section`,{key:0,class:normalizeClass([`assistant-conversation__avatar`,{"assistant-conversation__avatar--hidden":__props.avatarSize===`hidden`}]),"aria-label":unref(t)(`jskit.assistant.chat.avatar`)},[withDirectives(createBaseVNode(`div`,{ref_key:`avatarControls`,ref:avatarControls,class:`assistant-conversation__avatar-controls`},[renderSlot(_ctx.$slots,`avatar-control`,{size:__props.avatarSize,height:avatarHeight.value},void 0,true),createVNode(VBtn,{icon:`$accountCircle`,size:`small`,variant:`text`,class:`assistant-conversation__avatar-size`,"aria-label":unref(t)(`jskit.assistant.chat.showAvatar`),title:unref(t)(`jskit.assistant.chat.showAvatar`),"aria-expanded":__props.avatarSize!==`hidden`,onClick:toggleAvatar},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_3$47,[renderSlot(_ctx.$slots,`avatar-thumbnail`,{size:__props.avatarSize,height:avatarHeight.value},()=>[createVNode(VIcon,{size:`20`,icon:`$accountCircle`})],true)])]),_:3},8,[`aria-label`,`title`,`aria-expanded`])],512),[[vShow,__props.avatarSize===`hidden`]]),withDirectives(createBaseVNode(`div`,_hoisted_4$38,[__props.avatarSize!==`hidden`?(openBlock(),createElementBlock(`div`,{key:0,class:`assistant-conversation__avatar-visual`,style:normalizeStyle({height:`${avatarHeight.value}px`,width:`${avatarHeight.value}px`})},[renderSlot(_ctx.$slots,`avatar`,{size:__props.avatarSize,height:avatarHeight.value},void 0,true)],4)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_5$36,[renderSlot(_ctx.$slots,`avatar-tools`,{size:__props.avatarSize,height:avatarHeight.value},void 0,true),createVNode(VBtn,{icon:`$minus`,size:`small`,variant:`text`,color:`primary`,class:`assistant-conversation__avatar-size`,"aria-label":unref(t)(`jskit.assistant.chat.minimiseAvatar`),title:unref(t)(`jskit.assistant.chat.minimiseAvatar`),"aria-expanded":true,onClick:toggleAvatar},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_6$31,[createVNode(VIcon,{size:`20`,icon:`$minus`})])]),_:1},8,[`aria-label`,`title`])])],512),[[vShow,__props.avatarSize!==`hidden`]])],10,_hoisted_2$55)):createCommentVNode(``,true),createVNode(AssistantTranscript_default,mergeProps(conversation.value,{"preview-message":__props.adapter.conversation.previewMessage||null,working:working.value,class:`assistant-conversation__transcript`,onLoadMore:_cache[0]||(_cache[0]=$event=>__props.adapter.actions?.loadMore?.($event)),onReload:_cache[1]||(_cache[1]=$event=>__props.adapter.actions?.reload?.()),onResendTurn:_cache[2]||(_cache[2]=$event=>resend($event)),onCancelTurn:_cache[3]||(_cache[3]=$event=>cancel($event)),onCheckDelivery:_cache[4]||(_cache[4]=$event=>__props.adapter.actions?.checkDelivery?.($event)),onEditTurn:_cache[5]||(_cache[5]=$event=>edit($event)),onLinkClick:_cache[6]||(_cache[6]=$event=>__props.adapter.actions?.openLink?.($event))}),createSlots({"user-message-actions":withCtx(scope=>[scope.turn.preview&&scope.turn.previewMessage?.actions?(openBlock(),createElementBlock(`div`,_hoisted_7$30,[scope.turn.previewMessage.actions.discard?(openBlock(),createBlock(VBtn,{key:0,icon:`$close`,size:`small`,variant:`text`,"aria-label":unref(t)(`jskit.assistant.chat.discardUnsent`),title:unref(t)(`jskit.assistant.chat.discardUnsent`),disabled:!scope.turn.previewMessage.actions.canDiscard,onClick:$event=>scope.turn.previewMessage.actions.discard(scope.turn.turnId)},null,8,[`aria-label`,`title`,`disabled`,`onClick`])):createCommentVNode(``,true),scope.turn.previewMessage.actions.edit?(openBlock(),createBlock(VBtn,{key:1,icon:`$edit`,size:`small`,variant:`text`,"aria-label":unref(t)(`jskit.assistant.chat.editUnsent`),title:unref(t)(`jskit.assistant.chat.editUnsent`),disabled:!scope.turn.previewMessage.actions.canEdit,onClick:$event=>scope.turn.previewMessage.actions.edit(scope.turn.turnId)},null,8,[`aria-label`,`title`,`disabled`,`onClick`])):createCommentVNode(``,true),scope.turn.previewMessage.actions.send?(openBlock(),createBlock(VBtn,{key:2,size:`small`,color:`primary`,disabled:!scope.turn.previewMessage.actions.canSend,onClick:$event=>scope.turn.previewMessage.actions.send(scope.turn.turnId)},{default:withCtx(()=>[createTextVNode(toDisplayString(scope.turn.previewMessage.actions.sending?unref(t)(`jskit.assistant.composer.sending`):unref(t)(`jskit.assistant.composer.send`)),1)]),_:2},1032,[`disabled`,`onClick`])):createCommentVNode(``,true)])):createCommentVNode(``,true),renderSlot(_ctx.$slots,`user-message-actions`,normalizeProps(guardReactiveProps(scope)),void 0,true)]),_:2},[renderList(transcriptSlots.value,name=>{return{name,fn:withCtx(scope=>[renderSlot(_ctx.$slots,name,normalizeProps(guardReactiveProps(scope)),void 0,true)])}})]),1040,[`preview-message`,`working`]),__props.adapter.goal&&__props.adapter.goal.enabled!==false?(openBlock(),createElementBlock(`div`,_hoisted_8$28,[createVNode(AssistantGoalControl_default,{state:__props.adapter.goal},null,8,[`state`])])):createCommentVNode(``,true),!_ctx.$slots.hints&&(__props.adapter.composer||activity.value.label||__props.adapter.suggestions)?(openBlock(),createBlock(AssistantComposerSupport_default,{key:2,activity:activity.value,"status-id":statusId,loading:__props.adapter.suggestions?.visible&&__props.adapter.suggestions.loading,suggestions:__props.adapter.suggestions?.visible?__props.adapter.suggestions.items:[],onPreview:_cache[7]||(_cache[7]=$event=>__props.adapter.suggestions?.previewSuggestion($event)),onSelect:selectSuggestion,onDismiss:dismissSuggestions},createSlots({_:2},[_ctx.$slots.activity?{name:`activity`,fn:withCtx(scope=>[renderSlot(_ctx.$slots,`activity`,normalizeProps(guardReactiveProps(scope)),void 0,true)]),key:`0`}:void 0]),1032,[`activity`,`loading`,`suggestions`])):createCommentVNode(``,true),renderSlot(_ctx.$slots,`hints`,{adapter:__props.adapter},void 0,true),renderSlot(_ctx.$slots,`composer`,{adapter:__props.adapter},()=>[__props.adapter.composer?(openBlock(),createBlock(AssistantPromptInput_default,mergeProps({key:0,ref_key:`input`,ref:input},__props.adapter.composer,{class:`assistant-conversation__composer`,"model-value":__props.adapter.composer.draft||``,"submit-enabled":canSend.value,"aria-label":__props.adapter.composer.ariaLabel||unref(t)(`jskit.assistant.chat.messageAssistant`),rows:__props.adapter.composer.rows||2,"described-by":activity.value.label||__props.adapter.suggestions?.visible?statusId:__props.adapter.composer.describedBy,placeholder:suggestionPreview.value||__props.adapter.composer.placeholder,"placeholder-affects-height":!suggestionPreview.value,"attachment-state":attachmentState.value,dragging:attachmentsEnabled.value&&__props.adapter.attachments.dragActive,"tab-to-submit":``,"onUpdate:modelValue":_cache[22]||(_cache[22]=$event=>__props.adapter.actions.setDraft($event)),onSubmit:submit,onTabToSubmit:_cache[23]||(_cache[23]=$event=>delivery.value?.focus()),onFocus:_cache[24]||(_cache[24]=$event=>__props.adapter.suggestions?.focus()),onBlur:_cache[25]||(_cache[25]=$event=>__props.adapter.suggestions?.blur()),onEscape:dismissSuggestions,onDragenter:_cache[26]||(_cache[26]=$event=>attachmentsEnabled.value&&__props.adapter.attachments.handleDragEnter($event)),onDragover:_cache[27]||(_cache[27]=$event=>attachmentsEnabled.value&&__props.adapter.attachments.handleDragOver($event)),onDragleave:_cache[28]||(_cache[28]=$event=>attachmentsEnabled.value&&__props.adapter.attachments.handleDragLeave($event)),onDrop:_cache[29]||(_cache[29]=$event=>attachmentsEnabled.value&&__props.adapter.attachments.handleDrop($event)),onPaste:_cache[30]||(_cache[30]=$event=>attachmentsEnabled.value&&__props.adapter.attachments.handlePaste($event))}),createSlots({footer:withCtx(()=>[createVNode(AssistantComposerActions_default,{ref_key:`delivery`,ref:delivery,state:{...__props.adapter.composer,pending:pending.value,canSend:canSend.value},onSubmit:submit,onStop:stop},{feedback:withCtx(()=>[attachmentsEnabled.value&&__props.adapter.attachments.status?(openBlock(),createElementBlock(`p`,_hoisted_10$22,toDisplayString(__props.adapter.attachments.status),1)):createCommentVNode(``,true),renderSlot(_ctx.$slots,`composer-feedback`,{adapter:__props.adapter},void 0,true)]),default:withCtx(()=>[__props.adapter.models&&__props.adapter.models.enabled!==false?(openBlock(),createBlock(AssistantModelControl_default,mergeProps({key:0,modelValue:modelsOpen.value,"onUpdate:modelValue":_cache[16]||(_cache[16]=$event=>modelsOpen.value=$event)},__props.adapter.models,{onSelectProvider:_cache[17]||(_cache[17]=$event=>__props.adapter.models.selectProvider?.($event)),onSelectModel:_cache[18]||(_cache[18]=$event=>__props.adapter.models.selectModel?.($event)),onSelectVariant:_cache[19]||(_cache[19]=$event=>__props.adapter.models.selectVariant?.($event)),onApply:applyModel,onReload:_cache[20]||(_cache[20]=$event=>__props.adapter.models.reload?.())}),null,16,[`modelValue`])):createCommentVNode(``,true),attachmentsEnabled.value?(openBlock(),createBlock(VBtn,{key:1,"aria-label":unref(t)(`jskit.assistant.chat.attachFiles`),title:unref(t)(`jskit.assistant.chat.attachFiles`),size:`small`,variant:`text`,icon:`$attachFile`,disabled:!__props.adapter.attachments.canAddFiles,onClick:_cache[21]||(_cache[21]=$event=>fileInput.value?.click())},null,8,[`aria-label`,`title`,`disabled`])):createCommentVNode(``,true),__props.configurationMode!==`hidden`?renderSlot(_ctx.$slots,`configuration`,{configuration:__props.configuration,disabled:__props.configurationMode!==`editable`||pending.value,update:updateConfiguration},()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.configurationFields,field=>{return openBlock(),createBlock(VSelect,{key:field.name,"model-value":__props.configuration[field.name],label:field.label,items:field.items,disabled:__props.configurationMode!==`editable`||pending.value,density:`compact`,"hide-details":``,variant:`outlined`,class:`assistant-conversation__setting`,"onUpdate:modelValue":$event=>updateConfiguration({...__props.configuration,[field.name]:$event})},null,8,[`model-value`,`label`,`items`,`disabled`,`onUpdate:modelValue`])}),128))],true,2):createCommentVNode(``,true),renderSlot(_ctx.$slots,`composer-tools`,{adapter:__props.adapter},void 0,true)]),_:3},8,[`state`])]),_:2},[attachmentsEnabled.value?{name:`attachments`,fn:withCtx(()=>[createBaseVNode(`input`,{ref_key:`fileInput`,ref:fileInput,hidden:``,multiple:``,type:`file`,accept:__props.adapter.attachments.accept,disabled:!__props.adapter.attachments.canAddFiles,onChange:attachSelectedFiles},null,40,_hoisted_9$27),createVNode(AssistantAttachmentQueue_default,{items:__props.adapter.attachments.queueItems,"preview-enabled":Boolean(__props.adapter.attachments.open),"maximum-files":__props.adapter.attachments.maxItems,onCancel:_cache[8]||(_cache[8]=$event=>__props.adapter.attachments.cancelAttachment($event)),onRemove:_cache[9]||(_cache[9]=$event=>__props.adapter.attachments.removeAttachment($event)),onRetry:_cache[10]||(_cache[10]=$event=>__props.adapter.attachments.retryAttachment($event)),onPreview:_cache[11]||(_cache[11]=$event=>__props.adapter.attachments.open($event)),onFocusInput:_cache[12]||(_cache[12]=$event=>input.value?.focus())},null,8,[`items`,`preview-enabled`,`maximum-files`])]),key:`0`}:void 0,__props.adapter.questions||_ctx.$slots[`input-start`]?{name:`input-start`,fn:withCtx(()=>[renderSlot(_ctx.$slots,`input-start`,{adapter:__props.adapter},()=>[createVNode(AssistantQuestionInputs_default,mergeProps(__props.adapter.questions,{"onUpdate:answers":_cache[13]||(_cache[13]=$event=>__props.adapter.questions.setAnswers($event)),"onUpdate:choice":_cache[14]||(_cache[14]=$event=>__props.adapter.questions.setChoice($event)),onDismiss:_cache[15]||(_cache[15]=$event=>__props.adapter.questions.dismiss())}),null,16)],true)]),key:`1`}:void 0]),1040,[`model-value`,`submit-enabled`,`aria-label`,`rows`,`described-by`,`placeholder`,`placeholder-affects-height`,`attachment-state`,`dragging`])):createCommentVNode(``,true)],true)],10,_hoisted_1$65)}}};var AssistantConversationElement_default=_plugin_vue_export_helper_default(_sfc_main$89,[[`__scopeId`,`data-v-51f92074`]]);var{serverMessage:serverMessage$4}=useJskitText();function useAssistantSuggestions({active=true,requestKey=``,draft=``,configuration={},generate,onSelect=()=>false,debounceMs=750,minIntervalMs=0}){const items=ref([]);const loading=ref(false);const preview=ref(``);const error=ref(``);const dismissedKey=ref(null);const composerFocused=ref(false);const currentDraft=computed(()=>String(toValue(draft)??``).trim());const configurationKey=computed(()=>JSON.stringify(toValue(configuration)??{}));const key=computed(()=>JSON.stringify([toValue(requestKey),currentDraft.value,configurationKey.value]));const eligible=computed(()=>toValue(active)!==false&&typeof unref(generate)===`function`&&dismissedKey.value!==key.value);const visible=computed(()=>eligible.value&&(loading.value||items.value.length>0));let timer;let request;let lastStartedAt=-Infinity;function cancel(){clearTimeout(timer);const previous=request;request=null;previous?.abort();loading.value=false}watch([eligible,key,()=>unref(generate)],()=>{cancel();items.value=[];preview.value=``;error.value=``;if(!eligible.value)return;const controller=new AbortController;request=controller;const input={draft:currentDraft.value,configuration:JSON.parse(configurationKey.value),signal:controller.signal};const run=unref(generate);loading.value=true;timer=setTimeout(async()=>{lastStartedAt=Date.now();try{const result=await run(input);if(request!==controller)return;if(!Array.isArray(result)||result.some(item=>!item?.label?.trim()||!item?.prompt?.trim()))throw new TypeError(`Suggestions must contain a label and prompt.`);items.value=result.map(({label,prompt})=>({label:label.trim(),prompt:prompt.trim()}))}catch(failure){if(request===controller&&!controller.signal.aborted)error.value=String(serverMessage$4(failure)||failure)}finally{if(request===controller){request=null;loading.value=false}}},Math.max(0,Number(toValue(debounceMs))||0,lastStartedAt+Math.max(0,Number(toValue(minIntervalMs))||0)-Date.now()))},{immediate:true,flush:`sync`});function currentSuggestion(value){return items.value.find(item=>item.label===value?.label&&item.prompt===value?.prompt)}function previewSuggestion(value){preview.value=currentDraft.value?``:currentSuggestion(value)?.prompt||``;return Boolean(preview.value)}function select(value){const suggestion=currentSuggestion(value);if(!suggestion||!eligible.value)return false;preview.value=``;return onSelect(suggestion.prompt)!==false}function dismiss(){preview.value=``;dismissedKey.value=key.value}function focus(){if(toValue(active)===false||composerFocused.value)return;composerFocused.value=true}function blur(){preview.value=``;composerFocused.value=false}watch(()=>toValue(active),value=>{if(value===false){composerFocused.value=false;dismissedKey.value=null}},{flush:`sync`});watch(currentDraft,()=>{preview.value=``},{flush:`sync`});onScopeDispose(cancel);return{items,loading,preview,error,visible,composerFocused,previewSuggestion,select,dismiss,focus,blur}}function useAssistantQuestions({message=``,extraChoice=null}={}){const questionText=computed(()=>String(toValue(message)||``));const answers=ref({});const choice=ref(``);const dismissedText=ref(``);const submittedText=ref(``);const numberedInput=computed(()=>parseNumberedQuestionPrompt(questionText.value));const questions=computed(()=>[dismissedText.value,submittedText.value].includes(questionText.value)?[]:numberedInput.value.questions||[]);const selectItems=computed(()=>Object.fromEntries(questions.value.map(question=>{const choices=Array.isArray(question.choices)?question.choices:[];const extra=toValue(extraChoice);const includesExtra=extra&&choices.some(item=>String(item?.value||``).trim().toLowerCase()===String(extra.value||``).trim().toLowerCase());return[question.name,!extra||includesExtra?choices:[...choices,extra]]})));const choices=computed(()=>questions.value.length||submittedText.value===questionText.value?[]:parseAnswerChoicePrompt(questionText.value).choices||[]);const active=computed(()=>Boolean(questions.value.length||choices.value.length));function capture(draft=``){const additionalContext=String(draft||``).trim();return{message:questions.value.length?[numberedQuestionSubmissionText(questions.value,answers.value),additionalContext].filter(Boolean).join(`
|
|
93
93
|
|
|
94
94
|
`):choice.value||additionalContext,questionText:active.value?questionText.value:``}}function markSubmitted(text=``){submittedText.value=text;answers.value={};choice.value=``}function dismiss(){if(!questions.value.length)return false;dismissedText.value=questionText.value;answers.value={};return true}function reset(){answers.value={};dismissedText.value=``;submittedText.value=``;choice.value=``}watch(questionText,text=>{answers.value={};if(text!==dismissedText.value)dismissedText.value=``;if(text!==submittedText.value)submittedText.value=``;choice.value=``});function setAnswers(value){answers.value=value}function setChoice(value){choice.value=value}return{questions,selectItems,choices,answers,choice,active,capture,markSubmitted,dismiss,reset,setAnswers,setChoice}}var CANNOT_SEND_YET=`Your words are in the chat box, but this conversation cannot send yet.`;var submissionError=(message,{messageCode})=>Object.assign(new Error(message),{messageCode,messageParams:{}});async function readStateAtOnce(){}function createAssistantTextSubmission({getState,setDraft,submit,afterDraftChange=readStateAtOnce}){let revision=0;return async function submitText(text,{sendImmediately=true,signal,timeoutMs=2e3}={}){const request=++revision;const value=String(text||``).trim();const initial=getState();if(!value||!initial.active||signal?.aborted)throw submissionError(`The chat composer is not ready yet.`,{messageCode:`assistant.composer.notReady`});const hasDraft=Boolean(initial.draft?.trim());const writtenValue=hasDraft?`${initial.draft}\n${value}`:value;setDraft(writtenValue);if(!sendImmediately||hasDraft)return`draft`;await afterDraftChange();const deadline=Date.now()+timeoutMs;while(true){const state=getState();if(signal?.aborted||request!==revision||!state.active||state.id!==initial.id||state.draft!==writtenValue)throw submissionError(`The chat changed before sending. Review the draft before sending.`,{messageCode:`assistant.composer.chatChanged`});if(state.canSend){if(await submit()===false)throw submissionError(CANNOT_SEND_YET,{messageCode:`assistant.composer.cannotSendYet`});return state.turnActive?`steer`:`send`}if(Date.now()>=deadline)throw submissionError(CANNOT_SEND_YET,{messageCode:`assistant.composer.cannotSendYet`});await new Promise(resolve=>setTimeout(resolve,16))}}}var{t:t$26}=useJskitText();function assistantAttachmentFiles(fileList){return Array.from(fileList||[]).filter(file=>file&&file.size>=0)}function assistantAttachmentFilesFromTransferItems(items){return assistantAttachmentFiles(Array.from(items||[]).map(item=>{if(item?.kind!==`file`||typeof item.getAsFile!==`function`)return null;return item.getAsFile()}))}function assistantAttachmentFilesFromDropEvent(event){const dataTransfer=event?.dataTransfer;const itemFiles=assistantAttachmentFilesFromTransferItems(dataTransfer?.items);if(itemFiles.length>0)return itemFiles;return assistantAttachmentFiles(dataTransfer?.files)}function assistantAttachmentFilesFromPasteEvent(event){const clipboardData=event?.clipboardData;const itemFiles=assistantAttachmentFilesFromTransferItems(clipboardData?.items);if(itemFiles.length>0)return itemFiles;return assistantAttachmentFiles(clipboardData?.files)}function assistantAttachmentEventHasFiles(event){const dataTransfer=event?.dataTransfer;return assistantAttachmentFilesFromDropEvent(event).length>0||Array.from(dataTransfer?.items||[]).some(item=>item?.kind===`file`)||Array.from(dataTransfer?.types||[]).some(type=>type===`Files`||type===`application/x-moz-file`)}function assistantAttachmentClipboardText(event){if(typeof event?.clipboardData?.getData!==`function`)return``;return String(event.clipboardData.getData(`text/plain`)||``)}function assistantAttachmentClipboardLocalFileReference(event){const clipboardData=event?.clipboardData;if(!clipboardData||typeof clipboardData.getData!==`function`)return``;const types=Array.from(clipboardData.types||[]);const text=[clipboardData.getData(`x-special/gnome-copied-files`),clipboardData.getData(`text/uri-list`),clipboardData.getData(`text/plain`)].map(value=>String(value||``).trim()).filter(Boolean).join(`
|
|
95
|
-
`);if(types.includes(`Files`)||types.includes(`application/x-moz-file`)||types.includes(`x-special/gnome-copied-files`)||/^file:/imu.test(text))return text||`file://`;return``}function useAttachmentDropTarget({uploadFiles,reportAttachmentError}){const dragDepth=ref(0);const dragActive=computed(()=>dragDepth.value>0);function resetDragState(){dragDepth.value=0}function handleDragEnter(event){if(!assistantAttachmentEventHasFiles(event))return;dragDepth.value+=1;if(event?.dataTransfer)event.dataTransfer.dropEffect=`copy`}function handleDragOver(event){if(event?.dataTransfer)event.dataTransfer.dropEffect=`copy`}function handleDragLeave(){dragDepth.value=Math.max(0,dragDepth.value-1)}async function handleDrop(event){resetDragState();return uploadFiles(assistantAttachmentFilesFromDropEvent(event))}async function handlePaste(event){const files=assistantAttachmentFilesFromPasteEvent(event);if(files.length<1){if(assistantAttachmentClipboardLocalFileReference(event))reportAttachmentError(t$26(`jskit.assistant.attachments.error.localFilePaste`));return[]}if(!assistantAttachmentClipboardText(event))event?.preventDefault?.();return uploadFiles(files)}return{dragActive,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,resetDragState}}var{t:t$25}=useJskitText();function attachmentUploadError(attachment){return attachment?.error||attachment?.errors?.[0]?.message||``}function attachmentIdentity(attachment){return String(attachment?.clientId||attachment?.attachmentId||attachment?.path||attachment?.fileName||``)}var attachmentClientSequence=0;function nextAttachmentClientId(){attachmentClientSequence+=1;return`attachment-${Date.now().toString(36)}-${attachmentClientSequence.toString(36)}`}function attachmentFileName(file){return String(file?.name||`attachment`)}function attachmentUploadResult(upload=null){if(upload&&typeof upload.then===`function`)return{cancel:typeof upload.cancel===`function`?()=>upload.cancel():null,promise:upload};if(upload?.promise&&typeof upload.promise.then===`function`)return{cancel:typeof upload.abort===`function`?()=>upload.abort():typeof upload.cancel===`function`?()=>upload.cancel():null,promise:upload.promise};return{cancel:null,promise:Promise.resolve(upload)}}function attachmentProgress(progress={},possibleTotal,fallbackTotal=0){const directNumericProgress=typeof progress===`number`?progress:null;const progressObject=progress&&typeof progress===`object`?progress:{};const totalBytes=Math.max(0,Number(progressObject.totalBytes??progressObject.total??possibleTotal??fallbackTotal)||0);const bytesValue=progressObject.bytesSent??progressObject.loaded??progressObject.uploadedBytes??directNumericProgress;const bytesKnown=bytesValue!==null&&bytesValue!==void 0&&bytesValue!==``;let bytesSent=bytesKnown?Number(bytesValue)||0:0;const directPercent=progressObject.percent;let percent=directPercent!==null&&directPercent!==void 0&&directPercent!==``?Number(directPercent):null;const progressValue=progressObject.progress;if(!Number.isFinite(percent)&&progressValue!==null&&progressValue!==void 0&&progressValue!==``){const numericProgressValue=Number(progressValue);if(Number.isFinite(numericProgressValue))percent=numericProgressValue<=1?numericProgressValue*100:numericProgressValue}if(!Number.isFinite(percent))percent=bytesKnown&&totalBytes>0?bytesSent/totalBytes*100:null;if(percent!==null)percent=Math.max(0,Math.min(100,percent));if(totalBytes>0){const inferredBytes=percent===null?0:totalBytes*percent/100;bytesSent=Math.max(0,Math.min(totalBytes,bytesSent||inferredBytes))}else bytesSent=Math.max(0,bytesSent);return{bytesSent,percent,totalBytes}}function attachmentReceipt(row,uploaded){return{...uploaded,attachmentId:String(uploaded?.attachmentId||``),clientId:row.clientId,fileName:String(uploaded?.fileName||row.fileName),sessionId:row.sessionId,size:Number(uploaded?.size??row.size)||0}}function createWaiter(row){let resolve=null;row.waiter={promise:new Promise(currentResolve=>{resolve=currentResolve}),resolve,settled:false};return row.waiter}function settleWaiter(row,value=null,waiter=row.waiter){if(!waiter||waiter.settled)return;waiter.settled=true;waiter.resolve(value)}function updateRowProgress(row,progress,total){if(!row.retained||row.phase!==`uploading`)return;const next=attachmentProgress(progress,total,row.totalBytes);row.bytesSent=Math.max(row.bytesSent,next.bytesSent);row.totalBytes=next.totalBytes||row.totalBytes;if(next.percent!==null)row.progress=Math.max(Number(row.progress)||0,next.percent)}function buildQueueRow({currentSessionId,file=null,fileName=`attachment`,phase=`queued`,producer=null,size=0}={}){const normalizedSize=Number(file?.size??size)||0;return reactive({activeHandoffToken:null,activeToken:null,attachmentId:``,bytesSent:0,clientId:nextAttachmentClientId(),error:``,failureStage:``,file,fileName:file?attachmentFileName(file):String(fileName||`attachment`),path:``,phase,producer,producerAbortController:null,producerToken:null,progress:null,receipt:null,retained:true,sessionId:currentSessionId,size:normalizedSize,totalBytes:normalizedSize,waiter:null})}function createReceiptCleanup({deleteAttachment,deletesUnsentUploads,reportAttachmentError}){const cleanupTasks=new Set;const receiptCleanupById=new Map;const cleanedReceiptIds=new Set;function trackCleanup(task){const cleanup=Promise.resolve(task).catch(error=>{reportAttachmentError(error,t$25(`jskit.assistant.attachments.error.cleanupFailed`));return false});cleanupTasks.add(cleanup);cleanup.finally(()=>cleanupTasks.delete(cleanup));return cleanup}async function deleteUploadedAttachment(currentSessionId,attachment){const attachmentId=String(attachment?.attachmentId||``).trim();if(!attachmentId||!deletesUnsentUploads)return false;const response=await deleteAttachment(currentSessionId,attachmentId);if(response?.ok===false)throw new Error(attachmentUploadError(response)||t$25(`jskit.assistant.attachments.error.cleanupFailed`));return true}function cleanupReceipt(currentSessionId,receipt){const attachmentId=String(receipt?.attachmentId||``).trim();const cleanupId=`${currentSessionId}:${attachmentId}`;if(!attachmentId)return Promise.resolve(false);if(cleanedReceiptIds.has(cleanupId))return Promise.resolve(false);if(receiptCleanupById.has(cleanupId))return receiptCleanupById.get(cleanupId);const cleanup=trackCleanup(deleteUploadedAttachment(currentSessionId,receipt)).then(deleted=>{if(deleted)cleanedReceiptIds.add(cleanupId);return deleted});receiptCleanupById.set(cleanupId,cleanup);cleanup.finally(()=>receiptCleanupById.delete(cleanupId));return cleanup}async function waitForAttachmentCleanup(){while(cleanupTasks.size>0)await Promise.allSettled([...cleanupTasks])}return Object.freeze({cleanupReceipt,waitForAttachmentCleanup})}var{serverMessage:serverMessage$3,t:t$24}=useJskitText();function attachmentErrorText(error,fallback){return String(error&&typeof error===`object`&&serverMessage$3(error)||error?.message||error||fallback)}function assistantAttachmentSessionId(sessionId){return String(toValue(sessionId)||``).trim()}function assistantAttachmentUploadAllowed(canUpload){return toValue(canUpload)!==false}var ASSISTANT_ATTACHMENT_MAX_BYTES=1e8;var ASSISTANT_ATTACHMENT_UPLOAD_CONCURRENCY=2;var ASSISTANT_ATTACHMENT_UNRESOLVED_PHASES=new Set([`preparing`,`queued`,`uploading`,`delivering`,`failed`]);function keepAttachmentErrorInStatus(){}async function keepUploadedAttachmentsReady(){return null}function useAssistantAttachments({canUpload=()=>true,deleteAttachment,onError=keepAttachmentErrorInStatus,onUploaded=keepUploadedAttachmentsReady,sessionId,uploadAttachment,maxBytes=ASSISTANT_ATTACHMENT_MAX_BYTES,maxItems=10,uploadConcurrency=2}){if(![maxBytes,maxItems,uploadConcurrency].every(value=>Number.isSafeInteger(value)&&value>0))throw new TypeError(`Attachment limits must be positive integers.`);const attachments=ref([]);const queueItems=ref([]);const status=ref(``);const activeUploadCount=ref(0);const uploadQueue=[];const rowsById=new Map;const activeAttempts=new Map;let disposed=false;const uploading=computed(()=>activeUploadCount.value>0||queueItems.value.some(item=>[`preparing`,`uploading`,`delivering`].includes(item.phase)));const hasUnresolved=computed(()=>queueItems.value.some(item=>ASSISTANT_ATTACHMENT_UNRESOLVED_PHASES.has(item.phase)));const canSubmit=computed(()=>!hasUnresolved.value);const retainedItemCount=computed(()=>queueItems.value.filter(item=>item.phase!==`cancelled`).length);const atCapacity=computed(()=>retainedItemCount.value>=maxItems);const canAddFiles=computed(()=>Boolean(!disposed&&assistantAttachmentSessionId(sessionId)&&assistantAttachmentUploadAllowed(canUpload)&&!atCapacity.value));const aggregateProgress=computed(()=>{const retainedItems=queueItems.value.filter(item=>item.phase!==`cancelled`);const totalBytes=retainedItems.reduce((sum,item)=>sum+item.totalBytes,0);const bytesSent=retainedItems.reduce((sum,item)=>sum+item.bytesSent,0);return{bytesSent,percent:totalBytes>0?Math.round(bytesSent/totalBytes*100):0,totalBytes}});const tooLarge=row=>t$24(`jskit.assistant.attachments.error.tooLarge`,{fileName:row.fileName,limit:attachmentLimitText(maxBytes)});const tooMany=()=>t$24(`jskit.assistant.attachments.error.tooMany`,{count:maxItems});function reportAttachmentError(error,fallbackMessage=t$24(`jskit.assistant.attachments.error.uploadFailed`),{notify=true}={}){const message=attachmentErrorText(error,fallbackMessage);status.value=message;if(notify)try{onError(error||new Error(message),fallbackMessage)}catch{}return message}function clearStatus(){status.value=``}function failRow(row,failureStage,error,fallbackMessage){row.error=attachmentErrorText(error,fallbackMessage);row.failureStage=failureStage;row.phase=`failed`;reportAttachmentError(error,fallbackMessage,{notify:false})}function canonicalRow(attachment={}){const identity=attachmentIdentity(attachment);return identity?rowsById.get(identity)||queueItems.value.find(row=>attachmentIdentity(row)===identity||row.attachmentId===identity):null}const{cleanupReceipt,waitForAttachmentCleanup}=createReceiptCleanup({deleteAttachment,deletesUnsentUploads:typeof deleteAttachment===`function`,reportAttachmentError});const{dragActive,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,resetDragState}=useAttachmentDropTarget({uploadFiles,reportAttachmentError});function removeReadyReceipt(row){const removed=attachments.value.filter(attachment=>attachment.clientId===row.clientId);attachments.value=attachments.value.filter(attachment=>attachment.clientId!==row.clientId);return removed}async function handOffUploadedAttachment(row,receipt,waiter=row.waiter){const token=Symbol(`${row.clientId}-handoff`);row.activeHandoffToken=token;row.phase=`delivering`;if(!attachments.value.some(attachment=>attachment.clientId===row.clientId))attachments.value.push(receipt);try{const accepted=(await onUploaded([receipt]))?.accepted===true;if(row.activeHandoffToken!==token||!row.retained||row.phase===`cancelled`){removeReadyReceipt(row);if(!accepted)await cleanupReceipt(row.sessionId,receipt);settleWaiter(row,null,waiter);return null}row.activeHandoffToken=null;row.error=``;row.failureStage=``;if(accepted){removeReadyReceipt(row);row.retained=false;rowsById.delete(row.clientId);queueItems.value=queueItems.value.filter(candidate=>candidate.clientId!==row.clientId);settleWaiter(row,receipt,waiter);return receipt}row.phase=`ready`;settleWaiter(row,receipt,waiter);return receipt}catch(error){if(row.activeHandoffToken!==token||!row.retained||row.phase===`cancelled`){await cleanupReceipt(row.sessionId,receipt);settleWaiter(row,null,waiter);return null}row.activeHandoffToken=null;removeReadyReceipt(row);failRow(row,`handoff`,error,t$24(`jskit.assistant.attachments.error.unusable`));settleWaiter(row,null,waiter);return null}}async function finishUploadAttempt(attempt,uploaded,uploadError=null){activeAttempts.delete(attempt.token);activeUploadCount.value=activeAttempts.size;pumpQueue();const{row}=attempt;const isCurrentAttempt=row.activeToken===attempt.token;const uploadSucceeded=Boolean(!uploadError&&uploaded&&uploaded.ok!==false&&String(uploaded.attachmentId||``).trim());if(!isCurrentAttempt||!row.retained||disposed){if(uploadSucceeded)await cleanupReceipt(attempt.sessionId,uploaded);settleWaiter(row,null,attempt.waiter);pumpQueue();return}row.activeToken=null;if(uploadSucceeded){const receipt=attachmentReceipt(row,uploaded);row.receipt=receipt;row.attachmentId=receipt.attachmentId;row.path=String(receipt.path||``);row.bytesSent=row.totalBytes;row.progress=100;row.error=``;row.failureStage=``;await handOffUploadedAttachment(row,receipt,attempt.waiter)}else{failRow(row,`upload`,uploadError||new Error(attachmentUploadError(uploaded)||t$24(`jskit.assistant.attachments.error.uploadFailed`)),t$24(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null,attempt.waiter)}pumpQueue()}function startUpload(row){const token=Symbol(row.clientId);const abortController=new AbortController;const attempt={abortController,cancel:null,row,sessionId:row.sessionId,settled:null,token,waiter:row.waiter};row.activeToken=token;row.phase=`uploading`;row.error=``;activeAttempts.set(token,attempt);activeUploadCount.value=activeAttempts.size;try{const transport=attachmentUploadResult(uploadAttachment(row.sessionId,row.file,{onProgress:(progress,total)=>updateRowProgress(row,progress,total),signal:abortController.signal}));attempt.cancel=transport.cancel;attempt.settled=transport.promise.then(uploaded=>finishUploadAttempt(attempt,uploaded),error=>finishUploadAttempt(attempt,null,error))}catch(error){attempt.settled=finishUploadAttempt(attempt,null,error)}}function pumpQueue(){if(disposed)return;while(activeAttempts.size<uploadConcurrency&&uploadQueue.length>0){const row=uploadQueue.shift();if(!row?.retained||row.phase!==`queued`)continue;startUpload(row)}}function cancelAttachment(attachment={}){const row=canonicalRow(attachment);if(!row||!row.retained||![`preparing`,`queued`,`uploading`].includes(row.phase))return false;const token=row.activeToken;row.activeToken=null;row.activeHandoffToken=null;row.phase=`cancelled`;row.error=``;const receipt=row.receipt;removeReadyReceipt(row);if(receipt)cleanupReceipt(row.sessionId,receipt);row.receipt=null;row.failureStage=``;settleWaiter(row,null);const attempt=token?activeAttempts.get(token):null;try{row.producerAbortController?.abort();attempt?.abortController.abort();attempt?.cancel?.()}catch{}row.producerAbortController=null;row.producerToken=null;pumpQueue();return true}function retryAttachment(attachment={}){const row=canonicalRow(attachment);if(!row||!row.retained||![`failed`,`cancelled`].includes(row.phase)||row.sessionId!==assistantAttachmentSessionId(sessionId)||!assistantAttachmentUploadAllowed(canUpload))return Promise.resolve(null);if(row.phase===`cancelled`&&retainedItemCount.value>=maxItems){reportAttachmentError(tooMany());return Promise.resolve(null)}if(row.failureStage===`handoff`&&row.receipt){row.error=``;row.phase=`uploading`;const waiter=createWaiter(row);handOffUploadedAttachment(row,row.receipt,waiter);return waiter.promise}if(row.producer&&!row.file){const waiter=createWaiter(row);startAttachmentProducer(row);return waiter.promise}if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t$24(`jskit.assistant.attachments.error.uploadFailed`));return Promise.resolve(null)}row.bytesSent=0;row.progress=null;row.error=``;row.failureStage=``;row.phase=`queued`;const waiter=createWaiter(row);uploadQueue.push(row);pumpQueue();return waiter.promise}function detachRow(row){if([`preparing`,`queued`,`uploading`].includes(row.phase))cancelAttachment(row);row.retained=false;rowsById.delete(row.clientId);settleWaiter(row,null)}function removeAttachment(attachment={}){const row=canonicalRow(attachment);if(!row)return[];const removedReceipts=removeReadyReceipt(row);const removed=removedReceipts.length>0?removedReceipts:[row];const receiptToClean=removedReceipts[0]||row.receipt;detachRow(row);queueItems.value=queueItems.value.filter(candidate=>candidate.clientId!==row.clientId);if(receiptToClean)cleanupReceipt(row.sessionId,receiptToClean);return removed}function clearAttachments({accepted=true,attachmentIds=null}={}){if(!accepted)return abandonAttachments();const selectedIds=Array.isArray(attachmentIds)?new Set(attachmentIds):null;const cleared=attachments.value.filter(attachment=>!selectedIds||selectedIds.has(attachment.attachmentId));const readyIds=new Set(cleared.map(attachment=>attachment.clientId));const remaining=[];for(const row of[...queueItems.value]){if(selectedIds&&!readyIds.has(row.clientId)){remaining.push(row);continue}if(readyIds.has(row.clientId)){row.retained=false;rowsById.delete(row.clientId);continue}detachRow(row);if(row.receipt)cleanupReceipt(row.sessionId,row.receipt)}attachments.value=attachments.value.filter(attachment=>!readyIds.has(attachment.clientId));queueItems.value=remaining;return cleared}async function abandonAttachments({onlySessionId=``}={}){const normalizedSessionId=String(onlySessionId||``).trim();const rows=queueItems.value.filter(row=>!normalizedSessionId||row.sessionId===normalizedSessionId);const rowIds=new Set(rows.map(row=>row.clientId));const readyReceipts=rows.map(row=>row.receipt).filter(Boolean);const attempts=[...activeAttempts.values()].filter(attempt=>rowIds.has(attempt.row.clientId));for(const row of rows)detachRow(row);queueItems.value=queueItems.value.filter(row=>!rowIds.has(row.clientId));attachments.value=attachments.value.filter(attachment=>!rowIds.has(attachment.clientId));const readyCleanup=readyReceipts.map(attachment=>cleanupReceipt(attachment.sessionId,attachment));await Promise.allSettled([...readyCleanup,...attempts.map(attempt=>attempt.settled).filter(Boolean)]);await waitForAttachmentCleanup();return rows}async function disposeAttachments(){if(disposed){await waitForAttachmentCleanup();return[]}disposed=true;stopSessionWatch();return abandonAttachments()}function createQueueRow(options){const row=buildQueueRow(options);rowsById.set(row.clientId,row);queueItems.value.push(row);createWaiter(row);return row}function queuePreparedFile(row,file,waiter=row.waiter){const preparedFile=assistantAttachmentFiles([file])[0];if(!preparedFile)throw Object.assign(new Error(`The prepared attachment did not produce a file.`),{messageCode:`assistant.attachments.error.noFile`,messageParams:{}});row.file=preparedFile;row.fileName=attachmentFileName(preparedFile);row.size=Number(preparedFile.size)||0;row.totalBytes=row.size;if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t$24(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null,waiter);return false}row.phase=`queued`;uploadQueue.push(row);pumpQueue();return true}function startAttachmentProducer(row){const token=Symbol(`${row.clientId}-producer`);const waiter=row.waiter;const abortController=new AbortController;row.file=null;row.producerAbortController=abortController;row.producerToken=token;row.phase=`preparing`;row.error=``;row.failureStage=``;row.producerSettled=Promise.resolve().then(()=>row.producer({signal:abortController.signal})).then(file=>{if(row.producerToken!==token||!row.retained||disposed){settleWaiter(row,null,waiter);return null}row.producerAbortController=null;row.producerToken=null;try{queuePreparedFile(row,file,waiter)}catch(error){failRow(row,`preparing`,error,t$24(`jskit.assistant.attachments.error.preparationFailed`));settleWaiter(row,null,waiter)}return file},error=>{if(row.producerToken!==token||!row.retained||disposed){settleWaiter(row,null,waiter);return null}row.producerAbortController=null;row.producerToken=null;if(error?.name===`AbortError`){row.phase=`cancelled`;row.error=``}else failRow(row,`preparing`,error,t$24(`jskit.assistant.attachments.error.preparationFailed`));settleWaiter(row,null,waiter);return null})}function uploadFileProducer({fileName=t$24(`jskit.assistant.attachments.preparingName`),produce}={}){const currentSessionId=assistantAttachmentSessionId(sessionId);if(!canAddFiles.value||typeof produce!==`function`){if(atCapacity.value)reportAttachmentError(tooMany());return Promise.resolve(null)}status.value=``;const row=createQueueRow({currentSessionId,fileName,phase:`preparing`,producer:produce});const waiter=row.waiter;startAttachmentProducer(row);return waiter.promise}async function uploadFiles(files=[]){const uploadableFiles=assistantAttachmentFiles(files);const currentSessionId=assistantAttachmentSessionId(sessionId);if(uploadableFiles.length<1||!currentSessionId||disposed||!assistantAttachmentUploadAllowed(canUpload))return[];status.value=``;const availableSlots=Math.max(0,maxItems-retainedItemCount.value);const acceptedFiles=uploadableFiles.slice(0,availableSlots);if(acceptedFiles.length<uploadableFiles.length)reportAttachmentError(tooMany());const waiters=[];for(const file of acceptedFiles){const row=createQueueRow({currentSessionId,file});const waiter=row.waiter;waiters.push(waiter.promise);if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t$24(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null)}else uploadQueue.push(row)}pumpQueue();return(await Promise.all(waiters)).filter(attachment=>attachment&&attachments.value.some(candidate=>candidate.clientId===attachment.clientId))}const stopSessionWatch=watch(()=>assistantAttachmentSessionId(sessionId),(nextSessionId,previousSessionId)=>{if(nextSessionId!==previousSessionId&&previousSessionId)abandonAttachments({onlySessionId:previousSessionId})},{flush:`sync`});if(getCurrentScope())onScopeDispose(()=>{disposeAttachments()});return{maxBytes,maxItems,abandonAttachments,aggregateProgress,attachments,atCapacity,canAddFiles,cancelAttachment,canSubmit,clearAttachments,clearStatus,disposeAttachments,dragActive,hasUnresolved,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,queueItems,removeAttachment,resetDragState,retryAttachment,status,uploading,uploadFiles,uploadFileProducer,waitForAttachmentCleanup}}var _hoisted_1$64=[`alt`,`src`];var _hoisted_2$54={key:1};var _sfc_main$88={__name:`AssistantAttachmentPreview`,props:{attachment:{type:Object,default:null},previewUrl:{type:String,default:``},downloadUrl:{type:String,required:true}},emits:[`close`],setup(__props,{emit:__emit}){const{t}=useJskitText();const props=__props;const emit=__emit;const imageFailed=ref(false);watch(()=>[props.attachment,props.previewUrl],()=>{imageFailed.value=false});return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":Boolean(__props.attachment),"max-width":`960`,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>!$event&&emit(`close`))},{default:withCtx(()=>[__props.attachment?(openBlock(),createBlock(VCard,{key:0,title:__props.attachment.fileName},{default:withCtx(()=>[createVNode(VCardText,null,{default:withCtx(()=>[__props.previewUrl&&!imageFailed.value?(openBlock(),createElementBlock(`img`,{key:__props.previewUrl,alt:__props.attachment.fileName,class:`assistant-attachment-preview`,src:__props.previewUrl,onError:_cache[0]||(_cache[0]=$event=>imageFailed.value=true)},null,40,_hoisted_1$64)):(openBlock(),createElementBlock(`p`,_hoisted_2$54,toDisplayString(unref(t)(`jskit.assistant.attachments.previewUnavailable`)),1))]),_:1}),createVNode(VCardActions,null,{default:withCtx(()=>[createVNode(VBtn,{href:__props.downloadUrl,download:__props.attachment.fileName,"prepend-icon":`$download`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.attachments.download`)),1)]),_:1},8,[`href`,`download`]),createVNode(VSpacer),createVNode(VBtn,{onClick:_cache[1]||(_cache[1]=$event=>emit(`close`))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.attachments.close`)),1)]),_:1})]),_:1})]),_:1},8,[`title`])):createCommentVNode(``,true)]),_:1},8,[`model-value`])}}};var AssistantAttachmentPreview_default=_plugin_vue_export_helper_default(_sfc_main$88,[[`__scopeId`,`data-v-19946d64`]]);var applicationConversations=new WeakMap;function retainAssistantConversation(app,key,createRuntime,reader={active:true}){let conversations=applicationConversations.get(app);if(!conversations){conversations=new Map;applicationConversations.set(app,conversations)}let entry=conversations.get(key);if(!entry){const scope=effectScope(true);const readers=shallowReactive(new Map);const retain=()=>retainAssistantConversation(app,key,createRuntime);try{entry={scope,readers,runtime:app.runWithContext(()=>scope.run(()=>createRuntime(readers,retain)))};conversations.set(key,entry)}catch(error){scope.stop();throw error}}const token=Symbol(`conversation reader`);entry.readers.set(token,reader);return{runtime:entry.runtime,release(){if(!entry.readers.delete(token)||entry.readers.size)return;entry.scope.stop();conversations.delete(key)}}}var{serverMessage:serverMessage$2,t:t$23}=useJskitText();function turnMatchesOptimisticMessage(turn={},optimistic={}){const authored=optimistic.origin===`application`?turn.system:turn.user;const canonicalMessageId=normalizeText$1(authored?.messageId);const optimisticMessageId=normalizeText$1(optimistic.id);if(canonicalMessageId&&optimisticMessageId)return canonicalMessageId===optimisticMessageId;if(normalizeText$1(authored?.text)!==optimistic.text)return false;const userAtMs=Date.parse(String(authored?.at||``));return Number.isFinite(userAtMs)&&userAtMs>=optimistic.createdAtMs-5e3}function unmatchedOptimisticMessages(turns=[],optimisticMessages=[],{receiptsOnly=false}={}){const conversationTurns=Array.isArray(turns)?turns:[];const matchedTurnIndexes=new Set;return(Array.isArray(optimisticMessages)?optimisticMessages:[]).filter(message=>{const turnIndex=conversationTurns.findIndex((turn,index)=>!matchedTurnIndexes.has(index)&&turnMatchesOptimisticMessage(turn,message)&&(!receiptsOnly||message.status===`accepted`||(message.origin===`application`?turn.system:turn.user)?.receipt!==false));if(turnIndex<0)return true;matchedTurnIndexes.add(turnIndex);return false})}function createAssistantMessageDelivery({deliver:defaultDeliver}={}){const state=reactive({messages:[],sending:false});const acceptanceCallbacks=new WeakMap;let deliveryTail=null;let pendingSends=new Map;function find(messageId){return state.messages.find(message=>message.id===messageId)||null}function remove(messageId){state.messages=state.messages.filter(message=>message.id!==messageId)}function reconcile(turns){const unmatched=unmatchedOptimisticMessages(turns,state.messages,{receiptsOnly:true});const retained=new Set(unmatched.map(message=>message.id));for(const message of state.messages)if(!retained.has(message.id))accept(message.id);state.messages=unmatched}function turns(savedTurns=[]){const shown=[...savedTurns.map(turn=>{const message=state.messages.find(message=>message.status!==`accepted`&&turnMatchesOptimisticMessage(turn,message)&&(message.origin===`application`?turn.system:turn.user)?.receipt===false);if(!message)return turn;const pending=optimisticTurn(message);return{...turn,optimistic:pending.optimistic,...pending.system?{system:pending.system}:{}}})];for(const message of unmatchedOptimisticMessages(savedTurns,state.messages)){const turn=optimisticTurn(message);const later=message.status!==`failed`?-1:shown.findIndex(saved=>!saved.optimistic&&Date.parse((saved.user||saved.system)?.at||``)>message.createdAtMs);if(later<0)shown.push(turn);else shown.splice(later,0,turn)}return shown}function optimisticTurn(message){const role=message.origin===`application`?`system`:`user`;const authored={attachments:message.attachments,at:message.createdAt,messageId:message.id,role,text:message.text};const status=message.status===`uncertain`?{role:`system`,text:t$23(`jskit.assistant.delivery.notConfirmed`),delivery:{messageId:message.id,error:message.error,checking:message.checking===true}}:null;return{optimistic:{error:message.error,id:message.id,status:message.status,...message.status===`pending`&&message.waiting?{waiting:message.waiting}:{},...message.cancelling?{cancelling:true}:{},...message.cancelError?{cancelError:message.cancelError}:{}},turnId:message.id,[role]:authored,...status?{system:role===`system`?{...authored,...status,text:`${authored.text}\n\n${status.text}`}:status}:{}}}async function send(payload,{messageId=crypto.randomUUID(),deliver=defaultDeliver,isCurrent=()=>true,receiptTurns=null,onAccepted,uncertainOnError=false,queue=false}={}){if(state.sending&&!queue||pendingSends.has(messageId)||find(messageId)?.status===`uncertain`||find(messageId)?.cancelling||!normalizeText$1(payload?.message)&&!payload?.displayAttachments?.length)return false;if(typeof deliver!==`function`)throw new TypeError(`Message delivery requires a deliver function.`);const snapshot=JSON.parse(JSON.stringify(payload));const previous=find(messageId);const acknowledge=previous&&acceptanceCallbacks.get(toRaw(previous))||onAccepted;const ownerPendingSends=pendingSends;const current=()=>pendingSends===ownerPendingSends&&isCurrent();const predecessor=deliveryTail;const knownUncertain=new Set(state.messages.filter(entry=>entry.status===`uncertain`).map(entry=>entry.id));const settled=Promise.withResolvers();deliveryTail=settled.promise;ownerPendingSends.set(messageId,settled);const now=new Date;const message={attachments:snapshot.displayAttachments||[],createdAt:now.toISOString(),createdAtMs:now.getTime(),error:``,id:messageId,payload:snapshot,status:`pending`,text:String(snapshot.displayMessage||snapshot.message||``).trim()};if(typeof acknowledge===`function`)acceptanceCallbacks.set(message,acknowledge);state.messages=[...state.messages.filter(entry=>entry.id!==messageId),message];state.sending=true;let stopReceipt;try{if(predecessor)await predecessor;if(!current())return false;if(find(messageId)?.cancelling)return false;if(uncertainOnError&&state.messages.some(entry=>entry.id!==messageId&&entry.status===`uncertain`&&!knownUncertain.has(entry.id))){fail(messageId,t$23(`jskit.assistant.delivery.checkPrevious`));return false}let receipt;if(receiptTurns!==null){receipt=Promise.withResolvers();settled.receipt=receipt;stopReceipt=watch([current,()=>toValue(receiptTurns)],([isCurrent,turns])=>{if(!isCurrent)receipt.resolve(false);else if(turns?.some(turn=>turn.user?.messageId===messageId&&turn.user.receipt!==false))receipt.resolve({ok:true})},{immediate:true})}const submitted=deliver({...snapshot,messageId});const response=await(receipt?Promise.race([submitted,receipt.promise]):submitted);if(!current())return false;if(response===false||response?.ok===false)fail(messageId,response?.error||t$23(`jskit.assistant.delivery.notSent`),response?.status===`uncertain`?`uncertain`:`failed`);else accept(messageId);return response}catch(error){if(!current())return false;if(find(messageId)?.status===`accepted`)return{ok:true};fail(messageId,error,uncertainOnError||error?.status===`uncertain`?`uncertain`:`failed`);throw error}finally{stopReceipt?.();ownerPendingSends.delete(messageId);if(pendingSends===ownerPendingSends){state.sending=ownerPendingSends.size>0;if(!state.sending)deliveryTail=null}settled.resolve()}}function fail(messageId,error,status=`failed`){const message=find(messageId);if(message&&message.status!==`accepted`){const text=error&&typeof error===`object`?serverMessage$2(error):``;message.error=String(text||error?.message||error||t$23(`jskit.assistant.delivery.notSent`)).trim();message.status=status}}function accept(messageId){const message=find(messageId);if(message){message.status=`accepted`;message.error=``}pendingSends.get(messageId)?.receipt?.resolve({ok:true});if(message){const entry=toRaw(message);const acknowledge=acceptanceCallbacks.get(entry);acceptanceCallbacks.delete(entry);acknowledge?.()}}function wait(messageId,reason=``){const message=find(messageId);if(message?.status===`pending`)message.waiting=String(reason||``).trim()}function rejectUnsent(messageId,error){if(find(messageId)?.status!==`uncertain`)return false;fail(messageId,error);return true}function restoreUncertain(request,savedTurns=[]){const messageId=normalizeText$1(request?.messageId);if(!messageId||savedTurns.some(turn=>(turn.user||turn.system)?.messageId===messageId&&(turn.user||turn.system).receipt!==false)||find(messageId)?.status===`accepted`)return false;if(!find(messageId)){const payload=JSON.parse(JSON.stringify({message:request.text||``,displayAttachments:request.attachments||[]}));const createdAt=request.at||new Date().toISOString();state.messages=[...state.messages,{id:messageId,payload,text:payload.message,origin:request.origin,attachments:payload.displayAttachments,createdAt,createdAtMs:Date.parse(createdAt),status:`uncertain`,error:``}]}fail(messageId,(request.error?serverMessage$2({message:request.error,messageCode:request.errorMessageCode,messageParams:request.errorMessageParams}):``)||t$23(`jskit.assistant.delivery.unconfirmed`),`uncertain`);pendingSends.get(messageId)?.receipt?.resolve({ok:false,status:`uncertain`,error:request.error});return true}function cancel(messageId){const message=find(messageId);if(!message||message.status===`accepted`||message.cancelling)return false;message.cancelling=true;message.cancelError=``;return true}function cancelFailed(messageId,error=``){const message=find(messageId);if(!message)return;message.cancelling=false;message.cancelError=String(error||t$23(`jskit.assistant.delivery.cancelUnreachable`)).trim()}function edit(messageId,draft=``){const message=find(messageId);if(message?.status!==`failed`||message.cancelling)return null;remove(messageId);return draftWithRestoredMessage(message.text,draft)}function resend(messageId,{queue=false}={}){const message=find(messageId);if(message?.status!==`failed`)return false;return send(message.payload,{messageId,queue})}function reset(){deliveryTail=null;for(const pending of pendingSends.values()){pending.receipt?.resolve(false);pending.resolve()}pendingSends=new Map;state.messages=[];state.sending=false}return{accept,cancel,cancelFailed,edit,find,reconcile,remove,resend,reset,restoreUncertain,rejectUnsent,send,state,turns,wait}}function draftWithRestoredMessage(text=``,draft=``){return!draft||draft.startsWith(text)?draft||text:`${text}\n\n${draft}`}var IDLE_GESTURES=Object.freeze([`glance-left`,`tiny-nod`,`glance-right`,`brow-lift`,`glance-up`,`curious-tilt`,`smile-brighten`,`friendly-lean`,`shoulder-lift`,`earring-sway`]);var IDLE_MOUTH_POSES=Object.freeze({"tiny-nod":`warm-smile`,"curious-tilt":`warm-smile`,"smile-brighten":`smile`,"friendly-lean":`warm-smile`});var IDLE_GESTURE_DURATION_MS=1100;var LISTENING_EXPRESSIONS=Object.freeze([`attentive`,`tiny-nod`,`follow-left`,`tilt-left`,`follow-right`,`tilt-right`]);var LISTENING_MOUTH_POSES=Object.freeze({"attentive":`soft-smile`,"tiny-nod":`soft-smile`});var PRE_THINKING_EXPRESSIONS=Object.freeze([`settle`,`glance-left`,`center`,`glance-right`,`tiny-tilt`,`ready`]);var PRE_THINKING_MOUTH_POSES=Object.freeze({"ready":`soft-smile`,"tiny-tilt":`thoughtful`});var THINKING_EXPRESSIONS=Object.freeze([`look-up-left`,`focus`,`look-up-right`,`weigh-left`,`weigh-right`,`idea`]);var THINKING_MOUTH_POSES=Object.freeze({"idea":`soft-smile`,"weigh-left":`closed`,"weigh-right":`closed`});var ACTIVE_EXPRESSION_DURATION_MS=Object.freeze({listening:1350,"pre-thinking":1450,thinking:1700});var ACTIVE_EXPRESSION_SEQUENCES=Object.freeze({listening:LISTENING_EXPRESSIONS,"pre-thinking":PRE_THINKING_EXPRESSIONS,thinking:THINKING_EXPRESSIONS});function notFollowing(){}function useVoiceAvatar(props){const blinking=ref(false);const activeExpression=ref(``);const idleGesture=ref(``);const prefersReducedMotion=ref(false);const reducedMotion=computed(()=>props.still===true||prefersReducedMotion.value);let blinkTimer=0;let activeExpressionTimer=0;const activeExpressionIndexes={listening:Math.floor(Math.random()*LISTENING_EXPRESSIONS.length),"pre-thinking":Math.floor(Math.random()*PRE_THINKING_EXPRESSIONS.length),thinking:Math.floor(Math.random()*THINKING_EXPRESSIONS.length)};let idleGestureIndex=Math.floor(Math.random()*IDLE_GESTURES.length);let idleGestureTimer=0;let reopenTimer=0;let stopFollowingReducedMotion=notFollowing;const expression=computed(()=>String(props.state||`idle`));const visibleMouthPose=computed(()=>{if(expression.value===`idle`)return IDLE_MOUTH_POSES[idleGesture.value]||`soft-smile`;if(expression.value===`thinking`)return THINKING_MOUTH_POSES[activeExpression.value]||`thoughtful`;if(expression.value===`pre-thinking`)return PRE_THINKING_MOUTH_POSES[activeExpression.value]||`closed`;if(expression.value===`listening`)return LISTENING_MOUTH_POSES[activeExpression.value]||`closed`;if(expression.value!==`speaking`)return`closed`;const pose=String(props.mouthPose||`closed`);if(props.still===true||props.mouthLevel<.045||![`open`,`round`,`small`,`wide`].includes(pose))return`closed`;return pose});function clearBlinkTimers(){window.clearTimeout(blinkTimer);window.clearTimeout(reopenTimer);blinkTimer=0;reopenTimer=0}function clearIdleGesture(){window.clearTimeout(idleGestureTimer);idleGestureTimer=0;idleGesture.value=``}function clearActiveExpression(){window.clearTimeout(activeExpressionTimer);activeExpressionTimer=0;activeExpression.value=``}function scheduleBlink(delay=2800+Math.random()*3400){window.clearTimeout(blinkTimer);if(reducedMotion.value)return;blinkTimer=window.setTimeout(()=>{const doubleBlink=Math.random()<.16;blinking.value=true;reopenTimer=window.setTimeout(()=>{blinking.value=false;if(!doubleBlink){scheduleBlink();return}blinkTimer=window.setTimeout(()=>{blinking.value=true;reopenTimer=window.setTimeout(()=>{blinking.value=false;scheduleBlink()},115)},155)},135)},delay)}function scheduleIdleGesture(delay=2400+Math.random()*2800){window.clearTimeout(idleGestureTimer);if(reducedMotion.value||expression.value!==`idle`)return;idleGestureTimer=window.setTimeout(()=>{idleGesture.value=IDLE_GESTURES[idleGestureIndex];idleGestureIndex=(idleGestureIndex+1)%IDLE_GESTURES.length;idleGestureTimer=window.setTimeout(()=>{idleGesture.value=``;scheduleIdleGesture()},IDLE_GESTURE_DURATION_MS)},delay)}function showNextActiveExpression(){const state=expression.value;const sequence=ACTIVE_EXPRESSION_SEQUENCES[state]||[];if(!sequence.length){clearActiveExpression();return}const index=activeExpressionIndexes[state]||0;activeExpression.value=sequence[index];activeExpressionIndexes[state]=(index+1)%sequence.length;if(!reducedMotion.value)activeExpressionTimer=window.setTimeout(showNextActiveExpression,ACTIVE_EXPRESSION_DURATION_MS[state])}function restartMotion(){clearBlinkTimers();clearActiveExpression();clearIdleGesture();blinking.value=false;if(ACTIVE_EXPRESSION_SEQUENCES[expression.value])showNextActiveExpression();if(!reducedMotion.value){scheduleBlink();scheduleIdleGesture()}}function updateReducedMotion(event){prefersReducedMotion.value=Boolean(event.matches);restartMotion()}watch(()=>props.still===true,restartMotion);watch(expression,()=>{clearActiveExpression();clearIdleGesture();if(ACTIVE_EXPRESSION_SEQUENCES[expression.value])showNextActiveExpression();else if(!reducedMotion.value)scheduleIdleGesture(900+Math.random()*1200)});onMounted(()=>{const reducedMotionQuery=followMediaQuery$1(`(prefers-reduced-motion: reduce)`,updateReducedMotion);prefersReducedMotion.value=reducedMotionQuery.matches;stopFollowingReducedMotion=reducedMotionQuery.stop;if(!reducedMotion.value){scheduleBlink(1800+Math.random()*1800);scheduleIdleGesture(900+Math.random()*1500)}if(ACTIVE_EXPRESSION_SEQUENCES[expression.value])showNextActiveExpression()});onBeforeUnmount(()=>{clearBlinkTimers();clearActiveExpression();clearIdleGesture();stopFollowingReducedMotion();stopFollowingReducedMotion=notFollowing});return{blinking,activeExpression,idleGesture,expression,visibleMouthPose,reducedMotion}}var _hoisted_1$63=[`aria-label`];var _hoisted_2$53=[`cx`,`ry`];var _hoisted_3$46=[`rx`,`ry`];var _sfc_main$87={__name:`VoiceAvatar`,props:{state:{type:String,default:`idle`},mouthPose:{type:String,default:`closed`},mouthLevel:{type:Number,default:0},still:{type:Boolean,default:false}},setup(__props){const props=__props;const{blinking,visibleMouthPose,reducedMotion}=useVoiceAvatar(props);const{t}=useJskitText();const mouthHeight=computed(()=>reducedMotion.value||visibleMouthPose.value===`closed`?3:Math.max(4,Math.min(18,props.mouthLevel*28)));return(_ctx,_cache)=>{return openBlock(),createElementBlock(`svg`,{viewBox:`0 0 128 128`,"aria-label":unref(t)(`jskit.assistant.voice.avatar.label`),role:`img`,class:`voice-avatar`},[_cache[0]||(_cache[0]=createBaseVNode(`circle`,{cx:`64`,cy:`64`,r:`59`,fill:`currentColor`,opacity:`.1`},null,-1)),_cache[1]||(_cache[1]=createBaseVNode(`rect`,{x:`25`,y:`31`,width:`78`,height:`66`,rx:`24`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`},null,-1)),_cache[2]||(_cache[2]=createBaseVNode(`path`,{d:`M64 31V21`,stroke:`currentColor`,"stroke-width":`3`},null,-1)),_cache[3]||(_cache[3]=createBaseVNode(`circle`,{cx:`64`,cy:`18`,r:`4`,fill:`currentColor`},null,-1)),(openBlock(),createElementBlock(Fragment,null,renderList([47,81],x=>{return createBaseVNode(`ellipse`,{key:x,cx:x,cy:`55`,rx:`5`,ry:unref(blinking)?1:7,fill:`currentColor`},null,8,_hoisted_2$53)}),64)),createBaseVNode(`ellipse`,{cx:`64`,cy:`77`,rx:unref(visibleMouthPose)===`round`?6:15,ry:mouthHeight.value,fill:`currentColor`},null,8,_hoisted_3$46)],8,_hoisted_1$63)}}};var VoiceAvatar_default=_plugin_vue_export_helper_default(_sfc_main$87,[[`__scopeId`,`data-v-387d1d29`]]);function ignoreLauncherError(){}function useVoiceLauncher({open,enabled=true,onTap,onError=ignoreLauncherError}){const tappable=typeof onTap===`function`;const holding=ref(false);let input=null;let timer;let suppressClick=false;let revision=0;let session;function report(operation){Promise.resolve(operation).catch(onError)}function begin(identity,delay){suppressClick=false;input=identity;const expected=++revision;timer=setTimeout(()=>{holding.value=true;report((async()=>{const opened=await open();if(expected!==revision||!holding.value||!opened)return;session=opened;await session.startHeldRecording()})())},delay)}function pointerDown(event){if(!toValue(enabled)||event.button!==0||event.isPrimary===false||input!==null)return;event.currentTarget.setPointerCapture(event.pointerId);begin(event.pointerId,350)}function keyDown(event){if(!toValue(enabled)||event.repeat||input!==null||![` `,`Enter`].includes(event.key))return;begin(event.key,tappable?350:0)}function finish(discard){clearTimeout(timer);const keyboard=typeof input===`string`;input=null;++revision;if(!holding.value){if(!discard&&keyboard&&tappable)report(onTap());return}holding.value=false;suppressClick=true;if(session)report(discard?session.discardHeldRecording():session.finishHeldRecording());session=null}function pointerUp(event){if(event.pointerId===input)finish(false)}function keyUp(event){if(event.key===input)finish(false)}function cancel(event){if(event?.pointerId!==void 0&&event.pointerId!==input)return;finish(true)}function click(event){const suppressed=suppressClick&&event.detail!==0;suppressClick=false;if(suppressed){event.preventDefault();event.stopImmediatePropagation();return}if(toValue(enabled)&&tappable)report(onTap())}onScopeDispose(cancel);return{holding,pointerDown,pointerUp,keyDown,keyUp,cancel,click}}var _hoisted_1$62=[`disabled`];var _hoisted_2$52=[`disabled`];var _hoisted_3$45=[`title`];var _hoisted_4$37=[`aria-label`];var _hoisted_5$35={key:3,class:`assistant-voice-controls__status`,role:`status`};var _hoisted_6$30=[`aria-label`];var _hoisted_7$29={class:`assistant-voice__review-actions`};var _hoisted_8$27=[`disabled`,`aria-label`];var _hoisted_9$26={key:0,class:`assistant-voice-controls__stop`};var _hoisted_10$21={class:`assistant-voice__talk-action`};var _hoisted_11$19={key:0,class:`assistant-voice-controls__icon-disc`};var _hoisted_12$18={class:`assistant-voice-controls__icon-disc`};var _hoisted_13$17=[`id`];var _sfc_main$86={__name:`VoiceConversationControls`,props:{session:{type:Object,required:true},disabled:{type:Boolean,default:false},speakerDisabled:{type:Boolean,default:false},compact:{type:Boolean,default:false},iconOnly:{type:Boolean,default:false},reviewInTranscript:{type:Boolean,default:false},toolsTarget:{type:Object,default:null},feedbackTarget:{type:Object,default:null}},setup(__props){const props=__props;const{targetLabel,voice,error,microphoneMuted,live,starting,callMode,callStatus,speechActive,heldTranscript,capturing,pendingTranscript,pushHolding,sending,stopSpeech,startPushToTalk,finishPushToTalk,cancelPushToTalk,toggleHandsFree,readAloud,toggleReadAloud,enableSound,deliverTranscript,discardHeldRecording,editTranscript}=props.session;const{t}=useJskitText();const controlStatus=computed(()=>{if(props.iconOnly&&voice.listening.value&&!starting.value&&!error.value&&!voice.error.value)return``;if(!props.compact||!props.session.hasUnsentSpeech.value)return callStatus.value;if(pendingTranscript.value)return props.reviewInTranscript?``:t(`jskit.assistant.voice.controls.sendOrDiscard`);if(live.value&&callMode.value===`hands-free`&&voice.listening.value&&!microphoneMuted.value)return t(`jskit.assistant.voice.controls.listening`);return voice.listening.value?t(`jskit.assistant.voice.controls.recordingFinish`):t(`jskit.assistant.voice.controls.finishSpeech`)});const handsFreeListening=computed(()=>live.value&&callMode.value===`hands-free`&&voice.listening.value&&!microphoneMuted.value);const canTalk=computed(()=>!props.disabled&&(!capturing.value||voice.listening.value||pushHolding.value||starting.value));const talkLabel=computed(()=>t(starting.value?`jskit.assistant.voice.controls.connecting`:pushHolding.value?`jskit.assistant.voice.controls.releaseToSend`:handsFreeListening.value?`jskit.assistant.voice.controls.pause`:`jskit.assistant.voice.controls.talk`));const gestureHint=useId();const gesture=useVoiceLauncher({enabled:canTalk,open:()=>({startHeldRecording:startPushToTalk,finishHeldRecording:finishPushToTalk,discardHeldRecording:cancelPushToTalk}),onTap:toggleHandsFree,onError:cause=>{error.value=voiceErrorText(cause)}});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`fieldset`,{class:normalizeClass([`assistant-voice-controls`,{"assistant-voice-controls--compact":__props.compact}]),disabled:__props.disabled},[(openBlock(),createBlock(Teleport,{to:__props.feedbackTarget,disabled:!__props.feedbackTarget},[createBaseVNode(`fieldset`,{class:normalizeClass([`assistant-voice-controls__feedback`,{"assistant-voice-controls__feedback--compact":__props.compact}]),disabled:__props.disabled},[unref(error)||unref(voice).error.value?(openBlock(),createElementBlock(`p`,{key:0,class:normalizeClass([`assistant-voice__error`,{"text-body-small":__props.compact}]),role:`alert`},toDisplayString(unref(error)||unref(voice).error.value),3)):createCommentVNode(``,true),controlStatus.value?(openBlock(),createElementBlock(`p`,{key:1,class:`assistant-voice-controls__status text-body-small`,role:`status`,title:unref(callStatus)},toDisplayString(controlStatus.value),9,_hoisted_3$45)):createCommentVNode(``,true),__props.compact&&!__props.reviewInTranscript&&unref(heldTranscript)&&!unref(pendingTranscript)?(openBlock(),createElementBlock(`p`,{key:2,class:`assistant-voice-controls__provisional`,role:`status`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.recognizedWords`)},toDisplayString(unref(t)(`jskit.assistant.voice.controls.notSent`,{words:unref(heldTranscript)})),9,_hoisted_4$37)):createCommentVNode(``,true),unref(readAloud)&&unref(voice).playbackBlocked.value?(openBlock(),createElementBlock(`p`,_hoisted_5$35,toDisplayString(unref(t)(`jskit.assistant.voice.controls.soundBlocked`)),1)):createCommentVNode(``,true),unref(readAloud)&&unref(voice).playbackBlocked.value?(openBlock(),createBlock(VBtn,{key:4,"min-height":`48`,onClick:unref(enableSound)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.controls.enableSound`)),1)]),_:1},8,[`onClick`])):createCommentVNode(``,true),!__props.reviewInTranscript&&unref(pendingTranscript)&&(unref(pendingTranscript).reviewBeforeSend||!unref(sending))?(openBlock(),createElementBlock(`section`,{key:5,class:`assistant-voice__review`,"aria-label":unref(t)(`jskit.assistant.voice.controls.review`)},[createVNode(VTextarea,{class:`assistant-voice__review-input`,"model-value":unref(pendingTranscript).text,label:unref(t)(`jskit.assistant.voice.controls.reviewMessage`),disabled:unref(sending),density:__props.compact?`compact`:`default`,rows:__props.compact?1:2,"max-rows":__props.compact?2:3,"auto-grow":``,"hide-details":``,"onUpdate:modelValue":unref(editTranscript)},null,8,[`model-value`,`label`,`disabled`,`density`,`rows`,`max-rows`,`onUpdate:modelValue`]),createBaseVNode(`div`,_hoisted_7$29,[createVNode(VBtn,{disabled:unref(sending),"min-height":`48`,onClick:unref(discardHeldRecording)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.controls.discard`)),1)]),_:1},8,[`disabled`,`onClick`]),createVNode(VBtn,{disabled:unref(sending)||!unref(pendingTranscript).text.trim(),"min-height":`48`,color:`primary`,onClick:unref(deliverTranscript)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(sending)?unref(t)(`jskit.assistant.voice.controls.sending`):unref(t)(`jskit.assistant.voice.controls.send`)),1)]),_:1},8,[`disabled`,`onClick`])])],8,_hoisted_6$30)):createCommentVNode(``,true)],10,_hoisted_2$52)],8,[`to`,`disabled`])),(openBlock(),createBlock(Teleport,{to:__props.toolsTarget,disabled:!__props.toolsTarget},[createBaseVNode(`fieldset`,{class:normalizeClass([`assistant-voice-controls__tools`,{"assistant-voice-controls__tools--compact":__props.compact,"assistant-voice-controls__tools--icons":__props.iconOnly}]),disabled:__props.disabled,"aria-label":unref(t)(`jskit.assistant.voice.controls.label`,{target:unref(targetLabel)})},[__props.compact||__props.iconOnly||unref(speechActive)?(openBlock(),createElementBlock(`div`,_hoisted_9$26,[unref(speechActive)?(openBlock(),createBlock(VBtn,{key:0,icon:`$stop`,variant:`text`,"min-width":`48`,"min-height":`48`,"aria-label":unref(t)(`jskit.assistant.voice.controls.stopTargetSpeaking`,{target:unref(targetLabel)}),title:unref(t)(`jskit.assistant.voice.controls.stopSpeaking`),onClick:unref(stopSpeech)},null,8,[`aria-label`,`title`,`onClick`])):createCommentVNode(``,true)])):createCommentVNode(``,true),renderSlot(_ctx.$slots,`work-control`,{},void 0,true),createBaseVNode(`div`,_hoisted_10$21,[createVNode(VBtn,{class:`assistant-voice__talk`,color:`primary`,variant:__props.iconOnly?`text`:handsFreeListening.value?`tonal`:`flat`,"min-height":__props.iconOnly?44:__props.compact?48:64,rounded:`xl`,icon:__props.iconOnly?unref(voice).listening.value&&!unref(microphoneMuted)?`$mic`:`$micOff`:void 0,"prepend-icon":__props.iconOnly?void 0:unref(voice).listening.value&&!unref(microphoneMuted)?`$mic`:`$micOff`,"aria-label":__props.iconOnly?talkLabel.value:void 0,title:unref(t)(`jskit.assistant.voice.controls.talkHint`),"aria-pressed":handsFreeListening.value||unref(pushHolding),"aria-describedby":unref(gestureHint),disabled:!canTalk.value,slim:__props.compact||__props.iconOnly,width:__props.iconOnly?40:__props.compact?148:void 0,"min-width":__props.iconOnly?40:__props.compact?148:void 0,onPointerdown:unref(gesture).pointerDown,onPointerup:unref(gesture).pointerUp,onPointercancel:unref(gesture).cancel,onLostpointercapture:unref(gesture).cancel,onKeydown:[withKeys(withModifiers(unref(gesture).keyDown,[`prevent`]),[`space`]),withKeys(withModifiers(unref(gesture).keyDown,[`prevent`]),[`enter`])],onKeyup:[withKeys(withModifiers(unref(gesture).keyUp,[`prevent`]),[`space`]),withKeys(withModifiers(unref(gesture).keyUp,[`prevent`]),[`enter`])],onBlur:unref(gesture).cancel,onContextmenu:_cache[0]||(_cache[0]=withModifiers(()=>{},[`prevent`])),onClick:unref(gesture).click},{default:withCtx(()=>[__props.iconOnly?(openBlock(),createElementBlock(`span`,_hoisted_11$19,[createVNode(VIcon,{size:`20`,icon:unref(voice).listening.value&&!unref(microphoneMuted)?`$mic`:`$micOff`},null,8,[`icon`])])):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(talkLabel.value),1)],64))]),_:1},8,[`variant`,`min-height`,`icon`,`prepend-icon`,`aria-label`,`title`,`aria-pressed`,`aria-describedby`,`disabled`,`slim`,`width`,`min-width`,`onPointerdown`,`onPointerup`,`onPointercancel`,`onLostpointercapture`,`onKeydown`,`onKeyup`,`onBlur`,`onClick`]),createVNode(VBtn,{icon:unref(readAloud)?`$volumeHigh`:`$volumeOff`,"aria-pressed":unref(readAloud),variant:__props.iconOnly?`text`:`tonal`,color:__props.iconOnly?`primary`:void 0,"min-height":__props.iconOnly?44:__props.compact?48:64,width:__props.iconOnly?40:void 0,"min-width":__props.iconOnly?40:__props.compact?48:64,rounded:`xl`,"aria-label":unref(readAloud)?unref(t)(`jskit.assistant.voice.controls.readAloudOff`,{target:unref(targetLabel)}):unref(t)(`jskit.assistant.voice.controls.readAloudOn`,{target:unref(targetLabel)}),title:unref(readAloud)?unref(t)(`jskit.assistant.voice.controls.spokenRepliesOn`):unref(t)(`jskit.assistant.voice.controls.spokenRepliesOff`),disabled:__props.speakerDisabled||__props.session.readAloudChangePending.value,onClick:unref(toggleReadAloud)},createSlots({_:2},[__props.iconOnly?{name:`default`,fn:withCtx(()=>[createBaseVNode(`span`,_hoisted_12$18,[createVNode(VIcon,{size:`20`,icon:unref(readAloud)?`$volumeHigh`:`$volumeOff`},null,8,[`icon`])])]),key:`0`}:void 0]),1032,[`icon`,`aria-pressed`,`variant`,`color`,`min-height`,`width`,`min-width`,`aria-label`,`title`,`disabled`,`onClick`]),renderSlot(_ctx.$slots,`settings-control`,{},void 0,true),createBaseVNode(`p`,{id:unref(gestureHint),class:`text-body-small on-surface-variant`},toDisplayString(handsFreeListening.value?unref(t)(`jskit.assistant.voice.controls.tapToPause`):unref(t)(`jskit.assistant.voice.controls.tapForHandsFree`)),9,_hoisted_13$17)])],10,_hoisted_8$27)],8,[`to`,`disabled`]))],10,_hoisted_1$62)}}};var VoiceConversationControls_default=_plugin_vue_export_helper_default(_sfc_main$86,[[`__scopeId`,`data-v-e07aa2e4`]]);var _hoisted_1$61=[`disabled`];var _hoisted_2$51=[`aria-label`,`title`];var _hoisted_3$44=[`aria-label`,`title`];var _hoisted_4$36=[`disabled`];var _hoisted_5$34=[`aria-label`];var _hoisted_6$29={key:0,class:`assistant-voice__call-body`};var _hoisted_7$28=[`aria-label`];var _hoisted_8$26=[`aria-label`];var _hoisted_9$25={class:`text-label-medium`};var _hoisted_10$20={class:`assistant-voice__caption-text text-body-medium`};var _hoisted_11$18=[`aria-label`];var _hoisted_12$17={class:`text-label-medium`};var _hoisted_13$16={class:`assistant-voice__caption-text text-body-medium`};var _sfc_main$85={__name:`VoiceConversation`,props:{session:{type:Object,required:true},disabled:{type:Boolean,default:false},adapter:{type:Object,default:null},showAvatar:{type:Boolean,default:true},avatarSize:{type:String,default:`compact`}},emits:[`update:avatarSize`],setup(__props){const props=__props;const{t}=useJskitText();const{targetLabel,voice,microphoneMuted,heldTranscript,pendingTranscript,sending,avatarVisual,callAudioLevel,voiceWords,voiceAnswer}=props.session;const presentationAdapter=computed(()=>props.adapter&&{...props.adapter,composer:{...props.adapter.composer,canSend:props.adapter.composer?.canSend&&!props.session.composerBlocked.value}});const toolsTarget=ref(null);const voiceWordsTarget=ref(null);const voiceAnswerTarget=ref(null);const followWords=ref(true);const followAnswer=ref(true);const youLabel=computed(()=>{if(heldTranscript.value&&voice.listening.value&&!microphoneMuted.value)return t(`jskit.assistant.voice.conversation.youHearing`);if(pendingTranscript.value&&!sending.value)return t(`jskit.assistant.voice.conversation.youNotSent`);return t(`jskit.assistant.voice.conversation.you`)});function isAtBottom(element){return element.scrollHeight-element.scrollTop-element.clientHeight<24}function followCaption(target,following){if(target.value&&following.value)target.value.scrollTop=target.value.scrollHeight}watch(voiceWords,()=>followCaption(voiceWordsTarget,followWords),{flush:`post`});watch(voiceAnswer,()=>followCaption(voiceAnswerTarget,followAnswer),{flush:`post`});return(_ctx,_cache)=>{return __props.adapter?(openBlock(),createElementBlock(`fieldset`,{key:0,class:`assistant-voice-conversation`,disabled:__props.disabled},[createVNode(unref(AssistantConversationElement_default),{adapter:presentationAdapter.value,"avatar-size":__props.avatarSize,"onUpdate:avatarSize":_cache[0]||(_cache[0]=$event=>_ctx.$emit(`update:avatarSize`,$event))},createSlots({"avatar-control":withCtx(scope=>[renderSlot(_ctx.$slots,`avatar-control`,normalizeProps(guardReactiveProps(scope)),()=>[scope.size===`hidden`&&unref(voice).listening.value&&!unref(microphoneMuted)?(openBlock(),createElementBlock(`span`,{key:0,role:`img`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.listening`),title:unref(t)(`jskit.assistant.voice.conversation.listening`)},[createVNode(VIcon,{icon:`$mic`,size:`20`,"aria-hidden":`true`})],8,_hoisted_2$51)):createCommentVNode(``,true),scope.size===`hidden`&&unref(voice).speaking.value?(openBlock(),createElementBlock(`span`,{key:1,role:`img`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.speaking`),title:unref(t)(`jskit.assistant.voice.conversation.speaking`)},[createVNode(VIcon,{icon:`$volumeHigh`,size:`20`,"aria-hidden":`true`})],8,_hoisted_3$44)):createCommentVNode(``,true)],true)]),"composer-feedback":withCtx(()=>[createVNode(VoiceConversationControls_default,{session:__props.session,disabled:__props.disabled,compact:``,"icon-only":__props.showAvatar,"tools-target":toolsTarget.value,"review-in-transcript":Boolean(presentationAdapter.value?.conversation?.previewMessage)},{"work-control":withCtx(()=>[renderSlot(_ctx.$slots,`work-control`,{},void 0,true)]),"settings-control":withCtx(()=>[renderSlot(_ctx.$slots,`settings-control`,{},void 0,true)]),_:3},8,[`session`,`disabled`,`icon-only`,`tools-target`,`review-in-transcript`])]),_:2},[__props.showAvatar?{name:`avatar`,fn:withCtx(size=>[renderSlot(_ctx.$slots,`avatar`,mergeProps(unref(avatarVisual),{size:size.size,height:size.height}),()=>[createVNode(VoiceAvatar_default,normalizeProps(guardReactiveProps(unref(avatarVisual))),null,16)],true)]),key:`0`}:void 0,__props.showAvatar?{name:`avatar-tools`,fn:withCtx(()=>[createBaseVNode(`div`,{ref_key:`toolsTarget`,ref:toolsTarget,class:`assistant-voice-conversation__tools`},null,512)]),key:`1`}:void 0]),1032,[`adapter`,`avatar-size`])],8,_hoisted_1$61)):(openBlock(),createElementBlock(`fieldset`,{key:1,class:`assistant-voice`,disabled:__props.disabled},[createBaseVNode(`section`,{class:normalizeClass([`assistant-voice__call`,{"assistant-voice__call--without-avatar":!__props.showAvatar}]),"aria-label":unref(t)(`jskit.assistant.voice.controls.label`,{target:unref(targetLabel)})},[__props.showAvatar?(openBlock(),createElementBlock(`div`,_hoisted_6$29,[createBaseVNode(`div`,{class:`assistant-voice__call-portrait`,style:normalizeStyle({"--call-audio-scale":1+unref(callAudioLevel)*.16}),"aria-hidden":`true`},[renderSlot(_ctx.$slots,`avatar`,normalizeProps(guardReactiveProps(unref(avatarVisual))),()=>[createVNode(VoiceAvatar_default,normalizeProps(guardReactiveProps(unref(avatarVisual))),null,16)],true)],4)])):createCommentVNode(``,true),createBaseVNode(`div`,{class:`assistant-voice__captions`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.captions`)},[createBaseVNode(`section`,{ref_key:`voiceWordsTarget`,ref:voiceWordsTarget,class:`assistant-voice__caption`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.recognizedWords`),tabindex:`0`,onScroll:_cache[1]||(_cache[1]=$event=>followWords.value=isAtBottom($event.currentTarget))},[createBaseVNode(`strong`,_hoisted_9$25,toDisplayString(youLabel.value),1),createBaseVNode(`p`,_hoisted_10$20,toDisplayString(unref(voiceWords)),1)],40,_hoisted_8$26),createBaseVNode(`section`,{ref_key:`voiceAnswerTarget`,ref:voiceAnswerTarget,class:`assistant-voice__caption`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.latestAnswer`,{target:unref(targetLabel)}),tabindex:`0`,onScroll:_cache[2]||(_cache[2]=$event=>followAnswer.value=isAtBottom($event.currentTarget))},[createBaseVNode(`strong`,_hoisted_12$17,toDisplayString(unref(targetLabel)),1),createBaseVNode(`p`,_hoisted_13$16,toDisplayString(unref(voiceAnswer)),1)],40,_hoisted_11$18)],8,_hoisted_7$28),createVNode(VoiceConversationControls_default,{session:__props.session,disabled:__props.disabled},{"work-control":withCtx(()=>[renderSlot(_ctx.$slots,`work-control`,{},void 0,true)]),"settings-control":withCtx(()=>[renderSlot(_ctx.$slots,`settings-control`,{},void 0,true)]),_:3},8,[`session`,`disabled`])],10,_hoisted_5$34)],8,_hoisted_4$36))}}};var VoiceConversation_default=_plugin_vue_export_helper_default(_sfc_main$85,[[`__scopeId`,`data-v-d87ffb3d`]]);var _sfc_main$84={__name:`VoiceSpeakingVoiceSelect`,props:{voice:{type:Object,required:true}},setup(__props){const{t}=useJskitText();const props=__props;function selectVoice(value){const selectedVoice=props.voice.selectedVoice;selectedVoice.value=value}return(_ctx,_cache)=>{return openBlock(),createBlock(VSelect,{"model-value":__props.voice.selectedVoice.value,"onUpdate:modelValue":selectVoice,items:__props.voice.availableVoices.value,"item-title":`label`,"item-value":`id`,disabled:__props.voice.availableVoices.value.length<2,label:unref(t)(`jskit.assistant.voice.settings.speakingVoice`),density:`comfortable`,hint:unref(t)(`jskit.assistant.voice.settings.speakingVoiceHint`),"persistent-hint":``},null,8,[`model-value`,`items`,`disabled`,`label`,`hint`])}}};var _hoisted_1$60={class:`voice-settings__disc`};var _sfc_main$83={__name:`VoiceConversationSettings`,props:{voice:{type:Object,default:null},compact:Boolean},emits:[`error`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const{t}=useJskitText();const slots=useSlots();async function openSettings(open){if(!open||slots.default||!props.voice)return;try{await props.voice.connect()}catch(error){emit(`error`,error)}}return(_ctx,_cache)=>{return openBlock(),createBlock(VMenu,{"close-on-content-click":false,location:`bottom end`,"onUpdate:modelValue":openSettings},{activator:withCtx(({props:settingsButton})=>[createVNode(VBtn,mergeProps(settingsButton,{icon:`$settings`,variant:`text`,color:__props.compact?`primary`:void 0,width:__props.compact?40:void 0,"min-width":__props.compact?40:48,"min-height":__props.compact?44:48,disabled:!__props.voice&&!_ctx.$slots.default,"aria-label":unref(t)(`jskit.assistant.voice.settings.title`),title:unref(t)(`jskit.assistant.voice.settings.title`)}),createSlots({_:2},[__props.compact?{name:`default`,fn:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$60,[createVNode(VIcon,{size:`20`,icon:`$settings`})])]),key:`0`}:void 0]),1040,[`color`,`width`,`min-width`,`min-height`,`disabled`,`aria-label`,`title`])]),default:withCtx(()=>[createVNode(VCard,{class:`voice-settings__menu`,role:`region`,"aria-label":unref(t)(`jskit.assistant.voice.settings.title`)},{default:withCtx(()=>[createVNode(VCardText,null,{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{voice:__props.voice},()=>[__props.voice?(openBlock(),createBlock(_sfc_main$84,{key:0,voice:__props.voice},null,8,[`voice`])):createCommentVNode(``,true)],true)]),_:3})]),_:3},8,[`aria-label`])]),_:3})}}};var VoiceConversationSettings_default=_plugin_vue_export_helper_default(_sfc_main$83,[[`__scopeId`,`data-v-eb91f970`]]);var _hoisted_1$59={class:`voice-host__switch-actions`};var _hoisted_2$50={class:`voice-host__body`};var _sfc_main$82={__name:`VoiceConversationHost`,props:{controller:{type:Object,required:true},activator:{type:Object,default:null},avatarSize:{type:String,default:`hidden`},presentation:{type:String,default:`dialog`,validator:value=>[`dialog`,`inline`].includes(value)}},emits:[`update:avatarSize`],setup(__props){const props=__props;const{t}=useJskitText();const state=props.controller.state;async function invoke(operation){try{await operation()}catch(error){state.error=voiceErrorText(error)}}async function openText(){const opening=state.binding.openText();props.controller.minimize();try{await opening}catch(error){props.controller.reveal();throw error}}return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[unref(state).session?(openBlock(),createBlock(ConversationDialog_default,{key:0,"model-value":unref(state).visible,activator:__props.activator,presentation:__props.presentation,title:unref(state).binding.label||unref(t)(`jskit.assistant.voice.assistant`),mode:`talk`,"show-modes":Boolean(unref(state).binding.openText&&!unref(state).binding.adapter),minimizable:__props.presentation===`dialog`,"close-label":unref(t)(`jskit.assistant.voice.host.close`),onMinimize:_cache[7]||(_cache[7]=$event=>__props.controller.minimize()),"onUpdate:modelValue":_cache[8]||(_cache[8]=$event=>invoke(()=>__props.controller.end({discard:true}))),"onUpdate:mode":_cache[9]||(_cache[9]=value=>value===`text`&&invoke(openText))},createSlots({default:withCtx(()=>[unref(state).error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,density:`compact`,role:`alert`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(state).error),1)]),_:1})):createCommentVNode(``,true),unref(state).nextTarget?(openBlock(),createBlock(VAlert,{key:1,type:`info`,class:`voice-host__switch`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.switchPrompt`,{current:unref(state).binding.label||unref(t)(`jskit.assistant.voice.host.thisConversation`),next:unref(state).nextTarget.label||unref(t)(`jskit.assistant.voice.host.anotherConversation`)}))+` `,1),createBaseVNode(`div`,_hoisted_1$59,[createVNode(VBtn,{variant:`text`,onClick:_cache[1]||(_cache[1]=$event=>__props.controller.cancelSwitch())},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.stayHere`)),1)]),_:1}),createVNode(VBtn,{disabled:unref(state).busy||unref(state).session.sending.value,variant:`text`,onClick:_cache[2]||(_cache[2]=$event=>invoke(()=>__props.controller.switchTarget({discard:true})))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.discardAndSwitch`)),1)]),_:1},8,[`disabled`]),!unref(state).session.hasUnsentSpeech.value?(openBlock(),createBlock(VBtn,{key:0,disabled:unref(state).busy,variant:`text`,onClick:_cache[3]||(_cache[3]=$event=>invoke(()=>__props.controller.switchTarget()))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.switch`)),1)]),_:1},8,[`disabled`])):createCommentVNode(``,true)])]),_:1})):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$50,[renderSlot(_ctx.$slots,`conversation`,{binding:unref(state).binding,session:unref(state).session,disabled:unref(state).busy},()=>[(openBlock(),createBlock(VoiceConversation_default,{key:unref(state).binding.id,session:unref(state).session,disabled:unref(state).busy,adapter:unref(state).binding.adapter||null,"show-avatar":unref(state).binding.showAvatar!==false,"avatar-size":__props.avatarSize,"onUpdate:avatarSize":_cache[6]||(_cache[6]=$event=>_ctx.$emit(`update:avatarSize`,$event))},createSlots({"work-control":withCtx(()=>[unref(state).binding.cancelWork&&unref(state).binding.state.status===`working`?(openBlock(),createBlock(VBtn,{key:0,disabled:unref(state).busy,icon:`$stop`,variant:`text`,"aria-label":unref(t)(`jskit.assistant.voice.host.stopWork`),title:unref(t)(`jskit.assistant.voice.host.stopWork`),onClick:_cache[5]||(_cache[5]=$event=>invoke(unref(state).binding.cancelWork))},null,8,[`disabled`,`aria-label`,`title`])):createCommentVNode(``,true)]),_:2},[_ctx.$slots.avatar?{name:`avatar`,fn:withCtx(visual=>[renderSlot(_ctx.$slots,`avatar`,mergeProps(visual,{binding:unref(state).binding}),void 0,true)]),key:`0`}:void 0,_ctx.$slots[`avatar-control`]?{name:`avatar-control`,fn:withCtx(scope=>[renderSlot(_ctx.$slots,`avatar-control`,mergeProps(scope,{binding:unref(state).binding,session:unref(state).session}),void 0,true)]),key:`1`}:void 0,__props.presentation===`inline`||unref(state).binding.adapter?{name:`settings-control`,fn:withCtx(()=>[createVNode(VoiceConversationSettings_default,{voice:unref(state).session.voice,compact:``,onError:_cache[4]||(_cache[4]=$event=>unref(state).error=unref(voiceErrorText)($event))},createSlots({_:2},[_ctx.$slots.settings?{name:`default`,fn:withCtx(settings=>[renderSlot(_ctx.$slots,`settings`,normalizeProps(guardReactiveProps(settings)),void 0,true)]),key:`0`}:void 0]),1032,[`voice`])]),key:`2`}:void 0]),1032,[`session`,`disabled`,`adapter`,`show-avatar`,`avatar-size`]))],true)])]),_:2},[!unref(state).binding.adapter?{name:`header-actions`,fn:withCtx(()=>[createVNode(VoiceConversationSettings_default,{voice:unref(state).session.voice,onError:_cache[0]||(_cache[0]=$event=>unref(state).error=unref(voiceErrorText)($event))},createSlots({_:2},[_ctx.$slots.settings?{name:`default`,fn:withCtx(settings=>[renderSlot(_ctx.$slots,`settings`,normalizeProps(guardReactiveProps(settings)),void 0,true)]),key:`0`}:void 0]),1032,[`voice`])]),key:`0`}:void 0]),1032,[`model-value`,`activator`,`presentation`,`title`,`show-modes`,`minimizable`,`close-label`])):createCommentVNode(``,true),__props.presentation===`dialog`&&unref(state).session&&!unref(state).visible?(openBlock(),createElementBlock(Fragment,{key:1},[_ctx.$slots.reopen?renderSlot(_ctx.$slots,`reopen`,{controller:__props.controller},void 0,true,0):(openBlock(),createBlock(VBtn,{key:1,class:`voice-host__reopen`,color:`primary`,"prepend-icon":`$headsetMic`,"min-height":`56`,onClick:_cache[10]||(_cache[10]=$event=>__props.controller.reveal())},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.reopen`,{label:unref(state).binding.label||unref(t)(`jskit.assistant.voice.assistant`)})),1)]),_:1}))],64)):createCommentVNode(``,true)],64)}}};var VoiceConversationHost_default=_plugin_vue_export_helper_default(_sfc_main$82,[[`__scopeId`,`data-v-316a6c97`]]);var VIBE64_VOICE_KEY=Symbol.for(`vibe64.voice`);function useVibe64Voice(){return inject$1(VIBE64_VOICE_KEY)}var _sfc_main$81={__name:`Vibe64VoiceHost`,props:{preferences:{type:Object,default:()=>({})},preparePreferences:{type:Function,default:null}},emits:[`read-aloud-change`,`avatar-visibility-change`,`playback`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const controller=createVoiceConversationController({connectSpeech(binding){if(!binding.prepareVoice)return binding.socketUrl;return binding.prepareVoice().then(()=>binding.socketUrl)}});const launcher=shallowRef(null);const slots=useSlots();const Avatar=visual=>slots.avatar(visual);const Settings=settings=>slots.settings(settings);function preferencesFor(conversation){return props.preferences[conversation.preferenceTarget]||{}}function readAloudFor(conversation){const value=preferencesFor(conversation).readAloud;return typeof value===`boolean`?value:conversation.defaults?.readAloud===true}function readAloudChangePendingFor(conversation){return preferencesFor(conversation).isSaving===true}function avatarVisibleFor(target){const preferences=props.preferences[target];return preferences?preferences.avatarVisible!==false:null}function setAvatarVisible(target,visible){const current=avatarVisibleFor(target);if(current===null||current===visible)return;emit(`avatar-visibility-change`,visible,{target,actorKey:props.preferences.actorKey})}provide(VIBE64_VOICE_KEY,{controller,launcher,readAloudFor,readAloudChangePendingFor,avatarVisibleFor,setAvatarVisible,Avatar:slots.avatar?Avatar:null,Settings:slots.settings?Settings:null,open(conversation){let actorKey=props.preferences.actorKey;return controller.open({conversation:{...conversation,...props.preparePreferences?{async prepareVoice(){actorKey=await props.preparePreferences(conversation.preferenceTarget);if(!actorKey||props.preferences.actorKey!==actorKey||conversation.available===false)throw new Error(`This conversation is no longer available for voice.`);await conversation.prepareVoice?.();if(props.preferences.actorKey!==actorKey||conversation.available===false)throw new Error(`This conversation is no longer available for voice.`)}}:{},get state(){return conversation.state},get available(){return conversation.available},get label(){return conversation.label},get adapter(){return conversation.adapter},get onTranscript(){return conversation.onTranscript},get presentation(){return conversation.presentation},get readAloudChangePending(){return readAloudChangePendingFor(conversation)},get narration(){const narration=conversation.narration;if(!narration)return narration;const preferences=conversation.preferenceTarget===`coding`?preferencesFor(conversation):{};return{...narration,vocalizeThinking:typeof preferences.vocalizeThinking===`boolean`?preferences.vocalizeThinking:narration.vocalizeThinking,vocalizeInterimTurns:typeof preferences.vocalizeInterimTurns===`boolean`?preferences.vocalizeInterimTurns:narration.vocalizeInterimTurns,thinkingSounds:typeof preferences.thinkingSounds===`boolean`?preferences.thinkingSounds:narration.thinkingSounds}},get defaults(){const preferences=preferencesFor(conversation);return{...conversation.defaults,readAloud:readAloudFor(conversation),...preferences.sendMode===`edit`?{reviewBeforeSend:true}:{},...preferences.voice?{voiceId:preferences.voice===`current`?``:preferences.voice}:{}}},onReadAloudChange(value){emit(`read-aloud-change`,value,{target:conversation.preferenceTarget,actorKey});return conversation.onReadAloudChange?.(value)},onPlayback(event){emit(`playback`,event);return conversation.onPlayback?.(event)},get avatar(){return preferencesFor(conversation).avatar||conversation.avatar}}})}});onScopeDispose(()=>{controller.dispose()});return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[renderSlot(_ctx.$slots,`default`,{},void 0,true),unref(controller).state.binding?.presentation!==`inline`||unref(controller).state.nextTarget?(openBlock(),createBlock(unref(VoiceConversationHost_default),{key:0,controller:unref(controller),activator:launcher.value},createSlots({reopen:withCtx(()=>[]),_:2},[unref(controller).state.binding?.setConversationTarget?{name:`conversation`,fn:withCtx(({binding})=>[createBaseVNode(`div`,{ref:binding.setConversationTarget,class:`vibe64-voice-host__conversation`},null,512)]),key:`0`}:void 0,_ctx.$slots.settings?{name:`settings`,fn:withCtx(settings=>[renderSlot(_ctx.$slots,`settings`,mergeProps(settings,{binding:unref(controller).state.binding}),void 0,true)]),key:`1`}:void 0,_ctx.$slots.avatar?{name:`avatar`,fn:withCtx(visual=>[renderSlot(_ctx.$slots,`avatar`,mergeProps(visual,{binding:unref(controller).state.binding}),void 0,true)]),key:`2`}:void 0]),1032,[`controller`,`activator`])):createCommentVNode(``,true)],64)}}};var Vibe64VoiceHost_default=_plugin_vue_export_helper_default(_sfc_main$81,[[`__scopeId`,`data-v-3dec9644`]]);var mercAvatar=Object.freeze({shirt:`#72777c`,blouseNecklineStroke:`#e8c9dd`,blouseBow:`#dca4c8`,blouseBowStroke:`#5e466f`,face:`#f1c7a3`,neck:`#e6b18d`,hair:`#d2a13a`,hairFringe:`#e2b84e`,hairLockStroke:`#f5d978`,hairSwoopsStroke:`#f6ce63`,browStroke:`#8b6528`,eyeWhite:`#fffaf4`,eyelinerStroke:`#765021`,iris:`#5c3829`,pupil:`#241815`,teeth:`#fffaf0`,noseStroke:`#c4826e`,cheek:`#ed9993`,mouthInside:`#592d35`,tongue:`#c96870`,lipStroke:`#873f49`,lipLightStroke:`#984d55`,earringStroke:`#d7b76e`,earringDrop:`#dca4c8`,earringDropStroke:`#a77b42`});var mercBlueMangaAvatar=Object.freeze({shirt:`#72777c`,blondGirlShirt:`#f4f1e7`,ink:`#24252b`,undershirt:`#d63a39`,hood:`#c9d329`,hoodShadow:`#aebb24`,jacketPanel:`#f8f7f0`,shirtNecklineStroke:`#f7f4eb`,face:`#e2a06f`,neck:`#d78d60`,hair:`#237fbd`,blondGirlHairStroke:`#22242b`,hairLockStroke:`#4fa6d7`,hairSwoopsStroke:`#67add6`,browStroke:`#8b6528`,eyeWhite:`#fffaf4`,blondGirlEyeWhite:`#fffef7`,iris:`#2f3136`,pupil:`#0e0f12`,teeth:`#fffaf0`,noseStroke:`#c4826e`,cheek:`#ed9993`,blondGirlCheek:`#df865e`,mouthInside:`#292227`,tongue:`#e94e44`,lipStroke:`#873f49`,lipLightStroke:`#984d55`,earringStroke:`#d7b76e`,earringDrop:`#dca4c8`,earringDropStroke:`#a77b42`});var _hoisted_1$58={class:`merc-avatar__head-gesture`};var _hoisted_2$49={class:`merc-avatar__head`};var _hoisted_3$43={transform:`translate(35 34) scale(.78)`};var _hoisted_4$35={class:`merc-avatar__mouth`};var _hoisted_5$33={key:0,class:`merc-avatar__mouth-pose`};var _hoisted_6$28={key:1,class:`merc-avatar__mouth-pose`};var _hoisted_7$27={key:2,class:`merc-avatar__mouth-pose`};var _hoisted_8$25={key:3,class:`merc-avatar__mouth-pose`};var _hoisted_9$24={key:4,class:`merc-avatar__mouth-pose`};var _hoisted_10$19={key:5,class:`merc-avatar__lip`,d:`M140 190q20 7 40 0`};var _hoisted_11$17={key:6,class:`merc-avatar__lip`,d:`M141 191q19 3 38 0`};var _hoisted_12$16={key:7,class:`merc-avatar__lip`,d:`M142 191q17-3 36 1`};var _hoisted_13$15={key:8,class:`merc-avatar__lip`,d:`M141 191q19 1 38 0`};var _sfc_main$80={__name:`MercBlueMangaIllustratedAvatar`,props:{mouthLevel:{default:0,type:Number},mouthPose:{default:`closed`,type:String},state:{default:`idle`,type:String},still:{default:false,type:Boolean}},setup(__props){useCssVars(_ctx=>({"v00866ff0":unref(mercBlueMangaAvatar).shirt,"v4cabef4d":unref(mercBlueMangaAvatar).blondGirlShirt,"v110c4e78":unref(mercBlueMangaAvatar).ink,"v7ad9534c":unref(mercBlueMangaAvatar).undershirt,"v107d10ca":unref(mercBlueMangaAvatar).hood,"v98b592ec":unref(mercBlueMangaAvatar).hoodShadow,"v3e733668":unref(mercBlueMangaAvatar).jacketPanel,"v16070f13":unref(mercBlueMangaAvatar).shirtNecklineStroke,"v107bf20b":unref(mercBlueMangaAvatar).face,"v107fa40d":unref(mercBlueMangaAvatar).neck,"v107cdb90":unref(mercBlueMangaAvatar).hair,"fdd0247a":unref(mercBlueMangaAvatar).blondGirlHairStroke,"v91e2421a":unref(mercBlueMangaAvatar).hairLockStroke,"v2b56890f":unref(mercBlueMangaAvatar).hairSwoopsStroke,"b6fd8084":unref(mercBlueMangaAvatar).browStroke,"v3e579d26":unref(mercBlueMangaAvatar).eyeWhite,"v28e273c1":unref(mercBlueMangaAvatar).blondGirlEyeWhite,"v107d8fc1":unref(mercBlueMangaAvatar).iris,"v00cef900":unref(mercBlueMangaAvatar).pupil,"v006d18cc":unref(mercBlueMangaAvatar).teeth,"v4279c919":unref(mercBlueMangaAvatar).noseStroke,"v02498150":unref(mercBlueMangaAvatar).cheek,"v4bca669d":unref(mercBlueMangaAvatar).blondGirlCheek,"v783de796":unref(mercBlueMangaAvatar).mouthInside,"v0c14599c":unref(mercBlueMangaAvatar).tongue,"v5c268bbd":unref(mercBlueMangaAvatar).lipStroke,"v8798f6ee":unref(mercBlueMangaAvatar).lipLightStroke,"v8f6d3720":unref(mercBlueMangaAvatar).earringStroke,"b08d69b2":unref(mercBlueMangaAvatar).earringDrop,"v4fa2743f":unref(mercBlueMangaAvatar).earringDropStroke}));const{blinking,activeExpression,idleGesture,expression,visibleMouthPose}=useVoiceAvatar(__props);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`svg`,{"aria-label":`Illustrated blue-haired manga girl AI avatar of Merc`,class:normalizeClass([`merc-avatar merc-avatar--blond-girl`,[`merc-avatar--${unref(expression)}`,`merc-avatar--mouth-${unref(visibleMouthPose)}`,unref(idleGesture)?`merc-avatar--gesture-${unref(idleGesture)}`:``,unref(activeExpression)?`merc-avatar--${unref(expression)}-${unref(activeExpression)}`:``,{"merc-avatar--blinking":unref(blinking),"merc-avatar--still":__props.still}]]),role:`img`,viewBox:`0 0 320 320`,xmlns:`http://www.w3.org/2000/svg`},[_cache[10]||(_cache[10]=createStaticVNode(`<g class="merc-avatar__body" data-v-534752c9><path class="merc-avatar__shirt" d="M48 320c5-36 24-62 59-78 15-7 32-11 53-11s38 4 53 11c35 16 54 42 59 78H48Z" data-v-534752c9></path><path class="merc-avatar__undershirt" d="M119 251c12 11 26 17 41 17s29-6 41-17l17 69H102l17-69Z" data-v-534752c9></path><path class="merc-avatar__neck" d="M138 203h44v48c-7 13-37 13-44 0v-48Z" data-v-534752c9></path><path class="merc-avatar__hood" d="M92 246c15-9 29-14 45-16l23 28 23-28c16 2 30 7 45 16l-16 48-35-26-17 23-17-23-35 26-16-48Z" data-v-534752c9></path><path class="merc-avatar__hood-shadow" d="M103 252c13 5 26 13 40 24l17-18 17 18c14-11 27-19 40-24-9 17-18 29-28 39l-29-19-29 19c-10-10-19-22-28-39Z" data-v-534752c9></path><path class="merc-avatar__jacket-panel" d="M48 320c4-29 17-52 39-69l23 39-10 30H48Zm224 0c-4-29-17-52-39-69l-23 39 10 30h52Z" data-v-534752c9></path><path class="merc-avatar__shirt-neckline" d="M125 255q35 24 70 0" data-v-534752c9></path></g>`,1)),createBaseVNode(`g`,_hoisted_1$58,[createBaseVNode(`g`,_hoisted_2$49,[_cache[6]||(_cache[6]=createStaticVNode(`<path class="merc-avatar__hair merc-avatar__hair--back" d="M74 153C66 119 70 78 91 49c17-24 42-36 69-36 37 0 65 13 82 39 20 31 20 72 6 110-8 22-22 41-43 54H115c-22-14-34-34-41-63Z" data-v-534752c9></path><path class="merc-avatar__hair merc-avatar__hair--crown-spikes" d="M87 82c12-33 38-55 72-62 32-6 62 1 82 19-17 2-30 7-41 16-12-7-25-10-39-9-15 1-29 7-40 16-11-3-22-2-34 0Z" data-v-534752c9></path><path class="merc-avatar__hair merc-avatar__hair--temples" d="M92 116c-18 12-25 31-21 56 4 23 15 41 35 54-8-24-8-47 1-68l-15-42Zm136 0c18 12 25 31 21 56-4 23-15 41-35 54 8-24 8-47-1-68l15-42Z" data-v-534752c9></path><ellipse class="merc-avatar__ear" cx="94" cy="151" rx="10" ry="18" data-v-534752c9></ellipse><ellipse class="merc-avatar__ear" cx="226" cy="151" rx="10" ry="18" data-v-534752c9></ellipse><path class="merc-avatar__face" d="M160 72c-41 0-67 24-67 67 0 45 27 82 67 85 40-3 67-40 67-85 0-43-26-67-67-67Z" data-v-534752c9></path><path class="merc-avatar__hair merc-avatar__hair--cap" d="M82 118c-5-31 2-58 22-79 19-20 42-28 68-27 34 1 60 14 75 38 13 21 17 47 10 76-18-13-40-21-66-22-38-2-74 3-109 14Z" data-v-534752c9></path><path class="merc-avatar__hair merc-avatar__hair--fringe" d="M88 105c15 2 29-3 41-15 8-7 15-15 21-24 2 11 7 20 15 27 8-10 17-18 28-24 1 13 5 23 12 30 10-7 19-15 27-25 5 19 5 37 0 53-14-8-29-13-45-15-23-3-43-1-61 5-15 5-28 11-39 18-7-18-10-35-9-54Z" data-v-534752c9></path><path class="merc-avatar__hair-swoops" d="M91 76c22-33 56-49 99-48M103 91c29-29 65-38 107-28M117 105c28-20 61-25 97-15" data-v-534752c9></path><path class="merc-avatar__brow merc-avatar__brow--left" d="M104 111c13-8 28-9 41-3" data-v-534752c9></path><path class="merc-avatar__brow merc-avatar__brow--right" d="M175 108c13-6 28-5 41 3" data-v-534752c9></path>`,11)),createBaseVNode(`g`,{class:normalizeClass([`merc-avatar__eyes`,{"merc-avatar__eyes--closed":unref(blinking)}])},[..._cache[0]||(_cache[0]=[createStaticVNode(`<g class="merc-avatar__eye" data-v-534752c9><ellipse class="merc-avatar__eye-white" cx="126" cy="145" rx="19" ry="23" data-v-534752c9></ellipse><ellipse class="merc-avatar__iris" cx="127" cy="145" rx="14.5" ry="19.5" data-v-534752c9></ellipse><ellipse class="merc-avatar__pupil" cx="128" cy="145" rx="9.5" ry="14" data-v-534752c9></ellipse><circle class="merc-avatar__eye-light" cx="121" cy="136" r="5.5" data-v-534752c9></circle><circle class="merc-avatar__eye-light" cx="133" cy="154" r="3" data-v-534752c9></circle><path class="merc-avatar__eye-light merc-avatar__eye-star" d="M116 147l3 5 5 2-5 2-3 5-2-5-5-2 5-2 2-5Z" data-v-534752c9></path></g><g class="merc-avatar__eye" data-v-534752c9><ellipse class="merc-avatar__eye-white" cx="194" cy="145" rx="19" ry="23" data-v-534752c9></ellipse><ellipse class="merc-avatar__iris" cx="193" cy="145" rx="14.5" ry="19.5" data-v-534752c9></ellipse><ellipse class="merc-avatar__pupil" cx="192" cy="145" rx="9.5" ry="14" data-v-534752c9></ellipse><circle class="merc-avatar__eye-light" cx="187" cy="136" r="5.5" data-v-534752c9></circle><circle class="merc-avatar__eye-light" cx="199" cy="154" r="3" data-v-534752c9></circle><path class="merc-avatar__eye-light merc-avatar__eye-star" d="M181 147l3 5 5 2-5 2-3 5-2-5-5-2 5-2 2-5Z" data-v-534752c9></path></g><path class="merc-avatar__eyeliner" d="M106 143q20-27 40 0M174 143q20-27 40 0" data-v-534752c9></path><path class="merc-avatar__eyelashes" d="M108 132l-9-5m14 0-6-9m7 5-2-10m100 19 9-5m-14 0 6-9m-7 5 2-10" data-v-534752c9></path>`,4)])],2),_cache[7]||(_cache[7]=createBaseVNode(`path`,{class:`merc-avatar__nose`,d:`M159 164q-2 5 2 6`},null,-1)),_cache[8]||(_cache[8]=createBaseVNode(`ellipse`,{class:`merc-avatar__cheek`,cx:`112`,cy:`180`,rx:`18`,ry:`9`},null,-1)),_cache[9]||(_cache[9]=createBaseVNode(`ellipse`,{class:`merc-avatar__cheek`,cx:`208`,cy:`180`,rx:`18`,ry:`9`},null,-1)),createBaseVNode(`g`,_hoisted_3$43,[createBaseVNode(`g`,_hoisted_4$35,[unref(visibleMouthPose)===`smile`?(openBlock(),createElementBlock(`g`,_hoisted_5$33,[..._cache[1]||(_cache[1]=[createBaseVNode(`path`,{class:`merc-avatar__mouth-inside`,d:`M134 183q26 12 52 0c-2 25-13 36-26 36s-24-11-26-36Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__teeth`,d:`M139 184q21 8 42 0c-3 8-10 11-21 11s-18-3-21-11Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__tongue`,d:`M147 207q13-9 26 0c-4 7-8 10-13 10s-9-3-13-10Z`},null,-1)])])):unref(visibleMouthPose)===`wide`?(openBlock(),createElementBlock(`g`,_hoisted_6$28,[..._cache[2]||(_cache[2]=[createBaseVNode(`path`,{class:`merc-avatar__mouth-inside`,d:`M130 185q30-13 60 0-5 25-30 25t-30-25Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__teeth`,d:`M135 186q25-8 50 0-8 8-25 8t-25-8Z`},null,-1)])])):unref(visibleMouthPose)===`open`?(openBlock(),createElementBlock(`g`,_hoisted_7$27,[..._cache[3]||(_cache[3]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`194`,rx:`19`,ry:`25`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__tongue`,d:`M145 207q15-11 30 0-5 10-15 10t-15-10Z`},null,-1)])])):unref(visibleMouthPose)===`round`?(openBlock(),createElementBlock(`g`,_hoisted_8$25,[..._cache[4]||(_cache[4]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`193`,rx:`12`,ry:`18`},null,-1),createBaseVNode(`ellipse`,{class:`merc-avatar__lip-light`,cx:`160`,cy:`193`,rx:`16`,ry:`22`},null,-1)])])):unref(visibleMouthPose)===`small`?(openBlock(),createElementBlock(`g`,_hoisted_9$24,[..._cache[5]||(_cache[5]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`191`,rx:`19`,ry:`10`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__lip`,d:`M142 191q18 12 36 0`},null,-1)])])):unref(visibleMouthPose)===`warm-smile`?(openBlock(),createElementBlock(`path`,_hoisted_10$19)):unref(visibleMouthPose)===`soft-smile`?(openBlock(),createElementBlock(`path`,_hoisted_11$17)):unref(visibleMouthPose)===`thoughtful`?(openBlock(),createElementBlock(`path`,_hoisted_12$16)):(openBlock(),createElementBlock(`path`,_hoisted_13$15))])])])])],2)}}};var MercBlueMangaIllustratedAvatar_default=_plugin_vue_export_helper_default(_sfc_main$80,[[`__scopeId`,`data-v-534752c9`]]);var _hoisted_1$57={class:`merc-avatar__head-gesture`};var _hoisted_2$48={class:`merc-avatar__head`};var _hoisted_3$42={class:`merc-avatar__mouth`};var _hoisted_4$34={key:0,class:`merc-avatar__mouth-pose`};var _hoisted_5$32={key:1,class:`merc-avatar__mouth-pose`};var _hoisted_6$27={key:2,class:`merc-avatar__mouth-pose`};var _hoisted_7$26={key:3,class:`merc-avatar__mouth-pose`};var _hoisted_8$24={key:4,class:`merc-avatar__mouth-pose`};var _hoisted_9$23={key:5,class:`merc-avatar__lip`,d:`M140 190q20 7 40 0`};var _hoisted_10$18={key:6,class:`merc-avatar__lip`,d:`M141 191q19 3 38 0`};var _hoisted_11$16={key:7,class:`merc-avatar__lip`,d:`M142 191q17-3 36 1`};var _hoisted_12$15={key:8,class:`merc-avatar__lip`,d:`M141 191q19 1 38 0`};var _sfc_main$79={__name:`MercIllustratedAvatar`,props:{mouthLevel:{default:0,type:Number},mouthPose:{default:`closed`,type:String},state:{default:`idle`,type:String},still:{default:false,type:Boolean}},setup(__props){useCssVars(_ctx=>({"v0ea488c6":unref(mercAvatar).shirt,"v360da9f4":unref(mercAvatar).blouseNecklineStroke,"v379abe8f":unref(mercAvatar).blouseBow,"c62c8cb2":unref(mercAvatar).blouseBowStroke,"v1883b7d6":unref(mercAvatar).face,"v188769d8":unref(mercAvatar).neck,"v1884a15b":unref(mercAvatar).hair,"v86ebee6c":unref(mercAvatar).hairFringe,"v9d83ba04":unref(mercAvatar).hairLockStroke,"v56c4f65a":unref(mercAvatar).hairSwoopsStroke,"v69724149":unref(mercAvatar).browStroke,"v63bcf51e":unref(mercAvatar).eyeWhite,"v25e5f63e":unref(mercAvatar).eyelinerStroke,"v1885558c":unref(mercAvatar).iris,"v0eed11d6":unref(mercAvatar).pupil,"v0e8b31a2":unref(mercAvatar).teeth,"v076acaa4":unref(mercAvatar).noseStroke,"v10679a26":unref(mercAvatar).cheek,"c5df87ec":unref(mercAvatar).mouthInside,"v1f23523d":unref(mercAvatar).tongue,"v74cca65c":unref(mercAvatar).lipStroke,"v933a6ed8":unref(mercAvatar).lipLightStroke,"v026bf305":unref(mercAvatar).earringStroke,"fe2f0a08":unref(mercAvatar).earringDrop,"dbfc9f58":unref(mercAvatar).earringDropStroke}));const{blinking,activeExpression,idleGesture,expression,visibleMouthPose}=useVoiceAvatar(__props);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`svg`,{"aria-label":`Illustrated AI avatar of Merc`,class:normalizeClass([`merc-avatar`,[`merc-avatar--${unref(expression)}`,`merc-avatar--mouth-${unref(visibleMouthPose)}`,unref(idleGesture)?`merc-avatar--gesture-${unref(idleGesture)}`:``,unref(activeExpression)?`merc-avatar--${unref(expression)}-${unref(activeExpression)}`:``,{"merc-avatar--blinking":unref(blinking),"merc-avatar--still":__props.still}]]),role:`img`,viewBox:`0 0 320 320`,xmlns:`http://www.w3.org/2000/svg`},[_cache[11]||(_cache[11]=createBaseVNode(`g`,{class:`merc-avatar__body`},[createBaseVNode(`path`,{class:`merc-avatar__shirt`,d:`M52 320c4-50 28-78 75-91h66c47 13 71 41 75 91H52Z`}),createBaseVNode(`path`,{class:`merc-avatar__neck`,d:`M130 205h60v50c-8 15-52 15-60 0v-50Z`})],-1)),createBaseVNode(`g`,_hoisted_1$57,[createBaseVNode(`g`,_hoisted_2$48,[_cache[6]||(_cache[6]=createStaticVNode(`<path class="merc-avatar__hair merc-avatar__hair--back" d="M86 145c-11-35-4-68 18-90l-8-20 26 11 7-26 20 20 12-26 13 27 24-19 1 27 29-13-10 26h28l-21 20 25 12-23 10c5 12 7 25 5 39l-14-19c-5-43-28-68-59-69-34-2-58 24-62 69l-11 18Z" data-v-6f26701a></path><ellipse class="merc-avatar__ear" cx="91" cy="148" rx="16" ry="27" data-v-6f26701a></ellipse><ellipse class="merc-avatar__ear" cx="229" cy="148" rx="16" ry="27" data-v-6f26701a></ellipse><path class="merc-avatar__face" d="M160 48c-44 0-70 31-70 84 0 61 29 102 70 102s70-41 70-102c0-53-26-84-70-84Z" data-v-6f26701a></path><path class="merc-avatar__hair merc-avatar__hair--fringe" d="M91 115c5-38 29-61 66-65 35-3 61 15 72 50l-19-12-3 20-17-24-6 22-20-27-9 25-16-25-15 24-15-16-11 23-7 5Z" data-v-6f26701a></path><path class="merc-avatar__hair-lock" d="M108 72c9-12 20-20 33-24M145 43l-2 29M176 42l5 31M204 54c9 8 15 19 18 31" data-v-6f26701a></path><path class="merc-avatar__brow merc-avatar__brow--left" d="M113 113c11-8 24-8 34-1" data-v-6f26701a></path><path class="merc-avatar__brow merc-avatar__brow--right" d="M173 112c11-7 24-7 34 1" data-v-6f26701a></path>`,8)),createBaseVNode(`g`,{class:normalizeClass([`merc-avatar__eyes`,{"merc-avatar__eyes--closed":unref(blinking)}])},[..._cache[0]||(_cache[0]=[createStaticVNode(`<g class="merc-avatar__eye" data-v-6f26701a><ellipse class="merc-avatar__eye-white" cx="130" cy="132" rx="18" ry="11" data-v-6f26701a></ellipse><circle class="merc-avatar__iris" cx="132" cy="132" r="7.5" data-v-6f26701a></circle><circle class="merc-avatar__pupil" cx="133" cy="132" r="3.6" data-v-6f26701a></circle><circle class="merc-avatar__eye-light" cx="135" cy="128" r="1.8" data-v-6f26701a></circle></g><g class="merc-avatar__eye" data-v-6f26701a><ellipse class="merc-avatar__eye-white" cx="190" cy="132" rx="18" ry="11" data-v-6f26701a></ellipse><circle class="merc-avatar__iris" cx="188" cy="132" r="7.5" data-v-6f26701a></circle><circle class="merc-avatar__pupil" cx="187" cy="132" r="3.6" data-v-6f26701a></circle><circle class="merc-avatar__eye-light" cx="190" cy="128" r="1.8" data-v-6f26701a></circle></g>`,2)])],2),_cache[7]||(_cache[7]=createBaseVNode(`path`,{class:`merc-avatar__nose`,d:`M158 132c-1 15-6 27-3 31 4 4 10 4 14 0`},null,-1)),_cache[8]||(_cache[8]=createBaseVNode(`ellipse`,{class:`merc-avatar__cheek`,cx:`116`,cy:`166`,rx:`17`,ry:`9`},null,-1)),_cache[9]||(_cache[9]=createBaseVNode(`ellipse`,{class:`merc-avatar__cheek`,cx:`204`,cy:`166`,rx:`17`,ry:`9`},null,-1)),createBaseVNode(`g`,null,[createBaseVNode(`g`,_hoisted_3$42,[unref(visibleMouthPose)===`smile`?(openBlock(),createElementBlock(`g`,_hoisted_4$34,[..._cache[1]||(_cache[1]=[createBaseVNode(`path`,{class:`merc-avatar__mouth-inside`,d:`M132 183q28 24 56 0c-4 20-16 29-28 29s-24-9-28-29Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__teeth`,d:`M137 185q23 14 46 0c-4 9-13 13-23 13s-19-4-23-13Z`},null,-1)])])):unref(visibleMouthPose)===`wide`?(openBlock(),createElementBlock(`g`,_hoisted_5$32,[..._cache[2]||(_cache[2]=[createBaseVNode(`path`,{class:`merc-avatar__mouth-inside`,d:`M130 185q30-13 60 0-5 25-30 25t-30-25Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__teeth`,d:`M135 186q25-8 50 0-8 8-25 8t-25-8Z`},null,-1)])])):unref(visibleMouthPose)===`open`?(openBlock(),createElementBlock(`g`,_hoisted_6$27,[..._cache[3]||(_cache[3]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`194`,rx:`19`,ry:`25`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__tongue`,d:`M145 207q15-11 30 0-5 10-15 10t-15-10Z`},null,-1)])])):unref(visibleMouthPose)===`round`?(openBlock(),createElementBlock(`g`,_hoisted_7$26,[..._cache[4]||(_cache[4]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`193`,rx:`12`,ry:`18`},null,-1),createBaseVNode(`ellipse`,{class:`merc-avatar__lip-light`,cx:`160`,cy:`193`,rx:`16`,ry:`22`},null,-1)])])):unref(visibleMouthPose)===`small`?(openBlock(),createElementBlock(`g`,_hoisted_8$24,[..._cache[5]||(_cache[5]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`191`,rx:`19`,ry:`10`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__lip`,d:`M142 191q18 12 36 0`},null,-1)])])):unref(visibleMouthPose)===`warm-smile`?(openBlock(),createElementBlock(`path`,_hoisted_9$23)):unref(visibleMouthPose)===`soft-smile`?(openBlock(),createElementBlock(`path`,_hoisted_10$18)):unref(visibleMouthPose)===`thoughtful`?(openBlock(),createElementBlock(`path`,_hoisted_11$16)):(openBlock(),createElementBlock(`path`,_hoisted_12$15))])]),_cache[10]||(_cache[10]=createBaseVNode(`circle`,{class:`merc-avatar__earring`,cx:`84`,cy:`165`,r:`5`},null,-1))])])],2)}}};var MercIllustratedAvatar_default=_plugin_vue_export_helper_default(_sfc_main$79,[[`__scopeId`,`data-v-6f26701a`]]);var _sfc_main$78={__name:`MercAvatar`,props:{avatar:{default:`yu`,type:String},mouthLevel:{default:0,type:Number},mouthPose:{default:`closed`,type:String},state:{default:`idle`,type:String},still:{default:false,type:Boolean}},setup(__props){return(_ctx,_cache)=>{return __props.avatar===`merc`?(openBlock(),createBlock(MercIllustratedAvatar_default,{key:0,"mouth-level":__props.mouthLevel,"mouth-pose":__props.mouthPose,state:__props.state,still:__props.still},null,8,[`mouth-level`,`mouth-pose`,`state`,`still`])):(openBlock(),createBlock(MercBlueMangaIllustratedAvatar_default,{key:1,"mouth-level":__props.mouthLevel,"mouth-pose":__props.mouthPose,state:__props.state,still:__props.still},null,8,[`mouth-level`,`mouth-pose`,`state`,`still`]))}}};var VIBE64_AVATAR_CHOICES=Object.freeze([Object.freeze({id:`merc`,label:`Merc · male`}),Object.freeze({id:`yu`,label:`Yu · female`})]);var VIBE64_AVATAR_IDS=Object.freeze(VIBE64_AVATAR_CHOICES.map(choice=>choice.id));var VIBE64_DEFAULT_AVATARS=Object.freeze({colleague:`merc`,coding:`yu`});function isVibe64AvatarId(value){return VIBE64_AVATAR_IDS.includes(value)}var _sfc_main$77={__name:`Vibe64AvatarSetting`,props:{modelValue:{type:String,default:null},disabled:Boolean,loading:Boolean,hint:{type:String,default:``}},emits:[`update:modelValue`],setup(__props){return(_ctx,_cache)=>{return openBlock(),createBlock(VSelect,{"model-value":__props.modelValue,items:unref(VIBE64_AVATAR_CHOICES),"item-title":`label`,"item-value":`id`,label:`Avatar`,density:`comfortable`,disabled:__props.disabled,loading:__props.loading,hint:__props.hint,"persistent-hint":Boolean(__props.hint),"onUpdate:modelValue":_cache[0]||(_cache[0]=value=>_ctx.$emit(`update:modelValue`,value))},null,8,[`model-value`,`items`,`disabled`,`loading`,`hint`,`persistent-hint`])}}};var MAIN_CONVERSATION_PREFIX=`vibe64-main:`;var TEMPORARY_CONVERSATION_PREFIX=`vibe64-temporary:`;function invalidConversation(kind){return new AppError(400,`Invalid ${kind} conversation identity.`,{code:`vibe64_conversation_identity_invalid`,params:{kind}})}function mainConversationId({projectSlug,sessionId}={}){if(typeof projectSlug!==`string`||!projectSlug.trim()||typeof sessionId!==`string`||!sessionId.trim())throw new TypeError(`A Main conversation requires a project and session.`);return`${MAIN_CONVERSATION_PREFIX}${JSON.stringify([projectSlug,sessionId])}`}function mainConversationTarget(id){if(typeof id!==`string`||!id.startsWith(MAIN_CONVERSATION_PREFIX))return null;let target;try{target=JSON.parse(id.slice(12))}catch{throw invalidConversation(`Main`)}if(!Array.isArray(target)||target.length!==2||target.some(value=>typeof value!==`string`||!value.trim()))throw invalidConversation(`Main`);return{projectSlug:target[0],sessionId:target[1]}}function temporaryConversationId({projectSlug,sessionId,conversationId}={}){if([projectSlug,sessionId,conversationId].some(value=>typeof value!==`string`||!value.trim()))throw new TypeError(`A temporary conversation requires its project, session and saved logical identity.`);return`${TEMPORARY_CONVERSATION_PREFIX}${JSON.stringify([projectSlug,sessionId,conversationId])}`}function projectVoiceState(runtime){return projectConversationVoiceState({turns:runtime.conversationLog.turns||[],status:runtime.mounted.session.value?.agentSession?.turn?.active?`working`:`ready`})}function createProjectVoiceBinding(runtime,view={}){const identity=runtime.identity;let retained;function captureContext(){return{...identity}}function retain(){retained=runtime.retain();runtime=retained.runtime}function release(){retained?.release();retained=null}function submitText(text,{messageId,context}={}){if(context?.actorKey!==identity.actorKey||context?.sessionId!==identity.sessionId||context?.projectSlug!==identity.projectSlug)throw new Error(`This recording belongs to another conversation.`);return runtime.send({message:text,agentSettings:runtime.agentSettings.requestSettings.value},{messageId})}function cancelWork(){return runtime.interrupt()}return Object.freeze({preferenceTarget:`coding`,defaults:{readAloud:true},id:JSON.stringify([`project`,identity.actorKey,identity.projectSlug,identity.sessionId]),conversationId:mainConversationId(identity),socketUrl:`/api/app/${encodeURIComponent(identity.projectSlug)}/vibe64/sessions/${encodeURIComponent(identity.sessionId)}/voice/ws`,get label(){return`${identity.projectSlug} · ${runtime.mounted.session.value?.sessionName||identity.sessionId}`},get state(){return projectVoiceState(runtime)},get available(){return runtime.available.value},get narration(){return{turns:runtime.conversationLog.turns||[],loading:runtime.conversationLog.loading===true,working:runtime.mounted.session.value?.agentSession?.turn?.active===true,eligible:runtime.available.value&&runtime.access.canUseChat.value&&view.eligible===true,vocalizeThinking:false,vocalizeInterimTurns:false,thinkingSounds:true}},get adapter(){return view.adapter||null},get presentation(){return view.presentation||`dialog`},get onTranscript(){return view.onTranscript},captureContext,retain,release,submitText,cancelWork})}var REALTIME_SOCKET_KEY=`jskit.realtime.runtime.client.socket`;var NO_REALTIME_SOCKET=Object.freeze({active:false,connected:false,connect(){},disconnect(){},emit(){},timeout(){return NO_REALTIME_SOCKET},on(){},off(){},onAny(){},offAny(){}});function matchesEveryEvent(){return true}function resolveEnabled$1(value){if(value===void 0)return true;return Boolean(unref(value))}function resolveEventName(value){return normalizeText$1(unref(value))||`*`}function useRealtimeSocket(){return inject$1(REALTIME_SOCKET_KEY,NO_REALTIME_SOCKET)}function useRealtimeEvent({event=`*`,enabled=true,matches=matchesEveryEvent,onEvent}){const socket=useRealtimeSocket();const active=ref(false);let release=null;function detach(){if(release)try{release()}catch{}release=null;active.value=false}function runHandler(eventName,payload){const context=Object.freeze({event:eventName,payload,socket});if(matches(context)!==true)return;Promise.resolve(onEvent(context)).catch(error=>{console.error({event:eventName,error:String(error?.message||error||`unknown error`)},`Realtime event handler failed.`)})}function attach(){detach();if(socket===NO_REALTIME_SOCKET)return;if(!resolveEnabled$1(enabled))return;const eventName=resolveEventName(event);if(eventName===`*`){const onAny=(nextEventName,payload)=>runHandler(nextEventName,payload);socket.onAny(onAny);release=()=>{socket.offAny(onAny)};active.value=true;return}const onEventMessage=payload=>runHandler(eventName,payload);socket.on(eventName,onEventMessage);release=()=>{socket.off(eventName,onEventMessage)};active.value=true}watch(()=>[resolveEnabled$1(enabled),resolveEventName(event)],()=>{attach()},{immediate:true});onScopeDispose(detach);return{active}}var VIBE64_TRAINING_LEARNER_CHANGED_EVENT=`vibe64.training.learner.changed`;var ERROR_CHANNELS=Object.freeze([`snackbar`,`banner`,`dialog`,`silent`]);var ERROR_SEVERITIES=Object.freeze([`info`,`success`,`warning`,`error`,`critical`]);var ERROR_INTENTS=Object.freeze([`resource-load`,`action-feedback`,`app-recoverable`,`blocking`]);function normalizeText(value,fallback=``){return normalizeText$1(value,{fallback:String(fallback||``).trim()})}function normalizeChannel(value,fallback=``){const normalized=normalizeText(value).toLowerCase();if(ERROR_CHANNELS.includes(normalized))return normalized;return normalizeText(fallback).toLowerCase()}function normalizeSeverity(value,fallback=`error`){const normalized=normalizeText(value).toLowerCase();if(ERROR_SEVERITIES.includes(normalized))return normalized;const normalizedFallback=normalizeText(fallback).toLowerCase();if(ERROR_SEVERITIES.includes(normalizedFallback))return normalizedFallback;return`error`}function normalizeErrorIntent(value,fallback=``){const normalized=normalizeText(value).toLowerCase();if(ERROR_INTENTS.includes(normalized))return normalized;const normalizedFallback=normalizeText(fallback).toLowerCase();if(ERROR_INTENTS.includes(normalizedFallback))return normalizedFallback;return``}function normalizeNonNegativeInteger(value,fallback=0){const numericValue=Number(value);if(!Number.isFinite(numericValue))return Math.max(0,Number(fallback||0));if(numericValue<0)return 0;return Math.trunc(numericValue)}function normalizeAction(value){const source=isRecord(value)?value:null;if(!source)return null;const label=normalizeText(source.label);if(!label||!source.handler)return null;return Object.freeze({label,handler:source.handler,dismissOnRun:source.dismissOnRun!==false})}function normalizeAdditionalActions(value){return Object.freeze(Array.isArray(value)?value.map(normalizeAction).filter(Boolean):[])}function createDefaultErrorPolicy({defaultChannel=`snackbar`,resourceLoadChannel=`silent`,actionFeedbackChannel=`snackbar`,appRecoverableChannel=`banner`,blockingChannel=`dialog`,defaultSeverity=`error`}={}){const normalizedDefaultChannel=normalizeChannel(defaultChannel,`snackbar`)||`snackbar`;const normalizedResourceLoadChannel=normalizeChannel(resourceLoadChannel,`silent`)||`silent`;const normalizedActionFeedbackChannel=normalizeChannel(actionFeedbackChannel,`snackbar`)||`snackbar`;const normalizedAppRecoverableChannel=normalizeChannel(appRecoverableChannel,`banner`)||`banner`;const normalizedBlockingChannel=normalizeChannel(blockingChannel,`dialog`)||`dialog`;const normalizedDefaultSeverity=normalizeSeverity(defaultSeverity,`error`);return function defaultErrorPolicy(event={}){const explicitChannel=normalizeChannel(event.channel);const intent=normalizeErrorIntent(event.intent||(event.blocking===true?`blocking`:``));let channel=explicitChannel;if(!channel)switch(intent){case`resource-load`:channel=normalizedResourceLoadChannel;break;case`action-feedback`:channel=normalizedActionFeedbackChannel;break;case`app-recoverable`:channel=normalizedAppRecoverableChannel;break;case`blocking`:channel=normalizedBlockingChannel;break;default:channel=normalizedDefaultChannel}return Object.freeze({channel,severity:normalizeSeverity(event.severity,normalizedDefaultSeverity)})}}function subscribeListener(listeners,listener){if(!(listeners instanceof Set))throw new TypeError(`subscribeListener requires a Set.`);if(typeof listener!==`function`)return()=>{};listeners.add(listener);return()=>{listeners.delete(listener)}}function createListenerSubscription(listeners){if(!(listeners instanceof Set))throw new TypeError(`createListenerSubscription requires a Set.`);return function subscribe(listener){return subscribeListener(listeners,listener)}}var jskit$11={"shell":{"actions":{"back":`Back`,"close":`Close`,"dismiss":`Dismiss`,"more":`More actions`,"reload":`Reload`,"retry":`Retry`},"error":{"actionFailed":`Error action failed.`,"attentionRequired":`Attention required`,"navigationFailed":`Navigation failed.`,"requestFailed":`Request failed.`,"unexpectedUi":`Unexpected UI error.`},"layout":{"closeNavigationMenu":`Close navigation menu`,"collapseNavigationDrawer":`Collapse navigation drawer`,"details":`Details`,"expandNavigationDrawer":`Expand navigation drawer`,"openNavigationMenu":`Open navigation menu`,"surface":`Surface`,"tab":`Tab`,"tools":`Tools`},"pullToRefresh":{"pull":`Pull to refresh`,"refreshing":`Refreshing`,"release":`Release to refresh`},"recovery":{"appDataLabel":`App data`,"appLabel":`App`,"appModuleLabel":`App module`,"appUnreachable":`The app could not reach the server or network. Check the connection and try again.`,"appUpdated":`{app} was updated. Reload to get the latest version.`,"errorConfigLabel":`Error config`,"moduleFailed":`A required app module could not load.`,"placementConfigLabel":`Placement config`,"placementTopologyLabel":`Placement topology`,"refreshFailed":`Unable to refresh. Check the connection and try again.`,"reloadFailed":`The app cannot reload because the app server is not reachable. Restart the server, then click Reload.`,"thisAppUpdated":`This app was updated. Reload to get the latest version.`,"unreachable":`{label} could not reach the server or network. Check the connection and try again.`},"appEnvironment":{"development":`Development`,"developmentDescription":`Development: emails and messages are logged, not sent; payments use the sandbox.`,"test":`Test`,"testDescription":`Test: emails and messages are logged, not sent; payments use the sandbox.`,"staging":`Staging`,"stagingDescription":`Staging: email and text messages reach only the staging test addresses, other messages are logged and payments use the sandbox.`}}};var en_default$11={jskit:jskit$11};registerJskitMessages(en_default$11);var{t:t$22}=useJskitText();function freezeParams$1(params){return Object.freeze(isRecord(params)?{...params}:{})}function messageCodeFields(source={},fallback={}){const codeSource=source.code?source:fallback;const messageCodeSource=source.messageCode?source:fallback;return{code:normalizeText(codeSource?.code),params:freezeParams$1(codeSource?.params),messageCode:normalizeText(messageCodeSource?.messageCode),messageParams:freezeParams$1(messageCodeSource?.messageParams)}}function normalizeErrorEvent(rawEvent={}){const source=isRecord(rawEvent)?rawEvent:{message:rawEvent};const cause=source.cause!==void 0?source.cause:source.error;const statusCandidate=Number(source.status||source.statusCode||cause?.status||cause?.statusCode||0);const status=Number.isFinite(statusCandidate)?Math.trunc(statusCandidate):0;const fieldErrors=isRecord(source.fieldErrors)?Object.freeze({...source.fieldErrors}):isRecord(source.details?.fieldErrors)?Object.freeze({...source.details.fieldErrors}):null;const details=isRecord(source.details)?Object.freeze({...source.details}):null;const userMessage=normalizeText(source.userMessage);const runtimeMessage=normalizeText(source.message||cause?.message);return Object.freeze({...messageCodeFields(source,isRecord(cause)?cause:{}),status,source:normalizeText(source.source,`app`),message:normalizeText(userMessage||runtimeMessage,t$22(`jskit.shell.error.requestFailed`)),userMessage,intent:normalizeErrorIntent(source.intent||source.kind),severity:normalizeSeverity(source.severity,`error`),channel:normalizeChannel(source.channel),presenterId:normalizeText(source.presenterId),action:normalizeAction(source.action),additionalActions:normalizeAdditionalActions(source.additionalActions),persist:typeof source.persist===`boolean`?source.persist:null,blocking:source.blocking===true,dedupeKey:normalizeText(source.dedupeKey),dedupeWindowMs:normalizeNonNegativeInteger(source.dedupeWindowMs,0),traceId:normalizeText(source.traceId),fieldErrors,details,cause:cause||null,timestamp:Number(Date.now())})}function normalizePolicyDecision(policyDecision={},event={}){const source=isRecord(policyDecision)?policyDecision:{};const channel=normalizeChannel(source.channel||event.channel,`snackbar`)||`snackbar`;return Object.freeze({channel,presenterId:normalizeText(source.presenterId||event.presenterId),message:normalizeText(source.message||event.userMessage||event.message,t$22(`jskit.shell.error.requestFailed`)),...messageCodeFields(source,event),severity:normalizeSeverity(source.severity||event.severity,`error`),action:normalizeAction(source.action||event.action),additionalActions:normalizeAdditionalActions(source.additionalActions??event.additionalActions),persist:typeof source.persist===`boolean`?source.persist:typeof event.persist===`boolean`?event.persist:channel!==`snackbar`,dedupeKey:normalizeText(source.dedupeKey||event.dedupeKey),dedupeWindowMs:normalizeNonNegativeInteger(source.dedupeWindowMs,event.dedupeWindowMs||0)})}function supportsEveryChannel(){return true}function dismissNothing(){return 0}function normalizePresenter(source){const id=normalizeText(source.id);if(!id)throw new Error(`Error presenter requires id.`);const supports=source.supports||supportsEveryChannel;const dismiss=source.dismiss||dismissNothing;return Object.freeze({id,supports:supports.bind(source),present:source.present.bind(source),dismiss:dismiss.bind(source)})}function createErrorRuntime({presenters=[],policy=createDefaultErrorPolicy(),defaultPresenterId=``,moduleDefaultPresenterId=``,logger}){const byPresenterId=new Map;const listeners=new Set;const subscribe=createListenerSubscription(listeners);const dedupeWindowByKey=new Map;let activePolicy=policy;let activeAppDefaultPresenterId=normalizeText(defaultPresenterId);const activeModuleDefaultPresenterId=normalizeText(moduleDefaultPresenterId);function getPresenterIds(){return Object.freeze([...byPresenterId.keys()].sort((left,right)=>left.localeCompare(right)))}function assertPresenterExists(presenterId,label){if(!byPresenterId.has(presenterId))throw new Error(`${label} presenter "${presenterId}" is not registered.`)}function resolveDefaultPresenterId(){if(activeAppDefaultPresenterId){assertPresenterExists(activeAppDefaultPresenterId,`App default error`);return activeAppDefaultPresenterId}if(activeModuleDefaultPresenterId){assertPresenterExists(activeModuleDefaultPresenterId,`Module default error`);return activeModuleDefaultPresenterId}throw new Error(`Error runtime requires app default presenter or module default presenter.`)}function assertBootReady(){resolveDefaultPresenterId()}function registerPresenter(presenter){const normalized=normalizePresenter(presenter);if(byPresenterId.has(normalized.id))throw new Error(`Error presenter "${normalized.id}" is already registered.`);byPresenterId.set(normalized.id,normalized);return normalized.id}function registerPresenters(nextPresenters=[]){const source=Array.isArray(nextPresenters)?nextPresenters:[];const ids=[];for(const presenter of source)ids.push(registerPresenter(presenter));return Object.freeze(ids)}function setPolicy(nextPolicy){if(typeof nextPolicy!==`function`)throw new TypeError(`Error policy must be a function.`);activePolicy=nextPolicy}function setAppDefaultPresenterId(nextDefaultPresenterId=``){const normalized=normalizeText(nextDefaultPresenterId);if(normalized)assertPresenterExists(normalized,`App default error`);activeAppDefaultPresenterId=normalized;return activeAppDefaultPresenterId}function notify(event={}){const payload=Object.freeze({...event});for(const listener of listeners)try{listener(payload)}catch(error){logger.warn({error:String(error?.message||error||`unknown error`)},`Error runtime subscriber failed.`)}}function resolveChannelCompatiblePresenter(channel=``){for(const presenter of byPresenterId.values())if(presenter.supports(channel))return presenter;return null}function resolvePresenterForDecision(decision){const explicitPresenterId=normalizeText(decision.presenterId);if(explicitPresenterId){assertPresenterExists(explicitPresenterId,`Policy-selected error`);return byPresenterId.get(explicitPresenterId)}const defaultPresenterId=resolveDefaultPresenterId();const defaultPresenter=byPresenterId.get(defaultPresenterId);if(defaultPresenter.supports(decision.channel))return defaultPresenter;const compatiblePresenter=resolveChannelCompatiblePresenter(decision.channel);if(!compatiblePresenter)throw new Error(`No error presenter supports channel "${decision.channel}".`);return compatiblePresenter}function shouldSkipByDedupe(decision){if(!decision.dedupeKey||decision.dedupeWindowMs<1)return false;const now=Number(Date.now());if(now-Number(dedupeWindowByKey.get(decision.dedupeKey)||0)<decision.dedupeWindowMs)return true;dedupeWindowByKey.set(decision.dedupeKey,now);return false}function report(rawEvent={},rawContext={}){const event=normalizeErrorEvent(rawEvent);const context=isRecord(rawContext)?Object.freeze({...rawContext}):Object.freeze({});let policyDecision;try{policyDecision=activePolicy(event,Object.freeze({context,runtime:Object.freeze({presenterIds:getPresenterIds(),appDefaultPresenterId:activeAppDefaultPresenterId,moduleDefaultPresenterId:activeModuleDefaultPresenterId})}))}catch(error){logger.error({source:event.source,error:String(error?.message||error||`unknown error`)},`Error policy threw while evaluating error event.`);throw error}const decision=normalizePolicyDecision(policyDecision,event);if(decision.channel===`silent`){const silentResult=Object.freeze({event,decision,skipped:true,reason:`silent`});notify({type:`reported.silent`,result:silentResult});return silentResult}if(shouldSkipByDedupe(decision)){const dedupedResult=Object.freeze({event,decision,skipped:true,reason:`dedupe`});notify({type:`reported.deduped`,result:dedupedResult});return dedupedResult}const presenter=resolvePresenterForDecision(decision);if(!presenter.supports(decision.channel))throw new Error(`Error presenter "${presenter.id}" does not support channel "${decision.channel}".`);const payload=Object.freeze({...decision,presenterId:presenter.id,event,context});const presentationId=normalizeText(presenter.present(payload));const result=Object.freeze({event,decision:Object.freeze({...decision,presenterId:presenter.id}),presentationId,skipped:false});notify({type:`reported`,result});return result}function dismiss(presentationId=``,options={}){const normalizedPresentationId=normalizeText(presentationId);const source=isRecord(options)?options:{};const presenterId=normalizeText(source.presenterId);if(presenterId){const presenter=byPresenterId.get(presenterId);if(!presenter)return 0;return Number(presenter.dismiss(normalizedPresentationId)||0)}let total=0;for(const presenter of byPresenterId.values())total+=Number(presenter.dismiss(normalizedPresentationId)||0);return total}function configure(options={}){const source=isRecord(options)?options:{};if(Array.isArray(source.presenters)&&source.presenters.length>0)registerPresenters(source.presenters);if(Object.prototype.hasOwnProperty.call(source,`policy`))setPolicy(source.policy);if(Object.prototype.hasOwnProperty.call(source,`defaultPresenterId`))setAppDefaultPresenterId(source.defaultPresenterId);assertBootReady();return getSnapshot()}function getSnapshot(){return Object.freeze({presenterIds:getPresenterIds(),appDefaultPresenterId:activeAppDefaultPresenterId,moduleDefaultPresenterId:activeModuleDefaultPresenterId,resolvedDefaultPresenterId:resolveDefaultPresenterId()})}registerPresenters(presenters);assertBootReady();return Object.freeze({report,dismiss,configure,registerPresenter,registerPresenters,setPolicy,setAppDefaultPresenterId,assertBootReady,getSnapshot,subscribe,normalizeErrorEvent})}var SHELL_WEB_ERROR_RUNTIME_KEY=`jskit.shell-web.runtime.web-error.client`;function throwUnavailable(){throw new Error(`Shell web error runtime is not available.`)}function emptySnapshot(){return Object.freeze({presenterIds:Object.freeze([]),appDefaultPresenterId:``,moduleDefaultPresenterId:``,resolvedDefaultPresenterId:``})}var NO_SHELL_WEB_ERROR_RUNTIME=Object.freeze({report(){return Object.freeze({skipped:true,reason:`unavailable`})},dismiss(){return 0},configure:emptySnapshot,registerPresenter:throwUnavailable,registerPresenters:throwUnavailable,setPolicy:throwUnavailable,setAppDefaultPresenterId:throwUnavailable,assertBootReady:throwUnavailable,getSnapshot:emptySnapshot,subscribe(){return()=>{}},normalizeErrorEvent});function useShellWebErrorRuntime(){return inject$1(SHELL_WEB_ERROR_RUNTIME_KEY,NO_SHELL_WEB_ERROR_RUNTIME)}var EMPTY_PRESENTATION_STATE=Object.freeze({revision:0,channels:Object.freeze({snackbar:Object.freeze([]),banner:Object.freeze([]),dialog:Object.freeze([])})});var NO_PRESENTATION_STORE=Object.freeze({getState(){return EMPTY_PRESENTATION_STATE},subscribe(){return()=>{}},present(){throw new Error(`Shell web error presentation store is not available.`)},dismiss(){return 0},clear(){return 0}});function normalizePresentationState(nextState){if(!nextState||typeof nextState!==`object`)return EMPTY_PRESENTATION_STATE;return nextState}var useShellErrorPresentationStore=defineStore(`jskit.shell-web.error-presentation`,()=>{const runtimeStore=shallowRef(markRaw(NO_PRESENTATION_STORE));const presentationState=shallowRef(EMPTY_PRESENTATION_STATE);let unsubscribe=null;function setPresentationState(nextState){presentationState.value=normalizePresentationState(nextState);return presentationState.value}function detachRuntimeStore(){if(unsubscribe){unsubscribe();unsubscribe=null}}function attachRuntimeStore(nextRuntimeStore){if(runtimeStore.value===nextRuntimeStore){setPresentationState(nextRuntimeStore.getState());return runtimeStore.value}detachRuntimeStore();runtimeStore.value=markRaw(nextRuntimeStore);setPresentationState(nextRuntimeStore.getState());unsubscribe=nextRuntimeStore.subscribe(nextState=>{setPresentationState(nextState)});return runtimeStore.value}function getState(){return presentationState.value}function subscribe(listener){return runtimeStore.value.subscribe(listener)}function present(channel,payload={}){return runtimeStore.value.present(channel,payload)}function dismiss(channel,presentationId=``){return runtimeStore.value.dismiss(channel,presentationId)}function clear(channel=``){return runtimeStore.value.clear(channel)}return{runtimeStore,presentationState,revision:computed(()=>Number(presentationState.value.revision||0)),channels:computed(()=>presentationState.value.channels||EMPTY_PRESENTATION_STATE.channels),attachRuntimeStore,getState,subscribe,present,dismiss,clear}});var jskit$10={"crud":{"listFilter":{"present":`Present`,"missing":`Missing`,"chip":{"value":`{label}: {value}`,"range":`{label}: {from} to {to}`,"from":`{label}: from {from}`,"to":`{label}: to {to}`,"min":`{label}: min {min}`,"max":`{label}: max {max}`}}}};var en_default$10={jskit:jskit$10};var jskit$9={"http":{"access":{"permissionsUnavailable":`Permissions are unavailable in placement context.`,"routeParamsRequired":`Route parameters {params} are required for surface "{surface}".`},"actions":{"apply":`Apply`,"cancel":`Cancel`,"clear":`Clear`,"clearAll":`Clear all`,"close":`Close`,"delete":`Delete`,"deleting":`Deleting…`,"edit":`Edit`,"loadMore":`Load more`,"loadingMore":`Loading more…`,"more":`More`,"open":`Open`,"refresh":`Refresh`,"refreshing":`Refreshing…`,"retry":`Retry`,"retrying":`Retrying…`,"running":`{label}…`,"save":`Save`,"saving":`Saving…`},"crud":{"bulk":{"actions":`Bulk actions`,"selected":`{count} selected`,"selection":`Selection`},"delete":{"button":`Delete {resource}`,"description":`This permanently deletes this {resource}. This action cannot be undone.`,"failed":`Unable to delete record.`,"listRouteUnavailable":`Deleted the record, but the generated list route is unavailable.`,"title":`Delete {resource}?`},"filters":{"calendar":`{label} calendar`,"chipDate":`{label}: {date}`,"chipFrom":`{label}: from {from}`,"chipRange":`{label}: {from} to {to}`,"chipTo":`{label}: to {to}`,"dateRange":`{label} date range`,"enterId":`Enter id`,"enterIds":`Enter ids`,"option":`Option`,"optionValue":`{label} {value}`,"optionsLoadFailed":`Unable to load filter options ({path}).`,"rangeFrom":`{label} from`,"rangeMax":`{label} max`,"rangeMin":`{label} min`,"rangeTo":`{label} to`,"selectDate":`Select date`,"selectEndDate":`Select end date`,"selectStartDate":`Select start date`,"title":`Filters`},"list":{"emptyBody":`Create the first record to start using this workflow.`,"loadErrorBody":`Check the connection and try again.`,"loadFailed":`Unable to load records.`,"newRecord":`New record`,"recordActions":`Actions for {title}`,"selectRecord":`Select {title}`,"selectVisibleRows":`Select visible rows`},"lookup":{"optionsLoadFailed":`Unable to load lookup options ({path}).`},"no":`No`,"parent":{"loadFailed":`Unable to load parent record.`,"notFound":`Parent record not found.`,"recordWithId":`{label} #{id}`},"record":`Record`,"recordNotFound":`Record not found.`,"records":`Records`,"view":{"loadFailed":`Unable to load record.`,"notFound":`This {resource} could not be found.`},"yes":`Yes`},"feedback":{"actionFailed":`Unable to complete action.`,"completed":`Completed.`,"fixInvalidValues":`Fix invalid values and try again.`,"requestFailed":`Request failed.`,"saveFailed":`Unable to save.`,"saved":`Saved.`,"validationFailed":`Validation failed.`},"list":{"label":`List`,"loadFailed":`Unable to load list.`,"search":`Search`},"loadRefused":{"forbidden":`You don't have access to this.`,"notFound":`This wasn't found.`,"other":`This couldn't be loaded.`,"unauthorized":`Sign in again to see this.`},"resource":{"label":`Resource`,"loadFailed":`Unable to load resource.`,"saveFailed":`Unable to save resource.`},"selectField":{"unavailableOption":`Unavailable option`}}};var en_default$9={jskit:jskit$9};registerJskitMessages(en_default$10);registerJskitMessages(en_default$9);var{t:t$21}=useJskitText();var unavailableOption=Symbol(`unavailable option`);function readOption(item,key,fallback){if(typeof key===`function`){const value=key(item,fallback);return value===void 0?fallback:value}if(item===null||typeof item!==`object`||key==null)return fallback;const value=(Array.isArray(key)?key:String(key).split(`.`)).reduce((source,part)=>source?.[part],item);return value===void 0?fallback:value}function optionTitle(item,itemTitle){return item?.[unavailableOption]?item.title:readOption(item,itemTitle,item)}function optionValue(item,itemTitle,itemValue){return item?.[unavailableOption]?item.value:readOption(item,itemValue,readOption(item,itemTitle,item))}function selectedValues(modelValue,multiple){if(multiple)return modelValue==null?[]:[].concat(modelValue);return modelValue==null||modelValue===``?[]:[modelValue]}function selectionFieldState(field,seen){const{modelValue,items=[],itemTitle=`title`,itemValue=`value`,multiple=false,returnObject=false}=field;if(returnObject)return{modelValue,items,hiddenValues:[]};const listed=new Set;for(const item of items){const value=optionValue(item,itemTitle,itemValue);listed.add(value);seen.set(value,item)}const missing=selectedValues(modelValue,multiple).filter(value=>!listed.has(value));const remembered=missing.filter(value=>seen.has(value)).map(value=>seen.get(value));const unresolved=missing.filter(value=>!seen.has(value));if(field.loading&&unresolved.length)return{modelValue:multiple?[].concat(modelValue).filter(value=>!unresolved.includes(value)):null,items:[...items,...remembered],hiddenValues:unresolved};const title=t$21(`jskit.http.selectField.unavailableOption`);const unavailable=unresolved.map(value=>({[unavailableOption]:true,title,value}));return{modelValue,items:missing.length?[...items,...remembered,...unavailable]:items,hiddenValues:[]}}var _sfc_main$76=Object.assign({inheritAttrs:false},{__name:`SelectField`,props:{searchable:{type:Boolean,default:false},modelValue:{type:null,default:null},items:{type:Array,default:()=>[]},itemTitle:{type:[String,Array,Function],default:`title`},itemValue:{type:[String,Array,Function],default:`value`},multiple:{type:Boolean,default:false},returnObject:{type:Boolean,default:false},loading:{type:[Boolean,String],default:false}},emits:[`update:modelValue`],setup(__props,{expose:__expose,emit:__emit}){const props=__props;const emit=__emit;const field=ref(null);const seen=new Map;const state=computed(()=>selectionFieldState(props,seen));const titleOf=item=>optionTitle(item,props.itemTitle);const valueOf=item=>optionValue(item,props.itemTitle,props.itemValue);function update(value){const hidden=state.value.hiddenValues;emit(`update:modelValue`,props.multiple&&hidden.length?[...hidden,...[].concat(value??[])]:value)}__expose({focus:()=>field.value?.focus()});return(_ctx,_cache)=>{return openBlock(),createBlock(resolveDynamicComponent(__props.searchable?unref(VAutocomplete):unref(VSelect)),mergeProps({ref_key:`field`,ref:field},_ctx.$attrs,{"model-value":state.value.modelValue,items:state.value.items,"item-title":__props.returnObject?__props.itemTitle:titleOf,"item-value":__props.returnObject?__props.itemValue:valueOf,multiple:__props.multiple,"return-object":__props.returnObject,loading:__props.loading,"onUpdate:modelValue":update}),createSlots({_:2},[renderList(_ctx.$slots,(_,name)=>{return{name,fn:withCtx(slotProps=>[renderSlot(_ctx.$slots,name,normalizeProps(guardReactiveProps(slotProps||{})))])}})]),1040,[`model-value`,`items`,`item-title`,`item-value`,`multiple`,`return-object`,`loading`])}}});var ROUTE_VISIBILITY_LEVELS=Object.freeze([ROUTE_VISIBILITY_PUBLIC,ROUTE_VISIBILITY_USER]);var ROUTE_VISIBILITY_LEVEL_SET=new Set(ROUTE_VISIBILITY_LEVELS);var ROUTE_VISIBILITY_WORKSPACE=`workspace`;var ROUTE_VISIBILITY_WORKSPACE_USER=`workspace_user`;var ROUTE_VISIBILITY_TOKENS=Object.freeze([ROUTE_VISIBILITY_PUBLIC,ROUTE_VISIBILITY_USER,ROUTE_VISIBILITY_WORKSPACE,ROUTE_VISIBILITY_WORKSPACE_USER]);var ROUTE_VISIBILITY_TOKEN_SET=new Set(ROUTE_VISIBILITY_TOKENS);function hasResolvedQueryData({query=null,data=null}={}){const querySucceeded=Boolean(unref(query?.isSuccess));const hasDataPayload=unref(data)!=null;return querySucceeded||hasDataPayload}function mergeQueryMeta(queryOptions=null,meta={}){const sourceOptions=isRecord(queryOptions)?queryOptions:{};const sourceMeta=isRecord(sourceOptions.meta)?sourceOptions.meta:{};return{...sourceOptions,meta:{...sourceMeta,...meta,jskit:{...isRecord(sourceMeta.jskit)?sourceMeta.jskit:{},...isRecord(meta.jskit)?meta.jskit:{}}}}}var REQUEST_RECOVERY_META_KEYS=Object.freeze({label:`requestRecoveryLabel`,source:`requestRecoverySource`,dedupeKey:`requestRecoveryDedupeKey`,method:`requestRecoveryMethod`,dedupeWindowMs:`requestRecoveryDedupeWindowMs`});var DISABLED_REQUEST_RECOVERY_META=Object.freeze({jskit:Object.freeze({requestRecovery:false})});function normalizeRequestRecoveryInput(requestRecovery=null){if(typeof requestRecovery===`string`)return{label:requestRecovery};const source=isRecord(requestRecovery)?requestRecovery:{};for(const key of Object.keys(source))if(key!==`enabled`&&!Object.hasOwn(REQUEST_RECOVERY_META_KEYS,key))throw new TypeError(`requestRecovery.${key} is not supported; use ${Object.keys(REQUEST_RECOVERY_META_KEYS).join(`, `)} or enabled.`);return source}function normalizeRequestRecoveryValue(name,value){if(name===`dedupeWindowMs`){const numberValue=value==null||value===``?NaN:Number(value);return Number.isFinite(numberValue)?Math.max(0,numberValue):null}const text=normalizeText$1(value);if(!text)return null;return name===`method`?text.toUpperCase():text}function buildRequestRecoveryMeta(requestRecovery=null,defaults={}){if(requestRecovery===false)return DISABLED_REQUEST_RECOVERY_META;const source=normalizeRequestRecoveryInput(requestRecovery);if(source.enabled===false)return DISABLED_REQUEST_RECOVERY_META;const fallback=isRecord(defaults)?defaults:{};const jskit={};for(const[name,metaKey]of Object.entries(REQUEST_RECOVERY_META_KEYS)){const value=normalizeRequestRecoveryValue(name,source[name])??normalizeRequestRecoveryValue(name,fallback[name]);if(value!==null)jskit[metaKey]=value}return Object.keys(jskit).length>0?{jskit}:{}}function mergeRequestRecoveryQueryMeta(queryOptions=null,requestRecovery=null,defaults={}){const sourceOptions=isRecord(queryOptions)?queryOptions:{};let meta;if(requestRecovery==null){const presetMeta=isRecord(sourceOptions.meta?.jskit)?sourceOptions.meta.jskit:{};if(presetMeta.requestRecovery===false)return sourceOptions;const fallback=isRecord(defaults)?defaults:{};const unsetDefaults={};for(const[name,metaKey]of Object.entries(REQUEST_RECOVERY_META_KEYS))if(!hasValue(presetMeta[metaKey]))unsetDefaults[name]=fallback[name];meta=buildRequestRecoveryMeta(null,unsetDefaults)}else meta=buildRequestRecoveryMeta(requestRecovery,defaults);return Object.keys(meta).length>0?mergeQueryMeta(sourceOptions,meta):sourceOptions}var{t:t$20,text:text$5,serverMessage:serverMessage$1,fieldErrorMessages}=useJskitText();function toUiErrorMessage(error,fallbackMessage=``,defaultMessage=``){const normalizedFallback=text$5(fallbackMessage).trim();const normalizedMessage=String(error?.message||``).trim();if(normalizedMessage&&!isGenericHttpErrorMessage(error))return serverMessage$1(error).trim();if(normalizedFallback)return normalizedFallback;if(normalizedMessage)return serverMessage$1(error).trim();return text$5(defaultMessage).trim()||t$20(`jskit.http.feedback.requestFailed`)}function toQueryErrorMessage(error,fallbackMessage=``,defaultMessage=``){return error?toUiErrorMessage(error,fallbackMessage,defaultMessage):``}var LOAD_REFUSED_MESSAGE_KEYS=Object.freeze({401:`jskit.http.loadRefused.unauthorized`,403:`jskit.http.loadRefused.forbidden`,404:`jskit.http.loadRefused.notFound`});function toUiFieldErrors(error){return fieldErrorMessages({fieldErrors:resolveFieldErrors(error),fieldErrorCodes:error?.fieldErrorCodes||error?.details?.fieldErrorCodes})}var{t:t$19,text:text$4}=useJskitText();var SILENT_FIELD_BAG=Object.freeze({apply(){}});var SILENT_FEEDBACK=Object.freeze({error(){}});function validateOperationInput({input,rawPayload={},fieldBag=SILENT_FIELD_BAG,feedback=SILENT_FEEDBACK,validationMessage=``}){if(!input)return{ok:true,parsedInput:rawPayload};try{return{ok:true,parsedInput:validateSchemaPayload(input,rawPayload,{phase:`input`,context:`operation input`})}}catch(error){if(!error?.fieldErrors||typeof error.fieldErrors!==`object`)throw error;const fieldErrorCodes=error.fieldErrorCodes||error.details?.fieldErrorCodes;const failure={...buildValidationFailure({error:text$4(validationMessage)||t$19(`jskit.http.feedback.validationFailed`),code:`validation_failed`,fieldErrors:error?.fieldErrors}),...fieldErrorCodes?{fieldErrorCodes}:{}};fieldBag.apply(toUiFieldErrors(failure));feedback.error(failure,failure.error);return{ok:false,failure,parsedInput:null}}}function resolveEnabledRef(value){if(value===void 0)return true;return Boolean(toValue(value))}function resolveTextRef(value){return String(unref(value)||``).trim()}var OWNERSHIP_FILTER_VALUES=ROUTE_VISIBILITY_TOKENS;var SCOPED_OWNERSHIP_FILTER_SET=new Set([ROUTE_VISIBILITY_WORKSPACE,ROUTE_VISIBILITY_WORKSPACE_USER]);var ACCESS_MODE_VALUES=Object.freeze([`auto`,`always`,`never`]);function asPlainObject(value){if(!value||typeof value!==`object`||Array.isArray(value))return{};return value}function emptyRecord(){return{}}function normalizePermissions(value){if(Array.isArray(value))return value.map(entry=>String(entry||``).trim()).filter(Boolean);const one=String(value||``).trim();return one?[one]:[]}function resolvePermissionAccess(access,normalizedPermissions=[]){if(normalizedPermissions.length<1)return true;return access.canAny(normalizedPermissions)}function normalizeAccessMode(value=`auto`){const normalized=String(value||`auto`).trim().toLowerCase();if(ACCESS_MODE_VALUES.includes(normalized))return normalized;throw new TypeError(`access must be one of: ${ACCESS_MODE_VALUES.join(`, `)}. Received: ${String(value||``)||`(empty)`}`)}function resolveAccessModeEnabled(accessMode=`auto`,{hasPermissionRequirements=false}={}){const normalizedMode=normalizeAccessMode(accessMode);if(normalizedMode===`always`)return true;if(normalizedMode===`never`)return false;return hasPermissionRequirements===true}function ensureAccessModeCompatibility({accessMode=`auto`,hasPermissionRequirements=false,caller=`http-web`}={}){const normalizedMode=normalizeAccessMode(accessMode);if(normalizedMode===`never`&&hasPermissionRequirements)throw new TypeError(`${caller} cannot use access:\"never\" when permission requirements are configured.`);return normalizedMode}function resolveApiSuffix(apiSuffix,context={}){if(typeof apiSuffix===`function`)return resolveTextRef(apiSuffix(context));return resolveTextRef(apiSuffix)}function resolveEnabled(value,context={}){if(typeof value===`function`)return Boolean(value(context));return resolveEnabledRef(value)}function normalizeOwnershipFilter(value=ROUTE_VISIBILITY_WORKSPACE){const normalized=String(value||`workspace`).trim().toLowerCase();if(OWNERSHIP_FILTER_VALUES.includes(normalized))return normalized;throw new TypeError(`ownershipFilter must be one of: ${OWNERSHIP_FILTER_VALUES.join(`, `)}. Received: ${String(value||``)||`(empty)`}`)}function isScopedOwnershipFilter(ownershipFilter){return SCOPED_OWNERSHIP_FILTER_SET.has(ownershipFilter)}function resolveQueryKey(queryKeyFactory,{surfaceId=``,scopeParamValue=``,ownershipFilter=ROUTE_VISIBILITY_WORKSPACE}={}){if(isScopedOwnershipFilter(ownershipFilter))return queryKeyFactory(surfaceId,scopeParamValue,ownershipFilter);return queryKeyFactory(surfaceId,ownershipFilter)}var{t:t$18,text:text$3}=useJskitText();function permissionRefusal(){return Object.assign(createTextError(`jskit.errors.ACTION_PERMISSION_DENIED`),{status:403,code:`ACTION_PERMISSION_DENIED`})}function useCommandCore({model,resource,writeMethod=`POST`,canRun,fieldBag,feedback,input,buildRawPayload,buildCommandPayload,buildCommandOptions=emptyRecord,onRunSuccess,onRunError,suppressSuccessMessage=false,messages={}}){const queryClient=useQueryClient();const sendsParsedInput=String(writeMethod||`POST`).trim().toUpperCase()!==`DELETE`||Boolean(input)||buildRawPayload!==void 0;const readRawPayload=buildRawPayload??emptyRecord;const running=resource.isSaving;const fieldErrors=fieldBag.errors;const message=feedback.message;const messageType=feedback.messageType;async function run(context={}){if(running.value)return null;feedback.clear();fieldBag.clear();if(!canRun.value){feedback.error(permissionRefusal(),text$3(messages.error)||t$18(`jskit.http.feedback.actionFailed`));return null}const rawPayload=readRawPayload(model,{queryClient,resource,context});const validationResult=validateOperationInput({input,rawPayload,fieldBag,feedback,validationMessage:text$3(messages.validation)||t$18(`jskit.http.feedback.validationFailed`)});if(!validationResult.ok)return null;const{parsedInput}=validationResult;const payload=typeof buildCommandPayload===`function`?buildCommandPayload(parsedInput,{rawPayload,queryClient,resource,context}):sendsParsedInput?parsedInput:void 0;const options=buildCommandOptions(parsedInput,{rawPayload,queryClient,resource,context});try{const response=await resource.save(payload,options);if(onRunSuccess)await onRunSuccess(response,{parsed:parsedInput,rawPayload,payload,options,queryClient,resource,context});if(!suppressSuccessMessage)feedback.success(text$3(messages.success)||t$18(`jskit.http.feedback.completed`));return response}catch(error){fieldBag.apply(toUiFieldErrors(error));if(onRunError)await onRunError(error,{parsed:parsedInput,rawPayload,payload,options,queryClient,resource,context});feedback.error(error,text$3(messages.error)||t$18(`jskit.http.feedback.actionFailed`));throw error}}return{running,fieldErrors,message,messageType,run}}function normalizeRealtimeOptions(value={}){if(value===null||value===void 0||value===false)return{};if(typeof value!==`object`||Array.isArray(value))throw new TypeError(`realtime must be an object when configured.`);return value}function toQueryKeyList(value){const resolved=toValue(value);if(!Array.isArray(resolved)||resolved.length<1)return[];if(Array.isArray(resolved[0]))return resolved.filter(entry=>Array.isArray(entry)&&entry.length>0).map(entry=>Object.freeze([...entry]));return[Object.freeze([...resolved])]}var followUpReads=new WeakMap;function refetchAfterCurrentRead(queryClient,query){if(followUpReads.has(query))return followUpReads.get(query);const read=()=>queryClient.refetchQueries({queryKey:query.queryKey,exact:true},{cancelRefetch:false});if(query.state.fetchStatus!==`fetching`)return read();const followUp=read().then(()=>{followUpReads.delete(query);return read()});followUpReads.set(query,followUp);return followUp}async function refreshQueriesWithoutCancelling(queryClient,queryKey){await queryClient.invalidateQueries({queryKey,refetchType:`none`});await nextTick$1();await Promise.all(queryClient.getQueryCache().findAll({queryKey,type:`active`}).map(query=>refetchAfterCurrentRead(queryClient,query)))}function useRealtimeQueryInvalidation({event=``,enabled=true,matches,queryKey=null,onEvent}){const queryClient=useQueryClient();const normalizedEvent=computed(()=>normalizeText$1(unref(event)));const active=computed(()=>resolveEnabledRef(enabled)&&Boolean(normalizedEvent.value));return{active:useRealtimeEvent({event:normalizedEvent,enabled:active,matches,onEvent:async context=>{if(onEvent)await onEvent(context);const keys=toQueryKeyList(queryKey);for(const key of keys)await refreshQueriesWithoutCancelling(queryClient,key)}}).active}}function useOperationRealtime({realtime=null,queryKey=null,enabled=true}={}){const source=normalizeRealtimeOptions(realtime);const eventList=[];if(Object.hasOwn(source,`event`)){const normalizedEvent=normalizeText$1(source.event);if(normalizedEvent)eventList.push(normalizedEvent)}if(Object.hasOwn(source,`events`)){if(!Array.isArray(source.events))throw new TypeError(`realtime.events must be an array when configured.`);for(const entry of source.events){const normalizedEvent=normalizeText$1(entry);if(!normalizedEvent||eventList.includes(normalizedEvent))continue;eventList.push(normalizedEvent)}}if(eventList.length<1)return null;const{matches,onEvent}=source;const resolvedQueryKey=Object.hasOwn(source,`queryKey`)?source.queryKey:queryKey;const active=computed(()=>{const sourceEnabled=Object.hasOwn(source,`enabled`)?source.enabled:true;return resolveEnabledRef(enabled)&&resolveEnabledRef(sourceEnabled)});const bindings=eventList.map(event=>useRealtimeQueryInvalidation({event,enabled:active,matches,queryKey:resolvedQueryKey,onEvent}));return{active:computed(()=>bindings.some(binding=>Boolean(binding.active.value)))}}function buildEndpointReadRequestOptions({method=`GET`,query=null,transport=null}={}){const requestOptions={method:String(method||`GET`).toUpperCase()};const normalizedQuery=resolveRequestQuery(query);if(normalizedQuery)requestOptions.query=normalizedQuery;if(transport&&typeof transport===`object`)requestOptions.transport=transport;return requestOptions}function resolveRequestQuery(value=null){const source=unref(value);if(!source||typeof source!==`object`||Array.isArray(source))return null;return source}function buildEndpointWriteRequestOptions({method=`PATCH`,body=void 0,options=null,transport=null}={}){const requestOptions={method:String(method||`PATCH`).toUpperCase(),...asPlainObject(options)};if(body!==void 0)requestOptions.body=body;if(transport&&typeof transport===`object`)requestOptions.transport=transport;return requestOptions}function useEndpointResource({queryKey,path=``,enabled=true,client=getHttpWebClient(),readMethod=`GET`,writeMethod=`PATCH`,readQuery,transport,refreshOnPull=false,realtime,queryOptions=null,mutationOptions=null,requestRecovery=null,requestRecoveryLabel=``,fallbackLoadError=`jskit.http.resource.loadFailed`,fallbackSaveError=`jskit.http.resource.saveFailed`}){const normalizedPath=computed(()=>resolveTextRef(path));const queryEnabled=computed(()=>resolveEnabledRef(enabled)&&Boolean(normalizedPath.value));const query=useQuery({queryKey,queryFn:({signal})=>{const requestPath=normalizedPath.value;if(!requestPath)throw new Error(`Resource path is required.`);return client.request(requestPath,{...buildEndpointReadRequestOptions({method:readMethod,query:readQuery,transport}),signal})},enabled:queryEnabled,...mergeRequestRecoveryQueryMeta(refreshOnPull?mergeQueryMeta(asPlainObject(queryOptions),{jskit:{refreshOnPull:true}}):asPlainObject(queryOptions),requestRecovery,{label:requestRecoveryLabel,method:readMethod})});const realtimeBinding=useOperationRealtime({realtime,queryKey,enabled:queryEnabled});const mutation=useMutation({mutationFn:async(request={})=>{const options=asPlainObject(request);const requestPath=resolveTextRef(options.path||normalizedPath.value);if(!requestPath)throw new Error(`Resource path is required.`);const method=String(options.method||writeMethod||`PATCH`).toUpperCase();const body=Object.hasOwn(options,`body`)?options.body:options.payload;return client.request(requestPath,buildEndpointWriteRequestOptions({method,body,options:options.options,transport}))},...asPlainObject(mutationOptions)});const data=computed(()=>query.data.value);const hasResolvedData=computed(()=>hasResolvedQueryData({query,data}));const isInitialLoading=computed(()=>Boolean(queryEnabled.value&&query.isPending.value&&!hasResolvedData.value));const isFetching=computed(()=>Boolean(queryEnabled.value&&query.isFetching.value));const isRefetching=computed(()=>Boolean(isFetching.value&&!isInitialLoading.value));const isLoading=computed(()=>Boolean(isInitialLoading.value||isFetching.value));const isSaving=computed(()=>Boolean(mutation.isPending.value));const loadError=computed(()=>toQueryErrorMessage(query.error.value,fallbackLoadError));const saveError=computed(()=>toQueryErrorMessage(mutation.error.value,fallbackSaveError));async function reload(){return query.refetch()}async function save(payload,options={}){return mutation.mutateAsync({...asPlainObject(options),payload})}return{query,mutation,data,isInitialLoading,isFetching,isRefetching,isLoading,isSaving,loadError,saveError,realtime:realtimeBinding,reload,save}}var PLACEMENT_LAYOUT_CLASSES=Object.freeze([`compact`,`medium`,`expanded`]);var WEB_PLACEMENT_SURFACE_ANY=`*`;function normalizeShellOutletTargetId(value=``){const normalizedValue=normalizeText$1(value);if(!normalizedValue)return``;const separatorIndex=normalizedValue.indexOf(`:`);if(separatorIndex<=0||separatorIndex>=normalizedValue.length-1)return``;const host=normalizeText$1(normalizedValue.slice(0,separatorIndex));const position=normalizeText$1(normalizedValue.slice(separatorIndex+1));if(!host||!position)return``;return`${host}:${position}`}function normalizeSemanticPlacementId(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(!normalizedValue||normalizedValue.includes(`:`)||!normalizedValue.includes(`.`))return``;const segments=normalizedValue.split(`.`);if(segments.length<2)return``;const normalizedSegments=[];for(const segment of segments){const normalizedSegment=normalizeText$1(segment);if(!/^[a-z0-9]+(?:[_-][a-z0-9]+)*$/.test(normalizedSegment))return``;normalizedSegments.push(normalizedSegment)}return normalizedSegments.join(`.`)}function normalizePlacementOwnerId(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(!normalizedValue)return``;if(!/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/.test(normalizedValue))return``;return normalizedValue}function normalizePlacementLayoutClass(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(PLACEMENT_LAYOUT_CLASSES.includes(normalizedValue))return normalizedValue;return``}function normalizePlacementKind(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(normalizedValue===`link`||normalizedValue===`component`)return normalizedValue;return``}function normalizePlacementSurfaceId(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(!normalizedValue)return``;if(normalizedValue===`*`)return`*`;if(/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/.test(normalizedValue))return normalizedValue;return``}function normalizePlacementSurfaces$1(value){const candidates=Array.isArray(value)?value:value===void 0||value===null?[]:[value];if(candidates.length<1)return Object.freeze([`*`]);const normalized=[];const seen=new Set;for(const candidate of candidates){const surface=normalizePlacementSurfaceId(candidate);if(!surface||seen.has(surface))continue;if(surface===`*`)return Object.freeze([`*`]);seen.add(surface);normalized.push(surface)}if(normalized.length<1)return Object.freeze([`*`]);return Object.freeze(normalized)}function resolvePlacementTargetReference(value=``){const semanticId=normalizeSemanticPlacementId(value);if(semanticId)return Object.freeze({id:semanticId,type:`semantic`});const concreteId=normalizeShellOutletTargetId(value);if(concreteId)return Object.freeze({id:concreteId,type:`concrete`});return null}function normalizePlacementRenderers(value={}){const record=normalizeObject(value);const renderers={};for(const[key,rendererToken]of Object.entries(record)){const kind=normalizePlacementKind(key);const token=normalizeText$1(rendererToken);if(!kind||!token)continue;renderers[kind]=token}return Object.freeze(renderers)}function normalizePlacementTopologyVariant(value={},{context=`placement topology variant`}={}){const record=normalizeObject(value);const outlet=normalizeShellOutletTargetId(record.outlet||record.target);if(!outlet)throw new Error(`${normalizeText$1(context)||`placement topology variant`} requires outlet in "host:position" format.`);return Object.freeze({outlet,renderers:normalizePlacementRenderers(record.renderers)})}function normalizePlacementTopologyEntry(value={},{context=`placement topology`}={}){const record=normalizeObject(value);const resolvedContext=normalizeText$1(context)||`placement topology`;const id=normalizeSemanticPlacementId(record.id||record.target);if(!id)throw new Error(`${resolvedContext} requires semantic placement id in "area.slot" format.`);const owner=normalizePlacementOwnerId(record.owner);const surfaces=normalizePlacementSurfaces$1(record.surfaces);const variantsRecord=normalizeObject(record.variants);const variants={};for(const layoutClass of PLACEMENT_LAYOUT_CLASSES){const variant=variantsRecord[layoutClass];if(!variant)throw new Error(`${resolvedContext} "${id}" requires ${layoutClass} topology variant.`);variants[layoutClass]=normalizePlacementTopologyVariant(variant,{context:`${resolvedContext} "${id}" ${layoutClass}`})}return Object.freeze({id,owner,description:normalizeText$1(record.description),surfaces,default:record.default===true,variants:Object.freeze(variants)})}function normalizePlacementTopologyDefinition(value={},{context=`placement topology`}={}){const record=normalizeObject(value);const entries=Array.isArray(record.placements)?record.placements:Array.isArray(value)?value:[];const normalized=[];const seen=new Set;for(const entry of entries){const placement=normalizePlacementTopologyEntry(entry,{context});const key=`${placement.id}::${placement.owner||``}`;if(seen.has(key))throw new Error(`${normalizeText$1(context)||`placement topology`} contains duplicate semantic placement "${placement.id}"${placement.owner?` for owner "${placement.owner}"`:``}.`);seen.add(key);normalized.push(placement)}return Object.freeze({placements:Object.freeze(normalized)})}function placeAlways(){return true}function isRenderableComponent(value){if(typeof value===`function`)return true;return isRecord(value)}function normalizeSurface(value){return normalizeText$1(value).toLowerCase()||`*`}function normalizePlacementSurface(value,{strict=false,source=`placement`}={}){const surface=normalizePlacementSurfaceId(value);if(!surface&&strict){const normalized=normalizeText$1(value).toLowerCase();throw new TypeError(normalized?`${source} surface "${normalized}" is invalid.`:`${source} requires surface id or "*".`)}return surface}function toInteger(value,fallback=1e3){const numeric=Number(value);if(!Number.isFinite(numeric))return fallback;return Math.trunc(numeric)}function normalizePlacementTarget(value,{strict=false,source=`placement`}={}){const reference=resolvePlacementTargetReference(String(value||``).toLowerCase());if(reference?.id)return reference.id;if(strict)throw new TypeError(`${source} requires semantic target in "area.slot" format or internal concrete target in "host:position" format.`);return``}function normalizePlacementSurfaces(value,{strict=false,source=`placement`}={}){if(strict){const candidates=Array.isArray(value)?value:value===void 0||value===null?[]:[value];for(const candidate of candidates)if(normalizePlacementSurface(candidate,{strict,source})===`*`)break}return normalizePlacementSurfaces$1(value)}function normalizePlacementDefinition(value,{strict=false,source=`placement`}={}){if(!isRecord(value)){if(strict)throw new TypeError(`${source} must be an object.`);return null}const id=normalizeText$1(value.id);if(!id){if(strict)throw new TypeError(`${source} requires id.`);return null}const target=normalizePlacementTarget(value.target,{strict,source:`${source} "${id}"`});if(!target)return null;const targetReference=resolvePlacementTargetReference(target);const internal=value.internal===true;if(targetReference?.type===`concrete`&&internal!==true){if(strict)throw new TypeError(`${source} "${id}" targets concrete outlet "${target}" without internal: true.`);return null}const owner=normalizeText$1(value.owner).toLowerCase();const kind=normalizePlacementKind(value.kind)||(normalizeText$1(value.componentToken)?`component`:`link`);const componentToken=normalizeText$1(value.componentToken);if(kind===`component`&&!componentToken){if(strict)throw new TypeError(`${source} "${id}" requires componentToken.`);return null}const props=isRecord(value.props)?{...value.props}:{};const when=value.when||placeAlways;const surfaces=normalizePlacementSurfaces(value.surfaces,{strict,source:`${source} "${id}"`});return Object.freeze({id,target,targetType:targetReference?.type||``,owner,kind,surfaces,order:toInteger(value.order,1e3),componentToken,props,when,enabled:value.enabled!==false,internal})}function definePlacement(value={}){return normalizePlacementDefinition(value,{strict:true,source:`placement contribution`})}function createPlacementRegistry({entries=[]}={}){const placements=[];const ids=new Set;function addPlacement(value={}){const placement=definePlacement(value);if(ids.has(placement.id))return false;ids.add(placement.id);placements.push(placement);return true}for(const entry of Array.isArray(entries)?entries:[])addPlacement(entry);function hasPlacement(id){return ids.has(String(id||``).trim())}function build(){return Object.freeze([...placements])}return Object.freeze({addPlacement,hasPlacement,build})}var SHELL_WEB_PLACEMENT_RUNTIME_KEY=`jskit.shell-web.runtime.web-placement.client`;var NO_WEB_PLACEMENT_RUNTIME=Object.freeze({replacePlacements(){},replacePlacementTopology(){},getPlacements(){return Object.freeze([])},getContext(){return Object.freeze({})},setContext(){return Object.freeze({})},subscribe(){return()=>{}},getRevision(){return 0}});function useWebPlacementRuntime(){return inject$1(SHELL_WEB_PLACEMENT_RUNTIME_KEY,NO_WEB_PLACEMENT_RUNTIME)}function followWebPlacementRuntime(runtime,listener){let unsubscribe=null;onMounted(()=>{unsubscribe=runtime.subscribe(listener)});onBeforeUnmount(()=>{if(unsubscribe){unsubscribe();unsubscribe=null}})}function useWebPlacementContext(){const runtime=useWebPlacementRuntime();const context=shallowRef(runtime.getContext());followWebPlacementRuntime(runtime,()=>{context.value=runtime.getContext()});function mergeContext(value={},source=`component`){context.value=runtime.setContext(value,{source});return context.value}function replaceContext(value={},source=`component`){context.value=runtime.setContext(value,{replace:true,source});return context.value}return{context,mergeContext,replaceContext}}function useWebPlacementRevision(runtime){const revision=ref(runtime.getRevision());followWebPlacementRuntime(runtime,event=>{revision.value=event.revision});return revision}function pageWindow(){return typeof window!==`undefined`?window:null}function pageDocument(){return typeof document!==`undefined`?document:null}function pagePathname(){return String(pageWindow()?.location?.pathname||``).trim()}function pageOrigin(){return String(pageWindow()?.location?.origin||``)}function pageTitle(){return String(pageDocument()?.title||``)}function pageViewportWidth(){return Number(pageWindow()?.innerWidth||0)}function resolveRuntimePathname(candidate=``){return String(candidate||``).trim()||pagePathname()||`/`}var EMPTY_SURFACE_CONFIG=Object.freeze({tenancyMode:``,defaultSurfaceId:``,enabledSurfaceIds:Object.freeze([]),surfacesById:Object.freeze({})});function normalizeSurfaceIdList(value){if(!Array.isArray(value))return[];const seen=new Set;const normalized=[];for(const candidate of value){const surfaceId=normalizeLowerText(candidate);if(!surfaceId||seen.has(surfaceId))continue;seen.add(surfaceId);normalized.push(surfaceId)}return normalized}function normalizeSurfaceConfig(surfaceConfig={}){const source=isRecord(surfaceConfig)?surfaceConfig:{};const enabledSurfaceIds=normalizeSurfaceIdList(source.enabledSurfaceIds);const enabledSet=new Set(enabledSurfaceIds);const rawSurfacesById=isRecord(source.surfacesById)?source.surfacesById:{};const normalizedSurfacesById={};for(const[rawSurfaceId,rawDefinition]of Object.entries(rawSurfacesById)){const definition=isRecord(rawDefinition)?rawDefinition:{};const surfaceId=normalizeLowerText(definition.id||rawSurfaceId);if(!surfaceId)continue;const pagesRoot=normalizeSurfacePagesRoot(definition.pagesRoot);const routeBase=String(definition.routeBase||deriveSurfaceRouteBaseFromPagesRoot(pagesRoot)).trim()||`/`;const enabled=enabledSet.size>0?enabledSet.has(surfaceId):definition.enabled!==false;normalizedSurfacesById[surfaceId]=Object.freeze({...definition,id:surfaceId,pagesRoot,routeBase,enabled})}const derivedEnabledSurfaceIds=enabledSurfaceIds.length>0?enabledSurfaceIds.filter(surfaceId=>Boolean(normalizedSurfacesById[surfaceId])):Object.values(normalizedSurfacesById).filter(definition=>definition.enabled).map(definition=>definition.id);const defaultSurfaceId=normalizeLowerText(source.defaultSurfaceId);const resolvedDefaultSurfaceId=normalizedSurfacesById[defaultSurfaceId]?defaultSurfaceId:derivedEnabledSurfaceIds[0]||Object.keys(normalizedSurfacesById)[0]||``;return Object.freeze({tenancyMode:String(source.tenancyMode||``).trim().toLowerCase(),defaultSurfaceId:resolvedDefaultSurfaceId,enabledSurfaceIds:Object.freeze([...derivedEnabledSurfaceIds]),surfacesById:Object.freeze({...normalizedSurfacesById})})}function buildSurfaceConfigContext(surfaceRuntime,{tenancyMode=``}={}){const surfacesById={};for(const definition of surfaceRuntime.listSurfaceDefinitions()){const surfaceId=normalizeLowerText(definition.id);if(!surfaceId)continue;surfacesById[surfaceId]=definition}return normalizeSurfaceConfig({tenancyMode:String(tenancyMode||``).trim().toLowerCase(),defaultSurfaceId:surfaceRuntime.DEFAULT_SURFACE_ID,enabledSurfaceIds:surfaceRuntime.listEnabledSurfaceIds(),surfacesById})}function readPlacementSurfaceConfig(contextValue=null){return normalizeSurfaceConfig((isRecord(contextValue)?contextValue:{}).surfaceConfig)}function resolveSurfaceDefinitionFromPlacementContext(contextValue=null,surfaceId=``){const surfaceConfig=readPlacementSurfaceConfig(contextValue);const normalizedSurfaceId=normalizeLowerText(surfaceId);if(!normalizedSurfaceId)return null;return surfaceConfig.surfacesById[normalizedSurfaceId]||null}function joinSurfacePath(surfacePrefix=``,pathname=``){const normalizedPrefix=normalizePathname$1(surfacePrefix||`/`);const rawPathname=String(pathname||``).trim();if(!rawPathname)return normalizedPrefix;const normalizedPathname=(rawPathname.startsWith(`/`)?rawPathname:`/${rawPathname}`).replace(/\/{2,}/g,`/`);const compacted=(normalizedPrefix===`/`?normalizedPathname:`${normalizedPrefix}${normalizedPathname}`).replace(/\/{2,}/g,`/`);if(!compacted)return`/`;return compacted===`/`?compacted:compacted.replace(/\/+$/,``)||`/`}function resolveSurfaceRootPathFromPlacementContext(contextValue=null,surfaceId=``){return joinSurfacePath(resolveSurfaceDefinitionFromPlacementContext(contextValue,surfaceId)?.routeBase,``)}function decodePathSegment(segment=``){try{return decodeURIComponent(segment)}catch{return segment}}function resolveSurfaceRouteParamsFromPlacementPathname(contextValue=null,surfaceId=``,pathname=``){const surfaceDefinition=resolveSurfaceDefinitionFromPlacementContext(contextValue,surfaceId);if(!surfaceDefinition)return{};const routeBaseSegments=normalizePathname$1(surfaceDefinition.routeBase).split(`/`).filter(Boolean);const pathSegments=normalizePathname$1(pathname).split(`/`).filter(Boolean);const params={};for(const[index,routeBaseSegment]of routeBaseSegments.entries()){const pathSegment=pathSegments[index];if(!pathSegment)return{};if(routeBaseSegment.startsWith(`:`)&&routeBaseSegment.length>1)params[routeBaseSegment.slice(1)]=decodePathSegment(pathSegment);else if(routeBaseSegment!==pathSegment)return{}}return params}function normalizeSurfaceOrigin(originValue=``){const rawOrigin=String(originValue||``).trim();if(!rawOrigin)return``;try{const parsed=new URL(rawOrigin);if(parsed.protocol!==`http:`&&parsed.protocol!==`https:`)return``;return parsed.origin}catch{return``}}function resolveRuntimeOrigin(currentOrigin=``){return normalizeSurfaceOrigin(currentOrigin)||normalizeSurfaceOrigin(pageOrigin())}function resolveSurfaceNavigationTargetFromPlacementContext(contextValue=null,{path=`/`,surfaceId=``,currentOrigin=``}={}){const rawPath=String(path||``).trim()||`/`;if(isExternalLinkTarget(rawPath))return Object.freeze({href:rawPath,sameOrigin:false,surfaceId:normalizeLowerText(surfaceId),external:true});const{pathname,search,hash}=splitPathQueryHash(rawPath);const normalizedPathname=normalizePathname$1(pathname||`/`);const normalizedPath=`${normalizedPathname}${search}${hash}`;const resolvedSurfaceId=normalizeLowerText(surfaceId)||resolveSurfaceIdFromPlacementPathname(contextValue,normalizedPathname)||``;const targetOrigin=normalizeSurfaceOrigin((resolvedSurfaceId?resolveSurfaceDefinitionFromPlacementContext(contextValue,resolvedSurfaceId):null)?.origin||``);const runtimeOrigin=resolveRuntimeOrigin(currentOrigin);if(!targetOrigin)return Object.freeze({href:normalizedPath,sameOrigin:true,surfaceId:resolvedSurfaceId,external:false});if(runtimeOrigin&&targetOrigin===runtimeOrigin)return Object.freeze({href:normalizedPath,sameOrigin:true,surfaceId:resolvedSurfaceId,external:false});return Object.freeze({href:`${targetOrigin}${normalizedPath}`,sameOrigin:false,surfaceId:resolvedSurfaceId,external:false})}function createPlacementSurfacePathHelpers(surfaceConfig=EMPTY_SURFACE_CONFIG){const surfacesById=isRecord(surfaceConfig.surfacesById)?surfaceConfig.surfacesById:{};const defaultSurfaceId=normalizeLowerText(surfaceConfig.defaultSurfaceId);const fallbackSurfaceId=Object.keys(surfacesById)[0]||``;const resolvedDefaultSurfaceId=defaultSurfaceId&&surfacesById[defaultSurfaceId]?defaultSurfaceId:fallbackSurfaceId;if(!resolvedDefaultSurfaceId)return null;return createSurfacePathHelpers({defaultSurfaceId:resolvedDefaultSurfaceId,surfaceDefinitions:Object.values(surfacesById)})}function resolveSurfaceIdFromPlacementPathname(contextValue=null,pathname=``){const surfaceConfig=readPlacementSurfaceConfig(contextValue);const normalizedPathname=normalizePathname$1(pathname);const pathHelpers=createPlacementSurfacePathHelpers(surfaceConfig);if(!pathHelpers)return``;return pathHelpers.resolveSurfaceFromPathname(normalizedPathname)}var{t:t$17}=useJskitText();function asPermissionList(value){if(Array.isArray(value))return value;if(value===void 0||value===null||value===``)return[];return[value]}function useAccess({enabled=true,access=`always`,hasPermissionRequirements=false}={}){const normalizedAccessMode=normalizeAccessMode(access);const accessRequired=resolveAccessModeEnabled(normalizedAccessMode,{hasPermissionRequirements:hasPermissionRequirements===true});const{context:placementContext}=useWebPlacementContext();const queryEnabled=computed(()=>resolveEnabledRef(enabled)&&accessRequired);const hasPlacementPermissions=computed(()=>{const source=placementContext.value;if(!source||typeof source!==`object`)return false;return Object.hasOwn(source,`permissions`)});const placementPermissions=computed(()=>normalizePermissionList(placementContext.value?.permissions));const permissions=computed(()=>{if(!queryEnabled.value||!hasPlacementPermissions.value)return[];return placementPermissions.value});const permissionsUnavailableError=computed(()=>{if(!queryEnabled.value||hasPlacementPermissions.value)return``;return t$17(`jskit.http.access.permissionsUnavailable`)});const awaitingPlacementPermissions=computed(()=>queryEnabled.value&&!hasPlacementPermissions.value);function can(permission){return hasPermission(permissions.value,permission)}function canAny(requiredPermissions){const list=asPermissionList(requiredPermissions);if(list.length<1)return true;for(const entry of list)if(can(entry))return true;return false}function canAll(requiredPermissions){const list=asPermissionList(requiredPermissions);if(list.length<1)return true;for(const entry of list)if(!can(entry))return false;return true}return{accessMode:normalizedAccessMode,accessRequired,permissions,permissionsUnavailableError,awaitingPlacementPermissions,can,canAny,canAll}}function normalizeRouteParams(params=null){if(!params||typeof params!==`object`||Array.isArray(params))return{};const output={};for(const[rawKey,rawValue]of Object.entries(params)){const key=normalizeText$1(rawKey);if(!key)continue;const value=Array.isArray(rawValue)?rawValue[0]:rawValue;const normalizedValue=normalizeText$1(value);if(normalizedValue)output[key]=normalizedValue}return output}function fillPathParams(pathTemplate=`/`,{params={},strictParams=true,label=`route params`}={}){const template=String(pathTemplate||`/`);const suffixStart=template.search(/[?#]/u);const pathPart=suffixStart<0?template:template.slice(0,suffixStart);const suffix=suffixStart<0?``:template.slice(suffixStart);const normalizedParams=normalizeRouteParams(params);const missingParams=new Set;const outputPath=pathPart.replace(/(^|\/):([A-Za-z0-9_]+)/g,(full,start,paramName)=>{const paramValue=normalizedParams[paramName];if(!paramValue){missingParams.add(paramName);return full}return`${start}${encodeURIComponent(paramValue)}`});if(strictParams&&missingParams.size>0){const missing=[...missingParams].sort().join(`, `);throw new Error(`Missing required ${label}: ${missing}.`)}return`${outputPath}${suffix}`}function resolveSurfaceBasePath(context=null,surface=``,{params={},strictParams=true}={}){const normalizedSurface=normalizeLowerText(surface);if(normalizedSurface&&resolveSurfaceDefinitionFromPlacementContext(context,normalizedSurface))return fillPathParams(resolveSurfaceRootPathFromPlacementContext(context,normalizedSurface),{params,strictParams,label:`surface route params for "${normalizedSurface}"`});if(!normalizedSurface)return`/`;return normalizePathname$1(`/${normalizedSurface}`)}function resolveShellLinkPath({context=null,surface=``,explicitTo=``,relativePath=`/`,surfaceRelativePath=``,params={},strictParams=true}={}){const explicitTarget=String(explicitTo||``).trim();if(explicitTarget)return explicitTarget;const normalizedSurface=normalizeLowerText(surface);const nextRelativePath=String(surfaceRelativePath||``).trim()||String(relativePath||``).trim()||`/`;const nextSurfaceBasePath=resolveSurfaceBasePath(context,normalizedSurface,{params,strictParams});const filledRelativePath=isExternalLinkTarget(nextRelativePath)?nextRelativePath:fillPathParams(nextRelativePath,{params,strictParams,label:`route params for "${nextRelativePath}"`});return resolveLinkPath(nextSurfaceBasePath,filledRelativePath)}function useShellLinkResolver({surface=``}={}){const{context:placementContext}=useWebPlacementContext();function resolve(relativePath=`/`,options={}){return resolveShellLinkPath({context:placementContext.value,surface:String(unref(options.surface??surface)||``),explicitTo:options.explicitTo,relativePath,surfaceRelativePath:options.surfaceRelativePath,params:options.params,strictParams:options.strictParams!==false})}return{resolve}}function useSurfaceRouteContext(){const route=useRoute$1();const{context:placementContext,mergeContext:mergePlacementContext}=useWebPlacementContext();const routePath=computed(()=>resolveRuntimePathname(route.path));return{route,routePath,placementContext,mergePlacementContext,currentSurfaceId:computed(()=>resolveSurfaceIdFromPlacementPathname(placementContext.value,routePath.value))}}function normalizePathSuffix(value=``){const raw=normalizeText$1(unref(value));if(!raw)return``;return raw.startsWith(`/`)?raw:`/${raw}`}function resolveSurfaceId(value,fallback=``){const normalized=normalizeText$1(unref(value)).toLowerCase();if(normalized&&normalized!==`*`)return normalized;const normalizedFallback=normalizeText$1(unref(fallback)).toLowerCase();if(normalizedFallback&&normalizedFallback!==`*`)return normalizedFallback;return``}function resolveDefaultSurfaceIdFromPlacementContext(placementContext=null){return resolveSurfaceId(placementContext?.surfaceConfig?.defaultSurfaceId,``)}function resolveRouteParams(baseParams={},overrideParams=null){return{...normalizeRouteParams(baseParams),...normalizeRouteParams(overrideParams)}}function usePaths({routeContext=useSurfaceRouteContext()}={}){const shellLinkResolver=useShellLinkResolver();const routeParams=computed(()=>normalizeRouteParams(routeContext.route.params));function page(relativePath=`/`,options={}){const source=normalizeObject(options);if(source.scope===`global`)return shellLinkResolver.resolve(relativePath,{surface:``,params:resolveRouteParams(routeParams.value,source.params),strictParams:source.strictParams!==false});const surface=resolveSurfaceId(source.surface,routeContext.currentSurfaceId.value)||resolveDefaultSurfaceIdFromPlacementContext(routeContext.placementContext.value);if(!surface)return``;return shellLinkResolver.resolve(relativePath,{surface,explicitTo:source.explicitTo,surfaceRelativePath:source.surfaceRelativePath,params:resolveRouteParams(routeParams.value,source.params),strictParams:source.strictParams!==false})}function api(relativePath=``,options={}){const source=normalizeObject(options);const surface=resolveSurfaceId(source.surface,routeContext.currentSurfaceId.value)||resolveDefaultSurfaceIdFromPlacementContext(routeContext.placementContext.value);const suffix=normalizePathSuffix(relativePath);if(!suffix)throw new TypeError(`usePaths().api(relativePath) requires a non-empty relativePath.`);const routeBase=resolveSurfaceDefinitionFromPlacementContext(routeContext.placementContext.value,surface)?.routeBase||`/`;return resolveScopedApiBasePath({routeBase,relativePath:suffix,params:resolveRouteParams(routeParams.value,source.params),strictParams:source.strictParams!==false})}return{route:routeContext.route,placementContext:routeContext.placementContext,currentSurfaceId:routeContext.currentSurfaceId,routeParams,page,api}}function toRouteParamValue(value){if(Array.isArray(value))return toRouteParamValue(value[0]);if(value==null)return``;return String(value).trim()}function extractRouteParamNames(pathTemplate=``){const normalizedTemplate=String(pathTemplate||``).trim();if(!normalizedTemplate)return[];const names=[];const seen=new Set;const pattern=/:([A-Za-z][A-Za-z0-9_]*)/g;let match=null;while((match=pattern.exec(normalizedTemplate))!=null){const name=String(match[1]||``).trim();if(!name||seen.has(name))continue;seen.add(name);names.push(name)}return names}var{t:t$16}=useJskitText();function resolveScopedRouteParamNames(placementContext=null,surfaceId=``){const routeBase=resolveSurfaceDefinitionFromPlacementContext(placementContext,surfaceId)?.routeBase||`/`;return extractRouteParamNames(resolveScopedRouteBase(routeBase))}function useScopeRuntime({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,accessMode=`auto`,hasPermissionRequirements=false}={}){const normalizedOwnershipFilter=normalizeOwnershipFilter(ownershipFilter);const normalizedAccessMode=ensureAccessModeCompatibility({accessMode,hasPermissionRequirements,caller:`useScopeRuntime`});const accessRequired=resolveAccessModeEnabled(normalizedAccessMode,{hasPermissionRequirements});const routeContext=useSurfaceRouteContext();const paths=usePaths({routeContext});const resolvedSurfaceId=computed(()=>{const explicitSurfaceId=normalizeLowerText(surfaceId);if(explicitSurfaceId)return explicitSurfaceId;return normalizeLowerText(routeContext.currentSurfaceId.value)});const scopedRouteParamNames=computed(()=>resolveScopedRouteParamNames(routeContext.placementContext.value,resolvedSurfaceId.value));const routeScopeParams=computed(()=>{const source=paths.routeParams.value;const next={};for(const paramName of scopedRouteParamNames.value){const paramValue=toRouteParamValue(source[paramName]);if(paramValue)next[paramName]=paramValue}return Object.freeze(next)});const missingScopedRouteParamNames=computed(()=>scopedRouteParamNames.value.filter(paramName=>!routeScopeParams.value[paramName]));const requiresScopedRouteParams=computed(()=>scopedRouteParamNames.value.length>0);const hasRequiredRouteScope=computed(()=>missingScopedRouteParamNames.value.length<1);const scopeParamValue=computed(()=>{const[primaryScopeParamName=``]=scopedRouteParamNames.value;return primaryScopeParamName?routeScopeParams.value[primaryScopeParamName]||``:``});const routeScopeError=computed(()=>{if(!requiresScopedRouteParams.value||hasRequiredRouteScope.value)return``;const missingParams=missingScopedRouteParamNames.value.join(`, `);return t$16(`jskit.http.access.routeParamsRequired`,{params:missingParams,surface:resolvedSurfaceId.value||`<unknown>`})});const accessRuntime=useAccess({enabled:computed(()=>accessRequired&&hasRequiredRouteScope.value),access:normalizedAccessMode,hasPermissionRequirements});function resolveApiPath(apiSuffix=``,context={}){if(routeScopeError.value)return``;const suffix=resolveApiSuffix(apiSuffix,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter,...asPlainObject(context)});return paths.api(suffix,{surface:resolvedSurfaceId.value,params:routeScopeParams.value})}function requireRouteScope(caller=`useScopeRuntime`){if(routeScopeError.value)throw new Error(`${caller}: ${routeScopeError.value}`)}return{normalizedOwnershipFilter,requiresScopedRouteParams:requiresScopedRouteParams.value,resolvedSurfaceId,accessMode:normalizedAccessMode,accessRequired,routeContext,scopedRouteParamNames,routeScopeParams,scopeParamValue,hasRequiredRouteScope,routeScopeError,access:accessRuntime,resolveApiPath,requireRouteScope}}function normalizePermissionSets(permissionSets={}){const source=permissionSets&&typeof permissionSets===`object`&&!Array.isArray(permissionSets)?permissionSets:{};const normalized={};for(const[key,value]of Object.entries(source))normalized[key]=normalizePermissions(value);return normalized}function hasAnyPermissions(permissionSets={}){for(const list of Object.values(permissionSets))if(Array.isArray(list)&&list.length>0)return true;return false}function useOperationScope({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,access=`auto`,apiSuffix=``,model,readEnabled=true,queryKeyFactory,permissionSets={},realtime}){const normalizedPermissionSets=normalizePermissionSets(permissionSets);const scopeRuntime=useScopeRuntime({ownershipFilter,surfaceId,accessMode:access,hasPermissionRequirements:hasAnyPermissions(normalizedPermissionSets)});const normalizedOwnershipFilter=scopeRuntime.normalizedOwnershipFilter;const routeContext=scopeRuntime.routeContext;const scopeParamValue=scopeRuntime.scopeParamValue;const hasRequiredRouteScope=scopeRuntime.hasRequiredRouteScope;const accessRuntime=scopeRuntime.access;const apiPath=computed(()=>scopeRuntime.resolveApiPath(apiSuffix,{model}));const queryEnabled=computed(()=>resolveEnabled(readEnabled,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter,model}));const queryKey=computed(()=>resolveQueryKey(queryKeyFactory,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter}));const realtimeBinding=useOperationRealtime({realtime,queryKey:typeof queryKeyFactory===`function`?queryKey:null,enabled:computed(()=>hasRequiredRouteScope.value&&Boolean(apiPath.value))});function queryCanRun(accessGate=true){return computed(()=>queryEnabled.value&&hasRequiredRouteScope.value&&Boolean(apiPath.value)&&Boolean(unref(accessGate)))}function permissionGate(key=``){const list=normalizedPermissionSets[String(key||``)]||[];return computed(()=>resolvePermissionAccess(accessRuntime,list))}function loadError(baseError=``){return computed(()=>{if(scopeRuntime.routeScopeError.value)return scopeRuntime.routeScopeError.value;const permissionsError=String(accessRuntime.permissionsUnavailableError.value||``).trim();if(permissionsError)return permissionsError;if(baseError===void 0||baseError===null||baseError===``)return``;return String(unref(baseError)||``).trim()})}function isLoading(baseLoading=false){return computed(()=>Boolean(unref(baseLoading))||accessRuntime.awaitingPlacementPermissions.value)}return{scopeRuntime,routeContext,normalizedOwnershipFilter,scopeParamValue,hasRequiredRouteScope,access:accessRuntime,apiPath,queryEnabled,queryKey,queryCanRun,realtime:realtimeBinding,permissionGate,loadError,isLoading}}function useUiFeedback({initialType=`success`,source=`http-web.ui-feedback`,successChannel=``,warningChannel=``,errorChannel=``,dedupeWindowMs=2e3}={}){const message=ref(``);const messageType=ref(String(initialType||`success`));const errorRuntime=useShellWebErrorRuntime();const normalizedSource=String(source||``).trim()||`http-web.ui-feedback`;let lastErrorPresentation=null;function rememberErrorPresentation(reportResult=null){const presentationId=String(reportResult?.presentationId||``).trim();const presenterId=String(reportResult?.decision?.presenterId||``).trim();if(!presentationId||!presenterId)return;lastErrorPresentation=Object.freeze({presentationId,presenterId})}function dismissLastErrorPresentation(){if(!lastErrorPresentation)return;errorRuntime.dismiss(lastErrorPresentation.presentationId,{presenterId:lastErrorPresentation.presenterId});lastErrorPresentation=null}function clear(){message.value=``}function reportDone(severity,channel,nextMessage){messageType.value=severity;const normalizedMessage=String(nextMessage||``).trim();message.value=normalizedMessage;dismissLastErrorPresentation();if(!normalizedMessage)return;errorRuntime.report({source:normalizedSource,message:normalizedMessage,intent:`action-feedback`,severity,channel,dedupeKey:`${normalizedSource}:${severity}:${normalizedMessage}`,dedupeWindowMs})}function success(nextMessage=``){reportDone(`success`,successChannel,nextMessage)}function warning(nextMessage=``){reportDone(`warning`,warningChannel,nextMessage)}function error(errorValue,fallbackMessage=``){messageType.value=`error`;message.value=toUiErrorMessage(errorValue,fallbackMessage);if(!message.value)return;const reportResult=errorRuntime.report({source:normalizedSource,message:message.value,cause:errorValue||null,intent:`action-feedback`,severity:`error`,channel:errorChannel,dedupeKey:`${normalizedSource}:error:${message.value}`,dedupeWindowMs});if(!reportResult?.skipped)rememberErrorPresentation(reportResult)}return{message,messageType,clear,success,warning,error}}function normalizeFieldErrorKeys(keys){return Array.isArray(keys)?keys.map(entry=>String(entry||``).trim()).filter(Boolean):[]}function useFieldErrorBag(keys=[]){const normalizedKeys=normalizeFieldErrorKeys(keys);const hasFixedKeys=normalizedKeys.length>0;const errors=reactive(Object.fromEntries(normalizedKeys.map(key=>[key,``])));function clear(){const keysToClear=hasFixedKeys?normalizedKeys:Object.keys(errors);for(const key of keysToClear)errors[key]=``}function apply(source={}){const fieldErrorMap=source&&typeof source===`object`?source:{};if(hasFixedKeys){for(const key of normalizedKeys)errors[key]=String(fieldErrorMap[key]||``);return}clear();for(const[field,message]of Object.entries(fieldErrorMap)){const key=String(field||``).trim();if(!key)continue;errors[key]=String(message||``)}}function set(field,message){const key=String(field||``).trim();if(!key)return;if(hasFixedKeys&&!(key in errors))return;errors[key]=String(message||``)}return{errors,clear,apply,set}}var{t:t$15}=useJskitText();function normalizeMessage(value){return String(value||``).trim()}function noRetryAction(){return null}function setupOperationErrorReporting({enabled=true,source=`http-web.operation`,loadError=null,notFoundError=null,loadActionFactory=noRetryAction,notFoundActionFactory=noRetryAction,loadChannel=``,notFoundChannel=``,loadSeverity=`error`,notFoundSeverity=`warning`,dedupeWindowMs=2e3}={}){if(!enabled)return;const runtime=useShellWebErrorRuntime();const normalizedSource=normalizeMessage(source)||`http-web.operation`;function watchMessage(value,{kind=`load`,channel=``,intent=`resource-load`,severity=`error`,actionFactory=noRetryAction}={}){let lastMessage=``;let lastPresentationId=``;watch(()=>normalizeMessage(value.value),nextMessage=>{if(!nextMessage){lastMessage=``;if(lastPresentationId){runtime.dismiss(lastPresentationId);lastPresentationId=``}return}if(nextMessage===lastMessage)return;lastMessage=nextMessage;const action=actionFactory({message:nextMessage,kind});const reportResult=runtime.report({source:normalizedSource,message:nextMessage,intent,severity,channel,action,dedupeKey:`${normalizedSource}:${kind}:${nextMessage}`,dedupeWindowMs});const nextPresentationId=String(reportResult?.presentationId||``).trim();if(nextPresentationId){if(lastPresentationId&&lastPresentationId!==nextPresentationId)runtime.dismiss(lastPresentationId);lastPresentationId=nextPresentationId}},{immediate:true})}if(loadError)watchMessage(loadError,{kind:`load`,channel:loadChannel,intent:`resource-load`,severity:loadSeverity,actionFactory:loadActionFactory});if(notFoundError)watchMessage(notFoundError,{kind:`not-found`,channel:notFoundChannel,intent:`resource-load`,severity:notFoundSeverity,actionFactory:notFoundActionFactory})}function setupRouteChangeCleanup({enabled=true,route,feedback,onClear}){if(!enabled)return;watch(()=>route?.fullPath,()=>{feedback.clear();onClear()})}var CRUD_API_ACCESS_AUTHENTICATED=`authenticated`;var CRUD_API_ACCESS_PUBLIC=`public`;var CRUD_API_ACCESS_VALUES=Object.freeze([CRUD_API_ACCESS_AUTHENTICATED,CRUD_API_ACCESS_PUBLIC]);var publicCrudClients=new WeakSet;function normalizeCrudApiAccess(value=``){const normalized=normalizeText$1(value).toLowerCase()||`authenticated`;if(CRUD_API_ACCESS_VALUES.includes(normalized))return normalized;throw new TypeError(`CRUD resource apiAccess must be one of: ${CRUD_API_ACCESS_VALUES.join(`, `)}. Received: ${String(value||``)||`(empty)`}`)}function resolveCrudHttpClient(resource=null,{client=getHttpWebClient()}={}){if(normalizeCrudApiAccess(resource?.apiAccess)!==`public`)return client;if(publicCrudClients.has(client))return client;const publicClient=Object.freeze({request(url,options={}){const requestOptions=options&&typeof options===`object`&&!Array.isArray(options)?options:{};return client.request(url,{...requestOptions,csrf:false})}});publicCrudClients.add(publicClient);return publicClient}function useCommand({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,access=`auto`,apiSuffix=``,runPermissions=[],writeMethod=`POST`,client,resource:commandResource=null,transport,placementSource=`http-web.command`,fallbackRunError=`jskit.http.feedback.actionFailed`,fieldErrorKeys,clearOnRouteChange=true,model,input,buildRawPayload,buildCommandPayload,buildCommandOptions,onRunSuccess,onRunError,suppressSuccessMessage=false,messages={},realtime}){const operationScope=useOperationScope({ownershipFilter,surfaceId,access,apiSuffix,model,readEnabled:false,permissionSets:{run:runPermissions},realtime});const routeContext=operationScope.routeContext;const canRun=operationScope.permissionGate(`run`);const endpointResource=useEndpointResource({path:operationScope.apiPath,enabled:false,client:resolveCrudHttpClient(commandResource,{client}),writeMethod,transport,fallbackSaveError:fallbackRunError});const feedback=useUiFeedback({source:`${placementSource}.feedback`});const fieldBag=useFieldErrorBag(fieldErrorKeys);const command=useCommandCore({model,resource:endpointResource,writeMethod,canRun,fieldBag,feedback,input,buildRawPayload,buildCommandPayload,buildCommandOptions,onRunSuccess,onRunError,suppressSuccessMessage:Boolean(suppressSuccessMessage),messages:{validation:`jskit.http.feedback.fixInvalidValues`,success:`jskit.http.feedback.completed`,error:String(fallbackRunError||`jskit.http.feedback.actionFailed`),...messages&&typeof messages===`object`?messages:{}}});setupRouteChangeCleanup({enabled:clearOnRouteChange,route:routeContext.route,feedback,onClear:fieldBag.clear});const loadError=operationScope.loadError();const isLoading=operationScope.isLoading();setupOperationErrorReporting({source:`${placementSource}.load`,loadError});return proxyRefs({canRun,isLoading,loadError,isRunning:command.running,fieldErrors:command.fieldErrors,message:command.message,messageType:command.messageType,run:command.run,resource:endpointResource})}function readRefOrGetterValue(value){return unref(typeof value===`function`?value():value)}function hasWindowFunction$1(name){return typeof window!==`undefined`&&typeof window[name]===`function`}function browserSessionStorage(){if(typeof window===`undefined`||!window.sessionStorage)return null;return window.sessionStorage}function pageRandomUUID(root=globalThis){return typeof root.crypto?.randomUUID===`function`?root.crypto.randomUUID():``}function reloadPage(){if(typeof window!==`undefined`)window.location.reload()}function writePageClipboardText(text){if(typeof navigator===`undefined`)return false;return typeof navigator.clipboard?.writeText===`function`?navigator.clipboard.writeText(text):void 0}function followMediaQuery(query,sync){if(!hasWindowFunction$1(`matchMedia`))return()=>{};const media=window.matchMedia(query);const listener=()=>sync(Boolean(media.matches));listener();if(typeof media.addEventListener===`function`){media.addEventListener(`change`,listener);return()=>media.removeEventListener(`change`,listener)}media.addListener(listener);return()=>media.removeListener(listener)}function videoFrameCallbacksAvailable(video){return typeof video.requestVideoFrameCallback===`function`}function dataTransferItemEntry(item){return item.webkitGetAsEntry?.()}var VIBE64_BROWSER_TAB_ORIGIN_KEY=`__vibe64BrowserTabOriginId`;var VIBE64_BROWSER_TAB_ORIGIN_STORAGE_KEY=`vibe64:browser-tab-origin-id`;function createBrowserTabOriginId(root=globalThis){const uuid=pageRandomUUID(root);if(uuid)return`tab:${uuid}`;return`tab:${Date.now().toString(36)}:${Math.random().toString(36).slice(2)}`}function browserTabSessionStorage(root=globalThis){try{return root?.sessionStorage||root?.window?.sessionStorage||null}catch{return null}}function readStoredBrowserTabOriginId(root=globalThis){try{return normalizeText$1(browserTabSessionStorage(root)?.getItem(VIBE64_BROWSER_TAB_ORIGIN_STORAGE_KEY))}catch{return``}}function writeStoredBrowserTabOriginId(root=globalThis,originId=``){const normalizedOriginId=normalizeText$1(originId);if(!normalizedOriginId)return;try{browserTabSessionStorage(root)?.setItem(VIBE64_BROWSER_TAB_ORIGIN_STORAGE_KEY,normalizedOriginId)}catch{}}function vibe64BrowserTabOriginId(root=globalThis){const existing=normalizeText$1(root?.[VIBE64_BROWSER_TAB_ORIGIN_KEY]);if(existing)return existing;const nextOriginId=readStoredBrowserTabOriginId(root)||createBrowserTabOriginId(root);writeStoredBrowserTabOriginId(root,nextOriginId);try{Object.defineProperty(root,VIBE64_BROWSER_TAB_ORIGIN_KEY,{configurable:false,enumerable:false,value:nextOriginId,writable:false})}catch{root[VIBE64_BROWSER_TAB_ORIGIN_KEY]=nextOriginId}return nextOriginId}function vibe64RealtimeOriginPayload(fields={},root=globalThis){return{...fields&&typeof fields===`object`&&!Array.isArray(fields)?fields:{},originId:vibe64BrowserTabOriginId(root)}}function vibe64RealtimePayloadFromCurrentTab(payload,{originId=vibe64BrowserTabOriginId()}={}){const payloadOriginId=normalizeText$1(payload.originId);const currentOriginId=normalizeText$1(originId);return Boolean(payloadOriginId&¤tOriginId&&payloadOriginId===currentOriginId)}var VIBE64_SESSIONS_API_SUFFIX=`/vibe64/sessions`;var VIBE64_ARCHIVED_SESSIONS_API_SUFFIX=`${VIBE64_SESSIONS_API_SUFFIX}/archived`;var VIBE64_ASSISTANTS_API_SUFFIX=`/vibe64/assistants/capabilities`;var VIBE64_ASSISTANT_MODEL_ACCESS_API_SUFFIX=`/vibe64/assistants/model-access`;var VIBE64_CURRENT_SESSION_API_SUFFIX=`${VIBE64_SESSIONS_API_SUFFIX}/current`;var VIBE64_API_SUFFIX=`/vibe64`;var VIBE64_SESSION_CHANGED_EVENT=`vibe64.session.changed`;var VIBE64_SESSION_SUMMARY_CHANGED_EVENT=`vibe64.session.summary.changed`;var VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT=`vibe64.source-editor.file.changed`;var VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT=`vibe64.source-editor.sync.error`;var VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT=`vibe64.source-editor.sync.ready`;var SELECTED_SESSION_STORAGE_KEY=`vibe64:selected-session-id`;function agentTurnControlPayloadFromContext(context={}){const source=context&&typeof context===`object`&&!Array.isArray(context)?context:{};const{agentSettings:_agentSettings,sessionId:_sessionId,...body}=source;return vibe64RealtimeOriginPayload({...body,...agentSettingsInputFromContext(source)})}function selectedSessionStorageKey(projectSlug){return vibe64ProjectScopedStorageKey(SELECTED_SESSION_STORAGE_KEY,projectSlug)}function vibe64SessionsQueryKey(surfaceId,ownershipFilter,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`sessions`]}function vibe64SessionQueryKey(surfaceId,ownershipFilter,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`session`]}function vibe64ProjectSetupQueryKey(projectSlug,sessionId=``){return[...vibe64SessionQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug),`project-onboarding`,...sessionId?[sessionId]:[]]}function vibe64SessionEventMatchesScope(payload={},{projectSlug=``}={}){return!payload.learningAttemptId&&(!payload.projectSlug||payload.projectSlug===projectSlug)}function vibe64AssistantCapabilitiesQueryKey(surfaceId,ownershipFilter,projectSlug,scope=`overview`){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`assistant-capabilities`,String(scope||`overview`)]}function encodePathSegment(value=``){return encodeURIComponent(String(value||``).trim())}function vibe64SessionPath(sessionsApiPath=``,sessionId=``,suffix=``){return`${sessionsApiPath}/${encodePathSegment(sessionId)}${suffix}`}function vibe64AssistantModelAccessPath(capabilitiesApiPath=``){return String(capabilitiesApiPath||``).replace(/\/assistants\/capabilities(?=\?|#|$)/u,`/assistants/model-access`)}function vibe64RepositoryApiPath(sessionsApiPath=``){const normalized=String(sessionsApiPath||``).replace(/\/+$/u,``);return normalized.endsWith(`/vibe64/sessions`)?`${normalized.slice(0,-16)}/vibe64/repository`:`${normalized}/repository`}function vibe64RepositoryHistoryPath(sessionsApiPath=``,options={}){const params=new URLSearchParams;const sessionId=String(options.sessionId||``).trim();const cursor=String(options.cursor||``).trim();if(sessionId)params.set(`sessionId`,sessionId);if(cursor)params.set(`cursor`,cursor);const query=params.toString();const base=`${vibe64RepositoryApiPath(sessionsApiPath)}/history`;return query?`${base}?${query}`:base}function vibe64RepositoryVersionFilesPath(sessionsApiPath=``,commit=``,options={}){const params=new URLSearchParams;const sessionId=String(options.sessionId||``).trim();const historySnapshotCommit=String(options.historySnapshotCommit||``).trim();if(sessionId)params.set(`sessionId`,sessionId);if(historySnapshotCommit)params.set(`historySnapshotCommit`,historySnapshotCommit);if(Number.isInteger(Number(options.offset))&&Number(options.offset)>0)params.set(`offset`,String(Number(options.offset)));if(Number.isInteger(Number(options.limit))&&Number(options.limit)>0)params.set(`limit`,String(Number(options.limit)));const query=params.toString();const base=`${vibe64RepositoryApiPath(sessionsApiPath)}/history/${encodePathSegment(commit)}/files`;return query?`${base}?${query}`:base}function vibe64RepositoryVersionDiffPath(sessionsApiPath=``,commit=``,sourcePath=``,options={}){const params=new URLSearchParams({path:String(sourcePath||``)});const sessionId=String(options.sessionId||``).trim();const historySnapshotCommit=String(options.historySnapshotCommit||``).trim();if(sessionId)params.set(`sessionId`,sessionId);if(historySnapshotCommit)params.set(`historySnapshotCommit`,historySnapshotCommit);return`${vibe64RepositoryApiPath(sessionsApiPath)}/history/${encodePathSegment(commit)}/diff?${params.toString()}`}function vibe64SessionChangesPath(sessionsApiPath=``,sessionId=``,options={}){const params=new URLSearchParams;if(Number.isInteger(Number(options.offset))&&Number(options.offset)>0)params.set(`offset`,String(Number(options.offset)));if(Number.isInteger(Number(options.limit))&&Number(options.limit)>0)params.set(`limit`,String(Number(options.limit)));const query=params.toString();const base=vibe64SessionPath(sessionsApiPath,sessionId,`/changes`);return query?`${base}?${query}`:base}function vibe64SessionCheckUpdatesPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/updates/check`)}function vibe64SessionChangeDiffPath(sessionsApiPath=``,sessionId=``,sourcePath=``){return`${vibe64SessionPath(sessionsApiPath,sessionId,`/changes/diff`)}?path=${encodeURIComponent(String(sourcePath||``))}`}function vibe64AgentAttachmentPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/agent-attachments`)}function vibe64AgentAttachmentFilePath(sessionsApiPath=``,sessionId=``,attachmentId=``){return`${vibe64AgentAttachmentPath(sessionsApiPath,sessionId)}/${encodePathSegment(attachmentId)}`}function vibe64TemporaryConversationsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/temporary-conversations`)}function vibe64TemporaryConversationPath(sessionsApiPath=``,sessionId=``,conversationId=``){return`${vibe64TemporaryConversationsPath(sessionsApiPath,sessionId)}/${encodePathSegment(conversationId)}`}function vibe64AgentTerminalPath(sessionsApiPath=``,sessionId=``,terminalSessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,terminalSessionId?`/agent-terminal/${encodePathSegment(terminalSessionId)}`:`/agent-terminal`)}function vibe64AgentTerminalControlTextPath(sessionsApiPath=``,sessionId=``,terminalSessionId=``){return`${vibe64AgentTerminalPath(sessionsApiPath,sessionId,terminalSessionId)}/control/text`}function vibe64ConversationLogPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/conversation-log`)}function vibe64SessionPromptHintsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/prompt-hints`)}function vibe64SessionPromptHintsCancelPath(sessionsApiPath=``,sessionId=``){return`${vibe64SessionPromptHintsPath(sessionsApiPath,sessionId)}/cancel`}function vibe64SessionPreviewStatePath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/preview-state`)}function vibe64OutputsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/outputs`)}function vibe64PreviewIdentityPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/preview-identity`)}function vibe64OutputRunPath(sessionsApiPath=``,sessionId=``,terminalSessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,terminalSessionId?`/output-runs/${encodePathSegment(terminalSessionId)}/terminal`:`/output-runs`)}function vibe64OutputRunStopPath(sessionsApiPath=``,sessionId=``,terminalSessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/output-runs/${encodePathSegment(terminalSessionId)}/stop`)}function vibe64OutputResultPath(sessionsApiPath=``,sessionId=``,resultId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/output-results/${encodePathSegment(resultId)}`)}function vibe64SourceEditorTreePath(sessionsApiPath=``,sessionId=``,options={}){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/tree`);const params=new URLSearchParams;const normalizedPath=String(options.path||``).trim();if(normalizedPath)params.set(`path`,normalizedPath);if(Number.isInteger(Number(options.offset))&&Number(options.offset)>0)params.set(`offset`,String(Number(options.offset)));if(Number.isInteger(Number(options.limit))&&Number(options.limit)>0)params.set(`limit`,String(Number(options.limit)));const query=params.toString();return query?`${basePath}?${query}`:basePath}function vibe64SourceEditorFilesPath(sessionsApiPath=``,sessionId=``,query=``){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/files`);const normalizedQuery=String(query||``).trim();return normalizedQuery?`${basePath}?q=${encodeURIComponent(normalizedQuery)}`:basePath}function vibe64SourceEditorSearchPath(sessionsApiPath=``,sessionId=``,query=``){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/search`);const normalizedQuery=String(query||``).trim();return normalizedQuery?`${basePath}?q=${encodeURIComponent(normalizedQuery)}`:basePath}function vibe64SourceEditorResolvePathPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/resolve-path`)}function vibe64SourceEditorFilePath(sessionsApiPath=``,sessionId=``,sourcePath=``){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/file`);const normalizedPath=String(sourcePath||``).trim();return normalizedPath?`${basePath}?path=${encodeURIComponent(normalizedPath)}`:basePath}function vibe64SourceEditorCreateFilePath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/file`)}function vibe64SourceEditorStarsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/stars`)}function vibe64SourceEditorDownloadPath(sessionsApiPath=``,sessionId=``,sourcePath=``){return`${vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/download`)}?path=${encodeURIComponent(sourcePath)}`}function vibe64SourceEditorChangesStreamPath(sessionsApiPath=``,sessionId=``,sourcePath=``){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/changes/stream`);const normalizedPath=String(sourcePath||``).trim();return normalizedPath?`${basePath}?path=${encodeURIComponent(normalizedPath)}`:basePath}function vibe64SourceEditorExplanationsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/explanations`)}function vibe64SourceEditorExplanationsStreamPath(sessionsApiPath=``,sessionId=``){return`${vibe64SourceEditorExplanationsPath(sessionsApiPath,sessionId)}/stream`}function vibe64SourceEditorExplanationsCleanupPath(sessionsApiPath=``,sessionId=``){return`${vibe64SourceEditorExplanationsPath(sessionsApiPath,sessionId)}/cleanup`}function vibe64SourceEditorExplanationPath(sessionsApiPath=``,sessionId=``,explanationId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/explanations/${encodePathSegment(explanationId)}`)}function vibe64SourceEditorExplanationFollowupsPath(sessionsApiPath=``,sessionId=``,explanationId=``){return`${vibe64SourceEditorExplanationPath(sessionsApiPath,sessionId,explanationId)}/followups`}function vibe64SourceEditorExplanationFollowupsStreamPath(sessionsApiPath=``,sessionId=``,explanationId=``){return`${vibe64SourceEditorExplanationFollowupsPath(sessionsApiPath,sessionId,explanationId)}/stream`}function vibe64SourceEditorExplanationStopPath(sessionsApiPath=``,sessionId=``,explanationId=``){return`${vibe64SourceEditorExplanationPath(sessionsApiPath,sessionId,explanationId)}/stop`}function vibe64ConversationLogQueryKey(surfaceId,ownershipFilter,sessionId=``,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`conversation-log`,encodePathSegment(sessionId)]}function vibe64OutputsQueryKey(surfaceId,ownershipFilter,sessionId=``,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`outputs`,encodePathSegment(sessionId)]}function agentSettingsInputFromContext(context={}){return context.agentSettings&&typeof context.agentSettings===`object`&&!Array.isArray(context.agentSettings)?{agentSettings:context.agentSettings}:{}}function useVibe64SessionAssistantApply({choice,emit,menuOpen,props}){const{agentId,assistantSelection,catalog,catalogError,catalogLoading,connections,draftSelection,engineId,modelAccess,modelId,modelProviderId,recommendedModel,reloadCatalog,routingMode,savesThroughCaller,selectedAgent,selectedModel,selectedProvider,selectionChanged,selectionForModel,selectionRevision,variantId}=choice;const saveError=ref(``);const saving=ref(false);const modelAccessUpdating=ref(false);const unlockConfirmOpen=ref(false);const canSave=computed(()=>Boolean(!props.changesDisabled&&(selectionChanged.value||routingMode.value!==`custom`)&&selectedProvider.value&&selectedModel.value&&selectedAgent.value&&selectionRevision.value&&!catalogLoading.value&&!catalogError.value&&!modelAccessUpdating.value));const updateCommand=useCommand({access:`never`,apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:`PATCH`,path:String(context?.path||``)}),buildRawPayload:(_model,{context})=>vibe64RealtimeOriginPayload({assistantSelection:context?.assistantSelection||{}}),fallbackRunError:`AI session choices could not be updated.`,suppressSuccessMessage:true,onRunSuccess(response){if(response?.ok===false)throw new Error(response.error||`The custom model could not be saved.`)},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.sessions.assistant-selection.update`,surfaceId:`app`,writeMethod:`PATCH`});const modelAccessCommand=useCommand({access:`never`,apiSuffix:VIBE64_ASSISTANT_MODEL_ACCESS_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:`PATCH`,path:String(context?.path||``)}),buildRawPayload:(_model,{context})=>({engineId:String(context?.engineId||``),modelProviderId:String(context?.modelProviderId||``),unlocked:context?.unlocked===true}),fallbackRunError:`Provider model access could not be changed.`,messages:{error:`Provider model access could not be changed.`,success:`Provider model access updated.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.assistants.model-access.update`,surfaceId:`app`,writeMethod:`PATCH`});async function applySelection(selection,{closeMenu=true}={}){const sessionId=String(props.session?.sessionId||``).trim();const sessionsPath=String(readRefOrGetterValue(props.sessionsApiPath)||``).trim();if(props.changesDisabled||!selection||!savesThroughCaller.value&&(!sessionId||!sessionsPath)||saving.value)return null;saving.value=true;saveError.value=``;try{const response=savesThroughCaller.value?await props.saveSelection(selection):await updateCommand.run({assistantSelection:selection,path:vibe64SessionPath(sessionsPath,sessionId,`/assistant-selection`)});if(response?.ok===false)throw new Error(response.error||`The custom model could not be saved.`);if(response?.ok!==false){emit(`saved`);modelId.value=selection.modelId;agentId.value=selection.agentId;variantId.value=selection.variantId;if(closeMenu)menuOpen.value=false}return response}catch(error){saveError.value=error.message||`The custom model could not be saved.`;reloadCatalog().catch(()=>{});return{ok:false,error:saveError.value}}finally{saving.value=false}}async function save(){if(!canSave.value)return;await applySelection(draftSelection.value)}async function restoreRecommendedModel({closeMenu=true}={}){return applySelection(selectionForModel(recommendedModel.value),{closeMenu})}function requestModelAccessChange(unlocked){if(props.changesDisabled||!props.canConfigure||modelAccessUpdating.value||saving.value)return;if(unlocked===true){unlockConfirmOpen.value=true;return}updateModelAccess(false)}async function confirmUnlockModelAccess(){unlockConfirmOpen.value=false;await updateModelAccess(true)}async function updateModelAccess(unlocked){const providerId=String(modelProviderId.value||``).trim();const path=vibe64AssistantModelAccessPath(connections.apiPath.value);if(!props.canConfigure||props.changesDisabled||!providerId||!path||!modelAccess.value.configurable||modelAccessUpdating.value)return null;modelAccessUpdating.value=true;try{const current=assistantSelection.value||{};if(unlocked!==true&¤t.modelProviderId===providerId&&recommendedModel.value&¤t.modelId!==recommendedModel.value.id){const recovery=await restoreRecommendedModel({closeMenu:false});if(recovery?.ok===false||!recovery)return recovery;await nextTick$1()}const response=await modelAccessCommand.run({engineId:engineId.value,modelProviderId:providerId,path,unlocked:unlocked===true});if(response?.ok!==false)await catalog.value?.reload();return response}finally{modelAccessUpdating.value=false}}return{canSave,confirmUnlockModelAccess,modelAccessUpdating,requestModelAccessChange,restoreRecommendedModel,save,saveError,saving,unlockConfirmOpen}}var VIBE64_ASSISTANT_ENGINE_IDS=Object.freeze({CLAUDE:`claude`,CODEX:`codex`,OPENCODE:`opencode`});var VIBE64_ASSISTANT_TRANSPORT_IDS=Object.freeze({CLAUDE_STREAM_JSON:`claude_stream_json`,CODEX_APP_SERVER:`codex_app_server`,OPENCODE_SERVER:`opencode_server`});var VIBE64_ASSISTANT_SELECTION_SCHEMA=`vibe64.assistant-selection.v1`;var VIBE64_ASSISTANT_CATALOG_REVISION_PATTERN=/^sha256:[a-f0-9]{64}$/u;var VIBE64_ASSISTANT_ENGINE_ID_SET=new Set(Object.values(VIBE64_ASSISTANT_ENGINE_IDS));var VIBE64_ASSISTANT_SELECTION_ERROR_CODES=Object.freeze({CATALOG_STALE:`vibe64_assistant_catalog_stale`,CONNECTION_REQUIRED:`vibe64_assistant_connection_required`,ENGINE_IMMUTABLE:`vibe64_assistant_engine_immutable`,INVALID:`vibe64_assistant_selection_invalid`,TURN_ACTIVE:`vibe64_assistant_selection_turn_active`,UNAVAILABLE:`vibe64_assistant_selection_unavailable`});function selectionError(code,message,details={}){return new AppError(409,message,{code,details:Object.freeze({...details})})}function containsControlCharacter(value=``){return Array.from(value).some(character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127})}function boundedIdentifier(value,field,options={}){const{allowEmpty=false,maxLength=512}=options;const normalized=toText(value);if(!normalized&&!allowEmpty||normalized.length>maxLength||containsControlCharacter(normalized))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant ${field} is invalid.`,{field});return normalized}function catalogRevision(value,field=`catalogRevision`){const revision=toText(value);if(!VIBE64_ASSISTANT_CATALOG_REVISION_PATTERN.test(revision))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant catalog revision is invalid.`,{field});return revision}function defineVibe64AssistantSelection(value={}){const input=normalizeObject(value);const engineId=boundedIdentifier(input.engineId,`engineId`,{maxLength:64});if(!VIBE64_ASSISTANT_ENGINE_ID_SET.has(engineId))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Unknown assistant engine: ${engineId}.`,{engineId,field:`engineId`});const schema=toText(input.schema)||VIBE64_ASSISTANT_SELECTION_SCHEMA;if(schema!==VIBE64_ASSISTANT_SELECTION_SCHEMA)throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant selection schema is unsupported.`,{field:`schema`,schema});return Object.freeze({agentId:boundedIdentifier(input.agentId,`agentId`,{maxLength:256}),catalogRevision:catalogRevision(input.catalogRevision),engineId,modelId:boundedIdentifier(input.modelId,`modelId`),modelProviderId:boundedIdentifier(input.modelProviderId,`modelProviderId`,{maxLength:256}),schema,variantId:boundedIdentifier(input.variantId,`variantId`,{allowEmpty:true,maxLength:256})})}function assertVibe64AssistantSelectionUpdate(currentValue={},nextValue={},options={}){const{turnActive=false}=options;defineVibe64AssistantSelection(currentValue);const next=defineVibe64AssistantSelection(nextValue);if(turnActive===true)throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.TURN_ACTIVE,`Wait for the active assistant turn to finish before changing its selection.`);return next}var VIBE64_ASSISTANT_SELECTION_IDENTITY_FIELDS=Object.freeze([`engineId`,`modelProviderId`,`modelId`,`agentId`,`variantId`]);function sameVibe64AssistantSelection(left,right){return VIBE64_ASSISTANT_SELECTION_IDENTITY_FIELDS.every(key=>String(left?.[key]??``).trim()===String(right?.[key]??``).trim())}var __testables$5=Object.freeze({assertVibe64AssistantSelectionUpdate,VIBE64_ASSISTANT_SELECTION_ERROR_CODES});var model=(id,contextWindow,variants,options={})=>Object.freeze({id,contextWindow,variants:Object.freeze(variants),...options});var NATIVE_AI_PROVIDERS=Object.freeze([Object.freeze({id:`deepseek`,baseUrl:`https://api.deepseek.com/`,claudeBaseUrl:`https://api.deepseek.com/anthropic`,claudeAutoCompactWindow:786432,webSearch:false,models:Object.freeze([model(`deepseek-flash`,1048576,[`low`,`high`,`max`],{images:true,freeformPatch:true,codexHistoryRouting:true}),model(`deepseek-v4-pro`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])}),Object.freeze({id:`zai-coding-plan`,baseUrl:`https://api.z.ai/api/v1`,claudeBaseUrl:`https://api.z.ai/api/anthropic`,claudeAutoCompactWindow:1e6,webSearch:false,models:Object.freeze([model(`glm-5.3`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])}),Object.freeze({id:`zai`,baseUrl:`https://api.z.ai/api/v1`,claudeBaseUrl:`https://api.z.ai/api/anthropic`,claudeAutoCompactWindow:1e6,webSearch:false,models:Object.freeze([model(`glm-5.3`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])})]);var CUSTOM_AI_PROVIDER_ID=`custom`;function nativeAiProvider(id){return NATIVE_AI_PROVIDERS.find(provider=>provider.id===id)||null}function nativeAiModel(id,providerId=``){for(const provider of NATIVE_AI_PROVIDERS){if(providerId&&provider.id!==providerId)continue;const model=provider.models.find(candidate=>candidate.id===id);if(model)return{...model,modelProviderId:provider.id}}return null}var curatedModel=(providerId,id,label,defaultThinking)=>{const{modelProviderId:_provider,...definition}=nativeAiModel(id,providerId);return Object.freeze({...definition,label,defaultThinking})};var CURATED_CODEX_PROVIDERS=Object.freeze([Object.freeze({...nativeAiProvider(`deepseek`),label:`DeepSeek`,shortLabel:`DeepSeek`,description:`DeepSeek API key · usage-based billing`,keyUrl:`https://platform.deepseek.com/api_keys`,guideUrl:`https://api-docs.deepseek.com/quick_start/agent_integrations/codex/`,ownerOnly:false,models:Object.freeze([curatedModel(`deepseek`,`deepseek-flash`,`DeepSeek V4.1 Flash`,`high`),curatedModel(`deepseek`,`deepseek-v4-pro`,`DeepSeek V4 Pro`,`high`)])}),Object.freeze({...nativeAiProvider(`zai-coding-plan`),label:`GLM · Coding Plan`,shortLabel:`GLM`,description:`Z.AI Coding Plan key · uses your subscription quota`,keyUrl:`https://z.ai/manage-apikey/apikey-list`,guideUrl:`https://docs.z.ai/devpack/tool/codex`,ownerOnly:true,models:Object.freeze([curatedModel(`zai-coding-plan`,`glm-5.3`,`GLM 5.3`,`max`)])}),Object.freeze({...nativeAiProvider(`zai`),label:`GLM · Pay-as-you-go API`,shortLabel:`GLM`,description:`Z.AI API key · pay-as-you-go account`,keyUrl:`https://z.ai/manage-apikey/apikey-list`,guideUrl:`https://docs.z.ai/guides/overview/quick-start`,setupNote:`Use a key from a Z.AI account without a Coding Plan. Pay-as-you-go access through Codex and Claude Code still needs live verification; a successful check confirms model access, not billing.`,ownerOnly:false,models:Object.freeze([curatedModel(`zai`,`glm-5.3`,`GLM 5.3`,`max`)])}),Object.freeze({id:CUSTOM_AI_PROVIDER_ID,custom:true,label:`Custom endpoint`,shortLabel:`Custom`,description:`Your own model server · no Vibe64 billing`,ownerOnly:true,models:Object.freeze([])})]);function curatedCodexProvider(id){return CURATED_CODEX_PROVIDERS.find(provider=>provider.id===id)||null}function isPlainRecord(value){if(!value||typeof value!==`object`||Array.isArray(value))return false;const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}var VIBE64_AGENT_EXECUTION_PROFILE_IDS=Object.freeze({HELPER:`helper`});var VIBE64_AGENT_EXECUTION_WORKLOAD_IDS=Object.freeze({COMMIT_TITLE:`commit_title`,CONVERSATION_SUMMARY:`conversation_summary`,VOICE_TURN:`voice_turn`,DATABASE_ASSISTANT:`database_assistant`,LESSON_REVIEW:`lesson_review`,PROMPT_HINT:`prompt_hint`,REQUEST_ROUTING:`request_routing`,SESSION_TITLE:`session_title`,SOURCE_EXPLANATION:`source_explanation`});var VIBE64_AGENT_HELPER_WORKLOAD_LIMITS=Object.freeze({[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.COMMIT_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.VOICE_TURN]:Object.freeze({maxInputCharacters:12e3,maxOutputCharacters:512,timeoutMs:1e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.CONVERSATION_SUMMARY]:Object.freeze({maxInputCharacters:2e5,maxOutputCharacters:16e3,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.DATABASE_ASSISTANT]:Object.freeze({maxInputCharacters:5e5,maxOutputCharacters:16e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.LESSON_REVIEW]:Object.freeze({maxInputCharacters:16e4,maxOutputCharacters:12e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.PROMPT_HINT]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:2500,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.REQUEST_ROUTING]:Object.freeze({maxInputCharacters:128e3,maxOutputCharacters:8192,timeoutMs:6e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SESSION_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:3e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SOURCE_EXPLANATION]:Object.freeze({maxInputCharacters:1e5,maxOutputCharacters:32e3,timeoutMs:18e4})});var VIBE64_AGENT_EXECUTION_TOOL_POLICIES=Object.freeze({NONE:`none`});var VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS=Object.freeze({MAX_INPUT_CHARACTERS:5e5,MAX_OUTPUT_CHARACTERS:32e3,MAX_TIMEOUT_MS:3e5});var VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES=Object.freeze({INVALID:`vibe64_agent_execution_profile_invalid`,MODEL_UNAVAILABLE:`vibe64_agent_execution_profile_model_unavailable`,POLICY_UNENFORCEABLE:`vibe64_agent_execution_profile_policy_unenforceable`,PROFILE_UNKNOWN:`vibe64_agent_execution_profile_unknown`,REASONING_UNSUPPORTED:`vibe64_agent_execution_profile_reasoning_unsupported`,UNBOUNDED:`vibe64_agent_execution_profile_unbounded`,UNSAFE:`vibe64_agent_execution_profile_unsafe`,WORKLOAD_UNSUPPORTED:`vibe64_agent_execution_profile_workload_unsupported`});var VIBE64_AGENT_EXECUTION_PROFILE_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_PROFILE_IDS));var VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_WORKLOAD_IDS));var Vibe64AgentExecutionProfileError=class extends Error{constructor(code,message,details={}){super(message);this.name=`Vibe64AgentExecutionProfileError`;this.code=code;this.details=Object.freeze({...details});for(const[name,value]of Object.entries(this.details))if(![`code`,`details`,`message`,`name`].includes(name))this[name]=value}};function executionProfileError(code,message,details={}){return new Vibe64AgentExecutionProfileError(code,message,details)}function requiredRecord(value,fieldName){if(!isPlainRecord(value))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be an object.`,{field:fieldName});return value}function requireOnlyFields(value,allowedFields,fieldName){const allowed=new Set(allowedFields);const unexpected=Object.keys(value).find(name=>!allowed.has(name));if(unexpected)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} contains an unsupported field: ${unexpected}.`,{field:`${fieldName}.${unexpected}`})}function requiredText(value,fieldName,maximumLength=256){if(typeof value!==`string`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be text.`,{field:fieldName});const normalized=value.trim();if(!normalized||normalized.length>maximumLength)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} is invalid.`,{field:fieldName});return normalized}function requiredBoolean(value,fieldName){if(typeof value!==`boolean`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be a boolean.`,{field:fieldName});return value}function requireSafeFalse(value,fieldName){if(requiredBoolean(value,fieldName)!==false)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile ${fieldName} must be disabled.`,{field:fieldName});return false}function boundedPositiveInteger(value,fieldName,maximum){if(!Number.isSafeInteger(value)||value<=0||value>maximum)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile ${fieldName} must be a positive integer no greater than ${maximum}.`,{field:fieldName,maximum});return value}function requiredLimits(value){if(!isPlainRecord(value))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile limits are required.`,{field:`limits`});return value}function normalizeProfileId(value){const profileId=requiredText(value,`profileId`,64);if(!VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(profileId))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.PROFILE_UNKNOWN,`Unknown execution profile: ${profileId}.`,{profileId});return profileId}function normalizeWorkloadId(value){const workloadId=requiredText(value,`workloadId`,64);if(!VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES.has(workloadId))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.WORKLOAD_UNSUPPORTED,`Unsupported execution profile workload: ${workloadId}.`,{workloadId});return workloadId}function normalizedExecutionProfileRequest(input){return Object.freeze({profileId:normalizeProfileId(input.profileId),workloadId:normalizeWorkloadId(input.workloadId)})}function defineVibe64AgentExecutionProfileResolution(value){const input=requiredRecord(value,`resolution`);const executionProfile=normalizedExecutionProfileRequest(input);const request=requiredRecord(input.request,`request policy`);const policy=requiredRecord(input.policy,`tool policy`);const limits=requiredLimits(input.limits);requireOnlyFields(request,[`allowProviderModelFallback`,`reasoning`,`summary`],`request`);requireOnlyFields(policy,[`environmentAccess`,`networkAccess`,`repositoryWrite`,`tools`],`policy`);requireOnlyFields(limits,[`maxInputCharacters`,`maxOutputCharacters`,`timeoutMs`],`limits`);const reasoning=requiredBoolean(request.reasoning,`request.reasoning`);if(typeof input.thinking!==`string`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile thinking must be text.`,{field:`thinking`});const thinking=input.thinking.trim();if(reasoning&&!thinking||!reasoning&&thinking)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile thinking must agree with its reasoning request.`,{field:`thinking`});if(thinking.length>64)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile thinking is invalid.`,{field:`thinking`});if(policy.tools!==VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile tools must be disabled.`,{field:`policy.tools`});return Object.freeze({limits:Object.freeze({maxInputCharacters:boundedPositiveInteger(limits.maxInputCharacters,`limits.maxInputCharacters`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_INPUT_CHARACTERS),maxOutputCharacters:boundedPositiveInteger(limits.maxOutputCharacters,`limits.maxOutputCharacters`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_OUTPUT_CHARACTERS),timeoutMs:boundedPositiveInteger(limits.timeoutMs,`limits.timeoutMs`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_TIMEOUT_MS)}),model:requiredText(input.model,`model`),policy:Object.freeze({environmentAccess:requireSafeFalse(policy.environmentAccess,`policy.environmentAccess`),networkAccess:requireSafeFalse(policy.networkAccess,`policy.networkAccess`),repositoryWrite:requireSafeFalse(policy.repositoryWrite,`policy.repositoryWrite`),tools:VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE}),profileId:executionProfile.profileId,providerId:requiredText(input.providerId,`providerId`,64),request:Object.freeze({allowProviderModelFallback:requireSafeFalse(request.allowProviderModelFallback,`request.allowProviderModelFallback`),reasoning,summary:requireSafeFalse(request.summary,`request.summary`)}),revision:requiredText(input.revision,`revision`,128),thinking,workloadId:executionProfile.workloadId})}function vibe64AgentExecutionProfileAuditSnapshot(value){return defineVibe64AgentExecutionProfileResolution(value)}function vibe64AgentProviderSupportsExecutionProfile(provider,profileId){if(!isPlainRecord(provider)||typeof profileId!==`string`)return false;const normalizedProfileId=profileId.trim();return provider.implemented===true&&VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(normalizedProfileId)&&Array.isArray(provider.executionProfiles)&&provider.executionProfiles.includes(normalizedProfileId)}var __testables$4=Object.freeze({VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS,VIBE64_AGENT_EXECUTION_TOOL_POLICIES,vibe64AgentProviderSupportsExecutionProfile});var VIBE64_AGENT_PROVIDER_UNKNOWN_CODE=`vibe64_agent_provider_unknown`;var VIBE64_AGENT_PARAMETER_IDS=Object.freeze({MODEL:`model`,THINKING:`thinking`});var VIBE64_DEFAULT_AGENT_PROVIDER_ID=VIBE64_ASSISTANT_ENGINE_IDS.CODEX;var VIBE64_CODEX_SOL_MODEL=`gpt-5.6-sol`;var VIBE64_CODEX_GPT_5_5_MODEL=`gpt-5.5`;var VIBE64_CODEX_DEFAULT_MODEL=VIBE64_CODEX_SOL_MODEL;var VIBE64_CODEX_DEFAULT_THINKING=`xhigh`;var VIBE64_CODEX_SPARK_MODEL=`gpt-5.3-codex-spark`;var VIBE64_CODEX_STANDARD_THINKING_VALUES=Object.freeze([`low`,`medium`,`high`,`xhigh`]);var VIBE64_CODEX_SOL_THINKING_VALUES=Object.freeze([...VIBE64_CODEX_STANDARD_THINKING_VALUES,`max`]);var VIBE64_AGENT_PROVIDERS=Object.freeze([Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.HELPER]),id:VIBE64_ASSISTANT_ENGINE_IDS.CODEX,implemented:true,label:`Codex`,accountLabel:`Codex (OpenAI)`,planUsage:Object.freeze({label:`Codex`,managementUrl:`https://chatgpt.com/codex/settings/usage`}),terminal:`codex`,terminalAttachments:false,parameters:Object.freeze([Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.MODEL,defaultValue:VIBE64_CODEX_DEFAULT_MODEL,label:`Model`,options:Object.freeze([Object.freeze({label:`Automatic (GPT-5.6 Sol)`,value:``}),Object.freeze({label:`GPT-5.6 Sol`,supportedThinking:VIBE64_CODEX_SOL_THINKING_VALUES,value:VIBE64_CODEX_DEFAULT_MODEL}),Object.freeze({label:`GPT-5.5`,supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_GPT_5_5_MODEL}),Object.freeze({label:`Codex Spark`,request:Object.freeze({summary:false}),supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_SPARK_MODEL})])}),Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.THINKING,defaultValue:VIBE64_CODEX_DEFAULT_THINKING,label:`Thinking`,options:Object.freeze([Object.freeze({label:`Automatic`,value:``}),Object.freeze({label:`Low`,value:`low`}),Object.freeze({label:`Medium`,value:`medium`}),Object.freeze({label:`High`,value:`high`}),Object.freeze({label:`X High`,value:`xhigh`}),Object.freeze({label:`Max`,value:`max`})])})])}),Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.HELPER]),id:VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE,implemented:true,label:`Claude Code`,accountLabel:`Claude`,planUsage:Object.freeze({label:`Claude`,managementUrl:`https://claude.ai/settings/usage`}),parameters:Object.freeze([]),terminal:`native`,terminalAttachments:false}),Object.freeze({executionProfiles:Object.freeze([]),id:VIBE64_ASSISTANT_ENGINE_IDS.OPENCODE,implemented:false,label:`OpenCode`,parameters:Object.freeze([]),terminal:`native`,terminalAttachments:true})]);function findVibe64AgentProvider(engineId=``){const normalizedEngineId=normalizeAgentSettingText(engineId);return VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedEngineId)||null}function agentProviderDefinition(providerId=``){const normalizedProviderId=normalizeAgentSettingText(providerId)||VIBE64_DEFAULT_AGENT_PROVIDER_ID;const provider=VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedProviderId);if(provider)return provider;const error=new Error(`Unknown assistant provider: ${normalizedProviderId}.`);error.code=VIBE64_AGENT_PROVIDER_UNKNOWN_CODE;error.providerId=normalizedProviderId;throw error}function agentProviderParameter(provider={},parameterId=``){const normalizedParameterId=normalizeAgentSettingText(parameterId);return(Array.isArray(provider.parameters)?provider.parameters:[]).find(parameter=>parameter.id===normalizedParameterId)||null}function normalizeAgentSettingText(value=``){return String(value||``).trim()}function normalizeVibe64AgentSettings(value={}){const input=value&&typeof value===`object`&&!Array.isArray(value)?value:{};const provider=agentProviderDefinition(input.providerId||input.provider);const model=normalizeAgentSettingText(input.model);return{model,providerId:provider.id,thinking:normalizedAgentThinkingValue(provider,model,input.thinking)}}function defaultVibe64AgentSettings(providerId=VIBE64_DEFAULT_AGENT_PROVIDER_ID){return normalizeVibe64AgentSettings({providerId})}function effectiveAgentParameterValue(provider={},parameterId=``,value=``){const parameter=agentProviderParameter(provider,parameterId);return normalizeAgentSettingText(value)||normalizeAgentSettingText(parameter?.defaultValue)}function effectiveAgentParameterOption(provider={},parameterId=``,value=``){const parameter=agentProviderParameter(provider,parameterId);const effectiveValue=effectiveAgentParameterValue(provider,parameterId,value);return(Array.isArray(parameter?.options)?parameter.options:[]).find(option=>normalizeAgentSettingText(option.value)===effectiveValue)||null}function supportedAgentThinkingValues(provider={},model=``){const modelOption=effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,model);return Array.isArray(modelOption?.supportedThinking)?new Set(modelOption.supportedThinking.map(value=>normalizeAgentSettingText(value))):null}function normalizedAgentThinkingValue(provider={},model=``,value=``){const normalized=normalizeAgentSettingText(value);if(provider.id===VIBE64_ASSISTANT_ENGINE_IDS.CODEX)return normalized;const supported=supportedAgentThinkingValues(provider,model);if(!supported||!normalized||supported.has(normalized))return normalized;const fallback=normalizeAgentSettingText(agentProviderParameter(provider,VIBE64_AGENT_PARAMETER_IDS.THINKING)?.defaultValue);return supported.has(fallback)?fallback:``}function vibe64AgentSettingParameters(value={}){const normalized=normalizeVibe64AgentSettings(value);const provider=agentProviderDefinition(normalized.providerId);const requestsReasoning=agentOptionRequestValue(effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,normalized.model),`reasoning`,true);const supportedThinking=supportedAgentThinkingValues(provider,normalized.model);return(Array.isArray(provider.parameters)?provider.parameters:[]).flatMap(parameter=>{if(parameter.id===VIBE64_AGENT_PARAMETER_IDS.THINKING&&requestsReasoning===false)return[];if(parameter.id!==VIBE64_AGENT_PARAMETER_IDS.THINKING||!supportedThinking)return[parameter];return[{...parameter,options:parameter.options.filter(option=>!normalizeAgentSettingText(option.value)||supportedThinking.has(normalizeAgentSettingText(option.value)))}]})}function agentOptionRequestValue(option={},name=``,fallback=true){const request=option&&typeof option.request===`object`&&!Array.isArray(option.request)?option.request:{};return Object.hasOwn(request,name)?request[name]:fallback}function displayVibe64AgentSetting(providerId=``,parameterId=``,value=``){const parameter=agentProviderParameter(agentProviderDefinition(providerId),parameterId);const normalizedValue=normalizeAgentSettingText(value);return(Array.isArray(parameter?.options)?parameter.options:[]).find(candidate=>normalizeAgentSettingText(candidate.value)===normalizedValue)?.label||normalizedValue||`Automatic`}var __testables$3=Object.freeze({displayVibe64AgentSetting,VIBE64_AGENT_PROVIDER_UNKNOWN_CODE,VIBE64_CODEX_GPT_5_5_MODEL,VIBE64_CODEX_SOL_MODEL,VIBE64_CODEX_SPARK_MODEL,vibe64AgentSettingParameters});function vibe64AssistantSelectionLabel(selection,options={}){const{includeThinking=true}=options;const engine=VIBE64_AGENT_PROVIDERS.find(({id})=>id===selection.engineId)?.label||selection.engineId;if(!includeThinking)return`${engine} (${selection.modelId})`;const thinking=selection.variantId===``?`default`:selection.variantId||`not recorded`;return`${engine} (${selection.modelId} ${thinking})`}function vibe64ProviderPresentation(selection){const provider=curatedCodexProvider(selection?.modelProviderId);const commentaryAsThinking=Boolean(provider)&&[VIBE64_ASSISTANT_ENGINE_IDS.CODEX,VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE].includes(selection?.engineId);return Object.freeze({label:provider?.shortLabel||findVibe64AgentProvider(selection?.engineId)?.label||``,keyUsage:Boolean(provider),commentaryAsThinking,thinkingParagraphUpdates:!commentaryAsThinking&&selection?.engineId===VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE})}var AFTER_PLAN_PASS_ORDER=Object.freeze([`review`,`security-pass`,`data-pass`,`quality-pass`,`speed-pass`,`ux-pass`,`identity-pass`,`ui-pass`,`deslop`]);var AFTER_PLAN_MANDATORY_PASSES=Object.freeze([`review`,`security-pass`]);var AFTER_PLAN_DEFAULT_PASSES=Object.freeze([`review`,`security-pass`,`data-pass`,`quality-pass`,`ui-pass`,`deslop`]);var AFTER_PLAN_PASS_TITLES=Object.freeze({review:`Review`,"security-pass":`Security pass`,"data-pass":`Data pass`,"quality-pass":`Quality pass`,"speed-pass":`Speed pass`,"ux-pass":`User experience pass`,"identity-pass":`Visual identity`,"ui-pass":`UI pass`,deslop:`Deslop`});var ASSISTANT_FINISHING_DEFAULTS=Object.freeze({afterPlan:AFTER_PLAN_DEFAULT_PASSES,afterPlanDeep:Object.freeze([]),autoSave:true});var ASSISTANT_NO_FINISHING=Object.freeze({afterPlan:AFTER_PLAN_MANDATORY_PASSES,afterPlanDeep:Object.freeze([]),autoSave:false});var AUTO_SAVE_SETTING=`Automatically save changes`;function afterPlanChoiceProblem(afterPlan,afterPlanDeep){const known=list=>Array.isArray(list)&&list.every(id=>AFTER_PLAN_PASS_ORDER.includes(id));if(!known(afterPlan)||!known(afterPlanDeep))return`After a plan takes the passes ${AFTER_PLAN_PASS_ORDER.join(`, `)}.`;if(!AFTER_PLAN_MANDATORY_PASSES.every(id=>afterPlan.includes(id)))return`Review and Security pass always run after a plan; they can't be unticked.`;if(afterPlanDeep.some(id=>!afterPlan.includes(id)))return`Tick After a plan for a pass before ticking Deeply.`;return``}var inAfterPlanOrder=ids=>AFTER_PLAN_PASS_ORDER.filter(id=>ids.includes(id));var ASSISTANT_PLAN_COMPLETION_MESSAGE=[`Plan completion:`,`Read every page of BOTH Plan and Progress, including the complete technical implementation plan; checklist marks do not establish completion.`,`Verify each agreed requirement against the preceding implementation, my request, accepted steering and the recorded evidence. Inspect the implementation, fix in-scope gaps and run relevant checks. Leave unrelated plans unchanged.`,`Then explicitly complete the plan with the plan helper when every requirement is verified, and report complete with the returned revisions; otherwise leave Plan active, record the specific gaps and verification evidence in its paired Progress document, and report wait, or report handoff for substantial necessary rework.`,`This turn checks the plan only: run no Deslop, UI pass or other pass. Once the plan is completed, Vibe64 runs the passes this chat ticks in Passes (After a plan) as their own turns.`,`Do not ask for permission merely to verify or complete verified work. Report findings, fixes, actual checks and anything unverified.`].join(` `);var ASSISTANT_MODES=Object.freeze([{id:`custom`,label:`Custom`,description:`Choose a model and thinking level for this chat.`},{id:`senior`,label:`Senior`,description:`Talk directly to your most capable model. Ask questions or request changes.`},{id:`junior`,label:`Junior`,description:`Talk directly to your everyday model. Ask questions or request changes.`},{id:`auto`,label:`Auto`,description:`Name either role, or let Senior handle plans and reviews and Junior handle other requests.`}]);var ASSISTANT_FIX_MODE=Object.freeze({id:`fix`,label:`Fix it with AI`,description:`Repair what went wrong with the Fix it with AI model.`});var ASSISTANT_ROUTING_METADATA=`assistant_routing`;var ASSISTANT_SETUP_ROLES=Object.freeze({owner:Object.freeze([`senior`,`junior`,`router`,`colleague`,`fix`,`explain`,`quickHelper`]),nonOwner:Object.freeze([`colleague`,`fix`,`explain`,`quickHelper`])});var ASSISTANT_FOLLOWING_ROLES=Object.freeze([`colleague`,`fix`,`explain`]);var ASSISTANT_ROUTING_ROLE_DEFINITIONS=Object.freeze([{id:`senior`,label:`Senior`,description:`Plans, reviews and passes in main chat. Your most capable model.`,group:`main`},{id:`junior`,label:`Junior`,description:`Everyday changes in main chat.`,group:`main`},{id:`router`,label:`Router`,description:`Chooses Senior or Junior when main chat is on Auto.`,group:`main`},{id:`colleague`,label:`Colleague`,description:`The default for Colleague. Each person can change their own.`,group:`helpers`},{id:`fix`,label:`Fix it with AI`,description:`Repair chats opened from errors and conflicts. Can run in a different tool from the chat it fixes.`,group:`helpers`},{id:`explain`,label:`Explain & check`,description:`Explain this code, the database assistant and Check my work.`,group:`helpers`},{id:`quickHelper`,label:`Quick helper`,description:`Titles, commit messages, prompt hints and summaries.`,group:`helpers`}].map(Object.freeze));var ASSISTANT_ROLE_DEFAULT_FOLLOWS=Object.freeze({owner:Object.freeze({colleague:`senior`,fix:`junior`,explain:`quickHelper`}),nonOwner:Object.freeze({fix:`colleague`,explain:`quickHelper`})});var ROUTING_REASONS=Object.freeze([`conversation`,`planning`,`implementation`,`review`]);var MAIN_CHAT_PURPOSES=Object.freeze([`custom`,`senior`,`junior`,`auto`,`review`,`deslop`,`ui_pass`,`pass`,`request_routing`]);var ASSISTANT_PURPOSE_ROLES=Object.freeze({custom:`custom`,senior:`senior`,junior:`junior`,review:`senior`,deslop:`senior`,ui_pass:`senior`,pass:`senior`,request_routing:`router`,colleague:`colleague`,fix:`fix`,source_explanation:`explain`,database_assistant:`explain`,lesson_review:`explain`,commit_title:`quickHelper`,session_title:`quickHelper`,prompt_hint:`quickHelper`,conversation_summary:`quickHelper`,voice_turn:`quickHelper`,quick_helper:`quickHelper`});var ASSISTANT_ROLE_PURPOSES=Object.freeze({senior:`senior`,junior:`junior`,router:`request_routing`,colleague:`colleague`,fix:`fix`,explain:`source_explanation`,quickHelper:`prompt_hint`});function assistantModeLabel(mode){return ASSISTANT_MODES.find(({id})=>id===mode)?.label||(mode===`fix`?ASSISTANT_FIX_MODE.label:``)||{review:`Senior review`,deslop:`Senior Deslop`,ui_pass:`Senior UI pass`,pass:`Senior pass`}[mode]||ASSISTANT_ROUTING_ROLE_DEFINITIONS.find(({id})=>id===mode)?.label||``}function routingError(message,code,options={}){return new AppError(409,message,{...options,code})}var upgradeRequired=()=>routingError(`This saved request predates the current AI setup. The administrator must run the state upgrade.`,`vibe64_assistant_routing_upgrade_required`);var choosesAutomation=mode=>mode!==`fix`;function assistantRoutingPreferences(value={}){if(!value||typeof value!==`object`||Array.isArray(value)||![...ASSISTANT_MODES,ASSISTANT_FIX_MODE].some(({id})=>id===value.mode))throw routingError(`Choose Custom, Senior, Junior, or Auto.`,`vibe64_assistant_mode_invalid`);if(Object.hasOwn(value,`workflowEngineId`))throw upgradeRequired();if(value.mode===`custom`&&!value.override)throw routingError(`Choose a custom model first.`,`vibe64_assistant_custom_model_required`);const automation=choosesAutomation(value.mode)?assistantRoutingAutomation(value):ASSISTANT_NO_FINISHING;const problem=afterPlanChoiceProblem(automation.afterPlan,automation.afterPlanDeep);if(problem)throw routingError(problem,`vibe64_assistant_after_plan_invalid`);if(typeof automation.autoSave!==`boolean`)throw routingError(`Automatically save changes is either on or off.`,`vibe64_assistant_auto_save_invalid`);return{mode:value.mode,afterPlan:inAfterPlanOrder(automation.afterPlan),afterPlanDeep:inAfterPlanOrder(automation.afterPlanDeep),autoSave:automation.autoSave,...value.override&&![`auto`,`fix`].includes(value.mode)?{override:defineVibe64AssistantSelection(value.override)}:{}}}function assistantRoutingAutomation(value){const chosen=value&&choosesAutomation(value.mode)?value:{};return Object.fromEntries(Object.keys(ASSISTANT_FINISHING_DEFAULTS).map(id=>[id,chosen[id]===void 0?ASSISTANT_FINISHING_DEFAULTS[id]:chosen[id]]))}function savedAssistantRouting(saved){if(saved&&typeof saved===`object`&&!Array.isArray(saved.afterPlan))throw upgradeRequired();return assistantRoutingPreferences(saved)}function assistantRoutingFromMetadata(metadata={}){if(!metadata[`assistant_routing`])return null;return savedAssistantRouting(JSON.parse(metadata[ASSISTANT_ROUTING_METADATA]))}var assistantRoutingRequestFromMetadata=metadata=>JSON.parse(metadata?.assistant_routing_request||`null`);function assistantRoutingRequestForDisplay(metadata={}){try{return assistantRoutingRequestFromMetadata(metadata)}catch{return null}}var goalStatusIsComplete=status=>status===`complete`||status===`completed`;var assistantGoalIsActive=goal=>Boolean(goal)&&!goalStatusIsComplete(goal.status);var ASSISTANT_WORKFLOW_STATUSES=Object.freeze([`working`,`waiting`,`complete`]);var ASSISTANT_WORKFLOW_DELIVERIES=Object.freeze([`routing`,`pending`,`sending`,`uncertain`,`accepted`,`failed`]);var assistantWorkflowRole=request=>request.stage===`pass`||request.stage===`review`&&request.followup&&request.mode===`auto`?`senior`:request.resolvedMode;var assistantAfterPlanPass=request=>request?.stage===`pass`&&request.passChain?.passes?.[request.passChain.index]||null;function assistantSetupRoleValue(setupValues,role){const value=setupValues[role];return value?.follows?{value:setupValues[value.follows]??null,followedRole:value.follows}:{value:value??null,followedRole:``}}function assistantRoutingStatusIsPending(request){return request?.status!==`complete`&&[`routing`,`pending`,`sending`,`uncertain`].includes(request?.delivery)}function assistantRoutingRequestCanBeReplaced(request,selection){if(request?.helper)return false;if(request?.cancelled)return true;const previous=request?.deliverySelection||request?.observedSelection;if(request?.stopped&&previous&&selection&&!sameVibe64AssistantSelection(previous,selection))return true;return request?.delivery===`pending`&&(request.status===`waiting`||Boolean(request.error))&&!request.attemptedMessageId}function assistantRoutingRequestIsUnresolved(request,selection){return assistantRoutingStatusIsPending(request)&&!assistantRoutingRequestCanBeReplaced(request,selection)}function assistantModePrompt(mode,message,options={}){let{planInstructions=``,intent=``,browserReview=false}=options;const{rework=`junior`}=options;const direct=`Work directly from the user's request and conversation, answering questions or implementing changes as requested. You may edit application files when requested. Make ordinary local choices using established project patterns, ask about unresolved scope or design decisions, preserve unrelated work, and verify changes with relevant checks.`;const instructions={custom:direct,senior:direct,junior:direct,fix:direct,deslop:[`Perform Deslop directly using the project's Deslop guidance.`,`You may edit code for behavior-preserving cleanup; earlier Auto planning restrictions do not apply.`,`Preserve existing behavior, unrelated work and staging.`,`Use the user's selected commits or scope; otherwise clean up only the current task's changes.`,`Do not implement features, fix behavior-changing defects, create an implementation plan, or delegate cleanup to another model.`,`Report discovered defects separately without fixing them.`,`Run focused checks, then report what became simpler and what was verified.`,`Do not commit, push or deploy.`].join(` `),ui_pass:[`Perform the UI pass directly using the project's UI pass guidance, on the scope this request names.`,`You may edit code to bring those screens in line with the project's UI guidance; earlier Auto planning restrictions do not apply.`,`Preserve each screen's behavior, unrelated work and staging.`,`Do not implement features, fix behavior-changing defects, create an implementation plan, or delegate the pass to another model.`,`Report discovered defects separately without fixing them.`,`Check the screens you changed in the managed browser, run focused checks, then report what changed and what was verified.`,`Do not commit, push or deploy.`].join(` `),pass:`Perform the pass this request names directly, following the project's guidance for it. You may edit code for it; earlier Auto planning restrictions do not apply. Preserve unrelated work and staging. Do not implement features the pass does not call for, create an implementation plan, or delegate the pass to another model. Report discovered defects outside the pass separately without fixing them. Run focused checks, and check the screens you changed in the managed browser, then report what changed and what was verified. Do not commit, push or deploy.`,review:[`Review the preceding coding work against the original request and accepted steering.`,`Inspect actual files and relevant surrounding code. You may directly fix in-scope defects.`,`Earlier Auto planning restrictions do not apply.`,`Preserve unrelated work and staging, and report out-of-scope defects without fixing them.`,`For a cleanup-only request, apply the project's Deslop guidance and preserve behavior; report behavior-changing defects separately without fixing them.`,`Perform the review yourself in this turn. Cleanup is optional and only runs when requested in this review's instructions.`,`If implementation is missing or coding stopped for a decision, report that and preserve the decision for the user; do not start the original implementation from scratch.`,`Run relevant checks, then report findings, fixes, actual checks and anything unverified.`,`You own browser verification for this review. Exercise the requested user flow and inspect meaningful visual checkpoints yourself using the supplied managed browser tools; the implementer's code tests do not replace these checks. Reuse reliable passing evidence and avoid repeating unaffected checks. Report browser or visual checks that could not be performed, and do not claim verified completion while required checks remain unfinished.`,`Do not Save, push or invent new product requirements. For substantial necessary rework within the agreed outcome, `+{junior:`update the technical plan and hand back to Junior through the workflow outcome command. Junior's rework then returns to Senior to check and complete the plan.`,self:`return to your own implementation through the workflow outcome command.`,report:`report what it needs instead of starting it in this review.`}[rework]].join(` `)};if(!instructions[mode])throw routingError(`Unknown assistant mode.`,`vibe64_assistant_mode_unknown`);let instruction=instructions[intent]||instructions[mode];switch(intent){case`conversation`:instruction=`Answer or investigate the user's question. You may use vibe64-helper plan read or history to inspect a referenced plan. Do not create or update a plan, change its status, edit application files, run state-changing operations, or delegate implementation. Explain missing or completed plans without reopening them.`;break;case`planning`:instruction=`Discuss and manage the plan as requested through vibe64-helper plan. Do not change application files in a planning-only request. Clarify ambiguous references before changing a plan. Junior may update paired Progress and existing checklist ticks as work is verified; agreed Plan scope and lifecycle changes require Senior.`;break;case`implementation`:instruction=direct+` Implement the requested work, including any explicitly requested planning changes within your role's authority. `+`For a plan's explicitly authorised removal or deferral, record the exact deferred requirement and its agreed timing in a Deferred work section of paired Progress before removing it from Plan's current acceptance scope. Preserve completed implementation evidence and do not perform deferred work. Reassess the remaining requirements against that evidence; if none remain to implement, hand off for review rather than treating the scope edit as planning-only. Junior still cannot edit Plan scope. `+`Continue until the authorised scope is implemented and checked. Task size, context compaction, or finishing one useful slice is not a reason to end the task. `+`Stop for an unresolved architectural or product decision outside the agreed scope only where it blocks the remaining work; continue independent authorised work. `+`The latest execution request supersedes earlier planning-only wording, while explicit remaining approval boundaries still apply. `+`If work remains, lead with Implementation incomplete and name the exact blocker and unfinished scope; never open with Done for partial implementation. `+(mode===`senior`?`When this request implements a plan, verify every agreed requirement, then complete the plan yourself with the plan helper; leave it active with the gaps in Progress while any remain. `:`When this request implements a plan, leave the plan active: Senior checks and completes it in its own turn after yours; do not request permission for that turn. `)+`A completed plan starts the passes this chat ticks in Passes (After a plan), each in its own turn; never start a pass on your own in this turn.`}if(!planInstructions&&intent!==`conversation`)planInstructions=`This direct request is independent of the current Auto plan unless the user explicitly refers to it. Senior may use vibe64-helper plan to manage it; Junior may update Progress and existing checklist ticks after reading both documents, never change scope or mark the plan completed.`;const seniorTurns=[`review`,`deslop`,`ui_pass`,`pass`];if(![...seniorTurns,`conversation`,`planning`].includes(intent)&&!seniorTurns.includes(mode)){instruction+=` When the requested feature is implemented, its required runtime resources are prepared and Preview is responding, promptly tell the user: Ready to try—give it a spin. Verification is still running. Do not claim full completion before verification, and do not wait for the user to test before continuing your checks. If Preview is unavailable, report that instead of inviting the user to try it.`;instruction+=browserReview?` A separate Senior review owns in-depth browser testing and visual inspection. Do not run those checks in this implementation turn. Run relevant focused code tests and basic smoke checks: confirm server startup, relevant routes and API responses, and if needed make a brief managed-browser check that the changed page renders and its main control is present. Leave full end-to-end browser suites, multi-step user journeys and visual inspection to Senior; do not expand the smoke check into those checks. Prepare the app and report exact checks, remaining gaps and browser acceptance cases to Senior; browser verification pending is an expected handoff, not an implementation blocker. Tell the user that Senior will perform the remaining browser checks.`:` You own the remaining verification, including relevant browser checks and visual inspection using the supplied tools. Tell the user those checks are next, keep the app usable during checking and report anything unverified if checking is interrupted or unavailable.`}return`[Vibe64 role: ${assistantModeLabel(mode)}. Applies only to this request; earlier per-turn mode instructions no longer apply.]\n${instruction}${planInstructions?`\n${planInstructions}`:``}\n\n${message}`}function assistantGoalObjective(objective,pinned){if(pinned?.objective&&[`custom`,`senior`,`junior`].some(mode=>objective===assistantModePrompt(mode,pinned.objective)))return pinned.objective;return objective}function assistantGoalManagementMessage(message,turn={}){if(!message||message.receipt===false||turn.user?.receipt===false||turn.optimistic&&turn.optimistic.status!==`accepted`||turn.system?.delivery)return false;const native=message.data?.native;if(!(turn.metadata?.engineId===`claude`||turn.metadata?.assistantSelection?.engineId===`claude`||native?.engineId===`claude`))return false;const text=String(message.text||``);if(message.role===`user`)return Boolean(turn.metadata?.upstreamMessageId||message.receipt===true)&&/^\/goal(?:\s|$)/u.test(text);if(![`assistant`,`commentary`].includes(message.role))return false;if(native?.command)return native.engineId===`claude`&&([`assistant`,`result`].includes(native.type)||native.type===`system`&&[`local_command`,`local_command_output`].includes(native.subtype))&&native.command===`goal`&&native.output===`stdout`;const prefix=[`Goal set: `,`Goal cleared: `,`Goal active: `].find(value=>text.startsWith(value));if(prefix){const objective=text.slice(prefix.length);const separator=objective.indexOf(`
|
|
95
|
+
`);if(types.includes(`Files`)||types.includes(`application/x-moz-file`)||types.includes(`x-special/gnome-copied-files`)||/^file:/imu.test(text))return text||`file://`;return``}function useAttachmentDropTarget({uploadFiles,reportAttachmentError}){const dragDepth=ref(0);const dragActive=computed(()=>dragDepth.value>0);function resetDragState(){dragDepth.value=0}function handleDragEnter(event){if(!assistantAttachmentEventHasFiles(event))return;dragDepth.value+=1;if(event?.dataTransfer)event.dataTransfer.dropEffect=`copy`}function handleDragOver(event){if(event?.dataTransfer)event.dataTransfer.dropEffect=`copy`}function handleDragLeave(){dragDepth.value=Math.max(0,dragDepth.value-1)}async function handleDrop(event){resetDragState();return uploadFiles(assistantAttachmentFilesFromDropEvent(event))}async function handlePaste(event){const files=assistantAttachmentFilesFromPasteEvent(event);if(files.length<1){if(assistantAttachmentClipboardLocalFileReference(event))reportAttachmentError(t$26(`jskit.assistant.attachments.error.localFilePaste`));return[]}if(!assistantAttachmentClipboardText(event))event?.preventDefault?.();return uploadFiles(files)}return{dragActive,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,resetDragState}}var{t:t$25}=useJskitText();function attachmentUploadError(attachment){return attachment?.error||attachment?.errors?.[0]?.message||``}function attachmentIdentity(attachment){return String(attachment?.clientId||attachment?.attachmentId||attachment?.path||attachment?.fileName||``)}var attachmentClientSequence=0;function nextAttachmentClientId(){attachmentClientSequence+=1;return`attachment-${Date.now().toString(36)}-${attachmentClientSequence.toString(36)}`}function attachmentFileName(file){return String(file?.name||`attachment`)}function attachmentUploadResult(upload=null){if(upload&&typeof upload.then===`function`)return{cancel:typeof upload.cancel===`function`?()=>upload.cancel():null,promise:upload};if(upload?.promise&&typeof upload.promise.then===`function`)return{cancel:typeof upload.abort===`function`?()=>upload.abort():typeof upload.cancel===`function`?()=>upload.cancel():null,promise:upload.promise};return{cancel:null,promise:Promise.resolve(upload)}}function attachmentProgress(progress={},possibleTotal,fallbackTotal=0){const directNumericProgress=typeof progress===`number`?progress:null;const progressObject=progress&&typeof progress===`object`?progress:{};const totalBytes=Math.max(0,Number(progressObject.totalBytes??progressObject.total??possibleTotal??fallbackTotal)||0);const bytesValue=progressObject.bytesSent??progressObject.loaded??progressObject.uploadedBytes??directNumericProgress;const bytesKnown=bytesValue!==null&&bytesValue!==void 0&&bytesValue!==``;let bytesSent=bytesKnown?Number(bytesValue)||0:0;const directPercent=progressObject.percent;let percent=directPercent!==null&&directPercent!==void 0&&directPercent!==``?Number(directPercent):null;const progressValue=progressObject.progress;if(!Number.isFinite(percent)&&progressValue!==null&&progressValue!==void 0&&progressValue!==``){const numericProgressValue=Number(progressValue);if(Number.isFinite(numericProgressValue))percent=numericProgressValue<=1?numericProgressValue*100:numericProgressValue}if(!Number.isFinite(percent))percent=bytesKnown&&totalBytes>0?bytesSent/totalBytes*100:null;if(percent!==null)percent=Math.max(0,Math.min(100,percent));if(totalBytes>0){const inferredBytes=percent===null?0:totalBytes*percent/100;bytesSent=Math.max(0,Math.min(totalBytes,bytesSent||inferredBytes))}else bytesSent=Math.max(0,bytesSent);return{bytesSent,percent,totalBytes}}function attachmentReceipt(row,uploaded){return{...uploaded,attachmentId:String(uploaded?.attachmentId||``),clientId:row.clientId,fileName:String(uploaded?.fileName||row.fileName),sessionId:row.sessionId,size:Number(uploaded?.size??row.size)||0}}function createWaiter(row){let resolve=null;row.waiter={promise:new Promise(currentResolve=>{resolve=currentResolve}),resolve,settled:false};return row.waiter}function settleWaiter(row,value=null,waiter=row.waiter){if(!waiter||waiter.settled)return;waiter.settled=true;waiter.resolve(value)}function updateRowProgress(row,progress,total){if(!row.retained||row.phase!==`uploading`)return;const next=attachmentProgress(progress,total,row.totalBytes);row.bytesSent=Math.max(row.bytesSent,next.bytesSent);row.totalBytes=next.totalBytes||row.totalBytes;if(next.percent!==null)row.progress=Math.max(Number(row.progress)||0,next.percent)}function buildQueueRow({currentSessionId,file=null,fileName=`attachment`,phase=`queued`,producer=null,size=0}={}){const normalizedSize=Number(file?.size??size)||0;return reactive({activeHandoffToken:null,activeToken:null,attachmentId:``,bytesSent:0,clientId:nextAttachmentClientId(),error:``,failureStage:``,file,fileName:file?attachmentFileName(file):String(fileName||`attachment`),path:``,phase,producer,producerAbortController:null,producerToken:null,progress:null,receipt:null,retained:true,sessionId:currentSessionId,size:normalizedSize,totalBytes:normalizedSize,waiter:null})}function createReceiptCleanup({deleteAttachment,deletesUnsentUploads,reportAttachmentError}){const cleanupTasks=new Set;const receiptCleanupById=new Map;const cleanedReceiptIds=new Set;function trackCleanup(task){const cleanup=Promise.resolve(task).catch(error=>{reportAttachmentError(error,t$25(`jskit.assistant.attachments.error.cleanupFailed`));return false});cleanupTasks.add(cleanup);cleanup.finally(()=>cleanupTasks.delete(cleanup));return cleanup}async function deleteUploadedAttachment(currentSessionId,attachment){const attachmentId=String(attachment?.attachmentId||``).trim();if(!attachmentId||!deletesUnsentUploads)return false;const response=await deleteAttachment(currentSessionId,attachmentId);if(response?.ok===false)throw new Error(attachmentUploadError(response)||t$25(`jskit.assistant.attachments.error.cleanupFailed`));return true}function cleanupReceipt(currentSessionId,receipt){const attachmentId=String(receipt?.attachmentId||``).trim();const cleanupId=`${currentSessionId}:${attachmentId}`;if(!attachmentId)return Promise.resolve(false);if(cleanedReceiptIds.has(cleanupId))return Promise.resolve(false);if(receiptCleanupById.has(cleanupId))return receiptCleanupById.get(cleanupId);const cleanup=trackCleanup(deleteUploadedAttachment(currentSessionId,receipt)).then(deleted=>{if(deleted)cleanedReceiptIds.add(cleanupId);return deleted});receiptCleanupById.set(cleanupId,cleanup);cleanup.finally(()=>receiptCleanupById.delete(cleanupId));return cleanup}async function waitForAttachmentCleanup(){while(cleanupTasks.size>0)await Promise.allSettled([...cleanupTasks])}return Object.freeze({cleanupReceipt,waitForAttachmentCleanup})}var{serverMessage:serverMessage$3,t:t$24}=useJskitText();function attachmentErrorText(error,fallback){return String(error&&typeof error===`object`&&serverMessage$3(error)||error?.message||error||fallback)}function assistantAttachmentSessionId(sessionId){return String(toValue(sessionId)||``).trim()}function assistantAttachmentUploadAllowed(canUpload){return toValue(canUpload)!==false}var ASSISTANT_ATTACHMENT_MAX_BYTES=1e8;var ASSISTANT_ATTACHMENT_UPLOAD_CONCURRENCY=2;var ASSISTANT_ATTACHMENT_UNRESOLVED_PHASES=new Set([`preparing`,`queued`,`uploading`,`delivering`,`failed`]);function keepAttachmentErrorInStatus(){}async function keepUploadedAttachmentsReady(){return null}function useAssistantAttachments({canUpload=()=>true,deleteAttachment,onError=keepAttachmentErrorInStatus,onUploaded=keepUploadedAttachmentsReady,sessionId,uploadAttachment,maxBytes=ASSISTANT_ATTACHMENT_MAX_BYTES,maxItems=10,uploadConcurrency=2}){if(![maxBytes,maxItems,uploadConcurrency].every(value=>Number.isSafeInteger(value)&&value>0))throw new TypeError(`Attachment limits must be positive integers.`);const attachments=ref([]);const queueItems=ref([]);const status=ref(``);const activeUploadCount=ref(0);const uploadQueue=[];const rowsById=new Map;const activeAttempts=new Map;let disposed=false;const uploading=computed(()=>activeUploadCount.value>0||queueItems.value.some(item=>[`preparing`,`uploading`,`delivering`].includes(item.phase)));const hasUnresolved=computed(()=>queueItems.value.some(item=>ASSISTANT_ATTACHMENT_UNRESOLVED_PHASES.has(item.phase)));const canSubmit=computed(()=>!hasUnresolved.value);const retainedItemCount=computed(()=>queueItems.value.filter(item=>item.phase!==`cancelled`).length);const atCapacity=computed(()=>retainedItemCount.value>=maxItems);const canAddFiles=computed(()=>Boolean(!disposed&&assistantAttachmentSessionId(sessionId)&&assistantAttachmentUploadAllowed(canUpload)&&!atCapacity.value));const aggregateProgress=computed(()=>{const retainedItems=queueItems.value.filter(item=>item.phase!==`cancelled`);const totalBytes=retainedItems.reduce((sum,item)=>sum+item.totalBytes,0);const bytesSent=retainedItems.reduce((sum,item)=>sum+item.bytesSent,0);return{bytesSent,percent:totalBytes>0?Math.round(bytesSent/totalBytes*100):0,totalBytes}});const tooLarge=row=>t$24(`jskit.assistant.attachments.error.tooLarge`,{fileName:row.fileName,limit:attachmentLimitText(maxBytes)});const tooMany=()=>t$24(`jskit.assistant.attachments.error.tooMany`,{count:maxItems});function reportAttachmentError(error,fallbackMessage=t$24(`jskit.assistant.attachments.error.uploadFailed`),{notify=true}={}){const message=attachmentErrorText(error,fallbackMessage);status.value=message;if(notify)try{onError(error||new Error(message),fallbackMessage)}catch{}return message}function clearStatus(){status.value=``}function failRow(row,failureStage,error,fallbackMessage){row.error=attachmentErrorText(error,fallbackMessage);row.failureStage=failureStage;row.phase=`failed`;reportAttachmentError(error,fallbackMessage,{notify:false})}function canonicalRow(attachment={}){const identity=attachmentIdentity(attachment);return identity?rowsById.get(identity)||queueItems.value.find(row=>attachmentIdentity(row)===identity||row.attachmentId===identity):null}const{cleanupReceipt,waitForAttachmentCleanup}=createReceiptCleanup({deleteAttachment,deletesUnsentUploads:typeof deleteAttachment===`function`,reportAttachmentError});const{dragActive,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,resetDragState}=useAttachmentDropTarget({uploadFiles,reportAttachmentError});function removeReadyReceipt(row){const removed=attachments.value.filter(attachment=>attachment.clientId===row.clientId);attachments.value=attachments.value.filter(attachment=>attachment.clientId!==row.clientId);return removed}async function handOffUploadedAttachment(row,receipt,waiter=row.waiter){const token=Symbol(`${row.clientId}-handoff`);row.activeHandoffToken=token;row.phase=`delivering`;if(!attachments.value.some(attachment=>attachment.clientId===row.clientId))attachments.value.push(receipt);try{const accepted=(await onUploaded([receipt]))?.accepted===true;if(row.activeHandoffToken!==token||!row.retained||row.phase===`cancelled`){removeReadyReceipt(row);if(!accepted)await cleanupReceipt(row.sessionId,receipt);settleWaiter(row,null,waiter);return null}row.activeHandoffToken=null;row.error=``;row.failureStage=``;if(accepted){removeReadyReceipt(row);row.retained=false;rowsById.delete(row.clientId);queueItems.value=queueItems.value.filter(candidate=>candidate.clientId!==row.clientId);settleWaiter(row,receipt,waiter);return receipt}row.phase=`ready`;settleWaiter(row,receipt,waiter);return receipt}catch(error){if(row.activeHandoffToken!==token||!row.retained||row.phase===`cancelled`){await cleanupReceipt(row.sessionId,receipt);settleWaiter(row,null,waiter);return null}row.activeHandoffToken=null;removeReadyReceipt(row);failRow(row,`handoff`,error,t$24(`jskit.assistant.attachments.error.unusable`));settleWaiter(row,null,waiter);return null}}async function finishUploadAttempt(attempt,uploaded,uploadError=null){activeAttempts.delete(attempt.token);activeUploadCount.value=activeAttempts.size;pumpQueue();const{row}=attempt;const isCurrentAttempt=row.activeToken===attempt.token;const uploadSucceeded=Boolean(!uploadError&&uploaded&&uploaded.ok!==false&&String(uploaded.attachmentId||``).trim());if(!isCurrentAttempt||!row.retained||disposed){if(uploadSucceeded)await cleanupReceipt(attempt.sessionId,uploaded);settleWaiter(row,null,attempt.waiter);pumpQueue();return}row.activeToken=null;if(uploadSucceeded){const receipt=attachmentReceipt(row,uploaded);row.receipt=receipt;row.attachmentId=receipt.attachmentId;row.path=String(receipt.path||``);row.bytesSent=row.totalBytes;row.progress=100;row.error=``;row.failureStage=``;await handOffUploadedAttachment(row,receipt,attempt.waiter)}else{failRow(row,`upload`,uploadError||new Error(attachmentUploadError(uploaded)||t$24(`jskit.assistant.attachments.error.uploadFailed`)),t$24(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null,attempt.waiter)}pumpQueue()}function startUpload(row){const token=Symbol(row.clientId);const abortController=new AbortController;const attempt={abortController,cancel:null,row,sessionId:row.sessionId,settled:null,token,waiter:row.waiter};row.activeToken=token;row.phase=`uploading`;row.error=``;activeAttempts.set(token,attempt);activeUploadCount.value=activeAttempts.size;try{const transport=attachmentUploadResult(uploadAttachment(row.sessionId,row.file,{onProgress:(progress,total)=>updateRowProgress(row,progress,total),signal:abortController.signal}));attempt.cancel=transport.cancel;attempt.settled=transport.promise.then(uploaded=>finishUploadAttempt(attempt,uploaded),error=>finishUploadAttempt(attempt,null,error))}catch(error){attempt.settled=finishUploadAttempt(attempt,null,error)}}function pumpQueue(){if(disposed)return;while(activeAttempts.size<uploadConcurrency&&uploadQueue.length>0){const row=uploadQueue.shift();if(!row?.retained||row.phase!==`queued`)continue;startUpload(row)}}function cancelAttachment(attachment={}){const row=canonicalRow(attachment);if(!row||!row.retained||![`preparing`,`queued`,`uploading`].includes(row.phase))return false;const token=row.activeToken;row.activeToken=null;row.activeHandoffToken=null;row.phase=`cancelled`;row.error=``;const receipt=row.receipt;removeReadyReceipt(row);if(receipt)cleanupReceipt(row.sessionId,receipt);row.receipt=null;row.failureStage=``;settleWaiter(row,null);const attempt=token?activeAttempts.get(token):null;try{row.producerAbortController?.abort();attempt?.abortController.abort();attempt?.cancel?.()}catch{}row.producerAbortController=null;row.producerToken=null;pumpQueue();return true}function retryAttachment(attachment={}){const row=canonicalRow(attachment);if(!row||!row.retained||![`failed`,`cancelled`].includes(row.phase)||row.sessionId!==assistantAttachmentSessionId(sessionId)||!assistantAttachmentUploadAllowed(canUpload))return Promise.resolve(null);if(row.phase===`cancelled`&&retainedItemCount.value>=maxItems){reportAttachmentError(tooMany());return Promise.resolve(null)}if(row.failureStage===`handoff`&&row.receipt){row.error=``;row.phase=`uploading`;const waiter=createWaiter(row);handOffUploadedAttachment(row,row.receipt,waiter);return waiter.promise}if(row.producer&&!row.file){const waiter=createWaiter(row);startAttachmentProducer(row);return waiter.promise}if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t$24(`jskit.assistant.attachments.error.uploadFailed`));return Promise.resolve(null)}row.bytesSent=0;row.progress=null;row.error=``;row.failureStage=``;row.phase=`queued`;const waiter=createWaiter(row);uploadQueue.push(row);pumpQueue();return waiter.promise}function detachRow(row){if([`preparing`,`queued`,`uploading`].includes(row.phase))cancelAttachment(row);row.retained=false;rowsById.delete(row.clientId);settleWaiter(row,null)}function removeAttachment(attachment={}){const row=canonicalRow(attachment);if(!row)return[];const removedReceipts=removeReadyReceipt(row);const removed=removedReceipts.length>0?removedReceipts:[row];const receiptToClean=removedReceipts[0]||row.receipt;detachRow(row);queueItems.value=queueItems.value.filter(candidate=>candidate.clientId!==row.clientId);if(receiptToClean)cleanupReceipt(row.sessionId,receiptToClean);return removed}function clearAttachments({accepted=true,attachmentIds=null}={}){if(!accepted)return abandonAttachments();const selectedIds=Array.isArray(attachmentIds)?new Set(attachmentIds):null;const cleared=attachments.value.filter(attachment=>!selectedIds||selectedIds.has(attachment.attachmentId));const readyIds=new Set(cleared.map(attachment=>attachment.clientId));const remaining=[];for(const row of[...queueItems.value]){if(selectedIds&&!readyIds.has(row.clientId)){remaining.push(row);continue}if(readyIds.has(row.clientId)){row.retained=false;rowsById.delete(row.clientId);continue}detachRow(row);if(row.receipt)cleanupReceipt(row.sessionId,row.receipt)}attachments.value=attachments.value.filter(attachment=>!readyIds.has(attachment.clientId));queueItems.value=remaining;return cleared}async function abandonAttachments({onlySessionId=``}={}){const normalizedSessionId=String(onlySessionId||``).trim();const rows=queueItems.value.filter(row=>!normalizedSessionId||row.sessionId===normalizedSessionId);const rowIds=new Set(rows.map(row=>row.clientId));const readyReceipts=rows.map(row=>row.receipt).filter(Boolean);const attempts=[...activeAttempts.values()].filter(attempt=>rowIds.has(attempt.row.clientId));for(const row of rows)detachRow(row);queueItems.value=queueItems.value.filter(row=>!rowIds.has(row.clientId));attachments.value=attachments.value.filter(attachment=>!rowIds.has(attachment.clientId));const readyCleanup=readyReceipts.map(attachment=>cleanupReceipt(attachment.sessionId,attachment));await Promise.allSettled([...readyCleanup,...attempts.map(attempt=>attempt.settled).filter(Boolean)]);await waitForAttachmentCleanup();return rows}async function disposeAttachments(){if(disposed){await waitForAttachmentCleanup();return[]}disposed=true;stopSessionWatch();return abandonAttachments()}function createQueueRow(options){const row=buildQueueRow(options);rowsById.set(row.clientId,row);queueItems.value.push(row);createWaiter(row);return row}function queuePreparedFile(row,file,waiter=row.waiter){const preparedFile=assistantAttachmentFiles([file])[0];if(!preparedFile)throw Object.assign(new Error(`The prepared attachment did not produce a file.`),{messageCode:`assistant.attachments.error.noFile`,messageParams:{}});row.file=preparedFile;row.fileName=attachmentFileName(preparedFile);row.size=Number(preparedFile.size)||0;row.totalBytes=row.size;if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t$24(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null,waiter);return false}row.phase=`queued`;uploadQueue.push(row);pumpQueue();return true}function startAttachmentProducer(row){const token=Symbol(`${row.clientId}-producer`);const waiter=row.waiter;const abortController=new AbortController;row.file=null;row.producerAbortController=abortController;row.producerToken=token;row.phase=`preparing`;row.error=``;row.failureStage=``;row.producerSettled=Promise.resolve().then(()=>row.producer({signal:abortController.signal})).then(file=>{if(row.producerToken!==token||!row.retained||disposed){settleWaiter(row,null,waiter);return null}row.producerAbortController=null;row.producerToken=null;try{queuePreparedFile(row,file,waiter)}catch(error){failRow(row,`preparing`,error,t$24(`jskit.assistant.attachments.error.preparationFailed`));settleWaiter(row,null,waiter)}return file},error=>{if(row.producerToken!==token||!row.retained||disposed){settleWaiter(row,null,waiter);return null}row.producerAbortController=null;row.producerToken=null;if(error?.name===`AbortError`){row.phase=`cancelled`;row.error=``}else failRow(row,`preparing`,error,t$24(`jskit.assistant.attachments.error.preparationFailed`));settleWaiter(row,null,waiter);return null})}function uploadFileProducer({fileName=t$24(`jskit.assistant.attachments.preparingName`),produce}={}){const currentSessionId=assistantAttachmentSessionId(sessionId);if(!canAddFiles.value||typeof produce!==`function`){if(atCapacity.value)reportAttachmentError(tooMany());return Promise.resolve(null)}status.value=``;const row=createQueueRow({currentSessionId,fileName,phase:`preparing`,producer:produce});const waiter=row.waiter;startAttachmentProducer(row);return waiter.promise}async function uploadFiles(files=[]){const uploadableFiles=assistantAttachmentFiles(files);const currentSessionId=assistantAttachmentSessionId(sessionId);if(uploadableFiles.length<1||!currentSessionId||disposed||!assistantAttachmentUploadAllowed(canUpload))return[];status.value=``;const availableSlots=Math.max(0,maxItems-retainedItemCount.value);const acceptedFiles=uploadableFiles.slice(0,availableSlots);if(acceptedFiles.length<uploadableFiles.length)reportAttachmentError(tooMany());const waiters=[];for(const file of acceptedFiles){const row=createQueueRow({currentSessionId,file});const waiter=row.waiter;waiters.push(waiter.promise);if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t$24(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null)}else uploadQueue.push(row)}pumpQueue();return(await Promise.all(waiters)).filter(attachment=>attachment&&attachments.value.some(candidate=>candidate.clientId===attachment.clientId))}const stopSessionWatch=watch(()=>assistantAttachmentSessionId(sessionId),(nextSessionId,previousSessionId)=>{if(nextSessionId!==previousSessionId&&previousSessionId)abandonAttachments({onlySessionId:previousSessionId})},{flush:`sync`});if(getCurrentScope())onScopeDispose(()=>{disposeAttachments()});return{maxBytes,maxItems,abandonAttachments,aggregateProgress,attachments,atCapacity,canAddFiles,cancelAttachment,canSubmit,clearAttachments,clearStatus,disposeAttachments,dragActive,hasUnresolved,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,queueItems,removeAttachment,resetDragState,retryAttachment,status,uploading,uploadFiles,uploadFileProducer,waitForAttachmentCleanup}}var _hoisted_1$64=[`alt`,`src`];var _hoisted_2$54={key:1};var _sfc_main$88={__name:`AssistantAttachmentPreview`,props:{attachment:{type:Object,default:null},previewUrl:{type:String,default:``},downloadUrl:{type:String,required:true}},emits:[`close`],setup(__props,{emit:__emit}){const{t}=useJskitText();const props=__props;const emit=__emit;const imageFailed=ref(false);watch(()=>[props.attachment,props.previewUrl],()=>{imageFailed.value=false});return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":Boolean(__props.attachment),"max-width":`960`,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>!$event&&emit(`close`))},{default:withCtx(()=>[__props.attachment?(openBlock(),createBlock(VCard,{key:0,title:__props.attachment.fileName},{default:withCtx(()=>[createVNode(VCardText,null,{default:withCtx(()=>[__props.previewUrl&&!imageFailed.value?(openBlock(),createElementBlock(`img`,{key:__props.previewUrl,alt:__props.attachment.fileName,class:`assistant-attachment-preview`,src:__props.previewUrl,onError:_cache[0]||(_cache[0]=$event=>imageFailed.value=true)},null,40,_hoisted_1$64)):(openBlock(),createElementBlock(`p`,_hoisted_2$54,toDisplayString(unref(t)(`jskit.assistant.attachments.previewUnavailable`)),1))]),_:1}),createVNode(VCardActions,null,{default:withCtx(()=>[createVNode(VBtn,{href:__props.downloadUrl,download:__props.attachment.fileName,"prepend-icon":`$download`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.attachments.download`)),1)]),_:1},8,[`href`,`download`]),createVNode(VSpacer),createVNode(VBtn,{onClick:_cache[1]||(_cache[1]=$event=>emit(`close`))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.attachments.close`)),1)]),_:1})]),_:1})]),_:1},8,[`title`])):createCommentVNode(``,true)]),_:1},8,[`model-value`])}}};var AssistantAttachmentPreview_default=_plugin_vue_export_helper_default(_sfc_main$88,[[`__scopeId`,`data-v-19946d64`]]);var applicationConversations=new WeakMap;function retainAssistantConversation(app,key,createRuntime,reader={active:true}){let conversations=applicationConversations.get(app);if(!conversations){conversations=new Map;applicationConversations.set(app,conversations)}let entry=conversations.get(key);if(!entry){const scope=effectScope(true);const readers=shallowReactive(new Map);const retain=()=>retainAssistantConversation(app,key,createRuntime);try{entry={scope,readers,runtime:app.runWithContext(()=>scope.run(()=>createRuntime(readers,retain)))};conversations.set(key,entry)}catch(error){scope.stop();throw error}}const token=Symbol(`conversation reader`);entry.readers.set(token,reader);return{runtime:entry.runtime,release(){if(!entry.readers.delete(token)||entry.readers.size)return;entry.scope.stop();conversations.delete(key)}}}var{serverMessage:serverMessage$2,t:t$23}=useJskitText();function turnMatchesOptimisticMessage(turn={},optimistic={}){const authored=optimistic.origin===`application`?turn.system:turn.user;const canonicalMessageId=normalizeText$1(authored?.messageId);const optimisticMessageId=normalizeText$1(optimistic.id);if(canonicalMessageId&&optimisticMessageId)return canonicalMessageId===optimisticMessageId;if(normalizeText$1(authored?.text)!==optimistic.text)return false;const userAtMs=Date.parse(String(authored?.at||``));return Number.isFinite(userAtMs)&&userAtMs>=optimistic.createdAtMs-5e3}function unmatchedOptimisticMessages(turns=[],optimisticMessages=[],{receiptsOnly=false}={}){const conversationTurns=Array.isArray(turns)?turns:[];const matchedTurnIndexes=new Set;return(Array.isArray(optimisticMessages)?optimisticMessages:[]).filter(message=>{const turnIndex=conversationTurns.findIndex((turn,index)=>!matchedTurnIndexes.has(index)&&turnMatchesOptimisticMessage(turn,message)&&(!receiptsOnly||message.status===`accepted`||(message.origin===`application`?turn.system:turn.user)?.receipt!==false));if(turnIndex<0)return true;matchedTurnIndexes.add(turnIndex);return false})}function createAssistantMessageDelivery({deliver:defaultDeliver}={}){const state=reactive({messages:[],sending:false});const acceptanceCallbacks=new WeakMap;let deliveryTail=null;let pendingSends=new Map;function find(messageId){return state.messages.find(message=>message.id===messageId)||null}function remove(messageId){state.messages=state.messages.filter(message=>message.id!==messageId)}function reconcile(turns){const unmatched=unmatchedOptimisticMessages(turns,state.messages,{receiptsOnly:true});const retained=new Set(unmatched.map(message=>message.id));for(const message of state.messages)if(!retained.has(message.id))accept(message.id);state.messages=unmatched}function turns(savedTurns=[]){const shown=[...savedTurns.map(turn=>{const message=state.messages.find(message=>message.status!==`accepted`&&turnMatchesOptimisticMessage(turn,message)&&(message.origin===`application`?turn.system:turn.user)?.receipt===false);if(!message)return turn;const pending=optimisticTurn(message);return{...turn,optimistic:pending.optimistic,...pending.system?{system:pending.system}:{}}})];for(const message of unmatchedOptimisticMessages(savedTurns,state.messages)){const turn=optimisticTurn(message);const later=message.status!==`failed`?-1:shown.findIndex(saved=>!saved.optimistic&&Date.parse((saved.user||saved.system)?.at||``)>message.createdAtMs);if(later<0)shown.push(turn);else shown.splice(later,0,turn)}return shown}function optimisticTurn(message){const role=message.origin===`application`?`system`:`user`;const authored={attachments:message.attachments,at:message.createdAt,messageId:message.id,role,text:message.text};const status=message.status===`uncertain`?{role:`system`,text:t$23(`jskit.assistant.delivery.notConfirmed`),delivery:{messageId:message.id,error:message.error,checking:message.checking===true}}:null;return{optimistic:{error:message.error,id:message.id,status:message.status,...message.status===`pending`&&message.waiting?{waiting:message.waiting}:{},...message.cancelling?{cancelling:true}:{},...message.cancelError?{cancelError:message.cancelError}:{}},turnId:message.id,[role]:authored,...status?{system:role===`system`?{...authored,...status,text:`${authored.text}\n\n${status.text}`}:status}:{}}}async function send(payload,{messageId=crypto.randomUUID(),deliver=defaultDeliver,isCurrent=()=>true,receiptTurns=null,onAccepted,uncertainOnError=false,queue=false}={}){if(state.sending&&!queue||pendingSends.has(messageId)||find(messageId)?.status===`uncertain`||find(messageId)?.cancelling||!normalizeText$1(payload?.message)&&!payload?.displayAttachments?.length)return false;if(typeof deliver!==`function`)throw new TypeError(`Message delivery requires a deliver function.`);const snapshot=JSON.parse(JSON.stringify(payload));const previous=find(messageId);const acknowledge=previous&&acceptanceCallbacks.get(toRaw(previous))||onAccepted;const ownerPendingSends=pendingSends;const current=()=>pendingSends===ownerPendingSends&&isCurrent();const predecessor=deliveryTail;const knownUncertain=new Set(state.messages.filter(entry=>entry.status===`uncertain`).map(entry=>entry.id));const settled=Promise.withResolvers();deliveryTail=settled.promise;ownerPendingSends.set(messageId,settled);const now=new Date;const message={attachments:snapshot.displayAttachments||[],createdAt:now.toISOString(),createdAtMs:now.getTime(),error:``,id:messageId,payload:snapshot,status:`pending`,text:String(snapshot.displayMessage||snapshot.message||``).trim()};if(typeof acknowledge===`function`)acceptanceCallbacks.set(message,acknowledge);state.messages=[...state.messages.filter(entry=>entry.id!==messageId),message];state.sending=true;let stopReceipt;try{if(predecessor)await predecessor;if(!current())return false;if(find(messageId)?.cancelling)return false;if(uncertainOnError&&state.messages.some(entry=>entry.id!==messageId&&entry.status===`uncertain`&&!knownUncertain.has(entry.id))){fail(messageId,t$23(`jskit.assistant.delivery.checkPrevious`));return false}let receipt;if(receiptTurns!==null){receipt=Promise.withResolvers();settled.receipt=receipt;stopReceipt=watch([current,()=>toValue(receiptTurns)],([isCurrent,turns])=>{if(!isCurrent)receipt.resolve(false);else if(turns?.some(turn=>turn.user?.messageId===messageId&&turn.user.receipt!==false))receipt.resolve({ok:true})},{immediate:true})}const submitted=deliver({...snapshot,messageId});const response=await(receipt?Promise.race([submitted,receipt.promise]):submitted);if(!current())return false;if(response===false||response?.ok===false)fail(messageId,response?.error||t$23(`jskit.assistant.delivery.notSent`),response?.status===`uncertain`?`uncertain`:`failed`);else accept(messageId);return response}catch(error){if(!current())return false;if(find(messageId)?.status===`accepted`)return{ok:true};fail(messageId,error,uncertainOnError||error?.status===`uncertain`?`uncertain`:`failed`);throw error}finally{stopReceipt?.();ownerPendingSends.delete(messageId);if(pendingSends===ownerPendingSends){state.sending=ownerPendingSends.size>0;if(!state.sending)deliveryTail=null}settled.resolve()}}function fail(messageId,error,status=`failed`){const message=find(messageId);if(message&&message.status!==`accepted`){const text=error&&typeof error===`object`?serverMessage$2(error):``;message.error=String(text||error?.message||error||t$23(`jskit.assistant.delivery.notSent`)).trim();message.status=status}}function accept(messageId){const message=find(messageId);if(message){message.status=`accepted`;message.error=``}pendingSends.get(messageId)?.receipt?.resolve({ok:true});if(message){const entry=toRaw(message);const acknowledge=acceptanceCallbacks.get(entry);acceptanceCallbacks.delete(entry);acknowledge?.()}}function wait(messageId,reason=``){const message=find(messageId);if(message?.status===`pending`)message.waiting=String(reason||``).trim()}function rejectUnsent(messageId,error){if(find(messageId)?.status!==`uncertain`)return false;fail(messageId,error);return true}function restoreUncertain(request,savedTurns=[]){const messageId=normalizeText$1(request?.messageId);if(!messageId||savedTurns.some(turn=>(turn.user||turn.system)?.messageId===messageId&&(turn.user||turn.system).receipt!==false)||find(messageId)?.status===`accepted`)return false;if(!find(messageId)){const payload=JSON.parse(JSON.stringify({message:request.text||``,displayAttachments:request.attachments||[]}));const createdAt=request.at||new Date().toISOString();state.messages=[...state.messages,{id:messageId,payload,text:payload.message,origin:request.origin,attachments:payload.displayAttachments,createdAt,createdAtMs:Date.parse(createdAt),status:`uncertain`,error:``}]}fail(messageId,(request.error?serverMessage$2({message:request.error,messageCode:request.errorMessageCode,messageParams:request.errorMessageParams}):``)||t$23(`jskit.assistant.delivery.unconfirmed`),`uncertain`);pendingSends.get(messageId)?.receipt?.resolve({ok:false,status:`uncertain`,error:request.error});return true}function cancel(messageId){const message=find(messageId);if(!message||message.status===`accepted`||message.cancelling)return false;message.cancelling=true;message.cancelError=``;return true}function cancelFailed(messageId,error=``){const message=find(messageId);if(!message)return;message.cancelling=false;message.cancelError=String(error||t$23(`jskit.assistant.delivery.cancelUnreachable`)).trim()}function edit(messageId,draft=``){const message=find(messageId);if(message?.status!==`failed`||message.cancelling)return null;remove(messageId);return draftWithRestoredMessage(message.text,draft)}function resend(messageId,{queue=false}={}){const message=find(messageId);if(message?.status!==`failed`)return false;return send(message.payload,{messageId,queue})}function reset(){deliveryTail=null;for(const pending of pendingSends.values()){pending.receipt?.resolve(false);pending.resolve()}pendingSends=new Map;state.messages=[];state.sending=false}return{accept,cancel,cancelFailed,edit,find,reconcile,remove,resend,reset,restoreUncertain,rejectUnsent,send,state,turns,wait}}function draftWithRestoredMessage(text=``,draft=``){return!draft||draft.startsWith(text)?draft||text:`${text}\n\n${draft}`}var IDLE_GESTURES=Object.freeze([`glance-left`,`tiny-nod`,`glance-right`,`brow-lift`,`glance-up`,`curious-tilt`,`smile-brighten`,`friendly-lean`,`shoulder-lift`,`earring-sway`]);var IDLE_MOUTH_POSES=Object.freeze({"tiny-nod":`warm-smile`,"curious-tilt":`warm-smile`,"smile-brighten":`smile`,"friendly-lean":`warm-smile`});var IDLE_GESTURE_DURATION_MS=1100;var LISTENING_EXPRESSIONS=Object.freeze([`attentive`,`tiny-nod`,`follow-left`,`tilt-left`,`follow-right`,`tilt-right`]);var LISTENING_MOUTH_POSES=Object.freeze({"attentive":`soft-smile`,"tiny-nod":`soft-smile`});var PRE_THINKING_EXPRESSIONS=Object.freeze([`settle`,`glance-left`,`center`,`glance-right`,`tiny-tilt`,`ready`]);var PRE_THINKING_MOUTH_POSES=Object.freeze({"ready":`soft-smile`,"tiny-tilt":`thoughtful`});var THINKING_EXPRESSIONS=Object.freeze([`look-up-left`,`focus`,`look-up-right`,`weigh-left`,`weigh-right`,`idea`]);var THINKING_MOUTH_POSES=Object.freeze({"idea":`soft-smile`,"weigh-left":`closed`,"weigh-right":`closed`});var ACTIVE_EXPRESSION_DURATION_MS=Object.freeze({listening:1350,"pre-thinking":1450,thinking:1700});var ACTIVE_EXPRESSION_SEQUENCES=Object.freeze({listening:LISTENING_EXPRESSIONS,"pre-thinking":PRE_THINKING_EXPRESSIONS,thinking:THINKING_EXPRESSIONS});function notFollowing(){}function useVoiceAvatar(props){const blinking=ref(false);const activeExpression=ref(``);const idleGesture=ref(``);const prefersReducedMotion=ref(false);const reducedMotion=computed(()=>props.still===true||prefersReducedMotion.value);let blinkTimer=0;let activeExpressionTimer=0;const activeExpressionIndexes={listening:Math.floor(Math.random()*LISTENING_EXPRESSIONS.length),"pre-thinking":Math.floor(Math.random()*PRE_THINKING_EXPRESSIONS.length),thinking:Math.floor(Math.random()*THINKING_EXPRESSIONS.length)};let idleGestureIndex=Math.floor(Math.random()*IDLE_GESTURES.length);let idleGestureTimer=0;let reopenTimer=0;let stopFollowingReducedMotion=notFollowing;const expression=computed(()=>String(props.state||`idle`));const visibleMouthPose=computed(()=>{if(expression.value===`idle`)return IDLE_MOUTH_POSES[idleGesture.value]||`soft-smile`;if(expression.value===`thinking`)return THINKING_MOUTH_POSES[activeExpression.value]||`thoughtful`;if(expression.value===`pre-thinking`)return PRE_THINKING_MOUTH_POSES[activeExpression.value]||`closed`;if(expression.value===`listening`)return LISTENING_MOUTH_POSES[activeExpression.value]||`closed`;if(expression.value!==`speaking`)return`closed`;const pose=String(props.mouthPose||`closed`);if(props.still===true||props.mouthLevel<.045||![`open`,`round`,`small`,`wide`].includes(pose))return`closed`;return pose});function clearBlinkTimers(){window.clearTimeout(blinkTimer);window.clearTimeout(reopenTimer);blinkTimer=0;reopenTimer=0}function clearIdleGesture(){window.clearTimeout(idleGestureTimer);idleGestureTimer=0;idleGesture.value=``}function clearActiveExpression(){window.clearTimeout(activeExpressionTimer);activeExpressionTimer=0;activeExpression.value=``}function scheduleBlink(delay=2800+Math.random()*3400){window.clearTimeout(blinkTimer);if(reducedMotion.value)return;blinkTimer=window.setTimeout(()=>{const doubleBlink=Math.random()<.16;blinking.value=true;reopenTimer=window.setTimeout(()=>{blinking.value=false;if(!doubleBlink){scheduleBlink();return}blinkTimer=window.setTimeout(()=>{blinking.value=true;reopenTimer=window.setTimeout(()=>{blinking.value=false;scheduleBlink()},115)},155)},135)},delay)}function scheduleIdleGesture(delay=2400+Math.random()*2800){window.clearTimeout(idleGestureTimer);if(reducedMotion.value||expression.value!==`idle`)return;idleGestureTimer=window.setTimeout(()=>{idleGesture.value=IDLE_GESTURES[idleGestureIndex];idleGestureIndex=(idleGestureIndex+1)%IDLE_GESTURES.length;idleGestureTimer=window.setTimeout(()=>{idleGesture.value=``;scheduleIdleGesture()},IDLE_GESTURE_DURATION_MS)},delay)}function showNextActiveExpression(){const state=expression.value;const sequence=ACTIVE_EXPRESSION_SEQUENCES[state]||[];if(!sequence.length){clearActiveExpression();return}const index=activeExpressionIndexes[state]||0;activeExpression.value=sequence[index];activeExpressionIndexes[state]=(index+1)%sequence.length;if(!reducedMotion.value)activeExpressionTimer=window.setTimeout(showNextActiveExpression,ACTIVE_EXPRESSION_DURATION_MS[state])}function restartMotion(){clearBlinkTimers();clearActiveExpression();clearIdleGesture();blinking.value=false;if(ACTIVE_EXPRESSION_SEQUENCES[expression.value])showNextActiveExpression();if(!reducedMotion.value){scheduleBlink();scheduleIdleGesture()}}function updateReducedMotion(event){prefersReducedMotion.value=Boolean(event.matches);restartMotion()}watch(()=>props.still===true,restartMotion);watch(expression,()=>{clearActiveExpression();clearIdleGesture();if(ACTIVE_EXPRESSION_SEQUENCES[expression.value])showNextActiveExpression();else if(!reducedMotion.value)scheduleIdleGesture(900+Math.random()*1200)});onMounted(()=>{const reducedMotionQuery=followMediaQuery$1(`(prefers-reduced-motion: reduce)`,updateReducedMotion);prefersReducedMotion.value=reducedMotionQuery.matches;stopFollowingReducedMotion=reducedMotionQuery.stop;if(!reducedMotion.value){scheduleBlink(1800+Math.random()*1800);scheduleIdleGesture(900+Math.random()*1500)}if(ACTIVE_EXPRESSION_SEQUENCES[expression.value])showNextActiveExpression()});onBeforeUnmount(()=>{clearBlinkTimers();clearActiveExpression();clearIdleGesture();stopFollowingReducedMotion();stopFollowingReducedMotion=notFollowing});return{blinking,activeExpression,idleGesture,expression,visibleMouthPose,reducedMotion}}var _hoisted_1$63=[`aria-label`];var _hoisted_2$53=[`cx`,`ry`];var _hoisted_3$46=[`rx`,`ry`];var _sfc_main$87={__name:`VoiceAvatar`,props:{state:{type:String,default:`idle`},mouthPose:{type:String,default:`closed`},mouthLevel:{type:Number,default:0},still:{type:Boolean,default:false}},setup(__props){const props=__props;const{blinking,visibleMouthPose,reducedMotion}=useVoiceAvatar(props);const{t}=useJskitText();const mouthHeight=computed(()=>reducedMotion.value||visibleMouthPose.value===`closed`?3:Math.max(4,Math.min(18,props.mouthLevel*28)));return(_ctx,_cache)=>{return openBlock(),createElementBlock(`svg`,{viewBox:`0 0 128 128`,"aria-label":unref(t)(`jskit.assistant.voice.avatar.label`),role:`img`,class:`voice-avatar`},[_cache[0]||(_cache[0]=createBaseVNode(`circle`,{cx:`64`,cy:`64`,r:`59`,fill:`currentColor`,opacity:`.1`},null,-1)),_cache[1]||(_cache[1]=createBaseVNode(`rect`,{x:`25`,y:`31`,width:`78`,height:`66`,rx:`24`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`},null,-1)),_cache[2]||(_cache[2]=createBaseVNode(`path`,{d:`M64 31V21`,stroke:`currentColor`,"stroke-width":`3`},null,-1)),_cache[3]||(_cache[3]=createBaseVNode(`circle`,{cx:`64`,cy:`18`,r:`4`,fill:`currentColor`},null,-1)),(openBlock(),createElementBlock(Fragment,null,renderList([47,81],x=>{return createBaseVNode(`ellipse`,{key:x,cx:x,cy:`55`,rx:`5`,ry:unref(blinking)?1:7,fill:`currentColor`},null,8,_hoisted_2$53)}),64)),createBaseVNode(`ellipse`,{cx:`64`,cy:`77`,rx:unref(visibleMouthPose)===`round`?6:15,ry:mouthHeight.value,fill:`currentColor`},null,8,_hoisted_3$46)],8,_hoisted_1$63)}}};var VoiceAvatar_default=_plugin_vue_export_helper_default(_sfc_main$87,[[`__scopeId`,`data-v-387d1d29`]]);function ignoreLauncherError(){}function useVoiceLauncher({open,enabled=true,onTap,onError=ignoreLauncherError}){const tappable=typeof onTap===`function`;const holding=ref(false);let input=null;let timer;let suppressClick=false;let revision=0;let session;function report(operation){Promise.resolve(operation).catch(onError)}function begin(identity,delay){suppressClick=false;input=identity;const expected=++revision;timer=setTimeout(()=>{holding.value=true;report((async()=>{const opened=await open();if(expected!==revision||!holding.value||!opened)return;session=opened;await session.startHeldRecording()})())},delay)}function pointerDown(event){if(!toValue(enabled)||event.button!==0||event.isPrimary===false||input!==null)return;event.currentTarget.setPointerCapture(event.pointerId);begin(event.pointerId,350)}function keyDown(event){if(!toValue(enabled)||event.repeat||input!==null||![` `,`Enter`].includes(event.key))return;begin(event.key,tappable?350:0)}function finish(discard){clearTimeout(timer);const keyboard=typeof input===`string`;input=null;++revision;if(!holding.value){if(!discard&&keyboard&&tappable)report(onTap());return}holding.value=false;suppressClick=true;if(session)report(discard?session.discardHeldRecording():session.finishHeldRecording());session=null}function pointerUp(event){if(event.pointerId===input)finish(false)}function keyUp(event){if(event.key===input)finish(false)}function cancel(event){if(event?.pointerId!==void 0&&event.pointerId!==input)return;finish(true)}function click(event){const suppressed=suppressClick&&event.detail!==0;suppressClick=false;if(suppressed){event.preventDefault();event.stopImmediatePropagation();return}if(toValue(enabled)&&tappable)report(onTap())}onScopeDispose(cancel);return{holding,pointerDown,pointerUp,keyDown,keyUp,cancel,click}}var _hoisted_1$62=[`disabled`];var _hoisted_2$52=[`disabled`];var _hoisted_3$45=[`title`];var _hoisted_4$37=[`aria-label`];var _hoisted_5$35={key:3,class:`assistant-voice-controls__status`,role:`status`};var _hoisted_6$30=[`aria-label`];var _hoisted_7$29={class:`assistant-voice__review-actions`};var _hoisted_8$27=[`disabled`,`aria-label`];var _hoisted_9$26={key:0,class:`assistant-voice-controls__stop`};var _hoisted_10$21={class:`assistant-voice__talk-action`};var _hoisted_11$19={key:0,class:`assistant-voice-controls__icon-disc`};var _hoisted_12$18={class:`assistant-voice-controls__icon-disc`};var _hoisted_13$17=[`id`];var _sfc_main$86={__name:`VoiceConversationControls`,props:{session:{type:Object,required:true},disabled:{type:Boolean,default:false},speakerDisabled:{type:Boolean,default:false},compact:{type:Boolean,default:false},iconOnly:{type:Boolean,default:false},reviewInTranscript:{type:Boolean,default:false},toolsTarget:{type:Object,default:null},feedbackTarget:{type:Object,default:null}},setup(__props){const props=__props;const{targetLabel,voice,error,microphoneMuted,live,starting,callMode,callStatus,speechActive,heldTranscript,capturing,pendingTranscript,pushHolding,sending,stopSpeech,startPushToTalk,finishPushToTalk,cancelPushToTalk,toggleHandsFree,readAloud,toggleReadAloud,enableSound,deliverTranscript,discardHeldRecording,editTranscript}=props.session;const{t}=useJskitText();const controlStatus=computed(()=>{if(props.iconOnly&&voice.listening.value&&!starting.value&&!error.value&&!voice.error.value)return``;if(!props.compact||!props.session.hasUnsentSpeech.value)return callStatus.value;if(pendingTranscript.value)return props.reviewInTranscript?``:t(`jskit.assistant.voice.controls.sendOrDiscard`);if(live.value&&callMode.value===`hands-free`&&voice.listening.value&&!microphoneMuted.value)return t(`jskit.assistant.voice.controls.listening`);return voice.listening.value?t(`jskit.assistant.voice.controls.recordingFinish`):t(`jskit.assistant.voice.controls.finishSpeech`)});const handsFreeListening=computed(()=>live.value&&callMode.value===`hands-free`&&voice.listening.value&&!microphoneMuted.value);const canTalk=computed(()=>!props.disabled&&(!capturing.value||voice.listening.value||pushHolding.value||starting.value));const talkLabel=computed(()=>t(starting.value?`jskit.assistant.voice.controls.connecting`:pushHolding.value?`jskit.assistant.voice.controls.releaseToSend`:handsFreeListening.value?`jskit.assistant.voice.controls.pause`:`jskit.assistant.voice.controls.talk`));const gestureHint=useId();const gesture=useVoiceLauncher({enabled:canTalk,open:()=>({startHeldRecording:startPushToTalk,finishHeldRecording:finishPushToTalk,discardHeldRecording:cancelPushToTalk}),onTap:toggleHandsFree,onError:cause=>{error.value=voiceErrorText(cause)}});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`fieldset`,{class:normalizeClass([`assistant-voice-controls`,{"assistant-voice-controls--compact":__props.compact}]),disabled:__props.disabled},[(openBlock(),createBlock(Teleport,{to:__props.feedbackTarget,disabled:!__props.feedbackTarget},[createBaseVNode(`fieldset`,{class:normalizeClass([`assistant-voice-controls__feedback`,{"assistant-voice-controls__feedback--compact":__props.compact}]),disabled:__props.disabled},[unref(error)||unref(voice).error.value?(openBlock(),createElementBlock(`p`,{key:0,class:normalizeClass([`assistant-voice__error`,{"text-body-small":__props.compact}]),role:`alert`},toDisplayString(unref(error)||unref(voice).error.value),3)):createCommentVNode(``,true),controlStatus.value?(openBlock(),createElementBlock(`p`,{key:1,class:`assistant-voice-controls__status text-body-small`,role:`status`,title:unref(callStatus)},toDisplayString(controlStatus.value),9,_hoisted_3$45)):createCommentVNode(``,true),__props.compact&&!__props.reviewInTranscript&&unref(heldTranscript)&&!unref(pendingTranscript)?(openBlock(),createElementBlock(`p`,{key:2,class:`assistant-voice-controls__provisional`,role:`status`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.recognizedWords`)},toDisplayString(unref(t)(`jskit.assistant.voice.controls.notSent`,{words:unref(heldTranscript)})),9,_hoisted_4$37)):createCommentVNode(``,true),unref(readAloud)&&unref(voice).playbackBlocked.value?(openBlock(),createElementBlock(`p`,_hoisted_5$35,toDisplayString(unref(t)(`jskit.assistant.voice.controls.soundBlocked`)),1)):createCommentVNode(``,true),unref(readAloud)&&unref(voice).playbackBlocked.value?(openBlock(),createBlock(VBtn,{key:4,"min-height":`48`,onClick:unref(enableSound)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.controls.enableSound`)),1)]),_:1},8,[`onClick`])):createCommentVNode(``,true),!__props.reviewInTranscript&&unref(pendingTranscript)&&(unref(pendingTranscript).reviewBeforeSend||!unref(sending))?(openBlock(),createElementBlock(`section`,{key:5,class:`assistant-voice__review`,"aria-label":unref(t)(`jskit.assistant.voice.controls.review`)},[createVNode(VTextarea,{class:`assistant-voice__review-input`,"model-value":unref(pendingTranscript).text,label:unref(t)(`jskit.assistant.voice.controls.reviewMessage`),disabled:unref(sending),density:__props.compact?`compact`:`default`,rows:__props.compact?1:2,"max-rows":__props.compact?2:3,"auto-grow":``,"hide-details":``,"onUpdate:modelValue":unref(editTranscript)},null,8,[`model-value`,`label`,`disabled`,`density`,`rows`,`max-rows`,`onUpdate:modelValue`]),createBaseVNode(`div`,_hoisted_7$29,[createVNode(VBtn,{disabled:unref(sending),"min-height":`48`,onClick:unref(discardHeldRecording)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.controls.discard`)),1)]),_:1},8,[`disabled`,`onClick`]),createVNode(VBtn,{disabled:unref(sending)||!unref(pendingTranscript).text.trim(),"min-height":`48`,color:`primary`,onClick:unref(deliverTranscript)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(sending)?unref(t)(`jskit.assistant.voice.controls.sending`):unref(t)(`jskit.assistant.voice.controls.send`)),1)]),_:1},8,[`disabled`,`onClick`])])],8,_hoisted_6$30)):createCommentVNode(``,true)],10,_hoisted_2$52)],8,[`to`,`disabled`])),(openBlock(),createBlock(Teleport,{to:__props.toolsTarget,disabled:!__props.toolsTarget},[createBaseVNode(`fieldset`,{class:normalizeClass([`assistant-voice-controls__tools`,{"assistant-voice-controls__tools--compact":__props.compact,"assistant-voice-controls__tools--icons":__props.iconOnly}]),disabled:__props.disabled,"aria-label":unref(t)(`jskit.assistant.voice.controls.label`,{target:unref(targetLabel)})},[__props.compact||__props.iconOnly||unref(speechActive)?(openBlock(),createElementBlock(`div`,_hoisted_9$26,[unref(speechActive)?(openBlock(),createBlock(VBtn,{key:0,icon:`$stop`,variant:`text`,"min-width":`48`,"min-height":`48`,"aria-label":unref(t)(`jskit.assistant.voice.controls.stopTargetSpeaking`,{target:unref(targetLabel)}),title:unref(t)(`jskit.assistant.voice.controls.stopSpeaking`),onClick:unref(stopSpeech)},null,8,[`aria-label`,`title`,`onClick`])):createCommentVNode(``,true)])):createCommentVNode(``,true),renderSlot(_ctx.$slots,`work-control`,{},void 0,true),createBaseVNode(`div`,_hoisted_10$21,[createVNode(VBtn,{class:`assistant-voice__talk`,color:`primary`,variant:__props.iconOnly?`text`:handsFreeListening.value?`tonal`:`flat`,"min-height":__props.iconOnly?44:__props.compact?48:64,rounded:`xl`,icon:__props.iconOnly?unref(voice).listening.value&&!unref(microphoneMuted)?`$mic`:`$micOff`:void 0,"prepend-icon":__props.iconOnly?void 0:unref(voice).listening.value&&!unref(microphoneMuted)?`$mic`:`$micOff`,"aria-label":__props.iconOnly?talkLabel.value:void 0,title:unref(t)(`jskit.assistant.voice.controls.talkHint`),"aria-pressed":handsFreeListening.value||unref(pushHolding),"aria-describedby":unref(gestureHint),disabled:!canTalk.value,slim:__props.compact||__props.iconOnly,width:__props.iconOnly?40:__props.compact?148:void 0,"min-width":__props.iconOnly?40:__props.compact?148:void 0,onPointerdown:unref(gesture).pointerDown,onPointerup:unref(gesture).pointerUp,onPointercancel:unref(gesture).cancel,onLostpointercapture:unref(gesture).cancel,onKeydown:[withKeys(withModifiers(unref(gesture).keyDown,[`prevent`]),[`space`]),withKeys(withModifiers(unref(gesture).keyDown,[`prevent`]),[`enter`])],onKeyup:[withKeys(withModifiers(unref(gesture).keyUp,[`prevent`]),[`space`]),withKeys(withModifiers(unref(gesture).keyUp,[`prevent`]),[`enter`])],onBlur:unref(gesture).cancel,onContextmenu:_cache[0]||(_cache[0]=withModifiers(()=>{},[`prevent`])),onClick:unref(gesture).click},{default:withCtx(()=>[__props.iconOnly?(openBlock(),createElementBlock(`span`,_hoisted_11$19,[createVNode(VIcon,{size:`20`,icon:unref(voice).listening.value&&!unref(microphoneMuted)?`$mic`:`$micOff`},null,8,[`icon`])])):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(talkLabel.value),1)],64))]),_:1},8,[`variant`,`min-height`,`icon`,`prepend-icon`,`aria-label`,`title`,`aria-pressed`,`aria-describedby`,`disabled`,`slim`,`width`,`min-width`,`onPointerdown`,`onPointerup`,`onPointercancel`,`onLostpointercapture`,`onKeydown`,`onKeyup`,`onBlur`,`onClick`]),createVNode(VBtn,{icon:unref(readAloud)?`$volumeHigh`:`$volumeOff`,"aria-pressed":unref(readAloud),variant:__props.iconOnly?`text`:`tonal`,color:__props.iconOnly?`primary`:void 0,"min-height":__props.iconOnly?44:__props.compact?48:64,width:__props.iconOnly?40:void 0,"min-width":__props.iconOnly?40:__props.compact?48:64,rounded:`xl`,"aria-label":unref(readAloud)?unref(t)(`jskit.assistant.voice.controls.readAloudOff`,{target:unref(targetLabel)}):unref(t)(`jskit.assistant.voice.controls.readAloudOn`,{target:unref(targetLabel)}),title:unref(readAloud)?unref(t)(`jskit.assistant.voice.controls.spokenRepliesOn`):unref(t)(`jskit.assistant.voice.controls.spokenRepliesOff`),disabled:__props.speakerDisabled||__props.session.readAloudChangePending.value,onClick:unref(toggleReadAloud)},createSlots({_:2},[__props.iconOnly?{name:`default`,fn:withCtx(()=>[createBaseVNode(`span`,_hoisted_12$18,[createVNode(VIcon,{size:`20`,icon:unref(readAloud)?`$volumeHigh`:`$volumeOff`},null,8,[`icon`])])]),key:`0`}:void 0]),1032,[`icon`,`aria-pressed`,`variant`,`color`,`min-height`,`width`,`min-width`,`aria-label`,`title`,`disabled`,`onClick`]),renderSlot(_ctx.$slots,`settings-control`,{},void 0,true),createBaseVNode(`p`,{id:unref(gestureHint),class:`text-body-small on-surface-variant`},toDisplayString(handsFreeListening.value?unref(t)(`jskit.assistant.voice.controls.tapToPause`):unref(t)(`jskit.assistant.voice.controls.tapForHandsFree`)),9,_hoisted_13$17)])],10,_hoisted_8$27)],8,[`to`,`disabled`]))],10,_hoisted_1$62)}}};var VoiceConversationControls_default=_plugin_vue_export_helper_default(_sfc_main$86,[[`__scopeId`,`data-v-e07aa2e4`]]);var _hoisted_1$61=[`disabled`];var _hoisted_2$51=[`aria-label`,`title`];var _hoisted_3$44=[`aria-label`,`title`];var _hoisted_4$36=[`disabled`];var _hoisted_5$34=[`aria-label`];var _hoisted_6$29={key:0,class:`assistant-voice__call-body`};var _hoisted_7$28=[`aria-label`];var _hoisted_8$26=[`aria-label`];var _hoisted_9$25={class:`text-label-medium`};var _hoisted_10$20={class:`assistant-voice__caption-text text-body-medium`};var _hoisted_11$18=[`aria-label`];var _hoisted_12$17={class:`text-label-medium`};var _hoisted_13$16={class:`assistant-voice__caption-text text-body-medium`};var _sfc_main$85={__name:`VoiceConversation`,props:{session:{type:Object,required:true},disabled:{type:Boolean,default:false},adapter:{type:Object,default:null},showAvatar:{type:Boolean,default:true},avatarSize:{type:String,default:`compact`}},emits:[`update:avatarSize`],setup(__props){const props=__props;const{t}=useJskitText();const{targetLabel,voice,microphoneMuted,heldTranscript,pendingTranscript,sending,avatarVisual,callAudioLevel,voiceWords,voiceAnswer}=props.session;const presentationAdapter=computed(()=>props.adapter&&{...props.adapter,composer:{...props.adapter.composer,canSend:props.adapter.composer?.canSend&&!props.session.composerBlocked.value}});const toolsTarget=ref(null);const voiceWordsTarget=ref(null);const voiceAnswerTarget=ref(null);const followWords=ref(true);const followAnswer=ref(true);const youLabel=computed(()=>{if(heldTranscript.value&&voice.listening.value&&!microphoneMuted.value)return t(`jskit.assistant.voice.conversation.youHearing`);if(pendingTranscript.value&&!sending.value)return t(`jskit.assistant.voice.conversation.youNotSent`);return t(`jskit.assistant.voice.conversation.you`)});function isAtBottom(element){return element.scrollHeight-element.scrollTop-element.clientHeight<24}function followCaption(target,following){if(target.value&&following.value)target.value.scrollTop=target.value.scrollHeight}watch(voiceWords,()=>followCaption(voiceWordsTarget,followWords),{flush:`post`});watch(voiceAnswer,()=>followCaption(voiceAnswerTarget,followAnswer),{flush:`post`});return(_ctx,_cache)=>{return __props.adapter?(openBlock(),createElementBlock(`fieldset`,{key:0,class:`assistant-voice-conversation`,disabled:__props.disabled},[createVNode(unref(AssistantConversationElement_default),{adapter:presentationAdapter.value,"avatar-size":__props.avatarSize,"onUpdate:avatarSize":_cache[0]||(_cache[0]=$event=>_ctx.$emit(`update:avatarSize`,$event))},createSlots({"avatar-control":withCtx(scope=>[renderSlot(_ctx.$slots,`avatar-control`,normalizeProps(guardReactiveProps(scope)),()=>[scope.size===`hidden`&&unref(voice).listening.value&&!unref(microphoneMuted)?(openBlock(),createElementBlock(`span`,{key:0,role:`img`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.listening`),title:unref(t)(`jskit.assistant.voice.conversation.listening`)},[createVNode(VIcon,{icon:`$mic`,size:`20`,"aria-hidden":`true`})],8,_hoisted_2$51)):createCommentVNode(``,true),scope.size===`hidden`&&unref(voice).speaking.value?(openBlock(),createElementBlock(`span`,{key:1,role:`img`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.speaking`),title:unref(t)(`jskit.assistant.voice.conversation.speaking`)},[createVNode(VIcon,{icon:`$volumeHigh`,size:`20`,"aria-hidden":`true`})],8,_hoisted_3$44)):createCommentVNode(``,true)],true)]),"composer-feedback":withCtx(()=>[createVNode(VoiceConversationControls_default,{session:__props.session,disabled:__props.disabled,compact:``,"icon-only":__props.showAvatar,"tools-target":toolsTarget.value,"review-in-transcript":Boolean(presentationAdapter.value?.conversation?.previewMessage)},{"work-control":withCtx(()=>[renderSlot(_ctx.$slots,`work-control`,{},void 0,true)]),"settings-control":withCtx(()=>[renderSlot(_ctx.$slots,`settings-control`,{},void 0,true)]),_:3},8,[`session`,`disabled`,`icon-only`,`tools-target`,`review-in-transcript`])]),_:2},[__props.showAvatar?{name:`avatar`,fn:withCtx(size=>[renderSlot(_ctx.$slots,`avatar`,mergeProps(unref(avatarVisual),{size:size.size,height:size.height}),()=>[createVNode(VoiceAvatar_default,normalizeProps(guardReactiveProps(unref(avatarVisual))),null,16)],true)]),key:`0`}:void 0,__props.showAvatar?{name:`avatar-tools`,fn:withCtx(()=>[createBaseVNode(`div`,{ref_key:`toolsTarget`,ref:toolsTarget,class:`assistant-voice-conversation__tools`},null,512)]),key:`1`}:void 0]),1032,[`adapter`,`avatar-size`])],8,_hoisted_1$61)):(openBlock(),createElementBlock(`fieldset`,{key:1,class:`assistant-voice`,disabled:__props.disabled},[createBaseVNode(`section`,{class:normalizeClass([`assistant-voice__call`,{"assistant-voice__call--without-avatar":!__props.showAvatar}]),"aria-label":unref(t)(`jskit.assistant.voice.controls.label`,{target:unref(targetLabel)})},[__props.showAvatar?(openBlock(),createElementBlock(`div`,_hoisted_6$29,[createBaseVNode(`div`,{class:`assistant-voice__call-portrait`,style:normalizeStyle({"--call-audio-scale":1+unref(callAudioLevel)*.16}),"aria-hidden":`true`},[renderSlot(_ctx.$slots,`avatar`,normalizeProps(guardReactiveProps(unref(avatarVisual))),()=>[createVNode(VoiceAvatar_default,normalizeProps(guardReactiveProps(unref(avatarVisual))),null,16)],true)],4)])):createCommentVNode(``,true),createBaseVNode(`div`,{class:`assistant-voice__captions`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.captions`)},[createBaseVNode(`section`,{ref_key:`voiceWordsTarget`,ref:voiceWordsTarget,class:`assistant-voice__caption`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.recognizedWords`),tabindex:`0`,onScroll:_cache[1]||(_cache[1]=$event=>followWords.value=isAtBottom($event.currentTarget))},[createBaseVNode(`strong`,_hoisted_9$25,toDisplayString(youLabel.value),1),createBaseVNode(`p`,_hoisted_10$20,toDisplayString(unref(voiceWords)),1)],40,_hoisted_8$26),createBaseVNode(`section`,{ref_key:`voiceAnswerTarget`,ref:voiceAnswerTarget,class:`assistant-voice__caption`,"aria-label":unref(t)(`jskit.assistant.voice.conversation.latestAnswer`,{target:unref(targetLabel)}),tabindex:`0`,onScroll:_cache[2]||(_cache[2]=$event=>followAnswer.value=isAtBottom($event.currentTarget))},[createBaseVNode(`strong`,_hoisted_12$17,toDisplayString(unref(targetLabel)),1),createBaseVNode(`p`,_hoisted_13$16,toDisplayString(unref(voiceAnswer)),1)],40,_hoisted_11$18)],8,_hoisted_7$28),createVNode(VoiceConversationControls_default,{session:__props.session,disabled:__props.disabled},{"work-control":withCtx(()=>[renderSlot(_ctx.$slots,`work-control`,{},void 0,true)]),"settings-control":withCtx(()=>[renderSlot(_ctx.$slots,`settings-control`,{},void 0,true)]),_:3},8,[`session`,`disabled`])],10,_hoisted_5$34)],8,_hoisted_4$36))}}};var VoiceConversation_default=_plugin_vue_export_helper_default(_sfc_main$85,[[`__scopeId`,`data-v-d87ffb3d`]]);var _sfc_main$84={__name:`VoiceSpeakingVoiceSelect`,props:{voice:{type:Object,required:true}},setup(__props){const{t}=useJskitText();const props=__props;function selectVoice(value){const selectedVoice=props.voice.selectedVoice;selectedVoice.value=value}return(_ctx,_cache)=>{return openBlock(),createBlock(VSelect,{"model-value":__props.voice.selectedVoice.value,"onUpdate:modelValue":selectVoice,items:__props.voice.availableVoices.value,"item-title":`label`,"item-value":`id`,disabled:__props.voice.availableVoices.value.length<2,label:unref(t)(`jskit.assistant.voice.settings.speakingVoice`),density:`comfortable`,hint:unref(t)(`jskit.assistant.voice.settings.speakingVoiceHint`),"persistent-hint":``},null,8,[`model-value`,`items`,`disabled`,`label`,`hint`])}}};var _hoisted_1$60={class:`voice-settings__disc`};var _sfc_main$83={__name:`VoiceConversationSettings`,props:{voice:{type:Object,default:null},compact:Boolean},emits:[`error`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const{t}=useJskitText();const slots=useSlots();async function openSettings(open){if(!open||slots.default||!props.voice)return;try{await props.voice.connect()}catch(error){emit(`error`,error)}}return(_ctx,_cache)=>{return openBlock(),createBlock(VMenu,{"close-on-content-click":false,location:`bottom end`,"onUpdate:modelValue":openSettings},{activator:withCtx(({props:settingsButton})=>[createVNode(VBtn,mergeProps(settingsButton,{icon:`$settings`,variant:`text`,color:__props.compact?`primary`:void 0,width:__props.compact?40:void 0,"min-width":__props.compact?40:48,"min-height":__props.compact?44:48,disabled:!__props.voice&&!_ctx.$slots.default,"aria-label":unref(t)(`jskit.assistant.voice.settings.title`),title:unref(t)(`jskit.assistant.voice.settings.title`)}),createSlots({_:2},[__props.compact?{name:`default`,fn:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$60,[createVNode(VIcon,{size:`20`,icon:`$settings`})])]),key:`0`}:void 0]),1040,[`color`,`width`,`min-width`,`min-height`,`disabled`,`aria-label`,`title`])]),default:withCtx(()=>[createVNode(VCard,{class:`voice-settings__menu`,role:`region`,"aria-label":unref(t)(`jskit.assistant.voice.settings.title`)},{default:withCtx(()=>[createVNode(VCardText,null,{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{voice:__props.voice},()=>[__props.voice?(openBlock(),createBlock(_sfc_main$84,{key:0,voice:__props.voice},null,8,[`voice`])):createCommentVNode(``,true)],true)]),_:3})]),_:3},8,[`aria-label`])]),_:3})}}};var VoiceConversationSettings_default=_plugin_vue_export_helper_default(_sfc_main$83,[[`__scopeId`,`data-v-eb91f970`]]);var _hoisted_1$59={class:`voice-host__switch-actions`};var _hoisted_2$50={class:`voice-host__body`};var _sfc_main$82={__name:`VoiceConversationHost`,props:{controller:{type:Object,required:true},activator:{type:Object,default:null},avatarSize:{type:String,default:`hidden`},presentation:{type:String,default:`dialog`,validator:value=>[`dialog`,`inline`].includes(value)}},emits:[`update:avatarSize`],setup(__props){const props=__props;const{t}=useJskitText();const state=props.controller.state;async function invoke(operation){try{await operation()}catch(error){state.error=voiceErrorText(error)}}async function openText(){const opening=state.binding.openText();props.controller.minimize();try{await opening}catch(error){props.controller.reveal();throw error}}return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[unref(state).session?(openBlock(),createBlock(ConversationDialog_default,{key:0,"model-value":unref(state).visible,activator:__props.activator,presentation:__props.presentation,title:unref(state).binding.label||unref(t)(`jskit.assistant.voice.assistant`),mode:`talk`,"show-modes":Boolean(unref(state).binding.openText&&!unref(state).binding.adapter),minimizable:__props.presentation===`dialog`,"close-label":unref(t)(`jskit.assistant.voice.host.close`),onMinimize:_cache[7]||(_cache[7]=$event=>__props.controller.minimize()),"onUpdate:modelValue":_cache[8]||(_cache[8]=$event=>invoke(()=>__props.controller.end({discard:true}))),"onUpdate:mode":_cache[9]||(_cache[9]=value=>value===`text`&&invoke(openText))},createSlots({default:withCtx(()=>[unref(state).error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,density:`compact`,role:`alert`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(state).error),1)]),_:1})):createCommentVNode(``,true),unref(state).nextTarget?(openBlock(),createBlock(VAlert,{key:1,type:`info`,class:`voice-host__switch`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.switchPrompt`,{current:unref(state).binding.label||unref(t)(`jskit.assistant.voice.host.thisConversation`),next:unref(state).nextTarget.label||unref(t)(`jskit.assistant.voice.host.anotherConversation`)}))+` `,1),createBaseVNode(`div`,_hoisted_1$59,[createVNode(VBtn,{variant:`text`,onClick:_cache[1]||(_cache[1]=$event=>__props.controller.cancelSwitch())},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.stayHere`)),1)]),_:1}),createVNode(VBtn,{disabled:unref(state).busy||unref(state).session.sending.value,variant:`text`,onClick:_cache[2]||(_cache[2]=$event=>invoke(()=>__props.controller.switchTarget({discard:true})))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.discardAndSwitch`)),1)]),_:1},8,[`disabled`]),!unref(state).session.hasUnsentSpeech.value?(openBlock(),createBlock(VBtn,{key:0,disabled:unref(state).busy,variant:`text`,onClick:_cache[3]||(_cache[3]=$event=>invoke(()=>__props.controller.switchTarget()))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.switch`)),1)]),_:1},8,[`disabled`])):createCommentVNode(``,true)])]),_:1})):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$50,[renderSlot(_ctx.$slots,`conversation`,{binding:unref(state).binding,session:unref(state).session,disabled:unref(state).busy},()=>[(openBlock(),createBlock(VoiceConversation_default,{key:unref(state).binding.id,session:unref(state).session,disabled:unref(state).busy,adapter:unref(state).binding.adapter||null,"show-avatar":unref(state).binding.showAvatar!==false,"avatar-size":__props.avatarSize,"onUpdate:avatarSize":_cache[6]||(_cache[6]=$event=>_ctx.$emit(`update:avatarSize`,$event))},createSlots({"work-control":withCtx(()=>[unref(state).binding.cancelWork&&unref(state).binding.state.status===`working`?(openBlock(),createBlock(VBtn,{key:0,disabled:unref(state).busy,icon:`$stop`,variant:`text`,"aria-label":unref(t)(`jskit.assistant.voice.host.stopWork`),title:unref(t)(`jskit.assistant.voice.host.stopWork`),onClick:_cache[5]||(_cache[5]=$event=>invoke(unref(state).binding.cancelWork))},null,8,[`disabled`,`aria-label`,`title`])):createCommentVNode(``,true)]),_:2},[_ctx.$slots.avatar?{name:`avatar`,fn:withCtx(visual=>[renderSlot(_ctx.$slots,`avatar`,mergeProps(visual,{binding:unref(state).binding}),void 0,true)]),key:`0`}:void 0,_ctx.$slots[`avatar-control`]?{name:`avatar-control`,fn:withCtx(scope=>[renderSlot(_ctx.$slots,`avatar-control`,mergeProps(scope,{binding:unref(state).binding,session:unref(state).session}),void 0,true)]),key:`1`}:void 0,__props.presentation===`inline`||unref(state).binding.adapter?{name:`settings-control`,fn:withCtx(()=>[createVNode(VoiceConversationSettings_default,{voice:unref(state).session.voice,compact:``,onError:_cache[4]||(_cache[4]=$event=>unref(state).error=unref(voiceErrorText)($event))},createSlots({_:2},[_ctx.$slots.settings?{name:`default`,fn:withCtx(settings=>[renderSlot(_ctx.$slots,`settings`,normalizeProps(guardReactiveProps(settings)),void 0,true)]),key:`0`}:void 0]),1032,[`voice`])]),key:`2`}:void 0]),1032,[`session`,`disabled`,`adapter`,`show-avatar`,`avatar-size`]))],true)])]),_:2},[!unref(state).binding.adapter?{name:`header-actions`,fn:withCtx(()=>[createVNode(VoiceConversationSettings_default,{voice:unref(state).session.voice,onError:_cache[0]||(_cache[0]=$event=>unref(state).error=unref(voiceErrorText)($event))},createSlots({_:2},[_ctx.$slots.settings?{name:`default`,fn:withCtx(settings=>[renderSlot(_ctx.$slots,`settings`,normalizeProps(guardReactiveProps(settings)),void 0,true)]),key:`0`}:void 0]),1032,[`voice`])]),key:`0`}:void 0]),1032,[`model-value`,`activator`,`presentation`,`title`,`show-modes`,`minimizable`,`close-label`])):createCommentVNode(``,true),__props.presentation===`dialog`&&unref(state).session&&!unref(state).visible?(openBlock(),createElementBlock(Fragment,{key:1},[_ctx.$slots.reopen?renderSlot(_ctx.$slots,`reopen`,{controller:__props.controller},void 0,true,0):(openBlock(),createBlock(VBtn,{key:1,class:`voice-host__reopen`,color:`primary`,"prepend-icon":`$headsetMic`,"min-height":`56`,onClick:_cache[10]||(_cache[10]=$event=>__props.controller.reveal())},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.assistant.voice.host.reopen`,{label:unref(state).binding.label||unref(t)(`jskit.assistant.voice.assistant`)})),1)]),_:1}))],64)):createCommentVNode(``,true)],64)}}};var VoiceConversationHost_default=_plugin_vue_export_helper_default(_sfc_main$82,[[`__scopeId`,`data-v-316a6c97`]]);var VIBE64_VOICE_KEY=Symbol.for(`vibe64.voice`);function useVibe64Voice(){return inject$1(VIBE64_VOICE_KEY)}var _sfc_main$81={__name:`Vibe64VoiceHost`,props:{preferences:{type:Object,default:()=>({})},preparePreferences:{type:Function,default:null}},emits:[`read-aloud-change`,`avatar-visibility-change`,`playback`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const controller=createVoiceConversationController({connectSpeech(binding){if(!binding.prepareVoice)return binding.socketUrl;return binding.prepareVoice().then(()=>binding.socketUrl)}});const launcher=shallowRef(null);const slots=useSlots();const Avatar=visual=>slots.avatar(visual);const Settings=settings=>slots.settings(settings);function preferencesFor(conversation){return props.preferences[conversation.preferenceTarget]||{}}function readAloudFor(conversation){const value=preferencesFor(conversation).readAloud;return typeof value===`boolean`?value:conversation.defaults?.readAloud===true}function readAloudChangePendingFor(conversation){return preferencesFor(conversation).isSaving===true}function avatarVisibleFor(target){const preferences=props.preferences[target];return preferences?preferences.avatarVisible!==false:null}function setAvatarVisible(target,visible){const current=avatarVisibleFor(target);if(current===null||current===visible)return;emit(`avatar-visibility-change`,visible,{target,actorKey:props.preferences.actorKey})}provide(VIBE64_VOICE_KEY,{controller,launcher,readAloudFor,readAloudChangePendingFor,avatarVisibleFor,setAvatarVisible,Avatar:slots.avatar?Avatar:null,Settings:slots.settings?Settings:null,open(conversation){let actorKey=props.preferences.actorKey;return controller.open({conversation:{...conversation,...props.preparePreferences?{async prepareVoice(){actorKey=await props.preparePreferences(conversation.preferenceTarget);if(!actorKey||props.preferences.actorKey!==actorKey||conversation.available===false)throw new Error(`This conversation is no longer available for voice.`);await conversation.prepareVoice?.();if(props.preferences.actorKey!==actorKey||conversation.available===false)throw new Error(`This conversation is no longer available for voice.`)}}:{},get state(){return conversation.state},get available(){return conversation.available},get label(){return conversation.label},get adapter(){return conversation.adapter},get onTranscript(){return conversation.onTranscript},get presentation(){return conversation.presentation},get readAloudChangePending(){return readAloudChangePendingFor(conversation)},get narration(){const narration=conversation.narration;if(!narration)return narration;const preferences=conversation.preferenceTarget===`coding`?preferencesFor(conversation):{};return{...narration,vocalizeThinking:typeof preferences.vocalizeThinking===`boolean`?preferences.vocalizeThinking:narration.vocalizeThinking,vocalizeInterimTurns:typeof preferences.vocalizeInterimTurns===`boolean`?preferences.vocalizeInterimTurns:narration.vocalizeInterimTurns,thinkingSounds:typeof preferences.thinkingSounds===`boolean`?preferences.thinkingSounds:narration.thinkingSounds}},get defaults(){const preferences=preferencesFor(conversation);return{...conversation.defaults,readAloud:readAloudFor(conversation),...preferences.sendMode===`edit`?{reviewBeforeSend:true}:{},...preferences.voice?{voiceId:preferences.voice===`current`?``:preferences.voice}:{}}},onReadAloudChange(value){emit(`read-aloud-change`,value,{target:conversation.preferenceTarget,actorKey});return conversation.onReadAloudChange?.(value)},onPlayback(event){emit(`playback`,event);return conversation.onPlayback?.(event)},get avatar(){return preferencesFor(conversation).avatar||conversation.avatar}}})}});onScopeDispose(()=>{controller.dispose()});return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[renderSlot(_ctx.$slots,`default`,{},void 0,true),unref(controller).state.binding?.presentation!==`inline`||unref(controller).state.nextTarget?(openBlock(),createBlock(unref(VoiceConversationHost_default),{key:0,controller:unref(controller),activator:launcher.value},createSlots({reopen:withCtx(()=>[]),_:2},[unref(controller).state.binding?.setConversationTarget?{name:`conversation`,fn:withCtx(({binding})=>[createBaseVNode(`div`,{ref:binding.setConversationTarget,class:`vibe64-voice-host__conversation`},null,512)]),key:`0`}:void 0,_ctx.$slots.settings?{name:`settings`,fn:withCtx(settings=>[renderSlot(_ctx.$slots,`settings`,mergeProps(settings,{binding:unref(controller).state.binding}),void 0,true)]),key:`1`}:void 0,_ctx.$slots.avatar?{name:`avatar`,fn:withCtx(visual=>[renderSlot(_ctx.$slots,`avatar`,mergeProps(visual,{binding:unref(controller).state.binding}),void 0,true)]),key:`2`}:void 0]),1032,[`controller`,`activator`])):createCommentVNode(``,true)],64)}}};var Vibe64VoiceHost_default=_plugin_vue_export_helper_default(_sfc_main$81,[[`__scopeId`,`data-v-3dec9644`]]);var mercAvatar=Object.freeze({shirt:`#72777c`,blouseNecklineStroke:`#e8c9dd`,blouseBow:`#dca4c8`,blouseBowStroke:`#5e466f`,face:`#f1c7a3`,neck:`#e6b18d`,hair:`#d2a13a`,hairFringe:`#e2b84e`,hairLockStroke:`#f5d978`,hairSwoopsStroke:`#f6ce63`,browStroke:`#8b6528`,eyeWhite:`#fffaf4`,eyelinerStroke:`#765021`,iris:`#5c3829`,pupil:`#241815`,teeth:`#fffaf0`,noseStroke:`#c4826e`,cheek:`#ed9993`,mouthInside:`#592d35`,tongue:`#c96870`,lipStroke:`#873f49`,lipLightStroke:`#984d55`,earringStroke:`#d7b76e`,earringDrop:`#dca4c8`,earringDropStroke:`#a77b42`});var mercBlueMangaAvatar=Object.freeze({shirt:`#72777c`,blondGirlShirt:`#f4f1e7`,ink:`#24252b`,undershirt:`#d63a39`,hood:`#c9d329`,hoodShadow:`#aebb24`,jacketPanel:`#f8f7f0`,shirtNecklineStroke:`#f7f4eb`,face:`#e2a06f`,neck:`#d78d60`,hair:`#237fbd`,blondGirlHairStroke:`#22242b`,hairLockStroke:`#4fa6d7`,hairSwoopsStroke:`#67add6`,browStroke:`#8b6528`,eyeWhite:`#fffaf4`,blondGirlEyeWhite:`#fffef7`,iris:`#2f3136`,pupil:`#0e0f12`,teeth:`#fffaf0`,noseStroke:`#c4826e`,cheek:`#ed9993`,blondGirlCheek:`#df865e`,mouthInside:`#292227`,tongue:`#e94e44`,lipStroke:`#873f49`,lipLightStroke:`#984d55`,earringStroke:`#d7b76e`,earringDrop:`#dca4c8`,earringDropStroke:`#a77b42`});var _hoisted_1$58={class:`merc-avatar__head-gesture`};var _hoisted_2$49={class:`merc-avatar__head`};var _hoisted_3$43={transform:`translate(35 34) scale(.78)`};var _hoisted_4$35={class:`merc-avatar__mouth`};var _hoisted_5$33={key:0,class:`merc-avatar__mouth-pose`};var _hoisted_6$28={key:1,class:`merc-avatar__mouth-pose`};var _hoisted_7$27={key:2,class:`merc-avatar__mouth-pose`};var _hoisted_8$25={key:3,class:`merc-avatar__mouth-pose`};var _hoisted_9$24={key:4,class:`merc-avatar__mouth-pose`};var _hoisted_10$19={key:5,class:`merc-avatar__lip`,d:`M140 190q20 7 40 0`};var _hoisted_11$17={key:6,class:`merc-avatar__lip`,d:`M141 191q19 3 38 0`};var _hoisted_12$16={key:7,class:`merc-avatar__lip`,d:`M142 191q17-3 36 1`};var _hoisted_13$15={key:8,class:`merc-avatar__lip`,d:`M141 191q19 1 38 0`};var _sfc_main$80={__name:`MercBlueMangaIllustratedAvatar`,props:{mouthLevel:{default:0,type:Number},mouthPose:{default:`closed`,type:String},state:{default:`idle`,type:String},still:{default:false,type:Boolean}},setup(__props){useCssVars(_ctx=>({"v00866ff0":unref(mercBlueMangaAvatar).shirt,"v4cabef4d":unref(mercBlueMangaAvatar).blondGirlShirt,"v110c4e78":unref(mercBlueMangaAvatar).ink,"v7ad9534c":unref(mercBlueMangaAvatar).undershirt,"v107d10ca":unref(mercBlueMangaAvatar).hood,"v98b592ec":unref(mercBlueMangaAvatar).hoodShadow,"v3e733668":unref(mercBlueMangaAvatar).jacketPanel,"v16070f13":unref(mercBlueMangaAvatar).shirtNecklineStroke,"v107bf20b":unref(mercBlueMangaAvatar).face,"v107fa40d":unref(mercBlueMangaAvatar).neck,"v107cdb90":unref(mercBlueMangaAvatar).hair,"fdd0247a":unref(mercBlueMangaAvatar).blondGirlHairStroke,"v91e2421a":unref(mercBlueMangaAvatar).hairLockStroke,"v2b56890f":unref(mercBlueMangaAvatar).hairSwoopsStroke,"b6fd8084":unref(mercBlueMangaAvatar).browStroke,"v3e579d26":unref(mercBlueMangaAvatar).eyeWhite,"v28e273c1":unref(mercBlueMangaAvatar).blondGirlEyeWhite,"v107d8fc1":unref(mercBlueMangaAvatar).iris,"v00cef900":unref(mercBlueMangaAvatar).pupil,"v006d18cc":unref(mercBlueMangaAvatar).teeth,"v4279c919":unref(mercBlueMangaAvatar).noseStroke,"v02498150":unref(mercBlueMangaAvatar).cheek,"v4bca669d":unref(mercBlueMangaAvatar).blondGirlCheek,"v783de796":unref(mercBlueMangaAvatar).mouthInside,"v0c14599c":unref(mercBlueMangaAvatar).tongue,"v5c268bbd":unref(mercBlueMangaAvatar).lipStroke,"v8798f6ee":unref(mercBlueMangaAvatar).lipLightStroke,"v8f6d3720":unref(mercBlueMangaAvatar).earringStroke,"b08d69b2":unref(mercBlueMangaAvatar).earringDrop,"v4fa2743f":unref(mercBlueMangaAvatar).earringDropStroke}));const{blinking,activeExpression,idleGesture,expression,visibleMouthPose}=useVoiceAvatar(__props);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`svg`,{"aria-label":`Illustrated blue-haired manga girl AI avatar of Merc`,class:normalizeClass([`merc-avatar merc-avatar--blond-girl`,[`merc-avatar--${unref(expression)}`,`merc-avatar--mouth-${unref(visibleMouthPose)}`,unref(idleGesture)?`merc-avatar--gesture-${unref(idleGesture)}`:``,unref(activeExpression)?`merc-avatar--${unref(expression)}-${unref(activeExpression)}`:``,{"merc-avatar--blinking":unref(blinking),"merc-avatar--still":__props.still}]]),role:`img`,viewBox:`0 0 320 320`,xmlns:`http://www.w3.org/2000/svg`},[_cache[10]||(_cache[10]=createStaticVNode(`<g class="merc-avatar__body" data-v-534752c9><path class="merc-avatar__shirt" d="M48 320c5-36 24-62 59-78 15-7 32-11 53-11s38 4 53 11c35 16 54 42 59 78H48Z" data-v-534752c9></path><path class="merc-avatar__undershirt" d="M119 251c12 11 26 17 41 17s29-6 41-17l17 69H102l17-69Z" data-v-534752c9></path><path class="merc-avatar__neck" d="M138 203h44v48c-7 13-37 13-44 0v-48Z" data-v-534752c9></path><path class="merc-avatar__hood" d="M92 246c15-9 29-14 45-16l23 28 23-28c16 2 30 7 45 16l-16 48-35-26-17 23-17-23-35 26-16-48Z" data-v-534752c9></path><path class="merc-avatar__hood-shadow" d="M103 252c13 5 26 13 40 24l17-18 17 18c14-11 27-19 40-24-9 17-18 29-28 39l-29-19-29 19c-10-10-19-22-28-39Z" data-v-534752c9></path><path class="merc-avatar__jacket-panel" d="M48 320c4-29 17-52 39-69l23 39-10 30H48Zm224 0c-4-29-17-52-39-69l-23 39 10 30h52Z" data-v-534752c9></path><path class="merc-avatar__shirt-neckline" d="M125 255q35 24 70 0" data-v-534752c9></path></g>`,1)),createBaseVNode(`g`,_hoisted_1$58,[createBaseVNode(`g`,_hoisted_2$49,[_cache[6]||(_cache[6]=createStaticVNode(`<path class="merc-avatar__hair merc-avatar__hair--back" d="M74 153C66 119 70 78 91 49c17-24 42-36 69-36 37 0 65 13 82 39 20 31 20 72 6 110-8 22-22 41-43 54H115c-22-14-34-34-41-63Z" data-v-534752c9></path><path class="merc-avatar__hair merc-avatar__hair--crown-spikes" d="M87 82c12-33 38-55 72-62 32-6 62 1 82 19-17 2-30 7-41 16-12-7-25-10-39-9-15 1-29 7-40 16-11-3-22-2-34 0Z" data-v-534752c9></path><path class="merc-avatar__hair merc-avatar__hair--temples" d="M92 116c-18 12-25 31-21 56 4 23 15 41 35 54-8-24-8-47 1-68l-15-42Zm136 0c18 12 25 31 21 56-4 23-15 41-35 54 8-24 8-47-1-68l15-42Z" data-v-534752c9></path><ellipse class="merc-avatar__ear" cx="94" cy="151" rx="10" ry="18" data-v-534752c9></ellipse><ellipse class="merc-avatar__ear" cx="226" cy="151" rx="10" ry="18" data-v-534752c9></ellipse><path class="merc-avatar__face" d="M160 72c-41 0-67 24-67 67 0 45 27 82 67 85 40-3 67-40 67-85 0-43-26-67-67-67Z" data-v-534752c9></path><path class="merc-avatar__hair merc-avatar__hair--cap" d="M82 118c-5-31 2-58 22-79 19-20 42-28 68-27 34 1 60 14 75 38 13 21 17 47 10 76-18-13-40-21-66-22-38-2-74 3-109 14Z" data-v-534752c9></path><path class="merc-avatar__hair merc-avatar__hair--fringe" d="M88 105c15 2 29-3 41-15 8-7 15-15 21-24 2 11 7 20 15 27 8-10 17-18 28-24 1 13 5 23 12 30 10-7 19-15 27-25 5 19 5 37 0 53-14-8-29-13-45-15-23-3-43-1-61 5-15 5-28 11-39 18-7-18-10-35-9-54Z" data-v-534752c9></path><path class="merc-avatar__hair-swoops" d="M91 76c22-33 56-49 99-48M103 91c29-29 65-38 107-28M117 105c28-20 61-25 97-15" data-v-534752c9></path><path class="merc-avatar__brow merc-avatar__brow--left" d="M104 111c13-8 28-9 41-3" data-v-534752c9></path><path class="merc-avatar__brow merc-avatar__brow--right" d="M175 108c13-6 28-5 41 3" data-v-534752c9></path>`,11)),createBaseVNode(`g`,{class:normalizeClass([`merc-avatar__eyes`,{"merc-avatar__eyes--closed":unref(blinking)}])},[..._cache[0]||(_cache[0]=[createStaticVNode(`<g class="merc-avatar__eye" data-v-534752c9><ellipse class="merc-avatar__eye-white" cx="126" cy="145" rx="19" ry="23" data-v-534752c9></ellipse><ellipse class="merc-avatar__iris" cx="127" cy="145" rx="14.5" ry="19.5" data-v-534752c9></ellipse><ellipse class="merc-avatar__pupil" cx="128" cy="145" rx="9.5" ry="14" data-v-534752c9></ellipse><circle class="merc-avatar__eye-light" cx="121" cy="136" r="5.5" data-v-534752c9></circle><circle class="merc-avatar__eye-light" cx="133" cy="154" r="3" data-v-534752c9></circle><path class="merc-avatar__eye-light merc-avatar__eye-star" d="M116 147l3 5 5 2-5 2-3 5-2-5-5-2 5-2 2-5Z" data-v-534752c9></path></g><g class="merc-avatar__eye" data-v-534752c9><ellipse class="merc-avatar__eye-white" cx="194" cy="145" rx="19" ry="23" data-v-534752c9></ellipse><ellipse class="merc-avatar__iris" cx="193" cy="145" rx="14.5" ry="19.5" data-v-534752c9></ellipse><ellipse class="merc-avatar__pupil" cx="192" cy="145" rx="9.5" ry="14" data-v-534752c9></ellipse><circle class="merc-avatar__eye-light" cx="187" cy="136" r="5.5" data-v-534752c9></circle><circle class="merc-avatar__eye-light" cx="199" cy="154" r="3" data-v-534752c9></circle><path class="merc-avatar__eye-light merc-avatar__eye-star" d="M181 147l3 5 5 2-5 2-3 5-2-5-5-2 5-2 2-5Z" data-v-534752c9></path></g><path class="merc-avatar__eyeliner" d="M106 143q20-27 40 0M174 143q20-27 40 0" data-v-534752c9></path><path class="merc-avatar__eyelashes" d="M108 132l-9-5m14 0-6-9m7 5-2-10m100 19 9-5m-14 0 6-9m-7 5 2-10" data-v-534752c9></path>`,4)])],2),_cache[7]||(_cache[7]=createBaseVNode(`path`,{class:`merc-avatar__nose`,d:`M159 164q-2 5 2 6`},null,-1)),_cache[8]||(_cache[8]=createBaseVNode(`ellipse`,{class:`merc-avatar__cheek`,cx:`112`,cy:`180`,rx:`18`,ry:`9`},null,-1)),_cache[9]||(_cache[9]=createBaseVNode(`ellipse`,{class:`merc-avatar__cheek`,cx:`208`,cy:`180`,rx:`18`,ry:`9`},null,-1)),createBaseVNode(`g`,_hoisted_3$43,[createBaseVNode(`g`,_hoisted_4$35,[unref(visibleMouthPose)===`smile`?(openBlock(),createElementBlock(`g`,_hoisted_5$33,[..._cache[1]||(_cache[1]=[createBaseVNode(`path`,{class:`merc-avatar__mouth-inside`,d:`M134 183q26 12 52 0c-2 25-13 36-26 36s-24-11-26-36Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__teeth`,d:`M139 184q21 8 42 0c-3 8-10 11-21 11s-18-3-21-11Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__tongue`,d:`M147 207q13-9 26 0c-4 7-8 10-13 10s-9-3-13-10Z`},null,-1)])])):unref(visibleMouthPose)===`wide`?(openBlock(),createElementBlock(`g`,_hoisted_6$28,[..._cache[2]||(_cache[2]=[createBaseVNode(`path`,{class:`merc-avatar__mouth-inside`,d:`M130 185q30-13 60 0-5 25-30 25t-30-25Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__teeth`,d:`M135 186q25-8 50 0-8 8-25 8t-25-8Z`},null,-1)])])):unref(visibleMouthPose)===`open`?(openBlock(),createElementBlock(`g`,_hoisted_7$27,[..._cache[3]||(_cache[3]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`194`,rx:`19`,ry:`25`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__tongue`,d:`M145 207q15-11 30 0-5 10-15 10t-15-10Z`},null,-1)])])):unref(visibleMouthPose)===`round`?(openBlock(),createElementBlock(`g`,_hoisted_8$25,[..._cache[4]||(_cache[4]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`193`,rx:`12`,ry:`18`},null,-1),createBaseVNode(`ellipse`,{class:`merc-avatar__lip-light`,cx:`160`,cy:`193`,rx:`16`,ry:`22`},null,-1)])])):unref(visibleMouthPose)===`small`?(openBlock(),createElementBlock(`g`,_hoisted_9$24,[..._cache[5]||(_cache[5]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`191`,rx:`19`,ry:`10`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__lip`,d:`M142 191q18 12 36 0`},null,-1)])])):unref(visibleMouthPose)===`warm-smile`?(openBlock(),createElementBlock(`path`,_hoisted_10$19)):unref(visibleMouthPose)===`soft-smile`?(openBlock(),createElementBlock(`path`,_hoisted_11$17)):unref(visibleMouthPose)===`thoughtful`?(openBlock(),createElementBlock(`path`,_hoisted_12$16)):(openBlock(),createElementBlock(`path`,_hoisted_13$15))])])])])],2)}}};var MercBlueMangaIllustratedAvatar_default=_plugin_vue_export_helper_default(_sfc_main$80,[[`__scopeId`,`data-v-534752c9`]]);var _hoisted_1$57={class:`merc-avatar__head-gesture`};var _hoisted_2$48={class:`merc-avatar__head`};var _hoisted_3$42={class:`merc-avatar__mouth`};var _hoisted_4$34={key:0,class:`merc-avatar__mouth-pose`};var _hoisted_5$32={key:1,class:`merc-avatar__mouth-pose`};var _hoisted_6$27={key:2,class:`merc-avatar__mouth-pose`};var _hoisted_7$26={key:3,class:`merc-avatar__mouth-pose`};var _hoisted_8$24={key:4,class:`merc-avatar__mouth-pose`};var _hoisted_9$23={key:5,class:`merc-avatar__lip`,d:`M140 190q20 7 40 0`};var _hoisted_10$18={key:6,class:`merc-avatar__lip`,d:`M141 191q19 3 38 0`};var _hoisted_11$16={key:7,class:`merc-avatar__lip`,d:`M142 191q17-3 36 1`};var _hoisted_12$15={key:8,class:`merc-avatar__lip`,d:`M141 191q19 1 38 0`};var _sfc_main$79={__name:`MercIllustratedAvatar`,props:{mouthLevel:{default:0,type:Number},mouthPose:{default:`closed`,type:String},state:{default:`idle`,type:String},still:{default:false,type:Boolean}},setup(__props){useCssVars(_ctx=>({"v0ea488c6":unref(mercAvatar).shirt,"v360da9f4":unref(mercAvatar).blouseNecklineStroke,"v379abe8f":unref(mercAvatar).blouseBow,"c62c8cb2":unref(mercAvatar).blouseBowStroke,"v1883b7d6":unref(mercAvatar).face,"v188769d8":unref(mercAvatar).neck,"v1884a15b":unref(mercAvatar).hair,"v86ebee6c":unref(mercAvatar).hairFringe,"v9d83ba04":unref(mercAvatar).hairLockStroke,"v56c4f65a":unref(mercAvatar).hairSwoopsStroke,"v69724149":unref(mercAvatar).browStroke,"v63bcf51e":unref(mercAvatar).eyeWhite,"v25e5f63e":unref(mercAvatar).eyelinerStroke,"v1885558c":unref(mercAvatar).iris,"v0eed11d6":unref(mercAvatar).pupil,"v0e8b31a2":unref(mercAvatar).teeth,"v076acaa4":unref(mercAvatar).noseStroke,"v10679a26":unref(mercAvatar).cheek,"c5df87ec":unref(mercAvatar).mouthInside,"v1f23523d":unref(mercAvatar).tongue,"v74cca65c":unref(mercAvatar).lipStroke,"v933a6ed8":unref(mercAvatar).lipLightStroke,"v026bf305":unref(mercAvatar).earringStroke,"fe2f0a08":unref(mercAvatar).earringDrop,"dbfc9f58":unref(mercAvatar).earringDropStroke}));const{blinking,activeExpression,idleGesture,expression,visibleMouthPose}=useVoiceAvatar(__props);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`svg`,{"aria-label":`Illustrated AI avatar of Merc`,class:normalizeClass([`merc-avatar`,[`merc-avatar--${unref(expression)}`,`merc-avatar--mouth-${unref(visibleMouthPose)}`,unref(idleGesture)?`merc-avatar--gesture-${unref(idleGesture)}`:``,unref(activeExpression)?`merc-avatar--${unref(expression)}-${unref(activeExpression)}`:``,{"merc-avatar--blinking":unref(blinking),"merc-avatar--still":__props.still}]]),role:`img`,viewBox:`0 0 320 320`,xmlns:`http://www.w3.org/2000/svg`},[_cache[11]||(_cache[11]=createBaseVNode(`g`,{class:`merc-avatar__body`},[createBaseVNode(`path`,{class:`merc-avatar__shirt`,d:`M52 320c4-50 28-78 75-91h66c47 13 71 41 75 91H52Z`}),createBaseVNode(`path`,{class:`merc-avatar__neck`,d:`M130 205h60v50c-8 15-52 15-60 0v-50Z`})],-1)),createBaseVNode(`g`,_hoisted_1$57,[createBaseVNode(`g`,_hoisted_2$48,[_cache[6]||(_cache[6]=createStaticVNode(`<path class="merc-avatar__hair merc-avatar__hair--back" d="M86 145c-11-35-4-68 18-90l-8-20 26 11 7-26 20 20 12-26 13 27 24-19 1 27 29-13-10 26h28l-21 20 25 12-23 10c5 12 7 25 5 39l-14-19c-5-43-28-68-59-69-34-2-58 24-62 69l-11 18Z" data-v-6f26701a></path><ellipse class="merc-avatar__ear" cx="91" cy="148" rx="16" ry="27" data-v-6f26701a></ellipse><ellipse class="merc-avatar__ear" cx="229" cy="148" rx="16" ry="27" data-v-6f26701a></ellipse><path class="merc-avatar__face" d="M160 48c-44 0-70 31-70 84 0 61 29 102 70 102s70-41 70-102c0-53-26-84-70-84Z" data-v-6f26701a></path><path class="merc-avatar__hair merc-avatar__hair--fringe" d="M91 115c5-38 29-61 66-65 35-3 61 15 72 50l-19-12-3 20-17-24-6 22-20-27-9 25-16-25-15 24-15-16-11 23-7 5Z" data-v-6f26701a></path><path class="merc-avatar__hair-lock" d="M108 72c9-12 20-20 33-24M145 43l-2 29M176 42l5 31M204 54c9 8 15 19 18 31" data-v-6f26701a></path><path class="merc-avatar__brow merc-avatar__brow--left" d="M113 113c11-8 24-8 34-1" data-v-6f26701a></path><path class="merc-avatar__brow merc-avatar__brow--right" d="M173 112c11-7 24-7 34 1" data-v-6f26701a></path>`,8)),createBaseVNode(`g`,{class:normalizeClass([`merc-avatar__eyes`,{"merc-avatar__eyes--closed":unref(blinking)}])},[..._cache[0]||(_cache[0]=[createStaticVNode(`<g class="merc-avatar__eye" data-v-6f26701a><ellipse class="merc-avatar__eye-white" cx="130" cy="132" rx="18" ry="11" data-v-6f26701a></ellipse><circle class="merc-avatar__iris" cx="132" cy="132" r="7.5" data-v-6f26701a></circle><circle class="merc-avatar__pupil" cx="133" cy="132" r="3.6" data-v-6f26701a></circle><circle class="merc-avatar__eye-light" cx="135" cy="128" r="1.8" data-v-6f26701a></circle></g><g class="merc-avatar__eye" data-v-6f26701a><ellipse class="merc-avatar__eye-white" cx="190" cy="132" rx="18" ry="11" data-v-6f26701a></ellipse><circle class="merc-avatar__iris" cx="188" cy="132" r="7.5" data-v-6f26701a></circle><circle class="merc-avatar__pupil" cx="187" cy="132" r="3.6" data-v-6f26701a></circle><circle class="merc-avatar__eye-light" cx="190" cy="128" r="1.8" data-v-6f26701a></circle></g>`,2)])],2),_cache[7]||(_cache[7]=createBaseVNode(`path`,{class:`merc-avatar__nose`,d:`M158 132c-1 15-6 27-3 31 4 4 10 4 14 0`},null,-1)),_cache[8]||(_cache[8]=createBaseVNode(`ellipse`,{class:`merc-avatar__cheek`,cx:`116`,cy:`166`,rx:`17`,ry:`9`},null,-1)),_cache[9]||(_cache[9]=createBaseVNode(`ellipse`,{class:`merc-avatar__cheek`,cx:`204`,cy:`166`,rx:`17`,ry:`9`},null,-1)),createBaseVNode(`g`,null,[createBaseVNode(`g`,_hoisted_3$42,[unref(visibleMouthPose)===`smile`?(openBlock(),createElementBlock(`g`,_hoisted_4$34,[..._cache[1]||(_cache[1]=[createBaseVNode(`path`,{class:`merc-avatar__mouth-inside`,d:`M132 183q28 24 56 0c-4 20-16 29-28 29s-24-9-28-29Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__teeth`,d:`M137 185q23 14 46 0c-4 9-13 13-23 13s-19-4-23-13Z`},null,-1)])])):unref(visibleMouthPose)===`wide`?(openBlock(),createElementBlock(`g`,_hoisted_5$32,[..._cache[2]||(_cache[2]=[createBaseVNode(`path`,{class:`merc-avatar__mouth-inside`,d:`M130 185q30-13 60 0-5 25-30 25t-30-25Z`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__teeth`,d:`M135 186q25-8 50 0-8 8-25 8t-25-8Z`},null,-1)])])):unref(visibleMouthPose)===`open`?(openBlock(),createElementBlock(`g`,_hoisted_6$27,[..._cache[3]||(_cache[3]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`194`,rx:`19`,ry:`25`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__tongue`,d:`M145 207q15-11 30 0-5 10-15 10t-15-10Z`},null,-1)])])):unref(visibleMouthPose)===`round`?(openBlock(),createElementBlock(`g`,_hoisted_7$26,[..._cache[4]||(_cache[4]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`193`,rx:`12`,ry:`18`},null,-1),createBaseVNode(`ellipse`,{class:`merc-avatar__lip-light`,cx:`160`,cy:`193`,rx:`16`,ry:`22`},null,-1)])])):unref(visibleMouthPose)===`small`?(openBlock(),createElementBlock(`g`,_hoisted_8$24,[..._cache[5]||(_cache[5]=[createBaseVNode(`ellipse`,{class:`merc-avatar__mouth-inside`,cx:`160`,cy:`191`,rx:`19`,ry:`10`},null,-1),createBaseVNode(`path`,{class:`merc-avatar__lip`,d:`M142 191q18 12 36 0`},null,-1)])])):unref(visibleMouthPose)===`warm-smile`?(openBlock(),createElementBlock(`path`,_hoisted_9$23)):unref(visibleMouthPose)===`soft-smile`?(openBlock(),createElementBlock(`path`,_hoisted_10$18)):unref(visibleMouthPose)===`thoughtful`?(openBlock(),createElementBlock(`path`,_hoisted_11$16)):(openBlock(),createElementBlock(`path`,_hoisted_12$15))])]),_cache[10]||(_cache[10]=createBaseVNode(`circle`,{class:`merc-avatar__earring`,cx:`84`,cy:`165`,r:`5`},null,-1))])])],2)}}};var MercIllustratedAvatar_default=_plugin_vue_export_helper_default(_sfc_main$79,[[`__scopeId`,`data-v-6f26701a`]]);var _sfc_main$78={__name:`MercAvatar`,props:{avatar:{default:`yu`,type:String},mouthLevel:{default:0,type:Number},mouthPose:{default:`closed`,type:String},state:{default:`idle`,type:String},still:{default:false,type:Boolean}},setup(__props){return(_ctx,_cache)=>{return __props.avatar===`merc`?(openBlock(),createBlock(MercIllustratedAvatar_default,{key:0,"mouth-level":__props.mouthLevel,"mouth-pose":__props.mouthPose,state:__props.state,still:__props.still},null,8,[`mouth-level`,`mouth-pose`,`state`,`still`])):(openBlock(),createBlock(MercBlueMangaIllustratedAvatar_default,{key:1,"mouth-level":__props.mouthLevel,"mouth-pose":__props.mouthPose,state:__props.state,still:__props.still},null,8,[`mouth-level`,`mouth-pose`,`state`,`still`]))}}};var VIBE64_AVATAR_CHOICES=Object.freeze([Object.freeze({id:`merc`,label:`Merc · male`}),Object.freeze({id:`yu`,label:`Yu · female`})]);var VIBE64_AVATAR_IDS=Object.freeze(VIBE64_AVATAR_CHOICES.map(choice=>choice.id));var VIBE64_DEFAULT_AVATARS=Object.freeze({colleague:`merc`,coding:`yu`});function isVibe64AvatarId(value){return VIBE64_AVATAR_IDS.includes(value)}var _sfc_main$77={__name:`Vibe64AvatarSetting`,props:{modelValue:{type:String,default:null},disabled:Boolean,loading:Boolean,hint:{type:String,default:``}},emits:[`update:modelValue`],setup(__props){return(_ctx,_cache)=>{return openBlock(),createBlock(VSelect,{"model-value":__props.modelValue,items:unref(VIBE64_AVATAR_CHOICES),"item-title":`label`,"item-value":`id`,label:`Avatar`,density:`comfortable`,disabled:__props.disabled,loading:__props.loading,hint:__props.hint,"persistent-hint":Boolean(__props.hint),"onUpdate:modelValue":_cache[0]||(_cache[0]=value=>_ctx.$emit(`update:modelValue`,value))},null,8,[`model-value`,`items`,`disabled`,`loading`,`hint`,`persistent-hint`])}}};var MAIN_CONVERSATION_PREFIX=`vibe64-main:`;var TEMPORARY_CONVERSATION_PREFIX=`vibe64-temporary:`;function invalidConversation(kind){return new AppError(400,`Invalid ${kind} conversation identity.`,{code:`vibe64_conversation_identity_invalid`,params:{kind}})}function mainConversationId({projectSlug,sessionId}={}){if(typeof projectSlug!==`string`||!projectSlug.trim()||typeof sessionId!==`string`||!sessionId.trim())throw new TypeError(`A Main conversation requires a project and session.`);return`${MAIN_CONVERSATION_PREFIX}${JSON.stringify([projectSlug,sessionId])}`}function mainConversationTarget(id){if(typeof id!==`string`||!id.startsWith(MAIN_CONVERSATION_PREFIX))return null;let target;try{target=JSON.parse(id.slice(12))}catch{throw invalidConversation(`Main`)}if(!Array.isArray(target)||target.length!==2||target.some(value=>typeof value!==`string`||!value.trim()))throw invalidConversation(`Main`);return{projectSlug:target[0],sessionId:target[1]}}function temporaryConversationId({projectSlug,sessionId,conversationId}={}){if([projectSlug,sessionId,conversationId].some(value=>typeof value!==`string`||!value.trim()))throw new TypeError(`A temporary conversation requires its project, session and saved logical identity.`);return`${TEMPORARY_CONVERSATION_PREFIX}${JSON.stringify([projectSlug,sessionId,conversationId])}`}function projectVoiceState(runtime){return projectConversationVoiceState({turns:runtime.conversationLog.turns||[],status:runtime.mounted.session.value?.agentSession?.turn?.active?`working`:`ready`})}function createProjectVoiceBinding(runtime,view={}){const identity=runtime.identity;let retained;function captureContext(){return{...identity}}function retain(){retained=runtime.retain();runtime=retained.runtime}function release(){retained?.release();retained=null}function submitText(text,{messageId,context}={}){if(context?.actorKey!==identity.actorKey||context?.sessionId!==identity.sessionId||context?.projectSlug!==identity.projectSlug)throw new Error(`This recording belongs to another conversation.`);return runtime.send({message:text,agentSettings:runtime.agentSettings.requestSettings.value},{messageId})}function cancelWork(){return runtime.interrupt()}return Object.freeze({preferenceTarget:`coding`,defaults:{readAloud:true},id:JSON.stringify([`project`,identity.actorKey,identity.projectSlug,identity.sessionId]),conversationId:mainConversationId(identity),socketUrl:`/api/app/${encodeURIComponent(identity.projectSlug)}/vibe64/sessions/${encodeURIComponent(identity.sessionId)}/voice/ws`,get label(){return`${identity.projectSlug} · ${runtime.mounted.session.value?.sessionName||identity.sessionId}`},get state(){return projectVoiceState(runtime)},get available(){return runtime.available.value},get narration(){return{turns:runtime.conversationLog.turns||[],loading:runtime.conversationLog.loading===true,working:runtime.mounted.session.value?.agentSession?.turn?.active===true,eligible:runtime.available.value&&runtime.access.canUseChat.value&&view.eligible===true,vocalizeThinking:false,vocalizeInterimTurns:false,thinkingSounds:true}},get adapter(){return view.adapter||null},get presentation(){return view.presentation||`dialog`},get onTranscript(){return view.onTranscript},captureContext,retain,release,submitText,cancelWork})}var REALTIME_SOCKET_KEY=`jskit.realtime.runtime.client.socket`;var NO_REALTIME_SOCKET=Object.freeze({active:false,connected:false,connect(){},disconnect(){},emit(){},timeout(){return NO_REALTIME_SOCKET},on(){},off(){},onAny(){},offAny(){}});function matchesEveryEvent(){return true}function resolveEnabled$1(value){if(value===void 0)return true;return Boolean(unref(value))}function resolveEventName(value){return normalizeText$1(unref(value))||`*`}function useRealtimeSocket(){return inject$1(REALTIME_SOCKET_KEY,NO_REALTIME_SOCKET)}function useRealtimeEvent({event=`*`,enabled=true,matches=matchesEveryEvent,onEvent}){const socket=useRealtimeSocket();const active=ref(false);let release=null;function detach(){if(release)try{release()}catch{}release=null;active.value=false}function runHandler(eventName,payload){const context=Object.freeze({event:eventName,payload,socket});if(matches(context)!==true)return;Promise.resolve(onEvent(context)).catch(error=>{console.error({event:eventName,error:String(error?.message||error||`unknown error`)},`Realtime event handler failed.`)})}function attach(){detach();if(socket===NO_REALTIME_SOCKET)return;if(!resolveEnabled$1(enabled))return;const eventName=resolveEventName(event);if(eventName===`*`){const onAny=(nextEventName,payload)=>runHandler(nextEventName,payload);socket.onAny(onAny);release=()=>{socket.offAny(onAny)};active.value=true;return}const onEventMessage=payload=>runHandler(eventName,payload);socket.on(eventName,onEventMessage);release=()=>{socket.off(eventName,onEventMessage)};active.value=true}watch(()=>[resolveEnabled$1(enabled),resolveEventName(event)],()=>{attach()},{immediate:true});onScopeDispose(detach);return{active}}var VIBE64_TRAINING_LEARNER_CHANGED_EVENT=`vibe64.training.learner.changed`;var ERROR_CHANNELS=Object.freeze([`snackbar`,`banner`,`dialog`,`silent`]);var ERROR_SEVERITIES=Object.freeze([`info`,`success`,`warning`,`error`,`critical`]);var ERROR_INTENTS=Object.freeze([`resource-load`,`action-feedback`,`app-recoverable`,`blocking`]);function normalizeText(value,fallback=``){return normalizeText$1(value,{fallback:String(fallback||``).trim()})}function normalizeChannel(value,fallback=``){const normalized=normalizeText(value).toLowerCase();if(ERROR_CHANNELS.includes(normalized))return normalized;return normalizeText(fallback).toLowerCase()}function normalizeSeverity(value,fallback=`error`){const normalized=normalizeText(value).toLowerCase();if(ERROR_SEVERITIES.includes(normalized))return normalized;const normalizedFallback=normalizeText(fallback).toLowerCase();if(ERROR_SEVERITIES.includes(normalizedFallback))return normalizedFallback;return`error`}function normalizeErrorIntent(value,fallback=``){const normalized=normalizeText(value).toLowerCase();if(ERROR_INTENTS.includes(normalized))return normalized;const normalizedFallback=normalizeText(fallback).toLowerCase();if(ERROR_INTENTS.includes(normalizedFallback))return normalizedFallback;return``}function normalizeNonNegativeInteger(value,fallback=0){const numericValue=Number(value);if(!Number.isFinite(numericValue))return Math.max(0,Number(fallback||0));if(numericValue<0)return 0;return Math.trunc(numericValue)}function normalizeAction(value){const source=isRecord(value)?value:null;if(!source)return null;const label=normalizeText(source.label);if(!label||!source.handler)return null;return Object.freeze({label,handler:source.handler,dismissOnRun:source.dismissOnRun!==false})}function normalizeAdditionalActions(value){return Object.freeze(Array.isArray(value)?value.map(normalizeAction).filter(Boolean):[])}function createDefaultErrorPolicy({defaultChannel=`snackbar`,resourceLoadChannel=`silent`,actionFeedbackChannel=`snackbar`,appRecoverableChannel=`banner`,blockingChannel=`dialog`,defaultSeverity=`error`}={}){const normalizedDefaultChannel=normalizeChannel(defaultChannel,`snackbar`)||`snackbar`;const normalizedResourceLoadChannel=normalizeChannel(resourceLoadChannel,`silent`)||`silent`;const normalizedActionFeedbackChannel=normalizeChannel(actionFeedbackChannel,`snackbar`)||`snackbar`;const normalizedAppRecoverableChannel=normalizeChannel(appRecoverableChannel,`banner`)||`banner`;const normalizedBlockingChannel=normalizeChannel(blockingChannel,`dialog`)||`dialog`;const normalizedDefaultSeverity=normalizeSeverity(defaultSeverity,`error`);return function defaultErrorPolicy(event={}){const explicitChannel=normalizeChannel(event.channel);const intent=normalizeErrorIntent(event.intent||(event.blocking===true?`blocking`:``));let channel=explicitChannel;if(!channel)switch(intent){case`resource-load`:channel=normalizedResourceLoadChannel;break;case`action-feedback`:channel=normalizedActionFeedbackChannel;break;case`app-recoverable`:channel=normalizedAppRecoverableChannel;break;case`blocking`:channel=normalizedBlockingChannel;break;default:channel=normalizedDefaultChannel}return Object.freeze({channel,severity:normalizeSeverity(event.severity,normalizedDefaultSeverity)})}}function subscribeListener(listeners,listener){if(!(listeners instanceof Set))throw new TypeError(`subscribeListener requires a Set.`);if(typeof listener!==`function`)return()=>{};listeners.add(listener);return()=>{listeners.delete(listener)}}function createListenerSubscription(listeners){if(!(listeners instanceof Set))throw new TypeError(`createListenerSubscription requires a Set.`);return function subscribe(listener){return subscribeListener(listeners,listener)}}var jskit$11={"shell":{"actions":{"back":`Back`,"close":`Close`,"dismiss":`Dismiss`,"more":`More actions`,"reload":`Reload`,"retry":`Retry`},"error":{"actionFailed":`Error action failed.`,"attentionRequired":`Attention required`,"navigationFailed":`Navigation failed.`,"requestFailed":`Request failed.`,"unexpectedUi":`Unexpected UI error.`},"layout":{"closeNavigationMenu":`Close navigation menu`,"collapseNavigationDrawer":`Collapse navigation drawer`,"details":`Details`,"expandNavigationDrawer":`Expand navigation drawer`,"openNavigationMenu":`Open navigation menu`,"surface":`Surface`,"tab":`Tab`,"tools":`Tools`},"pullToRefresh":{"pull":`Pull to refresh`,"refreshing":`Refreshing`,"release":`Release to refresh`},"recovery":{"appDataLabel":`App data`,"appLabel":`App`,"appModuleLabel":`App module`,"appUnreachable":`The app could not reach the server or network. Check the connection and try again.`,"appUpdated":`{app} was updated. Reload to get the latest version.`,"errorConfigLabel":`Error config`,"moduleFailed":`A required app module could not load.`,"placementConfigLabel":`Placement config`,"placementTopologyLabel":`Placement topology`,"refreshFailed":`Unable to refresh. Check the connection and try again.`,"reloadFailed":`The app cannot reload because the app server is not reachable. Restart the server, then click Reload.`,"thisAppUpdated":`This app was updated. Reload to get the latest version.`,"unreachable":`{label} could not reach the server or network. Check the connection and try again.`},"appEnvironment":{"development":`Development`,"developmentDescription":`Development: emails and messages are logged, not sent; payments use the sandbox.`,"test":`Test`,"testDescription":`Test: emails and messages are logged, not sent; payments use the sandbox.`,"staging":`Staging`,"stagingDescription":`Staging: email and text messages reach only the staging test addresses, other messages are logged and payments use the sandbox.`,"stagingRealPeople":`Staging · real people`,"stagingRealPeopleDescription":`Staging that real people use: email and text messages reach the people they are for, other messages are logged and payments use the sandbox.`}}};var en_default$11={jskit:jskit$11};registerJskitMessages(en_default$11);var{t:t$22}=useJskitText();function freezeParams$1(params){return Object.freeze(isRecord(params)?{...params}:{})}function messageCodeFields(source={},fallback={}){const codeSource=source.code?source:fallback;const messageCodeSource=source.messageCode?source:fallback;return{code:normalizeText(codeSource?.code),params:freezeParams$1(codeSource?.params),messageCode:normalizeText(messageCodeSource?.messageCode),messageParams:freezeParams$1(messageCodeSource?.messageParams)}}function normalizeErrorEvent(rawEvent={}){const source=isRecord(rawEvent)?rawEvent:{message:rawEvent};const cause=source.cause!==void 0?source.cause:source.error;const statusCandidate=Number(source.status||source.statusCode||cause?.status||cause?.statusCode||0);const status=Number.isFinite(statusCandidate)?Math.trunc(statusCandidate):0;const fieldErrors=isRecord(source.fieldErrors)?Object.freeze({...source.fieldErrors}):isRecord(source.details?.fieldErrors)?Object.freeze({...source.details.fieldErrors}):null;const details=isRecord(source.details)?Object.freeze({...source.details}):null;const userMessage=normalizeText(source.userMessage);const runtimeMessage=normalizeText(source.message||cause?.message);return Object.freeze({...messageCodeFields(source,isRecord(cause)?cause:{}),status,source:normalizeText(source.source,`app`),message:normalizeText(userMessage||runtimeMessage,t$22(`jskit.shell.error.requestFailed`)),userMessage,intent:normalizeErrorIntent(source.intent||source.kind),severity:normalizeSeverity(source.severity,`error`),channel:normalizeChannel(source.channel),presenterId:normalizeText(source.presenterId),action:normalizeAction(source.action),additionalActions:normalizeAdditionalActions(source.additionalActions),persist:typeof source.persist===`boolean`?source.persist:null,blocking:source.blocking===true,dedupeKey:normalizeText(source.dedupeKey),dedupeWindowMs:normalizeNonNegativeInteger(source.dedupeWindowMs,0),traceId:normalizeText(source.traceId),fieldErrors,details,cause:cause||null,timestamp:Number(Date.now())})}function normalizePolicyDecision(policyDecision={},event={}){const source=isRecord(policyDecision)?policyDecision:{};const channel=normalizeChannel(source.channel||event.channel,`snackbar`)||`snackbar`;return Object.freeze({channel,presenterId:normalizeText(source.presenterId||event.presenterId),message:normalizeText(source.message||event.userMessage||event.message,t$22(`jskit.shell.error.requestFailed`)),...messageCodeFields(source,event),severity:normalizeSeverity(source.severity||event.severity,`error`),action:normalizeAction(source.action||event.action),additionalActions:normalizeAdditionalActions(source.additionalActions??event.additionalActions),persist:typeof source.persist===`boolean`?source.persist:typeof event.persist===`boolean`?event.persist:channel!==`snackbar`,dedupeKey:normalizeText(source.dedupeKey||event.dedupeKey),dedupeWindowMs:normalizeNonNegativeInteger(source.dedupeWindowMs,event.dedupeWindowMs||0)})}function supportsEveryChannel(){return true}function dismissNothing(){return 0}function normalizePresenter(source){const id=normalizeText(source.id);if(!id)throw new Error(`Error presenter requires id.`);const supports=source.supports||supportsEveryChannel;const dismiss=source.dismiss||dismissNothing;return Object.freeze({id,supports:supports.bind(source),present:source.present.bind(source),dismiss:dismiss.bind(source)})}function createErrorRuntime({presenters=[],policy=createDefaultErrorPolicy(),defaultPresenterId=``,moduleDefaultPresenterId=``,logger}){const byPresenterId=new Map;const listeners=new Set;const subscribe=createListenerSubscription(listeners);const dedupeWindowByKey=new Map;let activePolicy=policy;let activeAppDefaultPresenterId=normalizeText(defaultPresenterId);const activeModuleDefaultPresenterId=normalizeText(moduleDefaultPresenterId);function getPresenterIds(){return Object.freeze([...byPresenterId.keys()].sort((left,right)=>left.localeCompare(right)))}function assertPresenterExists(presenterId,label){if(!byPresenterId.has(presenterId))throw new Error(`${label} presenter "${presenterId}" is not registered.`)}function resolveDefaultPresenterId(){if(activeAppDefaultPresenterId){assertPresenterExists(activeAppDefaultPresenterId,`App default error`);return activeAppDefaultPresenterId}if(activeModuleDefaultPresenterId){assertPresenterExists(activeModuleDefaultPresenterId,`Module default error`);return activeModuleDefaultPresenterId}throw new Error(`Error runtime requires app default presenter or module default presenter.`)}function assertBootReady(){resolveDefaultPresenterId()}function registerPresenter(presenter){const normalized=normalizePresenter(presenter);if(byPresenterId.has(normalized.id))throw new Error(`Error presenter "${normalized.id}" is already registered.`);byPresenterId.set(normalized.id,normalized);return normalized.id}function registerPresenters(nextPresenters=[]){const source=Array.isArray(nextPresenters)?nextPresenters:[];const ids=[];for(const presenter of source)ids.push(registerPresenter(presenter));return Object.freeze(ids)}function setPolicy(nextPolicy){if(typeof nextPolicy!==`function`)throw new TypeError(`Error policy must be a function.`);activePolicy=nextPolicy}function setAppDefaultPresenterId(nextDefaultPresenterId=``){const normalized=normalizeText(nextDefaultPresenterId);if(normalized)assertPresenterExists(normalized,`App default error`);activeAppDefaultPresenterId=normalized;return activeAppDefaultPresenterId}function notify(event={}){const payload=Object.freeze({...event});for(const listener of listeners)try{listener(payload)}catch(error){logger.warn({error:String(error?.message||error||`unknown error`)},`Error runtime subscriber failed.`)}}function resolveChannelCompatiblePresenter(channel=``){for(const presenter of byPresenterId.values())if(presenter.supports(channel))return presenter;return null}function resolvePresenterForDecision(decision){const explicitPresenterId=normalizeText(decision.presenterId);if(explicitPresenterId){assertPresenterExists(explicitPresenterId,`Policy-selected error`);return byPresenterId.get(explicitPresenterId)}const defaultPresenterId=resolveDefaultPresenterId();const defaultPresenter=byPresenterId.get(defaultPresenterId);if(defaultPresenter.supports(decision.channel))return defaultPresenter;const compatiblePresenter=resolveChannelCompatiblePresenter(decision.channel);if(!compatiblePresenter)throw new Error(`No error presenter supports channel "${decision.channel}".`);return compatiblePresenter}function shouldSkipByDedupe(decision){if(!decision.dedupeKey||decision.dedupeWindowMs<1)return false;const now=Number(Date.now());if(now-Number(dedupeWindowByKey.get(decision.dedupeKey)||0)<decision.dedupeWindowMs)return true;dedupeWindowByKey.set(decision.dedupeKey,now);return false}function report(rawEvent={},rawContext={}){const event=normalizeErrorEvent(rawEvent);const context=isRecord(rawContext)?Object.freeze({...rawContext}):Object.freeze({});let policyDecision;try{policyDecision=activePolicy(event,Object.freeze({context,runtime:Object.freeze({presenterIds:getPresenterIds(),appDefaultPresenterId:activeAppDefaultPresenterId,moduleDefaultPresenterId:activeModuleDefaultPresenterId})}))}catch(error){logger.error({source:event.source,error:String(error?.message||error||`unknown error`)},`Error policy threw while evaluating error event.`);throw error}const decision=normalizePolicyDecision(policyDecision,event);if(decision.channel===`silent`){const silentResult=Object.freeze({event,decision,skipped:true,reason:`silent`});notify({type:`reported.silent`,result:silentResult});return silentResult}if(shouldSkipByDedupe(decision)){const dedupedResult=Object.freeze({event,decision,skipped:true,reason:`dedupe`});notify({type:`reported.deduped`,result:dedupedResult});return dedupedResult}const presenter=resolvePresenterForDecision(decision);if(!presenter.supports(decision.channel))throw new Error(`Error presenter "${presenter.id}" does not support channel "${decision.channel}".`);const payload=Object.freeze({...decision,presenterId:presenter.id,event,context});const presentationId=normalizeText(presenter.present(payload));const result=Object.freeze({event,decision:Object.freeze({...decision,presenterId:presenter.id}),presentationId,skipped:false});notify({type:`reported`,result});return result}function dismiss(presentationId=``,options={}){const normalizedPresentationId=normalizeText(presentationId);const source=isRecord(options)?options:{};const presenterId=normalizeText(source.presenterId);if(presenterId){const presenter=byPresenterId.get(presenterId);if(!presenter)return 0;return Number(presenter.dismiss(normalizedPresentationId)||0)}let total=0;for(const presenter of byPresenterId.values())total+=Number(presenter.dismiss(normalizedPresentationId)||0);return total}function configure(options={}){const source=isRecord(options)?options:{};if(Array.isArray(source.presenters)&&source.presenters.length>0)registerPresenters(source.presenters);if(Object.prototype.hasOwnProperty.call(source,`policy`))setPolicy(source.policy);if(Object.prototype.hasOwnProperty.call(source,`defaultPresenterId`))setAppDefaultPresenterId(source.defaultPresenterId);assertBootReady();return getSnapshot()}function getSnapshot(){return Object.freeze({presenterIds:getPresenterIds(),appDefaultPresenterId:activeAppDefaultPresenterId,moduleDefaultPresenterId:activeModuleDefaultPresenterId,resolvedDefaultPresenterId:resolveDefaultPresenterId()})}registerPresenters(presenters);assertBootReady();return Object.freeze({report,dismiss,configure,registerPresenter,registerPresenters,setPolicy,setAppDefaultPresenterId,assertBootReady,getSnapshot,subscribe,normalizeErrorEvent})}var SHELL_WEB_ERROR_RUNTIME_KEY=`jskit.shell-web.runtime.web-error.client`;function throwUnavailable(){throw new Error(`Shell web error runtime is not available.`)}function emptySnapshot(){return Object.freeze({presenterIds:Object.freeze([]),appDefaultPresenterId:``,moduleDefaultPresenterId:``,resolvedDefaultPresenterId:``})}var NO_SHELL_WEB_ERROR_RUNTIME=Object.freeze({report(){return Object.freeze({skipped:true,reason:`unavailable`})},dismiss(){return 0},configure:emptySnapshot,registerPresenter:throwUnavailable,registerPresenters:throwUnavailable,setPolicy:throwUnavailable,setAppDefaultPresenterId:throwUnavailable,assertBootReady:throwUnavailable,getSnapshot:emptySnapshot,subscribe(){return()=>{}},normalizeErrorEvent});function useShellWebErrorRuntime(){return inject$1(SHELL_WEB_ERROR_RUNTIME_KEY,NO_SHELL_WEB_ERROR_RUNTIME)}var EMPTY_PRESENTATION_STATE=Object.freeze({revision:0,channels:Object.freeze({snackbar:Object.freeze([]),banner:Object.freeze([]),dialog:Object.freeze([])})});var NO_PRESENTATION_STORE=Object.freeze({getState(){return EMPTY_PRESENTATION_STATE},subscribe(){return()=>{}},present(){throw new Error(`Shell web error presentation store is not available.`)},dismiss(){return 0},clear(){return 0}});function normalizePresentationState(nextState){if(!nextState||typeof nextState!==`object`)return EMPTY_PRESENTATION_STATE;return nextState}var useShellErrorPresentationStore=defineStore(`jskit.shell-web.error-presentation`,()=>{const runtimeStore=shallowRef(markRaw(NO_PRESENTATION_STORE));const presentationState=shallowRef(EMPTY_PRESENTATION_STATE);let unsubscribe=null;function setPresentationState(nextState){presentationState.value=normalizePresentationState(nextState);return presentationState.value}function detachRuntimeStore(){if(unsubscribe){unsubscribe();unsubscribe=null}}function attachRuntimeStore(nextRuntimeStore){if(runtimeStore.value===nextRuntimeStore){setPresentationState(nextRuntimeStore.getState());return runtimeStore.value}detachRuntimeStore();runtimeStore.value=markRaw(nextRuntimeStore);setPresentationState(nextRuntimeStore.getState());unsubscribe=nextRuntimeStore.subscribe(nextState=>{setPresentationState(nextState)});return runtimeStore.value}function getState(){return presentationState.value}function subscribe(listener){return runtimeStore.value.subscribe(listener)}function present(channel,payload={}){return runtimeStore.value.present(channel,payload)}function dismiss(channel,presentationId=``){return runtimeStore.value.dismiss(channel,presentationId)}function clear(channel=``){return runtimeStore.value.clear(channel)}return{runtimeStore,presentationState,revision:computed(()=>Number(presentationState.value.revision||0)),channels:computed(()=>presentationState.value.channels||EMPTY_PRESENTATION_STATE.channels),attachRuntimeStore,getState,subscribe,present,dismiss,clear}});var jskit$10={"crud":{"listFilter":{"present":`Present`,"missing":`Missing`,"chip":{"value":`{label}: {value}`,"range":`{label}: {from} to {to}`,"from":`{label}: from {from}`,"to":`{label}: to {to}`,"min":`{label}: min {min}`,"max":`{label}: max {max}`}}}};var en_default$10={jskit:jskit$10};var jskit$9={"http":{"access":{"permissionsUnavailable":`Permissions are unavailable in placement context.`,"routeParamsRequired":`Route parameters {params} are required for surface "{surface}".`},"actions":{"apply":`Apply`,"cancel":`Cancel`,"clear":`Clear`,"clearAll":`Clear all`,"close":`Close`,"delete":`Delete`,"deleting":`Deleting…`,"edit":`Edit`,"loadMore":`Load more`,"loadingMore":`Loading more…`,"more":`More`,"open":`Open`,"refresh":`Refresh`,"refreshing":`Refreshing…`,"retry":`Retry`,"retrying":`Retrying…`,"running":`{label}…`,"save":`Save`,"saving":`Saving…`},"crud":{"bulk":{"actions":`Bulk actions`,"selected":`{count} selected`,"selection":`Selection`},"delete":{"button":`Delete {resource}`,"description":`This permanently deletes this {resource}. This action cannot be undone.`,"failed":`Unable to delete record.`,"listRouteUnavailable":`Deleted the record, but the generated list route is unavailable.`,"title":`Delete {resource}?`},"filters":{"calendar":`{label} calendar`,"chipDate":`{label}: {date}`,"chipFrom":`{label}: from {from}`,"chipRange":`{label}: {from} to {to}`,"chipTo":`{label}: to {to}`,"dateRange":`{label} date range`,"enterId":`Enter id`,"enterIds":`Enter ids`,"option":`Option`,"optionValue":`{label} {value}`,"optionsLoadFailed":`Unable to load filter options ({path}).`,"rangeFrom":`{label} from`,"rangeMax":`{label} max`,"rangeMin":`{label} min`,"rangeTo":`{label} to`,"selectDate":`Select date`,"selectEndDate":`Select end date`,"selectStartDate":`Select start date`,"title":`Filters`},"list":{"emptyBody":`Create the first record to start using this workflow.`,"loadErrorBody":`Check the connection and try again.`,"loadFailed":`Unable to load records.`,"newRecord":`New record`,"recordActions":`Actions for {title}`,"selectRecord":`Select {title}`,"selectVisibleRows":`Select visible rows`},"lookup":{"optionsLoadFailed":`Unable to load lookup options ({path}).`},"no":`No`,"parent":{"loadFailed":`Unable to load parent record.`,"notFound":`Parent record not found.`,"recordWithId":`{label} #{id}`},"record":`Record`,"recordNotFound":`Record not found.`,"records":`Records`,"view":{"loadFailed":`Unable to load record.`,"notFound":`This {resource} could not be found.`},"yes":`Yes`},"feedback":{"actionFailed":`Unable to complete action.`,"completed":`Completed.`,"fixInvalidValues":`Fix invalid values and try again.`,"requestFailed":`Request failed.`,"saveFailed":`Unable to save.`,"saved":`Saved.`,"validationFailed":`Validation failed.`},"list":{"label":`List`,"loadFailed":`Unable to load list.`,"search":`Search`},"loadRefused":{"forbidden":`You don't have access to this.`,"notFound":`This wasn't found.`,"other":`This couldn't be loaded.`,"unauthorized":`Sign in again to see this.`},"resource":{"label":`Resource`,"loadFailed":`Unable to load resource.`,"saveFailed":`Unable to save resource.`},"selectField":{"unavailableOption":`Unavailable option`}}};var en_default$9={jskit:jskit$9};registerJskitMessages(en_default$10);registerJskitMessages(en_default$9);var{t:t$21}=useJskitText();var unavailableOption=Symbol(`unavailable option`);function readOption(item,key,fallback){if(typeof key===`function`){const value=key(item,fallback);return value===void 0?fallback:value}if(item===null||typeof item!==`object`||key==null)return fallback;const value=(Array.isArray(key)?key:String(key).split(`.`)).reduce((source,part)=>source?.[part],item);return value===void 0?fallback:value}function optionTitle(item,itemTitle){return item?.[unavailableOption]?item.title:readOption(item,itemTitle,item)}function optionValue(item,itemTitle,itemValue){return item?.[unavailableOption]?item.value:readOption(item,itemValue,readOption(item,itemTitle,item))}function selectedValues(modelValue,multiple){if(multiple)return modelValue==null?[]:[].concat(modelValue);return modelValue==null||modelValue===``?[]:[modelValue]}function selectionFieldState(field,seen){const{modelValue,items=[],itemTitle=`title`,itemValue=`value`,multiple=false,returnObject=false}=field;if(returnObject)return{modelValue,items,hiddenValues:[]};const listed=new Set;for(const item of items){const value=optionValue(item,itemTitle,itemValue);listed.add(value);seen.set(value,item)}const missing=selectedValues(modelValue,multiple).filter(value=>!listed.has(value));const remembered=missing.filter(value=>seen.has(value)).map(value=>seen.get(value));const unresolved=missing.filter(value=>!seen.has(value));if(field.loading&&unresolved.length)return{modelValue:multiple?[].concat(modelValue).filter(value=>!unresolved.includes(value)):null,items:[...items,...remembered],hiddenValues:unresolved};const title=t$21(`jskit.http.selectField.unavailableOption`);const unavailable=unresolved.map(value=>({[unavailableOption]:true,title,value}));return{modelValue,items:missing.length?[...items,...remembered,...unavailable]:items,hiddenValues:[]}}var _sfc_main$76=Object.assign({inheritAttrs:false},{__name:`SelectField`,props:{searchable:{type:Boolean,default:false},modelValue:{type:null,default:null},items:{type:Array,default:()=>[]},itemTitle:{type:[String,Array,Function],default:`title`},itemValue:{type:[String,Array,Function],default:`value`},multiple:{type:Boolean,default:false},returnObject:{type:Boolean,default:false},loading:{type:[Boolean,String],default:false}},emits:[`update:modelValue`],setup(__props,{expose:__expose,emit:__emit}){const props=__props;const emit=__emit;const field=ref(null);const seen=new Map;const state=computed(()=>selectionFieldState(props,seen));const titleOf=item=>optionTitle(item,props.itemTitle);const valueOf=item=>optionValue(item,props.itemTitle,props.itemValue);function update(value){const hidden=state.value.hiddenValues;emit(`update:modelValue`,props.multiple&&hidden.length?[...hidden,...[].concat(value??[])]:value)}__expose({focus:()=>field.value?.focus()});return(_ctx,_cache)=>{return openBlock(),createBlock(resolveDynamicComponent(__props.searchable?unref(VAutocomplete):unref(VSelect)),mergeProps({ref_key:`field`,ref:field},_ctx.$attrs,{"model-value":state.value.modelValue,items:state.value.items,"item-title":__props.returnObject?__props.itemTitle:titleOf,"item-value":__props.returnObject?__props.itemValue:valueOf,multiple:__props.multiple,"return-object":__props.returnObject,loading:__props.loading,"onUpdate:modelValue":update}),createSlots({_:2},[renderList(_ctx.$slots,(_,name)=>{return{name,fn:withCtx(slotProps=>[renderSlot(_ctx.$slots,name,normalizeProps(guardReactiveProps(slotProps||{})))])}})]),1040,[`model-value`,`items`,`item-title`,`item-value`,`multiple`,`return-object`,`loading`])}}});var ROUTE_VISIBILITY_LEVELS=Object.freeze([ROUTE_VISIBILITY_PUBLIC,ROUTE_VISIBILITY_USER]);var ROUTE_VISIBILITY_LEVEL_SET=new Set(ROUTE_VISIBILITY_LEVELS);var ROUTE_VISIBILITY_WORKSPACE=`workspace`;var ROUTE_VISIBILITY_WORKSPACE_USER=`workspace_user`;var ROUTE_VISIBILITY_TOKENS=Object.freeze([ROUTE_VISIBILITY_PUBLIC,ROUTE_VISIBILITY_USER,ROUTE_VISIBILITY_WORKSPACE,ROUTE_VISIBILITY_WORKSPACE_USER]);var ROUTE_VISIBILITY_TOKEN_SET=new Set(ROUTE_VISIBILITY_TOKENS);function hasResolvedQueryData({query=null,data=null}={}){const querySucceeded=Boolean(unref(query?.isSuccess));const hasDataPayload=unref(data)!=null;return querySucceeded||hasDataPayload}function mergeQueryMeta(queryOptions=null,meta={}){const sourceOptions=isRecord(queryOptions)?queryOptions:{};const sourceMeta=isRecord(sourceOptions.meta)?sourceOptions.meta:{};return{...sourceOptions,meta:{...sourceMeta,...meta,jskit:{...isRecord(sourceMeta.jskit)?sourceMeta.jskit:{},...isRecord(meta.jskit)?meta.jskit:{}}}}}var REQUEST_RECOVERY_META_KEYS=Object.freeze({label:`requestRecoveryLabel`,source:`requestRecoverySource`,dedupeKey:`requestRecoveryDedupeKey`,method:`requestRecoveryMethod`,dedupeWindowMs:`requestRecoveryDedupeWindowMs`});var DISABLED_REQUEST_RECOVERY_META=Object.freeze({jskit:Object.freeze({requestRecovery:false})});function normalizeRequestRecoveryInput(requestRecovery=null){if(typeof requestRecovery===`string`)return{label:requestRecovery};const source=isRecord(requestRecovery)?requestRecovery:{};for(const key of Object.keys(source))if(key!==`enabled`&&!Object.hasOwn(REQUEST_RECOVERY_META_KEYS,key))throw new TypeError(`requestRecovery.${key} is not supported; use ${Object.keys(REQUEST_RECOVERY_META_KEYS).join(`, `)} or enabled.`);return source}function normalizeRequestRecoveryValue(name,value){if(name===`dedupeWindowMs`){const numberValue=value==null||value===``?NaN:Number(value);return Number.isFinite(numberValue)?Math.max(0,numberValue):null}const text=normalizeText$1(value);if(!text)return null;return name===`method`?text.toUpperCase():text}function buildRequestRecoveryMeta(requestRecovery=null,defaults={}){if(requestRecovery===false)return DISABLED_REQUEST_RECOVERY_META;const source=normalizeRequestRecoveryInput(requestRecovery);if(source.enabled===false)return DISABLED_REQUEST_RECOVERY_META;const fallback=isRecord(defaults)?defaults:{};const jskit={};for(const[name,metaKey]of Object.entries(REQUEST_RECOVERY_META_KEYS)){const value=normalizeRequestRecoveryValue(name,source[name])??normalizeRequestRecoveryValue(name,fallback[name]);if(value!==null)jskit[metaKey]=value}return Object.keys(jskit).length>0?{jskit}:{}}function mergeRequestRecoveryQueryMeta(queryOptions=null,requestRecovery=null,defaults={}){const sourceOptions=isRecord(queryOptions)?queryOptions:{};let meta;if(requestRecovery==null){const presetMeta=isRecord(sourceOptions.meta?.jskit)?sourceOptions.meta.jskit:{};if(presetMeta.requestRecovery===false)return sourceOptions;const fallback=isRecord(defaults)?defaults:{};const unsetDefaults={};for(const[name,metaKey]of Object.entries(REQUEST_RECOVERY_META_KEYS))if(!hasValue(presetMeta[metaKey]))unsetDefaults[name]=fallback[name];meta=buildRequestRecoveryMeta(null,unsetDefaults)}else meta=buildRequestRecoveryMeta(requestRecovery,defaults);return Object.keys(meta).length>0?mergeQueryMeta(sourceOptions,meta):sourceOptions}var{t:t$20,text:text$5,serverMessage:serverMessage$1,fieldErrorMessages}=useJskitText();function toUiErrorMessage(error,fallbackMessage=``,defaultMessage=``){const normalizedFallback=text$5(fallbackMessage).trim();const normalizedMessage=String(error?.message||``).trim();if(normalizedMessage&&!isGenericHttpErrorMessage(error))return serverMessage$1(error).trim();if(normalizedFallback)return normalizedFallback;if(normalizedMessage)return serverMessage$1(error).trim();return text$5(defaultMessage).trim()||t$20(`jskit.http.feedback.requestFailed`)}function toQueryErrorMessage(error,fallbackMessage=``,defaultMessage=``){return error?toUiErrorMessage(error,fallbackMessage,defaultMessage):``}var LOAD_REFUSED_MESSAGE_KEYS=Object.freeze({401:`jskit.http.loadRefused.unauthorized`,403:`jskit.http.loadRefused.forbidden`,404:`jskit.http.loadRefused.notFound`});function toUiFieldErrors(error){return fieldErrorMessages({fieldErrors:resolveFieldErrors(error),fieldErrorCodes:error?.fieldErrorCodes||error?.details?.fieldErrorCodes})}var{t:t$19,text:text$4}=useJskitText();var SILENT_FIELD_BAG=Object.freeze({apply(){}});var SILENT_FEEDBACK=Object.freeze({error(){}});function validateOperationInput({input,rawPayload={},fieldBag=SILENT_FIELD_BAG,feedback=SILENT_FEEDBACK,validationMessage=``}){if(!input)return{ok:true,parsedInput:rawPayload};try{return{ok:true,parsedInput:validateSchemaPayload(input,rawPayload,{phase:`input`,context:`operation input`})}}catch(error){if(!error?.fieldErrors||typeof error.fieldErrors!==`object`)throw error;const fieldErrorCodes=error.fieldErrorCodes||error.details?.fieldErrorCodes;const failure={...buildValidationFailure({error:text$4(validationMessage)||t$19(`jskit.http.feedback.validationFailed`),code:`validation_failed`,fieldErrors:error?.fieldErrors}),...fieldErrorCodes?{fieldErrorCodes}:{}};fieldBag.apply(toUiFieldErrors(failure));feedback.error(failure,failure.error);return{ok:false,failure,parsedInput:null}}}function resolveEnabledRef(value){if(value===void 0)return true;return Boolean(toValue(value))}function resolveTextRef(value){return String(unref(value)||``).trim()}var OWNERSHIP_FILTER_VALUES=ROUTE_VISIBILITY_TOKENS;var SCOPED_OWNERSHIP_FILTER_SET=new Set([ROUTE_VISIBILITY_WORKSPACE,ROUTE_VISIBILITY_WORKSPACE_USER]);var ACCESS_MODE_VALUES=Object.freeze([`auto`,`always`,`never`]);function asPlainObject(value){if(!value||typeof value!==`object`||Array.isArray(value))return{};return value}function emptyRecord(){return{}}function normalizePermissions(value){if(Array.isArray(value))return value.map(entry=>String(entry||``).trim()).filter(Boolean);const one=String(value||``).trim();return one?[one]:[]}function resolvePermissionAccess(access,normalizedPermissions=[]){if(normalizedPermissions.length<1)return true;return access.canAny(normalizedPermissions)}function normalizeAccessMode(value=`auto`){const normalized=String(value||`auto`).trim().toLowerCase();if(ACCESS_MODE_VALUES.includes(normalized))return normalized;throw new TypeError(`access must be one of: ${ACCESS_MODE_VALUES.join(`, `)}. Received: ${String(value||``)||`(empty)`}`)}function resolveAccessModeEnabled(accessMode=`auto`,{hasPermissionRequirements=false}={}){const normalizedMode=normalizeAccessMode(accessMode);if(normalizedMode===`always`)return true;if(normalizedMode===`never`)return false;return hasPermissionRequirements===true}function ensureAccessModeCompatibility({accessMode=`auto`,hasPermissionRequirements=false,caller=`http-web`}={}){const normalizedMode=normalizeAccessMode(accessMode);if(normalizedMode===`never`&&hasPermissionRequirements)throw new TypeError(`${caller} cannot use access:\"never\" when permission requirements are configured.`);return normalizedMode}function resolveApiSuffix(apiSuffix,context={}){if(typeof apiSuffix===`function`)return resolveTextRef(apiSuffix(context));return resolveTextRef(apiSuffix)}function resolveEnabled(value,context={}){if(typeof value===`function`)return Boolean(value(context));return resolveEnabledRef(value)}function normalizeOwnershipFilter(value=ROUTE_VISIBILITY_WORKSPACE){const normalized=String(value||`workspace`).trim().toLowerCase();if(OWNERSHIP_FILTER_VALUES.includes(normalized))return normalized;throw new TypeError(`ownershipFilter must be one of: ${OWNERSHIP_FILTER_VALUES.join(`, `)}. Received: ${String(value||``)||`(empty)`}`)}function isScopedOwnershipFilter(ownershipFilter){return SCOPED_OWNERSHIP_FILTER_SET.has(ownershipFilter)}function resolveQueryKey(queryKeyFactory,{surfaceId=``,scopeParamValue=``,ownershipFilter=ROUTE_VISIBILITY_WORKSPACE}={}){if(isScopedOwnershipFilter(ownershipFilter))return queryKeyFactory(surfaceId,scopeParamValue,ownershipFilter);return queryKeyFactory(surfaceId,ownershipFilter)}var{t:t$18,text:text$3}=useJskitText();function permissionRefusal(){return Object.assign(createTextError(`jskit.errors.ACTION_PERMISSION_DENIED`),{status:403,code:`ACTION_PERMISSION_DENIED`})}function useCommandCore({model,resource,writeMethod=`POST`,canRun,fieldBag,feedback,input,buildRawPayload,buildCommandPayload,buildCommandOptions=emptyRecord,onRunSuccess,onRunError,suppressSuccessMessage=false,messages={}}){const queryClient=useQueryClient();const sendsParsedInput=String(writeMethod||`POST`).trim().toUpperCase()!==`DELETE`||Boolean(input)||buildRawPayload!==void 0;const readRawPayload=buildRawPayload??emptyRecord;const running=resource.isSaving;const fieldErrors=fieldBag.errors;const message=feedback.message;const messageType=feedback.messageType;async function run(context={}){if(running.value)return null;feedback.clear();fieldBag.clear();if(!canRun.value){feedback.error(permissionRefusal(),text$3(messages.error)||t$18(`jskit.http.feedback.actionFailed`));return null}const rawPayload=readRawPayload(model,{queryClient,resource,context});const validationResult=validateOperationInput({input,rawPayload,fieldBag,feedback,validationMessage:text$3(messages.validation)||t$18(`jskit.http.feedback.validationFailed`)});if(!validationResult.ok)return null;const{parsedInput}=validationResult;const payload=typeof buildCommandPayload===`function`?buildCommandPayload(parsedInput,{rawPayload,queryClient,resource,context}):sendsParsedInput?parsedInput:void 0;const options=buildCommandOptions(parsedInput,{rawPayload,queryClient,resource,context});try{const response=await resource.save(payload,options);if(onRunSuccess)await onRunSuccess(response,{parsed:parsedInput,rawPayload,payload,options,queryClient,resource,context});if(!suppressSuccessMessage)feedback.success(text$3(messages.success)||t$18(`jskit.http.feedback.completed`));return response}catch(error){fieldBag.apply(toUiFieldErrors(error));if(onRunError)await onRunError(error,{parsed:parsedInput,rawPayload,payload,options,queryClient,resource,context});feedback.error(error,text$3(messages.error)||t$18(`jskit.http.feedback.actionFailed`));throw error}}return{running,fieldErrors,message,messageType,run}}function normalizeRealtimeOptions(value={}){if(value===null||value===void 0||value===false)return{};if(typeof value!==`object`||Array.isArray(value))throw new TypeError(`realtime must be an object when configured.`);return value}function toQueryKeyList(value){const resolved=toValue(value);if(!Array.isArray(resolved)||resolved.length<1)return[];if(Array.isArray(resolved[0]))return resolved.filter(entry=>Array.isArray(entry)&&entry.length>0).map(entry=>Object.freeze([...entry]));return[Object.freeze([...resolved])]}var followUpReads=new WeakMap;function refetchAfterCurrentRead(queryClient,query){if(followUpReads.has(query))return followUpReads.get(query);const read=()=>queryClient.refetchQueries({queryKey:query.queryKey,exact:true},{cancelRefetch:false});if(query.state.fetchStatus!==`fetching`)return read();const followUp=read().then(()=>{followUpReads.delete(query);return read()});followUpReads.set(query,followUp);return followUp}async function refreshQueriesWithoutCancelling(queryClient,queryKey){await queryClient.invalidateQueries({queryKey,refetchType:`none`});await nextTick$1();await Promise.all(queryClient.getQueryCache().findAll({queryKey,type:`active`}).map(query=>refetchAfterCurrentRead(queryClient,query)))}function useRealtimeQueryInvalidation({event=``,enabled=true,matches,queryKey=null,onEvent}){const queryClient=useQueryClient();const normalizedEvent=computed(()=>normalizeText$1(unref(event)));const active=computed(()=>resolveEnabledRef(enabled)&&Boolean(normalizedEvent.value));return{active:useRealtimeEvent({event:normalizedEvent,enabled:active,matches,onEvent:async context=>{if(onEvent)await onEvent(context);const keys=toQueryKeyList(queryKey);for(const key of keys)await refreshQueriesWithoutCancelling(queryClient,key)}}).active}}function useOperationRealtime({realtime=null,queryKey=null,enabled=true}={}){const source=normalizeRealtimeOptions(realtime);const eventList=[];if(Object.hasOwn(source,`event`)){const normalizedEvent=normalizeText$1(source.event);if(normalizedEvent)eventList.push(normalizedEvent)}if(Object.hasOwn(source,`events`)){if(!Array.isArray(source.events))throw new TypeError(`realtime.events must be an array when configured.`);for(const entry of source.events){const normalizedEvent=normalizeText$1(entry);if(!normalizedEvent||eventList.includes(normalizedEvent))continue;eventList.push(normalizedEvent)}}if(eventList.length<1)return null;const{matches,onEvent}=source;const resolvedQueryKey=Object.hasOwn(source,`queryKey`)?source.queryKey:queryKey;const active=computed(()=>{const sourceEnabled=Object.hasOwn(source,`enabled`)?source.enabled:true;return resolveEnabledRef(enabled)&&resolveEnabledRef(sourceEnabled)});const bindings=eventList.map(event=>useRealtimeQueryInvalidation({event,enabled:active,matches,queryKey:resolvedQueryKey,onEvent}));return{active:computed(()=>bindings.some(binding=>Boolean(binding.active.value)))}}function buildEndpointReadRequestOptions({method=`GET`,query=null,transport=null}={}){const requestOptions={method:String(method||`GET`).toUpperCase()};const normalizedQuery=resolveRequestQuery(query);if(normalizedQuery)requestOptions.query=normalizedQuery;if(transport&&typeof transport===`object`)requestOptions.transport=transport;return requestOptions}function resolveRequestQuery(value=null){const source=unref(value);if(!source||typeof source!==`object`||Array.isArray(source))return null;return source}function buildEndpointWriteRequestOptions({method=`PATCH`,body=void 0,options=null,transport=null}={}){const requestOptions={method:String(method||`PATCH`).toUpperCase(),...asPlainObject(options)};if(body!==void 0)requestOptions.body=body;if(transport&&typeof transport===`object`)requestOptions.transport=transport;return requestOptions}function useEndpointResource({queryKey,path=``,enabled=true,client=getHttpWebClient(),readMethod=`GET`,writeMethod=`PATCH`,readQuery,transport,refreshOnPull=false,realtime,queryOptions=null,mutationOptions=null,requestRecovery=null,requestRecoveryLabel=``,fallbackLoadError=`jskit.http.resource.loadFailed`,fallbackSaveError=`jskit.http.resource.saveFailed`}){const normalizedPath=computed(()=>resolveTextRef(path));const queryEnabled=computed(()=>resolveEnabledRef(enabled)&&Boolean(normalizedPath.value));const query=useQuery({queryKey,queryFn:({signal})=>{const requestPath=normalizedPath.value;if(!requestPath)throw new Error(`Resource path is required.`);return client.request(requestPath,{...buildEndpointReadRequestOptions({method:readMethod,query:readQuery,transport}),signal})},enabled:queryEnabled,...mergeRequestRecoveryQueryMeta(refreshOnPull?mergeQueryMeta(asPlainObject(queryOptions),{jskit:{refreshOnPull:true}}):asPlainObject(queryOptions),requestRecovery,{label:requestRecoveryLabel,method:readMethod})});const realtimeBinding=useOperationRealtime({realtime,queryKey,enabled:queryEnabled});const mutation=useMutation({mutationFn:async(request={})=>{const options=asPlainObject(request);const requestPath=resolveTextRef(options.path||normalizedPath.value);if(!requestPath)throw new Error(`Resource path is required.`);const method=String(options.method||writeMethod||`PATCH`).toUpperCase();const body=Object.hasOwn(options,`body`)?options.body:options.payload;return client.request(requestPath,buildEndpointWriteRequestOptions({method,body,options:options.options,transport}))},...asPlainObject(mutationOptions)});const data=computed(()=>query.data.value);const hasResolvedData=computed(()=>hasResolvedQueryData({query,data}));const isInitialLoading=computed(()=>Boolean(queryEnabled.value&&query.isPending.value&&!hasResolvedData.value));const isFetching=computed(()=>Boolean(queryEnabled.value&&query.isFetching.value));const isRefetching=computed(()=>Boolean(isFetching.value&&!isInitialLoading.value));const isLoading=computed(()=>Boolean(isInitialLoading.value||isFetching.value));const isSaving=computed(()=>Boolean(mutation.isPending.value));const loadError=computed(()=>toQueryErrorMessage(query.error.value,fallbackLoadError));const saveError=computed(()=>toQueryErrorMessage(mutation.error.value,fallbackSaveError));async function reload(){return query.refetch()}async function save(payload,options={}){return mutation.mutateAsync({...asPlainObject(options),payload})}return{query,mutation,data,isInitialLoading,isFetching,isRefetching,isLoading,isSaving,loadError,saveError,realtime:realtimeBinding,reload,save}}var PLACEMENT_LAYOUT_CLASSES=Object.freeze([`compact`,`medium`,`expanded`]);var WEB_PLACEMENT_SURFACE_ANY=`*`;function normalizeShellOutletTargetId(value=``){const normalizedValue=normalizeText$1(value);if(!normalizedValue)return``;const separatorIndex=normalizedValue.indexOf(`:`);if(separatorIndex<=0||separatorIndex>=normalizedValue.length-1)return``;const host=normalizeText$1(normalizedValue.slice(0,separatorIndex));const position=normalizeText$1(normalizedValue.slice(separatorIndex+1));if(!host||!position)return``;return`${host}:${position}`}function normalizeSemanticPlacementId(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(!normalizedValue||normalizedValue.includes(`:`)||!normalizedValue.includes(`.`))return``;const segments=normalizedValue.split(`.`);if(segments.length<2)return``;const normalizedSegments=[];for(const segment of segments){const normalizedSegment=normalizeText$1(segment);if(!/^[a-z0-9]+(?:[_-][a-z0-9]+)*$/.test(normalizedSegment))return``;normalizedSegments.push(normalizedSegment)}return normalizedSegments.join(`.`)}function normalizePlacementOwnerId(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(!normalizedValue)return``;if(!/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/.test(normalizedValue))return``;return normalizedValue}function normalizePlacementLayoutClass(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(PLACEMENT_LAYOUT_CLASSES.includes(normalizedValue))return normalizedValue;return``}function normalizePlacementKind(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(normalizedValue===`link`||normalizedValue===`component`)return normalizedValue;return``}function normalizePlacementSurfaceId(value=``){const normalizedValue=normalizeText$1(value).toLowerCase();if(!normalizedValue)return``;if(normalizedValue===`*`)return`*`;if(/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/.test(normalizedValue))return normalizedValue;return``}function normalizePlacementSurfaces$1(value){const candidates=Array.isArray(value)?value:value===void 0||value===null?[]:[value];if(candidates.length<1)return Object.freeze([`*`]);const normalized=[];const seen=new Set;for(const candidate of candidates){const surface=normalizePlacementSurfaceId(candidate);if(!surface||seen.has(surface))continue;if(surface===`*`)return Object.freeze([`*`]);seen.add(surface);normalized.push(surface)}if(normalized.length<1)return Object.freeze([`*`]);return Object.freeze(normalized)}function resolvePlacementTargetReference(value=``){const semanticId=normalizeSemanticPlacementId(value);if(semanticId)return Object.freeze({id:semanticId,type:`semantic`});const concreteId=normalizeShellOutletTargetId(value);if(concreteId)return Object.freeze({id:concreteId,type:`concrete`});return null}function normalizePlacementRenderers(value={}){const record=normalizeObject(value);const renderers={};for(const[key,rendererToken]of Object.entries(record)){const kind=normalizePlacementKind(key);const token=normalizeText$1(rendererToken);if(!kind||!token)continue;renderers[kind]=token}return Object.freeze(renderers)}function normalizePlacementTopologyVariant(value={},{context=`placement topology variant`}={}){const record=normalizeObject(value);const outlet=normalizeShellOutletTargetId(record.outlet||record.target);if(!outlet)throw new Error(`${normalizeText$1(context)||`placement topology variant`} requires outlet in "host:position" format.`);return Object.freeze({outlet,renderers:normalizePlacementRenderers(record.renderers)})}function normalizePlacementTopologyEntry(value={},{context=`placement topology`}={}){const record=normalizeObject(value);const resolvedContext=normalizeText$1(context)||`placement topology`;const id=normalizeSemanticPlacementId(record.id||record.target);if(!id)throw new Error(`${resolvedContext} requires semantic placement id in "area.slot" format.`);const owner=normalizePlacementOwnerId(record.owner);const surfaces=normalizePlacementSurfaces$1(record.surfaces);const variantsRecord=normalizeObject(record.variants);const variants={};for(const layoutClass of PLACEMENT_LAYOUT_CLASSES){const variant=variantsRecord[layoutClass];if(!variant)throw new Error(`${resolvedContext} "${id}" requires ${layoutClass} topology variant.`);variants[layoutClass]=normalizePlacementTopologyVariant(variant,{context:`${resolvedContext} "${id}" ${layoutClass}`})}return Object.freeze({id,owner,description:normalizeText$1(record.description),surfaces,default:record.default===true,variants:Object.freeze(variants)})}function normalizePlacementTopologyDefinition(value={},{context=`placement topology`}={}){const record=normalizeObject(value);const entries=Array.isArray(record.placements)?record.placements:Array.isArray(value)?value:[];const normalized=[];const seen=new Set;for(const entry of entries){const placement=normalizePlacementTopologyEntry(entry,{context});const key=`${placement.id}::${placement.owner||``}`;if(seen.has(key))throw new Error(`${normalizeText$1(context)||`placement topology`} contains duplicate semantic placement "${placement.id}"${placement.owner?` for owner "${placement.owner}"`:``}.`);seen.add(key);normalized.push(placement)}return Object.freeze({placements:Object.freeze(normalized)})}function placeAlways(){return true}function isRenderableComponent(value){if(typeof value===`function`)return true;return isRecord(value)}function normalizeSurface(value){return normalizeText$1(value).toLowerCase()||`*`}function normalizePlacementSurface(value,{strict=false,source=`placement`}={}){const surface=normalizePlacementSurfaceId(value);if(!surface&&strict){const normalized=normalizeText$1(value).toLowerCase();throw new TypeError(normalized?`${source} surface "${normalized}" is invalid.`:`${source} requires surface id or "*".`)}return surface}function toInteger(value,fallback=1e3){const numeric=Number(value);if(!Number.isFinite(numeric))return fallback;return Math.trunc(numeric)}function normalizePlacementTarget(value,{strict=false,source=`placement`}={}){const reference=resolvePlacementTargetReference(String(value||``).toLowerCase());if(reference?.id)return reference.id;if(strict)throw new TypeError(`${source} requires semantic target in "area.slot" format or internal concrete target in "host:position" format.`);return``}function normalizePlacementSurfaces(value,{strict=false,source=`placement`}={}){if(strict){const candidates=Array.isArray(value)?value:value===void 0||value===null?[]:[value];for(const candidate of candidates)if(normalizePlacementSurface(candidate,{strict,source})===`*`)break}return normalizePlacementSurfaces$1(value)}function normalizePlacementDefinition(value,{strict=false,source=`placement`}={}){if(!isRecord(value)){if(strict)throw new TypeError(`${source} must be an object.`);return null}const id=normalizeText$1(value.id);if(!id){if(strict)throw new TypeError(`${source} requires id.`);return null}const target=normalizePlacementTarget(value.target,{strict,source:`${source} "${id}"`});if(!target)return null;const targetReference=resolvePlacementTargetReference(target);const internal=value.internal===true;if(targetReference?.type===`concrete`&&internal!==true){if(strict)throw new TypeError(`${source} "${id}" targets concrete outlet "${target}" without internal: true.`);return null}const owner=normalizeText$1(value.owner).toLowerCase();const kind=normalizePlacementKind(value.kind)||(normalizeText$1(value.componentToken)?`component`:`link`);const componentToken=normalizeText$1(value.componentToken);if(kind===`component`&&!componentToken){if(strict)throw new TypeError(`${source} "${id}" requires componentToken.`);return null}const props=isRecord(value.props)?{...value.props}:{};const when=value.when||placeAlways;const surfaces=normalizePlacementSurfaces(value.surfaces,{strict,source:`${source} "${id}"`});return Object.freeze({id,target,targetType:targetReference?.type||``,owner,kind,surfaces,order:toInteger(value.order,1e3),componentToken,props,when,enabled:value.enabled!==false,internal})}function definePlacement(value={}){return normalizePlacementDefinition(value,{strict:true,source:`placement contribution`})}function createPlacementRegistry({entries=[]}={}){const placements=[];const ids=new Set;function addPlacement(value={}){const placement=definePlacement(value);if(ids.has(placement.id))return false;ids.add(placement.id);placements.push(placement);return true}for(const entry of Array.isArray(entries)?entries:[])addPlacement(entry);function hasPlacement(id){return ids.has(String(id||``).trim())}function build(){return Object.freeze([...placements])}return Object.freeze({addPlacement,hasPlacement,build})}var SHELL_WEB_PLACEMENT_RUNTIME_KEY=`jskit.shell-web.runtime.web-placement.client`;var NO_WEB_PLACEMENT_RUNTIME=Object.freeze({replacePlacements(){},replacePlacementTopology(){},getPlacements(){return Object.freeze([])},getContext(){return Object.freeze({})},setContext(){return Object.freeze({})},subscribe(){return()=>{}},getRevision(){return 0}});function useWebPlacementRuntime(){return inject$1(SHELL_WEB_PLACEMENT_RUNTIME_KEY,NO_WEB_PLACEMENT_RUNTIME)}function followWebPlacementRuntime(runtime,listener){let unsubscribe=null;onMounted(()=>{unsubscribe=runtime.subscribe(listener)});onBeforeUnmount(()=>{if(unsubscribe){unsubscribe();unsubscribe=null}})}function useWebPlacementContext(){const runtime=useWebPlacementRuntime();const context=shallowRef(runtime.getContext());followWebPlacementRuntime(runtime,()=>{context.value=runtime.getContext()});function mergeContext(value={},source=`component`){context.value=runtime.setContext(value,{source});return context.value}function replaceContext(value={},source=`component`){context.value=runtime.setContext(value,{replace:true,source});return context.value}return{context,mergeContext,replaceContext}}function useWebPlacementRevision(runtime){const revision=ref(runtime.getRevision());followWebPlacementRuntime(runtime,event=>{revision.value=event.revision});return revision}function pageWindow(){return typeof window!==`undefined`?window:null}function pageDocument(){return typeof document!==`undefined`?document:null}function pagePathname(){return String(pageWindow()?.location?.pathname||``).trim()}function pageOrigin(){return String(pageWindow()?.location?.origin||``)}function pageTitle(){return String(pageDocument()?.title||``)}function pageViewportWidth(){return Number(pageWindow()?.innerWidth||0)}function resolveRuntimePathname(candidate=``){return String(candidate||``).trim()||pagePathname()||`/`}var EMPTY_SURFACE_CONFIG=Object.freeze({tenancyMode:``,defaultSurfaceId:``,enabledSurfaceIds:Object.freeze([]),surfacesById:Object.freeze({})});function normalizeSurfaceIdList(value){if(!Array.isArray(value))return[];const seen=new Set;const normalized=[];for(const candidate of value){const surfaceId=normalizeLowerText(candidate);if(!surfaceId||seen.has(surfaceId))continue;seen.add(surfaceId);normalized.push(surfaceId)}return normalized}function normalizeSurfaceConfig(surfaceConfig={}){const source=isRecord(surfaceConfig)?surfaceConfig:{};const enabledSurfaceIds=normalizeSurfaceIdList(source.enabledSurfaceIds);const enabledSet=new Set(enabledSurfaceIds);const rawSurfacesById=isRecord(source.surfacesById)?source.surfacesById:{};const normalizedSurfacesById={};for(const[rawSurfaceId,rawDefinition]of Object.entries(rawSurfacesById)){const definition=isRecord(rawDefinition)?rawDefinition:{};const surfaceId=normalizeLowerText(definition.id||rawSurfaceId);if(!surfaceId)continue;const pagesRoot=normalizeSurfacePagesRoot(definition.pagesRoot);const routeBase=String(definition.routeBase||deriveSurfaceRouteBaseFromPagesRoot(pagesRoot)).trim()||`/`;const enabled=enabledSet.size>0?enabledSet.has(surfaceId):definition.enabled!==false;normalizedSurfacesById[surfaceId]=Object.freeze({...definition,id:surfaceId,pagesRoot,routeBase,enabled})}const derivedEnabledSurfaceIds=enabledSurfaceIds.length>0?enabledSurfaceIds.filter(surfaceId=>Boolean(normalizedSurfacesById[surfaceId])):Object.values(normalizedSurfacesById).filter(definition=>definition.enabled).map(definition=>definition.id);const defaultSurfaceId=normalizeLowerText(source.defaultSurfaceId);const resolvedDefaultSurfaceId=normalizedSurfacesById[defaultSurfaceId]?defaultSurfaceId:derivedEnabledSurfaceIds[0]||Object.keys(normalizedSurfacesById)[0]||``;return Object.freeze({tenancyMode:String(source.tenancyMode||``).trim().toLowerCase(),defaultSurfaceId:resolvedDefaultSurfaceId,enabledSurfaceIds:Object.freeze([...derivedEnabledSurfaceIds]),surfacesById:Object.freeze({...normalizedSurfacesById})})}function buildSurfaceConfigContext(surfaceRuntime,{tenancyMode=``}={}){const surfacesById={};for(const definition of surfaceRuntime.listSurfaceDefinitions()){const surfaceId=normalizeLowerText(definition.id);if(!surfaceId)continue;surfacesById[surfaceId]=definition}return normalizeSurfaceConfig({tenancyMode:String(tenancyMode||``).trim().toLowerCase(),defaultSurfaceId:surfaceRuntime.DEFAULT_SURFACE_ID,enabledSurfaceIds:surfaceRuntime.listEnabledSurfaceIds(),surfacesById})}function readPlacementSurfaceConfig(contextValue=null){return normalizeSurfaceConfig((isRecord(contextValue)?contextValue:{}).surfaceConfig)}function resolveSurfaceDefinitionFromPlacementContext(contextValue=null,surfaceId=``){const surfaceConfig=readPlacementSurfaceConfig(contextValue);const normalizedSurfaceId=normalizeLowerText(surfaceId);if(!normalizedSurfaceId)return null;return surfaceConfig.surfacesById[normalizedSurfaceId]||null}function joinSurfacePath(surfacePrefix=``,pathname=``){const normalizedPrefix=normalizePathname$1(surfacePrefix||`/`);const rawPathname=String(pathname||``).trim();if(!rawPathname)return normalizedPrefix;const normalizedPathname=(rawPathname.startsWith(`/`)?rawPathname:`/${rawPathname}`).replace(/\/{2,}/g,`/`);const compacted=(normalizedPrefix===`/`?normalizedPathname:`${normalizedPrefix}${normalizedPathname}`).replace(/\/{2,}/g,`/`);if(!compacted)return`/`;return compacted===`/`?compacted:compacted.replace(/\/+$/,``)||`/`}function resolveSurfaceRootPathFromPlacementContext(contextValue=null,surfaceId=``){return joinSurfacePath(resolveSurfaceDefinitionFromPlacementContext(contextValue,surfaceId)?.routeBase,``)}function decodePathSegment(segment=``){try{return decodeURIComponent(segment)}catch{return segment}}function resolveSurfaceRouteParamsFromPlacementPathname(contextValue=null,surfaceId=``,pathname=``){const surfaceDefinition=resolveSurfaceDefinitionFromPlacementContext(contextValue,surfaceId);if(!surfaceDefinition)return{};const routeBaseSegments=normalizePathname$1(surfaceDefinition.routeBase).split(`/`).filter(Boolean);const pathSegments=normalizePathname$1(pathname).split(`/`).filter(Boolean);const params={};for(const[index,routeBaseSegment]of routeBaseSegments.entries()){const pathSegment=pathSegments[index];if(!pathSegment)return{};if(routeBaseSegment.startsWith(`:`)&&routeBaseSegment.length>1)params[routeBaseSegment.slice(1)]=decodePathSegment(pathSegment);else if(routeBaseSegment!==pathSegment)return{}}return params}function normalizeSurfaceOrigin(originValue=``){const rawOrigin=String(originValue||``).trim();if(!rawOrigin)return``;try{const parsed=new URL(rawOrigin);if(parsed.protocol!==`http:`&&parsed.protocol!==`https:`)return``;return parsed.origin}catch{return``}}function resolveRuntimeOrigin(currentOrigin=``){return normalizeSurfaceOrigin(currentOrigin)||normalizeSurfaceOrigin(pageOrigin())}function resolveSurfaceNavigationTargetFromPlacementContext(contextValue=null,{path=`/`,surfaceId=``,currentOrigin=``}={}){const rawPath=String(path||``).trim()||`/`;if(isExternalLinkTarget(rawPath))return Object.freeze({href:rawPath,sameOrigin:false,surfaceId:normalizeLowerText(surfaceId),external:true});const{pathname,search,hash}=splitPathQueryHash(rawPath);const normalizedPathname=normalizePathname$1(pathname||`/`);const normalizedPath=`${normalizedPathname}${search}${hash}`;const resolvedSurfaceId=normalizeLowerText(surfaceId)||resolveSurfaceIdFromPlacementPathname(contextValue,normalizedPathname)||``;const targetOrigin=normalizeSurfaceOrigin((resolvedSurfaceId?resolveSurfaceDefinitionFromPlacementContext(contextValue,resolvedSurfaceId):null)?.origin||``);const runtimeOrigin=resolveRuntimeOrigin(currentOrigin);if(!targetOrigin)return Object.freeze({href:normalizedPath,sameOrigin:true,surfaceId:resolvedSurfaceId,external:false});if(runtimeOrigin&&targetOrigin===runtimeOrigin)return Object.freeze({href:normalizedPath,sameOrigin:true,surfaceId:resolvedSurfaceId,external:false});return Object.freeze({href:`${targetOrigin}${normalizedPath}`,sameOrigin:false,surfaceId:resolvedSurfaceId,external:false})}function createPlacementSurfacePathHelpers(surfaceConfig=EMPTY_SURFACE_CONFIG){const surfacesById=isRecord(surfaceConfig.surfacesById)?surfaceConfig.surfacesById:{};const defaultSurfaceId=normalizeLowerText(surfaceConfig.defaultSurfaceId);const fallbackSurfaceId=Object.keys(surfacesById)[0]||``;const resolvedDefaultSurfaceId=defaultSurfaceId&&surfacesById[defaultSurfaceId]?defaultSurfaceId:fallbackSurfaceId;if(!resolvedDefaultSurfaceId)return null;return createSurfacePathHelpers({defaultSurfaceId:resolvedDefaultSurfaceId,surfaceDefinitions:Object.values(surfacesById)})}function resolveSurfaceIdFromPlacementPathname(contextValue=null,pathname=``){const surfaceConfig=readPlacementSurfaceConfig(contextValue);const normalizedPathname=normalizePathname$1(pathname);const pathHelpers=createPlacementSurfacePathHelpers(surfaceConfig);if(!pathHelpers)return``;return pathHelpers.resolveSurfaceFromPathname(normalizedPathname)}var{t:t$17}=useJskitText();function asPermissionList(value){if(Array.isArray(value))return value;if(value===void 0||value===null||value===``)return[];return[value]}function useAccess({enabled=true,access=`always`,hasPermissionRequirements=false}={}){const normalizedAccessMode=normalizeAccessMode(access);const accessRequired=resolveAccessModeEnabled(normalizedAccessMode,{hasPermissionRequirements:hasPermissionRequirements===true});const{context:placementContext}=useWebPlacementContext();const queryEnabled=computed(()=>resolveEnabledRef(enabled)&&accessRequired);const hasPlacementPermissions=computed(()=>{const source=placementContext.value;if(!source||typeof source!==`object`)return false;return Object.hasOwn(source,`permissions`)});const placementPermissions=computed(()=>normalizePermissionList(placementContext.value?.permissions));const permissions=computed(()=>{if(!queryEnabled.value||!hasPlacementPermissions.value)return[];return placementPermissions.value});const permissionsUnavailableError=computed(()=>{if(!queryEnabled.value||hasPlacementPermissions.value)return``;return t$17(`jskit.http.access.permissionsUnavailable`)});const awaitingPlacementPermissions=computed(()=>queryEnabled.value&&!hasPlacementPermissions.value);function can(permission){return hasPermission(permissions.value,permission)}function canAny(requiredPermissions){const list=asPermissionList(requiredPermissions);if(list.length<1)return true;for(const entry of list)if(can(entry))return true;return false}function canAll(requiredPermissions){const list=asPermissionList(requiredPermissions);if(list.length<1)return true;for(const entry of list)if(!can(entry))return false;return true}return{accessMode:normalizedAccessMode,accessRequired,permissions,permissionsUnavailableError,awaitingPlacementPermissions,can,canAny,canAll}}function normalizeRouteParams(params=null){if(!params||typeof params!==`object`||Array.isArray(params))return{};const output={};for(const[rawKey,rawValue]of Object.entries(params)){const key=normalizeText$1(rawKey);if(!key)continue;const value=Array.isArray(rawValue)?rawValue[0]:rawValue;const normalizedValue=normalizeText$1(value);if(normalizedValue)output[key]=normalizedValue}return output}function fillPathParams(pathTemplate=`/`,{params={},strictParams=true,label=`route params`}={}){const template=String(pathTemplate||`/`);const suffixStart=template.search(/[?#]/u);const pathPart=suffixStart<0?template:template.slice(0,suffixStart);const suffix=suffixStart<0?``:template.slice(suffixStart);const normalizedParams=normalizeRouteParams(params);const missingParams=new Set;const outputPath=pathPart.replace(/(^|\/):([A-Za-z0-9_]+)/g,(full,start,paramName)=>{const paramValue=normalizedParams[paramName];if(!paramValue){missingParams.add(paramName);return full}return`${start}${encodeURIComponent(paramValue)}`});if(strictParams&&missingParams.size>0){const missing=[...missingParams].sort().join(`, `);throw new Error(`Missing required ${label}: ${missing}.`)}return`${outputPath}${suffix}`}function resolveSurfaceBasePath(context=null,surface=``,{params={},strictParams=true}={}){const normalizedSurface=normalizeLowerText(surface);if(normalizedSurface&&resolveSurfaceDefinitionFromPlacementContext(context,normalizedSurface))return fillPathParams(resolveSurfaceRootPathFromPlacementContext(context,normalizedSurface),{params,strictParams,label:`surface route params for "${normalizedSurface}"`});if(!normalizedSurface)return`/`;return normalizePathname$1(`/${normalizedSurface}`)}function resolveShellLinkPath({context=null,surface=``,explicitTo=``,relativePath=`/`,surfaceRelativePath=``,params={},strictParams=true}={}){const explicitTarget=String(explicitTo||``).trim();if(explicitTarget)return explicitTarget;const normalizedSurface=normalizeLowerText(surface);const nextRelativePath=String(surfaceRelativePath||``).trim()||String(relativePath||``).trim()||`/`;const nextSurfaceBasePath=resolveSurfaceBasePath(context,normalizedSurface,{params,strictParams});const filledRelativePath=isExternalLinkTarget(nextRelativePath)?nextRelativePath:fillPathParams(nextRelativePath,{params,strictParams,label:`route params for "${nextRelativePath}"`});return resolveLinkPath(nextSurfaceBasePath,filledRelativePath)}function useShellLinkResolver({surface=``}={}){const{context:placementContext}=useWebPlacementContext();function resolve(relativePath=`/`,options={}){return resolveShellLinkPath({context:placementContext.value,surface:String(unref(options.surface??surface)||``),explicitTo:options.explicitTo,relativePath,surfaceRelativePath:options.surfaceRelativePath,params:options.params,strictParams:options.strictParams!==false})}return{resolve}}function useSurfaceRouteContext(){const route=useRoute$1();const{context:placementContext,mergeContext:mergePlacementContext}=useWebPlacementContext();const routePath=computed(()=>resolveRuntimePathname(route.path));return{route,routePath,placementContext,mergePlacementContext,currentSurfaceId:computed(()=>resolveSurfaceIdFromPlacementPathname(placementContext.value,routePath.value))}}function normalizePathSuffix(value=``){const raw=normalizeText$1(unref(value));if(!raw)return``;return raw.startsWith(`/`)?raw:`/${raw}`}function resolveSurfaceId(value,fallback=``){const normalized=normalizeText$1(unref(value)).toLowerCase();if(normalized&&normalized!==`*`)return normalized;const normalizedFallback=normalizeText$1(unref(fallback)).toLowerCase();if(normalizedFallback&&normalizedFallback!==`*`)return normalizedFallback;return``}function resolveDefaultSurfaceIdFromPlacementContext(placementContext=null){return resolveSurfaceId(placementContext?.surfaceConfig?.defaultSurfaceId,``)}function resolveRouteParams(baseParams={},overrideParams=null){return{...normalizeRouteParams(baseParams),...normalizeRouteParams(overrideParams)}}function usePaths({routeContext=useSurfaceRouteContext()}={}){const shellLinkResolver=useShellLinkResolver();const routeParams=computed(()=>normalizeRouteParams(routeContext.route.params));function page(relativePath=`/`,options={}){const source=normalizeObject(options);if(source.scope===`global`)return shellLinkResolver.resolve(relativePath,{surface:``,params:resolveRouteParams(routeParams.value,source.params),strictParams:source.strictParams!==false});const surface=resolveSurfaceId(source.surface,routeContext.currentSurfaceId.value)||resolveDefaultSurfaceIdFromPlacementContext(routeContext.placementContext.value);if(!surface)return``;return shellLinkResolver.resolve(relativePath,{surface,explicitTo:source.explicitTo,surfaceRelativePath:source.surfaceRelativePath,params:resolveRouteParams(routeParams.value,source.params),strictParams:source.strictParams!==false})}function api(relativePath=``,options={}){const source=normalizeObject(options);const surface=resolveSurfaceId(source.surface,routeContext.currentSurfaceId.value)||resolveDefaultSurfaceIdFromPlacementContext(routeContext.placementContext.value);const suffix=normalizePathSuffix(relativePath);if(!suffix)throw new TypeError(`usePaths().api(relativePath) requires a non-empty relativePath.`);const routeBase=resolveSurfaceDefinitionFromPlacementContext(routeContext.placementContext.value,surface)?.routeBase||`/`;return resolveScopedApiBasePath({routeBase,relativePath:suffix,params:resolveRouteParams(routeParams.value,source.params),strictParams:source.strictParams!==false})}return{route:routeContext.route,placementContext:routeContext.placementContext,currentSurfaceId:routeContext.currentSurfaceId,routeParams,page,api}}function toRouteParamValue(value){if(Array.isArray(value))return toRouteParamValue(value[0]);if(value==null)return``;return String(value).trim()}function extractRouteParamNames(pathTemplate=``){const normalizedTemplate=String(pathTemplate||``).trim();if(!normalizedTemplate)return[];const names=[];const seen=new Set;const pattern=/:([A-Za-z][A-Za-z0-9_]*)/g;let match=null;while((match=pattern.exec(normalizedTemplate))!=null){const name=String(match[1]||``).trim();if(!name||seen.has(name))continue;seen.add(name);names.push(name)}return names}var{t:t$16}=useJskitText();function resolveScopedRouteParamNames(placementContext=null,surfaceId=``){const routeBase=resolveSurfaceDefinitionFromPlacementContext(placementContext,surfaceId)?.routeBase||`/`;return extractRouteParamNames(resolveScopedRouteBase(routeBase))}function useScopeRuntime({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,accessMode=`auto`,hasPermissionRequirements=false}={}){const normalizedOwnershipFilter=normalizeOwnershipFilter(ownershipFilter);const normalizedAccessMode=ensureAccessModeCompatibility({accessMode,hasPermissionRequirements,caller:`useScopeRuntime`});const accessRequired=resolveAccessModeEnabled(normalizedAccessMode,{hasPermissionRequirements});const routeContext=useSurfaceRouteContext();const paths=usePaths({routeContext});const resolvedSurfaceId=computed(()=>{const explicitSurfaceId=normalizeLowerText(surfaceId);if(explicitSurfaceId)return explicitSurfaceId;return normalizeLowerText(routeContext.currentSurfaceId.value)});const scopedRouteParamNames=computed(()=>resolveScopedRouteParamNames(routeContext.placementContext.value,resolvedSurfaceId.value));const routeScopeParams=computed(()=>{const source=paths.routeParams.value;const next={};for(const paramName of scopedRouteParamNames.value){const paramValue=toRouteParamValue(source[paramName]);if(paramValue)next[paramName]=paramValue}return Object.freeze(next)});const missingScopedRouteParamNames=computed(()=>scopedRouteParamNames.value.filter(paramName=>!routeScopeParams.value[paramName]));const requiresScopedRouteParams=computed(()=>scopedRouteParamNames.value.length>0);const hasRequiredRouteScope=computed(()=>missingScopedRouteParamNames.value.length<1);const scopeParamValue=computed(()=>{const[primaryScopeParamName=``]=scopedRouteParamNames.value;return primaryScopeParamName?routeScopeParams.value[primaryScopeParamName]||``:``});const routeScopeError=computed(()=>{if(!requiresScopedRouteParams.value||hasRequiredRouteScope.value)return``;const missingParams=missingScopedRouteParamNames.value.join(`, `);return t$16(`jskit.http.access.routeParamsRequired`,{params:missingParams,surface:resolvedSurfaceId.value||`<unknown>`})});const accessRuntime=useAccess({enabled:computed(()=>accessRequired&&hasRequiredRouteScope.value),access:normalizedAccessMode,hasPermissionRequirements});function resolveApiPath(apiSuffix=``,context={}){if(routeScopeError.value)return``;const suffix=resolveApiSuffix(apiSuffix,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter,...asPlainObject(context)});return paths.api(suffix,{surface:resolvedSurfaceId.value,params:routeScopeParams.value})}function requireRouteScope(caller=`useScopeRuntime`){if(routeScopeError.value)throw new Error(`${caller}: ${routeScopeError.value}`)}return{normalizedOwnershipFilter,requiresScopedRouteParams:requiresScopedRouteParams.value,resolvedSurfaceId,accessMode:normalizedAccessMode,accessRequired,routeContext,scopedRouteParamNames,routeScopeParams,scopeParamValue,hasRequiredRouteScope,routeScopeError,access:accessRuntime,resolveApiPath,requireRouteScope}}function normalizePermissionSets(permissionSets={}){const source=permissionSets&&typeof permissionSets===`object`&&!Array.isArray(permissionSets)?permissionSets:{};const normalized={};for(const[key,value]of Object.entries(source))normalized[key]=normalizePermissions(value);return normalized}function hasAnyPermissions(permissionSets={}){for(const list of Object.values(permissionSets))if(Array.isArray(list)&&list.length>0)return true;return false}function useOperationScope({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,access=`auto`,apiSuffix=``,model,readEnabled=true,queryKeyFactory,permissionSets={},realtime}){const normalizedPermissionSets=normalizePermissionSets(permissionSets);const scopeRuntime=useScopeRuntime({ownershipFilter,surfaceId,accessMode:access,hasPermissionRequirements:hasAnyPermissions(normalizedPermissionSets)});const normalizedOwnershipFilter=scopeRuntime.normalizedOwnershipFilter;const routeContext=scopeRuntime.routeContext;const scopeParamValue=scopeRuntime.scopeParamValue;const hasRequiredRouteScope=scopeRuntime.hasRequiredRouteScope;const accessRuntime=scopeRuntime.access;const apiPath=computed(()=>scopeRuntime.resolveApiPath(apiSuffix,{model}));const queryEnabled=computed(()=>resolveEnabled(readEnabled,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter,model}));const queryKey=computed(()=>resolveQueryKey(queryKeyFactory,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter}));const realtimeBinding=useOperationRealtime({realtime,queryKey:typeof queryKeyFactory===`function`?queryKey:null,enabled:computed(()=>hasRequiredRouteScope.value&&Boolean(apiPath.value))});function queryCanRun(accessGate=true){return computed(()=>queryEnabled.value&&hasRequiredRouteScope.value&&Boolean(apiPath.value)&&Boolean(unref(accessGate)))}function permissionGate(key=``){const list=normalizedPermissionSets[String(key||``)]||[];return computed(()=>resolvePermissionAccess(accessRuntime,list))}function loadError(baseError=``){return computed(()=>{if(scopeRuntime.routeScopeError.value)return scopeRuntime.routeScopeError.value;const permissionsError=String(accessRuntime.permissionsUnavailableError.value||``).trim();if(permissionsError)return permissionsError;if(baseError===void 0||baseError===null||baseError===``)return``;return String(unref(baseError)||``).trim()})}function isLoading(baseLoading=false){return computed(()=>Boolean(unref(baseLoading))||accessRuntime.awaitingPlacementPermissions.value)}return{scopeRuntime,routeContext,normalizedOwnershipFilter,scopeParamValue,hasRequiredRouteScope,access:accessRuntime,apiPath,queryEnabled,queryKey,queryCanRun,realtime:realtimeBinding,permissionGate,loadError,isLoading}}function useUiFeedback({initialType=`success`,source=`http-web.ui-feedback`,successChannel=``,warningChannel=``,errorChannel=``,dedupeWindowMs=2e3}={}){const message=ref(``);const messageType=ref(String(initialType||`success`));const errorRuntime=useShellWebErrorRuntime();const normalizedSource=String(source||``).trim()||`http-web.ui-feedback`;let lastErrorPresentation=null;function rememberErrorPresentation(reportResult=null){const presentationId=String(reportResult?.presentationId||``).trim();const presenterId=String(reportResult?.decision?.presenterId||``).trim();if(!presentationId||!presenterId)return;lastErrorPresentation=Object.freeze({presentationId,presenterId})}function dismissLastErrorPresentation(){if(!lastErrorPresentation)return;errorRuntime.dismiss(lastErrorPresentation.presentationId,{presenterId:lastErrorPresentation.presenterId});lastErrorPresentation=null}function clear(){message.value=``}function reportDone(severity,channel,nextMessage){messageType.value=severity;const normalizedMessage=String(nextMessage||``).trim();message.value=normalizedMessage;dismissLastErrorPresentation();if(!normalizedMessage)return;errorRuntime.report({source:normalizedSource,message:normalizedMessage,intent:`action-feedback`,severity,channel,dedupeKey:`${normalizedSource}:${severity}:${normalizedMessage}`,dedupeWindowMs})}function success(nextMessage=``){reportDone(`success`,successChannel,nextMessage)}function warning(nextMessage=``){reportDone(`warning`,warningChannel,nextMessage)}function error(errorValue,fallbackMessage=``){messageType.value=`error`;message.value=toUiErrorMessage(errorValue,fallbackMessage);if(!message.value)return;const reportResult=errorRuntime.report({source:normalizedSource,message:message.value,cause:errorValue||null,intent:`action-feedback`,severity:`error`,channel:errorChannel,dedupeKey:`${normalizedSource}:error:${message.value}`,dedupeWindowMs});if(!reportResult?.skipped)rememberErrorPresentation(reportResult)}return{message,messageType,clear,success,warning,error}}function normalizeFieldErrorKeys(keys){return Array.isArray(keys)?keys.map(entry=>String(entry||``).trim()).filter(Boolean):[]}function useFieldErrorBag(keys=[]){const normalizedKeys=normalizeFieldErrorKeys(keys);const hasFixedKeys=normalizedKeys.length>0;const errors=reactive(Object.fromEntries(normalizedKeys.map(key=>[key,``])));function clear(){const keysToClear=hasFixedKeys?normalizedKeys:Object.keys(errors);for(const key of keysToClear)errors[key]=``}function apply(source={}){const fieldErrorMap=source&&typeof source===`object`?source:{};if(hasFixedKeys){for(const key of normalizedKeys)errors[key]=String(fieldErrorMap[key]||``);return}clear();for(const[field,message]of Object.entries(fieldErrorMap)){const key=String(field||``).trim();if(!key)continue;errors[key]=String(message||``)}}function set(field,message){const key=String(field||``).trim();if(!key)return;if(hasFixedKeys&&!(key in errors))return;errors[key]=String(message||``)}return{errors,clear,apply,set}}var{t:t$15}=useJskitText();function normalizeMessage(value){return String(value||``).trim()}function noRetryAction(){return null}function setupOperationErrorReporting({enabled=true,source=`http-web.operation`,loadError=null,notFoundError=null,loadActionFactory=noRetryAction,notFoundActionFactory=noRetryAction,loadChannel=``,notFoundChannel=``,loadSeverity=`error`,notFoundSeverity=`warning`,dedupeWindowMs=2e3}={}){if(!enabled)return;const runtime=useShellWebErrorRuntime();const normalizedSource=normalizeMessage(source)||`http-web.operation`;function watchMessage(value,{kind=`load`,channel=``,intent=`resource-load`,severity=`error`,actionFactory=noRetryAction}={}){let lastMessage=``;let lastPresentationId=``;watch(()=>normalizeMessage(value.value),nextMessage=>{if(!nextMessage){lastMessage=``;if(lastPresentationId){runtime.dismiss(lastPresentationId);lastPresentationId=``}return}if(nextMessage===lastMessage)return;lastMessage=nextMessage;const action=actionFactory({message:nextMessage,kind});const reportResult=runtime.report({source:normalizedSource,message:nextMessage,intent,severity,channel,action,dedupeKey:`${normalizedSource}:${kind}:${nextMessage}`,dedupeWindowMs});const nextPresentationId=String(reportResult?.presentationId||``).trim();if(nextPresentationId){if(lastPresentationId&&lastPresentationId!==nextPresentationId)runtime.dismiss(lastPresentationId);lastPresentationId=nextPresentationId}},{immediate:true})}if(loadError)watchMessage(loadError,{kind:`load`,channel:loadChannel,intent:`resource-load`,severity:loadSeverity,actionFactory:loadActionFactory});if(notFoundError)watchMessage(notFoundError,{kind:`not-found`,channel:notFoundChannel,intent:`resource-load`,severity:notFoundSeverity,actionFactory:notFoundActionFactory})}function setupRouteChangeCleanup({enabled=true,route,feedback,onClear}){if(!enabled)return;watch(()=>route?.fullPath,()=>{feedback.clear();onClear()})}var CRUD_API_ACCESS_AUTHENTICATED=`authenticated`;var CRUD_API_ACCESS_PUBLIC=`public`;var CRUD_API_ACCESS_VALUES=Object.freeze([CRUD_API_ACCESS_AUTHENTICATED,CRUD_API_ACCESS_PUBLIC]);var publicCrudClients=new WeakSet;function normalizeCrudApiAccess(value=``){const normalized=normalizeText$1(value).toLowerCase()||`authenticated`;if(CRUD_API_ACCESS_VALUES.includes(normalized))return normalized;throw new TypeError(`CRUD resource apiAccess must be one of: ${CRUD_API_ACCESS_VALUES.join(`, `)}. Received: ${String(value||``)||`(empty)`}`)}function resolveCrudHttpClient(resource=null,{client=getHttpWebClient()}={}){if(normalizeCrudApiAccess(resource?.apiAccess)!==`public`)return client;if(publicCrudClients.has(client))return client;const publicClient=Object.freeze({request(url,options={}){const requestOptions=options&&typeof options===`object`&&!Array.isArray(options)?options:{};return client.request(url,{...requestOptions,csrf:false})}});publicCrudClients.add(publicClient);return publicClient}function useCommand({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,access=`auto`,apiSuffix=``,runPermissions=[],writeMethod=`POST`,client,resource:commandResource=null,transport,placementSource=`http-web.command`,fallbackRunError=`jskit.http.feedback.actionFailed`,fieldErrorKeys,clearOnRouteChange=true,model,input,buildRawPayload,buildCommandPayload,buildCommandOptions,onRunSuccess,onRunError,suppressSuccessMessage=false,messages={},realtime}){const operationScope=useOperationScope({ownershipFilter,surfaceId,access,apiSuffix,model,readEnabled:false,permissionSets:{run:runPermissions},realtime});const routeContext=operationScope.routeContext;const canRun=operationScope.permissionGate(`run`);const endpointResource=useEndpointResource({path:operationScope.apiPath,enabled:false,client:resolveCrudHttpClient(commandResource,{client}),writeMethod,transport,fallbackSaveError:fallbackRunError});const feedback=useUiFeedback({source:`${placementSource}.feedback`});const fieldBag=useFieldErrorBag(fieldErrorKeys);const command=useCommandCore({model,resource:endpointResource,writeMethod,canRun,fieldBag,feedback,input,buildRawPayload,buildCommandPayload,buildCommandOptions,onRunSuccess,onRunError,suppressSuccessMessage:Boolean(suppressSuccessMessage),messages:{validation:`jskit.http.feedback.fixInvalidValues`,success:`jskit.http.feedback.completed`,error:String(fallbackRunError||`jskit.http.feedback.actionFailed`),...messages&&typeof messages===`object`?messages:{}}});setupRouteChangeCleanup({enabled:clearOnRouteChange,route:routeContext.route,feedback,onClear:fieldBag.clear});const loadError=operationScope.loadError();const isLoading=operationScope.isLoading();setupOperationErrorReporting({source:`${placementSource}.load`,loadError});return proxyRefs({canRun,isLoading,loadError,isRunning:command.running,fieldErrors:command.fieldErrors,message:command.message,messageType:command.messageType,run:command.run,resource:endpointResource})}function readRefOrGetterValue(value){return unref(typeof value===`function`?value():value)}function hasWindowFunction$1(name){return typeof window!==`undefined`&&typeof window[name]===`function`}function browserSessionStorage(){if(typeof window===`undefined`||!window.sessionStorage)return null;return window.sessionStorage}function pageRandomUUID(root=globalThis){return typeof root.crypto?.randomUUID===`function`?root.crypto.randomUUID():``}function reloadPage(){if(typeof window!==`undefined`)window.location.reload()}function writePageClipboardText(text){if(typeof navigator===`undefined`)return false;return typeof navigator.clipboard?.writeText===`function`?navigator.clipboard.writeText(text):void 0}function followMediaQuery(query,sync){if(!hasWindowFunction$1(`matchMedia`))return()=>{};const media=window.matchMedia(query);const listener=()=>sync(Boolean(media.matches));listener();if(typeof media.addEventListener===`function`){media.addEventListener(`change`,listener);return()=>media.removeEventListener(`change`,listener)}media.addListener(listener);return()=>media.removeListener(listener)}function videoFrameCallbacksAvailable(video){return typeof video.requestVideoFrameCallback===`function`}function dataTransferItemEntry(item){return item.webkitGetAsEntry?.()}var VIBE64_BROWSER_TAB_ORIGIN_KEY=`__vibe64BrowserTabOriginId`;var VIBE64_BROWSER_TAB_ORIGIN_STORAGE_KEY=`vibe64:browser-tab-origin-id`;function createBrowserTabOriginId(root=globalThis){const uuid=pageRandomUUID(root);if(uuid)return`tab:${uuid}`;return`tab:${Date.now().toString(36)}:${Math.random().toString(36).slice(2)}`}function browserTabSessionStorage(root=globalThis){try{return root?.sessionStorage||root?.window?.sessionStorage||null}catch{return null}}function readStoredBrowserTabOriginId(root=globalThis){try{return normalizeText$1(browserTabSessionStorage(root)?.getItem(VIBE64_BROWSER_TAB_ORIGIN_STORAGE_KEY))}catch{return``}}function writeStoredBrowserTabOriginId(root=globalThis,originId=``){const normalizedOriginId=normalizeText$1(originId);if(!normalizedOriginId)return;try{browserTabSessionStorage(root)?.setItem(VIBE64_BROWSER_TAB_ORIGIN_STORAGE_KEY,normalizedOriginId)}catch{}}function vibe64BrowserTabOriginId(root=globalThis){const existing=normalizeText$1(root?.[VIBE64_BROWSER_TAB_ORIGIN_KEY]);if(existing)return existing;const nextOriginId=readStoredBrowserTabOriginId(root)||createBrowserTabOriginId(root);writeStoredBrowserTabOriginId(root,nextOriginId);try{Object.defineProperty(root,VIBE64_BROWSER_TAB_ORIGIN_KEY,{configurable:false,enumerable:false,value:nextOriginId,writable:false})}catch{root[VIBE64_BROWSER_TAB_ORIGIN_KEY]=nextOriginId}return nextOriginId}function vibe64RealtimeOriginPayload(fields={},root=globalThis){return{...fields&&typeof fields===`object`&&!Array.isArray(fields)?fields:{},originId:vibe64BrowserTabOriginId(root)}}function vibe64RealtimePayloadFromCurrentTab(payload,{originId=vibe64BrowserTabOriginId()}={}){const payloadOriginId=normalizeText$1(payload.originId);const currentOriginId=normalizeText$1(originId);return Boolean(payloadOriginId&¤tOriginId&&payloadOriginId===currentOriginId)}var VIBE64_SESSIONS_API_SUFFIX=`/vibe64/sessions`;var VIBE64_ARCHIVED_SESSIONS_API_SUFFIX=`${VIBE64_SESSIONS_API_SUFFIX}/archived`;var VIBE64_ASSISTANTS_API_SUFFIX=`/vibe64/assistants/capabilities`;var VIBE64_ASSISTANT_MODEL_ACCESS_API_SUFFIX=`/vibe64/assistants/model-access`;var VIBE64_CURRENT_SESSION_API_SUFFIX=`${VIBE64_SESSIONS_API_SUFFIX}/current`;var VIBE64_API_SUFFIX=`/vibe64`;var VIBE64_SESSION_CHANGED_EVENT=`vibe64.session.changed`;var VIBE64_SESSION_SUMMARY_CHANGED_EVENT=`vibe64.session.summary.changed`;var VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT=`vibe64.source-editor.file.changed`;var VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT=`vibe64.source-editor.sync.error`;var VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT=`vibe64.source-editor.sync.ready`;var SELECTED_SESSION_STORAGE_KEY=`vibe64:selected-session-id`;function agentTurnControlPayloadFromContext(context={}){const source=context&&typeof context===`object`&&!Array.isArray(context)?context:{};const{agentSettings:_agentSettings,sessionId:_sessionId,...body}=source;return vibe64RealtimeOriginPayload({...body,...agentSettingsInputFromContext(source)})}function selectedSessionStorageKey(projectSlug){return vibe64ProjectScopedStorageKey(SELECTED_SESSION_STORAGE_KEY,projectSlug)}function vibe64SessionsQueryKey(surfaceId,ownershipFilter,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`sessions`]}function vibe64SessionQueryKey(surfaceId,ownershipFilter,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`session`]}function vibe64ProjectSetupQueryKey(projectSlug,sessionId=``){return[...vibe64SessionQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug),`project-onboarding`,...sessionId?[sessionId]:[]]}function vibe64SessionEventMatchesScope(payload={},{projectSlug=``}={}){return!payload.learningAttemptId&&(!payload.projectSlug||payload.projectSlug===projectSlug)}function vibe64AssistantCapabilitiesQueryKey(surfaceId,ownershipFilter,projectSlug,scope=`overview`){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`assistant-capabilities`,String(scope||`overview`)]}function encodePathSegment(value=``){return encodeURIComponent(String(value||``).trim())}function vibe64SessionPath(sessionsApiPath=``,sessionId=``,suffix=``){return`${sessionsApiPath}/${encodePathSegment(sessionId)}${suffix}`}function vibe64AssistantModelAccessPath(capabilitiesApiPath=``){return String(capabilitiesApiPath||``).replace(/\/assistants\/capabilities(?=\?|#|$)/u,`/assistants/model-access`)}function vibe64RepositoryApiPath(sessionsApiPath=``){const normalized=String(sessionsApiPath||``).replace(/\/+$/u,``);return normalized.endsWith(`/vibe64/sessions`)?`${normalized.slice(0,-16)}/vibe64/repository`:`${normalized}/repository`}function vibe64RepositoryHistoryPath(sessionsApiPath=``,options={}){const params=new URLSearchParams;const sessionId=String(options.sessionId||``).trim();const cursor=String(options.cursor||``).trim();if(sessionId)params.set(`sessionId`,sessionId);if(cursor)params.set(`cursor`,cursor);const query=params.toString();const base=`${vibe64RepositoryApiPath(sessionsApiPath)}/history`;return query?`${base}?${query}`:base}function vibe64RepositoryVersionFilesPath(sessionsApiPath=``,commit=``,options={}){const params=new URLSearchParams;const sessionId=String(options.sessionId||``).trim();const historySnapshotCommit=String(options.historySnapshotCommit||``).trim();if(sessionId)params.set(`sessionId`,sessionId);if(historySnapshotCommit)params.set(`historySnapshotCommit`,historySnapshotCommit);if(Number.isInteger(Number(options.offset))&&Number(options.offset)>0)params.set(`offset`,String(Number(options.offset)));if(Number.isInteger(Number(options.limit))&&Number(options.limit)>0)params.set(`limit`,String(Number(options.limit)));const query=params.toString();const base=`${vibe64RepositoryApiPath(sessionsApiPath)}/history/${encodePathSegment(commit)}/files`;return query?`${base}?${query}`:base}function vibe64RepositoryVersionDiffPath(sessionsApiPath=``,commit=``,sourcePath=``,options={}){const params=new URLSearchParams({path:String(sourcePath||``)});const sessionId=String(options.sessionId||``).trim();const historySnapshotCommit=String(options.historySnapshotCommit||``).trim();if(sessionId)params.set(`sessionId`,sessionId);if(historySnapshotCommit)params.set(`historySnapshotCommit`,historySnapshotCommit);return`${vibe64RepositoryApiPath(sessionsApiPath)}/history/${encodePathSegment(commit)}/diff?${params.toString()}`}function vibe64SessionChangesPath(sessionsApiPath=``,sessionId=``,options={}){const params=new URLSearchParams;if(Number.isInteger(Number(options.offset))&&Number(options.offset)>0)params.set(`offset`,String(Number(options.offset)));if(Number.isInteger(Number(options.limit))&&Number(options.limit)>0)params.set(`limit`,String(Number(options.limit)));const query=params.toString();const base=vibe64SessionPath(sessionsApiPath,sessionId,`/changes`);return query?`${base}?${query}`:base}function vibe64SessionCheckUpdatesPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/updates/check`)}function vibe64SessionChangeDiffPath(sessionsApiPath=``,sessionId=``,sourcePath=``){return`${vibe64SessionPath(sessionsApiPath,sessionId,`/changes/diff`)}?path=${encodeURIComponent(String(sourcePath||``))}`}function vibe64AgentAttachmentPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/agent-attachments`)}function vibe64AgentAttachmentFilePath(sessionsApiPath=``,sessionId=``,attachmentId=``){return`${vibe64AgentAttachmentPath(sessionsApiPath,sessionId)}/${encodePathSegment(attachmentId)}`}function vibe64TemporaryConversationsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/temporary-conversations`)}function vibe64TemporaryConversationPath(sessionsApiPath=``,sessionId=``,conversationId=``){return`${vibe64TemporaryConversationsPath(sessionsApiPath,sessionId)}/${encodePathSegment(conversationId)}`}function vibe64AgentTerminalPath(sessionsApiPath=``,sessionId=``,terminalSessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,terminalSessionId?`/agent-terminal/${encodePathSegment(terminalSessionId)}`:`/agent-terminal`)}function vibe64AgentTerminalControlTextPath(sessionsApiPath=``,sessionId=``,terminalSessionId=``){return`${vibe64AgentTerminalPath(sessionsApiPath,sessionId,terminalSessionId)}/control/text`}function vibe64ConversationLogPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/conversation-log`)}function vibe64SessionPromptHintsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/prompt-hints`)}function vibe64SessionPromptHintsCancelPath(sessionsApiPath=``,sessionId=``){return`${vibe64SessionPromptHintsPath(sessionsApiPath,sessionId)}/cancel`}function vibe64SessionPreviewStatePath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/preview-state`)}function vibe64OutputsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/outputs`)}function vibe64PreviewIdentityPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/preview-identity`)}function vibe64OutputRunPath(sessionsApiPath=``,sessionId=``,terminalSessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,terminalSessionId?`/output-runs/${encodePathSegment(terminalSessionId)}/terminal`:`/output-runs`)}function vibe64OutputRunStopPath(sessionsApiPath=``,sessionId=``,terminalSessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/output-runs/${encodePathSegment(terminalSessionId)}/stop`)}function vibe64OutputResultPath(sessionsApiPath=``,sessionId=``,resultId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/output-results/${encodePathSegment(resultId)}`)}function vibe64SourceEditorTreePath(sessionsApiPath=``,sessionId=``,options={}){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/tree`);const params=new URLSearchParams;const normalizedPath=String(options.path||``).trim();if(normalizedPath)params.set(`path`,normalizedPath);if(Number.isInteger(Number(options.offset))&&Number(options.offset)>0)params.set(`offset`,String(Number(options.offset)));if(Number.isInteger(Number(options.limit))&&Number(options.limit)>0)params.set(`limit`,String(Number(options.limit)));const query=params.toString();return query?`${basePath}?${query}`:basePath}function vibe64SourceEditorFilesPath(sessionsApiPath=``,sessionId=``,query=``){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/files`);const normalizedQuery=String(query||``).trim();return normalizedQuery?`${basePath}?q=${encodeURIComponent(normalizedQuery)}`:basePath}function vibe64SourceEditorSearchPath(sessionsApiPath=``,sessionId=``,query=``){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/search`);const normalizedQuery=String(query||``).trim();return normalizedQuery?`${basePath}?q=${encodeURIComponent(normalizedQuery)}`:basePath}function vibe64SourceEditorResolvePathPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/resolve-path`)}function vibe64SourceEditorFilePath(sessionsApiPath=``,sessionId=``,sourcePath=``){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/file`);const normalizedPath=String(sourcePath||``).trim();return normalizedPath?`${basePath}?path=${encodeURIComponent(normalizedPath)}`:basePath}function vibe64SourceEditorCreateFilePath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/file`)}function vibe64SourceEditorStarsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/stars`)}function vibe64SourceEditorDownloadPath(sessionsApiPath=``,sessionId=``,sourcePath=``){return`${vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/download`)}?path=${encodeURIComponent(sourcePath)}`}function vibe64SourceEditorChangesStreamPath(sessionsApiPath=``,sessionId=``,sourcePath=``){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/changes/stream`);const normalizedPath=String(sourcePath||``).trim();return normalizedPath?`${basePath}?path=${encodeURIComponent(normalizedPath)}`:basePath}function vibe64SourceEditorExplanationsPath(sessionsApiPath=``,sessionId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/explanations`)}function vibe64SourceEditorExplanationsStreamPath(sessionsApiPath=``,sessionId=``){return`${vibe64SourceEditorExplanationsPath(sessionsApiPath,sessionId)}/stream`}function vibe64SourceEditorExplanationsCleanupPath(sessionsApiPath=``,sessionId=``){return`${vibe64SourceEditorExplanationsPath(sessionsApiPath,sessionId)}/cleanup`}function vibe64SourceEditorExplanationPath(sessionsApiPath=``,sessionId=``,explanationId=``){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/explanations/${encodePathSegment(explanationId)}`)}function vibe64SourceEditorExplanationFollowupsPath(sessionsApiPath=``,sessionId=``,explanationId=``){return`${vibe64SourceEditorExplanationPath(sessionsApiPath,sessionId,explanationId)}/followups`}function vibe64SourceEditorExplanationFollowupsStreamPath(sessionsApiPath=``,sessionId=``,explanationId=``){return`${vibe64SourceEditorExplanationFollowupsPath(sessionsApiPath,sessionId,explanationId)}/stream`}function vibe64SourceEditorExplanationStopPath(sessionsApiPath=``,sessionId=``,explanationId=``){return`${vibe64SourceEditorExplanationPath(sessionsApiPath,sessionId,explanationId)}/stop`}function vibe64ConversationLogQueryKey(surfaceId,ownershipFilter,sessionId=``,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`conversation-log`,encodePathSegment(sessionId)]}function vibe64OutputsQueryKey(surfaceId,ownershipFilter,sessionId=``,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`outputs`,encodePathSegment(sessionId)]}function agentSettingsInputFromContext(context={}){return context.agentSettings&&typeof context.agentSettings===`object`&&!Array.isArray(context.agentSettings)?{agentSettings:context.agentSettings}:{}}function useVibe64SessionAssistantApply({choice,emit,menuOpen,props}){const{agentId,assistantSelection,catalog,catalogError,catalogLoading,connections,draftSelection,engineId,modelAccess,modelId,modelProviderId,recommendedModel,reloadCatalog,routingMode,savesThroughCaller,selectedAgent,selectedModel,selectedProvider,selectionChanged,selectionForModel,selectionRevision,variantId}=choice;const saveError=ref(``);const saving=ref(false);const modelAccessUpdating=ref(false);const unlockConfirmOpen=ref(false);const canSave=computed(()=>Boolean(!props.changesDisabled&&(selectionChanged.value||routingMode.value!==`custom`)&&selectedProvider.value&&selectedModel.value&&selectedAgent.value&&selectionRevision.value&&!catalogLoading.value&&!catalogError.value&&!modelAccessUpdating.value));const updateCommand=useCommand({access:`never`,apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:`PATCH`,path:String(context?.path||``)}),buildRawPayload:(_model,{context})=>vibe64RealtimeOriginPayload({assistantSelection:context?.assistantSelection||{}}),fallbackRunError:`AI session choices could not be updated.`,suppressSuccessMessage:true,onRunSuccess(response){if(response?.ok===false)throw new Error(response.error||`The custom model could not be saved.`)},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.sessions.assistant-selection.update`,surfaceId:`app`,writeMethod:`PATCH`});const modelAccessCommand=useCommand({access:`never`,apiSuffix:VIBE64_ASSISTANT_MODEL_ACCESS_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:`PATCH`,path:String(context?.path||``)}),buildRawPayload:(_model,{context})=>({engineId:String(context?.engineId||``),modelProviderId:String(context?.modelProviderId||``),unlocked:context?.unlocked===true}),fallbackRunError:`Provider model access could not be changed.`,messages:{error:`Provider model access could not be changed.`,success:`Provider model access updated.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.assistants.model-access.update`,surfaceId:`app`,writeMethod:`PATCH`});async function applySelection(selection,{closeMenu=true}={}){const sessionId=String(props.session?.sessionId||``).trim();const sessionsPath=String(readRefOrGetterValue(props.sessionsApiPath)||``).trim();if(props.changesDisabled||!selection||!savesThroughCaller.value&&(!sessionId||!sessionsPath)||saving.value)return null;saving.value=true;saveError.value=``;try{const response=savesThroughCaller.value?await props.saveSelection(selection):await updateCommand.run({assistantSelection:selection,path:vibe64SessionPath(sessionsPath,sessionId,`/assistant-selection`)});if(response?.ok===false)throw new Error(response.error||`The custom model could not be saved.`);if(response?.ok!==false){emit(`saved`);modelId.value=selection.modelId;agentId.value=selection.agentId;variantId.value=selection.variantId;if(closeMenu)menuOpen.value=false}return response}catch(error){saveError.value=error.message||`The custom model could not be saved.`;reloadCatalog().catch(()=>{});return{ok:false,error:saveError.value}}finally{saving.value=false}}async function save(){if(!canSave.value)return;await applySelection(draftSelection.value)}async function restoreRecommendedModel({closeMenu=true}={}){return applySelection(selectionForModel(recommendedModel.value),{closeMenu})}function requestModelAccessChange(unlocked){if(props.changesDisabled||!props.canConfigure||modelAccessUpdating.value||saving.value)return;if(unlocked===true){unlockConfirmOpen.value=true;return}updateModelAccess(false)}async function confirmUnlockModelAccess(){unlockConfirmOpen.value=false;await updateModelAccess(true)}async function updateModelAccess(unlocked){const providerId=String(modelProviderId.value||``).trim();const path=vibe64AssistantModelAccessPath(connections.apiPath.value);if(!props.canConfigure||props.changesDisabled||!providerId||!path||!modelAccess.value.configurable||modelAccessUpdating.value)return null;modelAccessUpdating.value=true;try{const current=assistantSelection.value||{};if(unlocked!==true&¤t.modelProviderId===providerId&&recommendedModel.value&¤t.modelId!==recommendedModel.value.id){const recovery=await restoreRecommendedModel({closeMenu:false});if(recovery?.ok===false||!recovery)return recovery;await nextTick$1()}const response=await modelAccessCommand.run({engineId:engineId.value,modelProviderId:providerId,path,unlocked:unlocked===true});if(response?.ok!==false)await catalog.value?.reload();return response}finally{modelAccessUpdating.value=false}}return{canSave,confirmUnlockModelAccess,modelAccessUpdating,requestModelAccessChange,restoreRecommendedModel,save,saveError,saving,unlockConfirmOpen}}var VIBE64_ASSISTANT_ENGINE_IDS=Object.freeze({CLAUDE:`claude`,CODEX:`codex`,OPENCODE:`opencode`});var VIBE64_ASSISTANT_TRANSPORT_IDS=Object.freeze({CLAUDE_STREAM_JSON:`claude_stream_json`,CODEX_APP_SERVER:`codex_app_server`,OPENCODE_SERVER:`opencode_server`});var VIBE64_ASSISTANT_SELECTION_SCHEMA=`vibe64.assistant-selection.v1`;var VIBE64_ASSISTANT_CATALOG_REVISION_PATTERN=/^sha256:[a-f0-9]{64}$/u;var VIBE64_ASSISTANT_ENGINE_ID_SET=new Set(Object.values(VIBE64_ASSISTANT_ENGINE_IDS));var VIBE64_ASSISTANT_SELECTION_ERROR_CODES=Object.freeze({CATALOG_STALE:`vibe64_assistant_catalog_stale`,CONNECTION_REQUIRED:`vibe64_assistant_connection_required`,ENGINE_IMMUTABLE:`vibe64_assistant_engine_immutable`,INVALID:`vibe64_assistant_selection_invalid`,TURN_ACTIVE:`vibe64_assistant_selection_turn_active`,UNAVAILABLE:`vibe64_assistant_selection_unavailable`});function selectionError(code,message,details={}){return new AppError(409,message,{code,details:Object.freeze({...details})})}function containsControlCharacter(value=``){return Array.from(value).some(character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127})}function boundedIdentifier(value,field,options={}){const{allowEmpty=false,maxLength=512}=options;const normalized=toText(value);if(!normalized&&!allowEmpty||normalized.length>maxLength||containsControlCharacter(normalized))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant ${field} is invalid.`,{field});return normalized}function catalogRevision(value,field=`catalogRevision`){const revision=toText(value);if(!VIBE64_ASSISTANT_CATALOG_REVISION_PATTERN.test(revision))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant catalog revision is invalid.`,{field});return revision}function defineVibe64AssistantSelection(value={}){const input=normalizeObject(value);const engineId=boundedIdentifier(input.engineId,`engineId`,{maxLength:64});if(!VIBE64_ASSISTANT_ENGINE_ID_SET.has(engineId))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Unknown assistant engine: ${engineId}.`,{engineId,field:`engineId`});const schema=toText(input.schema)||VIBE64_ASSISTANT_SELECTION_SCHEMA;if(schema!==VIBE64_ASSISTANT_SELECTION_SCHEMA)throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant selection schema is unsupported.`,{field:`schema`,schema});return Object.freeze({agentId:boundedIdentifier(input.agentId,`agentId`,{maxLength:256}),catalogRevision:catalogRevision(input.catalogRevision),engineId,modelId:boundedIdentifier(input.modelId,`modelId`),modelProviderId:boundedIdentifier(input.modelProviderId,`modelProviderId`,{maxLength:256}),schema,variantId:boundedIdentifier(input.variantId,`variantId`,{allowEmpty:true,maxLength:256})})}function assertVibe64AssistantSelectionUpdate(currentValue={},nextValue={},options={}){const{turnActive=false}=options;defineVibe64AssistantSelection(currentValue);const next=defineVibe64AssistantSelection(nextValue);if(turnActive===true)throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.TURN_ACTIVE,`Wait for the active assistant turn to finish before changing its selection.`);return next}var VIBE64_ASSISTANT_SELECTION_IDENTITY_FIELDS=Object.freeze([`engineId`,`modelProviderId`,`modelId`,`agentId`,`variantId`]);function sameVibe64AssistantSelection(left,right){return VIBE64_ASSISTANT_SELECTION_IDENTITY_FIELDS.every(key=>String(left?.[key]??``).trim()===String(right?.[key]??``).trim())}var __testables$5=Object.freeze({assertVibe64AssistantSelectionUpdate,VIBE64_ASSISTANT_SELECTION_ERROR_CODES});var model=(id,contextWindow,variants,options={})=>Object.freeze({id,contextWindow,variants:Object.freeze(variants),...options});var NATIVE_AI_PROVIDERS=Object.freeze([Object.freeze({id:`deepseek`,baseUrl:`https://api.deepseek.com/`,claudeBaseUrl:`https://api.deepseek.com/anthropic`,claudeAutoCompactWindow:786432,webSearch:false,models:Object.freeze([model(`deepseek-flash`,1048576,[`low`,`high`,`max`],{images:true,freeformPatch:true,codexHistoryRouting:true}),model(`deepseek-v4-pro`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])}),Object.freeze({id:`zai-coding-plan`,baseUrl:`https://api.z.ai/api/v1`,claudeBaseUrl:`https://api.z.ai/api/anthropic`,claudeAutoCompactWindow:1e6,webSearch:false,models:Object.freeze([model(`glm-5.3`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])}),Object.freeze({id:`zai`,baseUrl:`https://api.z.ai/api/v1`,claudeBaseUrl:`https://api.z.ai/api/anthropic`,claudeAutoCompactWindow:1e6,webSearch:false,models:Object.freeze([model(`glm-5.3`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])})]);var CUSTOM_AI_PROVIDER_ID=`custom`;function nativeAiProvider(id){return NATIVE_AI_PROVIDERS.find(provider=>provider.id===id)||null}function nativeAiModel(id,providerId=``){for(const provider of NATIVE_AI_PROVIDERS){if(providerId&&provider.id!==providerId)continue;const model=provider.models.find(candidate=>candidate.id===id);if(model)return{...model,modelProviderId:provider.id}}return null}var curatedModel=(providerId,id,label,defaultThinking)=>{const{modelProviderId:_provider,...definition}=nativeAiModel(id,providerId);return Object.freeze({...definition,label,defaultThinking})};var CURATED_CODEX_PROVIDERS=Object.freeze([Object.freeze({...nativeAiProvider(`deepseek`),label:`DeepSeek`,shortLabel:`DeepSeek`,description:`DeepSeek API key · usage-based billing`,keyUrl:`https://platform.deepseek.com/api_keys`,guideUrl:`https://api-docs.deepseek.com/quick_start/agent_integrations/codex/`,ownerOnly:false,models:Object.freeze([curatedModel(`deepseek`,`deepseek-flash`,`DeepSeek V4.1 Flash`,`high`),curatedModel(`deepseek`,`deepseek-v4-pro`,`DeepSeek V4 Pro`,`high`)])}),Object.freeze({...nativeAiProvider(`zai-coding-plan`),label:`GLM · Coding Plan`,shortLabel:`GLM`,description:`Z.AI Coding Plan key · uses your subscription quota`,keyUrl:`https://z.ai/manage-apikey/apikey-list`,guideUrl:`https://docs.z.ai/devpack/tool/codex`,ownerOnly:true,models:Object.freeze([curatedModel(`zai-coding-plan`,`glm-5.3`,`GLM 5.3`,`max`)])}),Object.freeze({...nativeAiProvider(`zai`),label:`GLM · Pay-as-you-go API`,shortLabel:`GLM`,description:`Z.AI API key · pay-as-you-go account`,keyUrl:`https://z.ai/manage-apikey/apikey-list`,guideUrl:`https://docs.z.ai/guides/overview/quick-start`,setupNote:`Use a key from a Z.AI account without a Coding Plan. Pay-as-you-go access through Codex and Claude Code still needs live verification; a successful check confirms model access, not billing.`,ownerOnly:false,models:Object.freeze([curatedModel(`zai`,`glm-5.3`,`GLM 5.3`,`max`)])}),Object.freeze({id:CUSTOM_AI_PROVIDER_ID,custom:true,label:`Custom endpoint`,shortLabel:`Custom`,description:`Your own model server · no Vibe64 billing`,ownerOnly:true,models:Object.freeze([])})]);function curatedCodexProvider(id){return CURATED_CODEX_PROVIDERS.find(provider=>provider.id===id)||null}function isPlainRecord(value){if(!value||typeof value!==`object`||Array.isArray(value))return false;const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}var VIBE64_AGENT_EXECUTION_PROFILE_IDS=Object.freeze({HELPER:`helper`});var VIBE64_AGENT_EXECUTION_WORKLOAD_IDS=Object.freeze({COMMIT_TITLE:`commit_title`,CONVERSATION_SUMMARY:`conversation_summary`,VOICE_TURN:`voice_turn`,DATABASE_ASSISTANT:`database_assistant`,LESSON_REVIEW:`lesson_review`,PROMPT_HINT:`prompt_hint`,REQUEST_ROUTING:`request_routing`,SESSION_TITLE:`session_title`,SOURCE_EXPLANATION:`source_explanation`});var VIBE64_AGENT_HELPER_WORKLOAD_LIMITS=Object.freeze({[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.COMMIT_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.VOICE_TURN]:Object.freeze({maxInputCharacters:12e3,maxOutputCharacters:512,timeoutMs:1e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.CONVERSATION_SUMMARY]:Object.freeze({maxInputCharacters:2e5,maxOutputCharacters:16e3,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.DATABASE_ASSISTANT]:Object.freeze({maxInputCharacters:5e5,maxOutputCharacters:16e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.LESSON_REVIEW]:Object.freeze({maxInputCharacters:16e4,maxOutputCharacters:12e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.PROMPT_HINT]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:2500,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.REQUEST_ROUTING]:Object.freeze({maxInputCharacters:128e3,maxOutputCharacters:8192,timeoutMs:6e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SESSION_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:3e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SOURCE_EXPLANATION]:Object.freeze({maxInputCharacters:1e5,maxOutputCharacters:32e3,timeoutMs:18e4})});var VIBE64_AGENT_EXECUTION_TOOL_POLICIES=Object.freeze({NONE:`none`});var VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS=Object.freeze({MAX_INPUT_CHARACTERS:5e5,MAX_OUTPUT_CHARACTERS:32e3,MAX_TIMEOUT_MS:3e5});var VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES=Object.freeze({INVALID:`vibe64_agent_execution_profile_invalid`,MODEL_UNAVAILABLE:`vibe64_agent_execution_profile_model_unavailable`,POLICY_UNENFORCEABLE:`vibe64_agent_execution_profile_policy_unenforceable`,PROFILE_UNKNOWN:`vibe64_agent_execution_profile_unknown`,REASONING_UNSUPPORTED:`vibe64_agent_execution_profile_reasoning_unsupported`,UNBOUNDED:`vibe64_agent_execution_profile_unbounded`,UNSAFE:`vibe64_agent_execution_profile_unsafe`,WORKLOAD_UNSUPPORTED:`vibe64_agent_execution_profile_workload_unsupported`});var VIBE64_AGENT_EXECUTION_PROFILE_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_PROFILE_IDS));var VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_WORKLOAD_IDS));var Vibe64AgentExecutionProfileError=class extends Error{constructor(code,message,details={}){super(message);this.name=`Vibe64AgentExecutionProfileError`;this.code=code;this.details=Object.freeze({...details});for(const[name,value]of Object.entries(this.details))if(![`code`,`details`,`message`,`name`].includes(name))this[name]=value}};function executionProfileError(code,message,details={}){return new Vibe64AgentExecutionProfileError(code,message,details)}function requiredRecord(value,fieldName){if(!isPlainRecord(value))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be an object.`,{field:fieldName});return value}function requireOnlyFields(value,allowedFields,fieldName){const allowed=new Set(allowedFields);const unexpected=Object.keys(value).find(name=>!allowed.has(name));if(unexpected)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} contains an unsupported field: ${unexpected}.`,{field:`${fieldName}.${unexpected}`})}function requiredText(value,fieldName,maximumLength=256){if(typeof value!==`string`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be text.`,{field:fieldName});const normalized=value.trim();if(!normalized||normalized.length>maximumLength)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} is invalid.`,{field:fieldName});return normalized}function requiredBoolean(value,fieldName){if(typeof value!==`boolean`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be a boolean.`,{field:fieldName});return value}function requireSafeFalse(value,fieldName){if(requiredBoolean(value,fieldName)!==false)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile ${fieldName} must be disabled.`,{field:fieldName});return false}function boundedPositiveInteger(value,fieldName,maximum){if(!Number.isSafeInteger(value)||value<=0||value>maximum)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile ${fieldName} must be a positive integer no greater than ${maximum}.`,{field:fieldName,maximum});return value}function requiredLimits(value){if(!isPlainRecord(value))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile limits are required.`,{field:`limits`});return value}function normalizeProfileId(value){const profileId=requiredText(value,`profileId`,64);if(!VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(profileId))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.PROFILE_UNKNOWN,`Unknown execution profile: ${profileId}.`,{profileId});return profileId}function normalizeWorkloadId(value){const workloadId=requiredText(value,`workloadId`,64);if(!VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES.has(workloadId))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.WORKLOAD_UNSUPPORTED,`Unsupported execution profile workload: ${workloadId}.`,{workloadId});return workloadId}function normalizedExecutionProfileRequest(input){return Object.freeze({profileId:normalizeProfileId(input.profileId),workloadId:normalizeWorkloadId(input.workloadId)})}function defineVibe64AgentExecutionProfileResolution(value){const input=requiredRecord(value,`resolution`);const executionProfile=normalizedExecutionProfileRequest(input);const request=requiredRecord(input.request,`request policy`);const policy=requiredRecord(input.policy,`tool policy`);const limits=requiredLimits(input.limits);requireOnlyFields(request,[`allowProviderModelFallback`,`reasoning`,`summary`],`request`);requireOnlyFields(policy,[`environmentAccess`,`networkAccess`,`repositoryWrite`,`tools`],`policy`);requireOnlyFields(limits,[`maxInputCharacters`,`maxOutputCharacters`,`timeoutMs`],`limits`);const reasoning=requiredBoolean(request.reasoning,`request.reasoning`);if(typeof input.thinking!==`string`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile thinking must be text.`,{field:`thinking`});const thinking=input.thinking.trim();if(reasoning&&!thinking||!reasoning&&thinking)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile thinking must agree with its reasoning request.`,{field:`thinking`});if(thinking.length>64)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile thinking is invalid.`,{field:`thinking`});if(policy.tools!==VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile tools must be disabled.`,{field:`policy.tools`});return Object.freeze({limits:Object.freeze({maxInputCharacters:boundedPositiveInteger(limits.maxInputCharacters,`limits.maxInputCharacters`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_INPUT_CHARACTERS),maxOutputCharacters:boundedPositiveInteger(limits.maxOutputCharacters,`limits.maxOutputCharacters`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_OUTPUT_CHARACTERS),timeoutMs:boundedPositiveInteger(limits.timeoutMs,`limits.timeoutMs`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_TIMEOUT_MS)}),model:requiredText(input.model,`model`),policy:Object.freeze({environmentAccess:requireSafeFalse(policy.environmentAccess,`policy.environmentAccess`),networkAccess:requireSafeFalse(policy.networkAccess,`policy.networkAccess`),repositoryWrite:requireSafeFalse(policy.repositoryWrite,`policy.repositoryWrite`),tools:VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE}),profileId:executionProfile.profileId,providerId:requiredText(input.providerId,`providerId`,64),request:Object.freeze({allowProviderModelFallback:requireSafeFalse(request.allowProviderModelFallback,`request.allowProviderModelFallback`),reasoning,summary:requireSafeFalse(request.summary,`request.summary`)}),revision:requiredText(input.revision,`revision`,128),thinking,workloadId:executionProfile.workloadId})}function vibe64AgentExecutionProfileAuditSnapshot(value){return defineVibe64AgentExecutionProfileResolution(value)}function vibe64AgentProviderSupportsExecutionProfile(provider,profileId){if(!isPlainRecord(provider)||typeof profileId!==`string`)return false;const normalizedProfileId=profileId.trim();return provider.implemented===true&&VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(normalizedProfileId)&&Array.isArray(provider.executionProfiles)&&provider.executionProfiles.includes(normalizedProfileId)}var __testables$4=Object.freeze({VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS,VIBE64_AGENT_EXECUTION_TOOL_POLICIES,vibe64AgentProviderSupportsExecutionProfile});var VIBE64_AGENT_PROVIDER_UNKNOWN_CODE=`vibe64_agent_provider_unknown`;var VIBE64_AGENT_PARAMETER_IDS=Object.freeze({MODEL:`model`,THINKING:`thinking`});var VIBE64_DEFAULT_AGENT_PROVIDER_ID=VIBE64_ASSISTANT_ENGINE_IDS.CODEX;var VIBE64_CODEX_SOL_MODEL=`gpt-5.6-sol`;var VIBE64_CODEX_GPT_5_5_MODEL=`gpt-5.5`;var VIBE64_CODEX_DEFAULT_MODEL=VIBE64_CODEX_SOL_MODEL;var VIBE64_CODEX_DEFAULT_THINKING=`xhigh`;var VIBE64_CODEX_SPARK_MODEL=`gpt-5.3-codex-spark`;var VIBE64_CODEX_STANDARD_THINKING_VALUES=Object.freeze([`low`,`medium`,`high`,`xhigh`]);var VIBE64_CODEX_SOL_THINKING_VALUES=Object.freeze([...VIBE64_CODEX_STANDARD_THINKING_VALUES,`max`]);var VIBE64_AGENT_PROVIDERS=Object.freeze([Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.HELPER]),id:VIBE64_ASSISTANT_ENGINE_IDS.CODEX,implemented:true,label:`Codex`,accountLabel:`Codex (OpenAI)`,planUsage:Object.freeze({label:`Codex`,managementUrl:`https://chatgpt.com/codex/settings/usage`}),terminal:`codex`,terminalAttachments:false,parameters:Object.freeze([Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.MODEL,defaultValue:VIBE64_CODEX_DEFAULT_MODEL,label:`Model`,options:Object.freeze([Object.freeze({label:`Automatic (GPT-5.6 Sol)`,value:``}),Object.freeze({label:`GPT-5.6 Sol`,supportedThinking:VIBE64_CODEX_SOL_THINKING_VALUES,value:VIBE64_CODEX_DEFAULT_MODEL}),Object.freeze({label:`GPT-5.5`,supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_GPT_5_5_MODEL}),Object.freeze({label:`Codex Spark`,request:Object.freeze({summary:false}),supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_SPARK_MODEL})])}),Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.THINKING,defaultValue:VIBE64_CODEX_DEFAULT_THINKING,label:`Thinking`,options:Object.freeze([Object.freeze({label:`Automatic`,value:``}),Object.freeze({label:`Low`,value:`low`}),Object.freeze({label:`Medium`,value:`medium`}),Object.freeze({label:`High`,value:`high`}),Object.freeze({label:`X High`,value:`xhigh`}),Object.freeze({label:`Max`,value:`max`})])})])}),Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.HELPER]),id:VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE,implemented:true,label:`Claude Code`,accountLabel:`Claude`,planUsage:Object.freeze({label:`Claude`,managementUrl:`https://claude.ai/settings/usage`}),parameters:Object.freeze([]),terminal:`native`,terminalAttachments:false}),Object.freeze({executionProfiles:Object.freeze([]),id:VIBE64_ASSISTANT_ENGINE_IDS.OPENCODE,implemented:false,label:`OpenCode`,parameters:Object.freeze([]),terminal:`native`,terminalAttachments:true})]);function findVibe64AgentProvider(engineId=``){const normalizedEngineId=normalizeAgentSettingText(engineId);return VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedEngineId)||null}function agentProviderDefinition(providerId=``){const normalizedProviderId=normalizeAgentSettingText(providerId)||VIBE64_DEFAULT_AGENT_PROVIDER_ID;const provider=VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedProviderId);if(provider)return provider;const error=new Error(`Unknown assistant provider: ${normalizedProviderId}.`);error.code=VIBE64_AGENT_PROVIDER_UNKNOWN_CODE;error.providerId=normalizedProviderId;throw error}function agentProviderParameter(provider={},parameterId=``){const normalizedParameterId=normalizeAgentSettingText(parameterId);return(Array.isArray(provider.parameters)?provider.parameters:[]).find(parameter=>parameter.id===normalizedParameterId)||null}function normalizeAgentSettingText(value=``){return String(value||``).trim()}function normalizeVibe64AgentSettings(value={}){const input=value&&typeof value===`object`&&!Array.isArray(value)?value:{};const provider=agentProviderDefinition(input.providerId||input.provider);const model=normalizeAgentSettingText(input.model);return{model,providerId:provider.id,thinking:normalizedAgentThinkingValue(provider,model,input.thinking)}}function defaultVibe64AgentSettings(providerId=VIBE64_DEFAULT_AGENT_PROVIDER_ID){return normalizeVibe64AgentSettings({providerId})}function effectiveAgentParameterValue(provider={},parameterId=``,value=``){const parameter=agentProviderParameter(provider,parameterId);return normalizeAgentSettingText(value)||normalizeAgentSettingText(parameter?.defaultValue)}function effectiveAgentParameterOption(provider={},parameterId=``,value=``){const parameter=agentProviderParameter(provider,parameterId);const effectiveValue=effectiveAgentParameterValue(provider,parameterId,value);return(Array.isArray(parameter?.options)?parameter.options:[]).find(option=>normalizeAgentSettingText(option.value)===effectiveValue)||null}function supportedAgentThinkingValues(provider={},model=``){const modelOption=effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,model);return Array.isArray(modelOption?.supportedThinking)?new Set(modelOption.supportedThinking.map(value=>normalizeAgentSettingText(value))):null}function normalizedAgentThinkingValue(provider={},model=``,value=``){const normalized=normalizeAgentSettingText(value);if(provider.id===VIBE64_ASSISTANT_ENGINE_IDS.CODEX)return normalized;const supported=supportedAgentThinkingValues(provider,model);if(!supported||!normalized||supported.has(normalized))return normalized;const fallback=normalizeAgentSettingText(agentProviderParameter(provider,VIBE64_AGENT_PARAMETER_IDS.THINKING)?.defaultValue);return supported.has(fallback)?fallback:``}function vibe64AgentSettingParameters(value={}){const normalized=normalizeVibe64AgentSettings(value);const provider=agentProviderDefinition(normalized.providerId);const requestsReasoning=agentOptionRequestValue(effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,normalized.model),`reasoning`,true);const supportedThinking=supportedAgentThinkingValues(provider,normalized.model);return(Array.isArray(provider.parameters)?provider.parameters:[]).flatMap(parameter=>{if(parameter.id===VIBE64_AGENT_PARAMETER_IDS.THINKING&&requestsReasoning===false)return[];if(parameter.id!==VIBE64_AGENT_PARAMETER_IDS.THINKING||!supportedThinking)return[parameter];return[{...parameter,options:parameter.options.filter(option=>!normalizeAgentSettingText(option.value)||supportedThinking.has(normalizeAgentSettingText(option.value)))}]})}function agentOptionRequestValue(option={},name=``,fallback=true){const request=option&&typeof option.request===`object`&&!Array.isArray(option.request)?option.request:{};return Object.hasOwn(request,name)?request[name]:fallback}function displayVibe64AgentSetting(providerId=``,parameterId=``,value=``){const parameter=agentProviderParameter(agentProviderDefinition(providerId),parameterId);const normalizedValue=normalizeAgentSettingText(value);return(Array.isArray(parameter?.options)?parameter.options:[]).find(candidate=>normalizeAgentSettingText(candidate.value)===normalizedValue)?.label||normalizedValue||`Automatic`}var __testables$3=Object.freeze({displayVibe64AgentSetting,VIBE64_AGENT_PROVIDER_UNKNOWN_CODE,VIBE64_CODEX_GPT_5_5_MODEL,VIBE64_CODEX_SOL_MODEL,VIBE64_CODEX_SPARK_MODEL,vibe64AgentSettingParameters});function vibe64AssistantSelectionLabel(selection,options={}){const{includeThinking=true}=options;const engine=VIBE64_AGENT_PROVIDERS.find(({id})=>id===selection.engineId)?.label||selection.engineId;if(!includeThinking)return`${engine} (${selection.modelId})`;const thinking=selection.variantId===``?`default`:selection.variantId||`not recorded`;return`${engine} (${selection.modelId} ${thinking})`}function vibe64ProviderPresentation(selection){const provider=curatedCodexProvider(selection?.modelProviderId);const commentaryAsThinking=Boolean(provider)&&[VIBE64_ASSISTANT_ENGINE_IDS.CODEX,VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE].includes(selection?.engineId);return Object.freeze({label:provider?.shortLabel||findVibe64AgentProvider(selection?.engineId)?.label||``,keyUsage:Boolean(provider),commentaryAsThinking,thinkingParagraphUpdates:!commentaryAsThinking&&selection?.engineId===VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE})}var AFTER_PLAN_PASS_ORDER=Object.freeze([`review`,`security-pass`,`data-pass`,`quality-pass`,`speed-pass`,`ux-pass`,`identity-pass`,`ui-pass`,`deslop`]);var AFTER_PLAN_MANDATORY_PASSES=Object.freeze([`review`,`security-pass`]);var AFTER_PLAN_DEFAULT_PASSES=Object.freeze([`review`,`security-pass`,`data-pass`,`quality-pass`,`ui-pass`,`deslop`]);var AFTER_PLAN_PASS_TITLES=Object.freeze({review:`Review`,"security-pass":`Security pass`,"data-pass":`Data pass`,"quality-pass":`Quality pass`,"speed-pass":`Speed pass`,"ux-pass":`User experience pass`,"identity-pass":`Visual identity`,"ui-pass":`UI pass`,deslop:`Deslop`});var ASSISTANT_FINISHING_DEFAULTS=Object.freeze({afterPlan:AFTER_PLAN_DEFAULT_PASSES,afterPlanDeep:Object.freeze([]),autoSave:true});var ASSISTANT_NO_FINISHING=Object.freeze({afterPlan:AFTER_PLAN_MANDATORY_PASSES,afterPlanDeep:Object.freeze([]),autoSave:false});var AUTO_SAVE_SETTING=`Automatically save changes`;function afterPlanChoiceProblem(afterPlan,afterPlanDeep){const known=list=>Array.isArray(list)&&list.every(id=>AFTER_PLAN_PASS_ORDER.includes(id));if(!known(afterPlan)||!known(afterPlanDeep))return`After a plan takes the passes ${AFTER_PLAN_PASS_ORDER.join(`, `)}.`;if(!AFTER_PLAN_MANDATORY_PASSES.every(id=>afterPlan.includes(id)))return`Review and Security pass always run after a plan; they can't be unticked.`;if(afterPlanDeep.some(id=>!afterPlan.includes(id)))return`Tick After a plan for a pass before ticking Deeply.`;return``}var inAfterPlanOrder=ids=>AFTER_PLAN_PASS_ORDER.filter(id=>ids.includes(id));var ASSISTANT_PLAN_COMPLETION_MESSAGE=[`Plan completion:`,`Read every page of BOTH Plan and Progress, including the complete technical implementation plan; checklist marks do not establish completion.`,`Verify each agreed requirement against the preceding implementation, my request, accepted steering and the recorded evidence. Inspect the implementation, fix in-scope gaps and run relevant checks. Leave unrelated plans unchanged.`,`Then explicitly complete the plan with the plan helper when every requirement is verified, and report complete with the returned revisions; otherwise leave Plan active, record the specific gaps and verification evidence in its paired Progress document, and report wait, or report handoff for substantial necessary rework.`,`This turn checks the plan only: run no Deslop, UI pass or other pass. Once the plan is completed, Vibe64 runs the passes this chat ticks in Passes (After a plan) as their own turns.`,`Do not ask for permission merely to verify or complete verified work. Report findings, fixes, actual checks and anything unverified.`].join(` `);var ASSISTANT_MODES=Object.freeze([{id:`custom`,label:`Custom`,description:`Choose a model and thinking level for this chat.`},{id:`senior`,label:`Senior`,description:`Talk directly to your most capable model. Ask questions or request changes.`},{id:`junior`,label:`Junior`,description:`Talk directly to your everyday model. Ask questions or request changes.`},{id:`auto`,label:`Auto`,description:`Name either role, or let Senior handle plans and reviews and Junior handle other requests.`}]);var ASSISTANT_FIX_MODE=Object.freeze({id:`fix`,label:`Fix it with AI`,description:`Repair what went wrong with the Fix it with AI model.`});var ASSISTANT_ROUTING_METADATA=`assistant_routing`;var ASSISTANT_SETUP_ROLES=Object.freeze({owner:Object.freeze([`senior`,`junior`,`router`,`colleague`,`fix`,`explain`,`quickHelper`]),nonOwner:Object.freeze([`colleague`,`fix`,`explain`,`quickHelper`])});var ASSISTANT_FOLLOWING_ROLES=Object.freeze([`colleague`,`fix`,`explain`]);var ASSISTANT_ROUTING_ROLE_DEFINITIONS=Object.freeze([{id:`senior`,label:`Senior`,description:`Plans, reviews and passes in main chat. Your most capable model.`,group:`main`},{id:`junior`,label:`Junior`,description:`Everyday changes in main chat.`,group:`main`},{id:`router`,label:`Router`,description:`Chooses Senior or Junior when main chat is on Auto.`,group:`main`},{id:`colleague`,label:`Colleague`,description:`The default for Colleague. Each person can change their own.`,group:`helpers`},{id:`fix`,label:`Fix it with AI`,description:`Repair chats opened from errors and conflicts. Can run in a different tool from the chat it fixes.`,group:`helpers`},{id:`explain`,label:`Explain & check`,description:`Explain this code, the database assistant and Check my work.`,group:`helpers`},{id:`quickHelper`,label:`Quick helper`,description:`Titles, commit messages, prompt hints and summaries.`,group:`helpers`}].map(Object.freeze));var ASSISTANT_ROLE_DEFAULT_FOLLOWS=Object.freeze({owner:Object.freeze({colleague:`senior`,fix:`junior`,explain:`quickHelper`}),nonOwner:Object.freeze({fix:`colleague`,explain:`quickHelper`})});var ROUTING_REASONS=Object.freeze([`conversation`,`planning`,`implementation`,`review`]);var MAIN_CHAT_PURPOSES=Object.freeze([`custom`,`senior`,`junior`,`auto`,`review`,`deslop`,`ui_pass`,`pass`,`request_routing`]);var ASSISTANT_PURPOSE_ROLES=Object.freeze({custom:`custom`,senior:`senior`,junior:`junior`,review:`senior`,deslop:`senior`,ui_pass:`senior`,pass:`senior`,request_routing:`router`,colleague:`colleague`,fix:`fix`,source_explanation:`explain`,database_assistant:`explain`,lesson_review:`explain`,commit_title:`quickHelper`,session_title:`quickHelper`,prompt_hint:`quickHelper`,conversation_summary:`quickHelper`,voice_turn:`quickHelper`,quick_helper:`quickHelper`});var ASSISTANT_ROLE_PURPOSES=Object.freeze({senior:`senior`,junior:`junior`,router:`request_routing`,colleague:`colleague`,fix:`fix`,explain:`source_explanation`,quickHelper:`prompt_hint`});function assistantModeLabel(mode){return ASSISTANT_MODES.find(({id})=>id===mode)?.label||(mode===`fix`?ASSISTANT_FIX_MODE.label:``)||{review:`Senior review`,deslop:`Senior Deslop`,ui_pass:`Senior UI pass`,pass:`Senior pass`}[mode]||ASSISTANT_ROUTING_ROLE_DEFINITIONS.find(({id})=>id===mode)?.label||``}function routingError(message,code,options={}){return new AppError(409,message,{...options,code})}var upgradeRequired=()=>routingError(`This saved request predates the current AI setup. The administrator must run the state upgrade.`,`vibe64_assistant_routing_upgrade_required`);var choosesAutomation=mode=>mode!==`fix`;function assistantRoutingPreferences(value={}){if(!value||typeof value!==`object`||Array.isArray(value)||![...ASSISTANT_MODES,ASSISTANT_FIX_MODE].some(({id})=>id===value.mode))throw routingError(`Choose Custom, Senior, Junior, or Auto.`,`vibe64_assistant_mode_invalid`);if(Object.hasOwn(value,`workflowEngineId`))throw upgradeRequired();if(value.mode===`custom`&&!value.override)throw routingError(`Choose a custom model first.`,`vibe64_assistant_custom_model_required`);const automation=choosesAutomation(value.mode)?assistantRoutingAutomation(value):ASSISTANT_NO_FINISHING;const problem=afterPlanChoiceProblem(automation.afterPlan,automation.afterPlanDeep);if(problem)throw routingError(problem,`vibe64_assistant_after_plan_invalid`);if(typeof automation.autoSave!==`boolean`)throw routingError(`Automatically save changes is either on or off.`,`vibe64_assistant_auto_save_invalid`);return{mode:value.mode,afterPlan:inAfterPlanOrder(automation.afterPlan),afterPlanDeep:inAfterPlanOrder(automation.afterPlanDeep),autoSave:automation.autoSave,...value.override&&![`auto`,`fix`].includes(value.mode)?{override:defineVibe64AssistantSelection(value.override)}:{}}}function assistantRoutingAutomation(value){const chosen=value&&choosesAutomation(value.mode)?value:{};return Object.fromEntries(Object.keys(ASSISTANT_FINISHING_DEFAULTS).map(id=>[id,chosen[id]===void 0?ASSISTANT_FINISHING_DEFAULTS[id]:chosen[id]]))}function savedAssistantRouting(saved){if(saved&&typeof saved===`object`&&!Array.isArray(saved.afterPlan))throw upgradeRequired();return assistantRoutingPreferences(saved)}function assistantRoutingFromMetadata(metadata={}){if(!metadata[`assistant_routing`])return null;return savedAssistantRouting(JSON.parse(metadata[ASSISTANT_ROUTING_METADATA]))}var assistantRoutingRequestFromMetadata=metadata=>JSON.parse(metadata?.assistant_routing_request||`null`);function assistantRoutingRequestForDisplay(metadata={}){try{return assistantRoutingRequestFromMetadata(metadata)}catch{return null}}var goalStatusIsComplete=status=>status===`complete`||status===`completed`;var assistantGoalIsActive=goal=>Boolean(goal)&&!goalStatusIsComplete(goal.status);var ASSISTANT_WORKFLOW_STATUSES=Object.freeze([`working`,`waiting`,`complete`]);var ASSISTANT_WORKFLOW_DELIVERIES=Object.freeze([`routing`,`pending`,`sending`,`uncertain`,`accepted`,`failed`]);var assistantWorkflowRole=request=>request.stage===`pass`||request.stage===`review`&&request.followup&&request.mode===`auto`?`senior`:request.resolvedMode;var assistantAfterPlanPass=request=>request?.stage===`pass`&&request.passChain?.passes?.[request.passChain.index]||null;function assistantSetupRoleValue(setupValues,role){const value=setupValues[role];return value?.follows?{value:setupValues[value.follows]??null,followedRole:value.follows}:{value:value??null,followedRole:``}}function assistantRoutingStatusIsPending(request){return request?.status!==`complete`&&[`routing`,`pending`,`sending`,`uncertain`].includes(request?.delivery)}function assistantRoutingRequestCanBeReplaced(request,selection){if(request?.helper)return false;if(request?.cancelled)return true;const previous=request?.deliverySelection||request?.observedSelection;if(request?.stopped&&previous&&selection&&!sameVibe64AssistantSelection(previous,selection))return true;return request?.delivery===`pending`&&(request.status===`waiting`||Boolean(request.error))&&!request.attemptedMessageId}function assistantRoutingRequestIsUnresolved(request,selection){return assistantRoutingStatusIsPending(request)&&!assistantRoutingRequestCanBeReplaced(request,selection)}function assistantModePrompt(mode,message,options={}){let{planInstructions=``,intent=``,browserReview=false}=options;const{rework=`junior`}=options;const direct=`Work directly from the user's request and conversation, answering questions or implementing changes as requested. You may edit application files when requested. Make ordinary local choices using established project patterns, ask about unresolved scope or design decisions, preserve unrelated work, and verify changes with relevant checks.`;const instructions={custom:direct,senior:direct,junior:direct,fix:direct,deslop:[`Perform Deslop directly using the project's Deslop guidance.`,`You may edit code for behavior-preserving cleanup; earlier Auto planning restrictions do not apply.`,`Preserve existing behavior, unrelated work and staging.`,`Use the user's selected commits or scope; otherwise clean up only the current task's changes.`,`Do not implement features, fix behavior-changing defects, create an implementation plan, or delegate cleanup to another model.`,`Report discovered defects separately without fixing them.`,`Run focused checks, then report what became simpler and what was verified.`,`Do not commit, push or deploy.`].join(` `),ui_pass:[`Perform the UI pass directly using the project's UI pass guidance, on the scope this request names.`,`You may edit code to bring those screens in line with the project's UI guidance; earlier Auto planning restrictions do not apply.`,`Preserve each screen's behavior, unrelated work and staging.`,`Do not implement features, fix behavior-changing defects, create an implementation plan, or delegate the pass to another model.`,`Report discovered defects separately without fixing them.`,`Check the screens you changed in the managed browser, run focused checks, then report what changed and what was verified.`,`Do not commit, push or deploy.`].join(` `),pass:`Perform the pass this request names directly, following the project's guidance for it. You may edit code for it; earlier Auto planning restrictions do not apply. Preserve unrelated work and staging. Do not implement features the pass does not call for, create an implementation plan, or delegate the pass to another model. Report discovered defects outside the pass separately without fixing them. Run focused checks, and check the screens you changed in the managed browser, then report what changed and what was verified. Do not commit, push or deploy.`,review:[`Review the preceding coding work against the original request and accepted steering.`,`Inspect actual files and relevant surrounding code. You may directly fix in-scope defects.`,`Earlier Auto planning restrictions do not apply.`,`Preserve unrelated work and staging, and report out-of-scope defects without fixing them.`,`For a cleanup-only request, apply the project's Deslop guidance and preserve behavior; report behavior-changing defects separately without fixing them.`,`Perform the review yourself in this turn. Cleanup is optional and only runs when requested in this review's instructions.`,`If implementation is missing or coding stopped for a decision, report that and preserve the decision for the user; do not start the original implementation from scratch.`,`Run relevant checks, then report findings, fixes, actual checks and anything unverified.`,`You own browser verification for this review. Exercise the requested user flow and inspect meaningful visual checkpoints yourself using the supplied managed browser tools; the implementer's code tests do not replace these checks. Reuse reliable passing evidence and avoid repeating unaffected checks. Report browser or visual checks that could not be performed, and do not claim verified completion while required checks remain unfinished.`,`Do not Save, push or invent new product requirements. For substantial necessary rework within the agreed outcome, `+{junior:`update the technical plan and hand back to Junior through the workflow outcome command. Junior's rework then returns to Senior to check and complete the plan.`,self:`return to your own implementation through the workflow outcome command.`,report:`report what it needs instead of starting it in this review.`}[rework]].join(` `)};if(!instructions[mode])throw routingError(`Unknown assistant mode.`,`vibe64_assistant_mode_unknown`);let instruction=instructions[intent]||instructions[mode];switch(intent){case`conversation`:instruction=`Answer or investigate the user's question. You may use vibe64-helper plan read or history to inspect a referenced plan. Do not create or update a plan, change its status, edit application files, run state-changing operations, or delegate implementation. Explain missing or completed plans without reopening them.`;break;case`planning`:instruction=`Discuss and manage the plan as requested through vibe64-helper plan. Do not change application files in a planning-only request. Clarify ambiguous references before changing a plan. Junior may update paired Progress and existing checklist ticks as work is verified; agreed Plan scope and lifecycle changes require Senior.`;break;case`implementation`:instruction=direct+` Implement the requested work, including any explicitly requested planning changes within your role's authority. `+`For a plan's explicitly authorised removal or deferral, record the exact deferred requirement and its agreed timing in a Deferred work section of paired Progress before removing it from Plan's current acceptance scope. Preserve completed implementation evidence and do not perform deferred work. Reassess the remaining requirements against that evidence; if none remain to implement, hand off for review rather than treating the scope edit as planning-only. Junior still cannot edit Plan scope. `+`Continue until the authorised scope is implemented and checked. Task size, context compaction, or finishing one useful slice is not a reason to end the task. `+`Stop for an unresolved architectural or product decision outside the agreed scope only where it blocks the remaining work; continue independent authorised work. `+`The latest execution request supersedes earlier planning-only wording, while explicit remaining approval boundaries still apply. `+`If work remains, lead with Implementation incomplete and name the exact blocker and unfinished scope; never open with Done for partial implementation. `+(mode===`senior`?`When this request implements a plan, verify every agreed requirement, then complete the plan yourself with the plan helper; leave it active with the gaps in Progress while any remain. `:`When this request implements a plan, leave the plan active: Senior checks and completes it in its own turn after yours; do not request permission for that turn. `)+`A completed plan starts the passes this chat ticks in Passes (After a plan), each in its own turn; never start a pass on your own in this turn.`}if(!planInstructions&&intent!==`conversation`)planInstructions=`This direct request is independent of the current Auto plan unless the user explicitly refers to it. Senior may use vibe64-helper plan to manage it; Junior may update Progress and existing checklist ticks after reading both documents, never change scope or mark the plan completed.`;const seniorTurns=[`review`,`deslop`,`ui_pass`,`pass`];if(![...seniorTurns,`conversation`,`planning`].includes(intent)&&!seniorTurns.includes(mode)){instruction+=` When the requested feature is implemented, its required runtime resources are prepared and Preview is responding, promptly tell the user: Ready to try—give it a spin. Verification is still running. Do not claim full completion before verification, and do not wait for the user to test before continuing your checks. If Preview is unavailable, report that instead of inviting the user to try it.`;instruction+=browserReview?` A separate Senior review owns in-depth browser testing and visual inspection. Do not run those checks in this implementation turn. Run relevant focused code tests and basic smoke checks: confirm server startup, relevant routes and API responses, and if needed make a brief managed-browser check that the changed page renders and its main control is present. Leave full end-to-end browser suites, multi-step user journeys and visual inspection to Senior; do not expand the smoke check into those checks. Prepare the app and report exact checks, remaining gaps and browser acceptance cases to Senior; browser verification pending is an expected handoff, not an implementation blocker. Tell the user that Senior will perform the remaining browser checks.`:` You own the remaining verification, including relevant browser checks and visual inspection using the supplied tools. Tell the user those checks are next, keep the app usable during checking and report anything unverified if checking is interrupted or unavailable.`}return`[Vibe64 role: ${assistantModeLabel(mode)}. Applies only to this request; earlier per-turn mode instructions no longer apply.]\n${instruction}${planInstructions?`\n${planInstructions}`:``}\n\n${message}`}function assistantGoalObjective(objective,pinned){if(pinned?.objective&&[`custom`,`senior`,`junior`].some(mode=>objective===assistantModePrompt(mode,pinned.objective)))return pinned.objective;return objective}function assistantGoalManagementMessage(message,turn={}){if(!message||message.receipt===false||turn.user?.receipt===false||turn.optimistic&&turn.optimistic.status!==`accepted`||turn.system?.delivery)return false;const native=message.data?.native;if(!(turn.metadata?.engineId===`claude`||turn.metadata?.assistantSelection?.engineId===`claude`||native?.engineId===`claude`))return false;const text=String(message.text||``);if(message.role===`user`)return Boolean(turn.metadata?.upstreamMessageId||message.receipt===true)&&/^\/goal(?:\s|$)/u.test(text);if(![`assistant`,`commentary`].includes(message.role))return false;if(native?.command)return native.engineId===`claude`&&([`assistant`,`result`].includes(native.type)||native.type===`system`&&[`local_command`,`local_command_output`].includes(native.subtype))&&native.command===`goal`&&native.output===`stdout`;const prefix=[`Goal set: `,`Goal cleared: `,`Goal active: `].find(value=>text.startsWith(value));if(prefix){const objective=text.slice(prefix.length);const separator=objective.indexOf(`
|
|
96
96
|
|
|
97
97
|
`);if(separator!==-1&&assistantGoalObjective(objective,{objective:objective.slice(separator+2)})!==objective)return true}return native?.type===`system`&&native.subtype===`local_command_output`&&Boolean(prefix||text===`No goal set`||text==="No goal set. Usage: `/goal <condition>`")}function assistantRoutingOutcomeNotice(request){if(!request?.messageId||!request.outcome||request.stopped)return null;const auto=request.mode===`auto`;let handoff=auto?`Returning to Junior for rework.`:`Returning to implementation for rework.`;if(request.status===`complete`)handoff=`Work finished.`;else if(request.stage===`review`)handoff=!auto?`Ready for review.`:request.planInvolved?`Ready for Senior to check the plan.`:`Ready for Senior review.`;const headings={continue:`Continuing work.`,handoff,wait:`Waiting to continue.`,complete:request.stage===`review`?`Review complete.`:`Finished.`};return{messageId:`assistant-routing-outcome:${request.messageId}:${request.outcome.turnId}:${request.outcome.decision}`,text:`${headings[request.outcome.decision]}\n\n${request.outcome.explanation}`}}function assistantRoutingStatusLabel(request){if(!request)return``;const selection=request.assignments?.[assistantWorkflowRole(request)];const recipient=selection?vibe64AssistantSelectionLabel(selection):``;const pass=assistantAfterPlanPass(request);const stage=pass?`${pass.title} after the plan`:(request.mode===`auto`||request.stage===`review`)&&{planning:`Planning`,implementation:`Implementing`,review:`Reviewing`}[request.stage]||assistantModeLabel(request.resolvedMode);if(request.delivery===`uncertain`)return`Delivery unconfirmed · ${recipient}`;if(request.status===`waiting`)return request.stopped?`Paused at your request.`:`${stage} waiting · ${recipient}`;if(request.status===`complete`){if(!request.workflow)return`Reply finished.`;if(request.stage===`pass`)return request.passChain?.stopped?`After-plan passes stopped.`:`Work finished.`;if(request.stage===`review`)return`Review complete — read the findings above.`;return request.outcome?.decision===`handoff`?`Work finished.`:`Reply finished.`}if(request.delivery===`routing`)return`Choosing the recipient with Router…`;if(request.delivery===`failed`)return`Request not sent`;if(request.delivery===`pending`)return`${stage} ready to continue · ${recipient}`;if(request.delivery===`sending`)return`${stage} · ${recipient} · awaiting receipt…`;return`${stage} · ${recipient}`}var __testables$2=Object.freeze({MAIN_CHAT_PURPOSES});var VIBE64_AGENT_TASK_RESULT_KINDS=Object.freeze({COMPLETE:`complete`,CONTINUE:`continue`});var VIBE64_AGENT_TASK_RESULT_SCHEMA=Object.freeze({additionalProperties:false,properties:{kind:{enum:Object.values(VIBE64_AGENT_TASK_RESULT_KINDS),type:`string`},message:{description:`Normal Markdown shown to the user for this task turn.`,type:`string`},report:{description:`A concise factual handoff for the main conversation when the task is complete; otherwise an empty string.`,type:`string`}},required:[`kind`,`message`,`report`],type:`object`});var VIBE64_AI_TASK_RESULT_KINDS=Object.freeze({CANNOT:`cannot`,COMPLETE:`complete`,QUESTION:`question`});var VIBE64_AI_TASK_RESULT_SCHEMA=Object.freeze({additionalProperties:false,properties:{kind:{description:`complete when the work is ready for Vibe64 to check, question when you need the person's decision, cannot when you cannot finish this.`,enum:Object.values(VIBE64_AI_TASK_RESULT_KINDS),type:`string`},message:{description:`Normal Markdown shown to the user for this task turn. For question, the question. For cannot, why.`,type:`string`},report:{description:`What you did, in a few plain sentences, when the task is complete; otherwise an empty string.`,type:`string`}},required:[`kind`,`message`,`report`],type:`object`});var VIBE64_TASK_RESULT_KINDS=Object.freeze([...Object.values(VIBE64_AGENT_TASK_RESULT_KINDS),VIBE64_AI_TASK_RESULT_KINDS.QUESTION,VIBE64_AI_TASK_RESULT_KINDS.CANNOT]);var VIBE64_ASSISTANT_ACCESS_ERROR_CODES=Object.freeze({RESTRICTED:`vibe64_assistant_owner_required`,UNAVAILABLE:`vibe64_assistant_connection_unavailable`});var VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS=10;var VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS=160;var ATTACHMENT_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;var IMAGE_TYPES=Object.freeze({avif:`image/avif`,bmp:`image/bmp`,gif:`image/gif`,jpeg:`image/jpeg`,jpg:`image/jpeg`,png:`image/png`,webp:`image/webp`});function conversationAttachmentContentType(fileName=``){const extension=String(fileName).split(`.`).at(-1).toLowerCase();return Object.hasOwn(IMAGE_TYPES,extension)?IMAGE_TYPES[extension]:`application/octet-stream`}function conversationAttachmentReference(attachment={},number=1){return`[${conversationAttachmentContentType(attachment.fileName).startsWith(`image/`)?`Image`:`File`} #${number}]`}function conversationAttachmentFileName(value=``){const normalized=Array.from(String(value??``),character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127?` `:character}).join(``).trim();return Array.from(normalized).slice(0,VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS).join(``)}function normalizeVibe64ConversationAttachments(value=[]){return(Array.isArray(value)?value:[]).slice(0,VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS).map(candidate=>{if(!candidate||typeof candidate!==`object`||Array.isArray(candidate)||typeof candidate.fileName!==`string`)return null;const fileName=conversationAttachmentFileName(candidate.fileName);if(!fileName)return null;return{...ATTACHMENT_ID_PATTERN.test(String(candidate.attachmentId||``))?{attachmentId:candidate.attachmentId}:{},.../^\[(?:Image|File) #[1-9][0-9]{0,3}\]$/u.test(candidate.reference||``)?{reference:candidate.reference}:{},fileName,...Number.isSafeInteger(candidate.size)&&candidate.size>=0?{size:candidate.size}:{}}}).filter(Boolean)}var VIBE64_PROMPT_HINT_LABEL_MAX_CHARACTERS=24;var VIBE64_PROMPT_HINT_PROMPT_MAX_CHARACTERS=108;function normalizedPromptHintDraft(value=``){return Array.from(String(value??``).replace(/\r\n?/gu,`
|
|
98
98
|
`).trim()).slice(-4e3).join(``)}var VIBE64_PROMPT_HINT_OUTPUT_SCHEMA=Object.freeze({additionalProperties:false,properties:Object.freeze({suggestions:Object.freeze({items:Object.freeze({additionalProperties:false,properties:Object.freeze({label:Object.freeze({maxLength:24,minLength:1,type:`string`}),prompt:Object.freeze({maxLength:108,minLength:1,type:`string`})}),required:Object.freeze([`label`,`prompt`]),type:`object`}),maxItems:3,minItems:3,type:`array`})}),required:Object.freeze([`suggestions`]),type:`object`});var VIBE64_PROMPT_HINT_STATIC_STARTERS=Object.freeze({existingProject:Object.freeze([Object.freeze({label:`Tour this project`,prompt:`Give me a quick tour of this project`}),Object.freeze({label:`Find first improvement`,prompt:`What should I improve first?`}),Object.freeze({label:`Plan safe change`,prompt:`Help me plan a small safe change`})]),greenfield:Object.freeze([Object.freeze({label:`Shape app idea`,prompt:`Help me shape my app idea`}),Object.freeze({label:`Plan first version`,prompt:`Show me the simplest useful first version`}),Object.freeze({label:`Decide first steps`,prompt:`What should we decide first?`})])});function normalizedPromptHintSuggestion(suggestion={}){if(!suggestion||typeof suggestion!==`object`||Array.isArray(suggestion)||Object.keys(suggestion).length!==2||!Object.hasOwn(suggestion,`label`)||!Object.hasOwn(suggestion,`prompt`)||typeof suggestion.label!==`string`||typeof suggestion.prompt!==`string`||[suggestion.label,suggestion.prompt].some(text=>Array.from(text).some(character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127})))return null;const label=suggestion.label.trim().replace(/[\t ]+/gu,` `);const prompt=suggestion.prompt.trim().replace(/[\t ]+/gu,` `);const labelWordCount=label?label.split(/\s+/u).length:0;return label&&prompt&&Array.from(label).length<=24&&Array.from(prompt).length<=108&&labelWordCount>=2&&labelWordCount<=4?{label,prompt}:null}function normalizedPromptHintSuggestions(value=[]){if(!Array.isArray(value)||value.length!==3)return[];const suggestions=value.map(normalizedPromptHintSuggestion).filter(Boolean);return suggestions.length===3&&new Set(suggestions.map(({label})=>label.toLocaleLowerCase())).size===3&&new Set(suggestions.map(({prompt})=>prompt.toLocaleLowerCase())).size===3?suggestions:[]}var VIBE64_SESSION_PRESENCE_CHANGED_EVENT=`vibe64.session.presence.changed`;var VIBE64_SESSION_PRESENCE_DEBOUNCE_MS=5e3;var VIBE64_SESSION_PRESENCE_IDLE_MS=1e4;function parseIntegrationSetupRequest(message){if(message?.role!==`assistant`||typeof message.text!==`string`)return null;const lines=message.text.replace(/\r\n/gu,`
|
|
@@ -171,4 +171,4 @@ ${e}</tr>
|
|
|
171
171
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${O(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:s,autolink:r}){let o=r?O(n,!0):this.parser.parseInline(s),i=re$1(e);if(i===null)return o;e=O(i,r);let u=`<a href="`+e+`"`;return t&&(u+=` title="`+O(t)+`"`),u+=`>`+o+`</a>`,u}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=re$1(e);if(r===null)return O(n);e=r;let o=`<img src="${O(e)}" alt="${O(n)}"`;return t&&(o+=` title="${O(t)}"`),o+=`>`,o}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:O(e.text)}};var z=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}};var T=class l{options;renderer;textRenderer;constructor(e){this.options=e||y,this.options.renderer=this.options.renderer||new S,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new z}static parse(e,t){return new l(t).parse(e)}static parseInline(e,t){return new l(t).parseInline(e)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let o=s,i=this.options.extensions.renderers[o.type].call({parser:this},o);if(i!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(o.type)){t+=i||``;continue}}let r=s;switch(r.type){case`space`:t+=this.renderer.space(r);break;case`hr`:t+=this.renderer.hr(r);break;case`heading`:t+=this.renderer.heading(r);break;case`code`:t+=this.renderer.code(r);break;case`table`:t+=this.renderer.table(r);break;case`blockquote`:t+=this.renderer.blockquote(r);break;case`list`:t+=this.renderer.list(r);break;case`checkbox`:t+=this.renderer.checkbox(r);break;case`html`:t+=this.renderer.html(r);break;case`def`:t+=this.renderer.def(r);break;case`paragraph`:t+=this.renderer.paragraph(r);break;case`text`:t+=this.renderer.text(r);break;default:{let o=`Token with "`+r.type+`" type was not found.`;if(this.options.silent)return console.error(o),``;throw new Error(o)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let i=this.options.extensions.renderers[r.type].call({parser:this},r);if(i!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(r.type)){n+=i||``;continue}}let o=r;switch(o.type){case`escape`:n+=t.text(o);break;case`html`:n+=t.html(o);break;case`link`:n+=t.link(o);break;case`image`:n+=t.image(o);break;case`checkbox`:n+=t.checkbox(o);break;case`strong`:n+=t.strong(o);break;case`em`:n+=t.em(o);break;case`codespan`:n+=t.codespan(o);break;case`br`:n+=t.br(o);break;case`del`:n+=t.del(o);break;case`text`:n+=t.text(o);break;default:{let i=`Token with "`+o.type+`" type was not found.`;if(this.options.silent)return console.error(i),``;throw new Error(i)}}}return n}};var _=class{options;block;constructor(e){this.options=e||y}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?R.lex:R.lexInline}provideParser(e=this.block){return e?T.parse:T.parseInline}};var F=class{defaults=I();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=T;Renderer=S;TextRenderer=z;Lexer=R;Tokenizer=P;Hooks=_;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case`table`:{let r=s;for(let o of r.header)n=n.concat(this.walkTokens(o.tokens,t));for(let o of r.rows)for(let i of o)n=n.concat(this.walkTokens(i.tokens,t));break}case`list`:{let r=s;n=n.concat(this.walkTokens(r.items,t));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(o=>{let i=r[o].flat(1/0);n=n.concat(this.walkTokens(i,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error(`extension name required`);if(`renderer`in r){let o=t.renderers[r.name];o?t.renderers[r.name]=function(...i){let u=r.renderer.apply(this,i);return u===!1&&(u=o.apply(this,i)),u}:t.renderers[r.name]=r.renderer}if(`tokenizer`in r){if(!r.level||r.level!==`block`&&r.level!==`inline`)throw new Error(`extension level must be 'block' or 'inline'`);let o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level===`block`?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level===`inline`&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}`childTokens`in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),s.extensions=t),n.renderer){let r=this.defaults.renderer||new S(this.defaults);for(let o in n.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if([`options`,`parser`].includes(o))continue;let i=o,u=n.renderer[i],a=r[i];r[i]=(...p)=>{let c=u.apply(r,p);return c===!1&&(c=a.apply(r,p)),c||``}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new P(this.defaults);for(let o in n.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if([`options`,`rules`,`lexer`].includes(o))continue;let i=o,u=n.tokenizer[i],a=r[i];r[i]=(...p)=>{let c=u.apply(r,p);return c===!1&&(c=a.apply(r,p)),c}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new _;for(let o in n.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if([`options`,`block`].includes(o))continue;let i=o,u=n.hooks[i],a=r[i];_.passThroughHooks.has(o)?r[i]=p=>{if(this.defaults.async&&_.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await u.call(r,p);return a.call(r,d)})();let c=u.call(r,p);return a.call(r,c)}:r[i]=(...p)=>{if(this.defaults.async)return(async()=>{let d=await u.apply(r,p);return d===!1&&(d=await a.apply(r,p)),d})();let c=u.apply(r,p);return c===!1&&(c=a.apply(r,p)),c}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,o=n.walkTokens;s.walkTokens=function(i){let u=[];return u.push(o.call(this,i)),r&&(u=u.concat(r.call(this,i))),u}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return R.lex(e,t??this.defaults)}parser(e,t){return T.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{let r={...s},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof n>`u`||n===null)return i(new Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return i(new Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let u=o.hooks?await o.hooks.preprocess(n):n,p=await(o.hooks?await o.hooks.provideLexer(e):e?R.lex:R.lexInline)(u,o),c=o.hooks?await o.hooks.processAllTokens(p):p;o.walkTokens&&await Promise.all(this.walkTokens(c,o.walkTokens));let m=await(o.hooks?await o.hooks.provideParser(e):e?T.parse:T.parseInline)(c,o);return o.hooks?await o.hooks.postprocess(m):m})().catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let a=(o.hooks?o.hooks.provideLexer(e):e?R.lex:R.lexInline)(n,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let c=(o.hooks?o.hooks.provideParser(e):e?T.parse:T.parseInline)(a,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(u){return i(u)}}}onError(e,t){return n=>{if(n.message+=`
|
|
172
172
|
Please report this to https://github.com/markedjs/marked.`,e){let s=`<p>An error occurred:</p><pre>`+O(n.message+``,!0)+`</pre>`;return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}};var E=new F;function k(l,e){return E.parse(l,e)}k.options=k.setOptions=function(l){return E.setOptions(l),k.defaults=E.defaults,W(k.defaults),k};k.getDefaults=I;k.defaults=y;function Pt(...l){return E.use(...l),k.defaults=E.defaults,W(k.defaults),k}k.use=Pt;k.walkTokens=function(l,e){return E.walkTokens(l,e)};k.parseInline=E.parseInline;k.Parser=T;k.parser=T.parse;k.Renderer=S;k.TextRenderer=z;k.Lexer=R;k.lexer=R.lex;k.Tokenizer=P;k.Hooks=_;k.parse=k;var gn=k.options;var fn=k.setOptions;var mn=k.walkTokens;var xn=k.parseInline;var Rn=T.parse;var Tn=R.lex;function _OverloadYield(e,d){this.v=e,this.k=d}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _iterableToArrayLimit(r,l){var t=null==r?null:`undefined`!=typeof Symbol&&r[Symbol.iterator]||r[`@@iterator`];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
173
173
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _unsupportedIterableToArray(r,a){if(r){if(`string`==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return`Object`===t&&r.constructor&&(t=r.constructor.name),`Map`===t||`Set`===t?Array.from(r):`Arguments`===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,u=o instanceof _OverloadYield;Promise.resolve(u?o.v:o).then(function(n){if(u){var i=`return`===t&&o.k?t:`next`;if(!o.k||n.done)return resume(i,n);n=e[i](n).value}settle(!!r.done,n)},function(e){resume(`throw`,e)})}catch(e){settle(2,e)}}function settle(e,r){2===e?t.reject(r):t.resolve({value:r,done:e}),(t=t.next)?resume(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(o,u){var i={key:e,arg:r,resolve:o,reject:u,next:null};n?n=n.next=i:(t=n=i,resume(e,r))})},`function`!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype[`function`==typeof Symbol&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke(`next`,e)},AsyncGenerator.prototype.throw=function(e){return this._invoke(`throw`,e)},AsyncGenerator.prototype.return=function(e){return this._invoke(`return`,e)};var entries=Object.entries;var setPrototypeOf=Object.setPrototypeOf;var isFrozen=Object.isFrozen;var getPrototypeOf=Object.getPrototypeOf;var getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;var freeze=Object.freeze;var seal=Object.seal;var create=Object.create;var _ref=typeof Reflect!==`undefined`&&Reflect;var apply=_ref.apply;var construct=_ref.construct;if(!freeze)freeze=function freeze(x){return x};if(!seal)seal=function seal(x){return x};if(!apply)apply=function apply(func,thisArg){for(var _len=arguments.length,args=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++)args[_key-2]=arguments[_key];return func.apply(thisArg,args)};if(!construct)construct=function construct(Func){for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];return new Func(...args)};var arrayForEach=unapply(Array.prototype.forEach);Array.prototype.indexOf;var arrayLastIndexOf=unapply(Array.prototype.lastIndexOf);var arrayPop=unapply(Array.prototype.pop);var arrayPush=unapply(Array.prototype.push);Array.prototype.slice;var arraySplice=unapply(Array.prototype.splice);var arrayIsArray=Array.isArray;var stringToLowerCase=unapply(String.prototype.toLowerCase);var stringToString=unapply(String.prototype.toString);var stringMatch=unapply(String.prototype.match);var stringReplace=unapply(String.prototype.replace);var stringIndexOf=unapply(String.prototype.indexOf);var stringTrim=unapply(String.prototype.trim);var numberToString=unapply(Number.prototype.toString);var booleanToString=unapply(Boolean.prototype.toString);var bigintToString=typeof BigInt===`undefined`?null:unapply(BigInt.prototype.toString);var symbolToString=typeof Symbol===`undefined`?null:unapply(Symbol.prototype.toString);var objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty);var objectToString=unapply(Object.prototype.toString);var regExpTest=unapply(RegExp.prototype.test);var typeErrorCreate=unconstruct(TypeError);function unapply(func){return function(thisArg){if(thisArg instanceof RegExp)thisArg.lastIndex=0;for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)args[_key3-1]=arguments[_key3];return apply(func,thisArg,args)}}function unconstruct(Func){return function(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++)args[_key4]=arguments[_key4];return construct(Func,args)}}function addToSet(set,array){let transformCaseFunc=arguments.length>2&&arguments[2]!==void 0?arguments[2]:stringToLowerCase;if(setPrototypeOf)setPrototypeOf(set,null);if(!arrayIsArray(array))return set;let l=array.length;while(l--){let element=array[l];if(typeof element===`string`){const lcElement=transformCaseFunc(element);if(lcElement!==element){if(!isFrozen(array))array[l]=lcElement;element=lcElement}}set[element]=true}return set}function cleanArray(array){for(let index=0;index<array.length;index++)if(!objectHasOwnProperty(array,index))array[index]=null;return array}function clone(object){const newObject=create(null);for(const _ref2 of entries(object)){var _ref3=_slicedToArray(_ref2,2);const property=_ref3[0];const value=_ref3[1];if(objectHasOwnProperty(object,property)){if(arrayIsArray(value))newObject[property]=cleanArray(value);else if(value&&typeof value===`object`&&value.constructor===Object)newObject[property]=clone(value);else newObject[property]=value}}return newObject}function stringifyValue(value){switch(typeof value){case`string`:return value;case`number`:return numberToString(value);case`boolean`:return booleanToString(value);case`bigint`:return bigintToString?bigintToString(value):`0`;case`symbol`:return symbolToString?symbolToString(value):`Symbol()`;case`undefined`:return objectToString(value);case`function`:case`object`:{if(value===null)return objectToString(value);const valueAsRecord=value;const valueToString=lookupGetter(valueAsRecord,`toString`);if(typeof valueToString===`function`){const stringified=valueToString(valueAsRecord);return typeof stringified===`string`?stringified:objectToString(stringified)}return objectToString(value)}default:return objectToString(value)}}function lookupGetter(object,prop){while(object!==null){const desc=getOwnPropertyDescriptor(object,prop);if(desc){if(desc.get)return unapply(desc.get);if(typeof desc.value===`function`)return unapply(desc.value)}object=getPrototypeOf(object)}function fallbackValue(){return null}return fallbackValue}function isRegex(value){try{regExpTest(value,``);return true}catch(_unused){return false}}var html$1=freeze([`a`,`abbr`,`acronym`,`address`,`area`,`article`,`aside`,`audio`,`b`,`bdi`,`bdo`,`big`,`blink`,`blockquote`,`body`,`br`,`button`,`canvas`,`caption`,`center`,`cite`,`code`,`col`,`colgroup`,`content`,`data`,`datalist`,`dd`,`decorator`,`del`,`details`,`dfn`,`dialog`,`dir`,`div`,`dl`,`dt`,`element`,`em`,`fieldset`,`figcaption`,`figure`,`font`,`footer`,`form`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`head`,`header`,`hgroup`,`hr`,`html`,`i`,`img`,`input`,`ins`,`kbd`,`label`,`legend`,`li`,`main`,`map`,`mark`,`marquee`,`menu`,`menuitem`,`meter`,`nav`,`nobr`,`ol`,`optgroup`,`option`,`output`,`p`,`picture`,`pre`,`progress`,`q`,`rp`,`rt`,`ruby`,`s`,`samp`,`search`,`section`,`select`,`shadow`,`slot`,`small`,`source`,`spacer`,`span`,`strike`,`strong`,`style`,`sub`,`summary`,`sup`,`table`,`tbody`,`td`,`template`,`textarea`,`tfoot`,`th`,`thead`,`time`,`tr`,`track`,`tt`,`u`,`ul`,`var`,`video`,`wbr`]);var svg$1=freeze([`svg`,`a`,`altglyph`,`altglyphdef`,`altglyphitem`,`animatecolor`,`animatemotion`,`animatetransform`,`circle`,`clippath`,`defs`,`desc`,`ellipse`,`enterkeyhint`,`exportparts`,`filter`,`font`,`g`,`glyph`,`glyphref`,`hkern`,`image`,`inputmode`,`line`,`lineargradient`,`marker`,`mask`,`metadata`,`mpath`,`part`,`path`,`pattern`,`polygon`,`polyline`,`radialgradient`,`rect`,`stop`,`style`,`switch`,`symbol`,`text`,`textpath`,`title`,`tref`,`tspan`,`view`,`vkern`]);var svgFilters=freeze([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]);var svgDisallowed=freeze([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]);var mathMl$1=freeze([`math`,`menclose`,`merror`,`mfenced`,`mfrac`,`mglyph`,`mi`,`mlabeledtr`,`mmultiscripts`,`mn`,`mo`,`mover`,`mpadded`,`mphantom`,`mroot`,`mrow`,`ms`,`mspace`,`msqrt`,`mstyle`,`msub`,`msup`,`msubsup`,`mtable`,`mtd`,`mtext`,`mtr`,`munder`,`munderover`,`mprescripts`]);var mathMlDisallowed=freeze([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]);var text$1=freeze([`#text`]);var html=freeze([`accept`,`action`,`align`,`alt`,`autocapitalize`,`autocomplete`,`autopictureinpicture`,`autoplay`,`background`,`bgcolor`,`border`,`capture`,`cellpadding`,`cellspacing`,`checked`,`cite`,`class`,`clear`,`color`,`cols`,`colspan`,`command`,`commandfor`,`controls`,`controlslist`,`coords`,`crossorigin`,`datetime`,`decoding`,`default`,`dir`,`disabled`,`disablepictureinpicture`,`disableremoteplayback`,`download`,`draggable`,`enctype`,`enterkeyhint`,`exportparts`,`face`,`for`,`headers`,`height`,`hidden`,`high`,`href`,`hreflang`,`id`,`inert`,`inputmode`,`integrity`,`ismap`,`kind`,`label`,`lang`,`list`,`loading`,`loop`,`low`,`max`,`maxlength`,`media`,`method`,`min`,`minlength`,`multiple`,`muted`,`name`,`nonce`,`noshade`,`novalidate`,`nowrap`,`open`,`optimum`,`part`,`pattern`,`placeholder`,`playsinline`,`popover`,`popovertarget`,`popovertargetaction`,`poster`,`preload`,`pubdate`,`radiogroup`,`readonly`,`rel`,`required`,`rev`,`reversed`,`role`,`rows`,`rowspan`,`spellcheck`,`scope`,`selected`,`shape`,`size`,`sizes`,`slot`,`span`,`srclang`,`start`,`src`,`srcset`,`step`,`style`,`summary`,`tabindex`,`title`,`translate`,`type`,`usemap`,`valign`,`value`,`width`,`wrap`,`xmlns`]);var svg=freeze([`accent-height`,`accumulate`,`additive`,`alignment-baseline`,`amplitude`,`ascent`,`attributename`,`attributetype`,`azimuth`,`basefrequency`,`baseline-shift`,`begin`,`bias`,`by`,`class`,`clip`,`clippathunits`,`clip-path`,`clip-rule`,`color`,`color-interpolation`,`color-interpolation-filters`,`color-profile`,`color-rendering`,`cx`,`cy`,`d`,`dx`,`dy`,`diffuseconstant`,`direction`,`display`,`divisor`,`dominant-baseline`,`dur`,`edgemode`,`elevation`,`end`,`exponent`,`fill`,`fill-opacity`,`fill-rule`,`filter`,`filterunits`,`flood-color`,`flood-opacity`,`font-family`,`font-size`,`font-size-adjust`,`font-stretch`,`font-style`,`font-variant`,`font-weight`,`fx`,`fy`,`g1`,`g2`,`glyph-name`,`glyphref`,`gradientunits`,`gradienttransform`,`height`,`href`,`id`,`image-rendering`,`in`,`in2`,`intercept`,`k`,`k1`,`k2`,`k3`,`k4`,`kerning`,`keypoints`,`keysplines`,`keytimes`,`lang`,`lengthadjust`,`letter-spacing`,`kernelmatrix`,`kernelunitlength`,`lighting-color`,`local`,`marker-end`,`marker-mid`,`marker-start`,`markerheight`,`markerunits`,`markerwidth`,`maskcontentunits`,`maskunits`,`max`,`mask`,`mask-type`,`media`,`method`,`mode`,`min`,`name`,`numoctaves`,`offset`,`operator`,`opacity`,`order`,`orient`,`orientation`,`origin`,`overflow`,`paint-order`,`path`,`pathlength`,`patterncontentunits`,`patterntransform`,`patternunits`,`pointer-events`,`points`,`preservealpha`,`preserveaspectratio`,`primitiveunits`,`r`,`rx`,`ry`,`radius`,`refx`,`refy`,`repeatcount`,`repeatdur`,`restart`,`result`,`rotate`,`scale`,`seed`,`shape-rendering`,`slope`,`specularconstant`,`specularexponent`,`spreadmethod`,`startoffset`,`stddeviation`,`stitchtiles`,`stop-color`,`stop-opacity`,`stroke-dasharray`,`stroke-dashoffset`,`stroke-linecap`,`stroke-linejoin`,`stroke-miterlimit`,`stroke-opacity`,`stroke`,`stroke-width`,`style`,`surfacescale`,`systemlanguage`,`tabindex`,`tablevalues`,`targetx`,`targety`,`transform`,`transform-origin`,`text-anchor`,`text-decoration`,`text-orientation`,`text-rendering`,`textlength`,`type`,`u1`,`u2`,`unicode`,`values`,`vector-effect`,`viewbox`,`visibility`,`version`,`vert-adv-y`,`vert-origin-x`,`vert-origin-y`,`width`,`word-spacing`,`wrap`,`writing-mode`,`xchannelselector`,`ychannelselector`,`x`,`x1`,`x2`,`xmlns`,`y`,`y1`,`y2`,`z`,`zoomandpan`]);var mathMl=freeze([`accent`,`accentunder`,`align`,`bevelled`,`close`,`columnalign`,`columnlines`,`columnspacing`,`columnspan`,`denomalign`,`depth`,`dir`,`display`,`displaystyle`,`encoding`,`fence`,`frame`,`height`,`href`,`id`,`largeop`,`length`,`linethickness`,`lquote`,`lspace`,`mathbackground`,`mathcolor`,`mathsize`,`mathvariant`,`maxsize`,`minsize`,`movablelimits`,`notation`,`numalign`,`open`,`rowalign`,`rowlines`,`rowspacing`,`rowspan`,`rspace`,`rquote`,`scriptlevel`,`scriptminsize`,`scriptsizemultiplier`,`selection`,`separator`,`separators`,`stretchy`,`subscriptshift`,`supscriptshift`,`symmetric`,`voffset`,`width`,`xmlns`]);var xml=freeze([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]);var MUSTACHE_EXPR=seal(/{{[\w\W]*|^[\w\W]*}}/g);var ERB_EXPR=seal(/<%[\w\W]*|^[\w\W]*%>/g);var TMPLIT_EXPR=seal(/\${[\w\W]*/g);var DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);var ARIA_ATTR=seal(/^aria-[\-\w]+$/);var IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);var IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i);var ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);var DOCTYPE_NAME=seal(/^html$/i);var CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i);var ELEMENT_MARKUP_PROBE=seal(/<[/\w!]/g);var COMMENT_MARKUP_PROBE=seal(/<[/\w]/g);var FALLBACK_TAG_CLOSE=seal(/<\/no(script|embed|frames)/i);var SELF_CLOSING_TAG=seal(/\/>/i);var NODE_TYPE={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12};var LITERAL_TEXT_ELEMENT_NAMES=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`];var LITERAL_TEXT_ELEMENTS=freeze(addToSet({},LITERAL_TEXT_ELEMENT_NAMES));var LITERAL_TEXT_CLOSE=function(){const map={};arrayForEach(LITERAL_TEXT_ELEMENT_NAMES,name=>{map[name]=seal(new RegExp(`</`+name+`(?=[\\t\\n\\f\\r />])`,`i`))});return freeze(map)}();var getGlobal=function getGlobal(){return typeof window===`undefined`?null:window};var _createTrustedTypesPolicy=function _createTrustedTypesPolicy(trustedTypes,purifyHostElement){if(typeof trustedTypes!==`object`||typeof trustedTypes.createPolicy!==`function`)return null;let suffix=null;const ATTR_NAME=`data-tt-policy-suffix`;if(purifyHostElement&&purifyHostElement.hasAttribute(ATTR_NAME))suffix=purifyHostElement.getAttribute(ATTR_NAME);const policyName=`dompurify`+(suffix?`#`+suffix:``);try{return trustedTypes.createPolicy(policyName,{createHTML(html){return html},createScriptURL(scriptUrl){return scriptUrl}})}catch(_){console.warn(`TrustedTypes policy `+policyName+` could not be created.`);return null}};var _createHooksMap=function _createHooksMap(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};var _resolveSetOption=function _resolveSetOption(cfg,key,fallback,options){return objectHasOwnProperty(cfg,key)&&arrayIsArray(cfg[key])?addToSet(options.base?clone(options.base):{},cfg[key],options.transform):fallback};var _resolveObjectOption=function _resolveObjectOption(cfg,key,makeFallback){const value=objectHasOwnProperty(cfg,key)?cfg[key]:void 0;return value&&typeof value===`object`?clone(value):makeFallback()};function createDOMPurify(){let window=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal();const DOMPurify=root=>createDOMPurify(root);DOMPurify.version=`3.4.16`;DOMPurify.removed=[];if(!window||!window.document||window.document.nodeType!==NODE_TYPE.document||!window.Element){DOMPurify.isSupported=false;return DOMPurify}let document=window.document;const originalDocument=document;const currentScript=originalDocument.currentScript;window.DocumentFragment;const HTMLTemplateElement=window.HTMLTemplateElement,Node=window.Node,Element=window.Element,NodeFilter=window.NodeFilter;window.NamedNodeMap===void 0&&(window.NamedNodeMap||window.MozNamedAttrMap);window.HTMLFormElement;const DOMParser=window.DOMParser,trustedTypes=window.trustedTypes;const ElementPrototype=Element.prototype;const cloneNode=lookupGetter(ElementPrototype,`cloneNode`);const remove=lookupGetter(ElementPrototype,`remove`);const removeAttributeNode=lookupGetter(ElementPrototype,`removeAttributeNode`);const getNextSibling=lookupGetter(ElementPrototype,`nextSibling`);const getChildNodes=lookupGetter(ElementPrototype,`childNodes`);const getParentNode=lookupGetter(ElementPrototype,`parentNode`);const getShadowRoot=lookupGetter(ElementPrototype,`shadowRoot`);const getAttributes=lookupGetter(ElementPrototype,`attributes`);const getNodeType=Node&&Node.prototype?lookupGetter(Node.prototype,`nodeType`):null;const getNodeName=Node&&Node.prototype?lookupGetter(Node.prototype,`nodeName`):null;const getOwnerDocument=Node&&Node.prototype?lookupGetter(Node.prototype,`ownerDocument`):null;const _readNodeType=function _readNodeType(node){return getNodeType?getNodeType(node):node.nodeType};const _readNodeName=function _readNodeName(node){return getNodeName?getNodeName(node):node.nodeName};if(typeof HTMLTemplateElement===`function`){const template=document.createElement(`template`);if(template.content&&template.content.ownerDocument)document=template.content.ownerDocument}let trustedTypesPolicy;let emptyHTML=``;let defaultTrustedTypesPolicy;let defaultTrustedTypesPolicyResolved=false;let IN_TRUSTED_TYPES_POLICY=0;const _assertNotInTrustedTypesPolicy=function _assertNotInTrustedTypesPolicy(){if(IN_TRUSTED_TYPES_POLICY>0)throw typeErrorCreate(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)};const _createTrustedHTML=function _createTrustedHTML(html){_assertNotInTrustedTypesPolicy();IN_TRUSTED_TYPES_POLICY++;try{return trustedTypesPolicy.createHTML(html)}finally{IN_TRUSTED_TYPES_POLICY--}};const _createTrustedScriptURL=function _createTrustedScriptURL(scriptUrl){_assertNotInTrustedTypesPolicy();IN_TRUSTED_TYPES_POLICY++;try{return trustedTypesPolicy.createScriptURL(scriptUrl)}finally{IN_TRUSTED_TYPES_POLICY--}};const _getDefaultTrustedTypesPolicy=function _getDefaultTrustedTypesPolicy(){if(!defaultTrustedTypesPolicyResolved){defaultTrustedTypesPolicy=_createTrustedTypesPolicy(trustedTypes,currentScript);defaultTrustedTypesPolicyResolved=true}return defaultTrustedTypesPolicy};const _document=document,implementation=_document.implementation,createNodeIterator=_document.createNodeIterator,createDocumentFragment=_document.createDocumentFragment,getElementsByTagName=_document.getElementsByTagName;const importNode=originalDocument.importNode;let hooks=_createHooksMap();DOMPurify.isSupported=typeof entries===`function`&&typeof getParentNode===`function`&&implementation&&implementation.createHTMLDocument!==void 0;const MUSTACHE_EXPR$1=MUSTACHE_EXPR,ERB_EXPR$1=ERB_EXPR,TMPLIT_EXPR$1=TMPLIT_EXPR,DATA_ATTR$1=DATA_ATTR,ARIA_ATTR$1=ARIA_ATTR,IS_SCRIPT_OR_DATA$1=IS_SCRIPT_OR_DATA,ATTR_WHITESPACE$1=ATTR_WHITESPACE,CUSTOM_ELEMENT$1=CUSTOM_ELEMENT;let IS_ALLOWED_URI$1=IS_ALLOWED_URI;let ALLOWED_TAGS=null;const DEFAULT_ALLOWED_TAGS=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text$1]);let ALLOWED_ATTR=null;const DEFAULT_ALLOWED_ATTR=addToSet({},[...html,...svg,...mathMl,...xml]);let CUSTOM_ELEMENT_HANDLING=Object.seal(create(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}}));let FORBID_TAGS=null;let FORBID_ATTR=null;const EXTRA_ELEMENT_HANDLING=Object.seal(create(null,{tagCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeCheck:{writable:true,configurable:false,enumerable:true,value:null}}));let ALLOW_ARIA_ATTR=true;let ALLOW_DATA_ATTR=true;let ALLOW_UNKNOWN_PROTOCOLS=false;let ALLOW_SELF_CLOSE_IN_ATTR=true;let SAFE_FOR_TEMPLATES=false;let SAFE_FOR_XML=true;let WHOLE_DOCUMENT=false;let SET_CONFIG=false;let SET_CONFIG_ALLOWED_TAGS=null;let SET_CONFIG_ALLOWED_ATTR=null;let FORCE_BODY=false;let RETURN_DOM=false;let RETURN_DOM_FRAGMENT=false;let RETURN_TRUSTED_TYPE=false;let SANITIZE_DOM=true;let SANITIZE_NAMED_PROPS=false;const SANITIZE_NAMED_PROPS_PREFIX=`user-content-`;let KEEP_CONTENT=true;let IN_PLACE=false;let USE_PROFILES={};let FORBID_CONTENTS=null;const DEFAULT_FORBID_CONTENTS=addToSet({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`selectedcontent`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]);let DATA_URI_TAGS=null;const DEFAULT_DATA_URI_TAGS=addToSet({},[`audio`,`video`,`img`,`source`,`image`,`track`]);let URI_SAFE_ATTRIBUTES=null;const DEFAULT_URI_SAFE_ATTRIBUTES=addToSet({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]);const MATHML_NAMESPACE=`http://www.w3.org/1998/Math/MathML`;const SVG_NAMESPACE=`http://www.w3.org/2000/svg`;const HTML_NAMESPACE=`http://www.w3.org/1999/xhtml`;let NAMESPACE=HTML_NAMESPACE;let IS_EMPTY_INPUT=false;let ALLOWED_NAMESPACES=null;const DEFAULT_ALLOWED_NAMESPACES=addToSet({},[MATHML_NAMESPACE,SVG_NAMESPACE,HTML_NAMESPACE],stringToString);const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS=freeze([`mi`,`mo`,`mn`,`ms`,`mtext`]);let MATHML_TEXT_INTEGRATION_POINTS=addToSet({},DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);const DEFAULT_HTML_INTEGRATION_POINTS=freeze([`annotation-xml`]);let HTML_INTEGRATION_POINTS=addToSet({},DEFAULT_HTML_INTEGRATION_POINTS);const COMMON_SVG_AND_HTML_ELEMENTS=addToSet({},[`title`,`style`,`font`,`a`,`script`]);let PARSER_MEDIA_TYPE=null;const SUPPORTED_PARSER_MEDIA_TYPES=[`application/xhtml+xml`,`text/html`];const DEFAULT_PARSER_MEDIA_TYPE=`text/html`;let transformCaseFunc=null;let CONFIG=null;const formElement=document.createElement(`form`);const isRegexOrFunction=function isRegexOrFunction(testValue){return testValue instanceof RegExp||testValue instanceof Function};const _parseConfig=function _parseConfig(){let cfg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(CONFIG&&CONFIG===cfg)return;if(!cfg||typeof cfg!==`object`)cfg={};cfg=clone(cfg);PARSER_MEDIA_TYPE=SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE)===-1?DEFAULT_PARSER_MEDIA_TYPE:cfg.PARSER_MEDIA_TYPE;transformCaseFunc=PARSER_MEDIA_TYPE===`application/xhtml+xml`?stringToString:stringToLowerCase;ALLOWED_TAGS=_resolveSetOption(cfg,`ALLOWED_TAGS`,DEFAULT_ALLOWED_TAGS,{transform:transformCaseFunc});ALLOWED_ATTR=_resolveSetOption(cfg,`ALLOWED_ATTR`,DEFAULT_ALLOWED_ATTR,{transform:transformCaseFunc});ALLOWED_NAMESPACES=_resolveSetOption(cfg,`ALLOWED_NAMESPACES`,DEFAULT_ALLOWED_NAMESPACES,{transform:stringToString});URI_SAFE_ATTRIBUTES=_resolveSetOption(cfg,`ADD_URI_SAFE_ATTR`,DEFAULT_URI_SAFE_ATTRIBUTES,{transform:transformCaseFunc,base:DEFAULT_URI_SAFE_ATTRIBUTES});DATA_URI_TAGS=_resolveSetOption(cfg,`ADD_DATA_URI_TAGS`,DEFAULT_DATA_URI_TAGS,{transform:transformCaseFunc,base:DEFAULT_DATA_URI_TAGS});FORBID_CONTENTS=_resolveSetOption(cfg,`FORBID_CONTENTS`,DEFAULT_FORBID_CONTENTS,{transform:transformCaseFunc});FORBID_TAGS=_resolveSetOption(cfg,`FORBID_TAGS`,clone({}),{transform:transformCaseFunc});FORBID_ATTR=_resolveSetOption(cfg,`FORBID_ATTR`,clone({}),{transform:transformCaseFunc});USE_PROFILES=objectHasOwnProperty(cfg,`USE_PROFILES`)?cfg.USE_PROFILES&&typeof cfg.USE_PROFILES===`object`?clone(cfg.USE_PROFILES):cfg.USE_PROFILES:false;ALLOW_ARIA_ATTR=cfg.ALLOW_ARIA_ATTR!==false;ALLOW_DATA_ATTR=cfg.ALLOW_DATA_ATTR!==false;ALLOW_UNKNOWN_PROTOCOLS=cfg.ALLOW_UNKNOWN_PROTOCOLS||false;ALLOW_SELF_CLOSE_IN_ATTR=cfg.ALLOW_SELF_CLOSE_IN_ATTR!==false;SAFE_FOR_TEMPLATES=cfg.SAFE_FOR_TEMPLATES||false;SAFE_FOR_XML=cfg.SAFE_FOR_XML!==false;WHOLE_DOCUMENT=cfg.WHOLE_DOCUMENT||false;RETURN_DOM=cfg.RETURN_DOM||false;RETURN_DOM_FRAGMENT=cfg.RETURN_DOM_FRAGMENT||false;RETURN_TRUSTED_TYPE=cfg.RETURN_TRUSTED_TYPE||false;FORCE_BODY=cfg.FORCE_BODY||false;SANITIZE_DOM=cfg.SANITIZE_DOM!==false;SANITIZE_NAMED_PROPS=cfg.SANITIZE_NAMED_PROPS||false;KEEP_CONTENT=cfg.KEEP_CONTENT!==false;IN_PLACE=cfg.IN_PLACE||false;IS_ALLOWED_URI$1=isRegex(cfg.ALLOWED_URI_REGEXP)?cfg.ALLOWED_URI_REGEXP:IS_ALLOWED_URI;NAMESPACE=typeof cfg.NAMESPACE===`string`?cfg.NAMESPACE:HTML_NAMESPACE;MATHML_TEXT_INTEGRATION_POINTS=_resolveObjectOption(cfg,`MATHML_TEXT_INTEGRATION_POINTS`,()=>addToSet({},DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));HTML_INTEGRATION_POINTS=_resolveObjectOption(cfg,`HTML_INTEGRATION_POINTS`,()=>addToSet({},DEFAULT_HTML_INTEGRATION_POINTS));const customElementHandling=_resolveObjectOption(cfg,`CUSTOM_ELEMENT_HANDLING`,()=>create(null));CUSTOM_ELEMENT_HANDLING=create(null);if(objectHasOwnProperty(customElementHandling,`tagNameCheck`)&&isRegexOrFunction(customElementHandling.tagNameCheck))CUSTOM_ELEMENT_HANDLING.tagNameCheck=customElementHandling.tagNameCheck;if(objectHasOwnProperty(customElementHandling,`attributeNameCheck`)&&isRegexOrFunction(customElementHandling.attributeNameCheck))CUSTOM_ELEMENT_HANDLING.attributeNameCheck=customElementHandling.attributeNameCheck;if(objectHasOwnProperty(customElementHandling,`allowCustomizedBuiltInElements`)&&typeof customElementHandling.allowCustomizedBuiltInElements===`boolean`)CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=customElementHandling.allowCustomizedBuiltInElements;seal(CUSTOM_ELEMENT_HANDLING);if(SAFE_FOR_TEMPLATES)ALLOW_DATA_ATTR=false;if(RETURN_DOM_FRAGMENT)RETURN_DOM=true;if(USE_PROFILES){ALLOWED_TAGS=addToSet({},text$1);ALLOWED_ATTR=create(null);if(USE_PROFILES.html===true){addToSet(ALLOWED_TAGS,html$1);addToSet(ALLOWED_ATTR,html)}if(USE_PROFILES.svg===true){addToSet(ALLOWED_TAGS,svg$1);addToSet(ALLOWED_ATTR,svg);addToSet(ALLOWED_ATTR,xml)}if(USE_PROFILES.svgFilters===true){addToSet(ALLOWED_TAGS,svgFilters);addToSet(ALLOWED_ATTR,svg);addToSet(ALLOWED_ATTR,xml)}if(USE_PROFILES.mathMl===true){addToSet(ALLOWED_TAGS,mathMl$1);addToSet(ALLOWED_ATTR,mathMl);addToSet(ALLOWED_ATTR,xml)}}EXTRA_ELEMENT_HANDLING.tagCheck=null;EXTRA_ELEMENT_HANDLING.attributeCheck=null;if(objectHasOwnProperty(cfg,`ADD_TAGS`)){if(typeof cfg.ADD_TAGS===`function`)EXTRA_ELEMENT_HANDLING.tagCheck=cfg.ADD_TAGS;else if(arrayIsArray(cfg.ADD_TAGS)){if(ALLOWED_TAGS===DEFAULT_ALLOWED_TAGS)ALLOWED_TAGS=clone(ALLOWED_TAGS);addToSet(ALLOWED_TAGS,cfg.ADD_TAGS,transformCaseFunc)}}if(objectHasOwnProperty(cfg,`ADD_ATTR`)){if(typeof cfg.ADD_ATTR===`function`)EXTRA_ELEMENT_HANDLING.attributeCheck=cfg.ADD_ATTR;else if(arrayIsArray(cfg.ADD_ATTR)){if(ALLOWED_ATTR===DEFAULT_ALLOWED_ATTR)ALLOWED_ATTR=clone(ALLOWED_ATTR);addToSet(ALLOWED_ATTR,cfg.ADD_ATTR,transformCaseFunc)}}if(objectHasOwnProperty(cfg,`ADD_FORBID_CONTENTS`)&&arrayIsArray(cfg.ADD_FORBID_CONTENTS)){if(FORBID_CONTENTS===DEFAULT_FORBID_CONTENTS)FORBID_CONTENTS=clone(FORBID_CONTENTS);addToSet(FORBID_CONTENTS,cfg.ADD_FORBID_CONTENTS,transformCaseFunc)}if(KEEP_CONTENT)ALLOWED_TAGS[`#text`]=true;if(WHOLE_DOCUMENT)addToSet(ALLOWED_TAGS,[`html`,`head`,`body`]);if(ALLOWED_TAGS.table){addToSet(ALLOWED_TAGS,[`tbody`]);delete FORBID_TAGS.tbody}if(cfg.TRUSTED_TYPES_POLICY){if(typeof cfg.TRUSTED_TYPES_POLICY.createHTML!==`function`)throw typeErrorCreate(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL!==`function`)throw typeErrorCreate(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);const previousTrustedTypesPolicy=trustedTypesPolicy;trustedTypesPolicy=cfg.TRUSTED_TYPES_POLICY;try{emptyHTML=_createTrustedHTML(``)}catch(error){trustedTypesPolicy=previousTrustedTypesPolicy;throw error}}else if(cfg.TRUSTED_TYPES_POLICY===null){trustedTypesPolicy=void 0;emptyHTML=``}else{if(trustedTypesPolicy===void 0)trustedTypesPolicy=_getDefaultTrustedTypesPolicy();if(trustedTypesPolicy&&typeof emptyHTML===`string`)emptyHTML=_createTrustedHTML(``)}if(freeze)freeze(cfg);CONFIG=cfg};const ALL_SVG_TAGS=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]);const ALL_MATHML_TAGS=addToSet({},[...mathMl$1,...mathMlDisallowed]);const _checkSvgNamespace=function _checkSvgNamespace(tagName,parent,parentTagName){if(parent.namespaceURI===HTML_NAMESPACE)return tagName===`svg`;if(parent.namespaceURI===MATHML_NAMESPACE)return tagName===`svg`&&(parentTagName===`annotation-xml`||MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);return Boolean(ALL_SVG_TAGS[tagName])};const _checkMathMlNamespace=function _checkMathMlNamespace(tagName,parent,parentTagName){if(parent.namespaceURI===HTML_NAMESPACE)return tagName===`math`;if(parent.namespaceURI===SVG_NAMESPACE)return tagName===`math`&&HTML_INTEGRATION_POINTS[parentTagName];return Boolean(ALL_MATHML_TAGS[tagName])};const _checkHtmlNamespace=function _checkHtmlNamespace(tagName,parent,parentTagName){if(parent.namespaceURI===SVG_NAMESPACE&&!HTML_INTEGRATION_POINTS[parentTagName])return false;if(parent.namespaceURI===MATHML_NAMESPACE&&!MATHML_TEXT_INTEGRATION_POINTS[parentTagName])return false;return!ALL_MATHML_TAGS[tagName]&&(COMMON_SVG_AND_HTML_ELEMENTS[tagName]||!ALL_SVG_TAGS[tagName])};const _checkValidNamespace=function _checkValidNamespace(element){let parent=getParentNode(element);if(!parent||!parent.tagName)parent={namespaceURI:NAMESPACE,tagName:`template`};const tagName=stringToLowerCase(element.tagName);const parentTagName=stringToLowerCase(parent.tagName);if(!ALLOWED_NAMESPACES[element.namespaceURI])return false;if(element.namespaceURI===SVG_NAMESPACE)return _checkSvgNamespace(tagName,parent,parentTagName);if(element.namespaceURI===MATHML_NAMESPACE)return _checkMathMlNamespace(tagName,parent,parentTagName);if(element.namespaceURI===HTML_NAMESPACE)return _checkHtmlNamespace(tagName,parent,parentTagName);if(PARSER_MEDIA_TYPE===`application/xhtml+xml`&&ALLOWED_NAMESPACES[element.namespaceURI])return true;return false};const _forceRemove=function _forceRemove(node){arrayPush(DOMPurify.removed,{element:node});try{getParentNode(node).removeChild(node)}catch(_){remove(node);if(!getParentNode(node))throw typeErrorCreate(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}};const _stripAttributeNode=function _stripAttributeNode(element,attribute,name){try{removeAttributeNode(element,attribute)}catch(_){try{element.removeAttribute(name)}catch(_){}}};const _neutralizeRoot=function _neutralizeRoot(root){_neutralizeSubtree(root);const childNodes=getChildNodes(root);if(childNodes){const snapshot=[];arrayForEach(childNodes,child=>{arrayPush(snapshot,child)});arrayForEach(snapshot,child=>{try{remove(child)}catch(_){}})}const attributes=getAttributes(root);if(attributes)for(let i=attributes.length-1;i>=0;--i){const attribute=attributes[i];const name=attribute&&attribute.name;if(typeof name===`string`)_stripAttributeNode(root,attribute,name)}};const _removeAttribute=function _removeAttribute(name,element,attr){if(!attr)try{attr=element.getAttributeNode(name)}catch(_){attr=null}arrayPush(DOMPurify.removed,{attribute:attr||null,from:element});try{if(attr)removeAttributeNode(element,attr);else element.removeAttribute(name)}catch(_){try{element.removeAttribute(name)}catch(_){}}if(name===`is`){if(RETURN_DOM||RETURN_DOM_FRAGMENT)try{_forceRemove(element)}catch(_){}else try{element.setAttribute(name,``)}catch(_){}}};const _stripDisallowedAttributes=function _stripDisallowedAttributes(element){const attributes=getAttributes(element);if(!attributes)return;for(let i=attributes.length-1;i>=0;--i){const attribute=attributes[i];const name=attribute&&attribute.name;if(typeof name!==`string`||ALLOWED_ATTR[transformCaseFunc(name)])continue;_stripAttributeNode(element,attribute,name)}};const _neutralizeSubtree=function _neutralizeSubtree(root){const stack=[root];while(stack.length>0){const node=stack.pop();if(_readNodeType(node)===NODE_TYPE.element)_stripDisallowedAttributes(node);const childNodes=getChildNodes(node);if(childNodes)for(let i=childNodes.length-1;i>=0;--i)stack.push(childNodes[i])}};const _isPatchLinkageAttribute=function _isPatchLinkageAttribute(lcName,lcTag){if(!SAFE_FOR_XML)return false;if(lcName===`patchsrc`)return true;return lcName===`for`&&lcTag!==`label`&&lcTag!==`output`};const _neutralizePatchLinkage=function _neutralizePatchLinkage(root){if(!SAFE_FOR_XML)return;const stack=[root];while(stack.length>0){const node=stack.pop();const nodeType=_readNodeType(node);if(nodeType===NODE_TYPE.processingInstruction||nodeType===NODE_TYPE.comment&®ExpTest(COMMENT_MARKUP_PROBE,node.data)){try{remove(node)}catch(_){}continue}if(nodeType===NODE_TYPE.element){const element=node;const lcTag=transformCaseFunc(_readNodeName(node));try{if(element.hasAttribute&&element.hasAttribute(`patchsrc`))element.removeAttribute(`patchsrc`);if(element.hasAttribute&&element.hasAttribute(`for`)&&_isPatchLinkageAttribute(`for`,lcTag))element.removeAttribute(`for`)}catch(_){}}const childNodes=getChildNodes(node);if(childNodes)for(let i=childNodes.length-1;i>=0;--i)stack.push(childNodes[i])}};const _initDocument=function _initDocument(dirty){let doc=null;let leadingWhitespace=null;if(FORCE_BODY)dirty=`<remove></remove>`+dirty;else{const matches=stringMatch(dirty,/^[\r\n\t ]+/);leadingWhitespace=matches&&matches[0]}if(PARSER_MEDIA_TYPE===`application/xhtml+xml`&&NAMESPACE===HTML_NAMESPACE)dirty=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+dirty+`</body></html>`;const dirtyPayload=trustedTypesPolicy?_createTrustedHTML(dirty):dirty;if(NAMESPACE===HTML_NAMESPACE)try{doc=new DOMParser().parseFromString(dirtyPayload,PARSER_MEDIA_TYPE)}catch(_){}if(!doc||!doc.documentElement){doc=implementation.createDocument(NAMESPACE,`template`,null);try{doc.documentElement.innerHTML=IS_EMPTY_INPUT?emptyHTML:dirtyPayload}catch(_){}}const body=doc.body||doc.documentElement;if(dirty&&leadingWhitespace)body.insertBefore(document.createTextNode(leadingWhitespace),body.childNodes[0]||null);if(NAMESPACE===HTML_NAMESPACE)return getElementsByTagName.call(doc,WHOLE_DOCUMENT?`html`:`body`)[0];return WHOLE_DOCUMENT?doc.documentElement:body};const _createNodeIterator=function _createNodeIterator(root){const doc=getOwnerDocument?getOwnerDocument(root):root.ownerDocument;return createNodeIterator.call(doc||root,root,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_PROCESSING_INSTRUCTION|NodeFilter.SHOW_CDATA_SECTION,null)};const _stripTemplateExpressions=function _stripTemplateExpressions(value){value=stringReplace(value,MUSTACHE_EXPR$1,` `);value=stringReplace(value,ERB_EXPR$1,` `);value=stringReplace(value,TMPLIT_EXPR$1,` `);return value};const _scrubTemplateExpressions2=function _scrubTemplateExpressions(node){var _node$querySelectorAl;node.normalize();const doc=getOwnerDocument?getOwnerDocument(node):node.ownerDocument;const walker=createNodeIterator.call(doc||node,node,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_CDATA_SECTION|NodeFilter.SHOW_PROCESSING_INSTRUCTION,null);let currentNode=walker.nextNode();while(currentNode){currentNode.data=_stripTemplateExpressions(currentNode.data);currentNode=walker.nextNode()}const templates=(_node$querySelectorAl=node.querySelectorAll)===null||_node$querySelectorAl===void 0?void 0:_node$querySelectorAl.call(node,`template`);if(templates)arrayForEach(templates,tmpl=>{if(_isDocumentFragment(tmpl.content))_scrubTemplateExpressions2(tmpl.content)})};const _isClobbered=function _isClobbered(element){const realTagName=getNodeName?getNodeName(element):null;if(typeof realTagName!==`string`)return false;if(transformCaseFunc(realTagName)!==`form`)return false;return typeof element.nodeName!==`string`||typeof element.textContent!==`string`||typeof element.removeChild!==`function`||element.attributes!==getAttributes(element)||typeof element.removeAttribute!==`function`||typeof element.removeAttributeNode!==`function`||typeof element.getAttributeNode!==`function`||typeof element.setAttribute!==`function`||typeof element.namespaceURI!==`string`||typeof element.insertBefore!==`function`||typeof element.hasChildNodes!==`function`||element.nodeType!==getNodeType(element)||element.childNodes!==getChildNodes(element)};const _isDocumentFragment=function _isDocumentFragment(value){if(!getNodeType||typeof value!==`object`||value===null)return false;try{return getNodeType(value)===NODE_TYPE.documentFragment}catch(_){return false}};const _isNode=function _isNode(value){if(!getNodeType||typeof value!==`object`||value===null)return false;try{return typeof getNodeType(value)===`number`}catch(_){return false}};function _executeHooks(hooks,currentNode,data){if(hooks.length===0)return;arrayForEach(hooks,hook=>{hook.call(DOMPurify,currentNode,data,CONFIG)})}const _isUnsafeNode=function _isUnsafeNode(currentNode,tagName){if(SAFE_FOR_XML&¤tNode.hasChildNodes()&&!_isNode(currentNode.firstElementChild)&®ExpTest(ELEMENT_MARKUP_PROBE,currentNode.textContent)&®ExpTest(ELEMENT_MARKUP_PROBE,currentNode.innerHTML))return true;if(SAFE_FOR_XML&¤tNode.namespaceURI===HTML_NAMESPACE&&LITERAL_TEXT_ELEMENTS[tagName]&&(_isNode(currentNode.firstElementChild)||typeof currentNode.textContent===`string`&®ExpTest(LITERAL_TEXT_CLOSE[tagName],currentNode.textContent)))return true;if(currentNode.nodeType===NODE_TYPE.processingInstruction)return true;if(SAFE_FOR_XML&¤tNode.nodeType===NODE_TYPE.comment&®ExpTest(COMMENT_MARKUP_PROBE,currentNode.data))return true;return false};const _matchesNameCheck=function _matchesNameCheck(check,name){if(check instanceof RegExp)return regExpTest(check,name);if(check instanceof Function){for(var _len=arguments.length,args=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++)args[_key-2]=arguments[_key];return Boolean(check(name,...args))}return false};const _sanitizeDisallowedNode=function _sanitizeDisallowedNode(currentNode,tagName,root){if(!FORBID_TAGS[tagName]&&_isBasicCustomElement(tagName)&&_matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck,tagName))return false;if(KEEP_CONTENT&&!FORBID_CONTENTS[tagName]){const parentNode=getParentNode(currentNode);const childNodes=getChildNodes(currentNode);if(childNodes&&parentNode){const childCount=childNodes.length;for(let i=childCount-1;i>=0;--i){const hoisted=currentNode===root?cloneNode(childNodes[i],true):childNodes[i];parentNode.insertBefore(hoisted,getNextSibling(currentNode))}}}_forceRemove(currentNode);return true};const _forkSharedAllowlist=function _forkSharedAllowlist(hookList,set,defaultSet,setConfigSet){if(hookList.length===0)return set;return set===defaultSet||set===setConfigSet?clone(set):set};const _handleHookDetachedNode=function _handleHookDetachedNode(currentNode,root){if(currentNode===root||getParentNode(currentNode)!==null)return false;if(IN_PLACE)_neutralizeSubtree(currentNode);return true};const _sanitizeElements=function _sanitizeElements(currentNode,root){_executeHooks(hooks.beforeSanitizeElements,currentNode,null);if(_handleHookDetachedNode(currentNode,root))return true;if(_isClobbered(currentNode)){_forceRemove(currentNode);return true}const tagName=transformCaseFunc(_readNodeName(currentNode));ALLOWED_TAGS=_forkSharedAllowlist(hooks.uponSanitizeElement,ALLOWED_TAGS,DEFAULT_ALLOWED_TAGS,SET_CONFIG_ALLOWED_TAGS);_executeHooks(hooks.uponSanitizeElement,currentNode,{tagName,allowedTags:ALLOWED_TAGS});if(_handleHookDetachedNode(currentNode,root))return true;if(_isUnsafeNode(currentNode,tagName)){_forceRemove(currentNode);return true}if(FORBID_TAGS[tagName]||!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function&&EXTRA_ELEMENT_HANDLING.tagCheck(tagName))&&!ALLOWED_TAGS[tagName]){const removed=_sanitizeDisallowedNode(currentNode,tagName,root);if(removed===false){_executeHooks(hooks.afterSanitizeElements,currentNode,null);if(_handleHookDetachedNode(currentNode,root))return true}return removed}if(_readNodeType(currentNode)===NODE_TYPE.element&&!_checkValidNamespace(currentNode)){_forceRemove(currentNode);return true}if((tagName===`noscript`||tagName===`noembed`||tagName===`noframes`)&®ExpTest(FALLBACK_TAG_CLOSE,currentNode.innerHTML)){_forceRemove(currentNode);return true}if(SAFE_FOR_TEMPLATES&¤tNode.nodeType===NODE_TYPE.text){const content=_stripTemplateExpressions(currentNode.textContent);if(currentNode.textContent!==content){arrayPush(DOMPurify.removed,{element:currentNode.cloneNode()});currentNode.textContent=content}}_executeHooks(hooks.afterSanitizeElements,currentNode,null);return _handleHookDetachedNode(currentNode,root)};const _isValidAttribute=function _isValidAttribute(lcTag,lcName,value){if(FORBID_ATTR[lcName])return false;if(_isPatchLinkageAttribute(lcName,lcTag))return false;if(SANITIZE_DOM&&(lcName===`id`||lcName===`name`)&&(value in document||value in formElement))return false;const nameIsPermitted=ALLOWED_ATTR[lcName]||EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function&&EXTRA_ELEMENT_HANDLING.attributeCheck(lcName,lcTag);if(ALLOW_DATA_ATTR&®ExpTest(DATA_ATTR$1,lcName))return true;if(ALLOW_ARIA_ATTR&®ExpTest(ARIA_ATTR$1,lcName))return true;if(!nameIsPermitted)return _isBasicCustomElement(lcTag)&&_matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck,lcTag)&&_matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck,lcName,lcTag)||lcName===`is`&&CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&_matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck,value);if(URI_SAFE_ATTRIBUTES[lcName])return true;if(regExpTest(IS_ALLOWED_URI$1,stringReplace(value,ATTR_WHITESPACE$1,``)))return true;if((lcName===`src`||lcName===`xlink:href`||lcName===`href`)&&lcTag!==`script`&&stringIndexOf(value,`data:`)===0&&DATA_URI_TAGS[lcTag])return true;if(ALLOW_UNKNOWN_PROTOCOLS&&!regExpTest(IS_SCRIPT_OR_DATA$1,stringReplace(value,ATTR_WHITESPACE$1,``)))return true;return!value};const RESERVED_CUSTOM_ELEMENT_NAMES=addToSet({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]);const _isBasicCustomElement=function _isBasicCustomElement(tagName){return!RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)]&®ExpTest(CUSTOM_ELEMENT$1,tagName)};const _applyTrustedTypesToAttribute=function _applyTrustedTypesToAttribute(lcTag,lcName,namespaceURI,value){if(trustedTypesPolicy&&typeof trustedTypes===`object`&&typeof trustedTypes.getAttributeType===`function`&&!namespaceURI)switch(trustedTypes.getAttributeType(lcTag,lcName)){case`TrustedHTML`:return _createTrustedHTML(value);case`TrustedScriptURL`:return _createTrustedScriptURL(value)}return value};const _setAttributeValue=function _setAttributeValue(currentNode,name,namespaceURI,value){try{if(namespaceURI)currentNode.setAttributeNS(namespaceURI,name,value);else currentNode.setAttribute(name,value);if(_isClobbered(currentNode)){_forceRemove(currentNode);return false}return true}catch(_){_removeAttribute(name,currentNode);return false}};const _sanitizeAttributes=function _sanitizeAttributes(currentNode,root){_executeHooks(hooks.beforeSanitizeAttributes,currentNode,null);if(_handleHookDetachedNode(currentNode,root))return;const attributes=currentNode.attributes;if(!attributes||_isClobbered(currentNode))return;ALLOWED_ATTR=_forkSharedAllowlist(hooks.uponSanitizeAttribute,ALLOWED_ATTR,DEFAULT_ALLOWED_ATTR,SET_CONFIG_ALLOWED_ATTR);const hookEvent={attrName:``,attrValue:``,keepAttr:true,allowedAttributes:ALLOWED_ATTR,forceKeepAttr:void 0};let l=attributes.length;const lcTag=transformCaseFunc(currentNode.nodeName);while(l--){const attr=attributes[l];const name=attr.name,namespaceURI=attr.namespaceURI,attrValue=attr.value;const lcName=transformCaseFunc(name);const initValue=attrValue;let value=name===`value`?initValue:stringTrim(initValue);let recreatedNamedProp=false;hookEvent.attrName=lcName;hookEvent.attrValue=value;hookEvent.keepAttr=true;hookEvent.forceKeepAttr=void 0;_executeHooks(hooks.uponSanitizeAttribute,currentNode,hookEvent);value=hookEvent.attrValue;if(SANITIZE_NAMED_PROPS&&(lcName===`id`||lcName===`name`)&&stringIndexOf(value,SANITIZE_NAMED_PROPS_PREFIX)!==0){_removeAttribute(name,currentNode,attr);value=SANITIZE_NAMED_PROPS_PREFIX+value;recreatedNamedProp=true}if(SAFE_FOR_XML&®ExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,value)){_removeAttribute(name,currentNode,attr);continue}if(lcName===`attributename`&&stringMatch(value,`href`)){_removeAttribute(name,currentNode,attr);continue}if(hookEvent.forceKeepAttr)continue;if(!hookEvent.keepAttr){_removeAttribute(name,currentNode,attr);continue}if(!ALLOW_SELF_CLOSE_IN_ATTR&®ExpTest(SELF_CLOSING_TAG,value)){_removeAttribute(name,currentNode,attr);continue}if(SAFE_FOR_TEMPLATES)value=_stripTemplateExpressions(value);if(!_isValidAttribute(lcTag,lcName,value)){_removeAttribute(name,currentNode,attr);continue}value=_applyTrustedTypesToAttribute(lcTag,lcName,namespaceURI,value);if(value!==initValue){if(_setAttributeValue(currentNode,name,namespaceURI,value)&&recreatedNamedProp)arrayPop(DOMPurify.removed)}}_executeHooks(hooks.afterSanitizeAttributes,currentNode,null);_handleHookDetachedNode(currentNode,root)};const _sanitizeShadowDOM2=function _sanitizeShadowDOM(fragment){let shadowNode=null;const shadowIterator=_createNodeIterator(fragment);_executeHooks(hooks.beforeSanitizeShadowDOM,fragment,null);while(shadowNode=shadowIterator.nextNode()){_executeHooks(hooks.uponSanitizeShadowNode,shadowNode,null);_sanitizeElements(shadowNode,fragment);_sanitizeAttributes(shadowNode,fragment);if(_isDocumentFragment(shadowNode.content))_sanitizeShadowDOM2(shadowNode.content);if(_readNodeType(shadowNode)===NODE_TYPE.element){const innerSr=getShadowRoot(shadowNode);if(_isDocumentFragment(innerSr)){_sanitizeAttachedShadowRoots(innerSr);_sanitizeShadowDOM2(innerSr)}}}_executeHooks(hooks.afterSanitizeShadowDOM,fragment,null)};const _sanitizeAttachedShadowRoots=function _sanitizeAttachedShadowRoots(root){const stack=[{node:root,shadow:null}];while(stack.length>0){const item=stack.pop();if(item.shadow){_sanitizeShadowDOM2(item.shadow);continue}const node=item.node;const isElement=_readNodeType(node)===NODE_TYPE.element;const childNodes=getChildNodes(node);if(childNodes)for(let i=childNodes.length-1;i>=0;--i)stack.push({node:childNodes[i],shadow:null});if(isElement){const rootName=getNodeName?getNodeName(node):null;if(typeof rootName===`string`&&transformCaseFunc(rootName)===`template`){const content=node.content;if(_isDocumentFragment(content))stack.push({node:content,shadow:null})}}if(isElement){const sr=getShadowRoot(node);if(_isDocumentFragment(sr))stack.push({node:null,shadow:sr},{node:sr,shadow:null})}}};DOMPurify.sanitize=function(dirty){let cfg=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};let body=null;let importedNode=null;let currentNode=null;let returnNode=null;IS_EMPTY_INPUT=!dirty;if(IS_EMPTY_INPUT)dirty=`<!-->`;if(typeof dirty!==`string`&&!_isNode(dirty)){dirty=stringifyValue(dirty);if(typeof dirty!==`string`)throw typeErrorCreate(`dirty is not a string, aborting`)}if(!DOMPurify.isSupported)return dirty;if(SET_CONFIG){ALLOWED_TAGS=SET_CONFIG_ALLOWED_TAGS;ALLOWED_ATTR=SET_CONFIG_ALLOWED_ATTR}else _parseConfig(cfg);if(hooks.uponSanitizeElement.length>0||hooks.uponSanitizeAttribute.length>0)ALLOWED_TAGS=clone(ALLOWED_TAGS);if(hooks.uponSanitizeAttribute.length>0)ALLOWED_ATTR=clone(ALLOWED_ATTR);DOMPurify.removed=[];const inPlace=IN_PLACE&&typeof dirty!==`string`&&_isNode(dirty);if(inPlace){_neutralizePatchLinkage(dirty);const nn=_readNodeName(dirty);if(typeof nn===`string`){const tagName=transformCaseFunc(nn);if(!ALLOWED_TAGS[tagName]||FORBID_TAGS[tagName]){_neutralizeRoot(dirty);throw typeErrorCreate(`root node is forbidden and cannot be sanitized in-place`)}}if(_isClobbered(dirty)){_neutralizeRoot(dirty);throw typeErrorCreate(`root node is clobbered and cannot be sanitized in-place`)}try{_sanitizeAttachedShadowRoots(dirty)}catch(error){_neutralizeRoot(dirty);throw error}}else if(_isNode(dirty)){body=_initDocument(`<!---->`);importedNode=body.ownerDocument.importNode(dirty,true);if(importedNode.nodeType===NODE_TYPE.element&&importedNode.nodeName===`BODY`)body=importedNode;else if(importedNode.nodeName===`HTML`)body=importedNode;else body.appendChild(importedNode);_sanitizeAttachedShadowRoots(body)}else{if(!RETURN_DOM&&!SAFE_FOR_TEMPLATES&&!WHOLE_DOCUMENT&&dirty.indexOf(`<`)===-1)return trustedTypesPolicy&&RETURN_TRUSTED_TYPE?_createTrustedHTML(dirty):dirty;body=_initDocument(dirty);if(!body)return RETURN_DOM?null:RETURN_TRUSTED_TYPE?emptyHTML:``}if(body&&FORCE_BODY)_forceRemove(body.firstChild);const walkRoot=inPlace?dirty:body;try{const nodeIterator=_createNodeIterator(walkRoot);while(currentNode=nodeIterator.nextNode()){_sanitizeElements(currentNode,walkRoot);_sanitizeAttributes(currentNode,walkRoot);if(_isDocumentFragment(currentNode.content))_sanitizeShadowDOM2(currentNode.content)}}catch(error){if(inPlace){_neutralizeRoot(dirty);arrayForEach(DOMPurify.removed,entry=>{if(entry.element)_neutralizeSubtree(entry.element)})}throw error}if(inPlace){let rootWasRemoved=false;arrayForEach(DOMPurify.removed,entry=>{if(entry.element){if(entry.element===dirty)rootWasRemoved=true;_neutralizeSubtree(entry.element)}});if(rootWasRemoved)throw typeErrorCreate(`a node selected for removal could not be safely returned; refusing to sanitize in place`);if(SAFE_FOR_TEMPLATES)_scrubTemplateExpressions2(dirty);return dirty}if(RETURN_DOM){if(SAFE_FOR_TEMPLATES)_scrubTemplateExpressions2(body);if(RETURN_DOM_FRAGMENT){returnNode=createDocumentFragment.call(body.ownerDocument);while(body.firstChild)returnNode.appendChild(body.firstChild)}else returnNode=body;if(ALLOWED_ATTR.shadowroot||ALLOWED_ATTR.shadowrootmode)returnNode=importNode.call(originalDocument,returnNode,true);return returnNode}let serializedHTML=WHOLE_DOCUMENT?body.outerHTML:body.innerHTML;if(WHOLE_DOCUMENT&&ALLOWED_TAGS[`!doctype`]&&body.ownerDocument&&body.ownerDocument.doctype&&body.ownerDocument.doctype.name&®ExpTest(DOCTYPE_NAME,body.ownerDocument.doctype.name))serializedHTML=`<!DOCTYPE `+body.ownerDocument.doctype.name+`>
|
|
174
|
-
`+serializedHTML;if(SAFE_FOR_TEMPLATES)serializedHTML=_stripTemplateExpressions(serializedHTML);return trustedTypesPolicy&&RETURN_TRUSTED_TYPE?_createTrustedHTML(serializedHTML):serializedHTML};DOMPurify.setConfig=function(){let cfg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_parseConfig(cfg);SET_CONFIG=true;SET_CONFIG_ALLOWED_TAGS=ALLOWED_TAGS;SET_CONFIG_ALLOWED_ATTR=ALLOWED_ATTR};DOMPurify.clearConfig=function(){CONFIG=null;SET_CONFIG=false;SET_CONFIG_ALLOWED_TAGS=null;SET_CONFIG_ALLOWED_ATTR=null;trustedTypesPolicy=defaultTrustedTypesPolicy;emptyHTML=``};DOMPurify.isValidAttribute=function(tag,attr,value){if(!CONFIG)_parseConfig({});const lcTag=transformCaseFunc(tag);const lcName=transformCaseFunc(attr);return _isValidAttribute(lcTag,lcName,value)};DOMPurify.addHook=function(entryPoint,hookFunction){if(typeof hookFunction!==`function`)return;if(!objectHasOwnProperty(hooks,entryPoint))return;arrayPush(hooks[entryPoint],hookFunction)};DOMPurify.removeHook=function(entryPoint,hookFunction){if(!objectHasOwnProperty(hooks,entryPoint))return;if(hookFunction!==void 0){const index=arrayLastIndexOf(hooks[entryPoint],hookFunction);return index===-1?void 0:arraySplice(hooks[entryPoint],index,1)[0]}return arrayPop(hooks[entryPoint])};DOMPurify.removeHooks=function(entryPoint){if(!objectHasOwnProperty(hooks,entryPoint))return;hooks[entryPoint]=[]};DOMPurify.removeAllHooks=function(){hooks=_createHooksMap()};return DOMPurify}var purify_default=createDOMPurify();var _hoisted_1$8=[`innerHTML`];var _sfc_main$17={__name:`GithubMarkdown`,props:{html:{type:String,default:``},text:{type:String,default:``}},setup(__props){const props=__props;const sanitizedHtml=computed(()=>purify_default.sanitize(props.html,{ALLOWED_TAGS:[`a`,`b`,`blockquote`,`br`,`code`,`del`,`details`,`div`,`em`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`hr`,`img`,`li`,`ol`,`p`,`pre`,`s`,`span`,`strong`,`sub`,`summary`,`sup`,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`ul`],ALLOWED_ATTR:[`href`,`src`,`alt`,`title`,`width`,`height`,`colspan`,`rowspan`,`start`],ALLOW_DATA_ATTR:false,ALLOW_ARIA_ATTR:false}));const blocks=computed(()=>parseLongTextReviewBlocks(props.text));return(_ctx,_cache)=>{return __props.html?(openBlock(),createElementBlock(`div`,{key:0,class:`github-markdown`,innerHTML:sanitizedHtml.value},null,8,_hoisted_1$8)):(openBlock(),createBlock(unref(LongTextPreviewBlocks_default),{key:1,blocks:blocks.value},null,8,[`blocks`]))}}};var GithubMarkdown_default=_plugin_vue_export_helper_default(_sfc_main$17,[[`__scopeId`,`data-v-3636cce2`]]);var _sfc_main$16={__name:`Vibe64LearningMarkdown`,props:{text:{type:String,default:``}},setup(__props){const props=__props;const renderer=new F({async:false,gfm:true,walkTokens(token){if(token.type!==`image`)return;token.type=`text`;token.raw=token.text=token.text||``;delete token.tokens}});const html=computed(()=>props.text?renderer.parse(props.text):``);return(_ctx,_cache)=>{return openBlock(),createBlock(GithubMarkdown_default,{class:`vibe64-learning-markdown`,html:html.value,onClick:unref(openLessonLink)},null,8,[`html`,`onClick`])}}};var Vibe64LearningMarkdown_default=_plugin_vue_export_helper_default(_sfc_main$16,[[`__scopeId`,`data-v-47420e75`]]);var _hoisted_1$7=[`aria-busy`];var _hoisted_2$4={class:`vibe64-teacher-notes__actions`};var _hoisted_3$3={key:1,class:`vibe64-teacher-notes__empty`,"data-test":`teacher-notes-empty`};var _hoisted_4$1={key:2,class:`vibe64-teacher-notes__updated`};var _hoisted_5$1={class:`vibe64-teacher-notes__actions`};var _sfc_main$15={__name:`Vibe64LearningTeacherNotes`,props:{learning:{type:Object,required:true}},setup(__props){const props=__props;const notes=computed(()=>props.learning.notes.value);const status=computed(()=>props.learning.notesState);const editing=ref(false);const confirmingClear=ref(false);const draft=ref(``);const updated=computed(()=>{const value=notes.value;if(!value?.updatedAt)return``;const when=new Date(value.updatedAt);const date=Number.isNaN(when.getTime())?``:when.toLocaleString();return`${value.updatedBy===`colleague`?`Updated by Colleague`:`Updated by you`}${date?`, ${date}`:``}`});onMounted(()=>{if(!props.learning.notes.value)props.learning.readNotes()});function edit(){draft.value=notes.value?.text||``;confirmingClear.value=false;editing.value=true}async function save(){if(await props.learning.saveNotes(draft.value))editing.value=false}async function clear(){if(await props.learning.clearNotes()){confirmingClear.value=false;editing.value=false}}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{class:`vibe64-teacher-notes`,"aria-labelledby":`vibe64-teacher-notes-title`,"aria-busy":status.value.loading||status.value.saving,"data-test":`teacher-notes`},[_cache[9]||(_cache[9]=createBaseVNode(`h2`,{id:`vibe64-teacher-notes-title`,class:`vibe64-teacher-notes__title`},`What my teacher knows about me`,-1)),_cache[10]||(_cache[10]=createBaseVNode(`p`,{class:`vibe64-teacher-notes__intro`},` Colleague keeps a short private summary of how you learn, so it can teach you better. Only you can see it, and it never changes your lesson results. `,-1)),status.value.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`vibe64-teacher-notes__error`,"data-test":`teacher-notes-error`},{default:withCtx(()=>[createTextVNode(toDisplayString(status.value.error),1)]),_:1})):createCommentVNode(``,true),editing.value?(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(VTextarea,{modelValue:draft.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>draft.value=$event),label:`Your notes (Markdown)`,variant:`outlined`,rows:`8`,"auto-grow":``,counter:unref(VIBE64_LEARNING_NOTES_MAX),maxlength:unref(VIBE64_LEARNING_NOTES_MAX),disabled:status.value.saving,"data-test":`teacher-notes-draft`},null,8,[`modelValue`,`counter`,`maxlength`,`disabled`]),createBaseVNode(`div`,_hoisted_2$4,[createVNode(VBtn,{color:`primary`,variant:`flat`,rounded:`pill`,loading:status.value.saving,disabled:status.value.saving||!draft.value.trim(),"data-test":`teacher-notes-save`,onClick:save},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(` Save `,-1)])]),_:1},8,[`loading`,`disabled`]),createVNode(VBtn,{variant:`text`,rounded:`pill`,disabled:status.value.saving,"data-test":`teacher-notes-cancel`,onClick:_cache[1]||(_cache[1]=$event=>editing.value=false)},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(` Cancel `,-1)])]),_:1},8,[`disabled`])])],64)):(openBlock(),createElementBlock(Fragment,{key:2},[notes.value?.text?(openBlock(),createBlock(Vibe64LearningMarkdown_default,{key:0,class:`vibe64-teacher-notes__text`,text:notes.value.text},null,8,[`text`])):!status.value.loading?(openBlock(),createElementBlock(`p`,_hoisted_3$3,` Nothing yet. Colleague adds notes as it teaches you. `)):createCommentVNode(``,true),notes.value?.text&&updated.value?(openBlock(),createElementBlock(`p`,_hoisted_4$1,toDisplayString(updated.value),1)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_5$1,[createVNode(VBtn,{variant:`tonal`,rounded:`pill`,disabled:status.value.loading||status.value.saving,"data-test":`teacher-notes-edit`,onClick:edit},{default:withCtx(()=>[createTextVNode(toDisplayString(notes.value?.text?`Edit`:`Write notes`),1)]),_:1},8,[`disabled`]),notes.value?.text?(openBlock(),createElementBlock(Fragment,{key:0},[!confirmingClear.value?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,rounded:`pill`,disabled:status.value.saving,"data-test":`teacher-notes-clear`,onClick:_cache[2]||(_cache[2]=$event=>confirmingClear.value=true)},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(` Clear `,-1)])]),_:1},8,[`disabled`])):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(VBtn,{color:`error`,variant:`flat`,rounded:`pill`,loading:status.value.saving,disabled:status.value.saving,"data-test":`teacher-notes-clear-confirm`,onClick:clear},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(` Clear all notes `,-1)])]),_:1},8,[`loading`,`disabled`]),createVNode(VBtn,{variant:`text`,rounded:`pill`,disabled:status.value.saving,"data-test":`teacher-notes-clear-cancel`,onClick:_cache[3]||(_cache[3]=$event=>confirmingClear.value=false)},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(` Keep them `,-1)])]),_:1},8,[`disabled`])],64))],64)):createCommentVNode(``,true)])],64))],8,_hoisted_1$7)}}};var Vibe64LearningTeacherNotes_default=_plugin_vue_export_helper_default(_sfc_main$15,[[`__scopeId`,`data-v-61f49466`]]);var _hoisted_1$6={class:`vibe64-learning__bar`};var _hoisted_2$3={class:`vibe64-learning__tabs`,"aria-label":`Courses`};var _hoisted_3$2=[`aria-current`,`data-test`,`onClick`];var _hoisted_4={class:`vibe64-learning__content`};var _hoisted_5={key:0,class:`vibe64-learning__scroll`};var _hoisted_6={key:1,class:`vibe64-learning__scroll`};var LEARN_MODE_CLASS=`vibe64-learn-mode`;var _sfc_main$14={__name:`Vibe64LearningOverlay`,setup(__props){const learning=useVibe64Learning();const viewer=inject$1(VIBE64_ASSISTANT_VIEWER_KEY);const actorKey=computed(()=>String(toValue(viewer)?.actorKey||``));watch(actorKey,value=>learning.setViewer(value),{immediate:true});onBeforeUnmount(()=>learning.setViewer(``));watch(()=>learning.learnMode,value=>globalThis.document?.body?.classList.toggle(LEARN_MODE_CLASS,value),{immediate:true});onBeforeUnmount(()=>globalThis.document?.body?.classList.remove(LEARN_MODE_CLASS));const route=useRoute$1();const router=useRouter$1();watch(()=>[learning.mode,route.fullPath,learning.state.modeBusy],(_value,previous)=>{if(learning.state.modeBusy)return;const target=modeRedirect({mode:learning.mode,slug:projectSlugFromRoute(route),path:route.path});if(!target||target.path===route.path)return;const modeChanged=Boolean(previous?.[0])&&previous[0]!==learning.mode;if(target.note&&!modeChanged)learning.showNotice(target.note);router.replace(learning.state.finished&&learning.mode?.on?withLesson(target.path):target.path)},{immediate:true});watch(()=>learning.mode?.on,(_on,wasOn)=>{if(typeof wasOn===`boolean`)learning.clearNotice()});function noticeShown(value){if(!value)learning.clearNotice()}const open=computed(()=>learning.state.open);const built=ref(false);watch(open,value=>{if(value)built.value=true},{immediate:true});watch(actorKey,()=>{built.value=open.value});const layer=ref(null);watch(open,async value=>{if(!value)return;await nextTick$1();const element=layer.value;if(element&&!element.contains(globalThis.document.activeElement))element.focus({preventScroll:true})});const orientationRequested=computed(()=>learning.orientationRequested);const courses=useVibe64LearningCourses({active:computed(()=>open.value||orientationRequested.value)});const surface=computed(()=>learning.state.surface);const tabs=Object.freeze([{id:`courses`,label:`Courses`},{id:`progress`,label:`In progress`},{id:`archived`,label:`Archived`}]);useRealtimeEvent({event:VIBE64_TRAINING_LEARNER_CHANGED_EVENT,enabled:computed(()=>Boolean(actorKey.value)),onEvent:({payload}={})=>{learning.learnerChanged(payload||{});if(open.value&&payload?.reason!==`notes`)courses.learningResource.reload()}});useRealtimeEvent({event:`connect`,enabled:computed(()=>Boolean(actorKey.value)),onEvent:()=>void learning.readLearningMode()});let orientationRun=false;watch(orientationRequested,value=>{if(value)takeOrientation()},{immediate:true});async function takeOrientation(){if(orientationRun)return;orientationRun=true;try{await courses.refresh();const selection=orientationSelection(courses.coursesResource.data.value,courses.learningResource.data.value);if(selection)await learning.startLesson(selection,courses.startLesson);else await learning.show({surface:`courses`})}catch(cause){learning.showNotice(String(cause?.message||`The tour did not start. Try again from Courses.`))}finally{orientationRun=false;if(!learning.confirmArchive)learning.orientationAnswered()}}const confirm=computed(()=>learning.confirmArchive);async function archiveAndStart(){try{await learning.confirmArchiveAndStart()}catch(cause){learning.showNotice(String(cause?.message||`The lesson did not start. Try again from Courses.`))}finally{learning.orientationAnswered()}}function keepCurrent(){learning.cancelArchive();learning.orientationAnswered()}const continueOffered=computed(()=>Boolean(learning.mode?.on&&learning.lessonAttemptId&&!learning.state.finished));function continueLesson(){learning.openLesson().catch(cause=>learning.showNotice(String(cause?.message||`The lesson could not open. Try again.`)))}function keydown(event){if(event.key===`Escape`&&!event.defaultPrevented&&!confirm.value){event.stopPropagation();learning.closeCourses()}}return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(unref(TrainingGuideOverlay_default)),actorKey.value&&built.value?withDirectives((openBlock(),createElementBlock(`div`,{key:0,class:`vibe64-learning`,role:`dialog`,"aria-modal":`true`,"aria-label":`Courses`,"data-pane-swipe-ignore":``,tabindex:`-1`,ref_key:`layer`,ref:layer,onKeydown:keydown},[createBaseVNode(`header`,_hoisted_1$6,[createBaseVNode(`nav`,_hoisted_2$3,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(tabs),tab=>{return openBlock(),createElementBlock(`button`,{key:tab.id,type:`button`,class:`vibe64-learning__tab`,"aria-current":surface.value===tab.id?`page`:void 0,"data-test":`learning-${tab.id}-tab`,onClick:$event=>unref(learning).show({surface:tab.id})},toDisplayString(tab.label),9,_hoisted_3$2)}),128))]),continueOffered.value?(openBlock(),createBlock(VBtn,{key:0,color:`primary`,variant:`flat`,rounded:`pill`,"append-icon":`$arrowForward`,class:`vibe64-learning__exit`,"data-test":`learning-continue-lesson`,onClick:continueLesson},{default:withCtx(()=>[..._cache[2]||(_cache[2]=[createTextVNode(` Continue lesson `,-1)])]),_:1})):createCommentVNode(``,true),createVNode(VBtn,{variant:`tonal`,rounded:`pill`,class:`vibe64-learning__exit`,title:`Your place is kept`,"data-test":`learning-close-courses`,onClick:_cache[0]||(_cache[0]=$event=>unref(learning).closeCourses())},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(` Close Courses `,-1)])]),_:1})]),createBaseVNode(`div`,_hoisted_4,[surface.value===`courses`?(openBlock(),createElementBlock(`div`,_hoisted_5,[createVNode(Vibe64LearningCourses_default,{courses:unref(courses)},{default:withCtx(scope=>[renderSlot(_ctx.$slots,`courses`,normalizeProps(guardReactiveProps(scope)),void 0,true)]),_:3},8,[`courses`]),createVNode(Vibe64LearningTeacherNotes_default,{learning:unref(learning)},null,8,[`learning`])])):(openBlock(),createElementBlock(`div`,_hoisted_6,[createVNode(Vibe64LearningAttempts_default,{learning:unref(learning),archived:surface.value===`archived`},null,8,[`learning`,`archived`])]))])],544)),[[vShow,open.value]]):createCommentVNode(``,true),actorKey.value?(openBlock(),createBlock(VDialog,{key:1,"model-value":Boolean(confirm.value),"max-width":`28rem`,style:{"z-index":`2410`},"onUpdate:modelValue":_cache[1]||(_cache[1]=value=>value||keepCurrent())},{default:withCtx(()=>[confirm.value?(openBlock(),createBlock(VCard,{key:0,rounded:`xl`,"data-test":`learning-archive-confirm`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`text-wrap`},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Archive your lesson in progress?`,-1)])]),_:1}),createVNode(VCardText,null,{default:withCtx(()=>[_cache[5]||(_cache[5]=createTextVNode(` You can have one lesson in progress. Starting this one archives `,-1)),createBaseVNode(`strong`,null,toDisplayString(confirm.value.current.lessonTitle||`the lesson in progress`),1),_cache[6]||(_cache[6]=createTextVNode(` with its practice project and conversation; it stays under Archived. `,-1))]),_:1}),createVNode(VCardActions,null,{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{variant:`text`,"data-test":`learning-archive-cancel`,onClick:keepCurrent},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(`Keep it`,-1)])]),_:1}),createVNode(VBtn,{color:`primary`,variant:`flat`,"data-test":`learning-archive-start`,onClick:archiveAndStart},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Archive and start`,-1)])]),_:1})]),_:1})]),_:1})):createCommentVNode(``,true)]),_:1},8,[`model-value`])):createCommentVNode(``,true),actorKey.value?(openBlock(),createBlock(VSnackbar,{key:2,"model-value":Boolean(unref(learning).notice),timeout:8e3,location:`bottom`,"data-test":`learning-mode-notice`,"onUpdate:modelValue":noticeShown},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(learning).notice),1)]),_:1},8,[`model-value`])):createCommentVNode(``,true)],64)}}};var Vibe64LearningOverlay_default=_plugin_vue_export_helper_default(_sfc_main$14,[[`__scopeId`,`data-v-5b6951cd`]]);var _sfc_main$13={__name:`Vibe64LearningRouteHold`,setup(__props){const learning=useVibe64Learning();const viewer=inject$1(VIBE64_ASSISTANT_VIEWER_KEY);const route=useRoute$1();const queryClient=useQueryClient();const held=computed(()=>{const slug=projectSlugFromRoute(route);const actorKey=String(toValue(viewer)?.actorKey||``);if(!actorKey||!slug)return false;return learning.state.actorKey!==actorKey||!learning.state.modeRead||learning.state.modeBusy===`set`||Boolean(modeRedirect({mode:learning.mode,slug,path:route.path}))});function leaveProject(slug){const queryKey=[`vibe64`,...vibe64ProjectQueryScope(slug)];queryClient.cancelQueries({queryKey}).then(()=>queryClient.removeQueries({queryKey,predicate:query=>query.state.error?.code===VIBE64_LEARNING_MODE_PROJECT_CODE}))}watch(()=>[held.value,projectSlugFromRoute(route)],([isHeld],[wasHeld,shownSlug]=[])=>{if(isHeld&&wasHeld===false&&shownSlug)leaveProject(shownSlug)});return(_ctx,_cache)=>{return!held.value?renderSlot(_ctx.$slots,`default`,{},void 0,void 0,0):createCommentVNode(``,true)}}};function resolveSeverityColor(severity=`error`){const normalized=String(severity||`error`).trim().toLowerCase();if(normalized===`info`)return`info`;if(normalized===`success`)return`success`;if(normalized===`warning`)return`warning`;return`error`}function resolveSeverityIcon(severity=`error`){const normalized=String(severity||`error`).trim().toLowerCase();if(normalized===`info`)return`$info`;if(normalized===`success`)return`$success`;return`$warning`}function resolveTimeout(entry){if(!entry)return-1;if(entry.persist)return-1;return 5e3}function actionsFor(entry){return entry?[entry.action,...entry.additionalActions].filter(Boolean):[]}function resolveBannerPlacement(rect){const top=Number(rect.top)||0;if(top<=0)return{inline:true,style:void 0};return{inline:false,style:{top:`calc(env(safe-area-inset-top, 0px) + ${top}px)`,left:`${Number(rect.left)||0}px`,right:`${Number(rect.right)||0}px`}}}var BANNER_INLINE_HEIGHT_PROPERTY=`--shell-error-banners-inline-height`;var MODAL_SURFACE_SELECTOR=[`.v-dialog.v-overlay--active`,`.v-navigation-drawer--temporary.v-navigation-drawer--active`].join(`, `);function isModalSurfaceOpen(){return document.querySelector(MODAL_SURFACE_SELECTOR)!==null}function isSameSnackbarEntry(left=null,right=null){return Boolean(left?.id&&right?.id&&left.id===right.id)}function publishInlineBannerHeight(height=0){const rootStyle=document.documentElement.style;if(height>0)rootStyle.setProperty(BANNER_INLINE_HEIGHT_PROPERTY,`${Math.ceil(height)}px`);else rootStyle.removeProperty(BANNER_INLINE_HEIGHT_PROPERTY)}function useShellErrorHost(){const runtime=useShellWebErrorRuntime();const{t}=useJskitText();const store=useShellErrorPresentationStore();const snackbarEntries=computed(()=>store.channels.snackbar||[]);const bannerEntries=computed(()=>store.channels.banner||[]);const dialogEntry=computed(()=>store.channels.dialog[0]||null);const displayedSnackbarEntry=ref(null);const layoutRect=useLayout().mainRect;const bannersElement=ref(null);const bannerPlacement=computed(()=>resolveBannerPlacement(layoutRect.value));let bannerResizeObserver=null;function stopObservingBanners(){bannerResizeObserver?.disconnect();bannerResizeObserver=null;publishInlineBannerHeight(0)}watch([bannersElement,()=>bannerPlacement.value.inline],([element,inline])=>{stopObservingBanners();if(!element||!inline)return;bannerResizeObserver=new ResizeObserver(()=>{publishInlineBannerHeight(element.getBoundingClientRect().height)});bannerResizeObserver.observe(element);publishInlineBannerHeight(element.getBoundingClientRect().height)},{flush:`post`});onBeforeUnmount(stopObservingBanners);const snackbarOpen=ref(false);const{isCompact}=useShellWindowSizeClass();const snackbarOverModalSurface=ref(false);const snackbarLocation=computed(()=>isCompact.value&&snackbarOverModalSurface.value?`top`:`bottom start`);function hasSnackbarEntry(entry=null){if(!entry?.id)return false;return snackbarEntries.value.some(candidate=>isSameSnackbarEntry(candidate,entry))}function openNextSnackbarEntry(){const nextEntry=snackbarEntries.value[0]||null;if(!nextEntry){displayedSnackbarEntry.value=null;snackbarOpen.value=false;return}snackbarOverModalSurface.value=isModalSurfaceOpen();displayedSnackbarEntry.value=nextEntry;snackbarOpen.value=true}watch(snackbarEntries,entries=>{const currentEntry=displayedSnackbarEntry.value;if(!currentEntry){openNextSnackbarEntry();return}const matchingEntry=entries.find(entry=>isSameSnackbarEntry(entry,currentEntry))||null;if(matchingEntry){displayedSnackbarEntry.value=matchingEntry;return}snackbarOpen.value=false},{immediate:true,flush:`post`});function dismiss(entry){if(!entry||!entry.channel||!entry.id)return;store.dismiss(entry.channel,entry.id)}async function runAction(entry,action){try{await action.handler(entry)}catch(error){runtime.report({source:`shell-web.error-host.action`,message:t(`jskit.shell.error.actionFailed`),cause:error,intent:`blocking`,severity:`error`})}if(action.dismissOnRun!==false)dismiss(entry)}function onSnackbarModelValue(nextValue){if(nextValue===false&&displayedSnackbarEntry.value){snackbarOpen.value=false;dismiss(displayedSnackbarEntry.value)}}function onDialogModelValue(nextValue){if(nextValue===false&&dialogEntry.value&&dialogEntry.value.persist!==true)dismiss(dialogEntry.value)}function onSnackbarAfterLeave(){if(hasSnackbarEntry(displayedSnackbarEntry.value))return;openNextSnackbarEntry()}return{bannerEntries,bannerPlacement,bannersElement,dialogEntry,dismiss,displayedSnackbarEntry,onDialogModelValue,onSnackbarAfterLeave,onSnackbarModelValue,runAction,snackbarLocation,snackbarOpen}}var _hoisted_1$5={class:`shell-error-host__banner-stack`};var _hoisted_2$2={class:`d-flex align-center ga-3 flex-wrap`};var _hoisted_3$1={key:0};var _sfc_main$12={__name:`ShellErrorHost`,setup(__props){const{t,text,serverMessage}=useJskitText();const{bannerEntries,bannerPlacement,bannersElement,dialogEntry,dismiss,displayedSnackbarEntry,onDialogModelValue,onSnackbarAfterLeave,onSnackbarModelValue,runAction,snackbarLocation,snackbarOpen}=useShellErrorHost();return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,{class:normalizeClass([`shell-error-host`,{"shell-error-host--inline-banners":unref(bannerPlacement).inline}]),"aria-live":`polite`},[unref(bannerEntries).length>0?(openBlock(),createElementBlock(`div`,{key:0,ref_key:`bannersElement`,ref:bannersElement,class:normalizeClass([`shell-error-host__banners`,{"shell-error-host__banners--inline":unref(bannerPlacement).inline}]),style:normalizeStyle(unref(bannerPlacement).style),"data-testid":`shell-error-host-banners`},[createBaseVNode(`div`,_hoisted_1$5,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(bannerEntries),entry=>{return openBlock(),createBlock(VAlert,{key:entry.id,color:`${unref(resolveSeverityColor)(entry.severity)}-container`,icon:unref(resolveSeverityIcon)(entry.severity),variant:`flat`,density:`comfortable`,rounded:12,class:`shell-error-host__banner`,closable:``,"close-label":unref(t)(`jskit.shell.actions.close`),"onClick:close":$event=>unref(dismiss)(entry)},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$2,[createBaseVNode(`span`,null,toDisplayString(unref(serverMessage)(entry)),1),createVNode(VSpacer),(openBlock(true),createElementBlock(Fragment,null,renderList(unref(actionsFor)(entry),(action,index)=>{return openBlock(),createBlock(VBtn,{key:index,variant:`text`,size:`small`,class:`text-none`,onClick:$event=>unref(runAction)(entry,action)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(text)(action.label)),1)]),_:2},1032,[`onClick`])}),128))])]),_:2},1032,[`color`,`icon`,`close-label`,`onClick:close`])}),128))])],6)):createCommentVNode(``,true),createVNode(VSnackbar,{"model-value":unref(snackbarOpen),class:`shell-error-host__snackbar`,location:unref(snackbarLocation),"_disable-global-stack":true,timeout:unref(resolveTimeout)(unref(displayedSnackbarEntry)),vertical:unref(actionsFor)(unref(displayedSnackbarEntry)).length>1,"onUpdate:modelValue":unref(onSnackbarModelValue),onAfterLeave:unref(onSnackbarAfterLeave)},{actions:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(actionsFor)(unref(displayedSnackbarEntry)),(action,index)=>{return openBlock(),createBlock(VBtn,{key:index,variant:`text`,onClick:$event=>unref(runAction)(unref(displayedSnackbarEntry),action)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(text)(action.label)),1)]),_:2},1032,[`onClick`])}),128)),unref(displayedSnackbarEntry)?(openBlock(),createBlock(VBtn,{key:0,icon:`$close`,variant:`text`,color:`inverse-on-surface`,"aria-label":unref(t)(`jskit.shell.actions.dismiss`),onClick:_cache[0]||(_cache[0]=$event=>unref(dismiss)(unref(displayedSnackbarEntry)))},null,8,[`aria-label`])):createCommentVNode(``,true)]),default:withCtx(()=>[unref(displayedSnackbarEntry)?(openBlock(),createElementBlock(`span`,_hoisted_3$1,toDisplayString(unref(serverMessage)(unref(displayedSnackbarEntry))),1)):createCommentVNode(``,true)]),_:1},8,[`model-value`,`location`,`timeout`,`vertical`,`onUpdate:modelValue`,`onAfterLeave`]),createVNode(VDialog,{"model-value":Boolean(unref(dialogEntry)),"aria-label":unref(t)(`jskit.shell.error.attentionRequired`),"max-width":`560`,persistent:Boolean(unref(dialogEntry)?.persist),"onUpdate:modelValue":unref(onDialogModelValue)},{default:withCtx(()=>[unref(dialogEntry)?(openBlock(),createBlock(VCard,{key:0},{default:withCtx(()=>[createVNode(VCardTitle,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.shell.error.attentionRequired`)),1)]),_:1}),createVNode(VCardText,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(serverMessage)(unref(dialogEntry))),1)]),_:1}),createVNode(VCardActions,null,{default:withCtx(()=>[createVNode(VSpacer),(openBlock(true),createElementBlock(Fragment,null,renderList(unref(actionsFor)(unref(dialogEntry)),(action,index)=>{return openBlock(),createBlock(VBtn,{key:index,variant:`text`,onClick:$event=>unref(runAction)(unref(dialogEntry),action)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(text)(action.label)),1)]),_:2},1032,[`onClick`])}),128)),createVNode(VBtn,{variant:`text`,onClick:_cache[1]||(_cache[1]=$event=>unref(dismiss)(unref(dialogEntry)))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.shell.actions.close`)),1)]),_:1})]),_:1})]),_:1})):createCommentVNode(``,true)]),_:1},8,[`model-value`,`aria-label`,`persistent`,`onUpdate:modelValue`])],2)}}};var ShellErrorHost_default=_plugin_vue_export_helper_default(_sfc_main$12,[[`__scopeId`,`data-v-fa4300b6`]]);function useVibe64InAppLinks(){const router=useRouter$1();function navigateAppLink(event){if(event.defaultPrevented||event.button!==0||event.ctrlKey||event.metaKey||event.shiftKey||event.altKey)return;const anchor=event.target.closest(`a[href]`);if(!anchor||anchor.hasAttribute(`download`)||anchor.relList.contains(`external`))return;const target=anchor.getAttribute(`target`);if(target&&target.toLowerCase()!==`_self`)return;const href=anchor.getAttribute(`href`);if(!href||href.startsWith(`#`))return;let url;try{url=new URL(anchor.href)}catch{return}if(url.origin!==window.location.origin||![`http:`,`https:`].includes(url.protocol)||url.username||url.password)return;const path=`${url.pathname}${url.search}${url.hash}`;const route=router.resolve(path);if(!route.matched.length||route.name===`not-found`)return;event.preventDefault();router.push(path)}onMounted(()=>document.addEventListener(`click`,navigateAppLink));onUnmounted(()=>document.removeEventListener(`click`,navigateAppLink))}var _sfc_main$11={__name:`App`,setup(__props){useVibe64InAppLinks();return(_ctx,_cache)=>{return openBlock(),createBlock(VApp,null,{default:withCtx(()=>[createVNode(_sfc_main$104,{local:``},{default:withCtx(()=>[createVNode(_sfc_main$28,null,{default:withCtx(()=>[createVNode(_sfc_main$13,null,{default:withCtx(()=>[createVNode(unref(RouterView))]),_:1}),createVNode(_sfc_main$30),createVNode(Vibe64LearningOverlay_default)]),_:1}),createVNode(_sfc_main$13,null,{default:withCtx(()=>[createVNode(unref(_sfc_main$42),{"can-configure":``,"actor-key":`local`})]),_:1})]),_:1}),createVNode(unref(ShellErrorHost_default))]),_:1})}}};var title=`Not Found`;var message=`The page you requested does not exist.`;var _sfc_main$10={__name:`NotFound`,setup(__props){return(_ctx,_cache)=>{return openBlock(),createBlock(VContainer,{class:`fill-height d-flex align-center justify-center`},{default:withCtx(()=>[createVNode(VCard,{class:`pa-6 text-center`,"max-width":`560`,rounded:`lg`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`text-headline-large`},{default:withCtx(()=>[createTextVNode(toDisplayString(title))]),_:1}),createVNode(VCardText,{class:`on-surface-variant`},{default:withCtx(()=>[createTextVNode(toDisplayString(message))]),_:1})]),_:1})]),_:1})}}};function createProviderLogger(logger,{debugEnabled=false}={}){function info(...args){logger.info(...args)}function warn(...args){logger.warn(...args)}function error(...args){logger.error(...args)}function debug(...args){if(debugEnabled===true)info(...args)}return Object.freeze({debug,info,warn,error})}var PACKET_TYPES=Object.create(null);PACKET_TYPES[`open`]=`0`;PACKET_TYPES[`close`]=`1`;PACKET_TYPES[`ping`]=`2`;PACKET_TYPES[`pong`]=`3`;PACKET_TYPES[`message`]=`4`;PACKET_TYPES[`upgrade`]=`5`;PACKET_TYPES[`noop`]=`6`;var PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(key=>{PACKET_TYPES_REVERSE[PACKET_TYPES[key]]=key});var ERROR_PACKET={type:`error`,data:`parser error`};var withNativeBlob$1=typeof Blob===`function`||typeof Blob!==`undefined`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`;var withNativeArrayBuffer$2=typeof ArrayBuffer===`function`;var isView$1=obj=>{return typeof ArrayBuffer.isView===`function`?ArrayBuffer.isView(obj):obj&&obj.buffer instanceof ArrayBuffer};var encodePacket=({type,data},supportsBinary,callback)=>{if(withNativeBlob$1&&data instanceof Blob){if(supportsBinary)return callback(data);else return encodeBlobAsBase64(data,callback)}else if(withNativeArrayBuffer$2&&(data instanceof ArrayBuffer||isView$1(data))){if(supportsBinary)return callback(data);else return encodeBlobAsBase64(new Blob([data]),callback)}return callback(PACKET_TYPES[type]+(data||``))};var encodeBlobAsBase64=(data,callback)=>{const fileReader=new FileReader;fileReader.onload=function(){const content=fileReader.result.split(`,`)[1];callback(`b`+(content||``))};return fileReader.readAsDataURL(data)};function toArray(data){if(data instanceof Uint8Array)return data;else if(data instanceof ArrayBuffer)return new Uint8Array(data);else return new Uint8Array(data.buffer,data.byteOffset,data.byteLength)}var TEXT_ENCODER;function encodePacketToBinary(packet,callback){if(withNativeBlob$1&&packet.data instanceof Blob)return packet.data.arrayBuffer().then(toArray).then(callback);else if(withNativeArrayBuffer$2&&(packet.data instanceof ArrayBuffer||isView$1(packet.data)))return callback(toArray(packet.data));encodePacket(packet,false,encoded=>{if(!TEXT_ENCODER)TEXT_ENCODER=new TextEncoder;callback(TEXT_ENCODER.encode(encoded))})}var chars=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;var lookup$1=typeof Uint8Array===`undefined`?[]:new Uint8Array(256);for(let i=0;i<64;i++)lookup$1[chars.charCodeAt(i)]=i;var decode$1=base64=>{let bufferLength=base64.length*.75,len=base64.length,i,p=0,encoded1,encoded2,encoded3,encoded4;if(base64[base64.length-1]===`=`){bufferLength--;if(base64[base64.length-2]===`=`)bufferLength--}const arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i<len;i+=4){encoded1=lookup$1[base64.charCodeAt(i)];encoded2=lookup$1[base64.charCodeAt(i+1)];encoded3=lookup$1[base64.charCodeAt(i+2)];encoded4=lookup$1[base64.charCodeAt(i+3)];bytes[p++]=encoded1<<2|encoded2>>4;bytes[p++]=(encoded2&15)<<4|encoded3>>2;bytes[p++]=(encoded3&3)<<6|encoded4&63}return arraybuffer};var withNativeArrayBuffer$1=typeof ArrayBuffer===`function`;var decodePacket=(encodedPacket,binaryType)=>{if(typeof encodedPacket!==`string`)return{type:`message`,data:mapBinary(encodedPacket,binaryType)};const type=encodedPacket.charAt(0);if(type===`b`)return{type:`message`,data:decodeBase64Packet(encodedPacket.substring(1),binaryType)};if(!PACKET_TYPES_REVERSE[type])return ERROR_PACKET;return encodedPacket.length>1?{type:PACKET_TYPES_REVERSE[type],data:encodedPacket.substring(1)}:{type:PACKET_TYPES_REVERSE[type]}};var decodeBase64Packet=(data,binaryType)=>{if(withNativeArrayBuffer$1){const decoded=decode$1(data);return mapBinary(decoded,binaryType)}else return{base64:true,data}};var mapBinary=(data,binaryType)=>{switch(binaryType){case`blob`:if(data instanceof Blob)return data;else return new Blob([data]);default:if(data instanceof ArrayBuffer)return data;else return data.buffer}};var SEPARATOR=String.fromCharCode(30);var encodePayload=(packets,callback)=>{const length=packets.length;const encodedPackets=new Array(length);let count=0;packets.forEach((packet,i)=>{encodePacket(packet,false,encodedPacket=>{encodedPackets[i]=encodedPacket;if(++count===length)callback(encodedPackets.join(SEPARATOR))})})};var decodePayload=(encodedPayload,binaryType)=>{const encodedPackets=encodedPayload.split(SEPARATOR);const packets=[];for(let i=0;i<encodedPackets.length;i++){const decodedPacket=decodePacket(encodedPackets[i],binaryType);packets.push(decodedPacket);if(decodedPacket.type===`error`)break}return packets};function createPacketEncoderStream(){return new TransformStream({transform(packet,controller){encodePacketToBinary(packet,encodedPacket=>{const payloadLength=encodedPacket.length;let header;if(payloadLength<126){header=new Uint8Array(1);new DataView(header.buffer).setUint8(0,payloadLength)}else if(payloadLength<65536){header=new Uint8Array(3);const view=new DataView(header.buffer);view.setUint8(0,126);view.setUint16(1,payloadLength)}else{header=new Uint8Array(9);const view=new DataView(header.buffer);view.setUint8(0,127);view.setBigUint64(1,BigInt(payloadLength))}if(packet.data&&typeof packet.data!==`string`)header[0]|=128;controller.enqueue(header);controller.enqueue(encodedPacket)})}})}var TEXT_DECODER;function totalLength(chunks){return chunks.reduce((acc,chunk)=>acc+chunk.length,0)}function concatChunks(chunks,size){if(chunks[0].length===size)return chunks.shift();const buffer=new Uint8Array(size);let j=0;for(let i=0;i<size;i++){buffer[i]=chunks[0][j++];if(j===chunks[0].length){chunks.shift();j=0}}if(chunks.length&&j<chunks[0].length)chunks[0]=chunks[0].slice(j);return buffer}function createPacketDecoderStream(maxPayload,binaryType){if(!TEXT_DECODER)TEXT_DECODER=new TextDecoder;const chunks=[];let state=0;let expectedLength=-1;let isBinary=false;return new TransformStream({transform(chunk,controller){chunks.push(chunk);while(true){if(state===0){if(totalLength(chunks)<1)break;const header=concatChunks(chunks,1);isBinary=(header[0]&128)===128;expectedLength=header[0]&127;if(expectedLength<126)state=3;else if(expectedLength===126)state=1;else state=2}else if(state===1){if(totalLength(chunks)<2)break;const headerArray=concatChunks(chunks,2);expectedLength=new DataView(headerArray.buffer,headerArray.byteOffset,headerArray.length).getUint16(0);state=3}else if(state===2){if(totalLength(chunks)<8)break;const headerArray=concatChunks(chunks,8);const view=new DataView(headerArray.buffer,headerArray.byteOffset,headerArray.length);const n=view.getUint32(0);if(n>Math.pow(2,21)-1){controller.enqueue(ERROR_PACKET);break}expectedLength=n*Math.pow(2,32)+view.getUint32(4);state=3}else{if(totalLength(chunks)<expectedLength)break;const data=concatChunks(chunks,expectedLength);controller.enqueue(decodePacket(isBinary?data:TEXT_DECODER.decode(data),binaryType));state=0}if(expectedLength===0||expectedLength>maxPayload){controller.enqueue(ERROR_PACKET);break}}}})}function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype)obj[key]=Emitter.prototype[key];return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks[`$`+event]=this._callbacks[`$`+event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){function on(){this.off(event,on);fn.apply(this,arguments)}on.fn=fn;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks[`$`+event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks[`$`+event];return this}var cb;for(var i=0;i<callbacks.length;i++){cb=callbacks[i];if(cb===fn||cb.fn===fn){callbacks.splice(i,1);break}}if(callbacks.length===0)delete this._callbacks[`$`+event];return this};Emitter.prototype.emit=function(event){this._callbacks=this._callbacks||{};var args=new Array(arguments.length-1),callbacks=this._callbacks[`$`+event];for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];if(callbacks){callbacks=callbacks.slice(0);for(var i=0,len=callbacks.length;i<len;++i)callbacks[i].apply(this,args)}return this};Emitter.prototype.emitReserved=Emitter.prototype.emit;Emitter.prototype.listeners=function(event){this._callbacks=this._callbacks||{};return this._callbacks[`$`+event]||[]};Emitter.prototype.hasListeners=function(event){return!!this.listeners(event).length};var nextTick=(()=>{if(typeof Promise===`function`&&typeof Promise.resolve===`function`)return cb=>Promise.resolve().then(cb);else return(cb,setTimeoutFn)=>setTimeoutFn(cb,0)})();var globalThisShim=(()=>{if(typeof self!==`undefined`)return self;else if(typeof window!==`undefined`)return window;else return Function(`return this`)()})();var defaultBinaryType=`arraybuffer`;function createCookieJar(){}function pick(obj,...attr){return attr.reduce((acc,k)=>{if(obj.hasOwnProperty(k))acc[k]=obj[k];return acc},{})}var NATIVE_SET_TIMEOUT=globalThisShim.setTimeout;var NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(obj,opts){if(opts.useNativeTimers){obj.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim);obj.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)}else{obj.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim);obj.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim)}}var BASE64_OVERHEAD=1.33;function byteLength(obj){if(typeof obj===`string`)return utf8Length(obj);return Math.ceil((obj.byteLength||obj.size)*BASE64_OVERHEAD)}function utf8Length(str){let c=0,length=0;for(let i=0,l=str.length;i<l;i++){c=str.charCodeAt(i);if(c<128)length+=1;else if(c<2048)length+=2;else if(c<55296||c>=57344)length+=3;else{i++;length+=4}}return length}function randomString(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function encode(obj){let str=``;for(let i in obj)if(obj.hasOwnProperty(i)){if(str.length)str+=`&`;str+=encodeURIComponent(i)+`=`+encodeURIComponent(obj[i])}return str}function decode(qs){let qry={};let pairs=qs.split(`&`);for(let i=0,l=pairs.length;i<l;i++){let pair=pairs[i].split(`=`);qry[decodeURIComponent(pair[0])]=decodeURIComponent(pair[1])}return qry}var TransportError=class extends Error{constructor(reason,description,context){super(reason);this.description=description;this.context=context;this.type=`TransportError`}};var Transport=class extends Emitter{constructor(opts){super();this.writable=false;installTimerFunctions(this,opts);this.opts=opts;this.query=opts.query;this.socket=opts.socket;this.supportsBinary=!opts.forceBase64}onError(reason,description,context){super.emitReserved(`error`,new TransportError(reason,description,context));return this}open(){this.readyState=`opening`;this.doOpen();return this}close(){if(this.readyState===`opening`||this.readyState===`open`){this.doClose();this.onClose()}return this}send(packets){if(this.readyState===`open`)this.write(packets)}onOpen(){this.readyState=`open`;this.writable=true;super.emitReserved(`open`)}onData(data){const packet=decodePacket(data,this.socket.binaryType);this.onPacket(packet)}onPacket(packet){super.emitReserved(`packet`,packet)}onClose(details){this.readyState=`closed`;super.emitReserved(`close`,details)}pause(onPause){}createUri(schema,query={}){return schema+`://`+this._hostname()+this._port()+this.opts.path+this._query(query)}_hostname(){const hostname=this.opts.hostname;return hostname.indexOf(`:`)===-1?hostname:`[`+hostname+`]`}_port(){if(this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80))return`:`+this.opts.port;else return``}_query(query){const encodedQuery=encode(query);return encodedQuery.length?`?`+encodedQuery:``}};var Polling=class extends Transport{constructor(){super(...arguments);this._polling=false}get name(){return`polling`}doOpen(){this._poll()}pause(onPause){this.readyState=`pausing`;const pause=()=>{this.readyState=`paused`;onPause()};if(this._polling||!this.writable){let total=0;if(this._polling){total++;this.once(`pollComplete`,function(){--total||pause()})}if(!this.writable){total++;this.once(`drain`,function(){--total||pause()})}}else pause()}_poll(){this._polling=true;this.doPoll();this.emitReserved(`poll`)}onData(data){const callback=packet=>{if(`opening`===this.readyState&&packet.type===`open`)this.onOpen();if(`close`===packet.type){this.onClose({description:`transport closed by the server`});return false}this.onPacket(packet)};decodePayload(data,this.socket.binaryType).forEach(callback);if(`closed`!==this.readyState){this._polling=false;this.emitReserved(`pollComplete`);if(`open`===this.readyState)this._poll()}}doClose(){const close=()=>{this.write([{type:`close`}])};if(`open`===this.readyState)close();else this.once(`open`,close)}write(packets){this.writable=false;encodePayload(packets,data=>{this.doWrite(data,()=>{this.writable=true;this.emitReserved(`drain`)})})}uri(){const schema=this.opts.secure?`https`:`http`;const query=this.query||{};if(false!==this.opts.timestampRequests)query[this.opts.timestampParam]=randomString();if(!this.supportsBinary&&!query.sid)query.b64=1;return this.createUri(schema,query)}};var value=false;try{value=typeof XMLHttpRequest!==`undefined`&&`withCredentials`in new XMLHttpRequest}catch(err){}var hasCORS=value;function empty(){}var BaseXHR=class extends Polling{constructor(opts){super(opts);if(typeof location!==`undefined`){const isSSL=`https:`===location.protocol;let port=location.port;if(!port)port=isSSL?`443`:`80`;this.xd=typeof location!==`undefined`&&opts.hostname!==location.hostname||port!==opts.port}}doWrite(data,fn){const req=this.request({method:`POST`,data});req.on(`success`,fn);req.on(`error`,(xhrStatus,context)=>{this.onError(`xhr post error`,xhrStatus,context)})}doPoll(){const req=this.request();req.on(`data`,this.onData.bind(this));req.on(`error`,(xhrStatus,context)=>{this.onError(`xhr poll error`,xhrStatus,context)});this.pollXhr=req}};var Request=class Request extends Emitter{constructor(createRequest,uri,opts){super();this.createRequest=createRequest;installTimerFunctions(this,opts);this._opts=opts;this._method=opts.method||`GET`;this._uri=uri;this._data=void 0!==opts.data?opts.data:null;this._create()}_create(){var _a;const opts=pick(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);opts.xdomain=!!this._opts.xd;const xhr=this._xhr=this.createRequest(opts);try{xhr.open(this._method,this._uri,true);try{if(this._opts.extraHeaders){xhr.setDisableHeaderCheck&&xhr.setDisableHeaderCheck(true);for(let i in this._opts.extraHeaders)if(this._opts.extraHeaders.hasOwnProperty(i))xhr.setRequestHeader(i,this._opts.extraHeaders[i])}}catch(e){}if(`POST`===this._method)try{xhr.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch(e){}try{xhr.setRequestHeader(`Accept`,`*/*`)}catch(e){}(_a=this._opts.cookieJar)===null||_a===void 0||_a.addCookies(xhr);if(`withCredentials`in xhr)xhr.withCredentials=this._opts.withCredentials;if(this._opts.requestTimeout)xhr.timeout=this._opts.requestTimeout;xhr.onreadystatechange=()=>{var _a;if(xhr.readyState===3)(_a=this._opts.cookieJar)===null||_a===void 0||_a.parseCookies(xhr.getResponseHeader(`set-cookie`));if(4!==xhr.readyState)return;if(200===xhr.status||1223===xhr.status)this._onLoad();else this.setTimeoutFn(()=>{this._onError(typeof xhr.status===`number`?xhr.status:0)},0)};xhr.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}if(typeof document!==`undefined`){this._index=Request.requestsCount++;Request.requests[this._index]=this}}_onError(err){this.emitReserved(`error`,err,this._xhr);this._cleanup(true)}_cleanup(fromError){if(`undefined`===typeof this._xhr||null===this._xhr)return;this._xhr.onreadystatechange=empty;if(fromError)try{this._xhr.abort()}catch(e){}if(typeof document!==`undefined`)delete Request.requests[this._index];this._xhr=null}_onLoad(){const data=this._xhr.responseText;if(data!==null){this.emitReserved(`data`,data);this.emitReserved(`success`);this._cleanup()}}abort(){this._cleanup()}};Request.requestsCount=0;Request.requests={};if(typeof document!==`undefined`){if(typeof attachEvent===`function`)attachEvent(`onunload`,unloadHandler);else if(typeof addEventListener===`function`){const terminationEvent=`onpagehide`in globalThisShim?`pagehide`:`unload`;addEventListener(terminationEvent,unloadHandler,false)}}function unloadHandler(){for(let i in Request.requests)if(Request.requests.hasOwnProperty(i))Request.requests[i].abort()}var hasXHR2=(function(){const xhr=newRequest({xdomain:false});return xhr&&xhr.responseType!==null})();var XHR=class extends BaseXHR{constructor(opts){super(opts);const forceBase64=opts&&opts.forceBase64;this.supportsBinary=hasXHR2&&!forceBase64}request(opts={}){Object.assign(opts,{xd:this.xd},this.opts);return new Request(newRequest,this.uri(),opts)}};function newRequest(opts){const xdomain=opts.xdomain;try{if(`undefined`!==typeof XMLHttpRequest&&(!xdomain||hasCORS))return new XMLHttpRequest}catch(e){}if(!xdomain)try{return new globalThisShim[[`Active`].concat(`Object`).join(`X`)](`Microsoft.XMLHTTP`)}catch(e){}}var isReactNative=typeof navigator!==`undefined`&&typeof navigator.product===`string`&&navigator.product.toLowerCase()===`reactnative`;var BaseWS=class extends Transport{get name(){return`websocket`}doOpen(){const uri=this.uri();const protocols=this.opts.protocols;const opts=isReactNative?{}:pick(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);if(this.opts.extraHeaders)opts.headers=this.opts.extraHeaders;try{this.ws=this.createSocket(uri,protocols,opts)}catch(err){return this.emitReserved(`error`,err)}this.ws.binaryType=this.socket.binaryType;this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{if(this.opts.autoUnref)this.ws._socket.unref();this.onOpen()};this.ws.onclose=closeEvent=>this.onClose({description:`websocket connection closed`,context:closeEvent});this.ws.onmessage=ev=>this.onData(ev.data);this.ws.onerror=e=>this.onError(`websocket error`,e)}write(packets){this.writable=false;for(let i=0;i<packets.length;i++){const packet=packets[i];const lastPacket=i===packets.length-1;encodePacket(packet,this.supportsBinary,data=>{try{this.doWrite(packet,data)}catch(e){}if(lastPacket)nextTick(()=>{this.writable=true;this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){if(typeof this.ws!==`undefined`){this.ws.onerror=()=>{};this.ws.close();this.ws=null}}uri(){const schema=this.opts.secure?`wss`:`ws`;const query=this.query||{};if(this.opts.timestampRequests)query[this.opts.timestampParam]=randomString();if(!this.supportsBinary)query.b64=1;return this.createUri(schema,query)}};var WebSocketCtor=globalThisShim.WebSocket||globalThisShim.MozWebSocket;var WS=class extends BaseWS{createSocket(uri,protocols,opts){return!isReactNative?protocols?new WebSocketCtor(uri,protocols):new WebSocketCtor(uri):new WebSocketCtor(uri,protocols,opts)}doWrite(_packet,data){this.ws.send(data)}};var WT=class extends Transport{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(err){return this.emitReserved(`error`,err)}this._transport.closed.then(()=>{this.onClose()}).catch(err=>{this.onError(`webtransport error`,err)});this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(stream=>{const decoderStream=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType);const reader=stream.readable.pipeThrough(decoderStream).getReader();const encoderStream=createPacketEncoderStream();encoderStream.readable.pipeTo(stream.writable);this._writer=encoderStream.writable.getWriter();const read=()=>{reader.read().then(({done,value})=>{if(done)return;this.onPacket(value);read()}).catch(err=>{})};read();const packet={type:`open`};if(this.query.sid)packet.data=`{"sid":"${this.query.sid}"}`;this._writer.write(packet).then(()=>this.onOpen())})})}write(packets){this.writable=false;for(let i=0;i<packets.length;i++){const packet=packets[i];const lastPacket=i===packets.length-1;this._writer.write(packet).then(()=>{if(lastPacket)nextTick(()=>{this.writable=true;this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var _a;(_a=this._transport)===null||_a===void 0||_a.close()}};var transports={websocket:WS,webtransport:WT,polling:XHR};var re=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;var parts=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function parse(str){if(str.length>8e3)throw`URI too long`;const src=str,b=str.indexOf(`[`),e=str.indexOf(`]`);if(b!=-1&&e!=-1)str=str.substring(0,b)+str.substring(b,e).replace(/:/g,`;`)+str.substring(e,str.length);let m=re.exec(str||``),uri={},i=14;while(i--)uri[parts[i]]=m[i]||``;if(b!=-1&&e!=-1){uri.source=src;uri.host=uri.host.substring(1,uri.host.length-1).replace(/;/g,`:`);uri.authority=uri.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`);uri.ipv6uri=true}uri.pathNames=pathNames(uri,uri[`path`]);uri.queryKey=queryKey(uri,uri[`query`]);return uri}function pathNames(obj,path){const names=path.replace(/\/{2,9}/g,`/`).split(`/`);if(path.slice(0,1)==`/`||path.length===0)names.splice(0,1);if(path.slice(-1)==`/`)names.splice(names.length-1,1);return names}function queryKey(uri,query){const data={};query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function($0,$1,$2){if($1)data[$1]=$2});return data}var withEventListeners=typeof addEventListener===`function`&&typeof removeEventListener===`function`;var OFFLINE_EVENT_LISTENERS=[];if(withEventListeners)addEventListener(`offline`,()=>{OFFLINE_EVENT_LISTENERS.forEach(listener=>listener())},false);var SocketWithoutUpgrade=class SocketWithoutUpgrade extends Emitter{constructor(uri,opts){super();this.binaryType=defaultBinaryType;this.writeBuffer=[];this._prevBufferLen=0;this._pingInterval=-1;this._pingTimeout=-1;this._maxPayload=-1;this._pingTimeoutTime=Infinity;if(uri&&`object`===typeof uri){opts=uri;uri=null}if(uri){const parsedUri=parse(uri);opts.hostname=parsedUri.host;opts.secure=parsedUri.protocol===`https`||parsedUri.protocol===`wss`;opts.port=parsedUri.port;if(parsedUri.query)opts.query=parsedUri.query}else if(opts.host)opts.hostname=parse(opts.host).host;installTimerFunctions(this,opts);this.secure=null!=opts.secure?opts.secure:typeof location!==`undefined`&&`https:`===location.protocol;if(opts.hostname&&!opts.port)opts.port=this.secure?`443`:`80`;this.hostname=opts.hostname||(typeof location!==`undefined`?location.hostname:`localhost`);this.port=opts.port||(typeof location!==`undefined`&&location.port?location.port:this.secure?`443`:`80`);this.transports=[];this._transportsByName={};opts.transports.forEach(t=>{const transportName=t.prototype.name;this.transports.push(transportName);this._transportsByName[transportName]=t});this.opts=Object.assign({path:`/engine.io`,agent:false,withCredentials:false,upgrade:true,timestampParam:`t`,rememberUpgrade:false,addTrailingSlash:true,rejectUnauthorized:true,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:false},opts);this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``);if(typeof this.opts.query===`string`)this.opts.query=decode(this.opts.query);if(withEventListeners){if(this.opts.closeOnBeforeunload){this._beforeunloadEventListener=()=>{if(this.transport){this.transport.removeAllListeners();this.transport.close()}};addEventListener(`beforeunload`,this._beforeunloadEventListener,false)}if(this.hostname!==`localhost`){this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})};OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener)}}if(this.opts.withCredentials)this._cookieJar=createCookieJar();this._open()}createTransport(name){const query=Object.assign({},this.opts.query);query.EIO=4;query.transport=name;if(this.id)query.sid=this.id;const opts=Object.assign({},this.opts,{query,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[name]);return new this._transportsByName[name](opts)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}const transportName=this.opts.rememberUpgrade&&SocketWithoutUpgrade.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;const transport=this.createTransport(transportName);transport.open();this.setTransport(transport)}setTransport(transport){if(this.transport)this.transport.removeAllListeners();this.transport=transport;transport.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,reason=>this._onClose(`transport close`,reason))}onOpen(){this.readyState=`open`;SocketWithoutUpgrade.priorWebsocketSuccess=`websocket`===this.transport.name;this.emitReserved(`open`);this.flush()}_onPacket(packet){if(`opening`===this.readyState||`open`===this.readyState||`closing`===this.readyState){this.emitReserved(`packet`,packet);this.emitReserved(`heartbeat`);switch(packet.type){case`open`:this.onHandshake(JSON.parse(packet.data));break;case`ping`:this._sendPacket(`pong`);this.emitReserved(`ping`);this.emitReserved(`pong`);this._resetPingTimeout();break;case`error`:const err=new Error(`server error`);err.code=packet.data;this._onError(err);break;case`message`:this.emitReserved(`data`,packet.data);this.emitReserved(`message`,packet.data)}}}onHandshake(data){this.emitReserved(`handshake`,data);this.id=data.sid;this.transport.query.sid=data.sid;this._pingInterval=data.pingInterval;this._pingTimeout=data.pingTimeout;this._maxPayload=data.maxPayload;this.onOpen();if(`closed`===this.readyState)return;this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const delay=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+delay;this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},delay);if(this.opts.autoUnref)this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen);this._prevBufferLen=0;if(0===this.writeBuffer.length)this.emitReserved(`drain`);else this.flush()}flush(){if(`closed`!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const packets=this._getWritablePackets();this.transport.send(packets);this._prevBufferLen=packets.length;this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let payloadSize=1;for(let i=0;i<this.writeBuffer.length;i++){const data=this.writeBuffer[i].data;if(data)payloadSize+=byteLength(data);if(i>0&&payloadSize>this._maxPayload)return this.writeBuffer.slice(0,i);payloadSize+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return true;const hasExpired=Date.now()>this._pingTimeoutTime;if(hasExpired){this._pingTimeoutTime=0;nextTick(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)}return hasExpired}write(msg,options,fn){this._sendPacket(`message`,msg,options,fn);return this}send(msg,options,fn){this._sendPacket(`message`,msg,options,fn);return this}_sendPacket(type,data,options,fn){if(`function`===typeof data){fn=data;data=void 0}if(`function`===typeof options){fn=options;options=null}if(`closing`===this.readyState||`closed`===this.readyState)return;options=options||{};options.compress=false!==options.compress;const packet={type,data,options};this.emitReserved(`packetCreate`,packet);this.writeBuffer.push(packet);if(fn)this.once(`flush`,fn);this.flush()}close(){const close=()=>{this._onClose(`forced close`);this.transport.close()};const cleanupAndClose=()=>{this.off(`upgrade`,cleanupAndClose);this.off(`upgradeError`,cleanupAndClose);close()};const waitForUpgrade=()=>{this.once(`upgrade`,cleanupAndClose);this.once(`upgradeError`,cleanupAndClose)};if(`opening`===this.readyState||`open`===this.readyState){this.readyState=`closing`;if(this.writeBuffer.length)this.once(`drain`,()=>{if(this.upgrading)waitForUpgrade();else close()});else if(this.upgrading)waitForUpgrade();else close()}return this}_onError(err){SocketWithoutUpgrade.priorWebsocketSuccess=false;if(this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`){this.transports.shift();return this._open()}this.emitReserved(`error`,err);this._onClose(`transport error`,err)}_onClose(reason,description){if(`opening`===this.readyState||`open`===this.readyState||`closing`===this.readyState){this.clearTimeoutFn(this._pingTimeoutTimer);this.transport.removeAllListeners(`close`);this.transport.close();this.transport.removeAllListeners();if(withEventListeners){if(this._beforeunloadEventListener)removeEventListener(`beforeunload`,this._beforeunloadEventListener,false);if(this._offlineEventListener){const i=OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);if(i!==-1)OFFLINE_EVENT_LISTENERS.splice(i,1)}}this.readyState=`closed`;this.id=null;this.emitReserved(`close`,reason,description);this.writeBuffer=[];this._prevBufferLen=0}}};SocketWithoutUpgrade.protocol=4;var SocketWithUpgrade=class extends SocketWithoutUpgrade{constructor(){super(...arguments);this._upgrades=[]}onOpen(){super.onOpen();if(`open`===this.readyState&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(name){let transport=this.createTransport(name);let failed=false;SocketWithoutUpgrade.priorWebsocketSuccess=false;const onTransportOpen=()=>{if(failed)return;transport.send([{type:`ping`,data:`probe`}]);transport.once(`packet`,msg=>{if(failed)return;if(`pong`===msg.type&&`probe`===msg.data){this.upgrading=true;this.emitReserved(`upgrading`,transport);if(!transport)return;SocketWithoutUpgrade.priorWebsocketSuccess=`websocket`===transport.name;this.transport.pause(()=>{if(failed)return;if(`closed`===this.readyState)return;cleanup();this.setTransport(transport);transport.send([{type:`upgrade`}]);this.emitReserved(`upgrade`,transport);transport=null;this.upgrading=false;this.flush()})}else{const err=new Error(`probe error`);err.transport=transport.name;this.emitReserved(`upgradeError`,err)}})};function freezeTransport(){if(failed)return;failed=true;cleanup();transport.close();transport=null}const onerror=err=>{const error=new Error(`probe error: `+err);error.transport=transport.name;freezeTransport();this.emitReserved(`upgradeError`,error)};function onTransportClose(){onerror(`transport closed`)}function onclose(){onerror(`socket closed`)}function onupgrade(to){if(transport&&to.name!==transport.name)freezeTransport()}const cleanup=()=>{transport.removeListener(`open`,onTransportOpen);transport.removeListener(`error`,onerror);transport.removeListener(`close`,onTransportClose);this.off(`close`,onclose);this.off(`upgrading`,onupgrade)};transport.once(`open`,onTransportOpen);transport.once(`error`,onerror);transport.once(`close`,onTransportClose);this.once(`close`,onclose);this.once(`upgrading`,onupgrade);if(this._upgrades.indexOf(`webtransport`)!==-1&&name!==`webtransport`)this.setTimeoutFn(()=>{if(!failed)transport.open()},200);else transport.open()}onHandshake(data){this._upgrades=this._filterUpgrades(data.upgrades);super.onHandshake(data)}_filterUpgrades(upgrades){const filteredUpgrades=[];for(let i=0;i<upgrades.length;i++)if(~this.transports.indexOf(upgrades[i]))filteredUpgrades.push(upgrades[i]);return filteredUpgrades}};var Socket$1=class extends SocketWithUpgrade{constructor(uri,opts={}){const isOptionsOnly=typeof uri===`object`;const o=isOptionsOnly?{...uri}:{...opts};if(!o.transports||o.transports&&typeof o.transports[0]===`string`)o.transports=(o.transports||[`polling`,`websocket`,`webtransport`]).map(transportName=>transports[transportName]).filter(t=>!!t);super(isOptionsOnly?o:uri,o)}};var protocol$1=Socket$1.protocol;function url(uri,path=``,loc){let obj=uri;loc=loc||typeof location!==`undefined`&&location;if(null==uri)uri=loc.protocol+`//`+loc.host;if(typeof uri===`string`){if(`/`===uri.charAt(0)){if(`/`===uri.charAt(1))uri=loc.protocol+uri;else uri=loc.host+uri}if(!/^(https?|wss?):\/\//.test(uri)){if(`undefined`!==typeof loc)uri=loc.protocol+`//`+uri;else uri=`https://`+uri}obj=parse(uri)}if(!obj.port){if(/^(http|ws)$/.test(obj.protocol))obj.port=`80`;else if(/^(http|ws)s$/.test(obj.protocol))obj.port=`443`}obj.path=obj.path||`/`;const host=obj.host.indexOf(`:`)!==-1?`[`+obj.host+`]`:obj.host;obj.id=obj.protocol+`://`+host+`:`+obj.port+path;obj.href=obj.protocol+`://`+host+(loc&&loc.port===obj.port?``:`:`+obj.port);return obj}var withNativeArrayBuffer=typeof ArrayBuffer===`function`;var isView=obj=>{return typeof ArrayBuffer.isView===`function`?ArrayBuffer.isView(obj):obj.buffer instanceof ArrayBuffer};var toString=Object.prototype.toString;var withNativeBlob=typeof Blob===`function`||typeof Blob!==`undefined`&&toString.call(Blob)===`[object BlobConstructor]`;var withNativeFile=typeof File===`function`||typeof File!==`undefined`&&toString.call(File)===`[object FileConstructor]`;function isBinary(obj){return withNativeArrayBuffer&&(obj instanceof ArrayBuffer||isView(obj))||withNativeBlob&&obj instanceof Blob||withNativeFile&&obj instanceof File}function hasBinary(obj,toJSON){if(!obj||typeof obj!==`object`)return false;if(Array.isArray(obj)){for(let i=0,l=obj.length;i<l;i++)if(hasBinary(obj[i]))return true;return false}if(isBinary(obj))return true;if(obj.toJSON&&typeof obj.toJSON===`function`&&arguments.length===1)return hasBinary(obj.toJSON(),true);for(const key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)&&hasBinary(obj[key]))return true;return false}function deconstructPacket(packet){const buffers=[];const packetData=packet.data;const pack=packet;pack.data=_deconstructPacket(packetData,buffers);pack.attachments=buffers.length;return{packet:pack,buffers}}function _deconstructPacket(data,buffers,toJSON){if(!data)return data;if(isBinary(data)){const placeholder={_placeholder:true,num:buffers.length};buffers.push(data);return placeholder}else if(Array.isArray(data)){const newData=new Array(data.length);for(let i=0;i<data.length;i++)newData[i]=_deconstructPacket(data[i],buffers);return newData}else if(typeof data===`object`&&!(data instanceof Date)){if(data.toJSON&&typeof data.toJSON===`function`&&!toJSON)return _deconstructPacket(data.toJSON(),buffers,true);const newData={};for(const key in data)if(Object.prototype.hasOwnProperty.call(data,key))newData[key]=_deconstructPacket(data[key],buffers);return newData}return data}function reconstructPacket(packet,buffers){packet.data=_reconstructPacket(packet.data,buffers);delete packet.attachments;return packet}function _reconstructPacket(data,buffers){if(!data)return data;if(data&&data._placeholder===true){if(typeof data.num===`number`&&data.num>=0&&data.num<buffers.length)return buffers[data.num];else throw new Error(`illegal attachments`)}else if(Array.isArray(data))for(let i=0;i<data.length;i++)data[i]=_reconstructPacket(data[i],buffers);else if(typeof data===`object`){for(const key in data)if(Object.prototype.hasOwnProperty.call(data,key))data[key]=_reconstructPacket(data[key],buffers)}return data}var esm_exports=__exportAll({Decoder:()=>Decoder,Encoder:()=>Encoder,PacketType:()=>PacketType,isPacketValid:()=>isPacketValid,protocol:()=>5});var RESERVED_EVENTS$1=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`];var protocol=5;var PacketType;(function(PacketType){PacketType[PacketType[`CONNECT`]=0]=`CONNECT`;PacketType[PacketType[`DISCONNECT`]=1]=`DISCONNECT`;PacketType[PacketType[`EVENT`]=2]=`EVENT`;PacketType[PacketType[`ACK`]=3]=`ACK`;PacketType[PacketType[`CONNECT_ERROR`]=4]=`CONNECT_ERROR`;PacketType[PacketType[`BINARY_EVENT`]=5]=`BINARY_EVENT`;PacketType[PacketType[`BINARY_ACK`]=6]=`BINARY_ACK`})(PacketType||(PacketType={}));var Encoder=class{constructor(replacer){this.replacer=replacer}encode(obj){if(obj.type===PacketType.EVENT||obj.type===PacketType.ACK){if(hasBinary(obj))return this.encodeAsBinary({type:obj.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:obj.nsp,data:obj.data,id:obj.id})}return[this.encodeAsString(obj)]}encodeAsString(obj){let str=``+obj.type;if(obj.type===PacketType.BINARY_EVENT||obj.type===PacketType.BINARY_ACK)str+=obj.attachments+`-`;if(obj.nsp&&`/`!==obj.nsp)str+=obj.nsp+`,`;if(null!=obj.id)str+=obj.id;if(null!=obj.data)str+=JSON.stringify(obj.data,this.replacer);return str}encodeAsBinary(obj){const deconstruction=deconstructPacket(obj);const pack=this.encodeAsString(deconstruction.packet);const buffers=deconstruction.buffers;buffers.unshift(pack);return buffers}};var Decoder=class Decoder extends Emitter{constructor(opts){super();this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof opts===`function`?{reviver:opts}:opts)}add(obj){let packet;if(typeof obj===`string`){if(this.reconstructor)throw new Error(`got plaintext data when reconstructing a packet`);packet=this.decodeString(obj);const isBinaryEvent=packet.type===PacketType.BINARY_EVENT;if(isBinaryEvent||packet.type===PacketType.BINARY_ACK){packet.type=isBinaryEvent?PacketType.EVENT:PacketType.ACK;this.reconstructor=new BinaryReconstructor(packet)}else super.emitReserved(`decoded`,packet)}else if(isBinary(obj)||obj.base64){if(!this.reconstructor)throw new Error(`got binary data when not reconstructing a packet`);else{packet=this.reconstructor.takeBinaryData(obj);if(packet){this.reconstructor=null;super.emitReserved(`decoded`,packet)}}}else throw new Error(`Unknown type: `+obj)}decodeString(str){let i=0;const p={type:Number(str.charAt(0))};if(PacketType[p.type]===void 0)throw new Error(`unknown packet type `+p.type);if(p.type===PacketType.BINARY_EVENT||p.type===PacketType.BINARY_ACK){const start=i+1;while(str.charAt(++i)!==`-`&&i!=str.length);const buf=str.substring(start,i);if(buf!=Number(buf)||str.charAt(i)!==`-`)throw new Error(`Illegal attachments`);const n=Number(buf);if(!isInteger(n)||n<1)throw new Error(`Illegal attachments`);else if(n>this.opts.maxAttachments)throw new Error(`too many attachments`);p.attachments=n}if(`/`===str.charAt(i+1)){const start=i+1;while(++i){if(`,`===str.charAt(i))break;if(i===str.length)break}p.nsp=str.substring(start,i)}else p.nsp=`/`;const next=str.charAt(i+1);if(``!==next&&Number(next)==next){const start=i+1;while(++i){const c=str.charAt(i);if(null==c||Number(c)!=c){--i;break}if(i===str.length)break}p.id=Number(str.substring(start,i+1))}if(str.charAt(++i)){const payload=this.tryParse(str.substr(i));if(Decoder.isPayloadValid(p.type,payload))p.data=payload;else throw new Error(`invalid payload`)}return p}tryParse(str){try{return JSON.parse(str,this.opts.reviver)}catch(e){return false}}static isPayloadValid(type,payload){switch(type){case PacketType.CONNECT:return isObject(payload);case PacketType.DISCONNECT:return payload===void 0;case PacketType.CONNECT_ERROR:return typeof payload===`string`||isObject(payload);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(payload)&&(typeof payload[0]===`number`||typeof payload[0]===`string`&&RESERVED_EVENTS$1.indexOf(payload[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(payload)}}destroy(){if(this.reconstructor){this.reconstructor.finishedReconstruction();this.reconstructor=null}}};var BinaryReconstructor=class{constructor(packet){this.packet=packet;this.buffers=[];this.reconPack=packet}takeBinaryData(binData){this.buffers.push(binData);if(this.buffers.length===this.reconPack.attachments){const packet=reconstructPacket(this.reconPack,this.buffers);this.finishedReconstruction();return packet}return null}finishedReconstruction(){this.reconPack=null;this.buffers=[]}};function isNamespaceValid(nsp){return typeof nsp===`string`}var isInteger=Number.isInteger||function(value){return typeof value===`number`&&isFinite(value)&&Math.floor(value)===value};function isAckIdValid(id){return id===void 0||isInteger(id)}function isObject(value){return Object.prototype.toString.call(value)===`[object Object]`}function isDataValid(type,payload){switch(type){case PacketType.CONNECT:return payload===void 0||isObject(payload);case PacketType.DISCONNECT:return payload===void 0;case PacketType.EVENT:return Array.isArray(payload)&&(typeof payload[0]===`number`||typeof payload[0]===`string`&&RESERVED_EVENTS$1.indexOf(payload[0])===-1);case PacketType.ACK:return Array.isArray(payload);case PacketType.CONNECT_ERROR:return typeof payload===`string`||isObject(payload);default:return false}}function isPacketValid(packet){return isNamespaceValid(packet.nsp)&&isAckIdValid(packet.id)&&isDataValid(packet.type,packet.data)}function on(obj,ev,fn){obj.on(ev,fn);return function subDestroy(){obj.off(ev,fn)}}var RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});var Socket=class extends Emitter{constructor(io,nsp,opts){super();this.connected=false;this.recovered=false;this.receiveBuffer=[];this.sendBuffer=[];this._queue=[];this._queueSeq=0;this.ids=0;this.acks={};this.flags={};this.io=io;this.nsp=nsp;if(opts&&opts.auth)this.auth=opts.auth;this._opts=Object.assign({},opts);if(this.io._autoConnect)this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const io=this.io;this.subs=[on(io,`open`,this.onopen.bind(this)),on(io,`packet`,this.onpacket.bind(this)),on(io,`error`,this.onerror.bind(this)),on(io,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){if(this.connected)return this;this.subEvents();if(!this.io[`_reconnecting`])this.io.open();if(`open`===this.io._readyState)this.onopen();return this}open(){return this.connect()}send(...args){args.unshift(`message`);this.emit.apply(this,args);return this}emit(ev,...args){var _a,_b,_c;if(RESERVED_EVENTS.hasOwnProperty(ev))throw new Error(`"`+ev.toString()+`" is a reserved event name`);args.unshift(ev);if(this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile){this._addToQueue(args);return this}const packet={type:PacketType.EVENT,data:args};packet.options={};packet.options.compress=this.flags.compress!==false;if(`function`===typeof args[args.length-1]){const id=this.ids++;const ack=args.pop();this._registerAckCallback(id,ack);packet.id=id}const isTransportWritable=(_b=(_a=this.io.engine)===null||_a===void 0?void 0:_a.transport)===null||_b===void 0?void 0:_b.writable;const isConnected=this.connected&&!((_c=this.io.engine)===null||_c===void 0?void 0:_c._hasPingExpired());if(this.flags.volatile&&!isTransportWritable){}else if(isConnected){this.notifyOutgoingListeners(packet);this.packet(packet)}else this.sendBuffer.push(packet);this.flags={};return this}_registerAckCallback(id,ack){var _a;const timeout=(_a=this.flags.timeout)!==null&&_a!==void 0?_a:this._opts.ackTimeout;if(timeout===void 0){this.acks[id]=ack;return}const timer=this.io.setTimeoutFn(()=>{delete this.acks[id];for(let i=0;i<this.sendBuffer.length;i++)if(this.sendBuffer[i].id===id)this.sendBuffer.splice(i,1);ack.call(this,new Error(`operation has timed out`))},timeout);const fn=(...args)=>{this.io.clearTimeoutFn(timer);ack.apply(this,args)};fn.withError=true;this.acks[id]=fn}emitWithAck(ev,...args){return new Promise((resolve,reject)=>{const fn=(arg1,arg2)=>{return arg1?reject(arg1):resolve(arg2)};fn.withError=true;args.push(fn);this.emit(ev,...args)})}_addToQueue(args){let ack;if(typeof args[args.length-1]===`function`)ack=args.pop();const packet={id:this._queueSeq++,tryCount:0,pending:false,args,flags:Object.assign({fromQueue:true},this.flags)};args.push((err,...responseArgs)=>{if(packet!==this._queue[0]){}if(err!==null){if(packet.tryCount>this._opts.retries){this._queue.shift();if(ack)ack(err)}}else{this._queue.shift();if(ack)ack(null,...responseArgs)}packet.pending=false;return this._drainQueue()});this._queue.push(packet);this._drainQueue()}_drainQueue(force=false){if(!this.connected||this._queue.length===0)return;const packet=this._queue[0];if(packet.pending&&!force)return;packet.pending=true;packet.tryCount++;this.flags=packet.flags;this.emit.apply(this,packet.args)}packet(packet){packet.nsp=this.nsp;this.io._packet(packet)}onopen(){if(typeof this.auth==`function`)this.auth(data=>{this._sendConnectPacket(data)});else this._sendConnectPacket(this.auth)}_sendConnectPacket(data){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},data):data})}onerror(err){if(!this.connected)this.emitReserved(`connect_error`,err)}onclose(reason,description){this.connected=false;delete this.id;this.emitReserved(`disconnect`,reason,description);this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(id=>{if(!this.sendBuffer.some(packet=>String(packet.id)===id)){const ack=this.acks[id];delete this.acks[id];if(ack.withError)ack.call(this,new Error(`socket has been disconnected`))}})}onpacket(packet){if(!(packet.nsp===this.nsp))return;switch(packet.type){case PacketType.CONNECT:if(packet.data&&packet.data.sid)this.onconnect(packet.data.sid,packet.data.pid);else this.emitReserved(`connect_error`,new Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(packet);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(packet);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const err=new Error(packet.data.message);err.data=packet.data.data;this.emitReserved(`connect_error`,err)}}onevent(packet){const args=packet.data||[];if(null!=packet.id)args.push(this.ack(packet.id));if(this.connected)this.emitEvent(args);else this.receiveBuffer.push(Object.freeze(args))}emitEvent(args){if(this._anyListeners&&this._anyListeners.length){const listeners=this._anyListeners.slice();for(const listener of listeners)listener.apply(this,args)}super.emit.apply(this,args);if(this._pid&&args.length&&typeof args[args.length-1]===`string`)this._lastOffset=args[args.length-1]}ack(id){const self=this;let sent=false;return function(...args){if(sent)return;sent=true;self.packet({type:PacketType.ACK,id,data:args})}}onack(packet){const ack=this.acks[packet.id];if(typeof ack!==`function`)return;delete this.acks[packet.id];if(ack.withError)packet.data.unshift(null);ack.apply(this,packet.data)}onconnect(id,pid){this.id=id;this.recovered=pid&&this._pid===pid;this._pid=pid;this.connected=true;this.emitBuffered();this._drainQueue(true);this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(args=>this.emitEvent(args));this.receiveBuffer=[];this.sendBuffer.forEach(packet=>{this.notifyOutgoingListeners(packet);this.packet(packet)});this.sendBuffer=[]}ondisconnect(){this.destroy();this.onclose(`io server disconnect`)}destroy(){if(this.subs){this.subs.forEach(subDestroy=>subDestroy());this.subs=void 0}this.io[`_destroy`](this)}disconnect(){if(this.connected)this.packet({type:PacketType.DISCONNECT});this.destroy();if(this.connected)this.onclose(`io client disconnect`);return this}close(){return this.disconnect()}compress(compress){this.flags.compress=compress;return this}get volatile(){this.flags.volatile=true;return this}timeout(timeout){this.flags.timeout=timeout;return this}onAny(listener){this._anyListeners=this._anyListeners||[];this._anyListeners.push(listener);return this}prependAny(listener){this._anyListeners=this._anyListeners||[];this._anyListeners.unshift(listener);return this}offAny(listener){if(!this._anyListeners)return this;if(listener){const listeners=this._anyListeners;for(let i=0;i<listeners.length;i++)if(listener===listeners[i]){listeners.splice(i,1);return this}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(listener){this._anyOutgoingListeners=this._anyOutgoingListeners||[];this._anyOutgoingListeners.push(listener);return this}prependAnyOutgoing(listener){this._anyOutgoingListeners=this._anyOutgoingListeners||[];this._anyOutgoingListeners.unshift(listener);return this}offAnyOutgoing(listener){if(!this._anyOutgoingListeners)return this;if(listener){const listeners=this._anyOutgoingListeners;for(let i=0;i<listeners.length;i++)if(listener===listeners[i]){listeners.splice(i,1);return this}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(packet){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const listeners=this._anyOutgoingListeners.slice();for(const listener of listeners)listener.apply(this,packet.data)}}};function Backoff(opts){opts=opts||{};this.ms=opts.min||100;this.max=opts.max||1e4;this.factor=opts.factor||2;this.jitter=opts.jitter>0&&opts.jitter<=1?opts.jitter:0;this.attempts=0}Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random();var deviation=Math.floor(rand*this.jitter*ms);ms=(Math.floor(rand*10)&1)==0?ms-deviation:ms+deviation}return Math.min(ms,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(min){this.ms=min};Backoff.prototype.setMax=function(max){this.max=max};Backoff.prototype.setJitter=function(jitter){this.jitter=jitter};var Manager=class extends Emitter{constructor(uri,opts){var _a;super();this.nsps={};this.subs=[];if(uri&&`object`===typeof uri){opts=uri;uri=void 0}opts=opts||{};opts.path=opts.path||`/socket.io`;this.opts=opts;installTimerFunctions(this,opts);this.reconnection(opts.reconnection!==false);this.reconnectionAttempts(opts.reconnectionAttempts||Infinity);this.reconnectionDelay(opts.reconnectionDelay||1e3);this.reconnectionDelayMax(opts.reconnectionDelayMax||5e3);this.randomizationFactor((_a=opts.randomizationFactor)!==null&&_a!==void 0?_a:.5);this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()});this.timeout(null==opts.timeout?2e4:opts.timeout);this._readyState=`closed`;this.uri=uri;const _parser=opts.parser||esm_exports;this.encoder=new _parser.Encoder;this.decoder=new _parser.Decoder;this._autoConnect=opts.autoConnect!==false;if(this._autoConnect)this.open()}reconnection(v){if(!arguments.length)return this._reconnection;this._reconnection=!!v;if(!v)this.skipReconnect=true;return this}reconnectionAttempts(v){if(v===void 0)return this._reconnectionAttempts;this._reconnectionAttempts=v;return this}reconnectionDelay(v){var _a;if(v===void 0)return this._reconnectionDelay;this._reconnectionDelay=v;(_a=this.backoff)===null||_a===void 0||_a.setMin(v);return this}randomizationFactor(v){var _a;if(v===void 0)return this._randomizationFactor;this._randomizationFactor=v;(_a=this.backoff)===null||_a===void 0||_a.setJitter(v);return this}reconnectionDelayMax(v){var _a;if(v===void 0)return this._reconnectionDelayMax;this._reconnectionDelayMax=v;(_a=this.backoff)===null||_a===void 0||_a.setMax(v);return this}timeout(v){if(!arguments.length)return this._timeout;this._timeout=v;return this}maybeReconnectOnOpen(){if(!this._reconnecting&&this._reconnection&&this.backoff.attempts===0)this.reconnect()}open(fn){if(~this._readyState.indexOf(`open`))return this;this.engine=new Socket$1(this.uri,this.opts);const socket=this.engine;const self=this;this._readyState=`opening`;this.skipReconnect=false;const openSubDestroy=on(socket,`open`,function(){self.onopen();fn&&fn()});const onError=err=>{this.cleanup();this._readyState=`closed`;this.emitReserved(`error`,err);if(fn)fn(err);else this.maybeReconnectOnOpen()};const errorSub=on(socket,`error`,onError);if(false!==this._timeout){const timeout=this._timeout;const timer=this.setTimeoutFn(()=>{openSubDestroy();onError(new Error(`timeout`));socket.close()},timeout);if(this.opts.autoUnref)timer.unref();this.subs.push(()=>{this.clearTimeoutFn(timer)})}this.subs.push(openSubDestroy);this.subs.push(errorSub);return this}connect(fn){return this.open(fn)}onopen(){this.cleanup();this._readyState=`open`;this.emitReserved(`open`);const socket=this.engine;this.subs.push(on(socket,`ping`,this.onping.bind(this)),on(socket,`data`,this.ondata.bind(this)),on(socket,`error`,this.onerror.bind(this)),on(socket,`close`,this.onclose.bind(this)),on(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(data){try{this.decoder.add(data)}catch(e){this.onclose(`parse error`,e)}}ondecoded(packet){nextTick(()=>{this.emitReserved(`packet`,packet)},this.setTimeoutFn)}onerror(err){this.emitReserved(`error`,err)}socket(nsp,opts){let socket=this.nsps[nsp];if(!socket){socket=new Socket(this,nsp,opts);this.nsps[nsp]=socket}else if(this._autoConnect&&!socket.active)socket.connect();return socket}_destroy(socket){const nsps=Object.keys(this.nsps);for(const nsp of nsps)if(this.nsps[nsp].active)return;this._close()}_packet(packet){const encodedPackets=this.encoder.encode(packet);for(let i=0;i<encodedPackets.length;i++)this.engine.write(encodedPackets[i],packet.options)}cleanup(){this.subs.forEach(subDestroy=>subDestroy());this.subs.length=0;this.decoder.destroy()}_close(){this.skipReconnect=true;this._reconnecting=false;this.onclose(`forced close`)}disconnect(){return this._close()}onclose(reason,description){var _a;this.cleanup();(_a=this.engine)===null||_a===void 0||_a.close();this.backoff.reset();this._readyState=`closed`;this.emitReserved(`close`,reason,description);if(this._reconnection&&!this.skipReconnect)this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const self=this;if(this.backoff.attempts>=this._reconnectionAttempts){this.backoff.reset();this.emitReserved(`reconnect_failed`);this._reconnecting=false}else{const delay=this.backoff.duration();this._reconnecting=true;const timer=this.setTimeoutFn(()=>{if(self.skipReconnect)return;this.emitReserved(`reconnect_attempt`,self.backoff.attempts);if(self.skipReconnect)return;self.open(err=>{if(err){self._reconnecting=false;self.reconnect();this.emitReserved(`reconnect_error`,err)}else self.onreconnect()})},delay);if(this.opts.autoUnref)timer.unref();this.subs.push(()=>{this.clearTimeoutFn(timer)})}}onreconnect(){const attempt=this.backoff.attempts;this._reconnecting=false;this.backoff.reset();this.emitReserved(`reconnect`,attempt)}};var cache={};function lookup(uri,opts){if(typeof uri===`object`){opts=uri;uri=void 0}opts=opts||{};const parsed=url(uri,opts.path||`/socket.io`);const source=parsed.source;const id=parsed.id;const path=parsed.path;const sameNamespace=cache[id]&&path in cache[id][`nsps`];const newConnection=opts.forceNew||opts[`force new connection`]||false===opts.multiplex||sameNamespace;let io;if(newConnection)io=new Manager(source,opts);else{if(!cache[id])cache[id]=new Manager(source,opts);io=cache[id]}if(parsed.query&&!opts.query)opts.query=parsed.queryKey;return io.socket(parsed.path,opts)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});var SOCKET_IO_PATH=`/socket.io`;function createSocketIoClient({url=``,options={},connect=lookup}){const normalizedUrl=normalizeText$1(url);const normalizedOptions={...normalizeObject(options),path:SOCKET_IO_PATH};if(normalizedUrl)return connect(normalizedUrl,normalizedOptions);return connect(normalizedOptions)}function disconnectSocketIoClient(socket){socket.disconnect()}function reconnectSocketIoClient(socket){if(socket.connected)return;if(socket.active)socket.disconnect();socket.connect()}var jskit$7={"errors":{"SESSION_REFRESH_REQUIRED":`Session refresh required.`},"realtime":{"indicator":{"connected":`Realtime connected`,"connectedTooltip":`Realtime is connected. Live updates are active.`,"disconnected":`Realtime disconnected`,"disconnectedTooltip":`Live updates are disconnected. Click to reconnect. If your session expired, sign in again.`,"reconnect":`Reconnect live updates`,"unavailableTooltip":`Realtime is unavailable. Live updates are disabled for this page.`}}};var en_default$7={jskit:jskit$7};registerJskitMessages(en_default$7);var{t:t$9}=useJskitText();var ROOT_STYLE=Object.freeze({alignItems:`center`,background:`transparent`,border:`0`,borderRadius:`50%`,display:`inline-flex`,height:`48px`,justifyContent:`center`,padding:`0`,width:`48px`});var DOT_STYLE=Object.freeze({borderRadius:`9999px`,boxShadow:`0 0 0 2px rgba(255, 255, 255, 0.82)`,display:`block`,height:`10px`,width:`10px`});var SR_ONLY_STYLE=Object.freeze({border:`0`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`});function resolveTooltipText({realtimeAvailable,connected}){if(!realtimeAvailable)return t$9(`jskit.realtime.indicator.unavailableTooltip`);if(connected)return t$9(`jskit.realtime.indicator.connectedTooltip`);return t$9(`jskit.realtime.indicator.disconnectedTooltip`)}var RealtimeConnectionIndicator=defineComponent$1({name:`RealtimeConnectionIndicator`,setup(){const socket=useRealtimeSocket();const connected=ref(Boolean(socket.connected));const realtimeAvailable=socket!==NO_REALTIME_SOCKET;const tooltipText=computed(()=>{return resolveTooltipText({realtimeAvailable,connected:connected.value})});const statusLabel=computed(()=>connected.value?t$9(`jskit.realtime.indicator.connected`):t$9(`jskit.realtime.indicator.disconnected`));const dotStyle=computed(()=>({...DOT_STYLE,backgroundColor:connected.value?`#22c55e`:`#ef4444`}));function syncConnected(nextState){connected.value=Boolean(nextState)}const onConnect=()=>syncConnected(true);const onDisconnect=()=>syncConnected(false);const onConnectError=()=>syncConnected(false);onMounted(()=>{syncConnected(socket.connected);socket.on(`connect`,onConnect);socket.on(`disconnect`,onDisconnect);socket.on(`connect_error`,onConnectError)});onBeforeUnmount(()=>{socket.off(`connect`,onConnect);socket.off(`disconnect`,onDisconnect);socket.off(`connect_error`,onConnectError)});return()=>h$1(`button`,{disabled:!realtimeAvailable||connected.value,onClick:()=>reconnectSocketIoClient(socket),style:{...ROOT_STYLE,cursor:realtimeAvailable&&!connected.value?`pointer`:`default`},title:tooltipText.value,type:`button`,"aria-label":realtimeAvailable&&!connected.value?t$9(`jskit.realtime.indicator.reconnect`):statusLabel.value},[h$1(`span`,{style:dotStyle.value,"aria-hidden":`true`}),h$1(`span`,{style:SR_ONLY_STYLE},statusLabel.value)])}});function attachSocketConnectionRecovery(socket,{prepareReconnect}){let timer=null;let delay=1e3;let recovering=false;const document=globalThis.document;const window=globalThis.window;function clearRetry(){clearTimeout(timer);timer=null}function canRetry(){return recovering&&!socket.connected&&!socket.active&&socket.io.reconnection()&&!document?.hidden&&window?.navigator?.onLine!==false}async function retry(){try{await prepareReconnect()}catch{}if(canRetry())socket.connect()}function scheduleRetry(){if(timer!==null||!canRetry())return;timer=setTimeout(()=>{timer=null;if(canRetry())retry()},delay);delay=Math.min(delay*2,3e4)}function onConnect(){clearRetry();recovering=false;delay=1e3}function onDisconnect(reason){clearRetry();recovering=reason===`io server disconnect`;scheduleRetry()}function onConnectError(){recovering=true;scheduleRetry()}function onAvailable(){if(socket.connected||document?.hidden||window?.navigator?.onLine===false||!socket.io.reconnection()||!socket.active&&!recovering)return;clearRetry();reconnectSocketIoClient(socket)}socket.on(`connect`,onConnect);socket.on(`disconnect`,onDisconnect);socket.on(`connect_error`,onConnectError);document?.addEventListener(`visibilitychange`,onAvailable);window?.addEventListener(`online`,onAvailable);return()=>{recovering=false;clearRetry();socket.off(`connect`,onConnect);socket.off(`disconnect`,onDisconnect);socket.off(`connect_error`,onConnectError);document?.removeEventListener(`visibilitychange`,onAvailable);window?.removeEventListener(`online`,onAvailable)}}var SERVED_CLIENT_BUILD_EVENT=`realtime.served-client-build`;function skipReconnectPreparation(){}function resolveRealtimeClientConfig({env={},mobile=null}={}){const appConfig=normalizeObject(getClientAppConfig());const realtime=normalizeObject(appConfig.realtime);const realtimeClient=normalizeObject(appConfig.realtimeClient);const mobileConfig=resolveMobileConfig({mobile:normalizeObject(appConfig.mobile)});const url=normalizeText$1(realtimeClient.url||(mobileConfig.enabled===true&&mobile?.adapter?.available===true?mobileConfig.apiBaseUrl:``));const options=normalizeObject(realtimeClient.options);const explicitDebugEnabled=typeof realtimeClient.debug===`boolean`?realtimeClient.debug:typeof realtime.debug===`boolean`?realtime.debug:void 0;const debugEnabled=Object.hasOwn(normalizeObject(env),`VITE_REALTIME_DEBUG`)?resolveClientBootstrapDebugEnabled({env,debugEnabled:void 0,debugEnvKey:`VITE_REALTIME_DEBUG`}):resolveClientBootstrapDebugEnabled({env,debugEnabled:explicitDebugEnabled,debugEnvKey:`VITE_REALTIME_DEBUG`});return Object.freeze({url,options,debugEnabled})}function createRealtimeClient({config,logger:appLogger}){const logger=createProviderLogger(appLogger,{debugEnabled:config.debugEnabled});const socket=createSocketIoClient({url:config.url,options:config.options});const servedClientBuild=trackServedClientBuild(socket,logger);const detach=[];let initialized=false;let beforeReconnect=skipReconnectPreparation;function initialize(vueApp){if(initialized)return;initialized=true;detach.push(attachSocketConnectionRecovery(socket,{prepareReconnect:()=>beforeReconnect()}));const onConnect=()=>logger.debug({socketConnected:true},`Realtime client socket connected.`);const onDisconnect=reason=>logger.debug({socketConnected:false,reason:String(reason||``)},`Realtime client socket disconnected.`);const onConnectError=error=>logger.warn({error:String(error?.message||error||`unknown error`)},`Realtime client socket connect error.`);socket.on(`connect`,onConnect);socket.on(`disconnect`,onDisconnect);socket.on(`connect_error`,onConnectError);detach.push(()=>{socket.off(`connect`,onConnect);socket.off(`disconnect`,onDisconnect);socket.off(`connect_error`,onConnectError)});if(config.debugEnabled===true){const onAny=(eventName,payload)=>logger.debug({event:String(eventName||``),payloadScope:payload?.scope||null,payloadEntityId:payload?.entityId||null},`Realtime client received socket event.`);socket.onAny(onAny);detach.push(()=>socket.offAny(onAny))}vueApp.provide(REALTIME_SOCKET_KEY,socket)}function dispose(){for(const release of detach.splice(0,detach.length))try{release()}catch{}servedClientBuild.dispose();disconnectSocketIoClient(socket);initialized=false}function setBeforeReconnect(prepare){beforeReconnect=prepare;return()=>{if(beforeReconnect===prepare)beforeReconnect=skipReconnectPreparation}}return Object.freeze({config,dispose,initialize,onServedClientBuild:servedClientBuild.subscribe,setBeforeReconnect,socket})}function trackServedClientBuild(socket,logger){const listeners=new Set;let buildId=``;function notify(listener){try{listener(buildId)}catch(error){logger.warn({error:String(error?.message||error)},`Served client build listener failed.`)}}function onServedClientBuild(payload){buildId=normalizeText$1(payload?.buildId);if(buildId)for(const listener of[...listeners])notify(listener)}socket.on(SERVED_CLIENT_BUILD_EVENT,onServedClientBuild);return Object.freeze({subscribe(listener){listeners.add(listener);if(buildId)notify(listener);return()=>listeners.delete(listener)},dispose(){socket.off(SERVED_CLIENT_BUILD_EVENT,onServedClientBuild);listeners.clear()}})}var RealtimeClientProvider=defineProvider({id:`runtime.realtime.client`,requires:{components:`client.components`,env:`client.env`,logger:`client.logger`,vueApp:`client.vue`},optional:{mobile:`client.mobile`},provides:{realtime:`client.realtime`},setup({components,env,logger,mobile}){components.register(`realtime.web.connection.indicator`,RealtimeConnectionIndicator);return{realtime:createRealtimeClient({config:resolveRealtimeClientConfig({env,mobile}),logger})}},boot({vueApp},{outputs}){outputs.realtime.initialize(vueApp)},shutdown(_dependencies,{outputs}){outputs.realtime.dispose()}});var{t:t$8}=useJskitText();function isMissingDynamicModule(error,moduleSpecifier){const message=String(error?.message||error||``);return message.includes(moduleSpecifier)&&(message.includes(`Cannot find module`)||message.includes(`ERR_MODULE_NOT_FOUND`))}function notifyDynamicImportFailure(asyncModuleRecoveryRuntime,error,{label=t$8(`jskit.shell.recovery.appModuleLabel`)}={}){if(!isDynamicImportError(error))return;asyncModuleRecoveryRuntime.notify(error,{label})}var{t:t$7,text}=useJskitText();var GENERIC_REQUEST_LABEL=`Request`;function appReloadFailureMessage(){return t$7(`jskit.shell.recovery.reloadFailed`)}var RECOVERABLE_REQUEST_ERROR_MESSAGES=Object.freeze([/Failed to fetch/iu,/Load failed/iu,/Network request failed/iu,/NetworkError when attempting to fetch resource/iu,/The Internet connection appears to be offline/iu]);var RECOVERABLE_REQUEST_ERROR_CODES=Object.freeze(new Set([`EAI_AGAIN`,`ECONNABORTED`,`ECONNREFUSED`,`ECONNRESET`,`ENETDOWN`,`ENETUNREACH`,`ENOTFOUND`,`ERR_NETWORK`,`ETIMEDOUT`]));var CANCELED_REQUEST_ERROR_CODES=Object.freeze(new Set([`ABORT_ERR`,`ERR_ABORTED`,`ERR_CANCELED`]));var SAFE_REQUEST_RECOVERY_METHODS=Object.freeze(new Set([`GET`,`HEAD`]));function errorMessage(error=null){return normalizeText$1(error?.message||error?.cause?.message||error)}function errorCode(error=null){return normalizeText$1(error?.code||error?.cause?.code).toUpperCase()}function errorName(error=null){return normalizeText$1(error?.name||error?.cause?.name)}function normalizeRequestErrorStatus(error=null){if(!isRecord(error))return null;const hasStatus=Object.prototype.hasOwnProperty.call(error,`status`);const hasStatusCode=Object.prototype.hasOwnProperty.call(error,`statusCode`);if(!hasStatus&&!hasStatusCode)return null;const status=Number(hasStatus?error.status:error.statusCode);return Number.isInteger(status)?status:null}function isCanceledRequestError(error=null){const name=errorName(error).toLowerCase();if(name===`aborterror`||name===`cancelederror`)return true;return CANCELED_REQUEST_ERROR_CODES.has(errorCode(error))}function isRecoverableRequestError(error=null){if(!error||isCanceledRequestError(error))return false;if(normalizeRequestErrorStatus(error)===0)return true;if(RECOVERABLE_REQUEST_ERROR_CODES.has(errorCode(error)))return true;const message=errorMessage(error);return Boolean(message&&RECOVERABLE_REQUEST_ERROR_MESSAGES.some(pattern=>pattern.test(message)))}function requestRecoveryMessage(error=null,{label=``,message=``}={}){const explicitMessage=normalizeText$1(message);if(explicitMessage)return explicitMessage;const requestLabel=normalizeText$1(text(label));if(!requestLabel||requestLabel===GENERIC_REQUEST_LABEL)return t$7(`jskit.shell.recovery.appUnreachable`);return t$7(`jskit.shell.recovery.unreachable`,{label:requestLabel})}function readQueryRecoveryMeta(query){const meta=isRecord(query.meta)?query.meta:{};const jskitMeta=isRecord(meta.jskit)?meta.jskit:{};const dedupeWindowMs=jskitMeta.requestRecoveryDedupeWindowMs;return Object.freeze({disabled:jskitMeta.requestRecovery===false,label:normalizeText$1(jskitMeta.requestRecoveryLabel),source:normalizeText$1(jskitMeta.requestRecoverySource,{fallback:`shell-web.request-recovery.query`}),dedupeKey:normalizeText$1(jskitMeta.requestRecoveryDedupeKey),dedupeWindowMs:Number.isFinite(Number(dedupeWindowMs))?Math.max(0,Number(dedupeWindowMs)):null,method:normalizeText$1(jskitMeta.requestRecoveryMethod).toUpperCase()})}function recoverableQueryError(query){const{state}=query;if(state.status!==`error`||state.fetchStatus!==`idle`)return null;const error=state.error||state.fetchFailureReason||null;return isRecoverableRequestError(error)?error:null}function createQueryRetry(queryClient,query){const{queryKey}=query;if(!Array.isArray(queryKey))return null;return()=>queryClient.refetchQueries({queryKey,exact:true,type:`active`},{throwOnError:false})}function resolveQueryHash(query){const explicitHash=normalizeText$1(query.queryHash);if(explicitHash)return explicitHash;try{return normalizeText$1(JSON.stringify(query.queryKey||[]))}catch{return normalizeText$1(String(query.queryKey||``))}}function installRecoverableQueryObserver({queryClient,runtime,logger}){const queryCache=queryClient.getQueryCache();const reportedErrorUpdateByQueryHash=new Map;function dismissReportedQueryRecovery(queryHash=``){const reported=reportedErrorUpdateByQueryHash.get(queryHash);if(!reported)return;reportedErrorUpdateByQueryHash.delete(queryHash);if(reported.presentationId)runtime.dismiss(reported.presentationId,{presenterId:reported.presenterId})}function dismissReportedQueryRecoveries(){for(const queryHash of[...reportedErrorUpdateByQueryHash.keys()])dismissReportedQueryRecovery(queryHash)}function inspectQuery(query){const queryHash=resolveQueryHash(query);const recoveryMeta=readQueryRecoveryMeta(query);if(recoveryMeta.disabled||!SAFE_REQUEST_RECOVERY_METHODS.has(recoveryMeta.method)||!query.isActive()){if(queryHash)dismissReportedQueryRecovery(queryHash);return}const error=recoverableQueryError(query);if(!error||!queryHash){if(queryHash)dismissReportedQueryRecovery(queryHash);return}const errorUpdateCount=Number(query.state.errorUpdateCount||0);const reportKey=`${errorUpdateCount}:${errorMessage(error)}`;const reported=reportedErrorUpdateByQueryHash.get(queryHash);if(reported?.reportKey===reportKey)return;const{dedupeWindowMs}=recoveryMeta;const result=runtime.report(error,{label:recoveryMeta.label,retry:createQueryRetry(queryClient,query),source:recoveryMeta.source,stale:query.state.data!==void 0,dedupeKey:recoveryMeta.dedupeKey||`shell-web.request-recovery.query.${queryHash}.${errorUpdateCount}`,...dedupeWindowMs!==null?{dedupeWindowMs}:{}});const presentationId=normalizeText$1(result?.presentationId||reported?.presentationId);const presenterId=normalizeText$1(result?.decision?.presenterId||reported?.presenterId);if(reported?.presentationId&&reported.presentationId!==presentationId)dismissReportedQueryRecovery(queryHash);reportedErrorUpdateByQueryHash.set(queryHash,{reportKey,presentationId,presenterId})}try{for(const query of queryCache.getAll())inspectQuery(query)}catch(error){logger.warn({error:errorMessage(error)||`unknown error`},`Shell request recovery could not inspect existing queries.`)}const unsubscribe=queryCache.subscribe(event=>{try{inspectQuery(event.query)}catch(error){logger.warn({error:errorMessage(error)||`unknown error`},`Shell request recovery query observer failed.`)}});return Object.freeze({dispose(){dismissReportedQueryRecoveries();unsubscribe()}})}function createShellRequestRecoveryRuntime({queryClient,errorRuntime,logger}){let installedQueryObserver=null;let reloadAttempt=0;async function reload({label=t$7(`jskit.shell.recovery.appLabel`),message=appReloadFailureMessage()}={}){const reloaded=await guardedReloadApp({label,message});if(!reloaded){reloadAttempt+=1;report(new Error(`Network request failed.`),{label,message,reload:true,force:true,source:`shell-web.request-recovery.reload`,dedupeKey:`shell-web.request-recovery.reload.${reloadAttempt}`})}return reloaded}function retryAction(options,retry){return{label:normalizeText$1(text(options.actionLabel),{fallback:t$7(`jskit.shell.actions.retry`)}),dismissOnRun:true,async handler(){try{return await retry()}catch(retryError){if(isRecoverableRequestError(retryError))return report(retryError,options);throw retryError}}}}function reloadAction(options){return{label:normalizeText$1(text(options.actionLabel),{fallback:t$7(`jskit.shell.actions.reload`)}),dismissOnRun:true,handler(){return reload({label:options.label,message:options.reloadFailureMessage||appReloadFailureMessage()})}}}function dismiss(presentationId=``,options={}){return errorRuntime.dismiss(presentationId,options)}function report(error=null,options={}){if(!isRecoverableRequestError(error)&&options.force!==true)return null;const source=normalizeText$1(options.source,{fallback:`shell-web.request-recovery`});const action=options.retry?retryAction(options,options.retry):options.reload===true?reloadAction(options):null;try{return errorRuntime.report({source,message:requestRecoveryMessage(error,options),cause:error||null,intent:`app-recoverable`,severity:normalizeText$1(options.severity,{fallback:options.stale?`warning`:`error`}),dedupeKey:normalizeText$1(options.dedupeKey),dedupeWindowMs:Number.isFinite(Number(options.dedupeWindowMs))?Math.max(0,Number(options.dedupeWindowMs)):2e3,action})}catch(reportError){logger.error({source,error:errorMessage(reportError)||`unknown error`},`Shell request recovery could not report through the shell error runtime.`);return null}}function install(){if(installedQueryObserver)return installedQueryObserver;installedQueryObserver=installRecoverableQueryObserver({queryClient,runtime:api,logger});return installedQueryObserver}function dispose(){if(installedQueryObserver){installedQueryObserver.dispose();installedQueryObserver=null}}const api=Object.freeze({dismiss,dispose,install,isRecoverableRequestError,reload,report});return api}var{t:t$6}=useJskitText();function createShellAsyncModuleRecoveryRuntime({router,errorRuntime,logger}){const state=createAsyncModuleRecoveryState();let installedRecovery=null;function report(nextState=state){try{return errorRuntime.report({source:`shell-web.async-module-recovery`,message:String(nextState.message||t$6(`jskit.shell.recovery.moduleFailed`)),...nextState.message&&nextState.messageCode?{messageCode:nextState.messageCode,messageParams:nextState.messageParams}:{},cause:nextState.error||null,intent:`app-recoverable`,severity:`warning`,dedupeKey:`shell-web.async-module-recovery.${Number(nextState.attempt||0)}`,action:{label:t$6(`jskit.shell.actions.reload`),dismissOnRun:true,handler(){return reload()}}})}catch(error){logger.error({label:String(nextState.label||``),error:String(error?.message||error||`unknown error`)},`Async module recovery could not report through the shell error runtime.`);return null}}async function reload(){const reloaded=await guardedReloadApp({state,label:t$6(`jskit.shell.recovery.appLabel`),message:appReloadFailureMessage()});if(!reloaded)report(state);return reloaded}function notify(error=null,{label=t$6(`jskit.shell.recovery.appModuleLabel`),message=``,stale=isDynamicImportError(error)}={}){notifyAsyncModuleLoadError(state,error,{label,message,retry:state.retry,stale});return report(state)}function install(){if(installedRecovery)return installedRecovery;installedRecovery=installAsyncModuleRecoveryHandlers({state,label:t$6(`jskit.shell.recovery.appModuleLabel`),router,onNotify:report});return installedRecovery}function dispose(){if(installedRecovery){installedRecovery.dispose();installedRecovery=null}}return Object.freeze({dispose,install,notify,reload,report,state})}var CLIENT_BUILD_META_NAME=`jskit-client-build`;var CLIENT_BUILD_META_PATTERN=new RegExp(`<meta name="${CLIENT_BUILD_META_NAME}" content="([0-9a-f]+)"`,`u`);function pageClientBuildId(documentObject=globalThis.document){const meta=documentObject?.querySelector(`meta[name="${CLIENT_BUILD_META_NAME}"]`);return String(meta?.getAttribute(`content`)||``).trim()}var{t:t$5}=useJskitText();function stopNothing(){}function createShellClientUpdateRuntime({errorRuntime,reload,pageBuildId=pageClientBuildId(),appName=normalizeText$1(pageTitle())}){let offer=null;let stopWatching=stopNothing;function withdraw(){if(offer?.presentationId)errorRuntime.dismiss(offer.presentationId);offer=null}function offerReload(servedBuildId){const[messageKey,messageParams]=appName?[`jskit.shell.recovery.appUpdated`,{app:appName}]:[`jskit.shell.recovery.thisAppUpdated`,{}];const result=errorRuntime.report({source:`shell-web.client-update`,message:t$5(messageKey,messageParams),messageCode:messageKey.slice(6),messageParams,intent:`app-recoverable`,severity:`info`,action:{label:t$5(`jskit.shell.actions.reload`),handler(){return reload()}}});offer={buildId:servedBuildId,presentationId:normalizeText$1(result.presentationId)}}function check(servedBuildId=``){const served=normalizeText$1(servedBuildId);if(!pageBuildId||!served||served===offer?.buildId)return;withdraw();if(served!==pageBuildId)offerReload(served)}function watch(realtime){dispose();if(realtime)stopWatching=realtime.onServedClientBuild(check)}function dispose(){stopWatching();stopWatching=stopNothing}return Object.freeze({check,dispose,watch})}var APP_ENVIRONMENTS=Object.freeze([`development`,`test`,`staging`,`production`]);var DEPLOYED_ENVIRONMENTS=Object.freeze([`staging`,`production`]);var APP_ENVIRONMENT_META_NAME=`jskit-app-environment`;var APP_ENVIRONMENT_META_PATTERN=new RegExp(`<meta name="${APP_ENVIRONMENT_META_NAME}" content="[a-z]*">`,`u`);function pageAppEnvironment(documentObject=globalThis.document){const meta=documentObject?.querySelector(`meta[name="${APP_ENVIRONMENT_META_NAME}"]`);const content=String(meta?.getAttribute(`content`)||``).trim();return APP_ENVIRONMENTS.includes(content)?content:``}var{t:t$4}=useJskitText();var APP_ENVIRONMENT_BANNER_ID=`jskit-app-environment-banner`;var BANNERED_ENVIRONMENTS=Object.freeze([`development`,`test`,`staging`]);var BANNER_TEXT_PREFIX=`jskit.shell.appEnvironment.`;var APP_ENVIRONMENT_BANNER_STYLE=Object.freeze({position:`fixed`,top:`env(safe-area-inset-top, 0px)`,left:`50%`,transform:`translateX(-50%)`,zIndex:`2147483000`,pointerEvents:`none`,userSelect:`none`,padding:`2px 12px 3px`,borderRadius:`0 0 8px 8px`,background:`#ffb300`,color:`#1f1300`,font:`600 12px/16px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`,letterSpacing:`0.02em`,whiteSpace:`nowrap`,boxShadow:`0 1px 3px rgba(0, 0, 0, 0.3)`});function removeNothing(){}function installAppEnvironmentBanner({documentObject=pageDocument(),environment=pageAppEnvironment(documentObject)}={}){if(!BANNERED_ENVIRONMENTS.includes(environment)||!documentObject?.body||documentObject.getElementById(`jskit-app-environment-banner`))return removeNothing;const banner=documentObject.createElement(`div`);banner.id=APP_ENVIRONMENT_BANNER_ID;banner.setAttribute(`data-testid`,APP_ENVIRONMENT_BANNER_ID);banner.setAttribute(`role`,`note`);banner.setAttribute(`aria-description`,t$4(`${BANNER_TEXT_PREFIX}${environment}Description`));banner.textContent=t$4(`${BANNER_TEXT_PREFIX}${environment}`);Object.assign(banner.style,APP_ENVIRONMENT_BANNER_STYLE);documentObject.body.append(banner);return()=>banner.remove()}function createAppEnvironmentBannerRuntime(options){let remove=removeNothing;function install(){remove();remove=installAppEnvironmentBanner(options)}function dispose(){remove();remove=removeNothing}return Object.freeze({install,dispose})}var SHELL_REQUEST_RECOVERY_RUNTIME_KEY=`jskit.shell-web.runtime.web-request-recovery.client`;var NO_SHELL_REQUEST_RECOVERY_RUNTIME=Object.freeze({dismiss(){return 0},dispose(){},install(){return Object.freeze({dispose(){}})},isRecoverableRequestError,async reload(){return false},report(){return null}});function createStoreBackedPresenter({id,channel,store}){const normalizedId=normalizeText(id);const normalizedChannel=normalizeText(channel).toLowerCase();if(!normalizedId)throw new Error(`createStoreBackedPresenter requires id.`);if(!normalizedChannel)throw new Error(`createStoreBackedPresenter("${normalizedId}") requires channel.`);function supports(requestedChannel=``){return String(requestedChannel||``).trim().toLowerCase()===normalizedChannel}function present(payload={}){return store.present(normalizedChannel,{...payload,presenterId:normalizedId})}function dismiss(presentationId=``){return store.dismiss(normalizedChannel,String(presentationId||``))}return Object.freeze({id:normalizedId,supports,present,dismiss})}function createMaterialSnackbarPresenter({store}){return createStoreBackedPresenter({id:`material.snackbar`,channel:`snackbar`,store})}function createMaterialBannerPresenter({store}){return createStoreBackedPresenter({id:`material.banner`,channel:`banner`,store})}function createMaterialDialogPresenter({store}){return createStoreBackedPresenter({id:`material.dialog`,channel:`dialog`,store})}function createDefaultMaterialErrorPresenters({store}){return Object.freeze([createMaterialSnackbarPresenter({store}),createMaterialBannerPresenter({store}),createMaterialDialogPresenter({store})])}var{t:t$3}=useJskitText();var PRESENTATION_CHANNELS=Object.freeze([`snackbar`,`banner`,`dialog`]);var SINGLETON_CHANNELS=new Set([`banner`]);function createEmptyChannelState(){return{snackbar:[],banner:[],dialog:[]}}function freezeParams(params){return Object.freeze(params&&typeof params===`object`&&!Array.isArray(params)?{...params}:{})}function cloneEntry(entry={}){return Object.freeze({id:String(entry.id||``).trim(),channel:String(entry.channel||``).trim(),message:String(entry.message||``).trim(),code:String(entry.code||``).trim(),params:freezeParams(entry.params),messageCode:String(entry.messageCode||``).trim(),messageParams:freezeParams(entry.messageParams),severity:String(entry.severity||`error`).trim(),persist:Boolean(entry.persist),action:entry.action||null,additionalActions:entry.additionalActions,presenterId:String(entry.presenterId||``).trim(),dedupeKey:String(entry.dedupeKey||``).trim(),timestamp:Number(entry.timestamp||0)})}function createErrorPresentationStore({now=()=>Date.now()}={}){const listeners=new Set;const subscribe=createListenerSubscription(listeners);const channelState=createEmptyChannelState();let sequence=0;let revision=0;function getChannelEntries(channel){if(!PRESENTATION_CHANNELS.includes(channel))throw new Error(`Unknown presentation channel "${channel}".`);return channelState[channel]}function getState(){return Object.freeze({revision,channels:Object.freeze({snackbar:Object.freeze(channelState.snackbar.map(cloneEntry)),banner:Object.freeze(channelState.banner.map(cloneEntry)),dialog:Object.freeze(channelState.dialog.map(cloneEntry))})})}function notify(event={}){const snapshot=getState();for(const listener of listeners)try{listener(snapshot,Object.freeze({...event}))}catch{}}function present(channel,payload={}){const normalizedChannel=String(channel||``).trim();const entries=getChannelEntries(normalizedChannel);sequence+=1;const entry=Object.freeze({id:normalizeText(payload.id,`${normalizedChannel}-${sequence}`),channel:normalizedChannel,message:normalizeText(payload.message,t$3(`jskit.shell.error.requestFailed`)),code:normalizeText(payload.code),params:freezeParams(payload.params),messageCode:normalizeText(payload.messageCode),messageParams:freezeParams(payload.messageParams),severity:normalizeSeverity(payload.severity,`error`),persist:payload.persist===true,action:normalizeAction(payload.action),additionalActions:normalizeAdditionalActions(payload.additionalActions),presenterId:normalizeText(payload.presenterId),dedupeKey:normalizeText(payload.dedupeKey),timestamp:Number(now())});if(SINGLETON_CHANNELS.has(normalizedChannel)&&entries.length>0)entries.splice(0,entries.length);entries.push(entry);revision+=1;notify({type:`presented`,channel:normalizedChannel,id:entry.id});return entry.id}function dismiss(channel,presentationId=``){const normalizedChannel=String(channel||``).trim();const entries=getChannelEntries(normalizedChannel);const normalizedPresentationId=normalizeText(presentationId);if(!normalizedPresentationId){if(entries.length<1)return 0;const removed=entries.length;entries.splice(0,entries.length);revision+=1;notify({type:`dismissed`,channel:normalizedChannel,id:``,count:removed});return removed}const index=entries.findIndex(entry=>entry.id===normalizedPresentationId);if(index<0)return 0;entries.splice(index,1);revision+=1;notify({type:`dismissed`,channel:normalizedChannel,id:normalizedPresentationId,count:1});return 1}function clear(channel=``){const normalizedChannel=normalizeText(channel).toLowerCase();if(!normalizedChannel){let removedCount=0;for(const candidateChannel of PRESENTATION_CHANNELS)removedCount+=dismiss(candidateChannel,``);return removedCount}return dismiss(normalizedChannel,``)}return Object.freeze({getState,subscribe,present,dismiss,clear})}var DEFAULT_DEBUG_DEPTH=4;function describeFunction(fn){return`[Function ${fn.name||`anonymous`}]`}function describeSymbol(value){return value.toString()}function explodePayload(value,depth=4){const visited=new WeakSet;function walk(node,remaining){if(node===null||typeof node!==`object`){if(typeof node===`function`)return describeFunction(node);if(typeof node===`symbol`)return describeSymbol(node);return node}if(visited.has(node))return`[Circular]`;visited.add(node);if(remaining<=0)return Array.isArray(node)?`[Array]`:`[Object]`;if(Array.isArray(node))return node.map(entry=>walk(entry,remaining-1));if(node instanceof Date)return node.toISOString();const next={};for(const[key,child]of Object.entries(node))next[key]=walk(child,remaining-1);return next}return walk(value,depth)}function ensureArray(value){if(Array.isArray(value))return value;if(value===void 0||value===null)return[];return[value]}var PLACEMENT_DEBUG_PREFIX=`[placement-debug]`;var PLACEMENT_DEBUG_FLAG=`__JSKIT_PLACEMENT_DEBUG__`;function isPlacementDebugEnabled(){return globalThis[PLACEMENT_DEBUG_FLAG]===true}function debugLog(message,payload=null){if(!isPlacementDebugEnabled())return;if(payload===null||payload===void 0){console.log(`${PLACEMENT_DEBUG_PREFIX} ${message}`);return}const terminalPayload=explodePayload(payload,4);const rendered=JSON.stringify(terminalPayload,null,2);console.log(`${PLACEMENT_DEBUG_PREFIX} ${message}\n${rendered}`)}function normalizePlacementList(placements,context={}){const normalized=[];for(const candidate of ensureArray(placements)){const placement=normalizePlacementDefinition(candidate,{strict:false,source:`app placement`});if(!placement||placement.enabled===false)continue;normalized.push(placement)}const byId=new Map;for(const placement of normalized){if(byId.has(placement.id))throw new Error(`Duplicate placement id "${placement.id}" in ${context.source||`placement list`}.`);byId.set(placement.id,placement)}return[...byId.values()].map((placement,index)=>({placement,index})).sort((left,right)=>{const orderCompare=left.placement.order-right.placement.order;if(orderCompare!==0)return orderCompare;return left.index-right.index}).map(entry=>entry.placement)}function normalizeTopologyList(topology,context={}){if(Array.isArray(topology))return normalizeTopologyList(normalizePlacementTopologyDefinition({placements:topology},{context:context.source||`placement topology`}),context);const candidates=ensureArray(topology);const entries=[];for(const candidate of candidates){const normalized=normalizePlacementTopologyDefinition(candidate,{context:context.source||`placement topology`});entries.push(...normalized.placements)}const byKey=new Map;for(const entry of entries){const key=`${entry.id}::${entry.owner||``}`;if(byKey.has(key))throw new Error(`Duplicate semantic placement "${entry.id}"${entry.owner?` for owner "${entry.owner}"`:``} in ${context.source||`placement topology`}.`);byKey.set(key,entry)}return Object.freeze([...byKey.values()])}function matchesSurface(placementSurfaces,requestedSurface){if(requestedSurface===`*`)return true;const surfaces=Array.isArray(placementSurfaces)?placementSurfaces:[`*`];return surfaces.includes(`*`)||surfaces.includes(requestedSurface)}function resolveTopologyPlacement(topologyEntries=[],placement={},requestedSurface=`*`){const semanticTarget=String(placement.target||``).trim();const owner=String(placement.owner||``).trim();const matches=topologyEntries.filter(entry=>{if(entry.id!==semanticTarget)return false;if(owner&&entry.owner!==owner)return false;if(!owner&&entry.owner)return false;return matchesSurface(entry.surfaces,requestedSurface)});if(matches.length===1)return matches[0];return null}function resolveRenderablePlacement({placement={},topologyEntries=[],requestedSurface=`*`,requestedTarget=``,requestedLayoutClass=`compact`}={}){if(placement.targetType===`concrete`){if(placement.target!==requestedTarget)return null;return placement}const topologyPlacement=resolveTopologyPlacement(topologyEntries,placement,requestedSurface);if(!topologyPlacement)return null;const variant=topologyPlacement.variants?.[requestedLayoutClass]||null;if(!variant||variant.outlet!==requestedTarget)return null;const componentToken=String(placement.componentToken||variant.renderers?.[placement.kind]||``).trim();if(!componentToken)return null;return Object.freeze({...placement,target:requestedTarget,semanticTarget:placement.target,topologyOwner:topologyPlacement.owner||``,layoutClass:requestedLayoutClass,componentToken})}function resolveContextContributors(contributors,baseContext={},logger){let merged={};for(const contributor of ensureArray(contributors))try{const resolved=typeof contributor===`function`?contributor(Object.freeze({...baseContext})):contributor;if(isRecord(resolved))merged={...merged,...resolved}}catch(error){logger.warn({contributor,error:String(error?.message||error||`unknown error`)},`Failed to evaluate web placement context contributor.`)}return merged}function resolvePlacementComponent(components,placement,logger,missingTokens,invalidComponentTokens,failedTokens){const componentToken=String(placement.componentToken||``).trim();if(!componentToken)return null;if(invalidComponentTokens.has(componentToken)||failedTokens.has(componentToken))return null;if(!components.has(componentToken)){if(!missingTokens.has(componentToken)){missingTokens.add(componentToken);logger.warn({placementId:placement.id,componentToken},`Skipping placement because component token is not bound.`)}return null}let component=null;try{component=components.get(componentToken)}catch(error){if(!failedTokens.has(componentToken)){failedTokens.add(componentToken);logger.error({placementId:placement.id,componentToken,error:String(error?.message||error||`unknown error`)},`Skipping placement because component token resolution threw.`)}return null}if(!isRenderableComponent(component)){if(!invalidComponentTokens.has(componentToken)){invalidComponentTokens.add(componentToken);logger.warn({placementId:placement.id,componentToken},`Skipping placement because component token did not resolve to a Vue component.`)}return null}return component}function shouldIncludePlacement(placement,placementContext,logger){try{return placement.when(Object.freeze({...placementContext}))===true}catch(error){logger.warn({placementId:placement.id,error:String(error?.message||error||`unknown error`)},`Placement when() predicate failed; placement was skipped.`);return false}}function createWebPlacementRuntime({components,contextContributors=[],logger}){const missingTokens=new Set;const invalidComponentTokens=new Set;const failedTokens=new Set;const listeners=new Set;const subscribe=createListenerSubscription(listeners);let placementDefinitions=Object.freeze([]);let placementTopology=Object.freeze([]);let sharedContext=Object.freeze({});let revision=0;function notify(event={}){revision+=1;debugLog(`notify`,{revision,event});for(const listener of listeners)try{listener(Object.freeze({revision,...event}))}catch(error){logger.warn({error:String(error?.message||error||`unknown error`)},`Web placement runtime listener threw during notification.`)}}function replacePlacements(entries=[],{source=`app placement registry`}={}){missingTokens.clear();invalidComponentTokens.clear();failedTokens.clear();placementDefinitions=Object.freeze(normalizePlacementList(entries,{source}));debugLog(`replacePlacements`,{source,count:placementDefinitions.length,ids:placementDefinitions.map(entry=>entry.id)});notify({type:`placements.replaced`,source})}function replacePlacementTopology(topology=[],{source=`app placement topology`}={}){missingTokens.clear();invalidComponentTokens.clear();failedTokens.clear();placementTopology=normalizeTopologyList(topology,{source});debugLog(`replacePlacementTopology`,{source,count:placementTopology.length,ids:placementTopology.map(entry=>entry.owner?`${entry.id}#${entry.owner}`:entry.id)});notify({type:`placement-topology.replaced`,source})}function getContext(){return sharedContext}function setContext(value={},{replace=false,source=`placement-context`}={}){const next=isRecord(value)?{...value}:{};let nextContext=next;if(!replace)nextContext={...sharedContext,...next};sharedContext=Object.freeze(nextContext);debugLog(`setContext`,{replace,source,keys:Object.keys(sharedContext)});notify({type:`context.updated`,source});return sharedContext}function getRevision(){return revision}function getPlacements({surface=`*`,target=``,layoutClass=``,context={}}={}){const normalizedTarget=normalizePlacementTarget(target,{strict:false});if(!normalizedTarget)return Object.freeze([]);const normalizedSurface=normalizeSurface(surface);const normalizedLayoutClass=normalizePlacementLayoutClass(layoutClass)||normalizePlacementLayoutClass(sharedContext.layoutClass)||`compact`;const baseContext=isRecord(context)?{...context}:{};const contextFromRuntime=sharedContext;const placementContext={...resolveContextContributors(contextContributors,{surface:normalizedSurface,target:normalizedTarget,layoutClass:normalizedLayoutClass,context:{...contextFromRuntime,...baseContext}},logger),...contextFromRuntime,...baseContext,surface:normalizedSurface,target:normalizedTarget,layoutClass:normalizedLayoutClass};debugLog(`getPlacements:start`,{surface:normalizedSurface,target:normalizedTarget,layoutClass:normalizedLayoutClass,contextKeys:Object.keys(baseContext),sharedContextKeys:Object.keys(contextFromRuntime),placementCount:placementDefinitions.length,topologyCount:placementTopology.length});const matches=[];for(const placement of placementDefinitions){const renderablePlacement=resolveRenderablePlacement({placement,topologyEntries:placementTopology,requestedSurface:normalizedSurface,requestedTarget:normalizedTarget,requestedLayoutClass:normalizedLayoutClass});if(!renderablePlacement)continue;const placementSurfaces=renderablePlacement.surfaces;if(!matchesSurface(placementSurfaces,normalizedSurface)){debugLog(`getPlacements:skip-surfaces`,{placementId:renderablePlacement.id,placementSurfaces,requestedSurface:normalizedSurface});continue}if(!shouldIncludePlacement(renderablePlacement,placementContext,logger)){debugLog(`getPlacements:skip-when`,{placementId:renderablePlacement.id});continue}const component=resolvePlacementComponent(components,renderablePlacement,logger,missingTokens,invalidComponentTokens,failedTokens);if(!component){debugLog(`getPlacements:skip-component`,{placementId:renderablePlacement.id,componentToken:renderablePlacement.componentToken});continue}debugLog(`getPlacements:include`,{placementId:renderablePlacement.id,componentToken:renderablePlacement.componentToken,placementSurfaces,order:renderablePlacement.order});matches.push(Object.freeze({...renderablePlacement,component}))}debugLog(`getPlacements:done`,{surface:normalizedSurface,target:normalizedTarget,layoutClass:normalizedLayoutClass,resultIds:matches.map(entry=>entry.id)});return Object.freeze(matches)}return Object.freeze({replacePlacements,replacePlacementTopology,getPlacements,getContext,setContext,subscribe,getRevision})}var{t:t$2}=useJskitText();function buildBootstrapUrl({path=BOOTSTRAP_PATH,query={}}={}){const normalizedPath=String(path||BOOTSTRAP_PATH).trim()||BOOTSTRAP_PATH;const params=new URLSearchParams;for(const[key,value]of Object.entries(normalizeObject(query))){const normalizedKey=String(key||``).trim();const normalizedValue=String(value||``).trim();if(!normalizedKey||!normalizedValue)continue;params.set(normalizedKey,normalizedValue)}const queryString=params.toString();return queryString?`${normalizedPath}?${queryString}`:normalizedPath}function normalizeBootstrapResponseError(response,url){const error=new Error(`Bootstrap payload request failed with status ${response.status}.`);error.statusCode=Number(response.status||0);error.url=url;return error}function createShellBootstrapRuntime({handlers,placementRuntime,requestRecoveryRuntime,router,logger,fetchImplementation=globalThis.fetch,bootstrapPath=BOOTSTRAP_PATH}){let initialized=false;let runningRefresh=null;let pendingRefresh=null;async function resolveBootstrapRequest(reason=`manual`){const payloadHandlers=handlers.list();let request={path:bootstrapPath,query:{},meta:{}};for(const handler of payloadHandlers){const contribution=normalizeObject(await handler.resolveBootstrapRequest({router,placementRuntime,reason,request:Object.freeze({path:request.path,query:Object.freeze({...request.query}),meta:Object.freeze({...request.meta})})}));request={path:String(contribution.path||request.path||bootstrapPath).trim()||bootstrapPath,query:{...request.query,...normalizeObject(contribution.query)},meta:{...request.meta,...normalizeObject(contribution.meta)}}}return Object.freeze({path:request.path,query:Object.freeze({...request.query}),meta:Object.freeze({...request.meta})})}async function applyBootstrapPayload(payload,reason=`manual`,request=Object.freeze({})){const payloadHandlers=handlers.list();const source=`shell-web.bootstrap.${String(reason||`manual`).trim()||`manual`}`;for(const handler of payloadHandlers)await handler.applyBootstrapPayload({router,placementRuntime,payload,request,reason,source});return payload}async function applyBootstrapError(error,reason=`manual`,request=Object.freeze({})){const payloadHandlers=handlers.list();const source=`shell-web.bootstrap.${String(reason||`manual`).trim()||`manual`}`;for(const handler of payloadHandlers)await handler.handleBootstrapError({router,placementRuntime,error,request,reason,source})}async function performRefresh(reason=`manual`){let request=Object.freeze({path:bootstrapPath,query:Object.freeze({}),meta:Object.freeze({})});try{request=await resolveBootstrapRequest(reason);const url=buildBootstrapUrl(request);const response=await fetchImplementation(url,{method:`GET`,credentials:`include`,headers:{accept:`application/json`}});if(!response.ok)throw normalizeBootstrapResponseError(response,url);return await applyBootstrapPayload(await response.json(),reason,request)}catch(error){await applyBootstrapError(error,reason,request);requestRecoveryRuntime.report(error,{label:t$2(`jskit.shell.recovery.appDataLabel`),retry:()=>refresh(reason),source:`shell-web.bootstrap`,dedupeKey:`shell-web.bootstrap.${String(reason||`manual`).trim()||`manual`}.request-failed`});logger.warn({reason,error:String(error?.message||error||`unknown error`)},`shell-web bootstrap refresh failed.`);return null}}function startRefresh(reason){runningRefresh=performRefresh(reason).finally(()=>{runningRefresh=null});return runningRefresh}function refresh(reason=`manual`){if(pendingRefresh)return pendingRefresh;if(!runningRefresh)return startRefresh(reason);pendingRefresh=runningRefresh.catch(()=>null).then(()=>{pendingRefresh=null;return startRefresh(reason)});return pendingRefresh}async function initialize(){if(initialized)return null;initialized=true;return refresh(`init`)}return Object.freeze({initialize,refresh})}var{t:t$1}=useJskitText();var SHELL_WEB_REFRESH_RUNTIME_KEY=`jskit.shell-web.runtime.web-refresh.client`;var NO_SHELL_WEB_REFRESH_RUNTIME=Object.freeze({async refresh(reason=`manual`){return Object.freeze({reason,bootstrapRefreshed:false,queriesRefetched:false})}});function isPullRefreshQuery(query){const meta=isRecord(query.meta)?query.meta:{};if(meta.jskitRefresh===`pull`)return true;if(meta.jskitRefresh===false)return false;return(isRecord(meta.jskit)?meta.jskit:{}).refreshOnPull!==false}function createShellRefreshRuntime({bootstrapRuntime,queryClient,errorRuntime,logger}){let refreshQueue=Promise.resolve(null);async function refreshBootstrap(reason){await bootstrapRuntime.refresh(reason);return true}async function refetchPullQueries(){await queryClient.refetchQueries({type:`active`,predicate:isPullRefreshQuery},{throwOnError:false});return true}function reportRefreshFailure(error){logger.warn({error:String(error?.message||error||`unknown error`)},`Shell refresh failed.`);errorRuntime.report({source:`shell-web.refresh`,message:t$1(`jskit.shell.recovery.refreshFailed`),intent:`app-recoverable`,severity:`error`,dedupeKey:`shell-web.refresh.failed`,dedupeWindowMs:2e3,action:{label:t$1(`jskit.shell.actions.retry`),dismissOnRun:true,handler(){refresh(`retry`)}}})}async function performRefresh(reason=`manual`){const normalizedReason=String(reason||`manual`).trim()||`manual`;try{const[bootstrapRefreshed,queriesRefetched]=await Promise.all([refreshBootstrap(normalizedReason),refetchPullQueries()]);return Object.freeze({reason:normalizedReason,bootstrapRefreshed,queriesRefetched})}catch(error){reportRefreshFailure(error);return Object.freeze({reason:normalizedReason,bootstrapRefreshed:false,queriesRefetched:false,error})}}function refresh(reason=`manual`){refreshQueue=refreshQueue.catch(()=>null).then(()=>performRefresh(reason));return refreshQueue}return Object.freeze({refresh})}function contributeNoBootstrapRequest(){return{}}function ignoreBootstrapError(){}function normalizeBootstrapPayloadHandler(entry){if(typeof entry===`function`)return Object.freeze({handlerId:String(entry.name||`anonymous`),order:0,applyBootstrapPayload:entry,resolveBootstrapRequest:contributeNoBootstrapRequest,handleBootstrapError:ignoreBootstrapError});const handlerId=String(entry.handlerId||``).trim();if(!handlerId)throw new TypeError(`Bootstrap payload handlers require handlerId.`);return Object.freeze({...entry,handlerId,order:Number.isFinite(entry.order)?Number(entry.order):0,resolveBootstrapRequest:entry.resolveBootstrapRequest||contributeNoBootstrapRequest,handleBootstrapError:entry.handleBootstrapError||ignoreBootstrapError})}function createBootstrapPayloadHandlerRegistry(){const handlers=new Map;function register(entry){const handler=normalizeBootstrapPayloadHandler(entry);if(handlers.has(handler.handlerId))throw new Error(`Bootstrap payload handler "${handler.handlerId}" is duplicated.`);handlers.set(handler.handlerId,handler);return api}function list(){return Object.freeze([...handlers.values()].sort((left,right)=>{if(left.order!==right.order)return left.order-right.order;return left.handlerId.localeCompare(right.handlerId)}))}const api=Object.freeze({register,list});return api}function resolveBootstrapErrorStatusCode(error){const statusCode=Number(error?.statusCode||error?.status||0);return Number.isInteger(statusCode)&&statusCode>0?statusCode:0}var{t}=useJskitText();var APP_PLACEMENT_MODULE_SPECIFIER=`/src/placement.js`;var APP_PLACEMENT_TOPOLOGY_MODULE_SPECIFIER=`/src/placementTopology.js`;var APP_ERROR_MODULE_SPECIFIER=`/src/error.js`;async function loadAppModule({importModule,specifier,label,resolve,invalidExportMessage=``,loadFailureMessage,fallback,logger,asyncModuleRecoveryRuntime}){try{const exported=(await importModule()).default;const resolved=await resolve(exported);if(resolved!==void 0)return resolved;logger.warn({module:specifier,exportedType:typeof exported},invalidExportMessage)}catch(error){if(isMissingDynamicModule(error,specifier))return fallback;notifyDynamicImportFailure(asyncModuleRecoveryRuntime,error,{label});logger.warn({module:specifier,error:String(error?.message||error||`unknown error`)},loadFailureMessage)}return fallback}function importAppModules(){const imports={placements:__vitePreload(()=>import(`./project-shared-pageNames-BVgvVg71.js`).then(n=>n.n),[]),placementTopology:__vitePreload(()=>import(`./placementTopology-CDhUIK6L.js`),[]),errorConfig:__vitePreload(()=>import(`./error-o4gXqrKI.js`),[])};for(const pending of Object.values(imports))pending.catch(()=>{});return imports}function loadAppPlacementDefinitions(logger,asyncModuleRecoveryRuntime,pendingImport){return loadAppModule({importModule:()=>pendingImport,specifier:APP_PLACEMENT_MODULE_SPECIFIER,label:t(`jskit.shell.recovery.placementConfigLabel`),resolve(exported){const resolved=typeof exported===`function`?exported():exported;return Array.isArray(resolved)?resolved:void 0},invalidExportMessage:`App placement module default export did not resolve to an array; using empty list.`,loadFailureMessage:`Failed to load app placement module; using empty list.`,fallback:[],logger,asyncModuleRecoveryRuntime})}function loadAppPlacementTopology(logger,asyncModuleRecoveryRuntime,pendingImport){return loadAppModule({importModule:()=>pendingImport,specifier:APP_PLACEMENT_TOPOLOGY_MODULE_SPECIFIER,label:t(`jskit.shell.recovery.placementTopologyLabel`),resolve:exported=>resolveAppPlacementTopologyExport(exported,logger),loadFailureMessage:`Failed to load app placement topology module; using empty topology.`,fallback:[],logger,asyncModuleRecoveryRuntime})}function resolveAppPlacementTopologyExport(exported,logger){const resolved=typeof exported===`function`?exported():exported;if(Array.isArray(resolved))return resolved;if(resolved&&typeof resolved===`object`)return resolved;logger.warn({module:APP_PLACEMENT_TOPOLOGY_MODULE_SPECIFIER,exportedType:typeof exported},`App placement topology module default export did not resolve to an object or array; using empty topology.`);return[]}function createErrorConfigToolkit(errorRuntime){return Object.freeze({createDefaultErrorPolicy,moduleDefaultPresenterId:`material.snackbar`,presenterFactories:Object.freeze({createMaterialSnackbarPresenter,createMaterialBannerPresenter,createMaterialDialogPresenter}),runtime:errorRuntime})}function loadAppErrorConfig(logger,errorRuntime,asyncModuleRecoveryRuntime,pendingImport){return loadAppModule({importModule:()=>pendingImport,specifier:APP_ERROR_MODULE_SPECIFIER,label:t(`jskit.shell.recovery.errorConfigLabel`),async resolve(exported){const toolkit=createErrorConfigToolkit(errorRuntime);const resolved=typeof exported===`function`?await exported(toolkit):exported;return isRecord(resolved)?resolved:void 0},invalidExportMessage:`App error module default export did not resolve to an object; using shell-web defaults.`,loadFailureMessage:`Failed to load app error module; using shell-web defaults.`,fallback:{},logger,asyncModuleRecoveryRuntime})}function installVueErrorBridge(vueApp,errorRuntime,logger){const previousHandler=vueApp.config.errorHandler;vueApp.config.errorHandler=(error,instance,info)=>{try{errorRuntime.report({source:`shell-web.vue.error-handler`,message:String(error?.message||t(`jskit.shell.error.unexpectedUi`)),cause:error,intent:`blocking`,severity:`error`,details:{info:String(info||``)}})}catch(reportError){logger.error({source:`shell-web.vue.error-handler`,error:String(reportError?.message||reportError||`unknown error`)},`Shell web error runtime failed to report a Vue error.`)}if(previousHandler)previousHandler(error,instance,info)}}function installRouterErrorBridge(router,errorRuntime,logger){router.onError(error=>{if(isDynamicImportError(error))return;try{errorRuntime.report({source:`shell-web.router.on-error`,message:String(error?.message||t(`jskit.shell.error.navigationFailed`)),cause:error,intent:`app-recoverable`,severity:`error`,dedupeKey:String(error?.message||`navigation-failed`),dedupeWindowMs:2e3})}catch(reportError){logger.error({source:`shell-web.router.on-error`,error:String(reportError?.message||reportError||`unknown error`)},`Shell web error runtime failed to report a router error.`)}})}var ShellWebClientProvider=defineProvider({id:`shell.web.client`,requires:{components:`client.components`,logger:`client.logger`,pinia:`client.pinia`,queryClient:`client.query`,router:`client.router`,surfaceRuntime:`client.surface`,vueApp:`client.vue`},optional:{realtime:`client.realtime`},provides:{shell:`client.shell`},setup({components,logger,queryClient,router}){const bootstrapHandlers=createBootstrapPayloadHandlerRegistry();bootstrapHandlers.register(Object.freeze({handlerId:`shell.web.bootstrap.surface-access`,order:0,applyBootstrapPayload({payload,placementRuntime,source}){placementRuntime.setContext({surfaceAccess:normalizeObject(normalizeObject(payload).surfaceAccess)},{source})},handleBootstrapError({error,placementRuntime,source}){if(resolveBootstrapErrorStatusCode(error)!==401)return;placementRuntime.setContext({surfaceAccess:{}},{source})}}));const errorPresentationStore=createErrorPresentationStore();const errorRuntime=createErrorRuntime({presenters:createDefaultMaterialErrorPresenters({store:errorPresentationStore}),policy:createDefaultErrorPolicy(),moduleDefaultPresenterId:`material.snackbar`,logger});const placementRuntime=createWebPlacementRuntime({components,logger});const asyncModuleRecoveryRuntime=createShellAsyncModuleRecoveryRuntime({router,errorRuntime,logger});const requestRecoveryRuntime=createShellRequestRecoveryRuntime({queryClient,errorRuntime,logger});const clientUpdateRuntime=createShellClientUpdateRuntime({errorRuntime,reload:()=>asyncModuleRecoveryRuntime.reload()});const bootstrapRuntime=createShellBootstrapRuntime({handlers:bootstrapHandlers,placementRuntime,requestRecoveryRuntime,router,logger});const refreshRuntime=createShellRefreshRuntime({bootstrapRuntime,queryClient,errorRuntime,logger});const navigationRuntime=createShellNavigationRuntime({router});const appEnvironmentBannerRuntime=createAppEnvironmentBannerRuntime();return{shell:Object.freeze({asyncModuleRecovery:asyncModuleRecoveryRuntime,bootstrap:bootstrapRuntime,bootstrapHandlers,clientUpdate:clientUpdateRuntime,error:errorRuntime,errorPresentationStore,navigation:navigationRuntime,placement:placementRuntime,refresh:refreshRuntime,requestRecovery:requestRecoveryRuntime,appEnvironmentBanner:appEnvironmentBannerRuntime})}},async boot({logger,pinia,realtime,router,surfaceRuntime,vueApp},{outputs}){const{asyncModuleRecovery:asyncModuleRecoveryRuntime,bootstrap:bootstrapRuntime,clientUpdate:clientUpdateRuntime,error:errorRuntime,errorPresentationStore,navigation:navigationRuntime,placement:placementRuntime,refresh:refreshRuntime,requestRecovery:requestRecoveryRuntime}=outputs.shell;asyncModuleRecoveryRuntime.install();navigationRuntime.install();outputs.shell.appEnvironmentBanner.install();const appModules=importAppModules();const placementTopology=await loadAppPlacementTopology(logger,asyncModuleRecoveryRuntime,appModules.placementTopology);placementRuntime.replacePlacementTopology(placementTopology,{source:APP_PLACEMENT_TOPOLOGY_MODULE_SPECIFIER});const placements=await loadAppPlacementDefinitions(logger,asyncModuleRecoveryRuntime,appModules.placements);placementRuntime.replacePlacements(placements,{source:APP_PLACEMENT_MODULE_SPECIFIER});const appConfig=getClientAppConfig();const surfaceConfig=buildSurfaceConfigContext(surfaceRuntime,{tenancyMode:appConfig.tenancyMode});placementRuntime.setContext({surfaceConfig,surfaceAccessPolicies:normalizeObject(appConfig.surfaceAccessPolicies)},{source:`shell-web.surface-config`});const errorConfig=await loadAppErrorConfig(logger,errorRuntime,asyncModuleRecoveryRuntime,appModules.errorConfig);errorRuntime.configure(errorConfig);requestRecoveryRuntime.install();clientUpdateRuntime.watch(realtime);await bootstrapRuntime.initialize();useShellErrorPresentationStore(pinia).attachRuntimeStore(errorPresentationStore);vueApp.provide(SHELL_WEB_PLACEMENT_RUNTIME_KEY,placementRuntime);vueApp.provide(SHELL_WEB_REFRESH_RUNTIME_KEY,refreshRuntime);vueApp.provide(SHELL_WEB_ERROR_RUNTIME_KEY,errorRuntime);vueApp.provide(SHELL_ASYNC_MODULE_RECOVERY_RUNTIME_KEY,asyncModuleRecoveryRuntime);vueApp.provide(SHELL_REQUEST_RECOVERY_RUNTIME_KEY,requestRecoveryRuntime);vueApp.provide(SHELL_NAVIGATION_RUNTIME_KEY,navigationRuntime);installVueErrorBridge(vueApp,errorRuntime,logger);installRouterErrorBridge(router,errorRuntime,logger)},shutdown(_dependencies,{outputs}){outputs.shell.appEnvironmentBanner.dispose();outputs.shell.navigation.dispose();outputs.shell.clientUpdate.dispose();outputs.shell.requestRecovery.dispose();outputs.shell.asyncModuleRecovery.dispose()}});var SURFACE_SWITCH_ICON_BY_ID=Object.freeze({home:`$home`,app:`$dashboard`,admin:`$adminPanelSettings`,console:`$terminal`});function resolveExplicitIconValue(explicitIcon=``){return normalizeText$1(explicitIcon)}function normalizePathname(value=``){const normalizedValue=normalizeText$1(value);if(!normalizedValue)return``;if(isExternalLinkTarget(normalizedValue)){if(!(normalizedValue.startsWith(`http://`)||normalizedValue.startsWith(`https://`)))return``;let parsedPathname=``;try{parsedPathname=String(new URL(normalizedValue).pathname||``)}catch{return``}const normalizedPathname=normalizeText$1(parsedPathname);if(!normalizedPathname)return``;return normalizePathname$1(normalizedPathname).toLowerCase()}const{pathname}=splitPathQueryHash(normalizedValue);const normalizedPathname=normalizeText$1(pathname);if(!normalizedPathname)return``;return normalizePathname$1(normalizedPathname).toLowerCase()}function resolveSurfaceSwitchIdFromLabel(label=``){const normalizedLabel=normalizeText$1(label).toLowerCase();if(!normalizedLabel.startsWith(`go to `))return``;return normalizeText$1(normalizedLabel.slice(6))}function resolveSurfaceSwitchIcon(surfaceId=``,explicitIcon=``){const resolvedExplicitIcon=resolveExplicitIconValue(explicitIcon);if(resolvedExplicitIcon)return resolvedExplicitIcon;const normalizedSurfaceId=normalizeText$1(surfaceId).toLowerCase();return SURFACE_SWITCH_ICON_BY_ID[normalizedSurfaceId]||`$arrowCircleRight`}function resolveMenuLinkIcon({icon=``,label=``,to=``}={}){const resolvedExplicitIcon=resolveExplicitIconValue(icon);if(resolvedExplicitIcon)return resolvedExplicitIcon;const normalizedLabel=normalizeText$1(label).toLowerCase();const normalizedPathname=normalizePathname(to);if(!normalizedLabel&&!normalizedPathname)return``;const surfaceSwitchSurfaceId=resolveSurfaceSwitchIdFromLabel(normalizedLabel);if(surfaceSwitchSurfaceId)return resolveSurfaceSwitchIcon(surfaceSwitchSurfaceId);if(normalizedLabel.includes(`sign in`)||normalizedPathname.includes(`/auth/login`))return`$login`;if(normalizedLabel.includes(`sign out`)||normalizedPathname.includes(`/auth/signout`))return`$logout`;if(normalizedLabel.includes(`account`)||normalizedPathname.includes(`/account`)){if(normalizedLabel.includes(`settings`)||normalizedPathname.includes(`/settings`)||normalizedPathname===`/account`)return`$manageAccounts`;return`$accountCircle`}if(normalizedLabel.includes(`members`)||normalizedLabel.includes(`team`)||normalizedPathname.includes(`/members`))return`$group`;if(normalizedLabel.includes(`assistant`)||normalizedPathname.includes(`/assistant`))return`$smartToy`;if(normalizedLabel.includes(`console`)||normalizedPathname.startsWith(`/console`))return`$terminal`;if(normalizedLabel.includes(`admin`)||normalizedPathname.includes(`/admin`))return`$adminPanelSettings`;if(normalizedLabel.includes(`settings`)||normalizedPathname.includes(`/settings`))return`$settings`;if(normalizedLabel.includes(`home`)||normalizedPathname===`/`)return`$home`;if(normalizedLabel.includes(`workspace`)||normalizedLabel.includes(`dashboard`)||normalizedPathname.includes(`/w/`))return`$dashboard`;if(normalizedPathname){if(normalizedPathname.split(`/`).filter(Boolean).length===1)return`$folder`}if(normalizedLabel.includes(`list`))return`$assignment`;return`$viewList`}function resolveMenuLinkSurfaceId(surface=``,fallbackSurfaceId=``){const explicitSurface=normalizeText$1(surface).toLowerCase();if(explicitSurface&&explicitSurface!==`*`)return explicitSurface;return normalizeText$1(fallbackSurfaceId).toLowerCase()}function interpolateBracketParams(pathTemplate=``,params={}){const source=String(pathTemplate||``).trim();if(!source)return``;return source.replace(/\[([^\]]+)\]/g,(_match,rawKey)=>{const key=String(rawKey||``).trim();if(!key)return``;const value=params[key];return value==null?`[${key}]`:encodeURIComponent(String(value))})}function isRelativeMenuLinkTarget(target=``){const normalizedTarget=normalizeText$1(target);return normalizedTarget.startsWith(`./`)||normalizedTarget.startsWith(`../`)}function surfaceRequiresWorkspaceFromPlacementContext(contextValue=null,surfaceId=``){return Boolean(resolveSurfaceDefinitionFromPlacementContext(contextValue,surfaceId)?.requiresWorkspace)}function resolveMenuLinkTarget({to=``,surface=``,currentSurfaceId=``,currentPathname=``,placementContext=null,scopedSuffix=`/`,unscopedSuffix=`/`,routeParams={}}={}){const explicitTarget=normalizeText$1(to);if(explicitTarget&&!isRelativeMenuLinkTarget(explicitTarget))return explicitTarget;const params={...resolveSurfaceRouteParamsFromPlacementPathname(placementContext,currentSurfaceId,currentPathname),...routeParams};const targetSurfaceId=resolveMenuLinkSurfaceId(surface,currentSurfaceId);const scopedRouteRequired=surfaceRequiresWorkspaceFromPlacementContext(placementContext,targetSurfaceId);const interpolatedSuffix=interpolateBracketParams(normalizeText$1(scopedRouteRequired?scopedSuffix:unscopedSuffix)||`/`,params);if(!targetSurfaceId||!interpolatedSuffix||interpolatedSuffix.includes(`[`))return``;return normalizeText$1(resolveShellLinkPath({context:placementContext,surface:targetSurfaceId,relativePath:interpolatedSuffix,params,strictParams:true}))}function resolveMenuLinkHref(placementContext=null,target=``){const path=String(target||``).trim();if(!path)return{href:``,sameOrigin:true};const navigationTarget=resolveSurfaceNavigationTargetFromPlacementContext(placementContext,{path});return{href:navigationTarget.href,sameOrigin:navigationTarget.sameOrigin}}function activateShellNavigationLinkOnSpace(event){if(event.key!==` `)return;event.preventDefault();event.stopPropagation();event.currentTarget.click()}var _hoisted_1$4={class:`shell-menu-link-item__indicator`};var _hoisted_2$1={class:`shell-menu-link-item__rail-label`};var _sfc_main$9=Object.assign({inheritAttrs:false},{__name:`ShellNavigationItem`,props:{label:{type:String,default:``},href:{type:String,default:``},sameOrigin:{type:Boolean,default:true},icon:{type:String,default:``},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}},setup(__props){const props=__props;const presentation=inject$1(SHELL_NAVIGATION_PRESENTATION_KEY,NO_SHELL_NAVIGATION_PRESENTATION);const iconOptions=inject$1(VUETIFY_ICONS_KEY,NO_VUETIFY_ICONS);const link=useLink$1({to:computed(()=>props.sameOrigin&&props.href||`/`)});const active=computed(()=>props.sameOrigin&&Boolean(props.exact?link.isExactActive.value:link.isActive.value));const displayIcon=computed(()=>active.value?filledIconAlias(props.icon,iconOptions.aliases):props.icon);const rail=computed(()=>presentation.value===`rail`);const list=inject$1(VUETIFY_LIST_KEY,null);const listItem=computed(()=>Boolean(list&&props.href));const Unwrapped=(_props,{slots})=>slots.default();Unwrapped.inheritAttrs=false;return(_ctx,_cache)=>{return openBlock(),createBlock(resolveDynamicComponent(listItem.value?`div`:Unwrapped),{role:listItem.value?`listitem`:void 0,class:normalizeClass(listItem.value?[`shell-navigation-item`,{"shell-navigation-item--rail":rail.value}]:void 0)},{default:withCtx(()=>[rail.value?(openBlock(),createBlock(VListItem,mergeProps({key:0,class:`shell-menu-link-item shell-menu-link-item--rail`,to:props.sameOrigin?props.href:void 0,href:props.sameOrigin?void 0:props.href,active:active.value,disabled:props.disabled,ripple:false},_ctx.$attrs,{onKeydown:withKeys(unref(activateShellNavigationLinkOnSpace),[`space`])}),{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$4,[displayIcon.value?(openBlock(),createBlock(VIcon,{key:0,icon:displayIcon.value},null,8,[`icon`])):createCommentVNode(``,true)]),createBaseVNode(`span`,_hoisted_2$1,toDisplayString(props.label),1)]),_:1},16,[`to`,`href`,`active`,`disabled`,`onKeydown`])):(openBlock(),createBlock(VListItem,mergeProps({key:1,class:`shell-menu-link-item`,title:props.label,to:props.sameOrigin?props.href:void 0,href:props.sameOrigin?void 0:props.href,"prepend-icon":displayIcon.value||void 0,active:active.value,disabled:props.disabled},_ctx.$attrs,{onKeydown:withKeys(unref(activateShellNavigationLinkOnSpace),[`space`])}),null,16,[`title`,`to`,`href`,`prepend-icon`,`active`,`disabled`,`onKeydown`]))]),_:1},8,[`role`,`class`])}}});var ShellNavigationItem_default=_plugin_vue_export_helper_default(_sfc_main$9,[[`__scopeId`,`data-v-e0567b0d`]]);var _sfc_main$8={__name:`ShellMenuLinkItem`,props:{label:{type:[String,Object],default:``},to:{type:String,default:``},icon:{type:String,default:``},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}},setup(__props){const props=__props;const{context:placementContext}=useWebPlacementContext();const{text}=useJskitText();const resolvedLabel=computed(()=>text(props.label));const resolvedTarget=computed(()=>resolveMenuLinkHref(placementContext.value,props.to));const resolvedIcon=computed(()=>resolveMenuLinkIcon({icon:props.icon,label:text(props.label,{locale:`en`}),to:resolvedTarget.value.href||props.to}));return(_ctx,_cache)=>{return resolvedTarget.value.href?(openBlock(),createBlock(ShellNavigationItem_default,{key:0,label:resolvedLabel.value,href:resolvedTarget.value.href,"same-origin":resolvedTarget.value.sameOrigin,icon:resolvedIcon.value,disabled:props.disabled,exact:props.exact},null,8,[`label`,`href`,`same-origin`,`icon`,`disabled`,`exact`])):createCommentVNode(``,true)}}};var _sfc_main$7={__name:`MenuLinkItem`,props:{label:{type:String,default:``},to:{type:String,default:``},icon:{type:String,default:``},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}},setup(__props){const props=__props;return(_ctx,_cache)=>{return openBlock(),createBlock(unref(_sfc_main$8),normalizeProps(guardReactiveProps(props)),null,16)}}};var MenuLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$7,[[`__scopeId`,`data-v-df570124`]]);var shellNavigationLinkProps=Object.freeze({label:{type:[String,Object],default:``},to:{type:String,default:``},icon:{type:String,default:``},surface:{type:String,default:``},scopedSuffix:{type:String,default:`/`},unscopedSuffix:{type:String,default:`/`},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}});function useShellNavigationLink(props){const route=useRoute$1();const{context:placementContext}=useWebPlacementContext();const{text}=useJskitText();const resolvedLabel=computed(()=>text(props.label));const resolvedTo=computed(()=>{const currentSurfaceId=resolveSurfaceIdFromPlacementPathname(placementContext.value,route.path);return resolveMenuLinkTarget({to:props.to,surface:props.surface,currentSurfaceId,currentPathname:route.path,placementContext:placementContext.value,scopedSuffix:props.scopedSuffix,unscopedSuffix:props.unscopedSuffix,routeParams:route.params})});const resolvedTarget=computed(()=>resolveMenuLinkHref(placementContext.value,resolvedTo.value));return{resolvedLabel,resolvedTarget,resolvedIcon:computed(()=>resolveMenuLinkIcon({icon:props.icon,label:text(props.label,{locale:`en`}),to:resolvedTarget.value.href||resolvedTo.value}))}}var _sfc_main$6={__name:`ShellSurfaceAwareMenuLinkItem`,props:shellNavigationLinkProps,setup(__props){const props=__props;const{resolvedLabel,resolvedTarget,resolvedIcon}=useShellNavigationLink(props);return(_ctx,_cache)=>{return unref(resolvedTarget).href?(openBlock(),createBlock(ShellNavigationItem_default,{key:0,label:unref(resolvedLabel),href:unref(resolvedTarget).href,"same-origin":unref(resolvedTarget).sameOrigin,icon:unref(resolvedIcon),disabled:props.disabled,exact:props.exact},null,8,[`label`,`href`,`same-origin`,`icon`,`disabled`,`exact`])):createCommentVNode(``,true)}}};var _hoisted_1$3=[`data-vibe64-guide`];var _sfc_main$5={__name:`SurfaceAwareMenuLinkItem`,props:{label:{type:String,default:``},to:{type:String,default:``},icon:{type:String,default:``},surface:{type:String,default:``},scopedSuffix:{type:String,default:`/`},unscopedSuffix:{type:String,default:`/`},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false},guideId:{type:String,default:``}},setup(__props){const props=__props;const linkProps=computed(()=>{const{guideId,...value}=props;return value});return(_ctx,_cache)=>{return __props.guideId?(openBlock(),createElementBlock(`div`,{key:0,class:`surface-aware-menu-link-guide`,"data-vibe64-guide":__props.guideId},[createVNode(unref(_sfc_main$6),normalizeProps(guardReactiveProps(linkProps.value)),null,16)],8,_hoisted_1$3)):(openBlock(),createBlock(unref(_sfc_main$6),normalizeProps(mergeProps({key:1},linkProps.value)),null,16))}}};var SurfaceAwareMenuLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$5,[[`__scopeId`,`data-v-04066dfc`]]);var _hoisted_1$2={class:`section-tab-link-item__label`};var _sfc_main$4={__name:`ShellSectionTabLinkItem`,props:shellNavigationLinkProps,setup(__props){const props=__props;const{t}=useJskitText();const{resolvedLabel,resolvedTarget,resolvedIcon}=useShellNavigationLink(props);const link=useLink$1({to:computed(()=>resolvedTarget.value.sameOrigin&&resolvedTarget.value.href||`/`)});const active=computed(()=>resolvedTarget.value.sameOrigin&&Boolean(props.exact?link.isExactActive.value:link.isActive.value));const icon=computed(()=>props.icon?resolvedIcon.value:``);return(_ctx,_cache)=>{return unref(resolvedTarget).href?(openBlock(),createBlock(VBtn,{key:0,class:normalizeClass([`section-tab-link-item text-none`,{"section-tab-link-item--active":active.value,"section-tab-link-item--icon":Boolean(icon.value)}]),to:unref(resolvedTarget).sameOrigin?unref(resolvedTarget).href:void 0,href:unref(resolvedTarget).sameOrigin?void 0:unref(resolvedTarget).href,active:active.value,"aria-current":active.value?`page`:void 0,disabled:props.disabled,exact:props.exact,variant:`text`,rounded:`0`,"min-width":`0`},{default:withCtx(()=>[icon.value?(openBlock(),createBlock(VIcon,{key:0,icon:icon.value,class:`section-tab-link-item__icon`},null,8,[`icon`])):createCommentVNode(``,true),createBaseVNode(`span`,_hoisted_1$2,toDisplayString(unref(resolvedLabel)||unref(t)(`jskit.shell.layout.tab`)),1),_cache[0]||(_cache[0]=createBaseVNode(`span`,{class:`section-tab-link-item__indicator`,"aria-hidden":`true`},null,-1))]),_:1},8,[`class`,`to`,`href`,`active`,`aria-current`,`disabled`,`exact`])):createCommentVNode(``,true)}}};var ShellSectionTabLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$4,[[`__scopeId`,`data-v-c4cd4eaa`]]);var _hoisted_1$1={class:`tab-link-item__label`};var _sfc_main$3={__name:`ShellTabLinkItem`,props:shellNavigationLinkProps,setup(__props){const props=__props;const presentation=inject$1(SHELL_NAVIGATION_PRESENTATION_KEY,NO_SHELL_NAVIGATION_PRESENTATION);const inNavigationBar=computed(()=>presentation.value===`bar`);const{t}=useJskitText();const{resolvedLabel,resolvedTarget,resolvedIcon}=useShellNavigationLink(props);const iconOptions=inject$1(VUETIFY_ICONS_KEY,NO_VUETIFY_ICONS);const link=useLink$1({to:computed(()=>resolvedTarget.value.sameOrigin&&resolvedTarget.value.href||`/`)});const active=computed(()=>resolvedTarget.value.sameOrigin&&Boolean(props.exact?link.isExactActive.value:link.isActive.value));const displayIcon=computed(()=>active.value?filledIconAlias(resolvedIcon.value,iconOptions.aliases):resolvedIcon.value);return(_ctx,_cache)=>{return!inNavigationBar.value?(openBlock(),createBlock(ShellSectionTabLinkItem_default,normalizeProps(mergeProps({key:0},props)),null,16)):unref(resolvedTarget).href?(openBlock(),createBlock(VBtn,{key:1,class:normalizeClass([`tab-link-item`,{"tab-link-item--active":active.value}]),to:unref(resolvedTarget).sameOrigin?unref(resolvedTarget).href:void 0,href:unref(resolvedTarget).sameOrigin?void 0:unref(resolvedTarget).href,active:active.value,disabled:props.disabled,exact:props.exact,ripple:false,variant:`text`,"min-width":`0`,stacked:``},{default:withCtx(()=>[displayIcon.value?(openBlock(),createBlock(VIcon,{key:0,icon:displayIcon.value},null,8,[`icon`])):createCommentVNode(``,true),createBaseVNode(`span`,_hoisted_1$1,toDisplayString(unref(resolvedLabel)||unref(t)(`jskit.shell.layout.tab`)),1)]),_:1},8,[`class`,`to`,`href`,`active`,`disabled`,`exact`])):createCommentVNode(``,true)}}};var ShellTabLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$3,[[`__scopeId`,`data-v-62597e5b`]]);var _sfc_main$2={__name:`TabLinkItem`,props:{label:{type:String,default:``},to:{type:String,default:``},icon:{type:String,default:``},surface:{type:String,default:``},scopedSuffix:{type:String,default:`/`},unscopedSuffix:{type:String,default:`/`},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}},setup(__props){const props=__props;return(_ctx,_cache)=>{return openBlock(),createBlock(unref(ShellTabLinkItem_default),normalizeProps(guardReactiveProps(props)),null,16)}}};var TabLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-1e93431e`]]);var _sfc_main$1={__name:`TopActionLinkItem`,props:{disabled:{default:false,type:Boolean},exact:{default:false,type:Boolean},icon:{default:``,type:String},label:{default:``,type:String},returnToCurrent:{default:false,type:Boolean},to:{default:``,type:String}},setup(__props){const props=__props;const route=useRoute$1();const resolvedIcon=computed(()=>`$link`);const active=computed(()=>{const target=String(props.to||``).trim();const path=String(route.path||``).trim();if(!target||!path)return false;return props.exact?path===target:path===target||path.startsWith(`${target}/`)});const resolvedTo=computed(()=>{const target=String(props.to||``).trim();if(!target||!props.returnToCurrent||active.value)return target;return{path:target,query:{returnTo:route.fullPath||route.path||`/app`}}});return(_ctx,_cache)=>{return props.to?(openBlock(),createBlock(VBtn,{key:0,class:normalizeClass([`top-action-link-item text-none`,{"top-action-link-item--active":active.value}]),disabled:props.disabled,"prepend-icon":resolvedIcon.value||void 0,to:resolvedTo.value,variant:`tonal`,color:`primary`},{default:withCtx(()=>[createTextVNode(toDisplayString(props.label||`Open`),1)]),_:1},8,[`class`,`disabled`,`prepend-icon`,`to`])):createCommentVNode(``,true)}}};var TopActionLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-52a9b85c`]]);var VIBE64_ACTIVE_SESSION_NAV_KEY=Symbol(`vibe64.activeSessionNav`);var NO_ACTIVE_SESSION_NAV=Object.freeze({value:null});var _hoisted_1={key:0,class:`vibe64-active-session-nav-item vibe64-active-session-nav-item--heading`,"aria-label":`Active session navigation`};var _hoisted_2=[`title`];var _hoisted_3={class:`vibe64-active-session-nav-item__label`};var _sfc_main={__name:`Vibe64ActiveSessionNavItem`,props:{disabled:{default:false,type:Boolean},icon:{default:``,type:String},guideId:{default:``,type:String},label:{default:``,type:String},role:{default:``,type:String},title:{default:``,type:String},to:{default:``,type:String},toolId:{default:``,type:String}},setup(__props){const props=__props;const injectedSessionNav=inject$1(VIBE64_ACTIVE_SESSION_NAV_KEY,NO_ACTIVE_SESSION_NAV);const sessionNav=computed(()=>injectedSessionNav.value||{});const tools=computed(()=>Array.isArray(sessionNav.value.tools)?sessionNav.value.tools:[]);const tool=computed(()=>{const toolId=String(props.toolId||``).trim();return tools.value.find(candidate=>String(candidate?.id||``)===toolId)||{}});const navVisible=computed(()=>Boolean(sessionNav.value.visible!==false&&sessionNav.value.label));const headerVisible=computed(()=>Boolean(navVisible.value&&props.role===`heading`));const itemVisible=computed(()=>Boolean(navVisible.value&&props.role!==`heading`&&props.toolId));const itemLabel=computed(()=>String(tool.value.label||props.label||``));const itemIcon=computed(()=>String(tool.value.icon||props.icon||``));const itemTitle=computed(()=>String(tool.value.title||props.title||``));const itemTo=computed(()=>String(tool.value.to||props.to||``).trim());const itemDisabled=computed(()=>Boolean(props.disabled||tool.value.disabled));const itemDisabledReason=computed(()=>String(tool.value.disabledReason||itemTitle.value||``));const statusClass=computed(()=>`vibe64-active-session-nav-item__status--${String(sessionNav.value.status||`unknown`).trim()||`unknown`}`);function selectTool(){if(itemDisabled.value||!injectedSessionNav.value)return;if(itemTo.value)return;injectedSessionNav.value.selectTool(String(props.toolId||``))}return(_ctx,_cache)=>{return headerVisible.value?(openBlock(),createElementBlock(`div`,_hoisted_1,[createVNode(VDivider,{class:`vibe64-active-session-nav-item__divider`}),_cache[0]||(_cache[0]=createBaseVNode(`span`,{class:`vibe64-dashboard-nav-group-label`},`Session`,-1)),createBaseVNode(`div`,{class:`vibe64-active-session-nav-item__heading`,title:sessionNav.value.label},[createBaseVNode(`span`,{class:normalizeClass([`vibe64-active-session-nav-item__status`,statusClass.value])},null,2),createBaseVNode(`span`,_hoisted_3,toDisplayString(sessionNav.value.label),1)],8,_hoisted_2)])):itemVisible.value?(openBlock(),createBlock(VListItem,{key:1,class:`vibe64-active-session-nav-item`,active:tool.value.active,disabled:itemDisabled.value,"prepend-icon":itemIcon.value,title:itemLabel.value,"data-vibe64-guide":props.guideId||void 0,subtitle:itemDisabled.value?itemDisabledReason.value:``,to:itemTo.value||void 0,onClick:selectTool},null,8,[`active`,`disabled`,`prepend-icon`,`title`,`data-vibe64-guide`,`subtitle`,`to`])):createCommentVNode(``,true)}}};var Vibe64ActiveSessionNavItem_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-81ecbdbd`]]);function isVibe64LiveQuery(query={}){return(Array.isArray(query.queryKey)?query.queryKey:[])[0]===`vibe64`}function invalidateVibe64LiveQueries(queryClient){return queryClient.invalidateQueries({predicate:isVibe64LiveQuery,refetchType:`active`})}function attachVibe64RealtimeQueryRecovery({queryClient,realtime}){const socket=realtime.socket;const recoverQueries=()=>invalidateVibe64LiveQueries(queryClient);socket.on(`connect`,recoverQueries);return()=>socket.off(`connect`,recoverQueries)}var detachQueryRecoveryByRealtime=new WeakMap;var MainClientProvider=defineProvider({id:`local.main.client`,requires:{components:`client.components`,queryClient:`client.query`,realtime:`client.realtime`},setup({components,queryClient,realtime}){components.register(`local.main.ui.menu-link-item`,MenuLinkItem_default);components.register(`local.main.ui.surface-aware-menu-link-item`,SurfaceAwareMenuLinkItem_default);components.register(`local.main.ui.tab-link-item`,TabLinkItem_default);components.register(`local.main.ui.top-action-link-item`,TopActionLinkItem_default);components.register(`local.main.vibe64.active-session-nav-item`,Vibe64ActiveSessionNavItem_default);detachQueryRecoveryByRealtime.set(realtime,attachVibe64RealtimeQueryRecovery({queryClient,realtime}))},shutdown({realtime}){detachQueryRecoveryByRealtime.get(realtime)();detachQueryRecoveryByRealtime.delete(realtime)}});var client_exports=__exportAll({MainClientProvider:()=>MainClientProvider});var jskit$6={"connectors":{"googleCalendar":{"attendeesRequiresUp200Email":`attendees requires up to 200 email entries with optional displayName/optional.`,"cancellationNoEventBody":`Cancellation has no event body.`,"chooseAllDayDateTimed":`Choose an all-day date or a timed dateTime.`,"chooseSendUpdates":`Choose sendUpdates explicitly: all, externalOnly or none.`,"datetimeRequiresExplicitTimezoneOffset":`dateTime requires an explicit timezone offset.`,"description":`Read calendars and create, edit or cancel events.`,"eventMustObject":`event must be an object.`,"invalidAllDayDate":`Invalid all-day date.`,"invalidEventEtag":`Invalid event ETag.`,"invalidTransparency":`Invalid transparency.`,"invalidVisibility":`Invalid visibility.`,"recurrenceMustArrayRfc5545Recurrence":`recurrence must be an array of RFC5545 recurrence lines.`,"scopes":{"calendar":{"label":`Manage calendars and events`},"calendarAcls":{"label":`Manage calendar sharing permissions`},"calendarAclsReadonly":{"label":`Read calendar sharing permissions`},"calendarAddonsCurrentEventRead":{"label":`Read the event open in a Calendar add-on`},"calendarAddonsCurrentEventWrite":{"label":`Edit the event open in a Calendar add-on`},"calendarAddonsExecute":{"label":`Run a Calendar add-on`},"calendarAppCreated":{"label":`Create and manage app-created calendars`},"calendarCalendarlist":{"label":`Manage calendar subscriptions`},"calendarCalendarlistReadonly":{"label":`List calendars`},"calendarCalendars":{"label":`Manage calendar properties`},"calendarCalendarsReadonly":{"label":`Read calendar properties`},"calendarEvents":{"label":`Manage events`},"calendarEventsFreebusy":{"label":`Read availability in accessible calendars`},"calendarEventsOwned":{"label":`Manage events in calendars you own`},"calendarEventsOwnedReadonly":{"label":`Read events in calendars you own`},"calendarEventsPublicReadonly":{"label":`Read public calendar events`},"calendarEventsReadonly":{"label":`Read events`},"calendarFreebusy":{"label":`Read your availability`},"calendarReadonly":{"label":`Read all calendar data`},"calendarSettingsReadonly":{"label":`Read calendar settings`}},"startEndRequired":`start and end are required.`,"supplyStartEndSettingRecurrence":`Supply start and end when setting recurrence.`,"supplyStartEndTogetherChanging":`Supply start and end together when changing event times.`,"textTooLong":`{field} must be text of at most 16384 characters.`,"timedRecurrenceRequiresStartEnd":`Timed recurrence requires start/end timeZone.`,"useDateDatetimeOptionalTimezone":`Use date or dateTime and optional timeZone.`,"useIanaTimezone":`Use an IANA timeZone.`,"useMatchingDateTypesEnd":`Use matching date types with end after start; all-day end is exclusive.`,"useSupportedEventFields":`Use supported event fields only.`}}};var en_default$6={jskit:jskit$6};var jskit$5=JSON.parse(`{"connectors":{"ai":{"access":{"freeNoSetup":"Free · no account or key","freeWithConnection":"Free · connection required","paid":"Paid · connection required","unknown":"Pricing unknown · check provider"},"accessConnectionDenied":"Access to this AI connection was denied.","apiKeyReferenceHint":"Use an environment reference for an administrator key. For individual accounts, use a private reference your app resolves for the authenticated user. Never put a key in this file.","authenticationHint":"Your app calls the provider directly. A shared account belongs to the app administrator; individual accounts belong to each signed-in app user.","authenticationLabels":{"apiKey":"Use a provider API key","none":"Free access · no account or key"},"authorizedAccountApiKeyUnavailable":"The authorized AI account's API key is unavailable.","connectionNotConfigured":"This AI connection is not configured.","description":"Choose an app AI provider, model and whose account pays. No model is preselected.","fields":{"model":{"hint":"Choose a provider and model. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback.","label":"AI model","selectedHint":{"freeNoSetup":"{model}: Free · no account or key. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback.","freeWithConnection":"{model}: Free · connection required. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback.","paid":"{model}: Paid · connection required. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback.","unknown":"{model}: Pricing unknown · check provider. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback."}}},"individualAccountsRequireUserOwned":"Individual AI accounts require a user-owned reference, not a shared environment variable."},"airtable":{"description":"Discover bases, read and edit records, and manage tables and fields."},"algolia":{"description":"Search and maintain index records, and check indexing completion.","fields":{"applicationId":{"hint":"Copy the ID from your Algolia application's API Keys page. This ID can be public.","label":"Application ID"},"publicApiKeyRef":{"environmentCredential":{"label":"Public frontend API key"},"hint":"Optional search-only key for your frontend. Enter its reference; your app decides whether to expose its value.","label":"Public API key reference (optional)"}}},"amazonRedshift":{"description":"Inspect tables and run queries in a serverless workgroup or provisioned cluster.","didNotReturnStatementIdentifier":"Redshift did not return a statement identifier.","fields":{"clusterIdentifier":{"label":"Cluster identifier"},"database":{"label":"Database"},"databaseUser":{"hint":"Leave blank to use the database identity derived from IAM.","label":"Database user (optional)"},"deploymentType":{"items":{"provisioned":{"title":"Provisioned cluster"},"serverless":{"title":"Serverless"}},"label":"Deployment type"},"region":{"hint":"Use the warehouse's region. Availability depends on your AWS account and deployment type.","label":"AWS Region"},"workgroup":{"hint":"The serverless workgroup name, without an ARN or URL.","label":"Workgroup name"}},"returnedUnexpectedStatement":"Redshift returned an unexpected statement.","statementBelongsDifferentTarget":"This statement belongs to a different Redshift target.","statementNoFinishedResultSet":"This statement has no finished result set.","useSqlParameterNameOnce":"Use each SQL parameter name only once."},"amplitude":{"description":"Query and manage Amplitude content through an authorized assistant MCP connection.","fields":{"region":{"hint":"Choose the region containing your Amplitude account and register the client there.","items":{"eu":{"title":"European Union"},"us":{"title":"United States"}},"label":"Region"}},"scopes":{"mcpRead":{"label":"Read Amplitude content (required for verification)"},"mcpWrite":{"label":"Create and edit Amplitude content"},"offlineAccess":{"label":"Refresh access without repeating sign-in"}}},"apify":{"description":"Run Actors with explicit limits and retrieve their results.","useFrameworkNativeClientStream":"Use the framework's native Apify client to stream records larger than 8 MiB."},"apolloIo":{"description":"Find prospects, enrich selected records and manage your sales contacts, accounts and deals.","enterRecordRequiredIdentifyingFields":"Enter the record's required identifying fields or changes."},"asana":{"description":"Discover projects and create, assign and track tasks in your Asana workspace.","includeDueSettingClearingStart":"Include due_on when setting or clearing start_on.","startDateMustPrecedeProject":"The start date must precede the project due date, or be no later than the task due date."},"ashby":{"couldNotCompleteOperation":"Ashby could not complete the operation.","description":"Read hiring data, maintain candidate profiles and advance sourced applications.","supplyLeastCandidateProfileChange":"Supply at least one candidate profile change."},"atlassian":{"description":"Use Jira, Confluence and other Atlassian tools through the assistant owner's Rovo MCP connection.","scopes":{"deleteJiraAgentInterface":{"label":"Delete Jira content"},"email":{"label":"Read your email address"},"manageJiraAgentInterface":{"label":"Manage Jira"},"offlineAccess":{"label":"Refresh access without repeating sign-in"},"readAccount":{"label":"Read your account"},"readAllTwg":{"label":"Read Teamwork Graph content"},"readConfluenceAgentInterface":{"label":"Read Confluence content"},"readJiraAgentInterface":{"label":"Read Jira content"},"readMe":{"label":"Read your profile"},"readProduct":{"label":"Read {product} content"},"searchCodeAgentInterface":{"label":"Search code"},"searchConfluenceAgentInterface":{"label":"Search Confluence"},"searchJiraAgentInterface":{"label":"Search Jira"},"searchRovoAgentInterface":{"label":"Search with Rovo"},"writeAllTwg":{"label":"Write Teamwork Graph content"},"writeConfluenceAgentInterface":{"label":"Create and edit Confluence content"},"writeJiraAgentInterface":{"label":"Create and edit Jira content"},"writeProduct":{"label":"Create and edit {product} content"}}},"attention":{"description":"Read conversations and coaching results; manage call metadata, snippets, users and teams.","endTimeMustFollowStart":"End time must follow start time."},"aws":{"checkRegionResourceOperationSettings":"Check the AWS region, resource and operation settings.","credentials":{"apiKeyReferenceHint":"Use a reference such as env:AWS_SECRET_ACCESS_KEY. Credentials belong to the configured AWS account; host defaults are never used.","apiKeyReferenceLabel":"Secret access key reference"},"deniedOperationCheckIamResource":"AWS denied this operation. Check IAM, resource and database permissions.","fields":{"accessKeyIdRef":{"environmentCredential":{"label":"AWS access key ID"},"hint":"Store the access key ID in Env and enter its reference.","label":"Access key ID reference"},"region":{"label":"AWS Region"},"sessionTokenRef":{"environmentCredential":{"label":"AWS session token"},"hint":"Required with temporary STS credentials. The host must renew all three credential bindings before they expire.","label":"Session token reference (optional)"}},"provideAccessKeyIdSecret":"Provide the AWS access key ID, secret access key and any required session token bindings.","regionDoesNotMatchOperation":"The AWS region does not match the operation destination.","regions":{"afSouth1":"Cape Town ({region})","apEast1":"Hong Kong ({region})","apEast2":"Taipei ({region})","apNortheast1":"Tokyo ({region})","apNortheast2":"Seoul ({region})","apNortheast3":"Osaka ({region})","apSouth1":"Mumbai ({region})","apSouth2":"Hyderabad ({region})","apSoutheast1":"Singapore ({region})","apSoutheast2":"Sydney ({region})","apSoutheast3":"Jakarta ({region})","apSoutheast4":"Melbourne ({region})","apSoutheast5":"Malaysia ({region})","apSoutheast6":"New Zealand ({region})","apSoutheast7":"Thailand ({region})","caCentral1":"Canada Central ({region})","caWest1":"Calgary ({region})","euCentral1":"Frankfurt ({region})","euCentral2":"Zurich ({region})","euNorth1":"Stockholm ({region})","euSouth1":"Milan ({region})","euSouth2":"Spain ({region})","euWest1":"Ireland ({region})","euWest2":"London ({region})","euWest3":"Paris ({region})","ilCentral1":"Tel Aviv ({region})","meCentral1":"UAE ({region})","meSouth1":"Bahrain ({region})","mxCentral1":"Mexico Central ({region})","saEast1":"São Paulo ({region})","usEast1":"N. Virginia ({region})","usEast2":"Ohio ({region})","usWest1":"N. California ({region})","usWest2":"Oregon ({region})"},"renewCredentialBindingsConnectAgain":"Renew the AWS credential bindings and connect again.","requestFailedReturnedUnreadableResponse":"The AWS request failed or returned an unreadable response.","requestLimitReached":"The AWS request limit was reached.","resourceNotFound":"The AWS resource was not found.","sdkSelectedUnexpectedDestination":"The AWS SDK selected an unexpected destination."},"awsAthena":{"description":"Browse data catalogs and schemas; start, inspect, page through and cancel queries in a configured workgroup.","fields":{"resultLocation":{"hint":"Leave blank when the workgroup supplies its own result storage. Enforced workgroup settings take precedence.","label":"Query result location (optional)"},"workgroup":{"hint":"Defaults to primary. Query access is restricted to this workgroup.","label":"Workgroup (optional)"}},"queryBelongsDifferentWorkgroup":"This query belongs to a different workgroup.","returnedDifferentWorkgroup":"Athena returned a different workgroup.","returnedUnexpectedQuery":"Athena returned an unexpected query."},"awsS3":{"description":"List bucket objects and create short-lived download or upload URLs.","fields":{"bucket":{"label":"Bucket name"}},"permissionsHint":"These choices limit the application's operations. AWS IAM and bucket policies decide actual access; selecting a permission does not grant it in AWS.","returnedUnexpectedBucketPageSize":"S3 returned an unexpected bucket or page size.","scopes":{"read":{"label":"List and download objects from bucket"},"write":{"label":"Also upload objects via pre-signed URLs"}}},"bigquery":{"description":"Configure the query project, run queries and retrieve results.","fields":{"projectId":{"hint":"The project that runs and is billed for queries. It can differ from the project containing your datasets. The initial connection check only lists accessible projects.","label":"Google Cloud project ID"}},"scopes":{"bigquery":{"label":"Manage BigQuery data"},"bigqueryReadonly":{"label":"Read BigQuery data and metadata"},"cloudPlatform":{"label":"Manage Google Cloud resources"},"cloudPlatformReadOnly":{"label":"Read Google Cloud resources"}}},"brevo":{"chooseTemplateProvideSubjectEmail":"Choose a template or provide a subject and email content.","description":"Send email and SMS, manage contacts and campaigns, and track delivery and automation events.","smsContentOrTemplate":"Choose SMS content or a template, not both."},"calendly":{"chooseEventOwner":"Choose the user, organization or group whose events to read.","choosePositiveRangeMost31":"Choose a positive range of at most 31 days.","description":"Read meetings and invitees, check availability, create booking links and manage appointments.","scopes":{"activityLogRead":{"label":"activity log — read"},"availabilityRead":{"label":"availability — read"},"availabilityWrite":{"label":"availability — write"},"contactsRead":{"label":"contacts — read"},"contactsWrite":{"label":"contacts — write"},"dataComplianceWrite":{"label":"data compliance — write"},"eventTypesRead":{"label":"event types — read"},"eventTypesWrite":{"label":"event types — write"},"groupsRead":{"label":"groups — read"},"locationsRead":{"label":"locations — read"},"organizationsRead":{"label":"organizations — read"},"organizationsWrite":{"label":"organizations — write"},"outgoingCommunicationsRead":{"label":"outgoing communications — read"},"routingFormsRead":{"label":"routing forms — read"},"scheduledEventsRead":{"label":"scheduled events — read"},"scheduledEventsWrite":{"label":"scheduled events — write"},"schedulingLinksWrite":{"label":"scheduling links — write"},"sharesWrite":{"label":"shares — write"},"usersRead":{"label":"users — read"},"webhooksRead":{"label":"webhooks — read"},"webhooksWrite":{"label":"webhooks — write"}}},"canva":{"clientIdHint":"Serve your client metadata JSON at this HTTPS URL. Canva must approve the callback; this setup uses no client secret.","clientIdLabel":"Client metadata URL","description":"Discover and use Canva design tools through each assistant owner's account.","scopes":{"assetRead":{"label":"Read assets"},"assetWrite":{"label":"Upload and edit assets"},"brandkitRead":{"label":"Read brand kits"},"brandtemplateContentRead":{"label":"Read brand template content"},"brandtemplateContentWrite":{"label":"Create and edit brand templates"},"brandtemplateMetaRead":{"label":"Read brand template information"},"commentRead":{"label":"Read comments"},"commentWrite":{"label":"Write comments"},"designContentRead":{"label":"Read design content"},"designContentWrite":{"label":"Create and edit designs"},"designMetaRead":{"label":"Read design information"},"folderRead":{"label":"Read folders"},"folderWrite":{"label":"Create and edit folders"},"helpAnswersRead":{"label":"Read help answers"},"helpAnswersWrite":{"label":"Write help answers"},"profileRead":{"label":"Read your profile"}}},"chargebee":{"description":"Manage customers and subscriptions, read invoices and launch hosted checkout for a Chargebee site.","fields":{"siteName":{"hint":"Your Chargebee site name, without .chargebee.com. Test and live sites use different keys.","label":"Site name"}}},"clay":{"apiKeyReferenceLabel":"Public API key reference","description":"Search people and companies, run enrichment routines and query Enterprise tables with your Clay Public API key."},"clickhouse":{"apiKeyReferenceHint":"Use a reference such as env:CLICKHOUSE_PASSWORD. Leave blank only if this database user has an empty password.","apiKeyReferenceLabel":"Password reference (optional)","authenticationHint":"No credentials uses the server's default user. Choose it only for a server configured to allow that access.","authenticationLabels":{"apiKey":"Username and password","none":"No credentials"},"description":"Explore tables and run bounded, parameterized analytical reads on your ClickHouse database.","fields":{"httpUrl":{"hint":"Use the HTTPS query endpoint, including its port and any proxy path. Native TCP addresses do not work here.","label":"HTTP Interface URL"},"username":{"hint":"The database user, not your Cloud console login. Leave blank to use default.","label":"Username (optional)"}}},"confidence":{"scopes":{"email":{"label":"Read account email"},"offlineAccess":{"label":"Refresh access without repeating sign-in"},"openid":{"label":"Identify the connected Confidence account"},"profile":{"label":"Read account profile"}}},"confidenceExp":{"description":"Read Confidence experiments and results through the assistant owner's MCP connection."},"confidenceFlags":{"description":"Manage Confidence flags through the assistant owner's MCP connection."},"contentful":{"apiKeyReferenceLabel":"Content Delivery API token reference","description":"Read published entries, linked assets, content models and locales from a Contentful space.","fields":{"environmentId":{"hint":"The key must have access to this environment. Defaults to master.","label":"Environment ID"},"region":{"items":{"eu":{"title":"Europe"},"us":{"title":"United States"}},"label":"Region"},"spaceId":{"hint":"Copy the Space ID from the selected space's API keys page.","label":"Space ID"}}},"databricks":{"description":"Read workspace jobs through user consent or a service principal.","fields":{"workspaceUrl":{"hint":"Use the workspace's own address. Omit browser paths, query strings and account-console URLs.","label":"Workspace URL"}},"oauthGrantHint":"User consent needs a custom OAuth application. Service account needs a service principal's client ID and OAuth secret, without a callback.","permissionsHint":"Permissions also depend on workspace membership and resource access. The jobs fragment only reads metadata; these OAuth scopes can permit more in other clients.","returnedUnexpectedJobResponse":"Databricks returned an unexpected job response.","scopes":{"allApis":{"label":"APIs allowed by the connected account"},"jobs":{"label":"Jobs API access for the service account"},"offlineAccess":{"label":"Keep user access between visits"}}},"dbtSemanticLayer":{"apiKeyReferenceHint":"Store the dbt service token in Env. It needs Semantic Layer Only and Metadata Only permissions and a linked warehouse credential.","apiKeyReferenceLabel":"Service token reference","completedWithoutJsonResultTable":"dbt completed without a JSON result table.","couldNotCompleteRequestedOperation":"dbt could not complete the requested operation. Check the environment and service token permissions.","description":"Discover metrics and query their values in a dbt Semantic Layer environment.","fields":{"environmentId":{"hint":"The deployment environment containing your metrics. Keep the full ID as text to avoid rounding.","label":"Environment ID"},"host":{"hint":"Copy the GraphQL hostname from dbt's Semantic Layer settings. Regional, single-tenant and multi-cell dbt hosts are supported.","label":"Semantic Layer host"}},"queryFailedInspectStatusDo":"dbt query failed. Inspect its status in dbt; do not automatically submit it again.","returnedInvalidJsonResultPage":"dbt returned an invalid JSON result page.","returnedInvalidJsonTable":"dbt returned an invalid JSON table.","returnedInvalidOversizedJsonResult":"dbt returned an invalid or oversized JSON result page.","returnedUnexpectedMetadataPage":"dbt returned an unexpected metadata page.","useServiceTokenWithoutSpaces":"Use a dbt service token without spaces or control characters."},"elevenlabs":{"audioSamplesMustTotalMost":"Audio samples must total at most 16 MiB.","description":"Generate speech, discover voices/models and create instant voice clones.","didNotReturnAudio":"ElevenLabs did not return audio.","returnedEmptyAudio":"ElevenLabs returned empty audio.","useNativeStreamingAudioAbove":"Use native streaming for audio above 16 MiB."},"figma":{"description":"Discover and call Figma's remote design tools through the assistant owner's account.","scopes":{"mcpConnect":{"label":"Use Figma MCP tools"}}},"firebaseCloudMessaging":{"couldNotAuthorizeServiceAccount":"Google could not authorize the service account. Check the credential and project permissions.","description":"Send notifications to mobile and browser installations, tokens or topics.","fields":{"apiKey":{"hint":"Public API key from the Firebase web app configuration. This value is visible in your deployed app.","label":"Firebase API key"},"appId":{"hint":"Public appId from the same Firebase project and web app.","label":"Firebase App ID"},"clientMode":{"hint":"Existing mobile/browser targets need server credentials. Include web push to configure browser registration too.","items":{"server":{"title":"Server or native only"},"web":{"title":"Include web push"}},"label":"Client setup"},"projectId":{"hint":"The project receiving messages. Usually project_id in your JSON; cross-project access requires an IAM grant on this target project.","label":"Firebase project ID"},"vapidKey":{"hint":"Public key from Project settings > Cloud Messaging > Web Push certificates. Never paste the private VAPID key.","label":"Web Push VAPID key"}},"permissionsHint":"Firebase IAM controls which projects this service account can send to. Sending to an audience also requires your application's authorization.","recipientNoLongerRegisteredRemove":"This Firebase recipient is no longer registered. Remove its association and wait for client registration again.","rejectedMessageTargetDoNot":"Firebase rejected the message or target. Do not delete a registration unless the payload is known to be valid.","returnedInvalidMessageJson":"Firebase returned invalid message JSON.","returnedUnexpectedMessageReceipt":"Firebase returned an unexpected message receipt.","returnedUnexpectedTokenRedirect":"Google returned an unexpected token redirect.","scopes":{"firebaseMessagingScope":{"label":"Validate and send Firebase messages"}},"serviceAccountReferenceHint":"Store the complete service-account JSON in Env, then enter its reference. It stays on the server and is never included in the browser configuration.","serviceAccountReferenceLabel":"Service-account JSON reference","useValidServiceAccountJson":"Use a valid Firebase service-account JSON credential for the default Google API domain."},"firecrawl":{"description":"Search, map, scrape and extract web content; run bounded site crawls.","useReturnedNextPageUrl":"Use the returned next-page URL for this crawl."},"fireflies":{"description":"Read and search Fireflies meetings, speaker-attributed transcripts and summaries."},"fireworksAi":{"description":"List accounts accessible to your Fireworks API key."},"gatewayApi":{"description":"Send SMS/RCS messages and read account credit on the Global or EU platform.","fields":{"region":{"hint":"Select the platform that issued this token.","items":{"eu":{"title":"EU (gatewayapi.eu)"},"global":{"title":"Global (gatewayapi.com)"}},"label":"API domain"}}},"gatewayapi":{"invalidWebhookEvent":"Invalid GatewayAPI webhook event."},"geminiEnterprise":{"description":"Search documents in a configured Gemini Enterprise engine.","fields":{"engineId":{"hint":"The existing search app identifier in default_collection, not its display name or full resource path.","label":"Engine ID"},"location":{"hint":"Match the engine's location. The runtime uses the corresponding Google API endpoint.","items":{"eu":{"title":"European Union"},"global":{"title":"Global"},"us":{"title":"United States"}},"label":"Location"},"projectId":{"hint":"The Google Cloud project where the Gemini Enterprise app lives.","label":"GCP project ID"}},"permissionsHint":"Google IAM and source permissions apply to the connected Google account. Shared access uses that same account for every authorized caller; it does not provide each app user's own search identity.","scopes":{"geminiEnterpriseScope":{"label":"Cloud Platform (full access)"}}},"githubApi":{"description":"Read repository content and activity; create and update issues and pull requests.","scopes":{"gist":{"label":"Gists"},"notifications":{"label":"Notifications"},"offlineAccess":{"label":"Expiring tokens with refresh access"},"project":{"label":"Projects"},"publicRepo":{"label":"Public repositories"},"readOrg":{"label":"Read organizations"},"readUser":{"label":"Read user profile"},"repo":{"label":"Repositories"},"userEmail":{"label":"Email"},"workflow":{"label":"Workflows"}}},"gitlabApi":{"description":"Read project content and activity; create and update issues and merge requests.","fields":{"instanceUrl":{"hint":"The trusted GitLab instance that receives this connection's credentials. Defaults to GitLab.com.","label":"Instance URL"}},"scopes":{"api":{"label":"Full API access"},"readApi":{"label":"Read API"},"readUser":{"label":"Read user profile"}}},"gmail":{"description":"Read and search mail, manage drafts and labels, and explicitly send messages.","scopes":{"gmailAddonsCurrentActionCompose":{"label":"Compose from an add-on"},"gmailAddonsCurrentMessageAction":{"label":"Act on the current add-on message"},"gmailAddonsCurrentMessageMetadata":{"label":"Read the current add-on message headers"},"gmailAddonsCurrentMessageReadonly":{"label":"Read the current add-on message"},"gmailCompose":{"label":"Manage drafts and send messages"},"gmailInsert":{"label":"Insert messages"},"gmailLabels":{"label":"Manage labels"},"gmailMetadata":{"label":"Read message headers and labels"},"gmailModify":{"label":"Read and modify messages"},"gmailReadonly":{"label":"Read messages"},"gmailSend":{"label":"Send messages"},"gmailSettingsBasic":{"label":"Manage basic mail settings"},"gmailSettingsSharing":{"label":"Manage sharing settings"},"httpsMailGoogleCom":{"label":"Full mailbox access including permanent deletion"}},"supplyLabelsAddRemove":"Supply labels to add or remove."},"gong":{"apiKeyReferenceLabel":"Access key secret reference","description":"Read company calls, transcripts, conversation statistics and linked CRM context.","endDateMustFollowStart":"The end date must follow the start date.","fields":{"accessKey":{"hint":"Copy the access key identifier from Gong's API settings. Store its secret separately.","label":"Access key"},"apiBaseUrl":{"hint":"Copy the API base URL from Gong's API settings. Leave empty to use https://api.gong.io.","label":"API base URL (optional)"}},"supplyCallIdsOrderedTimestamp":"Supply call IDs or an ordered timestamp range.","supplyIdsStringsPreserveAll":"Supply Gong IDs as strings to preserve all digits."},"google":{"batchRequestsInvalid":"Supply 1–100 native {product} request objects, one operation per object, within 1 MiB.","scopes":{"drive":{"label":"Manage Drive files"},"driveFile":{"label":"Access files selected for this application"},"driveReadonly":{"label":"Read Drive files"}}},"googleAds":{"apiCapacityExhaustedCheckCloud":"Google Ads API capacity is exhausted. Check the Cloud project and account quotas.","checkApiAccessApprovalCloud":"Check Google Ads API access approval for the Cloud project that owns this OAuth client.","connectAgainRequiredPermission":"Connect Google Ads again with its required permission.","description":"Discover advertising accounts, prepare reviewed Search campaigns and read Google Ads reports.","fields":{"loginCustomerId":{"hint":"Use the manager through which this app accesses client accounts, without hyphens. Direct account access can leave this blank.","label":"Manager customer ID (optional)"}},"permissionsHint":"This Google permission can authorize campaign changes. Search management uses separate reviewed operations; your application must authorize each account and spending decision. This is not application login.","rejectedOperationCheckCampaignFields":"Google Ads rejected the operation. Check campaign fields, policy requirements and account permissions.","resourceUnavailable":"This Google Ads resource is unavailable.","scopes":{"httpsWwwGoogleapisComAuthAdwords":{"label":"Access Google Ads accounts"}}},"googleAdsSearch":{"campaignChangedInspectApproveAgain":"The campaign changed. Inspect and approve it again.","campaignExceedsBoundedSearchReview":"This campaign exceeds the bounded Search review. Manage it in Google Ads.","chooseActiveClientAccount":"Choose an active client account.","chooseActiveClientAccountMatch":"Choose an active client account and match its currency.","chooseEnabledWebsiteConversionAction":"Choose an enabled website conversion action.","chooseIntegration":"Choose a Google Ads integration.","confirmInstalledConversionTrackingBilling":"Confirm installed conversion tracking and billing/advertiser readiness before launch.","didNotReturnSelectedAccount":"Google did not return the selected account.","enterLocationNameUsingLetters":"Enter a location name using letters, numbers, spaces, dots or hyphens.","pausedCampaignCanLaunchedHere":"Only a paused campaign can be launched here.","returnedInvalidCampaignGoal":"Google returned an invalid campaign goal.","reviewNonPoliticalSearchCampaign":"Review a non-political Search campaign with an enabled custom conversion goal.","screenLaunchesSearchCampaignsManual":"This screen launches only Search campaigns with manual CPC, ads and keywords. Manage other campaigns in Google Ads.","searchPlanChangedReviewAgain":"The Search plan changed. Review it again before creation.","selectAccessibleSearchCampaign":"Select an accessible Search campaign."},"googleAnalytics":{"authenticationHint":"Your application loads the Google tag. This does not grant access to Analytics reports.","authenticationLabels":{"none":"Public configuration · no credentials"},"description":"Configure website tracking with your public GA4 Measurement ID.","fields":{"measurementId":{"hint":"Public: this value will be visible in your deployed application. Copy it from your GA4 web stream.","label":"Measurement ID"}}},"googleDocs":{"description":"Create documents, read tabs and edit content with native batch requests.","scopes":{"documents":{"label":"Manage documents"},"documentsReadonly":{"label":"Read documents"}},"verificationFields":{"documentId":{"hint":"Leave blank for create-first access with drive.file and Drive API enabled. To verify an existing document, copy its ID between /document/d/ and /edit; the account and this app must have access.","label":"Document ID (optional)"}}},"googleDrive":{"base64Invalid":"Use standard padded base64 file data.","description":"Find files, upload and download content, and manage basic file metadata.","metadataChangeRequired":"Supply a name, description or trashed value.","mimeTypeInvalid":"Use a MIME type without header parameters.","parentIdNewFilesOnly":"parentId applies to new files; moving files requires native addParents/removeParents wiring.","scopes":{"drive":{"label":"Manage all Drive files"},"driveActivity":{"label":"Read and add file activity"},"driveActivityReadonly":{"label":"Read file activity"},"driveAppdata":{"label":"Manage application data"},"driveAppfolder":{"label":"Manage this application’s Drive folder data"},"driveAppsReadonly":{"label":"Read installed Drive apps"},"driveFile":{"label":"Manage files selected for this application"},"driveMeetReadonly":{"label":"Read Meet-created files"},"driveMetadata":{"label":"Manage file metadata"},"driveMetadataReadonly":{"label":"Read file metadata"},"drivePhotosReadonly":{"label":"Read photos"},"driveReadonly":{"label":"Read and download files"},"driveScripts":{"label":"Manage Apps Script files"}},"uploadTooLarge":"Uploads above 5 MB require the framework's native resumable client.","useFrameworkNativeDriveClient":"Use the framework's native Drive client for downloads or exports above 8 MiB."},"googleMapsPlatform":{"apiKeyReferenceHint":"Reference a server key authorized for Geocoding API. Verification performs one geocoding request using an address you supply and can incur provider usage charges.","apiKeyReferenceLabel":"Server API key reference","checkServerKeyBillingUsage":"Check the Google Maps server key, billing and usage cap.","couldNotAcceptGeocodingRequest":"Google Maps could not accept this geocoding request.","couldNotProcessRequestTry":"Google Maps could not process the request. Try again.","deniedAccessCheckEnabledApi":"Google Maps denied access. Check the enabled API and key restrictions.","description":"Geocode addresses, find places, compute routes and configure browser maps.","fields":{"browserKeyRef":{"hint":"A separate key for browser maps. Restrict it to the actual application websites and APIs. Backend verification does not verify this key.","label":"Browser API key reference (optional)"},"mapId":{"hint":"Public JavaScript map ID for advanced markers. Create it in Google Maps Platform > Map management. DEMO_MAP_ID is only for development.","label":"Map ID (optional)"}},"requestQuotaReached":"The Google Maps request quota was reached.","verificationFields":{"address":{"hint":"Enter an address or plus code. Connecting performs one geocoding request and can incur provider usage charges.","label":"Verification address"}}},"googleSearchConsole":{"datesOrder":"startDate must not follow endDate.","description":"Query search performance, inspect indexed URLs and manage sitemaps.","scopes":{"siteverification":{"label":"Manage website ownership through Site Verification"},"siteverificationVerifyOnly":{"label":"Verify new website ownership through Site Verification"},"webmasters":{"label":"Manage Search Console properties"},"webmastersReadonly":{"label":"Read Search Console properties"}}},"googleSheets":{"description":"Create spreadsheets, read and write ranges, and apply native batch updates.","rangesInvalid":"Supply 1–100 ranges within 1 MiB.","scopes":{"driveMetadataReadonly":{"label":"Read Drive file metadata (does not grant spreadsheet content access)"},"spreadsheets":{"label":"Manage spreadsheets"},"spreadsheetsReadonly":{"label":"Read spreadsheets"}},"valuesMatrixInvalid":"Supply a matrix of at most 10,000 cells and 1 MiB, containing strings, finite numbers, booleans or null.","verificationFields":{"spreadsheetId":{"hint":"Leave blank for create-first access with drive.file and Drive API enabled. Otherwise copy the ID between /spreadsheets/d/ and /edit, not the gid tab number; the account and app must have access.","label":"Spreadsheet ID (optional)"}}},"googleSlides":{"description":"Create and edit presentations, read pages and obtain preview thumbnails.","scopes":{"presentations":{"label":"Manage presentations"},"presentationsReadonly":{"label":"Read presentations"},"spreadsheets":{"label":"Manage linked spreadsheets"},"spreadsheetsReadonly":{"label":"Read linked spreadsheets"}},"verificationFields":{"presentationId":{"hint":"Leave blank for create-first access with drive.file and Drive API enabled. Otherwise copy the ID between /presentation/d/ and /edit; this is not a slide object ID. The account and app must have access.","label":"Presentation ID (optional)"}}},"granola":{"description":"Read meeting notes with an API key or connect the assistant owner through Granola MCP OAuth.","noteUnavailable":"The Granola note is unavailable, inaccessible or still being processed.","readTranscriptPagesTranscriptsList":"Read the transcript in pages with transcripts.list.","returnedDataDoesNotMatch":"Granola returned data that does not match this request.","scopes":{"email":{"label":"Read account email"},"offlineAccess":{"label":"Refresh access without repeating sign-in"},"openid":{"label":"Identify the connected Granola account"},"profile":{"label":"Read account profile"}},"useGrnApiKeyWithout":"Use the Granola grn_ API key without whitespace or control characters."},"hex":{"description":"Search projects and use Hex Threads through the assistant owner's MCP connection.","fields":{"endpoint":{"hint":"Use the endpoint where your Hex workspace lives; register the OAuth client at that endpoint.","items":{"eu":{"title":"Europe (eu.hex.tech)"},"hipaa":{"title":"HIPAA (hc.hex.tech)"},"standard":{"title":"Standard (app.hex.tech)"}},"label":"Hex workspace endpoint"}},"scopes":{"email":{"label":"Read account email"},"offlineAccess":{"label":"Refresh access without repeating sign-in"},"openid":{"label":"Identify the connected Hex account"},"profile":{"label":"Read account profile"}}},"heygen":{"description":"Read API profile and voices with a key, or connect HeyGen MCP tools through browser OAuth.","scopes":{"email":{"label":"Read account email"},"openid":{"label":"Identify the connected HeyGen account"},"profile":{"label":"Read account profile"}}},"heygenKey":{"description":"Read your API account profile and browse voice metadata."},"hubspot":{"contactIdentityRequired":"Supply email, firstname or lastname.","dealNameStageRequired":"Supply dealname and the internal dealstage ID.","scopes":{"crmObjectsContactsRead":{"label":"Read CRM contacts"},"crmObjectsContactsWrite":{"label":"Create and update CRM contacts"},"crmObjectsDealsRead":{"label":"Read deals and pipelines"},"crmObjectsDealsWrite":{"label":"Create and update CRM deals"},"oauth":{"label":"Authorize the HubSpot app"}}},"hubspotKey":{"description":"Manage contacts, deals and their relationships in the connected HubSpot account."},"incidentIo":{"description":"Manage incidents and follow-ups, resolve alerts, read on-call schedules and maintain catalogue entries."},"inngest":{"apiKeyReferenceHint":"Reference the Signing Key for the intended Inngest environment. Verification reads app metadata; it does not verify the Event Key or run a workflow.","apiKeyReferenceLabel":"Signing Key reference","configureValidEventKeyReconnect":"Configure a valid Inngest Event Key and reconnect.","deniedEvent":"Inngest denied this event.","description":"Send events to background workflows and inspect registered apps.","eventKeyBindingMissingInvalid":"The Inngest Event Key binding is missing or invalid.","eventLimitReached":"Inngest's event limit was reached.","fields":{"branchEnvironment":{"hint":"Routes event delivery to this branch. App metadata reads follow the Signing Key's environment.","label":"Branch environment (optional)"},"eventKeyRef":{"environmentCredential":{"label":"Inngest Event Key"},"hint":"The Event Key sends events. Keep it separate from the Signing Key, and use keys from the same intended environment.","label":"Event Key reference"}}},"klipy":{"description":"Browse clips, GIFs, stickers and existing AI emojis using your own KLIPY app key.","rejectedOperation":"KLIPY rejected the operation."},"lexware":{"description":"Read accounting contacts, articles and vouchers, and create net-EUR draft invoices."},"lightspeed":{"description":"Read products, inventory, sales, customers and outlets from a Lightspeed Retail X-Series store.","fields":{"domainPrefix":{"hint":"The store prefix from https://your-store.retail.lightspeed.app. Use the store you intend to authorize.","label":"Domain prefix"}},"lowerVersionMustBelowUpper":"The lower version must be below the upper version.","returnedInvalidTokenGrantDifferent":"Lightspeed returned an invalid token grant or a different store.","scopes":{"auditRead":{"label":"Read audit events"},"businessRulesRead":{"label":"Read business rules"},"businessRulesWrite":{"label":"Edit business rules"},"channelsRead":{"label":"Read channels"},"consignmentsRead":{"label":"Read consignments"},"consignmentsWriteInventoryCount":{"label":"Perform inventory counts"},"consignmentsWriteStockOrder":{"label":"Process stock orders"},"consignmentsWriteStockTransfer":{"label":"Transfer stock"},"customFieldsRead":{"label":"Read custom fields"},"customFieldsWrite":{"label":"Edit custom fields"},"customersRead":{"label":"Read customers"},"customersWrite":{"label":"Edit customers"},"fulfillmentsRead":{"label":"Read fulfillments"},"fulfillmentsWrite":{"label":"Edit fulfillments"},"giftCardsRead":{"label":"Read gift cards"},"giftCardsWriteIssue":{"label":"Issue gift cards"},"giftCardsWriteRedeem":{"label":"Redeem gift cards"},"inventoryRead":{"label":"Read inventory"},"inventoryWrite":{"label":"Edit inventory"},"outletsRead":{"label":"Read outlets"},"paymentTypesRead":{"label":"Read payment types"},"paymentsRead":{"label":"Read payments"},"productsRead":{"label":"Read products"},"productsReadPriceBooks":{"label":"Read price books"},"productsWrite":{"label":"Edit products"},"productsWritePriceBooks":{"label":"Edit price books"},"promotionsRead":{"label":"Read promotions"},"promotionsWrite":{"label":"Edit promotions"},"registerClose":{"label":"Close registers"},"registerOpen":{"label":"Open registers"},"registersRead":{"label":"Read registers"},"remoteRulesRead":{"label":"Read remote rules"},"remoteRulesWrite":{"label":"Edit remote rules"},"retailerRead":{"label":"Read retailer settings"},"salesRead":{"label":"Read sales"},"salesWrite":{"label":"Edit sales"},"serialNumbersRead":{"label":"Read serial numbers"},"serialNumbersWrite":{"label":"Edit serial numbers"},"servicesRead":{"label":"Read services"},"servicesWrite":{"label":"Edit services"},"storeCreditsRead":{"label":"Read store credits"},"storeCreditsWriteIssue":{"label":"Issue store credits"},"suppliersRead":{"label":"Read suppliers"},"suppliersWrite":{"label":"Edit suppliers"},"taxesRead":{"label":"Read taxes"},"taxesWrite":{"label":"Edit taxes"},"usersRead":{"label":"Read users"},"usersWrite":{"label":"Edit users"},"webhooks":{"label":"Manage application webhooks"}},"useOrderedInventoryVersionBounds":"Use ordered inventory version bounds and a product ID when requesting variants."},"linear":{"scopes":{"commentsCreate":{"label":"Create comments"},"issuesCreate":{"label":"Create issues and attachments"},"read":{"label":"Read your account"},"timeScheduleWrite":{"label":"Manage time schedules"},"write":{"label":"Write on your behalf"}}},"linearKey":{"description":"Read profiles and issues, or use Linear MCP tools with the connected account."},"linkedin":{"connectOpenidProfilePermissions":"Connect LinkedIn with OpenID and profile permissions.","description":"Connect a member's LinkedIn account to read their permitted profile information and publish approved text posts.","didNotConfirmPostCreation":"LinkedIn did not confirm post creation.","permissionsHint":"OpenID and profile are required for profile verification. Email is optional. Publish posts needs LinkedIn's Share on LinkedIn product; select it and reconnect before publishing text posts.","returnedInvalidMemberIdentity":"LinkedIn returned an invalid member identity.","scopes":{"email":{"label":"Read primary email address"},"openid":{"label":"OpenID (required)"},"profile":{"label":"Read basic profile (required)"},"wMemberSocial":{"label":"Publish posts"}}},"logoDev":{"apiKeyReferenceHint":"Reference a pk_ key. Your application exposes its value in image URLs. A private sk_ key cannot be used for this image flow.","apiKeyReferenceLabel":"Publishable key reference","description":"Display company logos using a publishable image-service key."},"mailgun":{"description":"Send transactional email, manage sending domains and inspect delivery logs.","fields":{"region":{"hint":"Select the region containing your sending domains.","items":{"eu":{"title":"European Union (api.eu.mailgun.net)"},"us":{"title":"United States (api.mailgun.net)"}},"label":"API region"}}},"mapbox":{"apiKeyReferenceHint":"Use a reference to a token for backend requests. It may be a public (pk.) or secret (sk.) token; browser URL restrictions can block backend geocoding.","apiKeyReferenceLabel":"Backend access token reference","configureValidTokenConnectAgain":"Configure a valid Mapbox token and connect again.","description":"Validate a backend access token and look up places or coordinates.","fields":{"publicTokenRef":{"environmentCredential":{"label":"Public browser token"},"hint":"Required for browser-only mode; optional with backend geocoding. Separate pk. token for Mapbox in your browser. The application may expose this value; backend verification does not verify its restrictions.","label":"Public browser token reference"},"usage":{"items":{"backend":{"title":"Backend geocoding and optional browser maps"},"browser":{"title":"Browser maps only"}},"label":"Mapbox usage"}}},"mcp":{"registrationFailed":"{provider} client registration failed. Check the provider before creating another client.","registrationInterrupted":"Registration was interrupted. Check the provider before creating another client.","transportRequestedUnexpectedDestination":"The MCP transport requested an unexpected destination."},"microsoft":{"chooseDocumentFile":"Choose a {product} file.","fields":{"tenantId":{"hint":"Use {authority} for the default audience, or the directory GUID for a single-tenant app. This is not the Application (client) ID.","label":"Directory (tenant) ID"}},"returnedInvalidFileList":"Microsoft returned an invalid file list.","returnedInvalidFileMetadata":"Microsoft returned invalid file metadata.","scopes":{"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftExcel":{"description":"Browse workbooks and read or update bounded cell ranges with explicit sessions.","scopes":{"filesRead":{"label":"Read your files"},"filesReadAll":{"label":"Read all files you can access"},"filesReadWrite":{"label":"Read and write your files (required by Excel worksheets)"},"filesReadWriteAll":{"label":"Read and write all files you can access"},"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftFabric":{"couldNotCompleteGraphqlDocument":"Fabric could not complete the GraphQL document. Check its schema and permissions before retrying.","description":"Access one Fabric GraphQL API using user consent or a service principal.","fields":{"graphqlEndpoint":{"hint":"Open your API for GraphQL in Fabric and select Copy endpoint. Custom proxies and sovereign-cloud addresses are not supported by this fragment.","label":"Fabric GraphQL Endpoint"},"tenantId":{"hint":"The directory containing the Fabric resource and permitted users or service principal.","label":"Microsoft Entra Tenant ID"}},"oauthGrantHint":"User consent needs a Web callback and delegated GraphQL permission. Service account needs a service principal with Fabric access, without a callback.","permissionsHint":"Fabric Execute access permits queries and mutations. Your application must authorize the documents it executes. Data-source access is separate; this does not sign users into your application.","requiresNewSignConsent":"Microsoft requires a new sign-in or consent.","scopes":{"delegatedScope":{"label":"Execute GraphQL queries and mutations as the user"},"offlineAccess":{"label":"Keep user access between visits"},"serviceScope":{"label":"Use the service account's Fabric permissions"}}},"microsoftOneDrive":{"description":"Browse folders, obtain file downloads and upload small files.","scopes":{"filesRead":{"label":"Read your files"},"filesReadAll":{"label":"Read all files you can access"},"filesReadWrite":{"label":"Read and write your files"},"filesReadWriteAll":{"label":"Read and write all files you can access"},"filesReadWriteAppFolder":{"label":"Read and write files in the application's folder"},"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftOneNote":{"description":"Browse notebooks and pages, read content, and create or append text notes.","scopes":{"notesCreate":{"label":"Create pages in OneNote notebooks"},"notesRead":{"label":"Read your notebooks"},"notesReadAll":{"label":"Read notebooks you can access in your organization"},"notesReadWrite":{"label":"Read and modify your notebooks"},"notesReadWriteAll":{"label":"Read and modify notebooks you can access in your organization"},"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftOnedrive":{"useStandardPaddedBase64Up":"Use standard padded base64 up to 5 MB; larger files need a native upload session."},"microsoftOnenote":{"useNativeOnenoteClientPages":"Use the native OneNote client for pages above 1 MiB."},"microsoftOutlook":{"description":"Read messages and files, send text mail, manage read/folder state and calendar appointments.","endMustFollowStart":"End must follow start.","scopes":{"calendarsRead":{"label":"Read your calendars"},"calendarsReadWrite":{"label":"Read and write your calendars"},"mailRead":{"label":"Read your mail"},"mailReadBasic":{"label":"Read basic mail properties"},"mailReadWrite":{"label":"Read and write your mail"},"mailSend":{"label":"Send mail as you"},"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftPowerPoint":{"description":"Browse PowerPoint files and folders in your drive and read presentation metadata.","scopes":{"filesRead":{"label":"Read your files"}}},"microsoftSharePoint":{"description":"Browse sites/libraries, transfer small files and edit list items.","scopes":{"filesReadAll":{"label":"Read all files that user can access"},"filesReadWriteAll":{"label":"Read and write all files that user can access"},"offlineAccess":{"label":"Keep access when you are away"},"sitesFullControlAll":{"label":"Have full control of all site collections"},"sitesManageAll":{"label":"Create, edit, and delete items and lists in all site collections"},"sitesReadAll":{"label":"Read items in all site collections"},"sitesReadWriteAll":{"label":"Edit or delete items in all site collections"},"userRead":{"label":"Read user profile"}},"verificationFields":{"search":{"hint":"Enter a search term for accessible SharePoint sites. Verification performs this search without changing a site.","label":"Site search"}}},"microsoftTeams":{"description":"Browse teams/channels and read or send channel and existing-chat messages.","scopes":{"channelMessageReadAll":{"label":"Read channel messages"},"channelMessageSend":{"label":"Send messages to channels"},"channelReadBasicAll":{"label":"List channels in teams"},"chatReadWrite":{"label":"Read and send chat messages"},"offlineAccess":{"label":"Keep access when you are away"},"teamReadBasicAll":{"label":"List joined teams"},"userRead":{"label":"Read user profile"},"userReadAll":{"label":"Read all users' full profiles"}}},"microsoftWord":{"description":"Browse Word files and folders in your drive and read document metadata.","scopes":{"filesRead":{"label":"Read your files"}}},"miro":{"description":"Use Miro board tools through the assistant owner's selected team.","scopes":{"boardsRead":{"label":"Read boards"},"boardsWrite":{"label":"Create and edit boards"},"email":{"label":"Read your email address"},"openid":{"label":"Include account identity"}}},"n8n":{"apiKeyReferenceHint":"Use the personal token from Instance-level MCP, not an n8n REST API key. The assistant host must authorize individual tool calls.","apiKeyReferenceLabel":"MCP access token reference","description":"Discover and use your n8n instance's MCP tools from an assistant.","discoverOauthSettingsExactMcp":"Discover OAuth settings for this exact n8n MCP URL before connecting.","fields":{"serverUrl":{"hint":"Copy the full Server URL from n8n's MCP connection details. Keep any reverse-proxy subdirectory.","label":"Server URL"}},"oauthDiscoveryFailedCheckMcp":"n8n OAuth discovery failed. Check the MCP URL, advertised authority and supported server version.","oauthDiscoveryInterrupted":"n8n OAuth discovery was interrupted.","selectPermissionsAdvertisedMcpServer":"Select only permissions advertised by this n8n MCP server."},"notion":{"fields":{"connectionType":{"hint":"Hosted MCP needs its own client registration and consent; REST credentials cannot be reused.","items":{"mcp":{"title":"Hosted assistant tools (MCP)"},"rest":{"title":"Application data (REST)"}},"label":"Connection type"}},"scopes":{"default":{"label":"Notion MCP access"}}},"notionInternal":{"description":"Read, query and update pages and data sources shared with a Notion connection."},"oura":{"description":"Connect an individual's Oura account to read sleep, readiness, activity, heart-rate and permitted profile data.","scopes":{"daily":{"label":"Read daily sleep, activity and readiness summaries"},"email":{"label":"Read the account email address"},"heartrate":{"label":"Read heart-rate samples"},"personal":{"label":"Read personal profile information"}},"startNotAfterEnd":"Start must be before or equal to end."},"paddle":{"assistantActions":{"apiRead":{"label":"Read Paddle API"},"apiWrite":{"label":"Write Paddle API"},"enable":{"label":"Enable Paddle"},"goLiveCheck":{"label":"Check go-live status"},"pricesCreate":{"label":"Create price"},"productsBatchCreate":{"label":"Batch create products with prices"},"productsCreate":{"label":"Create product with price"},"providerRecommend":{"label":"Recommend payment provider"},"webhooksUpdate":{"label":"Edit webhook"}},"chooseLeastNotificationSettingChange":"Choose at least one notification setting to change.","description":"Read and create Paddle Billing products and prices in sandbox or live mode.","fields":{"environment":{"hint":"Use the environment that issued this API key.","items":{"live":{"title":"Live"},"sandbox":{"title":"Sandbox"}},"label":"Environment"}}},"perplexity":{"description":"Connect your Perplexity key for app-owned cited answers and streaming."},"pipedrive":{"companyAddressChangedConnectAccount":"The Pipedrive company address changed. Connect this account again.","fields":{"companyDomain":{"hint":"For acme.pipedrive.com enter acme. Required for API-token CRM operations; OAuth uses the company address returned with consent.","label":"Company domain (API token)"}},"returnedInvalidCompanyApiAddress":"Pipedrive returned an invalid company API address.","setCompanyDomainApiToken":"Set the Pipedrive Company domain for API-token CRM operations.","supplyChangedFieldsNewLead":"Supply changed fields; a new lead also needs a person or organization."},"pipedriveToken":{"description":"Read the authenticated user and identify their Pipedrive company."},"polar":{"description":"Read your organization's Polar product catalogue.","fields":{"environment":{"hint":"Use the environment containing this organization and token.","items":{"production":{"title":"Production"},"sandbox":{"title":"Sandbox"}},"label":"Environment"}}},"posthog":{"apiKeyReferenceHint":"Use an environment reference for the project's public token (phc_). Your app may expose that token in its frontend. It cannot read private analytics.","apiKeyReferenceLabel":"Project token reference","couldNotEvaluateAllRequested":"PostHog could not evaluate all requested flags.","description":"Capture events and evaluate flags with a public project token.","featureFlagQuotaReached":"PostHog's feature flag quota has been reached.","fields":{"projectId":{"hint":"Public numeric ID from project settings. Public API requests use the token to select the project; verification does not match this ID to the token.","label":"Project ID"},"region":{"hint":"Choose the PostHog Cloud region containing this project.","items":{"eu":{"title":"Europe (eu.i.posthog.com)"},"us":{"title":"United States (us.i.posthog.com)"}},"label":"Region"}},"usePublicProjectTokenStarting":"Use the public PostHog project token starting with phc_.","verificationFields":{"distinctId":{"hint":"Enter the identity whose feature flags should be evaluated. This check does not submit an analytics event.","label":"Verification user ID"}}},"prestashop":{"apiKeyReferenceHint":"Store the Webservice key outside source. Grant GET for products, and for orders if the application needs order reads.","apiKeyReferenceLabel":"Webservice API key reference","description":"Read products and orders from your PrestaShop store.","fields":{"siteUrl":{"hint":"Use the HTTPS store address before /api, keeping any installation subdirectory.","label":"Store URL"}}},"replicate":{"description":"Run asynchronous model predictions with an application-owned Replicate token."},"resend":{"description":"Send transactional email and manage contact segments and draft broadcasts."},"salesforce":{"describedDifferentObject":"Salesforce described a different object.","description":"Explore Salesforce objects and read records with your organisation's API permissions.","fields":{"accountUrl":{"hint":"Copy My Domain from Salesforce Setup. The same org receives authorization and API requests.","label":"Account URL"},"environment":{"hint":"Production includes Developer Edition. Sandbox uses the org's .sandbox.my.salesforce.com domain.","items":{"production":{"title":"Production"},"sandbox":{"title":"Sandbox"}},"label":"Environment"}},"organisationApiRequestLimitReached":"The Salesforce organisation's API request limit was reached.","permissionsHint":"Salesforce's api permission can allow writes. This runtime exposes reads; your app still authorizes each query. Connecting an account does not sign the person into your application.","rejectedQueryObjectCheckApi":"Salesforce rejected the query or object. Check its API names and the user's permissions.","returnedInvalidGrantDifferentOrganisation":"Salesforce returned an invalid grant or a different organisation.","scopes":{"api":{"label":"Access Salesforce APIs with this user's permissions"},"refreshToken":{"label":"Keep access when the user is away"}},"startQueryAgainResultCursor":"Start the Salesforce query again; its result cursor is no longer valid."},"sanity":{"apiKeyReferenceHint":"Store a Sanity token in Env. Its role controls tool access at https://mcp.sanity.io; the assistant host must authorize individual calls.","apiKeyReferenceLabel":"MCP API token reference","description":"Discover and use Sanity's hosted MCP tools from an assistant.","scopes":{"global":{"label":"Sanity MCP account access"}}},"semrush":{"apiAccessDisabledAccount":"Semrush API access is disabled for this account.","apiCapacityExhaustedCheckAccount":"Semrush API capacity is exhausted. Check the account's subscription and available units.","apiKeyReferenceHint":"Use a new Semrush V4 key: Read-only for reports and project reads, Read and write for creating, renaming or deleting projects. V3 keys and OAuth tokens are different credentials.","apiKeyReferenceLabel":"V4 API key reference","checkV3ApiDatabaseReport":"Check Semrush V3 API, database and report entitlement.","checkV3ApiUnitsReport":"Check Semrush V3 API units and report limits.","chooseMonth201201Through":"Choose a month from 2012-01 through the current month.","configureSeparateV3ApiKey":"Configure the separate Semrush V3 API key reference for keyword reports.","configureSeparateV3ApiKeyReferenceDomainReports":"Configure the separate Semrush V3 API key reference for domain reports.","configureV3KeyCampaignDiscovery":"Configure the Semrush V3 key for campaign discovery.","configureV3KeyPositionTracking":"Configure the Semrush V3 key for position tracking.","couldNotCompleteRequest":"Semrush could not complete this request.","couldNotReturnV3Report":"Semrush could not return the V3 report.","description":"Read keyword and backlink reports and manage Semrush projects using a V4 API key.","fields":{"v3ApiKeyRef":{"environmentCredential":{"label":"Semrush V3 API key"},"hint":"For domain overview and domain/URL/subfolder keyword reports and position tracking: My profile > API Keys > copy your Version 3 key into this project's Env. Leave empty if only using V4 reports/projects.","label":"V3 API key reference (optional)"}},"projectNotFoundNotAccessible":"The Semrush project was not found or is not accessible.","provideV3ApiKeyThrough":"Provide the Semrush V3 API key through its private Env reference.","provideValidV3ApiKey":"Provide a valid Semrush V3 API key.","rejectedV3ReportCheckInputs":"Semrush rejected the V3 report. Check its inputs and account access.","replaceSeparateV3KeyEnv":"Replace the separate Semrush V3 key in Env.","replaceV4KeyConnectAgain":"Replace the Semrush V4 key and connect again.","requestedPageExceedsProviderResult":"The requested Semrush page exceeds the provider's result window.","returnedIncompleteCsv":"Semrush returned incomplete CSV.","returnedInvalidTrackingJson":"Semrush returned invalid tracking JSON.","returnedMalformedCsv":"Semrush returned malformed CSV.","returnedOversizedV3Report":"Semrush returned an oversized V3 report.","returnedUnexpectedV3ReportColumns":"Semrush returned unexpected V3 report columns or rows.","trackingStartDateMustNot":"The tracking start date must not follow its end date.","useV4ApiKeyWithout":"Use the Semrush V4 API key without spaces or control characters."},"sentry":{"description":"Inspect and triage Sentry issues through scoped MCP tools.","fields":{"organizationSlug":{"hint":"Copy the organization slug from Sentry's URL. This connection is restricted to that organization.","label":"Sentry organization slug"},"projectSlug":{"hint":"Copy the slug from Project Settings to restrict access to one project. Leave empty for the selected organization.","label":"Sentry project slug (optional)"}},"scopes":{"eventWrite":{"label":"Write event data"},"orgRead":{"label":"Read organization data"},"projectWrite":{"label":"Write project data"},"teamWrite":{"label":"Write team data"}}},"sevdesk":{"apiKeyReferenceLabel":"API token reference","description":"Read sevdesk contact organizations and people with offset pagination."},"shared":{"apiKeyFormat":"Use the {provider} API key without spaces, control characters or colons.","differentRecord":"{provider} returned a different record.","invalidCallback":"Invalid {provider} callback.","invalidPermissionGrant":"{provider} returned an invalid permission grant.","invalidResponse":"{provider} returned an invalid response.","invalidTokenGrant":"{provider} returned an invalid token grant.","invalidTokenResponse":"{provider} returned an invalid token response.","invalidWebhookSignature":"Invalid {provider} webhook signature.","operationDenied":"{provider} denied this operation.","reconnectAccount":"Connect this {provider} account again.","requestLimitReached":"{provider}'s request limit was reached.","resourceUnavailable":"This {provider} resource is not available.","supplyCanonicalBase64NonemptyFile":"Supply canonical base64 for a nonempty file of at most 5 MiB.","supplyLeastChange":"Supply at least one change.","tooManyRecords":"{provider} returned more records than requested.","unexpectedPage":"{provider} returned an unexpected page.","unexpectedResponse":"{provider} returned an unexpected response."},"shopify":{"apiKeyReferenceHint":"Use env:SHOPIFY_ADMIN_TOKEN. A Storefront token, client secret or App Automation Token cannot be used here.","apiKeyReferenceLabel":"Admin API access token reference","assistantActions":{"claim":{"label":"Claim your store"},"connect":{"label":"Connect your Shopify store"},"discountCodesCreate":{"label":"Create discount code"},"discountCodesDelete":{"label":"Delete discount code"},"discountCodesUpdate":{"label":"Update discount code"},"enable":{"label":"Enable Shopify"},"priceRulesCreate":{"label":"Create price rule"},"priceRulesDelete":{"label":"Delete price rule"},"priceRulesUpdate":{"label":"Update price rule"},"productsCreate":{"label":"Create product"},"productsDelete":{"label":"Delete product"},"productsList":{"label":"Read products"},"productsUpdate":{"label":"Update product"},"variantsCreate":{"label":"Add product variant"},"variantsDelete":{"label":"Delete product variant"},"variantsUpdate":{"label":"Update product variant"}},"authenticationHint":"Client credentials require the app and store in the same Shopify organization. Connecting another merchant requires a separate Shopify installation flow.","authenticationLabels":{"apiKey":"Existing Admin API access token","oauth2":"App in your Shopify organization"},"description":"Connect a Shopify store and control what the assistant may change.","fields":{"shopDomain":{"hint":"Use the permanent myshopify.com address, including when your storefront uses a custom domain.","label":"Shopify store domain"}},"permissionsHint":"Match the scopes approved for the installed Shopify app. Write access includes reads. Assistant permission choices do not grant Shopify scopes or staff permissions.","rejectedProductChangeCheckProduct":"Shopify rejected the product change. Check the product values and permissions before retrying.","returnedMoreProductsRequested":"Shopify returned more products than requested.","scopes":{"readProducts":{"label":"Read products"},"writeProducts":{"label":"Create, update and delete products"}},"selectLeastProductDetailUpdate":"Select at least one product detail to update."},"slack":{"checkClientRegistrationCallback":"Check the Slack client registration and callback.","couldNotAuthorizeRequest":"Slack could not authorize this request.","description":"Connect as a Slack user or install a bot to read conversations and send messages.","fields":{"actor":{"hint":"User access acts as the person who connects. Bot access acts as the app in its installed workspace. Changing this choice removes permissions unavailable to that identity and requires reconnecting.","items":{"bot":{"title":"Installed bot"},"user":{"title":"Connected user"}},"label":"Act in Slack as"},"signingSecretRef":{"hint":"For incoming events and interactions: Basic Information → App Credentials → Signing Secret. Keep the value in application Env, separate from Client Secret.","label":"Signing secret reference (optional)"}},"requestFailedTryAgain":"The Slack request failed. Try again.","returnedTokenWrongIdentityInvalid":"Slack returned a token for the wrong identity or an invalid permission grant.","scopes":{"bookmarksRead":{"label":"List bookmarks"},"bookmarksWrite":{"label":"Create, edit, and remove bookmarks"},"callsRead":{"label":"View information about ongoing and past calls"},"callsWrite":{"label":"Start and manage calls in a workspace"},"canvasesRead":{"label":"Access contents of canvases created inside Slack."},"canvasesWrite":{"label":"Create, edit and remove canvases"},"channelsHistory":{"label":"View messages and other content in public channels you are in"},"channelsJoin":{"label":"Join public channels in a workspace"},"channelsManage":{"label":"Manage public channels that your Slack app has been added to and create new ones"},"channelsRead":{"label":"View basic information about public channels in a workspace"},"channelsWrite":{"label":"Manage a user's public channels and create new ones on a user's behalf"},"channelsWriteInvites":{"label":"Invite members to public channels"},"channelsWriteTopic":{"label":"Set the description of public channels"},"chatWrite":{"label":"Send messages"},"chatWriteCustomize":{"label":"Customize the content of messages sent by your Slack app"},"chatWritePublic":{"label":"Send messages to channels your Slack app isn't a member of"},"dndRead":{"label":"View Do Not Disturb settings for people in a workspace"},"dndWrite":{"label":"Edit a user's Do Not Disturb settings"},"emojiRead":{"label":"View custom emoji in a workspace"},"filesRead":{"label":"View files shared in channels and conversations that your Slack app has been added to"},"filesWrite":{"label":"Upload, edit, and delete files as your Slack app"},"groupsHistory":{"label":"View messages and other content in private channels that your Slack app has been added to"},"groupsRead":{"label":"View basic information about private channels that your Slack app has been added to"},"groupsWrite":{"label":"Manage private channels that your Slack app has been added to and create new ones"},"groupsWriteInvites":{"label":"Invite members to private channels"},"groupsWriteTopic":{"label":"Set the description of private channels"},"imHistory":{"label":"View messages and other content in direct messages you are in"},"imRead":{"label":"View basic information about direct messages you are in"},"imWrite":{"label":"Start direct messages with people"},"imWriteTopic":{"label":"Set the description in direct messages"},"listsRead":{"label":"View Slack Lists"},"listsWrite":{"label":"Create, edit, and delete Slack Lists"},"metadataMessageRead":{"label":"Allows your Slack app to read message metadata in channels that your Slack app has been added to"},"mpimHistory":{"label":"View messages and other content in group direct messages that your Slack app has been added to"},"mpimRead":{"label":"View basic information about group direct messages that your Slack app has been added to"},"mpimWrite":{"label":"Start group direct messages with people"},"mpimWriteTopic":{"label":"Set the description in group direct messages"},"pinsRead":{"label":"View pinned content in channels and conversations that your Slack app has been added to"},"pinsWrite":{"label":"Add and remove pinned messages and files"},"reactionsRead":{"label":"View emoji reactions"},"reactionsWrite":{"label":"Add and edit emoji reactions"},"remindersRead":{"label":"View reminders created by your Slack app"},"remindersWrite":{"label":"Add, remove, or mark reminders as complete"},"searchReadFiles":{"label":"Search a workspace's content in files"},"searchReadIm":{"label":"Search a workspace's content in direct messages"},"searchReadMpim":{"label":"Search a workspace's content in group direct messages"},"searchReadPrivate":{"label":"Search a workspace's content in private channels"},"searchReadPublic":{"label":"Search a workspace's content in public channels"},"searchReadUsers":{"label":"Search a workspace's users"},"teamRead":{"label":"View the name, email domain, and icon for workspaces your Slack app is connected to"},"usergroupsRead":{"label":"View user groups in a workspace"},"usergroupsWrite":{"label":"Create and manage user groups"},"usersProfileRead":{"label":"View profile details about people in a workspace"},"usersProfileWrite":{"label":"Edit a user's profile information and status"},"usersRead":{"label":"View people in a workspace"},"usersReadEmail":{"label":"View email addresses of people in a workspace"},"usersWrite":{"label":"Set presence for your Slack app"}}},"snowflake":{"description":"Query data and manage warehouses with a connected Snowflake role.","fields":{"accountUrl":{"hint":"Copy the account URL from Snowflake. Snowsight browser paths and organization-console URLs are not API addresses.","label":"Account URL"},"database":{"hint":"Exact case-sensitive database name for SQL execution; blank uses the user's default namespace. This is a default, not an access boundary: Snowflake role grants control access.","label":"Database (optional)"},"role":{"hint":"Use the exact name from SHOW ROLES, normally uppercase. Leave blank to use each connected user's default role. Shared accounts should use a dedicated role.","label":"Role"},"schema":{"hint":"Exact case-sensitive schema name for SQL execution; blank uses the user's default namespace.","label":"Schema (optional)"},"warehouse":{"hint":"Exact case-sensitive warehouse name for SQL execution. Blank uses the connected user's default. Queries may resume compute and incur Snowflake charges.","label":"Warehouse (optional)"}},"permissionsHint":"The role's Snowflake grants control access. SQL and warehouse actions use those grants and may incur compute charges. Connecting Snowflake does not sign users into your application.","rejectedStatementInspectQueryHistory":"Snowflake rejected the statement. Inspect query history with the authorized role.","responseExceeds16MibReduce":"Snowflake response exceeds 16 MiB. Reduce the query result or use a native streaming client.","returnedInvalidStatementResponse":"Snowflake returned an invalid statement response.","returnedUnexpectedDatabasePage":"Snowflake returned an unexpected database page.","scopes":{"refreshToken":{"label":"Keep access between visits (required)"},"refreshTokenOptional":{"label":"Keep access between visits"},"role":{"label":"Use role {role} (required)"}}},"storyblok":{"description":"Read space metadata and published or draft content in the space's region.","fields":{"region":{"hint":"Match the region selected when the Storyblok space was created.","items":{"ap":{"title":"Australia / APAC (AP)"},"ca":{"title":"Canada (CA)"},"cn":{"title":"China (CN)"},"eu":{"title":"European Union (EU)"},"us":{"title":"United States (US)"}},"label":"Space region"}}},"stripe":{"description":"Read the Stripe account's available and pending balances."},"supabase":{"description":"List projects through the Supabase Management API."},"tally":{"chooseNameStatusBlockChange":"Choose a name, status or block change.","description":"Create forms and retrieve submissions using your Tally account."},"telegram":{"apiKeyReferenceLabel":"Bot token reference","configureBotTokenReferencedEnvironment":"Configure a Telegram bot token in the referenced environment variable.","description":"Send bot messages and receive updates through application-owned polling."},"tiktok":{"clientIdHint":"Use the Client key from TikTok's app credentials, not its App ID.","clientIdLabel":"Client key","connectBasicProfilePermission":"Connect TikTok with basic profile permission.","connectPermissionRequiredOperation":"Connect TikTok with the permission required for this operation.","couldNotAuthorizeConnection":"TikTok could not authorize this connection.","couldNotCompleteRequest":"TikTok could not complete the request.","description":"Read a connected creator's profile and public video metadata.","permissionsHint":"Basic profile access is required for verification. Users can decline the other permissions during consent; the corresponding operations then stay unavailable.","returnedDuplicatePermissions":"TikTok returned duplicate permissions.","returnedTooManyVideos":"TikTok returned too many videos.","scopes":{"userInfoBasic":{"label":"Read basic profile information (required)"},"userInfoProfile":{"label":"Read extended profile information"},"userInfoStats":{"label":"Read user statistics"},"videoList":{"label":"Read published video metadata"}}},"twilio":{"apiKeyReferenceLabel":"API key secret reference","chooseSenderNumberMessagingService":"Choose one sender number or Messaging Service SID.","description":"Send SMS, initiate calls and read delivery/call status for the selected account and region.","fields":{"accountSid":{"hint":"Copy the SID of the account or subaccount whose calls this app may read.","label":"Account SID","placeholder":"AC followed by 32 hexadecimal characters"},"apiKeySid":{"hint":"Copy the API Key SID for this account and region. Store its secret separately.","label":"Standard API Key SID","placeholder":"SK followed by 32 hexadecimal characters"},"authTokenRef":{"hint":"For inbound messages, voice and delivery callbacks. Copy the account Auth Token from Twilio Console into private Env; this is NOT the API key secret.","label":"Callback Auth Token reference (optional)"},"region":{"hint":"Choose the region where this API key was created.","items":{"au1":{"title":"Australia (AU1)"},"ie1":{"title":"Ireland (IE1)"},"us1":{"title":"United States (US1)"}},"label":"Region"}},"supplyEitherCallControlUrl":"Supply either a call-control URL or inline TwiML."},"twitch":{"connectAgainPermissionEvent":"Connect Twitch again with permission for this event.","connectAgainPermissionNeededOperation":"Connect Twitch again with the permission needed for this operation.","description":"Connect Twitch accounts for stream discovery, chat, channel management, rewards, schedules and analytics.","enablingVacationRequiresTimezoneEnd":"Enabling vacation requires a timezone and an end after the start.","operationInvalidDestination":"This Twitch operation has an invalid destination.","returnedInvalidUnexpectedEventsubMessage":"Twitch returned an invalid or unexpected EventSub message.","returnedInvalidUserTokenValidation":"Twitch returned an invalid user-token validation.","returnedProfileDifferentUser":"Twitch returned a profile for a different user.","rewardLimitAmountRequired":"Supply {field} when enabling this reward limit.","scopes":{"analyticsReadExtensions":{"label":"Read extension analytics"},"analyticsReadGames":{"label":"Read game analytics"},"bitsRead":{"label":"Read Bits information"},"channelManageBroadcast":{"label":"Manage channel broadcast settings"},"channelManagePolls":{"label":"Create and manage channel polls"},"channelManagePredictions":{"label":"Create and manage channel predictions"},"channelManageRedemptions":{"label":"Manage channel point rewards and redemptions"},"channelManageSchedule":{"label":"Manage channel schedule"},"channelReadEditors":{"label":"Read channel editors"},"channelReadHypeTrain":{"label":"Read current hype train status"},"channelReadPolls":{"label":"Read channel polls"},"channelReadPredictions":{"label":"Read channel predictions"},"channelReadRedemptions":{"label":"Read channel point rewards and redemptions"},"channelReadSubscriptions":{"label":"Read your channel subscriptions"},"channelReadVips":{"label":"Read VIPs for your channels"},"clipsEdit":{"label":"Create clips"},"moderationRead":{"label":"Read moderation data"},"moderatorReadChatters":{"label":"Read chatters in a channel"},"moderatorReadFollowers":{"label":"Read followers for your channels"},"userReadEmail":{"label":"Read your email address"},"userReadFollows":{"label":"Read the channels you follow"},"userReadSubscriptions":{"label":"Check your subscription status"},"userWriteChat":{"label":"Send chat messages"}},"supplyBothReportDatesEnd":"Supply both report dates, with the end on or after the start.","supplyLeastBroadcastChange":"Supply at least one broadcast change.","supplyLeastRewardChange":"Supply at least one reward change.","supplyLeastScheduleChange":"Supply at least one schedule change.","supplyWinningOutcomeResolvingPrediction":"Supply a winning outcome only when resolving the prediction.","tokenBelongsDifferentApplication":"The Twitch token belongs to a different application.","tokenRequestDenied":"Twitch denied the token request."},"wave":{"accountChangedReloadApplyingEdit":"The account changed. Reload it before applying your edit.","accountingRecordNotAvailableSelected":"This accounting record is not available in the selected business. Check read access.","approveDocumentCheckEmailEligibility":"Approve the document and check Wave email eligibility before sending.","chooseAccountingFieldsUpdate":"Choose accounting fields to update.","chooseLeastCustomerFieldUpdate":"Choose at least one customer field to update.","chooseLeastDocumentFieldUpdate":"Choose at least one document field to update.","chooseLeastProductFieldUpdate":"Choose at least one product field to update.","couldNotCompleteQuery":"Wave could not complete this query.","customerNotAvailable":"This customer is not available in the selected business.","customerNotAvailableCheckAccess":"This customer is not available in the selected business. Check read access.","deniedTokenAccessCheckBusiness":"Wave denied token access. Check the business subscription and permissions.","description":"Connect project-owned Wave accounts for customers, products, invoices, estimates and accounting workflows.","documentNotAvailableSelectedBusiness":"This document is not available in the selected business. Check read access.","productAccountTaxNotAvailable":"This product, account or tax is not available in the selected business. Check read access.","rejectedAccountingChangeCheckValues":"Wave rejected the accounting change. Check the values and current record.","rejectedCustomerDetailsCheckSelected":"Wave rejected the customer details. Check the selected business and customer fields.","rejectedDocumentOperationCheckDetails":"Wave rejected the document operation. Check its details and current state.","rejectedProductDetailsCheckAccounts":"Wave rejected the product details. Check accounts, taxes and price.","rejectedTransactionReviewBalanceAccounts":"Wave rejected the transaction. Review its balance, accounts and details before submitting again.","returnedCustomerUnexpectedBusinessCheck":"Wave returned a customer from an unexpected business. Check the outcome before retrying.","returnedEstimateAnotherBusiness":"Wave returned an estimate from another business.","returnedUnexpectedAccountingRecord":"Wave returned an unexpected accounting record.","returnedUnexpectedAccountingRecordCheck":"Wave returned an unexpected accounting record. Check the outcome before retrying.","returnedUnexpectedBusiness":"Wave returned an unexpected business.","returnedUnexpectedCustomerCheckOutcome":"Wave returned an unexpected customer. Check the outcome before retrying.","returnedUnexpectedDocumentCheckOutcome":"Wave returned an unexpected document. Check the outcome before retrying.","returnedUnexpectedEstimate":"Wave returned an unexpected estimate.","returnedUnexpectedInvoice":"Wave returned an unexpected invoice.","returnedUnexpectedProductCheckOutcome":"Wave returned an unexpected product. Check the outcome before retrying.","scopes":{"account":{"label":"Full accounting account access"},"accountRead":{"label":"Read accounting accounts"},"accountWrite":{"label":"Edit accounting accounts"},"business":{"label":"Full business access"},"businessRead":{"label":"Read businesses"},"businessWrite":{"label":"Edit businesses"},"checkout":{"label":"Full checkout access"},"checkoutRead":{"label":"Read checkouts"},"customer":{"label":"Full customer access"},"customerRead":{"label":"Read customers"},"customerWrite":{"label":"Edit customers"},"estimate":{"label":"Full estimate access"},"estimateRead":{"label":"Read estimates"},"estimateSend":{"label":"Send estimates"},"estimateWrite":{"label":"Edit estimates"},"invoice":{"label":"Full invoice access"},"invoiceRead":{"label":"Read invoices"},"invoiceSend":{"label":"Send invoices"},"invoiceWrite":{"label":"Edit invoices"},"product":{"label":"Full product and service access"},"productRead":{"label":"Read products and services"},"productWrite":{"label":"Edit products and services"},"salesTax":{"label":"Full sales tax access"},"salesTaxRead":{"label":"Read sales taxes"},"salesTaxWrite":{"label":"Edit sales taxes"},"transaction":{"label":"Full transaction access"},"transactionWrite":{"label":"Create money transactions"},"user":{"label":"Full user access"},"userRead":{"label":"Read the connected user's profile"},"vendor":{"label":"Full vendor access"},"vendorRead":{"label":"Read vendors"},"vendorWrite":{"label":"Edit vendors"}},"transactionAccountCustomerTaxNot":"A transaction account, customer or tax is not available in the selected business. Check read access.","useMost100DistinctRelated":"Use at most 100 distinct related records per transaction."},"wix":{"appointmentSupplyServiceScheduleIds":"For an appointment, supply its service/schedule IDs, increasing local slot dates and IANA timezone. Courses cannot be rescheduled.","businessScheduleLimits":"Use native businessSchedule periods and specialHourPeriod arrays with at most 100 entries each.","chooseBusinessLocationId":"Choose the business location ID.","chooseServiceFieldUpdate":"Choose a service field to update.","chooseServiceTimeZoneIncreasing":"Choose the service, time zone and an increasing local date range.","chooseValidSiteId":"Choose a valid Wix Site ID.","classCourseSessionDurationsBelong":"Class/course session durations belong to their sessions, not service availability constraints.","classSupplySelectedEventidSlot":"For a class, supply only the selected eventId in slot.","configureSiteIdFirst":"Configure the Wix Site ID first.","depositRequiresAmountOnlinePayment":"A deposit requires its amount, online payment and no in-person payment.","describeCustomPaymentUp50":"Describe the custom payment in up to 50 characters.","description":"Use project-owned Wix account and site API access.","didNotReturnUpdatedFulfillment":"Wix did not return the updated fulfillment. Inspect the order before retrying.","doNotSendGeneratedService":"Do not send generated service identity fields or existing add-on groups when creating a service.","enableParticipantNotificationSendCancellation":"Enable participant notification to send a cancellation message.","enableParticipantNotificationSupplyingMessage":"Enable participant notification before supplying a message.","fields":{"accountId":{"hint":"Copy your account's ID from the API Keys Manager. A site ID is a different setting.","label":"Account ID"},"selectableSiteIds":{"hint":"Optional. Comma-separated sites the app may explicitly select. The app must still authorize each user's site access. Leave empty for a fixed-site connection.","label":"Selectable Site IDs","placeholder":"Site ID, Site ID"},"siteId":{"hint":"Required for site operations. Copy the ID after /dashboard/ in the intended Wix site dashboard URL.","label":"Site ID"}},"manualApprovalCannotUsePricing":"Manual approval cannot use pricing plans; online payment requires online booking.","onlineDepositPaymentsRequireFixed":"Online and deposit payments require fixed or varied pricing.","provideAppointmentSessionDurationsMinutes":"Provide appointment session durations in minutes.","provideContactDetailsCreationRequires":"Provide contact details; creation requires a name, email or phone.","provideDestinationMovingFutureSessions":"Provide a destination only when moving future sessions.","provideExplicitOnlineBookingSettings":"Provide explicit online-booking settings.","provideLocationAddress":"Provide the location address.","providePositiveDecimalPriceString":"Provide a positive decimal price string and three-letter currency code.","provideProductNameVisibilityBase":"Provide a product name, visibility or base-price change.","provideProductNameVisibilityChange":"Provide a product name or visibility change.","provideSelectedServiceSettingsInstead":"Provide the selected service settings instead of an empty object.","provideServiceTypeNameUp":"Provide a service type and name of up to 400 characters.","returnedAvailabilityDifferentServiceTime":"Wix returned availability for a different service, time or time zone.","returnedClassSlotDifferentService":"Wix returned a class slot for a different service.","returnedDifferentBookingCheckOperation":"Wix returned a different booking. Check the operation outcome before retrying.","returnedDifferentBookingServiceCheck":"Wix returned a different booking service. Check the outcome before retrying.","returnedDifferentBusinessLocation":"Wix returned a different business location.","returnedDifferentCmsCollection":"Wix returned a different CMS collection.","returnedDifferentCmsItemCollection":"Wix returned a different CMS item or collection. Check write outcomes before retrying.","returnedDifferentContactCheckOperation":"Wix returned a different contact. Check the operation outcome before retrying.","returnedDifferentEventSlotTime":"Wix returned a different event slot or time zone.","returnedDifferentFormSummary":"Wix returned a different form summary.","returnedDifferentOrder":"Wix returned a different order.","returnedDifferentProduct":"Wix returned a different product.","returnedFulfillmentsDifferentOrder":"Wix returned fulfillments for a different order.","returnedItemsDifferentCmsCollection":"Wix returned items from a different CMS collection.","returnedUnexpectedBookingRequestedId":"Wix returned an unexpected booking for the requested ID.","returnedVariantsDifferentService":"Wix returned variants for a different service.","selectDurationAddOnsSupplying":"Select a duration or add-ons before supplying customer choices.","selectLeastStaffResourceId":"Select at least one staff resource ID for the appointment service.","selectPersonOnlinePaymentIncluding":"Select in-person or online payment, including for a free service.","setAppointmentCapacity1Class":"Set appointment capacity to 1, or class/course capacity from 1 to 1000.","siteNotEnabledProjectSelectable":"This site is not enabled in the project's Selectable Site IDs.","supplyDetailsMatchingServiceLocation":"Supply the details matching each service location type.","supplyFulfillmentPropertiesWrite":"Supply the fulfillment properties to write.","supplyTrackingNumberProviderCustom":"Supply tracking number and provider; custom carriers also require a tracking URL.","useAppointmentDatesResourceLocation":"Use appointment dates/resource/location, a class event ID, or a course schedule ID, matching the selected service type.","useCursorLimitNextAvailability":"Use only cursor and limit for the next availability page.","useCursorLimitNextOrder":"Use only cursor and limit for the next order page.","useFixedVariedCustomNo":"Use FIXED, VARIED, CUSTOM or NO_FEE service payment settings.","useMost1000ParticipantsDistinct":"Use at most 1000 participants, distinct options per group and exactly one custom or duration value per choice.","useParticipantChoicesFixedParticipant":"Use participant choices or a fixed participant total, not both."},"wiz":{"accessSourceScanDenied":"Access to this source scan was denied.","auth0ScanningRequiresVerifiedCompatible":"Auth0 scanning requires a verified compatible Wiz runner.","authenticationHint":"A source scanner uses your workspace's service account. It does not sign app users in. The installed Wiz CLI performs authentication when a scan runs.","authenticationLabels":{"oauth2":"Wiz service account"},"authorisedSourceDirectoryUnavailable":"The authorised source directory is unavailable.","cliCouldNotStarted":"The Wiz CLI could not be started.","clientSecretReferenceInvalid":"The Wiz client-secret reference is invalid.","clientSecretReferenceUnavailable":"The Wiz client-secret reference is unavailable.","couldNotCompleteScanCheck":"Wiz could not complete the scan. Check the runner, policies and tenant access.","description":"Scan project source with your Wiz security policies.","didNotProduceReadableReport":"Wiz did not produce a readable report within the configured size limit.","fields":{"byPolicyHits":{"hint":"Filtering reported findings does not disable Wiz's policy verdict.","items":{"aUDIT":{"title":"Blocking or audit policy hits (AUDIT)"},"bLOCK":{"title":"Blocking policy hits (BLOCK)"},"dISABLED":{"title":"All findings (DISABLED)"}},"label":"Filter findings by policy hits"},"policies":{"hint":"Optional comma-separated policy names. Leave blank to use your Wiz tenant's defaults.","label":"CI/CD scan policies","placeholder":"Default vulnerabilities policy, Default IaC policy"},"tokenUrl":{"hint":"The current Wiz v1 runner supports Cognito. Auth0 configuration can be saved, but requires a verified compatible runner before scanning.","items":{"httpsAuthAppWizIoOauthToken":{"title":"Cognito (auth.app.wiz.io)"},"httpsAuthWizIoOauthToken":{"title":"Auth0 (auth.wiz.io)"}},"label":"Token URL"}},"hostMustSupplyAbsoluteSource":"The host must supply an absolute source directory and revision.","integrationNotConfigured":"This Wiz integration is not configured.","rejectedServiceAccountCredentials":"Wiz rejected the service-account credentials.","returnedUnsupportedInconsistentScanReport":"Wiz returned an unsupported or inconsistent scan report.","scanCancelled":"The Wiz scan was cancelled.","scanExceededTimeLimit":"The Wiz scan exceeded its time limit."},"woocommerce":{"apiKeyReferenceHint":"Store the consumer secret in Env. Use Read for lookups or Read/Write for changes; the key's WordPress user must also have permission for the requested operation.","apiKeyReferenceLabel":"Consumer secret reference","categoryCannotOwnParent":"A category cannot be its own parent.","categoryDeletionPermanentRequiresForce":"Category deletion is permanent and requires force=true.","chooseDifferentReassignmentUser":"Choose a different reassignment user.","chooseExplicitRefundRestockFlags":"Choose explicit refund/restock flags and decimal-string amounts.","chooseExplicitlyWhetherPermanentlyDelete":"Choose explicitly whether to permanently delete.","choosePeriodCompleteAscendingDate":"Choose a period or a complete ascending date range.","description":"Manage your WooCommerce catalogue, orders, customers, discounts and refunds, and read store reports.","fields":{"consumerKey":{"hint":"The key identifier from WooCommerce. Store its matching consumer secret separately.","label":"Consumer key"},"siteUrl":{"label":"Store URL"}},"invalidWebhookSignatureInputs":"Invalid WooCommerce webhook signature inputs.","percentageDiscountsCannotExceed100":"Percentage discounts cannot exceed 100.","productPricesMustDecimalStrings":"Product prices must be decimal strings.","resourceDoesNotSupportTrash":"This resource does not support trash; permanent deletion requires force=true.","restockingRequiresSelectedOrderLines":"Restocking requires selected order lines and positive quantities.","returnedDifferentCategory":"WooCommerce returned a different category.","returnedDifferentRefund":"WooCommerce returned a different refund.","returnedDifferentVariation":"WooCommerce returned a different variation.","supplyCategoryChanges":"Supply category changes.","supplyCouponChanges":"Supply coupon changes.","supplyCustomerChangesNonEmpty":"Supply customer changes and non-empty address objects.","supplyOrderChanges":"Supply order changes.","supplyProductChanges":"Supply product changes.","supplyVariationChanges":"Supply variation changes.","variationPricesMustDecimalStrings":"Variation prices must be decimal strings."},"wordpress":{"fields":{"siteUrl":{"hint":"Use the site address before /wp-json, keeping any installation subdirectory. The runtime sends credentials only to this configured origin."}}},"wordpressCom":{"description":"Connect a WordPress.com account to read its profile/sites and manage posts, pages and media.","scopes":{"batch":{"label":"Batch API requests"},"comments":{"label":"View and manage comments"},"media":{"label":"Manage media assets"},"posts":{"label":"View and manage posts"},"sites":{"label":"View site information and options"},"stats":{"label":"View site statistics"},"taxonomy":{"label":"Manage taxonomy terms"},"users":{"label":"View user information (required for verification)"}},"verifiedTokenBelongsDifferentApplication":"The verified token belongs to a different application."},"wordpressSelfHosted":{"apiKeyReferenceHint":"Use a WordPress Application Password for this user, stored in Env. The user's role controls access; this is separate from the user's login password.","apiKeyReferenceLabel":"Application password reference","description":"Manage WordPress posts, pages, media and users with a site-owned account.","fields":{"siteUrl":{"label":"Site URL"},"username":{"hint":"The WordPress login name that owns the Application Password.","label":"Username"}}},"workday":{"datesOrder":"The start date must not follow the end date.","description":"Read workers, organizations, time off and custom reports with each connected Workday user's permissions.","fields":{"authorizationEndpoint":{"hint":"Copy from View API Clients. The sign-in host usually differs from the API host.","label":"Authorization Endpoint"},"restApiEndpoint":{"hint":"Copy from View API Clients. Worker reads use Staffing v7 on this host and tenant.","label":"Workday REST API Endpoint"},"tokenEndpoint":{"hint":"Copy the Token Endpoint from the same Workday tenant.","label":"Token Endpoint"}},"permissionsHint":"Select the required functional areas in Workday: Staffing, Organizations and Roles, or Time Off and Leave. Each user's domain and report permissions still apply. Connecting Workday does not create your app's login.","supplyReportPromptOnceJoin":"Supply each report prompt once; join multi-instance WIDs with !.","useSmallerReportPromptRequest":"Use a smaller report prompt request."},"xTwitter":{"apiKeyReferenceHint":"Reference the app-only Bearer Token from X Developer Console. This token does not sign in an app user.","apiKeyReferenceLabel":"App-only bearer token reference","checkApplicationApiCreditsBilling":"Check this X application's API credits and billing access.","couldNotReturnCompleteRequested":"X could not return the complete requested data.","description":"Read public X profiles, posts and recent search with an application's bearer token.","passUserIdString":"Pass the X user ID as a string.","resourceNotFoundNotAvailable":"The X resource was not found or is not available.","useAppTokenWithoutSpaces":"Use the X app-only token without spaces, control characters or a Bearer prefix.","verificationFields":{"username":{"hint":"Enter a public X username without {'@'}. Connecting looks up this profile and can consume provider credits.","label":"Verification username"}}},"xero":{"attachmentResponsesLimited3Mib":"Xero attachment responses are limited to 3 MiB.","budgetDatesOrder":"The budget start date must not follow its end date.","description":"Manage contacts and invoices, record payments and read financial reports in connected organisations.","discountRatesApplySalesInvoices":"Discount rates apply only to sales invoices.","organisationNotConnectedAccount":"This Xero organisation is not connected to this account.","reportDatesOrder":"The report start date must not follow its end date.","returnedDifferentOrganisation":"Xero returned a different organisation.","returnedInvalidAttachmentResponse":"Xero returned an invalid attachment response.","returnedInvalidConnections":"Xero returned invalid connections.","scopes":{"accountingAttachments":{"label":"Read and manage attachments"},"accountingAttachmentsRead":{"label":"Read attachments"},"accountingBanktransactions":{"label":"Read and manage bank transactions"},"accountingBanktransactionsRead":{"label":"Read bank transactions"},"accountingBudgetsRead":{"label":"Read budgets"},"accountingContacts":{"label":"Read and manage contacts"},"accountingContactsRead":{"label":"Read contacts"},"accountingInvoices":{"label":"Read and manage invoices and bills"},"accountingInvoicesRead":{"label":"Read invoices and bills"},"accountingManualjournals":{"label":"Read and manage manual journals"},"accountingManualjournalsRead":{"label":"Read manual journals"},"accountingPayments":{"label":"Read and manage payments"},"accountingPaymentsRead":{"label":"Read payments"},"accountingReportsAgedRead":{"label":"Read aged receivables and payables reports"},"accountingReportsBalancesheetRead":{"label":"Read balance sheet reports"},"accountingReportsBanksummaryRead":{"label":"Read bank summary reports"},"accountingReportsBudgetsummaryRead":{"label":"Read budget summary reports"},"accountingReportsExecutivesummaryRead":{"label":"Read executive summary reports"},"accountingReportsProfitandlossRead":{"label":"Read profit and loss reports"},"accountingReportsTaxreportsRead":{"label":"Read GST and BAS reports"},"accountingReportsTrialbalanceRead":{"label":"Read trial balance reports"},"accountingSettings":{"label":"Read and manage organisation settings"},"accountingSettingsRead":{"label":"Read organisation settings"},"offlineAccess":{"label":"Keep access when the user is away"}},"supplyBankTransactionFieldChange":"Supply a bank transaction field to change.","supplyCanonicalBase64NonemptyAttachment":"Supply canonical base64 for a nonempty attachment of at most 3 MiB.","supplyContactFieldChange":"Supply a contact field to change.","supplyInvoiceFieldChange":"Supply an invoice field to change.","supplyJournalFieldChange":"Supply a journal field to change."},"zoho":{"regions":{"au":{"title":"Australia (.com.au)"},"ca":{"title":"Canada (.ca)"},"cn":{"title":"China (.com.cn)"},"eu":{"title":"Europe (.eu)"},"in":{"title":"India (.in)"},"jp":{"title":"Japan (.jp)"},"sa":{"title":"Saudi Arabia (.sa)"},"us":{"title":"United States (.com)"}},"returnedTokenDifferentDataCenter":"Zoho returned a token for a different data center or environment."},"zohoBooks":{"chooseOrganisationIdOrganizationsList":"Choose an organisation ID from organizations.list or configure one for this integration.","configuredOrganisationNotActiveAccessible":"The configured Books organisation is not active and accessible to this account.","description":"Discover accessible organisations and read pages of contacts and invoices.","fields":{"organizationId":{"hint":"Set one organisation for this integration, or leave empty and let the app choose from the connected account's organisations.","label":"Organization ID (optional)"},"region":{"hint":"Choose the data center containing the Books account. Canada uses accounts.zohocloud.ca for OAuth.","label":"Data center"}},"integrationConfiguredDifferentOrganisation":"This integration is configured for a different organisation.","resourceNotAvailable":"This Books resource is not available.","returnedAmbiguousPagination":"Zoho Books returned ambiguous pagination.","returnedInvalidOrganisations":"Zoho Books returned invalid organisations.","scopes":{"billsAll":{"label":"Full access to bills"},"contactsAll":{"label":"Full access to contacts"},"creditnotesAll":{"label":"Full access to credit notes"},"customerpaymentsAll":{"label":"Full access to customer payments"},"estimatesAll":{"label":"Full access to estimates"},"expensesAll":{"label":"Full access to expenses"},"invoicesAll":{"label":"Full access to invoices"},"projectsAll":{"label":"Full access to projects"},"purchaseordersAll":{"label":"Full access to purchase orders"},"salesordersAll":{"label":"Full access to sales orders"},"zohoBooksContactsREAD":{"label":"Read contacts"},"zohoBooksInvoicesREAD":{"label":"Read invoices"},"zohoBooksSettingsREAD":{"label":"Read organisations and settings"}}},"zohoCrm":{"connectAgainPermissionsNeededOperation":"Connect again with the CRM permissions needed for this operation.","description":"Read the connected CRM user and pages of leads, contacts, accounts and deals.","fields":{"environment":{"hint":"Choose the same environment and organisation during Zoho consent. Tokens cannot be moved between environments.","items":{"developer":{"title":"Developer"},"production":{"title":"Production"},"sandbox":{"title":"Sandbox"}},"label":"CRM environment"},"region":{"hint":"Choose the data center containing your CRM account. Canada uses accounts.zohocloud.ca for OAuth.","label":"Data center"}},"resourceNotAvailable":"This CRM resource is not available.","scopes":{"zohoCRMModulesALL":{"label":"Full access to all CRM modules"},"zohoCRMModulesAccountsALL":{"label":"Full account access"},"zohoCRMModulesAccountsREAD":{"label":"Read accounts"},"zohoCRMModulesContactsALL":{"label":"Full contact access"},"zohoCRMModulesContactsREAD":{"label":"Read contacts"},"zohoCRMModulesDealsALL":{"label":"Full deal access"},"zohoCRMModulesDealsREAD":{"label":"Read deals"},"zohoCRMModulesLeadsALL":{"label":"Full lead access"},"zohoCRMModulesLeadsREAD":{"label":"Read leads"},"zohoCRMModulesREAD":{"label":"Read all CRM modules"},"zohoCRMUsersALL":{"label":"Full CRM user access"},"zohoCRMUsersREAD":{"label":"Read the connected CRM user"}},"useEitherPageNumberPage":"Use either a page number or a page token."}}}`);var en_default$5={jskit:jskit$5};var jskit$4={"connectors":{"configuration":{"accountModeUnsupported":`This provider does not support this account mode.`,"apiKeyRegistration":`API keys do not use an OAuth registration.`,"assistantActionUndeclared":`This provider does not declare this assistant action.`,"clientAuthenticationUnsupported":`This provider does not support this client authentication method.`,"clientId":`Check this provider's client identifier.`,"confidentialClientRequired":`Client credentials require a confidential client.`,"credentialModeUnsupported":`This provider configuration does not support this credential mode.`,"duplicateScope":`Select each permission only once.`,"invalid":`Invalid configuration.`,"invalidJson":`Enter valid JSON.`,"noCredentials":`This mode does not use credentials.`,"oauthFlowUnsupported":`This provider does not support this OAuth flow.`,"otherCredentialModeField":`This field belongs to another credential mode.`,"otherCredentialModeSetting":`This setting belongs to another credential mode.`,"providerSettings":`Check this provider's settings.`,"providerUnregistered":`Install and register this provider before using it.`,"refreshTokenClientCredentials":`Client credentials do not use a refresh token.`,"refreshTokenOAuthOnly":`Only an OAuth connection can start from a refresh token.`,"refreshTokenSharedOnly":`Only a shared connection can start from a refresh token in Env.`,"registrationSecret":`Use the registration's secret reference.`,"registrationUndefined":`Select a registration defined in this file.`,"requiredScopes":`Include this provider's required permissions.`,"schemaVersionUnsupported":`Use numeric schemaVersion 1; other versions require an explicit migration.`,"scopeRequired":`Select at least one permission.`,"scopeUnsupported":`A selected permission is not supported by this provider configuration.`,"secretReference":`Use a reference such as env:VARIABLE_NAME.`,"serviceAccountPerUser":`A service account cannot connect as each app user.`,"serviceAccountRegistration":`Service-account credentials do not use a browser OAuth registration.`,"stableName":`Use a stable lowercase name containing letters, digits and hyphens.`,"valueRequired":`This value is required.`},"connection":{"ambiguousPermissionGrant":`The provider did not return an unambiguous permission grant.`,"apiKeyBindingMissingInvalid":`The API key binding is missing or invalid.`,"assistantActionDisabled":`This assistant action is disabled.`,"authorizationAttemptInvalidExpired":`The authorization attempt is invalid or has expired.`,"authorizationCallbackInvalid":`The authorization callback is invalid.`,"callbackDoesNotMatchRegistration":`The callback does not match this registration.`,"callbackUrlDoesNotMeet":`The callback URL does not meet this provider's requirements.`,"checkOperationInputValues":`Check the operation's input values.`,"configureHttpsCallbackUrlLocal":`Configure an HTTPS callback URL, or a local development callback.`,"connectAccountAgain":`Connect this account again.`,"connectAgainPermissionRequiredOperation":`Connect again with the permission required for this operation.`,"connectAgainPermissionRequiredVerification":`Connect again with the permission required for verification.`,"connectionNotAllowed":`You cannot use this connection.`,"envRefreshTokenRejected":`The refresh token in Env no longer works; replace that Env value.`,"envSeeded":`This connection comes from an Env value; unlink or replace that value instead.`,"integrationNotConfigured":`This integration is not configured.`,"operationCancelled":`The operation was cancelled.`,"operationRequiresDifferentMethod":`This operation requires a different connection method.`,"operationRequiresPermissionAbsentApplication":`This operation requires a permission absent from the application's configuration.`,"providerClientIdNotConfigured":`The provider client ID is not configured.`,"providerDeniedOperation":`The provider denied this operation.`,"providerDoesNotDeclareAssistant":`This provider does not declare this assistant action.`,"providerInvalidCredentialPath":`This provider has an invalid credential path.`,"providerNonPkceFlowRequires":`This provider's non-PKCE flow requires a confidential client.`,"providerOperationInvalidDestination":`The provider operation has an invalid destination.`,"providerOperationNotAvailable":`This provider operation is not available.`,"providerRequestFailedTryAgain":`The provider request failed. Try again.`,"providerRequestLimitReached":`The provider's request limit was reached.`,"providerRequiresJsonRequestBody":`This provider requires a JSON request body.`,"providerReturnedInvalidAccountLabel":`The provider returned an invalid account label.`,"providerReturnedInvalidPermissionGrant":`The provider returned an invalid permission grant.`,"providerReturnedInvalidServiceAccount":`The provider returned an invalid service-account token.`,"providerReturnedUnexpectedResponse":`The provider returned an unexpected response.`,"refreshTokenBindingMissingInvalid":`The refresh token binding is missing or invalid.`,"requiredEnvironmentBindingMissing":`A required environment binding is missing.`,"requiredRegistrationBindingMissing":`A required registration binding is missing.`,"runtimeDoesNotYetSupport":`This runtime does not yet support the selected credential mode.`,"selectClientCredentialsConnectService":`Select client credentials to connect a service account.`,"selectMatchingCredentialModeVerify":`Select the matching credential mode to verify this connection.`,"selectServiceAccountCredentialsVerify":`Select service-account credentials to verify this connection.`,"serviceAccountCredentialBindingMissing":`The service-account credential binding is missing or invalid.`,"serviceAccountsConnectWithoutBrowser":`Service accounts connect without browser consent.`,"serviceAccountsDoNotUse":`Service accounts do not use an authorization callback.`,"verificationScopeAbsent":`Connection verification requires a permission absent from the application's configuration.`}},"errors":{"connector_approval_required":`Approve this assistant action before continuing.`,"connector_consent_denied":`Account access was declined.`,"connector_credentials_unavailable":`Stored credentials could not be opened.`,"connector_provider_timeout":`The provider request timed out. Try again.`,"connector_storage_invalid":`Connection state could not be read safely.`,"integration_configuration_invalid":`Integration configuration is invalid.`}};var en_default$4={jskit:jskit$4};var jskit$3={"connectors":{"configurationFields":{"accountMode":{"label":`Account used by the application`},"accountModes":{"assistant":`Assistant access`,"perUser":`Each app user's own account`,"shared":`One shared account`},"apiKeyReference":{"hint":`Store the API key in your environment or secret store. Enter its reference here, such as env:SERVICE_API_KEY.`,"label":`API key reference`},"ariaLabel":`{provider} configuration`,"assistant":{"defaultPermission":{"hint":`Changing this sets every assistant action below to the same choice.`,"label":`Manage all permissions`},"enabled":{"label":`Allow assistant access`},"hint":`These choices control assistant actions for this integration. They do not grant access to the provider or replace your application's permissions.`},"assistantPermissions":{"always":`Always allow`,"ask":`Ask each time`,"never":`Never allow`},"authentication":{"label":`Authentication`},"authenticationMethods":{"apiKey":`API key`,"none":`No credentials`,"oauth2":`OAuth`,"serviceAccount":`Service account`},"callbackUrl":{"label":`Callback URL`},"callbackUrlReference":{"hint":`Reference the callback route implemented by your application and registered with the provider.`,"label":`Callback URL reference`},"clientId":{"label":`Client ID`},"clientSecretReference":{"hint":`Use an environment reference such as env:{prefix}_CLIENT_SECRET. Keep the value outside this file.`,"label":`Client secret reference`},"displayName":{"label":`Display name`},"grantType":{"label":`OAuth flow`},"grantTypes":{"authorizationCode":`User consent`,"clientCredentials":`Service account`},"panels":{"assistant":`Assistant permissions`,"credentials":`Credentials`,"details":`Details`,"permissions":`Permissions`},"permissions":{"hint":`Choose what the application needs. The account owner approves these permissions when connecting.`},"registration":{"label":`App registration`},"serviceAccountReference":{"hint":`Store the service credential in your environment or secret store and enter its reference here.`,"label":`Service-account credential reference`}}}};var en_default$3={jskit:jskit$3};var jskit$2={"http":{"request":{"failedWithStatus":`Request failed with status {status}.`,"networkFailed":`Network request failed.`}},"errors":{"jsonapi_request_body_invalid":`JSON:API request body must contain a resource document.`,"jsonapi_request_type_mismatch":`JSON:API resource type must be {type}.`}};var en_default$2={jskit:jskit$2};var jskit$1={"errors":{"payment_plan_unknown":`Select a published payment plan.`,"payment_readiness_invalid":`App readiness checks must return bounded status and safe explanatory text.`,"payment_forbidden":`You cannot manage this billable account.`,"payment_operation_conflict":`The pending payment operation changed.`,"payment_request_invalid":`Supply a stable checkout request identifier.`,"payment_subscription_exists":`Manage the existing subscription through billing instead of starting another checkout.`,"payment_history_unavailable":`Billing history could not be loaded. Check provider access and retry.`,"payment_customer_missing":`Create a billing account first.`,"payment_reconciliation_required":`Provider inspection did not resolve this request.`,"payment_customer_conflict":`This provider customer is already bound to a different billable subject.`,"payment_catalogue_pending":`Another catalogue request needs resolution.`,"payment_catalogue_uncertain":`Catalogue publication stopped. Inspect the pending provider request before retrying; completed items are preserved.`,"payment_balance_limit":`Credit balance exceeds the supported integer range.`,"payment_feature_required":`Your subscription does not include this feature.`,"payment_insufficient_credits":`Not enough credits for this action.`,"payment_debit_missing":`No debit exists for this reference.`,"payment_customer_unbound":`Bind this provider customer before processing its events.`,"payment_sandbox_only":`Only production takes real payments: use the sandbox payment environment.`},"payments":{"scope":{"readinessMismatch":`Readiness returned a different payment account or environment.`,"catalogueMismatch":`Catalogue scope does not match its configured environment.`,"merchantMismatch":`The payment scope does not match this environment's merchant configuration.`},"operation":{"unfinished":`Inspect the unfinished provider request before retrying.`,"mayHaveSucceeded":`Inspect this account's provider activity before retrying; the request may have succeeded.`},"input":{"billingEmail":`Supply the authenticated billing contact's email.`,"historyPage":`Select billing subscriptions or transactions and a valid page cursor.`,"historyCollection":`Select a billing history collection.`,"recoveryObjectId":`Supply the exact provider object ID to recover.`,"reference":`Use a nonempty business reference of at most 150 characters.`,"creditQuantity":`Use a positive integer credit quantity, at most one billion.`,"timestamp":`Use an integer UTC timestamp in milliseconds.`},"reference":{"otherPlan":`The checkout request already selected another plan.`,"differentInputs":`This business reference was already used with different inputs.`},"provider":{"checkAccount":`Check the {provider} account, price mapping and subscription shape.`,"unsupportedEvent":`The event is not a supported subscription payment for this customer.`,"objectIdMissing":`The provider did not return an object ID.`,"subscriptionBinding":`Check the provider subscription and logical price binding.`,"renewalBinding":`Check the renewal's logical price binding.`},"webhook":{"rawBodyRequired":`Supply the unmodified webhook request bytes.`,"verificationFailed":`{provider} webhook verification failed.`},"configuration":{"invalid":`Check the application's payment configuration.`,"taxCategoryUnpublishable":`Set the application's Paddle product tax category before publishing.`,"sharedConnectionRequired":`Select a shared Stripe or Paddle connection with a backend API-key Env reference for {environment}.`,"paddleEnvironment":`Select a Paddle connection configured for {environment}.`,"paddleTaxCategory":`Choose the Paddle tax category for the products this app sells.`,"paddleClientToken":`Set the Env reference for this environment's Paddle public client token.`},"catalogue":{"reviewFirst":`Review the current catalogue and resolve provider drift or unfinished requests first.`,"publicationChanged":`Another publication changed the catalogue; review again.`,"planChanged":`This plan changed; review again.`,"productChanged":`This product changed; review again.`,"priceChanged":`This price changed; review again.`,"pendingCatalogueRequestChanged":`The pending catalogue request changed.`,"recoveryReviewChanged":`The recovery review changed. Inspect the current pending operation first.`,"pendingRequestChanged":`The pending request changed.`,"objectMismatch":`The provider object does not match the pending operation.`}}};var en_default$1={jskit:jskit$1};var jskit={"uploads":{"file":{"invalid":`Upload is invalid.`,"tooLarge":`{label} file is too large. Maximum allowed size is {maxMb}MB.`,"empty":`{label} file is empty.`,"typeNotAllowed":`{label} must be one of: {types}.`,"tooMany":`{label} upload allows only one file.`,"required":`{label} file is required.`,"fieldNotAllowed":`{label} field "{field}" is not allowed.`}}};var en_default={jskit};function normalizeComponentId(value){const id=String(value||``).trim();if(!id)throw new TypeError(`Client component id is required.`);return id}function createClientComponentRegistry(){const components=new Map;function register(id,component){const componentId=normalizeComponentId(id);if(component==null)throw new TypeError(`Client component "${componentId}" is required.`);if(components.has(componentId))throw new Error(`Client component "${componentId}" is duplicated.`);components.set(componentId,component);return api}function has(id){return components.has(normalizeComponentId(id))}function get(id){const componentId=normalizeComponentId(id);if(!components.has(componentId))throw new Error(`Client component "${componentId}" is not registered.`);return components.get(componentId)}function ids(){return Object.freeze([...components.keys()].sort())}const api=Object.freeze({register,has,get,ids});return api}function normalizePackageMetadataUiRoutes(value){const routeEntries=Array.isArray(value)?value:[];const normalizedRoutes=[];for(const routeEntry of routeEntries){if(!isRecord(routeEntry))continue;try{normalizedRoutes.push(Object.freeze(JSON.parse(JSON.stringify(routeEntry))))}catch{}}return Object.freeze(normalizedRoutes)}function normalizePackageMetadataClientProviders(value){const entries=Array.isArray(value)?value:[];const providers=[];for(const entry of entries){if(!isRecord(entry))continue;const exportName=String(entry.export||``).trim();if(!exportName)continue;providers.push(Object.freeze({export:exportName,entrypoint:String(entry.entrypoint||``).trim()}))}return Object.freeze(providers)}function normalizePackageId(value){return String(value||``).trim()}function toRouteSnapshot(route){const metaJskit=isRecord(route?.meta?.jskit)?route.meta.jskit:{};return Object.freeze({id:String(route?.id||``).trim(),name:String(route?.name||``).trim(),path:String(route?.path||``).trim(),scope:String(route?.scope||``).trim(),surface:String(route?.surface||``).trim(),metaScope:String(metaJskit.scope||``).trim(),metaSurface:String(metaJskit.surface||``).trim()})}function isRouteComponent(value){if(typeof value===`function`)return true;return isRecord(value)}function normalizeRoute(route,{packageId,index}){if(!isRecord(route))throw new TypeError(`Client route #${index} from ${packageId} must be an object.`);const id=String(route.id||``).trim();const path=String(route.path||``).trim();if(!id)throw new Error(`Client route #${index} from ${packageId} requires id.`);if(!path||!path.startsWith(`/`)||path.startsWith(`//`))throw new Error(`Client route "${id}" from ${packageId} must use an absolute path.`);if(!isRouteComponent(route.component))throw new Error(`Client route "${id}" from ${packageId} requires component.`);const scope=String(route.scope||`surface`).trim().toLowerCase();if(scope!==`global`&&scope!==`surface`)throw new Error(`Client route "${id}" from ${packageId} has invalid scope "${scope}".`);const surface=String(route.surface||``).trim().toLowerCase();const baseMeta=isRecord(route.meta)?route.meta:{};const baseMetaJskit=isRecord(baseMeta.jskit)?baseMeta.jskit:{};return Object.freeze({...route,id,path,scope,...surface?{surface}:{},meta:{...baseMeta,jskit:{...baseMetaJskit,packageId,routeId:id,scope}}})}function normalizeRouteList(routes,{packageId}){return Object.freeze((Array.isArray(routes)?routes:[]).map((route,index)=>normalizeRoute(route,{packageId,index:index+1})))}function toVueRouteRecord(route){const nextMeta=isRecord(route.meta)?{...route.meta}:void 0;const routeRecord={path:route.path,component:route.component,...route.name?{name:route.name}:{},...route.props!==void 0?{props:route.props}:{},...route.redirect!==void 0?{redirect:route.redirect}:{},...route.children!==void 0?{children:route.children}:{},...nextMeta?{meta:nextMeta}:{}};return Object.freeze(routeRecord)}function registerClientModuleRoutes({packageId,routes,router,surfaceRuntime,surfaceMode,seenRoutePaths,seenRouteNames,logger,source,packageMetadataRouteDeclarations}){const normalizedPackageId=normalizePackageId(packageId);if(!normalizedPackageId)throw new TypeError(`registerClientModuleRoutes requires packageId.`);const normalizedRoutes=normalizeRouteList(routes,{packageId:normalizedPackageId});assertRoutesDeclaredInPackageMetadata({packageId:normalizedPackageId,source,normalizedRoutes,packageMetadataRouteDeclarations});const activeRoutes=filterRoutesBySurface(normalizedRoutes,{surfaceRuntime,surfaceMode});const log=createStructuredLogger(logger);if(log.isDebugEnabled)log.debug({packageId:normalizedPackageId,source,surfaceMode:String(surfaceMode||``).trim(),declaredRoutes:normalizedRoutes.map(toRouteSnapshot),activeRoutes:activeRoutes.map(toRouteSnapshot)},`Client route registration analysis.`);const declaredPaths=normalizedRoutes.map(route=>route.path);const activePaths=activeRoutes.map(route=>route.path);let registeredCount=0;for(const route of activeRoutes){const normalizedPath=String(route.path||``).trim();if(seenRoutePaths.has(normalizedPath))throw new Error(`Client route path "${normalizedPath}" is duplicated (package ${normalizedPackageId}).`);const normalizedName=String(route.name||``).trim();if(normalizedName){if(seenRouteNames.has(normalizedName))throw new Error(`Client route name "${normalizedName}" is duplicated (package ${normalizedPackageId}).`);seenRouteNames.add(normalizedName)}seenRoutePaths.add(normalizedPath);router.addRoute(toVueRouteRecord(route));if(log.isDebugEnabled)log.debug({packageId:normalizedPackageId,source,route:toRouteSnapshot(route)},`Added client route to router.`);registeredCount+=1}return Object.freeze({packageId:normalizedPackageId,source,declaredCount:normalizedRoutes.length,registeredCount,declaredPaths:Object.freeze(declaredPaths),activePaths:Object.freeze(activePaths)})}function resolvePackageMetadataProviders(moduleNamespace,packageId,packageMetadataClientProviders=[]){const providers=[];const seenProviderIds=new Set;for(const providerDeclaration of packageMetadataClientProviders){const exportName=String(providerDeclaration?.export||``).trim();if(!exportName)continue;const providerValue=moduleNamespace?.[exportName];let provider=null;try{provider=defineProvider(providerValue)}catch(error){throw new TypeError(`Client module ${packageId} packageMetadata provider export "${exportName}" must be a capability provider: ${error.message}`,{cause:error})}const providerId=provider.id;if(seenProviderIds.has(providerId))continue;seenProviderIds.add(providerId);providers.push(provider)}return providers}function resolveModuleProviders(moduleNamespace,packageId,packageMetadataClientProviders=[]){if(!isRecord(moduleNamespace))return[];return resolvePackageMetadataProviders(moduleNamespace,packageId,packageMetadataClientProviders)}function buildPackageMetadataRouteDeclarationIndex({packageId,packageMetadataUiRoutes=[]}={}){const normalizedPackageId=normalizePackageId(packageId);const packageMetadataRoutes=normalizePackageMetadataUiRoutes(packageMetadataUiRoutes);const byId=new Map;for(const packageMetadataRoute of packageMetadataRoutes){const routeId=String(packageMetadataRoute.id||``).trim();const routePath=String(packageMetadataRoute.path||``).trim();const routeScope=String(packageMetadataRoute.scope||`surface`).trim().toLowerCase();if(!routeId||!routePath)continue;if(byId.has(routeId)){const existingRoute=byId.get(routeId);if(existingRoute.path!==routePath||existingRoute.scope!==routeScope)throw new Error(`PackageMetadata ui routes for ${normalizedPackageId} define duplicate id "${routeId}" with conflicting declarations.`);continue}byId.set(routeId,Object.freeze({id:routeId,path:routePath,scope:routeScope}))}return Object.freeze({byId})}function assertRoutesDeclaredInPackageMetadata({packageId,source,normalizedRoutes=[],packageMetadataRouteDeclarations=null}={}){if(String(source||``).trim()!==`clientRoutes`)return;const byId=packageMetadataRouteDeclarations?.byId instanceof Map?packageMetadataRouteDeclarations.byId:new Map;const normalizedPackageId=normalizePackageId(packageId);for(const route of normalizedRoutes){const routeId=String(route?.id||``).trim();const routePath=String(route?.path||``).trim();if(String(route?.scope||`surface`).trim().toLowerCase()!==`global`)continue;const declaredRoute=byId.get(routeId);if(!declaredRoute)throw new Error(`Global client route "${routeId}" from ${normalizedPackageId} (${source}) must be declared in metadata.ui.routes (id "${routeId}", path "${routePath}") with scope:"global" and autoRegister:false.`);if(String(declaredRoute.path||``).trim()!==routePath)throw new Error(`Global client route "${routeId}" from ${normalizedPackageId} (${source}) path "${routePath}" does not match packageMetadata metadata.ui.routes path "${declaredRoute.path}".`);if(String(declaredRoute.scope||``).trim().toLowerCase()!==`global`)throw new Error(`Global client route "${routeId}" from ${normalizedPackageId} (${source}) must be declared with scope:"global" in metadata.ui.routes.`)}}function resolvePackageMetadataClientRoutes({packageId,packageMetadataUiRoutes=[],routeComponents={},logger}={}){const normalizedPackageId=normalizePackageId(packageId);const packageMetadataRoutes=normalizePackageMetadataUiRoutes(packageMetadataUiRoutes);if(packageMetadataRoutes.length<1)return Object.freeze([]);if(!isRecord(routeComponents))throw new TypeError(`Client module ${normalizedPackageId} declares packageMetadata ui routes but does not export a routeComponents map.`);const log=createStructuredLogger(logger);const routes=[];const skippedRoutes=[];for(const packageMetadataRoute of packageMetadataRoutes){const routeId=String(packageMetadataRoute.id||``).trim();const routePath=String(packageMetadataRoute.path||``).trim();if(!(packageMetadataRoute.autoRegister!==false)){skippedRoutes.push(Object.freeze({id:routeId,path:routePath,reason:`autoRegister=false`}));continue}if(!routeId||!routePath)throw new Error(`PackageMetadata ui route from ${normalizedPackageId} requires id and path when autoRegister is enabled.`);const componentKey=String(packageMetadataRoute.componentKey||``).trim();if(!componentKey)throw new Error(`PackageMetadata ui route "${routeId}" from ${normalizedPackageId} requires componentKey when autoRegister is enabled.`);const routeComponent=routeComponents[componentKey];if(!isRouteComponent(routeComponent))throw new Error(`PackageMetadata ui route "${routeId}" from ${normalizedPackageId} references unknown routeComponents key "${componentKey}".`);const scope=String(packageMetadataRoute.scope||`surface`).trim().toLowerCase();const surface=String(packageMetadataRoute.surface||``).trim().toLowerCase();const guard=isRecord(packageMetadataRoute.guard)?{...packageMetadataRoute.guard}:{};const baseMeta=isRecord(packageMetadataRoute.meta)?{...packageMetadataRoute.meta}:{};const baseMetaJskit=isRecord(baseMeta.jskit)?{...baseMeta.jskit}:{};routes.push(Object.freeze({id:routeId,path:routePath,scope,...surface?{surface}:{},...String(packageMetadataRoute.name||``).trim()?{name:String(packageMetadataRoute.name||``).trim()}:{},component:routeComponent,meta:{...baseMeta,...Object.keys(guard).length>0?{guard}:{},jskit:{...baseMetaJskit,packageId:normalizedPackageId,routeId,scope,componentKey,source:`packageMetadata.ui.routes`}}}))}log.debug({packageId:normalizedPackageId,packageMetadataRouteCount:packageMetadataRoutes.length,autoRegisterRouteCount:routes.length,skippedRoutes},`Processed packageMetadata ui routes.`);return Object.freeze(routes)}function normalizeClientModuleEntries(clientModules){if(!Array.isArray(clientModules))return[];return clientModules.map(entry=>{const packageId=normalizePackageId(entry?.packageId);const moduleNamespace=isRecord(entry?.module)?entry.module:null;if(!packageId||!moduleNamespace)return null;return Object.freeze({packageId,module:moduleNamespace,packageMetadataUiRoutes:normalizePackageMetadataUiRoutes(entry?.packageMetadataUiRoutes),packageMetadataClientProviders:normalizePackageMetadataClientProviders(entry?.packageMetadataClientProviders)})}).filter(Boolean).sort((left,right)=>left.packageId.localeCompare(right.packageId))}function createClientRuntime({profile,providers,app,pinia,queryClient,router,env,logger,surfaceRuntime,surfaceMode}){const components=createClientComponentRegistry();const runtime=createCapabilityRuntime({profile,providers,inputs:{"client.vue":app,"client.router":router,"client.pinia":pinia,"client.query":queryClient,"client.env":Object.freeze({...isRecord(env)?env:{}}),"client.surface":surfaceRuntime,"client.surface-mode":String(surfaceMode||``).trim(),"client.logger":logger,"client.components":components}});return Object.freeze({runtime,components})}async function bootClientModules({clientModules,app,pinia,queryClient,router,surfaceRuntime,surfaceMode,env,logger}){const log=createStructuredLogger(logger);const moduleEntries=normalizeClientModuleEntries(clientModules);const providers=[];const seenProviderIds=new Set;log.debug({surfaceMode:String(surfaceMode||``).trim(),normalizedSurfaceMode:String(surfaceRuntime.normalizeSurfaceMode(surfaceMode)||``).trim(),moduleCount:moduleEntries.length,modules:moduleEntries.map(entry=>entry.packageId)},`Starting JSKIT client module bootstrap.`);for(const entry of moduleEntries){const moduleProviders=resolveModuleProviders(entry.module,entry.packageId,entry.packageMetadataClientProviders);log.debug({packageId:entry.packageId,providerExports:moduleProviders.map(provider=>provider.id),hasClientRoutes:Array.isArray(entry.module.clientRoutes)&&entry.module.clientRoutes.length>0},`Discovered client module capabilities.`);for(const provider of moduleProviders){const providerId=provider.id;if(seenProviderIds.has(providerId))throw new Error(`Client provider id "${providerId}" is duplicated.`);seenProviderIds.add(providerId);providers.push(provider)}}const clientRuntime=createClientRuntime({profile:String(surfaceRuntime.normalizeSurfaceMode(surfaceMode)||`client`),providers,app,pinia,queryClient,router,env,logger:log,surfaceRuntime,surfaceMode});await clientRuntime.runtime.start();const seenRoutePaths=new Set;const seenRouteNames=new Set;const routeResults=[];const registerRoutesForEntry=(routeList,packageId,source,packageMetadataRouteDeclarations)=>{if(!routeList||routeList.length===0)return null;const result=registerClientModuleRoutes({packageId,routes:routeList,router,surfaceRuntime,surfaceMode,seenRoutePaths,seenRouteNames,logger:log,source,packageMetadataRouteDeclarations});log.debug({packageId,source,declaredPaths:result.declaredPaths,activePaths:result.activePaths,registeredCount:result.registeredCount},`Registered client module routes.`);if(log.isDebugEnabled)log.debug({packageId,source,routerRoutes:summarizeRouterRoutes(router)},`Router route table after client route registration.`);routeResults.push(result);return result};for(const entry of moduleEntries){const packageMetadataRouteDeclarations=buildPackageMetadataRouteDeclarationIndex({packageId:entry.packageId,packageMetadataUiRoutes:entry.packageMetadataUiRoutes});registerRoutesForEntry(resolvePackageMetadataClientRoutes({packageId:entry.packageId,packageMetadataUiRoutes:entry.packageMetadataUiRoutes,routeComponents:entry.module.routeComponents,logger:log}),entry.packageId,`packageMetadata.ui.routes`,packageMetadataRouteDeclarations);registerRoutesForEntry(Array.isArray(entry.module.clientRoutes)?entry.module.clientRoutes:[],entry.packageId,`clientRoutes`,packageMetadataRouteDeclarations)}const registeredRouteCount=routeResults.reduce((sum,result)=>sum+result.registeredCount,0);if(moduleEntries.length>0){log.debug({modules:moduleEntries.map(entry=>entry.packageId),providerCount:providers.length,routeCount:registeredRouteCount},`Booted JSKIT client modules.`);if(log.isDebugEnabled)log.debug({routerRoutes:summarizeRouterRoutes(router),currentPath:pagePathname$1()},`JSKIT client bootstrap final route table.`)}return Object.freeze({runtime:clientRuntime.runtime,components:clientRuntime.components,modules:Object.freeze(moduleEntries.map(entry=>entry.packageId)),providerCount:providers.length,routeResults:Object.freeze(routeResults),routeCount:registeredRouteCount})}[en_default$12,en_default$8,en_default$14,en_default$6,en_default$5,en_default$4,en_default$3,en_default$2,en_default$9,en_default$1,en_default$7,en_default$10,en_default$11,en_default].forEach(registerJskitMessages);var installedClientModules=Object.freeze([{packageId:`@jskit-ai/assistant-core`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/assistant-runtime`,module:Object.freeze({AssistantClientProvider}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[{"export":`AssistantClientProvider`,"entrypoint":`src/client/providers/AssistantClientProvider.js`}]},{packageId:`@jskit-ai/assistant-voice`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/connectors-web`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/http-runtime`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/http-web`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/material-web`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/realtime`,module:Object.freeze({RealtimeClientProvider}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[{"export":`RealtimeClientProvider`,"entrypoint":`src/client/RealtimeClientProvider.js`}]},{packageId:`@jskit-ai/shell-web`,module:Object.freeze({ShellWebClientProvider}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[{"export":`ShellWebClientProvider`,"entrypoint":`src/client/providers/ShellWebClientProvider.js`}]},{packageId:`@jskit-ai/uploads-runtime`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/main`,module:client_exports,packageMetadataUiRoutes:[],packageMetadataClientProviders:[{"export":`MainClientProvider`,"entrypoint":`src/client/providers/MainClientProvider.js`}]},{packageId:`@local/vibe64-accounts`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-ai-tasks`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-colleague`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-database-tools`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-pages`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-system-graph`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-usage-recording`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-voice`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]}]);async function bootInstalledClientModules(context={}){return bootClientModules({...context,clientModules:installedClientModules})}var surfaceAccessPolicies={};surfaceAccessPolicies.public={};var config={};config.tenancyMode=`none`;config.realtimeClient={options:{transports:[`websocket`]}};config.surfaceModeAll=`all`;config.surfaceDefaultId=`app`;config.webRootAllowed=`yes`;config.surfaceAccessPolicies=surfaceAccessPolicies;config.mobile={enabled:false,strategy:``,appId:``,appName:``,assetMode:`bundled`,devServerUrl:``,apiBaseUrl:``,auth:{callbackPath:`/auth/login`,customScheme:``,appLinkDomains:[]},android:{packageName:``,minSdk:26,targetSdk:35,versionCode:1,versionName:`1.0.0`}};config.surfaceDefinitions={};config.surfaceDefinitions.app={id:`app`,label:`Sessions`,pagesRoot:`app`,enabled:true,requiresAuth:false,requiresWorkspace:false,accessPolicyId:`public`,origin:``};config.assistantSurfaces={app:{settingsSurfaceId:`app`,configScope:`global`}};var BROWSER_LIFECYCLE_WEBSOCKET_PATH=`/api/studio/browser-lifecycle/ws`;var BROWSER_LIFECYCLE_DISCONNECTED_EVENT=`vibe64:browser-lifecycle-disconnected`;function noopLifecycleConnection(){return{close(){}}}function createBrowserLifecycleDisconnectedEvent(browserWindow,detail={}){const CustomEventCtor=browserWindow?.CustomEvent||globalThis.CustomEvent;if(typeof CustomEventCtor===`function`)return new CustomEventCtor(BROWSER_LIFECYCLE_DISCONNECTED_EVENT,{detail});const EventCtor=browserWindow?.Event||globalThis.Event;if(typeof EventCtor===`function`){const event=new EventCtor(BROWSER_LIFECYCLE_DISCONNECTED_EVENT);event.detail=detail;return event}return{detail,type:BROWSER_LIFECYCLE_DISCONNECTED_EVENT}}function connectBrowserLifecycleSocket({browserWindow=typeof window!==`undefined`?window:null,WebSocketCtor=typeof WebSocket!==`undefined`?WebSocket:null}={}){if(!browserWindow||typeof WebSocketCtor!==`function`)return noopLifecycleConnection();let socket=null;let connected=false;let closeBrowserOnDisconnect=false;let pageUnloading=false;let stopped=false;const markPageUnloading=()=>{pageUnloading=true};const removeUnloadListeners=()=>{browserWindow.removeEventListener(`beforeunload`,markPageUnloading);browserWindow.removeEventListener(`pagehide`,markPageUnloading)};const closeWindowIfServerDisconnected=()=>{removeUnloadListeners();if(connected&&!stopped&&!pageUnloading)browserWindow.dispatchEvent(createBrowserLifecycleDisconnectedEvent(browserWindow,{closeBrowserOnDisconnect}));if(connected&&closeBrowserOnDisconnect&&!stopped&&!pageUnloading)browserWindow.close()};const receiveLifecycleState=event=>{try{const message=JSON.parse(String(event?.data||``));if(message?.type===`browser-lifecycle-state`)closeBrowserOnDisconnect=message.closeBrowserOnDisconnect===true}catch{}};browserWindow.addEventListener(`beforeunload`,markPageUnloading);browserWindow.addEventListener(`pagehide`,markPageUnloading);try{socket=new WebSocketCtor(resolveWebSocketUrl$1(BROWSER_LIFECYCLE_WEBSOCKET_PATH,browserWindow))}catch{removeUnloadListeners();return noopLifecycleConnection()}socket.addEventListener(`open`,()=>{connected=true});socket.addEventListener(`message`,receiveLifecycleState);socket.addEventListener(`close`,closeWindowIfServerDisconnected);return{close(){stopped=true;removeUnloadListeners();socket.close()}}}function bootBrowserLifecycle(options={}){return connectBrowserLifecycleSocket(options)}var APPEARANCE_STORAGE_KEY=`vibe64.appearance`;var APPEARANCE_CHOICES=Object.freeze([`light`,`dark`,`system`]);function readAppearance(){const value=readLocalStorageJson(APPEARANCE_STORAGE_KEY,`system`);return APPEARANCE_CHOICES.includes(value)?value:`system`}function writeAppearance(value){if(APPEARANCE_CHOICES.includes(value))writeLocalStorageJson(APPEARANCE_STORAGE_KEY,value)}configureHttpWebClient({csrf:{enabled:false},resolveRequestUrl(url){return resolveStudioRequestUrl(url)}});bootBrowserLifecycle();var surfaceRuntime=createSurfaceRuntime({allMode:config.surfaceModeAll,surfaces:config.surfaceDefinitions,defaultSurfaceId:config.surfaceDefaultId});var surfaceMode=surfaceRuntime.normalizeSurfaceMode(void 0);var{router,fallbackRoute}=createSurfaceShellRouter({createRouter,history:createWebHistory(),routes,surfaceRuntime,surfaceMode,notFoundComponent:_sfc_main$10,guard:{surfaceDefinitions:config.surfaceDefinitions,defaultSurfaceId:config.surfaceDefaultId,webRootAllowed:config.webRootAllowed}});function menuAndDialogMotion(defaults){if(!hasWindowFunction$1(`matchMedia`)||!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return defaults;return{...defaults,...Object.fromEntries([`VMenu`,`VSelect`,`VAutocomplete`,`VCombobox`,`VDialog`].map(name=>[name,{...defaults?.[name],transition:false}]))}}var materialOptions=createMaterialVuetifyOptions(theme);var vuetify=createVuetify({...materialOptions,defaults:menuAndDialogMotion(materialOptions.defaults),theme:{...materialOptions.theme,defaultTheme:readAppearance()}});var pinia=createPinia();var queryClient=new QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:false,refetchOnReconnect:true,retry:shouldRetryTransientQueryFailure,retryDelay:transientQueryRetryDelay}}});bootstrapClientShellApp({createApp,rootComponent:_sfc_main$11,appConfig:config,appPlugins:[pinia,[VueQueryPlugin,{queryClient}],vuetify],pinia,queryClient,router,bootClientModules:bootInstalledClientModules,surfaceRuntime,surfaceMode,env:{"BASE_URL":`/`,"DEV":false,"MODE":`production`,"PROD":true,"SSR":false},fallbackRoute}).catch(error=>{console.error(`Failed to bootstrap client app.`,error);const status=document.getElementById(`startup-status`);if(status)status.textContent=`Vibe64 could not open. Reload the page to try again.`;const shell=document.getElementById(`startup-shell`);if(shell)shell.dataset.startup=`failed`});export{ENV_DOWNLOAD_ENDPOINT as $,VCheckbox as $a,inject$1 as $c,VTab as $i,vibe64AgentAttachmentPath as $n,VIBE64_LEARNING_MODE_PROJECT_CODE as $o,readRefOrGetterValue as $r,convertToUnit as $s,useModelRouting as $t,mergeConversationLogPages as A,useSelectionMenu as Aa,vModelSelect as Ac,AssistantAttachmentPreview_default as Ai,reactive as Al,AUTO_SAVE_SETTING as An,useDimension as Ao,vibe64SourceEditorExplanationStopPath as Ar,elementSlotTarget as As,useVibe64Terminal as At,accountRowsForStatus as B,VMenu as Ba,createCommentVNode as Bc,AssistantGoalControl_default as Bi,normalizeProps as Bl,sameVibe64AssistantSelection as Bn,formatMessage as Bo,vibe64TemporaryConversationsPath as Br,useProxiedModel as Bs,StudioErrorNotice_default as Bt,useShellWindowSizeClass as C,VAutocomplete as Ca,NavigationFailureType as Cc,VoiceConversationHost_default as Ci,customRef as Cl,assistantRoutingRequestForDisplay as Cn,useBorder as Co,vibe64SessionQueryKey as Cr,VIBE64_COLLEAGUE_INTEGRATIONS_KEY as Cs,projectSelectionQueryKey as Ct,createAssistantApi as D,makeFilterProps as Da,useQueryClient as Dc,VoiceAvatar_default as Di,markRaw as Dl,AFTER_PLAN_MANDATORY_PASSES as Dn,useBackgroundColor as Do,vibe64SourceEditorDownloadPath as Dr,VIBE64_COLLEAGUE_PREVIEW_KEY as Ds,Vibe64CopyCommand_default as Dt,useAssistantConversationFactory as E,useMenuActivator as Ea,useRouter$1 as Ec,useVoiceLauncher as Ei,isRef as El,assistantRoutingStatusLabel as En,useRounded as Eo,vibe64SourceEditorCreateFilePath as Er,VIBE64_COLLEAGUE_PLAN_KEY as Es,ToolInstallRow_default as Et,onVibe64AccountConnectionsDialogRequested as F,makeVTextFieldProps as Fa,Fragment as Fc,useAssistantSuggestions as Fi,toRef as Fl,VIBE64_DEFAULT_AGENT_PROVIDER_ID as Fn,dynamicImportErrorMessage as Fo,vibe64SourceEditorResolvePathPath as Fr,provideTheme as Fs,readLocalStorageJson as Ft,onVibe64AiOnboardingRequested as G,VListSubheader as Ga,createTextVNode as Gc,_sfc_main$99 as Gi,__exportAll as Gl,VIBE64_SESSION_CHANGED_EVENT as Gn,scopedDevelopmentApiUrl as Go,browserSessionStorage as Gr,injectNestedDefaults as Gs,useVibe64Accounts as Gt,aiOnboardingAvailable as H,VList as Ha,createPropsRestProxy as Hc,AssistantPromptInput_default as Hi,toDisplayString as Hl,VIBE64_ARCHIVED_SESSIONS_API_SUFFIX as Hn,revealCurrentStep as Ho,vibe64BrowserTabOriginId as Hr,useRender as Hs,vibe64ApiResponseError as Ht,requestVibe64AccountConnectionsDialog as I,VField as Ia,Teleport as Ic,AssistantConversationElement_default as Ii,toRefs as Il,defaultVibe64AgentSettings as In,isDynamicImportError as Io,vibe64SourceEditorSearchPath as Ir,useTheme as Is,stableLocalStorageKeyPart as It,useVibe64Learning as J,VListItemSubtitle as Ja,defineComponent$1 as Jc,parseLongTextReviewBlocks as Ji,VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT as Jn,validateSchemaPayload as Jo,hasWindowFunction$1 as Jr,propsFactory as Js,repositoryUpdateRelationship as Jt,requestVibe64AiOnboarding as K,VListItem as Ka,createVNode as Kc,LongTextPreviewBlocks_default as Ki,__toCommonJS as Kl,VIBE64_SESSION_SUMMARY_CHANGED_EVENT as Kn,studioApiPath as Ko,dataTransferItemEntry as Kr,provideDefaults as Ks,VIBE64_UPLOAD_MAX_BYTES as Kt,useVibe64AssistantCatalog as L,makeVFieldProps as La,computed as Lc,AssistantModelControl_default as Li,toValue as Ll,findVibe64AgentProvider as Ln,registerJskitMessages as Lo,vibe64SourceEditorStarsPath as Lr,useDisplay as Ls,writeLocalStorageJson as Lt,normalizeConversationLogPagination as M,useFocusRepair as Ma,vShow as Mc,assistantAttachmentFilesFromDropEvent as Mi,ref as Ml,vibe64AssistantSelectionLabel as Mn,VExpandTransition as Mo,vibe64SourceEditorExplanationsStreamPath as Mr,useLayout as Ms,Vibe64Terminal_default as Mt,latestAssistantQuestionsAwaitingUserReply as N,VVirtualScroll as Na,withKeys as Nc,assistantAttachmentFilesFromPasteEvent as Ni,shallowRef as Nl,vibe64ProviderPresentation as Nn,makeTagProps as No,vibe64SourceEditorFilePath as Nr,useLayoutItem as Ns,writeClipboardText as Nt,normalizeConversationTurn as O,useFilter as Oa,Transition as Oc,draftWithRestoredMessage as Oi,onScopeDispose as Ol,AFTER_PLAN_PASS_ORDER as On,useTextColor as Oo,vibe64SourceEditorExplanationFollowupsStreamPath as Or,VIBE64_COLLEAGUE_VIEW_KEY as Os,ProviderAccountsSetup_default as Ot,Vibe64SessionAssistantMenu_default as P,VTextField as Pa,withModifiers as Pc,useAssistantQuestions as Pi,toRaw as Pl,VIBE64_AGENT_PROVIDERS as Pn,ROUTE_VISIBILITY_PUBLIC as Po,vibe64SourceEditorFilesPath as Pr,makeThemeProps as Ps,positiveNumber as Pt,ENGINEERING_ENDPOINT as Q,VChipGroup as Qa,hasInjectionContext as Qc,VTabs as Qi,vibe64AgentAttachmentFilePath as Qn,VIBE64_LEARNING_MODE_NOTE as Qo,writePageClipboardText as Qr,clamp$1 as Qs,ModelRoutingForm_default as Qt,provideVibe64OpenedProjectSlug as R,VCounter as Ra,createBaseVNode as Rc,AssistantQuestionInputs_default as Ri,unref as Rl,normalizeVibe64AgentSettings as Rn,useJskitText as Ro,vibe64SourceEditorTreePath as Rr,useLocale as Rs,Vibe64TerminalSurface_default as Rt,createShellPageActionsRegistry as S,makeVDialogProps as Sa,loadRouteLocation as Sc,useVibe64Voice as Si,withDirectives as Sl,assistantRoutingRequestCanBeReplaced as Sn,makeBorderProps as So,vibe64SessionPromptHintsPath as Sr,VIBE64_COLLEAGUE_DATABASE_KEY as Ss,previewIdentitiesQueryKey as St,useAssistantConversation as T,makeSelectProps as Ta,useRoute$1 as Tc,VoiceConversationControls_default as Ti,getCurrentScope as Tl,assistantRoutingStatusIsPending as Tn,makeRoundedProps as To,vibe64SourceEditorChangesStreamPath as Tr,VIBE64_COLLEAGUE_LAYOUT_KEY as Ts,studioHealthQueryKey as Tt,aiOnboardingBlocked as U,transformItem$1 as Ua,createSlots as Uc,useScrollToBottom as Ui,__commonJSMin as Ul,VIBE64_CURRENT_SESSION_API_SUFFIX as Un,resolveStudioRequestUrl as Uo,vibe64RealtimeOriginPayload as Ur,deepEqual$1 as Us,vibe64RequestAccepted as Ut,AiOnboardingSetUpPill_default as V,VOverlay as Va,createElementBlock as Vc,AssistantComposerSupport_default as Vi,normalizeStyle as Vl,VIBE64_API_SUFFIX as Vn,usePageActivity as Vo,browserTabSessionStorage as Vr,useToggleScope as Vs,vibe64ApiError as Vt,aiOnboardingNeeded as W,useItems as Wa,createStaticVNode as Wc,scrollElementNearBottom as Wi,__esmMin as Wl,VIBE64_SESSIONS_API_SUFFIX as Wn,resolveWebSocketUrl$1 as Wo,vibe64RealtimePayloadFromCurrentTab as Wr,genericComponent as Ws,vibe64ResourceResponseError as Wt,COLLABORATION_ENDPOINT as X,VDivider as Xa,guardReactiveProps as Xc,_plugin_vue_export_helper_default as Xi,agentTurnControlPayloadFromContext as Xn,deepFreeze as Xo,reloadPage as Xr,camelizeProps as Xs,CODEX_RECONNECT_REQUIRED_CODE as Xt,useLocalToolRows as Y,VHighlight as Ya,getCurrentInstance$1 as Yc,AssistantMessageAttachments_default as Yi,VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT as Yn,createSchema as Yo,pageRandomUUID as Yr,callEvent as Ys,isVibe64DebugLoggingEnabled as Yt,DEVELOPMENT_DATABASE_ENDPOINT as Z,VChip as Za,h$1 as Zc,VTextarea as Zi,selectedSessionStorageKey as Zn,STEP_STATUS_LABELS as Zo,videoFrameCallbacksAvailable as Zr,checkPrintable as Zs,CODEX_RECONNECT_REQUIRED_MESSAGE as Zt,resolvePageTitle as _,VCardItem as _a,isRecord as _c,useRealtimeSocket as _i,useModel as _l,assistantGoalObjective as _n,useSsrBoot as _o,vibe64SessionCheckUpdatesPath as _r,LOCAL_ASSISTANT_VIEWER as _s,VIBE64_PROJECT_CREATE_API_SUFFIX as _t,en_default$6 as a,VRadio as aa,isComposingIgnoreKey as ac,resolveRuntimePathname as ai,onBeforeUnmount as al,VIBE64_SESSION_PRESENCE_IDLE_MS as an,VCheckboxBtn as ao,vibe64OutputRunPath as ar,isPracticeProjectSlug as as,PROJECT_SETTINGS_ENDPOINT as at,NO_SHELL_PAGE_ACTIONS_REGISTRY as b,VCardActions as ba,toText as bc,mainConversationTarget as bi,watchEffect as bl,assistantRoutingFromMetadata as bn,makeElevationProps as bo,vibe64SessionPreviewStatePath as br,VIBE64_ASSISTANT_HOST_KEY as bs,engineeringSettingsQueryKey as bt,reconnectSocketIoClient as c,VExpansionPanel as ca,pickWithRest as cc,useWebPlacementRevision as ci,openBlock as cl,normalizedPromptHintSuggestions as cn,VBadge as co,vibe64OutputsQueryKey as cr,currentProjectSlugFromLocation as cs,VIBE64_COLLABORATION_API_SUFFIX as ct,F as d,VSpacer as da,isBoolean as dc,useEndpointResource as di,renderSlot as dl,normalizeVibe64ConversationAttachments as dn,VProgressLinear as do,vibe64RepositoryApiPath as dr,projectListPath as ds,VIBE64_ENGINEERING_API_SUFFIX as dt,VSwitch as ea,ensureValidVNode as ec,useCommand as ei,isMemoSame as el,VIBE64_ACCOUNTS_CHANGED_EVENT as en,VInput as eo,vibe64AgentTerminalControlTextPath as er,VIBE64_LEARNING_ROUTES as es,ENV_ENDPOINT as et,courseProgress as f,VRow as fa,isFunction as fc,_sfc_main$76 as fi,resolveComponent as fl,VIBE64_ASSISTANT_ACCESS_ERROR_CODES as fn,VProgressCircular as fo,vibe64RepositoryHistoryPath as fr,projectSlugFromPathname as fs,VIBE64_ENV_DOWNLOAD_API_SUFFIX as ft,PAGE_TITLE_ID as g,VCardText as ga,__vitePreload as gc,useRealtimeEvent as gi,useId as gl,assistantGoalManagementMessage as gn,useDensity as go,vibe64SessionChangesPath as gr,AppError as gs,VIBE64_PROJECT_CHANGED_EVENT as gt,useShellNavigationRuntime as h,VCard as ha,consoleWarn as hc,VIBE64_TRAINING_LEARNER_CHANGED_EVENT as hi,useAttrs as hl,assistantGoalIsActive as hn,makeDensityProps as ho,vibe64SessionChangeDiffPath as hr,PACKAGES_PAGE as hs,VIBE64_PREVIEW_IDENTITIES_API_SUFFIX as ht,en_default$5 as i,VRadioGroup as ia,humanReadableFileSize as ic,resolveSurfaceIdFromPlacementPathname as ii,onBeforeMount as il,VIBE64_SESSION_PRESENCE_DEBOUNCE_MS as in,useInputIcon as io,vibe64OutputResultPath as ir,withoutLesson as is,PROJECT_SELECTION_ENDPOINT as it,normalizeConversationLogPage as j,useScrolling as ja,vModelText as jc,useAssistantAttachments as ji,readonly as jl,inAfterPlanOrder as jn,VDefaultsProvider as jo,vibe64SourceEditorExplanationsCleanupPath as jr,makeLayoutItemProps as js,useShellAsyncModuleRecoveryRuntime as jt,conversationLogReadQuery as k,useFocusGroups as ka,useCssVars as kc,unmatchedOptimisticMessages as ki,proxyRefs as kl,ASSISTANT_FINISHING_DEFAULTS as kn,makeDimensionProps as ko,vibe64SourceEditorExplanationPath as kr,VIBE64_UNSENT_CHATS_KEY as ks,createWebSocketTerminalDriver as kt,Vibe64LearningMarkdown_default as l,VExpansionPanelTitle as la,wrapInArray as lc,useWebPlacementRuntime as li,provide as ll,conversationAttachmentContentType as ln,VAlert as lo,vibe64PreviewIdentityPath as lr,normalizeProjectRoutePath as ls,VIBE64_CONNECTIONS_CHANGED_EVENT as lt,useShellPageTitle as m,VContainer as ma,isObject$1 as mc,createDefaultErrorPolicy as mi,toHandlers as ml,ASSISTANT_MODES as mn,VBtnToggle as mo,vibe64RepositoryVersionFilesPath as mr,vibe64ProjectScopedStorageKey as ms,VIBE64_ENV_USER_VALUES_API_SUFFIX as mt,writeAppearance as n,VSnackbar as na,filterInputAttrs as nc,usePaths as ni,mergeProps as nl,parseIntegrationSetupRequest as nn,useForm as no,vibe64ConversationLogPath as nr,lessonShownIn as ns,ENV_USER_VALUES_ENDPOINT as nt,NO_ACTIVE_SESSION_NAV as o,VForm as oa,noop$1 as oc,pageViewportWidth as oi,onMounted as ol,normalizedPromptHintDraft as on,forwardRefs as oo,vibe64OutputRunStopPath as or,projectDisplayName as os,PROMPT_HINTS_SETTINGS_ENDPOINT as ot,useVibe64LearningCourses as p,VCol as pa,isNumber as pc,useShellWebErrorRuntime as pi,resolveDynamicComponent as pl,ASSISTANT_FIX_MODE as pn,VIcon as po,vibe64RepositoryVersionDiffPath as pr,projectSlugFromRoute as ps,VIBE64_ENV_SECRET_REVEAL_API_SUFFIX as pt,AiSetup_default as q,VListItemTitle as qa,defineAsyncComponent as qc,LongTextInlineParts_default as qi,__toESM as ql,VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT as qn,getHttpWebClient as qo,followMediaQuery as qr,makeComponentProps as qs,VIBE64_UPLOAD_MAX_LABEL as qt,en_default$3 as r,VSkeletonLoader as ra,getActiveElement as rc,readPlacementSurfaceConfig as ri,nextTick$1 as rl,VIBE64_SESSION_PRESENCE_CHANGED_EVENT as rn,useFocus as ro,vibe64ConversationLogQueryKey as rr,reviewRunNote as rs,PREVIEW_IDENTITIES_ENDPOINT as rt,VIBE64_ACTIVE_SESSION_NAV_KEY as s,VExpansionPanels as sa,omit as sc,useWebPlacementContext as si,onUnmounted as sl,normalizedPromptHintSuggestion as sn,VAvatar as so,vibe64OutputsPath as sr,projectSubtitle as ss,STUDIO_HEALTH_ENDPOINT as st,readAppearance as t,VTooltip as ta,escapeForRegex as tc,useUiFeedback as ti,mergeModels as tl,VIBE64_CONNECTIONS_CHANGED_EVENT$1 as tn,makeVInputProps as to,vibe64AgentTerminalPath as tr,checkNote as ts,ENV_SECRET_REVEAL_ENDPOINT as tt,GithubMarkdown_default as u,VExpansionPanelText as ua,IN_BROWSER as uc,createPlacementRegistry as ui,renderList as ul,conversationAttachmentReference as un,VBtn as uo,vibe64ProjectSetupQueryKey as ur,projectAppPath as us,VIBE64_DEVELOPMENT_DATABASE_API_SUFFIX as ut,SHELL_PAGE_ACTIONS_ID as v,VCardTitle as va,normalizeObject as vc,createProjectVoiceBinding as vi,useSlots as vl,assistantModeLabel as vn,makeLocationProps as vo,vibe64SessionEventMatchesScope as vr,NO_UNSENT_CHATS as vs,VIBE64_PROJECT_SELECT_API_SUFFIX as vt,resolveWindowSizeClass as w,VSelect as wa,isNavigationFailure as wc,VoiceConversationSettings_default as wi,effectScope as wl,assistantRoutingRequestIsUnresolved as wn,VImg as wo,vibe64SessionsQueryKey as wr,VIBE64_COLLEAGUE_LAUNCHER_KEY as ws,projectSettingsQueryKey as wt,SHELL_PAGE_ACTIONS_REGISTRY_KEY as x,VDialog as xa,RouterView as xc,temporaryConversationId as xi,withCtx as xl,assistantRoutingOutcomeNotice as xn,useElevation as xo,vibe64SessionPromptHintsCancelPath as xr,VIBE64_ASSISTANT_VIEWER_KEY as xs,envQueryKey as xt,SHELL_PAGE_ACTIONS_TARGET_KEY as y,VCardSubtitle as ya,normalizeText$1 as yc,mainConversationId as yi,watch as yl,assistantRoutingAutomation as yn,useLocation as yo,vibe64SessionPath as yr,VIBE64_AI_TASK_TRAY_KEY as ys,VIBE64_PROMPT_HINTS_SETTINGS_API_SUFFIX as yt,useVibe64ProjectSlug as z,VSheet as za,createBlock as zc,AssistantAttachmentQueue_default as zi,normalizeClass as zl,vibe64AgentExecutionProfileAuditSnapshot as zn,catalogMessage as zo,vibe64TemporaryConversationPath as zr,useRtl as zs,terminalLastMeaningfulLine as zt};
|
|
174
|
+
`+serializedHTML;if(SAFE_FOR_TEMPLATES)serializedHTML=_stripTemplateExpressions(serializedHTML);return trustedTypesPolicy&&RETURN_TRUSTED_TYPE?_createTrustedHTML(serializedHTML):serializedHTML};DOMPurify.setConfig=function(){let cfg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_parseConfig(cfg);SET_CONFIG=true;SET_CONFIG_ALLOWED_TAGS=ALLOWED_TAGS;SET_CONFIG_ALLOWED_ATTR=ALLOWED_ATTR};DOMPurify.clearConfig=function(){CONFIG=null;SET_CONFIG=false;SET_CONFIG_ALLOWED_TAGS=null;SET_CONFIG_ALLOWED_ATTR=null;trustedTypesPolicy=defaultTrustedTypesPolicy;emptyHTML=``};DOMPurify.isValidAttribute=function(tag,attr,value){if(!CONFIG)_parseConfig({});const lcTag=transformCaseFunc(tag);const lcName=transformCaseFunc(attr);return _isValidAttribute(lcTag,lcName,value)};DOMPurify.addHook=function(entryPoint,hookFunction){if(typeof hookFunction!==`function`)return;if(!objectHasOwnProperty(hooks,entryPoint))return;arrayPush(hooks[entryPoint],hookFunction)};DOMPurify.removeHook=function(entryPoint,hookFunction){if(!objectHasOwnProperty(hooks,entryPoint))return;if(hookFunction!==void 0){const index=arrayLastIndexOf(hooks[entryPoint],hookFunction);return index===-1?void 0:arraySplice(hooks[entryPoint],index,1)[0]}return arrayPop(hooks[entryPoint])};DOMPurify.removeHooks=function(entryPoint){if(!objectHasOwnProperty(hooks,entryPoint))return;hooks[entryPoint]=[]};DOMPurify.removeAllHooks=function(){hooks=_createHooksMap()};return DOMPurify}var purify_default=createDOMPurify();var _hoisted_1$8=[`innerHTML`];var _sfc_main$17={__name:`GithubMarkdown`,props:{html:{type:String,default:``},text:{type:String,default:``}},setup(__props){const props=__props;const sanitizedHtml=computed(()=>purify_default.sanitize(props.html,{ALLOWED_TAGS:[`a`,`b`,`blockquote`,`br`,`code`,`del`,`details`,`div`,`em`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`hr`,`img`,`li`,`ol`,`p`,`pre`,`s`,`span`,`strong`,`sub`,`summary`,`sup`,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`ul`],ALLOWED_ATTR:[`href`,`src`,`alt`,`title`,`width`,`height`,`colspan`,`rowspan`,`start`],ALLOW_DATA_ATTR:false,ALLOW_ARIA_ATTR:false}));const blocks=computed(()=>parseLongTextReviewBlocks(props.text));return(_ctx,_cache)=>{return __props.html?(openBlock(),createElementBlock(`div`,{key:0,class:`github-markdown`,innerHTML:sanitizedHtml.value},null,8,_hoisted_1$8)):(openBlock(),createBlock(unref(LongTextPreviewBlocks_default),{key:1,blocks:blocks.value},null,8,[`blocks`]))}}};var GithubMarkdown_default=_plugin_vue_export_helper_default(_sfc_main$17,[[`__scopeId`,`data-v-3636cce2`]]);var _sfc_main$16={__name:`Vibe64LearningMarkdown`,props:{text:{type:String,default:``}},setup(__props){const props=__props;const renderer=new F({async:false,gfm:true,walkTokens(token){if(token.type!==`image`)return;token.type=`text`;token.raw=token.text=token.text||``;delete token.tokens}});const html=computed(()=>props.text?renderer.parse(props.text):``);return(_ctx,_cache)=>{return openBlock(),createBlock(GithubMarkdown_default,{class:`vibe64-learning-markdown`,html:html.value,onClick:unref(openLessonLink)},null,8,[`html`,`onClick`])}}};var Vibe64LearningMarkdown_default=_plugin_vue_export_helper_default(_sfc_main$16,[[`__scopeId`,`data-v-47420e75`]]);var _hoisted_1$7=[`aria-busy`];var _hoisted_2$4={class:`vibe64-teacher-notes__actions`};var _hoisted_3$3={key:1,class:`vibe64-teacher-notes__empty`,"data-test":`teacher-notes-empty`};var _hoisted_4$1={key:2,class:`vibe64-teacher-notes__updated`};var _hoisted_5$1={class:`vibe64-teacher-notes__actions`};var _sfc_main$15={__name:`Vibe64LearningTeacherNotes`,props:{learning:{type:Object,required:true}},setup(__props){const props=__props;const notes=computed(()=>props.learning.notes.value);const status=computed(()=>props.learning.notesState);const editing=ref(false);const confirmingClear=ref(false);const draft=ref(``);const updated=computed(()=>{const value=notes.value;if(!value?.updatedAt)return``;const when=new Date(value.updatedAt);const date=Number.isNaN(when.getTime())?``:when.toLocaleString();return`${value.updatedBy===`colleague`?`Updated by Colleague`:`Updated by you`}${date?`, ${date}`:``}`});onMounted(()=>{if(!props.learning.notes.value)props.learning.readNotes()});function edit(){draft.value=notes.value?.text||``;confirmingClear.value=false;editing.value=true}async function save(){if(await props.learning.saveNotes(draft.value))editing.value=false}async function clear(){if(await props.learning.clearNotes()){confirmingClear.value=false;editing.value=false}}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{class:`vibe64-teacher-notes`,"aria-labelledby":`vibe64-teacher-notes-title`,"aria-busy":status.value.loading||status.value.saving,"data-test":`teacher-notes`},[_cache[9]||(_cache[9]=createBaseVNode(`h2`,{id:`vibe64-teacher-notes-title`,class:`vibe64-teacher-notes__title`},`What my teacher knows about me`,-1)),_cache[10]||(_cache[10]=createBaseVNode(`p`,{class:`vibe64-teacher-notes__intro`},` Colleague keeps a short private summary of how you learn, so it can teach you better. Only you can see it, and it never changes your lesson results. `,-1)),status.value.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`vibe64-teacher-notes__error`,"data-test":`teacher-notes-error`},{default:withCtx(()=>[createTextVNode(toDisplayString(status.value.error),1)]),_:1})):createCommentVNode(``,true),editing.value?(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(VTextarea,{modelValue:draft.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>draft.value=$event),label:`Your notes (Markdown)`,variant:`outlined`,rows:`8`,"auto-grow":``,counter:unref(VIBE64_LEARNING_NOTES_MAX),maxlength:unref(VIBE64_LEARNING_NOTES_MAX),disabled:status.value.saving,"data-test":`teacher-notes-draft`},null,8,[`modelValue`,`counter`,`maxlength`,`disabled`]),createBaseVNode(`div`,_hoisted_2$4,[createVNode(VBtn,{color:`primary`,variant:`flat`,rounded:`pill`,loading:status.value.saving,disabled:status.value.saving||!draft.value.trim(),"data-test":`teacher-notes-save`,onClick:save},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(` Save `,-1)])]),_:1},8,[`loading`,`disabled`]),createVNode(VBtn,{variant:`text`,rounded:`pill`,disabled:status.value.saving,"data-test":`teacher-notes-cancel`,onClick:_cache[1]||(_cache[1]=$event=>editing.value=false)},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(` Cancel `,-1)])]),_:1},8,[`disabled`])])],64)):(openBlock(),createElementBlock(Fragment,{key:2},[notes.value?.text?(openBlock(),createBlock(Vibe64LearningMarkdown_default,{key:0,class:`vibe64-teacher-notes__text`,text:notes.value.text},null,8,[`text`])):!status.value.loading?(openBlock(),createElementBlock(`p`,_hoisted_3$3,` Nothing yet. Colleague adds notes as it teaches you. `)):createCommentVNode(``,true),notes.value?.text&&updated.value?(openBlock(),createElementBlock(`p`,_hoisted_4$1,toDisplayString(updated.value),1)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_5$1,[createVNode(VBtn,{variant:`tonal`,rounded:`pill`,disabled:status.value.loading||status.value.saving,"data-test":`teacher-notes-edit`,onClick:edit},{default:withCtx(()=>[createTextVNode(toDisplayString(notes.value?.text?`Edit`:`Write notes`),1)]),_:1},8,[`disabled`]),notes.value?.text?(openBlock(),createElementBlock(Fragment,{key:0},[!confirmingClear.value?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,rounded:`pill`,disabled:status.value.saving,"data-test":`teacher-notes-clear`,onClick:_cache[2]||(_cache[2]=$event=>confirmingClear.value=true)},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(` Clear `,-1)])]),_:1},8,[`disabled`])):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(VBtn,{color:`error`,variant:`flat`,rounded:`pill`,loading:status.value.saving,disabled:status.value.saving,"data-test":`teacher-notes-clear-confirm`,onClick:clear},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(` Clear all notes `,-1)])]),_:1},8,[`loading`,`disabled`]),createVNode(VBtn,{variant:`text`,rounded:`pill`,disabled:status.value.saving,"data-test":`teacher-notes-clear-cancel`,onClick:_cache[3]||(_cache[3]=$event=>confirmingClear.value=false)},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(` Keep them `,-1)])]),_:1},8,[`disabled`])],64))],64)):createCommentVNode(``,true)])],64))],8,_hoisted_1$7)}}};var Vibe64LearningTeacherNotes_default=_plugin_vue_export_helper_default(_sfc_main$15,[[`__scopeId`,`data-v-61f49466`]]);var _hoisted_1$6={class:`vibe64-learning__bar`};var _hoisted_2$3={class:`vibe64-learning__tabs`,"aria-label":`Courses`};var _hoisted_3$2=[`aria-current`,`data-test`,`onClick`];var _hoisted_4={class:`vibe64-learning__content`};var _hoisted_5={key:0,class:`vibe64-learning__scroll`};var _hoisted_6={key:1,class:`vibe64-learning__scroll`};var LEARN_MODE_CLASS=`vibe64-learn-mode`;var _sfc_main$14={__name:`Vibe64LearningOverlay`,setup(__props){const learning=useVibe64Learning();const viewer=inject$1(VIBE64_ASSISTANT_VIEWER_KEY);const actorKey=computed(()=>String(toValue(viewer)?.actorKey||``));watch(actorKey,value=>learning.setViewer(value),{immediate:true});onBeforeUnmount(()=>learning.setViewer(``));watch(()=>learning.learnMode,value=>globalThis.document?.body?.classList.toggle(LEARN_MODE_CLASS,value),{immediate:true});onBeforeUnmount(()=>globalThis.document?.body?.classList.remove(LEARN_MODE_CLASS));const route=useRoute$1();const router=useRouter$1();watch(()=>[learning.mode,route.fullPath,learning.state.modeBusy],(_value,previous)=>{if(learning.state.modeBusy)return;const target=modeRedirect({mode:learning.mode,slug:projectSlugFromRoute(route),path:route.path});if(!target||target.path===route.path)return;const modeChanged=Boolean(previous?.[0])&&previous[0]!==learning.mode;if(target.note&&!modeChanged)learning.showNotice(target.note);router.replace(learning.state.finished&&learning.mode?.on?withLesson(target.path):target.path)},{immediate:true});watch(()=>learning.mode?.on,(_on,wasOn)=>{if(typeof wasOn===`boolean`)learning.clearNotice()});function noticeShown(value){if(!value)learning.clearNotice()}const open=computed(()=>learning.state.open);const built=ref(false);watch(open,value=>{if(value)built.value=true},{immediate:true});watch(actorKey,()=>{built.value=open.value});const layer=ref(null);watch(open,async value=>{if(!value)return;await nextTick$1();const element=layer.value;if(element&&!element.contains(globalThis.document.activeElement))element.focus({preventScroll:true})});const orientationRequested=computed(()=>learning.orientationRequested);const courses=useVibe64LearningCourses({active:computed(()=>open.value||orientationRequested.value)});const surface=computed(()=>learning.state.surface);const tabs=Object.freeze([{id:`courses`,label:`Courses`},{id:`progress`,label:`In progress`},{id:`archived`,label:`Archived`}]);useRealtimeEvent({event:VIBE64_TRAINING_LEARNER_CHANGED_EVENT,enabled:computed(()=>Boolean(actorKey.value)),onEvent:({payload}={})=>{learning.learnerChanged(payload||{});if(open.value&&payload?.reason!==`notes`)courses.learningResource.reload()}});useRealtimeEvent({event:`connect`,enabled:computed(()=>Boolean(actorKey.value)),onEvent:()=>void learning.readLearningMode()});let orientationRun=false;watch(orientationRequested,value=>{if(value)takeOrientation()},{immediate:true});async function takeOrientation(){if(orientationRun)return;orientationRun=true;try{await courses.refresh();const selection=orientationSelection(courses.coursesResource.data.value,courses.learningResource.data.value);if(selection)await learning.startLesson(selection,courses.startLesson);else await learning.show({surface:`courses`})}catch(cause){learning.showNotice(String(cause?.message||`The tour did not start. Try again from Courses.`))}finally{orientationRun=false;if(!learning.confirmArchive)learning.orientationAnswered()}}const confirm=computed(()=>learning.confirmArchive);async function archiveAndStart(){try{await learning.confirmArchiveAndStart()}catch(cause){learning.showNotice(String(cause?.message||`The lesson did not start. Try again from Courses.`))}finally{learning.orientationAnswered()}}function keepCurrent(){learning.cancelArchive();learning.orientationAnswered()}const continueOffered=computed(()=>Boolean(learning.mode?.on&&learning.lessonAttemptId&&!learning.state.finished));function continueLesson(){learning.openLesson().catch(cause=>learning.showNotice(String(cause?.message||`The lesson could not open. Try again.`)))}function keydown(event){if(event.key===`Escape`&&!event.defaultPrevented&&!confirm.value){event.stopPropagation();learning.closeCourses()}}return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(unref(TrainingGuideOverlay_default)),actorKey.value&&built.value?withDirectives((openBlock(),createElementBlock(`div`,{key:0,class:`vibe64-learning`,role:`dialog`,"aria-modal":`true`,"aria-label":`Courses`,"data-pane-swipe-ignore":``,tabindex:`-1`,ref_key:`layer`,ref:layer,onKeydown:keydown},[createBaseVNode(`header`,_hoisted_1$6,[createBaseVNode(`nav`,_hoisted_2$3,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(tabs),tab=>{return openBlock(),createElementBlock(`button`,{key:tab.id,type:`button`,class:`vibe64-learning__tab`,"aria-current":surface.value===tab.id?`page`:void 0,"data-test":`learning-${tab.id}-tab`,onClick:$event=>unref(learning).show({surface:tab.id})},toDisplayString(tab.label),9,_hoisted_3$2)}),128))]),continueOffered.value?(openBlock(),createBlock(VBtn,{key:0,color:`primary`,variant:`flat`,rounded:`pill`,"append-icon":`$arrowForward`,class:`vibe64-learning__exit`,"data-test":`learning-continue-lesson`,onClick:continueLesson},{default:withCtx(()=>[..._cache[2]||(_cache[2]=[createTextVNode(` Continue lesson `,-1)])]),_:1})):createCommentVNode(``,true),createVNode(VBtn,{variant:`tonal`,rounded:`pill`,class:`vibe64-learning__exit`,title:`Your place is kept`,"data-test":`learning-close-courses`,onClick:_cache[0]||(_cache[0]=$event=>unref(learning).closeCourses())},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(` Close Courses `,-1)])]),_:1})]),createBaseVNode(`div`,_hoisted_4,[surface.value===`courses`?(openBlock(),createElementBlock(`div`,_hoisted_5,[createVNode(Vibe64LearningCourses_default,{courses:unref(courses)},{default:withCtx(scope=>[renderSlot(_ctx.$slots,`courses`,normalizeProps(guardReactiveProps(scope)),void 0,true)]),_:3},8,[`courses`]),createVNode(Vibe64LearningTeacherNotes_default,{learning:unref(learning)},null,8,[`learning`])])):(openBlock(),createElementBlock(`div`,_hoisted_6,[createVNode(Vibe64LearningAttempts_default,{learning:unref(learning),archived:surface.value===`archived`},null,8,[`learning`,`archived`])]))])],544)),[[vShow,open.value]]):createCommentVNode(``,true),actorKey.value?(openBlock(),createBlock(VDialog,{key:1,"model-value":Boolean(confirm.value),"max-width":`28rem`,style:{"z-index":`2410`},"onUpdate:modelValue":_cache[1]||(_cache[1]=value=>value||keepCurrent())},{default:withCtx(()=>[confirm.value?(openBlock(),createBlock(VCard,{key:0,rounded:`xl`,"data-test":`learning-archive-confirm`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`text-wrap`},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Archive your lesson in progress?`,-1)])]),_:1}),createVNode(VCardText,null,{default:withCtx(()=>[_cache[5]||(_cache[5]=createTextVNode(` You can have one lesson in progress. Starting this one archives `,-1)),createBaseVNode(`strong`,null,toDisplayString(confirm.value.current.lessonTitle||`the lesson in progress`),1),_cache[6]||(_cache[6]=createTextVNode(` with its practice project and conversation; it stays under Archived. `,-1))]),_:1}),createVNode(VCardActions,null,{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{variant:`text`,"data-test":`learning-archive-cancel`,onClick:keepCurrent},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(`Keep it`,-1)])]),_:1}),createVNode(VBtn,{color:`primary`,variant:`flat`,"data-test":`learning-archive-start`,onClick:archiveAndStart},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Archive and start`,-1)])]),_:1})]),_:1})]),_:1})):createCommentVNode(``,true)]),_:1},8,[`model-value`])):createCommentVNode(``,true),actorKey.value?(openBlock(),createBlock(VSnackbar,{key:2,"model-value":Boolean(unref(learning).notice),timeout:8e3,location:`bottom`,"data-test":`learning-mode-notice`,"onUpdate:modelValue":noticeShown},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(learning).notice),1)]),_:1},8,[`model-value`])):createCommentVNode(``,true)],64)}}};var Vibe64LearningOverlay_default=_plugin_vue_export_helper_default(_sfc_main$14,[[`__scopeId`,`data-v-5b6951cd`]]);var _sfc_main$13={__name:`Vibe64LearningRouteHold`,setup(__props){const learning=useVibe64Learning();const viewer=inject$1(VIBE64_ASSISTANT_VIEWER_KEY);const route=useRoute$1();const queryClient=useQueryClient();const held=computed(()=>{const slug=projectSlugFromRoute(route);const actorKey=String(toValue(viewer)?.actorKey||``);if(!actorKey||!slug)return false;return learning.state.actorKey!==actorKey||!learning.state.modeRead||learning.state.modeBusy===`set`||Boolean(modeRedirect({mode:learning.mode,slug,path:route.path}))});function leaveProject(slug){const queryKey=[`vibe64`,...vibe64ProjectQueryScope(slug)];queryClient.cancelQueries({queryKey}).then(()=>queryClient.removeQueries({queryKey,predicate:query=>query.state.error?.code===VIBE64_LEARNING_MODE_PROJECT_CODE}))}watch(()=>[held.value,projectSlugFromRoute(route)],([isHeld],[wasHeld,shownSlug]=[])=>{if(isHeld&&wasHeld===false&&shownSlug)leaveProject(shownSlug)});return(_ctx,_cache)=>{return!held.value?renderSlot(_ctx.$slots,`default`,{},void 0,void 0,0):createCommentVNode(``,true)}}};function resolveSeverityColor(severity=`error`){const normalized=String(severity||`error`).trim().toLowerCase();if(normalized===`info`)return`info`;if(normalized===`success`)return`success`;if(normalized===`warning`)return`warning`;return`error`}function resolveSeverityIcon(severity=`error`){const normalized=String(severity||`error`).trim().toLowerCase();if(normalized===`info`)return`$info`;if(normalized===`success`)return`$success`;return`$warning`}function resolveTimeout(entry){if(!entry)return-1;if(entry.persist)return-1;return 5e3}function actionsFor(entry){return entry?[entry.action,...entry.additionalActions].filter(Boolean):[]}function resolveBannerPlacement(rect){const top=Number(rect.top)||0;if(top<=0)return{inline:true,style:void 0};return{inline:false,style:{top:`calc(env(safe-area-inset-top, 0px) + ${top}px)`,left:`${Number(rect.left)||0}px`,right:`${Number(rect.right)||0}px`}}}var BANNER_INLINE_HEIGHT_PROPERTY=`--shell-error-banners-inline-height`;var MODAL_SURFACE_SELECTOR=[`.v-dialog.v-overlay--active`,`.v-navigation-drawer--temporary.v-navigation-drawer--active`].join(`, `);function isModalSurfaceOpen(){return document.querySelector(MODAL_SURFACE_SELECTOR)!==null}function isSameSnackbarEntry(left=null,right=null){return Boolean(left?.id&&right?.id&&left.id===right.id)}function publishInlineBannerHeight(height=0){const rootStyle=document.documentElement.style;if(height>0)rootStyle.setProperty(BANNER_INLINE_HEIGHT_PROPERTY,`${Math.ceil(height)}px`);else rootStyle.removeProperty(BANNER_INLINE_HEIGHT_PROPERTY)}function useShellErrorHost(){const runtime=useShellWebErrorRuntime();const{t}=useJskitText();const store=useShellErrorPresentationStore();const snackbarEntries=computed(()=>store.channels.snackbar||[]);const bannerEntries=computed(()=>store.channels.banner||[]);const dialogEntry=computed(()=>store.channels.dialog[0]||null);const displayedSnackbarEntry=ref(null);const layoutRect=useLayout().mainRect;const bannersElement=ref(null);const bannerPlacement=computed(()=>resolveBannerPlacement(layoutRect.value));let bannerResizeObserver=null;function stopObservingBanners(){bannerResizeObserver?.disconnect();bannerResizeObserver=null;publishInlineBannerHeight(0)}watch([bannersElement,()=>bannerPlacement.value.inline],([element,inline])=>{stopObservingBanners();if(!element||!inline)return;bannerResizeObserver=new ResizeObserver(()=>{publishInlineBannerHeight(element.getBoundingClientRect().height)});bannerResizeObserver.observe(element);publishInlineBannerHeight(element.getBoundingClientRect().height)},{flush:`post`});onBeforeUnmount(stopObservingBanners);const snackbarOpen=ref(false);const{isCompact}=useShellWindowSizeClass();const snackbarOverModalSurface=ref(false);const snackbarLocation=computed(()=>isCompact.value&&snackbarOverModalSurface.value?`top`:`bottom start`);function hasSnackbarEntry(entry=null){if(!entry?.id)return false;return snackbarEntries.value.some(candidate=>isSameSnackbarEntry(candidate,entry))}function openNextSnackbarEntry(){const nextEntry=snackbarEntries.value[0]||null;if(!nextEntry){displayedSnackbarEntry.value=null;snackbarOpen.value=false;return}snackbarOverModalSurface.value=isModalSurfaceOpen();displayedSnackbarEntry.value=nextEntry;snackbarOpen.value=true}watch(snackbarEntries,entries=>{const currentEntry=displayedSnackbarEntry.value;if(!currentEntry){openNextSnackbarEntry();return}const matchingEntry=entries.find(entry=>isSameSnackbarEntry(entry,currentEntry))||null;if(matchingEntry){displayedSnackbarEntry.value=matchingEntry;return}snackbarOpen.value=false},{immediate:true,flush:`post`});function dismiss(entry){if(!entry||!entry.channel||!entry.id)return;store.dismiss(entry.channel,entry.id)}async function runAction(entry,action){try{await action.handler(entry)}catch(error){runtime.report({source:`shell-web.error-host.action`,message:t(`jskit.shell.error.actionFailed`),cause:error,intent:`blocking`,severity:`error`})}if(action.dismissOnRun!==false)dismiss(entry)}function onSnackbarModelValue(nextValue){if(nextValue===false&&displayedSnackbarEntry.value){snackbarOpen.value=false;dismiss(displayedSnackbarEntry.value)}}function onDialogModelValue(nextValue){if(nextValue===false&&dialogEntry.value&&dialogEntry.value.persist!==true)dismiss(dialogEntry.value)}function onSnackbarAfterLeave(){if(hasSnackbarEntry(displayedSnackbarEntry.value))return;openNextSnackbarEntry()}return{bannerEntries,bannerPlacement,bannersElement,dialogEntry,dismiss,displayedSnackbarEntry,onDialogModelValue,onSnackbarAfterLeave,onSnackbarModelValue,runAction,snackbarLocation,snackbarOpen}}var _hoisted_1$5={class:`shell-error-host__banner-stack`};var _hoisted_2$2={class:`d-flex align-center ga-3 flex-wrap`};var _hoisted_3$1={key:0};var _sfc_main$12={__name:`ShellErrorHost`,setup(__props){const{t,text,serverMessage}=useJskitText();const{bannerEntries,bannerPlacement,bannersElement,dialogEntry,dismiss,displayedSnackbarEntry,onDialogModelValue,onSnackbarAfterLeave,onSnackbarModelValue,runAction,snackbarLocation,snackbarOpen}=useShellErrorHost();return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,{class:normalizeClass([`shell-error-host`,{"shell-error-host--inline-banners":unref(bannerPlacement).inline}]),"aria-live":`polite`},[unref(bannerEntries).length>0?(openBlock(),createElementBlock(`div`,{key:0,ref_key:`bannersElement`,ref:bannersElement,class:normalizeClass([`shell-error-host__banners`,{"shell-error-host__banners--inline":unref(bannerPlacement).inline}]),style:normalizeStyle(unref(bannerPlacement).style),"data-testid":`shell-error-host-banners`},[createBaseVNode(`div`,_hoisted_1$5,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(bannerEntries),entry=>{return openBlock(),createBlock(VAlert,{key:entry.id,color:`${unref(resolveSeverityColor)(entry.severity)}-container`,icon:unref(resolveSeverityIcon)(entry.severity),variant:`flat`,density:`comfortable`,rounded:12,class:`shell-error-host__banner`,closable:``,"close-label":unref(t)(`jskit.shell.actions.close`),"onClick:close":$event=>unref(dismiss)(entry)},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$2,[createBaseVNode(`span`,null,toDisplayString(unref(serverMessage)(entry)),1),createVNode(VSpacer),(openBlock(true),createElementBlock(Fragment,null,renderList(unref(actionsFor)(entry),(action,index)=>{return openBlock(),createBlock(VBtn,{key:index,variant:`text`,size:`small`,class:`text-none`,onClick:$event=>unref(runAction)(entry,action)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(text)(action.label)),1)]),_:2},1032,[`onClick`])}),128))])]),_:2},1032,[`color`,`icon`,`close-label`,`onClick:close`])}),128))])],6)):createCommentVNode(``,true),createVNode(VSnackbar,{"model-value":unref(snackbarOpen),class:`shell-error-host__snackbar`,location:unref(snackbarLocation),"_disable-global-stack":true,timeout:unref(resolveTimeout)(unref(displayedSnackbarEntry)),vertical:unref(actionsFor)(unref(displayedSnackbarEntry)).length>1,"onUpdate:modelValue":unref(onSnackbarModelValue),onAfterLeave:unref(onSnackbarAfterLeave)},{actions:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(actionsFor)(unref(displayedSnackbarEntry)),(action,index)=>{return openBlock(),createBlock(VBtn,{key:index,variant:`text`,onClick:$event=>unref(runAction)(unref(displayedSnackbarEntry),action)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(text)(action.label)),1)]),_:2},1032,[`onClick`])}),128)),unref(displayedSnackbarEntry)?(openBlock(),createBlock(VBtn,{key:0,icon:`$close`,variant:`text`,color:`inverse-on-surface`,"aria-label":unref(t)(`jskit.shell.actions.dismiss`),onClick:_cache[0]||(_cache[0]=$event=>unref(dismiss)(unref(displayedSnackbarEntry)))},null,8,[`aria-label`])):createCommentVNode(``,true)]),default:withCtx(()=>[unref(displayedSnackbarEntry)?(openBlock(),createElementBlock(`span`,_hoisted_3$1,toDisplayString(unref(serverMessage)(unref(displayedSnackbarEntry))),1)):createCommentVNode(``,true)]),_:1},8,[`model-value`,`location`,`timeout`,`vertical`,`onUpdate:modelValue`,`onAfterLeave`]),createVNode(VDialog,{"model-value":Boolean(unref(dialogEntry)),"aria-label":unref(t)(`jskit.shell.error.attentionRequired`),"max-width":`560`,persistent:Boolean(unref(dialogEntry)?.persist),"onUpdate:modelValue":unref(onDialogModelValue)},{default:withCtx(()=>[unref(dialogEntry)?(openBlock(),createBlock(VCard,{key:0},{default:withCtx(()=>[createVNode(VCardTitle,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.shell.error.attentionRequired`)),1)]),_:1}),createVNode(VCardText,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(serverMessage)(unref(dialogEntry))),1)]),_:1}),createVNode(VCardActions,null,{default:withCtx(()=>[createVNode(VSpacer),(openBlock(true),createElementBlock(Fragment,null,renderList(unref(actionsFor)(unref(dialogEntry)),(action,index)=>{return openBlock(),createBlock(VBtn,{key:index,variant:`text`,onClick:$event=>unref(runAction)(unref(dialogEntry),action)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(text)(action.label)),1)]),_:2},1032,[`onClick`])}),128)),createVNode(VBtn,{variant:`text`,onClick:_cache[1]||(_cache[1]=$event=>unref(dismiss)(unref(dialogEntry)))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(t)(`jskit.shell.actions.close`)),1)]),_:1})]),_:1})]),_:1})):createCommentVNode(``,true)]),_:1},8,[`model-value`,`aria-label`,`persistent`,`onUpdate:modelValue`])],2)}}};var ShellErrorHost_default=_plugin_vue_export_helper_default(_sfc_main$12,[[`__scopeId`,`data-v-fa4300b6`]]);function useVibe64InAppLinks(){const router=useRouter$1();function navigateAppLink(event){if(event.defaultPrevented||event.button!==0||event.ctrlKey||event.metaKey||event.shiftKey||event.altKey)return;const anchor=event.target.closest(`a[href]`);if(!anchor||anchor.hasAttribute(`download`)||anchor.relList.contains(`external`))return;const target=anchor.getAttribute(`target`);if(target&&target.toLowerCase()!==`_self`)return;const href=anchor.getAttribute(`href`);if(!href||href.startsWith(`#`))return;let url;try{url=new URL(anchor.href)}catch{return}if(url.origin!==window.location.origin||![`http:`,`https:`].includes(url.protocol)||url.username||url.password)return;const path=`${url.pathname}${url.search}${url.hash}`;const route=router.resolve(path);if(!route.matched.length||route.name===`not-found`)return;event.preventDefault();router.push(path)}onMounted(()=>document.addEventListener(`click`,navigateAppLink));onUnmounted(()=>document.removeEventListener(`click`,navigateAppLink))}var _sfc_main$11={__name:`App`,setup(__props){useVibe64InAppLinks();return(_ctx,_cache)=>{return openBlock(),createBlock(VApp,null,{default:withCtx(()=>[createVNode(_sfc_main$104,{local:``},{default:withCtx(()=>[createVNode(_sfc_main$28,null,{default:withCtx(()=>[createVNode(_sfc_main$13,null,{default:withCtx(()=>[createVNode(unref(RouterView))]),_:1}),createVNode(_sfc_main$30),createVNode(Vibe64LearningOverlay_default)]),_:1}),createVNode(_sfc_main$13,null,{default:withCtx(()=>[createVNode(unref(_sfc_main$42),{"can-configure":``,"actor-key":`local`})]),_:1})]),_:1}),createVNode(unref(ShellErrorHost_default))]),_:1})}}};var title=`Not Found`;var message=`The page you requested does not exist.`;var _sfc_main$10={__name:`NotFound`,setup(__props){return(_ctx,_cache)=>{return openBlock(),createBlock(VContainer,{class:`fill-height d-flex align-center justify-center`},{default:withCtx(()=>[createVNode(VCard,{class:`pa-6 text-center`,"max-width":`560`,rounded:`lg`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`text-headline-large`},{default:withCtx(()=>[createTextVNode(toDisplayString(title))]),_:1}),createVNode(VCardText,{class:`on-surface-variant`},{default:withCtx(()=>[createTextVNode(toDisplayString(message))]),_:1})]),_:1})]),_:1})}}};function createProviderLogger(logger,{debugEnabled=false}={}){function info(...args){logger.info(...args)}function warn(...args){logger.warn(...args)}function error(...args){logger.error(...args)}function debug(...args){if(debugEnabled===true)info(...args)}return Object.freeze({debug,info,warn,error})}var PACKET_TYPES=Object.create(null);PACKET_TYPES[`open`]=`0`;PACKET_TYPES[`close`]=`1`;PACKET_TYPES[`ping`]=`2`;PACKET_TYPES[`pong`]=`3`;PACKET_TYPES[`message`]=`4`;PACKET_TYPES[`upgrade`]=`5`;PACKET_TYPES[`noop`]=`6`;var PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(key=>{PACKET_TYPES_REVERSE[PACKET_TYPES[key]]=key});var ERROR_PACKET={type:`error`,data:`parser error`};var withNativeBlob$1=typeof Blob===`function`||typeof Blob!==`undefined`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`;var withNativeArrayBuffer$2=typeof ArrayBuffer===`function`;var isView$1=obj=>{return typeof ArrayBuffer.isView===`function`?ArrayBuffer.isView(obj):obj&&obj.buffer instanceof ArrayBuffer};var encodePacket=({type,data},supportsBinary,callback)=>{if(withNativeBlob$1&&data instanceof Blob){if(supportsBinary)return callback(data);else return encodeBlobAsBase64(data,callback)}else if(withNativeArrayBuffer$2&&(data instanceof ArrayBuffer||isView$1(data))){if(supportsBinary)return callback(data);else return encodeBlobAsBase64(new Blob([data]),callback)}return callback(PACKET_TYPES[type]+(data||``))};var encodeBlobAsBase64=(data,callback)=>{const fileReader=new FileReader;fileReader.onload=function(){const content=fileReader.result.split(`,`)[1];callback(`b`+(content||``))};return fileReader.readAsDataURL(data)};function toArray(data){if(data instanceof Uint8Array)return data;else if(data instanceof ArrayBuffer)return new Uint8Array(data);else return new Uint8Array(data.buffer,data.byteOffset,data.byteLength)}var TEXT_ENCODER;function encodePacketToBinary(packet,callback){if(withNativeBlob$1&&packet.data instanceof Blob)return packet.data.arrayBuffer().then(toArray).then(callback);else if(withNativeArrayBuffer$2&&(packet.data instanceof ArrayBuffer||isView$1(packet.data)))return callback(toArray(packet.data));encodePacket(packet,false,encoded=>{if(!TEXT_ENCODER)TEXT_ENCODER=new TextEncoder;callback(TEXT_ENCODER.encode(encoded))})}var chars=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;var lookup$1=typeof Uint8Array===`undefined`?[]:new Uint8Array(256);for(let i=0;i<64;i++)lookup$1[chars.charCodeAt(i)]=i;var decode$1=base64=>{let bufferLength=base64.length*.75,len=base64.length,i,p=0,encoded1,encoded2,encoded3,encoded4;if(base64[base64.length-1]===`=`){bufferLength--;if(base64[base64.length-2]===`=`)bufferLength--}const arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i<len;i+=4){encoded1=lookup$1[base64.charCodeAt(i)];encoded2=lookup$1[base64.charCodeAt(i+1)];encoded3=lookup$1[base64.charCodeAt(i+2)];encoded4=lookup$1[base64.charCodeAt(i+3)];bytes[p++]=encoded1<<2|encoded2>>4;bytes[p++]=(encoded2&15)<<4|encoded3>>2;bytes[p++]=(encoded3&3)<<6|encoded4&63}return arraybuffer};var withNativeArrayBuffer$1=typeof ArrayBuffer===`function`;var decodePacket=(encodedPacket,binaryType)=>{if(typeof encodedPacket!==`string`)return{type:`message`,data:mapBinary(encodedPacket,binaryType)};const type=encodedPacket.charAt(0);if(type===`b`)return{type:`message`,data:decodeBase64Packet(encodedPacket.substring(1),binaryType)};if(!PACKET_TYPES_REVERSE[type])return ERROR_PACKET;return encodedPacket.length>1?{type:PACKET_TYPES_REVERSE[type],data:encodedPacket.substring(1)}:{type:PACKET_TYPES_REVERSE[type]}};var decodeBase64Packet=(data,binaryType)=>{if(withNativeArrayBuffer$1){const decoded=decode$1(data);return mapBinary(decoded,binaryType)}else return{base64:true,data}};var mapBinary=(data,binaryType)=>{switch(binaryType){case`blob`:if(data instanceof Blob)return data;else return new Blob([data]);default:if(data instanceof ArrayBuffer)return data;else return data.buffer}};var SEPARATOR=String.fromCharCode(30);var encodePayload=(packets,callback)=>{const length=packets.length;const encodedPackets=new Array(length);let count=0;packets.forEach((packet,i)=>{encodePacket(packet,false,encodedPacket=>{encodedPackets[i]=encodedPacket;if(++count===length)callback(encodedPackets.join(SEPARATOR))})})};var decodePayload=(encodedPayload,binaryType)=>{const encodedPackets=encodedPayload.split(SEPARATOR);const packets=[];for(let i=0;i<encodedPackets.length;i++){const decodedPacket=decodePacket(encodedPackets[i],binaryType);packets.push(decodedPacket);if(decodedPacket.type===`error`)break}return packets};function createPacketEncoderStream(){return new TransformStream({transform(packet,controller){encodePacketToBinary(packet,encodedPacket=>{const payloadLength=encodedPacket.length;let header;if(payloadLength<126){header=new Uint8Array(1);new DataView(header.buffer).setUint8(0,payloadLength)}else if(payloadLength<65536){header=new Uint8Array(3);const view=new DataView(header.buffer);view.setUint8(0,126);view.setUint16(1,payloadLength)}else{header=new Uint8Array(9);const view=new DataView(header.buffer);view.setUint8(0,127);view.setBigUint64(1,BigInt(payloadLength))}if(packet.data&&typeof packet.data!==`string`)header[0]|=128;controller.enqueue(header);controller.enqueue(encodedPacket)})}})}var TEXT_DECODER;function totalLength(chunks){return chunks.reduce((acc,chunk)=>acc+chunk.length,0)}function concatChunks(chunks,size){if(chunks[0].length===size)return chunks.shift();const buffer=new Uint8Array(size);let j=0;for(let i=0;i<size;i++){buffer[i]=chunks[0][j++];if(j===chunks[0].length){chunks.shift();j=0}}if(chunks.length&&j<chunks[0].length)chunks[0]=chunks[0].slice(j);return buffer}function createPacketDecoderStream(maxPayload,binaryType){if(!TEXT_DECODER)TEXT_DECODER=new TextDecoder;const chunks=[];let state=0;let expectedLength=-1;let isBinary=false;return new TransformStream({transform(chunk,controller){chunks.push(chunk);while(true){if(state===0){if(totalLength(chunks)<1)break;const header=concatChunks(chunks,1);isBinary=(header[0]&128)===128;expectedLength=header[0]&127;if(expectedLength<126)state=3;else if(expectedLength===126)state=1;else state=2}else if(state===1){if(totalLength(chunks)<2)break;const headerArray=concatChunks(chunks,2);expectedLength=new DataView(headerArray.buffer,headerArray.byteOffset,headerArray.length).getUint16(0);state=3}else if(state===2){if(totalLength(chunks)<8)break;const headerArray=concatChunks(chunks,8);const view=new DataView(headerArray.buffer,headerArray.byteOffset,headerArray.length);const n=view.getUint32(0);if(n>Math.pow(2,21)-1){controller.enqueue(ERROR_PACKET);break}expectedLength=n*Math.pow(2,32)+view.getUint32(4);state=3}else{if(totalLength(chunks)<expectedLength)break;const data=concatChunks(chunks,expectedLength);controller.enqueue(decodePacket(isBinary?data:TEXT_DECODER.decode(data),binaryType));state=0}if(expectedLength===0||expectedLength>maxPayload){controller.enqueue(ERROR_PACKET);break}}}})}function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype)obj[key]=Emitter.prototype[key];return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks[`$`+event]=this._callbacks[`$`+event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){function on(){this.off(event,on);fn.apply(this,arguments)}on.fn=fn;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks[`$`+event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks[`$`+event];return this}var cb;for(var i=0;i<callbacks.length;i++){cb=callbacks[i];if(cb===fn||cb.fn===fn){callbacks.splice(i,1);break}}if(callbacks.length===0)delete this._callbacks[`$`+event];return this};Emitter.prototype.emit=function(event){this._callbacks=this._callbacks||{};var args=new Array(arguments.length-1),callbacks=this._callbacks[`$`+event];for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];if(callbacks){callbacks=callbacks.slice(0);for(var i=0,len=callbacks.length;i<len;++i)callbacks[i].apply(this,args)}return this};Emitter.prototype.emitReserved=Emitter.prototype.emit;Emitter.prototype.listeners=function(event){this._callbacks=this._callbacks||{};return this._callbacks[`$`+event]||[]};Emitter.prototype.hasListeners=function(event){return!!this.listeners(event).length};var nextTick=(()=>{if(typeof Promise===`function`&&typeof Promise.resolve===`function`)return cb=>Promise.resolve().then(cb);else return(cb,setTimeoutFn)=>setTimeoutFn(cb,0)})();var globalThisShim=(()=>{if(typeof self!==`undefined`)return self;else if(typeof window!==`undefined`)return window;else return Function(`return this`)()})();var defaultBinaryType=`arraybuffer`;function createCookieJar(){}function pick(obj,...attr){return attr.reduce((acc,k)=>{if(obj.hasOwnProperty(k))acc[k]=obj[k];return acc},{})}var NATIVE_SET_TIMEOUT=globalThisShim.setTimeout;var NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(obj,opts){if(opts.useNativeTimers){obj.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim);obj.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)}else{obj.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim);obj.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim)}}var BASE64_OVERHEAD=1.33;function byteLength(obj){if(typeof obj===`string`)return utf8Length(obj);return Math.ceil((obj.byteLength||obj.size)*BASE64_OVERHEAD)}function utf8Length(str){let c=0,length=0;for(let i=0,l=str.length;i<l;i++){c=str.charCodeAt(i);if(c<128)length+=1;else if(c<2048)length+=2;else if(c<55296||c>=57344)length+=3;else{i++;length+=4}}return length}function randomString(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function encode(obj){let str=``;for(let i in obj)if(obj.hasOwnProperty(i)){if(str.length)str+=`&`;str+=encodeURIComponent(i)+`=`+encodeURIComponent(obj[i])}return str}function decode(qs){let qry={};let pairs=qs.split(`&`);for(let i=0,l=pairs.length;i<l;i++){let pair=pairs[i].split(`=`);qry[decodeURIComponent(pair[0])]=decodeURIComponent(pair[1])}return qry}var TransportError=class extends Error{constructor(reason,description,context){super(reason);this.description=description;this.context=context;this.type=`TransportError`}};var Transport=class extends Emitter{constructor(opts){super();this.writable=false;installTimerFunctions(this,opts);this.opts=opts;this.query=opts.query;this.socket=opts.socket;this.supportsBinary=!opts.forceBase64}onError(reason,description,context){super.emitReserved(`error`,new TransportError(reason,description,context));return this}open(){this.readyState=`opening`;this.doOpen();return this}close(){if(this.readyState===`opening`||this.readyState===`open`){this.doClose();this.onClose()}return this}send(packets){if(this.readyState===`open`)this.write(packets)}onOpen(){this.readyState=`open`;this.writable=true;super.emitReserved(`open`)}onData(data){const packet=decodePacket(data,this.socket.binaryType);this.onPacket(packet)}onPacket(packet){super.emitReserved(`packet`,packet)}onClose(details){this.readyState=`closed`;super.emitReserved(`close`,details)}pause(onPause){}createUri(schema,query={}){return schema+`://`+this._hostname()+this._port()+this.opts.path+this._query(query)}_hostname(){const hostname=this.opts.hostname;return hostname.indexOf(`:`)===-1?hostname:`[`+hostname+`]`}_port(){if(this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80))return`:`+this.opts.port;else return``}_query(query){const encodedQuery=encode(query);return encodedQuery.length?`?`+encodedQuery:``}};var Polling=class extends Transport{constructor(){super(...arguments);this._polling=false}get name(){return`polling`}doOpen(){this._poll()}pause(onPause){this.readyState=`pausing`;const pause=()=>{this.readyState=`paused`;onPause()};if(this._polling||!this.writable){let total=0;if(this._polling){total++;this.once(`pollComplete`,function(){--total||pause()})}if(!this.writable){total++;this.once(`drain`,function(){--total||pause()})}}else pause()}_poll(){this._polling=true;this.doPoll();this.emitReserved(`poll`)}onData(data){const callback=packet=>{if(`opening`===this.readyState&&packet.type===`open`)this.onOpen();if(`close`===packet.type){this.onClose({description:`transport closed by the server`});return false}this.onPacket(packet)};decodePayload(data,this.socket.binaryType).forEach(callback);if(`closed`!==this.readyState){this._polling=false;this.emitReserved(`pollComplete`);if(`open`===this.readyState)this._poll()}}doClose(){const close=()=>{this.write([{type:`close`}])};if(`open`===this.readyState)close();else this.once(`open`,close)}write(packets){this.writable=false;encodePayload(packets,data=>{this.doWrite(data,()=>{this.writable=true;this.emitReserved(`drain`)})})}uri(){const schema=this.opts.secure?`https`:`http`;const query=this.query||{};if(false!==this.opts.timestampRequests)query[this.opts.timestampParam]=randomString();if(!this.supportsBinary&&!query.sid)query.b64=1;return this.createUri(schema,query)}};var value=false;try{value=typeof XMLHttpRequest!==`undefined`&&`withCredentials`in new XMLHttpRequest}catch(err){}var hasCORS=value;function empty(){}var BaseXHR=class extends Polling{constructor(opts){super(opts);if(typeof location!==`undefined`){const isSSL=`https:`===location.protocol;let port=location.port;if(!port)port=isSSL?`443`:`80`;this.xd=typeof location!==`undefined`&&opts.hostname!==location.hostname||port!==opts.port}}doWrite(data,fn){const req=this.request({method:`POST`,data});req.on(`success`,fn);req.on(`error`,(xhrStatus,context)=>{this.onError(`xhr post error`,xhrStatus,context)})}doPoll(){const req=this.request();req.on(`data`,this.onData.bind(this));req.on(`error`,(xhrStatus,context)=>{this.onError(`xhr poll error`,xhrStatus,context)});this.pollXhr=req}};var Request=class Request extends Emitter{constructor(createRequest,uri,opts){super();this.createRequest=createRequest;installTimerFunctions(this,opts);this._opts=opts;this._method=opts.method||`GET`;this._uri=uri;this._data=void 0!==opts.data?opts.data:null;this._create()}_create(){var _a;const opts=pick(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);opts.xdomain=!!this._opts.xd;const xhr=this._xhr=this.createRequest(opts);try{xhr.open(this._method,this._uri,true);try{if(this._opts.extraHeaders){xhr.setDisableHeaderCheck&&xhr.setDisableHeaderCheck(true);for(let i in this._opts.extraHeaders)if(this._opts.extraHeaders.hasOwnProperty(i))xhr.setRequestHeader(i,this._opts.extraHeaders[i])}}catch(e){}if(`POST`===this._method)try{xhr.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch(e){}try{xhr.setRequestHeader(`Accept`,`*/*`)}catch(e){}(_a=this._opts.cookieJar)===null||_a===void 0||_a.addCookies(xhr);if(`withCredentials`in xhr)xhr.withCredentials=this._opts.withCredentials;if(this._opts.requestTimeout)xhr.timeout=this._opts.requestTimeout;xhr.onreadystatechange=()=>{var _a;if(xhr.readyState===3)(_a=this._opts.cookieJar)===null||_a===void 0||_a.parseCookies(xhr.getResponseHeader(`set-cookie`));if(4!==xhr.readyState)return;if(200===xhr.status||1223===xhr.status)this._onLoad();else this.setTimeoutFn(()=>{this._onError(typeof xhr.status===`number`?xhr.status:0)},0)};xhr.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}if(typeof document!==`undefined`){this._index=Request.requestsCount++;Request.requests[this._index]=this}}_onError(err){this.emitReserved(`error`,err,this._xhr);this._cleanup(true)}_cleanup(fromError){if(`undefined`===typeof this._xhr||null===this._xhr)return;this._xhr.onreadystatechange=empty;if(fromError)try{this._xhr.abort()}catch(e){}if(typeof document!==`undefined`)delete Request.requests[this._index];this._xhr=null}_onLoad(){const data=this._xhr.responseText;if(data!==null){this.emitReserved(`data`,data);this.emitReserved(`success`);this._cleanup()}}abort(){this._cleanup()}};Request.requestsCount=0;Request.requests={};if(typeof document!==`undefined`){if(typeof attachEvent===`function`)attachEvent(`onunload`,unloadHandler);else if(typeof addEventListener===`function`){const terminationEvent=`onpagehide`in globalThisShim?`pagehide`:`unload`;addEventListener(terminationEvent,unloadHandler,false)}}function unloadHandler(){for(let i in Request.requests)if(Request.requests.hasOwnProperty(i))Request.requests[i].abort()}var hasXHR2=(function(){const xhr=newRequest({xdomain:false});return xhr&&xhr.responseType!==null})();var XHR=class extends BaseXHR{constructor(opts){super(opts);const forceBase64=opts&&opts.forceBase64;this.supportsBinary=hasXHR2&&!forceBase64}request(opts={}){Object.assign(opts,{xd:this.xd},this.opts);return new Request(newRequest,this.uri(),opts)}};function newRequest(opts){const xdomain=opts.xdomain;try{if(`undefined`!==typeof XMLHttpRequest&&(!xdomain||hasCORS))return new XMLHttpRequest}catch(e){}if(!xdomain)try{return new globalThisShim[[`Active`].concat(`Object`).join(`X`)](`Microsoft.XMLHTTP`)}catch(e){}}var isReactNative=typeof navigator!==`undefined`&&typeof navigator.product===`string`&&navigator.product.toLowerCase()===`reactnative`;var BaseWS=class extends Transport{get name(){return`websocket`}doOpen(){const uri=this.uri();const protocols=this.opts.protocols;const opts=isReactNative?{}:pick(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);if(this.opts.extraHeaders)opts.headers=this.opts.extraHeaders;try{this.ws=this.createSocket(uri,protocols,opts)}catch(err){return this.emitReserved(`error`,err)}this.ws.binaryType=this.socket.binaryType;this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{if(this.opts.autoUnref)this.ws._socket.unref();this.onOpen()};this.ws.onclose=closeEvent=>this.onClose({description:`websocket connection closed`,context:closeEvent});this.ws.onmessage=ev=>this.onData(ev.data);this.ws.onerror=e=>this.onError(`websocket error`,e)}write(packets){this.writable=false;for(let i=0;i<packets.length;i++){const packet=packets[i];const lastPacket=i===packets.length-1;encodePacket(packet,this.supportsBinary,data=>{try{this.doWrite(packet,data)}catch(e){}if(lastPacket)nextTick(()=>{this.writable=true;this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){if(typeof this.ws!==`undefined`){this.ws.onerror=()=>{};this.ws.close();this.ws=null}}uri(){const schema=this.opts.secure?`wss`:`ws`;const query=this.query||{};if(this.opts.timestampRequests)query[this.opts.timestampParam]=randomString();if(!this.supportsBinary)query.b64=1;return this.createUri(schema,query)}};var WebSocketCtor=globalThisShim.WebSocket||globalThisShim.MozWebSocket;var WS=class extends BaseWS{createSocket(uri,protocols,opts){return!isReactNative?protocols?new WebSocketCtor(uri,protocols):new WebSocketCtor(uri):new WebSocketCtor(uri,protocols,opts)}doWrite(_packet,data){this.ws.send(data)}};var WT=class extends Transport{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(err){return this.emitReserved(`error`,err)}this._transport.closed.then(()=>{this.onClose()}).catch(err=>{this.onError(`webtransport error`,err)});this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(stream=>{const decoderStream=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType);const reader=stream.readable.pipeThrough(decoderStream).getReader();const encoderStream=createPacketEncoderStream();encoderStream.readable.pipeTo(stream.writable);this._writer=encoderStream.writable.getWriter();const read=()=>{reader.read().then(({done,value})=>{if(done)return;this.onPacket(value);read()}).catch(err=>{})};read();const packet={type:`open`};if(this.query.sid)packet.data=`{"sid":"${this.query.sid}"}`;this._writer.write(packet).then(()=>this.onOpen())})})}write(packets){this.writable=false;for(let i=0;i<packets.length;i++){const packet=packets[i];const lastPacket=i===packets.length-1;this._writer.write(packet).then(()=>{if(lastPacket)nextTick(()=>{this.writable=true;this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var _a;(_a=this._transport)===null||_a===void 0||_a.close()}};var transports={websocket:WS,webtransport:WT,polling:XHR};var re=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;var parts=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function parse(str){if(str.length>8e3)throw`URI too long`;const src=str,b=str.indexOf(`[`),e=str.indexOf(`]`);if(b!=-1&&e!=-1)str=str.substring(0,b)+str.substring(b,e).replace(/:/g,`;`)+str.substring(e,str.length);let m=re.exec(str||``),uri={},i=14;while(i--)uri[parts[i]]=m[i]||``;if(b!=-1&&e!=-1){uri.source=src;uri.host=uri.host.substring(1,uri.host.length-1).replace(/;/g,`:`);uri.authority=uri.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`);uri.ipv6uri=true}uri.pathNames=pathNames(uri,uri[`path`]);uri.queryKey=queryKey(uri,uri[`query`]);return uri}function pathNames(obj,path){const names=path.replace(/\/{2,9}/g,`/`).split(`/`);if(path.slice(0,1)==`/`||path.length===0)names.splice(0,1);if(path.slice(-1)==`/`)names.splice(names.length-1,1);return names}function queryKey(uri,query){const data={};query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function($0,$1,$2){if($1)data[$1]=$2});return data}var withEventListeners=typeof addEventListener===`function`&&typeof removeEventListener===`function`;var OFFLINE_EVENT_LISTENERS=[];if(withEventListeners)addEventListener(`offline`,()=>{OFFLINE_EVENT_LISTENERS.forEach(listener=>listener())},false);var SocketWithoutUpgrade=class SocketWithoutUpgrade extends Emitter{constructor(uri,opts){super();this.binaryType=defaultBinaryType;this.writeBuffer=[];this._prevBufferLen=0;this._pingInterval=-1;this._pingTimeout=-1;this._maxPayload=-1;this._pingTimeoutTime=Infinity;if(uri&&`object`===typeof uri){opts=uri;uri=null}if(uri){const parsedUri=parse(uri);opts.hostname=parsedUri.host;opts.secure=parsedUri.protocol===`https`||parsedUri.protocol===`wss`;opts.port=parsedUri.port;if(parsedUri.query)opts.query=parsedUri.query}else if(opts.host)opts.hostname=parse(opts.host).host;installTimerFunctions(this,opts);this.secure=null!=opts.secure?opts.secure:typeof location!==`undefined`&&`https:`===location.protocol;if(opts.hostname&&!opts.port)opts.port=this.secure?`443`:`80`;this.hostname=opts.hostname||(typeof location!==`undefined`?location.hostname:`localhost`);this.port=opts.port||(typeof location!==`undefined`&&location.port?location.port:this.secure?`443`:`80`);this.transports=[];this._transportsByName={};opts.transports.forEach(t=>{const transportName=t.prototype.name;this.transports.push(transportName);this._transportsByName[transportName]=t});this.opts=Object.assign({path:`/engine.io`,agent:false,withCredentials:false,upgrade:true,timestampParam:`t`,rememberUpgrade:false,addTrailingSlash:true,rejectUnauthorized:true,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:false},opts);this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``);if(typeof this.opts.query===`string`)this.opts.query=decode(this.opts.query);if(withEventListeners){if(this.opts.closeOnBeforeunload){this._beforeunloadEventListener=()=>{if(this.transport){this.transport.removeAllListeners();this.transport.close()}};addEventListener(`beforeunload`,this._beforeunloadEventListener,false)}if(this.hostname!==`localhost`){this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})};OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener)}}if(this.opts.withCredentials)this._cookieJar=createCookieJar();this._open()}createTransport(name){const query=Object.assign({},this.opts.query);query.EIO=4;query.transport=name;if(this.id)query.sid=this.id;const opts=Object.assign({},this.opts,{query,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[name]);return new this._transportsByName[name](opts)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}const transportName=this.opts.rememberUpgrade&&SocketWithoutUpgrade.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;const transport=this.createTransport(transportName);transport.open();this.setTransport(transport)}setTransport(transport){if(this.transport)this.transport.removeAllListeners();this.transport=transport;transport.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,reason=>this._onClose(`transport close`,reason))}onOpen(){this.readyState=`open`;SocketWithoutUpgrade.priorWebsocketSuccess=`websocket`===this.transport.name;this.emitReserved(`open`);this.flush()}_onPacket(packet){if(`opening`===this.readyState||`open`===this.readyState||`closing`===this.readyState){this.emitReserved(`packet`,packet);this.emitReserved(`heartbeat`);switch(packet.type){case`open`:this.onHandshake(JSON.parse(packet.data));break;case`ping`:this._sendPacket(`pong`);this.emitReserved(`ping`);this.emitReserved(`pong`);this._resetPingTimeout();break;case`error`:const err=new Error(`server error`);err.code=packet.data;this._onError(err);break;case`message`:this.emitReserved(`data`,packet.data);this.emitReserved(`message`,packet.data)}}}onHandshake(data){this.emitReserved(`handshake`,data);this.id=data.sid;this.transport.query.sid=data.sid;this._pingInterval=data.pingInterval;this._pingTimeout=data.pingTimeout;this._maxPayload=data.maxPayload;this.onOpen();if(`closed`===this.readyState)return;this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const delay=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+delay;this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},delay);if(this.opts.autoUnref)this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen);this._prevBufferLen=0;if(0===this.writeBuffer.length)this.emitReserved(`drain`);else this.flush()}flush(){if(`closed`!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const packets=this._getWritablePackets();this.transport.send(packets);this._prevBufferLen=packets.length;this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let payloadSize=1;for(let i=0;i<this.writeBuffer.length;i++){const data=this.writeBuffer[i].data;if(data)payloadSize+=byteLength(data);if(i>0&&payloadSize>this._maxPayload)return this.writeBuffer.slice(0,i);payloadSize+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return true;const hasExpired=Date.now()>this._pingTimeoutTime;if(hasExpired){this._pingTimeoutTime=0;nextTick(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)}return hasExpired}write(msg,options,fn){this._sendPacket(`message`,msg,options,fn);return this}send(msg,options,fn){this._sendPacket(`message`,msg,options,fn);return this}_sendPacket(type,data,options,fn){if(`function`===typeof data){fn=data;data=void 0}if(`function`===typeof options){fn=options;options=null}if(`closing`===this.readyState||`closed`===this.readyState)return;options=options||{};options.compress=false!==options.compress;const packet={type,data,options};this.emitReserved(`packetCreate`,packet);this.writeBuffer.push(packet);if(fn)this.once(`flush`,fn);this.flush()}close(){const close=()=>{this._onClose(`forced close`);this.transport.close()};const cleanupAndClose=()=>{this.off(`upgrade`,cleanupAndClose);this.off(`upgradeError`,cleanupAndClose);close()};const waitForUpgrade=()=>{this.once(`upgrade`,cleanupAndClose);this.once(`upgradeError`,cleanupAndClose)};if(`opening`===this.readyState||`open`===this.readyState){this.readyState=`closing`;if(this.writeBuffer.length)this.once(`drain`,()=>{if(this.upgrading)waitForUpgrade();else close()});else if(this.upgrading)waitForUpgrade();else close()}return this}_onError(err){SocketWithoutUpgrade.priorWebsocketSuccess=false;if(this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`){this.transports.shift();return this._open()}this.emitReserved(`error`,err);this._onClose(`transport error`,err)}_onClose(reason,description){if(`opening`===this.readyState||`open`===this.readyState||`closing`===this.readyState){this.clearTimeoutFn(this._pingTimeoutTimer);this.transport.removeAllListeners(`close`);this.transport.close();this.transport.removeAllListeners();if(withEventListeners){if(this._beforeunloadEventListener)removeEventListener(`beforeunload`,this._beforeunloadEventListener,false);if(this._offlineEventListener){const i=OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);if(i!==-1)OFFLINE_EVENT_LISTENERS.splice(i,1)}}this.readyState=`closed`;this.id=null;this.emitReserved(`close`,reason,description);this.writeBuffer=[];this._prevBufferLen=0}}};SocketWithoutUpgrade.protocol=4;var SocketWithUpgrade=class extends SocketWithoutUpgrade{constructor(){super(...arguments);this._upgrades=[]}onOpen(){super.onOpen();if(`open`===this.readyState&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(name){let transport=this.createTransport(name);let failed=false;SocketWithoutUpgrade.priorWebsocketSuccess=false;const onTransportOpen=()=>{if(failed)return;transport.send([{type:`ping`,data:`probe`}]);transport.once(`packet`,msg=>{if(failed)return;if(`pong`===msg.type&&`probe`===msg.data){this.upgrading=true;this.emitReserved(`upgrading`,transport);if(!transport)return;SocketWithoutUpgrade.priorWebsocketSuccess=`websocket`===transport.name;this.transport.pause(()=>{if(failed)return;if(`closed`===this.readyState)return;cleanup();this.setTransport(transport);transport.send([{type:`upgrade`}]);this.emitReserved(`upgrade`,transport);transport=null;this.upgrading=false;this.flush()})}else{const err=new Error(`probe error`);err.transport=transport.name;this.emitReserved(`upgradeError`,err)}})};function freezeTransport(){if(failed)return;failed=true;cleanup();transport.close();transport=null}const onerror=err=>{const error=new Error(`probe error: `+err);error.transport=transport.name;freezeTransport();this.emitReserved(`upgradeError`,error)};function onTransportClose(){onerror(`transport closed`)}function onclose(){onerror(`socket closed`)}function onupgrade(to){if(transport&&to.name!==transport.name)freezeTransport()}const cleanup=()=>{transport.removeListener(`open`,onTransportOpen);transport.removeListener(`error`,onerror);transport.removeListener(`close`,onTransportClose);this.off(`close`,onclose);this.off(`upgrading`,onupgrade)};transport.once(`open`,onTransportOpen);transport.once(`error`,onerror);transport.once(`close`,onTransportClose);this.once(`close`,onclose);this.once(`upgrading`,onupgrade);if(this._upgrades.indexOf(`webtransport`)!==-1&&name!==`webtransport`)this.setTimeoutFn(()=>{if(!failed)transport.open()},200);else transport.open()}onHandshake(data){this._upgrades=this._filterUpgrades(data.upgrades);super.onHandshake(data)}_filterUpgrades(upgrades){const filteredUpgrades=[];for(let i=0;i<upgrades.length;i++)if(~this.transports.indexOf(upgrades[i]))filteredUpgrades.push(upgrades[i]);return filteredUpgrades}};var Socket$1=class extends SocketWithUpgrade{constructor(uri,opts={}){const isOptionsOnly=typeof uri===`object`;const o=isOptionsOnly?{...uri}:{...opts};if(!o.transports||o.transports&&typeof o.transports[0]===`string`)o.transports=(o.transports||[`polling`,`websocket`,`webtransport`]).map(transportName=>transports[transportName]).filter(t=>!!t);super(isOptionsOnly?o:uri,o)}};var protocol$1=Socket$1.protocol;function url(uri,path=``,loc){let obj=uri;loc=loc||typeof location!==`undefined`&&location;if(null==uri)uri=loc.protocol+`//`+loc.host;if(typeof uri===`string`){if(`/`===uri.charAt(0)){if(`/`===uri.charAt(1))uri=loc.protocol+uri;else uri=loc.host+uri}if(!/^(https?|wss?):\/\//.test(uri)){if(`undefined`!==typeof loc)uri=loc.protocol+`//`+uri;else uri=`https://`+uri}obj=parse(uri)}if(!obj.port){if(/^(http|ws)$/.test(obj.protocol))obj.port=`80`;else if(/^(http|ws)s$/.test(obj.protocol))obj.port=`443`}obj.path=obj.path||`/`;const host=obj.host.indexOf(`:`)!==-1?`[`+obj.host+`]`:obj.host;obj.id=obj.protocol+`://`+host+`:`+obj.port+path;obj.href=obj.protocol+`://`+host+(loc&&loc.port===obj.port?``:`:`+obj.port);return obj}var withNativeArrayBuffer=typeof ArrayBuffer===`function`;var isView=obj=>{return typeof ArrayBuffer.isView===`function`?ArrayBuffer.isView(obj):obj.buffer instanceof ArrayBuffer};var toString=Object.prototype.toString;var withNativeBlob=typeof Blob===`function`||typeof Blob!==`undefined`&&toString.call(Blob)===`[object BlobConstructor]`;var withNativeFile=typeof File===`function`||typeof File!==`undefined`&&toString.call(File)===`[object FileConstructor]`;function isBinary(obj){return withNativeArrayBuffer&&(obj instanceof ArrayBuffer||isView(obj))||withNativeBlob&&obj instanceof Blob||withNativeFile&&obj instanceof File}function hasBinary(obj,toJSON){if(!obj||typeof obj!==`object`)return false;if(Array.isArray(obj)){for(let i=0,l=obj.length;i<l;i++)if(hasBinary(obj[i]))return true;return false}if(isBinary(obj))return true;if(obj.toJSON&&typeof obj.toJSON===`function`&&arguments.length===1)return hasBinary(obj.toJSON(),true);for(const key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)&&hasBinary(obj[key]))return true;return false}function deconstructPacket(packet){const buffers=[];const packetData=packet.data;const pack=packet;pack.data=_deconstructPacket(packetData,buffers);pack.attachments=buffers.length;return{packet:pack,buffers}}function _deconstructPacket(data,buffers,toJSON){if(!data)return data;if(isBinary(data)){const placeholder={_placeholder:true,num:buffers.length};buffers.push(data);return placeholder}else if(Array.isArray(data)){const newData=new Array(data.length);for(let i=0;i<data.length;i++)newData[i]=_deconstructPacket(data[i],buffers);return newData}else if(typeof data===`object`&&!(data instanceof Date)){if(data.toJSON&&typeof data.toJSON===`function`&&!toJSON)return _deconstructPacket(data.toJSON(),buffers,true);const newData={};for(const key in data)if(Object.prototype.hasOwnProperty.call(data,key))newData[key]=_deconstructPacket(data[key],buffers);return newData}return data}function reconstructPacket(packet,buffers){packet.data=_reconstructPacket(packet.data,buffers);delete packet.attachments;return packet}function _reconstructPacket(data,buffers){if(!data)return data;if(data&&data._placeholder===true){if(typeof data.num===`number`&&data.num>=0&&data.num<buffers.length)return buffers[data.num];else throw new Error(`illegal attachments`)}else if(Array.isArray(data))for(let i=0;i<data.length;i++)data[i]=_reconstructPacket(data[i],buffers);else if(typeof data===`object`){for(const key in data)if(Object.prototype.hasOwnProperty.call(data,key))data[key]=_reconstructPacket(data[key],buffers)}return data}var esm_exports=__exportAll({Decoder:()=>Decoder,Encoder:()=>Encoder,PacketType:()=>PacketType,isPacketValid:()=>isPacketValid,protocol:()=>5});var RESERVED_EVENTS$1=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`];var protocol=5;var PacketType;(function(PacketType){PacketType[PacketType[`CONNECT`]=0]=`CONNECT`;PacketType[PacketType[`DISCONNECT`]=1]=`DISCONNECT`;PacketType[PacketType[`EVENT`]=2]=`EVENT`;PacketType[PacketType[`ACK`]=3]=`ACK`;PacketType[PacketType[`CONNECT_ERROR`]=4]=`CONNECT_ERROR`;PacketType[PacketType[`BINARY_EVENT`]=5]=`BINARY_EVENT`;PacketType[PacketType[`BINARY_ACK`]=6]=`BINARY_ACK`})(PacketType||(PacketType={}));var Encoder=class{constructor(replacer){this.replacer=replacer}encode(obj){if(obj.type===PacketType.EVENT||obj.type===PacketType.ACK){if(hasBinary(obj))return this.encodeAsBinary({type:obj.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:obj.nsp,data:obj.data,id:obj.id})}return[this.encodeAsString(obj)]}encodeAsString(obj){let str=``+obj.type;if(obj.type===PacketType.BINARY_EVENT||obj.type===PacketType.BINARY_ACK)str+=obj.attachments+`-`;if(obj.nsp&&`/`!==obj.nsp)str+=obj.nsp+`,`;if(null!=obj.id)str+=obj.id;if(null!=obj.data)str+=JSON.stringify(obj.data,this.replacer);return str}encodeAsBinary(obj){const deconstruction=deconstructPacket(obj);const pack=this.encodeAsString(deconstruction.packet);const buffers=deconstruction.buffers;buffers.unshift(pack);return buffers}};var Decoder=class Decoder extends Emitter{constructor(opts){super();this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof opts===`function`?{reviver:opts}:opts)}add(obj){let packet;if(typeof obj===`string`){if(this.reconstructor)throw new Error(`got plaintext data when reconstructing a packet`);packet=this.decodeString(obj);const isBinaryEvent=packet.type===PacketType.BINARY_EVENT;if(isBinaryEvent||packet.type===PacketType.BINARY_ACK){packet.type=isBinaryEvent?PacketType.EVENT:PacketType.ACK;this.reconstructor=new BinaryReconstructor(packet)}else super.emitReserved(`decoded`,packet)}else if(isBinary(obj)||obj.base64){if(!this.reconstructor)throw new Error(`got binary data when not reconstructing a packet`);else{packet=this.reconstructor.takeBinaryData(obj);if(packet){this.reconstructor=null;super.emitReserved(`decoded`,packet)}}}else throw new Error(`Unknown type: `+obj)}decodeString(str){let i=0;const p={type:Number(str.charAt(0))};if(PacketType[p.type]===void 0)throw new Error(`unknown packet type `+p.type);if(p.type===PacketType.BINARY_EVENT||p.type===PacketType.BINARY_ACK){const start=i+1;while(str.charAt(++i)!==`-`&&i!=str.length);const buf=str.substring(start,i);if(buf!=Number(buf)||str.charAt(i)!==`-`)throw new Error(`Illegal attachments`);const n=Number(buf);if(!isInteger(n)||n<1)throw new Error(`Illegal attachments`);else if(n>this.opts.maxAttachments)throw new Error(`too many attachments`);p.attachments=n}if(`/`===str.charAt(i+1)){const start=i+1;while(++i){if(`,`===str.charAt(i))break;if(i===str.length)break}p.nsp=str.substring(start,i)}else p.nsp=`/`;const next=str.charAt(i+1);if(``!==next&&Number(next)==next){const start=i+1;while(++i){const c=str.charAt(i);if(null==c||Number(c)!=c){--i;break}if(i===str.length)break}p.id=Number(str.substring(start,i+1))}if(str.charAt(++i)){const payload=this.tryParse(str.substr(i));if(Decoder.isPayloadValid(p.type,payload))p.data=payload;else throw new Error(`invalid payload`)}return p}tryParse(str){try{return JSON.parse(str,this.opts.reviver)}catch(e){return false}}static isPayloadValid(type,payload){switch(type){case PacketType.CONNECT:return isObject(payload);case PacketType.DISCONNECT:return payload===void 0;case PacketType.CONNECT_ERROR:return typeof payload===`string`||isObject(payload);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(payload)&&(typeof payload[0]===`number`||typeof payload[0]===`string`&&RESERVED_EVENTS$1.indexOf(payload[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(payload)}}destroy(){if(this.reconstructor){this.reconstructor.finishedReconstruction();this.reconstructor=null}}};var BinaryReconstructor=class{constructor(packet){this.packet=packet;this.buffers=[];this.reconPack=packet}takeBinaryData(binData){this.buffers.push(binData);if(this.buffers.length===this.reconPack.attachments){const packet=reconstructPacket(this.reconPack,this.buffers);this.finishedReconstruction();return packet}return null}finishedReconstruction(){this.reconPack=null;this.buffers=[]}};function isNamespaceValid(nsp){return typeof nsp===`string`}var isInteger=Number.isInteger||function(value){return typeof value===`number`&&isFinite(value)&&Math.floor(value)===value};function isAckIdValid(id){return id===void 0||isInteger(id)}function isObject(value){return Object.prototype.toString.call(value)===`[object Object]`}function isDataValid(type,payload){switch(type){case PacketType.CONNECT:return payload===void 0||isObject(payload);case PacketType.DISCONNECT:return payload===void 0;case PacketType.EVENT:return Array.isArray(payload)&&(typeof payload[0]===`number`||typeof payload[0]===`string`&&RESERVED_EVENTS$1.indexOf(payload[0])===-1);case PacketType.ACK:return Array.isArray(payload);case PacketType.CONNECT_ERROR:return typeof payload===`string`||isObject(payload);default:return false}}function isPacketValid(packet){return isNamespaceValid(packet.nsp)&&isAckIdValid(packet.id)&&isDataValid(packet.type,packet.data)}function on(obj,ev,fn){obj.on(ev,fn);return function subDestroy(){obj.off(ev,fn)}}var RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});var Socket=class extends Emitter{constructor(io,nsp,opts){super();this.connected=false;this.recovered=false;this.receiveBuffer=[];this.sendBuffer=[];this._queue=[];this._queueSeq=0;this.ids=0;this.acks={};this.flags={};this.io=io;this.nsp=nsp;if(opts&&opts.auth)this.auth=opts.auth;this._opts=Object.assign({},opts);if(this.io._autoConnect)this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const io=this.io;this.subs=[on(io,`open`,this.onopen.bind(this)),on(io,`packet`,this.onpacket.bind(this)),on(io,`error`,this.onerror.bind(this)),on(io,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){if(this.connected)return this;this.subEvents();if(!this.io[`_reconnecting`])this.io.open();if(`open`===this.io._readyState)this.onopen();return this}open(){return this.connect()}send(...args){args.unshift(`message`);this.emit.apply(this,args);return this}emit(ev,...args){var _a,_b,_c;if(RESERVED_EVENTS.hasOwnProperty(ev))throw new Error(`"`+ev.toString()+`" is a reserved event name`);args.unshift(ev);if(this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile){this._addToQueue(args);return this}const packet={type:PacketType.EVENT,data:args};packet.options={};packet.options.compress=this.flags.compress!==false;if(`function`===typeof args[args.length-1]){const id=this.ids++;const ack=args.pop();this._registerAckCallback(id,ack);packet.id=id}const isTransportWritable=(_b=(_a=this.io.engine)===null||_a===void 0?void 0:_a.transport)===null||_b===void 0?void 0:_b.writable;const isConnected=this.connected&&!((_c=this.io.engine)===null||_c===void 0?void 0:_c._hasPingExpired());if(this.flags.volatile&&!isTransportWritable){}else if(isConnected){this.notifyOutgoingListeners(packet);this.packet(packet)}else this.sendBuffer.push(packet);this.flags={};return this}_registerAckCallback(id,ack){var _a;const timeout=(_a=this.flags.timeout)!==null&&_a!==void 0?_a:this._opts.ackTimeout;if(timeout===void 0){this.acks[id]=ack;return}const timer=this.io.setTimeoutFn(()=>{delete this.acks[id];for(let i=0;i<this.sendBuffer.length;i++)if(this.sendBuffer[i].id===id)this.sendBuffer.splice(i,1);ack.call(this,new Error(`operation has timed out`))},timeout);const fn=(...args)=>{this.io.clearTimeoutFn(timer);ack.apply(this,args)};fn.withError=true;this.acks[id]=fn}emitWithAck(ev,...args){return new Promise((resolve,reject)=>{const fn=(arg1,arg2)=>{return arg1?reject(arg1):resolve(arg2)};fn.withError=true;args.push(fn);this.emit(ev,...args)})}_addToQueue(args){let ack;if(typeof args[args.length-1]===`function`)ack=args.pop();const packet={id:this._queueSeq++,tryCount:0,pending:false,args,flags:Object.assign({fromQueue:true},this.flags)};args.push((err,...responseArgs)=>{if(packet!==this._queue[0]){}if(err!==null){if(packet.tryCount>this._opts.retries){this._queue.shift();if(ack)ack(err)}}else{this._queue.shift();if(ack)ack(null,...responseArgs)}packet.pending=false;return this._drainQueue()});this._queue.push(packet);this._drainQueue()}_drainQueue(force=false){if(!this.connected||this._queue.length===0)return;const packet=this._queue[0];if(packet.pending&&!force)return;packet.pending=true;packet.tryCount++;this.flags=packet.flags;this.emit.apply(this,packet.args)}packet(packet){packet.nsp=this.nsp;this.io._packet(packet)}onopen(){if(typeof this.auth==`function`)this.auth(data=>{this._sendConnectPacket(data)});else this._sendConnectPacket(this.auth)}_sendConnectPacket(data){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},data):data})}onerror(err){if(!this.connected)this.emitReserved(`connect_error`,err)}onclose(reason,description){this.connected=false;delete this.id;this.emitReserved(`disconnect`,reason,description);this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(id=>{if(!this.sendBuffer.some(packet=>String(packet.id)===id)){const ack=this.acks[id];delete this.acks[id];if(ack.withError)ack.call(this,new Error(`socket has been disconnected`))}})}onpacket(packet){if(!(packet.nsp===this.nsp))return;switch(packet.type){case PacketType.CONNECT:if(packet.data&&packet.data.sid)this.onconnect(packet.data.sid,packet.data.pid);else this.emitReserved(`connect_error`,new Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(packet);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(packet);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const err=new Error(packet.data.message);err.data=packet.data.data;this.emitReserved(`connect_error`,err)}}onevent(packet){const args=packet.data||[];if(null!=packet.id)args.push(this.ack(packet.id));if(this.connected)this.emitEvent(args);else this.receiveBuffer.push(Object.freeze(args))}emitEvent(args){if(this._anyListeners&&this._anyListeners.length){const listeners=this._anyListeners.slice();for(const listener of listeners)listener.apply(this,args)}super.emit.apply(this,args);if(this._pid&&args.length&&typeof args[args.length-1]===`string`)this._lastOffset=args[args.length-1]}ack(id){const self=this;let sent=false;return function(...args){if(sent)return;sent=true;self.packet({type:PacketType.ACK,id,data:args})}}onack(packet){const ack=this.acks[packet.id];if(typeof ack!==`function`)return;delete this.acks[packet.id];if(ack.withError)packet.data.unshift(null);ack.apply(this,packet.data)}onconnect(id,pid){this.id=id;this.recovered=pid&&this._pid===pid;this._pid=pid;this.connected=true;this.emitBuffered();this._drainQueue(true);this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(args=>this.emitEvent(args));this.receiveBuffer=[];this.sendBuffer.forEach(packet=>{this.notifyOutgoingListeners(packet);this.packet(packet)});this.sendBuffer=[]}ondisconnect(){this.destroy();this.onclose(`io server disconnect`)}destroy(){if(this.subs){this.subs.forEach(subDestroy=>subDestroy());this.subs=void 0}this.io[`_destroy`](this)}disconnect(){if(this.connected)this.packet({type:PacketType.DISCONNECT});this.destroy();if(this.connected)this.onclose(`io client disconnect`);return this}close(){return this.disconnect()}compress(compress){this.flags.compress=compress;return this}get volatile(){this.flags.volatile=true;return this}timeout(timeout){this.flags.timeout=timeout;return this}onAny(listener){this._anyListeners=this._anyListeners||[];this._anyListeners.push(listener);return this}prependAny(listener){this._anyListeners=this._anyListeners||[];this._anyListeners.unshift(listener);return this}offAny(listener){if(!this._anyListeners)return this;if(listener){const listeners=this._anyListeners;for(let i=0;i<listeners.length;i++)if(listener===listeners[i]){listeners.splice(i,1);return this}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(listener){this._anyOutgoingListeners=this._anyOutgoingListeners||[];this._anyOutgoingListeners.push(listener);return this}prependAnyOutgoing(listener){this._anyOutgoingListeners=this._anyOutgoingListeners||[];this._anyOutgoingListeners.unshift(listener);return this}offAnyOutgoing(listener){if(!this._anyOutgoingListeners)return this;if(listener){const listeners=this._anyOutgoingListeners;for(let i=0;i<listeners.length;i++)if(listener===listeners[i]){listeners.splice(i,1);return this}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(packet){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const listeners=this._anyOutgoingListeners.slice();for(const listener of listeners)listener.apply(this,packet.data)}}};function Backoff(opts){opts=opts||{};this.ms=opts.min||100;this.max=opts.max||1e4;this.factor=opts.factor||2;this.jitter=opts.jitter>0&&opts.jitter<=1?opts.jitter:0;this.attempts=0}Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random();var deviation=Math.floor(rand*this.jitter*ms);ms=(Math.floor(rand*10)&1)==0?ms-deviation:ms+deviation}return Math.min(ms,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(min){this.ms=min};Backoff.prototype.setMax=function(max){this.max=max};Backoff.prototype.setJitter=function(jitter){this.jitter=jitter};var Manager=class extends Emitter{constructor(uri,opts){var _a;super();this.nsps={};this.subs=[];if(uri&&`object`===typeof uri){opts=uri;uri=void 0}opts=opts||{};opts.path=opts.path||`/socket.io`;this.opts=opts;installTimerFunctions(this,opts);this.reconnection(opts.reconnection!==false);this.reconnectionAttempts(opts.reconnectionAttempts||Infinity);this.reconnectionDelay(opts.reconnectionDelay||1e3);this.reconnectionDelayMax(opts.reconnectionDelayMax||5e3);this.randomizationFactor((_a=opts.randomizationFactor)!==null&&_a!==void 0?_a:.5);this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()});this.timeout(null==opts.timeout?2e4:opts.timeout);this._readyState=`closed`;this.uri=uri;const _parser=opts.parser||esm_exports;this.encoder=new _parser.Encoder;this.decoder=new _parser.Decoder;this._autoConnect=opts.autoConnect!==false;if(this._autoConnect)this.open()}reconnection(v){if(!arguments.length)return this._reconnection;this._reconnection=!!v;if(!v)this.skipReconnect=true;return this}reconnectionAttempts(v){if(v===void 0)return this._reconnectionAttempts;this._reconnectionAttempts=v;return this}reconnectionDelay(v){var _a;if(v===void 0)return this._reconnectionDelay;this._reconnectionDelay=v;(_a=this.backoff)===null||_a===void 0||_a.setMin(v);return this}randomizationFactor(v){var _a;if(v===void 0)return this._randomizationFactor;this._randomizationFactor=v;(_a=this.backoff)===null||_a===void 0||_a.setJitter(v);return this}reconnectionDelayMax(v){var _a;if(v===void 0)return this._reconnectionDelayMax;this._reconnectionDelayMax=v;(_a=this.backoff)===null||_a===void 0||_a.setMax(v);return this}timeout(v){if(!arguments.length)return this._timeout;this._timeout=v;return this}maybeReconnectOnOpen(){if(!this._reconnecting&&this._reconnection&&this.backoff.attempts===0)this.reconnect()}open(fn){if(~this._readyState.indexOf(`open`))return this;this.engine=new Socket$1(this.uri,this.opts);const socket=this.engine;const self=this;this._readyState=`opening`;this.skipReconnect=false;const openSubDestroy=on(socket,`open`,function(){self.onopen();fn&&fn()});const onError=err=>{this.cleanup();this._readyState=`closed`;this.emitReserved(`error`,err);if(fn)fn(err);else this.maybeReconnectOnOpen()};const errorSub=on(socket,`error`,onError);if(false!==this._timeout){const timeout=this._timeout;const timer=this.setTimeoutFn(()=>{openSubDestroy();onError(new Error(`timeout`));socket.close()},timeout);if(this.opts.autoUnref)timer.unref();this.subs.push(()=>{this.clearTimeoutFn(timer)})}this.subs.push(openSubDestroy);this.subs.push(errorSub);return this}connect(fn){return this.open(fn)}onopen(){this.cleanup();this._readyState=`open`;this.emitReserved(`open`);const socket=this.engine;this.subs.push(on(socket,`ping`,this.onping.bind(this)),on(socket,`data`,this.ondata.bind(this)),on(socket,`error`,this.onerror.bind(this)),on(socket,`close`,this.onclose.bind(this)),on(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(data){try{this.decoder.add(data)}catch(e){this.onclose(`parse error`,e)}}ondecoded(packet){nextTick(()=>{this.emitReserved(`packet`,packet)},this.setTimeoutFn)}onerror(err){this.emitReserved(`error`,err)}socket(nsp,opts){let socket=this.nsps[nsp];if(!socket){socket=new Socket(this,nsp,opts);this.nsps[nsp]=socket}else if(this._autoConnect&&!socket.active)socket.connect();return socket}_destroy(socket){const nsps=Object.keys(this.nsps);for(const nsp of nsps)if(this.nsps[nsp].active)return;this._close()}_packet(packet){const encodedPackets=this.encoder.encode(packet);for(let i=0;i<encodedPackets.length;i++)this.engine.write(encodedPackets[i],packet.options)}cleanup(){this.subs.forEach(subDestroy=>subDestroy());this.subs.length=0;this.decoder.destroy()}_close(){this.skipReconnect=true;this._reconnecting=false;this.onclose(`forced close`)}disconnect(){return this._close()}onclose(reason,description){var _a;this.cleanup();(_a=this.engine)===null||_a===void 0||_a.close();this.backoff.reset();this._readyState=`closed`;this.emitReserved(`close`,reason,description);if(this._reconnection&&!this.skipReconnect)this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const self=this;if(this.backoff.attempts>=this._reconnectionAttempts){this.backoff.reset();this.emitReserved(`reconnect_failed`);this._reconnecting=false}else{const delay=this.backoff.duration();this._reconnecting=true;const timer=this.setTimeoutFn(()=>{if(self.skipReconnect)return;this.emitReserved(`reconnect_attempt`,self.backoff.attempts);if(self.skipReconnect)return;self.open(err=>{if(err){self._reconnecting=false;self.reconnect();this.emitReserved(`reconnect_error`,err)}else self.onreconnect()})},delay);if(this.opts.autoUnref)timer.unref();this.subs.push(()=>{this.clearTimeoutFn(timer)})}}onreconnect(){const attempt=this.backoff.attempts;this._reconnecting=false;this.backoff.reset();this.emitReserved(`reconnect`,attempt)}};var cache={};function lookup(uri,opts){if(typeof uri===`object`){opts=uri;uri=void 0}opts=opts||{};const parsed=url(uri,opts.path||`/socket.io`);const source=parsed.source;const id=parsed.id;const path=parsed.path;const sameNamespace=cache[id]&&path in cache[id][`nsps`];const newConnection=opts.forceNew||opts[`force new connection`]||false===opts.multiplex||sameNamespace;let io;if(newConnection)io=new Manager(source,opts);else{if(!cache[id])cache[id]=new Manager(source,opts);io=cache[id]}if(parsed.query&&!opts.query)opts.query=parsed.queryKey;return io.socket(parsed.path,opts)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});var SOCKET_IO_PATH=`/socket.io`;function createSocketIoClient({url=``,options={},connect=lookup}){const normalizedUrl=normalizeText$1(url);const normalizedOptions={...normalizeObject(options),path:SOCKET_IO_PATH};if(normalizedUrl)return connect(normalizedUrl,normalizedOptions);return connect(normalizedOptions)}function disconnectSocketIoClient(socket){socket.disconnect()}function reconnectSocketIoClient(socket){if(socket.connected)return;if(socket.active)socket.disconnect();socket.connect()}var jskit$7={"errors":{"SESSION_REFRESH_REQUIRED":`Session refresh required.`},"realtime":{"indicator":{"connected":`Realtime connected`,"connectedTooltip":`Realtime is connected. Live updates are active.`,"disconnected":`Realtime disconnected`,"disconnectedTooltip":`Live updates are disconnected. Click to reconnect. If your session expired, sign in again.`,"reconnect":`Reconnect live updates`,"unavailableTooltip":`Realtime is unavailable. Live updates are disabled for this page.`}}};var en_default$7={jskit:jskit$7};registerJskitMessages(en_default$7);var{t:t$9}=useJskitText();var ROOT_STYLE=Object.freeze({alignItems:`center`,background:`transparent`,border:`0`,borderRadius:`50%`,display:`inline-flex`,height:`48px`,justifyContent:`center`,padding:`0`,width:`48px`});var DOT_STYLE=Object.freeze({borderRadius:`9999px`,boxShadow:`0 0 0 2px rgba(255, 255, 255, 0.82)`,display:`block`,height:`10px`,width:`10px`});var SR_ONLY_STYLE=Object.freeze({border:`0`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`});function resolveTooltipText({realtimeAvailable,connected}){if(!realtimeAvailable)return t$9(`jskit.realtime.indicator.unavailableTooltip`);if(connected)return t$9(`jskit.realtime.indicator.connectedTooltip`);return t$9(`jskit.realtime.indicator.disconnectedTooltip`)}var RealtimeConnectionIndicator=defineComponent$1({name:`RealtimeConnectionIndicator`,setup(){const socket=useRealtimeSocket();const connected=ref(Boolean(socket.connected));const realtimeAvailable=socket!==NO_REALTIME_SOCKET;const tooltipText=computed(()=>{return resolveTooltipText({realtimeAvailable,connected:connected.value})});const statusLabel=computed(()=>connected.value?t$9(`jskit.realtime.indicator.connected`):t$9(`jskit.realtime.indicator.disconnected`));const dotStyle=computed(()=>({...DOT_STYLE,backgroundColor:connected.value?`#22c55e`:`#ef4444`}));function syncConnected(nextState){connected.value=Boolean(nextState)}const onConnect=()=>syncConnected(true);const onDisconnect=()=>syncConnected(false);const onConnectError=()=>syncConnected(false);onMounted(()=>{syncConnected(socket.connected);socket.on(`connect`,onConnect);socket.on(`disconnect`,onDisconnect);socket.on(`connect_error`,onConnectError)});onBeforeUnmount(()=>{socket.off(`connect`,onConnect);socket.off(`disconnect`,onDisconnect);socket.off(`connect_error`,onConnectError)});return()=>h$1(`button`,{disabled:!realtimeAvailable||connected.value,onClick:()=>reconnectSocketIoClient(socket),style:{...ROOT_STYLE,cursor:realtimeAvailable&&!connected.value?`pointer`:`default`},title:tooltipText.value,type:`button`,"aria-label":realtimeAvailable&&!connected.value?t$9(`jskit.realtime.indicator.reconnect`):statusLabel.value},[h$1(`span`,{style:dotStyle.value,"aria-hidden":`true`}),h$1(`span`,{style:SR_ONLY_STYLE},statusLabel.value)])}});function attachSocketConnectionRecovery(socket,{prepareReconnect}){let timer=null;let delay=1e3;let recovering=false;const document=globalThis.document;const window=globalThis.window;function clearRetry(){clearTimeout(timer);timer=null}function canRetry(){return recovering&&!socket.connected&&!socket.active&&socket.io.reconnection()&&!document?.hidden&&window?.navigator?.onLine!==false}async function retry(){try{await prepareReconnect()}catch{}if(canRetry())socket.connect()}function scheduleRetry(){if(timer!==null||!canRetry())return;timer=setTimeout(()=>{timer=null;if(canRetry())retry()},delay);delay=Math.min(delay*2,3e4)}function onConnect(){clearRetry();recovering=false;delay=1e3}function onDisconnect(reason){clearRetry();recovering=reason===`io server disconnect`;scheduleRetry()}function onConnectError(){recovering=true;scheduleRetry()}function onAvailable(){if(socket.connected||document?.hidden||window?.navigator?.onLine===false||!socket.io.reconnection()||!socket.active&&!recovering)return;clearRetry();reconnectSocketIoClient(socket)}socket.on(`connect`,onConnect);socket.on(`disconnect`,onDisconnect);socket.on(`connect_error`,onConnectError);document?.addEventListener(`visibilitychange`,onAvailable);window?.addEventListener(`online`,onAvailable);return()=>{recovering=false;clearRetry();socket.off(`connect`,onConnect);socket.off(`disconnect`,onDisconnect);socket.off(`connect_error`,onConnectError);document?.removeEventListener(`visibilitychange`,onAvailable);window?.removeEventListener(`online`,onAvailable)}}var SERVED_CLIENT_BUILD_EVENT=`realtime.served-client-build`;function skipReconnectPreparation(){}function resolveRealtimeClientConfig({env={},mobile=null}={}){const appConfig=normalizeObject(getClientAppConfig());const realtime=normalizeObject(appConfig.realtime);const realtimeClient=normalizeObject(appConfig.realtimeClient);const mobileConfig=resolveMobileConfig({mobile:normalizeObject(appConfig.mobile)});const url=normalizeText$1(realtimeClient.url||(mobileConfig.enabled===true&&mobile?.adapter?.available===true?mobileConfig.apiBaseUrl:``));const options=normalizeObject(realtimeClient.options);const explicitDebugEnabled=typeof realtimeClient.debug===`boolean`?realtimeClient.debug:typeof realtime.debug===`boolean`?realtime.debug:void 0;const debugEnabled=Object.hasOwn(normalizeObject(env),`VITE_REALTIME_DEBUG`)?resolveClientBootstrapDebugEnabled({env,debugEnabled:void 0,debugEnvKey:`VITE_REALTIME_DEBUG`}):resolveClientBootstrapDebugEnabled({env,debugEnabled:explicitDebugEnabled,debugEnvKey:`VITE_REALTIME_DEBUG`});return Object.freeze({url,options,debugEnabled})}function createRealtimeClient({config,logger:appLogger}){const logger=createProviderLogger(appLogger,{debugEnabled:config.debugEnabled});const socket=createSocketIoClient({url:config.url,options:config.options});const servedClientBuild=trackServedClientBuild(socket,logger);const detach=[];let initialized=false;let beforeReconnect=skipReconnectPreparation;function initialize(vueApp){if(initialized)return;initialized=true;detach.push(attachSocketConnectionRecovery(socket,{prepareReconnect:()=>beforeReconnect()}));const onConnect=()=>logger.debug({socketConnected:true},`Realtime client socket connected.`);const onDisconnect=reason=>logger.debug({socketConnected:false,reason:String(reason||``)},`Realtime client socket disconnected.`);const onConnectError=error=>logger.warn({error:String(error?.message||error||`unknown error`)},`Realtime client socket connect error.`);socket.on(`connect`,onConnect);socket.on(`disconnect`,onDisconnect);socket.on(`connect_error`,onConnectError);detach.push(()=>{socket.off(`connect`,onConnect);socket.off(`disconnect`,onDisconnect);socket.off(`connect_error`,onConnectError)});if(config.debugEnabled===true){const onAny=(eventName,payload)=>logger.debug({event:String(eventName||``),payloadScope:payload?.scope||null,payloadEntityId:payload?.entityId||null},`Realtime client received socket event.`);socket.onAny(onAny);detach.push(()=>socket.offAny(onAny))}vueApp.provide(REALTIME_SOCKET_KEY,socket)}function dispose(){for(const release of detach.splice(0,detach.length))try{release()}catch{}servedClientBuild.dispose();disconnectSocketIoClient(socket);initialized=false}function setBeforeReconnect(prepare){beforeReconnect=prepare;return()=>{if(beforeReconnect===prepare)beforeReconnect=skipReconnectPreparation}}return Object.freeze({config,dispose,initialize,onServedClientBuild:servedClientBuild.subscribe,setBeforeReconnect,socket})}function trackServedClientBuild(socket,logger){const listeners=new Set;let buildId=``;function notify(listener){try{listener(buildId)}catch(error){logger.warn({error:String(error?.message||error)},`Served client build listener failed.`)}}function onServedClientBuild(payload){buildId=normalizeText$1(payload?.buildId);if(buildId)for(const listener of[...listeners])notify(listener)}socket.on(SERVED_CLIENT_BUILD_EVENT,onServedClientBuild);return Object.freeze({subscribe(listener){listeners.add(listener);if(buildId)notify(listener);return()=>listeners.delete(listener)},dispose(){socket.off(SERVED_CLIENT_BUILD_EVENT,onServedClientBuild);listeners.clear()}})}var RealtimeClientProvider=defineProvider({id:`runtime.realtime.client`,requires:{components:`client.components`,env:`client.env`,logger:`client.logger`,vueApp:`client.vue`},optional:{mobile:`client.mobile`},provides:{realtime:`client.realtime`},setup({components,env,logger,mobile}){components.register(`realtime.web.connection.indicator`,RealtimeConnectionIndicator);return{realtime:createRealtimeClient({config:resolveRealtimeClientConfig({env,mobile}),logger})}},boot({vueApp},{outputs}){outputs.realtime.initialize(vueApp)},shutdown(_dependencies,{outputs}){outputs.realtime.dispose()}});var{t:t$8}=useJskitText();function isMissingDynamicModule(error,moduleSpecifier){const message=String(error?.message||error||``);return message.includes(moduleSpecifier)&&(message.includes(`Cannot find module`)||message.includes(`ERR_MODULE_NOT_FOUND`))}function notifyDynamicImportFailure(asyncModuleRecoveryRuntime,error,{label=t$8(`jskit.shell.recovery.appModuleLabel`)}={}){if(!isDynamicImportError(error))return;asyncModuleRecoveryRuntime.notify(error,{label})}var{t:t$7,text}=useJskitText();var GENERIC_REQUEST_LABEL=`Request`;function appReloadFailureMessage(){return t$7(`jskit.shell.recovery.reloadFailed`)}var RECOVERABLE_REQUEST_ERROR_MESSAGES=Object.freeze([/Failed to fetch/iu,/Load failed/iu,/Network request failed/iu,/NetworkError when attempting to fetch resource/iu,/The Internet connection appears to be offline/iu]);var RECOVERABLE_REQUEST_ERROR_CODES=Object.freeze(new Set([`EAI_AGAIN`,`ECONNABORTED`,`ECONNREFUSED`,`ECONNRESET`,`ENETDOWN`,`ENETUNREACH`,`ENOTFOUND`,`ERR_NETWORK`,`ETIMEDOUT`]));var CANCELED_REQUEST_ERROR_CODES=Object.freeze(new Set([`ABORT_ERR`,`ERR_ABORTED`,`ERR_CANCELED`]));var SAFE_REQUEST_RECOVERY_METHODS=Object.freeze(new Set([`GET`,`HEAD`]));function errorMessage(error=null){return normalizeText$1(error?.message||error?.cause?.message||error)}function errorCode(error=null){return normalizeText$1(error?.code||error?.cause?.code).toUpperCase()}function errorName(error=null){return normalizeText$1(error?.name||error?.cause?.name)}function normalizeRequestErrorStatus(error=null){if(!isRecord(error))return null;const hasStatus=Object.prototype.hasOwnProperty.call(error,`status`);const hasStatusCode=Object.prototype.hasOwnProperty.call(error,`statusCode`);if(!hasStatus&&!hasStatusCode)return null;const status=Number(hasStatus?error.status:error.statusCode);return Number.isInteger(status)?status:null}function isCanceledRequestError(error=null){const name=errorName(error).toLowerCase();if(name===`aborterror`||name===`cancelederror`)return true;return CANCELED_REQUEST_ERROR_CODES.has(errorCode(error))}function isRecoverableRequestError(error=null){if(!error||isCanceledRequestError(error))return false;if(normalizeRequestErrorStatus(error)===0)return true;if(RECOVERABLE_REQUEST_ERROR_CODES.has(errorCode(error)))return true;const message=errorMessage(error);return Boolean(message&&RECOVERABLE_REQUEST_ERROR_MESSAGES.some(pattern=>pattern.test(message)))}function requestRecoveryMessage(error=null,{label=``,message=``}={}){const explicitMessage=normalizeText$1(message);if(explicitMessage)return explicitMessage;const requestLabel=normalizeText$1(text(label));if(!requestLabel||requestLabel===GENERIC_REQUEST_LABEL)return t$7(`jskit.shell.recovery.appUnreachable`);return t$7(`jskit.shell.recovery.unreachable`,{label:requestLabel})}function readQueryRecoveryMeta(query){const meta=isRecord(query.meta)?query.meta:{};const jskitMeta=isRecord(meta.jskit)?meta.jskit:{};const dedupeWindowMs=jskitMeta.requestRecoveryDedupeWindowMs;return Object.freeze({disabled:jskitMeta.requestRecovery===false,label:normalizeText$1(jskitMeta.requestRecoveryLabel),source:normalizeText$1(jskitMeta.requestRecoverySource,{fallback:`shell-web.request-recovery.query`}),dedupeKey:normalizeText$1(jskitMeta.requestRecoveryDedupeKey),dedupeWindowMs:Number.isFinite(Number(dedupeWindowMs))?Math.max(0,Number(dedupeWindowMs)):null,method:normalizeText$1(jskitMeta.requestRecoveryMethod).toUpperCase()})}function recoverableQueryError(query){const{state}=query;if(state.status!==`error`||state.fetchStatus!==`idle`)return null;const error=state.error||state.fetchFailureReason||null;return isRecoverableRequestError(error)?error:null}function createQueryRetry(queryClient,query){const{queryKey}=query;if(!Array.isArray(queryKey))return null;return()=>queryClient.refetchQueries({queryKey,exact:true,type:`active`},{throwOnError:false})}function resolveQueryHash(query){const explicitHash=normalizeText$1(query.queryHash);if(explicitHash)return explicitHash;try{return normalizeText$1(JSON.stringify(query.queryKey||[]))}catch{return normalizeText$1(String(query.queryKey||``))}}function installRecoverableQueryObserver({queryClient,runtime,logger}){const queryCache=queryClient.getQueryCache();const reportedErrorUpdateByQueryHash=new Map;function dismissReportedQueryRecovery(queryHash=``){const reported=reportedErrorUpdateByQueryHash.get(queryHash);if(!reported)return;reportedErrorUpdateByQueryHash.delete(queryHash);if(reported.presentationId)runtime.dismiss(reported.presentationId,{presenterId:reported.presenterId})}function dismissReportedQueryRecoveries(){for(const queryHash of[...reportedErrorUpdateByQueryHash.keys()])dismissReportedQueryRecovery(queryHash)}function inspectQuery(query){const queryHash=resolveQueryHash(query);const recoveryMeta=readQueryRecoveryMeta(query);if(recoveryMeta.disabled||!SAFE_REQUEST_RECOVERY_METHODS.has(recoveryMeta.method)||!query.isActive()){if(queryHash)dismissReportedQueryRecovery(queryHash);return}const error=recoverableQueryError(query);if(!error||!queryHash){if(queryHash)dismissReportedQueryRecovery(queryHash);return}const errorUpdateCount=Number(query.state.errorUpdateCount||0);const reportKey=`${errorUpdateCount}:${errorMessage(error)}`;const reported=reportedErrorUpdateByQueryHash.get(queryHash);if(reported?.reportKey===reportKey)return;const{dedupeWindowMs}=recoveryMeta;const result=runtime.report(error,{label:recoveryMeta.label,retry:createQueryRetry(queryClient,query),source:recoveryMeta.source,stale:query.state.data!==void 0,dedupeKey:recoveryMeta.dedupeKey||`shell-web.request-recovery.query.${queryHash}.${errorUpdateCount}`,...dedupeWindowMs!==null?{dedupeWindowMs}:{}});const presentationId=normalizeText$1(result?.presentationId||reported?.presentationId);const presenterId=normalizeText$1(result?.decision?.presenterId||reported?.presenterId);if(reported?.presentationId&&reported.presentationId!==presentationId)dismissReportedQueryRecovery(queryHash);reportedErrorUpdateByQueryHash.set(queryHash,{reportKey,presentationId,presenterId})}try{for(const query of queryCache.getAll())inspectQuery(query)}catch(error){logger.warn({error:errorMessage(error)||`unknown error`},`Shell request recovery could not inspect existing queries.`)}const unsubscribe=queryCache.subscribe(event=>{try{inspectQuery(event.query)}catch(error){logger.warn({error:errorMessage(error)||`unknown error`},`Shell request recovery query observer failed.`)}});return Object.freeze({dispose(){dismissReportedQueryRecoveries();unsubscribe()}})}function createShellRequestRecoveryRuntime({queryClient,errorRuntime,logger}){let installedQueryObserver=null;let reloadAttempt=0;async function reload({label=t$7(`jskit.shell.recovery.appLabel`),message=appReloadFailureMessage()}={}){const reloaded=await guardedReloadApp({label,message});if(!reloaded){reloadAttempt+=1;report(new Error(`Network request failed.`),{label,message,reload:true,force:true,source:`shell-web.request-recovery.reload`,dedupeKey:`shell-web.request-recovery.reload.${reloadAttempt}`})}return reloaded}function retryAction(options,retry){return{label:normalizeText$1(text(options.actionLabel),{fallback:t$7(`jskit.shell.actions.retry`)}),dismissOnRun:true,async handler(){try{return await retry()}catch(retryError){if(isRecoverableRequestError(retryError))return report(retryError,options);throw retryError}}}}function reloadAction(options){return{label:normalizeText$1(text(options.actionLabel),{fallback:t$7(`jskit.shell.actions.reload`)}),dismissOnRun:true,handler(){return reload({label:options.label,message:options.reloadFailureMessage||appReloadFailureMessage()})}}}function dismiss(presentationId=``,options={}){return errorRuntime.dismiss(presentationId,options)}function report(error=null,options={}){if(!isRecoverableRequestError(error)&&options.force!==true)return null;const source=normalizeText$1(options.source,{fallback:`shell-web.request-recovery`});const action=options.retry?retryAction(options,options.retry):options.reload===true?reloadAction(options):null;try{return errorRuntime.report({source,message:requestRecoveryMessage(error,options),cause:error||null,intent:`app-recoverable`,severity:normalizeText$1(options.severity,{fallback:options.stale?`warning`:`error`}),dedupeKey:normalizeText$1(options.dedupeKey),dedupeWindowMs:Number.isFinite(Number(options.dedupeWindowMs))?Math.max(0,Number(options.dedupeWindowMs)):2e3,action})}catch(reportError){logger.error({source,error:errorMessage(reportError)||`unknown error`},`Shell request recovery could not report through the shell error runtime.`);return null}}function install(){if(installedQueryObserver)return installedQueryObserver;installedQueryObserver=installRecoverableQueryObserver({queryClient,runtime:api,logger});return installedQueryObserver}function dispose(){if(installedQueryObserver){installedQueryObserver.dispose();installedQueryObserver=null}}const api=Object.freeze({dismiss,dispose,install,isRecoverableRequestError,reload,report});return api}var{t:t$6}=useJskitText();function createShellAsyncModuleRecoveryRuntime({router,errorRuntime,logger}){const state=createAsyncModuleRecoveryState();let installedRecovery=null;function report(nextState=state){try{return errorRuntime.report({source:`shell-web.async-module-recovery`,message:String(nextState.message||t$6(`jskit.shell.recovery.moduleFailed`)),...nextState.message&&nextState.messageCode?{messageCode:nextState.messageCode,messageParams:nextState.messageParams}:{},cause:nextState.error||null,intent:`app-recoverable`,severity:`warning`,dedupeKey:`shell-web.async-module-recovery.${Number(nextState.attempt||0)}`,action:{label:t$6(`jskit.shell.actions.reload`),dismissOnRun:true,handler(){return reload()}}})}catch(error){logger.error({label:String(nextState.label||``),error:String(error?.message||error||`unknown error`)},`Async module recovery could not report through the shell error runtime.`);return null}}async function reload(){const reloaded=await guardedReloadApp({state,label:t$6(`jskit.shell.recovery.appLabel`),message:appReloadFailureMessage()});if(!reloaded)report(state);return reloaded}function notify(error=null,{label=t$6(`jskit.shell.recovery.appModuleLabel`),message=``,stale=isDynamicImportError(error)}={}){notifyAsyncModuleLoadError(state,error,{label,message,retry:state.retry,stale});return report(state)}function install(){if(installedRecovery)return installedRecovery;installedRecovery=installAsyncModuleRecoveryHandlers({state,label:t$6(`jskit.shell.recovery.appModuleLabel`),router,onNotify:report});return installedRecovery}function dispose(){if(installedRecovery){installedRecovery.dispose();installedRecovery=null}}return Object.freeze({dispose,install,notify,reload,report,state})}var CLIENT_BUILD_META_NAME=`jskit-client-build`;var CLIENT_BUILD_META_PATTERN=new RegExp(`<meta name="${CLIENT_BUILD_META_NAME}" content="([0-9a-f]+)"`,`u`);function pageClientBuildId(documentObject=globalThis.document){const meta=documentObject?.querySelector(`meta[name="${CLIENT_BUILD_META_NAME}"]`);return String(meta?.getAttribute(`content`)||``).trim()}var{t:t$5}=useJskitText();function stopNothing(){}function createShellClientUpdateRuntime({errorRuntime,reload,pageBuildId=pageClientBuildId(),appName=normalizeText$1(pageTitle())}){let offer=null;let stopWatching=stopNothing;function withdraw(){if(offer?.presentationId)errorRuntime.dismiss(offer.presentationId);offer=null}function offerReload(servedBuildId){const[messageKey,messageParams]=appName?[`jskit.shell.recovery.appUpdated`,{app:appName}]:[`jskit.shell.recovery.thisAppUpdated`,{}];const result=errorRuntime.report({source:`shell-web.client-update`,message:t$5(messageKey,messageParams),messageCode:messageKey.slice(6),messageParams,intent:`app-recoverable`,severity:`info`,action:{label:t$5(`jskit.shell.actions.reload`),handler(){return reload()}}});offer={buildId:servedBuildId,presentationId:normalizeText$1(result.presentationId)}}function check(servedBuildId=``){const served=normalizeText$1(servedBuildId);if(!pageBuildId||!served||served===offer?.buildId)return;withdraw();if(served!==pageBuildId)offerReload(served)}function watch(realtime){dispose();if(realtime)stopWatching=realtime.onServedClientBuild(check)}function dispose(){stopWatching();stopWatching=stopNothing}return Object.freeze({check,dispose,watch})}var APP_ENVIRONMENTS=Object.freeze([`development`,`test`,`staging`,`production`]);var STAGING_AND_PRODUCTION=Object.freeze([`staging`,`production`]);var APP_ENVIRONMENT_META_NAME=`jskit-app-environment`;var STAGING_REAL_PEOPLE_META_NAME=`jskit-staging-reaches-real-people`;var APP_ENVIRONMENT_META_PATTERN=new RegExp(`<meta name="${APP_ENVIRONMENT_META_NAME}" content="[a-z]*">(?:<meta name="${STAGING_REAL_PEOPLE_META_NAME}" content="true">)?`,`u`);function pageAppEnvironment(documentObject=globalThis.document){const meta=documentObject?.querySelector(`meta[name="${APP_ENVIRONMENT_META_NAME}"]`);const content=String(meta?.getAttribute(`content`)||``).trim();return APP_ENVIRONMENTS.includes(content)?content:``}function pageStagingReachesRealPeople(documentObject=globalThis.document){const meta=documentObject?.querySelector(`meta[name="${STAGING_REAL_PEOPLE_META_NAME}"]`);return pageAppEnvironment(documentObject)===`staging`&&String(meta?.getAttribute(`content`)||``).trim()===`true`}var{t:t$4}=useJskitText();var APP_ENVIRONMENT_BANNER_ID=`jskit-app-environment-banner`;var BANNERED_ENVIRONMENTS=Object.freeze([`development`,`test`,`staging`]);var BANNER_TEXT_PREFIX=`jskit.shell.appEnvironment.`;var STAGING_REAL_PEOPLE_TEXT=`stagingRealPeople`;var APP_ENVIRONMENT_BANNER_STYLE=Object.freeze({position:`fixed`,top:`env(safe-area-inset-top, 0px)`,left:`50%`,transform:`translateX(-50%)`,zIndex:`2147483000`,pointerEvents:`none`,userSelect:`none`,padding:`2px 12px 3px`,borderRadius:`0 0 8px 8px`,background:`#ffb300`,color:`#1f1300`,font:`600 12px/16px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`,letterSpacing:`0.02em`,whiteSpace:`nowrap`,boxShadow:`0 1px 3px rgba(0, 0, 0, 0.3)`});function removeNothing(){}function installAppEnvironmentBanner({documentObject=pageDocument(),environment=pageAppEnvironment(documentObject),reachesRealPeople=pageStagingReachesRealPeople(documentObject)}={}){if(!BANNERED_ENVIRONMENTS.includes(environment)||!documentObject?.body||documentObject.getElementById(`jskit-app-environment-banner`))return removeNothing;const banner=documentObject.createElement(`div`);banner.id=APP_ENVIRONMENT_BANNER_ID;banner.setAttribute(`data-testid`,APP_ENVIRONMENT_BANNER_ID);banner.setAttribute(`role`,`note`);const text=environment===`staging`&&reachesRealPeople===true?STAGING_REAL_PEOPLE_TEXT:environment;banner.setAttribute(`aria-description`,t$4(`${BANNER_TEXT_PREFIX}${text}Description`));banner.textContent=t$4(`${BANNER_TEXT_PREFIX}${text}`);Object.assign(banner.style,APP_ENVIRONMENT_BANNER_STYLE);documentObject.body.append(banner);return()=>banner.remove()}function createAppEnvironmentBannerRuntime(options){let remove=removeNothing;function install(){remove();remove=installAppEnvironmentBanner(options)}function dispose(){remove();remove=removeNothing}return Object.freeze({install,dispose})}var SHELL_REQUEST_RECOVERY_RUNTIME_KEY=`jskit.shell-web.runtime.web-request-recovery.client`;var NO_SHELL_REQUEST_RECOVERY_RUNTIME=Object.freeze({dismiss(){return 0},dispose(){},install(){return Object.freeze({dispose(){}})},isRecoverableRequestError,async reload(){return false},report(){return null}});function createStoreBackedPresenter({id,channel,store}){const normalizedId=normalizeText(id);const normalizedChannel=normalizeText(channel).toLowerCase();if(!normalizedId)throw new Error(`createStoreBackedPresenter requires id.`);if(!normalizedChannel)throw new Error(`createStoreBackedPresenter("${normalizedId}") requires channel.`);function supports(requestedChannel=``){return String(requestedChannel||``).trim().toLowerCase()===normalizedChannel}function present(payload={}){return store.present(normalizedChannel,{...payload,presenterId:normalizedId})}function dismiss(presentationId=``){return store.dismiss(normalizedChannel,String(presentationId||``))}return Object.freeze({id:normalizedId,supports,present,dismiss})}function createMaterialSnackbarPresenter({store}){return createStoreBackedPresenter({id:`material.snackbar`,channel:`snackbar`,store})}function createMaterialBannerPresenter({store}){return createStoreBackedPresenter({id:`material.banner`,channel:`banner`,store})}function createMaterialDialogPresenter({store}){return createStoreBackedPresenter({id:`material.dialog`,channel:`dialog`,store})}function createDefaultMaterialErrorPresenters({store}){return Object.freeze([createMaterialSnackbarPresenter({store}),createMaterialBannerPresenter({store}),createMaterialDialogPresenter({store})])}var{t:t$3}=useJskitText();var PRESENTATION_CHANNELS=Object.freeze([`snackbar`,`banner`,`dialog`]);var SINGLETON_CHANNELS=new Set([`banner`]);function createEmptyChannelState(){return{snackbar:[],banner:[],dialog:[]}}function freezeParams(params){return Object.freeze(params&&typeof params===`object`&&!Array.isArray(params)?{...params}:{})}function cloneEntry(entry={}){return Object.freeze({id:String(entry.id||``).trim(),channel:String(entry.channel||``).trim(),message:String(entry.message||``).trim(),code:String(entry.code||``).trim(),params:freezeParams(entry.params),messageCode:String(entry.messageCode||``).trim(),messageParams:freezeParams(entry.messageParams),severity:String(entry.severity||`error`).trim(),persist:Boolean(entry.persist),action:entry.action||null,additionalActions:entry.additionalActions,presenterId:String(entry.presenterId||``).trim(),dedupeKey:String(entry.dedupeKey||``).trim(),timestamp:Number(entry.timestamp||0)})}function createErrorPresentationStore({now=()=>Date.now()}={}){const listeners=new Set;const subscribe=createListenerSubscription(listeners);const channelState=createEmptyChannelState();let sequence=0;let revision=0;function getChannelEntries(channel){if(!PRESENTATION_CHANNELS.includes(channel))throw new Error(`Unknown presentation channel "${channel}".`);return channelState[channel]}function getState(){return Object.freeze({revision,channels:Object.freeze({snackbar:Object.freeze(channelState.snackbar.map(cloneEntry)),banner:Object.freeze(channelState.banner.map(cloneEntry)),dialog:Object.freeze(channelState.dialog.map(cloneEntry))})})}function notify(event={}){const snapshot=getState();for(const listener of listeners)try{listener(snapshot,Object.freeze({...event}))}catch{}}function present(channel,payload={}){const normalizedChannel=String(channel||``).trim();const entries=getChannelEntries(normalizedChannel);sequence+=1;const entry=Object.freeze({id:normalizeText(payload.id,`${normalizedChannel}-${sequence}`),channel:normalizedChannel,message:normalizeText(payload.message,t$3(`jskit.shell.error.requestFailed`)),code:normalizeText(payload.code),params:freezeParams(payload.params),messageCode:normalizeText(payload.messageCode),messageParams:freezeParams(payload.messageParams),severity:normalizeSeverity(payload.severity,`error`),persist:payload.persist===true,action:normalizeAction(payload.action),additionalActions:normalizeAdditionalActions(payload.additionalActions),presenterId:normalizeText(payload.presenterId),dedupeKey:normalizeText(payload.dedupeKey),timestamp:Number(now())});if(SINGLETON_CHANNELS.has(normalizedChannel)&&entries.length>0)entries.splice(0,entries.length);entries.push(entry);revision+=1;notify({type:`presented`,channel:normalizedChannel,id:entry.id});return entry.id}function dismiss(channel,presentationId=``){const normalizedChannel=String(channel||``).trim();const entries=getChannelEntries(normalizedChannel);const normalizedPresentationId=normalizeText(presentationId);if(!normalizedPresentationId){if(entries.length<1)return 0;const removed=entries.length;entries.splice(0,entries.length);revision+=1;notify({type:`dismissed`,channel:normalizedChannel,id:``,count:removed});return removed}const index=entries.findIndex(entry=>entry.id===normalizedPresentationId);if(index<0)return 0;entries.splice(index,1);revision+=1;notify({type:`dismissed`,channel:normalizedChannel,id:normalizedPresentationId,count:1});return 1}function clear(channel=``){const normalizedChannel=normalizeText(channel).toLowerCase();if(!normalizedChannel){let removedCount=0;for(const candidateChannel of PRESENTATION_CHANNELS)removedCount+=dismiss(candidateChannel,``);return removedCount}return dismiss(normalizedChannel,``)}return Object.freeze({getState,subscribe,present,dismiss,clear})}var DEFAULT_DEBUG_DEPTH=4;function describeFunction(fn){return`[Function ${fn.name||`anonymous`}]`}function describeSymbol(value){return value.toString()}function explodePayload(value,depth=4){const visited=new WeakSet;function walk(node,remaining){if(node===null||typeof node!==`object`){if(typeof node===`function`)return describeFunction(node);if(typeof node===`symbol`)return describeSymbol(node);return node}if(visited.has(node))return`[Circular]`;visited.add(node);if(remaining<=0)return Array.isArray(node)?`[Array]`:`[Object]`;if(Array.isArray(node))return node.map(entry=>walk(entry,remaining-1));if(node instanceof Date)return node.toISOString();const next={};for(const[key,child]of Object.entries(node))next[key]=walk(child,remaining-1);return next}return walk(value,depth)}function ensureArray(value){if(Array.isArray(value))return value;if(value===void 0||value===null)return[];return[value]}var PLACEMENT_DEBUG_PREFIX=`[placement-debug]`;var PLACEMENT_DEBUG_FLAG=`__JSKIT_PLACEMENT_DEBUG__`;function isPlacementDebugEnabled(){return globalThis[PLACEMENT_DEBUG_FLAG]===true}function debugLog(message,payload=null){if(!isPlacementDebugEnabled())return;if(payload===null||payload===void 0){console.log(`${PLACEMENT_DEBUG_PREFIX} ${message}`);return}const terminalPayload=explodePayload(payload,4);const rendered=JSON.stringify(terminalPayload,null,2);console.log(`${PLACEMENT_DEBUG_PREFIX} ${message}\n${rendered}`)}function normalizePlacementList(placements,context={}){const normalized=[];for(const candidate of ensureArray(placements)){const placement=normalizePlacementDefinition(candidate,{strict:false,source:`app placement`});if(!placement||placement.enabled===false)continue;normalized.push(placement)}const byId=new Map;for(const placement of normalized){if(byId.has(placement.id))throw new Error(`Duplicate placement id "${placement.id}" in ${context.source||`placement list`}.`);byId.set(placement.id,placement)}return[...byId.values()].map((placement,index)=>({placement,index})).sort((left,right)=>{const orderCompare=left.placement.order-right.placement.order;if(orderCompare!==0)return orderCompare;return left.index-right.index}).map(entry=>entry.placement)}function normalizeTopologyList(topology,context={}){if(Array.isArray(topology))return normalizeTopologyList(normalizePlacementTopologyDefinition({placements:topology},{context:context.source||`placement topology`}),context);const candidates=ensureArray(topology);const entries=[];for(const candidate of candidates){const normalized=normalizePlacementTopologyDefinition(candidate,{context:context.source||`placement topology`});entries.push(...normalized.placements)}const byKey=new Map;for(const entry of entries){const key=`${entry.id}::${entry.owner||``}`;if(byKey.has(key))throw new Error(`Duplicate semantic placement "${entry.id}"${entry.owner?` for owner "${entry.owner}"`:``} in ${context.source||`placement topology`}.`);byKey.set(key,entry)}return Object.freeze([...byKey.values()])}function matchesSurface(placementSurfaces,requestedSurface){if(requestedSurface===`*`)return true;const surfaces=Array.isArray(placementSurfaces)?placementSurfaces:[`*`];return surfaces.includes(`*`)||surfaces.includes(requestedSurface)}function resolveTopologyPlacement(topologyEntries=[],placement={},requestedSurface=`*`){const semanticTarget=String(placement.target||``).trim();const owner=String(placement.owner||``).trim();const matches=topologyEntries.filter(entry=>{if(entry.id!==semanticTarget)return false;if(owner&&entry.owner!==owner)return false;if(!owner&&entry.owner)return false;return matchesSurface(entry.surfaces,requestedSurface)});if(matches.length===1)return matches[0];return null}function resolveRenderablePlacement({placement={},topologyEntries=[],requestedSurface=`*`,requestedTarget=``,requestedLayoutClass=`compact`}={}){if(placement.targetType===`concrete`){if(placement.target!==requestedTarget)return null;return placement}const topologyPlacement=resolveTopologyPlacement(topologyEntries,placement,requestedSurface);if(!topologyPlacement)return null;const variant=topologyPlacement.variants?.[requestedLayoutClass]||null;if(!variant||variant.outlet!==requestedTarget)return null;const componentToken=String(placement.componentToken||variant.renderers?.[placement.kind]||``).trim();if(!componentToken)return null;return Object.freeze({...placement,target:requestedTarget,semanticTarget:placement.target,topologyOwner:topologyPlacement.owner||``,layoutClass:requestedLayoutClass,componentToken})}function resolveContextContributors(contributors,baseContext={},logger){let merged={};for(const contributor of ensureArray(contributors))try{const resolved=typeof contributor===`function`?contributor(Object.freeze({...baseContext})):contributor;if(isRecord(resolved))merged={...merged,...resolved}}catch(error){logger.warn({contributor,error:String(error?.message||error||`unknown error`)},`Failed to evaluate web placement context contributor.`)}return merged}function resolvePlacementComponent(components,placement,logger,missingTokens,invalidComponentTokens,failedTokens){const componentToken=String(placement.componentToken||``).trim();if(!componentToken)return null;if(invalidComponentTokens.has(componentToken)||failedTokens.has(componentToken))return null;if(!components.has(componentToken)){if(!missingTokens.has(componentToken)){missingTokens.add(componentToken);logger.warn({placementId:placement.id,componentToken},`Skipping placement because component token is not bound.`)}return null}let component=null;try{component=components.get(componentToken)}catch(error){if(!failedTokens.has(componentToken)){failedTokens.add(componentToken);logger.error({placementId:placement.id,componentToken,error:String(error?.message||error||`unknown error`)},`Skipping placement because component token resolution threw.`)}return null}if(!isRenderableComponent(component)){if(!invalidComponentTokens.has(componentToken)){invalidComponentTokens.add(componentToken);logger.warn({placementId:placement.id,componentToken},`Skipping placement because component token did not resolve to a Vue component.`)}return null}return component}function shouldIncludePlacement(placement,placementContext,logger){try{return placement.when(Object.freeze({...placementContext}))===true}catch(error){logger.warn({placementId:placement.id,error:String(error?.message||error||`unknown error`)},`Placement when() predicate failed; placement was skipped.`);return false}}function createWebPlacementRuntime({components,contextContributors=[],logger}){const missingTokens=new Set;const invalidComponentTokens=new Set;const failedTokens=new Set;const listeners=new Set;const subscribe=createListenerSubscription(listeners);let placementDefinitions=Object.freeze([]);let placementTopology=Object.freeze([]);let sharedContext=Object.freeze({});let revision=0;function notify(event={}){revision+=1;debugLog(`notify`,{revision,event});for(const listener of listeners)try{listener(Object.freeze({revision,...event}))}catch(error){logger.warn({error:String(error?.message||error||`unknown error`)},`Web placement runtime listener threw during notification.`)}}function replacePlacements(entries=[],{source=`app placement registry`}={}){missingTokens.clear();invalidComponentTokens.clear();failedTokens.clear();placementDefinitions=Object.freeze(normalizePlacementList(entries,{source}));debugLog(`replacePlacements`,{source,count:placementDefinitions.length,ids:placementDefinitions.map(entry=>entry.id)});notify({type:`placements.replaced`,source})}function replacePlacementTopology(topology=[],{source=`app placement topology`}={}){missingTokens.clear();invalidComponentTokens.clear();failedTokens.clear();placementTopology=normalizeTopologyList(topology,{source});debugLog(`replacePlacementTopology`,{source,count:placementTopology.length,ids:placementTopology.map(entry=>entry.owner?`${entry.id}#${entry.owner}`:entry.id)});notify({type:`placement-topology.replaced`,source})}function getContext(){return sharedContext}function setContext(value={},{replace=false,source=`placement-context`}={}){const next=isRecord(value)?{...value}:{};let nextContext=next;if(!replace)nextContext={...sharedContext,...next};sharedContext=Object.freeze(nextContext);debugLog(`setContext`,{replace,source,keys:Object.keys(sharedContext)});notify({type:`context.updated`,source});return sharedContext}function getRevision(){return revision}function getPlacements({surface=`*`,target=``,layoutClass=``,context={}}={}){const normalizedTarget=normalizePlacementTarget(target,{strict:false});if(!normalizedTarget)return Object.freeze([]);const normalizedSurface=normalizeSurface(surface);const normalizedLayoutClass=normalizePlacementLayoutClass(layoutClass)||normalizePlacementLayoutClass(sharedContext.layoutClass)||`compact`;const baseContext=isRecord(context)?{...context}:{};const contextFromRuntime=sharedContext;const placementContext={...resolveContextContributors(contextContributors,{surface:normalizedSurface,target:normalizedTarget,layoutClass:normalizedLayoutClass,context:{...contextFromRuntime,...baseContext}},logger),...contextFromRuntime,...baseContext,surface:normalizedSurface,target:normalizedTarget,layoutClass:normalizedLayoutClass};debugLog(`getPlacements:start`,{surface:normalizedSurface,target:normalizedTarget,layoutClass:normalizedLayoutClass,contextKeys:Object.keys(baseContext),sharedContextKeys:Object.keys(contextFromRuntime),placementCount:placementDefinitions.length,topologyCount:placementTopology.length});const matches=[];for(const placement of placementDefinitions){const renderablePlacement=resolveRenderablePlacement({placement,topologyEntries:placementTopology,requestedSurface:normalizedSurface,requestedTarget:normalizedTarget,requestedLayoutClass:normalizedLayoutClass});if(!renderablePlacement)continue;const placementSurfaces=renderablePlacement.surfaces;if(!matchesSurface(placementSurfaces,normalizedSurface)){debugLog(`getPlacements:skip-surfaces`,{placementId:renderablePlacement.id,placementSurfaces,requestedSurface:normalizedSurface});continue}if(!shouldIncludePlacement(renderablePlacement,placementContext,logger)){debugLog(`getPlacements:skip-when`,{placementId:renderablePlacement.id});continue}const component=resolvePlacementComponent(components,renderablePlacement,logger,missingTokens,invalidComponentTokens,failedTokens);if(!component){debugLog(`getPlacements:skip-component`,{placementId:renderablePlacement.id,componentToken:renderablePlacement.componentToken});continue}debugLog(`getPlacements:include`,{placementId:renderablePlacement.id,componentToken:renderablePlacement.componentToken,placementSurfaces,order:renderablePlacement.order});matches.push(Object.freeze({...renderablePlacement,component}))}debugLog(`getPlacements:done`,{surface:normalizedSurface,target:normalizedTarget,layoutClass:normalizedLayoutClass,resultIds:matches.map(entry=>entry.id)});return Object.freeze(matches)}return Object.freeze({replacePlacements,replacePlacementTopology,getPlacements,getContext,setContext,subscribe,getRevision})}var{t:t$2}=useJskitText();function buildBootstrapUrl({path=BOOTSTRAP_PATH,query={}}={}){const normalizedPath=String(path||BOOTSTRAP_PATH).trim()||BOOTSTRAP_PATH;const params=new URLSearchParams;for(const[key,value]of Object.entries(normalizeObject(query))){const normalizedKey=String(key||``).trim();const normalizedValue=String(value||``).trim();if(!normalizedKey||!normalizedValue)continue;params.set(normalizedKey,normalizedValue)}const queryString=params.toString();return queryString?`${normalizedPath}?${queryString}`:normalizedPath}function normalizeBootstrapResponseError(response,url){const error=new Error(`Bootstrap payload request failed with status ${response.status}.`);error.statusCode=Number(response.status||0);error.url=url;return error}function createShellBootstrapRuntime({handlers,placementRuntime,requestRecoveryRuntime,router,logger,fetchImplementation=globalThis.fetch,bootstrapPath=BOOTSTRAP_PATH}){let initialized=false;let runningRefresh=null;let pendingRefresh=null;async function resolveBootstrapRequest(reason=`manual`){const payloadHandlers=handlers.list();let request={path:bootstrapPath,query:{},meta:{}};for(const handler of payloadHandlers){const contribution=normalizeObject(await handler.resolveBootstrapRequest({router,placementRuntime,reason,request:Object.freeze({path:request.path,query:Object.freeze({...request.query}),meta:Object.freeze({...request.meta})})}));request={path:String(contribution.path||request.path||bootstrapPath).trim()||bootstrapPath,query:{...request.query,...normalizeObject(contribution.query)},meta:{...request.meta,...normalizeObject(contribution.meta)}}}return Object.freeze({path:request.path,query:Object.freeze({...request.query}),meta:Object.freeze({...request.meta})})}async function applyBootstrapPayload(payload,reason=`manual`,request=Object.freeze({})){const payloadHandlers=handlers.list();const source=`shell-web.bootstrap.${String(reason||`manual`).trim()||`manual`}`;for(const handler of payloadHandlers)await handler.applyBootstrapPayload({router,placementRuntime,payload,request,reason,source});return payload}async function applyBootstrapError(error,reason=`manual`,request=Object.freeze({})){const payloadHandlers=handlers.list();const source=`shell-web.bootstrap.${String(reason||`manual`).trim()||`manual`}`;for(const handler of payloadHandlers)await handler.handleBootstrapError({router,placementRuntime,error,request,reason,source})}async function performRefresh(reason=`manual`){let request=Object.freeze({path:bootstrapPath,query:Object.freeze({}),meta:Object.freeze({})});try{request=await resolveBootstrapRequest(reason);const url=buildBootstrapUrl(request);const response=await fetchImplementation(url,{method:`GET`,credentials:`include`,headers:{accept:`application/json`}});if(!response.ok)throw normalizeBootstrapResponseError(response,url);return await applyBootstrapPayload(await response.json(),reason,request)}catch(error){await applyBootstrapError(error,reason,request);requestRecoveryRuntime.report(error,{label:t$2(`jskit.shell.recovery.appDataLabel`),retry:()=>refresh(reason),source:`shell-web.bootstrap`,dedupeKey:`shell-web.bootstrap.${String(reason||`manual`).trim()||`manual`}.request-failed`});logger.warn({reason,error:String(error?.message||error||`unknown error`)},`shell-web bootstrap refresh failed.`);return null}}function startRefresh(reason){runningRefresh=performRefresh(reason).finally(()=>{runningRefresh=null});return runningRefresh}function refresh(reason=`manual`){if(pendingRefresh)return pendingRefresh;if(!runningRefresh)return startRefresh(reason);pendingRefresh=runningRefresh.catch(()=>null).then(()=>{pendingRefresh=null;return startRefresh(reason)});return pendingRefresh}async function initialize(){if(initialized)return null;initialized=true;return refresh(`init`)}return Object.freeze({initialize,refresh})}var{t:t$1}=useJskitText();var SHELL_WEB_REFRESH_RUNTIME_KEY=`jskit.shell-web.runtime.web-refresh.client`;var NO_SHELL_WEB_REFRESH_RUNTIME=Object.freeze({async refresh(reason=`manual`){return Object.freeze({reason,bootstrapRefreshed:false,queriesRefetched:false})}});function isPullRefreshQuery(query){const meta=isRecord(query.meta)?query.meta:{};if(meta.jskitRefresh===`pull`)return true;if(meta.jskitRefresh===false)return false;return(isRecord(meta.jskit)?meta.jskit:{}).refreshOnPull!==false}function createShellRefreshRuntime({bootstrapRuntime,queryClient,errorRuntime,logger}){let refreshQueue=Promise.resolve(null);async function refreshBootstrap(reason){await bootstrapRuntime.refresh(reason);return true}async function refetchPullQueries(){await queryClient.refetchQueries({type:`active`,predicate:isPullRefreshQuery},{throwOnError:false});return true}function reportRefreshFailure(error){logger.warn({error:String(error?.message||error||`unknown error`)},`Shell refresh failed.`);errorRuntime.report({source:`shell-web.refresh`,message:t$1(`jskit.shell.recovery.refreshFailed`),intent:`app-recoverable`,severity:`error`,dedupeKey:`shell-web.refresh.failed`,dedupeWindowMs:2e3,action:{label:t$1(`jskit.shell.actions.retry`),dismissOnRun:true,handler(){refresh(`retry`)}}})}async function performRefresh(reason=`manual`){const normalizedReason=String(reason||`manual`).trim()||`manual`;try{const[bootstrapRefreshed,queriesRefetched]=await Promise.all([refreshBootstrap(normalizedReason),refetchPullQueries()]);return Object.freeze({reason:normalizedReason,bootstrapRefreshed,queriesRefetched})}catch(error){reportRefreshFailure(error);return Object.freeze({reason:normalizedReason,bootstrapRefreshed:false,queriesRefetched:false,error})}}function refresh(reason=`manual`){refreshQueue=refreshQueue.catch(()=>null).then(()=>performRefresh(reason));return refreshQueue}return Object.freeze({refresh})}function contributeNoBootstrapRequest(){return{}}function ignoreBootstrapError(){}function normalizeBootstrapPayloadHandler(entry){if(typeof entry===`function`)return Object.freeze({handlerId:String(entry.name||`anonymous`),order:0,applyBootstrapPayload:entry,resolveBootstrapRequest:contributeNoBootstrapRequest,handleBootstrapError:ignoreBootstrapError});const handlerId=String(entry.handlerId||``).trim();if(!handlerId)throw new TypeError(`Bootstrap payload handlers require handlerId.`);return Object.freeze({...entry,handlerId,order:Number.isFinite(entry.order)?Number(entry.order):0,resolveBootstrapRequest:entry.resolveBootstrapRequest||contributeNoBootstrapRequest,handleBootstrapError:entry.handleBootstrapError||ignoreBootstrapError})}function createBootstrapPayloadHandlerRegistry(){const handlers=new Map;function register(entry){const handler=normalizeBootstrapPayloadHandler(entry);if(handlers.has(handler.handlerId))throw new Error(`Bootstrap payload handler "${handler.handlerId}" is duplicated.`);handlers.set(handler.handlerId,handler);return api}function list(){return Object.freeze([...handlers.values()].sort((left,right)=>{if(left.order!==right.order)return left.order-right.order;return left.handlerId.localeCompare(right.handlerId)}))}const api=Object.freeze({register,list});return api}function resolveBootstrapErrorStatusCode(error){const statusCode=Number(error?.statusCode||error?.status||0);return Number.isInteger(statusCode)&&statusCode>0?statusCode:0}var{t}=useJskitText();var APP_PLACEMENT_MODULE_SPECIFIER=`/src/placement.js`;var APP_PLACEMENT_TOPOLOGY_MODULE_SPECIFIER=`/src/placementTopology.js`;var APP_ERROR_MODULE_SPECIFIER=`/src/error.js`;async function loadAppModule({importModule,specifier,label,resolve,invalidExportMessage=``,loadFailureMessage,fallback,logger,asyncModuleRecoveryRuntime}){try{const exported=(await importModule()).default;const resolved=await resolve(exported);if(resolved!==void 0)return resolved;logger.warn({module:specifier,exportedType:typeof exported},invalidExportMessage)}catch(error){if(isMissingDynamicModule(error,specifier))return fallback;notifyDynamicImportFailure(asyncModuleRecoveryRuntime,error,{label});logger.warn({module:specifier,error:String(error?.message||error||`unknown error`)},loadFailureMessage)}return fallback}function importAppModules(){const imports={placements:__vitePreload(()=>import(`./project-shared-pageNames-CWXyQBuT.js`).then(n=>n.n),[]),placementTopology:__vitePreload(()=>import(`./placementTopology-CDhUIK6L.js`),[]),errorConfig:__vitePreload(()=>import(`./error-vtsBf2sc.js`),[])};for(const pending of Object.values(imports))pending.catch(()=>{});return imports}function loadAppPlacementDefinitions(logger,asyncModuleRecoveryRuntime,pendingImport){return loadAppModule({importModule:()=>pendingImport,specifier:APP_PLACEMENT_MODULE_SPECIFIER,label:t(`jskit.shell.recovery.placementConfigLabel`),resolve(exported){const resolved=typeof exported===`function`?exported():exported;return Array.isArray(resolved)?resolved:void 0},invalidExportMessage:`App placement module default export did not resolve to an array; using empty list.`,loadFailureMessage:`Failed to load app placement module; using empty list.`,fallback:[],logger,asyncModuleRecoveryRuntime})}function loadAppPlacementTopology(logger,asyncModuleRecoveryRuntime,pendingImport){return loadAppModule({importModule:()=>pendingImport,specifier:APP_PLACEMENT_TOPOLOGY_MODULE_SPECIFIER,label:t(`jskit.shell.recovery.placementTopologyLabel`),resolve:exported=>resolveAppPlacementTopologyExport(exported,logger),loadFailureMessage:`Failed to load app placement topology module; using empty topology.`,fallback:[],logger,asyncModuleRecoveryRuntime})}function resolveAppPlacementTopologyExport(exported,logger){const resolved=typeof exported===`function`?exported():exported;if(Array.isArray(resolved))return resolved;if(resolved&&typeof resolved===`object`)return resolved;logger.warn({module:APP_PLACEMENT_TOPOLOGY_MODULE_SPECIFIER,exportedType:typeof exported},`App placement topology module default export did not resolve to an object or array; using empty topology.`);return[]}function createErrorConfigToolkit(errorRuntime){return Object.freeze({createDefaultErrorPolicy,moduleDefaultPresenterId:`material.snackbar`,presenterFactories:Object.freeze({createMaterialSnackbarPresenter,createMaterialBannerPresenter,createMaterialDialogPresenter}),runtime:errorRuntime})}function loadAppErrorConfig(logger,errorRuntime,asyncModuleRecoveryRuntime,pendingImport){return loadAppModule({importModule:()=>pendingImport,specifier:APP_ERROR_MODULE_SPECIFIER,label:t(`jskit.shell.recovery.errorConfigLabel`),async resolve(exported){const toolkit=createErrorConfigToolkit(errorRuntime);const resolved=typeof exported===`function`?await exported(toolkit):exported;return isRecord(resolved)?resolved:void 0},invalidExportMessage:`App error module default export did not resolve to an object; using shell-web defaults.`,loadFailureMessage:`Failed to load app error module; using shell-web defaults.`,fallback:{},logger,asyncModuleRecoveryRuntime})}function installVueErrorBridge(vueApp,errorRuntime,logger){const previousHandler=vueApp.config.errorHandler;vueApp.config.errorHandler=(error,instance,info)=>{try{errorRuntime.report({source:`shell-web.vue.error-handler`,message:String(error?.message||t(`jskit.shell.error.unexpectedUi`)),cause:error,intent:`blocking`,severity:`error`,details:{info:String(info||``)}})}catch(reportError){logger.error({source:`shell-web.vue.error-handler`,error:String(reportError?.message||reportError||`unknown error`)},`Shell web error runtime failed to report a Vue error.`)}if(previousHandler)previousHandler(error,instance,info)}}function installRouterErrorBridge(router,errorRuntime,logger){router.onError(error=>{if(isDynamicImportError(error))return;try{errorRuntime.report({source:`shell-web.router.on-error`,message:String(error?.message||t(`jskit.shell.error.navigationFailed`)),cause:error,intent:`app-recoverable`,severity:`error`,dedupeKey:String(error?.message||`navigation-failed`),dedupeWindowMs:2e3})}catch(reportError){logger.error({source:`shell-web.router.on-error`,error:String(reportError?.message||reportError||`unknown error`)},`Shell web error runtime failed to report a router error.`)}})}var ShellWebClientProvider=defineProvider({id:`shell.web.client`,requires:{components:`client.components`,logger:`client.logger`,pinia:`client.pinia`,queryClient:`client.query`,router:`client.router`,surfaceRuntime:`client.surface`,vueApp:`client.vue`},optional:{realtime:`client.realtime`},provides:{shell:`client.shell`},setup({components,logger,queryClient,router}){const bootstrapHandlers=createBootstrapPayloadHandlerRegistry();bootstrapHandlers.register(Object.freeze({handlerId:`shell.web.bootstrap.surface-access`,order:0,applyBootstrapPayload({payload,placementRuntime,source}){placementRuntime.setContext({surfaceAccess:normalizeObject(normalizeObject(payload).surfaceAccess)},{source})},handleBootstrapError({error,placementRuntime,source}){if(resolveBootstrapErrorStatusCode(error)!==401)return;placementRuntime.setContext({surfaceAccess:{}},{source})}}));const errorPresentationStore=createErrorPresentationStore();const errorRuntime=createErrorRuntime({presenters:createDefaultMaterialErrorPresenters({store:errorPresentationStore}),policy:createDefaultErrorPolicy(),moduleDefaultPresenterId:`material.snackbar`,logger});const placementRuntime=createWebPlacementRuntime({components,logger});const asyncModuleRecoveryRuntime=createShellAsyncModuleRecoveryRuntime({router,errorRuntime,logger});const requestRecoveryRuntime=createShellRequestRecoveryRuntime({queryClient,errorRuntime,logger});const clientUpdateRuntime=createShellClientUpdateRuntime({errorRuntime,reload:()=>asyncModuleRecoveryRuntime.reload()});const bootstrapRuntime=createShellBootstrapRuntime({handlers:bootstrapHandlers,placementRuntime,requestRecoveryRuntime,router,logger});const refreshRuntime=createShellRefreshRuntime({bootstrapRuntime,queryClient,errorRuntime,logger});const navigationRuntime=createShellNavigationRuntime({router});const appEnvironmentBannerRuntime=createAppEnvironmentBannerRuntime();return{shell:Object.freeze({asyncModuleRecovery:asyncModuleRecoveryRuntime,bootstrap:bootstrapRuntime,bootstrapHandlers,clientUpdate:clientUpdateRuntime,error:errorRuntime,errorPresentationStore,navigation:navigationRuntime,placement:placementRuntime,refresh:refreshRuntime,requestRecovery:requestRecoveryRuntime,appEnvironmentBanner:appEnvironmentBannerRuntime})}},async boot({logger,pinia,realtime,router,surfaceRuntime,vueApp},{outputs}){const{asyncModuleRecovery:asyncModuleRecoveryRuntime,bootstrap:bootstrapRuntime,clientUpdate:clientUpdateRuntime,error:errorRuntime,errorPresentationStore,navigation:navigationRuntime,placement:placementRuntime,refresh:refreshRuntime,requestRecovery:requestRecoveryRuntime}=outputs.shell;asyncModuleRecoveryRuntime.install();navigationRuntime.install();outputs.shell.appEnvironmentBanner.install();const appModules=importAppModules();const placementTopology=await loadAppPlacementTopology(logger,asyncModuleRecoveryRuntime,appModules.placementTopology);placementRuntime.replacePlacementTopology(placementTopology,{source:APP_PLACEMENT_TOPOLOGY_MODULE_SPECIFIER});const placements=await loadAppPlacementDefinitions(logger,asyncModuleRecoveryRuntime,appModules.placements);placementRuntime.replacePlacements(placements,{source:APP_PLACEMENT_MODULE_SPECIFIER});const appConfig=getClientAppConfig();const surfaceConfig=buildSurfaceConfigContext(surfaceRuntime,{tenancyMode:appConfig.tenancyMode});placementRuntime.setContext({surfaceConfig,surfaceAccessPolicies:normalizeObject(appConfig.surfaceAccessPolicies)},{source:`shell-web.surface-config`});const errorConfig=await loadAppErrorConfig(logger,errorRuntime,asyncModuleRecoveryRuntime,appModules.errorConfig);errorRuntime.configure(errorConfig);requestRecoveryRuntime.install();clientUpdateRuntime.watch(realtime);await bootstrapRuntime.initialize();useShellErrorPresentationStore(pinia).attachRuntimeStore(errorPresentationStore);vueApp.provide(SHELL_WEB_PLACEMENT_RUNTIME_KEY,placementRuntime);vueApp.provide(SHELL_WEB_REFRESH_RUNTIME_KEY,refreshRuntime);vueApp.provide(SHELL_WEB_ERROR_RUNTIME_KEY,errorRuntime);vueApp.provide(SHELL_ASYNC_MODULE_RECOVERY_RUNTIME_KEY,asyncModuleRecoveryRuntime);vueApp.provide(SHELL_REQUEST_RECOVERY_RUNTIME_KEY,requestRecoveryRuntime);vueApp.provide(SHELL_NAVIGATION_RUNTIME_KEY,navigationRuntime);installVueErrorBridge(vueApp,errorRuntime,logger);installRouterErrorBridge(router,errorRuntime,logger)},shutdown(_dependencies,{outputs}){outputs.shell.appEnvironmentBanner.dispose();outputs.shell.navigation.dispose();outputs.shell.clientUpdate.dispose();outputs.shell.requestRecovery.dispose();outputs.shell.asyncModuleRecovery.dispose()}});var SURFACE_SWITCH_ICON_BY_ID=Object.freeze({home:`$home`,app:`$dashboard`,admin:`$adminPanelSettings`,console:`$terminal`});function resolveExplicitIconValue(explicitIcon=``){return normalizeText$1(explicitIcon)}function normalizePathname(value=``){const normalizedValue=normalizeText$1(value);if(!normalizedValue)return``;if(isExternalLinkTarget(normalizedValue)){if(!(normalizedValue.startsWith(`http://`)||normalizedValue.startsWith(`https://`)))return``;let parsedPathname=``;try{parsedPathname=String(new URL(normalizedValue).pathname||``)}catch{return``}const normalizedPathname=normalizeText$1(parsedPathname);if(!normalizedPathname)return``;return normalizePathname$1(normalizedPathname).toLowerCase()}const{pathname}=splitPathQueryHash(normalizedValue);const normalizedPathname=normalizeText$1(pathname);if(!normalizedPathname)return``;return normalizePathname$1(normalizedPathname).toLowerCase()}function resolveSurfaceSwitchIdFromLabel(label=``){const normalizedLabel=normalizeText$1(label).toLowerCase();if(!normalizedLabel.startsWith(`go to `))return``;return normalizeText$1(normalizedLabel.slice(6))}function resolveSurfaceSwitchIcon(surfaceId=``,explicitIcon=``){const resolvedExplicitIcon=resolveExplicitIconValue(explicitIcon);if(resolvedExplicitIcon)return resolvedExplicitIcon;const normalizedSurfaceId=normalizeText$1(surfaceId).toLowerCase();return SURFACE_SWITCH_ICON_BY_ID[normalizedSurfaceId]||`$arrowCircleRight`}function resolveMenuLinkIcon({icon=``,label=``,to=``}={}){const resolvedExplicitIcon=resolveExplicitIconValue(icon);if(resolvedExplicitIcon)return resolvedExplicitIcon;const normalizedLabel=normalizeText$1(label).toLowerCase();const normalizedPathname=normalizePathname(to);if(!normalizedLabel&&!normalizedPathname)return``;const surfaceSwitchSurfaceId=resolveSurfaceSwitchIdFromLabel(normalizedLabel);if(surfaceSwitchSurfaceId)return resolveSurfaceSwitchIcon(surfaceSwitchSurfaceId);if(normalizedLabel.includes(`sign in`)||normalizedPathname.includes(`/auth/login`))return`$login`;if(normalizedLabel.includes(`sign out`)||normalizedPathname.includes(`/auth/signout`))return`$logout`;if(normalizedLabel.includes(`account`)||normalizedPathname.includes(`/account`)){if(normalizedLabel.includes(`settings`)||normalizedPathname.includes(`/settings`)||normalizedPathname===`/account`)return`$manageAccounts`;return`$accountCircle`}if(normalizedLabel.includes(`members`)||normalizedLabel.includes(`team`)||normalizedPathname.includes(`/members`))return`$group`;if(normalizedLabel.includes(`assistant`)||normalizedPathname.includes(`/assistant`))return`$smartToy`;if(normalizedLabel.includes(`console`)||normalizedPathname.startsWith(`/console`))return`$terminal`;if(normalizedLabel.includes(`admin`)||normalizedPathname.includes(`/admin`))return`$adminPanelSettings`;if(normalizedLabel.includes(`settings`)||normalizedPathname.includes(`/settings`))return`$settings`;if(normalizedLabel.includes(`home`)||normalizedPathname===`/`)return`$home`;if(normalizedLabel.includes(`workspace`)||normalizedLabel.includes(`dashboard`)||normalizedPathname.includes(`/w/`))return`$dashboard`;if(normalizedPathname){if(normalizedPathname.split(`/`).filter(Boolean).length===1)return`$folder`}if(normalizedLabel.includes(`list`))return`$assignment`;return`$viewList`}function resolveMenuLinkSurfaceId(surface=``,fallbackSurfaceId=``){const explicitSurface=normalizeText$1(surface).toLowerCase();if(explicitSurface&&explicitSurface!==`*`)return explicitSurface;return normalizeText$1(fallbackSurfaceId).toLowerCase()}function interpolateBracketParams(pathTemplate=``,params={}){const source=String(pathTemplate||``).trim();if(!source)return``;return source.replace(/\[([^\]]+)\]/g,(_match,rawKey)=>{const key=String(rawKey||``).trim();if(!key)return``;const value=params[key];return value==null?`[${key}]`:encodeURIComponent(String(value))})}function isRelativeMenuLinkTarget(target=``){const normalizedTarget=normalizeText$1(target);return normalizedTarget.startsWith(`./`)||normalizedTarget.startsWith(`../`)}function surfaceRequiresWorkspaceFromPlacementContext(contextValue=null,surfaceId=``){return Boolean(resolveSurfaceDefinitionFromPlacementContext(contextValue,surfaceId)?.requiresWorkspace)}function resolveMenuLinkTarget({to=``,surface=``,currentSurfaceId=``,currentPathname=``,placementContext=null,scopedSuffix=`/`,unscopedSuffix=`/`,routeParams={}}={}){const explicitTarget=normalizeText$1(to);if(explicitTarget&&!isRelativeMenuLinkTarget(explicitTarget))return explicitTarget;const params={...resolveSurfaceRouteParamsFromPlacementPathname(placementContext,currentSurfaceId,currentPathname),...routeParams};const targetSurfaceId=resolveMenuLinkSurfaceId(surface,currentSurfaceId);const scopedRouteRequired=surfaceRequiresWorkspaceFromPlacementContext(placementContext,targetSurfaceId);const interpolatedSuffix=interpolateBracketParams(normalizeText$1(scopedRouteRequired?scopedSuffix:unscopedSuffix)||`/`,params);if(!targetSurfaceId||!interpolatedSuffix||interpolatedSuffix.includes(`[`))return``;return normalizeText$1(resolveShellLinkPath({context:placementContext,surface:targetSurfaceId,relativePath:interpolatedSuffix,params,strictParams:true}))}function resolveMenuLinkHref(placementContext=null,target=``){const path=String(target||``).trim();if(!path)return{href:``,sameOrigin:true};const navigationTarget=resolveSurfaceNavigationTargetFromPlacementContext(placementContext,{path});return{href:navigationTarget.href,sameOrigin:navigationTarget.sameOrigin}}function activateShellNavigationLinkOnSpace(event){if(event.key!==` `)return;event.preventDefault();event.stopPropagation();event.currentTarget.click()}var _hoisted_1$4={class:`shell-menu-link-item__indicator`};var _hoisted_2$1={class:`shell-menu-link-item__rail-label`};var _sfc_main$9=Object.assign({inheritAttrs:false},{__name:`ShellNavigationItem`,props:{label:{type:String,default:``},href:{type:String,default:``},sameOrigin:{type:Boolean,default:true},icon:{type:String,default:``},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}},setup(__props){const props=__props;const presentation=inject$1(SHELL_NAVIGATION_PRESENTATION_KEY,NO_SHELL_NAVIGATION_PRESENTATION);const iconOptions=inject$1(VUETIFY_ICONS_KEY,NO_VUETIFY_ICONS);const link=useLink$1({to:computed(()=>props.sameOrigin&&props.href||`/`)});const active=computed(()=>props.sameOrigin&&Boolean(props.exact?link.isExactActive.value:link.isActive.value));const displayIcon=computed(()=>active.value?filledIconAlias(props.icon,iconOptions.aliases):props.icon);const rail=computed(()=>presentation.value===`rail`);const list=inject$1(VUETIFY_LIST_KEY,null);const listItem=computed(()=>Boolean(list&&props.href));const Unwrapped=(_props,{slots})=>slots.default();Unwrapped.inheritAttrs=false;return(_ctx,_cache)=>{return openBlock(),createBlock(resolveDynamicComponent(listItem.value?`div`:Unwrapped),{role:listItem.value?`listitem`:void 0,class:normalizeClass(listItem.value?[`shell-navigation-item`,{"shell-navigation-item--rail":rail.value}]:void 0)},{default:withCtx(()=>[rail.value?(openBlock(),createBlock(VListItem,mergeProps({key:0,class:`shell-menu-link-item shell-menu-link-item--rail`,to:props.sameOrigin?props.href:void 0,href:props.sameOrigin?void 0:props.href,active:active.value,disabled:props.disabled,ripple:false},_ctx.$attrs,{onKeydown:withKeys(unref(activateShellNavigationLinkOnSpace),[`space`])}),{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$4,[displayIcon.value?(openBlock(),createBlock(VIcon,{key:0,icon:displayIcon.value},null,8,[`icon`])):createCommentVNode(``,true)]),createBaseVNode(`span`,_hoisted_2$1,toDisplayString(props.label),1)]),_:1},16,[`to`,`href`,`active`,`disabled`,`onKeydown`])):(openBlock(),createBlock(VListItem,mergeProps({key:1,class:`shell-menu-link-item`,title:props.label,to:props.sameOrigin?props.href:void 0,href:props.sameOrigin?void 0:props.href,"prepend-icon":displayIcon.value||void 0,active:active.value,disabled:props.disabled},_ctx.$attrs,{onKeydown:withKeys(unref(activateShellNavigationLinkOnSpace),[`space`])}),null,16,[`title`,`to`,`href`,`prepend-icon`,`active`,`disabled`,`onKeydown`]))]),_:1},8,[`role`,`class`])}}});var ShellNavigationItem_default=_plugin_vue_export_helper_default(_sfc_main$9,[[`__scopeId`,`data-v-e0567b0d`]]);var _sfc_main$8={__name:`ShellMenuLinkItem`,props:{label:{type:[String,Object],default:``},to:{type:String,default:``},icon:{type:String,default:``},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}},setup(__props){const props=__props;const{context:placementContext}=useWebPlacementContext();const{text}=useJskitText();const resolvedLabel=computed(()=>text(props.label));const resolvedTarget=computed(()=>resolveMenuLinkHref(placementContext.value,props.to));const resolvedIcon=computed(()=>resolveMenuLinkIcon({icon:props.icon,label:text(props.label,{locale:`en`}),to:resolvedTarget.value.href||props.to}));return(_ctx,_cache)=>{return resolvedTarget.value.href?(openBlock(),createBlock(ShellNavigationItem_default,{key:0,label:resolvedLabel.value,href:resolvedTarget.value.href,"same-origin":resolvedTarget.value.sameOrigin,icon:resolvedIcon.value,disabled:props.disabled,exact:props.exact},null,8,[`label`,`href`,`same-origin`,`icon`,`disabled`,`exact`])):createCommentVNode(``,true)}}};var _sfc_main$7={__name:`MenuLinkItem`,props:{label:{type:String,default:``},to:{type:String,default:``},icon:{type:String,default:``},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}},setup(__props){const props=__props;return(_ctx,_cache)=>{return openBlock(),createBlock(unref(_sfc_main$8),normalizeProps(guardReactiveProps(props)),null,16)}}};var MenuLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$7,[[`__scopeId`,`data-v-df570124`]]);var shellNavigationLinkProps=Object.freeze({label:{type:[String,Object],default:``},to:{type:String,default:``},icon:{type:String,default:``},surface:{type:String,default:``},scopedSuffix:{type:String,default:`/`},unscopedSuffix:{type:String,default:`/`},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}});function useShellNavigationLink(props){const route=useRoute$1();const{context:placementContext}=useWebPlacementContext();const{text}=useJskitText();const resolvedLabel=computed(()=>text(props.label));const resolvedTo=computed(()=>{const currentSurfaceId=resolveSurfaceIdFromPlacementPathname(placementContext.value,route.path);return resolveMenuLinkTarget({to:props.to,surface:props.surface,currentSurfaceId,currentPathname:route.path,placementContext:placementContext.value,scopedSuffix:props.scopedSuffix,unscopedSuffix:props.unscopedSuffix,routeParams:route.params})});const resolvedTarget=computed(()=>resolveMenuLinkHref(placementContext.value,resolvedTo.value));return{resolvedLabel,resolvedTarget,resolvedIcon:computed(()=>resolveMenuLinkIcon({icon:props.icon,label:text(props.label,{locale:`en`}),to:resolvedTarget.value.href||resolvedTo.value}))}}var _sfc_main$6={__name:`ShellSurfaceAwareMenuLinkItem`,props:shellNavigationLinkProps,setup(__props){const props=__props;const{resolvedLabel,resolvedTarget,resolvedIcon}=useShellNavigationLink(props);return(_ctx,_cache)=>{return unref(resolvedTarget).href?(openBlock(),createBlock(ShellNavigationItem_default,{key:0,label:unref(resolvedLabel),href:unref(resolvedTarget).href,"same-origin":unref(resolvedTarget).sameOrigin,icon:unref(resolvedIcon),disabled:props.disabled,exact:props.exact},null,8,[`label`,`href`,`same-origin`,`icon`,`disabled`,`exact`])):createCommentVNode(``,true)}}};var _hoisted_1$3=[`data-vibe64-guide`];var _sfc_main$5={__name:`SurfaceAwareMenuLinkItem`,props:{label:{type:String,default:``},to:{type:String,default:``},icon:{type:String,default:``},surface:{type:String,default:``},scopedSuffix:{type:String,default:`/`},unscopedSuffix:{type:String,default:`/`},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false},guideId:{type:String,default:``}},setup(__props){const props=__props;const linkProps=computed(()=>{const{guideId,...value}=props;return value});return(_ctx,_cache)=>{return __props.guideId?(openBlock(),createElementBlock(`div`,{key:0,class:`surface-aware-menu-link-guide`,"data-vibe64-guide":__props.guideId},[createVNode(unref(_sfc_main$6),normalizeProps(guardReactiveProps(linkProps.value)),null,16)],8,_hoisted_1$3)):(openBlock(),createBlock(unref(_sfc_main$6),normalizeProps(mergeProps({key:1},linkProps.value)),null,16))}}};var SurfaceAwareMenuLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$5,[[`__scopeId`,`data-v-04066dfc`]]);var _hoisted_1$2={class:`section-tab-link-item__label`};var _sfc_main$4={__name:`ShellSectionTabLinkItem`,props:shellNavigationLinkProps,setup(__props){const props=__props;const{t}=useJskitText();const{resolvedLabel,resolvedTarget,resolvedIcon}=useShellNavigationLink(props);const link=useLink$1({to:computed(()=>resolvedTarget.value.sameOrigin&&resolvedTarget.value.href||`/`)});const active=computed(()=>resolvedTarget.value.sameOrigin&&Boolean(props.exact?link.isExactActive.value:link.isActive.value));const icon=computed(()=>props.icon?resolvedIcon.value:``);return(_ctx,_cache)=>{return unref(resolvedTarget).href?(openBlock(),createBlock(VBtn,{key:0,class:normalizeClass([`section-tab-link-item text-none`,{"section-tab-link-item--active":active.value,"section-tab-link-item--icon":Boolean(icon.value)}]),to:unref(resolvedTarget).sameOrigin?unref(resolvedTarget).href:void 0,href:unref(resolvedTarget).sameOrigin?void 0:unref(resolvedTarget).href,active:active.value,"aria-current":active.value?`page`:void 0,disabled:props.disabled,exact:props.exact,variant:`text`,rounded:`0`,"min-width":`0`},{default:withCtx(()=>[icon.value?(openBlock(),createBlock(VIcon,{key:0,icon:icon.value,class:`section-tab-link-item__icon`},null,8,[`icon`])):createCommentVNode(``,true),createBaseVNode(`span`,_hoisted_1$2,toDisplayString(unref(resolvedLabel)||unref(t)(`jskit.shell.layout.tab`)),1),_cache[0]||(_cache[0]=createBaseVNode(`span`,{class:`section-tab-link-item__indicator`,"aria-hidden":`true`},null,-1))]),_:1},8,[`class`,`to`,`href`,`active`,`aria-current`,`disabled`,`exact`])):createCommentVNode(``,true)}}};var ShellSectionTabLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$4,[[`__scopeId`,`data-v-c4cd4eaa`]]);var _hoisted_1$1={class:`tab-link-item__label`};var _sfc_main$3={__name:`ShellTabLinkItem`,props:shellNavigationLinkProps,setup(__props){const props=__props;const presentation=inject$1(SHELL_NAVIGATION_PRESENTATION_KEY,NO_SHELL_NAVIGATION_PRESENTATION);const inNavigationBar=computed(()=>presentation.value===`bar`);const{t}=useJskitText();const{resolvedLabel,resolvedTarget,resolvedIcon}=useShellNavigationLink(props);const iconOptions=inject$1(VUETIFY_ICONS_KEY,NO_VUETIFY_ICONS);const link=useLink$1({to:computed(()=>resolvedTarget.value.sameOrigin&&resolvedTarget.value.href||`/`)});const active=computed(()=>resolvedTarget.value.sameOrigin&&Boolean(props.exact?link.isExactActive.value:link.isActive.value));const displayIcon=computed(()=>active.value?filledIconAlias(resolvedIcon.value,iconOptions.aliases):resolvedIcon.value);return(_ctx,_cache)=>{return!inNavigationBar.value?(openBlock(),createBlock(ShellSectionTabLinkItem_default,normalizeProps(mergeProps({key:0},props)),null,16)):unref(resolvedTarget).href?(openBlock(),createBlock(VBtn,{key:1,class:normalizeClass([`tab-link-item`,{"tab-link-item--active":active.value}]),to:unref(resolvedTarget).sameOrigin?unref(resolvedTarget).href:void 0,href:unref(resolvedTarget).sameOrigin?void 0:unref(resolvedTarget).href,active:active.value,disabled:props.disabled,exact:props.exact,ripple:false,variant:`text`,"min-width":`0`,stacked:``},{default:withCtx(()=>[displayIcon.value?(openBlock(),createBlock(VIcon,{key:0,icon:displayIcon.value},null,8,[`icon`])):createCommentVNode(``,true),createBaseVNode(`span`,_hoisted_1$1,toDisplayString(unref(resolvedLabel)||unref(t)(`jskit.shell.layout.tab`)),1)]),_:1},8,[`class`,`to`,`href`,`active`,`disabled`,`exact`])):createCommentVNode(``,true)}}};var ShellTabLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$3,[[`__scopeId`,`data-v-62597e5b`]]);var _sfc_main$2={__name:`TabLinkItem`,props:{label:{type:String,default:``},to:{type:String,default:``},icon:{type:String,default:``},surface:{type:String,default:``},scopedSuffix:{type:String,default:`/`},unscopedSuffix:{type:String,default:`/`},disabled:{type:Boolean,default:false},exact:{type:Boolean,default:false}},setup(__props){const props=__props;return(_ctx,_cache)=>{return openBlock(),createBlock(unref(ShellTabLinkItem_default),normalizeProps(guardReactiveProps(props)),null,16)}}};var TabLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-1e93431e`]]);var _sfc_main$1={__name:`TopActionLinkItem`,props:{disabled:{default:false,type:Boolean},exact:{default:false,type:Boolean},icon:{default:``,type:String},label:{default:``,type:String},returnToCurrent:{default:false,type:Boolean},to:{default:``,type:String}},setup(__props){const props=__props;const route=useRoute$1();const resolvedIcon=computed(()=>`$link`);const active=computed(()=>{const target=String(props.to||``).trim();const path=String(route.path||``).trim();if(!target||!path)return false;return props.exact?path===target:path===target||path.startsWith(`${target}/`)});const resolvedTo=computed(()=>{const target=String(props.to||``).trim();if(!target||!props.returnToCurrent||active.value)return target;return{path:target,query:{returnTo:route.fullPath||route.path||`/app`}}});return(_ctx,_cache)=>{return props.to?(openBlock(),createBlock(VBtn,{key:0,class:normalizeClass([`top-action-link-item text-none`,{"top-action-link-item--active":active.value}]),disabled:props.disabled,"prepend-icon":resolvedIcon.value||void 0,to:resolvedTo.value,variant:`tonal`,color:`primary`},{default:withCtx(()=>[createTextVNode(toDisplayString(props.label||`Open`),1)]),_:1},8,[`class`,`disabled`,`prepend-icon`,`to`])):createCommentVNode(``,true)}}};var TopActionLinkItem_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-52a9b85c`]]);var VIBE64_ACTIVE_SESSION_NAV_KEY=Symbol(`vibe64.activeSessionNav`);var NO_ACTIVE_SESSION_NAV=Object.freeze({value:null});var _hoisted_1={key:0,class:`vibe64-active-session-nav-item vibe64-active-session-nav-item--heading`,"aria-label":`Active session navigation`};var _hoisted_2=[`title`];var _hoisted_3={class:`vibe64-active-session-nav-item__label`};var _sfc_main={__name:`Vibe64ActiveSessionNavItem`,props:{disabled:{default:false,type:Boolean},icon:{default:``,type:String},guideId:{default:``,type:String},label:{default:``,type:String},role:{default:``,type:String},title:{default:``,type:String},to:{default:``,type:String},toolId:{default:``,type:String}},setup(__props){const props=__props;const injectedSessionNav=inject$1(VIBE64_ACTIVE_SESSION_NAV_KEY,NO_ACTIVE_SESSION_NAV);const sessionNav=computed(()=>injectedSessionNav.value||{});const tools=computed(()=>Array.isArray(sessionNav.value.tools)?sessionNav.value.tools:[]);const tool=computed(()=>{const toolId=String(props.toolId||``).trim();return tools.value.find(candidate=>String(candidate?.id||``)===toolId)||{}});const navVisible=computed(()=>Boolean(sessionNav.value.visible!==false&&sessionNav.value.label));const headerVisible=computed(()=>Boolean(navVisible.value&&props.role===`heading`));const itemVisible=computed(()=>Boolean(navVisible.value&&props.role!==`heading`&&props.toolId));const itemLabel=computed(()=>String(tool.value.label||props.label||``));const itemIcon=computed(()=>String(tool.value.icon||props.icon||``));const itemTitle=computed(()=>String(tool.value.title||props.title||``));const itemTo=computed(()=>String(tool.value.to||props.to||``).trim());const itemDisabled=computed(()=>Boolean(props.disabled||tool.value.disabled));const itemDisabledReason=computed(()=>String(tool.value.disabledReason||itemTitle.value||``));const statusClass=computed(()=>`vibe64-active-session-nav-item__status--${String(sessionNav.value.status||`unknown`).trim()||`unknown`}`);function selectTool(){if(itemDisabled.value||!injectedSessionNav.value)return;if(itemTo.value)return;injectedSessionNav.value.selectTool(String(props.toolId||``))}return(_ctx,_cache)=>{return headerVisible.value?(openBlock(),createElementBlock(`div`,_hoisted_1,[createVNode(VDivider,{class:`vibe64-active-session-nav-item__divider`}),_cache[0]||(_cache[0]=createBaseVNode(`span`,{class:`vibe64-dashboard-nav-group-label`},`Session`,-1)),createBaseVNode(`div`,{class:`vibe64-active-session-nav-item__heading`,title:sessionNav.value.label},[createBaseVNode(`span`,{class:normalizeClass([`vibe64-active-session-nav-item__status`,statusClass.value])},null,2),createBaseVNode(`span`,_hoisted_3,toDisplayString(sessionNav.value.label),1)],8,_hoisted_2)])):itemVisible.value?(openBlock(),createBlock(VListItem,{key:1,class:`vibe64-active-session-nav-item`,active:tool.value.active,disabled:itemDisabled.value,"prepend-icon":itemIcon.value,title:itemLabel.value,"data-vibe64-guide":props.guideId||void 0,subtitle:itemDisabled.value?itemDisabledReason.value:``,to:itemTo.value||void 0,onClick:selectTool},null,8,[`active`,`disabled`,`prepend-icon`,`title`,`data-vibe64-guide`,`subtitle`,`to`])):createCommentVNode(``,true)}}};var Vibe64ActiveSessionNavItem_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-81ecbdbd`]]);function isVibe64LiveQuery(query={}){return(Array.isArray(query.queryKey)?query.queryKey:[])[0]===`vibe64`}function invalidateVibe64LiveQueries(queryClient){return queryClient.invalidateQueries({predicate:isVibe64LiveQuery,refetchType:`active`})}function attachVibe64RealtimeQueryRecovery({queryClient,realtime}){const socket=realtime.socket;const recoverQueries=()=>invalidateVibe64LiveQueries(queryClient);socket.on(`connect`,recoverQueries);return()=>socket.off(`connect`,recoverQueries)}var detachQueryRecoveryByRealtime=new WeakMap;var MainClientProvider=defineProvider({id:`local.main.client`,requires:{components:`client.components`,queryClient:`client.query`,realtime:`client.realtime`},setup({components,queryClient,realtime}){components.register(`local.main.ui.menu-link-item`,MenuLinkItem_default);components.register(`local.main.ui.surface-aware-menu-link-item`,SurfaceAwareMenuLinkItem_default);components.register(`local.main.ui.tab-link-item`,TabLinkItem_default);components.register(`local.main.ui.top-action-link-item`,TopActionLinkItem_default);components.register(`local.main.vibe64.active-session-nav-item`,Vibe64ActiveSessionNavItem_default);detachQueryRecoveryByRealtime.set(realtime,attachVibe64RealtimeQueryRecovery({queryClient,realtime}))},shutdown({realtime}){detachQueryRecoveryByRealtime.get(realtime)();detachQueryRecoveryByRealtime.delete(realtime)}});var client_exports=__exportAll({MainClientProvider:()=>MainClientProvider});var jskit$6={"connectors":{"googleCalendar":{"attendeesRequiresUp200Email":`attendees requires up to 200 email entries with optional displayName/optional.`,"cancellationNoEventBody":`Cancellation has no event body.`,"chooseAllDayDateTimed":`Choose an all-day date or a timed dateTime.`,"chooseSendUpdates":`Choose sendUpdates explicitly: all, externalOnly or none.`,"datetimeRequiresExplicitTimezoneOffset":`dateTime requires an explicit timezone offset.`,"description":`Read calendars and create, edit or cancel events.`,"eventMustObject":`event must be an object.`,"invalidAllDayDate":`Invalid all-day date.`,"invalidEventEtag":`Invalid event ETag.`,"invalidTransparency":`Invalid transparency.`,"invalidVisibility":`Invalid visibility.`,"recurrenceMustArrayRfc5545Recurrence":`recurrence must be an array of RFC5545 recurrence lines.`,"scopes":{"calendar":{"label":`Manage calendars and events`},"calendarAcls":{"label":`Manage calendar sharing permissions`},"calendarAclsReadonly":{"label":`Read calendar sharing permissions`},"calendarAddonsCurrentEventRead":{"label":`Read the event open in a Calendar add-on`},"calendarAddonsCurrentEventWrite":{"label":`Edit the event open in a Calendar add-on`},"calendarAddonsExecute":{"label":`Run a Calendar add-on`},"calendarAppCreated":{"label":`Create and manage app-created calendars`},"calendarCalendarlist":{"label":`Manage calendar subscriptions`},"calendarCalendarlistReadonly":{"label":`List calendars`},"calendarCalendars":{"label":`Manage calendar properties`},"calendarCalendarsReadonly":{"label":`Read calendar properties`},"calendarEvents":{"label":`Manage events`},"calendarEventsFreebusy":{"label":`Read availability in accessible calendars`},"calendarEventsOwned":{"label":`Manage events in calendars you own`},"calendarEventsOwnedReadonly":{"label":`Read events in calendars you own`},"calendarEventsPublicReadonly":{"label":`Read public calendar events`},"calendarEventsReadonly":{"label":`Read events`},"calendarFreebusy":{"label":`Read your availability`},"calendarReadonly":{"label":`Read all calendar data`},"calendarSettingsReadonly":{"label":`Read calendar settings`}},"startEndRequired":`start and end are required.`,"supplyStartEndSettingRecurrence":`Supply start and end when setting recurrence.`,"supplyStartEndTogetherChanging":`Supply start and end together when changing event times.`,"textTooLong":`{field} must be text of at most 16384 characters.`,"timedRecurrenceRequiresStartEnd":`Timed recurrence requires start/end timeZone.`,"useDateDatetimeOptionalTimezone":`Use date or dateTime and optional timeZone.`,"useIanaTimezone":`Use an IANA timeZone.`,"useMatchingDateTypesEnd":`Use matching date types with end after start; all-day end is exclusive.`,"useSupportedEventFields":`Use supported event fields only.`}}};var en_default$6={jskit:jskit$6};var jskit$5=JSON.parse(`{"connectors":{"ai":{"access":{"freeNoSetup":"Free · no account or key","freeWithConnection":"Free · connection required","paid":"Paid · connection required","unknown":"Pricing unknown · check provider"},"accessConnectionDenied":"Access to this AI connection was denied.","apiKeyReferenceHint":"Use an environment reference for an administrator key. For individual accounts, use a private reference your app resolves for the authenticated user. Never put a key in this file.","authenticationHint":"Your app calls the provider directly. A shared account belongs to the app administrator; individual accounts belong to each signed-in app user.","authenticationLabels":{"apiKey":"Use a provider API key","none":"Free access · no account or key"},"authorizedAccountApiKeyUnavailable":"The authorized AI account's API key is unavailable.","connectionNotConfigured":"This AI connection is not configured.","description":"Choose an app AI provider, model and whose account pays. No model is preselected.","fields":{"model":{"hint":"Choose a provider and model. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback.","label":"AI model","selectedHint":{"freeNoSetup":"{model}: Free · no account or key. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback.","freeWithConnection":"{model}: Free · connection required. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback.","paid":"{model}: Paid · connection required. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback.","unknown":"{model}: Pricing unknown · check provider. Search by provider or model. Catalogue dated {date}; availability can change. No automatic paid fallback."}}},"individualAccountsRequireUserOwned":"Individual AI accounts require a user-owned reference, not a shared environment variable."},"airtable":{"description":"Discover bases, read and edit records, and manage tables and fields."},"algolia":{"description":"Search and maintain index records, and check indexing completion.","fields":{"applicationId":{"hint":"Copy the ID from your Algolia application's API Keys page. This ID can be public.","label":"Application ID"},"publicApiKeyRef":{"environmentCredential":{"label":"Public frontend API key"},"hint":"Optional search-only key for your frontend. Enter its reference; your app decides whether to expose its value.","label":"Public API key reference (optional)"}}},"amazonRedshift":{"description":"Inspect tables and run queries in a serverless workgroup or provisioned cluster.","didNotReturnStatementIdentifier":"Redshift did not return a statement identifier.","fields":{"clusterIdentifier":{"label":"Cluster identifier"},"database":{"label":"Database"},"databaseUser":{"hint":"Leave blank to use the database identity derived from IAM.","label":"Database user (optional)"},"deploymentType":{"items":{"provisioned":{"title":"Provisioned cluster"},"serverless":{"title":"Serverless"}},"label":"Deployment type"},"region":{"hint":"Use the warehouse's region. Availability depends on your AWS account and deployment type.","label":"AWS Region"},"workgroup":{"hint":"The serverless workgroup name, without an ARN or URL.","label":"Workgroup name"}},"returnedUnexpectedStatement":"Redshift returned an unexpected statement.","statementBelongsDifferentTarget":"This statement belongs to a different Redshift target.","statementNoFinishedResultSet":"This statement has no finished result set.","useSqlParameterNameOnce":"Use each SQL parameter name only once."},"amplitude":{"description":"Query and manage Amplitude content through an authorized assistant MCP connection.","fields":{"region":{"hint":"Choose the region containing your Amplitude account and register the client there.","items":{"eu":{"title":"European Union"},"us":{"title":"United States"}},"label":"Region"}},"scopes":{"mcpRead":{"label":"Read Amplitude content (required for verification)"},"mcpWrite":{"label":"Create and edit Amplitude content"},"offlineAccess":{"label":"Refresh access without repeating sign-in"}}},"apify":{"description":"Run Actors with explicit limits and retrieve their results.","useFrameworkNativeClientStream":"Use the framework's native Apify client to stream records larger than 8 MiB."},"apolloIo":{"description":"Find prospects, enrich selected records and manage your sales contacts, accounts and deals.","enterRecordRequiredIdentifyingFields":"Enter the record's required identifying fields or changes."},"asana":{"description":"Discover projects and create, assign and track tasks in your Asana workspace.","includeDueSettingClearingStart":"Include due_on when setting or clearing start_on.","startDateMustPrecedeProject":"The start date must precede the project due date, or be no later than the task due date."},"ashby":{"couldNotCompleteOperation":"Ashby could not complete the operation.","description":"Read hiring data, maintain candidate profiles and advance sourced applications.","supplyLeastCandidateProfileChange":"Supply at least one candidate profile change."},"atlassian":{"description":"Use Jira, Confluence and other Atlassian tools through the assistant owner's Rovo MCP connection.","scopes":{"deleteJiraAgentInterface":{"label":"Delete Jira content"},"email":{"label":"Read your email address"},"manageJiraAgentInterface":{"label":"Manage Jira"},"offlineAccess":{"label":"Refresh access without repeating sign-in"},"readAccount":{"label":"Read your account"},"readAllTwg":{"label":"Read Teamwork Graph content"},"readConfluenceAgentInterface":{"label":"Read Confluence content"},"readJiraAgentInterface":{"label":"Read Jira content"},"readMe":{"label":"Read your profile"},"readProduct":{"label":"Read {product} content"},"searchCodeAgentInterface":{"label":"Search code"},"searchConfluenceAgentInterface":{"label":"Search Confluence"},"searchJiraAgentInterface":{"label":"Search Jira"},"searchRovoAgentInterface":{"label":"Search with Rovo"},"writeAllTwg":{"label":"Write Teamwork Graph content"},"writeConfluenceAgentInterface":{"label":"Create and edit Confluence content"},"writeJiraAgentInterface":{"label":"Create and edit Jira content"},"writeProduct":{"label":"Create and edit {product} content"}}},"attention":{"description":"Read conversations and coaching results; manage call metadata, snippets, users and teams.","endTimeMustFollowStart":"End time must follow start time."},"aws":{"checkRegionResourceOperationSettings":"Check the AWS region, resource and operation settings.","credentials":{"apiKeyReferenceHint":"Use a reference such as env:AWS_SECRET_ACCESS_KEY. Credentials belong to the configured AWS account; host defaults are never used.","apiKeyReferenceLabel":"Secret access key reference"},"deniedOperationCheckIamResource":"AWS denied this operation. Check IAM, resource and database permissions.","fields":{"accessKeyIdRef":{"environmentCredential":{"label":"AWS access key ID"},"hint":"Store the access key ID in Env and enter its reference.","label":"Access key ID reference"},"region":{"label":"AWS Region"},"sessionTokenRef":{"environmentCredential":{"label":"AWS session token"},"hint":"Required with temporary STS credentials. The host must renew all three credential bindings before they expire.","label":"Session token reference (optional)"}},"provideAccessKeyIdSecret":"Provide the AWS access key ID, secret access key and any required session token bindings.","regionDoesNotMatchOperation":"The AWS region does not match the operation destination.","regions":{"afSouth1":"Cape Town ({region})","apEast1":"Hong Kong ({region})","apEast2":"Taipei ({region})","apNortheast1":"Tokyo ({region})","apNortheast2":"Seoul ({region})","apNortheast3":"Osaka ({region})","apSouth1":"Mumbai ({region})","apSouth2":"Hyderabad ({region})","apSoutheast1":"Singapore ({region})","apSoutheast2":"Sydney ({region})","apSoutheast3":"Jakarta ({region})","apSoutheast4":"Melbourne ({region})","apSoutheast5":"Malaysia ({region})","apSoutheast6":"New Zealand ({region})","apSoutheast7":"Thailand ({region})","caCentral1":"Canada Central ({region})","caWest1":"Calgary ({region})","euCentral1":"Frankfurt ({region})","euCentral2":"Zurich ({region})","euNorth1":"Stockholm ({region})","euSouth1":"Milan ({region})","euSouth2":"Spain ({region})","euWest1":"Ireland ({region})","euWest2":"London ({region})","euWest3":"Paris ({region})","ilCentral1":"Tel Aviv ({region})","meCentral1":"UAE ({region})","meSouth1":"Bahrain ({region})","mxCentral1":"Mexico Central ({region})","saEast1":"São Paulo ({region})","usEast1":"N. Virginia ({region})","usEast2":"Ohio ({region})","usWest1":"N. California ({region})","usWest2":"Oregon ({region})"},"renewCredentialBindingsConnectAgain":"Renew the AWS credential bindings and connect again.","requestFailedReturnedUnreadableResponse":"The AWS request failed or returned an unreadable response.","requestLimitReached":"The AWS request limit was reached.","resourceNotFound":"The AWS resource was not found.","sdkSelectedUnexpectedDestination":"The AWS SDK selected an unexpected destination."},"awsAthena":{"description":"Browse data catalogs and schemas; start, inspect, page through and cancel queries in a configured workgroup.","fields":{"resultLocation":{"hint":"Leave blank when the workgroup supplies its own result storage. Enforced workgroup settings take precedence.","label":"Query result location (optional)"},"workgroup":{"hint":"Defaults to primary. Query access is restricted to this workgroup.","label":"Workgroup (optional)"}},"queryBelongsDifferentWorkgroup":"This query belongs to a different workgroup.","returnedDifferentWorkgroup":"Athena returned a different workgroup.","returnedUnexpectedQuery":"Athena returned an unexpected query."},"awsS3":{"description":"List bucket objects and create short-lived download or upload URLs.","fields":{"bucket":{"label":"Bucket name"}},"permissionsHint":"These choices limit the application's operations. AWS IAM and bucket policies decide actual access; selecting a permission does not grant it in AWS.","returnedUnexpectedBucketPageSize":"S3 returned an unexpected bucket or page size.","scopes":{"read":{"label":"List and download objects from bucket"},"write":{"label":"Also upload objects via pre-signed URLs"}}},"bigquery":{"description":"Configure the query project, run queries and retrieve results.","fields":{"projectId":{"hint":"The project that runs and is billed for queries. It can differ from the project containing your datasets. The initial connection check only lists accessible projects.","label":"Google Cloud project ID"}},"scopes":{"bigquery":{"label":"Manage BigQuery data"},"bigqueryReadonly":{"label":"Read BigQuery data and metadata"},"cloudPlatform":{"label":"Manage Google Cloud resources"},"cloudPlatformReadOnly":{"label":"Read Google Cloud resources"}}},"brevo":{"chooseTemplateProvideSubjectEmail":"Choose a template or provide a subject and email content.","description":"Send email and SMS, manage contacts and campaigns, and track delivery and automation events.","smsContentOrTemplate":"Choose SMS content or a template, not both."},"calendly":{"chooseEventOwner":"Choose the user, organization or group whose events to read.","choosePositiveRangeMost31":"Choose a positive range of at most 31 days.","description":"Read meetings and invitees, check availability, create booking links and manage appointments.","scopes":{"activityLogRead":{"label":"activity log — read"},"availabilityRead":{"label":"availability — read"},"availabilityWrite":{"label":"availability — write"},"contactsRead":{"label":"contacts — read"},"contactsWrite":{"label":"contacts — write"},"dataComplianceWrite":{"label":"data compliance — write"},"eventTypesRead":{"label":"event types — read"},"eventTypesWrite":{"label":"event types — write"},"groupsRead":{"label":"groups — read"},"locationsRead":{"label":"locations — read"},"organizationsRead":{"label":"organizations — read"},"organizationsWrite":{"label":"organizations — write"},"outgoingCommunicationsRead":{"label":"outgoing communications — read"},"routingFormsRead":{"label":"routing forms — read"},"scheduledEventsRead":{"label":"scheduled events — read"},"scheduledEventsWrite":{"label":"scheduled events — write"},"schedulingLinksWrite":{"label":"scheduling links — write"},"sharesWrite":{"label":"shares — write"},"usersRead":{"label":"users — read"},"webhooksRead":{"label":"webhooks — read"},"webhooksWrite":{"label":"webhooks — write"}}},"canva":{"clientIdHint":"Serve your client metadata JSON at this HTTPS URL. Canva must approve the callback; this setup uses no client secret.","clientIdLabel":"Client metadata URL","description":"Discover and use Canva design tools through each assistant owner's account.","scopes":{"assetRead":{"label":"Read assets"},"assetWrite":{"label":"Upload and edit assets"},"brandkitRead":{"label":"Read brand kits"},"brandtemplateContentRead":{"label":"Read brand template content"},"brandtemplateContentWrite":{"label":"Create and edit brand templates"},"brandtemplateMetaRead":{"label":"Read brand template information"},"commentRead":{"label":"Read comments"},"commentWrite":{"label":"Write comments"},"designContentRead":{"label":"Read design content"},"designContentWrite":{"label":"Create and edit designs"},"designMetaRead":{"label":"Read design information"},"folderRead":{"label":"Read folders"},"folderWrite":{"label":"Create and edit folders"},"helpAnswersRead":{"label":"Read help answers"},"helpAnswersWrite":{"label":"Write help answers"},"profileRead":{"label":"Read your profile"}}},"chargebee":{"description":"Manage customers and subscriptions, read invoices and launch hosted checkout for a Chargebee site.","fields":{"siteName":{"hint":"Your Chargebee site name, without .chargebee.com. Test and live sites use different keys.","label":"Site name"}}},"clay":{"apiKeyReferenceLabel":"Public API key reference","description":"Search people and companies, run enrichment routines and query Enterprise tables with your Clay Public API key."},"clickhouse":{"apiKeyReferenceHint":"Use a reference such as env:CLICKHOUSE_PASSWORD. Leave blank only if this database user has an empty password.","apiKeyReferenceLabel":"Password reference (optional)","authenticationHint":"No credentials uses the server's default user. Choose it only for a server configured to allow that access.","authenticationLabels":{"apiKey":"Username and password","none":"No credentials"},"description":"Explore tables and run bounded, parameterized analytical reads on your ClickHouse database.","fields":{"httpUrl":{"hint":"Use the HTTPS query endpoint, including its port and any proxy path. Native TCP addresses do not work here.","label":"HTTP Interface URL"},"username":{"hint":"The database user, not your Cloud console login. Leave blank to use default.","label":"Username (optional)"}}},"confidence":{"scopes":{"email":{"label":"Read account email"},"offlineAccess":{"label":"Refresh access without repeating sign-in"},"openid":{"label":"Identify the connected Confidence account"},"profile":{"label":"Read account profile"}}},"confidenceExp":{"description":"Read Confidence experiments and results through the assistant owner's MCP connection."},"confidenceFlags":{"description":"Manage Confidence flags through the assistant owner's MCP connection."},"contentful":{"apiKeyReferenceLabel":"Content Delivery API token reference","description":"Read published entries, linked assets, content models and locales from a Contentful space.","fields":{"environmentId":{"hint":"The key must have access to this environment. Defaults to master.","label":"Environment ID"},"region":{"items":{"eu":{"title":"Europe"},"us":{"title":"United States"}},"label":"Region"},"spaceId":{"hint":"Copy the Space ID from the selected space's API keys page.","label":"Space ID"}}},"databricks":{"description":"Read workspace jobs through user consent or a service principal.","fields":{"workspaceUrl":{"hint":"Use the workspace's own address. Omit browser paths, query strings and account-console URLs.","label":"Workspace URL"}},"oauthGrantHint":"User consent needs a custom OAuth application. Service account needs a service principal's client ID and OAuth secret, without a callback.","permissionsHint":"Permissions also depend on workspace membership and resource access. The jobs fragment only reads metadata; these OAuth scopes can permit more in other clients.","returnedUnexpectedJobResponse":"Databricks returned an unexpected job response.","scopes":{"allApis":{"label":"APIs allowed by the connected account"},"jobs":{"label":"Jobs API access for the service account"},"offlineAccess":{"label":"Keep user access between visits"}}},"dbtSemanticLayer":{"apiKeyReferenceHint":"Store the dbt service token in Env. It needs Semantic Layer Only and Metadata Only permissions and a linked warehouse credential.","apiKeyReferenceLabel":"Service token reference","completedWithoutJsonResultTable":"dbt completed without a JSON result table.","couldNotCompleteRequestedOperation":"dbt could not complete the requested operation. Check the environment and service token permissions.","description":"Discover metrics and query their values in a dbt Semantic Layer environment.","fields":{"environmentId":{"hint":"The deployment environment containing your metrics. Keep the full ID as text to avoid rounding.","label":"Environment ID"},"host":{"hint":"Copy the GraphQL hostname from dbt's Semantic Layer settings. Regional, single-tenant and multi-cell dbt hosts are supported.","label":"Semantic Layer host"}},"queryFailedInspectStatusDo":"dbt query failed. Inspect its status in dbt; do not automatically submit it again.","returnedInvalidJsonResultPage":"dbt returned an invalid JSON result page.","returnedInvalidJsonTable":"dbt returned an invalid JSON table.","returnedInvalidOversizedJsonResult":"dbt returned an invalid or oversized JSON result page.","returnedUnexpectedMetadataPage":"dbt returned an unexpected metadata page.","useServiceTokenWithoutSpaces":"Use a dbt service token without spaces or control characters."},"elevenlabs":{"audioSamplesMustTotalMost":"Audio samples must total at most 16 MiB.","description":"Generate speech, discover voices/models and create instant voice clones.","didNotReturnAudio":"ElevenLabs did not return audio.","returnedEmptyAudio":"ElevenLabs returned empty audio.","useNativeStreamingAudioAbove":"Use native streaming for audio above 16 MiB."},"figma":{"description":"Discover and call Figma's remote design tools through the assistant owner's account.","scopes":{"mcpConnect":{"label":"Use Figma MCP tools"}}},"firebaseCloudMessaging":{"couldNotAuthorizeServiceAccount":"Google could not authorize the service account. Check the credential and project permissions.","description":"Send notifications to mobile and browser installations, tokens or topics.","fields":{"apiKey":{"hint":"Public API key from the Firebase web app configuration. This value is visible in your app's pages.","label":"Firebase API key"},"appId":{"hint":"Public appId from the same Firebase project and web app.","label":"Firebase App ID"},"clientMode":{"hint":"Existing mobile/browser targets need server credentials. Include web push to configure browser registration too.","items":{"server":{"title":"Server or native only"},"web":{"title":"Include web push"}},"label":"Client setup"},"projectId":{"hint":"The project receiving messages. Usually project_id in your JSON; cross-project access requires an IAM grant on this target project.","label":"Firebase project ID"},"vapidKey":{"hint":"Public key from Project settings > Cloud Messaging > Web Push certificates. Never paste the private VAPID key.","label":"Web Push VAPID key"}},"permissionsHint":"Firebase IAM controls which projects this service account can send to. Sending to an audience also requires your application's authorization.","recipientNoLongerRegisteredRemove":"This Firebase recipient is no longer registered. Remove its association and wait for client registration again.","rejectedMessageTargetDoNot":"Firebase rejected the message or target. Do not delete a registration unless the payload is known to be valid.","returnedInvalidMessageJson":"Firebase returned invalid message JSON.","returnedUnexpectedMessageReceipt":"Firebase returned an unexpected message receipt.","returnedUnexpectedTokenRedirect":"Google returned an unexpected token redirect.","scopes":{"firebaseMessagingScope":{"label":"Validate and send Firebase messages"}},"serviceAccountReferenceHint":"Store the complete service-account JSON in Env, then enter its reference. It stays on the server and is never included in the browser configuration.","serviceAccountReferenceLabel":"Service-account JSON reference","useValidServiceAccountJson":"Use a valid Firebase service-account JSON credential for the default Google API domain."},"firecrawl":{"description":"Search, map, scrape and extract web content; run bounded site crawls.","useReturnedNextPageUrl":"Use the returned next-page URL for this crawl."},"fireflies":{"description":"Read and search Fireflies meetings, speaker-attributed transcripts and summaries."},"fireworksAi":{"description":"List accounts accessible to your Fireworks API key."},"gatewayApi":{"description":"Send SMS/RCS messages and read account credit on the Global or EU platform.","fields":{"region":{"hint":"Select the platform that issued this token.","items":{"eu":{"title":"EU (gatewayapi.eu)"},"global":{"title":"Global (gatewayapi.com)"}},"label":"API domain"}}},"gatewayapi":{"invalidWebhookEvent":"Invalid GatewayAPI webhook event."},"geminiEnterprise":{"description":"Search documents in a configured Gemini Enterprise engine.","fields":{"engineId":{"hint":"The existing search app identifier in default_collection, not its display name or full resource path.","label":"Engine ID"},"location":{"hint":"Match the engine's location. The runtime uses the corresponding Google API endpoint.","items":{"eu":{"title":"European Union"},"global":{"title":"Global"},"us":{"title":"United States"}},"label":"Location"},"projectId":{"hint":"The Google Cloud project where the Gemini Enterprise app lives.","label":"GCP project ID"}},"permissionsHint":"Google IAM and source permissions apply to the connected Google account. Shared access uses that same account for every authorized caller; it does not provide each app user's own search identity.","scopes":{"geminiEnterpriseScope":{"label":"Cloud Platform (full access)"}}},"githubApi":{"description":"Read repository content and activity; create and update issues and pull requests.","scopes":{"gist":{"label":"Gists"},"notifications":{"label":"Notifications"},"offlineAccess":{"label":"Expiring tokens with refresh access"},"project":{"label":"Projects"},"publicRepo":{"label":"Public repositories"},"readOrg":{"label":"Read organizations"},"readUser":{"label":"Read user profile"},"repo":{"label":"Repositories"},"userEmail":{"label":"Email"},"workflow":{"label":"Workflows"}}},"gitlabApi":{"description":"Read project content and activity; create and update issues and merge requests.","fields":{"instanceUrl":{"hint":"The trusted GitLab instance that receives this connection's credentials. Defaults to GitLab.com.","label":"Instance URL"}},"scopes":{"api":{"label":"Full API access"},"readApi":{"label":"Read API"},"readUser":{"label":"Read user profile"}}},"gmail":{"description":"Read and search mail, manage drafts and labels, and explicitly send messages.","scopes":{"gmailAddonsCurrentActionCompose":{"label":"Compose from an add-on"},"gmailAddonsCurrentMessageAction":{"label":"Act on the current add-on message"},"gmailAddonsCurrentMessageMetadata":{"label":"Read the current add-on message headers"},"gmailAddonsCurrentMessageReadonly":{"label":"Read the current add-on message"},"gmailCompose":{"label":"Manage drafts and send messages"},"gmailInsert":{"label":"Insert messages"},"gmailLabels":{"label":"Manage labels"},"gmailMetadata":{"label":"Read message headers and labels"},"gmailModify":{"label":"Read and modify messages"},"gmailReadonly":{"label":"Read messages"},"gmailSend":{"label":"Send messages"},"gmailSettingsBasic":{"label":"Manage basic mail settings"},"gmailSettingsSharing":{"label":"Manage sharing settings"},"httpsMailGoogleCom":{"label":"Full mailbox access including permanent deletion"}},"supplyLabelsAddRemove":"Supply labels to add or remove."},"gong":{"apiKeyReferenceLabel":"Access key secret reference","description":"Read company calls, transcripts, conversation statistics and linked CRM context.","endDateMustFollowStart":"The end date must follow the start date.","fields":{"accessKey":{"hint":"Copy the access key identifier from Gong's API settings. Store its secret separately.","label":"Access key"},"apiBaseUrl":{"hint":"Copy the API base URL from Gong's API settings. Leave empty to use https://api.gong.io.","label":"API base URL (optional)"}},"supplyCallIdsOrderedTimestamp":"Supply call IDs or an ordered timestamp range.","supplyIdsStringsPreserveAll":"Supply Gong IDs as strings to preserve all digits."},"google":{"batchRequestsInvalid":"Supply 1–100 native {product} request objects, one operation per object, within 1 MiB.","scopes":{"drive":{"label":"Manage Drive files"},"driveFile":{"label":"Access files selected for this application"},"driveReadonly":{"label":"Read Drive files"}}},"googleAds":{"apiCapacityExhaustedCheckCloud":"Google Ads API capacity is exhausted. Check the Cloud project and account quotas.","checkApiAccessApprovalCloud":"Check Google Ads API access approval for the Cloud project that owns this OAuth client.","connectAgainRequiredPermission":"Connect Google Ads again with its required permission.","description":"Discover advertising accounts, prepare reviewed Search campaigns and read Google Ads reports.","fields":{"loginCustomerId":{"hint":"Use the manager through which this app accesses client accounts, without hyphens. Direct account access can leave this blank.","label":"Manager customer ID (optional)"}},"permissionsHint":"This Google permission can authorize campaign changes. Search management uses separate reviewed operations; your application must authorize each account and spending decision. This is not application login.","rejectedOperationCheckCampaignFields":"Google Ads rejected the operation. Check campaign fields, policy requirements and account permissions.","resourceUnavailable":"This Google Ads resource is unavailable.","scopes":{"httpsWwwGoogleapisComAuthAdwords":{"label":"Access Google Ads accounts"}}},"googleAdsSearch":{"campaignChangedInspectApproveAgain":"The campaign changed. Inspect and approve it again.","campaignExceedsBoundedSearchReview":"This campaign exceeds the bounded Search review. Manage it in Google Ads.","chooseActiveClientAccount":"Choose an active client account.","chooseActiveClientAccountMatch":"Choose an active client account and match its currency.","chooseEnabledWebsiteConversionAction":"Choose an enabled website conversion action.","chooseIntegration":"Choose a Google Ads integration.","confirmInstalledConversionTrackingBilling":"Confirm installed conversion tracking and billing/advertiser readiness before launch.","didNotReturnSelectedAccount":"Google did not return the selected account.","enterLocationNameUsingLetters":"Enter a location name using letters, numbers, spaces, dots or hyphens.","pausedCampaignCanLaunchedHere":"Only a paused campaign can be launched here.","returnedInvalidCampaignGoal":"Google returned an invalid campaign goal.","reviewNonPoliticalSearchCampaign":"Review a non-political Search campaign with an enabled custom conversion goal.","screenLaunchesSearchCampaignsManual":"This screen launches only Search campaigns with manual CPC, ads and keywords. Manage other campaigns in Google Ads.","searchPlanChangedReviewAgain":"The Search plan changed. Review it again before creation.","selectAccessibleSearchCampaign":"Select an accessible Search campaign."},"googleAnalytics":{"authenticationHint":"Your application loads the Google tag. This does not grant access to Analytics reports.","authenticationLabels":{"none":"Public configuration · no credentials"},"description":"Configure website tracking with your public GA4 Measurement ID.","fields":{"measurementId":{"hint":"Public: this value will be visible in your application's pages. Copy it from your GA4 web stream.","label":"Measurement ID"}}},"googleDocs":{"description":"Create documents, read tabs and edit content with native batch requests.","scopes":{"documents":{"label":"Manage documents"},"documentsReadonly":{"label":"Read documents"}},"verificationFields":{"documentId":{"hint":"Leave blank for create-first access with drive.file and Drive API enabled. To verify an existing document, copy its ID between /document/d/ and /edit; the account and this app must have access.","label":"Document ID (optional)"}}},"googleDrive":{"base64Invalid":"Use standard padded base64 file data.","description":"Find files, upload and download content, and manage basic file metadata.","metadataChangeRequired":"Supply a name, description or trashed value.","mimeTypeInvalid":"Use a MIME type without header parameters.","parentIdNewFilesOnly":"parentId applies to new files; moving files requires native addParents/removeParents wiring.","scopes":{"drive":{"label":"Manage all Drive files"},"driveActivity":{"label":"Read and add file activity"},"driveActivityReadonly":{"label":"Read file activity"},"driveAppdata":{"label":"Manage application data"},"driveAppfolder":{"label":"Manage this application’s Drive folder data"},"driveAppsReadonly":{"label":"Read installed Drive apps"},"driveFile":{"label":"Manage files selected for this application"},"driveMeetReadonly":{"label":"Read Meet-created files"},"driveMetadata":{"label":"Manage file metadata"},"driveMetadataReadonly":{"label":"Read file metadata"},"drivePhotosReadonly":{"label":"Read photos"},"driveReadonly":{"label":"Read and download files"},"driveScripts":{"label":"Manage Apps Script files"}},"uploadTooLarge":"Uploads above 5 MB require the framework's native resumable client.","useFrameworkNativeDriveClient":"Use the framework's native Drive client for downloads or exports above 8 MiB."},"googleMapsPlatform":{"apiKeyReferenceHint":"Reference a server key authorized for Geocoding API. Verification performs one geocoding request using an address you supply and can incur provider usage charges.","apiKeyReferenceLabel":"Server API key reference","checkServerKeyBillingUsage":"Check the Google Maps server key, billing and usage cap.","couldNotAcceptGeocodingRequest":"Google Maps could not accept this geocoding request.","couldNotProcessRequestTry":"Google Maps could not process the request. Try again.","deniedAccessCheckEnabledApi":"Google Maps denied access. Check the enabled API and key restrictions.","description":"Geocode addresses, find places, compute routes and configure browser maps.","fields":{"browserKeyRef":{"hint":"A separate key for browser maps. Restrict it to the actual application websites and APIs. Backend verification does not verify this key.","label":"Browser API key reference (optional)"},"mapId":{"hint":"Public JavaScript map ID for advanced markers. Create it in Google Maps Platform > Map management. DEMO_MAP_ID is only for development.","label":"Map ID (optional)"}},"requestQuotaReached":"The Google Maps request quota was reached.","verificationFields":{"address":{"hint":"Enter an address or plus code. Connecting performs one geocoding request and can incur provider usage charges.","label":"Verification address"}}},"googleSearchConsole":{"datesOrder":"startDate must not follow endDate.","description":"Query search performance, inspect indexed URLs and manage sitemaps.","scopes":{"siteverification":{"label":"Manage website ownership through Site Verification"},"siteverificationVerifyOnly":{"label":"Verify new website ownership through Site Verification"},"webmasters":{"label":"Manage Search Console properties"},"webmastersReadonly":{"label":"Read Search Console properties"}}},"googleSheets":{"description":"Create spreadsheets, read and write ranges, and apply native batch updates.","rangesInvalid":"Supply 1–100 ranges within 1 MiB.","scopes":{"driveMetadataReadonly":{"label":"Read Drive file metadata (does not grant spreadsheet content access)"},"spreadsheets":{"label":"Manage spreadsheets"},"spreadsheetsReadonly":{"label":"Read spreadsheets"}},"valuesMatrixInvalid":"Supply a matrix of at most 10,000 cells and 1 MiB, containing strings, finite numbers, booleans or null.","verificationFields":{"spreadsheetId":{"hint":"Leave blank for create-first access with drive.file and Drive API enabled. Otherwise copy the ID between /spreadsheets/d/ and /edit, not the gid tab number; the account and app must have access.","label":"Spreadsheet ID (optional)"}}},"googleSlides":{"description":"Create and edit presentations, read pages and obtain preview thumbnails.","scopes":{"presentations":{"label":"Manage presentations"},"presentationsReadonly":{"label":"Read presentations"},"spreadsheets":{"label":"Manage linked spreadsheets"},"spreadsheetsReadonly":{"label":"Read linked spreadsheets"}},"verificationFields":{"presentationId":{"hint":"Leave blank for create-first access with drive.file and Drive API enabled. Otherwise copy the ID between /presentation/d/ and /edit; this is not a slide object ID. The account and app must have access.","label":"Presentation ID (optional)"}}},"granola":{"description":"Read meeting notes with an API key or connect the assistant owner through Granola MCP OAuth.","noteUnavailable":"The Granola note is unavailable, inaccessible or still being processed.","readTranscriptPagesTranscriptsList":"Read the transcript in pages with transcripts.list.","returnedDataDoesNotMatch":"Granola returned data that does not match this request.","scopes":{"email":{"label":"Read account email"},"offlineAccess":{"label":"Refresh access without repeating sign-in"},"openid":{"label":"Identify the connected Granola account"},"profile":{"label":"Read account profile"}},"useGrnApiKeyWithout":"Use the Granola grn_ API key without whitespace or control characters."},"hex":{"description":"Search projects and use Hex Threads through the assistant owner's MCP connection.","fields":{"endpoint":{"hint":"Use the endpoint where your Hex workspace lives; register the OAuth client at that endpoint.","items":{"eu":{"title":"Europe (eu.hex.tech)"},"hipaa":{"title":"HIPAA (hc.hex.tech)"},"standard":{"title":"Standard (app.hex.tech)"}},"label":"Hex workspace endpoint"}},"scopes":{"email":{"label":"Read account email"},"offlineAccess":{"label":"Refresh access without repeating sign-in"},"openid":{"label":"Identify the connected Hex account"},"profile":{"label":"Read account profile"}}},"heygen":{"description":"Read API profile and voices with a key, or connect HeyGen MCP tools through browser OAuth.","scopes":{"email":{"label":"Read account email"},"openid":{"label":"Identify the connected HeyGen account"},"profile":{"label":"Read account profile"}}},"heygenKey":{"description":"Read your API account profile and browse voice metadata."},"hubspot":{"contactIdentityRequired":"Supply email, firstname or lastname.","dealNameStageRequired":"Supply dealname and the internal dealstage ID.","scopes":{"crmObjectsContactsRead":{"label":"Read CRM contacts"},"crmObjectsContactsWrite":{"label":"Create and update CRM contacts"},"crmObjectsDealsRead":{"label":"Read deals and pipelines"},"crmObjectsDealsWrite":{"label":"Create and update CRM deals"},"oauth":{"label":"Authorize the HubSpot app"}}},"hubspotKey":{"description":"Manage contacts, deals and their relationships in the connected HubSpot account."},"incidentIo":{"description":"Manage incidents and follow-ups, resolve alerts, read on-call schedules and maintain catalogue entries."},"inngest":{"apiKeyReferenceHint":"Reference the Signing Key for the intended Inngest environment. Verification reads app metadata; it does not verify the Event Key or run a workflow.","apiKeyReferenceLabel":"Signing Key reference","configureValidEventKeyReconnect":"Configure a valid Inngest Event Key and reconnect.","deniedEvent":"Inngest denied this event.","description":"Send events to background workflows and inspect registered apps.","eventKeyBindingMissingInvalid":"The Inngest Event Key binding is missing or invalid.","eventLimitReached":"Inngest's event limit was reached.","fields":{"branchEnvironment":{"hint":"Routes event delivery to this branch. App metadata reads follow the Signing Key's environment.","label":"Branch environment (optional)"},"eventKeyRef":{"environmentCredential":{"label":"Inngest Event Key"},"hint":"The Event Key sends events. Keep it separate from the Signing Key, and use keys from the same intended environment.","label":"Event Key reference"}}},"klipy":{"description":"Browse clips, GIFs, stickers and existing AI emojis using your own KLIPY app key.","rejectedOperation":"KLIPY rejected the operation."},"lexware":{"description":"Read accounting contacts, articles and vouchers, and create net-EUR draft invoices."},"lightspeed":{"description":"Read products, inventory, sales, customers and outlets from a Lightspeed Retail X-Series store.","fields":{"domainPrefix":{"hint":"The store prefix from https://your-store.retail.lightspeed.app. Use the store you intend to authorize.","label":"Domain prefix"}},"lowerVersionMustBelowUpper":"The lower version must be below the upper version.","returnedInvalidTokenGrantDifferent":"Lightspeed returned an invalid token grant or a different store.","scopes":{"auditRead":{"label":"Read audit events"},"businessRulesRead":{"label":"Read business rules"},"businessRulesWrite":{"label":"Edit business rules"},"channelsRead":{"label":"Read channels"},"consignmentsRead":{"label":"Read consignments"},"consignmentsWriteInventoryCount":{"label":"Perform inventory counts"},"consignmentsWriteStockOrder":{"label":"Process stock orders"},"consignmentsWriteStockTransfer":{"label":"Transfer stock"},"customFieldsRead":{"label":"Read custom fields"},"customFieldsWrite":{"label":"Edit custom fields"},"customersRead":{"label":"Read customers"},"customersWrite":{"label":"Edit customers"},"fulfillmentsRead":{"label":"Read fulfillments"},"fulfillmentsWrite":{"label":"Edit fulfillments"},"giftCardsRead":{"label":"Read gift cards"},"giftCardsWriteIssue":{"label":"Issue gift cards"},"giftCardsWriteRedeem":{"label":"Redeem gift cards"},"inventoryRead":{"label":"Read inventory"},"inventoryWrite":{"label":"Edit inventory"},"outletsRead":{"label":"Read outlets"},"paymentTypesRead":{"label":"Read payment types"},"paymentsRead":{"label":"Read payments"},"productsRead":{"label":"Read products"},"productsReadPriceBooks":{"label":"Read price books"},"productsWrite":{"label":"Edit products"},"productsWritePriceBooks":{"label":"Edit price books"},"promotionsRead":{"label":"Read promotions"},"promotionsWrite":{"label":"Edit promotions"},"registerClose":{"label":"Close registers"},"registerOpen":{"label":"Open registers"},"registersRead":{"label":"Read registers"},"remoteRulesRead":{"label":"Read remote rules"},"remoteRulesWrite":{"label":"Edit remote rules"},"retailerRead":{"label":"Read retailer settings"},"salesRead":{"label":"Read sales"},"salesWrite":{"label":"Edit sales"},"serialNumbersRead":{"label":"Read serial numbers"},"serialNumbersWrite":{"label":"Edit serial numbers"},"servicesRead":{"label":"Read services"},"servicesWrite":{"label":"Edit services"},"storeCreditsRead":{"label":"Read store credits"},"storeCreditsWriteIssue":{"label":"Issue store credits"},"suppliersRead":{"label":"Read suppliers"},"suppliersWrite":{"label":"Edit suppliers"},"taxesRead":{"label":"Read taxes"},"taxesWrite":{"label":"Edit taxes"},"usersRead":{"label":"Read users"},"usersWrite":{"label":"Edit users"},"webhooks":{"label":"Manage application webhooks"}},"useOrderedInventoryVersionBounds":"Use ordered inventory version bounds and a product ID when requesting variants."},"linear":{"scopes":{"commentsCreate":{"label":"Create comments"},"issuesCreate":{"label":"Create issues and attachments"},"read":{"label":"Read your account"},"timeScheduleWrite":{"label":"Manage time schedules"},"write":{"label":"Write on your behalf"}}},"linearKey":{"description":"Read profiles and issues, or use Linear MCP tools with the connected account."},"linkedin":{"connectOpenidProfilePermissions":"Connect LinkedIn with OpenID and profile permissions.","description":"Connect a member's LinkedIn account to read their permitted profile information and publish approved text posts.","didNotConfirmPostCreation":"LinkedIn did not confirm post creation.","permissionsHint":"OpenID and profile are required for profile verification. Email is optional. Publish posts needs LinkedIn's Share on LinkedIn product; select it and reconnect before publishing text posts.","returnedInvalidMemberIdentity":"LinkedIn returned an invalid member identity.","scopes":{"email":{"label":"Read primary email address"},"openid":{"label":"OpenID (required)"},"profile":{"label":"Read basic profile (required)"},"wMemberSocial":{"label":"Publish posts"}}},"logoDev":{"apiKeyReferenceHint":"Reference a pk_ key. Your application exposes its value in image URLs. A private sk_ key cannot be used for this image flow.","apiKeyReferenceLabel":"Publishable key reference","description":"Display company logos using a publishable image-service key."},"mailgun":{"description":"Send transactional email, manage sending domains and inspect delivery logs.","fields":{"region":{"hint":"Select the region containing your sending domains.","items":{"eu":{"title":"European Union (api.eu.mailgun.net)"},"us":{"title":"United States (api.mailgun.net)"}},"label":"API region"}}},"mapbox":{"apiKeyReferenceHint":"Use a reference to a token for backend requests. It may be a public (pk.) or secret (sk.) token; browser URL restrictions can block backend geocoding.","apiKeyReferenceLabel":"Backend access token reference","configureValidTokenConnectAgain":"Configure a valid Mapbox token and connect again.","description":"Validate a backend access token and look up places or coordinates.","fields":{"publicTokenRef":{"environmentCredential":{"label":"Public browser token"},"hint":"Required for browser-only mode; optional with backend geocoding. Separate pk. token for Mapbox in your browser. The application may expose this value; backend verification does not verify its restrictions.","label":"Public browser token reference"},"usage":{"items":{"backend":{"title":"Backend geocoding and optional browser maps"},"browser":{"title":"Browser maps only"}},"label":"Mapbox usage"}}},"mcp":{"registrationFailed":"{provider} client registration failed. Check the provider before creating another client.","registrationInterrupted":"Registration was interrupted. Check the provider before creating another client.","transportRequestedUnexpectedDestination":"The MCP transport requested an unexpected destination."},"microsoft":{"chooseDocumentFile":"Choose a {product} file.","fields":{"tenantId":{"hint":"Use {authority} for the default audience, or the directory GUID for a single-tenant app. This is not the Application (client) ID.","label":"Directory (tenant) ID"}},"returnedInvalidFileList":"Microsoft returned an invalid file list.","returnedInvalidFileMetadata":"Microsoft returned invalid file metadata.","scopes":{"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftExcel":{"description":"Browse workbooks and read or update bounded cell ranges with explicit sessions.","scopes":{"filesRead":{"label":"Read your files"},"filesReadAll":{"label":"Read all files you can access"},"filesReadWrite":{"label":"Read and write your files (required by Excel worksheets)"},"filesReadWriteAll":{"label":"Read and write all files you can access"},"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftFabric":{"couldNotCompleteGraphqlDocument":"Fabric could not complete the GraphQL document. Check its schema and permissions before retrying.","description":"Access one Fabric GraphQL API using user consent or a service principal.","fields":{"graphqlEndpoint":{"hint":"Open your API for GraphQL in Fabric and select Copy endpoint. Custom proxies and sovereign-cloud addresses are not supported by this fragment.","label":"Fabric GraphQL Endpoint"},"tenantId":{"hint":"The directory containing the Fabric resource and permitted users or service principal.","label":"Microsoft Entra Tenant ID"}},"oauthGrantHint":"User consent needs a Web callback and delegated GraphQL permission. Service account needs a service principal with Fabric access, without a callback.","permissionsHint":"Fabric Execute access permits queries and mutations. Your application must authorize the documents it executes. Data-source access is separate; this does not sign users into your application.","requiresNewSignConsent":"Microsoft requires a new sign-in or consent.","scopes":{"delegatedScope":{"label":"Execute GraphQL queries and mutations as the user"},"offlineAccess":{"label":"Keep user access between visits"},"serviceScope":{"label":"Use the service account's Fabric permissions"}}},"microsoftOneDrive":{"description":"Browse folders, obtain file downloads and upload small files.","scopes":{"filesRead":{"label":"Read your files"},"filesReadAll":{"label":"Read all files you can access"},"filesReadWrite":{"label":"Read and write your files"},"filesReadWriteAll":{"label":"Read and write all files you can access"},"filesReadWriteAppFolder":{"label":"Read and write files in the application's folder"},"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftOneNote":{"description":"Browse notebooks and pages, read content, and create or append text notes.","scopes":{"notesCreate":{"label":"Create pages in OneNote notebooks"},"notesRead":{"label":"Read your notebooks"},"notesReadAll":{"label":"Read notebooks you can access in your organization"},"notesReadWrite":{"label":"Read and modify your notebooks"},"notesReadWriteAll":{"label":"Read and modify notebooks you can access in your organization"},"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftOnedrive":{"useStandardPaddedBase64Up":"Use standard padded base64 up to 5 MB; larger files need a native upload session."},"microsoftOnenote":{"useNativeOnenoteClientPages":"Use the native OneNote client for pages above 1 MiB."},"microsoftOutlook":{"description":"Read messages and files, send text mail, manage read/folder state and calendar appointments.","endMustFollowStart":"End must follow start.","scopes":{"calendarsRead":{"label":"Read your calendars"},"calendarsReadWrite":{"label":"Read and write your calendars"},"mailRead":{"label":"Read your mail"},"mailReadBasic":{"label":"Read basic mail properties"},"mailReadWrite":{"label":"Read and write your mail"},"mailSend":{"label":"Send mail as you"},"offlineAccess":{"label":"Keep access when you are away"}}},"microsoftPowerPoint":{"description":"Browse PowerPoint files and folders in your drive and read presentation metadata.","scopes":{"filesRead":{"label":"Read your files"}}},"microsoftSharePoint":{"description":"Browse sites/libraries, transfer small files and edit list items.","scopes":{"filesReadAll":{"label":"Read all files that user can access"},"filesReadWriteAll":{"label":"Read and write all files that user can access"},"offlineAccess":{"label":"Keep access when you are away"},"sitesFullControlAll":{"label":"Have full control of all site collections"},"sitesManageAll":{"label":"Create, edit, and delete items and lists in all site collections"},"sitesReadAll":{"label":"Read items in all site collections"},"sitesReadWriteAll":{"label":"Edit or delete items in all site collections"},"userRead":{"label":"Read user profile"}},"verificationFields":{"search":{"hint":"Enter a search term for accessible SharePoint sites. Verification performs this search without changing a site.","label":"Site search"}}},"microsoftTeams":{"description":"Browse teams/channels and read or send channel and existing-chat messages.","scopes":{"channelMessageReadAll":{"label":"Read channel messages"},"channelMessageSend":{"label":"Send messages to channels"},"channelReadBasicAll":{"label":"List channels in teams"},"chatReadWrite":{"label":"Read and send chat messages"},"offlineAccess":{"label":"Keep access when you are away"},"teamReadBasicAll":{"label":"List joined teams"},"userRead":{"label":"Read user profile"},"userReadAll":{"label":"Read all users' full profiles"}}},"microsoftWord":{"description":"Browse Word files and folders in your drive and read document metadata.","scopes":{"filesRead":{"label":"Read your files"}}},"miro":{"description":"Use Miro board tools through the assistant owner's selected team.","scopes":{"boardsRead":{"label":"Read boards"},"boardsWrite":{"label":"Create and edit boards"},"email":{"label":"Read your email address"},"openid":{"label":"Include account identity"}}},"n8n":{"apiKeyReferenceHint":"Use the personal token from Instance-level MCP, not an n8n REST API key. The assistant host must authorize individual tool calls.","apiKeyReferenceLabel":"MCP access token reference","description":"Discover and use your n8n instance's MCP tools from an assistant.","discoverOauthSettingsExactMcp":"Discover OAuth settings for this exact n8n MCP URL before connecting.","fields":{"serverUrl":{"hint":"Copy the full Server URL from n8n's MCP connection details. Keep any reverse-proxy subdirectory.","label":"Server URL"}},"oauthDiscoveryFailedCheckMcp":"n8n OAuth discovery failed. Check the MCP URL, advertised authority and supported server version.","oauthDiscoveryInterrupted":"n8n OAuth discovery was interrupted.","selectPermissionsAdvertisedMcpServer":"Select only permissions advertised by this n8n MCP server."},"notion":{"fields":{"connectionType":{"hint":"Hosted MCP needs its own client registration and consent; REST credentials cannot be reused.","items":{"mcp":{"title":"Hosted assistant tools (MCP)"},"rest":{"title":"Application data (REST)"}},"label":"Connection type"}},"scopes":{"default":{"label":"Notion MCP access"}}},"notionInternal":{"description":"Read, query and update pages and data sources shared with a Notion connection."},"oura":{"description":"Connect an individual's Oura account to read sleep, readiness, activity, heart-rate and permitted profile data.","scopes":{"daily":{"label":"Read daily sleep, activity and readiness summaries"},"email":{"label":"Read the account email address"},"heartrate":{"label":"Read heart-rate samples"},"personal":{"label":"Read personal profile information"}},"startNotAfterEnd":"Start must be before or equal to end."},"paddle":{"assistantActions":{"apiRead":{"label":"Read Paddle API"},"apiWrite":{"label":"Write Paddle API"},"enable":{"label":"Enable Paddle"},"goLiveCheck":{"label":"Check go-live status"},"pricesCreate":{"label":"Create price"},"productsBatchCreate":{"label":"Batch create products with prices"},"productsCreate":{"label":"Create product with price"},"providerRecommend":{"label":"Recommend payment provider"},"webhooksUpdate":{"label":"Edit webhook"}},"chooseLeastNotificationSettingChange":"Choose at least one notification setting to change.","description":"Read and create Paddle Billing products and prices in sandbox or live mode.","fields":{"environment":{"hint":"Use the environment that issued this API key.","items":{"live":{"title":"Live"},"sandbox":{"title":"Sandbox"}},"label":"Environment"}}},"perplexity":{"description":"Connect your Perplexity key for app-owned cited answers and streaming."},"pipedrive":{"companyAddressChangedConnectAccount":"The Pipedrive company address changed. Connect this account again.","fields":{"companyDomain":{"hint":"For acme.pipedrive.com enter acme. Required for API-token CRM operations; OAuth uses the company address returned with consent.","label":"Company domain (API token)"}},"returnedInvalidCompanyApiAddress":"Pipedrive returned an invalid company API address.","setCompanyDomainApiToken":"Set the Pipedrive Company domain for API-token CRM operations.","supplyChangedFieldsNewLead":"Supply changed fields; a new lead also needs a person or organization."},"pipedriveToken":{"description":"Read the authenticated user and identify their Pipedrive company."},"polar":{"description":"Read your organization's Polar product catalogue.","fields":{"environment":{"hint":"Use the environment containing this organization and token.","items":{"production":{"title":"Production"},"sandbox":{"title":"Sandbox"}},"label":"Environment"}}},"posthog":{"apiKeyReferenceHint":"Use an environment reference for the project's public token (phc_). Your app may expose that token in its frontend. It cannot read private analytics.","apiKeyReferenceLabel":"Project token reference","couldNotEvaluateAllRequested":"PostHog could not evaluate all requested flags.","description":"Capture events and evaluate flags with a public project token.","featureFlagQuotaReached":"PostHog's feature flag quota has been reached.","fields":{"projectId":{"hint":"Public numeric ID from project settings. Public API requests use the token to select the project; verification does not match this ID to the token.","label":"Project ID"},"region":{"hint":"Choose the PostHog Cloud region containing this project.","items":{"eu":{"title":"Europe (eu.i.posthog.com)"},"us":{"title":"United States (us.i.posthog.com)"}},"label":"Region"}},"usePublicProjectTokenStarting":"Use the public PostHog project token starting with phc_.","verificationFields":{"distinctId":{"hint":"Enter the identity whose feature flags should be evaluated. This check does not submit an analytics event.","label":"Verification user ID"}}},"prestashop":{"apiKeyReferenceHint":"Store the Webservice key outside source. Grant GET for products, and for orders if the application needs order reads.","apiKeyReferenceLabel":"Webservice API key reference","description":"Read products and orders from your PrestaShop store.","fields":{"siteUrl":{"hint":"Use the HTTPS store address before /api, keeping any installation subdirectory.","label":"Store URL"}}},"replicate":{"description":"Run asynchronous model predictions with an application-owned Replicate token."},"resend":{"description":"Send transactional email and manage contact segments and draft broadcasts."},"salesforce":{"describedDifferentObject":"Salesforce described a different object.","description":"Explore Salesforce objects and read records with your organisation's API permissions.","fields":{"accountUrl":{"hint":"Copy My Domain from Salesforce Setup. The same org receives authorization and API requests.","label":"Account URL"},"environment":{"hint":"Production includes Developer Edition. Sandbox uses the org's .sandbox.my.salesforce.com domain.","items":{"production":{"title":"Production"},"sandbox":{"title":"Sandbox"}},"label":"Environment"}},"organisationApiRequestLimitReached":"The Salesforce organisation's API request limit was reached.","permissionsHint":"Salesforce's api permission can allow writes. This runtime exposes reads; your app still authorizes each query. Connecting an account does not sign the person into your application.","rejectedQueryObjectCheckApi":"Salesforce rejected the query or object. Check its API names and the user's permissions.","returnedInvalidGrantDifferentOrganisation":"Salesforce returned an invalid grant or a different organisation.","scopes":{"api":{"label":"Access Salesforce APIs with this user's permissions"},"refreshToken":{"label":"Keep access when the user is away"}},"startQueryAgainResultCursor":"Start the Salesforce query again; its result cursor is no longer valid."},"sanity":{"apiKeyReferenceHint":"Store a Sanity token in Env. Its role controls tool access at https://mcp.sanity.io; the assistant host must authorize individual calls.","apiKeyReferenceLabel":"MCP API token reference","description":"Discover and use Sanity's hosted MCP tools from an assistant.","scopes":{"global":{"label":"Sanity MCP account access"}}},"semrush":{"apiAccessDisabledAccount":"Semrush API access is disabled for this account.","apiCapacityExhaustedCheckAccount":"Semrush API capacity is exhausted. Check the account's subscription and available units.","apiKeyReferenceHint":"Use a new Semrush V4 key: Read-only for reports and project reads, Read and write for creating, renaming or deleting projects. V3 keys and OAuth tokens are different credentials.","apiKeyReferenceLabel":"V4 API key reference","checkV3ApiDatabaseReport":"Check Semrush V3 API, database and report entitlement.","checkV3ApiUnitsReport":"Check Semrush V3 API units and report limits.","chooseMonth201201Through":"Choose a month from 2012-01 through the current month.","configureSeparateV3ApiKey":"Configure the separate Semrush V3 API key reference for keyword reports.","configureSeparateV3ApiKeyReferenceDomainReports":"Configure the separate Semrush V3 API key reference for domain reports.","configureV3KeyCampaignDiscovery":"Configure the Semrush V3 key for campaign discovery.","configureV3KeyPositionTracking":"Configure the Semrush V3 key for position tracking.","couldNotCompleteRequest":"Semrush could not complete this request.","couldNotReturnV3Report":"Semrush could not return the V3 report.","description":"Read keyword and backlink reports and manage Semrush projects using a V4 API key.","fields":{"v3ApiKeyRef":{"environmentCredential":{"label":"Semrush V3 API key"},"hint":"For domain overview and domain/URL/subfolder keyword reports and position tracking: My profile > API Keys > copy your Version 3 key into this project's Env. Leave empty if only using V4 reports/projects.","label":"V3 API key reference (optional)"}},"projectNotFoundNotAccessible":"The Semrush project was not found or is not accessible.","provideV3ApiKeyThrough":"Provide the Semrush V3 API key through its private Env reference.","provideValidV3ApiKey":"Provide a valid Semrush V3 API key.","rejectedV3ReportCheckInputs":"Semrush rejected the V3 report. Check its inputs and account access.","replaceSeparateV3KeyEnv":"Replace the separate Semrush V3 key in Env.","replaceV4KeyConnectAgain":"Replace the Semrush V4 key and connect again.","requestedPageExceedsProviderResult":"The requested Semrush page exceeds the provider's result window.","returnedIncompleteCsv":"Semrush returned incomplete CSV.","returnedInvalidTrackingJson":"Semrush returned invalid tracking JSON.","returnedMalformedCsv":"Semrush returned malformed CSV.","returnedOversizedV3Report":"Semrush returned an oversized V3 report.","returnedUnexpectedV3ReportColumns":"Semrush returned unexpected V3 report columns or rows.","trackingStartDateMustNot":"The tracking start date must not follow its end date.","useV4ApiKeyWithout":"Use the Semrush V4 API key without spaces or control characters."},"sentry":{"description":"Inspect and triage Sentry issues through scoped MCP tools.","fields":{"organizationSlug":{"hint":"Copy the organization slug from Sentry's URL. This connection is restricted to that organization.","label":"Sentry organization slug"},"projectSlug":{"hint":"Copy the slug from Project Settings to restrict access to one project. Leave empty for the selected organization.","label":"Sentry project slug (optional)"}},"scopes":{"eventWrite":{"label":"Write event data"},"orgRead":{"label":"Read organization data"},"projectWrite":{"label":"Write project data"},"teamWrite":{"label":"Write team data"}}},"sevdesk":{"apiKeyReferenceLabel":"API token reference","description":"Read sevdesk contact organizations and people with offset pagination."},"shared":{"apiKeyFormat":"Use the {provider} API key without spaces, control characters or colons.","differentRecord":"{provider} returned a different record.","invalidCallback":"Invalid {provider} callback.","invalidPermissionGrant":"{provider} returned an invalid permission grant.","invalidResponse":"{provider} returned an invalid response.","invalidTokenGrant":"{provider} returned an invalid token grant.","invalidTokenResponse":"{provider} returned an invalid token response.","invalidWebhookSignature":"Invalid {provider} webhook signature.","operationDenied":"{provider} denied this operation.","reconnectAccount":"Connect this {provider} account again.","requestLimitReached":"{provider}'s request limit was reached.","resourceUnavailable":"This {provider} resource is not available.","supplyCanonicalBase64NonemptyFile":"Supply canonical base64 for a nonempty file of at most 5 MiB.","supplyLeastChange":"Supply at least one change.","tooManyRecords":"{provider} returned more records than requested.","unexpectedPage":"{provider} returned an unexpected page.","unexpectedResponse":"{provider} returned an unexpected response."},"shopify":{"apiKeyReferenceHint":"Use env:SHOPIFY_ADMIN_TOKEN. A Storefront token, client secret or App Automation Token cannot be used here.","apiKeyReferenceLabel":"Admin API access token reference","assistantActions":{"claim":{"label":"Claim your store"},"connect":{"label":"Connect your Shopify store"},"discountCodesCreate":{"label":"Create discount code"},"discountCodesDelete":{"label":"Delete discount code"},"discountCodesUpdate":{"label":"Update discount code"},"enable":{"label":"Enable Shopify"},"priceRulesCreate":{"label":"Create price rule"},"priceRulesDelete":{"label":"Delete price rule"},"priceRulesUpdate":{"label":"Update price rule"},"productsCreate":{"label":"Create product"},"productsDelete":{"label":"Delete product"},"productsList":{"label":"Read products"},"productsUpdate":{"label":"Update product"},"variantsCreate":{"label":"Add product variant"},"variantsDelete":{"label":"Delete product variant"},"variantsUpdate":{"label":"Update product variant"}},"authenticationHint":"Client credentials require the app and store in the same Shopify organization. Connecting another merchant requires a separate Shopify installation flow.","authenticationLabels":{"apiKey":"Existing Admin API access token","oauth2":"App in your Shopify organization"},"description":"Connect a Shopify store and control what the assistant may change.","fields":{"shopDomain":{"hint":"Use the permanent myshopify.com address, including when your storefront uses a custom domain.","label":"Shopify store domain"}},"permissionsHint":"Match the scopes approved for the installed Shopify app. Write access includes reads. Assistant permission choices do not grant Shopify scopes or staff permissions.","rejectedProductChangeCheckProduct":"Shopify rejected the product change. Check the product values and permissions before retrying.","returnedMoreProductsRequested":"Shopify returned more products than requested.","scopes":{"readProducts":{"label":"Read products"},"writeProducts":{"label":"Create, update and delete products"}},"selectLeastProductDetailUpdate":"Select at least one product detail to update."},"slack":{"checkClientRegistrationCallback":"Check the Slack client registration and callback.","couldNotAuthorizeRequest":"Slack could not authorize this request.","description":"Connect as a Slack user or install a bot to read conversations and send messages.","fields":{"actor":{"hint":"User access acts as the person who connects. Bot access acts as the app in its installed workspace. Changing this choice removes permissions unavailable to that identity and requires reconnecting.","items":{"bot":{"title":"Installed bot"},"user":{"title":"Connected user"}},"label":"Act in Slack as"},"signingSecretRef":{"hint":"For incoming events and interactions: Basic Information → App Credentials → Signing Secret. Keep the value in application Env, separate from Client Secret.","label":"Signing secret reference (optional)"}},"requestFailedTryAgain":"The Slack request failed. Try again.","returnedTokenWrongIdentityInvalid":"Slack returned a token for the wrong identity or an invalid permission grant.","scopes":{"bookmarksRead":{"label":"List bookmarks"},"bookmarksWrite":{"label":"Create, edit, and remove bookmarks"},"callsRead":{"label":"View information about ongoing and past calls"},"callsWrite":{"label":"Start and manage calls in a workspace"},"canvasesRead":{"label":"Access contents of canvases created inside Slack."},"canvasesWrite":{"label":"Create, edit and remove canvases"},"channelsHistory":{"label":"View messages and other content in public channels you are in"},"channelsJoin":{"label":"Join public channels in a workspace"},"channelsManage":{"label":"Manage public channels that your Slack app has been added to and create new ones"},"channelsRead":{"label":"View basic information about public channels in a workspace"},"channelsWrite":{"label":"Manage a user's public channels and create new ones on a user's behalf"},"channelsWriteInvites":{"label":"Invite members to public channels"},"channelsWriteTopic":{"label":"Set the description of public channels"},"chatWrite":{"label":"Send messages"},"chatWriteCustomize":{"label":"Customize the content of messages sent by your Slack app"},"chatWritePublic":{"label":"Send messages to channels your Slack app isn't a member of"},"dndRead":{"label":"View Do Not Disturb settings for people in a workspace"},"dndWrite":{"label":"Edit a user's Do Not Disturb settings"},"emojiRead":{"label":"View custom emoji in a workspace"},"filesRead":{"label":"View files shared in channels and conversations that your Slack app has been added to"},"filesWrite":{"label":"Upload, edit, and delete files as your Slack app"},"groupsHistory":{"label":"View messages and other content in private channels that your Slack app has been added to"},"groupsRead":{"label":"View basic information about private channels that your Slack app has been added to"},"groupsWrite":{"label":"Manage private channels that your Slack app has been added to and create new ones"},"groupsWriteInvites":{"label":"Invite members to private channels"},"groupsWriteTopic":{"label":"Set the description of private channels"},"imHistory":{"label":"View messages and other content in direct messages you are in"},"imRead":{"label":"View basic information about direct messages you are in"},"imWrite":{"label":"Start direct messages with people"},"imWriteTopic":{"label":"Set the description in direct messages"},"listsRead":{"label":"View Slack Lists"},"listsWrite":{"label":"Create, edit, and delete Slack Lists"},"metadataMessageRead":{"label":"Allows your Slack app to read message metadata in channels that your Slack app has been added to"},"mpimHistory":{"label":"View messages and other content in group direct messages that your Slack app has been added to"},"mpimRead":{"label":"View basic information about group direct messages that your Slack app has been added to"},"mpimWrite":{"label":"Start group direct messages with people"},"mpimWriteTopic":{"label":"Set the description in group direct messages"},"pinsRead":{"label":"View pinned content in channels and conversations that your Slack app has been added to"},"pinsWrite":{"label":"Add and remove pinned messages and files"},"reactionsRead":{"label":"View emoji reactions"},"reactionsWrite":{"label":"Add and edit emoji reactions"},"remindersRead":{"label":"View reminders created by your Slack app"},"remindersWrite":{"label":"Add, remove, or mark reminders as complete"},"searchReadFiles":{"label":"Search a workspace's content in files"},"searchReadIm":{"label":"Search a workspace's content in direct messages"},"searchReadMpim":{"label":"Search a workspace's content in group direct messages"},"searchReadPrivate":{"label":"Search a workspace's content in private channels"},"searchReadPublic":{"label":"Search a workspace's content in public channels"},"searchReadUsers":{"label":"Search a workspace's users"},"teamRead":{"label":"View the name, email domain, and icon for workspaces your Slack app is connected to"},"usergroupsRead":{"label":"View user groups in a workspace"},"usergroupsWrite":{"label":"Create and manage user groups"},"usersProfileRead":{"label":"View profile details about people in a workspace"},"usersProfileWrite":{"label":"Edit a user's profile information and status"},"usersRead":{"label":"View people in a workspace"},"usersReadEmail":{"label":"View email addresses of people in a workspace"},"usersWrite":{"label":"Set presence for your Slack app"}}},"snowflake":{"description":"Query data and manage warehouses with a connected Snowflake role.","fields":{"accountUrl":{"hint":"Copy the account URL from Snowflake. Snowsight browser paths and organization-console URLs are not API addresses.","label":"Account URL"},"database":{"hint":"Exact case-sensitive database name for SQL execution; blank uses the user's default namespace. This is a default, not an access boundary: Snowflake role grants control access.","label":"Database (optional)"},"role":{"hint":"Use the exact name from SHOW ROLES, normally uppercase. Leave blank to use each connected user's default role. Shared accounts should use a dedicated role.","label":"Role"},"schema":{"hint":"Exact case-sensitive schema name for SQL execution; blank uses the user's default namespace.","label":"Schema (optional)"},"warehouse":{"hint":"Exact case-sensitive warehouse name for SQL execution. Blank uses the connected user's default. Queries may resume compute and incur Snowflake charges.","label":"Warehouse (optional)"}},"permissionsHint":"The role's Snowflake grants control access. SQL and warehouse actions use those grants and may incur compute charges. Connecting Snowflake does not sign users into your application.","rejectedStatementInspectQueryHistory":"Snowflake rejected the statement. Inspect query history with the authorized role.","responseExceeds16MibReduce":"Snowflake response exceeds 16 MiB. Reduce the query result or use a native streaming client.","returnedInvalidStatementResponse":"Snowflake returned an invalid statement response.","returnedUnexpectedDatabasePage":"Snowflake returned an unexpected database page.","scopes":{"refreshToken":{"label":"Keep access between visits (required)"},"refreshTokenOptional":{"label":"Keep access between visits"},"role":{"label":"Use role {role} (required)"}}},"storyblok":{"description":"Read space metadata and published or draft content in the space's region.","fields":{"region":{"hint":"Match the region selected when the Storyblok space was created.","items":{"ap":{"title":"Australia / APAC (AP)"},"ca":{"title":"Canada (CA)"},"cn":{"title":"China (CN)"},"eu":{"title":"European Union (EU)"},"us":{"title":"United States (US)"}},"label":"Space region"}}},"stripe":{"description":"Read the Stripe account's available and pending balances."},"supabase":{"description":"List projects through the Supabase Management API."},"tally":{"chooseNameStatusBlockChange":"Choose a name, status or block change.","description":"Create forms and retrieve submissions using your Tally account."},"telegram":{"apiKeyReferenceLabel":"Bot token reference","configureBotTokenReferencedEnvironment":"Configure a Telegram bot token in the referenced environment variable.","description":"Send bot messages and receive updates through application-owned polling."},"tiktok":{"clientIdHint":"Use the Client key from TikTok's app credentials, not its App ID.","clientIdLabel":"Client key","connectBasicProfilePermission":"Connect TikTok with basic profile permission.","connectPermissionRequiredOperation":"Connect TikTok with the permission required for this operation.","couldNotAuthorizeConnection":"TikTok could not authorize this connection.","couldNotCompleteRequest":"TikTok could not complete the request.","description":"Read a connected creator's profile and public video metadata.","permissionsHint":"Basic profile access is required for verification. Users can decline the other permissions during consent; the corresponding operations then stay unavailable.","returnedDuplicatePermissions":"TikTok returned duplicate permissions.","returnedTooManyVideos":"TikTok returned too many videos.","scopes":{"userInfoBasic":{"label":"Read basic profile information (required)"},"userInfoProfile":{"label":"Read extended profile information"},"userInfoStats":{"label":"Read user statistics"},"videoList":{"label":"Read published video metadata"}}},"twilio":{"apiKeyReferenceLabel":"API key secret reference","chooseSenderNumberMessagingService":"Choose one sender number or Messaging Service SID.","description":"Send SMS, initiate calls and read delivery/call status for the selected account and region.","fields":{"accountSid":{"hint":"Copy the SID of the account or subaccount whose calls this app may read.","label":"Account SID","placeholder":"AC followed by 32 hexadecimal characters"},"apiKeySid":{"hint":"Copy the API Key SID for this account and region. Store its secret separately.","label":"Standard API Key SID","placeholder":"SK followed by 32 hexadecimal characters"},"authTokenRef":{"hint":"For inbound messages, voice and delivery callbacks. Copy the account Auth Token from Twilio Console into private Env; this is NOT the API key secret.","label":"Callback Auth Token reference (optional)"},"region":{"hint":"Choose the region where this API key was created.","items":{"au1":{"title":"Australia (AU1)"},"ie1":{"title":"Ireland (IE1)"},"us1":{"title":"United States (US1)"}},"label":"Region"}},"supplyEitherCallControlUrl":"Supply either a call-control URL or inline TwiML."},"twitch":{"connectAgainPermissionEvent":"Connect Twitch again with permission for this event.","connectAgainPermissionNeededOperation":"Connect Twitch again with the permission needed for this operation.","description":"Connect Twitch accounts for stream discovery, chat, channel management, rewards, schedules and analytics.","enablingVacationRequiresTimezoneEnd":"Enabling vacation requires a timezone and an end after the start.","operationInvalidDestination":"This Twitch operation has an invalid destination.","returnedInvalidUnexpectedEventsubMessage":"Twitch returned an invalid or unexpected EventSub message.","returnedInvalidUserTokenValidation":"Twitch returned an invalid user-token validation.","returnedProfileDifferentUser":"Twitch returned a profile for a different user.","rewardLimitAmountRequired":"Supply {field} when enabling this reward limit.","scopes":{"analyticsReadExtensions":{"label":"Read extension analytics"},"analyticsReadGames":{"label":"Read game analytics"},"bitsRead":{"label":"Read Bits information"},"channelManageBroadcast":{"label":"Manage channel broadcast settings"},"channelManagePolls":{"label":"Create and manage channel polls"},"channelManagePredictions":{"label":"Create and manage channel predictions"},"channelManageRedemptions":{"label":"Manage channel point rewards and redemptions"},"channelManageSchedule":{"label":"Manage channel schedule"},"channelReadEditors":{"label":"Read channel editors"},"channelReadHypeTrain":{"label":"Read current hype train status"},"channelReadPolls":{"label":"Read channel polls"},"channelReadPredictions":{"label":"Read channel predictions"},"channelReadRedemptions":{"label":"Read channel point rewards and redemptions"},"channelReadSubscriptions":{"label":"Read your channel subscriptions"},"channelReadVips":{"label":"Read VIPs for your channels"},"clipsEdit":{"label":"Create clips"},"moderationRead":{"label":"Read moderation data"},"moderatorReadChatters":{"label":"Read chatters in a channel"},"moderatorReadFollowers":{"label":"Read followers for your channels"},"userReadEmail":{"label":"Read your email address"},"userReadFollows":{"label":"Read the channels you follow"},"userReadSubscriptions":{"label":"Check your subscription status"},"userWriteChat":{"label":"Send chat messages"}},"supplyBothReportDatesEnd":"Supply both report dates, with the end on or after the start.","supplyLeastBroadcastChange":"Supply at least one broadcast change.","supplyLeastRewardChange":"Supply at least one reward change.","supplyLeastScheduleChange":"Supply at least one schedule change.","supplyWinningOutcomeResolvingPrediction":"Supply a winning outcome only when resolving the prediction.","tokenBelongsDifferentApplication":"The Twitch token belongs to a different application.","tokenRequestDenied":"Twitch denied the token request."},"wave":{"accountChangedReloadApplyingEdit":"The account changed. Reload it before applying your edit.","accountingRecordNotAvailableSelected":"This accounting record is not available in the selected business. Check read access.","approveDocumentCheckEmailEligibility":"Approve the document and check Wave email eligibility before sending.","chooseAccountingFieldsUpdate":"Choose accounting fields to update.","chooseLeastCustomerFieldUpdate":"Choose at least one customer field to update.","chooseLeastDocumentFieldUpdate":"Choose at least one document field to update.","chooseLeastProductFieldUpdate":"Choose at least one product field to update.","couldNotCompleteQuery":"Wave could not complete this query.","customerNotAvailable":"This customer is not available in the selected business.","customerNotAvailableCheckAccess":"This customer is not available in the selected business. Check read access.","deniedTokenAccessCheckBusiness":"Wave denied token access. Check the business subscription and permissions.","description":"Connect project-owned Wave accounts for customers, products, invoices, estimates and accounting workflows.","documentNotAvailableSelectedBusiness":"This document is not available in the selected business. Check read access.","productAccountTaxNotAvailable":"This product, account or tax is not available in the selected business. Check read access.","rejectedAccountingChangeCheckValues":"Wave rejected the accounting change. Check the values and current record.","rejectedCustomerDetailsCheckSelected":"Wave rejected the customer details. Check the selected business and customer fields.","rejectedDocumentOperationCheckDetails":"Wave rejected the document operation. Check its details and current state.","rejectedProductDetailsCheckAccounts":"Wave rejected the product details. Check accounts, taxes and price.","rejectedTransactionReviewBalanceAccounts":"Wave rejected the transaction. Review its balance, accounts and details before submitting again.","returnedCustomerUnexpectedBusinessCheck":"Wave returned a customer from an unexpected business. Check the outcome before retrying.","returnedEstimateAnotherBusiness":"Wave returned an estimate from another business.","returnedUnexpectedAccountingRecord":"Wave returned an unexpected accounting record.","returnedUnexpectedAccountingRecordCheck":"Wave returned an unexpected accounting record. Check the outcome before retrying.","returnedUnexpectedBusiness":"Wave returned an unexpected business.","returnedUnexpectedCustomerCheckOutcome":"Wave returned an unexpected customer. Check the outcome before retrying.","returnedUnexpectedDocumentCheckOutcome":"Wave returned an unexpected document. Check the outcome before retrying.","returnedUnexpectedEstimate":"Wave returned an unexpected estimate.","returnedUnexpectedInvoice":"Wave returned an unexpected invoice.","returnedUnexpectedProductCheckOutcome":"Wave returned an unexpected product. Check the outcome before retrying.","scopes":{"account":{"label":"Full accounting account access"},"accountRead":{"label":"Read accounting accounts"},"accountWrite":{"label":"Edit accounting accounts"},"business":{"label":"Full business access"},"businessRead":{"label":"Read businesses"},"businessWrite":{"label":"Edit businesses"},"checkout":{"label":"Full checkout access"},"checkoutRead":{"label":"Read checkouts"},"customer":{"label":"Full customer access"},"customerRead":{"label":"Read customers"},"customerWrite":{"label":"Edit customers"},"estimate":{"label":"Full estimate access"},"estimateRead":{"label":"Read estimates"},"estimateSend":{"label":"Send estimates"},"estimateWrite":{"label":"Edit estimates"},"invoice":{"label":"Full invoice access"},"invoiceRead":{"label":"Read invoices"},"invoiceSend":{"label":"Send invoices"},"invoiceWrite":{"label":"Edit invoices"},"product":{"label":"Full product and service access"},"productRead":{"label":"Read products and services"},"productWrite":{"label":"Edit products and services"},"salesTax":{"label":"Full sales tax access"},"salesTaxRead":{"label":"Read sales taxes"},"salesTaxWrite":{"label":"Edit sales taxes"},"transaction":{"label":"Full transaction access"},"transactionWrite":{"label":"Create money transactions"},"user":{"label":"Full user access"},"userRead":{"label":"Read the connected user's profile"},"vendor":{"label":"Full vendor access"},"vendorRead":{"label":"Read vendors"},"vendorWrite":{"label":"Edit vendors"}},"transactionAccountCustomerTaxNot":"A transaction account, customer or tax is not available in the selected business. Check read access.","useMost100DistinctRelated":"Use at most 100 distinct related records per transaction."},"wix":{"appointmentSupplyServiceScheduleIds":"For an appointment, supply its service/schedule IDs, increasing local slot dates and IANA timezone. Courses cannot be rescheduled.","businessScheduleLimits":"Use native businessSchedule periods and specialHourPeriod arrays with at most 100 entries each.","chooseBusinessLocationId":"Choose the business location ID.","chooseServiceFieldUpdate":"Choose a service field to update.","chooseServiceTimeZoneIncreasing":"Choose the service, time zone and an increasing local date range.","chooseValidSiteId":"Choose a valid Wix Site ID.","classCourseSessionDurationsBelong":"Class/course session durations belong to their sessions, not service availability constraints.","classSupplySelectedEventidSlot":"For a class, supply only the selected eventId in slot.","configureSiteIdFirst":"Configure the Wix Site ID first.","depositRequiresAmountOnlinePayment":"A deposit requires its amount, online payment and no in-person payment.","describeCustomPaymentUp50":"Describe the custom payment in up to 50 characters.","description":"Use project-owned Wix account and site API access.","didNotReturnUpdatedFulfillment":"Wix did not return the updated fulfillment. Inspect the order before retrying.","doNotSendGeneratedService":"Do not send generated service identity fields or existing add-on groups when creating a service.","enableParticipantNotificationSendCancellation":"Enable participant notification to send a cancellation message.","enableParticipantNotificationSupplyingMessage":"Enable participant notification before supplying a message.","fields":{"accountId":{"hint":"Copy your account's ID from the API Keys Manager. A site ID is a different setting.","label":"Account ID"},"selectableSiteIds":{"hint":"Optional. Comma-separated sites the app may explicitly select. The app must still authorize each user's site access. Leave empty for a fixed-site connection.","label":"Selectable Site IDs","placeholder":"Site ID, Site ID"},"siteId":{"hint":"Required for site operations. Copy the ID after /dashboard/ in the intended Wix site dashboard URL.","label":"Site ID"}},"manualApprovalCannotUsePricing":"Manual approval cannot use pricing plans; online payment requires online booking.","onlineDepositPaymentsRequireFixed":"Online and deposit payments require fixed or varied pricing.","provideAppointmentSessionDurationsMinutes":"Provide appointment session durations in minutes.","provideContactDetailsCreationRequires":"Provide contact details; creation requires a name, email or phone.","provideDestinationMovingFutureSessions":"Provide a destination only when moving future sessions.","provideExplicitOnlineBookingSettings":"Provide explicit online-booking settings.","provideLocationAddress":"Provide the location address.","providePositiveDecimalPriceString":"Provide a positive decimal price string and three-letter currency code.","provideProductNameVisibilityBase":"Provide a product name, visibility or base-price change.","provideProductNameVisibilityChange":"Provide a product name or visibility change.","provideSelectedServiceSettingsInstead":"Provide the selected service settings instead of an empty object.","provideServiceTypeNameUp":"Provide a service type and name of up to 400 characters.","returnedAvailabilityDifferentServiceTime":"Wix returned availability for a different service, time or time zone.","returnedClassSlotDifferentService":"Wix returned a class slot for a different service.","returnedDifferentBookingCheckOperation":"Wix returned a different booking. Check the operation outcome before retrying.","returnedDifferentBookingServiceCheck":"Wix returned a different booking service. Check the outcome before retrying.","returnedDifferentBusinessLocation":"Wix returned a different business location.","returnedDifferentCmsCollection":"Wix returned a different CMS collection.","returnedDifferentCmsItemCollection":"Wix returned a different CMS item or collection. Check write outcomes before retrying.","returnedDifferentContactCheckOperation":"Wix returned a different contact. Check the operation outcome before retrying.","returnedDifferentEventSlotTime":"Wix returned a different event slot or time zone.","returnedDifferentFormSummary":"Wix returned a different form summary.","returnedDifferentOrder":"Wix returned a different order.","returnedDifferentProduct":"Wix returned a different product.","returnedFulfillmentsDifferentOrder":"Wix returned fulfillments for a different order.","returnedItemsDifferentCmsCollection":"Wix returned items from a different CMS collection.","returnedUnexpectedBookingRequestedId":"Wix returned an unexpected booking for the requested ID.","returnedVariantsDifferentService":"Wix returned variants for a different service.","selectDurationAddOnsSupplying":"Select a duration or add-ons before supplying customer choices.","selectLeastStaffResourceId":"Select at least one staff resource ID for the appointment service.","selectPersonOnlinePaymentIncluding":"Select in-person or online payment, including for a free service.","setAppointmentCapacity1Class":"Set appointment capacity to 1, or class/course capacity from 1 to 1000.","siteNotEnabledProjectSelectable":"This site is not enabled in the project's Selectable Site IDs.","supplyDetailsMatchingServiceLocation":"Supply the details matching each service location type.","supplyFulfillmentPropertiesWrite":"Supply the fulfillment properties to write.","supplyTrackingNumberProviderCustom":"Supply tracking number and provider; custom carriers also require a tracking URL.","useAppointmentDatesResourceLocation":"Use appointment dates/resource/location, a class event ID, or a course schedule ID, matching the selected service type.","useCursorLimitNextAvailability":"Use only cursor and limit for the next availability page.","useCursorLimitNextOrder":"Use only cursor and limit for the next order page.","useFixedVariedCustomNo":"Use FIXED, VARIED, CUSTOM or NO_FEE service payment settings.","useMost1000ParticipantsDistinct":"Use at most 1000 participants, distinct options per group and exactly one custom or duration value per choice.","useParticipantChoicesFixedParticipant":"Use participant choices or a fixed participant total, not both."},"wiz":{"accessSourceScanDenied":"Access to this source scan was denied.","auth0ScanningRequiresVerifiedCompatible":"Auth0 scanning requires a verified compatible Wiz runner.","authenticationHint":"A source scanner uses your workspace's service account. It does not sign app users in. The installed Wiz CLI performs authentication when a scan runs.","authenticationLabels":{"oauth2":"Wiz service account"},"authorisedSourceDirectoryUnavailable":"The authorised source directory is unavailable.","cliCouldNotStarted":"The Wiz CLI could not be started.","clientSecretReferenceInvalid":"The Wiz client-secret reference is invalid.","clientSecretReferenceUnavailable":"The Wiz client-secret reference is unavailable.","couldNotCompleteScanCheck":"Wiz could not complete the scan. Check the runner, policies and tenant access.","description":"Scan project source with your Wiz security policies.","didNotProduceReadableReport":"Wiz did not produce a readable report within the configured size limit.","fields":{"byPolicyHits":{"hint":"Filtering reported findings does not disable Wiz's policy verdict.","items":{"aUDIT":{"title":"Blocking or audit policy hits (AUDIT)"},"bLOCK":{"title":"Blocking policy hits (BLOCK)"},"dISABLED":{"title":"All findings (DISABLED)"}},"label":"Filter findings by policy hits"},"policies":{"hint":"Optional comma-separated policy names. Leave blank to use your Wiz tenant's defaults.","label":"CI/CD scan policies","placeholder":"Default vulnerabilities policy, Default IaC policy"},"tokenUrl":{"hint":"The current Wiz v1 runner supports Cognito. Auth0 configuration can be saved, but requires a verified compatible runner before scanning.","items":{"httpsAuthAppWizIoOauthToken":{"title":"Cognito (auth.app.wiz.io)"},"httpsAuthWizIoOauthToken":{"title":"Auth0 (auth.wiz.io)"}},"label":"Token URL"}},"hostMustSupplyAbsoluteSource":"The host must supply an absolute source directory and revision.","integrationNotConfigured":"This Wiz integration is not configured.","rejectedServiceAccountCredentials":"Wiz rejected the service-account credentials.","returnedUnsupportedInconsistentScanReport":"Wiz returned an unsupported or inconsistent scan report.","scanCancelled":"The Wiz scan was cancelled.","scanExceededTimeLimit":"The Wiz scan exceeded its time limit."},"woocommerce":{"apiKeyReferenceHint":"Store the consumer secret in Env. Use Read for lookups or Read/Write for changes; the key's WordPress user must also have permission for the requested operation.","apiKeyReferenceLabel":"Consumer secret reference","categoryCannotOwnParent":"A category cannot be its own parent.","categoryDeletionPermanentRequiresForce":"Category deletion is permanent and requires force=true.","chooseDifferentReassignmentUser":"Choose a different reassignment user.","chooseExplicitRefundRestockFlags":"Choose explicit refund/restock flags and decimal-string amounts.","chooseExplicitlyWhetherPermanentlyDelete":"Choose explicitly whether to permanently delete.","choosePeriodCompleteAscendingDate":"Choose a period or a complete ascending date range.","description":"Manage your WooCommerce catalogue, orders, customers, discounts and refunds, and read store reports.","fields":{"consumerKey":{"hint":"The key identifier from WooCommerce. Store its matching consumer secret separately.","label":"Consumer key"},"siteUrl":{"label":"Store URL"}},"invalidWebhookSignatureInputs":"Invalid WooCommerce webhook signature inputs.","percentageDiscountsCannotExceed100":"Percentage discounts cannot exceed 100.","productPricesMustDecimalStrings":"Product prices must be decimal strings.","resourceDoesNotSupportTrash":"This resource does not support trash; permanent deletion requires force=true.","restockingRequiresSelectedOrderLines":"Restocking requires selected order lines and positive quantities.","returnedDifferentCategory":"WooCommerce returned a different category.","returnedDifferentRefund":"WooCommerce returned a different refund.","returnedDifferentVariation":"WooCommerce returned a different variation.","supplyCategoryChanges":"Supply category changes.","supplyCouponChanges":"Supply coupon changes.","supplyCustomerChangesNonEmpty":"Supply customer changes and non-empty address objects.","supplyOrderChanges":"Supply order changes.","supplyProductChanges":"Supply product changes.","supplyVariationChanges":"Supply variation changes.","variationPricesMustDecimalStrings":"Variation prices must be decimal strings."},"wordpress":{"fields":{"siteUrl":{"hint":"Use the site address before /wp-json, keeping any installation subdirectory. The runtime sends credentials only to this configured origin."}}},"wordpressCom":{"description":"Connect a WordPress.com account to read its profile/sites and manage posts, pages and media.","scopes":{"batch":{"label":"Batch API requests"},"comments":{"label":"View and manage comments"},"media":{"label":"Manage media assets"},"posts":{"label":"View and manage posts"},"sites":{"label":"View site information and options"},"stats":{"label":"View site statistics"},"taxonomy":{"label":"Manage taxonomy terms"},"users":{"label":"View user information (required for verification)"}},"verifiedTokenBelongsDifferentApplication":"The verified token belongs to a different application."},"wordpressSelfHosted":{"apiKeyReferenceHint":"Use a WordPress Application Password for this user, stored in Env. The user's role controls access; this is separate from the user's login password.","apiKeyReferenceLabel":"Application password reference","description":"Manage WordPress posts, pages, media and users with a site-owned account.","fields":{"siteUrl":{"label":"Site URL"},"username":{"hint":"The WordPress login name that owns the Application Password.","label":"Username"}}},"workday":{"datesOrder":"The start date must not follow the end date.","description":"Read workers, organizations, time off and custom reports with each connected Workday user's permissions.","fields":{"authorizationEndpoint":{"hint":"Copy from View API Clients. The sign-in host usually differs from the API host.","label":"Authorization Endpoint"},"restApiEndpoint":{"hint":"Copy from View API Clients. Worker reads use Staffing v7 on this host and tenant.","label":"Workday REST API Endpoint"},"tokenEndpoint":{"hint":"Copy the Token Endpoint from the same Workday tenant.","label":"Token Endpoint"}},"permissionsHint":"Select the required functional areas in Workday: Staffing, Organizations and Roles, or Time Off and Leave. Each user's domain and report permissions still apply. Connecting Workday does not create your app's login.","supplyReportPromptOnceJoin":"Supply each report prompt once; join multi-instance WIDs with !.","useSmallerReportPromptRequest":"Use a smaller report prompt request."},"xTwitter":{"apiKeyReferenceHint":"Reference the app-only Bearer Token from X Developer Console. This token does not sign in an app user.","apiKeyReferenceLabel":"App-only bearer token reference","checkApplicationApiCreditsBilling":"Check this X application's API credits and billing access.","couldNotReturnCompleteRequested":"X could not return the complete requested data.","description":"Read public X profiles, posts and recent search with an application's bearer token.","passUserIdString":"Pass the X user ID as a string.","resourceNotFoundNotAvailable":"The X resource was not found or is not available.","useAppTokenWithoutSpaces":"Use the X app-only token without spaces, control characters or a Bearer prefix.","verificationFields":{"username":{"hint":"Enter a public X username without {'@'}. Connecting looks up this profile and can consume provider credits.","label":"Verification username"}}},"xero":{"attachmentResponsesLimited3Mib":"Xero attachment responses are limited to 3 MiB.","budgetDatesOrder":"The budget start date must not follow its end date.","description":"Manage contacts and invoices, record payments and read financial reports in connected organisations.","discountRatesApplySalesInvoices":"Discount rates apply only to sales invoices.","organisationNotConnectedAccount":"This Xero organisation is not connected to this account.","reportDatesOrder":"The report start date must not follow its end date.","returnedDifferentOrganisation":"Xero returned a different organisation.","returnedInvalidAttachmentResponse":"Xero returned an invalid attachment response.","returnedInvalidConnections":"Xero returned invalid connections.","scopes":{"accountingAttachments":{"label":"Read and manage attachments"},"accountingAttachmentsRead":{"label":"Read attachments"},"accountingBanktransactions":{"label":"Read and manage bank transactions"},"accountingBanktransactionsRead":{"label":"Read bank transactions"},"accountingBudgetsRead":{"label":"Read budgets"},"accountingContacts":{"label":"Read and manage contacts"},"accountingContactsRead":{"label":"Read contacts"},"accountingInvoices":{"label":"Read and manage invoices and bills"},"accountingInvoicesRead":{"label":"Read invoices and bills"},"accountingManualjournals":{"label":"Read and manage manual journals"},"accountingManualjournalsRead":{"label":"Read manual journals"},"accountingPayments":{"label":"Read and manage payments"},"accountingPaymentsRead":{"label":"Read payments"},"accountingReportsAgedRead":{"label":"Read aged receivables and payables reports"},"accountingReportsBalancesheetRead":{"label":"Read balance sheet reports"},"accountingReportsBanksummaryRead":{"label":"Read bank summary reports"},"accountingReportsBudgetsummaryRead":{"label":"Read budget summary reports"},"accountingReportsExecutivesummaryRead":{"label":"Read executive summary reports"},"accountingReportsProfitandlossRead":{"label":"Read profit and loss reports"},"accountingReportsTaxreportsRead":{"label":"Read GST and BAS reports"},"accountingReportsTrialbalanceRead":{"label":"Read trial balance reports"},"accountingSettings":{"label":"Read and manage organisation settings"},"accountingSettingsRead":{"label":"Read organisation settings"},"offlineAccess":{"label":"Keep access when the user is away"}},"supplyBankTransactionFieldChange":"Supply a bank transaction field to change.","supplyCanonicalBase64NonemptyAttachment":"Supply canonical base64 for a nonempty attachment of at most 3 MiB.","supplyContactFieldChange":"Supply a contact field to change.","supplyInvoiceFieldChange":"Supply an invoice field to change.","supplyJournalFieldChange":"Supply a journal field to change."},"zoho":{"regions":{"au":{"title":"Australia (.com.au)"},"ca":{"title":"Canada (.ca)"},"cn":{"title":"China (.com.cn)"},"eu":{"title":"Europe (.eu)"},"in":{"title":"India (.in)"},"jp":{"title":"Japan (.jp)"},"sa":{"title":"Saudi Arabia (.sa)"},"us":{"title":"United States (.com)"}},"returnedTokenDifferentDataCenter":"Zoho returned a token for a different data center or environment."},"zohoBooks":{"chooseOrganisationIdOrganizationsList":"Choose an organisation ID from organizations.list or configure one for this integration.","configuredOrganisationNotActiveAccessible":"The configured Books organisation is not active and accessible to this account.","description":"Discover accessible organisations and read pages of contacts and invoices.","fields":{"organizationId":{"hint":"Set one organisation for this integration, or leave empty and let the app choose from the connected account's organisations.","label":"Organization ID (optional)"},"region":{"hint":"Choose the data center containing the Books account. Canada uses accounts.zohocloud.ca for OAuth.","label":"Data center"}},"integrationConfiguredDifferentOrganisation":"This integration is configured for a different organisation.","resourceNotAvailable":"This Books resource is not available.","returnedAmbiguousPagination":"Zoho Books returned ambiguous pagination.","returnedInvalidOrganisations":"Zoho Books returned invalid organisations.","scopes":{"billsAll":{"label":"Full access to bills"},"contactsAll":{"label":"Full access to contacts"},"creditnotesAll":{"label":"Full access to credit notes"},"customerpaymentsAll":{"label":"Full access to customer payments"},"estimatesAll":{"label":"Full access to estimates"},"expensesAll":{"label":"Full access to expenses"},"invoicesAll":{"label":"Full access to invoices"},"projectsAll":{"label":"Full access to projects"},"purchaseordersAll":{"label":"Full access to purchase orders"},"salesordersAll":{"label":"Full access to sales orders"},"zohoBooksContactsREAD":{"label":"Read contacts"},"zohoBooksInvoicesREAD":{"label":"Read invoices"},"zohoBooksSettingsREAD":{"label":"Read organisations and settings"}}},"zohoCrm":{"connectAgainPermissionsNeededOperation":"Connect again with the CRM permissions needed for this operation.","description":"Read the connected CRM user and pages of leads, contacts, accounts and deals.","fields":{"environment":{"hint":"Choose the same environment and organisation during Zoho consent. Tokens cannot be moved between environments.","items":{"developer":{"title":"Developer"},"production":{"title":"Production"},"sandbox":{"title":"Sandbox"}},"label":"CRM environment"},"region":{"hint":"Choose the data center containing your CRM account. Canada uses accounts.zohocloud.ca for OAuth.","label":"Data center"}},"resourceNotAvailable":"This CRM resource is not available.","scopes":{"zohoCRMModulesALL":{"label":"Full access to all CRM modules"},"zohoCRMModulesAccountsALL":{"label":"Full account access"},"zohoCRMModulesAccountsREAD":{"label":"Read accounts"},"zohoCRMModulesContactsALL":{"label":"Full contact access"},"zohoCRMModulesContactsREAD":{"label":"Read contacts"},"zohoCRMModulesDealsALL":{"label":"Full deal access"},"zohoCRMModulesDealsREAD":{"label":"Read deals"},"zohoCRMModulesLeadsALL":{"label":"Full lead access"},"zohoCRMModulesLeadsREAD":{"label":"Read leads"},"zohoCRMModulesREAD":{"label":"Read all CRM modules"},"zohoCRMUsersALL":{"label":"Full CRM user access"},"zohoCRMUsersREAD":{"label":"Read the connected CRM user"}},"useEitherPageNumberPage":"Use either a page number or a page token."}}}`);var en_default$5={jskit:jskit$5};var jskit$4={"connectors":{"configuration":{"accountModeUnsupported":`This provider does not support this account mode.`,"apiKeyRegistration":`API keys do not use an OAuth registration.`,"assistantActionUndeclared":`This provider does not declare this assistant action.`,"clientAuthenticationUnsupported":`This provider does not support this client authentication method.`,"clientId":`Check this provider's client identifier.`,"confidentialClientRequired":`Client credentials require a confidential client.`,"credentialModeUnsupported":`This provider configuration does not support this credential mode.`,"duplicateScope":`Select each permission only once.`,"invalid":`Invalid configuration.`,"invalidJson":`Enter valid JSON.`,"noCredentials":`This mode does not use credentials.`,"oauthFlowUnsupported":`This provider does not support this OAuth flow.`,"otherCredentialModeField":`This field belongs to another credential mode.`,"otherCredentialModeSetting":`This setting belongs to another credential mode.`,"providerSettings":`Check this provider's settings.`,"providerUnregistered":`Install and register this provider before using it.`,"refreshTokenClientCredentials":`Client credentials do not use a refresh token.`,"refreshTokenOAuthOnly":`Only an OAuth connection can start from a refresh token.`,"refreshTokenSharedOnly":`Only a shared connection can start from a refresh token in Env.`,"registrationSecret":`Use the registration's secret reference.`,"registrationUndefined":`Select a registration defined in this file.`,"requiredScopes":`Include this provider's required permissions.`,"schemaVersionUnsupported":`Use numeric schemaVersion 1; other versions require an explicit migration.`,"scopeRequired":`Select at least one permission.`,"scopeUnsupported":`A selected permission is not supported by this provider configuration.`,"secretReference":`Use a reference such as env:VARIABLE_NAME.`,"serviceAccountPerUser":`A service account cannot connect as each app user.`,"serviceAccountRegistration":`Service-account credentials do not use a browser OAuth registration.`,"stableName":`Use a stable lowercase name containing letters, digits and hyphens.`,"valueRequired":`This value is required.`},"connection":{"ambiguousPermissionGrant":`The provider did not return an unambiguous permission grant.`,"apiKeyBindingMissingInvalid":`The API key binding is missing or invalid.`,"assistantActionDisabled":`This assistant action is disabled.`,"authorizationAttemptInvalidExpired":`The authorization attempt is invalid or has expired.`,"authorizationCallbackInvalid":`The authorization callback is invalid.`,"callbackDoesNotMatchRegistration":`The callback does not match this registration.`,"callbackUrlDoesNotMeet":`The callback URL does not meet this provider's requirements.`,"checkOperationInputValues":`Check the operation's input values.`,"configureHttpsCallbackUrlLocal":`Configure an HTTPS callback URL, or a local development callback.`,"connectAccountAgain":`Connect this account again.`,"connectAgainPermissionRequiredOperation":`Connect again with the permission required for this operation.`,"connectAgainPermissionRequiredVerification":`Connect again with the permission required for verification.`,"connectionNotAllowed":`You cannot use this connection.`,"envRefreshTokenRejected":`The refresh token in Env no longer works; replace that Env value.`,"envSeeded":`This connection comes from an Env value; unlink or replace that value instead.`,"integrationNotConfigured":`This integration is not configured.`,"operationCancelled":`The operation was cancelled.`,"operationRequiresDifferentMethod":`This operation requires a different connection method.`,"operationRequiresPermissionAbsentApplication":`This operation requires a permission absent from the application's configuration.`,"providerClientIdNotConfigured":`The provider client ID is not configured.`,"providerDeniedOperation":`The provider denied this operation.`,"providerDoesNotDeclareAssistant":`This provider does not declare this assistant action.`,"providerInvalidCredentialPath":`This provider has an invalid credential path.`,"providerNonPkceFlowRequires":`This provider's non-PKCE flow requires a confidential client.`,"providerOperationInvalidDestination":`The provider operation has an invalid destination.`,"providerOperationNotAvailable":`This provider operation is not available.`,"providerRequestFailedTryAgain":`The provider request failed. Try again.`,"providerRequestLimitReached":`The provider's request limit was reached.`,"providerRequiresJsonRequestBody":`This provider requires a JSON request body.`,"providerReturnedInvalidAccountLabel":`The provider returned an invalid account label.`,"providerReturnedInvalidPermissionGrant":`The provider returned an invalid permission grant.`,"providerReturnedInvalidServiceAccount":`The provider returned an invalid service-account token.`,"providerReturnedUnexpectedResponse":`The provider returned an unexpected response.`,"refreshTokenBindingMissingInvalid":`The refresh token binding is missing or invalid.`,"requiredEnvironmentBindingMissing":`A required environment binding is missing.`,"requiredRegistrationBindingMissing":`A required registration binding is missing.`,"runtimeDoesNotYetSupport":`This runtime does not yet support the selected credential mode.`,"selectClientCredentialsConnectService":`Select client credentials to connect a service account.`,"selectMatchingCredentialModeVerify":`Select the matching credential mode to verify this connection.`,"selectServiceAccountCredentialsVerify":`Select service-account credentials to verify this connection.`,"serviceAccountCredentialBindingMissing":`The service-account credential binding is missing or invalid.`,"serviceAccountsConnectWithoutBrowser":`Service accounts connect without browser consent.`,"serviceAccountsDoNotUse":`Service accounts do not use an authorization callback.`,"verificationScopeAbsent":`Connection verification requires a permission absent from the application's configuration.`}},"errors":{"connector_approval_required":`Approve this assistant action before continuing.`,"connector_consent_denied":`Account access was declined.`,"connector_credentials_unavailable":`Stored credentials could not be opened.`,"connector_provider_timeout":`The provider request timed out. Try again.`,"connector_storage_invalid":`Connection state could not be read safely.`,"integration_configuration_invalid":`Integration configuration is invalid.`}};var en_default$4={jskit:jskit$4};var jskit$3={"connectors":{"configurationFields":{"accountMode":{"label":`Account used by the application`},"accountModes":{"assistant":`Assistant access`,"perUser":`Each app user's own account`,"shared":`One shared account`},"apiKeyReference":{"hint":`Store the API key in your environment or secret store. Enter its reference here, such as env:SERVICE_API_KEY.`,"label":`API key reference`},"ariaLabel":`{provider} configuration`,"assistant":{"defaultPermission":{"hint":`Changing this sets every assistant action below to the same choice.`,"label":`Manage all permissions`},"enabled":{"label":`Allow assistant access`},"hint":`These choices control assistant actions for this integration. They do not grant access to the provider or replace your application's permissions.`},"assistantPermissions":{"always":`Always allow`,"ask":`Ask each time`,"never":`Never allow`},"authentication":{"label":`Authentication`},"authenticationMethods":{"apiKey":`API key`,"none":`No credentials`,"oauth2":`OAuth`,"serviceAccount":`Service account`},"callbackUrl":{"label":`Callback URL`},"callbackUrlReference":{"hint":`Reference the callback route implemented by your application and registered with the provider.`,"label":`Callback URL reference`},"clientId":{"label":`Client ID`},"clientSecretReference":{"hint":`Use an environment reference such as env:{prefix}_CLIENT_SECRET. Keep the value outside this file.`,"label":`Client secret reference`},"displayName":{"label":`Display name`},"grantType":{"label":`OAuth flow`},"grantTypes":{"authorizationCode":`User consent`,"clientCredentials":`Service account`},"panels":{"assistant":`Assistant permissions`,"credentials":`Credentials`,"details":`Details`,"permissions":`Permissions`},"permissions":{"hint":`Choose what the application needs. The account owner approves these permissions when connecting.`},"registration":{"label":`App registration`},"serviceAccountReference":{"hint":`Store the service credential in your environment or secret store and enter its reference here.`,"label":`Service-account credential reference`}}}};var en_default$3={jskit:jskit$3};var jskit$2={"http":{"request":{"failedWithStatus":`Request failed with status {status}.`,"networkFailed":`Network request failed.`}},"errors":{"jsonapi_request_body_invalid":`JSON:API request body must contain a resource document.`,"jsonapi_request_type_mismatch":`JSON:API resource type must be {type}.`}};var en_default$2={jskit:jskit$2};var jskit$1={"errors":{"payment_plan_unknown":`Select a published payment plan.`,"payment_readiness_invalid":`App readiness checks must return bounded status and safe explanatory text.`,"payment_forbidden":`You cannot manage this billable account.`,"payment_operation_conflict":`The pending payment operation changed.`,"payment_request_invalid":`Supply a stable checkout request identifier.`,"payment_subscription_exists":`Manage the existing subscription through billing instead of starting another checkout.`,"payment_history_unavailable":`Billing history could not be loaded. Check provider access and retry.`,"payment_customer_missing":`Create a billing account first.`,"payment_reconciliation_required":`Provider inspection did not resolve this request.`,"payment_customer_conflict":`This provider customer is already bound to a different billable subject.`,"payment_catalogue_pending":`Another catalogue request needs resolution.`,"payment_catalogue_uncertain":`Catalogue publication stopped. Inspect the pending provider request before retrying; completed items are preserved.`,"payment_balance_limit":`Credit balance exceeds the supported integer range.`,"payment_feature_required":`Your subscription does not include this feature.`,"payment_insufficient_credits":`Not enough credits for this action.`,"payment_debit_missing":`No debit exists for this reference.`,"payment_customer_unbound":`Bind this provider customer before processing its events.`,"payment_sandbox_only":`Only production takes real payments: use the sandbox payment environment.`},"payments":{"scope":{"readinessMismatch":`Readiness returned a different payment account or environment.`,"catalogueMismatch":`Catalogue scope does not match its configured environment.`,"merchantMismatch":`The payment scope does not match this environment's merchant configuration.`},"operation":{"unfinished":`Inspect the unfinished provider request before retrying.`,"mayHaveSucceeded":`Inspect this account's provider activity before retrying; the request may have succeeded.`},"input":{"billingEmail":`Supply the authenticated billing contact's email.`,"historyPage":`Select billing subscriptions or transactions and a valid page cursor.`,"historyCollection":`Select a billing history collection.`,"recoveryObjectId":`Supply the exact provider object ID to recover.`,"reference":`Use a nonempty business reference of at most 150 characters.`,"creditQuantity":`Use a positive integer credit quantity, at most one billion.`,"timestamp":`Use an integer UTC timestamp in milliseconds.`},"reference":{"otherPlan":`The checkout request already selected another plan.`,"differentInputs":`This business reference was already used with different inputs.`},"provider":{"checkAccount":`Check the {provider} account, price mapping and subscription shape.`,"unsupportedEvent":`The event is not a supported subscription payment for this customer.`,"objectIdMissing":`The provider did not return an object ID.`,"subscriptionBinding":`Check the provider subscription and logical price binding.`,"renewalBinding":`Check the renewal's logical price binding.`},"webhook":{"rawBodyRequired":`Supply the unmodified webhook request bytes.`,"verificationFailed":`{provider} webhook verification failed.`},"configuration":{"invalid":`Check the application's payment configuration.`,"taxCategoryUnpublishable":`Set the application's Paddle product tax category before publishing.`,"sharedConnectionRequired":`Select a shared Stripe or Paddle connection with a backend API-key Env reference for {environment}.`,"paddleEnvironment":`Select a Paddle connection configured for {environment}.`,"paddleTaxCategory":`Choose the Paddle tax category for the products this app sells.`,"paddleClientToken":`Set the Env reference for this environment's Paddle public client token.`},"catalogue":{"reviewFirst":`Review the current catalogue and resolve provider drift or unfinished requests first.`,"publicationChanged":`Another publication changed the catalogue; review again.`,"planChanged":`This plan changed; review again.`,"productChanged":`This product changed; review again.`,"priceChanged":`This price changed; review again.`,"pendingCatalogueRequestChanged":`The pending catalogue request changed.`,"recoveryReviewChanged":`The recovery review changed. Inspect the current pending operation first.`,"pendingRequestChanged":`The pending request changed.`,"objectMismatch":`The provider object does not match the pending operation.`}}};var en_default$1={jskit:jskit$1};var jskit={"uploads":{"file":{"invalid":`Upload is invalid.`,"tooLarge":`{label} file is too large. Maximum allowed size is {maxMb}MB.`,"empty":`{label} file is empty.`,"typeNotAllowed":`{label} must be one of: {types}.`,"tooMany":`{label} upload allows only one file.`,"required":`{label} file is required.`,"fieldNotAllowed":`{label} field "{field}" is not allowed.`}}};var en_default={jskit};function normalizeComponentId(value){const id=String(value||``).trim();if(!id)throw new TypeError(`Client component id is required.`);return id}function createClientComponentRegistry(){const components=new Map;function register(id,component){const componentId=normalizeComponentId(id);if(component==null)throw new TypeError(`Client component "${componentId}" is required.`);if(components.has(componentId))throw new Error(`Client component "${componentId}" is duplicated.`);components.set(componentId,component);return api}function has(id){return components.has(normalizeComponentId(id))}function get(id){const componentId=normalizeComponentId(id);if(!components.has(componentId))throw new Error(`Client component "${componentId}" is not registered.`);return components.get(componentId)}function ids(){return Object.freeze([...components.keys()].sort())}const api=Object.freeze({register,has,get,ids});return api}function normalizePackageMetadataUiRoutes(value){const routeEntries=Array.isArray(value)?value:[];const normalizedRoutes=[];for(const routeEntry of routeEntries){if(!isRecord(routeEntry))continue;try{normalizedRoutes.push(Object.freeze(JSON.parse(JSON.stringify(routeEntry))))}catch{}}return Object.freeze(normalizedRoutes)}function normalizePackageMetadataClientProviders(value){const entries=Array.isArray(value)?value:[];const providers=[];for(const entry of entries){if(!isRecord(entry))continue;const exportName=String(entry.export||``).trim();if(!exportName)continue;providers.push(Object.freeze({export:exportName,entrypoint:String(entry.entrypoint||``).trim()}))}return Object.freeze(providers)}function normalizePackageId(value){return String(value||``).trim()}function toRouteSnapshot(route){const metaJskit=isRecord(route?.meta?.jskit)?route.meta.jskit:{};return Object.freeze({id:String(route?.id||``).trim(),name:String(route?.name||``).trim(),path:String(route?.path||``).trim(),scope:String(route?.scope||``).trim(),surface:String(route?.surface||``).trim(),metaScope:String(metaJskit.scope||``).trim(),metaSurface:String(metaJskit.surface||``).trim()})}function isRouteComponent(value){if(typeof value===`function`)return true;return isRecord(value)}function normalizeRoute(route,{packageId,index}){if(!isRecord(route))throw new TypeError(`Client route #${index} from ${packageId} must be an object.`);const id=String(route.id||``).trim();const path=String(route.path||``).trim();if(!id)throw new Error(`Client route #${index} from ${packageId} requires id.`);if(!path||!path.startsWith(`/`)||path.startsWith(`//`))throw new Error(`Client route "${id}" from ${packageId} must use an absolute path.`);if(!isRouteComponent(route.component))throw new Error(`Client route "${id}" from ${packageId} requires component.`);const scope=String(route.scope||`surface`).trim().toLowerCase();if(scope!==`global`&&scope!==`surface`)throw new Error(`Client route "${id}" from ${packageId} has invalid scope "${scope}".`);const surface=String(route.surface||``).trim().toLowerCase();const baseMeta=isRecord(route.meta)?route.meta:{};const baseMetaJskit=isRecord(baseMeta.jskit)?baseMeta.jskit:{};return Object.freeze({...route,id,path,scope,...surface?{surface}:{},meta:{...baseMeta,jskit:{...baseMetaJskit,packageId,routeId:id,scope}}})}function normalizeRouteList(routes,{packageId}){return Object.freeze((Array.isArray(routes)?routes:[]).map((route,index)=>normalizeRoute(route,{packageId,index:index+1})))}function toVueRouteRecord(route){const nextMeta=isRecord(route.meta)?{...route.meta}:void 0;const routeRecord={path:route.path,component:route.component,...route.name?{name:route.name}:{},...route.props!==void 0?{props:route.props}:{},...route.redirect!==void 0?{redirect:route.redirect}:{},...route.children!==void 0?{children:route.children}:{},...nextMeta?{meta:nextMeta}:{}};return Object.freeze(routeRecord)}function registerClientModuleRoutes({packageId,routes,router,surfaceRuntime,surfaceMode,seenRoutePaths,seenRouteNames,logger,source,packageMetadataRouteDeclarations}){const normalizedPackageId=normalizePackageId(packageId);if(!normalizedPackageId)throw new TypeError(`registerClientModuleRoutes requires packageId.`);const normalizedRoutes=normalizeRouteList(routes,{packageId:normalizedPackageId});assertRoutesDeclaredInPackageMetadata({packageId:normalizedPackageId,source,normalizedRoutes,packageMetadataRouteDeclarations});const activeRoutes=filterRoutesBySurface(normalizedRoutes,{surfaceRuntime,surfaceMode});const log=createStructuredLogger(logger);if(log.isDebugEnabled)log.debug({packageId:normalizedPackageId,source,surfaceMode:String(surfaceMode||``).trim(),declaredRoutes:normalizedRoutes.map(toRouteSnapshot),activeRoutes:activeRoutes.map(toRouteSnapshot)},`Client route registration analysis.`);const declaredPaths=normalizedRoutes.map(route=>route.path);const activePaths=activeRoutes.map(route=>route.path);let registeredCount=0;for(const route of activeRoutes){const normalizedPath=String(route.path||``).trim();if(seenRoutePaths.has(normalizedPath))throw new Error(`Client route path "${normalizedPath}" is duplicated (package ${normalizedPackageId}).`);const normalizedName=String(route.name||``).trim();if(normalizedName){if(seenRouteNames.has(normalizedName))throw new Error(`Client route name "${normalizedName}" is duplicated (package ${normalizedPackageId}).`);seenRouteNames.add(normalizedName)}seenRoutePaths.add(normalizedPath);router.addRoute(toVueRouteRecord(route));if(log.isDebugEnabled)log.debug({packageId:normalizedPackageId,source,route:toRouteSnapshot(route)},`Added client route to router.`);registeredCount+=1}return Object.freeze({packageId:normalizedPackageId,source,declaredCount:normalizedRoutes.length,registeredCount,declaredPaths:Object.freeze(declaredPaths),activePaths:Object.freeze(activePaths)})}function resolvePackageMetadataProviders(moduleNamespace,packageId,packageMetadataClientProviders=[]){const providers=[];const seenProviderIds=new Set;for(const providerDeclaration of packageMetadataClientProviders){const exportName=String(providerDeclaration?.export||``).trim();if(!exportName)continue;const providerValue=moduleNamespace?.[exportName];let provider=null;try{provider=defineProvider(providerValue)}catch(error){throw new TypeError(`Client module ${packageId} packageMetadata provider export "${exportName}" must be a capability provider: ${error.message}`,{cause:error})}const providerId=provider.id;if(seenProviderIds.has(providerId))continue;seenProviderIds.add(providerId);providers.push(provider)}return providers}function resolveModuleProviders(moduleNamespace,packageId,packageMetadataClientProviders=[]){if(!isRecord(moduleNamespace))return[];return resolvePackageMetadataProviders(moduleNamespace,packageId,packageMetadataClientProviders)}function buildPackageMetadataRouteDeclarationIndex({packageId,packageMetadataUiRoutes=[]}={}){const normalizedPackageId=normalizePackageId(packageId);const packageMetadataRoutes=normalizePackageMetadataUiRoutes(packageMetadataUiRoutes);const byId=new Map;for(const packageMetadataRoute of packageMetadataRoutes){const routeId=String(packageMetadataRoute.id||``).trim();const routePath=String(packageMetadataRoute.path||``).trim();const routeScope=String(packageMetadataRoute.scope||`surface`).trim().toLowerCase();if(!routeId||!routePath)continue;if(byId.has(routeId)){const existingRoute=byId.get(routeId);if(existingRoute.path!==routePath||existingRoute.scope!==routeScope)throw new Error(`PackageMetadata ui routes for ${normalizedPackageId} define duplicate id "${routeId}" with conflicting declarations.`);continue}byId.set(routeId,Object.freeze({id:routeId,path:routePath,scope:routeScope}))}return Object.freeze({byId})}function assertRoutesDeclaredInPackageMetadata({packageId,source,normalizedRoutes=[],packageMetadataRouteDeclarations=null}={}){if(String(source||``).trim()!==`clientRoutes`)return;const byId=packageMetadataRouteDeclarations?.byId instanceof Map?packageMetadataRouteDeclarations.byId:new Map;const normalizedPackageId=normalizePackageId(packageId);for(const route of normalizedRoutes){const routeId=String(route?.id||``).trim();const routePath=String(route?.path||``).trim();if(String(route?.scope||`surface`).trim().toLowerCase()!==`global`)continue;const declaredRoute=byId.get(routeId);if(!declaredRoute)throw new Error(`Global client route "${routeId}" from ${normalizedPackageId} (${source}) must be declared in metadata.ui.routes (id "${routeId}", path "${routePath}") with scope:"global" and autoRegister:false.`);if(String(declaredRoute.path||``).trim()!==routePath)throw new Error(`Global client route "${routeId}" from ${normalizedPackageId} (${source}) path "${routePath}" does not match packageMetadata metadata.ui.routes path "${declaredRoute.path}".`);if(String(declaredRoute.scope||``).trim().toLowerCase()!==`global`)throw new Error(`Global client route "${routeId}" from ${normalizedPackageId} (${source}) must be declared with scope:"global" in metadata.ui.routes.`)}}function resolvePackageMetadataClientRoutes({packageId,packageMetadataUiRoutes=[],routeComponents={},logger}={}){const normalizedPackageId=normalizePackageId(packageId);const packageMetadataRoutes=normalizePackageMetadataUiRoutes(packageMetadataUiRoutes);if(packageMetadataRoutes.length<1)return Object.freeze([]);if(!isRecord(routeComponents))throw new TypeError(`Client module ${normalizedPackageId} declares packageMetadata ui routes but does not export a routeComponents map.`);const log=createStructuredLogger(logger);const routes=[];const skippedRoutes=[];for(const packageMetadataRoute of packageMetadataRoutes){const routeId=String(packageMetadataRoute.id||``).trim();const routePath=String(packageMetadataRoute.path||``).trim();if(!(packageMetadataRoute.autoRegister!==false)){skippedRoutes.push(Object.freeze({id:routeId,path:routePath,reason:`autoRegister=false`}));continue}if(!routeId||!routePath)throw new Error(`PackageMetadata ui route from ${normalizedPackageId} requires id and path when autoRegister is enabled.`);const componentKey=String(packageMetadataRoute.componentKey||``).trim();if(!componentKey)throw new Error(`PackageMetadata ui route "${routeId}" from ${normalizedPackageId} requires componentKey when autoRegister is enabled.`);const routeComponent=routeComponents[componentKey];if(!isRouteComponent(routeComponent))throw new Error(`PackageMetadata ui route "${routeId}" from ${normalizedPackageId} references unknown routeComponents key "${componentKey}".`);const scope=String(packageMetadataRoute.scope||`surface`).trim().toLowerCase();const surface=String(packageMetadataRoute.surface||``).trim().toLowerCase();const guard=isRecord(packageMetadataRoute.guard)?{...packageMetadataRoute.guard}:{};const baseMeta=isRecord(packageMetadataRoute.meta)?{...packageMetadataRoute.meta}:{};const baseMetaJskit=isRecord(baseMeta.jskit)?{...baseMeta.jskit}:{};routes.push(Object.freeze({id:routeId,path:routePath,scope,...surface?{surface}:{},...String(packageMetadataRoute.name||``).trim()?{name:String(packageMetadataRoute.name||``).trim()}:{},component:routeComponent,meta:{...baseMeta,...Object.keys(guard).length>0?{guard}:{},jskit:{...baseMetaJskit,packageId:normalizedPackageId,routeId,scope,componentKey,source:`packageMetadata.ui.routes`}}}))}log.debug({packageId:normalizedPackageId,packageMetadataRouteCount:packageMetadataRoutes.length,autoRegisterRouteCount:routes.length,skippedRoutes},`Processed packageMetadata ui routes.`);return Object.freeze(routes)}function normalizeClientModuleEntries(clientModules){if(!Array.isArray(clientModules))return[];return clientModules.map(entry=>{const packageId=normalizePackageId(entry?.packageId);const moduleNamespace=isRecord(entry?.module)?entry.module:null;if(!packageId||!moduleNamespace)return null;return Object.freeze({packageId,module:moduleNamespace,packageMetadataUiRoutes:normalizePackageMetadataUiRoutes(entry?.packageMetadataUiRoutes),packageMetadataClientProviders:normalizePackageMetadataClientProviders(entry?.packageMetadataClientProviders)})}).filter(Boolean).sort((left,right)=>left.packageId.localeCompare(right.packageId))}function createClientRuntime({profile,providers,app,pinia,queryClient,router,env,logger,surfaceRuntime,surfaceMode}){const components=createClientComponentRegistry();const runtime=createCapabilityRuntime({profile,providers,inputs:{"client.vue":app,"client.router":router,"client.pinia":pinia,"client.query":queryClient,"client.env":Object.freeze({...isRecord(env)?env:{}}),"client.surface":surfaceRuntime,"client.surface-mode":String(surfaceMode||``).trim(),"client.logger":logger,"client.components":components}});return Object.freeze({runtime,components})}async function bootClientModules({clientModules,app,pinia,queryClient,router,surfaceRuntime,surfaceMode,env,logger}){const log=createStructuredLogger(logger);const moduleEntries=normalizeClientModuleEntries(clientModules);const providers=[];const seenProviderIds=new Set;log.debug({surfaceMode:String(surfaceMode||``).trim(),normalizedSurfaceMode:String(surfaceRuntime.normalizeSurfaceMode(surfaceMode)||``).trim(),moduleCount:moduleEntries.length,modules:moduleEntries.map(entry=>entry.packageId)},`Starting JSKIT client module bootstrap.`);for(const entry of moduleEntries){const moduleProviders=resolveModuleProviders(entry.module,entry.packageId,entry.packageMetadataClientProviders);log.debug({packageId:entry.packageId,providerExports:moduleProviders.map(provider=>provider.id),hasClientRoutes:Array.isArray(entry.module.clientRoutes)&&entry.module.clientRoutes.length>0},`Discovered client module capabilities.`);for(const provider of moduleProviders){const providerId=provider.id;if(seenProviderIds.has(providerId))throw new Error(`Client provider id "${providerId}" is duplicated.`);seenProviderIds.add(providerId);providers.push(provider)}}const clientRuntime=createClientRuntime({profile:String(surfaceRuntime.normalizeSurfaceMode(surfaceMode)||`client`),providers,app,pinia,queryClient,router,env,logger:log,surfaceRuntime,surfaceMode});await clientRuntime.runtime.start();const seenRoutePaths=new Set;const seenRouteNames=new Set;const routeResults=[];const registerRoutesForEntry=(routeList,packageId,source,packageMetadataRouteDeclarations)=>{if(!routeList||routeList.length===0)return null;const result=registerClientModuleRoutes({packageId,routes:routeList,router,surfaceRuntime,surfaceMode,seenRoutePaths,seenRouteNames,logger:log,source,packageMetadataRouteDeclarations});log.debug({packageId,source,declaredPaths:result.declaredPaths,activePaths:result.activePaths,registeredCount:result.registeredCount},`Registered client module routes.`);if(log.isDebugEnabled)log.debug({packageId,source,routerRoutes:summarizeRouterRoutes(router)},`Router route table after client route registration.`);routeResults.push(result);return result};for(const entry of moduleEntries){const packageMetadataRouteDeclarations=buildPackageMetadataRouteDeclarationIndex({packageId:entry.packageId,packageMetadataUiRoutes:entry.packageMetadataUiRoutes});registerRoutesForEntry(resolvePackageMetadataClientRoutes({packageId:entry.packageId,packageMetadataUiRoutes:entry.packageMetadataUiRoutes,routeComponents:entry.module.routeComponents,logger:log}),entry.packageId,`packageMetadata.ui.routes`,packageMetadataRouteDeclarations);registerRoutesForEntry(Array.isArray(entry.module.clientRoutes)?entry.module.clientRoutes:[],entry.packageId,`clientRoutes`,packageMetadataRouteDeclarations)}const registeredRouteCount=routeResults.reduce((sum,result)=>sum+result.registeredCount,0);if(moduleEntries.length>0){log.debug({modules:moduleEntries.map(entry=>entry.packageId),providerCount:providers.length,routeCount:registeredRouteCount},`Booted JSKIT client modules.`);if(log.isDebugEnabled)log.debug({routerRoutes:summarizeRouterRoutes(router),currentPath:pagePathname$1()},`JSKIT client bootstrap final route table.`)}return Object.freeze({runtime:clientRuntime.runtime,components:clientRuntime.components,modules:Object.freeze(moduleEntries.map(entry=>entry.packageId)),providerCount:providers.length,routeResults:Object.freeze(routeResults),routeCount:registeredRouteCount})}[en_default$12,en_default$8,en_default$14,en_default$6,en_default$5,en_default$4,en_default$3,en_default$2,en_default$9,en_default$1,en_default$7,en_default$10,en_default$11,en_default].forEach(registerJskitMessages);var installedClientModules=Object.freeze([{packageId:`@jskit-ai/assistant-core`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/assistant-runtime`,module:Object.freeze({AssistantClientProvider}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[{"export":`AssistantClientProvider`,"entrypoint":`src/client/providers/AssistantClientProvider.js`}]},{packageId:`@jskit-ai/assistant-voice`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/connectors-web`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/http-runtime`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/http-web`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/material-web`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@jskit-ai/realtime`,module:Object.freeze({RealtimeClientProvider}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[{"export":`RealtimeClientProvider`,"entrypoint":`src/client/RealtimeClientProvider.js`}]},{packageId:`@jskit-ai/shell-web`,module:Object.freeze({ShellWebClientProvider}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[{"export":`ShellWebClientProvider`,"entrypoint":`src/client/providers/ShellWebClientProvider.js`}]},{packageId:`@jskit-ai/uploads-runtime`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/main`,module:client_exports,packageMetadataUiRoutes:[],packageMetadataClientProviders:[{"export":`MainClientProvider`,"entrypoint":`src/client/providers/MainClientProvider.js`}]},{packageId:`@local/vibe64-accounts`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-ai-tasks`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-colleague`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-database-tools`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-pages`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-system-graph`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-usage-recording`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]},{packageId:`@local/vibe64-voice`,module:Object.freeze({}),packageMetadataUiRoutes:[],packageMetadataClientProviders:[]}]);async function bootInstalledClientModules(context={}){return bootClientModules({...context,clientModules:installedClientModules})}var surfaceAccessPolicies={};surfaceAccessPolicies.public={};var config={};config.tenancyMode=`none`;config.realtimeClient={options:{transports:[`websocket`]}};config.surfaceModeAll=`all`;config.surfaceDefaultId=`app`;config.webRootAllowed=`yes`;config.surfaceAccessPolicies=surfaceAccessPolicies;config.mobile={enabled:false,strategy:``,appId:``,appName:``,assetMode:`bundled`,devServerUrl:``,apiBaseUrl:``,auth:{callbackPath:`/auth/login`,customScheme:``,appLinkDomains:[]},android:{packageName:``,minSdk:26,targetSdk:35,versionCode:1,versionName:`1.0.0`}};config.surfaceDefinitions={};config.surfaceDefinitions.app={id:`app`,label:`Sessions`,pagesRoot:`app`,enabled:true,requiresAuth:false,requiresWorkspace:false,accessPolicyId:`public`,origin:``};config.assistantSurfaces={app:{settingsSurfaceId:`app`,configScope:`global`}};var BROWSER_LIFECYCLE_WEBSOCKET_PATH=`/api/studio/browser-lifecycle/ws`;var BROWSER_LIFECYCLE_DISCONNECTED_EVENT=`vibe64:browser-lifecycle-disconnected`;function noopLifecycleConnection(){return{close(){}}}function createBrowserLifecycleDisconnectedEvent(browserWindow,detail={}){const CustomEventCtor=browserWindow?.CustomEvent||globalThis.CustomEvent;if(typeof CustomEventCtor===`function`)return new CustomEventCtor(BROWSER_LIFECYCLE_DISCONNECTED_EVENT,{detail});const EventCtor=browserWindow?.Event||globalThis.Event;if(typeof EventCtor===`function`){const event=new EventCtor(BROWSER_LIFECYCLE_DISCONNECTED_EVENT);event.detail=detail;return event}return{detail,type:BROWSER_LIFECYCLE_DISCONNECTED_EVENT}}function connectBrowserLifecycleSocket({browserWindow=typeof window!==`undefined`?window:null,WebSocketCtor=typeof WebSocket!==`undefined`?WebSocket:null}={}){if(!browserWindow||typeof WebSocketCtor!==`function`)return noopLifecycleConnection();let socket=null;let connected=false;let closeBrowserOnDisconnect=false;let pageUnloading=false;let stopped=false;const markPageUnloading=()=>{pageUnloading=true};const removeUnloadListeners=()=>{browserWindow.removeEventListener(`beforeunload`,markPageUnloading);browserWindow.removeEventListener(`pagehide`,markPageUnloading)};const closeWindowIfServerDisconnected=()=>{removeUnloadListeners();if(connected&&!stopped&&!pageUnloading)browserWindow.dispatchEvent(createBrowserLifecycleDisconnectedEvent(browserWindow,{closeBrowserOnDisconnect}));if(connected&&closeBrowserOnDisconnect&&!stopped&&!pageUnloading)browserWindow.close()};const receiveLifecycleState=event=>{try{const message=JSON.parse(String(event?.data||``));if(message?.type===`browser-lifecycle-state`)closeBrowserOnDisconnect=message.closeBrowserOnDisconnect===true}catch{}};browserWindow.addEventListener(`beforeunload`,markPageUnloading);browserWindow.addEventListener(`pagehide`,markPageUnloading);try{socket=new WebSocketCtor(resolveWebSocketUrl$1(BROWSER_LIFECYCLE_WEBSOCKET_PATH,browserWindow))}catch{removeUnloadListeners();return noopLifecycleConnection()}socket.addEventListener(`open`,()=>{connected=true});socket.addEventListener(`message`,receiveLifecycleState);socket.addEventListener(`close`,closeWindowIfServerDisconnected);return{close(){stopped=true;removeUnloadListeners();socket.close()}}}function bootBrowserLifecycle(options={}){return connectBrowserLifecycleSocket(options)}var APPEARANCE_STORAGE_KEY=`vibe64.appearance`;var APPEARANCE_CHOICES=Object.freeze([`light`,`dark`,`system`]);function readAppearance(){const value=readLocalStorageJson(APPEARANCE_STORAGE_KEY,`system`);return APPEARANCE_CHOICES.includes(value)?value:`system`}function writeAppearance(value){if(APPEARANCE_CHOICES.includes(value))writeLocalStorageJson(APPEARANCE_STORAGE_KEY,value)}configureHttpWebClient({csrf:{enabled:false},resolveRequestUrl(url){return resolveStudioRequestUrl(url)}});bootBrowserLifecycle();var surfaceRuntime=createSurfaceRuntime({allMode:config.surfaceModeAll,surfaces:config.surfaceDefinitions,defaultSurfaceId:config.surfaceDefaultId});var surfaceMode=surfaceRuntime.normalizeSurfaceMode(void 0);var{router,fallbackRoute}=createSurfaceShellRouter({createRouter,history:createWebHistory(),routes,surfaceRuntime,surfaceMode,notFoundComponent:_sfc_main$10,guard:{surfaceDefinitions:config.surfaceDefinitions,defaultSurfaceId:config.surfaceDefaultId,webRootAllowed:config.webRootAllowed}});function menuAndDialogMotion(defaults){if(!hasWindowFunction$1(`matchMedia`)||!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return defaults;return{...defaults,...Object.fromEntries([`VMenu`,`VSelect`,`VAutocomplete`,`VCombobox`,`VDialog`].map(name=>[name,{...defaults?.[name],transition:false}]))}}var materialOptions=createMaterialVuetifyOptions(theme);var vuetify=createVuetify({...materialOptions,defaults:menuAndDialogMotion(materialOptions.defaults),theme:{...materialOptions.theme,defaultTheme:readAppearance()}});var pinia=createPinia();var queryClient=new QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:false,refetchOnReconnect:true,retry:shouldRetryTransientQueryFailure,retryDelay:transientQueryRetryDelay}}});bootstrapClientShellApp({createApp,rootComponent:_sfc_main$11,appConfig:config,appPlugins:[pinia,[VueQueryPlugin,{queryClient}],vuetify],pinia,queryClient,router,bootClientModules:bootInstalledClientModules,surfaceRuntime,surfaceMode,env:{"BASE_URL":`/`,"DEV":false,"MODE":`production`,"PROD":true,"SSR":false},fallbackRoute}).catch(error=>{console.error(`Failed to bootstrap client app.`,error);const status=document.getElementById(`startup-status`);if(status)status.textContent=`Vibe64 could not open. Reload the page to try again.`;const shell=document.getElementById(`startup-shell`);if(shell)shell.dataset.startup=`failed`});export{ENV_DOWNLOAD_ENDPOINT as $,VCheckbox as $a,inject$1 as $c,VTab as $i,vibe64AgentAttachmentPath as $n,VIBE64_LEARNING_MODE_PROJECT_CODE as $o,readRefOrGetterValue as $r,convertToUnit as $s,useModelRouting as $t,mergeConversationLogPages as A,useSelectionMenu as Aa,vModelSelect as Ac,AssistantAttachmentPreview_default as Ai,reactive as Al,AUTO_SAVE_SETTING as An,useDimension as Ao,vibe64SourceEditorExplanationStopPath as Ar,elementSlotTarget as As,useVibe64Terminal as At,accountRowsForStatus as B,VMenu as Ba,createCommentVNode as Bc,AssistantGoalControl_default as Bi,normalizeProps as Bl,sameVibe64AssistantSelection as Bn,formatMessage as Bo,vibe64TemporaryConversationsPath as Br,useProxiedModel as Bs,StudioErrorNotice_default as Bt,useShellWindowSizeClass as C,VAutocomplete as Ca,NavigationFailureType as Cc,VoiceConversationHost_default as Ci,customRef as Cl,assistantRoutingRequestForDisplay as Cn,useBorder as Co,vibe64SessionQueryKey as Cr,VIBE64_COLLEAGUE_INTEGRATIONS_KEY as Cs,projectSelectionQueryKey as Ct,createAssistantApi as D,makeFilterProps as Da,useQueryClient as Dc,VoiceAvatar_default as Di,markRaw as Dl,AFTER_PLAN_MANDATORY_PASSES as Dn,useBackgroundColor as Do,vibe64SourceEditorDownloadPath as Dr,VIBE64_COLLEAGUE_PREVIEW_KEY as Ds,Vibe64CopyCommand_default as Dt,useAssistantConversationFactory as E,useMenuActivator as Ea,useRouter$1 as Ec,useVoiceLauncher as Ei,isRef as El,assistantRoutingStatusLabel as En,useRounded as Eo,vibe64SourceEditorCreateFilePath as Er,VIBE64_COLLEAGUE_PLAN_KEY as Es,ToolInstallRow_default as Et,onVibe64AccountConnectionsDialogRequested as F,makeVTextFieldProps as Fa,Fragment as Fc,useAssistantSuggestions as Fi,toRef as Fl,VIBE64_DEFAULT_AGENT_PROVIDER_ID as Fn,dynamicImportErrorMessage as Fo,vibe64SourceEditorResolvePathPath as Fr,provideTheme as Fs,readLocalStorageJson as Ft,onVibe64AiOnboardingRequested as G,VListSubheader as Ga,createTextVNode as Gc,_sfc_main$99 as Gi,__exportAll as Gl,VIBE64_SESSION_CHANGED_EVENT as Gn,scopedDevelopmentApiUrl as Go,browserSessionStorage as Gr,injectNestedDefaults as Gs,useVibe64Accounts as Gt,aiOnboardingAvailable as H,VList as Ha,createPropsRestProxy as Hc,AssistantPromptInput_default as Hi,toDisplayString as Hl,VIBE64_ARCHIVED_SESSIONS_API_SUFFIX as Hn,revealCurrentStep as Ho,vibe64BrowserTabOriginId as Hr,useRender as Hs,vibe64ApiResponseError as Ht,requestVibe64AccountConnectionsDialog as I,VField as Ia,Teleport as Ic,AssistantConversationElement_default as Ii,toRefs as Il,defaultVibe64AgentSettings as In,isDynamicImportError as Io,vibe64SourceEditorSearchPath as Ir,useTheme as Is,stableLocalStorageKeyPart as It,useVibe64Learning as J,VListItemSubtitle as Ja,defineComponent$1 as Jc,parseLongTextReviewBlocks as Ji,VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT as Jn,validateSchemaPayload as Jo,hasWindowFunction$1 as Jr,propsFactory as Js,repositoryUpdateRelationship as Jt,requestVibe64AiOnboarding as K,VListItem as Ka,createVNode as Kc,LongTextPreviewBlocks_default as Ki,__toCommonJS as Kl,VIBE64_SESSION_SUMMARY_CHANGED_EVENT as Kn,studioApiPath as Ko,dataTransferItemEntry as Kr,provideDefaults as Ks,VIBE64_UPLOAD_MAX_BYTES as Kt,useVibe64AssistantCatalog as L,makeVFieldProps as La,computed as Lc,AssistantModelControl_default as Li,toValue as Ll,findVibe64AgentProvider as Ln,registerJskitMessages as Lo,vibe64SourceEditorStarsPath as Lr,useDisplay as Ls,writeLocalStorageJson as Lt,normalizeConversationLogPagination as M,useFocusRepair as Ma,vShow as Mc,assistantAttachmentFilesFromDropEvent as Mi,ref as Ml,vibe64AssistantSelectionLabel as Mn,VExpandTransition as Mo,vibe64SourceEditorExplanationsStreamPath as Mr,useLayout as Ms,Vibe64Terminal_default as Mt,latestAssistantQuestionsAwaitingUserReply as N,VVirtualScroll as Na,withKeys as Nc,assistantAttachmentFilesFromPasteEvent as Ni,shallowRef as Nl,vibe64ProviderPresentation as Nn,makeTagProps as No,vibe64SourceEditorFilePath as Nr,useLayoutItem as Ns,writeClipboardText as Nt,normalizeConversationTurn as O,useFilter as Oa,Transition as Oc,draftWithRestoredMessage as Oi,onScopeDispose as Ol,AFTER_PLAN_PASS_ORDER as On,useTextColor as Oo,vibe64SourceEditorExplanationFollowupsStreamPath as Or,VIBE64_COLLEAGUE_VIEW_KEY as Os,ProviderAccountsSetup_default as Ot,Vibe64SessionAssistantMenu_default as P,VTextField as Pa,withModifiers as Pc,useAssistantQuestions as Pi,toRaw as Pl,VIBE64_AGENT_PROVIDERS as Pn,ROUTE_VISIBILITY_PUBLIC as Po,vibe64SourceEditorFilesPath as Pr,makeThemeProps as Ps,positiveNumber as Pt,ENGINEERING_ENDPOINT as Q,VChipGroup as Qa,hasInjectionContext as Qc,VTabs as Qi,vibe64AgentAttachmentFilePath as Qn,VIBE64_LEARNING_MODE_NOTE as Qo,writePageClipboardText as Qr,clamp$1 as Qs,ModelRoutingForm_default as Qt,provideVibe64OpenedProjectSlug as R,VCounter as Ra,createBaseVNode as Rc,AssistantQuestionInputs_default as Ri,unref as Rl,normalizeVibe64AgentSettings as Rn,useJskitText as Ro,vibe64SourceEditorTreePath as Rr,useLocale as Rs,Vibe64TerminalSurface_default as Rt,createShellPageActionsRegistry as S,makeVDialogProps as Sa,loadRouteLocation as Sc,useVibe64Voice as Si,withDirectives as Sl,assistantRoutingRequestCanBeReplaced as Sn,makeBorderProps as So,vibe64SessionPromptHintsPath as Sr,VIBE64_COLLEAGUE_DATABASE_KEY as Ss,previewIdentitiesQueryKey as St,useAssistantConversation as T,makeSelectProps as Ta,useRoute$1 as Tc,VoiceConversationControls_default as Ti,getCurrentScope as Tl,assistantRoutingStatusIsPending as Tn,makeRoundedProps as To,vibe64SourceEditorChangesStreamPath as Tr,VIBE64_COLLEAGUE_LAYOUT_KEY as Ts,studioHealthQueryKey as Tt,aiOnboardingBlocked as U,transformItem$1 as Ua,createSlots as Uc,useScrollToBottom as Ui,__commonJSMin as Ul,VIBE64_CURRENT_SESSION_API_SUFFIX as Un,resolveStudioRequestUrl as Uo,vibe64RealtimeOriginPayload as Ur,deepEqual$1 as Us,vibe64RequestAccepted as Ut,AiOnboardingSetUpPill_default as V,VOverlay as Va,createElementBlock as Vc,AssistantComposerSupport_default as Vi,normalizeStyle as Vl,VIBE64_API_SUFFIX as Vn,usePageActivity as Vo,browserTabSessionStorage as Vr,useToggleScope as Vs,vibe64ApiError as Vt,aiOnboardingNeeded as W,useItems as Wa,createStaticVNode as Wc,scrollElementNearBottom as Wi,__esmMin as Wl,VIBE64_SESSIONS_API_SUFFIX as Wn,resolveWebSocketUrl$1 as Wo,vibe64RealtimePayloadFromCurrentTab as Wr,genericComponent as Ws,vibe64ResourceResponseError as Wt,COLLABORATION_ENDPOINT as X,VDivider as Xa,guardReactiveProps as Xc,_plugin_vue_export_helper_default as Xi,agentTurnControlPayloadFromContext as Xn,deepFreeze as Xo,reloadPage as Xr,camelizeProps as Xs,CODEX_RECONNECT_REQUIRED_CODE as Xt,useLocalToolRows as Y,VHighlight as Ya,getCurrentInstance$1 as Yc,AssistantMessageAttachments_default as Yi,VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT as Yn,createSchema as Yo,pageRandomUUID as Yr,callEvent as Ys,isVibe64DebugLoggingEnabled as Yt,DEVELOPMENT_DATABASE_ENDPOINT as Z,VChip as Za,h$1 as Zc,VTextarea as Zi,selectedSessionStorageKey as Zn,STEP_STATUS_LABELS as Zo,videoFrameCallbacksAvailable as Zr,checkPrintable as Zs,CODEX_RECONNECT_REQUIRED_MESSAGE as Zt,resolvePageTitle as _,VCardItem as _a,isRecord as _c,useRealtimeSocket as _i,useModel as _l,assistantGoalObjective as _n,useSsrBoot as _o,vibe64SessionCheckUpdatesPath as _r,LOCAL_ASSISTANT_VIEWER as _s,VIBE64_PROJECT_CREATE_API_SUFFIX as _t,en_default$6 as a,VRadio as aa,isComposingIgnoreKey as ac,resolveRuntimePathname as ai,onBeforeUnmount as al,VIBE64_SESSION_PRESENCE_IDLE_MS as an,VCheckboxBtn as ao,vibe64OutputRunPath as ar,isPracticeProjectSlug as as,PROJECT_SETTINGS_ENDPOINT as at,NO_SHELL_PAGE_ACTIONS_REGISTRY as b,VCardActions as ba,toText as bc,mainConversationTarget as bi,watchEffect as bl,assistantRoutingFromMetadata as bn,makeElevationProps as bo,vibe64SessionPreviewStatePath as br,VIBE64_ASSISTANT_HOST_KEY as bs,engineeringSettingsQueryKey as bt,reconnectSocketIoClient as c,VExpansionPanel as ca,pickWithRest as cc,useWebPlacementRevision as ci,openBlock as cl,normalizedPromptHintSuggestions as cn,VBadge as co,vibe64OutputsQueryKey as cr,currentProjectSlugFromLocation as cs,VIBE64_COLLABORATION_API_SUFFIX as ct,F as d,VSpacer as da,isBoolean as dc,useEndpointResource as di,renderSlot as dl,normalizeVibe64ConversationAttachments as dn,VProgressLinear as do,vibe64RepositoryApiPath as dr,projectListPath as ds,VIBE64_ENGINEERING_API_SUFFIX as dt,VSwitch as ea,ensureValidVNode as ec,useCommand as ei,isMemoSame as el,VIBE64_ACCOUNTS_CHANGED_EVENT as en,VInput as eo,vibe64AgentTerminalControlTextPath as er,VIBE64_LEARNING_ROUTES as es,ENV_ENDPOINT as et,courseProgress as f,VRow as fa,isFunction as fc,_sfc_main$76 as fi,resolveComponent as fl,VIBE64_ASSISTANT_ACCESS_ERROR_CODES as fn,VProgressCircular as fo,vibe64RepositoryHistoryPath as fr,projectSlugFromPathname as fs,VIBE64_ENV_DOWNLOAD_API_SUFFIX as ft,PAGE_TITLE_ID as g,VCardText as ga,__vitePreload as gc,useRealtimeEvent as gi,useId as gl,assistantGoalManagementMessage as gn,useDensity as go,vibe64SessionChangesPath as gr,AppError as gs,VIBE64_PROJECT_CHANGED_EVENT as gt,useShellNavigationRuntime as h,VCard as ha,consoleWarn as hc,VIBE64_TRAINING_LEARNER_CHANGED_EVENT as hi,useAttrs as hl,assistantGoalIsActive as hn,makeDensityProps as ho,vibe64SessionChangeDiffPath as hr,PACKAGES_PAGE as hs,VIBE64_PREVIEW_IDENTITIES_API_SUFFIX as ht,en_default$5 as i,VRadioGroup as ia,humanReadableFileSize as ic,resolveSurfaceIdFromPlacementPathname as ii,onBeforeMount as il,VIBE64_SESSION_PRESENCE_DEBOUNCE_MS as in,useInputIcon as io,vibe64OutputResultPath as ir,withoutLesson as is,PROJECT_SELECTION_ENDPOINT as it,normalizeConversationLogPage as j,useScrolling as ja,vModelText as jc,useAssistantAttachments as ji,readonly as jl,inAfterPlanOrder as jn,VDefaultsProvider as jo,vibe64SourceEditorExplanationsCleanupPath as jr,makeLayoutItemProps as js,useShellAsyncModuleRecoveryRuntime as jt,conversationLogReadQuery as k,useFocusGroups as ka,useCssVars as kc,unmatchedOptimisticMessages as ki,proxyRefs as kl,ASSISTANT_FINISHING_DEFAULTS as kn,makeDimensionProps as ko,vibe64SourceEditorExplanationPath as kr,VIBE64_UNSENT_CHATS_KEY as ks,createWebSocketTerminalDriver as kt,Vibe64LearningMarkdown_default as l,VExpansionPanelTitle as la,wrapInArray as lc,useWebPlacementRuntime as li,provide as ll,conversationAttachmentContentType as ln,VAlert as lo,vibe64PreviewIdentityPath as lr,normalizeProjectRoutePath as ls,VIBE64_CONNECTIONS_CHANGED_EVENT as lt,useShellPageTitle as m,VContainer as ma,isObject$1 as mc,createDefaultErrorPolicy as mi,toHandlers as ml,ASSISTANT_MODES as mn,VBtnToggle as mo,vibe64RepositoryVersionFilesPath as mr,vibe64ProjectScopedStorageKey as ms,VIBE64_ENV_USER_VALUES_API_SUFFIX as mt,writeAppearance as n,VSnackbar as na,filterInputAttrs as nc,usePaths as ni,mergeProps as nl,parseIntegrationSetupRequest as nn,useForm as no,vibe64ConversationLogPath as nr,lessonShownIn as ns,ENV_USER_VALUES_ENDPOINT as nt,NO_ACTIVE_SESSION_NAV as o,VForm as oa,noop$1 as oc,pageViewportWidth as oi,onMounted as ol,normalizedPromptHintDraft as on,forwardRefs as oo,vibe64OutputRunStopPath as or,projectDisplayName as os,PROMPT_HINTS_SETTINGS_ENDPOINT as ot,useVibe64LearningCourses as p,VCol as pa,isNumber as pc,useShellWebErrorRuntime as pi,resolveDynamicComponent as pl,ASSISTANT_FIX_MODE as pn,VIcon as po,vibe64RepositoryVersionDiffPath as pr,projectSlugFromRoute as ps,VIBE64_ENV_SECRET_REVEAL_API_SUFFIX as pt,AiSetup_default as q,VListItemTitle as qa,defineAsyncComponent as qc,LongTextInlineParts_default as qi,__toESM as ql,VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT as qn,getHttpWebClient as qo,followMediaQuery as qr,makeComponentProps as qs,VIBE64_UPLOAD_MAX_LABEL as qt,en_default$3 as r,VSkeletonLoader as ra,getActiveElement as rc,readPlacementSurfaceConfig as ri,nextTick$1 as rl,VIBE64_SESSION_PRESENCE_CHANGED_EVENT as rn,useFocus as ro,vibe64ConversationLogQueryKey as rr,reviewRunNote as rs,PREVIEW_IDENTITIES_ENDPOINT as rt,VIBE64_ACTIVE_SESSION_NAV_KEY as s,VExpansionPanels as sa,omit as sc,useWebPlacementContext as si,onUnmounted as sl,normalizedPromptHintSuggestion as sn,VAvatar as so,vibe64OutputsPath as sr,projectSubtitle as ss,STUDIO_HEALTH_ENDPOINT as st,readAppearance as t,VTooltip as ta,escapeForRegex as tc,useUiFeedback as ti,mergeModels as tl,VIBE64_CONNECTIONS_CHANGED_EVENT$1 as tn,makeVInputProps as to,vibe64AgentTerminalPath as tr,checkNote as ts,ENV_SECRET_REVEAL_ENDPOINT as tt,GithubMarkdown_default as u,VExpansionPanelText as ua,IN_BROWSER as uc,createPlacementRegistry as ui,renderList as ul,conversationAttachmentReference as un,VBtn as uo,vibe64ProjectSetupQueryKey as ur,projectAppPath as us,VIBE64_DEVELOPMENT_DATABASE_API_SUFFIX as ut,SHELL_PAGE_ACTIONS_ID as v,VCardTitle as va,normalizeObject as vc,createProjectVoiceBinding as vi,useSlots as vl,assistantModeLabel as vn,makeLocationProps as vo,vibe64SessionEventMatchesScope as vr,NO_UNSENT_CHATS as vs,VIBE64_PROJECT_SELECT_API_SUFFIX as vt,resolveWindowSizeClass as w,VSelect as wa,isNavigationFailure as wc,VoiceConversationSettings_default as wi,effectScope as wl,assistantRoutingRequestIsUnresolved as wn,VImg as wo,vibe64SessionsQueryKey as wr,VIBE64_COLLEAGUE_LAUNCHER_KEY as ws,projectSettingsQueryKey as wt,SHELL_PAGE_ACTIONS_REGISTRY_KEY as x,VDialog as xa,RouterView as xc,temporaryConversationId as xi,withCtx as xl,assistantRoutingOutcomeNotice as xn,useElevation as xo,vibe64SessionPromptHintsCancelPath as xr,VIBE64_ASSISTANT_VIEWER_KEY as xs,envQueryKey as xt,SHELL_PAGE_ACTIONS_TARGET_KEY as y,VCardSubtitle as ya,normalizeText$1 as yc,mainConversationId as yi,watch as yl,assistantRoutingAutomation as yn,useLocation as yo,vibe64SessionPath as yr,VIBE64_AI_TASK_TRAY_KEY as ys,VIBE64_PROMPT_HINTS_SETTINGS_API_SUFFIX as yt,useVibe64ProjectSlug as z,VSheet as za,createBlock as zc,AssistantAttachmentQueue_default as zi,normalizeClass as zl,vibe64AgentExecutionProfileAuditSnapshot as zn,catalogMessage as zo,vibe64TemporaryConversationPath as zr,useRtl as zs,terminalLastMeaningfulLine as zt};
|