vibe64 0.1.78 → 0.1.80
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/bin/run.js +1523 -1512
- package/bin/server.js +100 -98
- package/bin/upgrade-state.js +3288 -3277
- package/dist/assets/{GithubBrowserTabs-B2r19V0U.js → GithubBrowserTabs-d5SRhPw-.js} +1 -1
- package/dist/assets/GithubBrowserTabs-d5SRhPw-.js.br +0 -0
- package/dist/assets/GithubBrowserTabs-d5SRhPw-.js.gz +0 -0
- package/dist/assets/{LocalDatabaseServer-Ck9nZrGW.js → LocalDatabaseServer-CIAX_Xx8.js} +1 -1
- package/dist/assets/LocalDatabaseServer-CIAX_Xx8.js.br +0 -0
- package/dist/assets/LocalDatabaseServer-CIAX_Xx8.js.gz +0 -0
- package/dist/assets/{Vibe64DashboardPageHeader-C4iTKeE0.js → Vibe64DashboardPageHeader-CyYFBVSw.js} +1 -1
- package/dist/assets/Vibe64DashboardPageHeader-CyYFBVSw.js.br +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-CyYFBVSw.js.gz +0 -0
- package/dist/assets/{Vibe64DatabaseWorkspace-ChA-2QPU.js → Vibe64DatabaseWorkspace-Dep64whC.js} +1 -1
- package/dist/assets/Vibe64DatabaseWorkspace-Dep64whC.js.br +0 -0
- package/dist/assets/{Vibe64DatabaseWorkspace-ChA-2QPU.js.gz → Vibe64DatabaseWorkspace-Dep64whC.js.gz} +0 -0
- package/dist/assets/{Vibe64FileArea-DBEJsJSq.js → Vibe64FileArea-r9PP5pT7.js} +1 -1
- package/dist/assets/Vibe64FileArea-r9PP5pT7.js.br +0 -0
- package/dist/assets/Vibe64FileArea-r9PP5pT7.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-B6wjUtLL.js +8 -0
- package/dist/assets/Vibe64OutputControls-B6wjUtLL.js.br +0 -0
- package/dist/assets/Vibe64OutputControls-B6wjUtLL.js.gz +0 -0
- package/dist/assets/{Vibe64OutputControls-aQCEvUL2.css → Vibe64OutputControls-gSUdkqME.css} +1 -1
- package/dist/assets/Vibe64OutputControls-gSUdkqME.css.br +0 -0
- package/dist/assets/Vibe64OutputControls-gSUdkqME.css.gz +0 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-sT07hHPs.js → Vibe64RepositoryWorkspace-C_ez14Jz.js} +1 -1
- package/dist/assets/Vibe64RepositoryWorkspace-C_ez14Jz.js.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-C_ez14Jz.js.gz +0 -0
- package/dist/assets/{Vibe64SessionFiles-Djef01EV.js → Vibe64SessionFiles-CJPrBsND.js} +1 -1
- package/dist/assets/Vibe64SessionFiles-CJPrBsND.js.br +0 -0
- package/dist/assets/Vibe64SessionFiles-CJPrBsND.js.gz +0 -0
- package/dist/assets/{Vibe64SessionSourceEditor-CIGBLYYN.js → Vibe64SessionSourceEditor-CwE0Y-ka.js} +1 -1
- package/dist/assets/Vibe64SessionSourceEditor-CwE0Y-ka.js.br +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-CwE0Y-ka.js.gz +0 -0
- package/dist/assets/{Vibe64UiStoryboardView-CjkWoB8b.js → Vibe64UiStoryboardView-COViVA_8.js} +1 -1
- package/dist/assets/Vibe64UiStoryboardView-COViVA_8.js.br +0 -0
- package/dist/assets/Vibe64UiStoryboardView-COViVA_8.js.gz +0 -0
- package/dist/assets/{_pageId_-BTjeqgTN.js → _pageId_-DuE37c72.js} +1 -1
- package/dist/assets/{_sessionId_-C7Jh2bL4.js → _sessionId_-T6qoKZhb.js} +1 -1
- package/dist/assets/_sessionId_-T6qoKZhb.js.br +0 -0
- package/dist/assets/_sessionId_-T6qoKZhb.js.gz +0 -0
- package/dist/assets/{_sessionTool_-DITdXCS4.js → _sessionTool_-B-b_DFay.js} +1 -1
- package/dist/assets/{access-DIaPNdxr.js → access-Dx-76I4I.js} +1 -1
- package/dist/assets/access-Dx-76I4I.js.br +0 -0
- package/dist/assets/access-Dx-76I4I.js.gz +0 -0
- package/dist/assets/{app-mELSmS67.js → app-BM5ppUKY.js} +1 -1
- package/dist/assets/app-BM5ppUKY.js.br +0 -0
- package/dist/assets/app-BM5ppUKY.js.gz +0 -0
- package/dist/assets/{changes-DlxKdjdP.js → changes-CI15aJ2s.js} +1 -1
- package/dist/assets/{client-CL02nP02.js → client-CtgiCplj.js} +2 -2
- package/dist/assets/client-CtgiCplj.js.br +0 -0
- package/dist/assets/client-CtgiCplj.js.gz +0 -0
- package/dist/assets/{client-CLpGzGwX.js → client-wU-vn9Gt.js} +2 -2
- package/dist/assets/client-wU-vn9Gt.js.br +0 -0
- package/dist/assets/client-wU-vn9Gt.js.gz +0 -0
- package/dist/assets/{dashboard-km-kuDid.js → dashboard-DD-Kz8sQ.js} +1 -1
- package/dist/assets/{english-definitions-CMICWgdF.js → english-definitions-B-puV4oO.js} +1 -1
- package/dist/assets/english-definitions-B-puV4oO.js.br +0 -0
- package/dist/assets/english-definitions-B-puV4oO.js.gz +0 -0
- package/dist/assets/{env-DjkxkxdX.js → env-CsRMp84w.js} +1 -1
- package/dist/assets/env-CsRMp84w.js.br +0 -0
- package/dist/assets/env-CsRMp84w.js.gz +0 -0
- package/dist/assets/{error-C7q1-2bC.js → error-CL5AgVRX.js} +1 -1
- package/dist/assets/error-CL5AgVRX.js.br +0 -0
- package/dist/assets/error-CL5AgVRX.js.gz +0 -0
- package/dist/assets/{fileTypes-Dbn0qwKS.js → fileTypes-CFECKFVN.js} +1 -1
- package/dist/assets/fileTypes-CFECKFVN.js.br +0 -0
- package/dist/assets/fileTypes-CFECKFVN.js.gz +0 -0
- package/dist/assets/{health-BwJ6Z251.js → health-4aQl5EcU.js} +1 -1
- package/dist/assets/health-4aQl5EcU.js.br +0 -0
- package/dist/assets/health-4aQl5EcU.js.gz +0 -0
- package/dist/assets/{history-D2TywQVv.js → history-B5Sor4EE.js} +1 -1
- package/dist/assets/history-B5Sor4EE.js.br +0 -0
- package/dist/assets/history-B5Sor4EE.js.gz +0 -0
- package/dist/assets/{index-D14nUmm7.js → index-BAvE8_Ib.js} +5 -5
- package/dist/assets/index-BAvE8_Ib.js.br +0 -0
- package/dist/assets/index-BAvE8_Ib.js.gz +0 -0
- package/dist/assets/{integrations-BZFXW2Cp.js → integrations-DksSxQbj.js} +96 -10
- package/dist/assets/integrations-DksSxQbj.js.br +0 -0
- package/dist/assets/integrations-DksSxQbj.js.gz +0 -0
- package/dist/assets/{issues-CLvbBTek.js → issues-DK2L8AHT.js} +1 -1
- package/dist/assets/issues-DK2L8AHT.js.br +0 -0
- package/dist/assets/issues-DK2L8AHT.js.gz +0 -0
- package/dist/assets/{learning-DwytxEXC.js → learning-DeuGeINY.js} +1 -1
- package/dist/assets/{packages-BeiF8W7l.js → packages-Du3QFyu-.js} +1 -1
- package/dist/assets/packages-Du3QFyu-.js.br +0 -0
- package/dist/assets/packages-Du3QFyu-.js.gz +0 -0
- package/dist/assets/{pages-BIRQk4b8.js → pages-CBvnECLI.js} +1 -1
- package/dist/assets/{pages-BnAyUdL4.js → pages-D3MpRYy4.js} +1 -1
- package/dist/assets/pages-D3MpRYy4.js.br +0 -0
- package/dist/assets/pages-D3MpRYy4.js.gz +0 -0
- package/dist/assets/{project-GnljGud1.js → project-BFylqlOt.js} +13 -13
- package/dist/assets/project-BFylqlOt.js.br +0 -0
- package/dist/assets/project-BFylqlOt.js.gz +0 -0
- package/dist/assets/project-BZ-FhyDR.css +1 -0
- package/dist/assets/project-BZ-FhyDR.css.br +0 -0
- package/dist/assets/project-BZ-FhyDR.css.gz +0 -0
- package/dist/assets/{project-files-e4-Q65vT.js → project-files-CHgBwX2E.js} +1 -1
- package/dist/assets/project-files-CHgBwX2E.js.br +0 -0
- package/dist/assets/project-files-CHgBwX2E.js.gz +0 -0
- package/dist/assets/{project-shared-ShellOutlet-DKYDipmC.js → project-shared-ShellOutlet-CIoqgO35.js} +1 -1
- package/dist/assets/project-shared-ShellOutlet-CIoqgO35.js.br +0 -0
- package/dist/assets/project-shared-ShellOutlet-CIoqgO35.js.gz +0 -0
- package/dist/assets/{project-shared-VBottomSheet-BSE28ENQ.js → project-shared-VBottomSheet-Bezz1r7A.js} +1 -1
- package/dist/assets/project-shared-VBottomSheet-Bezz1r7A.js.br +0 -0
- package/dist/assets/project-shared-VBottomSheet-Bezz1r7A.js.gz +0 -0
- package/dist/assets/{project-shared-VToolbar-CrezJP9z.js → project-shared-VToolbar-DmXu_VIt.js} +1 -1
- package/dist/assets/project-shared-VToolbar-DmXu_VIt.js.br +0 -0
- package/dist/assets/project-shared-VToolbar-DmXu_VIt.js.gz +0 -0
- package/dist/assets/{project-shared-pageNames-6Jz0BfbS.js → project-shared-pageNames-BiomB55Q.js} +1 -1
- package/dist/assets/project-shared-pageNames-BiomB55Q.js.br +0 -0
- package/dist/assets/project-shared-pageNames-BiomB55Q.js.gz +0 -0
- package/dist/assets/{pull-requests-DH9gWw10.js → pull-requests-CPBGulVu.js} +1 -1
- package/dist/assets/pull-requests-CPBGulVu.js.br +0 -0
- package/dist/assets/pull-requests-CPBGulVu.js.gz +0 -0
- package/dist/assets/{repository-BNltUuvb.js → repository-CWDpx49H.js} +1 -1
- package/dist/assets/{session-Ck9aH4Yl.js → session-D2z1O4Y4.js} +1 -1
- package/dist/assets/session-D2z1O4Y4.js.br +0 -0
- package/dist/assets/session-D2z1O4Y4.js.gz +0 -0
- package/dist/assets/{settings-D8Ofbk56.js → settings-BZRdBSb9.js} +1 -1
- package/dist/assets/settings-BZRdBSb9.js.br +0 -0
- package/dist/assets/settings-BZRdBSb9.js.gz +0 -0
- package/dist/assets/{useArchivedVibe64Sessions-LIZjeLbd.js → useArchivedVibe64Sessions-C3jJk531.js} +1 -1
- package/dist/assets/useArchivedVibe64Sessions-C3jJk531.js.br +0 -0
- package/dist/assets/useArchivedVibe64Sessions-C3jJk531.js.gz +0 -0
- package/dist/assets/{vibe64AttachmentDownload-1_XfvfYp.js → vibe64AttachmentDownload-DcLsJc9X.js} +1 -1
- package/dist/assets/{vibe64SavedEnvValues-Bs7r4xWE.js → vibe64SavedEnvValues-hAfcxHhJ.js} +1 -1
- package/dist/assets/{vue-flow-core-iwGljzru.js → vue-flow-core-BwhpINSc.js} +1 -1
- package/dist/assets/vue-flow-core-BwhpINSc.js.br +0 -0
- package/dist/assets/vue-flow-core-BwhpINSc.js.gz +0 -0
- package/dist/index.html +2 -2
- package/docs/colleague-usage/ai-accounts.md +4 -4
- package/docs/colleague-usage/ai-tasks.md +3 -2
- package/docs/colleague-usage/auto-workflow.md +99 -43
- package/docs/colleague-usage/chat-settings.md +46 -44
- package/docs/colleague-usage/coding-agents.md +8 -5
- package/docs/colleague-usage/connected-projects.md +196 -48
- package/docs/colleague-usage/connected-repositories.md +50 -6
- package/docs/colleague-usage/development-env.md +2 -2
- package/docs/colleague-usage/github-work.md +3 -3
- package/docs/colleague-usage/main-chat-approvals.md +2 -2
- package/docs/colleague-usage/passes.md +177 -156
- package/docs/colleague-usage/plans.md +121 -38
- package/docs/colleague-usage/preview-starting-application.md +6 -0
- package/docs/colleague-usage/preview-stop-and-restart.md +51 -0
- package/docs/colleague-usage/preview.md +10 -37
- package/docs/colleague-usage/ui-pass.md +32 -22
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- 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/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +5 -0
- package/node_modules/@jskit-ai/payments-core/README.md +72 -8
- package/node_modules/@jskit-ai/payments-core/contracts/configuration.schema.json +56 -1
- package/node_modules/@jskit-ai/payments-core/contracts/conformance.json +484 -0
- package/node_modules/@jskit-ai/payments-core/locales/en.json +17 -5
- package/node_modules/@jskit-ai/payments-core/package.json +2 -1
- package/node_modules/@local/vibe64-execution/package.json +1 -0
- package/node_modules/@local/vibe64-genesis/README.md +12 -0
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +96 -96
- package/node_modules/@local/vibe64-genesis/package.json +2 -1
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +182 -174
- package/node_modules/@local/vibe64-genesis/src/server/index.js +573 -569
- package/node_modules/@local/vibe64-project/package.json +1 -0
- package/node_modules/@local/vibe64-terminals/package.json +1 -0
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +900 -890
- package/node_modules/chokidar/LICENSE +21 -0
- package/node_modules/chokidar/README.md +305 -0
- package/node_modules/chokidar/package.json +14 -0
- package/node_modules/readdirp/LICENSE +21 -0
- package/node_modules/readdirp/README.md +122 -0
- package/node_modules/readdirp/package.json +9 -0
- package/package.json +11 -7
- package/server.bundle.mjs +46995 -45449
- package/dist/assets/GithubBrowserTabs-B2r19V0U.js.br +0 -0
- package/dist/assets/GithubBrowserTabs-B2r19V0U.js.gz +0 -0
- package/dist/assets/LocalDatabaseServer-Ck9nZrGW.js.br +0 -0
- package/dist/assets/LocalDatabaseServer-Ck9nZrGW.js.gz +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-C4iTKeE0.js.br +0 -0
- package/dist/assets/Vibe64DashboardPageHeader-C4iTKeE0.js.gz +0 -0
- package/dist/assets/Vibe64DatabaseWorkspace-ChA-2QPU.js.br +0 -0
- package/dist/assets/Vibe64FileArea-DBEJsJSq.js.br +0 -0
- package/dist/assets/Vibe64FileArea-DBEJsJSq.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-DpFdKIO2.js +0 -8
- package/dist/assets/Vibe64OutputControls-DpFdKIO2.js.br +0 -0
- package/dist/assets/Vibe64OutputControls-DpFdKIO2.js.gz +0 -0
- package/dist/assets/Vibe64OutputControls-aQCEvUL2.css.br +0 -0
- package/dist/assets/Vibe64OutputControls-aQCEvUL2.css.gz +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-sT07hHPs.js.br +0 -0
- package/dist/assets/Vibe64RepositoryWorkspace-sT07hHPs.js.gz +0 -0
- package/dist/assets/Vibe64SessionFiles-Djef01EV.js.br +0 -0
- package/dist/assets/Vibe64SessionFiles-Djef01EV.js.gz +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-CIGBLYYN.js.br +0 -0
- package/dist/assets/Vibe64SessionSourceEditor-CIGBLYYN.js.gz +0 -0
- package/dist/assets/Vibe64UiStoryboardView-CjkWoB8b.js.br +0 -0
- package/dist/assets/Vibe64UiStoryboardView-CjkWoB8b.js.gz +0 -0
- package/dist/assets/_sessionId_-C7Jh2bL4.js.br +0 -0
- package/dist/assets/_sessionId_-C7Jh2bL4.js.gz +0 -0
- package/dist/assets/access-DIaPNdxr.js.br +0 -0
- package/dist/assets/access-DIaPNdxr.js.gz +0 -0
- package/dist/assets/app-mELSmS67.js.br +0 -0
- package/dist/assets/app-mELSmS67.js.gz +0 -0
- package/dist/assets/client-CL02nP02.js.br +0 -0
- package/dist/assets/client-CL02nP02.js.gz +0 -0
- package/dist/assets/client-CLpGzGwX.js.br +0 -0
- package/dist/assets/client-CLpGzGwX.js.gz +0 -0
- package/dist/assets/english-definitions-CMICWgdF.js.br +0 -0
- package/dist/assets/english-definitions-CMICWgdF.js.gz +0 -0
- package/dist/assets/env-DjkxkxdX.js.br +0 -0
- package/dist/assets/env-DjkxkxdX.js.gz +0 -0
- package/dist/assets/error-C7q1-2bC.js.br +0 -0
- package/dist/assets/error-C7q1-2bC.js.gz +0 -0
- package/dist/assets/fileTypes-Dbn0qwKS.js.br +0 -0
- package/dist/assets/fileTypes-Dbn0qwKS.js.gz +0 -0
- package/dist/assets/health-BwJ6Z251.js.br +0 -0
- package/dist/assets/health-BwJ6Z251.js.gz +0 -0
- package/dist/assets/history-D2TywQVv.js.br +0 -0
- package/dist/assets/history-D2TywQVv.js.gz +0 -0
- package/dist/assets/index-D14nUmm7.js.br +0 -0
- package/dist/assets/index-D14nUmm7.js.gz +0 -0
- package/dist/assets/integrations-BZFXW2Cp.js.br +0 -0
- package/dist/assets/integrations-BZFXW2Cp.js.gz +0 -0
- package/dist/assets/issues-CLvbBTek.js.br +0 -0
- package/dist/assets/issues-CLvbBTek.js.gz +0 -0
- package/dist/assets/packages-BeiF8W7l.js.br +0 -0
- package/dist/assets/packages-BeiF8W7l.js.gz +0 -0
- package/dist/assets/pages-BnAyUdL4.js.br +0 -3
- package/dist/assets/pages-BnAyUdL4.js.gz +0 -0
- package/dist/assets/project-GnljGud1.js.br +0 -0
- package/dist/assets/project-GnljGud1.js.gz +0 -0
- package/dist/assets/project-W_VltXAt.css +0 -1
- package/dist/assets/project-W_VltXAt.css.br +0 -0
- package/dist/assets/project-W_VltXAt.css.gz +0 -0
- package/dist/assets/project-files-e4-Q65vT.js.br +0 -0
- package/dist/assets/project-files-e4-Q65vT.js.gz +0 -0
- package/dist/assets/project-shared-ShellOutlet-DKYDipmC.js.br +0 -0
- package/dist/assets/project-shared-ShellOutlet-DKYDipmC.js.gz +0 -0
- package/dist/assets/project-shared-VBottomSheet-BSE28ENQ.js.br +0 -0
- package/dist/assets/project-shared-VBottomSheet-BSE28ENQ.js.gz +0 -0
- package/dist/assets/project-shared-VToolbar-CrezJP9z.js.br +0 -0
- package/dist/assets/project-shared-VToolbar-CrezJP9z.js.gz +0 -0
- package/dist/assets/project-shared-pageNames-6Jz0BfbS.js.br +0 -0
- package/dist/assets/project-shared-pageNames-6Jz0BfbS.js.gz +0 -0
- package/dist/assets/pull-requests-DH9gWw10.js.br +0 -0
- package/dist/assets/pull-requests-DH9gWw10.js.gz +0 -0
- package/dist/assets/session-Ck9aH4Yl.js.br +0 -0
- package/dist/assets/session-Ck9aH4Yl.js.gz +0 -0
- package/dist/assets/settings-D8Ofbk56.js.br +0 -0
- package/dist/assets/settings-D8Ofbk56.js.gz +0 -0
- package/dist/assets/useArchivedVibe64Sessions-LIZjeLbd.js.br +0 -0
- package/dist/assets/useArchivedVibe64Sessions-LIZjeLbd.js.gz +0 -0
- package/dist/assets/vue-flow-core-iwGljzru.js.br +0 -0
- package/dist/assets/vue-flow-core-iwGljzru.js.gz +0 -0
package/dist/assets/{Vibe64UiStoryboardView-CjkWoB8b.js → Vibe64UiStoryboardView-COViVA_8.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as VToolbarTitle,t as VToolbar}from"./project-shared-VToolbar-CrezJP9z.js";import{c as VBottomSheet,i as USAGE_RECORDING_API_SUFFIX,r as Vibe64UsageRecordDialog_default,t as Vibe64UsageRecordingSummary_default}from"./project-shared-VBottomSheet-BSE28ENQ.js";import{Ac as vModelSelect,Ba as VMenu,Bc as createCommentVNode,Dl as markRaw,Ec as useRouter,El as isRef,Fc as Fragment,Fl as toRef,Ga as VListSubheader,Gc as createTextVNode,Ha as VList,Hl as toDisplayString,Ja as VListItemSubtitle,Ka as VListItem,Kc as createVNode,Lc as computed,Mc as vShow,Ml as ref,Na as VVirtualScroll,Nc as withKeys,Nl as shallowRef,Pa as VTextField,Pc as withModifiers,Pl as toRaw,Qa as VChipGroup,Rc as createBaseVNode,Rl as unref,Sl as withDirectives,Tc as useRoute,Uc as createSlots,Vc as createElementBlock,Vl as normalizeStyle,Xa as VDivider,Xi as _plugin_vue_export_helper_default,Za as VChip,_a as VCardItem,al as onBeforeUnmount,cl as openBlock,dl as renderSlot,do as VProgressLinear,ea as VSwitch,fi as _sfc_main$12,fl as resolveComponent,ga as VCardText,gl as useId,ha as VCard,jc as vModelText,kc as useCssVars,lo as VAlert,ml as toHandlers,mo as VBtnToggle,ni as usePaths,nl as mergeProps,po as VIcon,qa as VListItemTitle,qo as getHttpWebClient,ra as VSkeletonLoader,rl as nextTick,ul as renderList,uo as VBtn,va as VCardTitle,xa as VDialog,xl as withCtx,ya as VCardSubtitle,yl as watch,zc as createBlock,zl as normalizeClass}from"./index-D14nUmm7.js";import{a as _sfc_main$d,i as _sfc_main$1$1,n as Position,s as _sfc_main$f,t as MarkerType}from"./vue-flow-core-iwGljzru.js";import{n as SYSTEM_GRAPH_API_SUFFIX,r as useVibe64SystemGraph}from"./client-CLpGzGwX.js";function layeredGraph(nodes=[],edges=[]){const byId=new Map(nodes.map(node=>[node.id,node]));const outgoing=new Map([...byId.keys()].map(id=>[id,new Set]));const incoming=new Map([...byId.keys()].map(id=>[id,new Set]));const validEdges=edges.filter(edge=>byId.has(edge.fromId)&&byId.has(edge.toId)&&edge.fromId!==edge.toId);for(const edge of validEdges){outgoing.get(edge.fromId).add(edge.toId);incoming.get(edge.toId).add(edge.fromId)}const visited=new Set;const finish=[];for(const id of[...byId.keys()].sort()){if(visited.has(id))continue;const stack=[[id,false]];while(stack.length){const[current,complete]=stack.pop();if(complete){finish.push(current);continue}if(visited.has(current))continue;visited.add(current);stack.push([current,true]);for(const target of outgoing.get(current))if(!visited.has(target))stack.push([target,false])}}const groupById=new Map;const groups=[];for(const id of finish.reverse()){if(groupById.has(id))continue;const members=[];const stack=[id];const group={id:``,members,dependencies:new Set,consumers:new Set,rank:0};while(stack.length){const current=stack.pop();if(groupById.has(current))continue;groupById.set(current,group);members.push(current);for(const source of incoming.get(current))if(!groupById.has(source))stack.push(source)}members.sort();group.id=JSON.stringify(members);group.cyclic=members.length>1;groups.push(group)}for(const edge of validEdges){const source=groupById.get(edge.fromId);const target=groupById.get(edge.toId);if(source===target)continue;source.dependencies.add(target);target.consumers.add(source)}const remaining=new Map(groups.map(group=>[group,group.dependencies.size]));const queue=groups.filter(group=>!group.dependencies.size);for(let index=0;index<queue.length;index++){const group=queue[index];for(const consumer of group.consumers){consumer.rank=Math.max(consumer.rank,group.rank+1);remaining.set(consumer,remaining.get(consumer)-1);if(!remaining.get(consumer))queue.push(consumer)}}const rows=new Map;for(const group of groups){if(!rows.has(group.rank))rows.set(group.rank,[]);rows.get(group.rank).push(group)}return{layers:[...rows].sort(([a],[b])=>b-a).map(([rank,row])=>({rank,groups:row.sort((a,b)=>a.id.localeCompare(b.id)).map(group=>({id:group.id,rank,cyclic:group.cyclic,members:group.members.map(id=>byId.get(id))}))})),edges:validEdges,disconnectedIds:new Set([...byId.keys()].filter(id=>!outgoing.get(id).size&&!incoming.get(id).size)),nodeRanks:new Map([...groupById].map(([id,group])=>[id,group.rank])),cyclicIds:new Set([...groupById].filter(([,group])=>group.cyclic).map(([id])=>id))}}function architectureGraph(architecture,subsystemId=``,{includeTypeOnly=false}={}){const files=architecture?.files||[];const subsystems=architecture?.subsystems||[];const packages=architecture?.packages||[];const relations=(architecture?.relations||[]).filter(relation=>(includeTypeOnly||!(relation.typeOnly||relation.kind===`type-import`))&&relation.resolution===`resolved`&&(relation.targetFileId||relation.targetPackageId));const usedPackages=new Set(relations.map(relation=>relation.targetPackageId));const boundaries=packages.map(entry=>({...entry,title:entry.name,kind:`package`,path:entry.root,fileIds:[],provenance:`package`}));const filesById=new Map([...files,...boundaries].map(file=>[file.id,file]));const sourceFileIds=new Set(files.map(file=>file.id));const fileEdges=relations.map(relation=>({fromId:relation.fromFileId,toId:relation.targetFileId||relation.targetPackageId,evidence:[relation]}));const concrete=layeredGraph(files,fileEdges.filter(edge=>sourceFileIds.has(edge.toId)));const externalCycleFileIds=new Set;if(subsystemId){for(const row of concrete.layers)for(const component of row.groups)if(component.cyclic&&component.members.some(file=>file.subsystemId===subsystemId)&&component.members.some(file=>file.subsystemId!==subsystemId)){for(const file of component.members)if(file.subsystemId===subsystemId)externalCycleFileIds.add(file.id)}}const localPackageIds=new Set(relations.filter(relation=>filesById.get(relation.fromFileId)?.subsystemId===subsystemId&&!relation.targetFileId).map(relation=>relation.targetPackageId));const nodes=subsystemId?[...files.filter(file=>file.subsystemId===subsystemId),...boundaries.filter(entry=>localPackageIds.has(entry.id))]:subsystems.filter(entry=>!entry.opaque||usedPackages.has(entry.packageId));const aggregated=new Map;const boundary=[];for(const edge of fileEdges){const from=filesById.get(edge.fromId);const to=filesById.get(edge.toId);if(!from||!to)continue;if(subsystemId){if(from.subsystemId===subsystemId&&(to.subsystemId===subsystemId||localPackageIds.has(to.id))){const key=JSON.stringify([edge.fromId,edge.toId]);if(!aggregated.has(key))aggregated.set(key,{...edge,evidence:[]});aggregated.get(key).evidence.push(...edge.evidence)}else if(from.subsystemId===subsystemId||to.subsystemId===subsystemId)boundary.push({...edge,from,to})}else if(from.subsystemId!==to.subsystemId){const key=`${from.subsystemId}->${to.subsystemId}`;if(!aggregated.has(key))aggregated.set(key,{fromId:from.subsystemId,toId:to.subsystemId,evidence:[]});aggregated.get(key).evidence.push(...edge.evidence)}}const graph=layeredGraph(nodes,[...aggregated.values()]);const groupByOwner=new Map(graph.layers.flatMap(layer=>layer.groups.flatMap(group=>group.members.map(member=>[member.id,group.id]))));const concreteCycleGroups=new Set;if(!subsystemId)for(const row of concrete.layers)for(const component of row.groups){if(!component.cyclic)continue;const owners=new Set(component.members.map(file=>file.subsystemId));const groups=new Set([...owners].map(id=>groupByOwner.get(id)));if(owners.size>1&&groups.size===1)concreteCycleGroups.add(groups.values().next().value)}for(const layer of graph.layers)for(const group of layer.groups)group.cycleLabel=group.cyclic&&!subsystemId&&!concreteCycleGroups.has(group.id)?`Bidirectional subsystem coupling`:`Dependency cycle`;return{...graph,boundary,externalCycleFileIds}}var externalDependenciesId=`visual:external-dependencies`;function pageConnections(ui,pageId){const parents=new Set([pageId]);const children=new Map;for(const use of ui?.componentUses||[]){if(!children.has(use.parentId))children.set(use.parentId,[]);children.get(use.parentId).push(use)}const pending=[pageId];while(pending.length)for(const use of children.get(pending.pop())||[])for(const id of[use.id,use.componentId]){if(!id||parents.has(id))continue;parents.add(id);pending.push(id)}return(ui?.connections||[]).filter(connection=>parents.has(connection.parentId))}function pageHierarchy(ui){const pages=ui?.pages||[];const registrations=ui?.registrations||[];const rows=[];const children=new Map;for(const page of pages){const parent=page.parentId||null;if(!children.has(parent))children.set(parent,[]);children.get(parent).push(page)}for(const list of children.values())list.sort((a,b)=>b.title.localeCompare(a.title));const stack=(children.get(null)||[]).map(page=>({page,depth:0}));while(stack.length){const{page,depth}=stack.pop();rows.push({...page,depth,registrations:registrations.filter(entry=>entry.pageId===page.id)});stack.push(...(children.get(page.id)||[]).map(child=>({page:child,depth:depth+1})))}return rows}function pageStoryboard(ui){const rows=pageHierarchy(ui);const children=new Map;const widths=new Map;const heights=new Map;const depthHeights=new Map;const cardWidth=264;const siblingGap=36;for(const page of rows){if(!children.has(page.parentId||null))children.set(page.parentId||null,[]);children.get(page.parentId||null).push(page);const identities=[...new Set(page.registrations.map(entry=>entry.identity))];const height=Math.max(120,64+Math.ceil(page.title.length/24)*26+identities.reduce((total,identity)=>total+Math.ceil(identity.length/32)*20,0));heights.set(page.id,height);depthHeights.set(page.depth,Math.max(depthHeights.get(page.depth)||0,height))}for(const page of[...rows].reverse()){const descendants=children.get(page.id)||[];widths.set(page.id,Math.max(cardWidth,descendants.reduce((total,child)=>total+widths.get(child.id),0)+Math.max(0,descendants.length-1)*siblingGap))}const depthTops=new Map;let y=0;for(const[depth,height]of[...depthHeights].sort((a,b)=>a[0]-b[0])){depthTops.set(depth,y);y+=height+84}const left=new Map;let rootLeft=0;for(const root of children.get(null)||[]){left.set(root.id,rootLeft);rootLeft+=widths.get(root.id)+100}return{nodes:rows.map(page=>{let childLeft=left.get(page.id);for(const child of children.get(page.id)||[]){left.set(child.id,childLeft);childLeft+=widths.get(child.id)+siblingGap}return{id:page.id,type:`page`,position:{x:left.get(page.id)+(widths.get(page.id)-cardWidth)/2,y:depthTops.get(page.depth)},style:{width:`${cardWidth}px`,height:`${heights.get(page.id)}px`},data:{...page,identities:[...new Set(page.registrations.map(entry=>entry.identity))],childCount:(children.get(page.id)||[]).length}}}),edges:rows.filter(page=>page.parentId).map(page=>({id:`parent:${page.id}`,source:page.parentId,target:page.id,sourceHandle:`children`,targetHandle:`parent`,type:`smoothstep`,selectable:false,style:{stroke:`rgb(var(--v-theme-outline))`,strokeWidth:2}}))}}function engineOverview(architecture,order=[]){const orderIndex=new Map(order.map((id,index)=>[id,index]));const graph=architectureGraph(architecture);const externalPackages=graph.layers.flatMap(layer=>layer.groups.flatMap(group=>group.members)).filter(owner=>owner.opaque).sort((a,b)=>a.title.localeCompare(b.title));const applicationLayers=graph.layers.map(layer=>({...layer,groups:layer.groups.map(group=>({...group,members:group.members.filter(owner=>!owner.opaque)})).filter(group=>group.members.length)}));const files=new Map((architecture?.files||[]).map(file=>[file.id,file]));const placements=new Map((architecture?.layout?.groups||[]).flatMap((group,index)=>group.subsystems.map((member,memberIndex)=>[member.root,{...member,kind:group.kind,groupId:group.id,order:index,memberOrder:memberIndex}])));const entryOwners=new Set((architecture?.entryPoints||[]).filter(entry=>entry.resolution===`resolved`).map(entry=>entry.subsystemId));const cards=new Map;const totals=applicationLayers.flatMap(layer=>layer.groups.flatMap(group=>group.members)).map(subsystem=>(subsystem.fileIds||[]).map(id=>files.get(id)?.sourceLines).filter(Number.isSafeInteger).reduce((sum,lines)=>sum+Math.max(0,lines),0));const largest=Math.max(1,...totals);for(const layer of applicationLayers)for(const group of layer.groups)for(const subsystem of group.members){const sourceFiles=(subsystem.fileIds||[]).map(id=>files.get(id)).filter(Boolean);const measured=sourceFiles.filter(file=>Number.isSafeInteger(file.sourceLines)&&file.sourceLines>=0);const sourceLines=measured.length?measured.reduce((total,file)=>total+file.sourceLines,0):null;const volume=Math.log1p((sourceLines||0)/100)/Math.log1p(largest/100);const placement=placements.get(subsystem.root);const width=260+160*volume;const height=width;const publicEntries=(architecture?.packages||[]).filter(pkg=>pkg.subsystemId===subsystem.id).flatMap(pkg=>pkg.entryPoints||[]);const receivingFiles=new Set((architecture?.relations||[]).filter(relation=>relation.resolution===`resolved`&&files.get(relation.targetFileId)?.subsystemId===subsystem.id&&files.get(relation.fromFileId)?.subsystemId!==subsystem.id).map(relation=>relation.targetFileId));const publicCount=new Set(publicEntries.flatMap(entry=>(entry.symbols||[]).map(symbol=>`${symbol.sourceFile||entry.file}:${symbol.qualifiedName||symbol.name}:${symbol.start?.line||``}`))).size;const publicSummary=publicCount?`${publicCount} public declaration${publicCount===1?``:`s`}`:publicEntries.length?`Public declarations need analysis`:receivingFiles.size?`Exported signatures to review`:`Public interface not recorded`;cards.set(subsystem.id,{id:subsystem.id,type:`subsystem`,style:{width:`${width}px`,height:`${height}px`},data:{...subsystem,...placement?{placementKind:placement.kind}:{},publicSummary,library:placement?.kind===`libraries`,presentationOrder:placement?.order??Infinity,memberOrder:placement?.memberOrder??Infinity,sourceLines,sizePartial:measured.length!==sourceFiles.length,measuredFiles:measured.length,sourceVolume:(sourceLines||0)/largest,entryFiles:(architecture?.entryPoints||[]).filter(entry=>entry.subsystemId===subsystem.id).map(entry=>entry.file),cycleLabel:group.cyclic?group.cycleLabel:``,disconnected:graph.disconnectedIds.has(subsystem.id),rank:layer.rank}})}const sourceCards=[...cards.values()].sort((a,b)=>(orderIndex.get(a.id)??Infinity)-(orderIndex.get(b.id)??Infinity)||Number(!entryOwners.has(a.id))-Number(!entryOwners.has(b.id))||Number(a.data.placementKind===`support`)-Number(b.data.placementKind===`support`)||a.data.presentationOrder-b.data.presentationOrder||a.data.memberOrder-b.data.memberOrder||(a.data.root||a.id).localeCompare(b.data.root||b.id));const libraryCards=sourceCards.filter(card=>card.data.library);const applicationCards=sourceCards.filter(card=>!card.data.library);const columns=Math.min(6,Math.max(1,Math.ceil(Math.sqrt(applicationCards.length))));const cellSize=Math.max(280,...applicationCards.map(card=>parseFloat(card.style.width)));const gap=56;const applicationWidth=applicationCards.length?columns*cellSize+(columns-1)*gap:0;const rowCount=Math.ceil(applicationCards.length/columns);const applicationHeight=rowCount?rowCount*cellSize+(rowCount-1)*gap:0;const decorations=[];const nodes=[];for(const[index,card]of applicationCards.entries()){const inset=(cellSize-parseFloat(card.style.width))/2;card.position={x:index%columns*(cellSize+gap)+inset,y:Math.floor(index/columns)*(cellSize+gap)+inset};card.data.arrangeable=true;card.data.initialFocus=index<columns;card.draggable=true;card.dragHandle=`.engine-subsystem__grip`;nodes.push(card)}let width=applicationWidth;let height=Math.max(200,applicationHeight);if(libraryCards.length){const columnX=applicationWidth+48;const columnWidth=Math.max(...libraryCards.map(card=>parseFloat(card.style.width)));decorations.push({id:`visual:shared-libraries`,type:`annotation`,position:{x:columnX,y:0},style:{width:`${columnWidth}px`,height:`76px`},selectable:false,focusable:false,draggable:false,data:{kind:`libraries`,title:`Shared libraries`,detail:`Project-owned reusable interfaces`}});let libraryY=88;for(const card of libraryCards){card.position={x:columnX+(columnWidth-parseFloat(card.style.width))/2,y:libraryY};card.data.library=true;card.draggable=false;nodes.push(card);libraryY+=parseFloat(card.style.height)+24}width=columnX+columnWidth;height=Math.max(height,libraryY-24)}if(externalPackages.length){const columnWidth=Math.min(640,Math.max(420,...externalPackages.map(pkg=>pkg.title.length*9+48)));const charactersPerLine=Math.floor((columnWidth-48)/9);const columnHeight=112+externalPackages.reduce((total,pkg)=>total+15+22*Math.ceil(pkg.title.length/charactersPerLine),0);nodes.push({id:externalDependenciesId,type:`external-dependencies`,position:{x:width+48,y:0},style:{width:`${columnWidth}px`,height:`${columnHeight}px`},draggable:false,data:{id:externalDependenciesId,kind:`external-dependencies`,title:`External dependencies`,root:``,opaque:true,fileIds:[],entryFiles:[],sourceLines:null,packages:externalPackages,description:`Available throughout the project. Select a dependency to read its public interface.`}});width+=48+columnWidth;height=Math.max(height,columnHeight)}return{nodes,edges:[],decorations,width,height,applicationWidth,applicationHeight,externalCount:externalPackages.length}}function symbolSource(path,symbol){return{path,symbolId:symbol.id,symbol:symbol.qualifiedName||symbol.name,line:symbol.start?.line}}function subsystemOutline(architecture,subsystemId){const nativeOwner=(architecture?.subsystems||[]).find(subsystem=>subsystem.id===subsystemId);if(!nativeOwner)return null;const placementGroup=(architecture?.layout?.groups||[]).find(group=>group.subsystems.some(member=>member.root===nativeOwner.root));const owner=placementGroup?.subsystems.find(member=>member.root===nativeOwner.root)?{...nativeOwner,placementKind:placementGroup.kind}:nativeOwner;const files=new Map((architecture?.files||[]).map(file=>[file.id,file]));const local=owner.opaque?[]:[...files.values()].filter(file=>file.subsystemId===owner.id);const localIds=new Set(local.map(file=>file.id));const byPath=new Map(local.map(file=>[file.path,file]));const sourceFilesByPath=new Map([...files.values()].map(file=>[file.path,file]));const symbolsByFile=new Map;for(const symbol of architecture?.symbols||[])if(symbol.visibility===`public`){if(!symbolsByFile.has(symbol.fileId))symbolsByFile.set(symbol.fileId,[]);symbolsByFile.get(symbol.fileId).push(symbol)}const entries=new Map;const addEntry=(file,reason)=>{if(!file||!localIds.has(file.id))return;if(!entries.has(file.id))entries.set(file.id,{file,reasons:new Set,consumers:new Map});entries.get(file.id).reasons.add(reason);return entries.get(file.id)};for(const entry of architecture?.entryPoints||[])if(entry.resolution===`resolved`&&entry.subsystemId===owner.id)addEntry(files.get(entry.fileId)||byPath.get(entry.file),`Application entry`);const publicEntries=(architecture?.packages||[]).filter(pkg=>pkg.subsystemId===owner.id).flatMap(pkg=>(pkg.entryPoints||[]).map(entry=>{const file=byPath.get(entry.file);addEntry(file,`Declared public import`);return{...entry,file,symbols:(entry.symbols||[]).map(symbol=>{const sourceFile=symbol.sourceFile?files.get(`file:${symbol.sourceFile}`)||sourceFilesByPath.get(symbol.sourceFile):file;const candidates=(symbolsByFile.get(sourceFile?.id)||[]).filter(candidate=>!owner.opaque&&(!symbol.sourceHash||symbol.sourceHash===sourceFile.hash)&&(candidate.qualifiedName||candidate.name)===(symbol.sourceQualifiedName||symbol.sourceName||symbol.qualifiedName||symbol.name)&&(!symbol.start||candidate.start?.line===symbol.start.line&&candidate.start?.column===symbol.start.column));const source=candidates.length===1?candidates[0]:null;return{...symbol,...source?{source:symbolSource(sourceFile.path,source)}:{}}}),conditions:entry.conditions||[],importPath:entry.importPath===`.`?pkg.name:`${pkg.name}${entry.importPath?.startsWith(`./`)?entry.importPath.slice(1):`/`+(entry.importPath||``)}`}}));const packages=new Map((architecture?.packages||[]).map(pkg=>[pkg.id,pkg]));const symbolsById=new Map((architecture?.symbols||[]).map(symbol=>[symbol.id,symbol]));const observed=new Map;const fileLinks=new Map;const importsByFile=new Map;const importsBySymbol=new Map;const exposedFiles=new Set(publicEntries.flatMap(entry=>entry.symbols.map(symbol=>sourceFilesByPath.get(symbol.source?.path)?.id)).filter(Boolean));for(const relation of architecture?.relations||[]){if(relation.resolution!==`resolved`)continue;const from=files.get(relation.fromFileId);const to=files.get(relation.targetFileId)||packages.get(relation.targetPackageId);if(!from||!to)continue;if(localIds.has(to.id)||exposedFiles.has(to.id)){if(!importsByFile.has(to.id))importsByFile.set(to.id,new Map);importsByFile.get(to.id).set(from.id,from);for(const id of relation.importedSymbolIds||[]){const symbol=symbolsById.get(id);if(!symbol||symbol.fileId!==to.id||symbol.visibility!==`public`)continue;if(!importsBySymbol.has(id))importsBySymbol.set(id,new Map);importsBySymbol.get(id).set(from.id,from)}}if(localIds.has(to.id)&&!localIds.has(from.id)){addEntry(to,`Used by other subsystems`).consumers.set(from.id,from);for(const id of relation.importedSymbolIds||[]){const symbol=symbolsById.get(id);if(!symbol||symbol.fileId!==to.id||symbol.visibility!==`public`)continue;if(!observed.has(id))observed.set(id,{...symbol,consumers:new Map,source:symbolSource(to.path,symbol)});observed.get(id).consumers.set(from.id,from)}}if(relation.typeOnly||relation.kind===`type-import`)continue;if(from.id!==to.id&&localIds.has(from.id)&&(localIds.has(to.id)||!relation.targetFileId)){const key=JSON.stringify([from.id,to.id]);fileLinks.set(key,{fromId:from.id,toId:to.id,from:from.path,to:to.path||to.name})}}const pages=architecture?.ui?.pages||[];let callsByPage;const operations=(architecture?.ui?.connections||[]).filter(connection=>connection.resolution===`resolved`&&localIds.has(connection.controllerFileId)).map(connection=>{const file=files.get(connection.controllerFileId);addEntry(file,`Receives UI calls`);callsByPage||=new Map(pages.map(page=>[page.id,new Set(pageConnections(architecture.ui,page.id).map(call=>call.id))]));return{...connection,file,pages:pages.filter(page=>callsByPage.get(page.id).has(connection.id))}});const entryFiles=[...entries.values()].map(entry=>({...entry,reasons:[...entry.reasons],consumers:[...entry.consumers.values()],symbols:symbolsByFile.get(entry.file.id)||[]})).sort((a,b)=>a.file.path.localeCompare(b.file.path));const programs=(architecture?.program?.modules||[]).filter(module=>module.subsystemId===owner.id);const programsByFile=new Map;for(const module of architecture?.program?.modules||[])for(const source of module.sources){if(!programsByFile.has(source))programsByFile.set(source,[]);programsByFile.get(source).push(module)}const largest=Math.max(1,...local.map(file=>Number.isSafeInteger(file.sourceLines)?file.sourceLines:0));const root={children:[]};const directories=new Map([[``,root]]);for(const file of local){const prefix=owner.root&&owner.root!==`.`?owner.root+`/`:``;const relativePath=prefix&&file.path.startsWith(prefix)?file.path.slice(prefix.length):file.path;const segments=relativePath.split(`/`);let directory=root;let path=``;for(const name of segments.slice(0,-1)){path=path?path+`/`+name:name;if(!directories.has(path)){const folder={kind:`directory`,name,path,children:[],count:0};directories.set(path,folder);directory.children.push(folder)}directory=directories.get(path);directory.count++}directory.children.push({kind:`file`,id:file.id,name:segments.at(-1),file,relativePath,reasons:entries.has(file.id)?[...entries.get(file.id).reasons]:[],programs:programsByFile.get(file.path)||[],publicCount:symbolsByFile.get(file.id)?.length||0,volume:Number.isSafeInteger(file.sourceLines)?Math.max(0,file.sourceLines)/largest:null})}for(const directory of directories.values())directory.children.sort((a,b)=>(a.kind===b.kind?0:a.kind===`file`?-1:1)||a.name.localeCompare(b.name));const publicSymbols=new Map;const declaredSymbolIds=new Set;for(const entry of publicEntries)for(const symbol of entry.symbols){const key=`${symbol.source?.symbolId||entry.importPath}:${symbol.qualifiedName||symbol.name}:${symbol.start?.line||``}`;if(symbol.source?.symbolId)declaredSymbolIds.add(symbol.source.symbolId);if(!publicSymbols.has(key))publicSymbols.set(key,{...symbol,importPaths:[]});const exposed=publicSymbols.get(key);if(!exposed.importPaths.includes(entry.importPath))exposed.importPaths.push(entry.importPath)}const boundarySymbols=entryFiles.filter(entry=>entry.consumers.length).flatMap(entry=>entry.symbols.filter(symbol=>!declaredSymbolIds.has(symbol.id)&&!observed.has(symbol.id)).map(symbol=>({...symbol,consumers:entry.consumers,source:symbolSource(entry.file.path,symbol)})));const observedSymbols=[...observed.values()].map(symbol=>({...symbol,declared:declaredSymbolIds.has(symbol.id),consumers:[...symbol.consumers.values()]}));const candidates=new Set(boundarySymbols.map(symbol=>symbol.id));const availableSymbols=local.flatMap(file=>(symbolsByFile.get(file.id)||[]).filter(symbol=>!declaredSymbolIds.has(symbol.id)&&!observed.has(symbol.id)&&!candidates.has(symbol.id)).map(symbol=>({...symbol,source:symbolSource(file.path,symbol)})));for(const symbol of[...publicSymbols.values(),...observedSymbols,...boundarySymbols,...availableSymbols]){if(!symbol.source)continue;const exact=[...importsBySymbol.get(symbol.source.symbolId)?.values()||[]];const sourceFile=sourceFilesByPath.get(symbol.source.path);symbol.consumers=(exact.length?exact:[...importsByFile.get(sourceFile?.id)?.values()||[]]).sort((a,b)=>a.path.localeCompare(b.path));symbol.consumerEvidence=exact.length?`declaration`:`file`}return{owner,tree:root.children,files:local,programs,programStatus:architecture?.program?.status||`unavailable`,programDiagnostics:architecture?.program?.diagnostics||[],entryFiles,publicEntries,publicSymbols:[...publicSymbols.values()],observedSymbols,boundarySymbols,availableSymbols,operations,fileLinks:[...fileLinks.values()],dependencyCoverage:architecture?.ui?.capabilities?.imports||architecture?.capabilities?.dependencies||`unconfigured`,exportCount:local.reduce((count,file)=>count+(symbolsByFile.get(file.id)?.length||0),0)}}function architectureOverview(architecture,expandedSubsystemId=``,order=[]){const ui=pageStoryboard(architecture?.ui);const engine=engineOverview(architecture,order);const uiWidth=Math.max(400,...ui.nodes.map(node=>node.position.x+parseFloat(node.style.width)));const uiHeight=Math.max(200,...ui.nodes.map(node=>node.position.y+parseFloat(node.style.height)));const width=Math.max(uiWidth,engine.width);const uiLeft=(width-uiWidth)/2;const engineLeft=(width-engine.width)/2;const engineTop=ui.nodes.length?uiHeight+112:0;const uiParents=ui.nodes.filter(node=>node.data.childCount);const uiFocus=uiParents.length?uiParents:ui.nodes.slice(0,3);const uiHeadingLeft=uiLeft+(uiFocus[0]?.position.x||0);const shift=(node,x,y)=>({...node,position:{x:node.position.x+x,y:node.position.y+y+48}});const annotations=[...ui.nodes.length?[{id:`visual:ui-heading`,type:`annotation`,position:{x:uiHeadingLeft,y:0},style:{width:`640px`,height:`36px`},data:{kind:`heading`,title:`UI`,detail:`Pages / screens / scenes · parents above children · siblings on the same row`}}]:[],...engine.nodes.length?[{id:`visual:engine-heading`,type:`annotation`,position:{x:engineLeft,y:engineTop},style:{width:`640px`,height:`36px`},data:{kind:`heading`,title:`Engine`,detail:`Directory subsystems · interfaces and responsibilities`}}]:[],...ui.nodes.length?[{id:`visual:divider`,type:`annotation`,position:{x:0,y:uiHeight+84},style:{width:`${width}px`,height:`1px`},data:{kind:`divider`}}]:[],...engine.decorations.map(node=>shift(node,engineLeft,engineTop))].map(node=>({...node,selectable:false,focusable:false,draggable:false,zIndex:-1}));const files=new Map((architecture?.files||[]).map(file=>[file.id,file]));const owners=new Map(engine.nodes.map(node=>[node.id,node]));const bridges=[];for(const page of ui.nodes){const connections=pageConnections(architecture?.ui,page.id);page.data.unresolvedCalls=0;page.data.callCount=0;for(const connection of connections){const file=files.get(connection.controllerFileId);const owner=owners.get(file?.subsystemId);if(connection.resolution!==`resolved`||!file||!owner){page.data.unresolvedCalls++;continue}const receivers=owner.data.receivers||=[];if(!receivers.some(receiver=>receiver.id===file.id))receivers.push({id:file.id,path:file.path});const key=connection.key||{};const operation=[key.protocol,key.method,key.operation].filter(Boolean).join(` · `);bridges.push({id:`call:${page.id}:${connection.id}`,source:page.id,target:owner.id,sourceHandle:`engine-out`,targetHandle:`controller:${file.id}`,type:`controller`,selectable:true,zIndex:2,markerEnd:{type:`arrowclosed`,color:`rgb(var(--v-theme-tertiary))`,width:18,height:18},style:{stroke:`rgb(var(--v-theme-tertiary))`,strokeWidth:2},data:{connection,controllerFile:file.path,operation,label:`${file.path.split(`/`).pop()} · ${operation}`}});page.data.callCount++}}const engineNodes=engine.nodes.map(node=>shift(node,engineLeft,engineTop));for(const node of engineNodes){node.data.expanded=node.id===expandedSubsystemId;if(node.data.arrangeable)node.extent=[[engineLeft,engineTop+48],[engineLeft+engine.applicationWidth,engineTop+48+engine.applicationHeight]]}return{nodes:[...annotations,...ui.nodes.map(node=>shift(node,uiLeft,0)),...engineNodes],edges:[...ui.edges,...engine.edges,...bridges],uiIds:ui.nodes.map(node=>node.id),engineIds:engine.nodes.map(node=>node.id),externalCount:engine.externalCount,initialIds:[...uiFocus.map(node=>node.id),...engine.nodes.filter(node=>node.data.initialFocus||engine.nodes.length===1).map(node=>node.id),...annotations.filter(node=>node.data.kind===`heading`).map(node=>node.id)]}}function readingWidth(canvasWidth){return Math.min(960,Math.max(280,canvasWidth-48))}function easedViewport(current,destination,elapsed){const amount=1-Math.exp(-Math.min(50,elapsed)/45);const next={x:current.x+(destination.x-current.x)*amount,y:current.y+(destination.y-current.y)*amount,zoom:current.zoom+(destination.zoom-current.zoom)*amount};return{next,complete:Math.abs(next.zoom-destination.zoom)<.001&&Math.abs(next.x-destination.x)<.3&&Math.abs(next.y-destination.y)<.3}}function adaptViewport(viewport,width,oldWidth){return viewport&&{...viewport,x:viewport.x+(width-oldWidth)/2+(readingWidth(oldWidth)-readingWidth(width))*viewport.zoom/2}}function touchDistance(touches){return Math.hypot(touches[0].clientX-touches[1].clientX,touches[0].clientY-touches[1].clientY)}function arrangedMapNodes(nodes,positions){const arranged=nodes.map(node=>({...node,class:node.class||``,position:{...node.position}}));for(const node of arranged)if(node.data.arrangeable&&positions[node.id]){const[minimum,maximum]=node.extent;node.position={x:Math.max(minimum[0],Math.min(maximum[0]-parseFloat(node.style.width),positions[node.id].x)),y:Math.max(minimum[1],Math.min(maximum[1]-parseFloat(node.style.height),positions[node.id].y))}}return arranged}function readingNodes(arranged,outline,owner){return[...arranged.map(node=>({...node,class:`architecture-map-node--hidden`})),{id:`visual:subsystem-detail`,type:`subsystem-detail`,position:{x:0,y:0},draggable:false,style:{width:`clamp(280px, calc(100cqw - 48px), 960px)`},data:{outline,owner}}]}function controllerPath(edge){const{sourceX,sourceY,targetX,targetY}=edge;return`M ${sourceX},${sourceY} L ${targetX},${targetY}`}function ignoreArrival(){}function useVibe64ArchitectureCanvas({props,architecture,usageState,canvas}){const expandedSubsystemId=ref(``);const outline=shallowRef(null);const retainedOutline=shallowRef(null);const focusOwner=computed(()=>{const native=architecture.value?.subsystems?.find(owner=>owner.id===expandedSubsystemId.value);return native?{...native,...overview.value.nodes.find(node=>node.id===native.id)?.data||{}}:null});watch([expandedSubsystemId,architecture],async([id],previous,onCleanup)=>{outline.value=null;if(!id)return;let cancelled=false;onCleanup(()=>{cancelled=true});await nextTick();await new Promise(requestAnimationFrame);await new Promise(requestAnimationFrame);if(!cancelled){const detail=subsystemOutline(toRaw(architecture.value),id);outline.value=detail?markRaw(detail):null}},{flush:`sync`});const layoutPositions=ref({});const fileRequest=ref(null);const retainedFileRequest=shallowRef(null);const viewHistory=shallowRef([]);const programId=ref(``);const retainedProgramId=ref(``);const currentProgram=computed(()=>architecture.value?.program?.modules?.find(program=>program.id===programId.value));const retainedProgram=computed(()=>architecture.value?.program?.modules?.find(program=>program.id===retainedProgramId.value));const parentProgram=computed(()=>architecture.value?.program?.modules?.find(program=>program.id===viewHistory.value.findLast(entry=>entry.programId)?.programId));let dragging=false;let lastDragEnded=0;let zoomAnchor;let zoomTarget;let parentViewport;let parentNode;let fileParentViewport;let transitioning=false;let gestureTarget;let gestureTimer;let gestureDirection;let zoomMotion;let zoomFrame;let zoomTime;let navigationVersion=0;let pinchDistance;let pinchTarget;function finishGesture(){if(zoomMotion||transitioning){gestureTimer=setTimeout(finishGesture,80);return}gestureTarget=void 0;zoomTarget=void 0;zoomAnchor=void 0}function stopZoomMotion(){cancelAnimationFrame(zoomFrame);zoomFrame=void 0;zoomMotion=void 0}function moveCamera(viewport,{semantic=false,done=ignoreArrival}){zoomMotion={viewport,semantic,done};if(!zoomFrame){zoomTime=void 0;zoomFrame=requestAnimationFrame(animateZoom)}}function animateZoom(time){if(!zoomMotion||!flow||!props.active){stopZoomMotion();return}const motion=zoomMotion;const destination=motion.viewport;const current=flow.getViewport();const{next,complete}=easedViewport(current,destination,time-(zoomTime||time-16));zoomTime=time;flow.setViewport(complete?destination:next,{duration:0});if(motion.semantic)viewportChanged(complete?destination:next);if(zoomMotion!==motion)return;if(complete){zoomFrame=void 0;zoomMotion=void 0;motion.done()}else zoomFrame=requestAnimationFrame(animateZoom)}async function readingViewport(origin){const version=++navigationVersion;stopZoomMotion();if(gestureTarget)gestureTarget.consumed=true;transitioning=true;canvas.value?.focus({preventScroll:true});if(origin&&flow&&canvas.value){const width=readingWidth(canvas.value.clientWidth);const zoom=Math.min(1,origin.width/width);flow.setViewport({x:origin.x+origin.width/2-width*zoom/2,y:origin.y+origin.height/2-160*zoom,zoom},{duration:0})}await nextTick();await new Promise(requestAnimationFrame);if(version!==navigationVersion||!flow||!canvas.value)return;const node=unref(flow?.getNodes)?.find(node=>node.type===`subsystem-detail`);const width=node?.dimensions.width||readingWidth(canvas.value.clientWidth);const height=Math.min(node?.dimensions.height||canvas.value.clientHeight-48,canvas.value.clientHeight-48);const destination={x:(canvas.value.clientWidth-width)/2,y:24,zoom:1};if(origin){const zoom=Math.min(1,origin.width/width);await flow.setViewport({x:origin.x+origin.width/2-width*zoom/2,y:origin.y+origin.height/2-height*zoom/2,zoom},{duration:0})}moveCamera(destination,{done:()=>{transitioning=false}})}async function closeDetail(event){const external=outline.value?.owner.opaque;const currentViewport=flow?.getViewport();const detailWidth=unref(flow?.getNodes)?.find(node=>node.type===`subsystem-detail`)?.dimensions.width||readingWidth(canvas.value.clientWidth);const detailHeight=unref(flow?.getNodes)?.find(node=>node.type===`subsystem-detail`)?.dimensions.height||canvas.value.clientHeight;const outAnchor=zoomAnchor||{x:canvas.value.clientWidth/2,y:canvas.value.clientHeight/2};stopZoomMotion();++navigationVersion;if(event?.type===`click`||event?.type===`keydown`)gestureTarget=void 0;else if(gestureTarget)gestureTarget.consumed=true;transitioning=true;expandedSubsystemId.value=``;fileRequest.value=null;retainedFileRequest.value=null;retainedOutline.value=null;programId.value=``;retainedProgramId.value=``;viewHistory.value=[];zoomTarget=void 0;await nextTick();if(!external&&parentViewport&&parentNode&¤tViewport){const zoom=Math.min(3,detailWidth*currentViewport.zoom/parseFloat(parentNode.style.width));const centreX=currentViewport.x+detailWidth*currentViewport.zoom/2;const centreY=currentViewport.y+Math.min(detailHeight,canvas.value.clientHeight)*currentViewport.zoom/2;const matched={zoom,x:centreX-(parentNode.position.x+parseFloat(parentNode.style.width)/2)*zoom,y:centreY-(parentNode.position.y+parseFloat(parentNode.style.height)/2)*zoom};await flow?.setViewport(matched,{duration:0});moveCamera({zoom:parentViewport.zoom,x:outAnchor.x-(outAnchor.x-matched.x)/zoom*parentViewport.zoom,y:outAnchor.y-(outAnchor.y-matched.y)/zoom*parentViewport.zoom},{done:()=>{transitioning=false}});return}transitioning=false}function rememberView(){viewHistory.value=[...viewHistory.value,{request:fileRequest.value&&{...fileRequest.value},programId:programId.value,ownerId:expandedSubsystemId.value,parentNode,parentViewport,fileParentViewport,viewport:{...flow.getViewport()}}]}async function openProgram(id){const program=architecture.value?.program?.modules?.find(program=>program.id===id);if(!program||programId.value===id)return;rememberView();const ownerNode=nodes.value.find(node=>node.id===program.subsystemId);if(ownerNode&&program.subsystemId!==expandedSubsystemId.value){parentNode={position:{...ownerNode.position},style:{...ownerNode.style}};expandedSubsystemId.value=program.subsystemId}programId.value=id;retainedProgramId.value=id;fileRequest.value=null;await readingViewport()}async function openFile(request){const program=architecture.value?.program?.modules?.find(program=>program.path===request.path);if(program)return openProgram(program.id);if(request.path===`genesis/subsystems.md`||request.path.startsWith(`genesis/program/`))return;if(fileRequest.value?.path===request.path&&!request.symbolId&&!request.symbol&&!request.presentation)return;rememberView();programId.value=``;const file=architecture.value?.files?.find(file=>file.path===request.path);const ownerNode=nodes.value.find(node=>node.id===file?.subsystemId);if(ownerNode&&file.subsystemId!==expandedSubsystemId.value){parentNode={position:{...ownerNode.position},style:{...ownerNode.style}};expandedSubsystemId.value=file.subsystemId}fileParentViewport=gestureDirection===true&&zoomTarget?.kind===`file`?gestureTarget.viewport:{...zoomMotion&&!zoomMotion.semantic?zoomMotion.viewport:flow.getViewport()};fileRequest.value={path:request.path,symbolId:request.symbolId,symbol:request.symbol,line:request.line,presentation:request.presentation||`interface`,symbolPresentation:request.symbolPresentation};retainedFileRequest.value=fileRequest.value;zoomTarget=void 0;await readingViewport()}function updateFileLocation(location){if(!fileRequest.value||location.path!==fileRequest.value.path)return;if([`symbolId`,`presentation`,`symbolPresentation`].every(key=>fileRequest.value[key]===location[key]))return;fileRequest.value={...fileRequest.value,...location};retainedFileRequest.value=fileRequest.value}async function previousView(event){const previous=viewHistory.value.at(-1);if(!previous)return closeDetail(event);++navigationVersion;stopZoomMotion();gestureTarget=void 0;transitioning=false;viewHistory.value=viewHistory.value.slice(0,-1);expandedSubsystemId.value=previous.request?architecture.value.files.find(file=>file.path===previous.request.path)?.subsystemId||previous.ownerId:architecture.value.program?.modules?.find(program=>program.id===previous.programId)?.subsystemId||previous.ownerId;parentNode=previous.parentNode;parentViewport=previous.parentViewport;fileParentViewport=previous.fileParentViewport;fileRequest.value=previous.request;if(previous.request)retainedFileRequest.value=previous.request;programId.value=previous.programId||``;if(previous.programId)retainedProgramId.value=previous.programId;await nextTick();await flow.setViewport(previous.viewport,{duration:0})}async function showSubsystem(){++navigationVersion;stopZoomMotion();if(gestureTarget)gestureTarget.consumed=true;transitioning=true;canvas.value?.focus({preventScroll:true});fileRequest.value=null;programId.value=``;viewHistory.value=[];await nextTick();moveCamera(fileParentViewport||{x:24,y:24,zoom:1},{done:()=>{transitioning=false}})}const nodes=shallowRef([]);const edges=shallowRef([]);const showCalls=ref(false);const selectedPageId=ref(``);const visibleEdges=computed(()=>(focusOwner.value&&!focusOwner.value.opaque?[]:edges.value).filter(edge=>edge.type!==`controller`||showCalls.value||edge.source===selectedPageId.value).map(edge=>expandedSubsystemId.value&&edge.type!==`controller`?{...edge,style:{...edge.style,opacity:edge.source===expandedSubsystemId.value||edge.target===expandedSubsystemId.value?.4:.05}}:edge));function toggleCalls(){showCalls.value=!showCalls.value;selectedPageId.value=``}function selectNode({node,event}){if(node.type===`page`){selectedPageId.value=node.id;showCalls.value=false}else if(node.type===`subsystem`&&!node.data.opaque&&!dragging&&Date.now()-lastDragEnded>250&&!event?.target?.closest(`.engine-subsystem__grip`)){gestureTarget=void 0;enterSubsystem(node,flow.getViewport())}}function clearSelection(){selectedPageId.value=``}function startDrag(){dragging=true}function rearrangeSubsystem({node}){dragging=false;lastDragEnded=Date.now();if(!node.data.arrangeable)return;layoutPositions.value={...layoutPositions.value,[node.id]:{...node.position}}}function moveSubsystem(id,direction){const node=nodes.value.find(entry=>entry.id===id);if(!node)return;rearrangeSubsystem({node:{...node,position:{...node.position,x:node.position.x+direction*32}}})}function captureZoomAnchor(event){const rect=canvas.value.getBoundingClientRect();zoomAnchor={x:event.clientX-rect.left,y:event.clientY-rect.top};const element=event.target.closest(`[data-zoom-kind]`);zoomTarget=element?{kind:element.dataset.zoomKind,path:element.dataset.filePath,element}:void 0}function zoomGesture(event,factor,inward){const current=flow.getViewport();if(!gestureTarget||gestureDirection!==inward){captureZoomAnchor(event);const hovered=event.target.closest(`.vue-flow__node`);const node=nodes.value.find(node=>node.id===hovered?.dataset.id);const element=inward?zoomTarget?.element:void 0;const rect=element?.getBoundingClientRect();const canvasRect=canvas.value.getBoundingClientRect();const centred=inward&&(element||node&&node.type!==`subsystem-detail`&&node.type!==`annotation`);gestureTarget={point:rect?{x:(rect.x-canvasRect.x+rect.width/2-current.x)/current.zoom,y:(rect.y-canvasRect.y+rect.height/2-current.y)/current.zoom}:centred?{x:node.position.x+parseFloat(node.style.width)/2,y:node.position.y+parseFloat(node.style.height)/2}:{x:(zoomAnchor.x-current.x)/current.zoom,y:(zoomAnchor.y-current.y)/current.zoom},anchor:centred?{x:canvas.value.clientWidth/2,y:canvas.value.clientHeight/2}:{...zoomAnchor},detail:zoomTarget,nodeId:node?.id,viewport:{...current}};gestureDirection=inward}clearTimeout(gestureTimer);gestureTimer=setTimeout(finishGesture,220);if(gestureTarget.consumed)return;if(transitioning){++navigationVersion;transitioning=false;stopZoomMotion()}const zoom=Math.max(.08,Math.min(3,(zoomMotion?.viewport.zoom||current.zoom)*factor));zoomTarget=gestureTarget.detail;zoomAnchor=gestureTarget.anchor;moveCamera({zoom,x:zoomAnchor.x-gestureTarget.point.x*zoom,y:zoomAnchor.y-gestureTarget.point.y*zoom},{semantic:true})}function zoomWheel(event){if(!flow||!props.active||focusOwner.value?.opaque||!event.deltaY)return;if(!event.ctrlKey&&event.target.closest(`.subsystem-zoom`))return;event.preventDefault();event.stopPropagation();const delta=event.deltaY*(event.deltaMode===1?16:event.deltaMode===2?canvas.value.clientHeight:1);zoomGesture(event,2**(-Math.max(-300,Math.min(300,delta))*(event.ctrlKey?.006:.003)),delta<0)}function startPinch(event){if(event.touches.length!==2||!flow||focusOwner.value?.opaque)return;event.preventDefault();event.stopPropagation();pinchDistance=touchDistance(event.touches);pinchTarget=event.target;gestureTarget=void 0}function movePinch(event){if(event.touches.length!==2||!pinchDistance||!props.active)return;event.preventDefault();event.stopPropagation();const distance=touchDistance(event.touches);if(!distance||distance===pinchDistance)return;const factor=distance/pinchDistance;zoomGesture({target:pinchTarget,clientX:(event.touches[0].clientX+event.touches[1].clientX)/2,clientY:(event.touches[0].clientY+event.touches[1].clientY)/2},factor,factor>1);clearTimeout(gestureTimer);pinchDistance=distance}function endPinch(event){if(event.touches.length<2){pinchDistance=void 0;pinchTarget=void 0;gestureTimer=setTimeout(finishGesture,220)}}function zoomControl(inward){if(!flow||!canvas.value)return;gestureTarget=void 0;const rect=canvas.value.getBoundingClientRect();zoomGesture({target:canvas.value,clientX:rect.x+rect.width/2,clientY:rect.y+rect.height/2},inward?1.4:1/1.4,inward)}function enterSubsystem(node,viewport){if(expandedSubsystemId.value||!canvas.value)return;parentNode={position:{...node.position},style:{...node.style}};parentViewport=gestureTarget?{...gestureTarget.viewport}:{...viewport};expandedSubsystemId.value=node.id;readingViewport({x:node.position.x*viewport.zoom+viewport.x,y:node.position.y*viewport.zoom+viewport.y,width:parseFloat(node.style.width)*viewport.zoom,height:parseFloat(node.style.height)*viewport.zoom})}function viewportChanged(viewport){if(!props.active||!canvas.value||!contentCount.value||dragging||transitioning)return;if(focusOwner.value?.opaque){zoomAnchor=void 0;return}const rect=canvas.value.getBoundingClientRect();if(outline.value&&!outline.value.owner.opaque){if(viewport.zoom<.7){if(fileRequest.value||programId.value)previousView();else closeDetail()}return}const centerX=((zoomAnchor?.x??rect.width/2)-viewport.x)/viewport.zoom;const centerY=((zoomAnchor?.y??rect.height/2)-viewport.y)/viewport.zoom;const candidate=gestureDirection===true&&nodes.value.find(node=>node.type===`subsystem`&&node.id===gestureTarget?.nodeId&&!node.data.opaque&&parseFloat(node.style.width)*viewport.zoom>=Math.min(560,rect.width*.8)&¢erX>=node.position.x&¢erX<=node.position.x+parseFloat(node.style.width)&¢erY>=node.position.y&¢erY<=node.position.y+parseFloat(node.style.height));if(candidate)enterSubsystem(candidate,viewport)}const uiIds=ref([]);const engineIds=ref([]);const externalCount=ref(0);const initialIds=ref([]);const contentCount=computed(()=>uiIds.value.length+engineIds.value.length);let flow;const flowReady=ref(false);let fitPending=true;async function fit(ids){if(!flow||!props.active||!contentCount.value||usageState.value.view!==`map`)return;stopZoomMotion();++navigationVersion;gestureTarget=void 0;transitioning=true;if(focusOwner.value&&!focusOwner.value.opaque){expandedSubsystemId.value=``;fileRequest.value=null;retainedFileRequest.value=null;retainedOutline.value=null;programId.value=``;retainedProgramId.value=``;viewHistory.value=[];ids=void 0}await nextTick();const measured=unref(flow.getNodes);if(measured.length!==nodes.value.length||measured.some(node=>!node.dimensions.width||!node.dimensions.height)){transitioning=false;return}await flow.fitView({nodes:Array.isArray(ids)?ids:void 0,padding:.12,maxZoom:1,duration:0});transitioning=false;fitPending=false}async function initialize(instance){flow=instance;await fit(initialIds.value);flowReady.value=true}function fitIfPending(){if(fitPending)fit(initialIds.value)}function fitWhenMapShown(){if(fitPending)nextTick(()=>fit(initialIds.value))}const overview=computed(()=>architectureOverview(toRaw(architecture.value)));watch([overview,expandedSubsystemId,layoutPositions],([diagram,expanded,positions],previous)=>{if(architecture.value&&expanded){const currentOwner=fileRequest.value?architecture.value.files.find(file=>file.path===fileRequest.value.path)?.subsystemId:currentProgram.value?.subsystemId;if(currentOwner&¤tOwner!==expanded)expandedSubsystemId.value=currentOwner;else if(!focusOwner.value){expandedSubsystemId.value=``;fileRequest.value=null;programId.value=``;viewHistory.value=[]}}const arranged=arrangedMapNodes(diagram.nodes,positions);if(!(architecture.value?.ui?.pages||[]).some(page=>page.id===selectedPageId.value))selectedPageId.value=``;const focused=focusOwner.value&&!focusOwner.value.opaque;nodes.value=focused?readingNodes(arranged,outline.value,focusOwner.value):arranged;edges.value=diagram.edges;uiIds.value=diagram.uiIds;engineIds.value=diagram.engineIds;externalCount.value=diagram.externalCount;initialIds.value=diagram.initialIds;if(!previous||diagram!==previous[0]){fitPending=true;if(!expandedSubsystemId.value)fit(initialIds.value)}},{immediate:true});watch([outline,fileRequest,programId],([detail,file,program])=>{flow?.updateNodeData(`visual:subsystem-detail`,{outline:detail});if(detail&&detail.owner.id===expandedSubsystemId.value&&!file&&!program)retainedOutline.value=detail});watch(()=>props.sessionId,()=>{++navigationVersion;stopZoomMotion();clearTimeout(gestureTimer);gestureTarget=void 0;transitioning=false;expandedSubsystemId.value=``;fileRequest.value=null;retainedFileRequest.value=null;retainedOutline.value=null;programId.value=``;retainedProgramId.value=``;viewHistory.value=[];selectedPageId.value=``;showCalls.value=false;layoutPositions.value={};zoomAnchor=void 0;zoomTarget=void 0;parentViewport=void 0;fileParentViewport=void 0});let handledProgramRequest;watch([()=>props.openProgramRequest,architecture,()=>props.active,flowReady],([request,snapshot,active,ready])=>{if(!ready||!active||!request||handledProgramRequest===request||!snapshot?.program?.modules.some(program=>program.id===request.id))return;handledProgramRequest=request;openProgram(request.id)});watch(architecture,snapshot=>{if(programId.value&&!snapshot?.program?.modules.some(program=>program.id===programId.value))showSubsystem()});watch(()=>props.active,active=>{if(!active){++navigationVersion;stopZoomMotion();clearTimeout(gestureTimer);gestureTarget=void 0;transitioning=false}else if(fitPending)fit(initialIds.value)});watch(canvas,(element,previous,onCleanup)=>{if(!element)return;const pageEscape=event=>{if(event.key!==`Escape`||event.defaultPrevented||event.target!==document.body||!props.active||usageState.value.view!==`map`||!expandedSubsystemId.value)return;event.preventDefault();previousView(event)};document.addEventListener(`keydown`,pageEscape);let width=element.clientWidth;let height=element.clientHeight;const observer=new ResizeObserver(()=>{const nextWidth=element.clientWidth;const nextHeight=element.clientHeight;if(!nextWidth||!nextHeight||width===nextWidth&&height===nextHeight)return;const oldWidth=width;width=nextWidth;height=nextHeight;if(!props.active||!flow||!expandedSubsystemId.value||focusOwner.value?.opaque)return;const adapt=viewport=>adaptViewport(viewport,width,oldWidth);stopZoomMotion();++navigationVersion;clearTimeout(gestureTimer);gestureTarget=void 0;zoomTarget=void 0;zoomAnchor=void 0;transitioning=false;fileParentViewport=adapt(fileParentViewport);viewHistory.value=viewHistory.value.map(entry=>({...entry,viewport:adapt(entry.viewport),fileParentViewport:adapt(entry.fileParentViewport)}));flow.setViewport(adapt(flow.getViewport()),{duration:0})});observer.observe(element);onCleanup(()=>{observer.disconnect();document.removeEventListener(`keydown`,pageEscape)})},{flush:`post`});onBeforeUnmount(()=>{stopZoomMotion();clearTimeout(gestureTimer)});return{expandedSubsystemId,outline,retainedOutline,layoutPositions,fileRequest,retainedFileRequest,programId,currentProgram,retainedProgram,parentProgram,nodes,edges,showCalls,selectedPageId,visibleEdges,uiIds,engineIds,externalCount,contentCount,closeDetail,openProgram,openFile,updateFileLocation,previousView,showSubsystem,toggleCalls,selectNode,clearSelection,startDrag,rearrangeSubsystem,moveSubsystem,zoomWheel,startPinch,movePinch,endPinch,zoomControl,viewportChanged,fit,initialize,fitIfPending,fitWhenMapShown}}var _hoisted_1$11={class:`usage-picker__label`};var _hoisted_2$11={class:`usage-picker__body`};var _sfc_main$11={__name:`Vibe64UsageEntryPicker`,props:{modelValue:{type:Boolean,default:false},label:{type:String,required:true},title:{type:String,required:true}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(VBtn,{class:`usage-picker`,variant:`outlined`,block:``,"append-icon":`$dropdown`,"aria-label":__props.label,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,true))},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$11,toDisplayString(__props.label),1)]),_:1},8,[`aria-label`]),createVNode(VDialog,{"model-value":__props.modelValue,fullscreen:``,transition:`dialog-bottom-transition`,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{class:`usage-picker__dialog`},{default:withCtx(()=>[createVNode(VToolbar,{density:`comfortable`,color:`surface`},{default:withCtx(()=>[createVNode(VBtn,{icon:`$close`,"aria-label":`Close`,onClick:_cache[1]||(_cache[1]=$event=>emit(`update:modelValue`,false))}),createVNode(VToolbarTitle,{class:`text-title-large`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.title),1)]),_:1})]),_:1}),createBaseVNode(`div`,_hoisted_2$11,[renderSlot(_ctx.$slots,`default`,{},void 0,true)])]),_:3})]),_:3},8,[`model-value`])],64)}}};var Vibe64UsageEntryPicker_default=_plugin_vue_export_helper_default(_sfc_main$11,[[`__scopeId`,`data-v-fe039242`]]);var USAGE_ENTRY_KINDS=Object.freeze([{kind:`page`,label:`Page`,plural:`Pages`,icon:`$description`},{kind:`component`,label:`Component`,plural:`Components`,icon:`$extension`},{kind:`route`,label:`Route`,plural:`Routes`,icon:`$api`},{kind:`action`,label:`Action`,plural:`Actions`,icon:`$bolt`},{kind:`library-export`,label:`Library export`,plural:`Library exports`,icon:`$package2`},{kind:`cli-command`,label:`Command`,plural:`Commands`,icon:`$terminal`},{kind:`job`,label:`Job`,plural:`Jobs`,icon:`$schedule`},{kind:`program-operation`,label:`Program operation`,plural:`Program operations`,icon:`$menuBook`},{kind:`test`,label:`Test file`,plural:`Test files`,icon:`$science`}].map(Object.freeze));var USAGE_MODES=Object.freeze([Object.freeze({value:`imports`,title:`Imports`}),Object.freeze({value:`calls`,title:`Calls`}),Object.freeze({value:`recording`,title:`Recording`})]);var USAGE_QUERY_KEYS=Object.freeze([`view`,`entry`,`mode`,`subsystem`,`recording`,`request`,`interaction`]);var MORE_NODES=1e3;function entryKind(kind){return USAGE_ENTRY_KINDS.find(item=>item.kind===kind)||{kind,label:kind,plural:kind,icon:`$description`}}var text=value=>typeof value===`string`?value.trim():Array.isArray(value)?text(value[0]):``;function usageStateFromQuery(query={}){const view=text(query.view)===`usage`?`usage`:`map`;const mode=USAGE_MODES.some(item=>item.value===text(query.mode))?text(query.mode):`calls`;const interaction=view===`usage`?text(query.interaction):``;return{view,entry:view===`usage`?text(query.entry):``,mode:view===`usage`?mode:`calls`,subsystem:view===`usage`?text(query.subsystem):``,recording:view===`usage`?text(query.recording):``,request:view===`usage`&&!interaction?text(query.request):``,interaction}}function usageQueryFor(query={},state={}){const next=Object.fromEntries(Object.entries(query).filter(([key])=>!USAGE_QUERY_KEYS.includes(key)));const normalized=usageStateFromQuery(state);if(normalized.view!==`usage`)return next;next.view=`usage`;next.mode=normalized.mode;for(const key of[`entry`,`subsystem`,`recording`,`request`,`interaction`])if(normalized[key])next[key]=normalized[key];return next}function sameUsageState(left={},right={}){const a=usageStateFromQuery(left);const b=usageStateFromQuery(right);return USAGE_QUERY_KEYS.every(key=>a[key]===b[key])}function sameQuery(left={},right={}){return[...new Set([...Object.keys(left),...Object.keys(right)])].every(key=>String(left[key]??``)===String(right[key]??``))}function functionLabel(fn={}){if(fn.kind===`module`)return`${fileName(fn.file)} top level`;const name=fn.name||`anonymous (line ${fn.start?.line??`?`})`;return fn.container?`${fn.container}.${name}`:name}function fileName(filePath=``){return String(filePath).split(`/`).pop()}function locationParts(filePath=``,line=null){if(line)return{name:fileName(filePath),line:`:${line}`};const folders=String(filePath).split(`/`).slice(0,-1);return{name:folders.length>2?`…/${folders.slice(-2).join(`/`)}`:folders.join(`/`),line:``}}function pathParts(filePath=``){return String(filePath).split(/(?<=\/)/u)}function countLabel(count,singular,plural=`${singular}s`){return`${Number(count||0).toLocaleString()} ${count===1?singular:plural}`}function subsystemSections(subsystems=[],groups=[],{countKey,showUntouched=false}={}){const reached=item=>Number(item[countKey]||0)>0;const visible=subsystems.filter(item=>showUntouched||reached(item));const alphabetical=(left,right)=>left.title.localeCompare(right.title);const sections=[];for(const group of groups){const cards=visible.filter(item=>item.group===group.id).sort(alphabetical);if(cards.length)sections.push({id:group.id,title:group.title,cards})}const placed=new Set(groups.map(group=>group.id));const rest=visible.filter(item=>!placed.has(item.group)).sort(alphabetical);if(rest.length)sections.push({id:``,title:groups.length?`Other subsystems`:``,cards:rest});return{sections,untouched:subsystems.filter(item=>!reached(item)).length}}function crossingsFrom(crossings=[],subsystemId=``,subsystems=[]){const titles=new Map(subsystems.map(item=>[item.id,item.title]));return crossings.filter(crossing=>crossing.fromSubsystemId===subsystemId).map(crossing=>({...crossing,title:titles.get(crossing.toSubsystemId)||crossing.toSubsystemId}))}var COUNT_KEYS=Object.freeze({imports:`fileCount`,calls:`functionCount`,recording:`ranCount`});function subsystemCard(mode,item={}){if(mode===`imports`)return{count:countLabel(item.fileCount,`file`),detail:``};if(mode===`calls`)return{count:countLabel(item.functionCount,`function`),detail:`${Number(item.exact||0).toLocaleString()} by exact calls · ${Number(item.probable||0).toLocaleString()} only via probable`};return{count:`${countLabel(item.ranCount,`function`)} ran`,detail:``,plumbing:item.plumbingCount||0}}function crossingText(mode,crossing={}){if(mode===`imports`)return countLabel(crossing.count,`import`);const exact=Number(crossing.exact||0);const probable=Number(crossing.probable||0);if(mode===`recording`)return countLabel(exact+probable,`call in code`,`calls in code`);return[[exact&&countLabel(exact,`exact call`),probable&&(exact?`${probable.toLocaleString()} probable`:countLabel(probable,`probable call`))].filter(Boolean).join(`, `),crossing.renders&&`renders ${countLabel(crossing.renders,`component`)}`].filter(Boolean).join(` · `)}function depthTitle(depth){return depth===0?`Start`:depth===1?`1 step away`:`${depth} steps away`}function edgeCounts(edges=[]){const out=new Map;const into=new Map;for(const edge of edges){out.set(edge.from,(out.get(edge.from)||0)+1);into.set(edge.to,(into.get(edge.to)||0)+1)}return{out,into}}function webNodes(mode,data={}){const edges=data.edges||[];const{out,into}=edgeCounts(edges);if(mode===`imports`)return(data.files||[]).map(file=>({id:file.id,title:fileName(file.path),subtitle:file.path,location:locationParts(file.path),file:file.path,start:null,depth:file.depth,certainty:null,outCount:out.get(file.id)||0,inCount:into.get(file.id)||0,unresolved:0}));if(mode===`calls`){const unresolved=new Map;for(const item of data.unresolved||[])unresolved.set(item.fromFunctionId,(unresolved.get(item.fromFunctionId)||0)+1);return(data.functions||[]).map(fn=>({id:fn.id,functionId:fn.id,title:functionLabel(fn),subtitle:`${fn.file}:${fn.start.line}`,location:locationParts(fn.file,fn.start.line),file:fn.file,start:fn.start,depth:fn.depth,certainty:fn.reach,outCount:fn.callCount||0,inCount:fn.calledByCount||0,unresolved:unresolved.get(fn.id)||0}))}return recordedDepths(data.nodes||[],edges).map(node=>({id:node.id,functionId:node.functionId,title:functionLabel({name:node.name,start:node.start}),subtitle:`${node.file}:${node.start.line}`,location:locationParts(node.file,node.start.line),file:node.file,start:node.start,depth:node.depth,certainty:null,count:node.count,plumbing:node.plumbing,join:node.join,reason:node.reason,outCount:out.get(node.id)||0,inCount:into.get(node.id)||0,unresolved:0}))}function depthColumns(nodes=[]){const columns=new Map;for(const node of nodes){const depth=Number(node.depth||0);if(!columns.has(depth))columns.set(depth,[]);columns.get(depth).push(node)}return[...columns.entries()].sort(([left],[right])=>left-right).map(([depth,items])=>({depth,items}))}var NODE=Object.freeze({width:220,height:76,columnGap:72,rowGap:16,padding:16});function canvasLayout(nodes=[],edges=[]){const positions=new Map;const columns=depthColumns(nodes);columns.forEach((column,columnIndex)=>column.items.forEach((node,rowIndex)=>{positions.set(node.id,{x:NODE.padding+columnIndex*(NODE.width+NODE.columnGap),y:NODE.padding+rowIndex*(NODE.height+NODE.rowGap)})}));const tallest=Math.max(0,...columns.map(column=>column.items.length));return{positions,paths:edges.filter(edge=>positions.has(edge.from)&&positions.has(edge.to)).map(edge=>{const from=positions.get(edge.from);const to=positions.get(edge.to);const forward=to.x>from.x;const start={x:from.x+NODE.width,y:from.y+NODE.height/2};const end=forward?{x:to.x,y:to.y+NODE.height/2}:{x:to.x+NODE.width,y:to.y+NODE.height/2};const bend=forward?Math.max(32,(end.x-start.x)/2):NODE.columnGap/2+Math.abs(end.y-start.y)/4;const d=forward?`M ${start.x} ${start.y} C ${start.x+bend} ${start.y}, ${end.x-bend} ${end.y}, ${end.x} ${end.y}`:`M ${start.x} ${start.y} C ${start.x+bend} ${start.y}, ${end.x+bend} ${end.y}, ${end.x} ${end.y}`;return{...edge,key:`${edge.from}>${edge.to}`,d}}),width:NODE.padding*2+Math.max(1,columns.length)*NODE.width+Math.max(0,columns.length-1)*NODE.columnGap,height:NODE.padding*2+tallest*NODE.height+Math.max(0,tallest-1)*NODE.rowGap}}var CERTAINTY_TEXT=Object.freeze({exact:`exact`,probable:`probable`,unresolved:`unresolved`});var METHOD_TEXT=Object.freeze({checker:`proved by types`,"di-binding":`dependency binding`,"route-action":`the route's action`,"argument-flow":`passed as an argument`,"import-scope":`matched by imported name`,"same-file-name":`matched by name in this file`,self:`same class`,"receiver-name":`matched by method name`,operation:`request`,renders:``,none:``});function callMethodText(method=``){return METHOD_TEXT[method]??method}var ANALYSIS_NAMES=Object.freeze({jskit:`JSKIT`});function coverageText(coverage=``){if(coverage.startsWith(`adapter:`)){const family=coverage.slice(8).split(`.`)[0];return`Calls read by ${ANALYSIS_NAMES[family]||family} analysis, which can prove exact calls`}if(coverage===`generic`)return`Calls read by name only: probable at best`;return`Calls not read for this file`}function callGroups(rows=[],heading){return[`exact`,`probable`].map(certainty=>({certainty,title:`${heading} (${certainty})`,rows:rows.filter(row=>row.certainty===certainty)})).filter(group=>group.rows.length)}var BACKGROUND_TEXT=`Not separated per request for this server`;var OUTSIDE_REQUESTS_TEXT=`Start-up and work outside requests`;var isBackgroundRequest=(request={})=>request.kind===`background`||/^bg_[0-9]+$/u.test(String(request.id||``));var READINESS_TEXT=`Launch readiness check`;var isReadinessRequest=(request={})=>request.kind===`readiness`;var requestCount=(requests=[])=>requests.filter(request=>!isBackgroundRequest(request)&&!isReadinessRequest(request)).length;function onlyBackground(requests=[]){const ran=requests.filter(request=>Number(request.functionCount||0)>0&&!isReadinessRequest(request));return ran.length>0&&ran.every(isBackgroundRequest)}function requestTitle(request={},requests=[request]){if(isBackgroundRequest(request))return onlyBackground(requests)?BACKGROUND_TEXT:OUTSIDE_REQUESTS_TEXT;if(isReadinessRequest(request))return READINESS_TEXT;return request.routeTemplate||request.path||`Request not in the request log`}function requestGroups(requests=[],interactions=[]){const byId=new Map(interactions.map(interaction=>[interaction.id,interaction]));const offered=new Set;const groups=[];for(const request of requests){const interaction=byId.get(request.interaction)||null;const last=groups.at(-1);if(last&&last.interaction?.id===interaction?.id){last.requests.push(request);continue}groups.push({key:`${interaction?.id||`none`}:${request.id}`,interaction,requests:[request],offersInteraction:Boolean(interaction)&&!offered.has(interaction.id)});if(interaction)offered.add(interaction.id)}return groups}var INTERACTION_VERBS=Object.freeze({click:`Click`,enter:`Enter`,submit:`Submit`});function interactionParts(interaction){if(!interaction)return{text:``,file:``};return{text:`${INTERACTION_VERBS[interaction.kind]||INTERACTION_VERBS.click}: ${interaction.label}`,file:interaction.componentFile?`(${fileName(interaction.componentFile)})`:``}}function interactionTitle(interaction){const{text,file}=interactionParts(interaction);return[text,file].filter(Boolean).join(` `)}var INTERACTION_NOUNS=Object.freeze({click:`click`,enter:`Enter`,submit:`submit`});function interactionRunTitle(interaction){return`Everything this ${INTERACTION_NOUNS[interaction.kind]||INTERACTION_NOUNS.click} ran`}function recordingWeb(functions=[],join=null){const joined=new Map((join?.joined||[]).map(item=>[item.index,item]));const nodes=functions.map((fn,index)=>{const match=joined.get(index)||{functionId:null,subsystemId:null,join:`none`};return{id:match.functionId||`ran:${index}`,functionId:match.functionId,name:fn.name,file:fn.path,start:fn.start,end:fn.end,count:fn.count,plumbing:fn.plumbing===true,subsystemId:match.subsystemId,join:match.join,reason:match.reason}});const edges=(join?.edges||[]).filter(edge=>nodes[edge.from]&&nodes[edge.to]).map(edge=>({from:nodes[edge.from].id,to:nodes[edge.to].id,certainty:edge.certainty}));const subsystems=(join?.subsystems||[]).map(owner=>{const ran=nodes.filter(node=>node.subsystemId===owner.id);return{...owner,ranCount:ran.length,plumbingCount:ran.filter(node=>node.plumbing).length}});const owners=new Map(nodes.map(node=>[node.id,node.subsystemId]));const crossings=new Map;for(const edge of edges){const from=owners.get(edge.from);const to=owners.get(edge.to);if(!from||!to||from===to)continue;const key=`${from}\n${to}`;if(!crossings.has(key))crossings.set(key,{fromSubsystemId:from,toSubsystemId:to,exact:0,probable:0});crossings.get(key)[edge.certainty===`exact`?`exact`:`probable`]+=1}return{nodes,edges,subsystems,crossings:[...crossings.values()]}}function recordedDepths(nodes=[],edges=[]){const ids=new Set(nodes.map(node=>node.id));const inside=edges.filter(edge=>ids.has(edge.from)&&ids.has(edge.to)&&edge.from!==edge.to);const incoming=new Map(nodes.map(node=>[node.id,0]));for(const edge of inside)incoming.set(edge.to,incoming.get(edge.to)+1);const depth=new Map;const queue=nodes.filter(node=>incoming.get(node.id)===0).map(node=>node.id);for(const id of queue)depth.set(id,0);for(let head=0;head<queue.length;head+=1)for(const edge of inside)if(edge.from===queue[head]&&!depth.has(edge.to)){depth.set(edge.to,depth.get(queue[head])+1);queue.push(edge.to)}return nodes.map(node=>({...node,depth:depth.get(node.id)??0}))}function unavailableRuntimes(targets=[]){if(!targets.length||targets.some(target=>target.available))return[];return[...new Set(targets.flatMap(target=>target.runtimes||[]))]}var NOT_SCANNED_CODE=`vibe64_genesis_city_missing`;var NOT_IGNORED_TEXT=`Git does not ignore .genesis/call-web.json in this project, so the last scan could not read calls. Add /.genesis/call-web.json to the project's .gitignore, then refresh the architecture scan.`;function joinText(join=``,reason=``){if(join===`stale`)return`Changed since the last scan`;if(join===`none`&&reason===`not-ignored`)return`Calls not read: Git does not ignore the call web`;if(join===`none`&&reason===`language`)return`Calls not read in this file's language`;if(join===`none`)return`Not in the last scan`;return``}var _hoisted_1$10={class:`usage-entry-rail`,"aria-label":`Entry points`};var _hoisted_2$10={class:`usage-entry-rail__body`};var _hoisted_3$10={key:1,class:`pa-2`,"aria-busy":`true`,"aria-label":`Loading entry points`};var _hoisted_4$10={key:2,class:`usage-entry-rail__empty`,role:`status`};var _hoisted_5$10={key:0,class:`text-body-medium`};var _sfc_main$10={__name:`Vibe64UsageEntryRail`,props:{entries:{type:Array,default:()=>[]},kinds:{type:Array,default:()=>[]},search:{type:String,default:``},kind:{type:String,default:``},selectedId:{type:String,default:``},loading:{type:Boolean,default:false},error:{type:String,default:``},hasMore:{type:Boolean,default:false},refreshing:{type:Boolean,default:false}},emits:[`update:search`,`update:kind`,`select`,`more`,`retry`,`refresh`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const rows=computed(()=>props.hasMore?[...props.entries,{id:`\0more`,more:true}]:props.entries);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$10,[createVNode(VTextField,{"model-value":__props.search,class:`usage-entry-rail__search`,label:`Search entries`,"prepend-inner-icon":`$search`,variant:`outlined`,density:`comfortable`,maxlength:`80`,clearable:``,"hide-details":``,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>emit(`update:search`,$event||``))},null,8,[`model-value`]),__props.kinds.length?(openBlock(),createBlock(VChipGroup,{key:0,"model-value":__props.kind,class:`usage-entry-rail__kinds`,column:``,"selected-class":`usage-entry-rail__kind--selected`,"aria-label":`Entry kinds`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:kind`,$event||``))},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.kinds,item=>{return openBlock(),createBlock(VChip,{key:item.kind,value:item.kind,filter:``,variant:`outlined`,size:`small`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(entryKind)(item.kind).plural)+` · `+toDisplayString(item.count),1)]),_:2},1032,[`value`])}),128))]),_:1},8,[`model-value`])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$10,[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`ma-3`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[2]||(_cache[2]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.entries.length?(openBlock(),createElementBlock(`div`,_hoisted_3$10,[(openBlock(),createElementBlock(Fragment,null,renderList(6,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!__props.entries.length?(openBlock(),createElementBlock(`div`,_hoisted_4$10,[__props.search||__props.kind?(openBlock(),createElementBlock(`p`,_hoisted_5$10,`No entry points match.`)):(openBlock(),createElementBlock(Fragment,{key:1},[_cache[7]||(_cache[7]=createBaseVNode(`p`,{class:`text-body-medium`},`No entry points found yet. Refresh the architecture scan.`,-1)),createVNode(VBtn,{variant:`tonal`,loading:__props.refreshing,"prepend-icon":`$refresh`,onClick:_cache[3]||(_cache[3]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`])],64))])):(openBlock(),createBlock(VVirtualScroll,{key:3,items:rows.value,"item-key":`id`,class:`usage-entry-rail__list`,role:`listbox`,"aria-label":`Entry points`},{default:withCtx(({item})=>[item.more?(openBlock(),createBlock(VBtn,{key:0,block:``,variant:`text`,class:`my-1`,loading:__props.loading,onClick:_cache[4]||(_cache[4]=$event=>emit(`more`))},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Show more`,-1)])]),_:1},8,[`loading`])):(openBlock(),createBlock(VListItem,{key:1,active:item.id===__props.selectedId,role:`option`,"aria-selected":item.id===__props.selectedId,"prepend-icon":unref(entryKind)(item.kind).icon,"aria-label":`${unref(entryKind)(item.kind).label}: ${item.title}, ${item.file}`,color:`primary`,rounded:`xl`,lines:`two`,class:`usage-entry-rail__item`,onClick:$event=>emit(`select`,item)},{title:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(item.title),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[9]||(_cache[9]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),subtitle:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(item.file),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[10]||(_cache[10]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),_:2},1032,[`active`,`aria-selected`,`prepend-icon`,`aria-label`,`onClick`]))]),_:1},8,[`items`]))])])}}};var Vibe64UsageEntryRail_default=_plugin_vue_export_helper_default(_sfc_main$10,[[`__scopeId`,`data-v-91f16a1a`]]);var _hoisted_1$9=[`aria-label`];var _hoisted_2$9={class:`usage-panel__header`};var _hoisted_3$9={class:`usage-panel__heading`};var _hoisted_4$9={class:`text-title-medium`};var _hoisted_5$9={class:`text-body-small`};var _hoisted_6$8={class:`usage-panel__actions`};var _hoisted_7$7={key:0,class:`text-body-medium`};var _hoisted_8$7={key:0,class:`usage-panel__note text-body-small`,role:`note`};var _hoisted_9$7={key:1,class:`usage-panel__note text-body-medium`};var _hoisted_10$6={key:1,"aria-busy":`true`,"aria-label":`Loading calls`};var _hoisted_11$6={class:`usage-panel__note text-body-small`};var _hoisted_12$6=[`aria-label`];var _hoisted_13$5={class:`text-title-small`};var _hoisted_14$5={key:0,class:`usage-panel__ran`};var _hoisted_15$4={key:0};var _hoisted_16$4={key:0,class:`usage-panel__section`,"aria-label":`Unresolved calls`};var _hoisted_17$4={class:`text-title-small`};var _hoisted_18$4={key:1,class:`usage-panel__note text-body-medium`};var _hoisted_19$4={key:2,class:`usage-panel__note text-body-small`};var _sfc_main$9={__name:`Vibe64UsageFunctionPanel`,props:{node:{type:Object,required:true},detail:{type:Object,default:null},loading:{type:Boolean,default:false},error:{type:String,default:``},ran:{type:Map,required:true}},emits:[`close`,`select`,`open-source`,`retry`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const sections=computed(()=>{if(!props.detail)return[];const calls=props.detail.calls.map(row=>({...row,fn:row.target,site:props.detail.function.file}));const calledBy=props.detail.calledBy.map(row=>({...row,fn:row.source,site:row.source.file}));const renders=row=>row.method===`renders`;return[...callGroups(calls.filter(row=>!renders(row)),`Calls`),...callGroups(calls.filter(renders),`Renders`),...callGroups(calledBy.filter(row=>!renders(row)),`Called by`),...callGroups(calledBy.filter(renders),`Rendered by`)]});const ranText=computed(()=>{if(props.node.count===void 0)return``;return props.node.count==null?`Ran in this request`:`Ran ${props.node.count.toLocaleString()} ${props.node.count===1?`time`:`times`}`});const joinNote=computed(()=>{if(!props.node.join||props.node.join===`exact`)return``;if(props.node.join===`name-line`)return`Matched by name near this line: the file moved slightly since the scan.`;if(props.node.reason===`not-ignored`)return NOT_IGNORED_TEXT;if(props.node.reason===`language`)return`The scan reads calls only in the languages of the project's Stack components, and this file's language is not among them.`;return`${joinText(props.node.join)}. Refresh the architecture scan to see its calls.`});const importText=computed(()=>props.node.functionId||props.node.join?``:`Imports ${props.node.outCount} of the reached files · imported by ${props.node.inCount}`);const methodText=row=>callMethodText(row.method);const ranLabel=count=>count==null?`ran`:`ran ${count.toLocaleString()} ${count===1?`time`:`times`}`;function openAt(start,file=props.node.file){emit(`open-source`,{path:file,line:start?.line||1,column:start?.column||1})}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:`usage-panel`,"aria-label":`Details for ${__props.node.title}`},[createBaseVNode(`header`,_hoisted_2$9,[createBaseVNode(`div`,_hoisted_3$9,[createBaseVNode(`h3`,_hoisted_4$9,toDisplayString(__props.node.title),1),createBaseVNode(`p`,_hoisted_5$9,toDisplayString(__props.node.subtitle),1)]),createVNode(VBtn,{icon:`$close`,variant:`text`,size:`small`,"aria-label":`Close details`,onClick:_cache[0]||(_cache[0]=$event=>emit(`close`))})]),createBaseVNode(`div`,_hoisted_6$8,[createVNode(VBtn,{variant:`tonal`,"prepend-icon":`$code`,onClick:_cache[1]||(_cache[1]=$event=>openAt(__props.node.start))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`Open source`,-1)])]),_:1}),ranText.value?(openBlock(),createElementBlock(`span`,_hoisted_7$7,toDisplayString(ranText.value),1)):createCommentVNode(``,true)]),joinNote.value?(openBlock(),createElementBlock(`p`,_hoisted_8$7,toDisplayString(joinNote.value),1)):createCommentVNode(``,true),importText.value?(openBlock(),createElementBlock(`p`,_hoisted_9$7,toDisplayString(importText.value),1)):createCommentVNode(``,true),__props.node.functionId?(openBlock(),createElementBlock(Fragment,{key:2},[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[2]||(_cache[2]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.detail?(openBlock(),createElementBlock(`div`,_hoisted_10$6,[createVNode(VSkeletonLoader,{type:`list-item-two-line, list-item-two-line, list-item-two-line`})])):__props.detail?(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`p`,_hoisted_11$6,toDisplayString(unref(coverageText)(__props.detail.function.coverage||``)),1),(openBlock(true),createElementBlock(Fragment,null,renderList(sections.value,group=>{return openBlock(),createElementBlock(`section`,{key:group.title,class:`usage-panel__section`,"aria-label":group.title},[createBaseVNode(`h4`,_hoisted_13$5,toDisplayString(group.title),1),createVNode(VList,{density:`compact`,class:`usage-panel__list`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(group.rows,(row,position)=>{return openBlock(),createBlock(VListItem,{key:position,rounded:`lg`,lines:`two`,onClick:$event=>emit(`select`,row.fn)},{append:withCtx(()=>[createVNode(VChip,{size:`x-small`,variant:row.certainty===`exact`?`tonal`:`outlined`,class:`mr-1`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(CERTAINTY_TEXT)[row.certainty]),1)]),_:2},1032,[`variant`]),row.start?(openBlock(),createBlock(VBtn,{key:0,icon:`$code`,variant:`text`,size:`x-small`,"aria-label":`Open the ${row.method===`renders`?`tag`:`call`} at line ${row.start.line}`,onClick:withModifiers($event=>openAt(row.start,row.site),[`stop`])},null,8,[`aria-label`,`onClick`])):createCommentVNode(``,true)]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(functionLabel)(row.fn)),1),__props.ran.has(row.fn.id)?(openBlock(),createElementBlock(`span`,_hoisted_14$5,` · `+toDisplayString(ranLabel(__props.ran.get(row.fn.id))),1)):createCommentVNode(``,true)]),_:2},1024),createVNode(VListItemSubtitle,{class:`usage-panel__callee`},{default:withCtx(()=>[createBaseVNode(`code`,null,toDisplayString(row.callee),1),methodText(row)?(openBlock(),createElementBlock(`span`,_hoisted_15$4,` · `+toDisplayString(methodText(row)),1)):createCommentVNode(``,true)]),_:2},1024)]),_:2},1032,[`onClick`])}),128))]),_:2},1024)],8,_hoisted_12$6)}),128)),__props.detail.unresolved.length?(openBlock(),createElementBlock(`section`,_hoisted_16$4,[createBaseVNode(`h4`,_hoisted_17$4,`Unresolved (`+toDisplayString(__props.detail.totals.unresolved)+`)`,1),createVNode(VList,{density:`compact`,class:`usage-panel__list`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.detail.unresolved,(item,position)=>{return openBlock(),createBlock(VListItem,{key:position,rounded:`lg`,onClick:$event=>openAt(item.start)},{default:withCtx(()=>[createVNode(VListItemTitle,{class:`usage-panel__callee text-body-medium`},{default:withCtx(()=>[_cache[5]||(_cache[5]=createTextVNode(`Unresolved call: `,-1)),createBaseVNode(`code`,null,toDisplayString(item.callee),1)]),_:2},1024),createVNode(VListItemSubtitle,null,{default:withCtx(()=>[createTextVNode(`Line `+toDisplayString(item.start.line),1)]),_:2},1024)]),_:2},1032,[`onClick`])}),128))]),_:1})])):createCommentVNode(``,true),!sections.value.length&&!__props.detail.unresolved.length?(openBlock(),createElementBlock(`p`,_hoisted_18$4,`No calls in or out are known for this function.`)):createCommentVNode(``,true),__props.detail.truncated?(openBlock(),createElementBlock(`p`,_hoisted_19$4,`Each list shows its first `+toDisplayString(__props.detail.limits.list)+`.`,1)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],8,_hoisted_1$9)}}};var Vibe64UsageFunctionPanel_default=_plugin_vue_export_helper_default(_sfc_main$9,[[`__scopeId`,`data-v-c4367069`]]);var _hoisted_1$8={class:`usage-recordings`,"aria-label":`Recordings`};var _hoisted_2$8={key:1,"aria-busy":`true`,"aria-label":`Loading recordings`};var _hoisted_3$8={key:2,class:`usage-recordings__empty`,role:`status`};var _hoisted_4$8={key:0,class:`text-body-medium`};var _hoisted_5$8={key:1,class:`text-body-medium`};var _hoisted_6$7={key:1,class:`usage-recordings__live text-body-small`,role:`status`};var _hoisted_7$6={key:3,class:`usage-recordings__live text-body-small`};var _hoisted_8$6={key:5,"aria-busy":`true`,"aria-label":`Loading requests`};var _hoisted_9$6={key:6,class:`usage-recordings__empty text-body-medium`,role:`status`};var _hoisted_10$5={class:`d-sr-only`};var _hoisted_11$5={key:8,class:`usage-recordings__footer`};var _hoisted_12$5={class:`text-body-small`};var _sfc_main$8={__name:`Vibe64UsageRecordingResults`,props:{recordings:{type:Array,default:()=>[]},recordingId:{type:String,default:``},requests:{type:Array,default:()=>[]},interactions:{type:Array,default:()=>[]},total:{type:Number,default:null},hasMore:{type:Boolean,default:false},newestFirst:{type:Boolean,default:false},requestId:{type:String,default:``},interactionId:{type:String,default:``},search:{type:String,default:``},includeEmpty:{type:Boolean,default:false},unavailable:{type:Array,default:()=>[]},loading:{type:Boolean,default:false},requestsLoading:{type:Boolean,default:false},error:{type:String,default:``},sessionId:{type:String,default:``}},emits:[`update:recordingId`,`update:requestId`,`update:interactionId`,`update:search`,`update:includeEmpty`,`more`,`retry`,`deleted`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const timeFormat=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`});const recordingItems=computed(()=>props.recordings.map(recording=>({value:recording.id,title:`${recording.target?.label||`Recording`} · ${recording.startedAt?timeFormat.format(new Date(recording.startedAt)):``} · ${countLabel(recording.counts?.requests,`request`)}${recording.state===`recording`?` · recording`:``}`})));const selectedRecording=computed(()=>props.recordings.find(recording=>recording.id===props.recordingId)||null);const groups=computed(()=>requestGroups(props.requests,props.interactions));const footerText=computed(()=>{if(!props.hasMore)return`Newest requests first`;const count=requestCount(props.requests);const shown=props.total==null?`Showing ${countLabel(count,`request`)}`:`Showing ${count.toLocaleString()} of ${countLabel(Math.max(props.total,count),`request`)}`;return props.newestFirst?`${shown}, newest first`:shown});const MARKS={background:{icon:`$settings`,label:`Start-up`},readiness:{icon:`$monitorHeart`,label:`Readiness check`},run:{icon:`$terminal`,label:`Command run`}};const markOf=request=>isBackgroundRequest(request)?MARKS.background:isReadinessRequest(request)?MARKS.readiness:/^run_/u.test(String(request.id))?MARKS.run:null;function subtitle(request){return[isBackgroundRequest(request)?onlyBackground(props.requests)?`Everything that ran while recording`:`Outside any request`:isReadinessRequest(request)?`Vibe64 checking that the launch started`:request.status,countLabel(request.fileCount,`file`),countLabel(request.functionCount,`function`)].filter(Boolean).join(` · `)}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$8,[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`mx-1`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[0]||(_cache[0]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.recordings.length?(openBlock(),createElementBlock(`div`,_hoisted_2$8,[(openBlock(),createElementBlock(Fragment,null,renderList(4,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!__props.recordings.length?(openBlock(),createElementBlock(`div`,_hoisted_3$8,[__props.unavailable.length?(openBlock(),createElementBlock(`p`,_hoisted_4$8,[_cache[7]||(_cache[7]=createTextVNode(` Recording not available for this project's runtimes (`,-1)),createBaseVNode(`code`,null,toDisplayString(__props.unavailable.join("`, `")),1),_cache[8]||(_cache[8]=createTextVNode(`). Imports and Calls still work. `,-1))])):(openBlock(),createElementBlock(`p`,_hoisted_5$8,`No recordings yet. Use Record to capture what runs, then pick a request here.`))])):(openBlock(),createElementBlock(Fragment,{key:3},[createVNode(unref(_sfc_main$12),{"model-value":__props.recordingId,items:recordingItems.value,label:`Recording`,loading:__props.loading,variant:`outlined`,density:`comfortable`,"hide-details":``,class:`usage-recordings__select`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:recordingId`,$event))},null,8,[`model-value`,`items`,`loading`]),selectedRecording.value&&__props.sessionId?(openBlock(),createBlock(unref(Vibe64UsageRecordingSummary_default),{key:0,recording:selectedRecording.value,"session-id":__props.sessionId,onDeleted:_cache[2]||(_cache[2]=$event=>emit(`deleted`,$event))},null,8,[`recording`,`session-id`])):createCommentVNode(``,true),createVNode(VTextField,{"model-value":__props.search,label:`Search requests`,"prepend-inner-icon":`$search`,variant:`outlined`,density:`comfortable`,maxlength:`80`,clearable:``,"hide-details":``,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>emit(`update:search`,$event||``))},null,8,[`model-value`]),createVNode(VSwitch,{"model-value":__props.includeEmpty,color:`primary`,density:`compact`,inset:``,"hide-details":``,label:`Show requests that ran no project code`,class:`usage-recordings__switch`,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>emit(`update:includeEmpty`,Boolean($event)))},null,8,[`model-value`]),selectedRecording.value?.state===`recording`?(openBlock(),createElementBlock(`p`,_hoisted_6$7,`Recording now. New requests appear as they finish.`)):createCommentVNode(``,true),selectedRecording.value?.requestLog?.full?(openBlock(),createBlock(VAlert,{key:2,type:`warning`,variant:`tonal`,density:`compact`},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(` Request log full; later requests not recorded `,-1)])]),_:1})):createCommentVNode(``,true),__props.includeEmpty&&selectedRecording.value?.requestLog?.assets?(openBlock(),createElementBlock(`p`,_hoisted_7$6,toDisplayString(unref(countLabel)(selectedRecording.value.requestLog.assets,`script, style, image or font load`))+` counted, not listed. `,1)):createCommentVNode(``,true),selectedRecording.value?.target?.kind===`web`&&unref(onlyBackground)(__props.requests)?(openBlock(),createBlock(VAlert,{key:4,type:`info`,variant:`tonal`,density:`compact`,class:`usage-recordings__shared`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(BACKGROUND_TEXT))+`: its requests share one process, so this recording shows everything that ran while it recorded. `,1)]),_:1})):createCommentVNode(``,true),__props.requestsLoading&&!groups.value.length?(openBlock(),createElementBlock(`div`,_hoisted_8$6,[(openBlock(),createElementBlock(Fragment,null,renderList(4,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!groups.value.length?(openBlock(),createElementBlock(`p`,_hoisted_9$6,toDisplayString(__props.search?`No requests match.`:`No requests ran project code yet.`),1)):(openBlock(),createBlock(VList,{key:7,class:`usage-recordings__list`,density:`comfortable`,"aria-label":`Requests`,role:`listbox`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(groups.value,(group,position)=>{return openBlock(),createElementBlock(Fragment,{key:group.key},[group.interaction||position>0?(openBlock(),createBlock(VListSubheader,{key:0,class:`usage-recordings__interaction`},{default:withCtx(()=>[createTextVNode(toDisplayString(group.interaction?unref(interactionTitle)(group.interaction):`Other requests`),1)]),_:2},1024)):createCommentVNode(``,true),group.offersInteraction?(openBlock(),createBlock(VListItem,{key:1,active:group.interaction.id===__props.interactionId,role:`option`,"aria-selected":group.interaction.id===__props.interactionId,color:`primary`,rounded:`xl`,lines:`two`,class:`usage-recordings__request`,onClick:$event=>emit(`update:interactionId`,group.interaction.id)},{prepend:withCtx(()=>[createVNode(VChip,{size:`small`,variant:`tonal`,label:``,class:`usage-recordings__method`},{default:withCtx(()=>[createVNode(VIcon,{icon:`$adsClick`,size:`small`})]),_:1})]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(interactionRunTitle)(group.interaction)),1)]),_:2},1024),group.interaction.requestCount?(openBlock(),createBlock(VListItemSubtitle,{key:0},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(countLabel)(group.interaction.requestCount,`request`)),1)]),_:2},1024)):createCommentVNode(``,true)]),_:2},1032,[`active`,`aria-selected`,`onClick`])):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(group.requests,request=>{return openBlock(),createBlock(VListItem,{key:request.id,active:request.id===__props.requestId,role:`option`,"aria-selected":request.id===__props.requestId,color:`primary`,rounded:`xl`,lines:`two`,class:normalizeClass([`usage-recordings__request`,{"usage-recordings__request--secondary":unref(isReadinessRequest)(request)}]),onClick:$event=>emit(`update:requestId`,request.id)},{prepend:withCtx(()=>[createVNode(VChip,{size:`small`,variant:`tonal`,label:``,class:`usage-recordings__method`,title:markOf(request)?.label},{default:withCtx(()=>[markOf(request)?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(VIcon,{icon:markOf(request).icon,size:`small`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_10$5,toDisplayString(markOf(request).label),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(request.method||`–`),1)],64))]),_:2},1032,[`title`])]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(unref(requestTitle)(request,__props.requests)),(part,index)=>{return openBlock(),createElementBlock(Fragment,{key:index},[createTextVNode(toDisplayString(part),1),_cache[10]||(_cache[10]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),_:2},1024),createVNode(VListItemSubtitle,null,{default:withCtx(()=>[createTextVNode(toDisplayString(subtitle(request)),1)]),_:2},1024)]),_:2},1032,[`active`,`aria-selected`,`class`,`onClick`])}),128))],64)}),128))]),_:1})),groups.value.length&&(__props.hasMore||__props.newestFirst)?(openBlock(),createElementBlock(`div`,_hoisted_11$5,[createBaseVNode(`p`,_hoisted_12$5,toDisplayString(footerText.value),1),__props.hasMore?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,size:`small`,loading:__props.requestsLoading,onClick:_cache[5]||(_cache[5]=$event=>emit(`more`))},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(`Show more`,-1)])]),_:1},8,[`loading`])):createCommentVNode(``,true)])):createCommentVNode(``,true)],64))])}}};var Vibe64UsageRecordingResults_default=_plugin_vue_export_helper_default(_sfc_main$8,[[`__scopeId`,`data-v-4dd8258c`]]);function hasWindowFunction(name){return typeof window!==`undefined`&&typeof window[name]===`function`}var _hoisted_1$7={key:0,class:`usage-web__empty text-body-medium`,role:`status`};var _hoisted_2$7=[`aria-label`];var _hoisted_3$7={key:0,class:`usage-web__group-title text-title-small`};var _hoisted_4$7={class:`usage-web__cards`};var _hoisted_5$7={key:0,class:`text-body-small`};var _hoisted_6$6={class:`usage-web__crossings`,"aria-label":`Crossings`};var _hoisted_7$5={class:`usage-web__zoom`};var _hoisted_8$5={class:`usage-web__zoom-title text-title-medium`};var _hoisted_9$5={key:0,class:`usage-web__legend`,"aria-label":`Legend`};var _hoisted_10$4={key:0,class:`usage-web__crossings`,"aria-label":`Leaving this subsystem`};var _hoisted_11$4={key:1,class:`usage-web__empty text-body-medium`,role:`status`};var _hoisted_12$4={class:`usage-web__row-path`};var _hoisted_13$4={class:`usage-web__row-counts`};var _hoisted_14$4={key:3,class:`usage-web__frame`};var _hoisted_15$3=[`width`,`height`];var _hoisted_16$3=[`id`];var _hoisted_17$3=[`d`,`marker-end`];var _hoisted_18$3=[`x1`,`y1`,`x2`,`y2`];var _hoisted_19$3=[`cx`,`cy`];var _hoisted_20$3=[`aria-pressed`,`aria-label`,`title`,`onClick`];var _hoisted_21$3={class:`usage-node__head`};var _hoisted_22$3={class:`usage-node__title text-body-medium`};var _hoisted_23$2={key:0,class:`usage-node__badge text-label-small`};var _hoisted_24$2={class:`usage-node__subtitle text-body-small`};var _hoisted_25$2={class:`usage-node__file`};var _hoisted_26$2={key:0,class:`usage-node__line`};var _hoisted_27$2={key:0,class:`usage-web__more`,"aria-hidden":`true`};var stubRoom=32;var _sfc_main$7={__name:`Vibe64UsageWebCanvas`,props:{mode:{type:String,required:true},subsystems:{type:Array,default:()=>[]},groups:{type:Array,default:()=>[]},crossings:{type:Array,default:()=>[]},zoomedId:{type:String,default:``},nodes:{type:Array,default:()=>[]},edges:{type:Array,default:()=>[]},selectedId:{type:String,default:``},showUntouched:{type:Boolean,default:false},compact:{type:Boolean,default:false},startSubsystemId:{type:String,default:``}},emits:[`zoom`,`select`,`update:showUntouched`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const countKey=computed(()=>COUNT_KEYS[props.mode]);const reached=item=>Number(item[countKey.value]||0)>0;const cardText=item=>subsystemCard(props.mode,item);const layout=computed(()=>subsystemSections(props.subsystems,props.groups,{countKey:countKey.value,showUntouched:props.showUntouched}));const zoomedTitle=computed(()=>props.subsystems.find(item=>item.id===props.zoomedId)?.title||props.zoomedId);const leaving=computed(()=>props.zoomedId?crossingsFrom(props.crossings,props.zoomedId,props.subsystems):[]);const emptyText=computed(()=>props.mode===`recording`?`This request ran no project code that the last scan knows.`:`Nothing is reached from this entry.`);const zoomEmptyText=computed(()=>props.mode===`imports`?`No files in this subsystem are reached.`:props.mode===`calls`?`No functions in this subsystem are reached.`:`No functions in this subsystem ran.`);const columns=computed(()=>depthColumns(props.nodes));const plan=computed(()=>canvasLayout(props.nodes,props.edges));const stubs=computed(()=>props.nodes.filter(node=>node.unresolved).map(node=>{const position=plan.value.positions.get(node.id);return{id:node.id,count:node.unresolved,x:position.x+NODE.width,y:position.y+NODE.height-12}}));const arrowId=`usage-arrow-${useId()}`;const scroller=ref(null);const moreRight=ref(false);function measureScroll(){const element=scroller.value;moreRight.value=Boolean(element)&&element.scrollLeft+element.clientWidth<element.scrollWidth-1}let resizeObserver=null;watch(scroller,element=>{resizeObserver?.disconnect();resizeObserver=null;if(element&&hasWindowFunction(`ResizeObserver`)){resizeObserver=new ResizeObserver(measureScroll);resizeObserver.observe(element)}measureScroll()},{flush:`post`});watch(plan,()=>nextTick(measureScroll));onBeforeUnmount(()=>resizeObserver?.disconnect());function nodeStyle(node){const position=plan.value.positions.get(node.id);return{left:`${position.x}px`,top:`${position.y}px`,width:`${NODE.width}px`,height:`${NODE.height}px`}}const SHORT_JOIN=Object.freeze({stale:`changed`,none:`not scanned`});function badge(node,full=false){if(props.mode===`recording`&&node.join!==`exact`&&node.join!==`name-line`)return full?joinText(node.join,node.reason):SHORT_JOIN[node.join]||``;if(props.mode===`recording`)return node.count==null?`ran`:`×${node.count.toLocaleString()}`;if(node.certainty===`probable`)return full?`only via probable calls`:`probable`;return``}function rowCounts(node){if(props.mode===`recording`)return badge(node,true);const[out,into]=props.mode===`imports`?[`imports`,`imported by`]:[`calls`,`called by`];return[badge(node,true),`${out} ${node.outCount} → · ${into} ${node.inCount} ←`,node.unresolved&&countLabel(node.unresolved,`unresolved call`)].filter(Boolean).join(` · `)}function nodeLabel(node){return[node.title,node.subtitle,props.mode===`recording`?badge(node,true):rowCounts(node)].filter(Boolean).join(`, `)}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,{class:normalizeClass([`usage-web`,{"usage-web--compact":__props.compact}])},[!__props.zoomedId?(openBlock(),createElementBlock(Fragment,{key:0},[!layout.value.sections.length?(openBlock(),createElementBlock(`p`,_hoisted_1$7,toDisplayString(emptyText.value),1)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(layout.value.sections,section=>{return openBlock(),createElementBlock(`section`,{key:section.id||`all`,class:`usage-web__group`,"aria-label":section.title||`Subsystems`},[section.title?(openBlock(),createElementBlock(`h3`,_hoisted_3$7,toDisplayString(section.title),1)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_4$7,[(openBlock(true),createElementBlock(Fragment,null,renderList(section.cards,card=>{return openBlock(),createBlock(VCard,{key:card.id,class:normalizeClass([`usage-web__card`,{"usage-web__card--untouched":!reached(card)}]),rounded:`lg`,disabled:!reached(card),"aria-label":`${card.title}: ${cardText(card).count}`,onClick:$event=>emit(`zoom`,card.id)},{default:withCtx(()=>[createVNode(VCardItem,null,createSlots({default:withCtx(()=>[createVNode(VCardTitle,{class:`text-title-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(card.title),1)]),_:2},1024),createVNode(VCardSubtitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(cardText(card).count),1)]),_:2},1024)]),_:2},[card.id===__props.startSubsystemId?{name:`append`,fn:withCtx(()=>[_cache[2]||(_cache[2]=createBaseVNode(`span`,{class:`usage-web__start text-label-medium`},`Starts here`,-1))]),key:`0`}:void 0]),1024),cardText(card).detail||cardText(card).plumbing||unref(crossingsFrom)(__props.crossings,card.id,__props.subsystems).length?(openBlock(),createBlock(VCardText,{key:0,class:`usage-web__card-body`},{default:withCtx(()=>[cardText(card).detail?(openBlock(),createElementBlock(`p`,_hoisted_5$7,toDisplayString(cardText(card).detail),1)):createCommentVNode(``,true),cardText(card).plumbing?(openBlock(),createBlock(VChip,{key:1,size:`small`,variant:`tonal`,class:`usage-web__plumbing`},{default:withCtx(()=>[createTextVNode(`Shared plumbing (`+toDisplayString(cardText(card).plumbing)+`)`,1)]),_:2},1024)):createCommentVNode(``,true),createBaseVNode(`ul`,_hoisted_6$6,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(crossingsFrom)(__props.crossings,card.id,__props.subsystems),crossing=>{return openBlock(),createElementBlock(`li`,{key:crossing.toSubsystemId,class:`text-body-small`},` → `+toDisplayString(crossing.title)+` · `+toDisplayString(unref(crossingText)(__props.mode,crossing)),1)}),128))])]),_:2},1024)):createCommentVNode(``,true)]),_:2},1032,[`class`,`disabled`,`aria-label`,`onClick`])}),128))])],8,_hoisted_2$7)}),128)),layout.value.untouched?(openBlock(),createBlock(VChip,{key:1,class:`usage-web__untouched`,variant:__props.showUntouched?`tonal`:`outlined`,"prepend-icon":__props.showUntouched?`$check`:void 0,role:`switch`,"aria-checked":__props.showUntouched,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:showUntouched`,!__props.showUntouched))},{default:withCtx(()=>[createTextVNode(` Show untouched (`+toDisplayString(layout.value.untouched)+`) `,1)]),_:1},8,[`variant`,`prepend-icon`,`aria-checked`])):createCommentVNode(``,true)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`header`,_hoisted_7$5,[createVNode(VBtn,{variant:`text`,onClick:_cache[1]||(_cache[1]=$event=>emit(`zoom`,``))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`All subsystems`,-1)])]),_:1}),createBaseVNode(`h3`,_hoisted_8$5,toDisplayString(zoomedTitle.value),1),renderSlot(_ctx.$slots,`zoom-actions`,{},void 0,true),__props.mode!==`imports`&&!__props.compact?(openBlock(),createElementBlock(`div`,_hoisted_9$5,[createVNode(VChip,{size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createBaseVNode(`svg`,{width:`24`,height:`8`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`4`,x2:`24`,y2:`4`,class:`usage-web__line usage-web__line--exact`})],-1),createTextVNode(`Exact`,-1)])]),_:1}),createVNode(VChip,{size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createBaseVNode(`svg`,{width:`24`,height:`8`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`4`,x2:`24`,y2:`4`,class:`usage-web__line usage-web__line--probable`})],-1),createTextVNode(`Probable`,-1)])]),_:1}),__props.mode===`calls`?(openBlock(),createBlock(VChip,{key:0,size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createBaseVNode(`svg`,{width:`24`,height:`10`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`5`,x2:`14`,y2:`5`,class:`usage-web__line usage-web__line--probable`}),createBaseVNode(`circle`,{cx:`18`,cy:`5`,r:`4`,class:`usage-web__stub`})],-1),createTextVNode(`Unresolved`,-1)])]),_:1})):createCommentVNode(``,true)])):createCommentVNode(``,true)]),leaving.value.length?(openBlock(),createElementBlock(`ul`,_hoisted_10$4,[(openBlock(true),createElementBlock(Fragment,null,renderList(leaving.value,crossing=>{return openBlock(),createElementBlock(`li`,{key:crossing.toSubsystemId,class:`text-body-small`},`→ `+toDisplayString(crossing.title)+` · `+toDisplayString(unref(crossingText)(__props.mode,crossing)),1)}),128))])):createCommentVNode(``,true),!__props.nodes.length?(openBlock(),createElementBlock(`p`,_hoisted_11$4,toDisplayString(zoomEmptyText.value),1)):__props.compact?(openBlock(),createBlock(VList,{key:2,class:`usage-web__rows`,density:`comfortable`,"aria-label":`Reached in this subsystem`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(columns.value,column=>{return openBlock(),createElementBlock(Fragment,{key:column.depth},[createVNode(VListSubheader,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(depthTitle)(column.depth)),1)]),_:2},1024),(openBlock(true),createElementBlock(Fragment,null,renderList(column.items,node=>{return openBlock(),createBlock(VListItem,{key:node.id,active:node.id===__props.selectedId,color:`primary`,rounded:`lg`,lines:`three`,title:node.title,onClick:$event=>emit(`select`,node)},{subtitle:withCtx(()=>[createBaseVNode(`span`,_hoisted_12$4,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(node.subtitle),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[7]||(_cache[7]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),createBaseVNode(`span`,_hoisted_13$4,toDisplayString(rowCounts(node)),1)]),_:2},1032,[`active`,`title`,`onClick`])}),128))],64)}),128))]),_:1})):(openBlock(),createElementBlock(`div`,_hoisted_14$4,[createBaseVNode(`div`,{ref_key:`scroller`,ref:scroller,class:`usage-web__scroll`,onScrollPassive:measureScroll},[createBaseVNode(`div`,{class:`usage-web__plane`,style:normalizeStyle({width:`${plan.value.width+stubRoom}px`,height:`${plan.value.height}px`})},[(openBlock(),createElementBlock(`svg`,{class:`usage-web__edges`,width:plan.value.width+stubRoom,height:plan.value.height,"aria-hidden":`true`},[createBaseVNode(`defs`,null,[(openBlock(),createElementBlock(Fragment,null,renderList([`exact`,`probable`],certainty=>{return createBaseVNode(`marker`,{id:`${arrowId}-${certainty}`,key:certainty,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`},[createBaseVNode(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,class:normalizeClass(`usage-web__arrow usage-web__arrow--${certainty}`)},null,2)],8,_hoisted_16$3)}),64))]),(openBlock(true),createElementBlock(Fragment,null,renderList(plan.value.paths,edge=>{return openBlock(),createElementBlock(`path`,{key:edge.key,d:edge.d,"marker-end":`url(#${arrowId}-${edge.certainty===`probable`?`probable`:`exact`})`,class:normalizeClass([`usage-web__line`,[`usage-web__line--${edge.certainty||`exact`}`,{"usage-web__line--dim":__props.selectedId&&edge.from!==__props.selectedId&&edge.to!==__props.selectedId}]])},null,10,_hoisted_17$3)}),128)),(openBlock(true),createElementBlock(Fragment,null,renderList(stubs.value,stub=>{return openBlock(),createElementBlock(`g`,{key:stub.id},[createBaseVNode(`line`,{x1:stub.x,y1:stub.y,x2:stub.x+14,y2:stub.y,class:`usage-web__line usage-web__line--probable`},null,8,_hoisted_18$3),createBaseVNode(`circle`,{cx:stub.x+19,cy:stub.y,r:`5`,class:`usage-web__stub`},[createBaseVNode(`title`,null,toDisplayString(unref(countLabel)(stub.count,`unresolved call`)),1)],8,_hoisted_19$3)])}),128))],8,_hoisted_15$3)),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.nodes,node=>{return openBlock(),createElementBlock(`button`,{key:node.id,type:`button`,class:normalizeClass([`usage-node`,{"usage-node--selected":node.id===__props.selectedId,"usage-node--probable":node.certainty===`probable`,"usage-node--plumbing":node.plumbing}]),style:normalizeStyle(nodeStyle(node)),"aria-pressed":node.id===__props.selectedId,"aria-label":nodeLabel(node),title:[node.title,node.subtitle,badge(node,true)].filter(Boolean).join(`
|
|
1
|
+
import{r as VToolbarTitle,t as VToolbar}from"./project-shared-VToolbar-DmXu_VIt.js";import{c as VBottomSheet,i as USAGE_RECORDING_API_SUFFIX,r as Vibe64UsageRecordDialog_default,t as Vibe64UsageRecordingSummary_default}from"./project-shared-VBottomSheet-Bezz1r7A.js";import{Ac as vModelSelect,Ba as VMenu,Bc as createCommentVNode,Dl as markRaw,Ec as useRouter,El as isRef,Fc as Fragment,Fl as toRef,Ga as VListSubheader,Gc as createTextVNode,Ha as VList,Hl as toDisplayString,Ja as VListItemSubtitle,Ka as VListItem,Kc as createVNode,Lc as computed,Mc as vShow,Ml as ref,Na as VVirtualScroll,Nc as withKeys,Nl as shallowRef,Pa as VTextField,Pc as withModifiers,Pl as toRaw,Qa as VChipGroup,Rc as createBaseVNode,Rl as unref,Sl as withDirectives,Tc as useRoute,Uc as createSlots,Vc as createElementBlock,Vl as normalizeStyle,Xa as VDivider,Xi as _plugin_vue_export_helper_default,Za as VChip,_a as VCardItem,al as onBeforeUnmount,cl as openBlock,dl as renderSlot,do as VProgressLinear,ea as VSwitch,fi as _sfc_main$12,fl as resolveComponent,ga as VCardText,gl as useId,ha as VCard,jc as vModelText,kc as useCssVars,lo as VAlert,ml as toHandlers,mo as VBtnToggle,ni as usePaths,nl as mergeProps,po as VIcon,qa as VListItemTitle,qo as getHttpWebClient,ra as VSkeletonLoader,rl as nextTick,ul as renderList,uo as VBtn,va as VCardTitle,xa as VDialog,xl as withCtx,ya as VCardSubtitle,yl as watch,zc as createBlock,zl as normalizeClass}from"./index-BAvE8_Ib.js";import{a as _sfc_main$d,i as _sfc_main$1$1,n as Position,s as _sfc_main$f,t as MarkerType}from"./vue-flow-core-BwhpINSc.js";import{n as SYSTEM_GRAPH_API_SUFFIX,r as useVibe64SystemGraph}from"./client-wU-vn9Gt.js";function layeredGraph(nodes=[],edges=[]){const byId=new Map(nodes.map(node=>[node.id,node]));const outgoing=new Map([...byId.keys()].map(id=>[id,new Set]));const incoming=new Map([...byId.keys()].map(id=>[id,new Set]));const validEdges=edges.filter(edge=>byId.has(edge.fromId)&&byId.has(edge.toId)&&edge.fromId!==edge.toId);for(const edge of validEdges){outgoing.get(edge.fromId).add(edge.toId);incoming.get(edge.toId).add(edge.fromId)}const visited=new Set;const finish=[];for(const id of[...byId.keys()].sort()){if(visited.has(id))continue;const stack=[[id,false]];while(stack.length){const[current,complete]=stack.pop();if(complete){finish.push(current);continue}if(visited.has(current))continue;visited.add(current);stack.push([current,true]);for(const target of outgoing.get(current))if(!visited.has(target))stack.push([target,false])}}const groupById=new Map;const groups=[];for(const id of finish.reverse()){if(groupById.has(id))continue;const members=[];const stack=[id];const group={id:``,members,dependencies:new Set,consumers:new Set,rank:0};while(stack.length){const current=stack.pop();if(groupById.has(current))continue;groupById.set(current,group);members.push(current);for(const source of incoming.get(current))if(!groupById.has(source))stack.push(source)}members.sort();group.id=JSON.stringify(members);group.cyclic=members.length>1;groups.push(group)}for(const edge of validEdges){const source=groupById.get(edge.fromId);const target=groupById.get(edge.toId);if(source===target)continue;source.dependencies.add(target);target.consumers.add(source)}const remaining=new Map(groups.map(group=>[group,group.dependencies.size]));const queue=groups.filter(group=>!group.dependencies.size);for(let index=0;index<queue.length;index++){const group=queue[index];for(const consumer of group.consumers){consumer.rank=Math.max(consumer.rank,group.rank+1);remaining.set(consumer,remaining.get(consumer)-1);if(!remaining.get(consumer))queue.push(consumer)}}const rows=new Map;for(const group of groups){if(!rows.has(group.rank))rows.set(group.rank,[]);rows.get(group.rank).push(group)}return{layers:[...rows].sort(([a],[b])=>b-a).map(([rank,row])=>({rank,groups:row.sort((a,b)=>a.id.localeCompare(b.id)).map(group=>({id:group.id,rank,cyclic:group.cyclic,members:group.members.map(id=>byId.get(id))}))})),edges:validEdges,disconnectedIds:new Set([...byId.keys()].filter(id=>!outgoing.get(id).size&&!incoming.get(id).size)),nodeRanks:new Map([...groupById].map(([id,group])=>[id,group.rank])),cyclicIds:new Set([...groupById].filter(([,group])=>group.cyclic).map(([id])=>id))}}function architectureGraph(architecture,subsystemId=``,{includeTypeOnly=false}={}){const files=architecture?.files||[];const subsystems=architecture?.subsystems||[];const packages=architecture?.packages||[];const relations=(architecture?.relations||[]).filter(relation=>(includeTypeOnly||!(relation.typeOnly||relation.kind===`type-import`))&&relation.resolution===`resolved`&&(relation.targetFileId||relation.targetPackageId));const usedPackages=new Set(relations.map(relation=>relation.targetPackageId));const boundaries=packages.map(entry=>({...entry,title:entry.name,kind:`package`,path:entry.root,fileIds:[],provenance:`package`}));const filesById=new Map([...files,...boundaries].map(file=>[file.id,file]));const sourceFileIds=new Set(files.map(file=>file.id));const fileEdges=relations.map(relation=>({fromId:relation.fromFileId,toId:relation.targetFileId||relation.targetPackageId,evidence:[relation]}));const concrete=layeredGraph(files,fileEdges.filter(edge=>sourceFileIds.has(edge.toId)));const externalCycleFileIds=new Set;if(subsystemId){for(const row of concrete.layers)for(const component of row.groups)if(component.cyclic&&component.members.some(file=>file.subsystemId===subsystemId)&&component.members.some(file=>file.subsystemId!==subsystemId)){for(const file of component.members)if(file.subsystemId===subsystemId)externalCycleFileIds.add(file.id)}}const localPackageIds=new Set(relations.filter(relation=>filesById.get(relation.fromFileId)?.subsystemId===subsystemId&&!relation.targetFileId).map(relation=>relation.targetPackageId));const nodes=subsystemId?[...files.filter(file=>file.subsystemId===subsystemId),...boundaries.filter(entry=>localPackageIds.has(entry.id))]:subsystems.filter(entry=>!entry.opaque||usedPackages.has(entry.packageId));const aggregated=new Map;const boundary=[];for(const edge of fileEdges){const from=filesById.get(edge.fromId);const to=filesById.get(edge.toId);if(!from||!to)continue;if(subsystemId){if(from.subsystemId===subsystemId&&(to.subsystemId===subsystemId||localPackageIds.has(to.id))){const key=JSON.stringify([edge.fromId,edge.toId]);if(!aggregated.has(key))aggregated.set(key,{...edge,evidence:[]});aggregated.get(key).evidence.push(...edge.evidence)}else if(from.subsystemId===subsystemId||to.subsystemId===subsystemId)boundary.push({...edge,from,to})}else if(from.subsystemId!==to.subsystemId){const key=`${from.subsystemId}->${to.subsystemId}`;if(!aggregated.has(key))aggregated.set(key,{fromId:from.subsystemId,toId:to.subsystemId,evidence:[]});aggregated.get(key).evidence.push(...edge.evidence)}}const graph=layeredGraph(nodes,[...aggregated.values()]);const groupByOwner=new Map(graph.layers.flatMap(layer=>layer.groups.flatMap(group=>group.members.map(member=>[member.id,group.id]))));const concreteCycleGroups=new Set;if(!subsystemId)for(const row of concrete.layers)for(const component of row.groups){if(!component.cyclic)continue;const owners=new Set(component.members.map(file=>file.subsystemId));const groups=new Set([...owners].map(id=>groupByOwner.get(id)));if(owners.size>1&&groups.size===1)concreteCycleGroups.add(groups.values().next().value)}for(const layer of graph.layers)for(const group of layer.groups)group.cycleLabel=group.cyclic&&!subsystemId&&!concreteCycleGroups.has(group.id)?`Bidirectional subsystem coupling`:`Dependency cycle`;return{...graph,boundary,externalCycleFileIds}}var externalDependenciesId=`visual:external-dependencies`;function pageConnections(ui,pageId){const parents=new Set([pageId]);const children=new Map;for(const use of ui?.componentUses||[]){if(!children.has(use.parentId))children.set(use.parentId,[]);children.get(use.parentId).push(use)}const pending=[pageId];while(pending.length)for(const use of children.get(pending.pop())||[])for(const id of[use.id,use.componentId]){if(!id||parents.has(id))continue;parents.add(id);pending.push(id)}return(ui?.connections||[]).filter(connection=>parents.has(connection.parentId))}function pageHierarchy(ui){const pages=ui?.pages||[];const registrations=ui?.registrations||[];const rows=[];const children=new Map;for(const page of pages){const parent=page.parentId||null;if(!children.has(parent))children.set(parent,[]);children.get(parent).push(page)}for(const list of children.values())list.sort((a,b)=>b.title.localeCompare(a.title));const stack=(children.get(null)||[]).map(page=>({page,depth:0}));while(stack.length){const{page,depth}=stack.pop();rows.push({...page,depth,registrations:registrations.filter(entry=>entry.pageId===page.id)});stack.push(...(children.get(page.id)||[]).map(child=>({page:child,depth:depth+1})))}return rows}function pageStoryboard(ui){const rows=pageHierarchy(ui);const children=new Map;const widths=new Map;const heights=new Map;const depthHeights=new Map;const cardWidth=264;const siblingGap=36;for(const page of rows){if(!children.has(page.parentId||null))children.set(page.parentId||null,[]);children.get(page.parentId||null).push(page);const identities=[...new Set(page.registrations.map(entry=>entry.identity))];const height=Math.max(120,64+Math.ceil(page.title.length/24)*26+identities.reduce((total,identity)=>total+Math.ceil(identity.length/32)*20,0));heights.set(page.id,height);depthHeights.set(page.depth,Math.max(depthHeights.get(page.depth)||0,height))}for(const page of[...rows].reverse()){const descendants=children.get(page.id)||[];widths.set(page.id,Math.max(cardWidth,descendants.reduce((total,child)=>total+widths.get(child.id),0)+Math.max(0,descendants.length-1)*siblingGap))}const depthTops=new Map;let y=0;for(const[depth,height]of[...depthHeights].sort((a,b)=>a[0]-b[0])){depthTops.set(depth,y);y+=height+84}const left=new Map;let rootLeft=0;for(const root of children.get(null)||[]){left.set(root.id,rootLeft);rootLeft+=widths.get(root.id)+100}return{nodes:rows.map(page=>{let childLeft=left.get(page.id);for(const child of children.get(page.id)||[]){left.set(child.id,childLeft);childLeft+=widths.get(child.id)+siblingGap}return{id:page.id,type:`page`,position:{x:left.get(page.id)+(widths.get(page.id)-cardWidth)/2,y:depthTops.get(page.depth)},style:{width:`${cardWidth}px`,height:`${heights.get(page.id)}px`},data:{...page,identities:[...new Set(page.registrations.map(entry=>entry.identity))],childCount:(children.get(page.id)||[]).length}}}),edges:rows.filter(page=>page.parentId).map(page=>({id:`parent:${page.id}`,source:page.parentId,target:page.id,sourceHandle:`children`,targetHandle:`parent`,type:`smoothstep`,selectable:false,style:{stroke:`rgb(var(--v-theme-outline))`,strokeWidth:2}}))}}function engineOverview(architecture,order=[]){const orderIndex=new Map(order.map((id,index)=>[id,index]));const graph=architectureGraph(architecture);const externalPackages=graph.layers.flatMap(layer=>layer.groups.flatMap(group=>group.members)).filter(owner=>owner.opaque).sort((a,b)=>a.title.localeCompare(b.title));const applicationLayers=graph.layers.map(layer=>({...layer,groups:layer.groups.map(group=>({...group,members:group.members.filter(owner=>!owner.opaque)})).filter(group=>group.members.length)}));const files=new Map((architecture?.files||[]).map(file=>[file.id,file]));const placements=new Map((architecture?.layout?.groups||[]).flatMap((group,index)=>group.subsystems.map((member,memberIndex)=>[member.root,{...member,kind:group.kind,groupId:group.id,order:index,memberOrder:memberIndex}])));const entryOwners=new Set((architecture?.entryPoints||[]).filter(entry=>entry.resolution===`resolved`).map(entry=>entry.subsystemId));const cards=new Map;const totals=applicationLayers.flatMap(layer=>layer.groups.flatMap(group=>group.members)).map(subsystem=>(subsystem.fileIds||[]).map(id=>files.get(id)?.sourceLines).filter(Number.isSafeInteger).reduce((sum,lines)=>sum+Math.max(0,lines),0));const largest=Math.max(1,...totals);for(const layer of applicationLayers)for(const group of layer.groups)for(const subsystem of group.members){const sourceFiles=(subsystem.fileIds||[]).map(id=>files.get(id)).filter(Boolean);const measured=sourceFiles.filter(file=>Number.isSafeInteger(file.sourceLines)&&file.sourceLines>=0);const sourceLines=measured.length?measured.reduce((total,file)=>total+file.sourceLines,0):null;const volume=Math.log1p((sourceLines||0)/100)/Math.log1p(largest/100);const placement=placements.get(subsystem.root);const width=260+160*volume;const height=width;const publicEntries=(architecture?.packages||[]).filter(pkg=>pkg.subsystemId===subsystem.id).flatMap(pkg=>pkg.entryPoints||[]);const receivingFiles=new Set((architecture?.relations||[]).filter(relation=>relation.resolution===`resolved`&&files.get(relation.targetFileId)?.subsystemId===subsystem.id&&files.get(relation.fromFileId)?.subsystemId!==subsystem.id).map(relation=>relation.targetFileId));const publicCount=new Set(publicEntries.flatMap(entry=>(entry.symbols||[]).map(symbol=>`${symbol.sourceFile||entry.file}:${symbol.qualifiedName||symbol.name}:${symbol.start?.line||``}`))).size;const publicSummary=publicCount?`${publicCount} public declaration${publicCount===1?``:`s`}`:publicEntries.length?`Public declarations need analysis`:receivingFiles.size?`Exported signatures to review`:`Public interface not recorded`;cards.set(subsystem.id,{id:subsystem.id,type:`subsystem`,style:{width:`${width}px`,height:`${height}px`},data:{...subsystem,...placement?{placementKind:placement.kind}:{},publicSummary,library:placement?.kind===`libraries`,presentationOrder:placement?.order??Infinity,memberOrder:placement?.memberOrder??Infinity,sourceLines,sizePartial:measured.length!==sourceFiles.length,measuredFiles:measured.length,sourceVolume:(sourceLines||0)/largest,entryFiles:(architecture?.entryPoints||[]).filter(entry=>entry.subsystemId===subsystem.id).map(entry=>entry.file),cycleLabel:group.cyclic?group.cycleLabel:``,disconnected:graph.disconnectedIds.has(subsystem.id),rank:layer.rank}})}const sourceCards=[...cards.values()].sort((a,b)=>(orderIndex.get(a.id)??Infinity)-(orderIndex.get(b.id)??Infinity)||Number(!entryOwners.has(a.id))-Number(!entryOwners.has(b.id))||Number(a.data.placementKind===`support`)-Number(b.data.placementKind===`support`)||a.data.presentationOrder-b.data.presentationOrder||a.data.memberOrder-b.data.memberOrder||(a.data.root||a.id).localeCompare(b.data.root||b.id));const libraryCards=sourceCards.filter(card=>card.data.library);const applicationCards=sourceCards.filter(card=>!card.data.library);const columns=Math.min(6,Math.max(1,Math.ceil(Math.sqrt(applicationCards.length))));const cellSize=Math.max(280,...applicationCards.map(card=>parseFloat(card.style.width)));const gap=56;const applicationWidth=applicationCards.length?columns*cellSize+(columns-1)*gap:0;const rowCount=Math.ceil(applicationCards.length/columns);const applicationHeight=rowCount?rowCount*cellSize+(rowCount-1)*gap:0;const decorations=[];const nodes=[];for(const[index,card]of applicationCards.entries()){const inset=(cellSize-parseFloat(card.style.width))/2;card.position={x:index%columns*(cellSize+gap)+inset,y:Math.floor(index/columns)*(cellSize+gap)+inset};card.data.arrangeable=true;card.data.initialFocus=index<columns;card.draggable=true;card.dragHandle=`.engine-subsystem__grip`;nodes.push(card)}let width=applicationWidth;let height=Math.max(200,applicationHeight);if(libraryCards.length){const columnX=applicationWidth+48;const columnWidth=Math.max(...libraryCards.map(card=>parseFloat(card.style.width)));decorations.push({id:`visual:shared-libraries`,type:`annotation`,position:{x:columnX,y:0},style:{width:`${columnWidth}px`,height:`76px`},selectable:false,focusable:false,draggable:false,data:{kind:`libraries`,title:`Shared libraries`,detail:`Project-owned reusable interfaces`}});let libraryY=88;for(const card of libraryCards){card.position={x:columnX+(columnWidth-parseFloat(card.style.width))/2,y:libraryY};card.data.library=true;card.draggable=false;nodes.push(card);libraryY+=parseFloat(card.style.height)+24}width=columnX+columnWidth;height=Math.max(height,libraryY-24)}if(externalPackages.length){const columnWidth=Math.min(640,Math.max(420,...externalPackages.map(pkg=>pkg.title.length*9+48)));const charactersPerLine=Math.floor((columnWidth-48)/9);const columnHeight=112+externalPackages.reduce((total,pkg)=>total+15+22*Math.ceil(pkg.title.length/charactersPerLine),0);nodes.push({id:externalDependenciesId,type:`external-dependencies`,position:{x:width+48,y:0},style:{width:`${columnWidth}px`,height:`${columnHeight}px`},draggable:false,data:{id:externalDependenciesId,kind:`external-dependencies`,title:`External dependencies`,root:``,opaque:true,fileIds:[],entryFiles:[],sourceLines:null,packages:externalPackages,description:`Available throughout the project. Select a dependency to read its public interface.`}});width+=48+columnWidth;height=Math.max(height,columnHeight)}return{nodes,edges:[],decorations,width,height,applicationWidth,applicationHeight,externalCount:externalPackages.length}}function symbolSource(path,symbol){return{path,symbolId:symbol.id,symbol:symbol.qualifiedName||symbol.name,line:symbol.start?.line}}function subsystemOutline(architecture,subsystemId){const nativeOwner=(architecture?.subsystems||[]).find(subsystem=>subsystem.id===subsystemId);if(!nativeOwner)return null;const placementGroup=(architecture?.layout?.groups||[]).find(group=>group.subsystems.some(member=>member.root===nativeOwner.root));const owner=placementGroup?.subsystems.find(member=>member.root===nativeOwner.root)?{...nativeOwner,placementKind:placementGroup.kind}:nativeOwner;const files=new Map((architecture?.files||[]).map(file=>[file.id,file]));const local=owner.opaque?[]:[...files.values()].filter(file=>file.subsystemId===owner.id);const localIds=new Set(local.map(file=>file.id));const byPath=new Map(local.map(file=>[file.path,file]));const sourceFilesByPath=new Map([...files.values()].map(file=>[file.path,file]));const symbolsByFile=new Map;for(const symbol of architecture?.symbols||[])if(symbol.visibility===`public`){if(!symbolsByFile.has(symbol.fileId))symbolsByFile.set(symbol.fileId,[]);symbolsByFile.get(symbol.fileId).push(symbol)}const entries=new Map;const addEntry=(file,reason)=>{if(!file||!localIds.has(file.id))return;if(!entries.has(file.id))entries.set(file.id,{file,reasons:new Set,consumers:new Map});entries.get(file.id).reasons.add(reason);return entries.get(file.id)};for(const entry of architecture?.entryPoints||[])if(entry.resolution===`resolved`&&entry.subsystemId===owner.id)addEntry(files.get(entry.fileId)||byPath.get(entry.file),`Application entry`);const publicEntries=(architecture?.packages||[]).filter(pkg=>pkg.subsystemId===owner.id).flatMap(pkg=>(pkg.entryPoints||[]).map(entry=>{const file=byPath.get(entry.file);addEntry(file,`Declared public import`);return{...entry,file,symbols:(entry.symbols||[]).map(symbol=>{const sourceFile=symbol.sourceFile?files.get(`file:${symbol.sourceFile}`)||sourceFilesByPath.get(symbol.sourceFile):file;const candidates=(symbolsByFile.get(sourceFile?.id)||[]).filter(candidate=>!owner.opaque&&(!symbol.sourceHash||symbol.sourceHash===sourceFile.hash)&&(candidate.qualifiedName||candidate.name)===(symbol.sourceQualifiedName||symbol.sourceName||symbol.qualifiedName||symbol.name)&&(!symbol.start||candidate.start?.line===symbol.start.line&&candidate.start?.column===symbol.start.column));const source=candidates.length===1?candidates[0]:null;return{...symbol,...source?{source:symbolSource(sourceFile.path,source)}:{}}}),conditions:entry.conditions||[],importPath:entry.importPath===`.`?pkg.name:`${pkg.name}${entry.importPath?.startsWith(`./`)?entry.importPath.slice(1):`/`+(entry.importPath||``)}`}}));const packages=new Map((architecture?.packages||[]).map(pkg=>[pkg.id,pkg]));const symbolsById=new Map((architecture?.symbols||[]).map(symbol=>[symbol.id,symbol]));const observed=new Map;const fileLinks=new Map;const importsByFile=new Map;const importsBySymbol=new Map;const exposedFiles=new Set(publicEntries.flatMap(entry=>entry.symbols.map(symbol=>sourceFilesByPath.get(symbol.source?.path)?.id)).filter(Boolean));for(const relation of architecture?.relations||[]){if(relation.resolution!==`resolved`)continue;const from=files.get(relation.fromFileId);const to=files.get(relation.targetFileId)||packages.get(relation.targetPackageId);if(!from||!to)continue;if(localIds.has(to.id)||exposedFiles.has(to.id)){if(!importsByFile.has(to.id))importsByFile.set(to.id,new Map);importsByFile.get(to.id).set(from.id,from);for(const id of relation.importedSymbolIds||[]){const symbol=symbolsById.get(id);if(!symbol||symbol.fileId!==to.id||symbol.visibility!==`public`)continue;if(!importsBySymbol.has(id))importsBySymbol.set(id,new Map);importsBySymbol.get(id).set(from.id,from)}}if(localIds.has(to.id)&&!localIds.has(from.id)){addEntry(to,`Used by other subsystems`).consumers.set(from.id,from);for(const id of relation.importedSymbolIds||[]){const symbol=symbolsById.get(id);if(!symbol||symbol.fileId!==to.id||symbol.visibility!==`public`)continue;if(!observed.has(id))observed.set(id,{...symbol,consumers:new Map,source:symbolSource(to.path,symbol)});observed.get(id).consumers.set(from.id,from)}}if(relation.typeOnly||relation.kind===`type-import`)continue;if(from.id!==to.id&&localIds.has(from.id)&&(localIds.has(to.id)||!relation.targetFileId)){const key=JSON.stringify([from.id,to.id]);fileLinks.set(key,{fromId:from.id,toId:to.id,from:from.path,to:to.path||to.name})}}const pages=architecture?.ui?.pages||[];let callsByPage;const operations=(architecture?.ui?.connections||[]).filter(connection=>connection.resolution===`resolved`&&localIds.has(connection.controllerFileId)).map(connection=>{const file=files.get(connection.controllerFileId);addEntry(file,`Receives UI calls`);callsByPage||=new Map(pages.map(page=>[page.id,new Set(pageConnections(architecture.ui,page.id).map(call=>call.id))]));return{...connection,file,pages:pages.filter(page=>callsByPage.get(page.id).has(connection.id))}});const entryFiles=[...entries.values()].map(entry=>({...entry,reasons:[...entry.reasons],consumers:[...entry.consumers.values()],symbols:symbolsByFile.get(entry.file.id)||[]})).sort((a,b)=>a.file.path.localeCompare(b.file.path));const programs=(architecture?.program?.modules||[]).filter(module=>module.subsystemId===owner.id);const programsByFile=new Map;for(const module of architecture?.program?.modules||[])for(const source of module.sources){if(!programsByFile.has(source))programsByFile.set(source,[]);programsByFile.get(source).push(module)}const largest=Math.max(1,...local.map(file=>Number.isSafeInteger(file.sourceLines)?file.sourceLines:0));const root={children:[]};const directories=new Map([[``,root]]);for(const file of local){const prefix=owner.root&&owner.root!==`.`?owner.root+`/`:``;const relativePath=prefix&&file.path.startsWith(prefix)?file.path.slice(prefix.length):file.path;const segments=relativePath.split(`/`);let directory=root;let path=``;for(const name of segments.slice(0,-1)){path=path?path+`/`+name:name;if(!directories.has(path)){const folder={kind:`directory`,name,path,children:[],count:0};directories.set(path,folder);directory.children.push(folder)}directory=directories.get(path);directory.count++}directory.children.push({kind:`file`,id:file.id,name:segments.at(-1),file,relativePath,reasons:entries.has(file.id)?[...entries.get(file.id).reasons]:[],programs:programsByFile.get(file.path)||[],publicCount:symbolsByFile.get(file.id)?.length||0,volume:Number.isSafeInteger(file.sourceLines)?Math.max(0,file.sourceLines)/largest:null})}for(const directory of directories.values())directory.children.sort((a,b)=>(a.kind===b.kind?0:a.kind===`file`?-1:1)||a.name.localeCompare(b.name));const publicSymbols=new Map;const declaredSymbolIds=new Set;for(const entry of publicEntries)for(const symbol of entry.symbols){const key=`${symbol.source?.symbolId||entry.importPath}:${symbol.qualifiedName||symbol.name}:${symbol.start?.line||``}`;if(symbol.source?.symbolId)declaredSymbolIds.add(symbol.source.symbolId);if(!publicSymbols.has(key))publicSymbols.set(key,{...symbol,importPaths:[]});const exposed=publicSymbols.get(key);if(!exposed.importPaths.includes(entry.importPath))exposed.importPaths.push(entry.importPath)}const boundarySymbols=entryFiles.filter(entry=>entry.consumers.length).flatMap(entry=>entry.symbols.filter(symbol=>!declaredSymbolIds.has(symbol.id)&&!observed.has(symbol.id)).map(symbol=>({...symbol,consumers:entry.consumers,source:symbolSource(entry.file.path,symbol)})));const observedSymbols=[...observed.values()].map(symbol=>({...symbol,declared:declaredSymbolIds.has(symbol.id),consumers:[...symbol.consumers.values()]}));const candidates=new Set(boundarySymbols.map(symbol=>symbol.id));const availableSymbols=local.flatMap(file=>(symbolsByFile.get(file.id)||[]).filter(symbol=>!declaredSymbolIds.has(symbol.id)&&!observed.has(symbol.id)&&!candidates.has(symbol.id)).map(symbol=>({...symbol,source:symbolSource(file.path,symbol)})));for(const symbol of[...publicSymbols.values(),...observedSymbols,...boundarySymbols,...availableSymbols]){if(!symbol.source)continue;const exact=[...importsBySymbol.get(symbol.source.symbolId)?.values()||[]];const sourceFile=sourceFilesByPath.get(symbol.source.path);symbol.consumers=(exact.length?exact:[...importsByFile.get(sourceFile?.id)?.values()||[]]).sort((a,b)=>a.path.localeCompare(b.path));symbol.consumerEvidence=exact.length?`declaration`:`file`}return{owner,tree:root.children,files:local,programs,programStatus:architecture?.program?.status||`unavailable`,programDiagnostics:architecture?.program?.diagnostics||[],entryFiles,publicEntries,publicSymbols:[...publicSymbols.values()],observedSymbols,boundarySymbols,availableSymbols,operations,fileLinks:[...fileLinks.values()],dependencyCoverage:architecture?.ui?.capabilities?.imports||architecture?.capabilities?.dependencies||`unconfigured`,exportCount:local.reduce((count,file)=>count+(symbolsByFile.get(file.id)?.length||0),0)}}function architectureOverview(architecture,expandedSubsystemId=``,order=[]){const ui=pageStoryboard(architecture?.ui);const engine=engineOverview(architecture,order);const uiWidth=Math.max(400,...ui.nodes.map(node=>node.position.x+parseFloat(node.style.width)));const uiHeight=Math.max(200,...ui.nodes.map(node=>node.position.y+parseFloat(node.style.height)));const width=Math.max(uiWidth,engine.width);const uiLeft=(width-uiWidth)/2;const engineLeft=(width-engine.width)/2;const engineTop=ui.nodes.length?uiHeight+112:0;const uiParents=ui.nodes.filter(node=>node.data.childCount);const uiFocus=uiParents.length?uiParents:ui.nodes.slice(0,3);const uiHeadingLeft=uiLeft+(uiFocus[0]?.position.x||0);const shift=(node,x,y)=>({...node,position:{x:node.position.x+x,y:node.position.y+y+48}});const annotations=[...ui.nodes.length?[{id:`visual:ui-heading`,type:`annotation`,position:{x:uiHeadingLeft,y:0},style:{width:`640px`,height:`36px`},data:{kind:`heading`,title:`UI`,detail:`Pages / screens / scenes · parents above children · siblings on the same row`}}]:[],...engine.nodes.length?[{id:`visual:engine-heading`,type:`annotation`,position:{x:engineLeft,y:engineTop},style:{width:`640px`,height:`36px`},data:{kind:`heading`,title:`Engine`,detail:`Directory subsystems · interfaces and responsibilities`}}]:[],...ui.nodes.length?[{id:`visual:divider`,type:`annotation`,position:{x:0,y:uiHeight+84},style:{width:`${width}px`,height:`1px`},data:{kind:`divider`}}]:[],...engine.decorations.map(node=>shift(node,engineLeft,engineTop))].map(node=>({...node,selectable:false,focusable:false,draggable:false,zIndex:-1}));const files=new Map((architecture?.files||[]).map(file=>[file.id,file]));const owners=new Map(engine.nodes.map(node=>[node.id,node]));const bridges=[];for(const page of ui.nodes){const connections=pageConnections(architecture?.ui,page.id);page.data.unresolvedCalls=0;page.data.callCount=0;for(const connection of connections){const file=files.get(connection.controllerFileId);const owner=owners.get(file?.subsystemId);if(connection.resolution!==`resolved`||!file||!owner){page.data.unresolvedCalls++;continue}const receivers=owner.data.receivers||=[];if(!receivers.some(receiver=>receiver.id===file.id))receivers.push({id:file.id,path:file.path});const key=connection.key||{};const operation=[key.protocol,key.method,key.operation].filter(Boolean).join(` · `);bridges.push({id:`call:${page.id}:${connection.id}`,source:page.id,target:owner.id,sourceHandle:`engine-out`,targetHandle:`controller:${file.id}`,type:`controller`,selectable:true,zIndex:2,markerEnd:{type:`arrowclosed`,color:`rgb(var(--v-theme-tertiary))`,width:18,height:18},style:{stroke:`rgb(var(--v-theme-tertiary))`,strokeWidth:2},data:{connection,controllerFile:file.path,operation,label:`${file.path.split(`/`).pop()} · ${operation}`}});page.data.callCount++}}const engineNodes=engine.nodes.map(node=>shift(node,engineLeft,engineTop));for(const node of engineNodes){node.data.expanded=node.id===expandedSubsystemId;if(node.data.arrangeable)node.extent=[[engineLeft,engineTop+48],[engineLeft+engine.applicationWidth,engineTop+48+engine.applicationHeight]]}return{nodes:[...annotations,...ui.nodes.map(node=>shift(node,uiLeft,0)),...engineNodes],edges:[...ui.edges,...engine.edges,...bridges],uiIds:ui.nodes.map(node=>node.id),engineIds:engine.nodes.map(node=>node.id),externalCount:engine.externalCount,initialIds:[...uiFocus.map(node=>node.id),...engine.nodes.filter(node=>node.data.initialFocus||engine.nodes.length===1).map(node=>node.id),...annotations.filter(node=>node.data.kind===`heading`).map(node=>node.id)]}}function readingWidth(canvasWidth){return Math.min(960,Math.max(280,canvasWidth-48))}function easedViewport(current,destination,elapsed){const amount=1-Math.exp(-Math.min(50,elapsed)/45);const next={x:current.x+(destination.x-current.x)*amount,y:current.y+(destination.y-current.y)*amount,zoom:current.zoom+(destination.zoom-current.zoom)*amount};return{next,complete:Math.abs(next.zoom-destination.zoom)<.001&&Math.abs(next.x-destination.x)<.3&&Math.abs(next.y-destination.y)<.3}}function adaptViewport(viewport,width,oldWidth){return viewport&&{...viewport,x:viewport.x+(width-oldWidth)/2+(readingWidth(oldWidth)-readingWidth(width))*viewport.zoom/2}}function touchDistance(touches){return Math.hypot(touches[0].clientX-touches[1].clientX,touches[0].clientY-touches[1].clientY)}function arrangedMapNodes(nodes,positions){const arranged=nodes.map(node=>({...node,class:node.class||``,position:{...node.position}}));for(const node of arranged)if(node.data.arrangeable&&positions[node.id]){const[minimum,maximum]=node.extent;node.position={x:Math.max(minimum[0],Math.min(maximum[0]-parseFloat(node.style.width),positions[node.id].x)),y:Math.max(minimum[1],Math.min(maximum[1]-parseFloat(node.style.height),positions[node.id].y))}}return arranged}function readingNodes(arranged,outline,owner){return[...arranged.map(node=>({...node,class:`architecture-map-node--hidden`})),{id:`visual:subsystem-detail`,type:`subsystem-detail`,position:{x:0,y:0},draggable:false,style:{width:`clamp(280px, calc(100cqw - 48px), 960px)`},data:{outline,owner}}]}function controllerPath(edge){const{sourceX,sourceY,targetX,targetY}=edge;return`M ${sourceX},${sourceY} L ${targetX},${targetY}`}function ignoreArrival(){}function useVibe64ArchitectureCanvas({props,architecture,usageState,canvas}){const expandedSubsystemId=ref(``);const outline=shallowRef(null);const retainedOutline=shallowRef(null);const focusOwner=computed(()=>{const native=architecture.value?.subsystems?.find(owner=>owner.id===expandedSubsystemId.value);return native?{...native,...overview.value.nodes.find(node=>node.id===native.id)?.data||{}}:null});watch([expandedSubsystemId,architecture],async([id],previous,onCleanup)=>{outline.value=null;if(!id)return;let cancelled=false;onCleanup(()=>{cancelled=true});await nextTick();await new Promise(requestAnimationFrame);await new Promise(requestAnimationFrame);if(!cancelled){const detail=subsystemOutline(toRaw(architecture.value),id);outline.value=detail?markRaw(detail):null}},{flush:`sync`});const layoutPositions=ref({});const fileRequest=ref(null);const retainedFileRequest=shallowRef(null);const viewHistory=shallowRef([]);const programId=ref(``);const retainedProgramId=ref(``);const currentProgram=computed(()=>architecture.value?.program?.modules?.find(program=>program.id===programId.value));const retainedProgram=computed(()=>architecture.value?.program?.modules?.find(program=>program.id===retainedProgramId.value));const parentProgram=computed(()=>architecture.value?.program?.modules?.find(program=>program.id===viewHistory.value.findLast(entry=>entry.programId)?.programId));let dragging=false;let lastDragEnded=0;let zoomAnchor;let zoomTarget;let parentViewport;let parentNode;let fileParentViewport;let transitioning=false;let gestureTarget;let gestureTimer;let gestureDirection;let zoomMotion;let zoomFrame;let zoomTime;let navigationVersion=0;let pinchDistance;let pinchTarget;function finishGesture(){if(zoomMotion||transitioning){gestureTimer=setTimeout(finishGesture,80);return}gestureTarget=void 0;zoomTarget=void 0;zoomAnchor=void 0}function stopZoomMotion(){cancelAnimationFrame(zoomFrame);zoomFrame=void 0;zoomMotion=void 0}function moveCamera(viewport,{semantic=false,done=ignoreArrival}){zoomMotion={viewport,semantic,done};if(!zoomFrame){zoomTime=void 0;zoomFrame=requestAnimationFrame(animateZoom)}}function animateZoom(time){if(!zoomMotion||!flow||!props.active){stopZoomMotion();return}const motion=zoomMotion;const destination=motion.viewport;const current=flow.getViewport();const{next,complete}=easedViewport(current,destination,time-(zoomTime||time-16));zoomTime=time;flow.setViewport(complete?destination:next,{duration:0});if(motion.semantic)viewportChanged(complete?destination:next);if(zoomMotion!==motion)return;if(complete){zoomFrame=void 0;zoomMotion=void 0;motion.done()}else zoomFrame=requestAnimationFrame(animateZoom)}async function readingViewport(origin){const version=++navigationVersion;stopZoomMotion();if(gestureTarget)gestureTarget.consumed=true;transitioning=true;canvas.value?.focus({preventScroll:true});if(origin&&flow&&canvas.value){const width=readingWidth(canvas.value.clientWidth);const zoom=Math.min(1,origin.width/width);flow.setViewport({x:origin.x+origin.width/2-width*zoom/2,y:origin.y+origin.height/2-160*zoom,zoom},{duration:0})}await nextTick();await new Promise(requestAnimationFrame);if(version!==navigationVersion||!flow||!canvas.value)return;const node=unref(flow?.getNodes)?.find(node=>node.type===`subsystem-detail`);const width=node?.dimensions.width||readingWidth(canvas.value.clientWidth);const height=Math.min(node?.dimensions.height||canvas.value.clientHeight-48,canvas.value.clientHeight-48);const destination={x:(canvas.value.clientWidth-width)/2,y:24,zoom:1};if(origin){const zoom=Math.min(1,origin.width/width);await flow.setViewport({x:origin.x+origin.width/2-width*zoom/2,y:origin.y+origin.height/2-height*zoom/2,zoom},{duration:0})}moveCamera(destination,{done:()=>{transitioning=false}})}async function closeDetail(event){const external=outline.value?.owner.opaque;const currentViewport=flow?.getViewport();const detailWidth=unref(flow?.getNodes)?.find(node=>node.type===`subsystem-detail`)?.dimensions.width||readingWidth(canvas.value.clientWidth);const detailHeight=unref(flow?.getNodes)?.find(node=>node.type===`subsystem-detail`)?.dimensions.height||canvas.value.clientHeight;const outAnchor=zoomAnchor||{x:canvas.value.clientWidth/2,y:canvas.value.clientHeight/2};stopZoomMotion();++navigationVersion;if(event?.type===`click`||event?.type===`keydown`)gestureTarget=void 0;else if(gestureTarget)gestureTarget.consumed=true;transitioning=true;expandedSubsystemId.value=``;fileRequest.value=null;retainedFileRequest.value=null;retainedOutline.value=null;programId.value=``;retainedProgramId.value=``;viewHistory.value=[];zoomTarget=void 0;await nextTick();if(!external&&parentViewport&&parentNode&¤tViewport){const zoom=Math.min(3,detailWidth*currentViewport.zoom/parseFloat(parentNode.style.width));const centreX=currentViewport.x+detailWidth*currentViewport.zoom/2;const centreY=currentViewport.y+Math.min(detailHeight,canvas.value.clientHeight)*currentViewport.zoom/2;const matched={zoom,x:centreX-(parentNode.position.x+parseFloat(parentNode.style.width)/2)*zoom,y:centreY-(parentNode.position.y+parseFloat(parentNode.style.height)/2)*zoom};await flow?.setViewport(matched,{duration:0});moveCamera({zoom:parentViewport.zoom,x:outAnchor.x-(outAnchor.x-matched.x)/zoom*parentViewport.zoom,y:outAnchor.y-(outAnchor.y-matched.y)/zoom*parentViewport.zoom},{done:()=>{transitioning=false}});return}transitioning=false}function rememberView(){viewHistory.value=[...viewHistory.value,{request:fileRequest.value&&{...fileRequest.value},programId:programId.value,ownerId:expandedSubsystemId.value,parentNode,parentViewport,fileParentViewport,viewport:{...flow.getViewport()}}]}async function openProgram(id){const program=architecture.value?.program?.modules?.find(program=>program.id===id);if(!program||programId.value===id)return;rememberView();const ownerNode=nodes.value.find(node=>node.id===program.subsystemId);if(ownerNode&&program.subsystemId!==expandedSubsystemId.value){parentNode={position:{...ownerNode.position},style:{...ownerNode.style}};expandedSubsystemId.value=program.subsystemId}programId.value=id;retainedProgramId.value=id;fileRequest.value=null;await readingViewport()}async function openFile(request){const program=architecture.value?.program?.modules?.find(program=>program.path===request.path);if(program)return openProgram(program.id);if(request.path===`genesis/subsystems.md`||request.path.startsWith(`genesis/program/`))return;if(fileRequest.value?.path===request.path&&!request.symbolId&&!request.symbol&&!request.presentation)return;rememberView();programId.value=``;const file=architecture.value?.files?.find(file=>file.path===request.path);const ownerNode=nodes.value.find(node=>node.id===file?.subsystemId);if(ownerNode&&file.subsystemId!==expandedSubsystemId.value){parentNode={position:{...ownerNode.position},style:{...ownerNode.style}};expandedSubsystemId.value=file.subsystemId}fileParentViewport=gestureDirection===true&&zoomTarget?.kind===`file`?gestureTarget.viewport:{...zoomMotion&&!zoomMotion.semantic?zoomMotion.viewport:flow.getViewport()};fileRequest.value={path:request.path,symbolId:request.symbolId,symbol:request.symbol,line:request.line,presentation:request.presentation||`interface`,symbolPresentation:request.symbolPresentation};retainedFileRequest.value=fileRequest.value;zoomTarget=void 0;await readingViewport()}function updateFileLocation(location){if(!fileRequest.value||location.path!==fileRequest.value.path)return;if([`symbolId`,`presentation`,`symbolPresentation`].every(key=>fileRequest.value[key]===location[key]))return;fileRequest.value={...fileRequest.value,...location};retainedFileRequest.value=fileRequest.value}async function previousView(event){const previous=viewHistory.value.at(-1);if(!previous)return closeDetail(event);++navigationVersion;stopZoomMotion();gestureTarget=void 0;transitioning=false;viewHistory.value=viewHistory.value.slice(0,-1);expandedSubsystemId.value=previous.request?architecture.value.files.find(file=>file.path===previous.request.path)?.subsystemId||previous.ownerId:architecture.value.program?.modules?.find(program=>program.id===previous.programId)?.subsystemId||previous.ownerId;parentNode=previous.parentNode;parentViewport=previous.parentViewport;fileParentViewport=previous.fileParentViewport;fileRequest.value=previous.request;if(previous.request)retainedFileRequest.value=previous.request;programId.value=previous.programId||``;if(previous.programId)retainedProgramId.value=previous.programId;await nextTick();await flow.setViewport(previous.viewport,{duration:0})}async function showSubsystem(){++navigationVersion;stopZoomMotion();if(gestureTarget)gestureTarget.consumed=true;transitioning=true;canvas.value?.focus({preventScroll:true});fileRequest.value=null;programId.value=``;viewHistory.value=[];await nextTick();moveCamera(fileParentViewport||{x:24,y:24,zoom:1},{done:()=>{transitioning=false}})}const nodes=shallowRef([]);const edges=shallowRef([]);const showCalls=ref(false);const selectedPageId=ref(``);const visibleEdges=computed(()=>(focusOwner.value&&!focusOwner.value.opaque?[]:edges.value).filter(edge=>edge.type!==`controller`||showCalls.value||edge.source===selectedPageId.value).map(edge=>expandedSubsystemId.value&&edge.type!==`controller`?{...edge,style:{...edge.style,opacity:edge.source===expandedSubsystemId.value||edge.target===expandedSubsystemId.value?.4:.05}}:edge));function toggleCalls(){showCalls.value=!showCalls.value;selectedPageId.value=``}function selectNode({node,event}){if(node.type===`page`){selectedPageId.value=node.id;showCalls.value=false}else if(node.type===`subsystem`&&!node.data.opaque&&!dragging&&Date.now()-lastDragEnded>250&&!event?.target?.closest(`.engine-subsystem__grip`)){gestureTarget=void 0;enterSubsystem(node,flow.getViewport())}}function clearSelection(){selectedPageId.value=``}function startDrag(){dragging=true}function rearrangeSubsystem({node}){dragging=false;lastDragEnded=Date.now();if(!node.data.arrangeable)return;layoutPositions.value={...layoutPositions.value,[node.id]:{...node.position}}}function moveSubsystem(id,direction){const node=nodes.value.find(entry=>entry.id===id);if(!node)return;rearrangeSubsystem({node:{...node,position:{...node.position,x:node.position.x+direction*32}}})}function captureZoomAnchor(event){const rect=canvas.value.getBoundingClientRect();zoomAnchor={x:event.clientX-rect.left,y:event.clientY-rect.top};const element=event.target.closest(`[data-zoom-kind]`);zoomTarget=element?{kind:element.dataset.zoomKind,path:element.dataset.filePath,element}:void 0}function zoomGesture(event,factor,inward){const current=flow.getViewport();if(!gestureTarget||gestureDirection!==inward){captureZoomAnchor(event);const hovered=event.target.closest(`.vue-flow__node`);const node=nodes.value.find(node=>node.id===hovered?.dataset.id);const element=inward?zoomTarget?.element:void 0;const rect=element?.getBoundingClientRect();const canvasRect=canvas.value.getBoundingClientRect();const centred=inward&&(element||node&&node.type!==`subsystem-detail`&&node.type!==`annotation`);gestureTarget={point:rect?{x:(rect.x-canvasRect.x+rect.width/2-current.x)/current.zoom,y:(rect.y-canvasRect.y+rect.height/2-current.y)/current.zoom}:centred?{x:node.position.x+parseFloat(node.style.width)/2,y:node.position.y+parseFloat(node.style.height)/2}:{x:(zoomAnchor.x-current.x)/current.zoom,y:(zoomAnchor.y-current.y)/current.zoom},anchor:centred?{x:canvas.value.clientWidth/2,y:canvas.value.clientHeight/2}:{...zoomAnchor},detail:zoomTarget,nodeId:node?.id,viewport:{...current}};gestureDirection=inward}clearTimeout(gestureTimer);gestureTimer=setTimeout(finishGesture,220);if(gestureTarget.consumed)return;if(transitioning){++navigationVersion;transitioning=false;stopZoomMotion()}const zoom=Math.max(.08,Math.min(3,(zoomMotion?.viewport.zoom||current.zoom)*factor));zoomTarget=gestureTarget.detail;zoomAnchor=gestureTarget.anchor;moveCamera({zoom,x:zoomAnchor.x-gestureTarget.point.x*zoom,y:zoomAnchor.y-gestureTarget.point.y*zoom},{semantic:true})}function zoomWheel(event){if(!flow||!props.active||focusOwner.value?.opaque||!event.deltaY)return;if(!event.ctrlKey&&event.target.closest(`.subsystem-zoom`))return;event.preventDefault();event.stopPropagation();const delta=event.deltaY*(event.deltaMode===1?16:event.deltaMode===2?canvas.value.clientHeight:1);zoomGesture(event,2**(-Math.max(-300,Math.min(300,delta))*(event.ctrlKey?.006:.003)),delta<0)}function startPinch(event){if(event.touches.length!==2||!flow||focusOwner.value?.opaque)return;event.preventDefault();event.stopPropagation();pinchDistance=touchDistance(event.touches);pinchTarget=event.target;gestureTarget=void 0}function movePinch(event){if(event.touches.length!==2||!pinchDistance||!props.active)return;event.preventDefault();event.stopPropagation();const distance=touchDistance(event.touches);if(!distance||distance===pinchDistance)return;const factor=distance/pinchDistance;zoomGesture({target:pinchTarget,clientX:(event.touches[0].clientX+event.touches[1].clientX)/2,clientY:(event.touches[0].clientY+event.touches[1].clientY)/2},factor,factor>1);clearTimeout(gestureTimer);pinchDistance=distance}function endPinch(event){if(event.touches.length<2){pinchDistance=void 0;pinchTarget=void 0;gestureTimer=setTimeout(finishGesture,220)}}function zoomControl(inward){if(!flow||!canvas.value)return;gestureTarget=void 0;const rect=canvas.value.getBoundingClientRect();zoomGesture({target:canvas.value,clientX:rect.x+rect.width/2,clientY:rect.y+rect.height/2},inward?1.4:1/1.4,inward)}function enterSubsystem(node,viewport){if(expandedSubsystemId.value||!canvas.value)return;parentNode={position:{...node.position},style:{...node.style}};parentViewport=gestureTarget?{...gestureTarget.viewport}:{...viewport};expandedSubsystemId.value=node.id;readingViewport({x:node.position.x*viewport.zoom+viewport.x,y:node.position.y*viewport.zoom+viewport.y,width:parseFloat(node.style.width)*viewport.zoom,height:parseFloat(node.style.height)*viewport.zoom})}function viewportChanged(viewport){if(!props.active||!canvas.value||!contentCount.value||dragging||transitioning)return;if(focusOwner.value?.opaque){zoomAnchor=void 0;return}const rect=canvas.value.getBoundingClientRect();if(outline.value&&!outline.value.owner.opaque){if(viewport.zoom<.7){if(fileRequest.value||programId.value)previousView();else closeDetail()}return}const centerX=((zoomAnchor?.x??rect.width/2)-viewport.x)/viewport.zoom;const centerY=((zoomAnchor?.y??rect.height/2)-viewport.y)/viewport.zoom;const candidate=gestureDirection===true&&nodes.value.find(node=>node.type===`subsystem`&&node.id===gestureTarget?.nodeId&&!node.data.opaque&&parseFloat(node.style.width)*viewport.zoom>=Math.min(560,rect.width*.8)&¢erX>=node.position.x&¢erX<=node.position.x+parseFloat(node.style.width)&¢erY>=node.position.y&¢erY<=node.position.y+parseFloat(node.style.height));if(candidate)enterSubsystem(candidate,viewport)}const uiIds=ref([]);const engineIds=ref([]);const externalCount=ref(0);const initialIds=ref([]);const contentCount=computed(()=>uiIds.value.length+engineIds.value.length);let flow;const flowReady=ref(false);let fitPending=true;async function fit(ids){if(!flow||!props.active||!contentCount.value||usageState.value.view!==`map`)return;stopZoomMotion();++navigationVersion;gestureTarget=void 0;transitioning=true;if(focusOwner.value&&!focusOwner.value.opaque){expandedSubsystemId.value=``;fileRequest.value=null;retainedFileRequest.value=null;retainedOutline.value=null;programId.value=``;retainedProgramId.value=``;viewHistory.value=[];ids=void 0}await nextTick();const measured=unref(flow.getNodes);if(measured.length!==nodes.value.length||measured.some(node=>!node.dimensions.width||!node.dimensions.height)){transitioning=false;return}await flow.fitView({nodes:Array.isArray(ids)?ids:void 0,padding:.12,maxZoom:1,duration:0});transitioning=false;fitPending=false}async function initialize(instance){flow=instance;await fit(initialIds.value);flowReady.value=true}function fitIfPending(){if(fitPending)fit(initialIds.value)}function fitWhenMapShown(){if(fitPending)nextTick(()=>fit(initialIds.value))}const overview=computed(()=>architectureOverview(toRaw(architecture.value)));watch([overview,expandedSubsystemId,layoutPositions],([diagram,expanded,positions],previous)=>{if(architecture.value&&expanded){const currentOwner=fileRequest.value?architecture.value.files.find(file=>file.path===fileRequest.value.path)?.subsystemId:currentProgram.value?.subsystemId;if(currentOwner&¤tOwner!==expanded)expandedSubsystemId.value=currentOwner;else if(!focusOwner.value){expandedSubsystemId.value=``;fileRequest.value=null;programId.value=``;viewHistory.value=[]}}const arranged=arrangedMapNodes(diagram.nodes,positions);if(!(architecture.value?.ui?.pages||[]).some(page=>page.id===selectedPageId.value))selectedPageId.value=``;const focused=focusOwner.value&&!focusOwner.value.opaque;nodes.value=focused?readingNodes(arranged,outline.value,focusOwner.value):arranged;edges.value=diagram.edges;uiIds.value=diagram.uiIds;engineIds.value=diagram.engineIds;externalCount.value=diagram.externalCount;initialIds.value=diagram.initialIds;if(!previous||diagram!==previous[0]){fitPending=true;if(!expandedSubsystemId.value)fit(initialIds.value)}},{immediate:true});watch([outline,fileRequest,programId],([detail,file,program])=>{flow?.updateNodeData(`visual:subsystem-detail`,{outline:detail});if(detail&&detail.owner.id===expandedSubsystemId.value&&!file&&!program)retainedOutline.value=detail});watch(()=>props.sessionId,()=>{++navigationVersion;stopZoomMotion();clearTimeout(gestureTimer);gestureTarget=void 0;transitioning=false;expandedSubsystemId.value=``;fileRequest.value=null;retainedFileRequest.value=null;retainedOutline.value=null;programId.value=``;retainedProgramId.value=``;viewHistory.value=[];selectedPageId.value=``;showCalls.value=false;layoutPositions.value={};zoomAnchor=void 0;zoomTarget=void 0;parentViewport=void 0;fileParentViewport=void 0});let handledProgramRequest;watch([()=>props.openProgramRequest,architecture,()=>props.active,flowReady],([request,snapshot,active,ready])=>{if(!ready||!active||!request||handledProgramRequest===request||!snapshot?.program?.modules.some(program=>program.id===request.id))return;handledProgramRequest=request;openProgram(request.id)});watch(architecture,snapshot=>{if(programId.value&&!snapshot?.program?.modules.some(program=>program.id===programId.value))showSubsystem()});watch(()=>props.active,active=>{if(!active){++navigationVersion;stopZoomMotion();clearTimeout(gestureTimer);gestureTarget=void 0;transitioning=false}else if(fitPending)fit(initialIds.value)});watch(canvas,(element,previous,onCleanup)=>{if(!element)return;const pageEscape=event=>{if(event.key!==`Escape`||event.defaultPrevented||event.target!==document.body||!props.active||usageState.value.view!==`map`||!expandedSubsystemId.value)return;event.preventDefault();previousView(event)};document.addEventListener(`keydown`,pageEscape);let width=element.clientWidth;let height=element.clientHeight;const observer=new ResizeObserver(()=>{const nextWidth=element.clientWidth;const nextHeight=element.clientHeight;if(!nextWidth||!nextHeight||width===nextWidth&&height===nextHeight)return;const oldWidth=width;width=nextWidth;height=nextHeight;if(!props.active||!flow||!expandedSubsystemId.value||focusOwner.value?.opaque)return;const adapt=viewport=>adaptViewport(viewport,width,oldWidth);stopZoomMotion();++navigationVersion;clearTimeout(gestureTimer);gestureTarget=void 0;zoomTarget=void 0;zoomAnchor=void 0;transitioning=false;fileParentViewport=adapt(fileParentViewport);viewHistory.value=viewHistory.value.map(entry=>({...entry,viewport:adapt(entry.viewport),fileParentViewport:adapt(entry.fileParentViewport)}));flow.setViewport(adapt(flow.getViewport()),{duration:0})});observer.observe(element);onCleanup(()=>{observer.disconnect();document.removeEventListener(`keydown`,pageEscape)})},{flush:`post`});onBeforeUnmount(()=>{stopZoomMotion();clearTimeout(gestureTimer)});return{expandedSubsystemId,outline,retainedOutline,layoutPositions,fileRequest,retainedFileRequest,programId,currentProgram,retainedProgram,parentProgram,nodes,edges,showCalls,selectedPageId,visibleEdges,uiIds,engineIds,externalCount,contentCount,closeDetail,openProgram,openFile,updateFileLocation,previousView,showSubsystem,toggleCalls,selectNode,clearSelection,startDrag,rearrangeSubsystem,moveSubsystem,zoomWheel,startPinch,movePinch,endPinch,zoomControl,viewportChanged,fit,initialize,fitIfPending,fitWhenMapShown}}var _hoisted_1$11={class:`usage-picker__label`};var _hoisted_2$11={class:`usage-picker__body`};var _sfc_main$11={__name:`Vibe64UsageEntryPicker`,props:{modelValue:{type:Boolean,default:false},label:{type:String,required:true},title:{type:String,required:true}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(VBtn,{class:`usage-picker`,variant:`outlined`,block:``,"append-icon":`$dropdown`,"aria-label":__props.label,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,true))},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$11,toDisplayString(__props.label),1)]),_:1},8,[`aria-label`]),createVNode(VDialog,{"model-value":__props.modelValue,fullscreen:``,transition:`dialog-bottom-transition`,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{class:`usage-picker__dialog`},{default:withCtx(()=>[createVNode(VToolbar,{density:`comfortable`,color:`surface`},{default:withCtx(()=>[createVNode(VBtn,{icon:`$close`,"aria-label":`Close`,onClick:_cache[1]||(_cache[1]=$event=>emit(`update:modelValue`,false))}),createVNode(VToolbarTitle,{class:`text-title-large`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.title),1)]),_:1})]),_:1}),createBaseVNode(`div`,_hoisted_2$11,[renderSlot(_ctx.$slots,`default`,{},void 0,true)])]),_:3})]),_:3},8,[`model-value`])],64)}}};var Vibe64UsageEntryPicker_default=_plugin_vue_export_helper_default(_sfc_main$11,[[`__scopeId`,`data-v-fe039242`]]);var USAGE_ENTRY_KINDS=Object.freeze([{kind:`page`,label:`Page`,plural:`Pages`,icon:`$description`},{kind:`component`,label:`Component`,plural:`Components`,icon:`$extension`},{kind:`route`,label:`Route`,plural:`Routes`,icon:`$api`},{kind:`action`,label:`Action`,plural:`Actions`,icon:`$bolt`},{kind:`library-export`,label:`Library export`,plural:`Library exports`,icon:`$package2`},{kind:`cli-command`,label:`Command`,plural:`Commands`,icon:`$terminal`},{kind:`job`,label:`Job`,plural:`Jobs`,icon:`$schedule`},{kind:`program-operation`,label:`Program operation`,plural:`Program operations`,icon:`$menuBook`},{kind:`test`,label:`Test file`,plural:`Test files`,icon:`$science`}].map(Object.freeze));var USAGE_MODES=Object.freeze([Object.freeze({value:`imports`,title:`Imports`}),Object.freeze({value:`calls`,title:`Calls`}),Object.freeze({value:`recording`,title:`Recording`})]);var USAGE_QUERY_KEYS=Object.freeze([`view`,`entry`,`mode`,`subsystem`,`recording`,`request`,`interaction`]);var MORE_NODES=1e3;function entryKind(kind){return USAGE_ENTRY_KINDS.find(item=>item.kind===kind)||{kind,label:kind,plural:kind,icon:`$description`}}var text=value=>typeof value===`string`?value.trim():Array.isArray(value)?text(value[0]):``;function usageStateFromQuery(query={}){const view=text(query.view)===`usage`?`usage`:`map`;const mode=USAGE_MODES.some(item=>item.value===text(query.mode))?text(query.mode):`calls`;const interaction=view===`usage`?text(query.interaction):``;return{view,entry:view===`usage`?text(query.entry):``,mode:view===`usage`?mode:`calls`,subsystem:view===`usage`?text(query.subsystem):``,recording:view===`usage`?text(query.recording):``,request:view===`usage`&&!interaction?text(query.request):``,interaction}}function usageQueryFor(query={},state={}){const next=Object.fromEntries(Object.entries(query).filter(([key])=>!USAGE_QUERY_KEYS.includes(key)));const normalized=usageStateFromQuery(state);if(normalized.view!==`usage`)return next;next.view=`usage`;next.mode=normalized.mode;for(const key of[`entry`,`subsystem`,`recording`,`request`,`interaction`])if(normalized[key])next[key]=normalized[key];return next}function sameUsageState(left={},right={}){const a=usageStateFromQuery(left);const b=usageStateFromQuery(right);return USAGE_QUERY_KEYS.every(key=>a[key]===b[key])}function sameQuery(left={},right={}){return[...new Set([...Object.keys(left),...Object.keys(right)])].every(key=>String(left[key]??``)===String(right[key]??``))}function functionLabel(fn={}){if(fn.kind===`module`)return`${fileName(fn.file)} top level`;const name=fn.name||`anonymous (line ${fn.start?.line??`?`})`;return fn.container?`${fn.container}.${name}`:name}function fileName(filePath=``){return String(filePath).split(`/`).pop()}function locationParts(filePath=``,line=null){if(line)return{name:fileName(filePath),line:`:${line}`};const folders=String(filePath).split(`/`).slice(0,-1);return{name:folders.length>2?`…/${folders.slice(-2).join(`/`)}`:folders.join(`/`),line:``}}function pathParts(filePath=``){return String(filePath).split(/(?<=\/)/u)}function countLabel(count,singular,plural=`${singular}s`){return`${Number(count||0).toLocaleString()} ${count===1?singular:plural}`}function subsystemSections(subsystems=[],groups=[],{countKey,showUntouched=false}={}){const reached=item=>Number(item[countKey]||0)>0;const visible=subsystems.filter(item=>showUntouched||reached(item));const alphabetical=(left,right)=>left.title.localeCompare(right.title);const sections=[];for(const group of groups){const cards=visible.filter(item=>item.group===group.id).sort(alphabetical);if(cards.length)sections.push({id:group.id,title:group.title,cards})}const placed=new Set(groups.map(group=>group.id));const rest=visible.filter(item=>!placed.has(item.group)).sort(alphabetical);if(rest.length)sections.push({id:``,title:groups.length?`Other subsystems`:``,cards:rest});return{sections,untouched:subsystems.filter(item=>!reached(item)).length}}function crossingsFrom(crossings=[],subsystemId=``,subsystems=[]){const titles=new Map(subsystems.map(item=>[item.id,item.title]));return crossings.filter(crossing=>crossing.fromSubsystemId===subsystemId).map(crossing=>({...crossing,title:titles.get(crossing.toSubsystemId)||crossing.toSubsystemId}))}var COUNT_KEYS=Object.freeze({imports:`fileCount`,calls:`functionCount`,recording:`ranCount`});function subsystemCard(mode,item={}){if(mode===`imports`)return{count:countLabel(item.fileCount,`file`),detail:``};if(mode===`calls`)return{count:countLabel(item.functionCount,`function`),detail:`${Number(item.exact||0).toLocaleString()} by exact calls · ${Number(item.probable||0).toLocaleString()} only via probable`};return{count:`${countLabel(item.ranCount,`function`)} ran`,detail:``,plumbing:item.plumbingCount||0}}function crossingText(mode,crossing={}){if(mode===`imports`)return countLabel(crossing.count,`import`);const exact=Number(crossing.exact||0);const probable=Number(crossing.probable||0);if(mode===`recording`)return countLabel(exact+probable,`call in code`,`calls in code`);return[[exact&&countLabel(exact,`exact call`),probable&&(exact?`${probable.toLocaleString()} probable`:countLabel(probable,`probable call`))].filter(Boolean).join(`, `),crossing.renders&&`renders ${countLabel(crossing.renders,`component`)}`].filter(Boolean).join(` · `)}function depthTitle(depth){return depth===0?`Start`:depth===1?`1 step away`:`${depth} steps away`}function edgeCounts(edges=[]){const out=new Map;const into=new Map;for(const edge of edges){out.set(edge.from,(out.get(edge.from)||0)+1);into.set(edge.to,(into.get(edge.to)||0)+1)}return{out,into}}function webNodes(mode,data={}){const edges=data.edges||[];const{out,into}=edgeCounts(edges);if(mode===`imports`)return(data.files||[]).map(file=>({id:file.id,title:fileName(file.path),subtitle:file.path,location:locationParts(file.path),file:file.path,start:null,depth:file.depth,certainty:null,outCount:out.get(file.id)||0,inCount:into.get(file.id)||0,unresolved:0}));if(mode===`calls`){const unresolved=new Map;for(const item of data.unresolved||[])unresolved.set(item.fromFunctionId,(unresolved.get(item.fromFunctionId)||0)+1);return(data.functions||[]).map(fn=>({id:fn.id,functionId:fn.id,title:functionLabel(fn),subtitle:`${fn.file}:${fn.start.line}`,location:locationParts(fn.file,fn.start.line),file:fn.file,start:fn.start,depth:fn.depth,certainty:fn.reach,outCount:fn.callCount||0,inCount:fn.calledByCount||0,unresolved:unresolved.get(fn.id)||0}))}return recordedDepths(data.nodes||[],edges).map(node=>({id:node.id,functionId:node.functionId,title:functionLabel({name:node.name,start:node.start}),subtitle:`${node.file}:${node.start.line}`,location:locationParts(node.file,node.start.line),file:node.file,start:node.start,depth:node.depth,certainty:null,count:node.count,plumbing:node.plumbing,join:node.join,reason:node.reason,outCount:out.get(node.id)||0,inCount:into.get(node.id)||0,unresolved:0}))}function depthColumns(nodes=[]){const columns=new Map;for(const node of nodes){const depth=Number(node.depth||0);if(!columns.has(depth))columns.set(depth,[]);columns.get(depth).push(node)}return[...columns.entries()].sort(([left],[right])=>left-right).map(([depth,items])=>({depth,items}))}var NODE=Object.freeze({width:220,height:76,columnGap:72,rowGap:16,padding:16});function canvasLayout(nodes=[],edges=[]){const positions=new Map;const columns=depthColumns(nodes);columns.forEach((column,columnIndex)=>column.items.forEach((node,rowIndex)=>{positions.set(node.id,{x:NODE.padding+columnIndex*(NODE.width+NODE.columnGap),y:NODE.padding+rowIndex*(NODE.height+NODE.rowGap)})}));const tallest=Math.max(0,...columns.map(column=>column.items.length));return{positions,paths:edges.filter(edge=>positions.has(edge.from)&&positions.has(edge.to)).map(edge=>{const from=positions.get(edge.from);const to=positions.get(edge.to);const forward=to.x>from.x;const start={x:from.x+NODE.width,y:from.y+NODE.height/2};const end=forward?{x:to.x,y:to.y+NODE.height/2}:{x:to.x+NODE.width,y:to.y+NODE.height/2};const bend=forward?Math.max(32,(end.x-start.x)/2):NODE.columnGap/2+Math.abs(end.y-start.y)/4;const d=forward?`M ${start.x} ${start.y} C ${start.x+bend} ${start.y}, ${end.x-bend} ${end.y}, ${end.x} ${end.y}`:`M ${start.x} ${start.y} C ${start.x+bend} ${start.y}, ${end.x+bend} ${end.y}, ${end.x} ${end.y}`;return{...edge,key:`${edge.from}>${edge.to}`,d}}),width:NODE.padding*2+Math.max(1,columns.length)*NODE.width+Math.max(0,columns.length-1)*NODE.columnGap,height:NODE.padding*2+tallest*NODE.height+Math.max(0,tallest-1)*NODE.rowGap}}var CERTAINTY_TEXT=Object.freeze({exact:`exact`,probable:`probable`,unresolved:`unresolved`});var METHOD_TEXT=Object.freeze({checker:`proved by types`,"di-binding":`dependency binding`,"route-action":`the route's action`,"argument-flow":`passed as an argument`,"import-scope":`matched by imported name`,"same-file-name":`matched by name in this file`,self:`same class`,"receiver-name":`matched by method name`,operation:`request`,renders:``,none:``});function callMethodText(method=``){return METHOD_TEXT[method]??method}var ANALYSIS_NAMES=Object.freeze({jskit:`JSKIT`});function coverageText(coverage=``){if(coverage.startsWith(`adapter:`)){const family=coverage.slice(8).split(`.`)[0];return`Calls read by ${ANALYSIS_NAMES[family]||family} analysis, which can prove exact calls`}if(coverage===`generic`)return`Calls read by name only: probable at best`;return`Calls not read for this file`}function callGroups(rows=[],heading){return[`exact`,`probable`].map(certainty=>({certainty,title:`${heading} (${certainty})`,rows:rows.filter(row=>row.certainty===certainty)})).filter(group=>group.rows.length)}var BACKGROUND_TEXT=`Not separated per request for this server`;var OUTSIDE_REQUESTS_TEXT=`Start-up and work outside requests`;var isBackgroundRequest=(request={})=>request.kind===`background`||/^bg_[0-9]+$/u.test(String(request.id||``));var READINESS_TEXT=`Launch readiness check`;var isReadinessRequest=(request={})=>request.kind===`readiness`;var requestCount=(requests=[])=>requests.filter(request=>!isBackgroundRequest(request)&&!isReadinessRequest(request)).length;function onlyBackground(requests=[]){const ran=requests.filter(request=>Number(request.functionCount||0)>0&&!isReadinessRequest(request));return ran.length>0&&ran.every(isBackgroundRequest)}function requestTitle(request={},requests=[request]){if(isBackgroundRequest(request))return onlyBackground(requests)?BACKGROUND_TEXT:OUTSIDE_REQUESTS_TEXT;if(isReadinessRequest(request))return READINESS_TEXT;return request.routeTemplate||request.path||`Request not in the request log`}function requestGroups(requests=[],interactions=[]){const byId=new Map(interactions.map(interaction=>[interaction.id,interaction]));const offered=new Set;const groups=[];for(const request of requests){const interaction=byId.get(request.interaction)||null;const last=groups.at(-1);if(last&&last.interaction?.id===interaction?.id){last.requests.push(request);continue}groups.push({key:`${interaction?.id||`none`}:${request.id}`,interaction,requests:[request],offersInteraction:Boolean(interaction)&&!offered.has(interaction.id)});if(interaction)offered.add(interaction.id)}return groups}var INTERACTION_VERBS=Object.freeze({click:`Click`,enter:`Enter`,submit:`Submit`});function interactionParts(interaction){if(!interaction)return{text:``,file:``};return{text:`${INTERACTION_VERBS[interaction.kind]||INTERACTION_VERBS.click}: ${interaction.label}`,file:interaction.componentFile?`(${fileName(interaction.componentFile)})`:``}}function interactionTitle(interaction){const{text,file}=interactionParts(interaction);return[text,file].filter(Boolean).join(` `)}var INTERACTION_NOUNS=Object.freeze({click:`click`,enter:`Enter`,submit:`submit`});function interactionRunTitle(interaction){return`Everything this ${INTERACTION_NOUNS[interaction.kind]||INTERACTION_NOUNS.click} ran`}function recordingWeb(functions=[],join=null){const joined=new Map((join?.joined||[]).map(item=>[item.index,item]));const nodes=functions.map((fn,index)=>{const match=joined.get(index)||{functionId:null,subsystemId:null,join:`none`};return{id:match.functionId||`ran:${index}`,functionId:match.functionId,name:fn.name,file:fn.path,start:fn.start,end:fn.end,count:fn.count,plumbing:fn.plumbing===true,subsystemId:match.subsystemId,join:match.join,reason:match.reason}});const edges=(join?.edges||[]).filter(edge=>nodes[edge.from]&&nodes[edge.to]).map(edge=>({from:nodes[edge.from].id,to:nodes[edge.to].id,certainty:edge.certainty}));const subsystems=(join?.subsystems||[]).map(owner=>{const ran=nodes.filter(node=>node.subsystemId===owner.id);return{...owner,ranCount:ran.length,plumbingCount:ran.filter(node=>node.plumbing).length}});const owners=new Map(nodes.map(node=>[node.id,node.subsystemId]));const crossings=new Map;for(const edge of edges){const from=owners.get(edge.from);const to=owners.get(edge.to);if(!from||!to||from===to)continue;const key=`${from}\n${to}`;if(!crossings.has(key))crossings.set(key,{fromSubsystemId:from,toSubsystemId:to,exact:0,probable:0});crossings.get(key)[edge.certainty===`exact`?`exact`:`probable`]+=1}return{nodes,edges,subsystems,crossings:[...crossings.values()]}}function recordedDepths(nodes=[],edges=[]){const ids=new Set(nodes.map(node=>node.id));const inside=edges.filter(edge=>ids.has(edge.from)&&ids.has(edge.to)&&edge.from!==edge.to);const incoming=new Map(nodes.map(node=>[node.id,0]));for(const edge of inside)incoming.set(edge.to,incoming.get(edge.to)+1);const depth=new Map;const queue=nodes.filter(node=>incoming.get(node.id)===0).map(node=>node.id);for(const id of queue)depth.set(id,0);for(let head=0;head<queue.length;head+=1)for(const edge of inside)if(edge.from===queue[head]&&!depth.has(edge.to)){depth.set(edge.to,depth.get(queue[head])+1);queue.push(edge.to)}return nodes.map(node=>({...node,depth:depth.get(node.id)??0}))}function unavailableRuntimes(targets=[]){if(!targets.length||targets.some(target=>target.available))return[];return[...new Set(targets.flatMap(target=>target.runtimes||[]))]}var NOT_SCANNED_CODE=`vibe64_genesis_city_missing`;var NOT_IGNORED_TEXT=`Git does not ignore .genesis/call-web.json in this project, so the last scan could not read calls. Add /.genesis/call-web.json to the project's .gitignore, then refresh the architecture scan.`;function joinText(join=``,reason=``){if(join===`stale`)return`Changed since the last scan`;if(join===`none`&&reason===`not-ignored`)return`Calls not read: Git does not ignore the call web`;if(join===`none`&&reason===`language`)return`Calls not read in this file's language`;if(join===`none`)return`Not in the last scan`;return``}var _hoisted_1$10={class:`usage-entry-rail`,"aria-label":`Entry points`};var _hoisted_2$10={class:`usage-entry-rail__body`};var _hoisted_3$10={key:1,class:`pa-2`,"aria-busy":`true`,"aria-label":`Loading entry points`};var _hoisted_4$10={key:2,class:`usage-entry-rail__empty`,role:`status`};var _hoisted_5$10={key:0,class:`text-body-medium`};var _sfc_main$10={__name:`Vibe64UsageEntryRail`,props:{entries:{type:Array,default:()=>[]},kinds:{type:Array,default:()=>[]},search:{type:String,default:``},kind:{type:String,default:``},selectedId:{type:String,default:``},loading:{type:Boolean,default:false},error:{type:String,default:``},hasMore:{type:Boolean,default:false},refreshing:{type:Boolean,default:false}},emits:[`update:search`,`update:kind`,`select`,`more`,`retry`,`refresh`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const rows=computed(()=>props.hasMore?[...props.entries,{id:`\0more`,more:true}]:props.entries);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$10,[createVNode(VTextField,{"model-value":__props.search,class:`usage-entry-rail__search`,label:`Search entries`,"prepend-inner-icon":`$search`,variant:`outlined`,density:`comfortable`,maxlength:`80`,clearable:``,"hide-details":``,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>emit(`update:search`,$event||``))},null,8,[`model-value`]),__props.kinds.length?(openBlock(),createBlock(VChipGroup,{key:0,"model-value":__props.kind,class:`usage-entry-rail__kinds`,column:``,"selected-class":`usage-entry-rail__kind--selected`,"aria-label":`Entry kinds`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:kind`,$event||``))},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.kinds,item=>{return openBlock(),createBlock(VChip,{key:item.kind,value:item.kind,filter:``,variant:`outlined`,size:`small`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(entryKind)(item.kind).plural)+` · `+toDisplayString(item.count),1)]),_:2},1032,[`value`])}),128))]),_:1},8,[`model-value`])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$10,[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`ma-3`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[2]||(_cache[2]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.entries.length?(openBlock(),createElementBlock(`div`,_hoisted_3$10,[(openBlock(),createElementBlock(Fragment,null,renderList(6,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!__props.entries.length?(openBlock(),createElementBlock(`div`,_hoisted_4$10,[__props.search||__props.kind?(openBlock(),createElementBlock(`p`,_hoisted_5$10,`No entry points match.`)):(openBlock(),createElementBlock(Fragment,{key:1},[_cache[7]||(_cache[7]=createBaseVNode(`p`,{class:`text-body-medium`},`No entry points found yet. Refresh the architecture scan.`,-1)),createVNode(VBtn,{variant:`tonal`,loading:__props.refreshing,"prepend-icon":`$refresh`,onClick:_cache[3]||(_cache[3]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`])],64))])):(openBlock(),createBlock(VVirtualScroll,{key:3,items:rows.value,"item-key":`id`,class:`usage-entry-rail__list`,role:`listbox`,"aria-label":`Entry points`},{default:withCtx(({item})=>[item.more?(openBlock(),createBlock(VBtn,{key:0,block:``,variant:`text`,class:`my-1`,loading:__props.loading,onClick:_cache[4]||(_cache[4]=$event=>emit(`more`))},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Show more`,-1)])]),_:1},8,[`loading`])):(openBlock(),createBlock(VListItem,{key:1,active:item.id===__props.selectedId,role:`option`,"aria-selected":item.id===__props.selectedId,"prepend-icon":unref(entryKind)(item.kind).icon,"aria-label":`${unref(entryKind)(item.kind).label}: ${item.title}, ${item.file}`,color:`primary`,rounded:`xl`,lines:`two`,class:`usage-entry-rail__item`,onClick:$event=>emit(`select`,item)},{title:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(item.title),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[9]||(_cache[9]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),subtitle:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(item.file),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[10]||(_cache[10]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),_:2},1032,[`active`,`aria-selected`,`prepend-icon`,`aria-label`,`onClick`]))]),_:1},8,[`items`]))])])}}};var Vibe64UsageEntryRail_default=_plugin_vue_export_helper_default(_sfc_main$10,[[`__scopeId`,`data-v-91f16a1a`]]);var _hoisted_1$9=[`aria-label`];var _hoisted_2$9={class:`usage-panel__header`};var _hoisted_3$9={class:`usage-panel__heading`};var _hoisted_4$9={class:`text-title-medium`};var _hoisted_5$9={class:`text-body-small`};var _hoisted_6$8={class:`usage-panel__actions`};var _hoisted_7$7={key:0,class:`text-body-medium`};var _hoisted_8$7={key:0,class:`usage-panel__note text-body-small`,role:`note`};var _hoisted_9$7={key:1,class:`usage-panel__note text-body-medium`};var _hoisted_10$6={key:1,"aria-busy":`true`,"aria-label":`Loading calls`};var _hoisted_11$6={class:`usage-panel__note text-body-small`};var _hoisted_12$6=[`aria-label`];var _hoisted_13$5={class:`text-title-small`};var _hoisted_14$5={key:0,class:`usage-panel__ran`};var _hoisted_15$4={key:0};var _hoisted_16$4={key:0,class:`usage-panel__section`,"aria-label":`Unresolved calls`};var _hoisted_17$4={class:`text-title-small`};var _hoisted_18$4={key:1,class:`usage-panel__note text-body-medium`};var _hoisted_19$4={key:2,class:`usage-panel__note text-body-small`};var _sfc_main$9={__name:`Vibe64UsageFunctionPanel`,props:{node:{type:Object,required:true},detail:{type:Object,default:null},loading:{type:Boolean,default:false},error:{type:String,default:``},ran:{type:Map,required:true}},emits:[`close`,`select`,`open-source`,`retry`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const sections=computed(()=>{if(!props.detail)return[];const calls=props.detail.calls.map(row=>({...row,fn:row.target,site:props.detail.function.file}));const calledBy=props.detail.calledBy.map(row=>({...row,fn:row.source,site:row.source.file}));const renders=row=>row.method===`renders`;return[...callGroups(calls.filter(row=>!renders(row)),`Calls`),...callGroups(calls.filter(renders),`Renders`),...callGroups(calledBy.filter(row=>!renders(row)),`Called by`),...callGroups(calledBy.filter(renders),`Rendered by`)]});const ranText=computed(()=>{if(props.node.count===void 0)return``;return props.node.count==null?`Ran in this request`:`Ran ${props.node.count.toLocaleString()} ${props.node.count===1?`time`:`times`}`});const joinNote=computed(()=>{if(!props.node.join||props.node.join===`exact`)return``;if(props.node.join===`name-line`)return`Matched by name near this line: the file moved slightly since the scan.`;if(props.node.reason===`not-ignored`)return NOT_IGNORED_TEXT;if(props.node.reason===`language`)return`The scan reads calls only in the languages of the project's Stack components, and this file's language is not among them.`;return`${joinText(props.node.join)}. Refresh the architecture scan to see its calls.`});const importText=computed(()=>props.node.functionId||props.node.join?``:`Imports ${props.node.outCount} of the reached files · imported by ${props.node.inCount}`);const methodText=row=>callMethodText(row.method);const ranLabel=count=>count==null?`ran`:`ran ${count.toLocaleString()} ${count===1?`time`:`times`}`;function openAt(start,file=props.node.file){emit(`open-source`,{path:file,line:start?.line||1,column:start?.column||1})}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:`usage-panel`,"aria-label":`Details for ${__props.node.title}`},[createBaseVNode(`header`,_hoisted_2$9,[createBaseVNode(`div`,_hoisted_3$9,[createBaseVNode(`h3`,_hoisted_4$9,toDisplayString(__props.node.title),1),createBaseVNode(`p`,_hoisted_5$9,toDisplayString(__props.node.subtitle),1)]),createVNode(VBtn,{icon:`$close`,variant:`text`,size:`small`,"aria-label":`Close details`,onClick:_cache[0]||(_cache[0]=$event=>emit(`close`))})]),createBaseVNode(`div`,_hoisted_6$8,[createVNode(VBtn,{variant:`tonal`,"prepend-icon":`$code`,onClick:_cache[1]||(_cache[1]=$event=>openAt(__props.node.start))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`Open source`,-1)])]),_:1}),ranText.value?(openBlock(),createElementBlock(`span`,_hoisted_7$7,toDisplayString(ranText.value),1)):createCommentVNode(``,true)]),joinNote.value?(openBlock(),createElementBlock(`p`,_hoisted_8$7,toDisplayString(joinNote.value),1)):createCommentVNode(``,true),importText.value?(openBlock(),createElementBlock(`p`,_hoisted_9$7,toDisplayString(importText.value),1)):createCommentVNode(``,true),__props.node.functionId?(openBlock(),createElementBlock(Fragment,{key:2},[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[2]||(_cache[2]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.detail?(openBlock(),createElementBlock(`div`,_hoisted_10$6,[createVNode(VSkeletonLoader,{type:`list-item-two-line, list-item-two-line, list-item-two-line`})])):__props.detail?(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`p`,_hoisted_11$6,toDisplayString(unref(coverageText)(__props.detail.function.coverage||``)),1),(openBlock(true),createElementBlock(Fragment,null,renderList(sections.value,group=>{return openBlock(),createElementBlock(`section`,{key:group.title,class:`usage-panel__section`,"aria-label":group.title},[createBaseVNode(`h4`,_hoisted_13$5,toDisplayString(group.title),1),createVNode(VList,{density:`compact`,class:`usage-panel__list`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(group.rows,(row,position)=>{return openBlock(),createBlock(VListItem,{key:position,rounded:`lg`,lines:`two`,onClick:$event=>emit(`select`,row.fn)},{append:withCtx(()=>[createVNode(VChip,{size:`x-small`,variant:row.certainty===`exact`?`tonal`:`outlined`,class:`mr-1`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(CERTAINTY_TEXT)[row.certainty]),1)]),_:2},1032,[`variant`]),row.start?(openBlock(),createBlock(VBtn,{key:0,icon:`$code`,variant:`text`,size:`x-small`,"aria-label":`Open the ${row.method===`renders`?`tag`:`call`} at line ${row.start.line}`,onClick:withModifiers($event=>openAt(row.start,row.site),[`stop`])},null,8,[`aria-label`,`onClick`])):createCommentVNode(``,true)]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(functionLabel)(row.fn)),1),__props.ran.has(row.fn.id)?(openBlock(),createElementBlock(`span`,_hoisted_14$5,` · `+toDisplayString(ranLabel(__props.ran.get(row.fn.id))),1)):createCommentVNode(``,true)]),_:2},1024),createVNode(VListItemSubtitle,{class:`usage-panel__callee`},{default:withCtx(()=>[createBaseVNode(`code`,null,toDisplayString(row.callee),1),methodText(row)?(openBlock(),createElementBlock(`span`,_hoisted_15$4,` · `+toDisplayString(methodText(row)),1)):createCommentVNode(``,true)]),_:2},1024)]),_:2},1032,[`onClick`])}),128))]),_:2},1024)],8,_hoisted_12$6)}),128)),__props.detail.unresolved.length?(openBlock(),createElementBlock(`section`,_hoisted_16$4,[createBaseVNode(`h4`,_hoisted_17$4,`Unresolved (`+toDisplayString(__props.detail.totals.unresolved)+`)`,1),createVNode(VList,{density:`compact`,class:`usage-panel__list`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.detail.unresolved,(item,position)=>{return openBlock(),createBlock(VListItem,{key:position,rounded:`lg`,onClick:$event=>openAt(item.start)},{default:withCtx(()=>[createVNode(VListItemTitle,{class:`usage-panel__callee text-body-medium`},{default:withCtx(()=>[_cache[5]||(_cache[5]=createTextVNode(`Unresolved call: `,-1)),createBaseVNode(`code`,null,toDisplayString(item.callee),1)]),_:2},1024),createVNode(VListItemSubtitle,null,{default:withCtx(()=>[createTextVNode(`Line `+toDisplayString(item.start.line),1)]),_:2},1024)]),_:2},1032,[`onClick`])}),128))]),_:1})])):createCommentVNode(``,true),!sections.value.length&&!__props.detail.unresolved.length?(openBlock(),createElementBlock(`p`,_hoisted_18$4,`No calls in or out are known for this function.`)):createCommentVNode(``,true),__props.detail.truncated?(openBlock(),createElementBlock(`p`,_hoisted_19$4,`Each list shows its first `+toDisplayString(__props.detail.limits.list)+`.`,1)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],8,_hoisted_1$9)}}};var Vibe64UsageFunctionPanel_default=_plugin_vue_export_helper_default(_sfc_main$9,[[`__scopeId`,`data-v-c4367069`]]);var _hoisted_1$8={class:`usage-recordings`,"aria-label":`Recordings`};var _hoisted_2$8={key:1,"aria-busy":`true`,"aria-label":`Loading recordings`};var _hoisted_3$8={key:2,class:`usage-recordings__empty`,role:`status`};var _hoisted_4$8={key:0,class:`text-body-medium`};var _hoisted_5$8={key:1,class:`text-body-medium`};var _hoisted_6$7={key:1,class:`usage-recordings__live text-body-small`,role:`status`};var _hoisted_7$6={key:3,class:`usage-recordings__live text-body-small`};var _hoisted_8$6={key:5,"aria-busy":`true`,"aria-label":`Loading requests`};var _hoisted_9$6={key:6,class:`usage-recordings__empty text-body-medium`,role:`status`};var _hoisted_10$5={class:`d-sr-only`};var _hoisted_11$5={key:8,class:`usage-recordings__footer`};var _hoisted_12$5={class:`text-body-small`};var _sfc_main$8={__name:`Vibe64UsageRecordingResults`,props:{recordings:{type:Array,default:()=>[]},recordingId:{type:String,default:``},requests:{type:Array,default:()=>[]},interactions:{type:Array,default:()=>[]},total:{type:Number,default:null},hasMore:{type:Boolean,default:false},newestFirst:{type:Boolean,default:false},requestId:{type:String,default:``},interactionId:{type:String,default:``},search:{type:String,default:``},includeEmpty:{type:Boolean,default:false},unavailable:{type:Array,default:()=>[]},loading:{type:Boolean,default:false},requestsLoading:{type:Boolean,default:false},error:{type:String,default:``},sessionId:{type:String,default:``}},emits:[`update:recordingId`,`update:requestId`,`update:interactionId`,`update:search`,`update:includeEmpty`,`more`,`retry`,`deleted`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const timeFormat=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`});const recordingItems=computed(()=>props.recordings.map(recording=>({value:recording.id,title:`${recording.target?.label||`Recording`} · ${recording.startedAt?timeFormat.format(new Date(recording.startedAt)):``} · ${countLabel(recording.counts?.requests,`request`)}${recording.state===`recording`?` · recording`:``}`})));const selectedRecording=computed(()=>props.recordings.find(recording=>recording.id===props.recordingId)||null);const groups=computed(()=>requestGroups(props.requests,props.interactions));const footerText=computed(()=>{if(!props.hasMore)return`Newest requests first`;const count=requestCount(props.requests);const shown=props.total==null?`Showing ${countLabel(count,`request`)}`:`Showing ${count.toLocaleString()} of ${countLabel(Math.max(props.total,count),`request`)}`;return props.newestFirst?`${shown}, newest first`:shown});const MARKS={background:{icon:`$settings`,label:`Start-up`},readiness:{icon:`$monitorHeart`,label:`Readiness check`},run:{icon:`$terminal`,label:`Command run`}};const markOf=request=>isBackgroundRequest(request)?MARKS.background:isReadinessRequest(request)?MARKS.readiness:/^run_/u.test(String(request.id))?MARKS.run:null;function subtitle(request){return[isBackgroundRequest(request)?onlyBackground(props.requests)?`Everything that ran while recording`:`Outside any request`:isReadinessRequest(request)?`Vibe64 checking that the launch started`:request.status,countLabel(request.fileCount,`file`),countLabel(request.functionCount,`function`)].filter(Boolean).join(` · `)}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$8,[__props.error?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`mx-1`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[0]||(_cache[0]=$event=>emit(`retry`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(__props.error)+` `,1)]),_:1})):__props.loading&&!__props.recordings.length?(openBlock(),createElementBlock(`div`,_hoisted_2$8,[(openBlock(),createElementBlock(Fragment,null,renderList(4,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!__props.recordings.length?(openBlock(),createElementBlock(`div`,_hoisted_3$8,[__props.unavailable.length?(openBlock(),createElementBlock(`p`,_hoisted_4$8,[_cache[7]||(_cache[7]=createTextVNode(` Recording not available for this project's runtimes (`,-1)),createBaseVNode(`code`,null,toDisplayString(__props.unavailable.join("`, `")),1),_cache[8]||(_cache[8]=createTextVNode(`). Imports and Calls still work. `,-1))])):(openBlock(),createElementBlock(`p`,_hoisted_5$8,`No recordings yet. Use Record to capture what runs, then pick a request here.`))])):(openBlock(),createElementBlock(Fragment,{key:3},[createVNode(unref(_sfc_main$12),{"model-value":__props.recordingId,items:recordingItems.value,label:`Recording`,loading:__props.loading,variant:`outlined`,density:`comfortable`,"hide-details":``,class:`usage-recordings__select`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:recordingId`,$event))},null,8,[`model-value`,`items`,`loading`]),selectedRecording.value&&__props.sessionId?(openBlock(),createBlock(unref(Vibe64UsageRecordingSummary_default),{key:0,recording:selectedRecording.value,"session-id":__props.sessionId,onDeleted:_cache[2]||(_cache[2]=$event=>emit(`deleted`,$event))},null,8,[`recording`,`session-id`])):createCommentVNode(``,true),createVNode(VTextField,{"model-value":__props.search,label:`Search requests`,"prepend-inner-icon":`$search`,variant:`outlined`,density:`comfortable`,maxlength:`80`,clearable:``,"hide-details":``,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>emit(`update:search`,$event||``))},null,8,[`model-value`]),createVNode(VSwitch,{"model-value":__props.includeEmpty,color:`primary`,density:`compact`,inset:``,"hide-details":``,label:`Show requests that ran no project code`,class:`usage-recordings__switch`,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>emit(`update:includeEmpty`,Boolean($event)))},null,8,[`model-value`]),selectedRecording.value?.state===`recording`?(openBlock(),createElementBlock(`p`,_hoisted_6$7,`Recording now. New requests appear as they finish.`)):createCommentVNode(``,true),selectedRecording.value?.requestLog?.full?(openBlock(),createBlock(VAlert,{key:2,type:`warning`,variant:`tonal`,density:`compact`},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(` Request log full; later requests not recorded `,-1)])]),_:1})):createCommentVNode(``,true),__props.includeEmpty&&selectedRecording.value?.requestLog?.assets?(openBlock(),createElementBlock(`p`,_hoisted_7$6,toDisplayString(unref(countLabel)(selectedRecording.value.requestLog.assets,`script, style, image or font load`))+` counted, not listed. `,1)):createCommentVNode(``,true),selectedRecording.value?.target?.kind===`web`&&unref(onlyBackground)(__props.requests)?(openBlock(),createBlock(VAlert,{key:4,type:`info`,variant:`tonal`,density:`compact`,class:`usage-recordings__shared`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(BACKGROUND_TEXT))+`: its requests share one process, so this recording shows everything that ran while it recorded. `,1)]),_:1})):createCommentVNode(``,true),__props.requestsLoading&&!groups.value.length?(openBlock(),createElementBlock(`div`,_hoisted_8$6,[(openBlock(),createElementBlock(Fragment,null,renderList(4,row=>{return createVNode(VSkeletonLoader,{key:row,type:`list-item-two-line`})}),64))])):!groups.value.length?(openBlock(),createElementBlock(`p`,_hoisted_9$6,toDisplayString(__props.search?`No requests match.`:`No requests ran project code yet.`),1)):(openBlock(),createBlock(VList,{key:7,class:`usage-recordings__list`,density:`comfortable`,"aria-label":`Requests`,role:`listbox`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(groups.value,(group,position)=>{return openBlock(),createElementBlock(Fragment,{key:group.key},[group.interaction||position>0?(openBlock(),createBlock(VListSubheader,{key:0,class:`usage-recordings__interaction`},{default:withCtx(()=>[createTextVNode(toDisplayString(group.interaction?unref(interactionTitle)(group.interaction):`Other requests`),1)]),_:2},1024)):createCommentVNode(``,true),group.offersInteraction?(openBlock(),createBlock(VListItem,{key:1,active:group.interaction.id===__props.interactionId,role:`option`,"aria-selected":group.interaction.id===__props.interactionId,color:`primary`,rounded:`xl`,lines:`two`,class:`usage-recordings__request`,onClick:$event=>emit(`update:interactionId`,group.interaction.id)},{prepend:withCtx(()=>[createVNode(VChip,{size:`small`,variant:`tonal`,label:``,class:`usage-recordings__method`},{default:withCtx(()=>[createVNode(VIcon,{icon:`$adsClick`,size:`small`})]),_:1})]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(interactionRunTitle)(group.interaction)),1)]),_:2},1024),group.interaction.requestCount?(openBlock(),createBlock(VListItemSubtitle,{key:0},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(countLabel)(group.interaction.requestCount,`request`)),1)]),_:2},1024)):createCommentVNode(``,true)]),_:2},1032,[`active`,`aria-selected`,`onClick`])):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(group.requests,request=>{return openBlock(),createBlock(VListItem,{key:request.id,active:request.id===__props.requestId,role:`option`,"aria-selected":request.id===__props.requestId,color:`primary`,rounded:`xl`,lines:`two`,class:normalizeClass([`usage-recordings__request`,{"usage-recordings__request--secondary":unref(isReadinessRequest)(request)}]),onClick:$event=>emit(`update:requestId`,request.id)},{prepend:withCtx(()=>[createVNode(VChip,{size:`small`,variant:`tonal`,label:``,class:`usage-recordings__method`,title:markOf(request)?.label},{default:withCtx(()=>[markOf(request)?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(VIcon,{icon:markOf(request).icon,size:`small`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_10$5,toDisplayString(markOf(request).label),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(request.method||`–`),1)],64))]),_:2},1032,[`title`])]),default:withCtx(()=>[createVNode(VListItemTitle,{class:`text-body-medium`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(unref(requestTitle)(request,__props.requests)),(part,index)=>{return openBlock(),createElementBlock(Fragment,{key:index},[createTextVNode(toDisplayString(part),1),_cache[10]||(_cache[10]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),_:2},1024),createVNode(VListItemSubtitle,null,{default:withCtx(()=>[createTextVNode(toDisplayString(subtitle(request)),1)]),_:2},1024)]),_:2},1032,[`active`,`aria-selected`,`class`,`onClick`])}),128))],64)}),128))]),_:1})),groups.value.length&&(__props.hasMore||__props.newestFirst)?(openBlock(),createElementBlock(`div`,_hoisted_11$5,[createBaseVNode(`p`,_hoisted_12$5,toDisplayString(footerText.value),1),__props.hasMore?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,size:`small`,loading:__props.requestsLoading,onClick:_cache[5]||(_cache[5]=$event=>emit(`more`))},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(`Show more`,-1)])]),_:1},8,[`loading`])):createCommentVNode(``,true)])):createCommentVNode(``,true)],64))])}}};var Vibe64UsageRecordingResults_default=_plugin_vue_export_helper_default(_sfc_main$8,[[`__scopeId`,`data-v-4dd8258c`]]);function hasWindowFunction(name){return typeof window!==`undefined`&&typeof window[name]===`function`}var _hoisted_1$7={key:0,class:`usage-web__empty text-body-medium`,role:`status`};var _hoisted_2$7=[`aria-label`];var _hoisted_3$7={key:0,class:`usage-web__group-title text-title-small`};var _hoisted_4$7={class:`usage-web__cards`};var _hoisted_5$7={key:0,class:`text-body-small`};var _hoisted_6$6={class:`usage-web__crossings`,"aria-label":`Crossings`};var _hoisted_7$5={class:`usage-web__zoom`};var _hoisted_8$5={class:`usage-web__zoom-title text-title-medium`};var _hoisted_9$5={key:0,class:`usage-web__legend`,"aria-label":`Legend`};var _hoisted_10$4={key:0,class:`usage-web__crossings`,"aria-label":`Leaving this subsystem`};var _hoisted_11$4={key:1,class:`usage-web__empty text-body-medium`,role:`status`};var _hoisted_12$4={class:`usage-web__row-path`};var _hoisted_13$4={class:`usage-web__row-counts`};var _hoisted_14$4={key:3,class:`usage-web__frame`};var _hoisted_15$3=[`width`,`height`];var _hoisted_16$3=[`id`];var _hoisted_17$3=[`d`,`marker-end`];var _hoisted_18$3=[`x1`,`y1`,`x2`,`y2`];var _hoisted_19$3=[`cx`,`cy`];var _hoisted_20$3=[`aria-pressed`,`aria-label`,`title`,`onClick`];var _hoisted_21$3={class:`usage-node__head`};var _hoisted_22$3={class:`usage-node__title text-body-medium`};var _hoisted_23$2={key:0,class:`usage-node__badge text-label-small`};var _hoisted_24$2={class:`usage-node__subtitle text-body-small`};var _hoisted_25$2={class:`usage-node__file`};var _hoisted_26$2={key:0,class:`usage-node__line`};var _hoisted_27$2={key:0,class:`usage-web__more`,"aria-hidden":`true`};var stubRoom=32;var _sfc_main$7={__name:`Vibe64UsageWebCanvas`,props:{mode:{type:String,required:true},subsystems:{type:Array,default:()=>[]},groups:{type:Array,default:()=>[]},crossings:{type:Array,default:()=>[]},zoomedId:{type:String,default:``},nodes:{type:Array,default:()=>[]},edges:{type:Array,default:()=>[]},selectedId:{type:String,default:``},showUntouched:{type:Boolean,default:false},compact:{type:Boolean,default:false},startSubsystemId:{type:String,default:``}},emits:[`zoom`,`select`,`update:showUntouched`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const countKey=computed(()=>COUNT_KEYS[props.mode]);const reached=item=>Number(item[countKey.value]||0)>0;const cardText=item=>subsystemCard(props.mode,item);const layout=computed(()=>subsystemSections(props.subsystems,props.groups,{countKey:countKey.value,showUntouched:props.showUntouched}));const zoomedTitle=computed(()=>props.subsystems.find(item=>item.id===props.zoomedId)?.title||props.zoomedId);const leaving=computed(()=>props.zoomedId?crossingsFrom(props.crossings,props.zoomedId,props.subsystems):[]);const emptyText=computed(()=>props.mode===`recording`?`This request ran no project code that the last scan knows.`:`Nothing is reached from this entry.`);const zoomEmptyText=computed(()=>props.mode===`imports`?`No files in this subsystem are reached.`:props.mode===`calls`?`No functions in this subsystem are reached.`:`No functions in this subsystem ran.`);const columns=computed(()=>depthColumns(props.nodes));const plan=computed(()=>canvasLayout(props.nodes,props.edges));const stubs=computed(()=>props.nodes.filter(node=>node.unresolved).map(node=>{const position=plan.value.positions.get(node.id);return{id:node.id,count:node.unresolved,x:position.x+NODE.width,y:position.y+NODE.height-12}}));const arrowId=`usage-arrow-${useId()}`;const scroller=ref(null);const moreRight=ref(false);function measureScroll(){const element=scroller.value;moreRight.value=Boolean(element)&&element.scrollLeft+element.clientWidth<element.scrollWidth-1}let resizeObserver=null;watch(scroller,element=>{resizeObserver?.disconnect();resizeObserver=null;if(element&&hasWindowFunction(`ResizeObserver`)){resizeObserver=new ResizeObserver(measureScroll);resizeObserver.observe(element)}measureScroll()},{flush:`post`});watch(plan,()=>nextTick(measureScroll));onBeforeUnmount(()=>resizeObserver?.disconnect());function nodeStyle(node){const position=plan.value.positions.get(node.id);return{left:`${position.x}px`,top:`${position.y}px`,width:`${NODE.width}px`,height:`${NODE.height}px`}}const SHORT_JOIN=Object.freeze({stale:`changed`,none:`not scanned`});function badge(node,full=false){if(props.mode===`recording`&&node.join!==`exact`&&node.join!==`name-line`)return full?joinText(node.join,node.reason):SHORT_JOIN[node.join]||``;if(props.mode===`recording`)return node.count==null?`ran`:`×${node.count.toLocaleString()}`;if(node.certainty===`probable`)return full?`only via probable calls`:`probable`;return``}function rowCounts(node){if(props.mode===`recording`)return badge(node,true);const[out,into]=props.mode===`imports`?[`imports`,`imported by`]:[`calls`,`called by`];return[badge(node,true),`${out} ${node.outCount} → · ${into} ${node.inCount} ←`,node.unresolved&&countLabel(node.unresolved,`unresolved call`)].filter(Boolean).join(` · `)}function nodeLabel(node){return[node.title,node.subtitle,props.mode===`recording`?badge(node,true):rowCounts(node)].filter(Boolean).join(`, `)}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,{class:normalizeClass([`usage-web`,{"usage-web--compact":__props.compact}])},[!__props.zoomedId?(openBlock(),createElementBlock(Fragment,{key:0},[!layout.value.sections.length?(openBlock(),createElementBlock(`p`,_hoisted_1$7,toDisplayString(emptyText.value),1)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(layout.value.sections,section=>{return openBlock(),createElementBlock(`section`,{key:section.id||`all`,class:`usage-web__group`,"aria-label":section.title||`Subsystems`},[section.title?(openBlock(),createElementBlock(`h3`,_hoisted_3$7,toDisplayString(section.title),1)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_4$7,[(openBlock(true),createElementBlock(Fragment,null,renderList(section.cards,card=>{return openBlock(),createBlock(VCard,{key:card.id,class:normalizeClass([`usage-web__card`,{"usage-web__card--untouched":!reached(card)}]),rounded:`lg`,disabled:!reached(card),"aria-label":`${card.title}: ${cardText(card).count}`,onClick:$event=>emit(`zoom`,card.id)},{default:withCtx(()=>[createVNode(VCardItem,null,createSlots({default:withCtx(()=>[createVNode(VCardTitle,{class:`text-title-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(card.title),1)]),_:2},1024),createVNode(VCardSubtitle,{class:`text-body-medium`},{default:withCtx(()=>[createTextVNode(toDisplayString(cardText(card).count),1)]),_:2},1024)]),_:2},[card.id===__props.startSubsystemId?{name:`append`,fn:withCtx(()=>[_cache[2]||(_cache[2]=createBaseVNode(`span`,{class:`usage-web__start text-label-medium`},`Starts here`,-1))]),key:`0`}:void 0]),1024),cardText(card).detail||cardText(card).plumbing||unref(crossingsFrom)(__props.crossings,card.id,__props.subsystems).length?(openBlock(),createBlock(VCardText,{key:0,class:`usage-web__card-body`},{default:withCtx(()=>[cardText(card).detail?(openBlock(),createElementBlock(`p`,_hoisted_5$7,toDisplayString(cardText(card).detail),1)):createCommentVNode(``,true),cardText(card).plumbing?(openBlock(),createBlock(VChip,{key:1,size:`small`,variant:`tonal`,class:`usage-web__plumbing`},{default:withCtx(()=>[createTextVNode(`Shared plumbing (`+toDisplayString(cardText(card).plumbing)+`)`,1)]),_:2},1024)):createCommentVNode(``,true),createBaseVNode(`ul`,_hoisted_6$6,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(crossingsFrom)(__props.crossings,card.id,__props.subsystems),crossing=>{return openBlock(),createElementBlock(`li`,{key:crossing.toSubsystemId,class:`text-body-small`},` → `+toDisplayString(crossing.title)+` · `+toDisplayString(unref(crossingText)(__props.mode,crossing)),1)}),128))])]),_:2},1024)):createCommentVNode(``,true)]),_:2},1032,[`class`,`disabled`,`aria-label`,`onClick`])}),128))])],8,_hoisted_2$7)}),128)),layout.value.untouched?(openBlock(),createBlock(VChip,{key:1,class:`usage-web__untouched`,variant:__props.showUntouched?`tonal`:`outlined`,"prepend-icon":__props.showUntouched?`$check`:void 0,role:`switch`,"aria-checked":__props.showUntouched,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:showUntouched`,!__props.showUntouched))},{default:withCtx(()=>[createTextVNode(` Show untouched (`+toDisplayString(layout.value.untouched)+`) `,1)]),_:1},8,[`variant`,`prepend-icon`,`aria-checked`])):createCommentVNode(``,true)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`header`,_hoisted_7$5,[createVNode(VBtn,{variant:`text`,onClick:_cache[1]||(_cache[1]=$event=>emit(`zoom`,``))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`All subsystems`,-1)])]),_:1}),createBaseVNode(`h3`,_hoisted_8$5,toDisplayString(zoomedTitle.value),1),renderSlot(_ctx.$slots,`zoom-actions`,{},void 0,true),__props.mode!==`imports`&&!__props.compact?(openBlock(),createElementBlock(`div`,_hoisted_9$5,[createVNode(VChip,{size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createBaseVNode(`svg`,{width:`24`,height:`8`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`4`,x2:`24`,y2:`4`,class:`usage-web__line usage-web__line--exact`})],-1),createTextVNode(`Exact`,-1)])]),_:1}),createVNode(VChip,{size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createBaseVNode(`svg`,{width:`24`,height:`8`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`4`,x2:`24`,y2:`4`,class:`usage-web__line usage-web__line--probable`})],-1),createTextVNode(`Probable`,-1)])]),_:1}),__props.mode===`calls`?(openBlock(),createBlock(VChip,{key:0,size:`small`,variant:`text`,class:`usage-web__legend-chip`},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createBaseVNode(`svg`,{width:`24`,height:`10`,"aria-hidden":`true`},[createBaseVNode(`line`,{x1:`0`,y1:`5`,x2:`14`,y2:`5`,class:`usage-web__line usage-web__line--probable`}),createBaseVNode(`circle`,{cx:`18`,cy:`5`,r:`4`,class:`usage-web__stub`})],-1),createTextVNode(`Unresolved`,-1)])]),_:1})):createCommentVNode(``,true)])):createCommentVNode(``,true)]),leaving.value.length?(openBlock(),createElementBlock(`ul`,_hoisted_10$4,[(openBlock(true),createElementBlock(Fragment,null,renderList(leaving.value,crossing=>{return openBlock(),createElementBlock(`li`,{key:crossing.toSubsystemId,class:`text-body-small`},`→ `+toDisplayString(crossing.title)+` · `+toDisplayString(unref(crossingText)(__props.mode,crossing)),1)}),128))])):createCommentVNode(``,true),!__props.nodes.length?(openBlock(),createElementBlock(`p`,_hoisted_11$4,toDisplayString(zoomEmptyText.value),1)):__props.compact?(openBlock(),createBlock(VList,{key:2,class:`usage-web__rows`,density:`comfortable`,"aria-label":`Reached in this subsystem`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(columns.value,column=>{return openBlock(),createElementBlock(Fragment,{key:column.depth},[createVNode(VListSubheader,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(depthTitle)(column.depth)),1)]),_:2},1024),(openBlock(true),createElementBlock(Fragment,null,renderList(column.items,node=>{return openBlock(),createBlock(VListItem,{key:node.id,active:node.id===__props.selectedId,color:`primary`,rounded:`lg`,lines:`three`,title:node.title,onClick:$event=>emit(`select`,node)},{subtitle:withCtx(()=>[createBaseVNode(`span`,_hoisted_12$4,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(node.subtitle),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[7]||(_cache[7]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))]),createBaseVNode(`span`,_hoisted_13$4,toDisplayString(rowCounts(node)),1)]),_:2},1032,[`active`,`title`,`onClick`])}),128))],64)}),128))]),_:1})):(openBlock(),createElementBlock(`div`,_hoisted_14$4,[createBaseVNode(`div`,{ref_key:`scroller`,ref:scroller,class:`usage-web__scroll`,onScrollPassive:measureScroll},[createBaseVNode(`div`,{class:`usage-web__plane`,style:normalizeStyle({width:`${plan.value.width+stubRoom}px`,height:`${plan.value.height}px`})},[(openBlock(),createElementBlock(`svg`,{class:`usage-web__edges`,width:plan.value.width+stubRoom,height:plan.value.height,"aria-hidden":`true`},[createBaseVNode(`defs`,null,[(openBlock(),createElementBlock(Fragment,null,renderList([`exact`,`probable`],certainty=>{return createBaseVNode(`marker`,{id:`${arrowId}-${certainty}`,key:certainty,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto-start-reverse`},[createBaseVNode(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,class:normalizeClass(`usage-web__arrow usage-web__arrow--${certainty}`)},null,2)],8,_hoisted_16$3)}),64))]),(openBlock(true),createElementBlock(Fragment,null,renderList(plan.value.paths,edge=>{return openBlock(),createElementBlock(`path`,{key:edge.key,d:edge.d,"marker-end":`url(#${arrowId}-${edge.certainty===`probable`?`probable`:`exact`})`,class:normalizeClass([`usage-web__line`,[`usage-web__line--${edge.certainty||`exact`}`,{"usage-web__line--dim":__props.selectedId&&edge.from!==__props.selectedId&&edge.to!==__props.selectedId}]])},null,10,_hoisted_17$3)}),128)),(openBlock(true),createElementBlock(Fragment,null,renderList(stubs.value,stub=>{return openBlock(),createElementBlock(`g`,{key:stub.id},[createBaseVNode(`line`,{x1:stub.x,y1:stub.y,x2:stub.x+14,y2:stub.y,class:`usage-web__line usage-web__line--probable`},null,8,_hoisted_18$3),createBaseVNode(`circle`,{cx:stub.x+19,cy:stub.y,r:`5`,class:`usage-web__stub`},[createBaseVNode(`title`,null,toDisplayString(unref(countLabel)(stub.count,`unresolved call`)),1)],8,_hoisted_19$3)])}),128))],8,_hoisted_15$3)),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.nodes,node=>{return openBlock(),createElementBlock(`button`,{key:node.id,type:`button`,class:normalizeClass([`usage-node`,{"usage-node--selected":node.id===__props.selectedId,"usage-node--probable":node.certainty===`probable`,"usage-node--plumbing":node.plumbing}]),style:normalizeStyle(nodeStyle(node)),"aria-pressed":node.id===__props.selectedId,"aria-label":nodeLabel(node),title:[node.title,node.subtitle,badge(node,true)].filter(Boolean).join(`
|
|
2
2
|
`),onClick:$event=>emit(`select`,node)},[createBaseVNode(`span`,_hoisted_21$3,[createBaseVNode(`span`,_hoisted_22$3,toDisplayString(node.title),1),badge(node)?(openBlock(),createElementBlock(`span`,_hoisted_23$2,toDisplayString(badge(node)),1)):createCommentVNode(``,true)]),createBaseVNode(`span`,_hoisted_24$2,[createBaseVNode(`span`,_hoisted_25$2,toDisplayString(node.location?.name??node.subtitle),1),node.location?.line?(openBlock(),createElementBlock(`span`,_hoisted_26$2,toDisplayString(node.location.line),1)):createCommentVNode(``,true)])],14,_hoisted_20$3)}),128))],4)],544),moreRight.value?(openBlock(),createElementBlock(`div`,_hoisted_27$2)):createCommentVNode(``,true)]))],64))],2)}}};var Vibe64UsageWebCanvas_default=_plugin_vue_export_helper_default(_sfc_main$7,[[`__scopeId`,`data-v-3a912858`]]);function useVibe64UsageEntryReads({props,usage,mode,compact,pickerOpen,update,closePanel}){const search=ref(``);const kind=ref(``);const exactOnly=ref(false);const maxNodes=ref(300);let searchTimer;let loadedKey=``;const loadEntries=()=>usage.entries.search({q:search.value,kind:kind.value});watch([search,kind],()=>{clearTimeout(searchTimer);searchTimer=setTimeout(loadEntries,200)});watch([()=>props.active,()=>props.sessionId,()=>props.snapshotKey],([active,sessionId,key])=>{if(!active||!sessionId||loadedKey===`${sessionId}\n${key}`)return;loadedKey=`${sessionId}\n${key}`;loadEntries()},{immediate:true});function selectEntry(entry){pickerOpen.value=false;if(entry.id!==props.state.entry)update({entry:entry.id,subsystem:``})}let handledFind=null;watch(()=>props.findRequest,async request=>{if(!request||request===handledFind||request.entryId)return;handledFind=request;search.value=String(request.q||``).slice(0,80);kind.value=request.kind||``;await nextTick();clearTimeout(searchTimer);const page=await loadEntries();if(page?.entries.length===1&&!page.nextCursor)selectEntry(page.entries[0]);else if(compact.value)pickerOpen.value=true},{immediate:true});const webQuery=computed(()=>props.state.entry&&mode.value!==`recording`?{entryId:props.state.entry,mode:mode.value,certainty:mode.value===`calls`&&exactOnly.value?`exact`:void 0,subsystemId:props.state.subsystem||void 0,maxNodes:maxNodes.value===300?void 0:maxNodes.value}:null);let webKey=``;function loadWeb(force=false){const key=JSON.stringify([webQuery.value,props.sessionId,props.snapshotKey]);if(!props.active||!webQuery.value||!force&&key===webKey)return;webKey=key;usage.web.run(webQuery.value)}watch([()=>props.state.entry,mode,()=>props.state.subsystem],()=>{maxNodes.value=300;closePanel()});watch([()=>JSON.stringify(webQuery.value),()=>props.active,()=>props.sessionId,()=>props.snapshotKey],()=>loadWeb(),{immediate:true});const webData=computed(()=>usage.web.data.value);const webEntry=computed(()=>webData.value?.entry||{});let handledPick=null;let pickedEntry=``;watch([()=>props.findRequest,webEntry],([request,entry])=>{if(request?.entryId&&request!==handledPick){handledPick=request;pickedEntry=request.entryId}if(!pickedEntry||entry.id!==pickedEntry)return;pickedEntry=``;kind.value=``;search.value=String(entry.title||``).slice(0,80)},{immediate:true});const webFresh=computed(()=>Boolean(webData.value&&webData.value.entry.id===props.state.entry&&webData.value.mode===mode.value&&(mode.value!==`calls`||webData.value.certainty===(exactOnly.value?`exact`:`all`))));onBeforeUnmount(()=>clearTimeout(searchTimer));return{search,kind,exactOnly,maxNodes,loadEntries,selectEntry,loadWeb,webData,webEntry,webFresh}}var LIVE_REFRESH_MS=5e3;var LIVE_STATES=new Set([`starting`,`recording`,`stopping`]);function useVibe64UsageRecordingReads({props,usage,mode,pickerOpen,update,closePanel}){const requestSearch=ref(``);const includeEmpty=ref(false);const recordings=computed(()=>usage.recordings.data.value?.recordings||[]);const unavailable=computed(()=>unavailableRuntimes(usage.targets.data.value?.targets||[]));const recordingActive=computed(()=>props.active&&mode.value===`recording`);const selectedRecording=computed(()=>recordings.value.find(recording=>recording.id===props.state.recording)||null);async function loadRecordings(){await Promise.all([usage.recordings.run(),usage.targets.run()])}let recordingsKey=``;watch([recordingActive,()=>props.sessionId,()=>props.snapshotKey],([on,sessionId,key])=>{if(!on||recordingsKey===`${sessionId}\n${key}`)return;recordingsKey=`${sessionId}\n${key}`;loadRecordings()},{immediate:true});watch(recordings,list=>{if(mode.value===`recording`&&list.length&&!list.some(recording=>recording.id===props.state.recording))update({recording:list[0].id,request:``,interaction:``,subsystem:``})});const live=computed(()=>LIVE_STATES.has(selectedRecording.value?.state));const newestFirst=ref(false);watch(()=>selectedRecording.value?.id,id=>{if(id)newestFirst.value=live.value},{immediate:true});let requestTimer;const requestFilter=()=>({recordingId:props.state.recording,q:requestSearch.value.trim(),includeEmpty:includeEmpty.value,newestFirst:newestFirst.value});const loadRequests=(read=`run`)=>recordingActive.value&&selectedRecording.value?usage.requests[read](requestFilter()):null;watch(requestSearch,()=>{clearTimeout(requestTimer);requestTimer=setTimeout(loadRequests,200)});watch([recordingActive,()=>selectedRecording.value?.id,includeEmpty,newestFirst,()=>props.snapshotKey],()=>{loadRequests()},{immediate:true});let resultKey=``;function loadResult(force=false){const{recording,request,interaction}=props.state;const key=JSON.stringify([recording,request,interaction,props.sessionId,props.snapshotKey]);if(!recordingActive.value||!recording||!request&&!interaction||!force&&key===resultKey)return;resultKey=key;usage.result.run(interaction?{recordingId:recording,interactionId:interaction}:{recordingId:recording,requestId:request})}watch([recordingActive,()=>props.state.recording,()=>props.state.request,()=>props.state.interaction,()=>props.snapshotKey],()=>loadResult(),{immediate:true});watch([()=>props.state.request,()=>props.state.interaction],()=>closePanel());watch(()=>recordingActive.value&&live.value,(following,wasFollowing,onCleanup)=>{if(!following){if(wasFollowing)loadRequests(`refresh`);return}const timer=setInterval(()=>{usage.recordings.run();loadRequests(`refresh`)},LIVE_REFRESH_MS);onCleanup(()=>clearInterval(timer))});const resultFresh=computed(()=>{const data=usage.result.data.value;return Boolean(data&&data.recordingId===props.state.recording&&data.requestId===props.state.request&&data.interactionId===props.state.interaction)});const recorded=computed(()=>resultFresh.value?recordingWeb(usage.result.data.value.functions,usage.result.data.value.join):null);const changedSinceRecording=computed(()=>{const recordedScan=selectedRecording.value?.sourceIdentity;const currentScan=resultFresh.value?usage.result.data.value.join?.snapshot?.sourceIdentity:null;return Boolean(recordedScan&¤tScan&&recordedScan!==currentScan)});const requestRows=computed(()=>usage.requests.data.value?.requests||[]);const requestTotal=computed(()=>usage.requests.data.value?.total??null);const resultRead=computed(()=>resultFresh.value?usage.result.data.value:null);const selectedRequest=computed(()=>requestRows.value.find(request=>request.id===props.state.request)||(resultRead.value?.request?.id===props.state.request?resultRead.value.request:null));const selectedInteraction=computed(()=>{const id=props.state.interaction||selectedRequest.value?.interaction;return id?[...usage.requests.data.value?.interactions||[],...resultRead.value?.interactions||[]].find(item=>item.id===id)||null:null});const interactionRequestCount=computed(()=>props.state.interaction?resultRead.value?.requestIds?.length??null:null);const recordingBindings=computed(()=>({sessionId:props.sessionId,recordings:recordings.value,recordingId:props.state.recording,requests:requestRows.value,interactions:usage.requests.data.value?.interactions||[],total:requestTotal.value,hasMore:Boolean(usage.requests.data.value?.nextCursor)&&(requestTotal.value==null||requestCount(requestRows.value)<requestTotal.value),newestFirst:newestFirst.value,requestId:props.state.request,interactionId:props.state.interaction,search:requestSearch.value,includeEmpty:includeEmpty.value,unavailable:unavailable.value,loading:usage.recordings.loading.value,requestsLoading:usage.requests.loading.value,error:usage.recordings.error.value||usage.requests.error.value}));const recordingHandlers={deleted:()=>{update({recording:``,request:``,interaction:``,subsystem:``});loadRecordings()},"update:recordingId":id=>update({recording:id,request:``,interaction:``,subsystem:``}),"update:requestId":id=>{pickerOpen.value=false;update({request:id,interaction:``,subsystem:``})},"update:interactionId":id=>{pickerOpen.value=false;update({interaction:id,request:``,subsystem:``})},"update:search":value=>{requestSearch.value=value},"update:includeEmpty":value=>{includeEmpty.value=value},more:()=>usage.requests.more(),retry:()=>{loadRecordings();loadRequests()}};function recordingStarted(event={}){const id=event.recording?.id;if(id)update({mode:`recording`,recording:id,request:``,interaction:``,subsystem:``});recordingsKey=``;loadRecordings()}onBeforeUnmount(()=>clearTimeout(requestTimer));return{recordings,unavailable,loadRecordings,loadResult,resultFresh,recorded,changedSinceRecording,requestRows,selectedRequest,selectedInteraction,interactionRequestCount,recordingBindings,recordingHandlers,recordingStarted}}var ENTRY_PAGE=100;var REQUEST_PAGE=200;var RECORDED_FUNCTIONS=1500;var segment=value=>encodeURIComponent(String(value||``).trim());function queryOf(values){return Object.fromEntries(Object.entries(values).filter(([,value])=>value!==void 0&&value!==null&&value!==``&&value!==false))}function latestRead(load){const data=shallowRef(null);const loading=ref(false);const error=ref(``);const errorCode=ref(``);let sequence=0;let controller=null;async function run(...args){const current=++sequence;controller?.abort();controller=typeof AbortController===`function`?new AbortController:null;loading.value=true;error.value=``;errorCode.value=``;try{const value=await load(controller?.signal,...args);if(current===sequence)data.value=value;return current===sequence?value:null}catch(failure){if(current===sequence){error.value=String(failure?.message||`The usage map could not be read.`);errorCode.value=String(failure?.code||``)}return null}finally{if(current===sequence)loading.value=false}}function reset(){sequence+=1;controller?.abort();data.value=null;loading.value=false;error.value=``;errorCode.value=``}return{data,loading,error,errorCode,run,reset}}var byId=rows=>new Set(rows.map(row=>row.id));var union=(first=[],second=[])=>{const ids=byId(first);return[...first,...second.filter(row=>!ids.has(row.id))]};function requestPages(load){const read=latestRead(load);const data=shallowRef(null);let filter=null;async function run(next){filter=next;const page=await read.run(next,null);if(page)data.value={...page,filterKey:JSON.stringify(next)};return page}async function more(){const shown=data.value;if(!shown?.nextCursor)return null;const page=await read.run(filter,shown.nextCursor);if(!page||data.value!==shown)return null;data.value={...shown,...page,requests:union(shown.requests,page.requests),interactions:union(shown.interactions,page.interactions)};return page}async function refresh(next){const shown=data.value;if(!shown||shown.filterKey!==JSON.stringify(next))return run(next);if(read.loading.value)return null;const page=await read.run(next,null);if(!page||data.value!==shown)return null;const reaches=!page.nextCursor||byId(shown.requests).has(page.requests.at(-1)?.id);data.value=!reaches?{...page,filterKey:shown.filterKey}:{...shown,...page,requests:union(page.requests,shown.requests),interactions:union(page.interactions,shown.interactions),nextCursor:shown.requests.length>page.requests.length?shown.nextCursor:page.nextCursor};return page}return{data,loading:read.loading,error:read.error,errorCode:read.errorCode,run,more,refresh}}function useVibe64UsageWeb({sessionId}){const paths=usePaths();const client=getHttpWebClient();const session=computed(()=>segment(unref(sessionId)));const usagePath=computed(()=>`${paths.api(SYSTEM_GRAPH_API_SUFFIX,{surface:`app`})}/sessions/${session.value}/usage`);const recordingPath=computed(()=>`${paths.api(USAGE_RECORDING_API_SUFFIX,{surface:`app`})}/sessions/${session.value}`);const get=(path,query,signal)=>client.request(path,{method:`GET`,query:queryOf(query),signal});const entryItems=shallowRef([]);const entryKinds=shallowRef([]);const entryCursor=ref(null);const snapshot=shallowRef(null);let entryFilter={};const entryRead=latestRead((signal,filter,cursor)=>get(`${usagePath.value}/entries`,{q:filter.q,kind:filter.kind,cursor,limit:ENTRY_PAGE},signal));async function searchEntries(filter={}){entryFilter={q:String(filter.q||``).trim().slice(0,80),kind:filter.kind||``};const page=await entryRead.run(entryFilter,null);if(!page)return null;entryItems.value=page.entries;entryKinds.value=page.kinds;entryCursor.value=page.nextCursor;snapshot.value=page.snapshot;return page}async function moreEntries(){if(!entryCursor.value)return null;const page=await entryRead.run(entryFilter,entryCursor.value);if(!page)return null;entryItems.value=[...entryItems.value,...page.entries];entryCursor.value=page.nextCursor;return page}const web=latestRead((signal,query)=>get(`${usagePath.value}/web`,query,signal));const detail=latestRead((signal,functionId)=>get(`${usagePath.value}/function`,{functionId},signal));const recordings=latestRead(signal=>get(recordingPath.value,{},signal));const targets=latestRead(signal=>get(`${recordingPath.value}/targets`,{},signal));async function withRouteTemplates(page,signal){const rows=page?.requests||[];const keyOf=row=>`${row.method} ${row.path}`;const asked=[...new Map(rows.filter(row=>row.method&&row.path).map(row=>[keyOf(row),row])).values()];if(!asked.length)return page;const answer=await client.request(`${usagePath.value}/routes`,{method:`POST`,body:{requests:asked.map(({method,path})=>({method,path}))},signal}).catch(()=>null);const templates=new Map(asked.map((row,position)=>[keyOf(row),answer?.templates?.[position]||``]));return{...page,requests:rows.map(row=>templates.get(keyOf(row))?{...row,routeTemplate:templates.get(keyOf(row))}:row)}}const requests=requestPages(async(signal,{recordingId,q,includeEmpty,newestFirst},cursor)=>withRouteTemplates(await get(`${recordingPath.value}/${segment(recordingId)}/requests`,{q,includeEmpty:includeEmpty?`true`:``,order:newestFirst?`newest`:``,cursor,limit:REQUEST_PAGE},signal),signal));const result=latestRead(async(signal,{recordingId,requestId=``,interactionId=``})=>{const recordingBase=`${recordingPath.value}/${segment(recordingId)}`;const requestsPath=`${recordingBase}/requests`;const[ran,named]=await Promise.all(interactionId?[get(`${recordingBase}/interactions/${segment(interactionId)}/functions`,{limit:RECORDED_FUNCTIONS},signal),null]:[get(`${requestsPath}/${segment(requestId)}/functions`,{limit:RECORDED_FUNCTIONS},signal),get(requestsPath,{requestId,limit:1},signal).then(page=>withRouteTemplates(page,signal)).catch(()=>null)]);const functions=ran.functions||[];const join=await client.request(`${usagePath.value}/join`,{method:`POST`,body:{functions:functions.map(({path,hash,name,start})=>({path,hash,name,start}))},signal});return{recordingId,requestId,interactionId,functions,total:ran.total??functions.length,truncated:ran.truncated===true,join,request:named?.requests?.find(row=>row.id===requestId)||null,interactions:interactionId?[ran.interaction].filter(Boolean):named?.interactions||[],requestIds:interactionId?ran.requests||[]:null}});return{entries:{items:entryItems,kinds:entryKinds,hasMore:computed(()=>Boolean(entryCursor.value)),loading:entryRead.loading,error:entryRead.error,errorCode:entryRead.errorCode,search:searchEntries,more:moreEntries},snapshot,web,detail,recordings,targets,requests,result}}var _hoisted_1$6={key:0,class:`usage-view__rail`};var _hoisted_2$6={class:`usage-view__main`};var _hoisted_3$6={class:`usage-view__header`};var _hoisted_4$6={key:0,class:`usage-view__picker-row`};var _hoisted_5$6={key:1,class:`usage-view__title`};var _hoisted_6$5=[`title`];var _hoisted_7$4={class:`usage-view__click-text`};var _hoisted_8$4={key:0,class:`usage-view__click-file`};var _hoisted_9$4={key:1,class:`usage-view__click-count`};var _hoisted_10$3={class:`usage-view__controls`};var _hoisted_11$3={class:`usage-view__content`};var _hoisted_12$3={key:0,class:`usage-view__state`,role:`status`};var _hoisted_13$3={key:2,class:`usage-view__skeleton`,"aria-busy":`true`,"aria-label":`Loading usage`};var _hoisted_14$3={key:3,class:`usage-view__state`,role:`status`};var _hoisted_15$2={class:`text-body-medium`};var _hoisted_16$2={key:1,class:`usage-view__note text-body-small`};var _hoisted_17$2={key:2,class:`usage-view__note text-body-small`};var _hoisted_18$2={key:1,class:`usage-view__state`,role:`status`};var _hoisted_19$2={key:1,class:`text-body-medium`};var _hoisted_20$2={key:2,class:`usage-view__state`,role:`status`};var _hoisted_21$2={key:3,class:`usage-view__state`,role:`status`};var _hoisted_22$2={key:5,class:`usage-view__skeleton`,"aria-busy":`true`,"aria-label":`Loading what ran`};var COMPACT_WIDTH=600;var WIDE_WIDTH=1040;var GRAPH_WIDTH=888;var _sfc_main$6={__name:`Vibe64UsageView`,props:{active:{type:Boolean,default:true},sessionId:{type:String,required:true},state:{type:Object,required:true},findRequest:{type:Object,default:null},snapshotKey:{type:String,default:``},refreshing:{type:Boolean,default:false}},emits:[`update:state`,`refresh`,`open-source-file`,`select-preview`],setup(__props,{expose:__expose,emit:__emit}){const props=__props;const emit=__emit;const usage=useVibe64UsageWeb({sessionId:toRef(props,`sessionId`)});const root=ref(null);const compact=ref(false);const wide=ref(true);const listCanvas=ref(false);const showUntouched=ref(false);const showPlumbing=ref(false);const selected=shallowRef(null);const pickerOpen=ref(false);const recordOpen=ref(false);const mode=computed(()=>props.state.mode||`calls`);const snapshot=computed(()=>usage.snapshot.value||usage.web.data.value?.snapshot||null);const notScanned=computed(()=>[usage.entries,usage.web,usage.result].some(read=>read.errorCode.value===NOT_SCANNED_CODE));const busy=computed(()=>[usage.web,usage.result,usage.requests].some(read=>read.loading.value));function update(patch){emit(`update:state`,{...props.state,view:`usage`,...patch})}function setMode(value){if(!value||value===mode.value)return;update({mode:value,subsystem:``})}function selectNode(node){selected.value=node;if(node.functionId)usage.detail.run(node.functionId);else usage.detail.reset()}function closePanel(){selected.value=null;usage.detail.reset()}const{search,kind,exactOnly,maxNodes,loadEntries,selectEntry,loadWeb,webData,webEntry,webFresh}=useVibe64UsageEntryReads({props,usage,mode,compact,pickerOpen,update,closePanel});const noEntries=computed(()=>notScanned.value||!usage.entries.items.value.length&&!usage.entries.loading.value&&!usage.entries.error.value&&!search.value&&!kind.value&&Boolean(usage.snapshot.value));const railBindings=computed(()=>({entries:usage.entries.items.value,kinds:usage.entries.kinds.value,search:search.value,kind:kind.value,selectedId:props.state.entry,loading:usage.entries.loading.value,error:notScanned.value?``:usage.entries.error.value,hasMore:usage.entries.hasMore.value,refreshing:props.refreshing}));const railHandlers={"update:search":value=>{search.value=value},"update:kind":value=>{kind.value=value},select:selectEntry,more:()=>usage.entries.more(),retry:loadEntries,refresh:()=>emit(`refresh`)};const{recordings,unavailable,loadRecordings,loadResult,resultFresh,recorded,changedSinceRecording,requestRows,selectedRequest,selectedInteraction,interactionRequestCount,recordingBindings,recordingHandlers,recordingStarted}=useVibe64UsageRecordingReads({props,usage,mode,pickerOpen,update,closePanel});const inSubsystem=(items,subsystemId)=>(items||[]).filter(item=>item.subsystemId===subsystemId);const webView=computed(()=>{const zoomed=props.state.subsystem;if(mode.value===`recording`){const data=recorded.value;if(!data)return null;const inside=zoomed?inSubsystem(data.nodes,zoomed):[];return{subsystems:data.subsystems,groups:usage.result.data.value.join?.groups||[],crossings:data.crossings,nodes:webNodes(`recording`,{nodes:inside.filter(node=>showPlumbing.value||!node.plumbing),edges:data.edges}),edges:data.edges,plumbing:inside.filter(node=>node.plumbing).length}}const data=webFresh.value?webData.value:null;if(!data)return null;const scoped=zoomed?{...data,files:inSubsystem(data.files,zoomed),functions:inSubsystem(data.functions,zoomed)}:{};return{subsystems:data.subsystems,groups:data.groups,crossings:data.crossings,nodes:zoomed?webNodes(mode.value,scoped):[],edges:data.edges||[],plumbing:0}});const canvasBindings=computed(()=>({mode:mode.value,subsystems:webView.value?.subsystems||[],groups:webView.value?.groups||[],crossings:webView.value?.crossings||[],zoomedId:props.state.subsystem,nodes:webView.value?.nodes||[],edges:webView.value?.edges||[],selectedId:selected.value?.id||``,showUntouched:showUntouched.value,compact:compact.value||listCanvas.value,startSubsystemId:mode.value===`recording`?``:webEntry.value.subsystemId||``}));const canvasHandlers={zoom:subsystemId=>update({subsystem:subsystemId}),select:selectNode,"update:showUntouched":value=>{showUntouched.value=value}};function selectFunction(fn){selectNode((webView.value?.nodes||[]).find(node=>node.functionId===fn.id)||{id:fn.id,functionId:fn.id,title:functionLabel(fn),subtitle:`${fn.file}:${fn.start.line}`,file:fn.file,start:fn.start})}function openSource(location){emit(`open-source-file`,{...location,presentation:`code`,origin:`system`,systemContext:{usage:{...props.state,view:`usage`}}})}const ranCounts=computed(()=>mode.value===`recording`&&recorded.value?new Map(recorded.value.nodes.filter(node=>node.functionId).map(node=>[node.functionId,node.count])):new Map);const panelBindings=computed(()=>({node:selected.value,ran:ranCounts.value,detail:selected.value?.functionId&&usage.detail.data.value?.function?.id===selected.value.functionId?usage.detail.data.value:null,loading:usage.detail.loading.value,error:usage.detail.error.value}));const panelHandlers={close:closePanel,select:selectFunction,"open-source":openSource,retry:()=>selected.value&&selectNode(selected.value)};const chosenClick=computed(()=>props.state.interaction?selectedInteraction.value:null);const chosen=computed(()=>Boolean(mode.value===`recording`?selectedRequest.value||chosenClick.value:props.state.entry));const clickInteraction=computed(()=>chosen.value?selectedInteraction.value:null);const clickParts=computed(()=>interactionParts(clickInteraction.value));const clickTitle=computed(()=>interactionTitle(clickInteraction.value));const clickStarted=computed(()=>chosenClick.value&&interactionRequestCount.value!==null?`probably started ${countLabel(interactionRequestCount.value,`request`)}`:``);const clickTooltip=computed(()=>[clickTitle.value,clickStarted.value].filter(Boolean).join(` · `));const pickerLabel=computed(()=>{if(mode.value===`recording`){if(chosenClick.value)return compact.value?[clickTitle.value,interactionRequestCount.value!==null&&countLabel(interactionRequestCount.value,`request`)].filter(Boolean).join(` · `):interactionRunTitle(chosenClick.value);const request=selectedRequest.value;if(!request)return`Choose a request`;return isBackgroundRequest(request)?`Request: ${requestTitle(request,requestRows.value)}`:`Request: ${[request.method,requestTitle(request)].filter(Boolean).join(` `)}`}const entry=usage.entries.items.value.find(item=>item.id===props.state.entry)||(webEntry.value.id===props.state.entry?webEntry.value:null);return entry?`Entry: ${entry.title}`:`Choose an entry`});let observer=null;watch(root,element=>{observer?.disconnect();if(!element||!hasWindowFunction(`ResizeObserver`))return;observer=new ResizeObserver(()=>{const width=element.clientWidth;if(!width)return;compact.value=width<=COMPACT_WIDTH;wide.value=width>=WIDE_WIDTH;listCanvas.value=width<GRAPH_WIDTH});observer.observe(element)},{flush:`post`});onBeforeUnmount(()=>{observer?.disconnect()});__expose({compact,selected,pickerOpen,search,kind,exactOnly});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{ref_key:`root`,ref:root,class:normalizeClass([`usage-view`,{"usage-view--compact":compact.value,"usage-view--panel":selected.value&&wide.value}]),"aria-label":`Usage`},[!compact.value?(openBlock(),createElementBlock(`aside`,_hoisted_1$6,[mode.value===`recording`?(openBlock(),createBlock(Vibe64UsageRecordingResults_default,mergeProps({key:0},unref(recordingBindings),toHandlers(unref(recordingHandlers))),null,16)):(openBlock(),createBlock(Vibe64UsageEntryRail_default,mergeProps({key:1},railBindings.value,toHandlers(railHandlers)),null,16))])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$6,[createBaseVNode(`header`,_hoisted_3$6,[compact.value?(openBlock(),createElementBlock(`div`,_hoisted_4$6,[createVNode(Vibe64UsageEntryPicker_default,{modelValue:pickerOpen.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>pickerOpen.value=$event),label:pickerLabel.value,title:mode.value===`recording`?`Requests`:`Entry points`},{default:withCtx(()=>[mode.value===`recording`?(openBlock(),createBlock(Vibe64UsageRecordingResults_default,mergeProps({key:0},unref(recordingBindings),toHandlers(unref(recordingHandlers))),null,16)):(openBlock(),createBlock(Vibe64UsageEntryRail_default,mergeProps({key:1},railBindings.value,toHandlers(railHandlers)),null,16))]),_:1},8,[`modelValue`,`label`,`title`]),createVNode(VBtn,{class:`usage-view__record usage-view__record--icon`,variant:`tonal`,color:`primary`,icon:`$radioOn`,"aria-label":`Record`,title:`Record`,onClick:_cache[1]||(_cache[1]=$event=>recordOpen.value=true)})])):createCommentVNode(``,true),!compact.value?(openBlock(),createElementBlock(`div`,_hoisted_5$6,[createBaseVNode(`h3`,{class:normalizeClass([`usage-view__entry text-title-medium`,{"usage-view__entry--none":!chosen.value}])},[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(pathParts)(pickerLabel.value),(part,position)=>{return openBlock(),createElementBlock(Fragment,{key:position},[createTextVNode(toDisplayString(part),1),_cache[16]||(_cache[16]=createBaseVNode(`wbr`,null,null,-1))],64)}),128))],2),mode.value===`recording`?(openBlock(),createElementBlock(`p`,{key:0,class:`usage-view__click text-body-medium`,title:clickTooltip.value||void 0},[clickTitle.value?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode(`span`,_hoisted_7$4,toDisplayString(clickParts.value.text),1),clickParts.value.file?(openBlock(),createElementBlock(`span`,_hoisted_8$4,toDisplayString(` `+clickParts.value.file),1)):createCommentVNode(``,true),clickStarted.value?(openBlock(),createElementBlock(`span`,_hoisted_9$4,toDisplayString(` · `+clickStarted.value),1)):createCommentVNode(``,true)],64)):createCommentVNode(``,true)],8,_hoisted_6$5)):createCommentVNode(``,true)])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_10$3,[createVNode(VBtnToggle,{"model-value":mode.value,class:`usage-view__modes`,mandatory:``,divided:``,rounded:`pill`,color:`primary`,variant:`outlined`,density:`comfortable`,role:`group`,"aria-label":`Usage mode`,"onUpdate:modelValue":setMode},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(USAGE_MODES),item=>{return openBlock(),createBlock(VBtn,{key:item.value,value:item.value},{default:withCtx(()=>[createTextVNode(toDisplayString(item.title),1)]),_:2},1032,[`value`])}),128))]),_:1},8,[`model-value`]),mode.value===`calls`?(openBlock(),createBlock(VChip,{key:0,variant:unref(exactOnly)?`tonal`:`outlined`,"prepend-icon":unref(exactOnly)?`$check`:void 0,role:`switch`,"aria-checked":unref(exactOnly),onClick:_cache[2]||(_cache[2]=$event=>exactOnly.value=!unref(exactOnly))},{default:withCtx(()=>[..._cache[17]||(_cache[17]=[createTextVNode(` Exact only `,-1)])]),_:1},8,[`variant`,`prepend-icon`,`aria-checked`])):createCommentVNode(``,true),!compact.value?(openBlock(),createBlock(VBtn,{key:1,class:`usage-view__record`,variant:`tonal`,color:`primary`,"prepend-icon":`$radioOn`,title:`Record`,onClick:_cache[3]||(_cache[3]=$event=>recordOpen.value=true)},{default:withCtx(()=>[..._cache[18]||(_cache[18]=[createBaseVNode(`span`,{class:`usage-view__record-label`},`Record`,-1)])]),_:1})):createCommentVNode(``,true)])]),createVNode(VProgressLinear,{active:busy.value,indeterminate:``,color:`primary`,height:`2`,class:`usage-view__progress`},null,8,[`active`]),createBaseVNode(`div`,_hoisted_11$3,[snapshot.value?.stale?(openBlock(),createBlock(VAlert,{key:0,type:`info`,variant:`tonal`,density:`compact`,class:`usage-view__banner`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,loading:__props.refreshing,onClick:_cache[4]||(_cache[4]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[19]||(_cache[19]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`])]),default:withCtx(()=>[_cache[20]||(_cache[20]=createTextVNode(` Source changed since the last scan `,-1))]),_:1})):createCommentVNode(``,true),mode.value!==`recording`?(openBlock(),createElementBlock(Fragment,{key:1},[!__props.state.entry||notScanned.value?(openBlock(),createElementBlock(`div`,_hoisted_12$3,[noEntries.value?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[22]||(_cache[22]=createBaseVNode(`h3`,{class:`text-title-medium`},`No entry points found yet`,-1)),_cache[23]||(_cache[23]=createBaseVNode(`p`,{class:`text-body-medium`},`No entry points found yet. Refresh the architecture scan.`,-1)),createVNode(VBtn,{variant:`tonal`,loading:__props.refreshing,"prepend-icon":`$refresh`,onClick:_cache[5]||(_cache[5]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[21]||(_cache[21]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`])],64)):(openBlock(),createElementBlock(Fragment,{key:1},[_cache[24]||(_cache[24]=createBaseVNode(`h3`,{class:`text-title-medium`},`Pick an entry point`,-1)),_cache[25]||(_cache[25]=createBaseVNode(`p`,{class:`text-body-medium`},`Choose a page, component, route, command or library export to see only what it reaches.`,-1))],64))])):unref(usage).web.error.value?(openBlock(),createBlock(VAlert,{key:1,type:`error`,variant:`tonal`,class:`usage-view__banner`},{append:withCtx(()=>[unref(usage).web.errorCode.value===`vibe64_usage_entry_not_found`?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,size:`small`,onClick:_cache[6]||(_cache[6]=$event=>update({entry:``,subsystem:``}))},{default:withCtx(()=>[..._cache[26]||(_cache[26]=[createTextVNode(`Choose another`,-1)])]),_:1})):(openBlock(),createBlock(VBtn,{key:1,variant:`text`,size:`small`,onClick:_cache[7]||(_cache[7]=$event=>unref(loadWeb)(true))},{default:withCtx(()=>[..._cache[27]||(_cache[27]=[createTextVNode(`Retry`,-1)])]),_:1}))]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(usage).web.errorCode.value===`vibe64_usage_entry_not_found`?`This entry point is not in the current scan.`:unref(usage).web.error.value)+` `,1)]),_:1})):!unref(webFresh)?(openBlock(),createElementBlock(`div`,_hoisted_13$3,[(openBlock(),createElementBlock(Fragment,null,renderList(4,card=>{return createVNode(VSkeletonLoader,{key:card,type:`card`,class:`usage-view__skeleton-card`})}),64))])):mode.value===`calls`&&!unref(webEntry).hasCalls?(openBlock(),createElementBlock(`div`,_hoisted_14$3,[_cache[29]||(_cache[29]=createBaseVNode(`h3`,{class:`text-title-medium`},`Calls are not available here`,-1)),createBaseVNode(`p`,_hoisted_15$2,toDisplayString(snapshot.value?.callWebIdentity?`No functions are known for this entry.`:snapshot.value?.callWebProblem===`not-ignored`?unref(NOT_IGNORED_TEXT):`The last scan did not read calls for this project.`)+` Imports still shows the files it reaches.`,1),createVNode(VBtn,{variant:`tonal`,onClick:_cache[8]||(_cache[8]=$event=>setMode(`imports`))},{default:withCtx(()=>[..._cache[28]||(_cache[28]=[createTextVNode(`Show Imports`,-1)])]),_:1})])):(openBlock(),createElementBlock(Fragment,{key:4},[unref(webData).truncated?(openBlock(),createBlock(VAlert,{key:0,type:`warning`,variant:`tonal`,density:`compact`,class:`usage-view__banner`},createSlots({default:withCtx(()=>[createTextVNode(` Showing the first `+toDisplayString(unref(webData).limits.maxNodes.toLocaleString())+toDisplayString(unref(maxNodes)<unref(1e3)?``:`. Zoom into a subsystem to see the rest`)+` `,1)]),_:2},[unref(maxNodes)<unref(1e3)?{name:`append`,fn:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[9]||(_cache[9]=$event=>maxNodes.value=unref(1e3))},{default:withCtx(()=>[..._cache[30]||(_cache[30]=[createTextVNode(`Show more`,-1)])]),_:1})]),key:`0`}:void 0]),1024)):createCommentVNode(``,true),createVNode(Vibe64UsageWebCanvas_default,mergeProps(canvasBindings.value,toHandlers(canvasHandlers)),null,16),mode.value===`calls`&&__props.state.subsystem&&unref(webData).unresolvedTotal>unref(webData).unresolved.length?(openBlock(),createElementBlock(`p`,_hoisted_16$2,` Showing `+toDisplayString(unref(webData).unresolved.length)+` of `+toDisplayString(unref(webData).unresolvedTotal.toLocaleString())+` unresolved calls. `,1)):createCommentVNode(``,true),mode.value===`imports`&&unref(webData).unresolvedImports?(openBlock(),createElementBlock(`p`,_hoisted_17$2,toDisplayString(unref(countLabel)(unref(webData).unresolvedImports,`import`))+` could not be resolved to a project file. `,1)):createCommentVNode(``,true)],64))],64)):(openBlock(),createElementBlock(Fragment,{key:2},[unref(usage).recordings.error.value?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,class:`usage-view__banner`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:unref(loadRecordings)},{default:withCtx(()=>[..._cache[31]||(_cache[31]=[createTextVNode(`Retry`,-1)])]),_:1},8,[`onClick`])]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(usage).recordings.error.value)+` `,1)]),_:1})):!unref(recordings).length?(openBlock(),createElementBlock(`div`,_hoisted_18$2,[unref(usage).recordings.loading.value||!unref(usage).recordings.data.value?(openBlock(),createBlock(VSkeletonLoader,{key:0,type:`paragraph`})):unref(unavailable).length?(openBlock(),createElementBlock(`p`,_hoisted_19$2,[_cache[32]||(_cache[32]=createTextVNode(` Recording not available for this project's runtimes (`,-1)),createBaseVNode(`code`,null,toDisplayString(unref(unavailable).join("`, `")),1),_cache[33]||(_cache[33]=createTextVNode(`). Imports and Calls still work. `,-1))])):(openBlock(),createElementBlock(Fragment,{key:2},[_cache[34]||(_cache[34]=createBaseVNode(`h3`,{class:`text-title-medium`},`No recordings yet`,-1)),_cache[35]||(_cache[35]=createBaseVNode(`p`,{class:`text-body-medium`},`Record what runs, use the app or command, then pick a request to see only the code it ran.`,-1))],64))])):!__props.state.request&&!__props.state.interaction?(openBlock(),createElementBlock(`div`,_hoisted_20$2,[..._cache[36]||(_cache[36]=[createBaseVNode(`h3`,{class:`text-title-medium`},`Pick a request`,-1),createBaseVNode(`p`,{class:`text-body-medium`},`Each request shows the subsystems and functions that ran for it; Everything this click ran shows all of a click's requests together.`,-1)])])):notScanned.value?(openBlock(),createElementBlock(`div`,_hoisted_21$2,[_cache[38]||(_cache[38]=createBaseVNode(`h3`,{class:`text-title-medium`},`Not scanned yet`,-1)),_cache[39]||(_cache[39]=createBaseVNode(`p`,{class:`text-body-medium`},`Refresh the architecture scan to see the subsystems and functions this request ran.`,-1)),createVNode(VBtn,{variant:`tonal`,loading:__props.refreshing,"prepend-icon":`$refresh`,onClick:_cache[10]||(_cache[10]=$event=>emit(`refresh`))},{default:withCtx(()=>[..._cache[37]||(_cache[37]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`loading`])])):unref(usage).result.error.value?(openBlock(),createBlock(VAlert,{key:4,type:`error`,variant:`tonal`,class:`usage-view__banner`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,size:`small`,onClick:_cache[11]||(_cache[11]=$event=>unref(loadResult)(true))},{default:withCtx(()=>[..._cache[40]||(_cache[40]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(usage).result.error.value)+` `,1)]),_:1})):!unref(resultFresh)?(openBlock(),createElementBlock(`div`,_hoisted_22$2,[(openBlock(),createElementBlock(Fragment,null,renderList(4,card=>{return createVNode(VSkeletonLoader,{key:card,type:`card`,class:`usage-view__skeleton-card`})}),64))])):(openBlock(),createElementBlock(Fragment,{key:6},[unref(changedSinceRecording)?(openBlock(),createBlock(VAlert,{key:0,type:`info`,variant:`tonal`,density:`compact`,class:`usage-view__banner`},{default:withCtx(()=>[..._cache[41]||(_cache[41]=[createTextVNode(` Source changed since this recording `,-1)])]),_:1})):createCommentVNode(``,true),unref(usage).result.data.value.truncated?(openBlock(),createBlock(VAlert,{key:1,type:`warning`,variant:`tonal`,density:`compact`,class:`usage-view__banner`},{default:withCtx(()=>[createTextVNode(` Showing the first `+toDisplayString(unref(usage).result.data.value.functions.length.toLocaleString())+` of `+toDisplayString(unref(usage).result.data.value.total.toLocaleString())+` functions that ran. `,1)]),_:1})):createCommentVNode(``,true),createVNode(Vibe64UsageWebCanvas_default,mergeProps(canvasBindings.value,toHandlers(canvasHandlers)),{"zoom-actions":withCtx(()=>[webView.value.plumbing?(openBlock(),createBlock(VChip,{key:0,size:`small`,variant:showPlumbing.value?`tonal`:`outlined`,"prepend-icon":showPlumbing.value?`$check`:void 0,role:`switch`,"aria-checked":showPlumbing.value,onClick:_cache[12]||(_cache[12]=$event=>showPlumbing.value=!showPlumbing.value)},{default:withCtx(()=>[createTextVNode(` Show shared plumbing (`+toDisplayString(webView.value.plumbing)+`) `,1)]),_:1},8,[`variant`,`prepend-icon`,`aria-checked`])):createCommentVNode(``,true)]),_:1},16)],64))],64))])]),selected.value&&!compact.value&&!wide.value?(openBlock(),createElementBlock(`div`,{key:1,class:`usage-view__scrim`,"aria-hidden":`true`,onClick:closePanel})):createCommentVNode(``,true),selected.value&&!compact.value?(openBlock(),createElementBlock(`aside`,{key:2,class:normalizeClass([`usage-view__panel`,{"usage-view__panel--floating":!wide.value}])},[createVNode(Vibe64UsageFunctionPanel_default,mergeProps(panelBindings.value,toHandlers(panelHandlers)),null,16)],2)):createCommentVNode(``,true),compact.value?(openBlock(),createBlock(VBottomSheet,{key:3,"model-value":Boolean(selected.value),scrollable:``,"onUpdate:modelValue":_cache[13]||(_cache[13]=$event=>!$event&&closePanel())},{default:withCtx(()=>[selected.value?(openBlock(),createBlock(VCard,{key:0,class:`usage-view__sheet`},{default:withCtx(()=>[createVNode(Vibe64UsageFunctionPanel_default,mergeProps(panelBindings.value,toHandlers(panelHandlers)),null,16)]),_:1})):createCommentVNode(``,true)]),_:1},8,[`model-value`])):createCommentVNode(``,true),createVNode(unref(Vibe64UsageRecordDialog_default),{modelValue:recordOpen.value,"onUpdate:modelValue":_cache[14]||(_cache[14]=$event=>recordOpen.value=$event),"session-id":__props.sessionId,onStarted:unref(recordingStarted),onSelectPreview:_cache[15]||(_cache[15]=$event=>emit(`select-preview`))},null,8,[`modelValue`,`session-id`,`onStarted`])],2)}}};var Vibe64UsageView_default=_plugin_vue_export_helper_default(_sfc_main$6,[[`__scopeId`,`data-v-269e4878`]]);function useVibe64UsageState({props,architecture,onMapShown}){const route=useRoute();const router=useRouter();const usageState=ref(usageStateFromQuery(route?.query));const usageMounted=ref(usageState.value.view===`usage`);const usageFind=shallowRef(null);const usageSnapshotKey=computed(()=>[architecture.value?.sourceHash,architecture.value?.callWeb?.identity].filter(Boolean).join(`:`));const onSystemRoute=computed(()=>props.active&&/\/dashboard\/system\/?$/u.test(route?.path||``));watch(()=>usageState.value.view,view=>{if(view===`usage`)usageMounted.value=true;else onMapShown()});watch([usageState,onSystemRoute],([state,onRoute])=>{if(!onRoute||!router)return;const query=usageQueryFor(route.query,state);if(!sameQuery(query,route.query))router.replace({query})},{immediate:true});watch(()=>route?.query,query=>{if(!onSystemRoute.value||!query?.view)return;const next=usageStateFromQuery(query);if(!sameUsageState(next,usageState.value))usageState.value=next});let handledUsageOpen=null;watch(()=>props.usageOpenRequest,request=>{if(!request||request===handledUsageOpen)return;handledUsageOpen=request;usageState.value=usageStateFromQuery({view:`usage`,mode:request.mode||`recording`,entry:request.entryId,recording:request.recordingId,request:request.requestId});if(request.entryId&&usageState.value.mode!==`recording`)usageFind.value={entryId:request.entryId}},{immediate:true});let handledRestore=null;watch(()=>props.restoreRequest,request=>{if(!request?.usage||request===handledRestore)return;handledRestore=request;usageState.value=usageStateFromQuery({...request.usage,view:`usage`})},{immediate:true});let usageMemory=null;function setArchitectureView(view){if(!view||view===usageState.value.view)return;if(view===`map`){usageMemory=usageState.value;usageState.value=usageStateFromQuery({})}else usageState.value=usageMemory||usageStateFromQuery({view:`usage`})}function showUsage({q=``,kind=``}){const mode=usageMemory&&usageMemory.mode!==`recording`?usageMemory.mode:`calls`;usageState.value=usageStateFromQuery({view:`usage`,mode});usageFind.value={q,kind}}return{usageState,usageMounted,usageFind,usageSnapshotKey,setArchitectureView,showUsage}}var fileTypeTints=Object.freeze({javascript:`#aa8215`,typescript:`#397fc3`,vue:`#38866c`,python:`#3e79a1`,rust:`#936344`,go:`#298998`,java:`#bc674d`,kotlin:`#8163b0`,csharp:`#7760ac`,cpp:`#4b7aaa`,ruby:`#b75757`,php:`#7a72a6`,css:`#4f86bc`,html:`#bd7050`,json:`#938140`,config:`#7b8190`,shell:`#698171`,image:`#9a74a3`,data:`#408b89`,text:`#6d8592`,code:`#698b80`,folder:`#b68b49`});var _hoisted_1$5=[`open`,`onToggle`];var _hoisted_2$5=[`data-file-path`,`aria-pressed`,`title`,`onClick`,`onKeydown`];var _hoisted_3$5={class:`subsystem-tree__type`,"aria-hidden":`true`};var _hoisted_4$5={class:`subsystem-tree__name`};var _hoisted_5$5=[`title`];var _hoisted_6$4=[`title`];var _hoisted_7$3=[`title`];var _hoisted_8$3=[`title`];var _hoisted_9$3={key:0,class:`subsystem-tree__bar`};var _sfc_main$5={__name:`Vibe64SubsystemTreeBranch`,props:{items:{type:Array,required:true},depth:{type:Number,default:0},selectedId:{type:String,default:``},searching:Boolean,folderState:{type:Map,required:true}},emits:[`select`,`inspect`],setup(__props){useCssVars(_ctx=>({"v5a431d6b":unref(fileTypeTints).folder}));const icons=[[[`js`,`mjs`,`cjs`,`jsx`],`$languageJavascript`,fileTypeTints.javascript],[[`ts`,`tsx`,`mts`,`cts`],`$languageTypescript`,fileTypeTints.typescript],[[`vue`],`$vuejs`,fileTypeTints.vue],[[`py`,`pyi`],`$languagePython`,fileTypeTints.python],[[`rs`],`$languageRust`,fileTypeTints.rust],[[`go`],`$languageGo`,fileTypeTints.go],[[`java`],`$languageJava`,fileTypeTints.java],[[`kt`,`kts`],`$languageKotlin`,fileTypeTints.kotlin],[[`cs`],`$languageCsharp`,fileTypeTints.csharp],[[`c`,`h`,`cc`,`cpp`,`hpp`],`$languageCpp`,fileTypeTints.cpp],[[`rb`],`$languageRuby`,fileTypeTints.ruby],[[`php`],`$languagePhp`,fileTypeTints.php],[[`css`,`scss`,`sass`,`less`],`$languageCss3`,fileTypeTints.css],[[`html`,`htm`],`$languageHtml5`,fileTypeTints.html],[[`json`,`jsonc`],`$dataObject`,fileTypeTints.json],[[`yaml`,`yml`,`toml`,`ini`,`conf`],`$settingsApplications`,fileTypeTints.config],[[`sh`,`bash`,`zsh`,`ps1`],`$terminal`,fileTypeTints.shell],[[`png`,`jpg`,`jpeg`,`webp`,`gif`,`svg`,`ico`],`$image`,fileTypeTints.image],[[`csv`,`tsv`,`sql`],`$tableView`,fileTypeTints.data],[[`md`,`txt`,`rst`],`$description`,fileTypeTints.text]];function icon(name){const extension=name.includes(`.`)?name.split(`.`).at(-1).toLowerCase():``;const match=icons.find(([extensions])=>extensions.includes(extension));return match?{icon:match[1],color:match[2]}:{icon:`$codeBlocks`,color:fileTypeTints.code}}return(_ctx,_cache)=>{const _component_Vibe64SubsystemTreeBranch=resolveComponent(`Vibe64SubsystemTreeBranch`,true);return openBlock(),createElementBlock(`ul`,{class:normalizeClass([`subsystem-tree`,{"subsystem-tree--branch":__props.depth>0}])},[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.items,item=>{return openBlock(),createElementBlock(`li`,{key:item.path||item.id,class:normalizeClass({"subsystem-tree__directory":item.kind===`directory`})},[item.kind===`directory`?(openBlock(),createElementBlock(`details`,{key:0,open:__props.searching||(__props.folderState.get(item.path)??__props.depth<1),onToggle:$event=>!__props.searching&&__props.folderState.set(item.path,$event.target.open)},[createBaseVNode(`summary`,null,[createVNode(VIcon,{class:`subsystem-tree__folder`,icon:`$folder`,size:`20`,"aria-hidden":`true`}),createBaseVNode(`span`,null,toDisplayString(item.name),1),createBaseVNode(`small`,null,toDisplayString(item.count)+` file`+toDisplayString(item.count===1?``:`s`),1)]),createVNode(_component_Vibe64SubsystemTreeBranch,{items:item.children,"folder-state":__props.folderState,depth:__props.depth+1,searching:__props.searching,"selected-id":__props.selectedId,onSelect:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`select`,$event)),onInspect:_cache[1]||(_cache[1]=$event=>_ctx.$emit(`inspect`,$event))},null,8,[`items`,`folder-state`,`depth`,`searching`,`selected-id`])],40,_hoisted_1$5)):(openBlock(),createElementBlock(`button`,{key:1,type:`button`,class:normalizeClass([`subsystem-tree__file nodrag nopan`,{"subsystem-tree__file--selected":__props.selectedId===item.id,"subsystem-tree__file--main":item.programs?.some(program=>program.mainSource===item.file.path)}]),"data-zoom-kind":`file`,"data-file-path":item.file.path,"aria-pressed":__props.selectedId===item.id,style:normalizeStyle({"--file-volume":item.volume??0}),title:`${item.file.path}\n${item.reasons.join(` · `)}\nClick to open this file's interface.`,onClick:$event=>{_ctx.$emit(`select`,item.file);_ctx.$emit(`inspect`,item.file)},onKeydown:withKeys(withModifiers($event=>{_ctx.$emit(`select`,item.file);_ctx.$emit(`inspect`,item.file)},[`stop`,`prevent`]),[`enter`])},[createBaseVNode(`span`,_hoisted_3$5,[createVNode(VIcon,{class:`subsystem-tree__document`,icon:icon(item.name).icon,style:normalizeStyle({color:icon(item.name).color})},null,8,[`icon`,`style`]),createBaseVNode(`small`,null,toDisplayString(item.name.includes(`.`)?item.name.split(`.`).at(-1):`file`),1)]),createBaseVNode(`span`,_hoisted_4$5,toDisplayString(item.name),1),(openBlock(true),createElementBlock(Fragment,null,renderList(item.programs?.filter(program=>program.mainSource===item.file.path),program=>{return openBlock(),createElementBlock(`span`,{key:program.id,class:`subsystem-tree__program subsystem-tree__program--main`,title:program.title},[createVNode(VIcon,{icon:`$star`,"aria-hidden":`true`}),createTextVNode(` Main · `+toDisplayString(program.title),1)],8,_hoisted_5$5)}),128)),item.programs?.some(program=>program.mainSource!==item.file.path)?(openBlock(),createElementBlock(`span`,{key:0,class:`subsystem-tree__program`,title:item.programs.filter(program=>program.mainSource!==item.file.path).map(program=>program.title).join(`
|
|
3
3
|
`)},`Part of · `+toDisplayString(item.programs.filter(program=>program.mainSource!==item.file.path).length===1?item.programs.find(program=>program.mainSource!==item.file.path).title:`${item.programs.filter(program=>program.mainSource!==item.file.path).length} Programs`),9,_hoisted_6$4)):createCommentVNode(``,true),item.reasons.length?(openBlock(),createElementBlock(`span`,{key:1,class:`subsystem-tree__entry`,title:item.reasons.join(` · `)},`Entry`,8,_hoisted_7$3)):createCommentVNode(``,true),createBaseVNode(`span`,{class:`subsystem-tree__volume`,title:item.volume==null?`Size unavailable`:`${item.file.sourceLines.toLocaleString()} source lines; bar relative to other files in this subsystem.`},[item.volume!=null?(openBlock(),createElementBlock(`span`,_hoisted_9$3,[createBaseVNode(`i`,{style:normalizeStyle({width:`${item.volume*100}%`})},null,4)])):createCommentVNode(``,true),createBaseVNode(`small`,null,toDisplayString(item.volume==null?`—`:item.file.sourceLines.toLocaleString()),1)],8,_hoisted_8$3)],46,_hoisted_2$5))],2)}),128))],2)}}};var Vibe64SubsystemTreeBranch_default=_plugin_vue_export_helper_default(_sfc_main$5,[[`__scopeId`,`data-v-7f5a3487`]]);var _hoisted_1$4=[`aria-label`];var _hoisted_2$4={class:`subsystem-inspector__header`};var _hoisted_3$4={key:0,class:`subsystem-inspector__navigation nodrag nopan`,"aria-label":`In this subsystem`};var _hoisted_4$4={class:`subsystem-inspector__body`};var _hoisted_5$4={class:`subsystem-inspector__summary`};var _hoisted_6$3={key:0,class:`subsystem-inspector__description`};var _hoisted_7$2={key:1,class:`subsystem-inspector__hint`};var _hoisted_8$2={key:0,class:`subsystem-inspector__coverage`,role:`status`};var _hoisted_9$2=[`onClick`];var _hoisted_10$2={key:0,title:`Export analysis is partial. Unknown return information is omitted.`};var _hoisted_11$2={key:0,class:`subsystem-inspector__hint`,title:`No intended directory-level contract is recorded; observed imports and available exports are shown separately.`};var _hoisted_12$2={key:1,class:`subsystem-inspector__coverage`,role:`status`,title:`Unobserved imports do not prove an export is internal or unused.`};var _hoisted_13$2={key:2,class:`subsystem-inspector__search`};var _hoisted_14$2=[`open`,`onToggle`];var _hoisted_15$1=[`title`];var _hoisted_16$1={key:0};var _hoisted_17$1={class:`subsystem-inspector__signatures`};var _hoisted_18$1={key:0,class:`subsystem-inspector__declaration`};var _hoisted_19$1=[`title`,`onClick`];var _hoisted_20$1=[`title`];var _hoisted_21$1={key:0,class:`subsystem-inspector__returns`};var _hoisted_22$1={class:`subsystem-inspector__source`};var _hoisted_23$1={key:1,class:`subsystem-inspector__evidence`};var _hoisted_24$1={key:0,class:`subsystem-inspector__consumers nodrag nopan`};var _hoisted_25$1=[`title`];var _hoisted_26$1=[`onClick`];var _hoisted_27$1={key:1,class:`subsystem-inspector__no-imports`,title:`No imports are recorded in the current analysis. This does not prove the export is unused.`};var _hoisted_28$1={key:1,class:`subsystem-inspector__signature subsystem-inspector__signature--unresolved`};var _hoisted_29$1=[`title`];var _hoisted_30$1={key:0,class:`subsystem-inspector__returns`};var _hoisted_31={key:0,class:`subsystem-inspector__hint`};var _hoisted_32={key:1,class:`subsystem-inspector__hint`};var _hoisted_33={key:3,class:`subsystem-inspector__technical nodrag nopan`};var _hoisted_34={key:0};var _hoisted_35={key:4,class:`subsystem-inspector__technical nodrag nopan`};var _hoisted_36={key:0};var _hoisted_37={key:0};var _hoisted_38={key:2,class:`subsystem-inspector__section`};var _hoisted_39=[`onClick`];var _hoisted_40={class:`subsystem-inspector__file-tools nodrag nopan`};var _hoisted_41={class:`subsystem-inspector__search`};var _hoisted_42={class:`subsystem-inspector__sort`};var _hoisted_43={key:0,class:`subsystem-inspector__hint`};var _sfc_main$4={__name:`Vibe64SubsystemInspector`,props:{outline:{type:Object,required:true},embedded:Boolean},emits:[`close`,`inspect`,`open-program`],setup(__props){const props=__props;function preserveTextSelection(event){if(!event.detail)return;const selected=event.view?.getSelection();const control=event.target.closest(`button, a, summary`);if(control&&selected&&!selected.isCollapsed&&control.contains(selected.anchorNode)&&control.contains(selected.focusNode)){event.preventDefault();event.stopPropagation()}}const query=ref(``);const filesElement=ref(null);const interfaceElement=ref(null);const programElement=ref(null);const programsElement=ref(null);const folderState=ref(new Map);const symbolQuery=ref(``);const sortBy=ref(`name`);const selected=ref(null);const expandedGroups=ref(new Set);const signatureGroups=computed(()=>{const term=symbolQuery.value.trim().toLocaleLowerCase();const observed=props.outline.observedSymbols||[];const observedIds=new Set(observed.map(symbol=>symbol.source.symbolId));return[{key:`observed`,title:`Imported by other subsystems`,primary:true,symbols:observed,explanation:`These particular declarations are imported across this directory boundary. Imports do not prove runtime calls or intended API membership.`},{key:`declared`,title:`Declared API`,primary:!observed.length,symbols:props.outline.publicSymbols.filter(symbol=>!observedIds.has(symbol.source?.symbolId)),explanation:`Explicit package or module exports, including members with no observed consumers.`},{key:`candidates`,title:`Exports from externally used files`,primary:!observed.length&&!props.outline.publicSymbols.length,symbols:props.outline.boundarySymbols,explanation:`These files are imported by other subsystems, but imports of these particular exports are unproven. This is not a declared API.`},{key:`available`,title:`Other available exports`,primary:false,symbols:props.outline.availableSymbols||[],explanation:`Available under the language’s visibility rules. They may be internal, unused or useful to future consumers; current analysis does not decide intent.`}].filter(group=>group.symbols.length).map(group=>({...group,count:group.symbols.length,symbols:group.symbols.filter(symbol=>!term||`${symbol.qualifiedName||``} ${symbol.name||``} ${symbol.source?.path||``}`.toLocaleLowerCase().includes(term))}))});const measuredFiles=computed(()=>props.outline.files.filter(file=>Number.isSafeInteger(file.sourceLines)).length);const measuredLines=computed(()=>props.outline.files.reduce((total,file)=>total+(Number.isSafeInteger(file.sourceLines)?file.sourceLines:0),0));function signature(symbol){return(symbol.qualifiedName||symbol.name)+(Array.isArray(symbol.parameters)?`(${symbol.parameters.join(`, `)})`:``)}function basename(path){return path.split(`/`).pop()}const tree=computed(()=>{const term=query.value.trim().toLocaleLowerCase();const byName=(a,b)=>a.name.localeCompare(b.name,void 0,{numeric:true,sensitivity:`base`});function compare(a,b){if(a.kind!==b.kind)return a.kind===`file`?-1:1;if(a.kind===`file`){if(sortBy.value===`size`){const size=item=>Number.isSafeInteger(item.file.sourceLines)?item.file.sourceLines:-1;if(size(a)!==size(b))return size(b)-size(a)}if(sortBy.value===`type`){const extension=item=>item.name.includes(`.`)?item.name.split(`.`).at(-1).toLocaleLowerCase():``;const typeOrder=extension(a).localeCompare(extension(b));if(typeOrder)return typeOrder}}return byName(a,b)}function arrange(items){return items.flatMap(item=>{if(item.kind===`file`)return!term||item.file.path.toLocaleLowerCase().includes(term)?[item]:[];const children=arrange(item.children);return children.length?[{...item,children}]:[]}).sort(compare)}return arrange(props.outline.tree)});watch(()=>props.outline.owner.id,()=>{query.value=``;symbolQuery.value=``;selected.value=null;sortBy.value=`name`;folderState.value=new Map;expandedGroups.value=new Set});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{class:normalizeClass([`subsystem-inspector`,{"subsystem-inspector--embedded":__props.embedded}]),"aria-label":__props.outline.owner.opaque?`External package interface`:`Subsystem interface`,onClickCapture:preserveTextSelection},[createBaseVNode(`header`,_hoisted_2$4,[createBaseVNode(`div`,null,[createBaseVNode(`small`,null,toDisplayString(__props.outline.owner.opaque?`EXTERNAL DEPENDENCY`:__props.outline.owner.placementKind===`libraries`?`SHARED LIBRARY`:`SUBSYSTEM`),1),createBaseVNode(`h2`,null,toDisplayString(__props.outline.owner.title),1),createBaseVNode(`p`,null,toDisplayString(__props.outline.owner.root),1)]),!__props.embedded?(openBlock(),createElementBlock(`button`,{key:0,type:`button`,class:`subsystem-inspector__close`,"aria-label":`Close subsystem`,onClick:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`close`))},`×`)):createCommentVNode(``,true)]),!__props.outline.owner.opaque?(openBlock(),createElementBlock(`nav`,_hoisted_3$4,[createBaseVNode(`button`,{type:`button`,onClick:_cache[1]||(_cache[1]=$event=>programElement.value?.scrollIntoView({block:`start`}))},`Explanation`),__props.outline.programs?.length?(openBlock(),createElementBlock(`button`,{key:0,type:`button`,onClick:_cache[2]||(_cache[2]=$event=>programsElement.value?.scrollIntoView({block:`start`}))},[_cache[10]||(_cache[10]=createTextVNode(`Programs `,-1)),createBaseVNode(`small`,null,toDisplayString(__props.outline.programs.length),1)])):createCommentVNode(``,true),createBaseVNode(`button`,{type:`button`,onClick:_cache[3]||(_cache[3]=$event=>interfaceElement.value?.scrollIntoView({block:`start`}))},`Interface`),createBaseVNode(`button`,{type:`button`,onClick:_cache[4]||(_cache[4]=$event=>filesElement.value?.scrollIntoView({block:`start`}))},[_cache[11]||(_cache[11]=createTextVNode(`Files `,-1)),createBaseVNode(`small`,null,toDisplayString(__props.outline.files.length),1)])])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_4$4,[createBaseVNode(`p`,_hoisted_5$4,toDisplayString(__props.outline.owner.opaque?`External package · source remains opaque`:`${__props.outline.files.length} file${__props.outline.files.length===1?``:`s`} · ${measuredFiles.value?measuredLines.value.toLocaleString()+` measured source lines`+(measuredFiles.value<__props.outline.files.length?` (${measuredFiles.value}/${__props.outline.files.length} files)`:``):`Source size unavailable`}`),1),!__props.outline.owner.opaque?(openBlock(),createElementBlock(`section`,{key:0,ref_key:`programElement`,ref:programElement,class:`subsystem-inspector__section`,"aria-label":`Subsystem explanation`},[_cache[12]||(_cache[12]=createBaseVNode(`h3`,null,`Explanation`,-1)),__props.outline.owner.description?(openBlock(),createElementBlock(`div`,_hoisted_6$3,[renderSlot(_ctx.$slots,`text`,{text:__props.outline.owner.description,sourcePath:`genesis/subsystems.md`},()=>[createTextVNode(toDisplayString(__props.outline.owner.description),1)],true)])):(openBlock(),createElementBlock(`p`,_hoisted_7$2,`No explanation in Genesis.`))],512)):createCommentVNode(``,true),!__props.outline.owner.opaque&&(__props.outline.programs?.length||__props.outline.programStatus!==`valid`)?(openBlock(),createElementBlock(`section`,{key:1,ref_key:`programsElement`,ref:programsElement,class:`subsystem-inspector__section`,"aria-label":`Subsystem Programs`},[createBaseVNode(`h3`,null,[_cache[13]||(_cache[13]=createTextVNode(`Programs `,-1)),createBaseVNode(`span`,null,toDisplayString(__props.outline.programs?.length||0),1)]),__props.outline.programStatus!==`valid`?(openBlock(),createElementBlock(`div`,_hoisted_8$2,[..._cache[14]||(_cache[14]=[createBaseVNode(`p`,null,`Program descriptions need refresh.`,-1)])])):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.outline.programs||[],program=>{return openBlock(),createElementBlock(`button`,{key:program.id,type:`button`,class:`subsystem-inspector__program nodrag nopan`,onClick:$event=>_ctx.$emit(`open-program`,program.id)},[createBaseVNode(`strong`,null,toDisplayString(program.title)+` →`,1),createBaseVNode(`span`,null,toDisplayString(program.description),1)],8,_hoisted_9$2)}),128))],512)):createCommentVNode(``,true),createBaseVNode(`section`,{ref_key:`interfaceElement`,ref:interfaceElement,class:`subsystem-inspector__section`,"aria-label":`Subsystem interface`},[createBaseVNode(`h3`,null,[_cache[15]||(_cache[15]=createTextVNode(`Interface `,-1)),__props.outline.publicEntries.some(entry=>entry.coverage!==`complete`)?(openBlock(),createElementBlock(`small`,_hoisted_10$2,`Partial`)):createCommentVNode(``,true)]),!__props.outline.publicEntries.length?(openBlock(),createElementBlock(`p`,_hoisted_11$2,`Intended API not declared.`)):createCommentVNode(``,true),__props.outline.dependencyCoverage!==`complete`&&!__props.outline.owner.opaque?(openBlock(),createElementBlock(`p`,_hoisted_12$2,`Import analysis `+toDisplayString(__props.outline.dependencyCoverage||`unavailable`)+`.`,1)):createCommentVNode(``,true),(__props.outline.exportCount||__props.outline.publicSymbols.length)>12?(openBlock(),createElementBlock(`label`,_hoisted_13$2,[_cache[16]||(_cache[16]=createTextVNode(`Find a signature`,-1)),withDirectives(createBaseVNode(`input`,{"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>symbolQuery.value=$event),type:`search`,placeholder:`Operation, component, value or type`},null,512),[[vModelText,symbolQuery.value]])])):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(signatureGroups.value,group=>{return openBlock(),createElementBlock(`details`,{key:group.key,class:`subsystem-inspector__surface nodrag nopan`,open:group.primary,onToggle:$event=>$event.target.open&&expandedGroups.value.add(group.key)},[createBaseVNode(`summary`,{title:group.explanation},toDisplayString(group.title)+` · `+toDisplayString(group.count),9,_hoisted_15$1),group.primary||expandedGroups.value.has(group.key)?(openBlock(),createElementBlock(`div`,_hoisted_16$1,[createBaseVNode(`div`,_hoisted_17$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(group.symbols.slice(0,200),symbol=>{return openBlock(),createElementBlock(Fragment,{key:`${symbol.source?.symbolId||symbol.importPaths?.join(`,`)}:${symbol.qualifiedName||symbol.name}:${symbol.start?.line||``}`},[symbol.source?(openBlock(),createElementBlock(`div`,_hoisted_18$1,[createBaseVNode(`button`,{type:`button`,class:`subsystem-inspector__signature nodrag nopan`,title:`Open ${symbol.source.path}:${symbol.source.line||``}`,onClick:$event=>_ctx.$emit(`inspect`,symbol.source)},[createBaseVNode(`small`,null,toDisplayString(symbol.kind||`Declaration`),1),createBaseVNode(`code`,{title:signature(symbol)},toDisplayString(signature(symbol)),9,_hoisted_20$1),symbol.returnType?(openBlock(),createElementBlock(`span`,_hoisted_21$1,`→ `+toDisplayString(symbol.returnType),1)):createCommentVNode(``,true),createBaseVNode(`span`,_hoisted_22$1,toDisplayString(basename(symbol.source.path))+` ↗`,1),symbol.declared||symbol.importPaths?.length?(openBlock(),createElementBlock(`span`,_hoisted_23$1,`Declared export`)):createCommentVNode(``,true)],8,_hoisted_19$1),symbol.consumers?.length?(openBlock(),createElementBlock(`details`,_hoisted_24$1,[createBaseVNode(`summary`,{title:symbol.consumerEvidence===`file`||group.key===`candidates`?`Show files that import the source file; use of this particular export is unproven.`:`Show files that import this declaration.`},toDisplayString(symbol.consumerEvidence===`file`||group.key===`candidates`?`Source file imported by`:`Imported by`)+` `+toDisplayString([...new Set(symbol.consumers.map(file=>file.subsystemId))].length)+` subsystem`+toDisplayString(new Set(symbol.consumers.map(file=>file.subsystemId)).size===1?``:`s`)+` · `+toDisplayString(symbol.consumers.length)+` file`+toDisplayString(symbol.consumers.length===1?``:`s`),9,_hoisted_25$1),(openBlock(true),createElementBlock(Fragment,null,renderList(symbol.consumers,file=>{return openBlock(),createElementBlock(`button`,{key:file.id,type:`button`,class:`subsystem-inspector__consumer`,onClick:$event=>_ctx.$emit(`inspect`,{path:file.path})},[createBaseVNode(`code`,null,toDisplayString(file.path),1),_cache[17]||(_cache[17]=createBaseVNode(`span`,{"aria-hidden":`true`},`→`,-1))],8,_hoisted_26$1)}),128))])):group.key===`available`?(openBlock(),createElementBlock(`p`,_hoisted_27$1,`No recorded imports`)):createCommentVNode(``,true)])):(openBlock(),createElementBlock(`div`,_hoisted_28$1,[createBaseVNode(`small`,null,toDisplayString(symbol.kind||`Declaration`),1),createBaseVNode(`code`,{title:signature(symbol)},toDisplayString(signature(symbol)),9,_hoisted_29$1),symbol.returnType?(openBlock(),createElementBlock(`span`,_hoisted_30$1,`→ `+toDisplayString(symbol.returnType),1)):createCommentVNode(``,true),createBaseVNode(`span`,null,toDisplayString(__props.outline.owner.opaque?`External package`:`Implementation location not resolved`),1)]))],64)}),128))]),group.symbols.length>200?(openBlock(),createElementBlock(`p`,_hoisted_31,`Showing 200 matches. Refine the search.`)):createCommentVNode(``,true),symbolQuery.value&&!group.symbols.length?(openBlock(),createElementBlock(`p`,_hoisted_32,`No declarations match this search.`)):createCommentVNode(``,true)])):createCommentVNode(``,true)],40,_hoisted_14$2)}),128)),__props.outline.programStatus!==`valid`||__props.outline.programDiagnostics?.length?(openBlock(),createElementBlock(`details`,_hoisted_33,[_cache[18]||(_cache[18]=createBaseVNode(`summary`,null,`Analysis details`,-1)),__props.outline.programStatus!==`valid`?(openBlock(),createElementBlock(`p`,_hoisted_34,`Genesis explanation index needs repair.`)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.outline.programDiagnostics||[],diagnostic=>{return openBlock(),createElementBlock(`p`,{key:diagnostic.code+diagnostic.message},toDisplayString(diagnostic.message),1)}),128))])):createCommentVNode(``,true),__props.outline.publicEntries.length?(openBlock(),createElementBlock(`details`,_hoisted_35,[createBaseVNode(`summary`,null,`Import paths · `+toDisplayString(__props.outline.publicEntries.length),1),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.outline.publicEntries,(entry,index)=>{return openBlock(),createElementBlock(`div`,{key:index},[createBaseVNode(`code`,null,toDisplayString(entry.importPath),1),createBaseVNode(`p`,null,[createTextVNode(toDisplayString(entry.conditions.join(` · `)||`Default conditions`),1),entry.target?(openBlock(),createElementBlock(`span`,_hoisted_36,` · `+toDisplayString(entry.target),1)):createCommentVNode(``,true)]),!entry.symbols.length?(openBlock(),createElementBlock(`p`,_hoisted_37,`Public declarations have not been resolved for this path.`)):createCommentVNode(``,true)])}),128))])):createCommentVNode(``,true)],512),__props.outline.operations.length?(openBlock(),createElementBlock(`section`,_hoisted_38,[createBaseVNode(`h3`,null,[_cache[19]||(_cache[19]=createTextVNode(`Receives UI calls `,-1)),createBaseVNode(`span`,null,toDisplayString(__props.outline.operations.length),1)]),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.outline.operations,call=>{return openBlock(),createElementBlock(`button`,{key:call.id,type:`button`,class:`subsystem-inspector__signature nodrag nopan`,onClick:$event=>_ctx.$emit(`inspect`,{path:call.file.path,symbol:call.controllerSymbol})},[createBaseVNode(`code`,null,toDisplayString([call.key?.protocol,call.key?.method,call.key?.operation].filter(Boolean).join(` · `)||call.id),1),createBaseVNode(`span`,null,[createTextVNode(toDisplayString(basename(call.file.path))+` ↗`,1),call.pages.length?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` · `+toDisplayString(call.pages.map(page=>page.title).join(`, `)),1)],64)):createCommentVNode(``,true)])],8,_hoisted_39)}),128))])):createCommentVNode(``,true),!__props.outline.owner.opaque?(openBlock(),createElementBlock(`section`,{key:3,ref_key:`filesElement`,ref:filesElement,class:`subsystem-inspector__section subsystem-inspector__files`},[createBaseVNode(`h3`,null,[_cache[20]||(_cache[20]=createTextVNode(`Files `,-1)),createBaseVNode(`span`,null,toDisplayString(__props.outline.files.length),1)]),_cache[24]||(_cache[24]=createBaseVNode(`p`,{class:`subsystem-inspector__hint`},`Click a file to open it. Bars compare source size.`,-1)),createBaseVNode(`div`,_hoisted_40,[createBaseVNode(`label`,_hoisted_41,[_cache[21]||(_cache[21]=createTextVNode(`Find a file`,-1)),withDirectives(createBaseVNode(`input`,{"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>query.value=$event),type:`search`,placeholder:`Name or path`},null,512),[[vModelText,query.value]])]),createBaseVNode(`label`,_hoisted_42,[_cache[23]||(_cache[23]=createTextVNode(`Sort`,-1)),withDirectives(createBaseVNode(`select`,{"onUpdate:modelValue":_cache[7]||(_cache[7]=$event=>sortBy.value=$event)},[..._cache[22]||(_cache[22]=[createBaseVNode(`option`,{value:`name`},`Name`,-1),createBaseVNode(`option`,{value:`type`},`File type`,-1),createBaseVNode(`option`,{value:`size`},`Size · largest first`,-1)])],512),[[vModelSelect,sortBy.value]])])]),createVNode(Vibe64SubsystemTreeBranch_default,{items:tree.value,"folder-state":folderState.value,searching:!!query.value.trim(),"selected-id":selected.value?.id||``,onSelect:_cache[8]||(_cache[8]=$event=>selected.value=$event),onInspect:_cache[9]||(_cache[9]=$event=>_ctx.$emit(`inspect`,$event))},null,8,[`items`,`folder-state`,`searching`,`selected-id`]),!tree.value.length?(openBlock(),createElementBlock(`p`,_hoisted_43,`No files match this search.`)):createCommentVNode(``,true)],512)):createCommentVNode(``,true)])],42,_hoisted_1$4)}}};var Vibe64SubsystemInspector_default=_plugin_vue_export_helper_default(_sfc_main$4,[[`__scopeId`,`data-v-0d42c24d`]]);var _hoisted_1$3={class:`program-inspector`,"aria-label":`Program explanation`};var _hoisted_2$3={key:0};var _hoisted_3$3={class:`program-inspector__preview`};var _hoisted_4$3={class:`program-explanation-dialog__header`};var _hoisted_5$3=[`id`];var _sfc_main$3={__name:`Vibe64ProgramInspector`,props:{program:{type:Object,required:true},architecture:{type:Object,required:true},owner:{type:Object,default:null},active:{type:Boolean,default:true}},emits:[`inspect`],setup(__props){const props=__props;const filesElement=ref(null);const folderState=new Map;const explanationOpen=ref(false);const dialogTitleId=useId();const preview=computed(()=>props.program.description.trim().split(/\n\s*\n/u)[0]);watch([()=>props.program.id,()=>props.active],()=>{explanationOpen.value=false});const files=computed(()=>{const sources=new Set(props.program.sources);const indexed=props.architecture.files.filter(file=>sources.has(file.path));const largest=Math.max(1,...indexed.map(file=>file.sourceLines||0));return indexed.map(file=>({kind:`file`,id:file.id,name:file.path,file,programs:[props.program],reasons:[],volume:Number.isSafeInteger(file.sourceLines)?file.sourceLines/largest:null}))});const mainFiles=computed(()=>files.value.filter(item=>item.file.path===props.program.mainSource));const supportingFiles=computed(()=>files.value.filter(item=>item.file.path!==props.program.mainSource).sort((a,b)=>a.name.localeCompare(b.name)));return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$3,[createBaseVNode(`header`,null,[_cache[5]||(_cache[5]=createBaseVNode(`small`,null,`PROGRAM`,-1)),createBaseVNode(`h2`,null,toDisplayString(__props.program.title),1),createBaseVNode(`p`,null,toDisplayString(__props.owner?.title),1)]),createBaseVNode(`button`,{type:`button`,class:`program-inspector__anchor`,onClick:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`inspect`,{path:__props.program.mainSource}))},[_cache[6]||(_cache[6]=createBaseVNode(`small`,null,`Main source file`,-1)),createBaseVNode(`strong`,null,toDisplayString(__props.program.mainSource)+` →`,1)]),supportingFiles.value.length?(openBlock(),createElementBlock(`nav`,_hoisted_2$3,[createBaseVNode(`button`,{type:`button`,onClick:_cache[1]||(_cache[1]=$event=>filesElement.value?.scrollIntoView({block:`start`}))},`Supporting files `+toDisplayString(supportingFiles.value.length)+` ↓`,1)])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_3$3,[renderSlot(_ctx.$slots,`text`,{text:preview.value,sourcePath:__props.program.path},()=>[createTextVNode(toDisplayString(preview.value),1)],true)]),createVNode(VDialog,{modelValue:explanationOpen.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>explanationOpen.value=$event),"max-width":`800`,scrollable:``,class:`program-explanation-dialog`,"aria-labelledby":unref(dialogTitleId)},{activator:withCtx(({props:activatorProps})=>[createBaseVNode(`button`,mergeProps(activatorProps,{type:`button`,class:`program-inspector__read`,"aria-haspopup":`dialog`}),`Read full explanation`,16)]),default:withCtx(()=>[createVNode(VCard,null,{default:withCtx(()=>[createBaseVNode(`header`,_hoisted_4$3,[createBaseVNode(`h2`,{id:unref(dialogTitleId)},toDisplayString(__props.program.title),9,_hoisted_5$3),createBaseVNode(`button`,{type:`button`,"aria-label":`Close Program explanation`,onClick:_cache[2]||(_cache[2]=$event=>explanationOpen.value=false)},`×`)]),createVNode(VCardText,{class:`program-explanation-dialog__body`},{default:withCtx(()=>[createBaseVNode(`div`,null,[renderSlot(_ctx.$slots,`text`,{text:__props.program.description,sourcePath:__props.program.path},()=>[createTextVNode(toDisplayString(__props.program.description),1)],true)]),createBaseVNode(`div`,null,[renderSlot(_ctx.$slots,`text`,{text:__props.program.publicContract,sourcePath:__props.program.path},()=>[createTextVNode(toDisplayString(__props.program.publicContract),1)],true)])]),_:3})]),_:3})]),_:3},8,[`modelValue`,`aria-labelledby`]),createBaseVNode(`section`,{ref_key:`filesElement`,ref:filesElement},[createBaseVNode(`h3`,null,[_cache[7]||(_cache[7]=createTextVNode(`Source files `,-1)),createBaseVNode(`small`,null,toDisplayString(files.value.length),1)]),createVNode(Vibe64SubsystemTreeBranch_default,{items:[...mainFiles.value,...supportingFiles.value],"folder-state":unref(folderState),onInspect:_cache[4]||(_cache[4]=$event=>_ctx.$emit(`inspect`,$event))},null,8,[`items`,`folder-state`])],512)])}}};var Vibe64ProgramInspector_default=_plugin_vue_export_helper_default(_sfc_main$3,[[`__scopeId`,`data-v-e89d51de`]]);var _hoisted_1$2=[`title`];var _hoisted_2$2={class:`storyboard-page__meta`};var _hoisted_3$2=[`aria-label`];var _hoisted_4$2={key:1,class:`storyboard-page__routes`};var _hoisted_5$2={key:2,class:`storyboard-page__unregistered`};var _hoisted_6$2={key:3,class:`storyboard-page__unresolved`};var _sfc_main$2={__name:`Vibe64ArchitecturePageNode`,props:{data:{type:Object,required:true},selected:Boolean,compact:Boolean,context:Boolean},emits:[`show-usage`],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:normalizeClass([`storyboard-page`,{"storyboard-page--compact":__props.compact,"storyboard-page--root":!__props.data.parentId,"storyboard-page--selected":__props.selected,"architecture-context":__props.context}]),title:[__props.data.title,...__props.data.identities,__props.data.file].filter(Boolean).join(`
|
|
4
4
|
`)},[__props.data.parentId?(openBlock(),createBlock(unref(_sfc_main$f),{key:0,id:`parent`,type:`target`,position:unref(Position).Top},null,8,[`position`])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_2$2,[createBaseVNode(`span`,null,toDisplayString(__props.data.kind),1),createBaseVNode(`span`,null,toDisplayString(__props.data.surface),1),__props.data.file?(openBlock(),createElementBlock(`button`,{key:0,type:`button`,class:`storyboard-page__usage nodrag nopan`,"aria-label":`Show usage of ${__props.data.title}`,onClick:_cache[0]||(_cache[0]=withModifiers($event=>emit(`show-usage`,{q:__props.data.file}),[`stop`]))},`Show usage`,8,_hoisted_3$2)):createCommentVNode(``,true)]),createBaseVNode(`h2`,null,toDisplayString(__props.data.title),1),__props.data.identities.length?(openBlock(),createElementBlock(`div`,_hoisted_4$2,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.data.identities,identity=>{return openBlock(),createElementBlock(`span`,{key:identity},toDisplayString(identity),1)}),128))])):(openBlock(),createElementBlock(`p`,_hoisted_5$2,`No navigation identity recorded`)),__props.data.unresolvedCalls?(openBlock(),createElementBlock(`span`,_hoisted_6$2,toDisplayString(__props.data.unresolvedCalls)+` unresolved calls`,1)):createCommentVNode(``,true),__props.data.callCount?(openBlock(),createBlock(unref(_sfc_main$f),{key:4,id:`engine-out`,type:`source`,position:unref(Position).Right},null,8,[`position`])):createCommentVNode(``,true),__props.data.childCount?(openBlock(),createBlock(unref(_sfc_main$f),{key:5,id:`children`,type:`source`,position:unref(Position).Bottom},null,8,[`position`])):createCommentVNode(``,true)],10,_hoisted_1$2)}}};var Vibe64ArchitecturePageNode_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-ba2e8037`]]);var _hoisted_1$1=[`title`];var _hoisted_2$1={class:`engine-subsystem__content`};var _hoisted_3$1={key:0,class:`engine-subsystem__start`};var _hoisted_4$1={class:`engine-subsystem__meta`};var _hoisted_5$1={key:0};var _hoisted_6$1={key:1,class:`engine-subsystem__directory`};var _hoisted_7$1={class:`engine-subsystem__description`};var _hoisted_8$1=[`title`];var _hoisted_9$1=[`title`];var _hoisted_10$1={key:0};var _hoisted_11$1={key:2,class:`engine-subsystem__receivers`};var _hoisted_12$1=[`title`];var _hoisted_13$1=[`title`];var _hoisted_14$1=[`aria-label`,`title`];var _sfc_main$1={__name:`Vibe64ArchitectureSubsystemNode`,props:{data:{type:Object,required:true},selected:Boolean,compact:Boolean,context:Boolean},emits:[`move`],setup(__props,{emit:__emit}){const emit=__emit;const ports=[[`top-in`,`target`,Position.Top],[`bottom-out`,`source`,Position.Bottom],[`top-out`,`source`,Position.Top],[`bottom-in`,`target`,Position.Bottom],[`left-in`,`target`,Position.Left],[`left-out`,`source`,Position.Left],[`right-in`,`target`,Position.Right],[`right-out`,`source`,Position.Right]].map(([id,type,position])=>({id,type,position}));return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:normalizeClass([`engine-subsystem`,{"engine-subsystem--compact":__props.compact,"engine-subsystem--library":__props.data.library,"engine-subsystem--support":__props.data.placementKind===`support`,"engine-subsystem--entry":__props.data.entryFiles.length,"engine-subsystem--cycle":__props.data.cycleLabel,"engine-subsystem--selected":__props.selected,"engine-subsystem--expanded":__props.data.expanded,"architecture-context":__props.context}]),title:`${__props.data.root}\n${__props.data.description||`Description not recorded.`}${__props.data.sourceLines!=null?`
|