@lunora/studio 1.0.0-alpha.37 → 1.0.0-alpha.370
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.d.mts +1626 -0
- package/dist/index.d.ts +1018 -809
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +23 -0
- package/dist/mount.d.ts +13 -11
- package/dist/mount.mjs +1 -0
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ApiTab.mjs +1 -0
- package/dist/packem_chunks/AuditPanel.mjs +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ExportImportPanel.mjs +10 -0
- package/dist/packem_chunks/FileBrowser.mjs +4 -0
- package/dist/packem_chunks/FunctionRunner.mjs +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
- package/dist/packem_chunks/HealthPanel.mjs +1 -0
- package/dist/packem_chunks/InsightsPanel.mjs +1 -0
- package/dist/packem_chunks/LogsPanel.mjs +1 -0
- package/dist/packem_chunks/MailPanel.mjs +2 -0
- package/dist/packem_chunks/MetricsPanel.mjs +1 -0
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
- package/dist/packem_chunks/PitrPanel.mjs +1 -0
- package/dist/packem_chunks/SchemaViewer.mjs +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
- package/dist/packem_chunks/SettingsPanel.mjs +1 -0
- package/dist/packem_chunks/SqlEditorPanel.mjs +25 -0
- package/dist/packem_chunks/TableEditor.mjs +1 -0
- package/dist/packem_chunks/agents-panel.mjs +1 -0
- package/dist/packem_chunks/ai-knowledge.mjs +1 -0
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
- package/dist/packem_chunks/analytics-panel.mjs +1 -0
- package/dist/packem_chunks/architecture-panel.mjs +1 -0
- package/dist/packem_chunks/assistant-panel.mjs +3 -0
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
- package/dist/packem_chunks/auth-config-panel.mjs +1 -0
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
- package/dist/packem_chunks/containers-panel.mjs +1 -0
- package/dist/packem_chunks/dashboards-panel.mjs +1 -0
- package/dist/packem_chunks/evals-panel.mjs +1 -0
- package/dist/packem_chunks/fanout-panel.mjs +1 -0
- package/dist/packem_chunks/flags-panel.mjs +1 -0
- package/dist/packem_chunks/issues-panel.mjs +1 -0
- package/dist/packem_chunks/kv-browser.mjs +1 -0
- package/dist/packem_chunks/log-drains-panel.mjs +4 -0
- package/dist/packem_chunks/migrations-route.mjs +1 -0
- package/dist/packem_chunks/organizations-panel.mjs +1 -0
- package/dist/packem_chunks/payments-panel.mjs +1 -0
- package/dist/packem_chunks/permissions-panel.mjs +1 -0
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
- package/dist/packem_chunks/queues-panel.mjs +1 -0
- package/dist/packem_chunks/reactors-panel.mjs +1 -0
- package/dist/packem_chunks/rls-panel.mjs +1 -0
- package/dist/packem_chunks/schedule-panel.mjs +1 -0
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
- package/dist/packem_chunks/sync-client-panel.mjs +1 -0
- package/dist/packem_chunks/theme-indicator.mjs +1 -0
- package/dist/packem_chunks/traces-panel.mjs +1 -0
- package/dist/packem_chunks/users-panel.mjs +1 -0
- package/dist/packem_chunks/vector-browser.mjs +1 -0
- package/dist/packem_chunks/workflows-panel.mjs +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-DUXsXId1.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-B9S9l1Ce.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-CQxU1Ocx.mjs +1 -0
- package/dist/packem_shared/CommandPalette-BZCHLpst.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-CIXYF6Mg.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-BfcoN-VE.mjs +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Py5Yx7rP.mjs +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BQ3jRT74.mjs +1 -0
- package/dist/packem_shared/DataBrowser-Dm-jhIUP.mjs +4 -0
- package/dist/packem_shared/DataFilters--ocFTVT2.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-C1Y8GUhe.mjs +1 -0
- package/dist/packem_shared/HomePanel-B5ytwPIo.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-CwLikxDT.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-BFDG91tn.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-QCTRdugp.mjs +1 -0
- package/dist/packem_shared/ShardInput-CoySruKZ.mjs +1 -0
- package/dist/packem_shared/Studio-wrwGcG7J.mjs +1 -0
- package/dist/packem_shared/StudioApp-D1XLXXe_.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-CGXCPnQn.mjs +1 -0
- package/dist/packem_shared/advisor-view-CzieqKMe.mjs +5 -0
- package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
- package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
- package/dist/packem_shared/app.d-jC98McBG.d.mts +358 -0
- package/dist/packem_shared/app.d-jC98McBG.d.ts +358 -0
- package/dist/packem_shared/assistant-provider-Bp72uWsq.mjs +1 -0
- package/dist/packem_shared/assistant-reason-D6EwMCxT.mjs +1 -0
- package/dist/packem_shared/auth-pager-DW77WeZw.mjs +1 -0
- package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
- package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
- package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
- package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
- package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
- package/dist/packem_shared/cf-links-C4DVTr8A.mjs +1 -0
- package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
- package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
- package/dist/packem_shared/data-grid-B5m1OosL.mjs +1 -0
- package/dist/packem_shared/data-view-params-C-_G-biH.mjs +1 -0
- package/dist/packem_shared/diagram-export-panel-Vdt-DZnO.mjs +2 -0
- package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
- package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
- package/dist/packem_shared/error-alert-DKXm5h19.mjs +6 -0
- package/dist/packem_shared/grid-features-Drvfswwy.mjs +6 -0
- package/dist/packem_shared/grid-pagination-DY2erU65.mjs +1 -0
- package/dist/packem_shared/home-panel-5fGktYeD.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-hIuTpSbx.mjs +2 -0
- package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
- package/dist/packem_shared/live-status-D1GasNsH.mjs +1 -0
- package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
- package/dist/packem_shared/log-line-BH0iWiBv.mjs +1 -0
- package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
- package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
- package/dist/packem_shared/recording-client-z4CBi0y8.mjs +1 -0
- package/dist/packem_shared/reference-view-DENugPcj.mjs +13 -0
- package/dist/packem_shared/schema-diagram-CtVPhOGj.mjs +2 -0
- package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
- package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
- package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
- package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
- package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
- package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
- package/dist/packem_shared/sql-result-table-DCwooMGW.mjs +1 -0
- package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
- package/dist/packem_shared/studio-Cm9ea8j7.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-kpHaDWjy.mjs +1 -0
- package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
- package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
- package/dist/packem_shared/use-admin-query-CaOm4JS3.mjs +1 -0
- package/dist/packem_shared/use-admin-spec-CK7mk3Ui.mjs +1 -0
- package/dist/packem_shared/use-assistant-rpc-GCUK2zPa.mjs +1 -0
- package/dist/packem_shared/use-async-submit-D0r7-m2J.mjs +1 -0
- package/dist/packem_shared/use-auth-config-CG7VvAvQ.mjs +1 -0
- package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
- package/dist/packem_shared/use-open-trace-BJKMJjeS.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-studio-client-DCA50tF2.mjs +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
- package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
- package/dist/standalone/chunk-2DT3QG6Q.js +1 -0
- package/dist/standalone/chunk-2EB7FN5S.js +1 -0
- package/dist/standalone/chunk-2JD7ZSZV.js +4 -0
- package/dist/standalone/chunk-2TBMJ7XV.js +1 -0
- package/dist/standalone/chunk-2W4UO5BC.js +1 -0
- package/dist/standalone/chunk-36RORAX3.js +1 -0
- package/dist/standalone/chunk-3D67ZJRW.js +1 -0
- package/dist/standalone/chunk-3IMLG2OT.js +1 -0
- package/dist/standalone/chunk-4EPW63HS.js +1 -0
- package/dist/standalone/chunk-4NKJV7YX.js +1 -0
- package/dist/standalone/chunk-4PI2OSSP.js +1 -0
- package/dist/standalone/chunk-5BXW4BR6.js +1 -0
- package/dist/standalone/chunk-5KZIXB6E.js +1 -0
- package/dist/standalone/chunk-5PEAXTYQ.js +1 -0
- package/dist/standalone/chunk-5QUEED5Z.js +1 -0
- package/dist/standalone/chunk-5SKGLIO5.js +1 -0
- package/dist/standalone/chunk-5X6BEWUI.js +1 -0
- package/dist/standalone/chunk-5XN5GQP5.js +1 -0
- package/dist/standalone/chunk-62XXKQH3.js +1 -0
- package/dist/standalone/chunk-6FLYVL6K.js +1 -0
- package/dist/standalone/chunk-6FNFOTRR.js +1 -0
- package/dist/standalone/chunk-6FPV3EK2.js +1 -0
- package/dist/standalone/chunk-6G3E4PJ2.js +1 -0
- package/dist/standalone/chunk-6LLUZFDD.js +3 -0
- package/dist/standalone/chunk-6VLPJOPR.js +1 -0
- package/dist/standalone/chunk-6XL3EV2X.js +8 -0
- package/dist/standalone/chunk-7N2OPADC.js +5 -0
- package/dist/standalone/chunk-7TTX42IR.js +1 -0
- package/dist/standalone/chunk-7YZKGLGA.js +1 -0
- package/dist/standalone/chunk-A2Q3TGIQ.js +1 -0
- package/dist/standalone/chunk-AA3R3QNN.js +1 -0
- package/dist/standalone/chunk-AMOPLAX6.js +1 -0
- package/dist/standalone/chunk-ARGGBECJ.js +1 -0
- package/dist/standalone/chunk-B4K4IET7.js +1 -0
- package/dist/standalone/chunk-BG2CJOVS.js +1 -0
- package/dist/standalone/chunk-BKI3JMXQ.js +1 -0
- package/dist/standalone/chunk-CL3JOU6F.js +1 -0
- package/dist/standalone/chunk-CLYI7JF2.js +1 -0
- package/dist/standalone/chunk-CNQBTB5C.js +1 -0
- package/dist/standalone/chunk-CVSIFPI5.js +1 -0
- package/dist/standalone/chunk-D65UVZIA.js +1 -0
- package/dist/standalone/chunk-DA2CAFXI.js +1 -0
- package/dist/standalone/chunk-DBLSNTHL.js +1 -0
- package/dist/standalone/chunk-E5LR7G22.js +6 -0
- package/dist/standalone/chunk-E6FH3ZOB.js +1 -0
- package/dist/standalone/chunk-E6NWADUS.js +1 -0
- package/dist/standalone/chunk-F7EKRF7I.js +1 -0
- package/dist/standalone/chunk-FHKZP25N.js +1 -0
- package/dist/standalone/chunk-FTJ6RR64.js +4 -0
- package/dist/standalone/chunk-FWM5Z6CH.js +1 -0
- package/dist/standalone/chunk-G2Z7WFAT.js +1 -0
- package/dist/standalone/chunk-G6PUHYKD.js +1 -0
- package/dist/standalone/chunk-GM7MBMYI.js +1 -0
- package/dist/standalone/chunk-GWNGVKLG.js +1 -0
- package/dist/standalone/chunk-GXTSE66Z.js +1 -0
- package/dist/standalone/chunk-H6KIDQ6V.js +1 -0
- package/dist/standalone/chunk-HCOF7HOM.js +1 -0
- package/dist/standalone/chunk-HFBSWKJS.js +1 -0
- package/dist/standalone/chunk-HGNPJO7S.js +1 -0
- package/dist/standalone/chunk-HLWDT5VZ.js +1 -0
- package/dist/standalone/chunk-HWFV5UCF.js +1 -0
- package/dist/standalone/chunk-IDHU47FP.js +1 -0
- package/dist/standalone/chunk-IDNHNCZV.js +14 -0
- package/dist/standalone/chunk-IHWSRI72.js +1 -0
- package/dist/standalone/chunk-J45HAKBU.js +1 -0
- package/dist/standalone/chunk-J77YDVBD.js +3 -0
- package/dist/standalone/chunk-JG74C6DH.js +1 -0
- package/dist/standalone/chunk-JMZT3CEW.js +1 -0
- package/dist/standalone/chunk-JT7UYB6L.js +1 -0
- package/dist/standalone/chunk-JWQOB4EW.js +7 -0
- package/dist/standalone/chunk-K3DHV2YQ.js +1 -0
- package/dist/standalone/chunk-K5BAERB3.js +1 -0
- package/dist/standalone/chunk-KAK3HS5E.js +2 -0
- package/dist/standalone/chunk-KGLIQIZU.js +1 -0
- package/dist/standalone/chunk-KTK4NDWQ.js +1 -0
- package/dist/standalone/chunk-KZ6YQ234.js +1 -0
- package/dist/standalone/chunk-LZHT6UGJ.js +1 -0
- package/dist/standalone/chunk-MGJZKA6O.js +1 -0
- package/dist/standalone/chunk-MQBQBEGM.js +1 -0
- package/dist/standalone/chunk-NEFVDZHP.js +1 -0
- package/dist/standalone/chunk-NGVP66OH.js +1 -0
- package/dist/standalone/chunk-NHUEXULQ.js +1 -0
- package/dist/standalone/chunk-NSAQ3EDS.js +1 -0
- package/dist/standalone/chunk-NYJXRBOK.js +1 -0
- package/dist/standalone/chunk-O24UFHUY.js +1 -0
- package/dist/standalone/chunk-O3AZ7JKE.js +1 -0
- package/dist/standalone/chunk-O6W2YLME.js +1 -0
- package/dist/standalone/chunk-O7XG7DTU.js +1 -0
- package/dist/standalone/chunk-OBYE3IXP.js +1 -0
- package/dist/standalone/chunk-OCYIIOBX.js +1 -0
- package/dist/standalone/chunk-ONTGYVAN.js +1 -0
- package/dist/standalone/chunk-OOOT4H45.js +33 -0
- package/dist/standalone/chunk-OQOKF4LL.js +1 -0
- package/dist/standalone/chunk-OS5DOPZW.js +1 -0
- package/dist/standalone/chunk-P6VNMPWR.js +1 -0
- package/dist/standalone/chunk-PDBCAPP6.js +1 -0
- package/dist/standalone/chunk-PDBW6GTJ.js +1 -0
- package/dist/standalone/chunk-PFNK2MGW.js +1 -0
- package/dist/standalone/chunk-PMDLNIHA.js +1 -0
- package/dist/standalone/chunk-PZGLD7G7.js +5 -0
- package/dist/standalone/chunk-Q3WMP7OA.js +3 -0
- package/dist/standalone/chunk-Q65X2ZIP.js +1 -0
- package/dist/standalone/chunk-QAOZXPLU.js +1 -0
- package/dist/standalone/chunk-QBRBGDCL.js +1 -0
- package/dist/standalone/chunk-QR6RYVUD.js +1 -0
- package/dist/standalone/chunk-QRA7AKYO.js +1 -0
- package/dist/standalone/chunk-QSUQAWEP.js +1 -0
- package/dist/standalone/chunk-RIAOZECW.js +1 -0
- package/dist/standalone/chunk-RLJYW6TY.js +1 -0
- package/dist/standalone/chunk-RTS5G3ET.js +2 -0
- package/dist/standalone/chunk-S36FVTKK.js +1 -0
- package/dist/standalone/chunk-SGIBDCPB.js +59 -0
- package/dist/standalone/chunk-STK3KLLV.js +1 -0
- package/dist/standalone/chunk-TDPAITW5.js +1 -0
- package/dist/standalone/chunk-TW4O2BA5.js +159 -0
- package/dist/standalone/chunk-TZ5PSNZW.js +1 -0
- package/dist/standalone/chunk-UBX5ZPLV.js +1 -0
- package/dist/standalone/chunk-UCJWHNUJ.js +1 -0
- package/dist/standalone/chunk-V3SVDOVD.js +1 -0
- package/dist/standalone/chunk-V6YA4TAL.js +1 -0
- package/dist/standalone/chunk-VB2XDTVB.js +6 -0
- package/dist/standalone/chunk-VFB22IM2.js +1 -0
- package/dist/standalone/chunk-VGIDGJ5K.js +1 -0
- package/dist/standalone/chunk-VJC5PQ7D.js +1 -0
- package/dist/standalone/chunk-VNH4OBJS.js +1 -0
- package/dist/standalone/chunk-VUOEJJUH.js +1 -0
- package/dist/standalone/chunk-W42GZL6T.js +1 -0
- package/dist/standalone/chunk-WGGSW4E2.js +1 -0
- package/dist/standalone/chunk-XLYFGUEF.js +1 -0
- package/dist/standalone/chunk-XMOG3LIP.js +1 -0
- package/dist/standalone/chunk-Y2JFJP4B.js +1 -0
- package/dist/standalone/{chunk-BJGBHGK3.js → chunk-Y2YLTUMD.js} +1 -1
- package/dist/standalone/chunk-YLXNXB7E.js +1 -0
- package/dist/standalone/chunk-YORPLSI5.js +1 -0
- package/dist/standalone/chunk-YUVGMKHG.js +1 -0
- package/dist/standalone/chunk-YYIW5EKO.js +30 -0
- package/dist/standalone/chunk-ZCN4YUCA.js +1 -0
- package/dist/standalone/chunk-ZEWRYBCB.js +1 -0
- package/dist/standalone/chunk-ZGZSTTKN.js +10 -0
- package/dist/standalone/chunk-ZM3A5WO5.js +1 -0
- package/dist/standalone/chunk-ZPQBVYNN.js +1 -0
- package/dist/standalone/chunk-ZSWW2UGP.js +1 -0
- package/dist/standalone/chunk-ZYZ5ATT2.js +1 -0
- package/dist/standalone/studio.js +9 -214
- package/dist/styles.css +2 -2
- package/package.json +27 -22
- package/dist/index.js +0 -41
- package/dist/mount.js +0 -27
- package/dist/packem_chunks/ApiTab.js +0 -251
- package/dist/packem_chunks/AuditPanel.js +0 -200
- package/dist/packem_chunks/ExportImportPanel.js +0 -198
- package/dist/packem_chunks/FileBrowser.js +0 -2932
- package/dist/packem_chunks/FunctionRunner.js +0 -343
- package/dist/packem_chunks/FunctionStatsPanel.js +0 -377
- package/dist/packem_chunks/HealthPanel.js +0 -648
- package/dist/packem_chunks/InsightsPanel.js +0 -462
- package/dist/packem_chunks/LogsPanel.js +0 -827
- package/dist/packem_chunks/MailPanel.js +0 -353
- package/dist/packem_chunks/MetricsPanel.js +0 -1344
- package/dist/packem_chunks/MigrationsPanel.js +0 -239
- package/dist/packem_chunks/PitrPanel.js +0 -252
- package/dist/packem_chunks/SchemaViewer.js +0 -2513
- package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -95
- package/dist/packem_chunks/SettingsPanel.js +0 -391
- package/dist/packem_chunks/SqlEditorPanel.js +0 -2323
- package/dist/packem_chunks/TableEditor.js +0 -313
- package/dist/packem_chunks/analytics-panel.js +0 -261
- package/dist/packem_chunks/auth-config-panel.js +0 -179
- package/dist/packem_chunks/auth-sessions-panel.js +0 -175
- package/dist/packem_chunks/containers-panel.js +0 -247
- package/dist/packem_chunks/dashboards-panel.js +0 -780
- package/dist/packem_chunks/fanout-panel.js +0 -482
- package/dist/packem_chunks/flags-panel.js +0 -176
- package/dist/packem_chunks/kv-browser.js +0 -1896
- package/dist/packem_chunks/log-drains-panel.js +0 -273
- package/dist/packem_chunks/organizations-panel.js +0 -670
- package/dist/packem_chunks/payments-panel.js +0 -186
- package/dist/packem_chunks/permissions-panel.js +0 -805
- package/dist/packem_chunks/queues-panel.js +0 -1052
- package/dist/packem_chunks/rls-panel.js +0 -315
- package/dist/packem_chunks/schedule-panel.js +0 -831
- package/dist/packem_chunks/sparkline.js +0 -79
- package/dist/packem_chunks/storage-rules-panel.js +0 -140
- package/dist/packem_chunks/subscriptions-panel.js +0 -238
- package/dist/packem_chunks/users-panel.js +0 -1265
- package/dist/packem_chunks/vector-browser.js +0 -281
- package/dist/packem_chunks/workflows-panel.js +0 -562
- package/dist/packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js +0 -52
- package/dist/packem_shared/ApiDocsPanel-D4CJf2ad.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-Co_wpRF2.js +0 -230
- package/dist/packem_shared/CommandPalette-BUPpbpMc.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-BeVNxSVm.js +0 -4493
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/GlobalDataBrowser-ErfvIs1S.js +0 -289
- package/dist/packem_shared/HomePanel-D9MQk8I7.js +0 -14
- package/dist/packem_shared/OpenRpcReferencePanel-DLWzrIx9.js +0 -192
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-ClaNpZsg.js +0 -262
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/Studio-C48P1K5W.js +0 -16
- package/dist/packem_shared/StudioApp-Cqh-SYm2.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/advisor-view-D3-U4kRR.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/alert-CdAET2K_.js +0 -68
- package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
- package/dist/packem_shared/browser-storage-tLOxkIHd.js +0 -185
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-Jz8FqQ2C.js +0 -183
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/error-alert-BBT6D22d.js +0 -114
- package/dist/packem_shared/grid-features-CUr8Z1_O.js +0 -745
- package/dist/packem_shared/home-panel-CoGxi-oj.js +0 -1639
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-DTsYVn-g.js +0 -97
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
- package/dist/packem_shared/reference-view-CSKyUyPl.js +0 -2141
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
- package/dist/packem_shared/select-UkNYCT3s.js +0 -273
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
- package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-CPHA_-3I.js +0 -4015
- package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
- package/dist/packem_shared/table-list-sidebar-B5psdSV1.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-admin-query-BHPKmPuj.js +0 -106
- package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
- package/dist/standalone/chunk-22W5VKZ6.js +0 -1
- package/dist/standalone/chunk-2GGMGPEP.js +0 -1
- package/dist/standalone/chunk-2K47A3P6.js +0 -1
- package/dist/standalone/chunk-2NGUNNGW.js +0 -1
- package/dist/standalone/chunk-2THHW7BC.js +0 -1
- package/dist/standalone/chunk-3CJW6NWG.js +0 -4
- package/dist/standalone/chunk-3OA7PECS.js +0 -6
- package/dist/standalone/chunk-46K3NKPA.js +0 -1
- package/dist/standalone/chunk-4QHKBC77.js +0 -1
- package/dist/standalone/chunk-5OH3VPZF.js +0 -1
- package/dist/standalone/chunk-5OIBXYZM.js +0 -1
- package/dist/standalone/chunk-6GFEVKJP.js +0 -1
- package/dist/standalone/chunk-6WRZP62V.js +0 -1
- package/dist/standalone/chunk-764T6X6X.js +0 -1
- package/dist/standalone/chunk-7SLSB2TS.js +0 -4
- package/dist/standalone/chunk-7TJJXVSE.js +0 -1
- package/dist/standalone/chunk-7VF3IAAW.js +0 -2
- package/dist/standalone/chunk-AHILM3ZP.js +0 -1
- package/dist/standalone/chunk-AJIUI7DD.js +0 -1
- package/dist/standalone/chunk-ATYUMPDM.js +0 -1
- package/dist/standalone/chunk-BACPICH6.js +0 -1
- package/dist/standalone/chunk-BI35RXKQ.js +0 -1
- package/dist/standalone/chunk-BOXSWNXZ.js +0 -1
- package/dist/standalone/chunk-BQUQS7QN.js +0 -1
- package/dist/standalone/chunk-CKSHCYGC.js +0 -2
- package/dist/standalone/chunk-DC72CQY4.js +0 -76
- package/dist/standalone/chunk-DORBUITF.js +0 -1
- package/dist/standalone/chunk-DVC6YWVP.js +0 -1
- package/dist/standalone/chunk-DVKPRFIJ.js +0 -1
- package/dist/standalone/chunk-DWDILV2E.js +0 -1
- package/dist/standalone/chunk-DWTBY343.js +0 -1
- package/dist/standalone/chunk-EUIHTPKI.js +0 -1
- package/dist/standalone/chunk-FCSPAJW4.js +0 -1
- package/dist/standalone/chunk-GMSGZDDH.js +0 -13
- package/dist/standalone/chunk-GTM65MVX.js +0 -1
- package/dist/standalone/chunk-HV7G6DFP.js +0 -5
- package/dist/standalone/chunk-ILCTSAOB.js +0 -1
- package/dist/standalone/chunk-IOFMK4D7.js +0 -1
- package/dist/standalone/chunk-J6J54MBP.js +0 -1
- package/dist/standalone/chunk-JE2YOAB7.js +0 -4
- package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
- package/dist/standalone/chunk-K3GNLVYK.js +0 -1
- package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
- package/dist/standalone/chunk-KJJ3WM6H.js +0 -4
- package/dist/standalone/chunk-KZ6INM5M.js +0 -1
- package/dist/standalone/chunk-LAK5VSPI.js +0 -1
- package/dist/standalone/chunk-LD2R263D.js +0 -1
- package/dist/standalone/chunk-LI43EKM6.js +0 -1
- package/dist/standalone/chunk-M55U7NHO.js +0 -1
- package/dist/standalone/chunk-MPTM7ZU3.js +0 -3
- package/dist/standalone/chunk-MPYFGAOW.js +0 -1
- package/dist/standalone/chunk-NKJDGOM3.js +0 -1
- package/dist/standalone/chunk-O3NAGRTR.js +0 -1
- package/dist/standalone/chunk-OCHNCAXJ.js +0 -1
- package/dist/standalone/chunk-OIZ4CHPN.js +0 -8
- package/dist/standalone/chunk-OY3GVYS7.js +0 -4
- package/dist/standalone/chunk-PACH5AHG.js +0 -1
- package/dist/standalone/chunk-PN5NCZDX.js +0 -1
- package/dist/standalone/chunk-PVZI3CXP.js +0 -19
- package/dist/standalone/chunk-PZ7HD5T2.js +0 -1
- package/dist/standalone/chunk-Q52CHOSY.js +0 -1
- package/dist/standalone/chunk-QAFAJBAW.js +0 -1
- package/dist/standalone/chunk-QBAT52GB.js +0 -1
- package/dist/standalone/chunk-QLM6FYZW.js +0 -2
- package/dist/standalone/chunk-RRAFQ5G2.js +0 -1
- package/dist/standalone/chunk-RRCPZMC2.js +0 -22
- package/dist/standalone/chunk-RSEEHNFI.js +0 -1
- package/dist/standalone/chunk-SEU5V7I6.js +0 -1
- package/dist/standalone/chunk-SG3ALJJU.js +0 -1
- package/dist/standalone/chunk-SLKF2L74.js +0 -1
- package/dist/standalone/chunk-TAD43CG5.js +0 -1
- package/dist/standalone/chunk-TBMYIZIO.js +0 -1
- package/dist/standalone/chunk-TDL7NEWA.js +0 -1
- package/dist/standalone/chunk-TO4JQX7W.js +0 -1
- package/dist/standalone/chunk-TOJ3TC35.js +0 -1
- package/dist/standalone/chunk-TQ36RWOP.js +0 -1
- package/dist/standalone/chunk-U4OAQPBT.js +0 -1
- package/dist/standalone/chunk-UK64ZSUW.js +0 -1
- package/dist/standalone/chunk-VLXV72QE.js +0 -1
- package/dist/standalone/chunk-VTGBPW24.js +0 -1
- package/dist/standalone/chunk-WI7GWFEG.js +0 -1
- package/dist/standalone/chunk-WXPWVBIY.js +0 -1
- package/dist/standalone/chunk-X5P2WRYI.js +0 -1
- package/dist/standalone/chunk-X7MMBSNW.js +0 -1
- package/dist/standalone/chunk-XLQ4BHBD.js +0 -1
- package/dist/standalone/chunk-XNJNSCLM.js +0 -1
- package/dist/standalone/chunk-XUGSA2NG.js +0 -1
- package/dist/standalone/chunk-Y2ZPNDL7.js +0 -4
- package/dist/standalone/chunk-YAECF5LW.js +0 -1
- package/dist/standalone/chunk-YEVCU7TB.js +0 -13
- package/dist/standalone/chunk-ZHVTQ37P.js +0 -1
- package/dist/standalone/chunk-ZIGWVHCS.js +0 -1
- package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
- package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
- package/dist/standalone/chunk-ZU4DZ6NK.js +0 -1
- package/dist/standalone/chunk-ZYRGPDZB.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-5PEAXTYQ.js";var d=[{headings:["Vocabulary","The mental model","The components","Request lifecycle","The data tiers","Compute tiers","The consistency model","The real-time engine"],id:"architecture",summary:"The full picture \u2014 topology, request lifecycle, the data tiers, the consistency model, and the design decisions behind them.",title:"Architecture"},{headings:["How telemetry reaches the cloud","Traces","Issues","Logs","Metrics","Scoped ingest keys","Bring your own OpenTelemetry","Retention & scale"],id:"cloud/monitoring",summary:"The Lunora cloud is a managed OpenTelemetry backend + control plane \u2014 deploy to it and your traces, logs, metrics, and AI generations flow\u2026",title:"Monitoring"},{headings:["When to use an action vs a mutation","ActionCtx","Calling queries and mutations from an action","Scheduling follow-up work"],id:"concepts/actions",summary:"Non-deterministic functions for external APIs and side effects \u2014 the action builder and its ActionCtx.",title:"Actions"},{headings:["Keep your session authority","Declare ownership once","Call Lunora from your own Worker","Dev proxy: two silent failures","Run both engines during the migration","Test it without a worker","When something is stuck"],id:"concepts/adopt-in-an-existing-app",summary:"Add Lunora to a working product that already has its own auth, Worker, and data layer \u2014 without rewriting either.",title:"Adopt in an existing app"},{headings:["Static lints","Runtime lints","Running advisors"],id:"concepts/advisors",summary:"Splinter-style lints that catch schema, performance, and security problems \u2014 many before you deploy.",title:"Advisors"},{headings:["Agent skills","Agent mode","The docs server","The local server","The MCP server","Keeping generated types honest"],id:"concepts/ai-tooling",summary:"Teach Claude Code, Cursor, and Copilot how to use Lunora \u2014 agent skills, agent-aware dev mode, the docs server, and the MCP server.",title:"AI coding agents"},{headings:["What lands in your project","Wire it up","The cards","Enabling the optional flows","Password rules","Username availability","Being an OAuth provider","Avatar and logo uploads"],id:"concepts/auth-ui",summary:"Copy-in sign-in, settings, and organization screens for React, Vue, Svelte, Solid, and Angular \u2014 the code lands in your project and you\u2026",title:"Auth UI"},{headings:["ctx.auth inside functions","@lunora/auth on the server","Routing /api/auth/*","The client side","Feeding row-level security","See also"],id:"concepts/authentication",summary:"How ctx.auth threads the signed-in user through queries, mutations, and actions \u2014 and feeds row-level security.",title:"Authentication"},{headings:["Point-in-time recovery","Snapshot backups","Export and import","Streaming data out continuously","Practising a restore"],id:"concepts/backups",summary:"Snapshot a deployment, recover a shard to any moment in the last 30 days, and move data in and out as NDJSON.",title:"Backups, export & import"},{headings:["Schema first","Reads","Writes","Inputs and safety","Scaling","Lean on Advisors"],id:"concepts/best-practices",summary:"The opinionated idioms that keep a Lunora app fast, safe, and reactive.",title:"Best practices"},{headings:["Enabling Workers Cache","Declarative cache headers on httpRoute","Programmatic cache purging","Why only HTTP actions?","Memoizing an expensive action result","Scaffolding cache-aware routes","Best practices"],id:"concepts/caching",summary:"Edge caching with Cloudflare Workers Cache \u2014 declarative headers on HTTP routes and programmatic cache purging from actions.",title:"Caching"},{headings:["The short version","Rows or events?","Live topics, whispers and rooms","Streams","Write a row, then tell the page","Things to know before you rely on a live topic"],id:"concepts/choosing-a-data-channel",summary:"Live query, stream, live topic, whisper, room or socket? Which one to use for which job.",title:"Choosing a data channel"},{headings:["Declaring it","What _commitSeq guarantees","Refreshed on every write","Three things it is not","When to reach for it"],id:"concepts/commit-ordering",summary:"Declare .commitOrdered() so every row carries _commitSeq \u2014 a per-shard sequence that orders commits, and the cursor a changefeed can page\u2026",title:"Commit ordering"},{headings:["Defining one","Installing one","What the namespace guarantees","What a component does NOT get","In the architecture view","Migrations","See also"],id:"concepts/components",summary:"Package backend features \u2014 tables, functions, and context \u2014 as an installable unit that cannot collide with the app that installs it.",title:"Components"},{headings:["Constraint kinds","Unique","Non-null","Foreign-key integrity","Error codes"],id:"concepts/constraints",summary:"Unique, non-null and foreign-key integrity declared on the schema and enforced at write time.",title:"Constraints"},{headings:["What it pins","Pinning auth and voice","Pinning mail","Set it once: changing it strands data","Runbook: moving an app to a new jurisdiction"],id:"concepts/data-residency",summary:"Pin Durable Objects to a Cloudflare jurisdiction with .jurisdiction(), and the export\u2192import runbook for moving regions.",title:"Data residency"},{headings:["The type table","Numbers, bigints, and dates","Optional versus null","Values that JSON cannot carry","Size limits","Types outside the schema"],id:"concepts/data-types",summary:"The value types a Lunora document can hold, how each is stored, and which ones need the wire codec to survive JSON.",title:"Data types"},{headings:["Start with lunora doctor","Catch it before it runs","The error overlay","Structured logging with ctx.log","The Studio","Find the slow or failing function","Watch production","Debugging authentication"],id:"concepts/debugging",summary:"The tools to reach for when something is broken \u2014 doctor, the error overlay, ctx.log, the Studio, insights, and live logs.",title:"Debugging"},{headings:["How ids are minted","Typing a reference with v.id","Reading and following ids","Validating an id that came from outside","Ids in exports and imports"],id:"concepts/document-ids",summary:"Every row carries an _id and a _creationTime \u2014 how they are minted, how v.id types a reference, and what an id does and does not guarantee.",title:"Document IDs"},{headings:["Locally: .dev.vars","In production: secrets and vars","Accessing env inside your app","The rule: never commit secrets"],id:"concepts/environment-variables",summary:"Configure secrets and vars \u2014 .dev.vars locally, wrangler secrets in production, env bindings inside functions.",title:"Environment variables"},{headings:["Multiple environments","Linking a checkout to a deployment","Preview deployments","Moving traffic between versions","Build once, deploy many","Custom domains","Trying a deploy without an account","Who changed what"],id:"concepts/environments",summary:"Running staging next to production, deploying an isolated environment, checking pull requests with a dry run, an isolated preview per pull\u2026",title:"Environments & releases"},{headings:["Throwing from a handler","Expected vs. unexpected","Reading error state on the client","Optimistic updates roll back on rejection","See also"],id:"concepts/error-handling",summary:"Throwing inside handlers, how errors travel to the client, and reading error state without losing optimistic safety.",title:"Error handling"},{headings:["What reaches your tracker","Wire it once, to both halves","Sentry","PostHog","Datadog, Axiom, Better Stack, and the rest","Source maps","Privacy"],id:"concepts/error-tracking",summary:"Send Lunora's failed calls and error logs to Sentry, PostHog, Datadog, or any error tracker, with the thrown error's real stack and\u2026",title:"Error tracking"},{headings:["External provider or @lunora/auth?","The resolver","Client: hand over the token, refresh it","WebSockets and live queries","RLS with org claims","Memoization and revocation","Composing with @lunora/auth or Cloudflare Access","Walkthrough: Clerk"],id:"concepts/external-auth",summary:"Use Clerk, WorkOS AuthKit, Auth0, Supabase or any OIDC JWT issuer as your identity provider \u2014 verify its token at the Worker and feed\u2026",title:"External auth"},{headings:["Which contexts expose what","Uploading","Serving files","Named buckets","Deleting","See also"],id:"concepts/file-storage",summary:"Typed R2 buckets exposed as ctx.storage \u2014 uploading, serving via signed URLs, and deleting files from your functions.",title:"File storage"},{headings:["Where the work happens","Choosing between them","When a bare filter is fine","How the advisors catch this","Composing","Inside an object column"],id:"concepts/filtering",summary:".filter() is a JavaScript predicate applied after rows are loaded \u2014 when to use it, and when to reach for an index instead.",title:"Filtering"},{headings:["The three context types","Surfaces on every ctx","ctx field matrix","Add-on surfaces (codegen-wired)"],id:"concepts/function-context",summary:"The ctx object passed to every query, mutation, and action \u2014 and what each kind is allowed to do with it.",title:"Function context"},{headings:["api.ts and internal.ts: function references","server.ts: typed helpers","dataModel.ts: Id and Doc","Importing the generated code","lunora/* vs @lunora/* imports","Linting and formatting","Regenerating"],id:"concepts/generated-code",summary:"What @lunora/codegen emits from your schema.ts, and how api / Id / Doc keep server and client in sync.",title:"Generated code"},{headings:["Declaring a point column and a geo index",'"Places near me": near(point, radiusMeters)',"Bounding box: within(box)","Single-shard scope","How the Advisors catch geo mistakes"],id:"concepts/geospatial",summary:'Store lat/lng points with v.geoPoint, index them with .geoIndex, and answer "places near me" and bounding-box reads with withGeoIndex.',title:"Geospatial"},{headings:["httpAction","HttpActionCtx","Typed routes with httpRoute","How routes mount in the worker"],id:"concepts/http-endpoints",summary:"Public HTTP routes with httpAction and the Hono-based httpRouter.",title:"HTTP endpoints"},{headings:["Declaring an index","Querying with withIndex","Why every filtered read should hit an index","How the Advisors catch unindexed reads","Checking a read with explain","Aggregate indexes"],id:"concepts/indexes",summary:"Declare B-tree indexes on tables and query them with withIndex \u2014 every filtered read should hit one.",title:"Indexes"},{headings:["Calling internal functions","Internal functions and scheduling"],id:"concepts/internal-functions",summary:"internalQuery / internalMutation / internalAction \u2014 server-only functions never exposed to the client.",title:"Internal functions"},{headings:["Declare the stream","Publish","Follow a topic in the browser","Authorization","Where delivery stops","Platform support","React Native"],id:"concepts/live-streams",summary:"Publish events to named topics from the server and follow many of them over one SSE connection.",title:"Live topic streams"},{headings:["Turn CDC on first","Why the DO topology fits","Shapes \u2014 partial replication","The poke diff protocol","Custom mutators \u2014 optimistic, server-authoritative","The client store","Cross-shard joins \u2014 the one limit"],id:"concepts/local-first",summary:"Shapes, the poke diff protocol, and custom mutators \u2014 the Zero-class sync engine.",title:"Local-first sync"},{headings:["Strategies","Roles and bypass","What's masked, what isn't","Sensitive arguments","Tooling","See also"],id:"concepts/masking",summary:"Column-level redaction on the read path \u2014 the companion to row-level security.",title:"Data masking"},{headings:["The lifetime","Rebuilding: onShardInit","What .memory() buys, and what it does not","Restrictions","Choosing between .memory() and .ttl()"],id:"concepts/memory-tables",summary:"Declare .memory() for state the shard rebuilds rather than remembers \u2014 presence, cursors, live counters \u2014 and onShardInit to bring it back\u2026",title:"Memory tables"},{headings:["Attaching middleware","Augmenting ctx","Composing concerns"],id:"concepts/middleware",summary:"Compose cross-cutting concerns \u2014 auth checks, rate limiting, logging \u2014 and augment ctx for downstream handlers.",title:"Middleware"},{headings:["The deploy gate tells you when you need one","Schema migrations (global tables)","Data migrations (sharded tables)","Inspecting run-state in the Studio","One-off data edits without a deploy","Resetting local state"],id:"concepts/migrations",summary:"Schema-change SQL for global tables and online, resumable data migrations.",title:"Migrations"},{headings:["Queues and topics","What you get","Table ownership","Installed components"],id:"concepts/modules",summary:"Group lunora/ folders into modules and get a module catalog and an architecture diagram from codegen.",title:"Modules"},{headings:["Running as one node in a dev graph","Deploying from external IaC","Consuming the generated API from a sibling package","Calling the backend from a sibling Worker"],id:"concepts/monorepos-and-iac",summary:"Running the Lunora worker as one node in a larger dev graph, deploying it from Terraform/Pulumi/Alchemy, and consuming its generated API\u2026",title:"Monorepos and external IaC"},{headings:["The output is pinned to your CLI version","Wiring it into your project","What you get, and what you don't","Conformance"],id:"concepts/non-js-sdks",summary:"Generate a typed, self-contained Lunora client for Python, Go, Ruby, Rust, Swift, Java, Kotlin or Dart/Flutter \u2014 vendored into your\u2026",title:"Non-JS SDKs"},{headings:["Configure defineNotify","VAPID / FCM config via .dev.vars","Register a browser push subscription","Send from an action","Queue-backed fan-out"],id:"concepts/notifications",summary:"Configure defineNotify in lunora/notify.ts for Web Push + FCM, register browser subscriptions, and send via ctx.notify / ctx.push from an\u2026",title:"Push notifications"},{headings:["Sinks","Structured logging with ctx.log","Tracing sub-operations with ctx.trace","Database telemetry (ctx.db and ctx.sql)","Trace sampling","Source maps","Application metrics with ctx.metrics","Container telemetry"],id:"concepts/observability",summary:"Ship Lunora's logs, traces, and metrics to any OTLP collector \u2014 the otlpSink worker option, ctx.log/ctx.trace/ctx.metrics, the zero-config\u2026",title:"Observability"},{headings:["Mutations are serialized, not retried","Where conflicts still happen","Handling a conflict on the client","Diagnosing a persistent conflict","Atomicity across shards",".global() tables"],id:"concepts/occ",summary:"Why mutations in one shard are serialized rather than retried, where optimistic-concurrency conflicts still arise, and what atomicity\u2026",title:"OCC & atomicity"},{headings:["Passing the adapters explicitly","What gets persisted","Surviving a breaking deploy","Multiple tabs","Sync status","Connection status UI","Boot with no network (the app shell)","The reconciliation model"],id:"concepts/offline-first",summary:"Persist reads and writes to disk so the app boots, renders, and accepts edits with no network.",title:"Offline-first"},{headings:["PaginationOptions","PaginationResult","Paging through a query","Ordering rows that hold NULL","Load more / infinite lists on the client",'Total count ("42 of 1,203")'],id:"concepts/pagination",summary:"Keyset pagination with .paginate(options) \u2014 page through a query and build an infinite list on the client.",title:"Pagination"},{headings:["ctx.db","ctx.auth","ctx.scheduler"],id:"concepts/queries-mutations",summary:"query / mutation / action \u2014 what each is for and how ctx is shaped.",title:"Queries & mutations"},{headings:["How this differs from a trigger","The convergence contract","What the handler receives","Execution and identity","Reads that should not wake you","Watching them work"],id:"concepts/reactors",summary:"Declare onQueryChange to run server logic when a query's result changes \u2014 the actor pattern, with no client on the other end and nothing\u2026",title:"Reactors (server-side reactivity)"},{headings:["Where a shard is created","Replica reads","Sockets near the client"],id:"concepts/read-replicas",summary:"Serve one-shot queries from a copy of the shard in the caller's region, pin where a shard is created, and terminate sockets near the client.",title:"Read replicas & placement"},{headings:["Hibernation","How an update reaches a subscriber","Reconnect","When WebSockets are blocked","Durable streams","Whispers (ephemeral peer messages)","Why no MQTT / Pub/Sub"],id:"concepts/realtime",summary:"How subscriptions, deltas, and hibernation fit together.",title:"Real-time"},{headings:["Using items","The manifest","Validation","Building the catalog","Distributing"],id:"concepts/registry-items",summary:"Package a reusable capability \u2014 schema, functions, bindings and env vars \u2014 as a registry item others install with one command.",title:"Authoring registry items"},{headings:["A worked example","The edge set","Directions","Depth, limit and score","Cycles and paging","It is an ordinary read","Fusing the graph into retrieval","From an AI agent"],id:"concepts/relation-graph",summary:"Traverse the foreign-key graph your schema already declares with ctx.db.related \u2014 depth-bounded, cycle-safe, scored by proximity, and\u2026",title:"Relation graph"},{headings:["The descriptors","Many-to-many","Index your foreign keys","Querying across a relation","Writing through a relation","Relations vs the relation graph"],id:"concepts/relations",summary:"Modeling many-to-one, one-to-many and many-to-many relationships with the one / many relation descriptors, foreign-key columns, join\u2026",title:"Relations"},{headings:["Default-closed","URLs and methods","Arguments","Choosing a shard","Authentication","Rate limiting","Caching","OpenAPI"],id:"concepts/rest-api",summary:"Publish a query, mutation, or action as a plain REST endpoint with .expose({ rest: true }) \u2014 default-closed, routed through the procedure\u2026",title:"Public REST API"},{headings:["Policies","Permissions and roles","Relation predicates","What's covered, what isn't","Testing policies","See also"],id:"concepts/rls",summary:"Server-side authorization that decides which rows a procedure can read or write.",title:"Row-level security"},{headings:["Node compatibility","Where the constraints bite","Bundling","The worker entry","Build once, deploy many"],id:"concepts/runtime",summary:"Everything runs on the Workers runtime \u2014 what that means for Node APIs, dependencies, and the 64 MiB bundle you have to fit into.",title:"Runtime & bundling"},{headings:["Deferring a function","Recurring jobs (Cron Triggers)","How dispatch works","See also"],id:"concepts/scheduling",summary:"Defer follow-up work with ctx.scheduler.runAfter / runAt, and run recurring jobs via Cron Triggers.",title:"Scheduling"},{headings:["Validators","Tier modifiers","Indexes"],id:"concepts/schema",summary:"Declarative tables, validators, indexes and sharding.",title:"Schema"},{headings:["Declaring a search index","Language","Running a search query","Matching rules","Filter fields","Relevance ordering, .take(n) and pagination","Limits","Backfill and staged"],id:"concepts/search",summary:"Declare a search index on a table and run relevance-ordered full-text queries.",title:"Full-text search"},{headings:["The HTTP edge","Auth, cookies, and secrets","Protecting public procedures","Securing sharded access","Advisor catalog","Config-time validation"],id:"concepts/security",summary:"Lunora's secure-by-default posture \u2014 the protections you get for free, how to opt out, and the advisor lints that catch the gaps.",title:"Security"},{headings:["From an SSR loader","From a script","From the terminal","From Python","From any language, over HTTP","Writing a new SDK"],id:"concepts/server-clients",summary:"Calling a Lunora deployment without a live subscription \u2014 from SSR loaders, scripts, other languages, or plain HTTP.",title:"Server-side & non-reactive clients"},{headings:["Declare a service","Call it from an action","What Lunora wires","Test an action that calls one","Make the service private","Smart Placement","Platforms","Migrating from URLs and HMAC"],id:"concepts/services",summary:"Call sibling Cloudflare Workers from actions over typed service bindings, run them in one dev session, and deploy them before the app.",title:"Services"},{headings:["When to shard","Migrating a populated table","What stays in the root DO","Going global","Cross-shard reads","The shard registry","Securing shard access"],id:"concepts/sharding",summary:"Default __root__ DO, opt-in .shardBy(), and .global() escape hatch.",title:"Sharding"},{headings:["The one caveat that matters","The read surface","_scheduled_functions","_storage"],id:"concepts/system-tables",summary:"Read pending scheduled jobs and stored file metadata through ctx.db.system \u2014 a read-only, eventually consistent view outside the mutation\u2026",title:"System tables"},{headings:["Install","Configure","Write a test","Run in CI"],id:"concepts/testing-ai-features",summary:"Drive a Lunora app's AI flows in a real browser with the e2e runner, and judge non-deterministic model output with natural-language\u2026",title:"Testing AI features end to end"},{headings:["The in-memory harness","Asserting reactive results","Mail-catcher helpers (E2E)","Running in CI"],id:"concepts/testing",summary:"Unit-test queries, mutations, and actions in memory with lunoraTest \u2014 no worker, no network.",title:"Testing"},{headings:["Declaring a TTL","Sweep semantics: coarse, batched, bounded","Not on .global() tables","Interaction with soft delete","How the Advisors catch TTL mistakes"],id:"concepts/ttl",summary:"Declare a table-level .ttl() so a DO alarm sweep auto-deletes expired rows \u2014 sessions, OTPs, and other ephemeral data.",title:"TTL & auto-expiry"},{headings:["Where types come from","Do not restate what is inferred","Reach for Doc and Id","Pin the client contract with .output()","Optional versus null in types","Bringing your own validators","Project configuration","Keeping types honest in CI"],id:"concepts/typescript",summary:"Getting the most out of Lunora's end-to-end types \u2014 where types come from, what to annotate, and what to let inference do.",title:"TypeScript"},{headings:["Job 1: column types in defineTable","Job 2: argument and return validation","Return-type inference to the client","Common validators","Coming from zod","ValidationError"],id:"concepts/validation",summary:"The v.* validators that type your columns and parse query / mutation / action inputs and outputs end to end.",title:"Validation"},{headings:["Declaring an index","Automatic write sync","ctx.vectors","RAG with @lunora/ai","Binding & config wiring"],id:"concepts/vector-search",summary:"Typed Vectorize indexes on ctx.vectors \u2014 automatic write sync, similarity search, and RAG with embeddings.",title:"Vector search"},{headings:["The specification","Conformance fixtures","SDKs built on it"],id:"concepts/wire-protocol",summary:"The language-independent Lunora client\u2194server wire protocol and the golden fixtures every SDK is tested against.",title:"Wire protocol"},{headings:["wrangler.jsonc","lunora.config.ts","Secrets","Containers","Deploy","Durable Object class limit","Worker size","Streaming logs"],id:"deployment",summary:"Wrangler bindings, secrets, and the deploy flow.",title:"Deployment"},{headings:["Redacted codes","Build-time errors","Throwing your own","Error codes"],id:"errors",summary:"Every well-known Lunora error code \u2014 its HTTP status, what it means, and what to do about it.",title:"Errors & warnings reference"},{headings:["Branching on one","The same number, in the document","Where the numbers come from","From your own code"],id:"exit-codes",summary:"The exit code every lunora command terminates with \u2014 what each number means, and how it is derived from the error catalog.",title:"CLI exit codes"},{headings:["Install","Provide the client","Live queries","Mutations","Connection status","Reactive loaders"],id:"frameworks/angular",summary:"Use Lunora with Angular \u2014 provideLunora in your app config, signal-based liveQuery, imperative mutate, and a connectionStatus signal.",title:"Angular"},{headings:["Install","Exports","The integration","Single-worker composition with withLunora","Reactive-loader server helpers","Deploy"],id:"frameworks/astro",summary:"Compose Astro's @astrojs/cloudflare worker with Lunora realtime, plus reactive-loader server helpers for .astro frontmatter.",title:"Astro"},{headings:["One worker, two dispatch flows","Mount Lunora inside your framework","The per-framework matrix","Client adapters","Scaffolding","Vite composition"],id:"frameworks/bring-your-framework",summary:"Compose any meta-framework's SSR with Lunora realtime in one Cloudflare Worker.",title:"Bring your framework"},{headings:["One worker, two dispatch flows","Class A: Lunora owns the worker entry","Class B: the framework owns the CF adapter","Class C: SPA / SSR-less","Wrangler reconciliation"],id:"frameworks/deploy",summary:"One worker, one deploy \u2014 how a composed Lunora + meta-framework app ships to Cloudflare.",title:"Deploy your framework"},{headings:["Why two workers","Wiring them together","Client and server entry points","Loading data in a Server Component","Providing the client","Developing","Deploying"],id:"frameworks/nextjs",summary:"Run Lunora alongside Next.js on Cloudflare with the two-worker split \u2014 RSC loaders that hydrate into live subscriptions.",title:"Next.js"},{headings:["Install","Setup","How it works","Provide the client","Reactive loaders","Feature flags","Verify before deploy","Alternative: two-worker split"],id:"frameworks/nuxt",summary:"Run Lunora and Nuxt as one Cloudflare Worker \u2014 the @lunora/nuxt module mounts /_lunora/** into Nitro, plus reactive-loader server helpers.",title:"Nuxt"},{headings:["Scaffold a new app","Install","Create the client","Provide it","Live queries and mutations","HTTP streams","Local-first (shapes, custom mutators, TanStack DB)","Authentication (better-auth + Expo)"],id:"frameworks/react-native",summary:"Use Lunora in a React Native / Expo app \u2014 the same live hooks, plus an AsyncStorage-backed client and a better-auth Expo bridge.",title:"React Native / Expo"},{headings:["Install","Provide the client","Live queries","Mutations","Auth","Reactive loaders","One worker, one deploy"],id:"frameworks/react",summary:"Use Lunora with React \u2014 a provider, live useQuery/useMutation hooks, and the SSR-seed \u2192 live reactive-loader handoff.",title:"React"},{headings:["The problem with static loaders","The handoff","Why there's no flash","Identity continuity (SSR \u2192 client)","Sharding carries through","Status"],id:"frameworks/reactive-loaders",summary:"Your loaders are live \u2014 SSR data that hydrates into a real-time subscription with no flash.",title:"Reactive loaders"},{headings:["Install","Solid 1.x and Solid 2.0","Provide the client","Live queries","Mutations","Reactive loaders"],id:"frameworks/solid",summary:"Use Lunora with SolidJS \u2014 a provider, live createQuery/createMutation primitives, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Solid"},{headings:["Install","Provide the client","Live queries","Mutations","Reactive loaders","One worker, one deploy"],id:"frameworks/svelte",summary:"Use Lunora with Svelte 5 / SvelteKit \u2014 context-provided client, live query/mutation stores, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Svelte"},{headings:["What you're proving","1. Scaffold","2. Dev","3. Prove SSR preload (curl the raw HTML)","4. Prove the live subscription attaches","5. Prove live update (two tabs)","Identity check (optional, with auth)",'What "pass" looks like'],id:"frameworks/verify-live-loaders",summary:"How to actually prove live loaders work \u2014 scaffold, SSR-curl the preloaded value, two-tab live update.",title:"Manual end-to-end verification"},{headings:["Install","Provide the client","Live queries","Mutations","Reactive loaders","Worker composition"],id:"frameworks/vue",summary:"Use Lunora with Vue 3 \u2014 a client plugin, live useQuery/useMutation composables, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Vue"},{headings:["Requirements"],id:"getting-started",summary:"Scaffold a Lunora app and run the dev loop in under a minute.",title:"Getting started"},{headings:["Durable Objects","Statement limits (Durable Objects **and** D1)","D1","R2","Workers","Worker startup (error 10021)","Queues","Pipelines"],id:"limits",summary:"Cloudflare ceilings you should keep in your head.",title:"Limits"},{headings:["Two translations, not one","Schema: transposing the relation graph","Procedures: the shape deltas","Writes: .returning() does not survive","Components decompose by hand"],id:"migrating/from-a-convex-toolkit",summary:"The second translation step a Drizzle-style schema DSL and a tRPC-style procedure builder add on top of the raw Convex mapping.",title:"Migrating from a Convex toolkit"},{headings:["Bump strategy","Breaking changes already landed","Recommended (non-breaking) follow-ups","See also"],id:"migrating/from-alpha",summary:"How a 1.0.0-alpha.* app moves to stable \u2014 dependency bumps plus every breaking change already landed on the road to 1.0.",title:"Upgrading from alpha to 1.0"},{headings:["At a glance","Schema","Queries, mutations, actions","React","Auth","Scheduler","File storage","Subscriptions"],id:"migrating/from-convex",summary:"Side-by-side mapping \u2014 schema, queries, mutations, actions, React hooks.",title:"Migrating from Convex"},{headings:["At a glance","Schema","Reads: onSnapshot \u2192 useQuery","Writes: setDoc \u2192 mutation","Cloud Functions \u2192 actions","Auth","File storage","Scheduled work"],id:"migrating/from-firebase",summary:"Side-by-side mapping \u2014 Firestore, Cloud Functions, Auth, Storage, and real-time listeners.",title:"Migrating from Firebase"},{headings:["At a glance","Schema","Reads: supabase.from(...).select() \u2192 useQuery","Writes: .insert() \u2192 mutation","Row-level security","Edge Functions \u2192 actions","Auth","File storage"],id:"migrating/from-supabase",summary:"Side-by-side mapping \u2014 Postgres tables, RLS, Edge Functions, Auth, Storage, and Realtime.",title:"Migrating from Supabase"},{headings:["No arbitrary external SQL or ad-hoc cross-dataset joins","RPC-first, not REST-first","Cross-shard writes are eventual, not atomic","No data warehouse hosting in the framework","No managed control plane as a hard dependency","Also deliberately absent","See also"],id:"non-goals",summary:"The things Lunora deliberately does not do \u2014 each with the reason it's a boundary and the escape hatch when you need past it.",title:"Design boundaries"},{headings:["Why Lunora","Own it, or let us run it","How Lunora compares","Where it's rough","What ships in v1.0.0-alpha.1","Start building"],id:"overview",summary:"The Convex-style real-time backend that runs on your own Cloudflare account \u2014 typed end to end, live by default, ~$0 at idle.",title:"Overview"},{headings:["Bindings and wrangler config","Secrets","LUNORA_ADMIN_TOKEN and the admin plane","Rate limiting and abuse","Auth and row-level security","Migrations","Observability","Health and readiness endpoint"],id:"production-checklist",summary:"Everything to verify before a Lunora app takes real traffic \u2014 bindings, secrets, admin tokens, rate limits, RLS, migrations, observability.",title:"Production checklist"},{headings:["Pick a starting point","Adding Lunora to an app you already have","What you get either way","Next steps"],id:"quickstarts",summary:"Every starting point Lunora scaffolds \u2014 pick your framework, run one command, and get a live backend wired to it.",title:"Quickstarts"},{headings:["1. See where you stand","2. Create the usage alerts","3. Add the budget alert by hand","4. Check delivery","In CI"],id:"runaway-bill",summary:"Set Cloudflare usage alerts well above normal with `lunora cloudflare alerts`, add the budget alert the API cannot, and check what\u2026",title:"Protect yourself from a runaway bill"},{headings:["Why startup grows with the app","Measure it locally","The fix: load function modules on demand","Keep heavy packages off the startup path"],id:"startup-cpu-limit",summary:'Why a large app fails to deploy with "Script startup exceeded CPU time limit", how to measure it, and how lazy function loading and\u2026',title:"Worker startup CPU limit (error 10021)"},{headings:["1. Scaffold","2. Model the data","3. Generate the migration","4. Write the query","5. Write the mutation","6. Wire the React app","7. Run the dev loop","8. Deploy"],id:"tutorial/realtime-chat",summary:"End-to-end Lunora walkthrough \u2014 schema, query, mutation, subscription, React, sharding.",title:"Build a real-time chat app in 15 minutes"},{headings:["Know when to act","Step 1: shard the messages","Step 2: put identities in a global table","Step 3: keep fan-out off the hot path","Step 4: lock down shard access","Step 5: migrate the data you already have","Checking your work","What you learned"],id:"tutorial/scaling",summary:"Take the chat app from one Durable Object to many \u2014 shard by channel, put identities in a global table, and keep cross-shard reads off the\u2026",title:"Tutorial: scaling the chat app"},{headings:["Release channels","What SemVer means here","Stability tiers",'What "experimental" means',"See also"],id:"versioning",summary:"What SemVer means for Lunora packages \u2014 release channels, stability tiers, and the experimental surface.",title:"Versioning & stability"}],l="https://lunora.sh/docs/",u=4,m=3,g=200,p=4,y=3,f=2,w=1,v=o(t=>t.slice(0,g).toLowerCase().split(/[^a-z0-9.]+/u).filter(a=>a.length>=m),"w"),b=o((t,a)=>{let i=t.id.toLowerCase(),e=t.title.toLowerCase(),s=t.summary.toLowerCase(),c=t.headings.map(n=>n.toLowerCase()),r=0;for(let n of a)i.includes(n)&&(r+=p),e.includes(n)&&(r+=y),c.some(h=>h.includes(n))&&(r+=f),s.includes(n)&&(r+=w);return r},"v"),k=o(t=>{let a=v(typeof t=="string"?t:""),i=a.length===0?[]:d.map(e=>({candidate:e,rank:b(e,a)})).filter(e=>e.rank>0).sort((e,s)=>s.rank-e.rank).slice(0,u).map(e=>({...e.candidate,url:`${l}${e.candidate.id}`}));return{entries:i.length===0?d.map(e=>e.id):i}},"b"),S=o(t=>{let{entries:a}=k(t);return a.every(i=>typeof i=="string")?[`Documentation pages under ${l}: ${a.join(", ")}`]:a.map(i=>{let e=i;return`${e.title} (${e.url}): ${e.summary} Sections: ${e.headings.join(", ")}`})},"k");export{S as knowledgeExcerpts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as i,j as a}from"./chunk-YUVGMKHG.js";import{a as o}from"./chunk-ZPQBVYNN.js";import{x as n}from"./chunk-OOOT4H45.js";import{a as r}from"./chunk-5PEAXTYQ.js";function s(e){return a(e.defaultTagName??"div",e,e)}r(s,"useRender");var g=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function x({className:e,variant:t="default",render:d,...u}){return s({defaultTagName:"span",props:i({className:n(g({variant:t}),e)},u),render:d,state:{slot:"badge",variant:t}})}r(x,"f");export{s as a,x as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as fe}from"./chunk-VJC5PQ7D.js";import"./chunk-O3AZ7JKE.js";import{a as ie}from"./chunk-UBX5ZPLV.js";import{a as de}from"./chunk-Q65X2ZIP.js";import"./chunk-D65UVZIA.js";import{i as me}from"./chunk-Q3WMP7OA.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as b}from"./chunk-5SKGLIO5.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as ue}from"./chunk-XMOG3LIP.js";import{b as he}from"./chunk-K5BAERB3.js";import"./chunk-YUVGMKHG.js";import{a as pe}from"./chunk-E5LR7G22.js";import"./chunk-F7EKRF7I.js";import"./chunk-O7XG7DTU.js";import"./chunk-O24UFHUY.js";import"./chunk-4PI2OSSP.js";import{a as H}from"./chunk-2W4UO5BC.js";import{c as oe}from"./chunk-5X6BEWUI.js";import{m as se}from"./chunk-JWQOB4EW.js";import"./chunk-ZPQBVYNN.js";import{B as ce,h as Z,i as ee,j as te,s as ae,v as le,w as re,x as ne}from"./chunk-OOOT4H45.js";import"./chunk-PDBW6GTJ.js";import{a as ve}from"./chunk-GWNGVKLG.js";import{a as ge,b as Ne}from"./chunk-6G3E4PJ2.js";import{a as l,d as Y}from"./chunk-5PEAXTYQ.js";var t=Y(Ne(),1);var be=Y(ve(),1),v=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:ne("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}l(ye,"ge");var we=/https?:\/\/[^\s"'<>)]+/i,xe=l(a=>a===void 0?void 0:we.exec(a)?.[0],"re"),N=l(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"v"),Ce=/<a\s(?:[^>]*?\s)?href\s*=\s*["'](https?:\/\/[^"'\s]+)["']/iu,ke=/&(?:amp|#0*38|#x0*26);/giu,Se=l(a=>a===void 0?void 0:((a.html===void 0?void 0:Ce.exec(a.html)?.[1])??xe(a.text)??xe(a.html))?.replaceAll(ke,"&"),"ye"),Te=l((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${N(o.to)} ${N(o.cc)}`.toLowerCase().includes(s))},"Ce"),je=l((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"Se"),Le=Z(H.clearCapturedMail),_e=Z(H.sendTestMail),Me=l(a=>{let e=(0,be.c)(36),{limit:s}=a,o=se(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:I,error:y,errorSource:w,isLoading:g,poll:P,refetch:c}=oe(H.getCapturedMail,p),[C,f]=(0,v.useState)(null),[q,k]=(0,v.useState)(null),[i,h]=(0,v.useState)("html"),[x,B]=(0,v.useState)(""),r=I?.entries??[],m=y??C,D=y===null?C:w,S;e[2]!==o||e[3]!==c?(S=l(async()=>{f(null);try{await o.query(Le,{},ee("")),k(null),c()}catch(d){f(te(d))}},"S"),e[2]=o,e[3]=c,e[4]=S):S=e[4];let R=S,T;e[5]!==o||e[6]!==c?(T=l(async()=>{f(null);try{await o.query(_e,{},ee("")),c()}catch(d){f(te(d))}},"T"),e[5]=o,e[6]=c,e[7]=T):T=e[7];let Q=T;de(P,!0);let j;e[8]!==R?(j=l(()=>{ae(R())},"k"),e[8]=R,e[9]=j):j=e[9];let U=j,L;e[10]!==Q?(L=l(()=>{ae(Q())},"A"),e[10]=Q,e[11]=L):L=e[11];let W=L,_;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=l(d=>{B(d.currentTarget.value)},"E"),e[12]=_):_=e[12];let G=_,M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=l(d=>{let{id:u}=d.currentTarget.dataset;u!==void 0&&k(u)},"_"),e[13]=M):M=e[13];let J=M,z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=l(d=>{let u=d.currentTarget.dataset.tab;(u==="headers"||u==="html"||u==="text")&&h(u)},"L"),e[14]=z):z=e[14];let K=z,$=Te(r,x),A=je($,q),n=Se(A),O;e[15]!==n?(O=l(()=>{n!==void 0&&le(n)},"j"),e[15]=n,e[16]=O):O=e[16];let V=O,F;e[17]!==n?(F=l(()=>{n!==void 0&&"window"in globalThis&&globalThis.window.open(n,"_blank","noopener")},"$"),e[17]=n,e[18]=F):F=e[18];let X=F,E;return e[19]!==r||e[20]!==m||e[21]!==D||e[22]!==x||e[23]!==g||e[24]!==n||e[25]!==U||e[26]!==V||e[27]!==G||e[28]!==X||e[29]!==J||e[30]!==K||e[31]!==W||e[32]!==A||e[33]!==i||e[34]!==$?(E={entries:r,error:m,errorSource:D,filter:x,isLoading:g,link:n,onClear:U,onCopyLink:V,onFilterChange:G,onOpenLink:X,onSelectMessage:J,onSelectTab:K,onSendTest:W,selected:A,tab:i,visible:$},e[19]=r,e[20]=m,e[21]=D,e[22]=x,e[23]=g,e[24]=n,e[25]=U,e[26]=V,e[27]=G,e[28]=X,e[29]=J,e[30]=K,e[31]=W,e[32]=A,e[33]=i,e[34]=$,e[35]=E):E=e[35],E},"Ae"),ze=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,$e=l(a=>`${ze}${a}`,"_e"),Ke=l(({limit:a=100})=>{let e=ce(),{entries:s,error:o,errorSource:p,filter:I,isLoading:y,link:w,onClear:g,onCopyLink:P,onFilterChange:c,onOpenLink:C,onSelectMessage:f,onSelectTab:q,onSendTest:k,selected:i,tab:h,visible:x}=Me({limit:a}),B=l(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"H");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b,{"data-testid":"mail-send-test",onClick:k,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(b,{"data-testid":"mail-clear",disabled:s.length===0,onClick:g,size:"sm",type:"button",variant:"outline",children:e("Clear inbox")}),s.length>0&&(0,t.jsx)(he,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(pe,{error:p,testId:"mail-error"}),o===null&&!y&&s.length===0&&(0,t.jsx)(ue,{description:e("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M4 5h16v14H4z"}),(0,t.jsx)("path",{d:"m4 6 8 6 8-6"})]}),testId:"mail-empty",title:e("No captured email.")}),s.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(me,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:c,placeholder:e("Filter messages"),type:"search",value:I}),(0,t.jsx)(fe,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,t.jsx)("ul",{className:"divide-y",children:x.map(r=>{let m=r.id===i?.id;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${m?"bg-muted":""}`,"data-active":m,"data-id":r.id,"data-testid":"mail-list-item",onClick:f,type:"button",children:[(0,t.jsx)("span",{className:"w-full truncate font-medium",children:r.subject||e("(no subject)")}),(0,t.jsx)("span",{className:"w-full truncate text-xs text-muted-foreground",children:N(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),i!==void 0&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:i.subject||e("(no subject)")}),(0,t.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsx)("dt",{children:e("From")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:i.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.to)}),i.cc!==void 0&&i.cc.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:e("Cc")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(i.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(b,{"data-testid":"mail-copy-link",disabled:w===void 0,onClick:P,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(b,{"data-testid":"mail-open-link",disabled:w===void 0,onClick:C,size:"sm",type:"button",variant:"outline",children:e("Open in new tab")})]}),(0,t.jsx)(ye,{}),(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(r=>(0,t.jsx)(b,{"aria-selected":h===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:q,role:"tab",size:"sm",type:"button",variant:h===r?"secondary":"ghost",children:B(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[h==="html"&&(i.html===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No HTML body.")}):(0,t.jsx)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:$e(i.html),title:e("Email preview")})),h==="text"&&(i.text===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No text body.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:i.text})),h==="headers"&&(i.headers===void 0||Object.keys(i.headers).length===0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No headers.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(i.headers).map(([r,m])=>`${r}: ${m}`).join(`
|
|
2
|
+
`)}))]})]})]})]})},"Qe");export{Ke as MailPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{e}from"./chunk-TW4O2BA5.js";import"./chunk-4EPW63HS.js";import"./chunk-PDBW6GTJ.js";import"./chunk-6G3E4PJ2.js";import"./chunk-5PEAXTYQ.js";export{e as Mermaid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as ve,H as Ce,c as Z,d as fe,f as he,fa as Pe,g as ge,ga as G,h as ye,ha as Re,i as Se,ia as we,ja as be,ka as Ee,ta as xe}from"./chunk-XLYFGUEF.js";import{b as Y}from"./chunk-D65UVZIA.js";import{a as Ye}from"./chunk-QRA7AKYO.js";import{F as U,H as j,M as V,N,e as de}from"./chunk-HFBSWKJS.js";import{a as ue}from"./chunk-4EPW63HS.js";import{b as ce,f as le,o as pe,u as E,v,w as W}from"./chunk-VUOEJJUH.js";import{d as me,g as w,i as D}from"./chunk-YUVGMKHG.js";import{a as B,b as je}from"./chunk-6G3E4PJ2.js";import{a as n,d as R}from"./chunk-5PEAXTYQ.js";var Te=class{static{n(this,"BasePopupHandle")}attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(t,o,r=!0){this.fallbackStore=t,this.componentName=o,this.throwOnMissingTrigger=r}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(t){return this.storeListeners.add(t),()=>{this.storeListeners.delete(t)}}attachStore(t){return this.attachedStores.push(t),this.setActiveStore(t),()=>{let o=this.attachedStores.lastIndexOf(t);o!==-1&&this.attachedStores.splice(o,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(t){this.attachedStoreValue!==t&&(this.attachedStoreValue=t,this.storeListeners.forEach(o=>{o()}))}openByTrigger(t){let o=this.attachedStore;if(o===null)return;let r;if(t){for(let s=this.attachedStores.length-1;s>=0&&!r;s-=1)r=this.attachedStores[s].context.triggerElements.getById(t);r??=this.fallbackStore.context.triggerElements.getById(t)}if(t&&!r&&this.throwOnMissingTrigger)throw new Error(me(99,this.componentName,t,this.componentName));o.setOpen(!0,N(V.imperativeAction,void 0,r))}closePopup(){let t=this.attachedStore;t!==null&&t.setOpen(!1,N(V.imperativeAction))}};var ee=R(B(),1),Oe=R(Ye(),1);function rt(e){let t=ee.useCallback(r=>e===void 0?w:e.subscribeStore(r),[e]),o=ee.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Oe.useSyncExternalStore)(t,o,()=>e?.serverStore)}n(rt,"usePopupHandleStore");var Ae=R(B(),1),te=R(ue(),1);function lt(e,t){let o=Ae.useRef(null);function r(i){te.flushSync(()=>{e.setOpen(!1,N(V.focusOut,i.nativeEvent,i.currentTarget))}),ye(o.current)?.focus()}n(r,"handlePreFocusGuardFocus");function s(i){let u=e.select("positionerElement");if(u&&Se(i,u))e.context.beforeContentFocusGuardRef.current?.focus();else{te.flushSync(()=>{e.setOpen(!1,N(V.focusOut,i.nativeEvent,i.currentTarget))});let a=ge(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&de(u,a);){let l=a;if(a=he(a),a===l)break}a?.focus()}}return n(s,"handleFocusTargetFocus"),{preFocusGuardRef:o,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}n(lt,"useTriggerFocusGuards");var c=R(B(),1),Le=R(ue(),1);var F=R(B(),1);function oe(e){let t=pe(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,s=le(e),i=s?e.offsetWidth:o,u=s?e.offsetHeight:r;return(Z(o)!==i||Z(r)!==u)&&(o=i,r=u),{width:o,height:r}}n(oe,"getCssDimensions");var H="--popup-width",_="--popup-height";function Ne(e){let{popupElement:t,positionerElement:o,content:r,mounted:s,onMeasureLayout:i,onMeasureLayoutComplete:u,side:a,direction:l}=e,g=j(t,!0),C=U(),p=F.useRef(null),d=F.useRef(!0),m=F.useRef(w),y=E(i),h=E(u),b=F.useMemo(()=>Ge(a,l),[a,l]);v(()=>{if(!s){m.current=w,d.current=!0,p.current=null;return}if(!t||!o)return;m.current=Ve(t,b),ne(t,"auto");let I=q(t,"position","static"),x=q(t,"transform","none"),S=q(t,"scale","1"),T=Ve(o,{[Re]:"max-content",[we]:"max-content"});function X(){I(),x(),T()}n(X,"restoreMeasurementOverrides");function L(){X(),S()}if(n(L,"restoreMeasurementOverridesIncludingScale"),y?.(),d.current||p.current===null){K(o,"max-content");let A=oe(t);return p.current=A,K(o,A),L(),h?.(null,A),d.current=!1,()=>{m.current(),m.current=w}}K(o,"max-content");let O=p.current,P=oe(t);p.current=P,ne(t,O),L(),h?.(O,P),K(o,P);let $=new AbortController;return C.request(()=>{ne(t,P),g(()=>{t.style.setProperty(H,"auto"),t.style.setProperty(_,"auto")},$.signal)}),()=>{$.abort(),C.cancel(),m.current(),m.current=w}},[r,t,o,g,C,s,y,h,b])}n(Ne,"usePopupAutoResize");function Ge(e,t){let o=e==="top",r=e==="left"||e===(t==="rtl"?"inline-end":"inline-start");return!o&&!r?D:{position:"absolute",[o?"bottom":"top"]:"0",[r?"right":"left"]:"0"}}n(Ge,"getPopupAnchoringStyles");function q(e,t,o){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,o),()=>{e.style.setProperty(t,r)}}n(q,"overrideElementStyle");function Ve(e,t){let o=[];for(let[r,s]of Object.entries(t))o.push(q(e,r,s));return o.length?()=>{o.forEach(r=>r())}:w}n(Ve,"applyElementStyles");function ne(e,t){let o=t==="auto"?"auto":`${t.width}px`,r=t==="auto"?"auto":`${t.height}px`;e.style.setProperty(H,o),e.style.setProperty(_,r)}n(ne,"setPopupCssSize");function K(e,t){let o=t==="max-content"?"max-content":`${t.width}px`,r=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty(be,o),e.style.setProperty(Ee,r)}n(K,"setPositionerCssSize");var Fe={name:"adaptiveOrigin",async fn(e){let{x:t,y:o,rects:{floating:r},elements:{floating:s},platform:i,strategy:u,placement:a}=e,l=ce(s),g=l.getComputedStyle(s);if(!(g.transitionDuration!=="0s"&&g.transitionDuration!==""))return{x:t,y:o,data:G};let p=await i.getOffsetParent?.(s),d={width:0,height:0};if(u==="fixed"&&l?.visualViewport)d={width:l.visualViewport.width,height:l.visualViewport.height};else if(p===l){let x=W(s);d={width:x.documentElement.clientWidth,height:x.documentElement.clientHeight}}else await i.isElement?.(p)&&(d=await i.getDimensions(p));let m=fe(a),y=t,h=o;m==="left"&&(y=d.width-(t+r.width)),m==="top"&&(h=d.height-(o+r.height));let b=m==="left"?"right":G.sideX,I=m==="top"?"bottom":G.sideY;return{x:y,y:h,data:{sideX:b,sideY:I}}}};var Me="data-activation-direction";var M=R(je(),1);var Yt={activationDirection:n(e=>e?{[Me]:e}:null,"activationDirection")};function Gt(e){let{store:t,side:o,children:r}=e,s=Y(),i=t.useState("activeTriggerElement"),u=t.useState("activeTriggerId"),a=t.useState("open"),l=t.useState("payload"),g=t.useState("mounted"),C=t.useState("popupElement"),p=t.useState("positionerElement"),d=xe(a?i:null),m=Je(u,l),y=c.useRef(null),[h,b]=c.useState(null),[I,x]=c.useState(null),S=c.useRef(null),T=c.useRef(null),X=j(S,!0),L=U(),O=c.useRef(null),[P,$]=c.useState(null),[A,J]=c.useState(!1);v(()=>(t.set("adaptiveOrigin",Fe),()=>{t.set("adaptiveOrigin",void 0)}),[t]);let ke=E(()=>{S.current?.style.setProperty("animation","none"),S.current?.style.setProperty("transition","none"),T.current?.style.setProperty("display","none")}),Be=E(f=>{S.current?.style.removeProperty("animation"),S.current?.style.removeProperty("transition"),T.current?.style.removeProperty("display"),f&&$(f)}),ie=E(()=>{O.current?.abort();let f=new AbortController;O.current=f,X(()=>{b(null),$(null),y.current=null},f.signal)}),z=c.useRef(null);v(()=>{(!a||!g)&&(z.current=null)},[a,g]),v(()=>{if(i&&d&&i!==d&&z.current!==i&&y.current){b(y.current),J(!0);let f=Xe(d,i);x(f),z.current=i}},[i,d]),v(()=>{h!=null&&(O.current?.abort(),J(!0),L.request(()=>{Le.flushSync(()=>{J(!1)}),ie()}))},[m,h,ie,L]),v(()=>{let f=S.current;if(!f)return;let ae=W(f).createElement("div");for(let Ue of Array.from(f.childNodes))ae.appendChild(Ue.cloneNode(!0));y.current=ae});let se=h!=null,Q;se?Q=(0,M.jsxs)(c.Fragment,{children:[(0,M.jsx)("div",{"data-previous":!0,inert:Pe(!0),ref:T,style:{...P?{[H]:`${P.width}px`,[_]:`${P.height}px`}:null,position:"absolute"},"data-ending-style":A?void 0:""},"previous"),(0,M.jsx)("div",{"data-current":!0,ref:S,"data-starting-style":A?"":void 0,children:r},m)]}):Q=(0,M.jsx)("div",{"data-current":!0,ref:S,children:r},m),v(()=>{let f=T.current;!f||!h||f.replaceChildren(...Array.from(h.childNodes))},[h]),Ne({popupElement:C,positionerElement:p,mounted:g,content:l,onMeasureLayout:ke,onMeasureLayoutComplete:Be,side:o,direction:s});let We={activationDirection:qe(I),transitioning:se};return{children:Q,state:We}}n(Gt,"usePopupViewport");function qe(e){if(e)return`${Ie(e.horizontal,5,"right","left")} ${Ie(e.vertical,5,"down","up")}`}n(qe,"getActivationDirection");function Ie(e,t,o,r){return e>t?o:e<-t?r:""}n(Ie,"getValueWithTolerance");function Xe(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s={x:o.left+o.width/2,y:o.top+o.height/2},i={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:i.x-s.x,vertical:i.y-s.y}}n(Xe,"calculateRelativePosition");function Je(e,t){let[o,r]=c.useState(0),s=c.useRef(e),i=c.useRef(t),u=c.useRef(!1);return v(()=>{let a=s.current,l=i.current,g=e!==a,C=t!==l;g?(r(p=>p+1),u.current=!C):u.current&&C&&(r(p=>p+1),u.current=!1),s.current=e,i.current=t},[e,t]),`${e??"current"}-${o}`}n(Je,"usePopupContentKey");function zt(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Ce({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:D,inactiveTriggerProps:D,popupProps:D}}n(zt,"createInitialPopupStoreState");var k=n(e=>e.triggerIdProp??e.activeTriggerId,"activeTriggerIdSelector"),re=n(e=>e.openProp??e.open,"openSelector"),$e=n(e=>(e.popupElement?.id??e.floatingId)||void 0,"popupIdSelector");function He(e,t){return t!==void 0&&re(e)&&k(e)===t}n(He,"triggerOwnsOpenPopup");function ze(e,t){return He(e,t)?!0:t!==void 0&&re(e)&&k(e)==null&&e.triggerCount===1}n(ze,"triggerOwnsOpenPopupOrIsOnlyTrigger");var Qt={open:re,mounted:n(e=>e.mounted,"mounted"),transitionStatus:n(e=>e.transitionStatus,"transitionStatus"),floatingRootContext:n(e=>e.floatingRootContext,"floatingRootContext"),triggerCount:n(e=>e.triggerCount,"triggerCount"),preventUnmountingOnClose:n(e=>e.preventUnmountingOnClose,"preventUnmountingOnClose"),payload:n(e=>e.payload,"payload"),activeTriggerId:k,activeTriggerElement:n(e=>e.mounted?e.activeTriggerElement:null,"activeTriggerElement"),popupId:$e,isTriggerActive:n((e,t)=>t!==void 0&&k(e)===t,"isTriggerActive"),isOpenedByTrigger:n((e,t)=>He(e,t),"isOpenedByTrigger"),isMountedByTrigger:n((e,t)=>t!==void 0&&k(e)===t&&e.mounted,"isMountedByTrigger"),triggerProps:n((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,"triggerProps"),triggerPopupId:n((e,t)=>ze(e,t)?$e(e):void 0,"triggerPopupId"),popupProps:n(e=>e.popupProps,"popupProps"),popupElement:n(e=>e.popupElement,"popupElement"),positionerElement:n(e=>e.positionerElement,"positionerElement")};var _e=class extends ve{static{n(this,"NullStore")}setState(t){}update(t){}set(t,o){}notifyAll(){}};export{Te as a,zt as b,Qt as c,rt as d,_e as e,lt as f,Yt as g,Gt as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as D}from"./chunk-Q3WMP7OA.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as B}from"./chunk-5SKGLIO5.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as U}from"./chunk-XMOG3LIP.js";import{b as S}from"./chunk-K5BAERB3.js";import"./chunk-YUVGMKHG.js";import{a as q}from"./chunk-E5LR7G22.js";import"./chunk-F7EKRF7I.js";import{a as G,b as J,c as K,d as F,e as s,f as o}from"./chunk-TZ5PSNZW.js";import"./chunk-O7XG7DTU.js";import"./chunk-O24UFHUY.js";import"./chunk-4PI2OSSP.js";import{a as V}from"./chunk-2W4UO5BC.js";import{c as R}from"./chunk-5X6BEWUI.js";import{a as H,e as O}from"./chunk-PDBCAPP6.js";import"./chunk-JWQOB4EW.js";import"./chunk-ZPQBVYNN.js";import{B as W,w as P}from"./chunk-OOOT4H45.js";import"./chunk-PDBW6GTJ.js";import{a as ae}from"./chunk-GWNGVKLG.js";import{a as re,b as ie}from"./chunk-6G3E4PJ2.js";import{a as n,d as j}from"./chunk-5PEAXTYQ.js";var X=j(ae(),1),M=j(re(),1);var t=j(ie(),1);var ne=n(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","te"),Q=n(e=>e.endpoint??e.id,"M"),ve=n(()=>{let e=(0,X.c)(38),r=W(),[i,Y]=(0,M.useState)("all"),[l,Z]=(0,M.useState)(""),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let{data:I,error:d,errorSource:x,isLoading:_,refetch:v}=R(V.listPushSubscriptions,g),N;if(e[1]!==I?.subscriptions||e[2]!==d||e[3]!==x||e[4]!==_||e[5]!==i||e[6]!==v||e[7]!==l||e[8]!==r){let L=I?.subscriptions??[],T=l.trim().toLowerCase(),A=L.filter(a=>i!=="all"&&a.kind!==i?!1:T===""?!0:`${Q(a)} ${a.userId??""}`.toLowerCase().includes(T)),b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n(a=>{Z(a.target.value)},"w"),e[10]=b):b=e[10];let ee=b,w;e[11]!==v?(w=n(()=>{v()},"y"),e[11]=v,e[12]=w):w=e[12];let E=w,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=["all","web-push","fcm"],e[13]=k):k=e[13];let te=k,c;e[14]!==i||e[15]!==r?(c=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:te.map(a=>(0,t.jsx)(B,{"aria-selected":i===a,"data-testid":`nt-kind-${a}`,onClick:n(()=>{Y(a)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===a?"secondary":"ghost",children:a==="all"?r("All"):a},a))}),e[14]=i,e[15]=r,e[16]=c):c=e[16];let m;e[17]!==r?(m=r("Filter devices"),e[17]=r,e[18]=m):m=e[18];let h;e[19]!==r?(h=r("filter endpoint, user"),e[19]=r,e[20]=h):h=e[20];let u;e[21]!==l||e[22]!==m||e[23]!==h?(u=(0,t.jsx)(D,{"aria-label":m,className:"h-8 w-56","data-testid":"nt-search",onChange:ee,placeholder:h,value:l}),e[21]=l,e[22]=m,e[23]=h,e[24]=u):u=e[24];let f;e[25]!==r?(f=r("Refresh"),e[25]=r,e[26]=f):f=e[26];let p;e[27]!==E||e[28]!==f?(p=(0,t.jsx)(B,{className:"ml-auto","data-testid":"nt-refresh",onClick:E,size:"sm",type:"button",variant:"outline",children:f}),e[27]=E,e[28]=f,e[29]=p):p=e[29];let $=L.length>0&&(0,t.jsx)(S,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:L.length})}),y;e[30]!==p||e[31]!==$||e[32]!==c||e[33]!==u?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,u,p,$]}),e[30]=p,e[31]=$,e[32]=c,e[33]=u,e[34]=y):y=e[34];let C;e[35]!==d||e[36]!==x?(C=d!==null&&(0,t.jsx)(q,{error:x,testId:"nt-error"}),e[35]=d,e[36]=x,e[37]=C):C=e[37],N=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[y,C,d===null&&!_&&A.length===0&&(0,t.jsx)(U,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&(0,t.jsx)(H,{className:"overflow-hidden py-0",children:(0,t.jsx)(O,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"nt-table",children:[(0,t.jsx)(J,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(s,{children:r("kind")}),(0,t.jsx)(s,{children:r("endpoint")}),(0,t.jsx)(s,{children:r("user")}),(0,t.jsx)(s,{children:r("last seen")}),(0,t.jsx)(s,{children:r("status")}),(0,t.jsx)(s,{children:r("error")})]})}),(0,t.jsx)(K,{children:A.map(a=>{let z=Q(a);return(0,t.jsxs)(F,{"data-testid":"nt-row",children:[(0,t.jsx)(o,{children:(0,t.jsx)(S,{variant:"outline",children:a.kind})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs",title:z,children:z}),(0,t.jsx)(o,{className:"max-w-[16ch] truncate font-mono text-xs",children:a.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(o,{className:"text-muted-foreground tabular-nums",children:P(a.lastSeenAt,"\u2014")}),(0,t.jsx)(o,{children:(0,t.jsx)(S,{"data-testid":`nt-status-${a.id}`,variant:ne(a.lastStatus),children:a.lastStatus??r("n/a")})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:a.lastError??void 0,children:a.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},a.id)})})]})})})]}),e[1]=I?.subscriptions,e[2]=d,e[3]=x,e[4]=_,e[5]=i,e[6]=v,e[7]=l,e[8]=r,e[9]=N}else N=e[9];return N},"ge");export{ve as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as B}from"./chunk-J77YDVBD.js";import{a as j}from"./chunk-Q65X2ZIP.js";import"./chunk-DA2CAFXI.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import"./chunk-5SKGLIO5.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as I}from"./chunk-XMOG3LIP.js";import{b as w}from"./chunk-K5BAERB3.js";import"./chunk-YUVGMKHG.js";import{a as C}from"./chunk-E5LR7G22.js";import"./chunk-F7EKRF7I.js";import{a as A,b as D,c as P,d as b,e as l,f as n}from"./chunk-TZ5PSNZW.js";import"./chunk-O7XG7DTU.js";import"./chunk-O24UFHUY.js";import"./chunk-4PI2OSSP.js";import{a as u}from"./chunk-2W4UO5BC.js";import{c as p}from"./chunk-5X6BEWUI.js";import{a as v,e as S}from"./chunk-PDBCAPP6.js";import{e as R}from"./chunk-JWQOB4EW.js";import"./chunk-ZPQBVYNN.js";import{B as k,w as N}from"./chunk-OOOT4H45.js";import"./chunk-PDBW6GTJ.js";import"./chunk-GWNGVKLG.js";import{b as Q}from"./chunk-6G3E4PJ2.js";import{a as m,d as H}from"./chunk-5PEAXTYQ.js";var e=H(Q(),1);var _="payment_subscriptions",O="payment_events",V=[_,O],Y={},E=new Set(["active","trialing"]),z=new Set(["past_due","unpaid"]),s=m((a,t)=>{if(a[t]!==void 0)return a[t];let h=a.__doc__;return typeof h=="string"?R(h)?.[t]:void 0},"a"),o=m(a=>typeof a=="string"?a:typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"?String(a):"","s"),J=m(a=>E.has(a)?"default":z.has(a)?"destructive":"outline","q"),ie=m(({limit:a=100})=>{let t=k(),h=B(),{data:x}=p(u.listTables,Y,{live:!0}),F=x!==void 0,L=Array.isArray(x)&&V.every(r=>x.some(d=>d.name===r)),c=h.payments&&L,i=p(u.readTablePage,{filters:[],limit:a,offset:0,orderBy:{column:"updatedAt",direction:"desc"},search:"",table:_},{enabled:c}),f=p(u.readTablePage,{filters:[],limit:25,offset:0,orderBy:{column:"processedAt",direction:"desc"},search:"",table:O},{enabled:c}),g=p(u.facetColumn,{column:"state",table:_},{enabled:c});j(()=>{if(c)return Promise.all([i.poll(),f.poll(),g.poll()])},!0);let y=i.data?.rows??[],M=f.data?.rows??[],U=i.error??f.error,q=i.error===null?f.errorSource:i.errorSource,G=i.data?.total??y.length,T=g.data?.values===void 0?y.filter(r=>E.has(o(s(r,"state")))).length:g.data.values.reduce((r,d)=>r+(E.has(o(d.value))?d.count:0),0);return F&&!c?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:(0,e.jsx)(I,{description:t("No @lunora/payment tables found in this deployment. Add `.extend(paymentExtension)` to lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions."),testId:"payments-unconfigured",title:t("No payments configured")})}):(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsx)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxs)(v,{className:"justify-between gap-0 py-0",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Subscriptions")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T}),(0,e.jsx)(w,{variant:"default",children:t("{count} active",{count:T})})]})]}),(0,e.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:t("{total} total",{total:G})})]})}),U===null?void 0:(0,e.jsx)(C,{error:q}),y.length===0&&!i.isLoading?(0,e.jsx)(I,{testId:"payments-empty",title:t("No subscriptions yet")}):(0,e.jsx)(v,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(A,{children:[(0,e.jsx)(D,{children:(0,e.jsxs)(b,{children:[(0,e.jsx)(l,{children:t("Provider")}),(0,e.jsx)(l,{children:t("Reference")}),(0,e.jsx)(l,{children:t("Plan")}),(0,e.jsx)(l,{children:t("State")}),(0,e.jsx)(l,{children:t("Renews")})]})}),(0,e.jsx)(P,{children:y.map(r=>{let d=o(s(r,"state"));return(0,e.jsxs)(b,{"data-testid":"payment-subscription-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{children:o(s(r,"referenceId"))}),(0,e.jsx)(n,{children:o(s(r,"priceId"))}),(0,e.jsx)(n,{children:(0,e.jsx)(w,{variant:J(d),children:d})}),(0,e.jsx)(n,{children:N(s(r,"currentPeriodEnd"))})]},o(s(r,"providerSubscriptionId")))})})]})})}),(0,e.jsxs)(v,{className:"overflow-hidden py-0",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Recent webhook events")})}),(0,e.jsx)(S,{className:"px-0",children:(0,e.jsx)(A,{children:(0,e.jsx)(P,{children:M.map(r=>(0,e.jsxs)(b,{"data-testid":"payment-event-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{className:"font-medium",children:o(s(r,"type"))}),(0,e.jsx)(n,{className:"text-muted-foreground",children:o(s(r,"providerEventId"))}),(0,e.jsx)(n,{children:N(s(r,"processedAt"))})]},o(s(r,"providerEventId"))))})})})]})]})},"oe");export{ie as PaymentsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as g}from"./chunk-7N2OPADC.js";import"./chunk-E5LR7G22.js";import"./chunk-F7EKRF7I.js";import"./chunk-TZ5PSNZW.js";import"./chunk-O7XG7DTU.js";import"./chunk-O24UFHUY.js";import"./chunk-4PI2OSSP.js";import{a as m}from"./chunk-2W4UO5BC.js";import{c as p}from"./chunk-5X6BEWUI.js";import"./chunk-PDBCAPP6.js";import"./chunk-JWQOB4EW.js";import"./chunk-ZPQBVYNN.js";import{B as f}from"./chunk-OOOT4H45.js";import"./chunk-PDBW6GTJ.js";import{a as S}from"./chunk-GWNGVKLG.js";import{b as A}from"./chunk-6G3E4PJ2.js";import{a as r,d as h}from"./chunk-5PEAXTYQ.js";var R=h(S(),1);var k=h(A(),1);var _=r((e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("User subscriptions are ungated")})[s.kind],"k"),w=r(e=>Array.isArray(e.findings)?e.findings:[],"g"),b=r(e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],"S"),E=r((e,s)=>({"admin-token-weak":e("Your admin token is {length} characters \u2014 use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters \u2014 use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed \u2014 browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: anyone who can reach the worker can open a socket and run ordinary user subscriptions. Admin subscriptions are unaffected \u2014 they need the admin token. Set it if subscribers should present a shared credential.")})[s.kind],"A"),O=r(()=>{let e=(0,R.c)(8),s=f(),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let{data:a,error:d,errorSource:c}=p(m.getSecurityAudit,i),n;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:w(a);n=u===null?null:u.map(t=>({description:E(s,t),entity:b(t),issueType:_(s,t),key:t.kind,level:t.level})),e[1]=a,e[2]=s,e[3]=n}else n=e[3];let l=n,o;return e[4]!==d||e[5]!==c||e[6]!==l?(o=(0,k.jsx)(g,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"}),e[4]=d,e[5]=c,e[6]=l,e[7]=o):o=e[7],o},"T");export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-5SKGLIO5.js";import{B as d}from"./chunk-OOOT4H45.js";import{a as h,b as k}from"./chunk-6G3E4PJ2.js";import{a as e,d as r}from"./chunk-5PEAXTYQ.js";var l=r(h(),1);var t=r(k(),1);var g=e(({children:m,confirmLabel:c,disabled:a=!1,onConfirm:p,testId:i})=>{let o=d(),[f,n]=(0,l.useState)(!1),u=e(()=>{n(!0)},"f"),C=e(()=>{n(!1)},"l"),b=e(()=>{n(!1),p()},"p");return f?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(s,{"data-testid":`${i}-confirm`,disabled:a,onClick:b,size:"sm",type:"button",variant:"destructive",children:c??o("Confirm")}),(0,t.jsx)(s,{"data-testid":`${i}-cancel`,onClick:C,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(s,{"data-testid":i,disabled:a,onClick:u,size:"sm",type:"button",variant:"outline",children:m})},"k");export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Me}from"./chunk-O6W2YLME.js";import{a as ve}from"./chunk-YORPLSI5.js";import{b as ye,c as we}from"./chunk-ONTGYVAN.js";import{a as xe}from"./chunk-TDPAITW5.js";import{a as Ne}from"./chunk-GM7MBMYI.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import{a as be}from"./chunk-J45HAKBU.js";import{a as fe}from"./chunk-FHKZP25N.js";import{b as pe}from"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import{i as ue}from"./chunk-Q3WMP7OA.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as he}from"./chunk-XMOG3LIP.js";import{b as ce}from"./chunk-K5BAERB3.js";import"./chunk-YUVGMKHG.js";import{a as ge}from"./chunk-E5LR7G22.js";import"./chunk-F7EKRF7I.js";import"./chunk-O7XG7DTU.js";import"./chunk-O24UFHUY.js";import"./chunk-4PI2OSSP.js";import{a as ie}from"./chunk-2W4UO5BC.js";import{c as de}from"./chunk-5X6BEWUI.js";import"./chunk-JWQOB4EW.js";import"./chunk-ZPQBVYNN.js";import{B as U,p as me,w as oe,x as te}from"./chunk-OOOT4H45.js";import"./chunk-PDBW6GTJ.js";import{a as Le}from"./chunk-GWNGVKLG.js";import{a as Ce,b as Te}from"./chunk-6G3E4PJ2.js";import{a as m,d as le}from"./chunk-5PEAXTYQ.js";var O=le(Le(),1),A=le(Ce(),1);var s=le(Te(),1);var Pe=.5,Ie=4,Se=m(n=>Math.min(100,Math.max(0,n)),"ce"),Ke=m((n,e)=>{if(!Number.isFinite(e)||e<=0)return{leftPercent:0,widthPercent:100};let t=Se(n.offsetMs/e*100),a=n.durationMs/e*100,l=Math.max(Pe,Math.min(Se(a),100-t));return{leftPercent:t,widthPercent:l}},"Ce"),De=m((n,e,t=!1)=>{let a=e.trim().toLowerCase(),l=t?n.filter(r=>!r.ok):n;return a===""?[...l]:l.filter(r=>r.rootName.toLowerCase().includes(a)||r.functionPath.toLowerCase().includes(a)||r.traceId.toLowerCase().includes(a)||r.spans.some(o=>o.name.toLowerCase().includes(a)||o.spanId.toLowerCase().includes(a)))},"Ee"),G=m(n=>Number.isFinite(n)?n>0&&n<1?`${n.toFixed(2)}ms`:`${String(Math.round(n))}ms`:"\u2014","q"),Fe=m(n=>!Number.isFinite(n)||n<=0?[]:Array.from({length:Ie},(e,t)=>{let a=(t+1)/Ie;return{label:G(n*a),percent:a*100}}),"Pe"),ke=m(n=>{if(typeof n=="string")return n;try{return JSON.stringify(n,me)}catch{return String(n)}},"ue"),ee=m(n=>{let e=(0,O.c)(7),{label:t,value:a}=n,l;e[0]!==t?(l=(0,s.jsx)("dt",{className:"w-40 shrink-0 text-muted-foreground",children:t}),e[0]=t,e[1]=l):l=e[1];let r;e[2]!==a?(r=(0,s.jsx)("dd",{className:"min-w-0 break-all",children:a}),e[2]=a,e[3]=r):r=e[3];let o;return e[4]!==l||e[5]!==r?(o=(0,s.jsxs)("div",{className:"flex gap-2",children:[l,r]}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o},"Y"),je=m(n=>{let e=(0,O.c)(68),{span:t}=n,a=U(),l,r,o,d,i,u;if(e[0]!==t.attributes||e[1]!==t.durationMs||e[2]!==t.error||e[3]!==t.events||e[4]!==t.kind||e[5]!==t.offsetMs||e[6]!==t.parentSpanId||e[7]!==t.spanId||e[8]!==a){let $=Object.entries(t.attributes??{}),_;e[15]!==t.events?(_=t.events??[],e[15]=t.events,e[16]=_):_=e[16],l=_,r="border-t border-border bg-background/60 px-3 py-2 font-mono text-xs",o="tr-span-detail";let y;e[17]!==a?(y=a("Span ID"),e[17]=a,e[18]=y):y=e[18];let w;e[19]!==t.spanId||e[20]!==y?(w=(0,s.jsx)(ee,{label:y,value:t.spanId}),e[19]=t.spanId,e[20]=y,e[21]=w):w=e[21];let M;e[22]!==a?(M=a("Parent span ID"),e[22]=a,e[23]=M):M=e[23];let h;e[24]!==t.parentSpanId||e[25]!==a?(h=t.parentSpanId===""?a("\u2014 (trace root)"):t.parentSpanId,e[24]=t.parentSpanId,e[25]=a,e[26]=h):h=e[26];let p;e[27]!==h||e[28]!==M?(p=(0,s.jsx)(ee,{label:M,value:h}),e[27]=h,e[28]=M,e[29]=p):p=e[29];let b;e[30]!==a?(b=a("Kind"),e[30]=a,e[31]=b):b=e[31];let C=t.kind??"internal",S;e[32]!==b||e[33]!==C?(S=(0,s.jsx)(ee,{label:b,value:C}),e[32]=b,e[33]=C,e[34]=S):S=e[34];let I;e[35]!==a?(I=a("Started at"),e[35]=a,e[36]=I):I=e[36];let g;e[37]!==t.offsetMs||e[38]!==a?(g=a("+{offset}",{offset:G(t.offsetMs)}),e[37]=t.offsetMs,e[38]=a,e[39]=g):g=e[39];let x;e[40]!==I||e[41]!==g?(x=(0,s.jsx)(ee,{label:I,value:g}),e[40]=I,e[41]=g,e[42]=x):x=e[42];let k;e[43]!==a?(k=a("Duration"),e[43]=a,e[44]=k):k=e[44];let f;e[45]!==t.durationMs?(f=G(t.durationMs),e[45]=t.durationMs,e[46]=f):f=e[46];let N;e[47]!==k||e[48]!==f?(N=(0,s.jsx)(ee,{label:k,value:f}),e[47]=k,e[48]=f,e[49]=N):N=e[49],e[50]!==p||e[51]!==S||e[52]!==x||e[53]!==N||e[54]!==w?(d=(0,s.jsxs)("dl",{className:"flex flex-col gap-1",children:[w,p,S,x,N]}),e[50]=p,e[51]=S,e[52]=x,e[53]=N,e[54]=w,e[55]=d):d=e[55],e[56]!==t.error?(i=t.error!==void 0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1.5","data-testid":"tr-detail-error",children:[(0,s.jsx)("span",{className:"font-semibold text-destructive",children:t.error.type}),(0,s.jsx)("p",{className:"whitespace-pre-wrap break-all text-destructive",children:t.error.message})]}),e[56]=t.error,e[57]=i):i=e[57],u=$.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-attributes",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Attributes")}),(0,s.jsx)("dl",{className:"flex flex-col gap-1",children:$.map(Ee)})]}),e[0]=t.attributes,e[1]=t.durationMs,e[2]=t.error,e[3]=t.events,e[4]=t.kind,e[5]=t.offsetMs,e[6]=t.parentSpanId,e[7]=t.spanId,e[8]=a,e[9]=l,e[10]=r,e[11]=o,e[12]=d,e[13]=i,e[14]=u}else l=e[9],r=e[10],o=e[11],d=e[12],i=e[13],u=e[14];let c;e[58]!==l||e[59]!==a?(c=l.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-events",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Events")}),(0,s.jsx)("ul",{className:"flex flex-col gap-1",children:l.map(Oe)})]}),e[58]=l,e[59]=a,e[60]=c):c=e[60];let v;return e[61]!==r||e[62]!==o||e[63]!==d||e[64]!==i||e[65]!==u||e[66]!==c?(v=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,i,u,c]}),e[61]=r,e[62]=o,e[63]=d,e[64]=i,e[65]=u,e[66]=c,e[67]=v):v=e[67],v},"Ke");function Ee(n){let[e,t]=n;return(0,s.jsx)(ee,{label:e,value:ke(t)},e)}m(Ee,"Fe");function Ae(n){let[e,t]=n;return`${e}=${ke(t)}`}m(Ae,"Re");function Oe(n){return(0,s.jsxs)("li",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:oe(n.ts)}),(0,s.jsx)(ce,{variant:"secondary",children:n.name}),(0,s.jsx)("span",{className:"min-w-0 break-all text-muted-foreground",children:Object.entries(n.attributes??{}).map(Ae).join(" ")})]},`${n.name}:${String(n.ts)}`)}m(Oe,"Ae");var Be=14,_e="grid grid-cols-[14rem_1fr_4rem_16rem_16rem] items-center gap-2 px-3",We=m(n=>{let e=(0,O.c)(17),{traceDurationMs:t}=n,a,l,r,o,d,i;if(e[0]!==t){i=Symbol.for("react.early_return_sentinel");e:{let v=Fe(t);if(v.length===0){i=null;break e}e[7]===Symbol.for("react.memo_cache_sentinel")?(r=te(_e,"border-b border-border py-1 font-mono text-[10px] text-muted-foreground"),e[7]=r):r=e[7],o="tr-ruler",e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)("span",{}),e[8]=d):d=e[8],a="relative h-3",l=v.map(Je)}e[0]=t,e[1]=a,e[2]=l,e[3]=r,e[4]=o,e[5]=d,e[6]=i}else a=e[1],l=e[2],r=e[3],o=e[4],d=e[5],i=e[6];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;e[9]!==a||e[10]!==l?(u=(0,s.jsx)("span",{className:a,children:l}),e[9]=a,e[10]=l,e[11]=u):u=e[11];let c;return e[12]!==r||e[13]!==o||e[14]!==d||e[15]!==u?(c=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,u]}),e[12]=r,e[13]=o,e[14]=d,e[15]=u,e[16]=c):c=e[16],c},"je"),qe=m(n=>{let e=(0,O.c)(60),{span:t,traceDurationMs:a}=n,l=U(),[r,o]=(0,A.useState)(!1),d;e[0]!==t||e[1]!==a?(d=Ke(t,a),e[0]=t,e[1]=a,e[2]=d):d=e[2];let{leftPercent:i,widthPercent:u}=d,c;e[3]!==t.attributes?(c=ve(t.attributes),e[3]=t.attributes,e[4]=c):c=e[4];let v=c,$=t.depth*Be,_;e[5]!==$?(_={paddingLeft:$},e[5]=$,e[6]=_):_=e[6];let y=_,w=`${String(i)}%`,M=`${String(u)}%`,h;e[7]!==w||e[8]!==M?(h={left:w,width:M},e[7]=w,e[8]=M,e[9]=h):h=e[9];let p=h,b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=m(()=>{o(Ue)},"h"),e[10]=b):b=e[10];let C=b,S=t.depth,I=`tr-span-detail-${t.spanId}`,g;e[11]!==t.durationMs||e[12]!==t.error||e[13]!==t.name||e[14]!==t.offsetMs||e[15]!==l?(g=l("{name}, {duration}, starts {offset} in{failure}",{duration:G(t.durationMs),failure:t.error===void 0?"":l(", failed: {message}",{message:t.error.message}),name:t.name,offset:G(t.offsetMs)}),e[11]=t.durationMs,e[12]=t.error,e[13]=t.name,e[14]=t.offsetMs,e[15]=l,e[16]=g):g=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=te(_e,"w-full border-b border-border py-1.5 text-left font-mono text-xs hover:bg-muted/50"),e[17]=x):x=e[17];let k=`tr-span-toggle-${t.spanId}`,f;e[18]!==t.ok?(f=t.ok?null:(0,s.jsx)("span",{"aria-hidden":"true",className:"mr-1 text-destructive","data-testid":"tr-span-error",children:"\u25CF"}),e[18]=t.ok,e[19]=f):f=e[19];let N;e[20]!==y||e[21]!==t.name||e[22]!==f?(N=(0,s.jsxs)("span",{className:"truncate",style:y,title:t.name,children:[f,t.name]}),e[20]=y,e[21]=t.name,e[22]=f,e[23]=N):N=e[23];let B=t.ok?"bg-primary/70":"bg-destructive",L;e[24]!==B?(L=te("absolute inset-y-0 rounded-sm",B),e[24]=B,e[25]=L):L=e[25];let E;e[26]!==p||e[27]!==i||e[28]!==L||e[29]!==u?(E=(0,s.jsx)("span",{"aria-hidden":"true",className:"relative h-3 overflow-hidden rounded-sm bg-muted",children:(0,s.jsx)("span",{className:L,"data-left":i,"data-testid":"tr-span-bar","data-width":u,style:p})}),e[26]=p,e[27]=i,e[28]=L,e[29]=u,e[30]=E):E=e[30];let W;e[31]!==t.durationMs?(W=G(t.durationMs),e[31]=t.durationMs,e[32]=W):W=e[32];let D;e[33]!==W?(D=(0,s.jsx)("span",{className:"text-right tabular-nums text-muted-foreground",children:W}),e[33]=W,e[34]=D):D=e[34];let q;e[35]!==t.error?(q=t.error===void 0?null:(0,s.jsx)("span",{className:"text-destructive","data-testid":"tr-span-error-message",title:t.error.message,children:`${t.error.type}: ${t.error.message}`}),e[35]=t.error,e[36]=q):q=e[36];let T;e[37]!==q?(T=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:q}),e[37]=q,e[38]=T):T=e[38];let z;e[39]!==v?(z=v===""?null:(0,s.jsx)("span",{"data-testid":"tr-span-attributes",title:v,children:v}),e[39]=v,e[40]=z):z=e[40];let P;e[41]!==z?(P=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:z}),e[41]=z,e[42]=P):P=e[42];let J;e[43]!==r||e[44]!==I||e[45]!==g||e[46]!==k||e[47]!==N||e[48]!==E||e[49]!==D||e[50]!==T||e[51]!==P?(J=(0,s.jsxs)("button",{"aria-controls":I,"aria-expanded":r,"aria-label":g,className:x,"data-testid":k,onClick:C,type:"button",children:[N,E,D,T,P]}),e[43]=r,e[44]=I,e[45]=g,e[46]=k,e[47]=N,e[48]=E,e[49]=D,e[50]=T,e[51]=P,e[52]=J):J=e[52];let F;e[53]!==r||e[54]!==t?(F=r&&(0,s.jsx)("div",{id:`tr-span-detail-${t.spanId}`,children:(0,s.jsx)(je,{span:t})}),e[53]=r,e[54]=t,e[55]=F):F=e[55];let K;return e[56]!==t.depth||e[57]!==J||e[58]!==F?(K=(0,s.jsxs)("li",{"data-depth":S,"data-testid":"tr-span-row",children:[J,F]}),e[56]=t.depth,e[57]=J,e[58]=F,e[59]=K):K=e[59],K},"Be"),ze=m(n=>{let e=(0,O.c)(15),{durationMs:t,spans:a}=n,l=U(),r;e[0]!==t?(r=(0,s.jsx)(We,{traceDurationMs:t}),e[0]=t,e[1]=r):r=e[1];let o;e[2]!==l?(o=l("Trace waterfall"),e[2]=l,e[3]=o):o=e[3];let d;if(e[4]!==t||e[5]!==a){let c;e[7]!==t?(c=m(v=>(0,s.jsx)(qe,{span:v,traceDurationMs:t},v.spanId),"c"),e[7]=t,e[8]=c):c=e[8],d=a.map(c),e[4]=t,e[5]=a,e[6]=d}else d=e[6];let i;e[9]!==o||e[10]!==d?(i=(0,s.jsx)("ul",{"aria-label":o,children:d}),e[9]=o,e[10]=d,e[11]=i):i=e[11];let u;return e[12]!==r||e[13]!==i?(u=(0,s.jsxs)(s.Fragment,{children:[r,i]}),e[12]=r,e[13]=i,e[14]=u):u=e[14],u},"Oe");function Je(n){return(0,s.jsx)("span",{className:te("absolute inset-y-0 border-l border-border/70",n.percent===100?"-translate-x-full pr-1":"pl-1"),style:{left:`${String(n.percent)}%`},children:n.label},n.percent)}m(Je,"We");function Ue(n){return!n}m(Ue,"Ue");var Ge=m(n=>Array.isArray(n?.traces)?n.traces:[],"qe"),He=m(n=>{let e=(0,O.c)(12),{entries:t}=n,a=U(),l;e[0]!==t.length||e[1]!==a?(l=a("Logs ({count})",{count:t.length}),e[0]=t.length,e[1]=a,e[2]=l):l=e[2];let r;e[3]!==l?(r=(0,s.jsx)("p",{className:"mb-1 font-mono text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=r):r=e[4];let o;e[5]!==t?(o=t.map(Ve),e[5]=t,e[6]=o):o=e[6];let d;e[7]!==o?(d=(0,s.jsx)("div",{role:"grid",children:o}),e[7]=o,e[8]=d):d=e[8];let i;return e[9]!==r||e[10]!==d?(i=(0,s.jsxs)("div",{className:"border-t border-border px-3 py-2","data-testid":"tr-logs",children:[r,d]}),e[9]=r,e[10]=d,e[11]=i):i=e[11],i},"ze"),Qe=m(n=>{let e=(0,O.c)(50),{expanded:t,logs:a,onToggle:l,trace:r}=n,o=U(),d;e[0]!==l||e[1]!==r.traceId?(d=m(()=>{l(r.traceId)},"i"),e[0]=l,e[1]=r.traceId,e[2]=d):d=e[2];let i=d,u=`tr-row-${r.traceId}`,c=`tr-waterfall-${r.traceId}`,v=`tr-toggle-${r.traceId}`,$=t?"\u25BE":"\u25B8",_;e[3]!==$?(_=(0,s.jsx)("span",{"aria-hidden":"true",className:"w-3 shrink-0 text-xs text-muted-foreground",children:$}),e[3]=$,e[4]=_):_=e[4];let y;e[5]!==r.rootName?(y=(0,s.jsx)("span",{className:"w-56 shrink-0 truncate text-sm font-medium",title:r.rootName,children:r.rootName}),e[5]=r.rootName,e[6]=y):y=e[6];let w;e[7]!==r.functionPath?(w=(0,s.jsx)("span",{className:"w-48 shrink-0 truncate font-mono text-xs text-muted-foreground",title:r.functionPath,children:r.functionPath}),e[7]=r.functionPath,e[8]=w):w=e[8];let M;e[9]!==r.durationMs?(M=G(r.durationMs),e[9]=r.durationMs,e[10]=M):M=e[10];let h;e[11]!==M?(h=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:M}),e[11]=M,e[12]=h):h=e[12];let p;e[13]!==o||e[14]!==r.spans.length?(p=o("{count} spans",{count:r.spans.length}),e[13]=o,e[14]=r.spans.length,e[15]=p):p=e[15];let b;e[16]!==p?(b=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:p}),e[16]=p,e[17]=b):b=e[17];let C=r.ok?"secondary":"destructive",S;e[18]!==o||e[19]!==r.ok?(S=r.ok?o("ok"):o("error"),e[18]=o,e[19]=r.ok,e[20]=S):S=e[20];let I;e[21]!==C||e[22]!==S?(I=(0,s.jsx)("span",{className:"shrink-0",children:(0,s.jsx)(ce,{variant:C,children:S})}),e[21]=C,e[22]=S,e[23]=I):I=e[23];let g;e[24]!==r.startTs?(g=oe(r.startTs),e[24]=r.startTs,e[25]=g):g=e[25];let x;e[26]!==g?(x=(0,s.jsx)("span",{className:"flex-1 truncate text-right font-mono text-xs tabular-nums text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let k;e[28]!==t||e[29]!==i||e[30]!==h||e[31]!==b||e[32]!==I||e[33]!==x||e[34]!==c||e[35]!==v||e[36]!==_||e[37]!==y||e[38]!==w?(k=(0,s.jsxs)("button",{"aria-controls":c,"aria-expanded":t,className:"flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50","data-testid":v,onClick:i,type:"button",children:[_,y,w,h,b,I,x]}),e[28]=t,e[29]=i,e[30]=h,e[31]=b,e[32]=I,e[33]=x,e[34]=c,e[35]=v,e[36]=_,e[37]=y,e[38]=w,e[39]=k):k=e[39];let f;e[40]!==t||e[41]!==a||e[42]!==r.durationMs||e[43]!==r.spans||e[44]!==r.traceId?(f=t&&(0,s.jsxs)("div",{className:"bg-muted/20","data-testid":`tr-waterfall-${r.traceId}`,id:`tr-waterfall-${r.traceId}`,children:[(0,s.jsx)(ze,{durationMs:r.durationMs,spans:r.spans}),a.length>0&&(0,s.jsx)(He,{entries:a})]}),e[40]=t,e[41]=a,e[42]=r.durationMs,e[43]=r.spans,e[44]=r.traceId,e[45]=f):f=e[45];let N;return e[46]!==k||e[47]!==f||e[48]!==u?(N=(0,s.jsxs)("div",{className:"border-b border-border last:border-b-0","data-testid":u,children:[k,f]}),e[46]=k,e[47]=f,e[48]=u,e[49]=N):N=e[49],N},"Ge"),bt=m(n=>{let e=(0,O.c)(60),{initialShardKey:t}=n,a=U(),[l]=(0,A.useState)(ye),{queryShardKey:r,setShardKey:o,shardKey:d}=be(l?.shardKey!==void 0&&l.shardKey!==""?l.shardKey:t??""),[i,u]=(0,A.useState)(l?.traceId??""),[c,v]=(0,A.useState)(!1),[$,_]=(0,A.useState)(Xe),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0],(0,A.useEffect)(Ye,y);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={},e[1]=w):w=e[1];let M;e[2]!==r?(M={live:!0,shardKey:r},e[2]=r,e[3]=M):M=e[3];let{data:h,error:p,errorSource:b,isLoading:C,liveError:S}=de(ie.getTraces,w,M),I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I={},e[4]=I):I=e[4];let g=$.size>0,x;e[5]!==r||e[6]!==g?(x={enabled:g,live:!0,shardKey:r},e[5]=r,e[6]=g,e[7]=x):x=e[7];let{data:k}=de(ie.getLogs,I,x),f,N;e[8]!==h||e[9]!==r?(f=m(()=>{h!==void 0&&pe(r)},"p"),N=[h,r],e[8]=h,e[9]=r,e[10]=f,e[11]=N):(f=e[10],N=e[11]),(0,A.useEffect)(f,N);let B;if(e[12]!==h||e[13]!==p||e[14]!==b||e[15]!==$||e[16]!==C||e[17]!==S||e[18]!==k?.entries||e[19]!==c||e[20]!==r||e[21]!==i||e[22]!==o||e[23]!==d||e[24]!==a){let L=Ge(h),E=h?.total??L.length,W=E>L.length,D=De(L,i,c),q=Map.groupBy((k?.entries??[]).toReversed(),Ze),T;e[26]===Symbol.for("react.memo_cache_sentinel")?(T=m(j=>{u(j.target.value)},"C"),e[26]=T):T=e[26];let z=T,P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=m(j=>{_($e=>{let ne=new Set($e);return ne.has(j)?ne.delete(j):ne.add(j),ne})},"E"),e[27]=P):P=e[27];let J=P,F=p===null&&D.length===0&&!C,K;e[28]!==o||e[29]!==d?(K=(0,s.jsx)(fe,{onChange:o,testId:"tr-shard-input",value:d}),e[28]=o,e[29]=d,e[30]=K):K=e[30];let H;e[31]!==a?(H=a("Search traces"),e[31]=a,e[32]=H):H=e[32];let Q;e[33]!==a?(Q=a("search trace, span, or function"),e[33]=a,e[34]=Q):Q=e[34];let V;e[35]!==i||e[36]!==H||e[37]!==Q?(V=(0,s.jsx)(ue,{"aria-label":H,className:"h-8 w-56","data-testid":"tr-search",onChange:z,placeholder:Q,value:i}),e[35]=i,e[36]=H,e[37]=Q,e[38]=V):V=e[38];let X;e[39]!==c?(X=(0,s.jsx)(xe,{checked:c,"data-testid":"tr-only-errors",id:"tr-only-errors",onCheckedChange:v}),e[39]=c,e[40]=X):X=e[40];let Y;e[41]!==a?(Y=a("Errors only"),e[41]=a,e[42]=Y):Y=e[42];let Z;e[43]!==X||e[44]!==Y?(Z=(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",htmlFor:"tr-only-errors",children:[X,Y]}),e[43]=X,e[44]=Y,e[45]=Z):Z=e[45];let R;e[46]!==S?(R=(0,s.jsx)(Ne,{message:S,prefix:"tr"}),e[46]=S,e[47]=R):R=e[47];let re;e[48]!==K||e[49]!==V||e[50]!==Z||e[51]!==R?(re=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K,V,Z,R]}),e[48]=K,e[49]=V,e[50]=Z,e[51]=R,e[52]=re):re=e[52];let ae;e[53]!==p||e[54]!==b||e[55]!==r?(ae=p!==null&&(0,s.jsx)(ge,{error:b,shardKey:r,testId:"tr-error"}),e[53]=p,e[54]=b,e[55]=r,e[56]=ae):ae=e[56];let se;e[57]!==F||e[58]!==a?(se=F&&(0,s.jsx)(he,{description:a("Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates."),icon:(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M4 6h10M7 12h13M10 18h7"})}),testId:"tr-empty",title:a("No traces")}),e[57]=F,e[58]=a,e[59]=se):se=e[59],B=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-traces-panel",children:[re,ae,se,p===null&&W&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"tr-truncated",children:a("Showing the {shown} most recent of {total} traces in the buffer.",{shown:L.length,total:E})}),p===null&&D.length>0&&(0,s.jsx)("div",{"aria-label":a("Recent traces"),className:"overflow-hidden rounded-xl border border-border shadow-xs","data-testid":"tr-list",children:D.map(j=>(0,s.jsx)(Qe,{expanded:$.has(j.traceId),logs:q.get(j.traceId)??[],onToggle:J,trace:j},j.traceId))})]}),e[12]=h,e[13]=p,e[14]=b,e[15]=$,e[16]=C,e[17]=S,e[18]=k?.entries,e[19]=c,e[20]=r,e[21]=i,e[22]=o,e[23]=d,e[24]=a,e[25]=B}else B=e[25];return B},"bt");function Ve(n,e){return(0,s.jsx)("div",{className:"flex items-center border-b border-border py-1 font-mono text-xs last:border-b-0","data-testid":"tr-log-row",role:"row",children:(0,s.jsx)(Me,{entry:n})},`${String(e)}:${String(n.timestamp)}`)}m(Ve,"He");function Xe(){return new Set}m(Xe,"Je");function Ye(){we()}m(Ye,"Qe");function Ze(n){return n.traceId}m(Ze,"Ve");export{bt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},e={...i,position:"fixed",top:0,left:0},t={...i,position:"absolute"};export{e as a,t as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as L,d as W,e as $,f as q,h as D,i as F,j as H,k as A,l as S,m as I,n as J,o as M,p as P}from"./chunk-SGIBDCPB.js";import{a as O}from"./chunk-IHWSRI72.js";import{a as X,b as z,c as B,d as K,e as E,f as G}from"./chunk-TZ5PSNZW.js";import{B as C,r as j}from"./chunk-OOOT4H45.js";import{a as U}from"./chunk-GWNGVKLG.js";import{b as V}from"./chunk-6G3E4PJ2.js";import{a as f,d as T}from"./chunk-5PEAXTYQ.js";var N=T(U(),1);var t=T(V(),1);var _=50,R={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},Q=f(r=>{let a=r.columns.find(e=>r.rows.length>0&&r.rows.every(n=>typeof n[e]=="number"))??null;return{label:r.columns.find(e=>e!==a)??null,value:a}},"D"),Y=f(r=>{let a=(0,N.c)(3),{data:e,kind:n}=r,l;return a[0]!==e||a[1]!==n?(l=(0,t.jsx)(H,{className:"h-full w-full",config:R,children:n==="area"?(0,t.jsxs)(F,{data:e,children:[(0,t.jsx)(L,{vertical:!1}),(0,t.jsx)(q,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(S,{content:(0,t.jsx)(A,{})}),(0,t.jsx)($,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):(0,t.jsxs)(D,{data:e,children:[(0,t.jsx)(L,{vertical:!1}),(0,t.jsx)(q,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(S,{content:(0,t.jsx)(A,{})}),(0,t.jsx)(W,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),a[0]=e,a[1]=n,a[2]=l):l=a[2],l},"J"),na=f(r=>{let a=(0,N.c)(21),{axes:e,kind:n,result:l}=r,u=C(),o;a[0]!==l?(o=Q(l),a[0]=l,a[1]=o):o=a[1];let d=o,m;a[2]!==l.columns?(m=new Set(l.columns),a[2]=l.columns,a[3]=m):m=a[3];let s=m,c=e!==void 0&&s.has(e.x)?e.x:d.label,p;a[4]!==e?.y||a[5]!==s?(p=e?.y.find(i=>s.has(i)),a[4]=e?.y,a[5]=s,a[6]=p):p=a[6];let x=p,y=x??d.value,b;a[7]!==c||a[8]!==l.rows||a[9]!==y?(b=y===null?[]:l.rows.slice(0,_).map((i,w)=>({label:c===null?`#${(w+1).toString()}`:j(i[c]),value:Number(i[y])||0})),a[7]=c,a[8]=l.rows,a[9]=y,a[10]=b):b=a[10];let k=b;if(y===null){let i;a[11]!==u?(i=u("No numeric column to chart."),a[11]=u,a[12]=i):i=a[12];let w;return a[13]!==i?(w=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:i}),a[13]=i,a[14]=w):w=a[14],w}let h=n??(e!==void 0&&x!==void 0?e.kind:"bar"),v;a[15]!==k||a[16]!==h?(v=h==="bar"?(0,t.jsxs)(I,{className:"h-full w-full",config:R,data:k,children:[(0,t.jsx)(M,{dataKey:"label"}),(0,t.jsx)(J,{dataKey:"value"}),(0,t.jsx)(P,{})]}):(0,t.jsx)(Y,{data:k,kind:h}),a[15]=k,a[16]=h,a[17]=v):v=a[17];let g;return a[18]!==h||a[19]!==v?(g=(0,t.jsx)("div",{className:"h-80 w-full p-3","data-chart-kind":h,"data-testid":"sql-chart",children:v}),a[18]=h,a[19]=v,a[20]=g):g=a[20],g},"oe"),oa=f(r=>{let a=(0,N.c)(19),{result:e}=r,n=C();if(e.columns.length===0){let s;a[0]!==e.rowCount||a[1]!==n?(s=n("{count} rows",{count:e.rowCount}),a[0]=e.rowCount,a[1]=n,a[2]=s):s=a[2];let c;return a[3]!==s?(c=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:s}),a[3]=s,a[4]=c):c=a[4],c}let l;a[5]!==e.columns?(l=e.columns.map(Z),a[5]=e.columns,a[6]=l):l=a[6];let u;a[7]!==l?(u=(0,t.jsx)(z,{className:"sticky top-0 z-10 bg-muted",children:(0,t.jsx)(K,{children:l})}),a[7]=l,a[8]=u):u=a[8];let o;if(a[9]!==e.columns||a[10]!==e.rows){let s;a[12]!==e.columns?(s=f((c,p)=>(0,t.jsx)(K,{"data-testid":"sql-row",children:e.columns.map(x=>(0,t.jsx)(G,{className:"max-w-md truncate font-mono text-xs",children:(0,t.jsx)(O,{value:c[x]})},x))},p),"s"),a[12]=e.columns,a[13]=s):s=a[13],o=e.rows.map(s),a[9]=e.columns,a[10]=e.rows,a[11]=o}else o=a[11];let d;a[14]!==o?(d=(0,t.jsx)(B,{children:o}),a[14]=o,a[15]=d):d=a[15];let m;return a[16]!==u||a[17]!==d?(m=(0,t.jsxs)(X,{"data-testid":"sql-rows",children:[u,d]}),a[16]=u,a[17]=d,a[18]=m):m=a[18],m},"ne");function Z(r){return(0,t.jsx)(E,{children:r},r)}f(Z,"P");export{na as a,oa as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as ie}from"./chunk-P6VNMPWR.js";import{a as ae,b as re,c as se}from"./chunk-GXTSE66Z.js";import"./chunk-ZSWW2UGP.js";import{b as Y}from"./chunk-K5BAERB3.js";import"./chunk-YUVGMKHG.js";import{a as ne}from"./chunk-E5LR7G22.js";import"./chunk-F7EKRF7I.js";import{a as le,b as oe,c as de,d as Z,e as G,f as H}from"./chunk-TZ5PSNZW.js";import"./chunk-O7XG7DTU.js";import"./chunk-O24UFHUY.js";import"./chunk-4PI2OSSP.js";import{a as W}from"./chunk-2W4UO5BC.js";import{c as Q}from"./chunk-5X6BEWUI.js";import{a as q,e as B}from"./chunk-PDBCAPP6.js";import"./chunk-JWQOB4EW.js";import"./chunk-ZPQBVYNN.js";import{B as X}from"./chunk-OOOT4H45.js";import"./chunk-PDBW6GTJ.js";import{a as pe}from"./chunk-GWNGVKLG.js";import{b as ue}from"./chunk-6G3E4PJ2.js";import{a as _,d as te}from"./chunk-5PEAXTYQ.js";var J=te(pe(),1);var a=te(ue(),1);var ce=["disabled","schema","schema_and_log","schema_and_log_and_data"],he={describeTables:"schema",readAdvisors:"schema",readLogs:"schema_and_log",readPolicies:"schema",runSql:"schema_and_log_and_data"},xe={binding:"outline",secret:"destructive",var:"secondary"},fe=_((t,e)=>{if(t===void 0)return[];let m=[];return t.workerUrl!==void 0&&m.push({label:e("URL"),value:t.workerUrl}),t.environment!==void 0&&m.push({label:e("Environment"),value:t.environment}),t.deploymentId!==void 0&&m.push({label:e("Deployment"),value:t.deploymentId}),t.versionTag!==void 0&&m.push({label:e("Version"),value:t.versionTag}),m},"ue"),ge={disabled:"The assistant is off. Nothing about this deployment is sent to a model.",schema:"Table and column names.",schema_and_log:"Table and column names, plus recent log lines.",schema_and_log_and_data:"Table and column names, log lines, and rows read with SELECT."},be=_(t=>{let e=[];for(let[m,r]of Object.entries(he))r===t&&e.push(m);return e},"pe"),ye=_(()=>{let t=(0,J.c)(29),e=X(),m,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(m={},r={shardKey:""},t[0]=m,t[1]=r):(m=t[0],r=t[1]);let{data:g}=Q(W.aiAvailable,m,r),p=g?.level,f;t[2]!==p?(f=p===void 0?-1:ce.indexOf(p),t[2]=p,t[3]=f):f=t[3];let x=f,i;t[4]!==e?(i=e("AI assistant data sharing"),t[4]=e,t[5]=i):i=t[5];let c;t[6]!==i?(c=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),t[6]=i,t[7]=c):c=t[7];let u;t[8]!==p?(u=p!==void 0&&(0,a.jsx)(Y,{"data-testid":"set-ai-level",variant:p==="disabled"?"outline":"secondary",children:p}),t[8]=p,t[9]=u):u=t[9];let n;t[10]!==c||t[11]!==u?(n=(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[c,u]}),t[10]=c,t[11]=u,t[12]=n):n=t[12];let h;t[13]!==x||t[14]!==p||t[15]!==e?(h=ce.map((y,w)=>{let N=x>=w,v=be(y);return(0,a.jsxs)("li",{className:N?"flex flex-col gap-0.5":"flex flex-col gap-0.5 opacity-50","data-granted":String(N),"data-testid":`set-ai-tier-${y}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:y}),y===p&&(0,a.jsx)("span",{className:"text-[11px] text-primary",children:e("current")})]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e(ge[y])}),v.length>0&&(0,a.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:v.join(", ")})]},y)}),t[13]=x,t[14]=p,t[15]=e,t[16]=h):h=t[16];let o;t[17]!==h?(o=(0,a.jsx)("ul",{className:"flex flex-col gap-1.5 text-sm",children:h}),t[17]=h,t[18]=o):o=t[18];let s;t[19]!==e?(s=e("Set LUNORA_AI_OPT_IN in wrangler.jsonc and redeploy to change this. The Studio can read this level but never raise it."),t[19]=e,t[20]=s):s=t[20];let d;t[21]!==s?(d=(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"set-ai-howto",children:s}),t[21]=s,t[22]=d):d=t[22];let l;t[23]!==d||t[24]!==o?(l=(0,a.jsxs)(B,{className:"flex flex-col gap-3 py-3",children:[o,d]}),t[23]=d,t[24]=o,t[25]=l):l=t[25];let b;return t[26]!==l||t[27]!==n?(b=(0,a.jsxs)(q,{className:"py-0","data-testid":"set-ai-sharing",children:[n,l]}),t[26]=l,t[27]=n,t[28]=b):b=t[28],b},"xe"),me=_(t=>{let e=(0,J.c)(18),{modifier:m,name:r,label:g}=t,p=ae(),f;e[0]!==r?(f=_(l=>{if(!["Escape","Tab"].includes(l.key)){if(l.shiftKey){l.preventDefault();return}l.preventDefault(),re(r,l.key)}},"g"),e[0]=r,e[1]=f):f=e[1];let x=f,i=`set-shortcut-${r}`,c;e[2]!==g?(c=(0,a.jsx)("dt",{className:"text-muted-foreground",children:g}),e[2]=g,e[3]=c):c=e[3];let u;e[4]!==m?(u=(0,a.jsx)("kbd",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:m}),e[4]=m,e[5]=u):u=e[5];let n=`set-shortcut-input-${r}`,h=p[r],o;e[6]!==g||e[7]!==x||e[8]!==n||e[9]!==h?(o=(0,a.jsx)("input",{"aria-label":g,className:"h-7 w-12 rounded-md border border-border bg-background text-center font-mono text-xs uppercase outline-none focus-visible:border-ring","data-testid":n,onKeyDown:x,readOnly:!0,value:h}),e[6]=g,e[7]=x,e[8]=n,e[9]=h,e[10]=o):o=e[10];let s;e[11]!==u||e[12]!==o?(s=(0,a.jsxs)("dd",{className:"flex items-center gap-1.5",children:[u,o]}),e[11]=u,e[12]=o,e[13]=s):s=e[13];let d;return e[14]!==i||e[15]!==c||e[16]!==s?(d=(0,a.jsxs)("div",{className:"contents","data-testid":i,children:[c,s]}),e[14]=i,e[15]=c,e[16]=s,e[17]=d):d=e[17],d},"J"),Ee=_(t=>{let e=(0,J.c)(86),{initialShardKey:m}=t,r=X(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let p=m??"",f;e[1]!==p?(f={shardKey:p},e[1]=p,e[2]=f):f=e[2];let{data:x,error:i,errorSource:c,isLoading:u}=Q(W.getSettings,g,f),n,h,o,s,d,l,b;if(e[3]!==i||e[4]!==c||e[5]!==x?.deploy||e[6]!==x?.settings||e[7]!==r){let ee=fe(x?.deploy,r),z;e[15]!==x?.settings?(z=x?.settings??[],e[15]=x?.settings,e[16]=z):z=e[16],n=z,h="flex flex-col gap-4",o="lunora-settings";let F;e[17]!==r?(F=r("Open in Cloudflare"),e[17]=r,e[18]=F):F=e[18],e[19]!==F?(s=(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,a.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:ie,rel:"noreferrer",target:"_blank",children:F})}),e[19]=F,e[20]=s):s=e[20];let V;e[21]!==r?(V=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=V):V=e[22],e[23]!==V?(d=(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:V}),e[23]=V,e[24]=d):d=e[24],e[25]!==i||e[26]!==c?(l=i!==null&&(0,a.jsx)(ne,{error:c,testId:"set-error"}),e[25]=i,e[26]=c,e[27]=l):l=e[27],b=ee.length>0&&(0,a.jsxs)(q,{className:"py-0","data-testid":"set-deploy",children:[(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,a.jsx)(B,{className:"py-3",children:(0,a.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:ee.map(Ne)})})]}),e[3]=i,e[4]=c,e[5]=x?.deploy,e[6]=x?.settings,e[7]=r,e[8]=n,e[9]=h,e[10]=o,e[11]=s,e[12]=d,e[13]=l,e[14]=b}else n=e[8],h=e[9],o=e[10],s=e[11],d=e[12],l=e[13],b=e[14];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=(0,a.jsx)(ye,{}),e[28]=y):y=e[28];let w;e[29]!==r?(w=r("Keyboard shortcuts"),e[29]=r,e[30]=w):w=e[30];let N;e[31]!==w?(N=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:w}),e[31]=w,e[32]=N):N=e[32];let v;e[33]!==r?(v=r("Reset"),e[33]=r,e[34]=v):v=e[34];let k;e[35]!==v?(k=(0,a.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"set-shortcut-reset",onClick:se,type:"button",children:v}),e[35]=v,e[36]=k):k=e[36];let T;e[37]!==N||e[38]!==k?(T=(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[N,k]}),e[37]=N,e[38]=k,e[39]=T):T=e[39];let S;e[40]!==r?(S=r("Command palette"),e[40]=r,e[41]=S):S=e[41];let C;e[42]!==S?(C=(0,a.jsx)(me,{label:S,modifier:"\u2318/Ctrl",name:"palette"}),e[42]=S,e[43]=C):C=e[43];let I;e[44]!==r?(I=r("Operation console"),e[44]=r,e[45]=I):I=e[45];let O;e[46]!==I?(O=(0,a.jsx)(me,{label:I,modifier:"Ctrl",name:"console"}),e[46]=I,e[47]=O):O=e[47];let j;e[48]!==C||e[49]!==O?(j=(0,a.jsxs)("dl",{className:"grid grid-cols-[10rem_minmax(0,1fr)] items-center gap-x-4 gap-y-2 text-sm",children:[C,O]}),e[48]=C,e[49]=O,e[50]=j):j=e[50];let E;e[51]!==r?(E=r("Stored in this browser. Focus a box and press a key to rebind it."),e[51]=r,e[52]=E):E=e[52];let A;e[53]!==E?(A=(0,a.jsx)("p",{className:"pt-3 text-xs text-muted-foreground",children:E}),e[53]=E,e[54]=A):A=e[54];let D;e[55]!==j||e[56]!==A?(D=(0,a.jsxs)(B,{className:"py-3",children:[j,A]}),e[55]=j,e[56]=A,e[57]=D):D=e[57];let K;e[58]!==T||e[59]!==D?(K=(0,a.jsxs)(q,{className:"py-0","data-testid":"set-preferences",children:[T,D]}),e[58]=T,e[59]=D,e[60]=K):K=e[60];let L;e[61]!==r?(L=r("Environment & bindings"),e[61]=r,e[62]=L):L=e[62];let U;e[63]!==L?(U=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:L})}),e[63]=L,e[64]=U):U=e[64];let P;e[65]!==i||e[66]!==u||e[67]!==n.length||e[68]!==r?(P=i===null&&!u&&n.length===0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[65]=i,e[66]=u,e[67]=n.length,e[68]=r,e[69]=P):P=e[69];let R;e[70]!==n||e[71]!==r?(R=n.length>0&&(0,a.jsx)(B,{className:"px-0 py-0",children:(0,a.jsxs)(le,{"data-testid":"set-table",children:[(0,a.jsx)(oe,{children:(0,a.jsxs)(Z,{children:[(0,a.jsx)(G,{children:r("name")}),(0,a.jsx)(G,{children:r("kind")}),(0,a.jsx)(G,{children:r("value")})]})}),(0,a.jsx)(de,{children:n.map(ve)})]})}),e[70]=n,e[71]=r,e[72]=R):R=e[72];let $;e[73]!==U||e[74]!==P||e[75]!==R?($=(0,a.jsxs)(q,{className:"py-0",children:[U,P,R]}),e[73]=U,e[74]=P,e[75]=R,e[76]=$):$=e[76];let M;return e[77]!==K||e[78]!==$||e[79]!==h||e[80]!==o||e[81]!==s||e[82]!==d||e[83]!==l||e[84]!==b?(M=(0,a.jsxs)("div",{className:h,"data-testid":o,children:[s,d,l,b,y,K,$]}),e[77]=K,e[78]=$,e[79]=h,e[80]=o,e[81]=s,e[82]=d,e[83]=l,e[84]=b,e[85]=M):M=e[85],M},"Le");function Ne(t){return(0,a.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,a.jsx)("dt",{className:"text-muted-foreground",children:t.label}),(0,a.jsx)("dd",{className:"truncate font-mono text-xs",title:t.value,children:t.value})]},t.label)}_(Ne,"ge");function ve(t){return(0,a.jsxs)(Z,{"data-testid":"set-row",children:[(0,a.jsx)(H,{className:"font-mono text-xs font-medium",children:t.name}),(0,a.jsx)(H,{children:(0,a.jsx)(Y,{variant:xe[t.kind],children:t.bindingType??t.kind})}),(0,a.jsx)(H,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:t.value??(0,a.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},t.name)}_(ve,"be");export{Ee as SettingsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ut,b as he,c as Xe,d as Ke,e as pt,f as cr}from"./chunk-O3AZ7JKE.js";import{a as sr,b as ir,c as lr,d as ar}from"./chunk-VNH4OBJS.js";import{B as Do,C as _o,E as Uo,F as ko,G as Fo,J as Ho,X as Bo,a as Eo,aa as jo,ba as zo,e as wo,ea as Wo,fa as Go,la as Yo,ma as $o,na as Xo,o as Pt,oa as Ko,qa as Jo,r as Oo,ra as Zo,sa as Qo,ta as er,u as Lo}from"./chunk-XLYFGUEF.js";import{a as Po,b as qo}from"./chunk-D65UVZIA.js";import{a as Mo,b as Vo}from"./chunk-NGVP66OH.js";import{a as tr,b as or,i as rr,j as nr,k as ct}from"./chunk-QAOZXPLU.js";import{a as Ct,b as qe,c as So,d as ho,e as At,f as Co,h as No}from"./chunk-Q3WMP7OA.js";import{A as Io,D as Ye,F as Ao,I as Ve,J as $e,K as $t,L as To,M as oe,N as ce,b as xo,c as Ro,e as Nt,l as Me,n as Yt,o as bo,p as yo,q as Tt,r as vo}from"./chunk-HFBSWKJS.js";import{c as Et}from"./chunk-JMZT3CEW.js";import{b as It,u as ve,v as te,w as lt}from"./chunk-VUOEJJUH.js";import{a as mo,b as it,d as Ie,e as go,g as at,h as qt,i as wt,j as w}from"./chunk-YUVGMKHG.js";import{x as He}from"./chunk-OOOT4H45.js";import{a as Rn}from"./chunk-GWNGVKLG.js";import{a as O,b as xe}from"./chunk-6G3E4PJ2.js";import{a as o,c as hn,d as b}from"./chunk-5PEAXTYQ.js";var St=b(Rn(),1);var re={};hn(re,{Arrow:()=>Jr,Backdrop:()=>Ur,Group:()=>an,GroupLabel:()=>un,Icon:()=>Vr,Item:()=>qr,ItemIndicator:()=>$r,ItemText:()=>Xr,Label:()=>Cr,List:()=>Wr,Popup:()=>jr,Portal:()=>Dr,Positioner:()=>kr,Root:()=>vr,ScrollDownArrow:()=>tn,ScrollUpArrow:()=>nn,Separator:()=>dn,Trigger:()=>Nr,Value:()=>Pr});var U=b(O(),1);var ur=b(O(),1);function pr(e){let t=ur.useRef(!0);t.current&&(t.current=!1,e())}o(pr,"useOnFirstRender");var Oe=b(O(),1);var Xt=Oe.createContext(void 0),Kt=Oe.createContext(void 0),Jt=Oe.createContext(void 0);function L(){let e=Oe.useContext(Xt);if(e===void 0)throw new Error(Ie(60));return e}o(L,"useSelectRootContext");function Le(){let e=Oe.useContext(Kt);if(e===void 0)throw new Error(Ie(101));return e}o(Le,"useSelectRootPropsContext");function Mt(){let e=Oe.useContext(Jt);if(e===void 0)throw new Error(Ie(61));return e}o(Mt,"useSelectFloatingContext");function fr(e,t,r=Object.is){let{length:n}=e;if(n!==t.length)return!1;for(let s=0;s<n;s+=1)if(!r(e[s],t[s]))return!1;return!0}o(fr,"areArraysEqual");var Qt=o((e,t)=>Object.is(e,t),"defaultItemEquality");function Ce(e,t,r){return e==null||t==null?Object.is(e,t):r(e,t)}o(Ce,"compareItemEquality");function dr(e,t,r){return Array.isArray(e)&&Array.isArray(t)?!fr(e,t,(n,s)=>Ce(n,s,r)):e!==t}o(dr,"isSelectedValueDirty");function Zt(e,t,r){return e?e.some(n=>n===void 0?!1:Ce(t,n,r)):!1}o(Zt,"selectedValueIncludes");function ft(e,t,r){return e?e.findIndex(n=>n===void 0?!1:Ce(n,t,r)):-1}o(ft,"findItemIndex");function bn(e,t){if(t!==Qt)return n=>Zt(e,n,t);let r=new Set(e);return r.delete(void 0),n=>r.has(n)&&(n!==0||e.some(s=>Object.is(n,s)))}o(bn,"createSelectionMatcher");function eo(e,t,r,n){let s=n&&Array.isArray(t)?e.findIndex(bn(t,r)):ft(e,t,r);return s===-1?null:s}o(eo,"findSelectionIndex");function mr(e,t,r,n,s,a){return Zt(n,t,s)?a!=null&&e>a&&Zt(n,r[a],s)?a:e:e===a?eo(r,n,s,!0):a}o(mr,"resolveSelectedIndex");function gr(e,t,r){return e.filter(n=>!Ce(t,n,r))}o(gr,"removeItem");var Sr=b(O(),1);function Vt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}o(Vt,"serializeValue");var xr=b(xe(),1);function yn(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}o(yn,"isGroup");function hr(e){return yn(e?.[0])}o(hr,"isGroupedItems");function vn(e){return hr(e)?e.flatMap(t=>t.items):e}o(vn,"flattenLeafItems");function Rr(e){if(!Array.isArray(e))return e!=null&&"null"in e;let t=e;if(hr(t)){for(let r of t)for(let n of r.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(let r of t)if(r&&r.value==null&&r.label!=null)return!0;return!1}o(Rr,"hasNullItemLabel");function to(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Vt(e)}o(to,"stringifyAsLabel");function De(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Vt(e.value):Vt(e)}o(De,"stringifyAsValue");function oo(e,t,r){function n(){return to(e,r)}if(o(n,"fallback"),r&&e!=null)return r(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??n();if(Array.isArray(t)){let a=vn(t);if(e==null||typeof e!="object"){let i=a.find(u=>u.value===e);return i&&i.label!=null?i.label:n()}if("value"in e){let i=a.find(u=>u&&u.value===e.value);if(i&&i.label!=null)return i.label}}return n()}o(oo,"resolveSelectedLabel");function br(e,t,r){return e.reduce((n,s,a)=>(a>0&&n.push(", "),n.push((0,xr.jsx)(Sr.Fragment,{children:oo(s,t,r)},a)),n),[])}o(br,"resolveMultipleLabels");var yr={id:o(e=>e.id,"id"),labelId:o(e=>e.labelId,"labelId"),modal:o(e=>e.modal,"modal"),items:o(e=>e.items,"items"),itemToStringLabel:o(e=>e.itemToStringLabel,"itemToStringLabel"),isItemEqualToValue:o(e=>e.isItemEqualToValue,"isItemEqualToValue"),value:o(e=>e.value,"value"),hasSelectedValue:o(e=>{let{value:t,multiple:r,itemToStringValue:n}=e;return t==null?!1:r&&Array.isArray(t)?t.length>0:De(t,n)!==""},"hasSelectedValue"),hasNullItemLabel:o((e,t)=>t?Rr(e.items):!1,"hasNullItemLabel"),open:o(e=>e.open,"open"),mounted:o(e=>e.mounted,"mounted"),forceMount:o(e=>e.forceMount,"forceMount"),transitionStatus:o(e=>e.transitionStatus,"transitionStatus"),openMethod:o(e=>e.openMethod,"openMethod"),activeIndex:o(e=>e.activeIndex,"activeIndex"),selectedIndex:o(e=>e.selectedIndex,"selectedIndex"),isActive:o((e,t)=>e.activeIndex===t,"isActive"),isSelected:o((e,t)=>{let r=e.isItemEqualToValue,n=e.value;return e.multiple?Array.isArray(n)&&n.some(s=>Ce(t,s,r)):Ce(t,n,r)},"isSelected"),isSelectedByFocus:o((e,t)=>e.selectedIndex===t,"isSelectedByFocus"),popupProps:o(e=>e.popupProps,"popupProps"),triggerProps:o(e=>e.triggerProps,"triggerProps"),triggerElement:o(e=>e.triggerElement,"triggerElement"),positionerElement:o(e=>e.positionerElement,"positionerElement"),listElement:o(e=>e.listElement,"listElement"),popupSide:o(e=>e.popupSide,"popupSide"),scrollUpArrowVisible:o(e=>e.scrollUpArrowVisible,"scrollUpArrowVisible"),scrollDownArrowVisible:o(e=>e.scrollDownArrowVisible,"scrollDownArrowVisible"),hasScrollArrows:o(e=>e.hasScrollArrows,"hasScrollArrows")};var Be=b(xe(),1);function vr(e){let{id:t,value:r,defaultValue:n=null,onValueChange:s,open:a,defaultOpen:i=!1,onOpenChange:u,name:l,form:m,autoComplete:p,disabled:h=!1,readOnly:y=!1,required:d=!1,modal:N=!0,actionsRef:v,inputRef:H,onOpenChangeComplete:S,items:j,multiple:I=!1,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M=Qt,highlightItemOnHover:T=!0,children:k}=e,{clearErrors:Q}=So(),{setDirty:$,setTouched:W,setFocused:X,validityData:c,setFilled:z,name:q,disabled:ie,validation:G,validationMode:le}=qe(),F=At({id:t}),f=ie||h,E=q??l,[R,x]=$t({controlled:r,default:I?n??qt:n,name:"Select",state:"value"}),[P,K]=$t({controlled:a,default:i,name:"Select",state:"open"}),ne=U.useRef([]),J=U.useRef([]),ue=U.useRef(null),Se=U.useRef(null),ee=U.useRef(0),pe=U.useRef(null),V=U.useRef([]),D=U.useRef(!1),ae=U.useRef(null),Z=U.useRef(null),Ue=U.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ae=U.useRef(!1),Ne=U.useRef(R),{mounted:fe,setMounted:ke,transitionStatus:Te}=$e(P),{openMethod:se,triggerProps:xt}=Wo(P),_=mo(()=>new Fo({id:F,labelId:void 0,modal:N,multiple:I,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M,value:R,open:P,mounted:fe,transitionStatus:Te,items:j,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:wt,triggerProps:wt,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:at,setOpen:at,handleScrollArrowVisibility:at,onOpenChangeComplete:at,listRef:ne,popupRef:ue,scrollHandlerRef:Se,scrollArrowsMountedCountRef:ee,valueRef:pe,valuesRef:V,labelsRef:J,typingRef:D,selectionRef:Ue,firstItemTextRef:ae,selectedItemTextRef:Z,alignItemWithTriggerActiveRef:Ae,initialValueRef:Ne},yr)).current,be=_.useState("activeIndex"),ht=_.useState("selectedIndex"),Rt=_.useState("triggerElement"),ye=_.useState("positionerElement"),bt=er(se),yt=se??bt,ze=U.useMemo(()=>I?"":De(R,C),[I,R,C]),Ee=U.useMemo(()=>I&&Array.isArray(R)?R.map(A=>De(A,C)):De(R,C),[I,R,C]),Bt=Pt(Rt),tt=ve(()=>Ee);No(Bt,F,R,tt,!f,l);let ot=I?Array.isArray(R)&&R.length>0:R!=null&&ze!=="";te(()=>{z(ot)},[ot,z]),te(o(function(){let Y=eo(V.current,R,M,I);Y===null&&(Z.current=null),!P&&_.set("selectedIndex",Y)},"syncSelectedIndex"),[I,P,R,M,_]),To(R,()=>{Q(E),$(dr(R,c.initialValue,M)),G.change(R)});let rt=ve((A,Y)=>{u?.(A,Y),!Y.isCanceled&&(K(A),!A&&(Y.reason===oe.focusOut||Y.reason===oe.outsidePress)&&(W(!0),X(!1),le==="onBlur"&&G.commit(R)))}),We=ve(()=>{ke(!1),_.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),S?.(!1)});Ve({enabled:!v,open:P,ref:ue,onComplete(){P||We()}}),U.useImperativeHandle(v,()=>({unmount:We}),[We]);let nt=ve((A,Y)=>{s?.(A,Y),!Y.isCanceled&&x(A)}),jt=ve(A=>{let Y=Xe(A.scrollHeight,A.clientHeight),vt=Ke(A.scrollTop,Y),zt=vt>0,st=vt<Y;_.set("scrollUpArrowVisible",zt),_.set("scrollDownArrowVisible",st)}),Fe=Bo({open:P,onOpenChange:rt,elements:{reference:Rt,floating:ye}}),de=_o(Fe,{enabled:!f,event:"mousedown"}),we=Uo(Fe),Pe=jo(Fe,{enabled:!f,listRef:ne,activeIndex:be,selectedIndex:ht,disabledIndices:qt,onNavigate(A){A===null&&!P||_.set("activeIndex",A)},focusItemOnHover:T}),Ge=zo(Fe,{enabled:!f&&(P||!y&&!I),listRef:J,activeIndex:be,selectedIndex:ht,disabledIndices:o(A=>ar(ne.current[A]),"disabledIndices"),onMatch(A){P?_.set("activeIndex",A):nt(V.current[A],ce(oe.none))},onTyping(A){D.current=A}}),lo=U.useMemo(()=>it(Ge.reference,Pe.reference,we.reference,de.reference,xt),[de.reference,Ge.reference,Pe.reference,we.reference,xt]),ao=U.useMemo(()=>it(Ho,Ge.floating,Pe.floating,we.floating),[Ge.floating,Pe.floating,we.floating]),co=Pe.item??wt;_.useContextCallback("setValue",nt),_.useContextCallback("setOpen",rt),_.useContextCallback("handleScrollArrowVisibility",jt),_.useContextCallback("onOpenChangeComplete",S),pr(()=>{_.update({popupProps:ao,triggerProps:lo})}),_.useSyncedValues({id:F,modal:N,multiple:I,value:R,open:P,mounted:fe,transitionStatus:Te,popupProps:ao,triggerProps:lo,items:j,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M,openMethod:yt});let mn=U.useMemo(()=>({disabled:f,readOnly:y,required:d,multiple:I,highlightItemOnHover:T,itemProps:co}),[f,y,d,I,T,co]),gn=go(H,G.inputRef),uo=I?void 0:E,Sn=U.useMemo(()=>!I||!Array.isArray(R)||!E?null:R.map(A=>{let Y=De(A,C);return(0,Be.jsx)("input",{type:"hidden",form:m,name:E,value:Y,disabled:f},Y)}),[I,R,m,E,C,f]);return(0,Be.jsxs)(Xt.Provider,{value:_,children:[(0,Be.jsx)(Kt.Provider,{value:mn,children:(0,Be.jsx)(Jt.Provider,{value:Fe,children:k})}),(0,Be.jsx)("input",{...G.getValidationProps(f,{onFocus(){_.state.triggerElement?.focus({focusVisible:!0})},onChange(A){if(A.nativeEvent.defaultPrevented||f||y)return;let Y=A.currentTarget.value,vt=ce(oe.none,A.nativeEvent);function zt(){if(I)return;let st=Y.toLowerCase(),Wt=V.current.findIndex(Gt=>De(Gt,C).toLowerCase()===st||to(Gt,g).toLowerCase()===st);Wt===-1&&(Wt=V.current.findIndex((Gt,xn)=>{let fo=J.current[xn];return fo!=null&&fo.toLowerCase()===st}));let po=V.current[Wt];po!=null&&nt(po,vt)}o(zt,"handleChange"),_.set("forceMount",!0),queueMicrotask(zt)}}),id:F&&uo==null?`${F}-hidden-input`:void 0,form:m,name:uo,autoComplete:p,value:ze,disabled:f,required:d&&!(I&&ot),readOnly:y,ref:gn,style:E?Vo:Mo,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Sn]})}o(vr,"SelectRoot");var wr=b(O(),1);function Ir(e){return e==null?void 0:`${e}-label`}o(Ir,"getDefaultLabelId");function Er(e,t){return e??t}o(Er,"resolveAriaLabelledBy");var Cr=wr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=i;delete u.id;let l=qe(),m=L(),p=m.useState("triggerElement"),h=m.useState("id"),y=Ir(h),d=Co({id:y,fallbackControlId:p?.id??h,setLabelId(N){let v=typeof N=="function"?N(m.state.labelId):N;m.set("labelId",v)}});return w("div",t,{ref:r,state:l.state,props:[d,i],stateAttributesMapping:Ct})},"SelectLabel"));var Je=b(O(),1);var Gs=Yt.popupOpen,qs=Yt.pressed;var Ar="data-popup-side";var En=400,wn={...yo,...Ct,popupSide:o(e=>e?{[Ar]:e}:null,"popupSide"),value:o(()=>null,"value")},Nr=Je.forwardRef(o(function(t,r){let{render:n,className:s,id:a,disabled:i=!1,nativeButton:u=!0,style:l,...m}=t,{setTouched:p,setFocused:h,validationMode:y,validation:d,state:N,disabled:v}=qe(),{labelId:H}=ho(),S=L(),{readOnly:j,required:I,disabled:g}=Le(),C=v||g||i,M=S.useState("open"),T=S.useState("mounted"),k=S.useState("value"),Q=S.useState("triggerProps"),$=S.useState("positionerElement"),W=S.useState("listElement"),X=S.useState("popupSide"),c=S.useState("id"),z=S.useState("labelId"),q=S.useState("hasSelectedValue"),ie=T&&$?X:null,G=a??c,le=Er(H,z);At({id:a});let F=Pt($),f=Je.useRef(null),{getButtonProps:E,buttonRef:R}=Et({disabled:C,native:u}),x=S.useStateSetter("triggerElement"),P=Ye(),K=Ye(),ne=Ye();Je.useEffect(()=>{if(M)return ne.start(En,()=>{S.context.selectionRef.current.allowUnselectedMouseUp=!0,S.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ne.clear()};S.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[M,S,K,ne]);let J=it(Q,{id:G,role:"combobox","aria-expanded":M,"aria-haspopup":"listbox","aria-controls":M?W?.id??Io($)?.id:void 0,"aria-labelledby":le,"aria-readonly":j||void 0,"aria-required":I||void 0,tabIndex:C?-1:0,onFocus(ee){h(!0),M&&S.context.alignItemWithTriggerActiveRef.current&&S.context.setOpen(!1,ce(oe.none,ee.nativeEvent)),P.start(0,()=>{S.set("forceMount",!0)})},onBlur(ee){Nt($,ee.relatedTarget)||(p(!0),h(!1),y==="onBlur"&&d.commit(k))},onMouseDown(ee){if(M)return;let pe=lt(ee.currentTarget);function V(D){if(!f.current)return;let ae=D.target;Nt(f.current,ae)||Nt(F.current,ae)||lr(D,f.current)||S.context.setOpen(!1,ce(oe.cancelOpen,D))}o(V,"handleMouseUp"),K.start(0,()=>{pe.addEventListener("mouseup",V,{once:!0})})}},m,E),ue=d.getValidationProps(C,J);ue.role="combobox";let Se={...N,open:M,disabled:C,value:k,readOnly:j,popupSide:ie,placeholder:!q};return w("button",t,{ref:[r,f,R,x],state:Se,stateAttributesMapping:wn,props:ue})},"SelectTrigger"));var Tr=b(O(),1);var Cn={value:o(()=>null,"value")},Pr=Tr.forwardRef(o(function(t,r){let{className:n,render:s,children:a,placeholder:i,style:u,...l}=t,m=L(),p=m.useState("value"),h=m.useState("items"),y=m.useState("itemToStringLabel"),d=m.useState("hasSelectedValue"),N=!d&&i!=null&&a==null,v=m.useState("hasNullItemLabel",N),H={value:p,placeholder:!d},S=null;return typeof a=="function"?S=a(p):a!=null?S=a:N&&!v?S=i:Array.isArray(p)?S=br(p,h,y):S=oo(p,h,y),w("span",t,{state:H,ref:[r,m.context.valueRef],props:[{children:S},l],stateAttributesMapping:Cn})},"SelectValue"));var Mr=b(O(),1);var Vr=Mr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,m={open:L().useState("open")};return w("span",t,{state:m,ref:r,props:[{"aria-hidden":!0,children:"\u25BC"},i],stateAttributesMapping:bo})},"SelectIcon"));var Or=b(O(),1);var Lr=b(xe(),1);var Dr=Or.forwardRef(o(function(t,r){let n=L(),s=n.useState("mounted"),a=n.useState("forceMount");return s||a?(0,Lr.jsx)(Lo,{ref:r,...t}):null},"SelectPortal"));var _r=b(O(),1);var An={...Tt,...Me},Ur=_r.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),l=u.useState("open"),m=u.useState("mounted"),p=u.useState("transitionStatus");return w("div",t,{state:{open:l,transitionStatus:p},ref:r,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:An})},"SelectBackdrop"));var me=b(O(),1);var Ot=b(O(),1);var ro=Ot.createContext(void 0);function _e(){let e=Ot.useContext(ro);if(!e)throw new Error(Ie(59));return e}o(_e,"useSelectPositionerContext");function Ze(e,t){e&&Object.assign(e.style,t)}o(Ze,"clearStyles");var Lt={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var dt=b(xe(),1);var Nn={position:"fixed"},kr=me.forwardRef(o(function(t,r){let{anchor:n,className:s,render:a,positionMethod:i,side:u,align:l,sideOffset:m,alignOffset:p,collisionBoundary:h="clipping-ancestors",collisionPadding:y,arrowPadding:d,sticky:N,disableAnchorTracking:v,alignItemWithTrigger:H=!0,collisionAvoidance:S=Oo,style:j,...I}=t,g=L(),C=Mt(),M=g.useState("open"),T=g.useState("mounted"),k=g.useState("modal"),Q=g.useState("value"),$=g.useState("openMethod"),W=g.useState("positionerElement"),X=g.useState("triggerElement"),c=g.useState("isItemEqualToValue"),z=g.useState("transitionStatus"),q=me.useRef(null),ie=me.useRef(null),[G,le]=me.useState(H),F=T&&G&&$!=="touch";!T&&G!==H&&le(H),me.useImperativeHandle(g.context.alignItemWithTriggerActiveRef,()=>F),Jo((F||k)&&M,$==="touch",W,X);let f=Yo({anchor:n,floatingRootContext:C,positionMethod:i,mounted:T,side:u,sideOffset:m,align:l,alignOffset:p,arrowPadding:d,collisionBoundary:h,collisionPadding:y,sticky:N,disableAnchorTracking:v??F,collisionAvoidance:S,keepMounted:!0}),E=F?"none":f.side,R=F?Nn:f.positionerStyles,x={open:M,side:E,align:f.align,anchorHidden:f.anchorHidden};te(()=>{g.set("popupSide",f.side)},[g,f.side]);let P=g.useStateSetter("positionerElement"),K=Ko(t,x,{styles:R,transitionStatus:z,props:I,refs:[r,P],hidden:!T,inert:!M}),ne=me.useRef(0),J=ve(Se=>{if(g.context.valuesRef.current.length===0)return;let ee=ne.current;ne.current=Se.size;let pe=ce(oe.none);if(ee!==0&&!g.state.multiple&&Q!==null&&ft(g.context.valuesRef.current,Q,c)===-1){let D=g.context.initialValueRef.current,Z=D!=null&&ft(g.context.valuesRef.current,D,c)!==-1?D:null;g.context.setValue(Z,pe),Z===null&&(g.set("selectedIndex",null),g.context.selectedItemTextRef.current=null)}if(ee!==0&&g.state.multiple&&Array.isArray(Q)){let V=Q.filter(D=>ft(g.context.valuesRef.current,D,c)!==-1);V.length!==Q.length&&(g.context.setValue(V,pe),V.length===0&&(g.set("selectedIndex",null),g.context.selectedItemTextRef.current=null))}if(M&&F){g.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let V={height:""};Ze(W,V),Ze(g.context.popupRef.current,V)}}),ue=me.useMemo(()=>({...f,side:E,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:q,scrollDownArrowRef:ie}),[f,E,F,le]);return(0,dt.jsx)(ir,{elementsRef:g.context.listRef,labelsRef:g.context.labelsRef,onMapChange:J,children:(0,dt.jsxs)(ro.Provider,{value:ue,children:[T&&k&&(0,dt.jsx)($o,{inert:Go(!M),cutout:X}),K]})})},"SelectPositioner"));var ge=b(O(),1);var no="--transform-origin";var Ut=b(xe(),1);var Pn={...Tt,...Me},jr=ge.forwardRef(o(function(t,r){let{render:n,className:s,style:a,finalFocus:i,...u}=t,l=L(),{multiple:m,readOnly:p,highlightItemOnHover:h}=Le(),y=Mt(),{side:d,align:N,alignItemWithTriggerActive:v,isPositioned:H,setControlledAlignItemWithTrigger:S}=_e(),j=Qo(!0)!=null,I=qo(),{nonce:g,disableStyleElements:C}=cr(),M=l.useState("id"),T=l.useState("open"),k=l.useState("openMethod"),Q=l.useState("mounted"),$=l.useState("popupProps"),W=l.useState("transitionStatus"),X=l.useState("triggerElement"),c=l.useState("positionerElement"),z=l.useState("listElement"),q=ge.useRef(!1),ie=ge.useRef(!1),G=ge.useRef({}),le=Ao(),F=ve(x=>{if(!c||!l.context.popupRef.current||!ie.current)return;let P=c.style.top==="0px",K=c.style.bottom==="0px";if(q.current||!v||!P&&!K){l.context.handleScrollArrowVisibility(x);return}let ne=Hr(c),J=mt(c.getBoundingClientRect().height,"y",ne),ue=lt(c),Se=It(c),ee=Se.getComputedStyle(c),pe=parseFloat(ee.marginTop),V=parseFloat(ee.marginBottom),D=Fr(Se.getComputedStyle(l.context.popupRef.current)),ae=Math.min(ue.documentElement.clientHeight-pe-V,D),Z=x.scrollTop,Ue=Dt(x),Ae=null,Ne=o(se=>{c.style.height=`${se}px`},"setHeight"),fe=P?Ue-Z:Z,ke=Math.min(J+fe,ae);if(fe<=he){let se=ut(fe,0,ae-J);se>0&&Ne(J+se),x.scrollTop=P?Ue:0,ae-(J+se)<=he&&(q.current=!0),l.context.handleScrollArrowVisibility(x);return}if(ae-ke>he)Ae=P?1/0:0;else if(K&&Z<Ue){let se=J+fe-ae;Ae=Z-(fe-se)}let Te=Math.ceil(ke);if(Te!==0&&Ne(Te),Ae!=null){let se=ut(Ae,0,Dt(x));Math.abs(x.scrollTop-se)>he&&(x.scrollTop=se)}Te>=ae-he&&(q.current=!0),l.context.handleScrollArrowVisibility(x)});ge.useImperativeHandle(l.context.scrollHandlerRef,()=>F,[F]),Ve({open:T,ref:l.context.popupRef,onComplete(){T&&l.context.onOpenChangeComplete(!0)}});let f={open:T,transitionStatus:W,side:d,align:N};te(()=>{!c||!l.context.popupRef.current||Object.keys(G.current).length||(G.current={top:c.style.top||"0",left:c.style.left||"0",right:c.style.right,height:c.style.height,bottom:c.style.bottom,minHeight:c.style.minHeight,maxHeight:c.style.maxHeight,marginTop:c.style.marginTop,marginBottom:c.style.marginBottom})},[l,c]),te(()=>{T||v||(ie.current=!1,q.current=!1,Ze(c,G.current))},[T,v,c]),te(()=>{let x=l.context.popupRef.current;if(!T||!X||!c||!x||v&&!H||l.state.transitionStatus==="ending")return;if(ie.current=!0,x.style.removeProperty(no),!v){le.request(()=>l.context.handleScrollArrowVisibility(z||x));return}let P=Mn(x);try{let K=l.context.selectedItemTextRef.current;K?.isConnected||(K=!l.select("hasSelectedValue")&&l.context.firstItemTextRef.current?.isConnected?l.context.firstItemTextRef.current:null);let ne=l.context.valueRef.current,J=It(c),ue=J.getComputedStyle(c),Se=J.getComputedStyle(x),ee=lt(X),pe=Hr(X),V=_t(X.getBoundingClientRect(),pe),D=_t(c.getBoundingClientRect(),pe),ae=V.height,Z=z||x,Ue=Z.scrollHeight,Ae=parseFloat(Se.borderBottomWidth),Ne=parseFloat(ue.marginTop)||10,fe=parseFloat(ue.marginBottom)||10,ke=parseFloat(ue.minHeight)||100,Te=Fr(Se),se=5,xt=5,_=20,be=ee.documentElement.clientHeight-Ne-fe,ht=ee.documentElement.clientWidth,Rt=be-V.bottom+ae,ye,bt=I==="rtl"?V.right-D.width:V.left,yt=0;if(K&&ne){let de=_t(ne.getBoundingClientRect(),pe);ye=_t(K.getBoundingClientRect(),pe),bt=D.left+(I==="rtl"?de.right-ye.right:de.left-ye.left);let we=de.top-V.top+de.height/2;yt=ye.top-D.top+ye.height/2-we}let ze=Rt+yt+fe+Ae,Ee=Math.min(be,ze),Bt=be-Ne-fe,tt=ze-Ee,ot=ht-xt;c.style.left=`${ut(bt,se,ot-D.width)}px`,c.style.height=`${Ee}px`,c.style.maxHeight="none",c.style.marginTop=`${Ne}px`,c.style.marginBottom=`${fe}px`,x.style.height="100%";let rt=Dt(Z),We=tt>=rt-he;We&&(Ee=Math.min(be,D.height)-(tt-rt));let nt=V.top<_||V.bottom>be-_||Math.ceil(Ee)+he<Math.min(Ue,ke),jt=(J.visualViewport?.scale??1)!==1&&Ro.engine.webkit;if(nt||jt){Ze(c,G.current),S(!1);return}let Fe=Math.max(ke,Ee);if(We){let de=Math.max(0,be-ze);c.style.top=D.height>=Bt?"0":`${de}px`,c.style.height=`${Ee}px`,Z.scrollTop=Dt(Z)}else c.style.bottom="0",Z.scrollTop=tt;if(ye){let de=D.top,we=D.height,Pe=ye.top+ye.height/2,Ge=ut(we>0?(Pe-de)/we*100:50,0,100);x.style.setProperty(no,`50% ${Ge}%`)}(Fe===be||Ee>=Te)&&(q.current=!0),l.context.handleScrollArrowVisibility(Z),h&&l.state.selectedIndex===null&&l.state.activeIndex===null&&l.context.listRef.current[0]!=null&&l.set("activeIndex",0)}finally{P()}},[l,T,c,X,v,S,le,z,h,I,H]),ge.useEffect(()=>{if(!v||!c||!T)return;let x=It(c);function P(K){l.context.setOpen(!1,ce(oe.windowResize,K))}return o(P,"handleResize"),Po(x,"resize",P)},[l,v,c,T]);let E={...z?{role:"presentation"}:{role:"listbox","aria-multiselectable":m||void 0,"aria-readonly":p||void 0,id:`${M}-list`},onKeyDown(x){j&&Zo.has(x.key)&&x.stopPropagation()},onScroll(x){z||F(x.currentTarget)},...v&&{style:z?{height:"100%"}:Lt},className:!z&&v?pt.className:void 0},R=w("div",t,{ref:[r,l.context.popupRef],state:f,stateAttributesMapping:Pn,props:[$,E,Xo(W),u]});return(0,Ut.jsxs)(ge.Fragment,{children:[!C&&pt.getElement(g),(0,Ut.jsx)(Do,{context:y,modal:!1,disabled:!Q,openInteractionType:k,returnFocus:i,restoreFocus:!0,children:R})]})},"SelectPopup"));function Fr(e){let t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}o(Fr,"getMaxPopupHeight");function Dt(e){return Xe(e.scrollHeight,e.clientHeight)}o(Dt,"getMaxScrollTop");function Hr(e){return ko.getScale(e)}o(Hr,"getScale");function mt(e,t,r){return e/r[t]}o(mt,"normalizeSize");function _t(e,t){return wo({x:mt(e.x,"x",t),y:mt(e.y,"y",t),width:mt(e.width,"x",t),height:mt(e.height,"y",t)})}o(_t,"normalizeRect");var Br=[["transform","none"],["scale","1"],["translate","0 0"]];function Mn(e){let{style:t}=e,r={};for(let[n,s]of Br)r[n]=t.getPropertyValue(n),t.setProperty(n,s,"important");return()=>{for(let[n]of Br){let s=r[n];s?t.setProperty(n,s):t.removeProperty(n)}}}o(Mn,"unsetTransformStyles");var zr=b(O(),1);var Wr=zr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),{multiple:l,readOnly:m}=Le(),{alignItemWithTriggerActive:p}=_e(),h=u.useState("hasScrollArrows"),y=u.useState("openMethod"),N={id:`${u.useState("id")}-list`,role:"listbox","aria-multiselectable":l||void 0,"aria-readonly":m||void 0,onScroll(H){u.context.scrollHandlerRef.current?.(H.currentTarget)},...p&&{style:Lt},className:h&&y!=="touch"?pt.className:void 0},v=u.useStateSetter("listElement");return w("div",t,{ref:[r,v],props:[N,i]})},"SelectList"));var Re=b(O(),1);var kt=b(O(),1);var so=kt.createContext(void 0);function gt(){let e=kt.useContext(so);if(!e)throw new Error(Ie(57));return e}o(gt,"useSelectItemContext");var Gr=b(xe(),1);var qr=Re.memo(Re.forwardRef(o(function(t,r){let{render:n,className:s,style:a,value:i=null,label:u,disabled:l=!1,nativeButton:m=!1,...p}=t,h=Re.useRef(null),y=sr({guess:!0,label:u,textRef:h}),d=L(),{itemProps:N,multiple:v,disabled:H,readOnly:S}=Le(),j=H||l,I=d.useState("isActive",y.index),g=d.useState("open"),C=d.useState("isSelected",i),M=d.useState("isSelectedByFocus",y.index),T=d.useState("isItemEqualToValue"),k=y.index,Q=Re.useRef(null);te(()=>{let f=d.context.valuesRef.current;return f[k]=i,()=>{delete f[k]}},[k,i,d]),te(()=>{let f=d.state.value,E=d.state.selectedIndex,R=E,x;v&&Array.isArray(f)?(R=mr(k,i,d.context.valuesRef.current,f,T,E),x=R===k,k===E&&!x&&(d.context.selectedItemTextRef.current=null)):(x=f!==void 0&&Ce(i,f,T),x&&(R=k)),d.set("selectedIndex",R),x&&h.current&&(d.context.selectedItemTextRef.current=h.current)},[k,v,T,d,i]);let $=Re.useRef("mouse"),W=Re.useRef(!1),{getButtonProps:X,buttonRef:c}=Et({disabled:j,focusableWhenDisabled:!0,native:m,composite:!0}),z={disabled:j,selected:C,highlighted:I};function q(f){if(H||S)return;let E=d.state.value;if(v){let R=Array.isArray(E)?E:[],x=C?gr(R,i,T):[...R,i];d.context.setValue(x,ce(oe.itemPress,f))}else d.context.setValue(i,ce(oe.itemPress,f)),d.context.setOpen(!1,ce(oe.itemPress,f))}o(q,"commitSelection");function ie(){d.context.selectionRef.current.dragY=0}o(ie,"resetDragMovement");let G={role:"option","aria-selected":C,tabIndex:g&&I?0:-1,onKeyDown(f){d.set("activeIndex",k),f.key===" "&&d.context.typingRef.current&&f.preventDefault()},onClick(f){let E=$.current!=="touch",R=f.nativeEvent.pointerType,x=E&&Eo(f.nativeEvent)&&(R!==void 0||I),P=E&&!x&&!W.current;W.current=!1,!(j||P)&&q(f.nativeEvent)},onPointerEnter(f){$.current=f.pointerType},onPointerMove(f){if(f.pointerType==="mouse"&&f.buttons===1){let E=d.context.selectionRef.current;E.dragY+=f.movementY,E.dragY**2>=64&&(E.allowUnselectedMouseUp=!0)}},onPointerDown(f){$.current=f.pointerType,W.current=!0,ie()},onMouseUp(){if(ie(),j||$.current==="touch"||W.current)return;let f=!d.context.selectionRef.current.allowSelectedMouseUp&&C,E=!d.context.selectionRef.current.allowUnselectedMouseUp&&!C;f||E||(W.current=!0,Q.current?.click(),W.current=!1)}},le=w("div",t,{ref:[c,r,y.ref,Q],state:z,props:[N,G,p,X]}),F=Re.useMemo(()=>({selected:C,index:k,textRef:h,selectedByFocus:M}),[C,k,h,M]);return(0,Gr.jsx)(so.Provider,{value:F,children:le})},"SelectItem")));var je=b(O(),1);var Yr=b(xe(),1);var $r=je.forwardRef(o(function(t,r){let{selected:n}=gt();return t.keepMounted||n?(0,Yr.jsx)(Vn,{...t,ref:r}):null},"SelectItemIndicator")),Vn=je.memo(je.forwardRef((e,t)=>{let{render:r,className:n,style:s,keepMounted:a,...i}=e,{selected:u}=gt(),l=je.useRef(null),{transitionStatus:m,setMounted:p}=$e(u),y=w("span",e,{ref:[t,l],state:{selected:u,transitionStatus:m},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},i],stateAttributesMapping:Me});return Ve({batch:!0,enabled:!u,open:u,ref:l,onComplete(){u||p(!1)}}),y}));var Qe=b(O(),1);var Xr=Qe.memo(Qe.forwardRef(o(function(t,r){let{index:n,textRef:s,selectedByFocus:a}=gt(),i=L(),{render:u,className:l,style:m,...p}=t,h=Qe.useCallback(d=>{d&&(n===0&&(i.context.firstItemTextRef.current=d),a&&(i.context.selectedItemTextRef.current=d))},[i,n,a]);return w("div",t,{ref:[h,r,s],props:p})},"SelectItemText")));var Kr=b(O(),1);var Jr=Kr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),{side:l,align:m,arrowRef:p,arrowStyles:h,arrowUncentered:y,alignItemWithTriggerActive:d}=_e(),v={open:u.useState("open"),side:l,align:m,uncentered:y},H=w("div",t,{state:v,ref:[p,r],props:[{style:h,"aria-hidden":!0},i],stateAttributesMapping:vo});return d?null:H},"SelectArrow"));var Qr=b(O(),1);var Zr=b(O(),1);var Ft=Zr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,direction:i,keepMounted:u,...l}=t,m=i==="up",p=L(),{side:h,scrollDownArrowRef:y,scrollUpArrowRef:d}=_e(),N=m?"scrollUpArrowVisible":"scrollDownArrowVisible",v=p.useState(N),H=p.useState("openMethod"),S=v&&H!=="touch",j=Ye(),I=m?d:y,{mounted:g,transitionStatus:C,setMounted:M}=$e(S);te(()=>(p.context.scrollArrowsMountedCountRef.current+=1,p.set("hasScrollArrows",!0),()=>{p.context.scrollArrowsMountedCountRef.current=Math.max(0,p.context.scrollArrowsMountedCountRef.current-1),p.context.scrollArrowsMountedCountRef.current===0&&p.set("hasScrollArrows",!1)}),[p]),Ve({open:S,ref:I,onComplete(){S||M(!1)}});let Q=w("div",t,{ref:[r,I],state:{direction:i,visible:S,side:h,transitionStatus:C},props:[{"aria-hidden":!0,children:m?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(W){if(W.movementX===0&&W.movementY===0||j.isStarted())return;p.set("activeIndex",null);function X(){let c=p.state.listElement??p.context.popupRef.current;if(!c)return;p.set("activeIndex",null),p.context.handleScrollArrowVisibility(c);let z=Xe(c.scrollHeight,c.clientHeight),q=Ke(c.scrollTop,z),ie=q===(m?0:z),G=p.context.listRef.current;if(q!==c.scrollTop&&(c.scrollTop=q),ie){j.clear();return}if(G.length>0){let le=I.current?.offsetHeight||0;c.scrollTop=On(G,m,q,c.clientHeight,le,z)}j.start(40,X)}o(X,"scrollNextItem"),j.start(40,X)},onMouseLeave(){j.clear()}},l],stateAttributesMapping:Me});return g||u?Q:null},"SelectScrollArrow"));function On(e,t,r,n,s,a){if(t){let p=0,h=r+s-he;for(let N=0;N<e.length;N+=1){let v=e[N];if(v&&v.offsetTop>=h){p=N;break}}let y=Math.max(0,p-1),d=e[y];return y<p&&d?Ke(d.offsetTop-s,a):0}let i=e.length-1,u=r+n-s+he;for(let p=0;p<e.length;p+=1){let h=e[p];if(h&&h.offsetTop+h.offsetHeight>u){i=Math.max(0,p-1);break}}let l=Math.min(e.length-1,i+1),m=e[l];return l>i&&m?Ke(m.offsetTop+m.offsetHeight-n+s,a):a}o(On,"getTargetScrollTop");var en=b(xe(),1);var tn=Qr.forwardRef(o(function(t,r){return(0,en.jsx)(Ft,{...t,ref:r,direction:"down"})},"SelectScrollDownArrow"));var on=b(O(),1);var rn=b(xe(),1);var nn=on.forwardRef(o(function(t,r){return(0,rn.jsx)(Ft,{...t,ref:r,direction:"up"})},"SelectScrollUpArrow"));var et=b(O(),1);var Ht=b(O(),1);var io=Ht.createContext(void 0);function sn(){let e=Ht.useContext(io);if(e===void 0)throw new Error(Ie(56));return e}o(sn,"useSelectGroupContext");var ln=b(xe(),1);var an=et.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,[u,l]=et.useState(),m=et.useMemo(()=>({labelId:u,setLabelId:l}),[u,l]),p=w("div",t,{ref:r,props:[{role:"group","aria-labelledby":u},i]});return(0,ln.jsx)(io.Provider,{value:m,children:p})},"SelectGroup"));var cn=b(O(),1);var un=cn.forwardRef(o(function(t,r){let{render:n,className:s,style:a,id:i,...u}=t,{setLabelId:l}=sn(),m=xo(i);return te(()=>(l(m),()=>{l(h=>h===m?void 0:h)}),[m,l]),w("div",t,{ref:r,props:[{id:m,"aria-hidden":!0},u]})},"SelectGroupLabel"));var pn=b(O(),1);var fn=pn.forwardRef(o(function(t,r){let{className:n,render:s,orientation:a="horizontal",style:i,...u}=t;return w("div",t,{state:{orientation:a},ref:r,props:[{role:"presentation"},u]})},"ListboxSeparator"));var dn=fn;var B=b(xe(),1);var hc=re.Root;function Rc(e){let t=(0,St.c)(8),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("flex flex-1 text-start",r),t[3]=r,t[4]=s):s=t[4];let a;return t[5]!==n||t[6]!==s?(a=(0,B.jsx)(re.Value,{"data-slot":"select-value",className:s,...n}),t[5]=n,t[6]=s,t[7]=a):a=t[7],a}o(Rc,"$");function bc({className:e,size:t="default",children:r,...n}){return(0,B.jsxs)(re.Trigger,{"data-slot":"select-trigger","data-size":t,className:He("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,(0,B.jsx)(re.Icon,{render:(0,B.jsx)(ct,{icon:nr,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"})})]})}o(bc,"j");function yc({className:e,children:t,side:r="bottom",sideOffset:n=4,align:s="center",alignOffset:a=0,alignItemWithTrigger:i=!0,...u}){return(0,B.jsx)(re.Portal,{children:(0,B.jsx)(re.Positioner,{side:r,sideOffset:n,align:s,alignOffset:a,alignItemWithTrigger:i,className:"isolate z-50",children:(0,B.jsxs)(re.Popup,{"data-slot":"select-content","data-align-trigger":i,className:He("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...u,children:[(0,B.jsx)(Ln,{}),(0,B.jsx)(re.List,{children:t}),(0,B.jsx)(Dn,{})]})})})}o(yc,"A");function vc(e){let t=(0,St.c)(13),r,n,s;t[0]!==e?({className:n,children:r,...s}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=s):(r=t[1],n=t[2],s=t[3]);let a;t[4]!==n?(a=He("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),t[4]=n,t[5]=a):a=t[5];let i;t[6]!==r?(i=(0,B.jsx)(re.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:r}),t[6]=r,t[7]=i):i=t[7];let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,B.jsx)(re.ItemIndicator,{render:(0,B.jsx)("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:(0,B.jsx)(ct,{icon:rr,strokeWidth:2,className:"pointer-events-none"})}),t[8]=u):u=t[8];let l;return t[9]!==s||t[10]!==a||t[11]!==i?(l=(0,B.jsxs)(re.Item,{"data-slot":"select-item",className:a,...s,children:[i,u]}),t[9]=s,t[10]=a,t[11]=i,t[12]=l):l=t[12],l}o(vc,"U");function Ln(e){let t=(0,St.c)(9),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",r),t[3]=r,t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)(ct,{icon:or,strokeWidth:2}),t[5]=a):a=t[5];let i;return t[6]!==n||t[7]!==s?(i=(0,B.jsx)(re.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:s,...n,children:a}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}o(Ln,"x");function Dn(e){let t=(0,St.c)(9),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",r),t[3]=r,t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)(ct,{icon:tr,strokeWidth:2}),t[5]=a):a=t[5];let i;return t[6]!==n||t[7]!==s?(i=(0,B.jsx)(re.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:s,...n,children:a}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}o(Dn,"w");export{hc as a,Rc as b,bc as c,yc as d,vc as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R}from"./chunk-2W4UO5BC.js";import{c as K}from"./chunk-5X6BEWUI.js";import{a as N}from"./chunk-GWNGVKLG.js";import{a as C,b as F}from"./chunk-6G3E4PJ2.js";import{a as o,d as A}from"./chunk-5PEAXTYQ.js";var b=A(N(),1),u=A(C(),1);var S=A(F(),1);var x=(0,u.createContext)(void 0),w={},T="New chat",j=o((n,s)=>({id:n,name:s?.title??T,schema:s?.schema??[],shardKey:s?.shardKey,suggestions:s?.suggestions??[],turns:[]}),"F"),D=o((n,s)=>[...n.sessions,s].slice(-10),"T"),m=o((n,s)=>{let a=`chat-${String(n.seq+1)}`;return{activeId:a,draft:s?.draft===void 0?void 0:{id:n.seq+1,text:s.draft},hasEditor:n.hasEditor,insertRequest:void 0,open:!0,pendingAsk:s?.ask===void 0?void 0:{id:n.seq+1,sessionId:a,text:s.ask},seq:n.seq+1,sessions:D(n,j(a,s))}},"f"),v=o((n,s)=>n.find(a=>a.id===s),"l"),O=o((n,s,a)=>n.map(c=>c.id===s?{...c,schema:a}:c),"D"),U=o((n,s,a)=>n.map(c=>c.id===s?{...c,schema:[],shardKey:a}:c),"O"),$=o((n,s)=>n.filter(a=>a.id!==s),"U"),E=o((n,s,a)=>n.map(c=>c.id===s?{...c,turns:a}:c),"y"),z=o(n=>{let s=(0,b.c)(16),{children:a}=n,c;s[0]===Symbol.for("react.memo_cache_sentinel")?(c={shardKey:""},s[0]=c):c=s[0];let _=K(R.aiAvailable,w,c),l;s[1]===Symbol.for("react.memo_cache_sentinel")?(l={activeId:void 0,draft:void 0,hasEditor:!1,insertRequest:void 0,open:!1,pendingAsk:void 0,seq:0,sessions:[]},s[1]=l):l=s[1];let[d,h]=(0,u.useState)(l),p;s[2]===Symbol.for("react.memo_cache_sentinel")?(p=o(()=>({close:o(()=>{h(H)},"close"),deleteChat:o(t=>{h(e=>{let i=$(e.sessions,t);return{...e,activeId:e.activeId===t?i.at(-1)?.id:e.activeId,open:i.length===0?!1:e.open,sessions:i}})},"deleteChat"),newChat:o(t=>{h(e=>m(e,t))},"newChat"),openAssistant:o(t=>{h(e=>{let i=e.activeId===void 0?void 0:v(e.sessions,e.activeId);return t?.ask!==void 0||i===void 0||(t?.shardKey??"")!==(i.shardKey??"")?m(e,t):{...e,draft:t?.draft===void 0?e.draft:{id:e.seq+1,text:t.draft},open:!0,sessions:t?.schema===void 0?e.sessions:O(e.sessions,i.id,t.schema),seq:e.seq+1}})},"openAssistant"),rebindShard:o((t,e)=>{h(i=>{let r=i.activeId===void 0?void 0:v(i.sessions,i.activeId);return!i.open||r===void 0||(r.shardKey??"")!==t||t===e?i:r.turns.length===0?{...i,sessions:U(i.sessions,r.id,e)}:m(i,{shardKey:e,title:r.name})})},"rebindShard"),requestInsert:o(t=>{h(e=>({...e,insertRequest:{id:e.seq+1,sql:t},seq:e.seq+1}))},"requestInsert"),setHasEditor:o(t=>{h(e=>e.hasEditor===t?e:{...e,hasEditor:t})},"setHasEditor"),takeInsert:o(t=>{h(e=>e.insertRequest?.id===t?{...e,insertRequest:void 0}:e)},"takeInsert"),selectChat:o(t=>{h(e=>({...e,activeId:t,open:!0}))},"selectChat"),branchFrom:o((t,e)=>{h(i=>{let r=v(i.sessions,t);if(r===void 0)return i;let y=m(i,{schema:r.schema,shardKey:r.shardKey,title:r.name});return{...y,sessions:E(y.sessions,y.activeId??"",r.turns.slice(0,e+1))}})},"branchFrom"),setTurns:o((t,e)=>{h(i=>{let r=v(i.sessions,t);return r===void 0?i:{...i,sessions:E(i.sessions,t,typeof e=="function"?e(r.turns):e)}})},"setTurns"),toggle:o(()=>{h(M)},"toggle"),truncateFrom:o((t,e)=>{h(i=>{let r=v(i.sessions,t);return r===void 0?i:{...i,sessions:E(i.sessions,t,r.turns.slice(0,e))}})},"truncateFrom"),takeAsk:o(t=>{h(e=>e.pendingAsk?.id===t?{...e,pendingAsk:void 0}:e)},"takeAsk")}),"c"),s[2]=p):p=s[2];let[I]=(0,u.useState)(p),g=_.data?.available!==!0,f;s[3]!==I||s[4]!==d.activeId||s[5]!==d.draft||s[6]!==d.hasEditor||s[7]!==d.insertRequest||s[8]!==d.open||s[9]!==d.pendingAsk||s[10]!==d.sessions||s[11]!==g?(f={...I,activeId:d.activeId,draft:d.draft,hasEditor:d.hasEditor,insertRequest:d.insertRequest,open:d.open,pendingAsk:d.pendingAsk,sessions:d.sessions,unavailable:g},s[3]=I,s[4]=d.activeId,s[5]=d.draft,s[6]=d.hasEditor,s[7]=d.insertRequest,s[8]=d.open,s[9]=d.pendingAsk,s[10]=d.sessions,s[11]=g,s[12]=f):f=s[12];let k=f,q;return s[13]!==a||s[14]!==k?(q=(0,S.jsx)(x,{value:k,children:a}),s[13]=a,s[14]=k,s[15]=q):q=s[15],q},"P"),B=o(()=>(0,u.use)(x),"Q");function H(n){return{...n,open:!1}}o(H,"$");function M(n){return!n.open&&n.activeId===void 0?m(n,void 0):{...n,open:!n.open}}o(M,"j");export{z as a,B as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as S,b as m}from"./chunk-6G3E4PJ2.js";import{a as n,d as E}from"./chunk-5PEAXTYQ.js";function u(t,e=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,r))}n(u,"clamp");var p=1;function x(t,e){return Math.max(0,t-e)}n(x,"getMaxScrollOffset");function A(t,e){if(e<=0)return 0;let r=u(t,0,e),l=r,c=e-r,a=l<=p,i=c<=p;return a&&i?l<=c?0:e:a?0:i?e:r}n(A,"normalizeScrollOffset");var f=E(m(),1),o="base-ui-disable-scrollbar",R={className:o,getElement(t){return(0,f.jsx)("style",{nonce:t,href:o,precedence:"base-ui:low",children:`.${o}{scrollbar-width:none}.${o}::-webkit-scrollbar{display:none}`})}};var s=E(S(),1);var b=s.createContext(void 0),C={disableStyleElements:!1};function y(){return s.useContext(b)??C}n(y,"useCSPContext");export{u as a,p as b,x as c,A as d,R as e,y as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as x}from"./chunk-YORPLSI5.js";import{b as v}from"./chunk-K5BAERB3.js";import{w as h}from"./chunk-OOOT4H45.js";import{a as k}from"./chunk-GWNGVKLG.js";import{b as y}from"./chunk-6G3E4PJ2.js";import{a as g,d as p}from"./chunk-5PEAXTYQ.js";var N=p(k(),1);var l=p(y(),1);var b={debug:"secondary",error:"destructive",fatal:"destructive",info:"outline",log:"outline",trace:"outline",warn:"secondary"},F=g(w=>{let e=(0,N.c)(21),{entry:t}=w,c;e[0]!==t.fields?(c=x(t.fields),e[0]=t.fields,e[1]=c):c=e[1];let m=c,s;e[2]!==t.timestamp?(s=h(t.timestamp),e[2]=t.timestamp,e[3]=s):s=e[3];let r;e[4]!==s?(r=(0,l.jsx)("span",{className:"w-44 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:s}),e[4]=s,e[5]=r):r=e[5];let u=b[t.level],a;e[6]!==t.level||e[7]!==u?(a=(0,l.jsx)("span",{className:"w-20 shrink-0",role:"gridcell",children:(0,l.jsx)(v,{variant:u,children:t.level})}),e[6]=t.level,e[7]=u,e[8]=a):a=e[8];let f=t.functionPath??"\u2014",n;e[9]!==f?(n=(0,l.jsx)("span",{className:"w-48 shrink-0 truncate text-muted-foreground",role:"gridcell",children:f}),e[9]=f,e[10]=n):n=e[10];let i;e[11]!==m?(i=m===""?null:(0,l.jsx)("span",{className:"ml-2 text-muted-foreground","data-testid":"lg-fields",children:m}),e[11]=m,e[12]=i):i=e[12];let o;e[13]!==t.message||e[14]!==i?(o=(0,l.jsxs)("span",{className:"flex-1 truncate",role:"gridcell",children:[t.message,i]}),e[13]=t.message,e[14]=i,e[15]=o):o=e[15];let d;return e[16]!==r||e[17]!==a||e[18]!==n||e[19]!==o?(d=(0,l.jsxs)(l.Fragment,{children:[r,a,n,o]}),e[16]=r,e[17]=a,e[18]=n,e[19]=o,e[20]=d):d=e[20],d},"B");export{b as a,F as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-5X6BEWUI.js";import{a as n}from"./chunk-5PEAXTYQ.js";var d="__lunora_admin__:",g=new Set(["action","mutation","query","streamRpc"]),y=Symbol("lunora.operationSeq"),w=n(t=>{if(typeof t!="object"||t===null)return;let e=t[y];return typeof e=="number"?e:void 0},"R"),_=n((t,e)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,y,{configurable:!0,enumerable:!1,value:e,writable:!0})}catch{}},"O"),h=n(t=>{if(typeof t!="object"||t===null)return;let e=t.__lunoraRef;return typeof e=="string"&&e.startsWith(d)?e:void 0},"_"),p=n(t=>{if(typeof t!="object"||t===null)return"";let{shardKey:e}=t;return typeof e=="string"?e:""},"l"),R=n(t=>new Proxy(t,{get(e,a,b){let s=Reflect.get(e,a,b);if(typeof s!="function"||typeof a!="string"||!g.has(a))return typeof s=="function"?s.bind(e):s;let c=s;return async(...o)=>{let f=h(o[0]);if(f===void 0)return c.apply(e,o);let l=typeof o[1]=="object"&&o[1]!==null?o[1]:{},m=p(o[2])||(a==="streamRpc"?p(l):""),u=i.start(f,l,m);try{let r=await c.apply(e,o);return i.settle(u,{result:r}),r}catch(r){throw i.settle(u,{error:r instanceof Error?r.message:String(r)}),_(r,u),r}}}}),"E");export{w as a,R as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-2W4UO5BC.js";import{c as f}from"./chunk-5X6BEWUI.js";import{m as q}from"./chunk-JWQOB4EW.js";import{h as s,i as l}from"./chunk-OOOT4H45.js";import{a as U}from"./chunk-6G3E4PJ2.js";import{a as e,d as R}from"./chunk-5PEAXTYQ.js";var p=R(U(),1);var _=e(async i=>{try{let{knowledgeExcerpts:d}=await import("./chunk-K3DHV2YQ.js");return d(i)}catch{return[]}},"x"),B={},H=s(n.aiGenerateSql),L=s(n.aiTableFilter),O=s(n.aiChartConfig),P=s(n.aiChat),V=s(n.aiNameQuery),j=s(n.aiCronExpression),Y=e(i=>{let d=q(),[w,m]=(0,p.useState)({}),[b,g]=(0,p.useState)({}),y=f(n.aiAvailable,B,{shardKey:i}),[C,S]=(0,p.useState)(!1),N=C||y.data?.available===!1,c=e(a=>{m(r=>({...r,[a]:!0})),g(r=>({...r,[a]:void 0}))},"i"),t=e((a,r)=>{m(o=>({...o,[a]:!1})),r!==void 0&&g(o=>({...o,[a]:r})),(r==="ai-disabled"||r==="no-ai-binding")&&S(!0)},"e"),h=e(async a=>{c("sql");try{let r=await d.query(H,a,l(i));return t("sql",r.degraded?r.reason:void 0),r.degraded?void 0:r.sql}catch{t("sql","ai-error");return}},"p"),x=e(async(a,r)=>h({failedError:r?.error,failedSql:r?.sql,prompt:a}),"E"),E=e(async(a,r)=>h({editSql:r,prompt:a}),"w"),F=e(async(a,r,o,G,K,v)=>{c("chat");try{let u=await d.streamRpc(P,{approval:G,knowledge:await _(a),prompt:a,schema:o,shardKey:i,transcript:r},{onFrame:e(M=>{K?.(M)},"onFrame"),...v===void 0?{}:{signal:v}});return t("chat",u.degraded?u.reason:void 0),u.degraded?void 0:u}catch{t("chat","ai-error");return}},"C"),A=e(async(a,r)=>{c("filter");try{let o=await d.query(L,{prompt:a,table:r},l(i));return t("filter",o.degraded?o.reason:void 0),o.degraded?void 0:o.clauses}catch{t("filter","ai-error");return}},"I"),I=e(async a=>{c("chart");try{let r=await d.query(O,a,l(i));return t("chart",r.degraded?r.reason:void 0),r.degraded?void 0:r.chart}catch{t("chart","ai-error");return}},"R"),Q=e(async a=>{c("name");try{let r=await d.query(V,{sql:a},l(i));return t("name",r.degraded?r.reason:void 0),r.degraded?void 0:{description:r.description,title:r.title}}catch{t("name","ai-error");return}},"S"),T=e(async a=>{c("cron");try{let r=await d.query(j,{prompt:a},l(i));return t("cron",r.degraded?r.reason:void 0),r.degraded?void 0:r.cron}catch{t("cron","ai-error");return}},"T"),k=e(a=>w[a]===!0,"N"),D=e(a=>b[a],"b");return{chat:F,generate:x,inferChart:I,level:y.data?.level,nameQuery:Q,pending:k,reason:D,rewrite:E,suggestCron:T,suggestFilter:A,unavailable:N}},"V");export{Y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as E,e as _}from"./chunk-FWM5Z6CH.js";import{a as $}from"./chunk-62XXKQH3.js";import{a as de}from"./chunk-5BXW4BR6.js";import"./chunk-SGIBDCPB.js";import{a as ce}from"./chunk-JG74C6DH.js";import"./chunk-ONTGYVAN.js";import"./chunk-Y2YLTUMD.js";import"./chunk-BG2CJOVS.js";import{a as le}from"./chunk-J45HAKBU.js";import{a as re}from"./chunk-FHKZP25N.js";import"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import"./chunk-Q3WMP7OA.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import"./chunk-VUOEJJUH.js";import{a as ae}from"./chunk-XMOG3LIP.js";import{b as K}from"./chunk-K5BAERB3.js";import"./chunk-YUVGMKHG.js";import{a as ie}from"./chunk-E5LR7G22.js";import"./chunk-F7EKRF7I.js";import{a as R,b as W,c as Z,d as A,e as M,f as S}from"./chunk-TZ5PSNZW.js";import"./chunk-O7XG7DTU.js";import"./chunk-O24UFHUY.js";import"./chunk-4PI2OSSP.js";import{a as U}from"./chunk-2W4UO5BC.js";import{c as D}from"./chunk-5X6BEWUI.js";import{a as q,b as H,c as J,e as ne}from"./chunk-PDBCAPP6.js";import"./chunk-JWQOB4EW.js";import"./chunk-ZPQBVYNN.js";import{B as F,w as oe}from"./chunk-OOOT4H45.js";import"./chunk-PDBW6GTJ.js";import{a as be}from"./chunk-GWNGVKLG.js";import{b as ge}from"./chunk-6G3E4PJ2.js";import{a as p,d as se}from"./chunk-5PEAXTYQ.js";var O=se(be(),1);var o=se(ge(),1);var G="gen_ai.usage.input_tokens",Q="gen_ai.usage.output_tokens",V="gen_ai.usage.cost",fe="gen_ai.request.model",Te="lunora.usage.cost.source",xe=new Set(["ai.embed","ai.generate","ai.stream"]),ue=6e4,Ce=1440,ve="unknown",X=p(()=>({calls:0,estimatedCost:0,inputTokens:0,outputTokens:0,providerCost:0}),"q"),Y=p((n,e)=>{let s=n?.[e];return typeof s=="string"&&s!==""?s:void 0},"J"),z=p((n,e)=>{let s=n?.[e];return typeof s=="number"&&Number.isFinite(s)?s:void 0},"L"),ee=p(n=>Y(n,Te)==="provider"?"provider":"estimated","Q"),me=p((n,e)=>n.reduce((s,a)=>s+e(a),0),"Y"),B=p(n=>n.providerCost+n.estimatedCost,"F"),ke=p(n=>n.estimatedCost>0?n.providerCost>0?"mixed":"estimated":n.providerCost>0?"provider":"none","ae"),ye=p((n,e)=>({calls:n.calls+e.calls,estimatedCost:n.estimatedCost+e.estimatedCost,inputTokens:n.inputTokens+e.inputTokens,outputTokens:n.outputTokens+e.outputTokens,providerCost:n.providerCost+e.providerCost}),"ce"),Ie=p(n=>{let e=X(),s=0,a=0,t=0;for(let c of n){let l=me(c.points,i=>i.sum),r=me(c.points,i=>i.count);c.name===G?(e.inputTokens+=l,s+=r):c.name===Q?(e.outputTokens+=l,a+=r):(t+=r,ee(c.attributes)==="provider"?e.providerCost+=l:e.estimatedCost+=l)}return e.calls=Math.max(s,a,t),e},"ge"),Ne=p((n,e)=>B(e)-B(n)||e.inputTokens+e.outputTokens-(n.inputTokens+n.outputTokens)||n.key.localeCompare(e.key),"Ne"),pe=p((n,e)=>{let s=new Map;for(let a of n){let t=e(a);s.set(t,{key:t,...ye(s.get(t)??X(),a)})}return[...s.values()].toSorted(Ne)},"Z"),we=p(n=>(n?.series??[]).filter(e=>e.name===G||e.name===Q||e.name===V),"xe"),Me=p(n=>Y(n.attributes,fe)??ve,"Se"),Se=p(n=>{let e=new Map;for(let s of n){let a=Me(s),t=JSON.stringify([s.functionPath,a]),c=e.get(t)??{functionPath:s.functionPath,model:a,series:[]};c.series.push(s),e.set(t,c)}return[...e.values()].map(({functionPath:s,model:a,series:t})=>({functionPath:s,model:a,...Ie(t)}))},"Ie"),_e=p(n=>{let e=new Map;for(let r of n){if(r.name!==V)continue;let i=ee(r.attributes)==="provider";for(let u of r.points){let m=e.get(u.bucketMs)??{bucketMs:u.bucketMs,estimatedCost:0,providerCost:0};i?m.providerCost+=u.sum:m.estimatedCost+=u.sum,e.set(u.bucketMs,m)}}let s=[...e.keys()].toSorted((r,i)=>r-i),a=s[0],t=s.at(-1);if(a===void 0||t===void 0)return[];let c=Math.max(a,t-(Ce-1)*ue),l=[];for(let r=c;r<=t;r+=ue)l.push(e.get(r)??{bucketMs:r,estimatedCost:0,providerCost:0});return l},"_e"),Pe=p(n=>{let e=[];for(let s of n)for(let a of s.spans){if(!xe.has(a.name))continue;let{attributes:t}=a,c=z(t,V),l=z(t,G),r=z(t,Q);e.push({...c===void 0?{}:{cost:c,costSource:ee(t)},functionPath:s.functionPath,...l===void 0?{}:{inputTokens:l},model:Y(t,fe)??ve,ok:a.ok,...r===void 0?{}:{outputTokens:r},startTs:s.startTs+a.offsetMs,streaming:a.name==="ai.stream",traceId:s.traceId})}return e.toSorted((s,a)=>a.startTs-s.startTs)},"Me"),Fe=p(n=>n.map(e=>{let s=e.cost??0;return{calls:1,estimatedCost:e.costSource==="provider"?0:s,functionPath:e.functionPath,inputTokens:e.inputTokens??0,model:e.model,outputTokens:e.outputTokens??0,providerCost:e.costSource==="provider"?s:0}}),"Oe"),Oe=p((n,e)=>{let s=we(n),a=Pe(e),t=s.length>0,c=t?Se(s):Fe(a),l=X(),r="none";for(let i of c)l=ye(l,i);return t?r="history":a.length>0&&(r="live"),{byFunction:pe(c,i=>i.functionPath),byModel:pe(c,i=>i.model),calls:a,source:r,totals:l,trend:t?_e(s):[]}},"Ae"),Ke=p(n=>Array.isArray(n?.traces)?n.traces:[],"Ee"),Ae=25,te=p(n=>{let e=(0,O.c)(16),{provenance:s,value:a}=n,t=F();if(s==="none"){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=(0,o.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=m):m=e[0],m}let c;e[1]!==s||e[2]!==a?(c=s==="provider"?E(a):`~${E(a)}`,e[1]=s,e[2]=a,e[3]=c):c=e[3];let l;e[4]!==c?(l=(0,o.jsx)("span",{className:"tabular-nums",children:c}),e[4]=c,e[5]=l):l=e[5];let r;e[6]!==s||e[7]!==t?(r=s==="estimated"?(0,o.jsx)(K,{title:t("Derived from a price table, not reported by the provider."),variant:"warning",children:t("Estimated")}):null,e[6]=s,e[7]=t,e[8]=r):r=e[8];let i;e[9]!==s||e[10]!==t?(i=s==="mixed"?(0,o.jsx)(K,{title:t("Includes cost derived from a price table, not reported by the provider."),variant:"warning",children:t("Partly estimated")}):null,e[9]=s,e[10]=t,e[11]=i):i=e[11];let u;return e[12]!==l||e[13]!==r||e[14]!==i?(u=(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[l,r,i]}),e[12]=l,e[13]=r,e[14]=i,e[15]=u):u=e[15],u},"V"),he=p(n=>{let e=(0,O.c)(40),{keyLabel:s,rows:a,testId:t,title:c}=n,l=F(),r;e[0]!==c?(r=(0,o.jsx)(H,{className:"px-4 py-3",children:(0,o.jsx)(J,{children:c})}),e[0]=c,e[1]=r):r=e[1];let i;e[2]!==s?(i=(0,o.jsx)(M,{children:s}),e[2]=s,e[3]=i):i=e[3];let u;e[4]!==l?(u=l("Calls"),e[4]=l,e[5]=u):u=e[5];let m;e[6]!==u?(m=(0,o.jsx)(M,{className:"text-end",children:u}),e[6]=u,e[7]=m):m=e[7];let k;e[8]!==l?(k=l("Input tokens"),e[8]=l,e[9]=k):k=e[9];let y;e[10]!==k?(y=(0,o.jsx)(M,{className:"text-end",children:k}),e[10]=k,e[11]=y):y=e[11];let b;e[12]!==l?(b=l("Output tokens"),e[12]=l,e[13]=b):b=e[13];let T;e[14]!==b?(T=(0,o.jsx)(M,{className:"text-end",children:b}),e[14]=b,e[15]=T):T=e[15];let g;e[16]!==l?(g=l("Cost"),e[16]=l,e[17]=g):g=e[17];let d;e[18]!==g?(d=(0,o.jsx)(M,{className:"text-end",children:g}),e[18]=g,e[19]=d):d=e[19];let x;e[20]!==d||e[21]!==i||e[22]!==m||e[23]!==y||e[24]!==T?(x=(0,o.jsx)(W,{children:(0,o.jsxs)(A,{children:[i,m,y,T,d]})}),e[20]=d,e[21]=i,e[22]=m,e[23]=y,e[24]=T,e[25]=x):x=e[25];let h;if(e[26]!==a||e[27]!==t){let N;e[29]!==t?(N=p(w=>(0,o.jsxs)(A,{"data-testid":`${t}-row`,children:[(0,o.jsx)(S,{className:"max-w-[280px] truncate font-mono",title:w.key,children:w.key}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.calls)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.inputTokens)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.outputTokens)}),(0,o.jsx)(S,{className:"text-end",children:(0,o.jsx)(te,{provenance:ke(w),value:B(w)})})]},w.key),"x"),e[29]=t,e[30]=N):N=e[30],h=a.map(N),e[26]=a,e[27]=t,e[28]=h}else h=e[28];let f;e[31]!==h?(f=(0,o.jsx)(Z,{children:h}),e[31]=h,e[32]=f):f=e[32];let v;e[33]!==x||e[34]!==f?(v=(0,o.jsxs)(R,{children:[x,f]}),e[33]=x,e[34]=f,e[35]=v):v=e[35];let C;return e[36]!==r||e[37]!==v||e[38]!==t?(C=(0,o.jsxs)(q,{className:"gap-0 py-0","data-testid":t,children:[r,v]}),e[36]=r,e[37]=v,e[38]=t,e[39]=C):C=e[39],C},"ee"),$e=p(n=>{let e=(0,O.c)(55),{calls:s,onOpenTrace:a}=n,t=F(),c;e[0]!==t?(c=t("Recent calls"),e[0]=t,e[1]=c):c=e[1];let l;e[2]!==c?(l=(0,o.jsx)(H,{className:"px-4 py-3",children:(0,o.jsx)(J,{children:c})}),e[2]=c,e[3]=l):l=e[3];let r;e[4]!==t?(r=t("When"),e[4]=t,e[5]=r):r=e[5];let i;e[6]!==r?(i=(0,o.jsx)(M,{children:r}),e[6]=r,e[7]=i):i=e[7];let u;e[8]!==t?(u=t("Function"),e[8]=t,e[9]=u):u=e[9];let m;e[10]!==u?(m=(0,o.jsx)(M,{children:u}),e[10]=u,e[11]=m):m=e[11];let k;e[12]!==t?(k=t("Model"),e[12]=t,e[13]=k):k=e[13];let y;e[14]!==k?(y=(0,o.jsx)(M,{children:k}),e[14]=k,e[15]=y):y=e[15];let b;e[16]!==t?(b=t("Input tokens"),e[16]=t,e[17]=b):b=e[17];let T;e[18]!==b?(T=(0,o.jsx)(M,{className:"text-end",children:b}),e[18]=b,e[19]=T):T=e[19];let g;e[20]!==t?(g=t("Output tokens"),e[20]=t,e[21]=g):g=e[21];let d;e[22]!==g?(d=(0,o.jsx)(M,{className:"text-end",children:g}),e[22]=g,e[23]=d):d=e[23];let x;e[24]!==t?(x=t("Cost"),e[24]=t,e[25]=x):x=e[25];let h;e[26]!==x?(h=(0,o.jsx)(M,{className:"text-end",children:x}),e[26]=x,e[27]=h):h=e[27];let f;e[28]!==t?(f=t("Trace"),e[28]=t,e[29]=f):f=e[29];let v;e[30]!==f?(v=(0,o.jsx)(M,{children:f}),e[30]=f,e[31]=v):v=e[31];let C;e[32]!==T||e[33]!==d||e[34]!==h||e[35]!==v||e[36]!==i||e[37]!==m||e[38]!==y?(C=(0,o.jsx)(W,{children:(0,o.jsxs)(A,{children:[i,m,y,T,d,h,v]})}),e[32]=T,e[33]=d,e[34]=h,e[35]=v,e[36]=i,e[37]=m,e[38]=y,e[39]=C):C=e[39];let N;if(e[40]!==s||e[41]!==a||e[42]!==t){let j;e[44]!==a||e[45]!==t?(j=p(I=>(0,o.jsxs)(A,{"data-testid":"ai-call",children:[(0,o.jsx)(S,{className:"font-mono text-muted-foreground",children:oe(I.startTs)}),(0,o.jsx)(S,{className:"font-mono",children:(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[I.functionPath,I.streaming?(0,o.jsx)(K,{variant:"outline",children:t("stream")}):null,I.ok?null:(0,o.jsx)(K,{variant:"destructive",children:t("failed")})]})}),(0,o.jsx)(S,{className:"max-w-[240px] truncate font-mono",title:I.model,children:I.model}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:I.inputTokens===void 0?"\u2014":_(I.inputTokens)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:I.outputTokens===void 0?"\u2014":_(I.outputTokens)}),(0,o.jsx)(S,{className:"text-end",children:(0,o.jsx)(te,{provenance:I.cost===void 0?"none":I.costSource??"estimated",value:I.cost??0})}),(0,o.jsx)(S,{children:(0,o.jsx)("button",{className:"font-mono text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{a(I.traceId)},"onClick"),title:t("Open the trace {trace}",{trace:I.traceId}),type:"button",children:I.traceId.slice(0,8)})})]},`${I.traceId}:${I.startTs.toString()}:${I.model}`),"K"),e[44]=a,e[45]=t,e[46]=j):j=e[46],N=s.slice(0,Ae).map(j),e[40]=s,e[41]=a,e[42]=t,e[43]=N}else N=e[43];let w;e[47]!==N?(w=(0,o.jsx)(Z,{children:N}),e[47]=N,e[48]=w):w=e[48];let P;e[49]!==C||e[50]!==w?(P=(0,o.jsxs)(R,{children:[C,w]}),e[49]=C,e[50]=w,e[51]=P):P=e[51];let L;return e[52]!==l||e[53]!==P?(L=(0,o.jsxs)(q,{className:"gap-0 py-0","data-testid":"ai-calls",children:[l,P]}),e[52]=l,e[53]=P,e[54]=L):L=e[54],L},"Pe"),Ee=p(n=>{let e=(0,O.c)(48),{totals:s,trend:a}=n,t=F(),c;e[0]!==s?(c=ke(s),e[0]=s,e[1]=c):c=e[1];let l=c,r;e[2]!==t||e[3]!==a?(r=a.length>=2?(0,o.jsx)(de,{ariaLabel:t("Cost per minute"),className:"h-7 w-24",series:a,testId:"ai-trend"}):void 0,e[2]=t,e[3]=a,e[4]=r):r=e[4];let i;e[5]!==l||e[6]!==t||e[7]!==s.estimatedCost||e[8]!==s.providerCost?(i=l==="none"?t("No cost reported"):(0,o.jsx)("span",{"data-testid":"ai-cost-split",children:t("{provider} provider-reported \xB7 {estimated} estimated",{estimated:E(s.estimatedCost),provider:E(s.providerCost)})}),e[5]=l,e[6]=t,e[7]=s.estimatedCost,e[8]=s.providerCost,e[9]=i):i=e[9];let u;e[10]!==t?(u=t("Total cost"),e[10]=t,e[11]=u):u=e[11];let m;e[12]!==s?(m=B(s),e[12]=s,e[13]=m):m=e[13];let k;e[14]!==l||e[15]!==m?(k=(0,o.jsx)(te,{provenance:l,value:m}),e[14]=l,e[15]=m,e[16]=k):k=e[16];let y;e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==k?(y=(0,o.jsx)($,{chart:r,footer:i,label:u,testId:"ai-total-cost",value:k}),e[17]=r,e[18]=i,e[19]=u,e[20]=k,e[21]=y):y=e[21];let b;e[22]!==t?(b=t("Input tokens"),e[22]=t,e[23]=b):b=e[23];let T;e[24]!==s.inputTokens?(T=_(s.inputTokens),e[24]=s.inputTokens,e[25]=T):T=e[25];let g;e[26]!==b||e[27]!==T?(g=(0,o.jsx)($,{label:b,testId:"ai-input-tokens",value:T}),e[26]=b,e[27]=T,e[28]=g):g=e[28];let d;e[29]!==t?(d=t("Output tokens"),e[29]=t,e[30]=d):d=e[30];let x;e[31]!==s.outputTokens?(x=_(s.outputTokens),e[31]=s.outputTokens,e[32]=x):x=e[32];let h;e[33]!==d||e[34]!==x?(h=(0,o.jsx)($,{label:d,testId:"ai-output-tokens",value:x}),e[33]=d,e[34]=x,e[35]=h):h=e[35];let f;e[36]!==t?(f=t("Calls"),e[36]=t,e[37]=f):f=e[37];let v;e[38]!==s.calls?(v=_(s.calls),e[38]=s.calls,e[39]=v):v=e[39];let C;e[40]!==f||e[41]!==v?(C=(0,o.jsx)($,{label:f,testId:"ai-calls-total",value:v}),e[40]=f,e[41]=v,e[42]=C):C=e[42];let N;return e[43]!==g||e[44]!==h||e[45]!==C||e[46]!==y?(N=(0,o.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"ai-totals",children:[y,g,h,C]}),e[43]=g,e[44]=h,e[45]=C,e[46]=y,e[47]=N):N=e[47],N},"Ke"),Ye=p(n=>{let e=(0,O.c)(29),{initialShardKey:s}=n,a=F(),{queryShardKey:t,setShardKey:c,shardKey:l}=le(s),r=ce(t),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let u;e[1]!==t?(u={live:!0,shardKey:t},e[1]=t,e[2]=u):u=e[2];let{data:m,error:k}=D(U.getTraces,i,u),y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={},e[3]=y):y=e[3];let b;e[4]!==t?(b={live:!0,shardKey:t},e[4]=t,e[5]=b):b=e[5];let{data:T}=D(U.getMetricHistory,y,b),g,d;e[6]!==m||e[7]!==T?(d=Oe(T,Ke(m)),g=d.trend.map(Le),e[6]=m,e[7]=T,e[8]=g,e[9]=d):(g=e[8],d=e[9]);let x=g,h;e[10]!==c||e[11]!==l?(h=(0,o.jsx)(re,{onChange:c,testId:"ai-shard-input",value:l}),e[10]=c,e[11]=l,e[12]=h):h=e[12];let f;e[13]!==k||e[14]!==t?(f=k===null?null:(0,o.jsx)(ie,{error:k,shardKey:t,testId:"ai-error"}),e[13]=k,e[14]=t,e[15]=f):f=e[15];let v;e[16]!==r||e[17]!==a||e[18]!==x||e[19]!==d.byFunction||e[20]!==d.byModel||e[21]!==d.calls||e[22]!==d.source||e[23]!==d.totals?(v=d.source==="none"?(0,o.jsx)(ae,{description:a("Spend shows up here once an action calls ctx.ai.model(...) \u2014 tokens and cost per function and per model."),testId:"ai-empty",title:a("No AI usage recorded")}):(0,o.jsxs)(o.Fragment,{children:[d.source==="live"?(0,o.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ai-live-only",children:a("No durable history yet \u2014 these totals come from the live trace ring and reset when the shard hibernates.")}):(0,o.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ai-window",children:a("Totals cover the retained metric history (up to the last 24 hours).")}),(0,o.jsx)(Ee,{totals:d.totals,trend:x}),(0,o.jsxs)("div",{className:"grid gap-3 xl:grid-cols-2",children:[(0,o.jsx)(he,{keyLabel:a("Function"),rows:d.byFunction,testId:"ai-by-function",title:a("By function")}),(0,o.jsx)(he,{keyLabel:a("Model"),rows:d.byModel,testId:"ai-by-model",title:a("By model")})]}),d.calls.length===0?(0,o.jsx)(q,{children:(0,o.jsx)(ne,{className:"p-4 text-xs text-muted-foreground","data-testid":"ai-no-calls",children:a("No recent calls in the live trace ring \u2014 it empties when the shard hibernates.")})}):(0,o.jsx)($e,{calls:d.calls,onOpenTrace:r})]}),e[16]=r,e[17]=a,e[18]=x,e[19]=d.byFunction,e[20]=d.byModel,e[21]=d.calls,e[22]=d.source,e[23]=d.totals,e[24]=v):v=e[24];let C;return e[25]!==h||e[26]!==f||e[27]!==v?(C=(0,o.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ai-panel",children:[h,f,v]}),e[25]=h,e[26]=f,e[27]=v,e[28]=C):C=e[28],C},"Ze");function Le(n){return n.providerCost+n.estimatedCost}p(Le,"Ue");export{Ye as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r,c as o}from"./chunk-ZSWW2UGP.js";import{a as e}from"./chunk-5PEAXTYQ.js";var a="lunora:traces:pending-filter",i=e(s=>{o(a,s,"session")},"i"),d=e(()=>{let s=r("session");if(s!==void 0)try{let n=s.getItem(a);if(n===null)return;let t=JSON.parse(n);return typeof t.traceId!="string"?void 0:{traceId:t.traceId,...typeof t.shardKey=="string"?{shardKey:t.shardKey}:{}}}catch{return}},"c"),p=e(()=>{try{r("session")?.removeItem(a)}catch{}},"d");export{i as a,d as b,p as c};
|