@lunora/studio 1.0.0-alpha.3 → 1.0.0-alpha.30

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.
Files changed (174) hide show
  1. package/__assets__/package-og.svg +1 -1
  2. package/dist/index.d.ts +29 -18
  3. package/dist/index.js +29 -29
  4. package/dist/mount.d.ts +1 -1
  5. package/dist/mount.js +1 -1
  6. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  7. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +24 -36
  8. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +13 -9
  9. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
  10. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
  11. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +147 -204
  12. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  13. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +107 -69
  14. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +41 -53
  15. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +37 -44
  16. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  17. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +39 -46
  18. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  19. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +15 -15
  20. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +44 -31
  21. package/dist/packem_chunks/SettingsPanel.js +390 -0
  22. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +12 -252
  23. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
  24. package/dist/packem_chunks/analytics-panel.js +261 -0
  25. package/dist/packem_chunks/auth-config-panel.js +179 -0
  26. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  27. package/dist/packem_chunks/dashboards-panel.js +779 -0
  28. package/dist/packem_chunks/fanout-panel.js +481 -0
  29. package/dist/packem_chunks/flags-panel.js +176 -0
  30. package/dist/packem_chunks/kv-browser.js +1896 -0
  31. package/dist/packem_chunks/log-drains-panel.js +273 -0
  32. package/dist/packem_chunks/organizations-panel.js +670 -0
  33. package/dist/packem_chunks/payments-panel.js +185 -0
  34. package/dist/packem_chunks/permissions-panel.js +804 -0
  35. package/dist/packem_chunks/queues-panel.js +147 -0
  36. package/dist/packem_chunks/rls-panel.js +313 -0
  37. package/dist/packem_chunks/schedule-panel.js +831 -0
  38. package/dist/packem_chunks/sparkline.js +79 -0
  39. package/dist/packem_chunks/storage-rules-panel.js +138 -0
  40. package/dist/packem_chunks/subscriptions-panel.js +236 -0
  41. package/dist/packem_chunks/users-panel.js +1265 -0
  42. package/dist/packem_chunks/vector-browser.js +281 -0
  43. package/dist/packem_chunks/workflows-panel.js +562 -0
  44. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-CdaxLGkE.js} +3 -0
  45. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-B6u_wnz-.js} +2 -2
  46. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Drz4UO0a.js} +2 -1
  47. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-B5BertvU.js} +1 -1
  48. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-ANTHLWWh.js} +198 -247
  49. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-CjgTG_wa.js} +37 -66
  50. package/dist/packem_shared/HomePanel-c2FodE9t.js +14 -0
  51. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CspFdbUT.js} +2 -1
  52. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-BEJXtsBn.js} +163 -60
  53. package/dist/packem_shared/Studio-CVTtA_sB.js +16 -0
  54. package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-BSYV2fz6.js} +277 -3
  55. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-DzqyvUU3.js} +1 -1
  56. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-B6MyY_al.d.ts} +1 -1
  57. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-Bb__F5-u.js} +1 -1
  58. package/dist/packem_shared/browser-storage-d03UsV7v.js +249 -0
  59. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  60. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-Dsg6nRjo.js} +1 -1
  61. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  62. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-D7nNzBYm.js} +4 -99
  63. package/dist/packem_shared/{HomePanel-Cw16stjq.js → home-panel-aOR_drVv.js} +833 -469
  64. package/dist/packem_shared/{internal-rXJEAhXS.js → internal-FcNZ3beb.js} +1 -1
  65. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  66. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-Doy1XlQq.js} +4 -44
  67. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  68. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  69. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-KgMPHS4u.js} +1 -1
  70. package/dist/packem_shared/studio-dMTJ-kRR.js +3987 -0
  71. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  72. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-VMo0ftxD.js} +1 -1
  73. package/dist/packem_shared/use-admin-query-BViPA3US.js +105 -0
  74. package/dist/packem_shared/use-auth-capabilities-BHkoBnbZ.js +32 -0
  75. package/dist/standalone/chunk-2DS7JLWL.js +13 -0
  76. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  77. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  78. package/dist/standalone/chunk-2PDQ4KZ6.js +1 -0
  79. package/dist/standalone/chunk-3BP4BTLR.js +4 -0
  80. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  81. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  82. package/dist/standalone/chunk-57LYXHXH.js +1 -0
  83. package/dist/standalone/chunk-5NSZVXCS.js +1 -0
  84. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  85. package/dist/standalone/chunk-63XKJQTQ.js +1 -0
  86. package/dist/standalone/chunk-6RC6L33K.js +4 -0
  87. package/dist/standalone/chunk-6VTGE3WJ.js +1 -0
  88. package/dist/standalone/chunk-7PBZKXYA.js +1 -0
  89. package/dist/standalone/chunk-7POIIWC5.js +3 -0
  90. package/dist/standalone/chunk-7RYIQKZA.js +1 -0
  91. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  92. package/dist/standalone/chunk-AB6QGMBF.js +1 -0
  93. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  94. package/dist/standalone/chunk-AQGOX5DK.js +1 -0
  95. package/dist/standalone/chunk-ASLGNHAX.js +1 -0
  96. package/dist/standalone/chunk-BHTPZS7L.js +4 -0
  97. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  98. package/dist/standalone/chunk-D7HKX4DI.js +1 -0
  99. package/dist/standalone/chunk-DGWTR4G7.js +1 -0
  100. package/dist/standalone/chunk-DSX53PBM.js +1 -0
  101. package/dist/standalone/chunk-DV2MNASX.js +1 -0
  102. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  103. package/dist/standalone/chunk-E7AVZZKO.js +1 -0
  104. package/dist/standalone/chunk-EGJX34WM.js +1 -0
  105. package/dist/standalone/chunk-FCR3HKFV.js +1 -0
  106. package/dist/standalone/chunk-FKO3HO6I.js +4 -0
  107. package/dist/standalone/chunk-FQKNJSRA.js +76 -0
  108. package/dist/standalone/chunk-G2TFEWEQ.js +4 -0
  109. package/dist/standalone/chunk-GABMIICA.js +1 -0
  110. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  111. package/dist/standalone/chunk-GZXPPJVK.js +1 -0
  112. package/dist/standalone/chunk-HFBRE65A.js +1 -0
  113. package/dist/standalone/chunk-HFMQNUBC.js +1 -0
  114. package/dist/standalone/chunk-HG7Q5B3H.js +1 -0
  115. package/dist/standalone/chunk-HTQL7AXU.js +1 -0
  116. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  117. package/dist/standalone/chunk-ITLLHEVG.js +1 -0
  118. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  119. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  120. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  121. package/dist/standalone/chunk-KG3QTFWE.js +1 -0
  122. package/dist/standalone/chunk-KGS7KM4A.js +2 -0
  123. package/dist/standalone/chunk-KODWGUAB.js +1 -0
  124. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  125. package/dist/standalone/chunk-MGFEVTRI.js +1 -0
  126. package/dist/standalone/chunk-N2QDG3MW.js +1 -0
  127. package/dist/standalone/chunk-N4JI6VQD.js +1 -0
  128. package/dist/standalone/chunk-NNISYDNI.js +1 -0
  129. package/dist/standalone/chunk-O4PXDNR3.js +1 -0
  130. package/dist/standalone/chunk-O77VNUFD.js +1 -0
  131. package/dist/standalone/chunk-OD2POGPJ.js +1 -0
  132. package/dist/standalone/chunk-OXCK3ZUG.js +1 -0
  133. package/dist/standalone/chunk-P7DSVO4U.js +1 -0
  134. package/dist/standalone/chunk-PKAM3N5C.js +1 -0
  135. package/dist/standalone/chunk-QGXGBHQO.js +1 -0
  136. package/dist/standalone/chunk-QHA3TAEJ.js +1 -0
  137. package/dist/standalone/chunk-QQWC62X7.js +1 -0
  138. package/dist/standalone/chunk-RMYA7NAH.js +1 -0
  139. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  140. package/dist/standalone/chunk-S53RUBW5.js +1 -0
  141. package/dist/standalone/chunk-SB4GT6PK.js +1 -0
  142. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  143. package/dist/standalone/chunk-SHIOUDOT.js +1 -0
  144. package/dist/standalone/chunk-SIDRSX7Y.js +1 -0
  145. package/dist/standalone/chunk-SVR644RF.js +1 -0
  146. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  147. package/dist/standalone/chunk-TBMYIZIO.js +1 -0
  148. package/dist/standalone/chunk-TICVNLPM.js +1 -0
  149. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  150. package/dist/standalone/chunk-UGMRUEBU.js +1 -0
  151. package/dist/standalone/chunk-UII66UVF.js +1 -0
  152. package/dist/standalone/chunk-VJPQUBN6.js +8 -0
  153. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  154. package/dist/standalone/chunk-VMJKJWG6.js +1 -0
  155. package/dist/standalone/chunk-VPDPN5RR.js +2 -0
  156. package/dist/standalone/chunk-VSEGZA3J.js +1 -0
  157. package/dist/standalone/chunk-VXBZQIGY.js +4 -0
  158. package/dist/standalone/chunk-W7PCVQTE.js +1 -0
  159. package/dist/standalone/chunk-XLILSHPE.js +1 -0
  160. package/dist/standalone/chunk-XURNGQSS.js +1 -0
  161. package/dist/standalone/chunk-YJGANMU7.js +18 -0
  162. package/dist/standalone/chunk-YQQJ4N6U.js +1 -0
  163. package/dist/standalone/chunk-ZH7UES4T.js +2 -0
  164. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  165. package/dist/standalone/chunk-ZQCVDXDL.js +1 -0
  166. package/dist/standalone/studio.js +104 -246
  167. package/dist/styles.css +1 -1
  168. package/package.json +13 -12
  169. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  170. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  171. package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
  172. package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
  173. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  174. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -0,0 +1,3987 @@
1
+ 'use client';
2
+ import { c } from 'react/compiler-runtime';
3
+ import { createRootRoute, createRoute, createBrowserHistory, createMemoryHistory, createRouter, useNavigate, useRouterState, useSearch, Outlet, RouterProvider } from '@tanstack/react-router';
4
+ import * as React from 'react';
5
+ import { useState, useEffect, createContext, use, lazy, Suspense } from 'react';
6
+ import { c as cn } from './utils-B05Dmz_H.js';
7
+ import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
8
+ import { ErrorBoundary } from './ErrorBoundary-BzAApI7J.js';
9
+ import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { motion } from 'motion/react';
11
+ import { B as Badge } from './badge-B2PKA1-5.js';
12
+ import { I as Input } from './input-XH4r1Pt1.js';
13
+ import { Popover as Popover$1 } from '@base-ui/react/popover';
14
+ import { Cancel01Icon, SidebarLeftIcon } from '@hugeicons/core-free-icons';
15
+ import { HugeiconsIcon } from '@hugeicons/react';
16
+ import { mergeProps } from '@base-ui/react/merge-props';
17
+ import { useRender } from '@base-ui/react/use-render';
18
+ import { cva } from 'class-variance-authority';
19
+ import { B as Button } from './button-BhsN2uZH.js';
20
+ import { Dialog } from '@base-ui/react/dialog';
21
+ import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
22
+ import { S as Skeleton } from './skeleton-CGhL0p20.js';
23
+ import { u as useStudioFeatures, H as HomePanel } from './home-panel-aOR_drVv.js';
24
+ import { StudioI18nProvider } from './StudioI18nProvider-B-tDCZIi.js';
25
+ import { v as validateDataViewSearch } from './data-view-params-Cd6yRVbv.js';
26
+ import { f as fireAndForget } from './internal-FcNZ3beb.js';
27
+ import { CommandPalette, openCommandPalette } from './CommandPalette-B5BertvU.js';
28
+
29
+ const DARK_MEDIA_QUERY = "(prefers-color-scheme: dark)";
30
+ const store = () => {
31
+ try {
32
+ return globalThis.localStorage;
33
+ } catch {
34
+ return void 0;
35
+ }
36
+ };
37
+ const isPreference = (value) => value === "system" || value === "light" || value === "dark";
38
+ const matchMedia = () => globalThis.matchMedia;
39
+ const THEME_STORAGE_KEY = "lunora-studio-theme";
40
+ const THEME_ORDER = ["system", "light", "dark"];
41
+ const loadThemePreference = (fallback = "system") => {
42
+ try {
43
+ const raw = store()?.getItem(THEME_STORAGE_KEY);
44
+ return isPreference(raw) ? raw : fallback;
45
+ } catch {
46
+ return fallback;
47
+ }
48
+ };
49
+ const saveThemePreference = (preference) => {
50
+ const storage = store();
51
+ if (storage === void 0) {
52
+ return;
53
+ }
54
+ try {
55
+ storage.setItem(THEME_STORAGE_KEY, preference);
56
+ } catch {
57
+ }
58
+ };
59
+ const getSystemTheme = () => {
60
+ try {
61
+ return matchMedia()?.(DARK_MEDIA_QUERY).matches ? "dark" : "light";
62
+ } catch {
63
+ return "light";
64
+ }
65
+ };
66
+ const resolveTheme = (preference, system) => preference === "system" ? system : preference;
67
+ const subscribeSystemTheme = (onChange) => {
68
+ let mql;
69
+ try {
70
+ mql = matchMedia()?.(DARK_MEDIA_QUERY);
71
+ } catch {
72
+ mql = void 0;
73
+ }
74
+ if (mql === void 0) {
75
+ return () => {
76
+ };
77
+ }
78
+ const handler = (event) => {
79
+ onChange(event.matches ? "dark" : "light");
80
+ };
81
+ mql.addEventListener("change", handler);
82
+ return () => {
83
+ mql.removeEventListener("change", handler);
84
+ };
85
+ };
86
+
87
+ const ThemeContext = /* @__PURE__ */ createContext(null);
88
+ const ThemeProvider = ({
89
+ children,
90
+ defaultTheme = "system"
91
+ }) => {
92
+ const [theme, setThemeState] = useState(() => loadThemePreference(defaultTheme));
93
+ const [systemTheme, setSystemTheme] = useState(() => getSystemTheme());
94
+ useEffect(() => subscribeSystemTheme(setSystemTheme), []);
95
+ const setTheme = (next) => {
96
+ saveThemePreference(next);
97
+ setThemeState(next);
98
+ };
99
+ const cycleTheme = () => {
100
+ setThemeState((current) => {
101
+ const next_0 = THEME_ORDER[(THEME_ORDER.indexOf(current) + 1) % THEME_ORDER.length] ?? current;
102
+ saveThemePreference(next_0);
103
+ return next_0;
104
+ });
105
+ };
106
+ const value = {
107
+ cycleTheme,
108
+ resolvedTheme: resolveTheme(theme, systemTheme),
109
+ setTheme,
110
+ systemTheme,
111
+ theme
112
+ };
113
+ return /* @__PURE__ */ jsxDEV(ThemeContext, {
114
+ value,
115
+ children
116
+ }, void 0, false);
117
+ };
118
+ const useTheme = () => {
119
+ const context = use(ThemeContext);
120
+ if (context === null) {
121
+ throw new Error("useTheme must be used within a <ThemeProvider>");
122
+ }
123
+ return context;
124
+ };
125
+
126
+ function TooltipProvider({
127
+ delay = 0,
128
+ ...props
129
+ }) {
130
+ return /* @__PURE__ */ jsxDEV(Tooltip$1.Provider, {
131
+ "data-slot": "tooltip-provider",
132
+ delay,
133
+ ...props
134
+ }, void 0, false);
135
+ }
136
+ function Tooltip(t0) {
137
+ const $ = c(4);
138
+ let props;
139
+ if ($[0] !== t0) {
140
+ ({
141
+ ...props
142
+ } = t0);
143
+ $[0] = t0;
144
+ $[1] = props;
145
+ } else {
146
+ props = $[1];
147
+ }
148
+ let t1;
149
+ if ($[2] !== props) {
150
+ t1 = /* @__PURE__ */ jsxDEV(Tooltip$1.Root, {
151
+ "data-slot": "tooltip",
152
+ ...props
153
+ }, void 0, false);
154
+ $[2] = props;
155
+ $[3] = t1;
156
+ } else {
157
+ t1 = $[3];
158
+ }
159
+ return t1;
160
+ }
161
+ function TooltipTrigger(t0) {
162
+ const $ = c(4);
163
+ let props;
164
+ if ($[0] !== t0) {
165
+ ({
166
+ ...props
167
+ } = t0);
168
+ $[0] = t0;
169
+ $[1] = props;
170
+ } else {
171
+ props = $[1];
172
+ }
173
+ let t1;
174
+ if ($[2] !== props) {
175
+ t1 = /* @__PURE__ */ jsxDEV(Tooltip$1.Trigger, {
176
+ "data-slot": "tooltip-trigger",
177
+ ...props
178
+ }, void 0, false);
179
+ $[2] = props;
180
+ $[3] = t1;
181
+ } else {
182
+ t1 = $[3];
183
+ }
184
+ return t1;
185
+ }
186
+ function TooltipContent({
187
+ className,
188
+ side = "top",
189
+ sideOffset = 4,
190
+ align = "center",
191
+ alignOffset = 0,
192
+ children,
193
+ ...props
194
+ }) {
195
+ return /* @__PURE__ */ jsxDEV(Tooltip$1.Portal, {
196
+ children: /* @__PURE__ */ jsxDEV(Tooltip$1.Positioner, {
197
+ align,
198
+ alignOffset,
199
+ side,
200
+ sideOffset,
201
+ className: "isolate z-50",
202
+ children: /* @__PURE__ */ jsxDEV(Tooltip$1.Popup, {
203
+ "data-slot": "tooltip-content",
204
+ className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-md data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
205
+ ...props,
206
+ children: [children, /* @__PURE__ */ jsxDEV(Tooltip$1.Arrow, {
207
+ className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"
208
+ }, void 0, false)]
209
+ }, void 0, true)
210
+ }, void 0, false)
211
+ }, void 0, false);
212
+ }
213
+
214
+ const BrandMark = (t0) => {
215
+ const $ = c(5);
216
+ const {
217
+ className
218
+ } = t0;
219
+ let t1;
220
+ if ($[0] !== className) {
221
+ t1 = cn("h-full w-full text-foreground", className);
222
+ $[0] = className;
223
+ $[1] = t1;
224
+ } else {
225
+ t1 = $[1];
226
+ }
227
+ let t2;
228
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
229
+ t2 = /* @__PURE__ */ jsxDEV("path", {
230
+ d: "M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",
231
+ fillRule: "evenodd"
232
+ }, void 0, false);
233
+ $[2] = t2;
234
+ } else {
235
+ t2 = $[2];
236
+ }
237
+ let t3;
238
+ if ($[3] !== t1) {
239
+ t3 = /* @__PURE__ */ jsxDEV("svg", {
240
+ "aria-hidden": "true",
241
+ className: t1,
242
+ fill: "currentColor",
243
+ viewBox: "0 0 543 446",
244
+ children: t2
245
+ }, void 0, false);
246
+ $[3] = t1;
247
+ $[4] = t3;
248
+ } else {
249
+ t3 = $[4];
250
+ }
251
+ return t3;
252
+ };
253
+
254
+ const RULES_BANNER_DISMISSED_KEY = "lunora.studio.rulesBannerDismissed";
255
+ const readBannerDismissed = () => {
256
+ try {
257
+ return globalThis.localStorage.getItem(RULES_BANNER_DISMISSED_KEY) === "1";
258
+ } catch {
259
+ return false;
260
+ }
261
+ };
262
+ const writeBannerDismissed = () => {
263
+ try {
264
+ globalThis.localStorage.setItem(RULES_BANNER_DISMISSED_KEY, "1");
265
+ } catch {
266
+ }
267
+ };
268
+ const RulesBanner = () => {
269
+ const $ = c(18);
270
+ const t = useT();
271
+ const [dismissed, setDismissed] = useState(_temp$1);
272
+ let t0;
273
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
274
+ t0 = () => {
275
+ setDismissed(true);
276
+ writeBannerDismissed();
277
+ };
278
+ $[0] = t0;
279
+ } else {
280
+ t0 = $[0];
281
+ }
282
+ const dismiss = t0;
283
+ if (dismissed) {
284
+ return null;
285
+ }
286
+ let t1;
287
+ if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
288
+ t1 = /* @__PURE__ */ jsxDEV("span", {
289
+ "aria-hidden": "true",
290
+ className: "text-warning",
291
+ children: "⚠"
292
+ }, void 0, false);
293
+ $[1] = t1;
294
+ } else {
295
+ t1 = $[1];
296
+ }
297
+ let t2;
298
+ if ($[2] !== t) {
299
+ t2 = t("Lunora AI rules aren't installed.");
300
+ $[2] = t;
301
+ $[3] = t2;
302
+ } else {
303
+ t2 = $[3];
304
+ }
305
+ let t3;
306
+ if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
307
+ t3 = /* @__PURE__ */ jsxDEV("code", {
308
+ className: "rounded bg-muted px-1 py-0.5 font-mono text-[11px]",
309
+ children: "lunora rules install"
310
+ }, void 0, false);
311
+ $[4] = t3;
312
+ } else {
313
+ t3 = $[4];
314
+ }
315
+ let t4;
316
+ if ($[5] !== t) {
317
+ t4 = t("lets your coding agent use Lunora correctly.");
318
+ $[5] = t;
319
+ $[6] = t4;
320
+ } else {
321
+ t4 = $[6];
322
+ }
323
+ let t5;
324
+ if ($[7] !== t2 || $[8] !== t4) {
325
+ t5 = /* @__PURE__ */ jsxDEV("span", {
326
+ children: [t2, " ", t3, " ", t4]
327
+ }, void 0, true);
328
+ $[7] = t2;
329
+ $[8] = t4;
330
+ $[9] = t5;
331
+ } else {
332
+ t5 = $[9];
333
+ }
334
+ let t6;
335
+ if ($[10] !== t) {
336
+ t6 = t("Dismiss");
337
+ $[10] = t;
338
+ $[11] = t6;
339
+ } else {
340
+ t6 = $[11];
341
+ }
342
+ let t7;
343
+ if ($[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
344
+ t7 = /* @__PURE__ */ jsxDEV("svg", {
345
+ "aria-hidden": "true",
346
+ className: "size-3.5",
347
+ fill: "none",
348
+ stroke: "currentColor",
349
+ strokeLinecap: "round",
350
+ strokeWidth: 1.8,
351
+ viewBox: "0 0 24 24",
352
+ children: /* @__PURE__ */ jsxDEV("path", {
353
+ d: "M18 6 6 18M6 6l12 12"
354
+ }, void 0, false)
355
+ }, void 0, false);
356
+ $[12] = t7;
357
+ } else {
358
+ t7 = $[12];
359
+ }
360
+ let t8;
361
+ if ($[13] !== t6) {
362
+ t8 = /* @__PURE__ */ jsxDEV("button", {
363
+ "aria-label": t6,
364
+ className: "ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent",
365
+ "data-testid": "dash-app-rules-banner-dismiss",
366
+ onClick: dismiss,
367
+ type: "button",
368
+ children: t7
369
+ }, void 0, false);
370
+ $[13] = t6;
371
+ $[14] = t8;
372
+ } else {
373
+ t8 = $[14];
374
+ }
375
+ let t9;
376
+ if ($[15] !== t5 || $[16] !== t8) {
377
+ t9 = /* @__PURE__ */ jsxDEV("div", {
378
+ className: "flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground",
379
+ "data-testid": "dash-app-rules-banner",
380
+ role: "note",
381
+ children: [t1, t5, t8]
382
+ }, void 0, true);
383
+ $[15] = t5;
384
+ $[16] = t8;
385
+ $[17] = t9;
386
+ } else {
387
+ t9 = $[17];
388
+ }
389
+ return t9;
390
+ };
391
+ function _temp$1() {
392
+ return readBannerDismissed();
393
+ }
394
+
395
+ const MonitorIcon = () => {
396
+ const $ = c(1);
397
+ let t0;
398
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
399
+ t0 = /* @__PURE__ */ jsxDEV("svg", {
400
+ "aria-hidden": "true",
401
+ className: "size-3.5",
402
+ fill: "none",
403
+ stroke: "currentColor",
404
+ strokeLinecap: "round",
405
+ strokeLinejoin: "round",
406
+ strokeWidth: 1.8,
407
+ viewBox: "0 0 24 24",
408
+ children: [/* @__PURE__ */ jsxDEV("rect", {
409
+ height: "14",
410
+ rx: "2",
411
+ width: "20",
412
+ x: "2",
413
+ y: "3"
414
+ }, void 0, false), /* @__PURE__ */ jsxDEV("path", {
415
+ d: "M8 21h8M12 17v4"
416
+ }, void 0, false)]
417
+ }, void 0, true);
418
+ $[0] = t0;
419
+ } else {
420
+ t0 = $[0];
421
+ }
422
+ return t0;
423
+ };
424
+ const SunIcon = () => {
425
+ const $ = c(1);
426
+ let t0;
427
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
428
+ t0 = /* @__PURE__ */ jsxDEV("svg", {
429
+ "aria-hidden": "true",
430
+ className: "size-3.5",
431
+ fill: "none",
432
+ stroke: "currentColor",
433
+ strokeLinecap: "round",
434
+ strokeLinejoin: "round",
435
+ strokeWidth: 1.8,
436
+ viewBox: "0 0 24 24",
437
+ children: [/* @__PURE__ */ jsxDEV("circle", {
438
+ cx: "12",
439
+ cy: "12",
440
+ r: "4"
441
+ }, void 0, false), /* @__PURE__ */ jsxDEV("path", {
442
+ d: "M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"
443
+ }, void 0, false)]
444
+ }, void 0, true);
445
+ $[0] = t0;
446
+ } else {
447
+ t0 = $[0];
448
+ }
449
+ return t0;
450
+ };
451
+ const MoonIcon = () => {
452
+ const $ = c(1);
453
+ let t0;
454
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
455
+ t0 = /* @__PURE__ */ jsxDEV("svg", {
456
+ "aria-hidden": "true",
457
+ className: "size-3.5",
458
+ fill: "none",
459
+ stroke: "currentColor",
460
+ strokeLinecap: "round",
461
+ strokeLinejoin: "round",
462
+ strokeWidth: 1.8,
463
+ viewBox: "0 0 24 24",
464
+ children: /* @__PURE__ */ jsxDEV("path", {
465
+ d: "M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"
466
+ }, void 0, false)
467
+ }, void 0, false);
468
+ $[0] = t0;
469
+ } else {
470
+ t0 = $[0];
471
+ }
472
+ return t0;
473
+ };
474
+ const OPTIONS = [{
475
+ Icon: MonitorIcon,
476
+ value: "system"
477
+ }, {
478
+ Icon: SunIcon,
479
+ value: "light"
480
+ }, {
481
+ Icon: MoonIcon,
482
+ value: "dark"
483
+ }];
484
+ const ThemeToggle = () => {
485
+ const $ = c(19);
486
+ const {
487
+ theme,
488
+ setTheme
489
+ } = useTheme();
490
+ const t = useT();
491
+ let t0;
492
+ if ($[0] !== t) {
493
+ t0 = t("Dark theme");
494
+ $[0] = t;
495
+ $[1] = t0;
496
+ } else {
497
+ t0 = $[1];
498
+ }
499
+ let t1;
500
+ if ($[2] !== t) {
501
+ t1 = t("Light theme");
502
+ $[2] = t;
503
+ $[3] = t1;
504
+ } else {
505
+ t1 = $[3];
506
+ }
507
+ let t2;
508
+ if ($[4] !== t) {
509
+ t2 = t("System theme");
510
+ $[4] = t;
511
+ $[5] = t2;
512
+ } else {
513
+ t2 = $[5];
514
+ }
515
+ let t3;
516
+ if ($[6] !== t0 || $[7] !== t1 || $[8] !== t2) {
517
+ t3 = {
518
+ dark: t0,
519
+ light: t1,
520
+ system: t2
521
+ };
522
+ $[6] = t0;
523
+ $[7] = t1;
524
+ $[8] = t2;
525
+ $[9] = t3;
526
+ } else {
527
+ t3 = $[9];
528
+ }
529
+ const label = t3;
530
+ let t4;
531
+ if ($[10] !== t) {
532
+ t4 = t("Theme");
533
+ $[10] = t;
534
+ $[11] = t4;
535
+ } else {
536
+ t4 = $[11];
537
+ }
538
+ let t5;
539
+ if ($[12] !== label || $[13] !== setTheme || $[14] !== theme) {
540
+ t5 = OPTIONS.map((t62) => {
541
+ const {
542
+ Icon,
543
+ value
544
+ } = t62;
545
+ const active = theme === value;
546
+ return /* @__PURE__ */ jsxDEV("button", {
547
+ "aria-checked": active,
548
+ "aria-label": label[value],
549
+ className: cn("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent", active ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
550
+ "data-testid": `dash-app-theme-${value}`,
551
+ onClick: () => {
552
+ setTheme(value);
553
+ },
554
+ role: "radio",
555
+ title: label[value],
556
+ type: "button",
557
+ children: [active && /* @__PURE__ */ jsxDEV(motion.span, {
558
+ className: "absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",
559
+ layoutId: "studio-theme-active",
560
+ transition: {
561
+ bounce: 0.1,
562
+ duration: 0.45,
563
+ type: "spring"
564
+ }
565
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
566
+ className: "relative",
567
+ children: /* @__PURE__ */ jsxDEV(Icon, {}, void 0, false)
568
+ }, void 0, false)]
569
+ }, value, true);
570
+ });
571
+ $[12] = label;
572
+ $[13] = setTheme;
573
+ $[14] = theme;
574
+ $[15] = t5;
575
+ } else {
576
+ t5 = $[15];
577
+ }
578
+ let t6;
579
+ if ($[16] !== t4 || $[17] !== t5) {
580
+ t6 = /* @__PURE__ */ jsxDEV("div", {
581
+ "aria-label": t4,
582
+ className: "inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5",
583
+ "data-testid": "dash-app-theme",
584
+ role: "radiogroup",
585
+ children: t5
586
+ }, void 0, false);
587
+ $[16] = t4;
588
+ $[17] = t5;
589
+ $[18] = t6;
590
+ } else {
591
+ t6 = $[18];
592
+ }
593
+ return t6;
594
+ };
595
+
596
+ function Popover(t0) {
597
+ const $ = c(4);
598
+ let props;
599
+ if ($[0] !== t0) {
600
+ ({
601
+ ...props
602
+ } = t0);
603
+ $[0] = t0;
604
+ $[1] = props;
605
+ } else {
606
+ props = $[1];
607
+ }
608
+ let t1;
609
+ if ($[2] !== props) {
610
+ t1 = /* @__PURE__ */ jsxDEV(Popover$1.Root, {
611
+ "data-slot": "popover",
612
+ ...props
613
+ }, void 0, false);
614
+ $[2] = props;
615
+ $[3] = t1;
616
+ } else {
617
+ t1 = $[3];
618
+ }
619
+ return t1;
620
+ }
621
+ function PopoverTrigger(t0) {
622
+ const $ = c(4);
623
+ let props;
624
+ if ($[0] !== t0) {
625
+ ({
626
+ ...props
627
+ } = t0);
628
+ $[0] = t0;
629
+ $[1] = props;
630
+ } else {
631
+ props = $[1];
632
+ }
633
+ let t1;
634
+ if ($[2] !== props) {
635
+ t1 = /* @__PURE__ */ jsxDEV(Popover$1.Trigger, {
636
+ "data-slot": "popover-trigger",
637
+ ...props
638
+ }, void 0, false);
639
+ $[2] = props;
640
+ $[3] = t1;
641
+ } else {
642
+ t1 = $[3];
643
+ }
644
+ return t1;
645
+ }
646
+ function PopoverContent({
647
+ align = "end",
648
+ alignOffset = 0,
649
+ className,
650
+ keepMounted = false,
651
+ side = "bottom",
652
+ sideOffset = 6,
653
+ ...props
654
+ }) {
655
+ return /* @__PURE__ */ jsxDEV(Popover$1.Portal, {
656
+ keepMounted,
657
+ children: /* @__PURE__ */ jsxDEV(Popover$1.Positioner, {
658
+ align,
659
+ alignOffset,
660
+ className: "isolate z-50 outline-none",
661
+ side,
662
+ sideOffset,
663
+ children: /* @__PURE__ */ jsxDEV(Popover$1.Popup, {
664
+ className: cn("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none 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", className),
665
+ "data-slot": "popover-content",
666
+ ...props
667
+ }, void 0, false)
668
+ }, void 0, false)
669
+ }, void 0, false);
670
+ }
671
+
672
+ const MOBILE_BREAKPOINT = 768;
673
+ function useIsMobile() {
674
+ const $ = c(2);
675
+ const [isMobile, setIsMobile] = useState(void 0);
676
+ let t0;
677
+ let t1;
678
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
679
+ t0 = () => {
680
+ const mql = globalThis.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
681
+ const onChange = () => {
682
+ setIsMobile(globalThis.innerWidth < MOBILE_BREAKPOINT);
683
+ };
684
+ mql.addEventListener("change", onChange);
685
+ setIsMobile(globalThis.innerWidth < MOBILE_BREAKPOINT);
686
+ return () => {
687
+ mql.removeEventListener("change", onChange);
688
+ };
689
+ };
690
+ t1 = [];
691
+ $[0] = t0;
692
+ $[1] = t1;
693
+ } else {
694
+ t0 = $[0];
695
+ t1 = $[1];
696
+ }
697
+ useEffect(t0, t1);
698
+ return Boolean(isMobile);
699
+ }
700
+
701
+ function Sheet(t0) {
702
+ const $ = c(4);
703
+ let props;
704
+ if ($[0] !== t0) {
705
+ ({
706
+ ...props
707
+ } = t0);
708
+ $[0] = t0;
709
+ $[1] = props;
710
+ } else {
711
+ props = $[1];
712
+ }
713
+ let t1;
714
+ if ($[2] !== props) {
715
+ t1 = /* @__PURE__ */ jsxDEV(Dialog.Root, {
716
+ "data-slot": "sheet",
717
+ ...props
718
+ }, void 0, false);
719
+ $[2] = props;
720
+ $[3] = t1;
721
+ } else {
722
+ t1 = $[3];
723
+ }
724
+ return t1;
725
+ }
726
+ function SheetPortal(t0) {
727
+ const $ = c(4);
728
+ let props;
729
+ if ($[0] !== t0) {
730
+ ({
731
+ ...props
732
+ } = t0);
733
+ $[0] = t0;
734
+ $[1] = props;
735
+ } else {
736
+ props = $[1];
737
+ }
738
+ let t1;
739
+ if ($[2] !== props) {
740
+ t1 = /* @__PURE__ */ jsxDEV(Dialog.Portal, {
741
+ "data-slot": "sheet-portal",
742
+ ...props
743
+ }, void 0, false);
744
+ $[2] = props;
745
+ $[3] = t1;
746
+ } else {
747
+ t1 = $[3];
748
+ }
749
+ return t1;
750
+ }
751
+ function SheetOverlay(t0) {
752
+ const $ = c(8);
753
+ let className;
754
+ let props;
755
+ if ($[0] !== t0) {
756
+ ({
757
+ className,
758
+ ...props
759
+ } = t0);
760
+ $[0] = t0;
761
+ $[1] = className;
762
+ $[2] = props;
763
+ } else {
764
+ className = $[1];
765
+ props = $[2];
766
+ }
767
+ let t1;
768
+ if ($[3] !== className) {
769
+ t1 = cn("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:", className);
770
+ $[3] = className;
771
+ $[4] = t1;
772
+ } else {
773
+ t1 = $[4];
774
+ }
775
+ let t2;
776
+ if ($[5] !== props || $[6] !== t1) {
777
+ t2 = /* @__PURE__ */ jsxDEV(Dialog.Backdrop, {
778
+ "data-slot": "sheet-overlay",
779
+ className: t1,
780
+ ...props
781
+ }, void 0, false);
782
+ $[5] = props;
783
+ $[6] = t1;
784
+ $[7] = t2;
785
+ } else {
786
+ t2 = $[7];
787
+ }
788
+ return t2;
789
+ }
790
+ function SheetContent({
791
+ className,
792
+ children,
793
+ side = "right",
794
+ showCloseButton = true,
795
+ ...props
796
+ }) {
797
+ return /* @__PURE__ */ jsxDEV(SheetPortal, {
798
+ children: [/* @__PURE__ */ jsxDEV(SheetOverlay, {}, void 0, false), /* @__PURE__ */ jsxDEV(Dialog.Popup, {
799
+ "data-slot": "sheet-content",
800
+ "data-side": side,
801
+ className: cn("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className),
802
+ ...props,
803
+ children: [children, showCloseButton && /* @__PURE__ */ jsxDEV(Dialog.Close, {
804
+ "data-slot": "sheet-close",
805
+ render: /* @__PURE__ */ jsxDEV(Button, {
806
+ variant: "ghost",
807
+ className: "absolute top-3 end-3",
808
+ size: "icon-sm"
809
+ }, void 0, false),
810
+ children: [/* @__PURE__ */ jsxDEV(HugeiconsIcon, {
811
+ icon: Cancel01Icon,
812
+ strokeWidth: 2
813
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
814
+ className: "sr-only",
815
+ children: "Close"
816
+ }, void 0, false)]
817
+ }, void 0, true)]
818
+ }, void 0, true)]
819
+ }, void 0, true);
820
+ }
821
+ function SheetHeader(t0) {
822
+ const $ = c(8);
823
+ let className;
824
+ let props;
825
+ if ($[0] !== t0) {
826
+ ({
827
+ className,
828
+ ...props
829
+ } = t0);
830
+ $[0] = t0;
831
+ $[1] = className;
832
+ $[2] = props;
833
+ } else {
834
+ className = $[1];
835
+ props = $[2];
836
+ }
837
+ let t1;
838
+ if ($[3] !== className) {
839
+ t1 = cn("flex flex-col gap-0.5 p-4", className);
840
+ $[3] = className;
841
+ $[4] = t1;
842
+ } else {
843
+ t1 = $[4];
844
+ }
845
+ let t2;
846
+ if ($[5] !== props || $[6] !== t1) {
847
+ t2 = /* @__PURE__ */ jsxDEV("div", {
848
+ "data-slot": "sheet-header",
849
+ className: t1,
850
+ ...props
851
+ }, void 0, false);
852
+ $[5] = props;
853
+ $[6] = t1;
854
+ $[7] = t2;
855
+ } else {
856
+ t2 = $[7];
857
+ }
858
+ return t2;
859
+ }
860
+ function SheetTitle(t0) {
861
+ const $ = c(8);
862
+ let className;
863
+ let props;
864
+ if ($[0] !== t0) {
865
+ ({
866
+ className,
867
+ ...props
868
+ } = t0);
869
+ $[0] = t0;
870
+ $[1] = className;
871
+ $[2] = props;
872
+ } else {
873
+ className = $[1];
874
+ props = $[2];
875
+ }
876
+ let t1;
877
+ if ($[3] !== className) {
878
+ t1 = cn("text-sm font-medium text-foreground", className);
879
+ $[3] = className;
880
+ $[4] = t1;
881
+ } else {
882
+ t1 = $[4];
883
+ }
884
+ let t2;
885
+ if ($[5] !== props || $[6] !== t1) {
886
+ t2 = /* @__PURE__ */ jsxDEV(Dialog.Title, {
887
+ "data-slot": "sheet-title",
888
+ className: t1,
889
+ ...props
890
+ }, void 0, false);
891
+ $[5] = props;
892
+ $[6] = t1;
893
+ $[7] = t2;
894
+ } else {
895
+ t2 = $[7];
896
+ }
897
+ return t2;
898
+ }
899
+ function SheetDescription(t0) {
900
+ const $ = c(8);
901
+ let className;
902
+ let props;
903
+ if ($[0] !== t0) {
904
+ ({
905
+ className,
906
+ ...props
907
+ } = t0);
908
+ $[0] = t0;
909
+ $[1] = className;
910
+ $[2] = props;
911
+ } else {
912
+ className = $[1];
913
+ props = $[2];
914
+ }
915
+ let t1;
916
+ if ($[3] !== className) {
917
+ t1 = cn("text-xs/relaxed text-muted-foreground", className);
918
+ $[3] = className;
919
+ $[4] = t1;
920
+ } else {
921
+ t1 = $[4];
922
+ }
923
+ let t2;
924
+ if ($[5] !== props || $[6] !== t1) {
925
+ t2 = /* @__PURE__ */ jsxDEV(Dialog.Description, {
926
+ "data-slot": "sheet-description",
927
+ className: t1,
928
+ ...props
929
+ }, void 0, false);
930
+ $[5] = props;
931
+ $[6] = t1;
932
+ $[7] = t2;
933
+ } else {
934
+ t2 = $[7];
935
+ }
936
+ return t2;
937
+ }
938
+
939
+ const SIDEBAR_COOKIE_NAME = "sidebar_state";
940
+ const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
941
+ const SIDEBAR_WIDTH = "16rem";
942
+ const SIDEBAR_WIDTH_MOBILE = "18rem";
943
+ const SIDEBAR_WIDTH_ICON = "3rem";
944
+ const SIDEBAR_KEYBOARD_SHORTCUT = "b";
945
+ const SidebarContext = /* @__PURE__ */ React.createContext(null);
946
+ function useSidebar() {
947
+ const context = React.useContext(SidebarContext);
948
+ if (!context) {
949
+ throw new Error("useSidebar must be used within a SidebarProvider.");
950
+ }
951
+ return context;
952
+ }
953
+ function SidebarProvider({
954
+ defaultOpen = true,
955
+ open: openProp,
956
+ onOpenChange: setOpenProp,
957
+ className,
958
+ style,
959
+ children,
960
+ ...props
961
+ }) {
962
+ const isMobile = useIsMobile();
963
+ const [openMobile, setOpenMobile] = React.useState(false);
964
+ const [_open, _setOpen] = React.useState(defaultOpen);
965
+ const open = openProp ?? _open;
966
+ const setOpen = (value) => {
967
+ const openState = typeof value === "function" ? value(open) : value;
968
+ if (setOpenProp) {
969
+ setOpenProp(openState);
970
+ } else {
971
+ _setOpen(openState);
972
+ }
973
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
974
+ };
975
+ const toggleSidebar = () => {
976
+ return isMobile ? setOpenMobile((open_0) => !open_0) : setOpen((open_1) => !open_1);
977
+ };
978
+ React.useEffect(() => {
979
+ const handleKeyDown = (event) => {
980
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
981
+ event.preventDefault();
982
+ toggleSidebar();
983
+ }
984
+ };
985
+ globalThis.addEventListener("keydown", handleKeyDown);
986
+ return () => globalThis.removeEventListener("keydown", handleKeyDown);
987
+ }, [toggleSidebar]);
988
+ const state = open ? "expanded" : "collapsed";
989
+ const contextValue = {
990
+ state,
991
+ open,
992
+ setOpen,
993
+ isMobile,
994
+ openMobile,
995
+ setOpenMobile,
996
+ toggleSidebar
997
+ };
998
+ return /* @__PURE__ */ jsxDEV(SidebarContext.Provider, {
999
+ value: contextValue,
1000
+ children: /* @__PURE__ */ jsxDEV("div", {
1001
+ "data-slot": "sidebar-wrapper",
1002
+ style: {
1003
+ "--sidebar-width": SIDEBAR_WIDTH,
1004
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
1005
+ ...style
1006
+ },
1007
+ className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className),
1008
+ ...props,
1009
+ children
1010
+ }, void 0, false)
1011
+ }, void 0, false);
1012
+ }
1013
+ function Sidebar({
1014
+ side = "left",
1015
+ variant = "sidebar",
1016
+ collapsible = "offcanvas",
1017
+ className,
1018
+ children,
1019
+ dir,
1020
+ ...props
1021
+ }) {
1022
+ const {
1023
+ isMobile,
1024
+ state,
1025
+ openMobile,
1026
+ setOpenMobile
1027
+ } = useSidebar();
1028
+ if (collapsible === "none") {
1029
+ return /* @__PURE__ */ jsxDEV("div", {
1030
+ "data-slot": "sidebar",
1031
+ className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
1032
+ ...props,
1033
+ children
1034
+ }, void 0, false);
1035
+ }
1036
+ if (isMobile) {
1037
+ return /* @__PURE__ */ jsxDEV(Sheet, {
1038
+ open: openMobile,
1039
+ onOpenChange: setOpenMobile,
1040
+ ...props,
1041
+ children: /* @__PURE__ */ jsxDEV(SheetContent, {
1042
+ dir,
1043
+ "data-sidebar": "sidebar",
1044
+ "data-slot": "sidebar",
1045
+ "data-mobile": "true",
1046
+ className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
1047
+ style: {
1048
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
1049
+ },
1050
+ side,
1051
+ children: [/* @__PURE__ */ jsxDEV(SheetHeader, {
1052
+ className: "sr-only",
1053
+ children: [/* @__PURE__ */ jsxDEV(SheetTitle, {
1054
+ children: "Sidebar"
1055
+ }, void 0, false), /* @__PURE__ */ jsxDEV(SheetDescription, {
1056
+ children: "Displays the mobile sidebar."
1057
+ }, void 0, false)]
1058
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1059
+ className: "flex h-full w-full flex-col",
1060
+ children
1061
+ }, void 0, false)]
1062
+ }, void 0, true)
1063
+ }, void 0, false);
1064
+ }
1065
+ return /* @__PURE__ */ jsxDEV("div", {
1066
+ className: "group peer hidden text-sidebar-foreground md:block",
1067
+ "data-state": state,
1068
+ "data-collapsible": state === "collapsed" ? collapsible : "",
1069
+ "data-variant": variant,
1070
+ "data-side": side,
1071
+ "data-slot": "sidebar",
1072
+ children: [/* @__PURE__ */ jsxDEV("div", {
1073
+ "data-slot": "sidebar-gap",
1074
+ className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
1075
+ }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1076
+ "data-slot": "sidebar-container",
1077
+ "data-side": side,
1078
+ className: cn(
1079
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
1080
+ // Adjust the padding for floating and inset variants.
1081
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",
1082
+ className
1083
+ ),
1084
+ ...props,
1085
+ children: /* @__PURE__ */ jsxDEV("div", {
1086
+ "data-sidebar": "sidebar",
1087
+ "data-slot": "sidebar-inner",
1088
+ className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",
1089
+ children
1090
+ }, void 0, false)
1091
+ }, void 0, false)]
1092
+ }, void 0, true);
1093
+ }
1094
+ function SidebarTrigger(t0) {
1095
+ const $ = c(15);
1096
+ let className;
1097
+ let onClick;
1098
+ let props;
1099
+ if ($[0] !== t0) {
1100
+ ({
1101
+ className,
1102
+ onClick,
1103
+ ...props
1104
+ } = t0);
1105
+ $[0] = t0;
1106
+ $[1] = className;
1107
+ $[2] = onClick;
1108
+ $[3] = props;
1109
+ } else {
1110
+ className = $[1];
1111
+ onClick = $[2];
1112
+ props = $[3];
1113
+ }
1114
+ const {
1115
+ toggleSidebar
1116
+ } = useSidebar();
1117
+ let t1;
1118
+ if ($[4] !== className) {
1119
+ t1 = cn(className);
1120
+ $[4] = className;
1121
+ $[5] = t1;
1122
+ } else {
1123
+ t1 = $[5];
1124
+ }
1125
+ let t2;
1126
+ if ($[6] !== onClick || $[7] !== toggleSidebar) {
1127
+ t2 = (event) => {
1128
+ onClick?.(event);
1129
+ toggleSidebar();
1130
+ };
1131
+ $[6] = onClick;
1132
+ $[7] = toggleSidebar;
1133
+ $[8] = t2;
1134
+ } else {
1135
+ t2 = $[8];
1136
+ }
1137
+ let t3;
1138
+ let t4;
1139
+ if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1140
+ t3 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
1141
+ icon: SidebarLeftIcon,
1142
+ strokeWidth: 2,
1143
+ className: "rtl:rotate-180"
1144
+ }, void 0, false);
1145
+ t4 = /* @__PURE__ */ jsxDEV("span", {
1146
+ className: "sr-only",
1147
+ children: "Toggle Sidebar"
1148
+ }, void 0, false);
1149
+ $[9] = t3;
1150
+ $[10] = t4;
1151
+ } else {
1152
+ t3 = $[9];
1153
+ t4 = $[10];
1154
+ }
1155
+ let t5;
1156
+ if ($[11] !== props || $[12] !== t1 || $[13] !== t2) {
1157
+ t5 = /* @__PURE__ */ jsxDEV(Button, {
1158
+ "data-sidebar": "trigger",
1159
+ "data-slot": "sidebar-trigger",
1160
+ variant: "ghost",
1161
+ size: "icon-sm",
1162
+ className: t1,
1163
+ onClick: t2,
1164
+ ...props,
1165
+ children: [t3, t4]
1166
+ }, void 0, true);
1167
+ $[11] = props;
1168
+ $[12] = t1;
1169
+ $[13] = t2;
1170
+ $[14] = t5;
1171
+ } else {
1172
+ t5 = $[14];
1173
+ }
1174
+ return t5;
1175
+ }
1176
+ function SidebarInset(t0) {
1177
+ const $ = c(8);
1178
+ let className;
1179
+ let props;
1180
+ if ($[0] !== t0) {
1181
+ ({
1182
+ className,
1183
+ ...props
1184
+ } = t0);
1185
+ $[0] = t0;
1186
+ $[1] = className;
1187
+ $[2] = props;
1188
+ } else {
1189
+ className = $[1];
1190
+ props = $[2];
1191
+ }
1192
+ let t1;
1193
+ if ($[3] !== className) {
1194
+ t1 = cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2", className);
1195
+ $[3] = className;
1196
+ $[4] = t1;
1197
+ } else {
1198
+ t1 = $[4];
1199
+ }
1200
+ let t2;
1201
+ if ($[5] !== props || $[6] !== t1) {
1202
+ t2 = /* @__PURE__ */ jsxDEV("main", {
1203
+ "data-slot": "sidebar-inset",
1204
+ className: t1,
1205
+ ...props
1206
+ }, void 0, false);
1207
+ $[5] = props;
1208
+ $[6] = t1;
1209
+ $[7] = t2;
1210
+ } else {
1211
+ t2 = $[7];
1212
+ }
1213
+ return t2;
1214
+ }
1215
+ function SidebarHeader(t0) {
1216
+ const $ = c(8);
1217
+ let className;
1218
+ let props;
1219
+ if ($[0] !== t0) {
1220
+ ({
1221
+ className,
1222
+ ...props
1223
+ } = t0);
1224
+ $[0] = t0;
1225
+ $[1] = className;
1226
+ $[2] = props;
1227
+ } else {
1228
+ className = $[1];
1229
+ props = $[2];
1230
+ }
1231
+ let t1;
1232
+ if ($[3] !== className) {
1233
+ t1 = cn("flex flex-col gap-2 p-2", className);
1234
+ $[3] = className;
1235
+ $[4] = t1;
1236
+ } else {
1237
+ t1 = $[4];
1238
+ }
1239
+ let t2;
1240
+ if ($[5] !== props || $[6] !== t1) {
1241
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1242
+ "data-slot": "sidebar-header",
1243
+ "data-sidebar": "header",
1244
+ className: t1,
1245
+ ...props
1246
+ }, void 0, false);
1247
+ $[5] = props;
1248
+ $[6] = t1;
1249
+ $[7] = t2;
1250
+ } else {
1251
+ t2 = $[7];
1252
+ }
1253
+ return t2;
1254
+ }
1255
+ function SidebarFooter(t0) {
1256
+ const $ = c(8);
1257
+ let className;
1258
+ let props;
1259
+ if ($[0] !== t0) {
1260
+ ({
1261
+ className,
1262
+ ...props
1263
+ } = t0);
1264
+ $[0] = t0;
1265
+ $[1] = className;
1266
+ $[2] = props;
1267
+ } else {
1268
+ className = $[1];
1269
+ props = $[2];
1270
+ }
1271
+ let t1;
1272
+ if ($[3] !== className) {
1273
+ t1 = cn("flex flex-col gap-2 p-2", className);
1274
+ $[3] = className;
1275
+ $[4] = t1;
1276
+ } else {
1277
+ t1 = $[4];
1278
+ }
1279
+ let t2;
1280
+ if ($[5] !== props || $[6] !== t1) {
1281
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1282
+ "data-slot": "sidebar-footer",
1283
+ "data-sidebar": "footer",
1284
+ className: t1,
1285
+ ...props
1286
+ }, void 0, false);
1287
+ $[5] = props;
1288
+ $[6] = t1;
1289
+ $[7] = t2;
1290
+ } else {
1291
+ t2 = $[7];
1292
+ }
1293
+ return t2;
1294
+ }
1295
+ function SidebarContent(t0) {
1296
+ const $ = c(8);
1297
+ let className;
1298
+ let props;
1299
+ if ($[0] !== t0) {
1300
+ ({
1301
+ className,
1302
+ ...props
1303
+ } = t0);
1304
+ $[0] = t0;
1305
+ $[1] = className;
1306
+ $[2] = props;
1307
+ } else {
1308
+ className = $[1];
1309
+ props = $[2];
1310
+ }
1311
+ let t1;
1312
+ if ($[3] !== className) {
1313
+ t1 = cn("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50", className);
1314
+ $[3] = className;
1315
+ $[4] = t1;
1316
+ } else {
1317
+ t1 = $[4];
1318
+ }
1319
+ let t2;
1320
+ if ($[5] !== props || $[6] !== t1) {
1321
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1322
+ "data-slot": "sidebar-content",
1323
+ "data-sidebar": "content",
1324
+ className: t1,
1325
+ ...props
1326
+ }, void 0, false);
1327
+ $[5] = props;
1328
+ $[6] = t1;
1329
+ $[7] = t2;
1330
+ } else {
1331
+ t2 = $[7];
1332
+ }
1333
+ return t2;
1334
+ }
1335
+ function SidebarGroup(t0) {
1336
+ const $ = c(8);
1337
+ let className;
1338
+ let props;
1339
+ if ($[0] !== t0) {
1340
+ ({
1341
+ className,
1342
+ ...props
1343
+ } = t0);
1344
+ $[0] = t0;
1345
+ $[1] = className;
1346
+ $[2] = props;
1347
+ } else {
1348
+ className = $[1];
1349
+ props = $[2];
1350
+ }
1351
+ let t1;
1352
+ if ($[3] !== className) {
1353
+ t1 = cn("relative flex w-full min-w-0 flex-col p-2", className);
1354
+ $[3] = className;
1355
+ $[4] = t1;
1356
+ } else {
1357
+ t1 = $[4];
1358
+ }
1359
+ let t2;
1360
+ if ($[5] !== props || $[6] !== t1) {
1361
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1362
+ "data-slot": "sidebar-group",
1363
+ "data-sidebar": "group",
1364
+ className: t1,
1365
+ ...props
1366
+ }, void 0, false);
1367
+ $[5] = props;
1368
+ $[6] = t1;
1369
+ $[7] = t2;
1370
+ } else {
1371
+ t2 = $[7];
1372
+ }
1373
+ return t2;
1374
+ }
1375
+ function SidebarGroupLabel(t0) {
1376
+ const $ = c(10);
1377
+ let render;
1378
+ let t1;
1379
+ let t2;
1380
+ let t3;
1381
+ if ($[0] !== t0) {
1382
+ const {
1383
+ className,
1384
+ render: t42,
1385
+ ...props
1386
+ } = t0;
1387
+ render = t42;
1388
+ t3 = useRender;
1389
+ t1 = "div";
1390
+ t2 = mergeProps({
1391
+ className: cn("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", className)
1392
+ }, props);
1393
+ $[0] = t0;
1394
+ $[1] = render;
1395
+ $[2] = t1;
1396
+ $[3] = t2;
1397
+ $[4] = t3;
1398
+ } else {
1399
+ render = $[1];
1400
+ t1 = $[2];
1401
+ t2 = $[3];
1402
+ t3 = $[4];
1403
+ }
1404
+ let t4;
1405
+ if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1406
+ t4 = {
1407
+ slot: "sidebar-group-label",
1408
+ sidebar: "group-label"
1409
+ };
1410
+ $[5] = t4;
1411
+ } else {
1412
+ t4 = $[5];
1413
+ }
1414
+ let t5;
1415
+ if ($[6] !== render || $[7] !== t1 || $[8] !== t2) {
1416
+ t5 = {
1417
+ defaultTagName: t1,
1418
+ props: t2,
1419
+ render,
1420
+ state: t4
1421
+ };
1422
+ $[6] = render;
1423
+ $[7] = t1;
1424
+ $[8] = t2;
1425
+ $[9] = t5;
1426
+ } else {
1427
+ t5 = $[9];
1428
+ }
1429
+ return t3(t5);
1430
+ }
1431
+ function SidebarGroupContent(t0) {
1432
+ const $ = c(8);
1433
+ let className;
1434
+ let props;
1435
+ if ($[0] !== t0) {
1436
+ ({
1437
+ className,
1438
+ ...props
1439
+ } = t0);
1440
+ $[0] = t0;
1441
+ $[1] = className;
1442
+ $[2] = props;
1443
+ } else {
1444
+ className = $[1];
1445
+ props = $[2];
1446
+ }
1447
+ let t1;
1448
+ if ($[3] !== className) {
1449
+ t1 = cn("w-full text-xs", className);
1450
+ $[3] = className;
1451
+ $[4] = t1;
1452
+ } else {
1453
+ t1 = $[4];
1454
+ }
1455
+ let t2;
1456
+ if ($[5] !== props || $[6] !== t1) {
1457
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1458
+ "data-slot": "sidebar-group-content",
1459
+ "data-sidebar": "group-content",
1460
+ className: t1,
1461
+ ...props
1462
+ }, void 0, false);
1463
+ $[5] = props;
1464
+ $[6] = t1;
1465
+ $[7] = t2;
1466
+ } else {
1467
+ t2 = $[7];
1468
+ }
1469
+ return t2;
1470
+ }
1471
+ function SidebarMenu(t0) {
1472
+ const $ = c(8);
1473
+ let className;
1474
+ let props;
1475
+ if ($[0] !== t0) {
1476
+ ({
1477
+ className,
1478
+ ...props
1479
+ } = t0);
1480
+ $[0] = t0;
1481
+ $[1] = className;
1482
+ $[2] = props;
1483
+ } else {
1484
+ className = $[1];
1485
+ props = $[2];
1486
+ }
1487
+ let t1;
1488
+ if ($[3] !== className) {
1489
+ t1 = cn("flex w-full min-w-0 flex-col gap-0", className);
1490
+ $[3] = className;
1491
+ $[4] = t1;
1492
+ } else {
1493
+ t1 = $[4];
1494
+ }
1495
+ let t2;
1496
+ if ($[5] !== props || $[6] !== t1) {
1497
+ t2 = /* @__PURE__ */ jsxDEV("ul", {
1498
+ "data-slot": "sidebar-menu",
1499
+ "data-sidebar": "menu",
1500
+ className: t1,
1501
+ ...props
1502
+ }, void 0, false);
1503
+ $[5] = props;
1504
+ $[6] = t1;
1505
+ $[7] = t2;
1506
+ } else {
1507
+ t2 = $[7];
1508
+ }
1509
+ return t2;
1510
+ }
1511
+ function SidebarMenuItem(t0) {
1512
+ const $ = c(8);
1513
+ let className;
1514
+ let props;
1515
+ if ($[0] !== t0) {
1516
+ ({
1517
+ className,
1518
+ ...props
1519
+ } = t0);
1520
+ $[0] = t0;
1521
+ $[1] = className;
1522
+ $[2] = props;
1523
+ } else {
1524
+ className = $[1];
1525
+ props = $[2];
1526
+ }
1527
+ let t1;
1528
+ if ($[3] !== className) {
1529
+ t1 = cn("group/menu-item relative", className);
1530
+ $[3] = className;
1531
+ $[4] = t1;
1532
+ } else {
1533
+ t1 = $[4];
1534
+ }
1535
+ let t2;
1536
+ if ($[5] !== props || $[6] !== t1) {
1537
+ t2 = /* @__PURE__ */ jsxDEV("li", {
1538
+ "data-slot": "sidebar-menu-item",
1539
+ "data-sidebar": "menu-item",
1540
+ className: t1,
1541
+ ...props
1542
+ }, void 0, false);
1543
+ $[5] = props;
1544
+ $[6] = t1;
1545
+ $[7] = t2;
1546
+ } else {
1547
+ t2 = $[7];
1548
+ }
1549
+ return t2;
1550
+ }
1551
+ const sidebarMenuButtonVariants = cva("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
1552
+ variants: {
1553
+ variant: {
1554
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
1555
+ outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
1556
+ },
1557
+ size: {
1558
+ default: "h-8 text-xs",
1559
+ sm: "h-7 text-xs",
1560
+ lg: "h-12 text-xs group-data-[collapsible=icon]:p-0!"
1561
+ }
1562
+ },
1563
+ defaultVariants: {
1564
+ variant: "default",
1565
+ size: "default"
1566
+ }
1567
+ });
1568
+ function SidebarMenuButton({
1569
+ render,
1570
+ isActive = false,
1571
+ variant = "default",
1572
+ size = "default",
1573
+ tooltip,
1574
+ className,
1575
+ ...props
1576
+ }) {
1577
+ const {
1578
+ isMobile,
1579
+ state
1580
+ } = useSidebar();
1581
+ const comp = useRender({
1582
+ defaultTagName: "button",
1583
+ props: mergeProps({
1584
+ className: cn(sidebarMenuButtonVariants({
1585
+ variant,
1586
+ size
1587
+ }), className)
1588
+ }, props),
1589
+ render: !tooltip ? render : /* @__PURE__ */ jsxDEV(TooltipTrigger, {
1590
+ render
1591
+ }, void 0, false),
1592
+ state: {
1593
+ slot: "sidebar-menu-button",
1594
+ sidebar: "menu-button",
1595
+ size,
1596
+ active: isActive
1597
+ }
1598
+ });
1599
+ if (!tooltip) {
1600
+ return comp;
1601
+ }
1602
+ if (typeof tooltip === "string") {
1603
+ tooltip = {
1604
+ children: tooltip
1605
+ };
1606
+ }
1607
+ return /* @__PURE__ */ jsxDEV(Tooltip, {
1608
+ children: [comp, /* @__PURE__ */ jsxDEV(TooltipContent, {
1609
+ side: "right",
1610
+ align: "center",
1611
+ hidden: state !== "collapsed" || isMobile,
1612
+ ...tooltip
1613
+ }, void 0, false)]
1614
+ }, void 0, true);
1615
+ }
1616
+
1617
+ const lazyNamed = (load, key) => /* @__PURE__ */ lazy(() => load().then((loaded) => {
1618
+ return {
1619
+ default: loaded[key]
1620
+ };
1621
+ }));
1622
+ const InsightsPanel = lazyNamed(() => import('../packem_chunks/InsightsPanel.js'), "InsightsPanel");
1623
+ const RlsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/rls-panel.js'));
1624
+ const SecurityAdvisorPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/SecurityAdvisorPanel.js'));
1625
+ const AnalyticsPanel = lazyNamed(() => import('../packem_chunks/analytics-panel.js'), "AnalyticsPanel");
1626
+ const ApiTab = /* @__PURE__ */ lazy(() => import('../packem_chunks/ApiTab.js'));
1627
+ const AuthConfigPanel = lazyNamed(() => import('../packem_chunks/auth-config-panel.js'), "AuthConfigPanel");
1628
+ const AuthSessionsPanel = lazyNamed(() => import('../packem_chunks/auth-sessions-panel.js'), "AuthSessionsPanel");
1629
+ const OrganizationsPanel = lazyNamed(() => import('../packem_chunks/organizations-panel.js'), "OrganizationsPanel");
1630
+ const UsersPanel = lazyNamed(() => import('../packem_chunks/users-panel.js'), "UsersPanel");
1631
+ const TableEditor = lazyNamed(() => import('../packem_chunks/TableEditor.js'), "TableEditor");
1632
+ const ExportImportPanel = lazyNamed(() => import('../packem_chunks/ExportImportPanel.js'), "ExportImportPanel");
1633
+ const MigrationsPanel = lazyNamed(() => import('../packem_chunks/MigrationsPanel.js'), "MigrationsPanel");
1634
+ const PitrPanel = lazyNamed(() => import('../packem_chunks/PitrPanel.js'), "PitrPanel");
1635
+ const FlagsPanel = lazyNamed(() => import('../packem_chunks/flags-panel.js'), "FlagsPanel");
1636
+ const FunctionRunner = lazyNamed(() => import('../packem_chunks/FunctionRunner.js'), "FunctionRunner");
1637
+ const FunctionStatsPanel = lazyNamed(() => import('../packem_chunks/FunctionStatsPanel.js'), "FunctionStatsPanel");
1638
+ const AuditPanel = lazyNamed(() => import('../packem_chunks/AuditPanel.js'), "AuditPanel");
1639
+ const LogDrainsPanel = lazyNamed(() => import('../packem_chunks/log-drains-panel.js'), "LogDrainsPanel");
1640
+ const LogsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/LogsPanel.js').then((m) => {
1641
+ return {
1642
+ default: m.LogsPanel
1643
+ };
1644
+ }));
1645
+ const MailPanel = lazyNamed(() => import('../packem_chunks/MailPanel.js'), "MailPanel");
1646
+ const SchedulePanel = lazyNamed(() => import('../packem_chunks/schedule-panel.js'), "SchedulePanel");
1647
+ const SubscriptionsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/subscriptions-panel.js'));
1648
+ const KvBrowser = lazyNamed(() => import('../packem_chunks/kv-browser.js'), "KvBrowser");
1649
+ const PaymentsPanel = lazyNamed(() => import('../packem_chunks/payments-panel.js'), "PaymentsPanel");
1650
+ const PermissionsPanel = lazyNamed(() => import('../packem_chunks/permissions-panel.js'), "PermissionsPanel");
1651
+ const QueuesPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/queues-panel.js'));
1652
+ const DashboardsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/dashboards-panel.js'));
1653
+ const FanoutPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/fanout-panel.js'));
1654
+ const HealthPanel = lazyNamed(() => import('../packem_chunks/HealthPanel.js'), "HealthPanel");
1655
+ const MetricsPanel = lazyNamed(() => import('../packem_chunks/MetricsPanel.js'), "MetricsPanel");
1656
+ const SchemaViewer = lazyNamed(() => import('../packem_chunks/SchemaViewer.js'), "SchemaViewer");
1657
+ const SettingsPanel = lazyNamed(() => import('../packem_chunks/SettingsPanel.js'), "SettingsPanel");
1658
+ const SqlEditorPanel = lazyNamed(() => import('../packem_chunks/SqlEditorPanel.js'), "SqlEditorPanel");
1659
+ const FileBrowser = lazyNamed(() => import('../packem_chunks/FileBrowser.js'), "FileBrowser");
1660
+ const StorageRulesPanel = lazyNamed(() => import('../packem_chunks/storage-rules-panel.js'), "StorageRulesPanel");
1661
+ const VectorBrowser = lazyNamed(() => import('../packem_chunks/vector-browser.js'), "VectorBrowser");
1662
+ const WorkflowsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/workflows-panel.js'));
1663
+ const StudioChromeContext = /* @__PURE__ */ createContext(null);
1664
+ const TAB_ICONS = {
1665
+ analytics: /* @__PURE__ */ jsxDEV("path", {
1666
+ d: "M5 20V10m6.5 10V4M18 20v-7M3 20h18"
1667
+ }, void 0, false),
1668
+ api: /* @__PURE__ */ jsxDEV("path", {
1669
+ d: "m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"
1670
+ }, void 0, false),
1671
+ audit: /* @__PURE__ */ jsxDEV("path", {
1672
+ d: "M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"
1673
+ }, void 0, false),
1674
+ authConfig: /* @__PURE__ */ jsxDEV("path", {
1675
+ d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"
1676
+ }, void 0, false),
1677
+ authSessions: /* @__PURE__ */ jsxDEV("path", {
1678
+ d: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"
1679
+ }, void 0, false),
1680
+ dashboards: /* @__PURE__ */ jsxDEV("path", {
1681
+ d: "M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"
1682
+ }, void 0, false),
1683
+ drains: /* @__PURE__ */ jsxDEV("path", {
1684
+ d: "M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"
1685
+ }, void 0, false),
1686
+ data: /* @__PURE__ */ jsxDEV("path", {
1687
+ d: "M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"
1688
+ }, void 0, false),
1689
+ export: /* @__PURE__ */ jsxDEV("path", {
1690
+ d: "M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"
1691
+ }, void 0, false),
1692
+ fanout: /* @__PURE__ */ jsxDEV("path", {
1693
+ d: "M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"
1694
+ }, void 0, false),
1695
+ files: /* @__PURE__ */ jsxDEV("path", {
1696
+ d: "M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"
1697
+ }, void 0, false),
1698
+ flags: /* @__PURE__ */ jsxDEV("path", {
1699
+ d: "M6 21V4m0 0h11l-2 3 2 3H6"
1700
+ }, void 0, false),
1701
+ functions: /* @__PURE__ */ jsxDEV("path", {
1702
+ d: "m9 8-4 4 4 4m6-8 4 4-4 4"
1703
+ }, void 0, false),
1704
+ health: /* @__PURE__ */ jsxDEV("path", {
1705
+ d: "M3 12h4l2 6 4-14 2 8h6"
1706
+ }, void 0, false),
1707
+ home: /* @__PURE__ */ jsxDEV("path", {
1708
+ d: "M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"
1709
+ }, void 0, false),
1710
+ insights: /* @__PURE__ */ jsxDEV("path", {
1711
+ d: "M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"
1712
+ }, void 0, false),
1713
+ kv: /* @__PURE__ */ jsxDEV("path", {
1714
+ d: "M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"
1715
+ }, void 0, false),
1716
+ logs: /* @__PURE__ */ jsxDEV("path", {
1717
+ d: "M5 6h14M5 10h14M5 14h9M5 18h11"
1718
+ }, void 0, false),
1719
+ mail: /* @__PURE__ */ jsxDEV("path", {
1720
+ d: "M4 5h16v14H4V5Zm0 1.5 8 6 8-6"
1721
+ }, void 0, false),
1722
+ payments: /* @__PURE__ */ jsxDEV("path", {
1723
+ d: "M3 7h18v10H3V7Zm0 3h18M7 14h4"
1724
+ }, void 0, false),
1725
+ metrics: /* @__PURE__ */ jsxDEV("path", {
1726
+ d: "M5 20V10m6.5 10V4M18 20v-7M3 20h18"
1727
+ }, void 0, false),
1728
+ migrations: /* @__PURE__ */ jsxDEV("path", {
1729
+ d: "M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"
1730
+ }, void 0, false),
1731
+ organizations: /* @__PURE__ */ jsxDEV("path", {
1732
+ d: "M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"
1733
+ }, void 0, false),
1734
+ permissions: /* @__PURE__ */ jsxDEV("path", {
1735
+ d: "M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"
1736
+ }, void 0, false),
1737
+ pitr: /* @__PURE__ */ jsxDEV("path", {
1738
+ d: "M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"
1739
+ }, void 0, false),
1740
+ queues: /* @__PURE__ */ jsxDEV("path", {
1741
+ d: "M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"
1742
+ }, void 0, false),
1743
+ realtime: /* @__PURE__ */ jsxDEV("path", {
1744
+ d: "M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
1745
+ }, void 0, false),
1746
+ rls: /* @__PURE__ */ jsxDEV("path", {
1747
+ d: "M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"
1748
+ }, void 0, false),
1749
+ schedule: /* @__PURE__ */ jsxDEV("path", {
1750
+ d: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"
1751
+ }, void 0, false),
1752
+ schema: /* @__PURE__ */ jsxDEV("path", {
1753
+ d: "M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"
1754
+ }, void 0, false),
1755
+ sql: /* @__PURE__ */ jsxDEV("path", {
1756
+ d: "M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"
1757
+ }, void 0, false),
1758
+ storageRules: /* @__PURE__ */ jsxDEV("path", {
1759
+ d: "M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"
1760
+ }, void 0, false),
1761
+ security: /* @__PURE__ */ jsxDEV("path", {
1762
+ d: "M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"
1763
+ }, void 0, false),
1764
+ settings: /* @__PURE__ */ jsxDEV("path", {
1765
+ d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"
1766
+ }, void 0, false),
1767
+ users: /* @__PURE__ */ jsxDEV("path", {
1768
+ d: "M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85M16 3.13A4 4 0 0 1 16 11"
1769
+ }, void 0, false),
1770
+ vectors: /* @__PURE__ */ jsxDEV("path", {
1771
+ d: "M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"
1772
+ }, void 0, false),
1773
+ workflows: /* @__PURE__ */ jsxDEV("path", {
1774
+ d: "M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"
1775
+ }, void 0, false)
1776
+ };
1777
+ const NAV_GROUPS = [{
1778
+ key: "overview",
1779
+ tabs: ["home", "dashboards"]
1780
+ }, {
1781
+ key: "database",
1782
+ tabs: ["data", "sql", "schema", "migrations", "vectors", "pitr", "export"]
1783
+ }, {
1784
+ key: "functions",
1785
+ tabs: ["functions", "api", "workflows", "queues"]
1786
+ }, {
1787
+ key: "auth",
1788
+ tabs: ["users", "organizations", "authSessions", "authConfig"]
1789
+ }, {
1790
+ key: "storage",
1791
+ tabs: ["files", "storageRules", "kv"]
1792
+ }, {
1793
+ key: "observability",
1794
+ tabs: ["logs", "audit", "realtime", "fanout", "metrics", "analytics", "health"]
1795
+ }, {
1796
+ key: "advisors",
1797
+ tabs: ["security", "rls", "permissions", "insights"]
1798
+ }, {
1799
+ key: "operations",
1800
+ tabs: ["schedule", "mail", "drains", "payments", "flags"]
1801
+ }, {
1802
+ key: "settings",
1803
+ tabs: ["settings"]
1804
+ }];
1805
+ const TAB_FEATURE = {
1806
+ analytics: "analytics",
1807
+ authConfig: "auth",
1808
+ authSessions: "auth",
1809
+ files: "storage",
1810
+ flags: "flags",
1811
+ kv: "kv",
1812
+ mail: "mail",
1813
+ organizations: "auth",
1814
+ payments: "payments",
1815
+ queues: "queues",
1816
+ schedule: "scheduler",
1817
+ storageRules: "storage",
1818
+ users: "auth",
1819
+ vectors: "vectors",
1820
+ workflows: "workflows"
1821
+ };
1822
+ const isTabVisible = (tab, features) => {
1823
+ const feature = TAB_FEATURE[tab];
1824
+ return feature === void 0 || features[feature];
1825
+ };
1826
+ const TabIcon = (t0) => {
1827
+ const $ = c(2);
1828
+ const {
1829
+ tab
1830
+ } = t0;
1831
+ const t1 = TAB_ICONS[tab];
1832
+ let t2;
1833
+ if ($[0] !== t1) {
1834
+ t2 = /* @__PURE__ */ jsxDEV("svg", {
1835
+ "aria-hidden": "true",
1836
+ className: "size-4 shrink-0",
1837
+ fill: "none",
1838
+ stroke: "currentColor",
1839
+ strokeLinecap: "round",
1840
+ strokeLinejoin: "round",
1841
+ strokeWidth: 1.6,
1842
+ viewBox: "0 0 24 24",
1843
+ children: t1
1844
+ }, void 0, false);
1845
+ $[0] = t1;
1846
+ $[1] = t2;
1847
+ } else {
1848
+ t2 = $[1];
1849
+ }
1850
+ return t2;
1851
+ };
1852
+ const TABS = ["home", "data", "sql", "functions", "api", "workflows", "queues", "schema", "migrations", "vectors", "export", "pitr", "users", "organizations", "authSessions", "authConfig", "files", "storageRules", "kv", "dashboards", "metrics", "analytics", "health", "security", "rls", "permissions", "insights", "logs", "realtime", "mail", "payments", "audit", "schedule", "drains", "flags", "settings"];
1853
+ const FULL_HEIGHT_TABS = /* @__PURE__ */ new Set(["api", "data", "sql"]);
1854
+ const tabFromPathname = (pathname) => {
1855
+ const slug = pathname.split("/").findLast(Boolean) ?? "";
1856
+ return TABS.includes(slug) ? slug : "home";
1857
+ };
1858
+ const ConnectPopoverContent = (t0) => {
1859
+ const $ = c(19);
1860
+ const {
1861
+ chrome,
1862
+ connected
1863
+ } = t0;
1864
+ const t = useT();
1865
+ let t1;
1866
+ if ($[0] !== t) {
1867
+ t1 = t("admin token");
1868
+ $[0] = t;
1869
+ $[1] = t1;
1870
+ } else {
1871
+ t1 = $[1];
1872
+ }
1873
+ let t2;
1874
+ if ($[2] !== t1) {
1875
+ t2 = /* @__PURE__ */ jsxDEV("label", {
1876
+ className: "text-xs font-medium text-foreground",
1877
+ htmlFor: "dash-app-token",
1878
+ children: t1
1879
+ }, void 0, false);
1880
+ $[2] = t1;
1881
+ $[3] = t2;
1882
+ } else {
1883
+ t2 = $[3];
1884
+ }
1885
+ let t3;
1886
+ if ($[4] !== chrome.onTokenChange || $[5] !== chrome.token) {
1887
+ t3 = /* @__PURE__ */ jsxDEV(Input, {
1888
+ className: "h-8",
1889
+ "data-testid": "dash-app-token",
1890
+ id: "dash-app-token",
1891
+ onChange: chrome.onTokenChange,
1892
+ placeholder: "LUNORA_ADMIN_TOKEN",
1893
+ type: "password",
1894
+ value: chrome.token
1895
+ }, void 0, false);
1896
+ $[4] = chrome.onTokenChange;
1897
+ $[5] = chrome.token;
1898
+ $[6] = t3;
1899
+ } else {
1900
+ t3 = $[6];
1901
+ }
1902
+ let t4;
1903
+ if ($[7] !== connected || $[8] !== t) {
1904
+ t4 = connected && /* @__PURE__ */ jsxDEV("p", {
1905
+ className: "flex items-start gap-1.5 text-[11px] text-muted-foreground",
1906
+ "data-testid": "dash-app-token-warning",
1907
+ role: "note",
1908
+ children: [/* @__PURE__ */ jsxDEV("span", {
1909
+ "aria-hidden": "true",
1910
+ className: "text-warning",
1911
+ children: "⚠"
1912
+ }, void 0, false), t("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]
1913
+ }, void 0, true);
1914
+ $[7] = connected;
1915
+ $[8] = t;
1916
+ $[9] = t4;
1917
+ } else {
1918
+ t4 = $[9];
1919
+ }
1920
+ let t5;
1921
+ if ($[10] !== chrome.clearToken || $[11] !== connected || $[12] !== t) {
1922
+ t5 = connected && /* @__PURE__ */ jsxDEV("button", {
1923
+ className: "self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent",
1924
+ "data-testid": "dash-app-clear-token",
1925
+ onClick: chrome.clearToken,
1926
+ type: "button",
1927
+ children: t("Clear")
1928
+ }, void 0, false);
1929
+ $[10] = chrome.clearToken;
1930
+ $[11] = connected;
1931
+ $[12] = t;
1932
+ $[13] = t5;
1933
+ } else {
1934
+ t5 = $[13];
1935
+ }
1936
+ let t6;
1937
+ if ($[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5) {
1938
+ t6 = /* @__PURE__ */ jsxDEV("div", {
1939
+ className: "flex flex-col gap-2",
1940
+ children: [t2, t3, t4, t5]
1941
+ }, void 0, true);
1942
+ $[14] = t2;
1943
+ $[15] = t3;
1944
+ $[16] = t4;
1945
+ $[17] = t5;
1946
+ $[18] = t6;
1947
+ } else {
1948
+ t6 = $[18];
1949
+ }
1950
+ return t6;
1951
+ };
1952
+ const CollapsedGroupNav = (t0) => {
1953
+ const $ = c(25);
1954
+ const {
1955
+ current,
1956
+ group,
1957
+ groupLabel,
1958
+ selectTab,
1959
+ tabDescription,
1960
+ tabLabel
1961
+ } = t0;
1962
+ const t1 = group.tabs.includes(current) ? "page" : void 0;
1963
+ const t2 = groupLabel[group.key];
1964
+ const t3 = group.tabs[0];
1965
+ let t4;
1966
+ if ($[0] !== t3) {
1967
+ t4 = /* @__PURE__ */ jsxDEV(TabIcon, {
1968
+ tab: t3
1969
+ }, void 0, false);
1970
+ $[0] = t3;
1971
+ $[1] = t4;
1972
+ } else {
1973
+ t4 = $[1];
1974
+ }
1975
+ let t5;
1976
+ if ($[2] !== t1 || $[3] !== t2 || $[4] !== t4) {
1977
+ t5 = /* @__PURE__ */ jsxDEV(PopoverTrigger, {
1978
+ "aria-current": t1,
1979
+ "aria-label": t2,
1980
+ className: "mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",
1981
+ delay: 120,
1982
+ openOnHover: true,
1983
+ children: t4
1984
+ }, void 0, false);
1985
+ $[2] = t1;
1986
+ $[3] = t2;
1987
+ $[4] = t4;
1988
+ $[5] = t5;
1989
+ } else {
1990
+ t5 = $[5];
1991
+ }
1992
+ const t6 = groupLabel[group.key];
1993
+ let t7;
1994
+ if ($[6] !== t6) {
1995
+ t7 = /* @__PURE__ */ jsxDEV("div", {
1996
+ className: "px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",
1997
+ children: t6
1998
+ }, void 0, false);
1999
+ $[6] = t6;
2000
+ $[7] = t7;
2001
+ } else {
2002
+ t7 = $[7];
2003
+ }
2004
+ let t8;
2005
+ if ($[8] !== current || $[9] !== group.tabs || $[10] !== selectTab || $[11] !== tabDescription || $[12] !== tabLabel) {
2006
+ let t92;
2007
+ if ($[14] !== current || $[15] !== selectTab || $[16] !== tabDescription || $[17] !== tabLabel) {
2008
+ t92 = (tab) => /* @__PURE__ */ jsxDEV("button", {
2009
+ "aria-current": current === tab ? "page" : void 0,
2010
+ className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100",
2011
+ "data-tab": tab,
2012
+ "data-testid": `dash-tab-${tab}`,
2013
+ onClick: selectTab,
2014
+ title: tabDescription[tab],
2015
+ type: "button",
2016
+ children: [/* @__PURE__ */ jsxDEV(TabIcon, {
2017
+ tab
2018
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2019
+ children: tabLabel[tab]
2020
+ }, void 0, false)]
2021
+ }, tab, true);
2022
+ $[14] = current;
2023
+ $[15] = selectTab;
2024
+ $[16] = tabDescription;
2025
+ $[17] = tabLabel;
2026
+ $[18] = t92;
2027
+ } else {
2028
+ t92 = $[18];
2029
+ }
2030
+ t8 = group.tabs.map(t92);
2031
+ $[8] = current;
2032
+ $[9] = group.tabs;
2033
+ $[10] = selectTab;
2034
+ $[11] = tabDescription;
2035
+ $[12] = tabLabel;
2036
+ $[13] = t8;
2037
+ } else {
2038
+ t8 = $[13];
2039
+ }
2040
+ let t9;
2041
+ if ($[19] !== t7 || $[20] !== t8) {
2042
+ t9 = /* @__PURE__ */ jsxDEV(PopoverContent, {
2043
+ align: "start",
2044
+ className: "w-56 p-1",
2045
+ side: "right",
2046
+ sideOffset: 8,
2047
+ children: [t7, t8]
2048
+ }, void 0, true);
2049
+ $[19] = t7;
2050
+ $[20] = t8;
2051
+ $[21] = t9;
2052
+ } else {
2053
+ t9 = $[21];
2054
+ }
2055
+ let t10;
2056
+ if ($[22] !== t5 || $[23] !== t9) {
2057
+ t10 = /* @__PURE__ */ jsxDEV(Popover, {
2058
+ children: [t5, t9]
2059
+ }, void 0, true);
2060
+ $[22] = t5;
2061
+ $[23] = t9;
2062
+ $[24] = t10;
2063
+ } else {
2064
+ t10 = $[24];
2065
+ }
2066
+ return t10;
2067
+ };
2068
+ const SidebarFooterProfile = (t0) => {
2069
+ const $ = c(45);
2070
+ const {
2071
+ chrome,
2072
+ collapsed,
2073
+ connected
2074
+ } = t0;
2075
+ const t = useT();
2076
+ if (chrome === null) {
2077
+ let t14;
2078
+ if ($[0] !== t) {
2079
+ t14 = t("Admin");
2080
+ $[0] = t;
2081
+ $[1] = t14;
2082
+ } else {
2083
+ t14 = $[1];
2084
+ }
2085
+ let t22;
2086
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2087
+ t22 = /* @__PURE__ */ jsxDEV("span", {
2088
+ className: "flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",
2089
+ children: "C"
2090
+ }, void 0, false);
2091
+ $[2] = t22;
2092
+ } else {
2093
+ t22 = $[2];
2094
+ }
2095
+ let t32;
2096
+ if ($[3] !== t) {
2097
+ t32 = t("Admin");
2098
+ $[3] = t;
2099
+ $[4] = t32;
2100
+ } else {
2101
+ t32 = $[4];
2102
+ }
2103
+ let t42;
2104
+ if ($[5] !== t32) {
2105
+ t42 = /* @__PURE__ */ jsxDEV("span", {
2106
+ className: "truncate text-[13px] font-medium",
2107
+ children: t32
2108
+ }, void 0, false);
2109
+ $[5] = t32;
2110
+ $[6] = t42;
2111
+ } else {
2112
+ t42 = $[6];
2113
+ }
2114
+ let t52;
2115
+ if ($[7] !== t) {
2116
+ t52 = t("Studio");
2117
+ $[7] = t;
2118
+ $[8] = t52;
2119
+ } else {
2120
+ t52 = $[8];
2121
+ }
2122
+ let t62;
2123
+ if ($[9] !== t52) {
2124
+ t62 = /* @__PURE__ */ jsxDEV("span", {
2125
+ className: "truncate text-[11px] text-muted-foreground",
2126
+ children: t52
2127
+ }, void 0, false);
2128
+ $[9] = t52;
2129
+ $[10] = t62;
2130
+ } else {
2131
+ t62 = $[10];
2132
+ }
2133
+ let t72;
2134
+ if ($[11] !== t42 || $[12] !== t62) {
2135
+ t72 = /* @__PURE__ */ jsxDEV("span", {
2136
+ className: "grid flex-1 text-start leading-tight",
2137
+ children: [t42, t62]
2138
+ }, void 0, true);
2139
+ $[11] = t42;
2140
+ $[12] = t62;
2141
+ $[13] = t72;
2142
+ } else {
2143
+ t72 = $[13];
2144
+ }
2145
+ let t82;
2146
+ if ($[14] !== t14 || $[15] !== t72) {
2147
+ t82 = /* @__PURE__ */ jsxDEV(SidebarMenuButton, {
2148
+ className: "data-active:bg-transparent",
2149
+ size: "lg",
2150
+ tooltip: t14,
2151
+ children: [t22, t72]
2152
+ }, void 0, true);
2153
+ $[14] = t14;
2154
+ $[15] = t72;
2155
+ $[16] = t82;
2156
+ } else {
2157
+ t82 = $[16];
2158
+ }
2159
+ return t82;
2160
+ }
2161
+ const t1 = collapsed ? "mx-auto size-8 justify-center" : "w-full p-2";
2162
+ let t2;
2163
+ if ($[17] !== t1) {
2164
+ t2 = cn("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent", t1);
2165
+ $[17] = t1;
2166
+ $[18] = t2;
2167
+ } else {
2168
+ t2 = $[18];
2169
+ }
2170
+ let t3;
2171
+ if ($[19] !== connected || $[20] !== t) {
2172
+ t3 = connected ? t("Connected") : t("Not connected");
2173
+ $[19] = connected;
2174
+ $[20] = t;
2175
+ $[21] = t3;
2176
+ } else {
2177
+ t3 = $[21];
2178
+ }
2179
+ const t4 = connected ? "bg-success" : "bg-muted-foreground/50";
2180
+ let t5;
2181
+ if ($[22] !== t4) {
2182
+ t5 = cn("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar", t4);
2183
+ $[22] = t4;
2184
+ $[23] = t5;
2185
+ } else {
2186
+ t5 = $[23];
2187
+ }
2188
+ let t6;
2189
+ if ($[24] !== t5) {
2190
+ t6 = /* @__PURE__ */ jsxDEV("span", {
2191
+ className: "relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",
2192
+ children: ["C", /* @__PURE__ */ jsxDEV("span", {
2193
+ "aria-hidden": "true",
2194
+ className: t5
2195
+ }, void 0, false)]
2196
+ }, void 0, true);
2197
+ $[24] = t5;
2198
+ $[25] = t6;
2199
+ } else {
2200
+ t6 = $[25];
2201
+ }
2202
+ let t7;
2203
+ if ($[26] !== collapsed || $[27] !== connected || $[28] !== t) {
2204
+ t7 = !collapsed && /* @__PURE__ */ jsxDEV(Fragment, {
2205
+ children: [/* @__PURE__ */ jsxDEV("span", {
2206
+ className: "grid flex-1 text-start leading-tight",
2207
+ children: [/* @__PURE__ */ jsxDEV("span", {
2208
+ className: "truncate text-[13px] font-medium",
2209
+ children: t("Admin")
2210
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2211
+ className: "truncate text-[11px] text-muted-foreground",
2212
+ children: connected ? t("Connected") : t("Not connected")
2213
+ }, void 0, false)]
2214
+ }, void 0, true), /* @__PURE__ */ jsxDEV("svg", {
2215
+ "aria-hidden": "true",
2216
+ className: "size-4 text-muted-foreground",
2217
+ fill: "none",
2218
+ stroke: "currentColor",
2219
+ strokeWidth: 1.7,
2220
+ viewBox: "0 0 24 24",
2221
+ children: /* @__PURE__ */ jsxDEV("path", {
2222
+ d: "m8 9 4-4 4 4M8 15l4 4 4-4",
2223
+ strokeLinecap: "round",
2224
+ strokeLinejoin: "round"
2225
+ }, void 0, false)
2226
+ }, void 0, false)]
2227
+ }, void 0, true);
2228
+ $[26] = collapsed;
2229
+ $[27] = connected;
2230
+ $[28] = t;
2231
+ $[29] = t7;
2232
+ } else {
2233
+ t7 = $[29];
2234
+ }
2235
+ let t8;
2236
+ if ($[30] !== t2 || $[31] !== t3 || $[32] !== t6 || $[33] !== t7) {
2237
+ t8 = /* @__PURE__ */ jsxDEV(PopoverTrigger, {
2238
+ className: t2,
2239
+ "data-testid": "dash-app-connect",
2240
+ title: t3,
2241
+ children: [t6, t7]
2242
+ }, void 0, true);
2243
+ $[30] = t2;
2244
+ $[31] = t3;
2245
+ $[32] = t6;
2246
+ $[33] = t7;
2247
+ $[34] = t8;
2248
+ } else {
2249
+ t8 = $[34];
2250
+ }
2251
+ const t9 = collapsed ? "end" : "start";
2252
+ const t10 = collapsed ? "right" : "top";
2253
+ let t11;
2254
+ if ($[35] !== chrome || $[36] !== connected) {
2255
+ t11 = /* @__PURE__ */ jsxDEV(ConnectPopoverContent, {
2256
+ chrome,
2257
+ connected
2258
+ }, void 0, false);
2259
+ $[35] = chrome;
2260
+ $[36] = connected;
2261
+ $[37] = t11;
2262
+ } else {
2263
+ t11 = $[37];
2264
+ }
2265
+ let t12;
2266
+ if ($[38] !== t10 || $[39] !== t11 || $[40] !== t9) {
2267
+ t12 = /* @__PURE__ */ jsxDEV(PopoverContent, {
2268
+ align: t9,
2269
+ keepMounted: true,
2270
+ side: t10,
2271
+ children: t11
2272
+ }, void 0, false);
2273
+ $[38] = t10;
2274
+ $[39] = t11;
2275
+ $[40] = t9;
2276
+ $[41] = t12;
2277
+ } else {
2278
+ t12 = $[41];
2279
+ }
2280
+ let t13;
2281
+ if ($[42] !== t12 || $[43] !== t8) {
2282
+ t13 = /* @__PURE__ */ jsxDEV(Popover, {
2283
+ children: [t8, t12]
2284
+ }, void 0, true);
2285
+ $[42] = t12;
2286
+ $[43] = t8;
2287
+ $[44] = t13;
2288
+ } else {
2289
+ t13 = $[44];
2290
+ }
2291
+ return t13;
2292
+ };
2293
+ const StudioSidebar = (t0) => {
2294
+ const $ = c(28);
2295
+ const {
2296
+ chrome,
2297
+ connected,
2298
+ current,
2299
+ groupLabel,
2300
+ groups,
2301
+ selectTab,
2302
+ tabDescription,
2303
+ tabLabel
2304
+ } = t0;
2305
+ const t = useT();
2306
+ const {
2307
+ state
2308
+ } = useSidebar();
2309
+ const collapsed = state === "collapsed";
2310
+ const t1 = collapsed && "justify-center px-0";
2311
+ let t2;
2312
+ if ($[0] !== t1) {
2313
+ t2 = cn("flex items-center gap-2.5 px-1.5 py-1", t1);
2314
+ $[0] = t1;
2315
+ $[1] = t2;
2316
+ } else {
2317
+ t2 = $[1];
2318
+ }
2319
+ let t3;
2320
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2321
+ t3 = /* @__PURE__ */ jsxDEV(BrandMark, {
2322
+ className: "size-9 shrink-0 text-foreground"
2323
+ }, void 0, false);
2324
+ $[2] = t3;
2325
+ } else {
2326
+ t3 = $[2];
2327
+ }
2328
+ let t4;
2329
+ if ($[3] !== collapsed || $[4] !== connected || $[5] !== t) {
2330
+ t4 = !collapsed && /* @__PURE__ */ jsxDEV(Fragment, {
2331
+ children: [/* @__PURE__ */ jsxDEV("span", {
2332
+ className: "grid flex-1 leading-tight",
2333
+ children: [/* @__PURE__ */ jsxDEV("span", {
2334
+ className: "truncate text-sm font-semibold text-foreground",
2335
+ children: "lunora"
2336
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2337
+ className: "truncate text-[11px] text-muted-foreground",
2338
+ children: t("Studio")
2339
+ }, void 0, false)]
2340
+ }, void 0, true), /* @__PURE__ */ jsxDEV(Badge, {
2341
+ className: "px-1.5 text-[10px] tracking-wider uppercase",
2342
+ variant: "secondary",
2343
+ children: connected ? t("Live") : t("Local")
2344
+ }, void 0, false)]
2345
+ }, void 0, true);
2346
+ $[3] = collapsed;
2347
+ $[4] = connected;
2348
+ $[5] = t;
2349
+ $[6] = t4;
2350
+ } else {
2351
+ t4 = $[6];
2352
+ }
2353
+ let t5;
2354
+ if ($[7] !== t2 || $[8] !== t4) {
2355
+ t5 = /* @__PURE__ */ jsxDEV(SidebarHeader, {
2356
+ children: /* @__PURE__ */ jsxDEV("div", {
2357
+ className: t2,
2358
+ children: [t3, t4]
2359
+ }, void 0, true)
2360
+ }, void 0, false);
2361
+ $[7] = t2;
2362
+ $[8] = t4;
2363
+ $[9] = t5;
2364
+ } else {
2365
+ t5 = $[9];
2366
+ }
2367
+ let t6;
2368
+ if ($[10] !== collapsed || $[11] !== current || $[12] !== groupLabel || $[13] !== groups || $[14] !== selectTab || $[15] !== tabDescription || $[16] !== tabLabel) {
2369
+ t6 = collapsed ? groups.map((group) => /* @__PURE__ */ jsxDEV(CollapsedGroupNav, {
2370
+ current,
2371
+ group,
2372
+ groupLabel,
2373
+ selectTab,
2374
+ tabDescription,
2375
+ tabLabel
2376
+ }, group.key, false)) : groups.map((group_0) => /* @__PURE__ */ jsxDEV(SidebarGroup, {
2377
+ children: [/* @__PURE__ */ jsxDEV(SidebarGroupLabel, {
2378
+ className: "text-[11px] font-medium tracking-wider uppercase",
2379
+ children: groupLabel[group_0.key]
2380
+ }, void 0, false), /* @__PURE__ */ jsxDEV(SidebarGroupContent, {
2381
+ children: /* @__PURE__ */ jsxDEV(SidebarMenu, {
2382
+ children: group_0.tabs.map((tab) => /* @__PURE__ */ jsxDEV(SidebarMenuItem, {
2383
+ children: /* @__PURE__ */ jsxDEV(SidebarMenuButton, {
2384
+ className: "data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",
2385
+ "data-tab": tab,
2386
+ "data-testid": `dash-tab-${tab}`,
2387
+ isActive: current === tab,
2388
+ onClick: selectTab,
2389
+ title: tabDescription[tab],
2390
+ tooltip: tabDescription[tab],
2391
+ children: [/* @__PURE__ */ jsxDEV(TabIcon, {
2392
+ tab
2393
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2394
+ children: tabLabel[tab]
2395
+ }, void 0, false)]
2396
+ }, void 0, true)
2397
+ }, tab, false))
2398
+ }, void 0, false)
2399
+ }, void 0, false)]
2400
+ }, group_0.key, true));
2401
+ $[10] = collapsed;
2402
+ $[11] = current;
2403
+ $[12] = groupLabel;
2404
+ $[13] = groups;
2405
+ $[14] = selectTab;
2406
+ $[15] = tabDescription;
2407
+ $[16] = tabLabel;
2408
+ $[17] = t6;
2409
+ } else {
2410
+ t6 = $[17];
2411
+ }
2412
+ let t7;
2413
+ if ($[18] !== t6) {
2414
+ t7 = /* @__PURE__ */ jsxDEV(SidebarContent, {
2415
+ children: t6
2416
+ }, void 0, false);
2417
+ $[18] = t6;
2418
+ $[19] = t7;
2419
+ } else {
2420
+ t7 = $[19];
2421
+ }
2422
+ let t8;
2423
+ if ($[20] !== chrome || $[21] !== collapsed || $[22] !== connected) {
2424
+ t8 = /* @__PURE__ */ jsxDEV(SidebarFooter, {
2425
+ children: /* @__PURE__ */ jsxDEV(SidebarMenu, {
2426
+ children: /* @__PURE__ */ jsxDEV(SidebarMenuItem, {
2427
+ children: /* @__PURE__ */ jsxDEV(SidebarFooterProfile, {
2428
+ chrome,
2429
+ collapsed,
2430
+ connected
2431
+ }, void 0, false)
2432
+ }, void 0, false)
2433
+ }, void 0, false)
2434
+ }, void 0, false);
2435
+ $[20] = chrome;
2436
+ $[21] = collapsed;
2437
+ $[22] = connected;
2438
+ $[23] = t8;
2439
+ } else {
2440
+ t8 = $[23];
2441
+ }
2442
+ let t9;
2443
+ if ($[24] !== t5 || $[25] !== t7 || $[26] !== t8) {
2444
+ t9 = /* @__PURE__ */ jsxDEV(Sidebar, {
2445
+ collapsible: "icon",
2446
+ variant: "inset",
2447
+ children: [t5, t7, t8]
2448
+ }, void 0, true);
2449
+ $[24] = t5;
2450
+ $[25] = t7;
2451
+ $[26] = t8;
2452
+ $[27] = t9;
2453
+ } else {
2454
+ t9 = $[27];
2455
+ }
2456
+ return t9;
2457
+ };
2458
+ const RoutePending = () => {
2459
+ const $ = c(1);
2460
+ let t0;
2461
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2462
+ t0 = /* @__PURE__ */ jsxDEV("div", {
2463
+ className: "flex flex-col gap-4",
2464
+ "data-testid": "dash-pending",
2465
+ children: [/* @__PURE__ */ jsxDEV("div", {
2466
+ className: "flex items-center gap-2",
2467
+ children: [/* @__PURE__ */ jsxDEV(Skeleton, {
2468
+ className: "h-8 w-40"
2469
+ }, void 0, false), /* @__PURE__ */ jsxDEV(Skeleton, {
2470
+ className: "h-8 w-24"
2471
+ }, void 0, false)]
2472
+ }, void 0, true), /* @__PURE__ */ jsxDEV(Skeleton, {
2473
+ className: "h-72 w-full"
2474
+ }, void 0, false)]
2475
+ }, void 0, true);
2476
+ $[0] = t0;
2477
+ } else {
2478
+ t0 = $[0];
2479
+ }
2480
+ return t0;
2481
+ };
2482
+ const StudioLayout = () => {
2483
+ const $ = c(288);
2484
+ const t = useT();
2485
+ const navigate = useNavigate();
2486
+ let t0;
2487
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2488
+ t0 = {
2489
+ select: _temp
2490
+ };
2491
+ $[0] = t0;
2492
+ } else {
2493
+ t0 = $[0];
2494
+ }
2495
+ const pathname = useRouterState(t0);
2496
+ let current;
2497
+ let t1;
2498
+ if ($[1] !== pathname) {
2499
+ current = tabFromPathname(pathname);
2500
+ t1 = FULL_HEIGHT_TABS.has(current);
2501
+ $[1] = pathname;
2502
+ $[2] = current;
2503
+ $[3] = t1;
2504
+ } else {
2505
+ current = $[2];
2506
+ t1 = $[3];
2507
+ }
2508
+ const fullHeight = t1;
2509
+ const features = useStudioFeatures();
2510
+ let t2;
2511
+ if ($[4] !== features) {
2512
+ t2 = (group) => ({
2513
+ ...group,
2514
+ tabs: group.tabs.filter((tab) => isTabVisible(tab, features))
2515
+ });
2516
+ $[4] = features;
2517
+ $[5] = t2;
2518
+ } else {
2519
+ t2 = $[5];
2520
+ }
2521
+ const visibleGroups = NAV_GROUPS.map(t2).filter(_temp2);
2522
+ let t3;
2523
+ let t4;
2524
+ if ($[6] !== current || $[7] !== features || $[8] !== navigate) {
2525
+ t3 = () => {
2526
+ if (!isTabVisible(current, features)) {
2527
+ fireAndForget(navigate({
2528
+ replace: true,
2529
+ to: "/home"
2530
+ }));
2531
+ }
2532
+ };
2533
+ t4 = [current, features, navigate];
2534
+ $[6] = current;
2535
+ $[7] = features;
2536
+ $[8] = navigate;
2537
+ $[9] = t3;
2538
+ $[10] = t4;
2539
+ } else {
2540
+ t3 = $[9];
2541
+ t4 = $[10];
2542
+ }
2543
+ useEffect(t3, t4);
2544
+ let t5;
2545
+ if ($[11] !== t) {
2546
+ t5 = t("Analytics");
2547
+ $[11] = t;
2548
+ $[12] = t5;
2549
+ } else {
2550
+ t5 = $[12];
2551
+ }
2552
+ let t6;
2553
+ if ($[13] !== t) {
2554
+ t6 = t("API");
2555
+ $[13] = t;
2556
+ $[14] = t6;
2557
+ } else {
2558
+ t6 = $[14];
2559
+ }
2560
+ let t7;
2561
+ if ($[15] !== t) {
2562
+ t7 = t("Audit");
2563
+ $[15] = t;
2564
+ $[16] = t7;
2565
+ } else {
2566
+ t7 = $[16];
2567
+ }
2568
+ let t8;
2569
+ if ($[17] !== t) {
2570
+ t8 = t("Configuration");
2571
+ $[17] = t;
2572
+ $[18] = t8;
2573
+ } else {
2574
+ t8 = $[18];
2575
+ }
2576
+ let t9;
2577
+ if ($[19] !== t) {
2578
+ t9 = t("Sessions");
2579
+ $[19] = t;
2580
+ $[20] = t9;
2581
+ } else {
2582
+ t9 = $[20];
2583
+ }
2584
+ let t10;
2585
+ if ($[21] !== t) {
2586
+ t10 = t("Dashboards");
2587
+ $[21] = t;
2588
+ $[22] = t10;
2589
+ } else {
2590
+ t10 = $[22];
2591
+ }
2592
+ let t11;
2593
+ if ($[23] !== t) {
2594
+ t11 = t("Data");
2595
+ $[23] = t;
2596
+ $[24] = t11;
2597
+ } else {
2598
+ t11 = $[24];
2599
+ }
2600
+ let t12;
2601
+ if ($[25] !== t) {
2602
+ t12 = t("Log drains");
2603
+ $[25] = t;
2604
+ $[26] = t12;
2605
+ } else {
2606
+ t12 = $[26];
2607
+ }
2608
+ let t13;
2609
+ if ($[27] !== t) {
2610
+ t13 = t("Export / Import");
2611
+ $[27] = t;
2612
+ $[28] = t13;
2613
+ } else {
2614
+ t13 = $[28];
2615
+ }
2616
+ let t14;
2617
+ if ($[29] !== t) {
2618
+ t14 = t("Fan-out");
2619
+ $[29] = t;
2620
+ $[30] = t14;
2621
+ } else {
2622
+ t14 = $[30];
2623
+ }
2624
+ let t15;
2625
+ if ($[31] !== t) {
2626
+ t15 = t("Files");
2627
+ $[31] = t;
2628
+ $[32] = t15;
2629
+ } else {
2630
+ t15 = $[32];
2631
+ }
2632
+ let t16;
2633
+ if ($[33] !== t) {
2634
+ t16 = t("Flags");
2635
+ $[33] = t;
2636
+ $[34] = t16;
2637
+ } else {
2638
+ t16 = $[34];
2639
+ }
2640
+ let t17;
2641
+ if ($[35] !== t) {
2642
+ t17 = t("Functions");
2643
+ $[35] = t;
2644
+ $[36] = t17;
2645
+ } else {
2646
+ t17 = $[36];
2647
+ }
2648
+ let t18;
2649
+ if ($[37] !== t) {
2650
+ t18 = t("Health");
2651
+ $[37] = t;
2652
+ $[38] = t18;
2653
+ } else {
2654
+ t18 = $[38];
2655
+ }
2656
+ let t19;
2657
+ if ($[39] !== t) {
2658
+ t19 = t("Home");
2659
+ $[39] = t;
2660
+ $[40] = t19;
2661
+ } else {
2662
+ t19 = $[40];
2663
+ }
2664
+ let t20;
2665
+ if ($[41] !== t) {
2666
+ t20 = t("Performance");
2667
+ $[41] = t;
2668
+ $[42] = t20;
2669
+ } else {
2670
+ t20 = $[42];
2671
+ }
2672
+ let t21;
2673
+ if ($[43] !== t) {
2674
+ t21 = t("KV");
2675
+ $[43] = t;
2676
+ $[44] = t21;
2677
+ } else {
2678
+ t21 = $[44];
2679
+ }
2680
+ let t22;
2681
+ if ($[45] !== t) {
2682
+ t22 = t("Logs");
2683
+ $[45] = t;
2684
+ $[46] = t22;
2685
+ } else {
2686
+ t22 = $[46];
2687
+ }
2688
+ let t23;
2689
+ if ($[47] !== t) {
2690
+ t23 = t("Metrics");
2691
+ $[47] = t;
2692
+ $[48] = t23;
2693
+ } else {
2694
+ t23 = $[48];
2695
+ }
2696
+ let t24;
2697
+ if ($[49] !== t) {
2698
+ t24 = t("Migrations");
2699
+ $[49] = t;
2700
+ $[50] = t24;
2701
+ } else {
2702
+ t24 = $[50];
2703
+ }
2704
+ let t25;
2705
+ if ($[51] !== t) {
2706
+ t25 = t("Organizations");
2707
+ $[51] = t;
2708
+ $[52] = t25;
2709
+ } else {
2710
+ t25 = $[52];
2711
+ }
2712
+ let t26;
2713
+ if ($[53] !== t) {
2714
+ t26 = t("Time Travel");
2715
+ $[53] = t;
2716
+ $[54] = t26;
2717
+ } else {
2718
+ t26 = $[54];
2719
+ }
2720
+ let t27;
2721
+ if ($[55] !== t) {
2722
+ t27 = t("Mail");
2723
+ $[55] = t;
2724
+ $[56] = t27;
2725
+ } else {
2726
+ t27 = $[56];
2727
+ }
2728
+ let t28;
2729
+ if ($[57] !== t) {
2730
+ t28 = t("Payments");
2731
+ $[57] = t;
2732
+ $[58] = t28;
2733
+ } else {
2734
+ t28 = $[58];
2735
+ }
2736
+ let t29;
2737
+ if ($[59] !== t) {
2738
+ t29 = t("Permissions");
2739
+ $[59] = t;
2740
+ $[60] = t29;
2741
+ } else {
2742
+ t29 = $[60];
2743
+ }
2744
+ let t30;
2745
+ if ($[61] !== t) {
2746
+ t30 = t("Queues");
2747
+ $[61] = t;
2748
+ $[62] = t30;
2749
+ } else {
2750
+ t30 = $[62];
2751
+ }
2752
+ let t31;
2753
+ if ($[63] !== t) {
2754
+ t31 = t("Realtime");
2755
+ $[63] = t;
2756
+ $[64] = t31;
2757
+ } else {
2758
+ t31 = $[64];
2759
+ }
2760
+ let t32;
2761
+ if ($[65] !== t) {
2762
+ t32 = t("RLS Policies");
2763
+ $[65] = t;
2764
+ $[66] = t32;
2765
+ } else {
2766
+ t32 = $[66];
2767
+ }
2768
+ let t33;
2769
+ if ($[67] !== t) {
2770
+ t33 = t("Scheduled");
2771
+ $[67] = t;
2772
+ $[68] = t33;
2773
+ } else {
2774
+ t33 = $[68];
2775
+ }
2776
+ let t34;
2777
+ if ($[69] !== t) {
2778
+ t34 = t("Schema");
2779
+ $[69] = t;
2780
+ $[70] = t34;
2781
+ } else {
2782
+ t34 = $[70];
2783
+ }
2784
+ let t35;
2785
+ if ($[71] !== t) {
2786
+ t35 = t("Security");
2787
+ $[71] = t;
2788
+ $[72] = t35;
2789
+ } else {
2790
+ t35 = $[72];
2791
+ }
2792
+ let t36;
2793
+ if ($[73] !== t) {
2794
+ t36 = t("Settings");
2795
+ $[73] = t;
2796
+ $[74] = t36;
2797
+ } else {
2798
+ t36 = $[74];
2799
+ }
2800
+ let t37;
2801
+ if ($[75] !== t) {
2802
+ t37 = t("SQL editor");
2803
+ $[75] = t;
2804
+ $[76] = t37;
2805
+ } else {
2806
+ t37 = $[76];
2807
+ }
2808
+ let t38;
2809
+ if ($[77] !== t) {
2810
+ t38 = t("Access Rules");
2811
+ $[77] = t;
2812
+ $[78] = t38;
2813
+ } else {
2814
+ t38 = $[78];
2815
+ }
2816
+ let t39;
2817
+ if ($[79] !== t) {
2818
+ t39 = t("Users");
2819
+ $[79] = t;
2820
+ $[80] = t39;
2821
+ } else {
2822
+ t39 = $[80];
2823
+ }
2824
+ let t40;
2825
+ if ($[81] !== t) {
2826
+ t40 = t("Vectors");
2827
+ $[81] = t;
2828
+ $[82] = t40;
2829
+ } else {
2830
+ t40 = $[82];
2831
+ }
2832
+ let t41;
2833
+ if ($[83] !== t) {
2834
+ t41 = t("Workflows");
2835
+ $[83] = t;
2836
+ $[84] = t41;
2837
+ } else {
2838
+ t41 = $[84];
2839
+ }
2840
+ let t42;
2841
+ if ($[85] !== t10 || $[86] !== t11 || $[87] !== t12 || $[88] !== t13 || $[89] !== t14 || $[90] !== t15 || $[91] !== t16 || $[92] !== t17 || $[93] !== t18 || $[94] !== t19 || $[95] !== t20 || $[96] !== t21 || $[97] !== t22 || $[98] !== t23 || $[99] !== t24 || $[100] !== t25 || $[101] !== t26 || $[102] !== t27 || $[103] !== t28 || $[104] !== t29 || $[105] !== t30 || $[106] !== t31 || $[107] !== t32 || $[108] !== t33 || $[109] !== t34 || $[110] !== t35 || $[111] !== t36 || $[112] !== t37 || $[113] !== t38 || $[114] !== t39 || $[115] !== t40 || $[116] !== t41 || $[117] !== t5 || $[118] !== t6 || $[119] !== t7 || $[120] !== t8 || $[121] !== t9) {
2842
+ t42 = {
2843
+ analytics: t5,
2844
+ api: t6,
2845
+ audit: t7,
2846
+ authConfig: t8,
2847
+ authSessions: t9,
2848
+ dashboards: t10,
2849
+ data: t11,
2850
+ drains: t12,
2851
+ export: t13,
2852
+ fanout: t14,
2853
+ files: t15,
2854
+ flags: t16,
2855
+ functions: t17,
2856
+ health: t18,
2857
+ home: t19,
2858
+ insights: t20,
2859
+ kv: t21,
2860
+ logs: t22,
2861
+ metrics: t23,
2862
+ migrations: t24,
2863
+ organizations: t25,
2864
+ pitr: t26,
2865
+ mail: t27,
2866
+ payments: t28,
2867
+ permissions: t29,
2868
+ queues: t30,
2869
+ realtime: t31,
2870
+ rls: t32,
2871
+ schedule: t33,
2872
+ schema: t34,
2873
+ security: t35,
2874
+ settings: t36,
2875
+ sql: t37,
2876
+ storageRules: t38,
2877
+ users: t39,
2878
+ vectors: t40,
2879
+ workflows: t41
2880
+ };
2881
+ $[85] = t10;
2882
+ $[86] = t11;
2883
+ $[87] = t12;
2884
+ $[88] = t13;
2885
+ $[89] = t14;
2886
+ $[90] = t15;
2887
+ $[91] = t16;
2888
+ $[92] = t17;
2889
+ $[93] = t18;
2890
+ $[94] = t19;
2891
+ $[95] = t20;
2892
+ $[96] = t21;
2893
+ $[97] = t22;
2894
+ $[98] = t23;
2895
+ $[99] = t24;
2896
+ $[100] = t25;
2897
+ $[101] = t26;
2898
+ $[102] = t27;
2899
+ $[103] = t28;
2900
+ $[104] = t29;
2901
+ $[105] = t30;
2902
+ $[106] = t31;
2903
+ $[107] = t32;
2904
+ $[108] = t33;
2905
+ $[109] = t34;
2906
+ $[110] = t35;
2907
+ $[111] = t36;
2908
+ $[112] = t37;
2909
+ $[113] = t38;
2910
+ $[114] = t39;
2911
+ $[115] = t40;
2912
+ $[116] = t41;
2913
+ $[117] = t5;
2914
+ $[118] = t6;
2915
+ $[119] = t7;
2916
+ $[120] = t8;
2917
+ $[121] = t9;
2918
+ $[122] = t42;
2919
+ } else {
2920
+ t42 = $[122];
2921
+ }
2922
+ const tabLabel = t42;
2923
+ const groupLabel = {
2924
+ advisors: t("Advisors"),
2925
+ auth: t("Auth"),
2926
+ database: t("Database"),
2927
+ functions: t("Functions"),
2928
+ observability: t("Observability"),
2929
+ operations: t("Operations"),
2930
+ overview: t("Overview"),
2931
+ settings: t("Settings"),
2932
+ storage: t("Storage")
2933
+ };
2934
+ let t43;
2935
+ if ($[123] !== t) {
2936
+ t43 = t("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards.");
2937
+ $[123] = t;
2938
+ $[124] = t43;
2939
+ } else {
2940
+ t43 = $[124];
2941
+ }
2942
+ let t44;
2943
+ if ($[125] !== t) {
2944
+ t44 = t("Interactive OpenAPI reference and copy-paste snippets for your functions.");
2945
+ $[125] = t;
2946
+ $[126] = t44;
2947
+ } else {
2948
+ t44 = $[126];
2949
+ }
2950
+ let t45;
2951
+ if ($[127] !== t) {
2952
+ t45 = t("A durable log of admin state-changing operations.");
2953
+ $[127] = t;
2954
+ $[128] = t45;
2955
+ } else {
2956
+ t45 = $[128];
2957
+ }
2958
+ let t46;
2959
+ if ($[129] !== t) {
2960
+ t46 = t("Enabled plugins and session config (read-only).");
2961
+ $[129] = t;
2962
+ $[130] = t46;
2963
+ } else {
2964
+ t46 = $[130];
2965
+ }
2966
+ let t47;
2967
+ if ($[131] !== t) {
2968
+ t47 = t("Browse and revoke active sessions across all users.");
2969
+ $[131] = t;
2970
+ $[132] = t47;
2971
+ } else {
2972
+ t47 = $[132];
2973
+ }
2974
+ let t48;
2975
+ if ($[133] !== t) {
2976
+ t48 = t("Chart widgets backed by saved read-only SQL queries.");
2977
+ $[133] = t;
2978
+ $[134] = t48;
2979
+ } else {
2980
+ t48 = $[134];
2981
+ }
2982
+ let t49;
2983
+ if ($[135] !== t) {
2984
+ t49 = t("Browse and edit rows across your shard and global tables.");
2985
+ $[135] = t;
2986
+ $[136] = t49;
2987
+ } else {
2988
+ t49 = $[136];
2989
+ }
2990
+ let t50;
2991
+ if ($[137] !== t) {
2992
+ t50 = t("Forward logs to Logpush, Tail Workers, or a webhook collector.");
2993
+ $[137] = t;
2994
+ $[138] = t50;
2995
+ } else {
2996
+ t50 = $[138];
2997
+ }
2998
+ let t51;
2999
+ if ($[139] !== t) {
3000
+ t51 = t("Export a shard to NDJSON, or import rows from it.");
3001
+ $[139] = t;
3002
+ $[140] = t51;
3003
+ } else {
3004
+ t51 = $[140];
3005
+ }
3006
+ let t52;
3007
+ if ($[141] !== t) {
3008
+ t52 = t("Realtime fan-out cost and per-topic subscriber counts for this shard.");
3009
+ $[141] = t;
3010
+ $[142] = t52;
3011
+ } else {
3012
+ t52 = $[142];
3013
+ }
3014
+ let t53;
3015
+ if ($[143] !== t) {
3016
+ t53 = t("Browse objects in your R2 storage buckets.");
3017
+ $[143] = t;
3018
+ $[144] = t53;
3019
+ } else {
3020
+ t53 = $[144];
3021
+ }
3022
+ let t54;
3023
+ if ($[145] !== t) {
3024
+ t54 = t("Inspect feature flags and their live evaluation under a targeting context.");
3025
+ $[145] = t;
3026
+ $[146] = t54;
3027
+ } else {
3028
+ t54 = $[146];
3029
+ }
3030
+ let t55;
3031
+ if ($[147] !== t) {
3032
+ t55 = t("Run registered queries, mutations, and actions.");
3033
+ $[147] = t;
3034
+ $[148] = t55;
3035
+ } else {
3036
+ t55 = $[148];
3037
+ }
3038
+ let t56;
3039
+ if ($[149] !== t) {
3040
+ t56 = t("At-a-glance connection, error, and shard signals.");
3041
+ $[149] = t;
3042
+ $[150] = t56;
3043
+ } else {
3044
+ t56 = $[150];
3045
+ }
3046
+ let t57;
3047
+ if ($[151] !== t) {
3048
+ t57 = t("Connection, health, and advisor summary for your deployment.");
3049
+ $[151] = t;
3050
+ $[152] = t57;
3051
+ } else {
3052
+ t57 = $[152];
3053
+ }
3054
+ let t58;
3055
+ if ($[153] !== t) {
3056
+ t58 = t("Surface slow functions, error spikes, and cache problems.");
3057
+ $[153] = t;
3058
+ $[154] = t58;
3059
+ } else {
3060
+ t58 = $[154];
3061
+ }
3062
+ let t59;
3063
+ if ($[155] !== t) {
3064
+ t59 = t("A live stream of recent function logs.");
3065
+ $[155] = t;
3066
+ $[156] = t59;
3067
+ } else {
3068
+ t59 = $[156];
3069
+ }
3070
+ let t60;
3071
+ if ($[157] !== t) {
3072
+ t60 = t("Per-shard health and aggregate metrics.");
3073
+ $[157] = t;
3074
+ $[158] = t60;
3075
+ } else {
3076
+ t60 = $[158];
3077
+ }
3078
+ let t61;
3079
+ if ($[159] !== t) {
3080
+ t61 = t("Review migration status and run them.");
3081
+ $[159] = t;
3082
+ $[160] = t61;
3083
+ } else {
3084
+ t61 = $[160];
3085
+ }
3086
+ let t62;
3087
+ if ($[161] !== t) {
3088
+ t62 = t("Browse and manage organizations, members, and invitations.");
3089
+ $[161] = t;
3090
+ $[162] = t62;
3091
+ } else {
3092
+ t62 = $[162];
3093
+ }
3094
+ let t63;
3095
+ if ($[163] !== t) {
3096
+ t63 = t("Restore a shard to a point in the last 30 days.");
3097
+ $[163] = t;
3098
+ $[164] = t63;
3099
+ } else {
3100
+ t63 = $[164];
3101
+ }
3102
+ let t64;
3103
+ if ($[165] !== t) {
3104
+ t64 = t("Email your app sent, captured in dev.");
3105
+ $[165] = t;
3106
+ $[166] = t64;
3107
+ } else {
3108
+ t64 = $[166];
3109
+ }
3110
+ let t65;
3111
+ if ($[167] !== t) {
3112
+ t65 = t("Synced customers, subscriptions, and webhook events.");
3113
+ $[167] = t;
3114
+ $[168] = t65;
3115
+ } else {
3116
+ t65 = $[168];
3117
+ }
3118
+ let t66;
3119
+ if ($[169] !== t) {
3120
+ t66 = t("Inspect access policies per table, and probe a function as any identity.");
3121
+ $[169] = t;
3122
+ $[170] = t66;
3123
+ } else {
3124
+ t66 = $[170];
3125
+ }
3126
+ let t67;
3127
+ if ($[171] !== t) {
3128
+ t67 = t("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue.");
3129
+ $[171] = t;
3130
+ $[172] = t67;
3131
+ } else {
3132
+ t67 = $[172];
3133
+ }
3134
+ let t68;
3135
+ if ($[173] !== t) {
3136
+ t68 = t("Active WebSocket subscriptions on this shard.");
3137
+ $[173] = t;
3138
+ $[174] = t68;
3139
+ } else {
3140
+ t68 = $[174];
3141
+ }
3142
+ let t69;
3143
+ if ($[175] !== t) {
3144
+ t69 = t("Inspect row-level-security policies and roles, per table.");
3145
+ $[175] = t;
3146
+ $[176] = t69;
3147
+ } else {
3148
+ t69 = $[176];
3149
+ }
3150
+ let t70;
3151
+ if ($[177] !== t) {
3152
+ t70 = t("Inspect and cancel scheduled jobs.");
3153
+ $[177] = t;
3154
+ $[178] = t70;
3155
+ } else {
3156
+ t70 = $[178];
3157
+ }
3158
+ let t71;
3159
+ if ($[179] !== t) {
3160
+ t71 = t("Inspect each table and its columns.");
3161
+ $[179] = t;
3162
+ $[180] = t71;
3163
+ } else {
3164
+ t71 = $[180];
3165
+ }
3166
+ let t72;
3167
+ if ($[181] !== t) {
3168
+ t72 = t("Review admin gates, credentials, and log redaction.");
3169
+ $[181] = t;
3170
+ $[182] = t72;
3171
+ } else {
3172
+ t72 = $[182];
3173
+ }
3174
+ let t73;
3175
+ if ($[183] !== t) {
3176
+ t73 = t("Read-only deployment config — vars, secrets, and bindings.");
3177
+ $[183] = t;
3178
+ $[184] = t73;
3179
+ } else {
3180
+ t73 = $[184];
3181
+ }
3182
+ let t74;
3183
+ if ($[185] !== t) {
3184
+ t74 = t("Run read-only SQL against a shard.");
3185
+ $[185] = t;
3186
+ $[186] = t74;
3187
+ } else {
3188
+ t74 = $[186];
3189
+ }
3190
+ let t75;
3191
+ if ($[187] !== t) {
3192
+ t75 = t("Browse and edit key-value pairs in your Workers KV namespaces.");
3193
+ $[187] = t;
3194
+ $[188] = t75;
3195
+ } else {
3196
+ t75 = $[188];
3197
+ }
3198
+ let t76;
3199
+ if ($[189] !== t) {
3200
+ t76 = t("Inspect storage access rules — per bucket, operation, and key prefix.");
3201
+ $[189] = t;
3202
+ $[190] = t76;
3203
+ } else {
3204
+ t76 = $[190];
3205
+ }
3206
+ let t77;
3207
+ if ($[191] !== t) {
3208
+ t77 = t("Manage auth users — roles, bans, sessions, and identity.");
3209
+ $[191] = t;
3210
+ $[192] = t77;
3211
+ } else {
3212
+ t77 = $[192];
3213
+ }
3214
+ let t78;
3215
+ if ($[193] !== t) {
3216
+ t78 = t("Browse Vectorize indexes and run similarity searches.");
3217
+ $[193] = t;
3218
+ $[194] = t78;
3219
+ } else {
3220
+ t78 = $[194];
3221
+ }
3222
+ let t79;
3223
+ if ($[195] !== t) {
3224
+ t79 = t("Inspect declared Cloudflare Workflows and their bindings.");
3225
+ $[195] = t;
3226
+ $[196] = t79;
3227
+ } else {
3228
+ t79 = $[196];
3229
+ }
3230
+ let t80;
3231
+ if ($[197] !== t43 || $[198] !== t44 || $[199] !== t45 || $[200] !== t46 || $[201] !== t47 || $[202] !== t48 || $[203] !== t49 || $[204] !== t50 || $[205] !== t51 || $[206] !== t52 || $[207] !== t53 || $[208] !== t54 || $[209] !== t55 || $[210] !== t56 || $[211] !== t57 || $[212] !== t58 || $[213] !== t59 || $[214] !== t60 || $[215] !== t61 || $[216] !== t62 || $[217] !== t63 || $[218] !== t64 || $[219] !== t65 || $[220] !== t66 || $[221] !== t67 || $[222] !== t68 || $[223] !== t69 || $[224] !== t70 || $[225] !== t71 || $[226] !== t72 || $[227] !== t73 || $[228] !== t74 || $[229] !== t75 || $[230] !== t76 || $[231] !== t77 || $[232] !== t78 || $[233] !== t79) {
3232
+ t80 = {
3233
+ analytics: t43,
3234
+ api: t44,
3235
+ audit: t45,
3236
+ authConfig: t46,
3237
+ authSessions: t47,
3238
+ dashboards: t48,
3239
+ data: t49,
3240
+ drains: t50,
3241
+ export: t51,
3242
+ fanout: t52,
3243
+ files: t53,
3244
+ flags: t54,
3245
+ functions: t55,
3246
+ health: t56,
3247
+ home: t57,
3248
+ insights: t58,
3249
+ logs: t59,
3250
+ metrics: t60,
3251
+ migrations: t61,
3252
+ organizations: t62,
3253
+ pitr: t63,
3254
+ mail: t64,
3255
+ payments: t65,
3256
+ permissions: t66,
3257
+ queues: t67,
3258
+ realtime: t68,
3259
+ rls: t69,
3260
+ schedule: t70,
3261
+ schema: t71,
3262
+ security: t72,
3263
+ settings: t73,
3264
+ sql: t74,
3265
+ kv: t75,
3266
+ storageRules: t76,
3267
+ users: t77,
3268
+ vectors: t78,
3269
+ workflows: t79
3270
+ };
3271
+ $[197] = t43;
3272
+ $[198] = t44;
3273
+ $[199] = t45;
3274
+ $[200] = t46;
3275
+ $[201] = t47;
3276
+ $[202] = t48;
3277
+ $[203] = t49;
3278
+ $[204] = t50;
3279
+ $[205] = t51;
3280
+ $[206] = t52;
3281
+ $[207] = t53;
3282
+ $[208] = t54;
3283
+ $[209] = t55;
3284
+ $[210] = t56;
3285
+ $[211] = t57;
3286
+ $[212] = t58;
3287
+ $[213] = t59;
3288
+ $[214] = t60;
3289
+ $[215] = t61;
3290
+ $[216] = t62;
3291
+ $[217] = t63;
3292
+ $[218] = t64;
3293
+ $[219] = t65;
3294
+ $[220] = t66;
3295
+ $[221] = t67;
3296
+ $[222] = t68;
3297
+ $[223] = t69;
3298
+ $[224] = t70;
3299
+ $[225] = t71;
3300
+ $[226] = t72;
3301
+ $[227] = t73;
3302
+ $[228] = t74;
3303
+ $[229] = t75;
3304
+ $[230] = t76;
3305
+ $[231] = t77;
3306
+ $[232] = t78;
3307
+ $[233] = t79;
3308
+ $[234] = t80;
3309
+ } else {
3310
+ t80 = $[234];
3311
+ }
3312
+ const tabDescription = t80;
3313
+ let t81;
3314
+ if ($[235] !== navigate) {
3315
+ t81 = (event) => {
3316
+ fireAndForget(navigate({
3317
+ to: `/${event.currentTarget.dataset.tab ?? ""}`
3318
+ }));
3319
+ };
3320
+ $[235] = navigate;
3321
+ $[236] = t81;
3322
+ } else {
3323
+ t81 = $[236];
3324
+ }
3325
+ const selectTab = t81;
3326
+ let t82;
3327
+ let t83;
3328
+ if ($[237] !== current || $[238] !== tabLabel) {
3329
+ t82 = () => {
3330
+ if (typeof document !== "undefined") {
3331
+ document.title = `${tabLabel[current]} · lunora`;
3332
+ }
3333
+ };
3334
+ t83 = [current, tabLabel];
3335
+ $[237] = current;
3336
+ $[238] = tabLabel;
3337
+ $[239] = t82;
3338
+ $[240] = t83;
3339
+ } else {
3340
+ t82 = $[239];
3341
+ t83 = $[240];
3342
+ }
3343
+ useEffect(t82, t83);
3344
+ const activeGroup = visibleGroups.find((group_1) => group_1.tabs.includes(current)) ?? NAV_GROUPS[0];
3345
+ const commandItems = visibleGroups.flatMap((group_2) => group_2.tabs.map((tab_0) => ({
3346
+ group: groupLabel[group_2.key],
3347
+ label: tabLabel[tab_0],
3348
+ to: `/${tab_0}`
3349
+ })));
3350
+ const chrome = use(StudioChromeContext);
3351
+ const connected = chrome !== null && chrome.token !== "";
3352
+ let t84;
3353
+ if ($[241] !== commandItems) {
3354
+ t84 = /* @__PURE__ */ jsxDEV(CommandPalette, {
3355
+ items: commandItems
3356
+ }, void 0, false);
3357
+ $[241] = commandItems;
3358
+ $[242] = t84;
3359
+ } else {
3360
+ t84 = $[242];
3361
+ }
3362
+ let t85;
3363
+ if ($[243] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3364
+ t85 = /* @__PURE__ */ jsxDEV(SidebarTrigger, {
3365
+ className: "-ms-1"
3366
+ }, void 0, false);
3367
+ $[243] = t85;
3368
+ } else {
3369
+ t85 = $[243];
3370
+ }
3371
+ let t86;
3372
+ if ($[244] !== t) {
3373
+ t86 = t("Breadcrumb");
3374
+ $[244] = t;
3375
+ $[245] = t86;
3376
+ } else {
3377
+ t86 = $[245];
3378
+ }
3379
+ const t87 = groupLabel[activeGroup.key];
3380
+ let t88;
3381
+ if ($[246] !== t87) {
3382
+ t88 = /* @__PURE__ */ jsxDEV("span", {
3383
+ className: "text-muted-foreground",
3384
+ children: t87
3385
+ }, void 0, false);
3386
+ $[246] = t87;
3387
+ $[247] = t88;
3388
+ } else {
3389
+ t88 = $[247];
3390
+ }
3391
+ let t89;
3392
+ if ($[248] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3393
+ t89 = /* @__PURE__ */ jsxDEV("svg", {
3394
+ "aria-hidden": "true",
3395
+ className: "size-3.5 text-muted-foreground/60",
3396
+ fill: "none",
3397
+ stroke: "currentColor",
3398
+ strokeWidth: 1.7,
3399
+ viewBox: "0 0 24 24",
3400
+ children: /* @__PURE__ */ jsxDEV("path", {
3401
+ d: "m9 6 6 6-6 6",
3402
+ strokeLinecap: "round",
3403
+ strokeLinejoin: "round"
3404
+ }, void 0, false)
3405
+ }, void 0, false);
3406
+ $[248] = t89;
3407
+ } else {
3408
+ t89 = $[248];
3409
+ }
3410
+ const t90 = tabLabel[current];
3411
+ let t91;
3412
+ if ($[249] !== t90) {
3413
+ t91 = /* @__PURE__ */ jsxDEV("span", {
3414
+ className: "font-medium text-foreground",
3415
+ children: t90
3416
+ }, void 0, false);
3417
+ $[249] = t90;
3418
+ $[250] = t91;
3419
+ } else {
3420
+ t91 = $[250];
3421
+ }
3422
+ let t92;
3423
+ if ($[251] !== t86 || $[252] !== t88 || $[253] !== t91) {
3424
+ t92 = /* @__PURE__ */ jsxDEV("nav", {
3425
+ "aria-label": t86,
3426
+ className: "flex items-center gap-1.5 text-[13px]",
3427
+ children: [t88, t89, t91]
3428
+ }, void 0, true);
3429
+ $[251] = t86;
3430
+ $[252] = t88;
3431
+ $[253] = t91;
3432
+ $[254] = t92;
3433
+ } else {
3434
+ t92 = $[254];
3435
+ }
3436
+ let t93;
3437
+ if ($[255] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3438
+ t93 = /* @__PURE__ */ jsxDEV("svg", {
3439
+ "aria-hidden": "true",
3440
+ className: "size-3.5",
3441
+ fill: "none",
3442
+ stroke: "currentColor",
3443
+ strokeWidth: 1.8,
3444
+ viewBox: "0 0 24 24",
3445
+ children: [/* @__PURE__ */ jsxDEV("circle", {
3446
+ cx: "11",
3447
+ cy: "11",
3448
+ r: "7"
3449
+ }, void 0, false), /* @__PURE__ */ jsxDEV("path", {
3450
+ d: "m21 21-4.3-4.3",
3451
+ strokeLinecap: "round"
3452
+ }, void 0, false)]
3453
+ }, void 0, true);
3454
+ $[255] = t93;
3455
+ } else {
3456
+ t93 = $[255];
3457
+ }
3458
+ let t94;
3459
+ if ($[256] !== t) {
3460
+ t94 = t("Search…");
3461
+ $[256] = t;
3462
+ $[257] = t94;
3463
+ } else {
3464
+ t94 = $[257];
3465
+ }
3466
+ let t95;
3467
+ if ($[258] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3468
+ t95 = /* @__PURE__ */ jsxDEV("kbd", {
3469
+ className: "ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",
3470
+ children: "⌘K"
3471
+ }, void 0, false);
3472
+ $[258] = t95;
3473
+ } else {
3474
+ t95 = $[258];
3475
+ }
3476
+ let t96;
3477
+ if ($[259] !== t94) {
3478
+ t96 = /* @__PURE__ */ jsxDEV("button", {
3479
+ className: "mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex",
3480
+ "data-testid": "dash-app-search",
3481
+ onClick: openCommandPalette,
3482
+ type: "button",
3483
+ children: [t93, t94, t95]
3484
+ }, void 0, true);
3485
+ $[259] = t94;
3486
+ $[260] = t96;
3487
+ } else {
3488
+ t96 = $[260];
3489
+ }
3490
+ let t97;
3491
+ if ($[261] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3492
+ t97 = /* @__PURE__ */ jsxDEV("div", {
3493
+ className: "ms-auto flex items-center gap-1.5 md:ms-0",
3494
+ children: /* @__PURE__ */ jsxDEV(ThemeToggle, {}, void 0, false)
3495
+ }, void 0, false);
3496
+ $[261] = t97;
3497
+ } else {
3498
+ t97 = $[261];
3499
+ }
3500
+ let t98;
3501
+ if ($[262] !== t92 || $[263] !== t96) {
3502
+ t98 = /* @__PURE__ */ jsxDEV("header", {
3503
+ className: "flex h-11 shrink-0 items-center gap-2 border-b border-border px-4",
3504
+ "data-testid": "dash-app-header",
3505
+ children: [t85, t92, t96, t97]
3506
+ }, void 0, true);
3507
+ $[262] = t92;
3508
+ $[263] = t96;
3509
+ $[264] = t98;
3510
+ } else {
3511
+ t98 = $[264];
3512
+ }
3513
+ let t99;
3514
+ if ($[265] !== chrome?.rulesInstalled) {
3515
+ t99 = chrome?.rulesInstalled === false && /* @__PURE__ */ jsxDEV(RulesBanner, {}, void 0, false);
3516
+ $[265] = chrome?.rulesInstalled;
3517
+ $[266] = t99;
3518
+ } else {
3519
+ t99 = $[266];
3520
+ }
3521
+ const t100 = `dash-tab-${current}`;
3522
+ const t101 = fullHeight ? "flex min-w-0 flex-1 flex-col overflow-hidden" : "min-w-0 flex-1 overflow-auto p-6";
3523
+ const t102 = tabLabel[current];
3524
+ let t103;
3525
+ if ($[267] !== t || $[268] !== t102) {
3526
+ t103 = t("{title} failed", {
3527
+ title: t102
3528
+ });
3529
+ $[267] = t;
3530
+ $[268] = t102;
3531
+ $[269] = t103;
3532
+ } else {
3533
+ t103 = $[269];
3534
+ }
3535
+ const t104 = tabLabel[current];
3536
+ let t105;
3537
+ if ($[270] !== t) {
3538
+ t105 = t("Try again");
3539
+ $[270] = t;
3540
+ $[271] = t105;
3541
+ } else {
3542
+ t105 = $[271];
3543
+ }
3544
+ let t106;
3545
+ if ($[272] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3546
+ t106 = /* @__PURE__ */ jsxDEV(Suspense, {
3547
+ fallback: /* @__PURE__ */ jsxDEV(RoutePending, {}, void 0, false),
3548
+ children: /* @__PURE__ */ jsxDEV(Outlet, {}, void 0, false)
3549
+ }, void 0, false);
3550
+ $[272] = t106;
3551
+ } else {
3552
+ t106 = $[272];
3553
+ }
3554
+ let t107;
3555
+ if ($[273] !== current || $[274] !== t103 || $[275] !== t104 || $[276] !== t105) {
3556
+ t107 = /* @__PURE__ */ jsxDEV(ErrorBoundary, {
3557
+ fallbackTitle: t103,
3558
+ label: t104,
3559
+ retryLabel: t105,
3560
+ children: t106
3561
+ }, current, false);
3562
+ $[273] = current;
3563
+ $[274] = t103;
3564
+ $[275] = t104;
3565
+ $[276] = t105;
3566
+ $[277] = t107;
3567
+ } else {
3568
+ t107 = $[277];
3569
+ }
3570
+ let t108;
3571
+ if ($[278] !== t101 || $[279] !== t107) {
3572
+ t108 = /* @__PURE__ */ jsxDEV("div", {
3573
+ className: t101,
3574
+ children: t107
3575
+ }, void 0, false);
3576
+ $[278] = t101;
3577
+ $[279] = t107;
3578
+ $[280] = t108;
3579
+ } else {
3580
+ t108 = $[280];
3581
+ }
3582
+ let t109;
3583
+ if ($[281] !== t100 || $[282] !== t108) {
3584
+ t109 = /* @__PURE__ */ jsxDEV("div", {
3585
+ "aria-labelledby": t100,
3586
+ className: "flex min-w-0 flex-1 flex-col overflow-hidden",
3587
+ "data-testid": "dash-panel",
3588
+ id: "dash-panel",
3589
+ role: "tabpanel",
3590
+ children: t108
3591
+ }, void 0, false);
3592
+ $[281] = t100;
3593
+ $[282] = t108;
3594
+ $[283] = t109;
3595
+ } else {
3596
+ t109 = $[283];
3597
+ }
3598
+ let t110;
3599
+ if ($[284] !== t109 || $[285] !== t98 || $[286] !== t99) {
3600
+ t110 = /* @__PURE__ */ jsxDEV(SidebarInset, {
3601
+ className: "overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
3602
+ children: [t98, t99, t109]
3603
+ }, void 0, true);
3604
+ $[284] = t109;
3605
+ $[285] = t98;
3606
+ $[286] = t99;
3607
+ $[287] = t110;
3608
+ } else {
3609
+ t110 = $[287];
3610
+ }
3611
+ return /* @__PURE__ */ jsxDEV(SidebarProvider, {
3612
+ className: "min-h-0 flex-1",
3613
+ "data-testid": "lunora-studio",
3614
+ children: [t84, /* @__PURE__ */ jsxDEV(StudioSidebar, {
3615
+ chrome,
3616
+ connected,
3617
+ current,
3618
+ groupLabel,
3619
+ groups: visibleGroups,
3620
+ selectTab,
3621
+ tabDescription,
3622
+ tabLabel
3623
+ }, void 0, false), t110]
3624
+ }, void 0, true);
3625
+ };
3626
+ const SchemaRoutePanel = (t0) => {
3627
+ const $ = c(5);
3628
+ const {
3629
+ initialShardKey,
3630
+ schemaEditable
3631
+ } = t0;
3632
+ let t1;
3633
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3634
+ t1 = {
3635
+ strict: false
3636
+ };
3637
+ $[0] = t1;
3638
+ } else {
3639
+ t1 = $[0];
3640
+ }
3641
+ const search = useSearch(t1);
3642
+ const {
3643
+ table
3644
+ } = search;
3645
+ const initialTable = typeof table === "string" ? table : void 0;
3646
+ let t2;
3647
+ if ($[1] !== initialShardKey || $[2] !== initialTable || $[3] !== schemaEditable) {
3648
+ t2 = /* @__PURE__ */ jsxDEV(SchemaViewer, {
3649
+ initialShardKey,
3650
+ initialTable,
3651
+ schemaEditable
3652
+ }, void 0, false);
3653
+ $[1] = initialShardKey;
3654
+ $[2] = initialTable;
3655
+ $[3] = schemaEditable;
3656
+ $[4] = t2;
3657
+ } else {
3658
+ t2 = $[4];
3659
+ }
3660
+ return t2;
3661
+ };
3662
+ const NotFoundRedirect = () => {
3663
+ const $ = c(3);
3664
+ const navigate = useNavigate();
3665
+ let t0;
3666
+ let t1;
3667
+ if ($[0] !== navigate) {
3668
+ t0 = () => {
3669
+ fireAndForget(navigate({
3670
+ replace: true,
3671
+ to: "/home"
3672
+ }));
3673
+ };
3674
+ t1 = [navigate];
3675
+ $[0] = navigate;
3676
+ $[1] = t0;
3677
+ $[2] = t1;
3678
+ } else {
3679
+ t0 = $[1];
3680
+ t1 = $[2];
3681
+ }
3682
+ useEffect(t0, t1);
3683
+ return null;
3684
+ };
3685
+ const buildRouter = ({
3686
+ basePath,
3687
+ dataEditable = false,
3688
+ functions,
3689
+ initialShardKey,
3690
+ openApiSpec,
3691
+ openRpcSpec,
3692
+ runAsIdentity = false,
3693
+ schemaEditable = false,
3694
+ scheduledCancel,
3695
+ scheduledCron,
3696
+ scheduledLoad
3697
+ }) => {
3698
+ const rootRoute = createRootRoute({
3699
+ component: StudioLayout
3700
+ });
3701
+ const panels = {
3702
+ analytics: /* @__PURE__ */ jsxDEV(AnalyticsPanel, {}, void 0, false),
3703
+ api: /* @__PURE__ */ jsxDEV(ApiTab, {
3704
+ functions,
3705
+ initialShardKey,
3706
+ openApiSpec,
3707
+ openRpcSpec
3708
+ }, void 0, false),
3709
+ audit: /* @__PURE__ */ jsxDEV(AuditPanel, {
3710
+ initialShardKey
3711
+ }, void 0, false),
3712
+ authConfig: /* @__PURE__ */ jsxDEV(AuthConfigPanel, {}, void 0, false),
3713
+ authSessions: /* @__PURE__ */ jsxDEV(AuthSessionsPanel, {}, void 0, false),
3714
+ dashboards: /* @__PURE__ */ jsxDEV(DashboardsPanel, {
3715
+ initialShardKey
3716
+ }, void 0, false),
3717
+ data: /* @__PURE__ */ jsxDEV(TableEditor, {
3718
+ editable: dataEditable,
3719
+ initialShardKey
3720
+ }, void 0, false),
3721
+ drains: /* @__PURE__ */ jsxDEV(LogDrainsPanel, {}, void 0, false),
3722
+ export: /* @__PURE__ */ jsxDEV(ExportImportPanel, {
3723
+ initialShardKey
3724
+ }, void 0, false),
3725
+ fanout: /* @__PURE__ */ jsxDEV(FanoutPanel, {
3726
+ initialShardKey
3727
+ }, void 0, false),
3728
+ files: /* @__PURE__ */ jsxDEV(FileBrowser, {}, void 0, false),
3729
+ kv: /* @__PURE__ */ jsxDEV(KvBrowser, {}, void 0, false),
3730
+ flags: /* @__PURE__ */ jsxDEV(FlagsPanel, {
3731
+ initialShardKey
3732
+ }, void 0, false),
3733
+ functions: /* @__PURE__ */ jsxDEV("div", {
3734
+ className: "flex flex-col gap-8",
3735
+ children: [/* @__PURE__ */ jsxDEV(FunctionStatsPanel, {
3736
+ functions,
3737
+ initialShardKey
3738
+ }, void 0, false), /* @__PURE__ */ jsxDEV(FunctionRunner, {
3739
+ functions,
3740
+ runAsIdentity
3741
+ }, void 0, false)]
3742
+ }, void 0, true),
3743
+ health: /* @__PURE__ */ jsxDEV(HealthPanel, {
3744
+ initialShardKey
3745
+ }, void 0, false),
3746
+ home: /* @__PURE__ */ jsxDEV(HomePanel, {
3747
+ initialShardKey
3748
+ }, void 0, false),
3749
+ insights: /* @__PURE__ */ jsxDEV(InsightsPanel, {
3750
+ initialShardKey
3751
+ }, void 0, false),
3752
+ logs: /* @__PURE__ */ jsxDEV(LogsPanel, {
3753
+ initialShardKey
3754
+ }, void 0, false),
3755
+ metrics: /* @__PURE__ */ jsxDEV(MetricsPanel, {
3756
+ initialShardKey
3757
+ }, void 0, false),
3758
+ migrations: /* @__PURE__ */ jsxDEV(MigrationsPanel, {
3759
+ initialShardKey
3760
+ }, void 0, false),
3761
+ organizations: /* @__PURE__ */ jsxDEV(OrganizationsPanel, {}, void 0, false),
3762
+ permissions: /* @__PURE__ */ jsxDEV(PermissionsPanel, {
3763
+ functions,
3764
+ runAsIdentity,
3765
+ schemaEditable
3766
+ }, void 0, false),
3767
+ pitr: /* @__PURE__ */ jsxDEV(PitrPanel, {
3768
+ initialShardKey
3769
+ }, void 0, false),
3770
+ mail: /* @__PURE__ */ jsxDEV(MailPanel, {}, void 0, false),
3771
+ payments: /* @__PURE__ */ jsxDEV(PaymentsPanel, {}, void 0, false),
3772
+ queues: /* @__PURE__ */ jsxDEV(QueuesPanel, {}, void 0, false),
3773
+ realtime: /* @__PURE__ */ jsxDEV(SubscriptionsPanel, {
3774
+ initialShardKey
3775
+ }, void 0, false),
3776
+ rls: /* @__PURE__ */ jsxDEV(RlsPanel, {}, void 0, false),
3777
+ schedule: /* @__PURE__ */ jsxDEV(SchedulePanel, {
3778
+ loadCronJobs: scheduledCron,
3779
+ scheduledCancel,
3780
+ scheduledLoad
3781
+ }, void 0, false),
3782
+ schema: /* @__PURE__ */ jsxDEV(SchemaRoutePanel, {
3783
+ initialShardKey,
3784
+ schemaEditable
3785
+ }, void 0, false),
3786
+ security: /* @__PURE__ */ jsxDEV(SecurityAdvisorPanel, {}, void 0, false),
3787
+ settings: /* @__PURE__ */ jsxDEV(SettingsPanel, {
3788
+ initialShardKey
3789
+ }, void 0, false),
3790
+ sql: /* @__PURE__ */ jsxDEV(SqlEditorPanel, {
3791
+ initialShardKey
3792
+ }, void 0, false),
3793
+ storageRules: /* @__PURE__ */ jsxDEV(StorageRulesPanel, {}, void 0, false),
3794
+ users: /* @__PURE__ */ jsxDEV(UsersPanel, {}, void 0, false),
3795
+ vectors: /* @__PURE__ */ jsxDEV(VectorBrowser, {}, void 0, false),
3796
+ workflows: /* @__PURE__ */ jsxDEV(WorkflowsPanel, {}, void 0, false)
3797
+ };
3798
+ const indexRoute = createRoute({
3799
+ component: () => panels.home,
3800
+ getParentRoute: () => rootRoute,
3801
+ path: "/"
3802
+ });
3803
+ const tabRoutes = TABS.map((tab) => {
3804
+ if (tab === "data") {
3805
+ return createRoute({
3806
+ component: () => panels[tab],
3807
+ getParentRoute: () => rootRoute,
3808
+ path: `/${tab}`,
3809
+ validateSearch: validateDataViewSearch
3810
+ });
3811
+ }
3812
+ return createRoute({
3813
+ component: () => panels[tab],
3814
+ getParentRoute: () => rootRoute,
3815
+ path: `/${tab}`
3816
+ });
3817
+ });
3818
+ const routeTree = rootRoute.addChildren([indexRoute, ...tabRoutes]);
3819
+ const history = "window" in globalThis ? createBrowserHistory() : createMemoryHistory({
3820
+ initialEntries: ["/home"]
3821
+ });
3822
+ return createRouter({
3823
+ // When mounted under a prefix (e.g. the `/__lunora` dev route), the router
3824
+ // works in that subtree: `/__lunora` matches the index route and every
3825
+ // `navigate({ to: "/logs" })` resolves to `/__lunora/logs`, so navigation
3826
+ // never escapes the mount. Omitted for a root mount.
3827
+ ...basePath === void 0 || basePath === "/" ? {} : {
3828
+ basepath: basePath
3829
+ },
3830
+ defaultNotFoundComponent: NotFoundRedirect,
3831
+ defaultPendingComponent: RoutePending,
3832
+ defaultPendingMinMs: 0,
3833
+ defaultPendingMs: 0,
3834
+ history,
3835
+ routeTree
3836
+ });
3837
+ };
3838
+ const StudioShell = (t0) => {
3839
+ const $ = c(17);
3840
+ const {
3841
+ basePath,
3842
+ chrome,
3843
+ dataEditable,
3844
+ functions,
3845
+ initialShardKey,
3846
+ openApiSpec,
3847
+ openRpcSpec,
3848
+ runAsIdentity,
3849
+ schemaEditable,
3850
+ scheduledCancel,
3851
+ scheduledCron,
3852
+ scheduledLoad
3853
+ } = t0;
3854
+ let t1;
3855
+ if ($[0] !== basePath || $[1] !== dataEditable || $[2] !== functions || $[3] !== initialShardKey || $[4] !== openApiSpec || $[5] !== openRpcSpec || $[6] !== runAsIdentity || $[7] !== scheduledCancel || $[8] !== scheduledCron || $[9] !== scheduledLoad || $[10] !== schemaEditable) {
3856
+ t1 = buildRouter({
3857
+ basePath,
3858
+ dataEditable,
3859
+ functions,
3860
+ initialShardKey,
3861
+ openApiSpec,
3862
+ openRpcSpec,
3863
+ runAsIdentity,
3864
+ schemaEditable,
3865
+ scheduledCancel,
3866
+ scheduledCron,
3867
+ scheduledLoad
3868
+ });
3869
+ $[0] = basePath;
3870
+ $[1] = dataEditable;
3871
+ $[2] = functions;
3872
+ $[3] = initialShardKey;
3873
+ $[4] = openApiSpec;
3874
+ $[5] = openRpcSpec;
3875
+ $[6] = runAsIdentity;
3876
+ $[7] = scheduledCancel;
3877
+ $[8] = scheduledCron;
3878
+ $[9] = scheduledLoad;
3879
+ $[10] = schemaEditable;
3880
+ $[11] = t1;
3881
+ } else {
3882
+ t1 = $[11];
3883
+ }
3884
+ const router = t1;
3885
+ const t2 = chrome ?? null;
3886
+ let t3;
3887
+ if ($[12] !== router) {
3888
+ t3 = /* @__PURE__ */ jsxDEV(RouterProvider, {
3889
+ router
3890
+ }, void 0, false);
3891
+ $[12] = router;
3892
+ $[13] = t3;
3893
+ } else {
3894
+ t3 = $[13];
3895
+ }
3896
+ let t4;
3897
+ if ($[14] !== t2 || $[15] !== t3) {
3898
+ t4 = /* @__PURE__ */ jsxDEV(StudioChromeContext, {
3899
+ value: t2,
3900
+ children: t3
3901
+ }, void 0, false);
3902
+ $[14] = t2;
3903
+ $[15] = t3;
3904
+ $[16] = t4;
3905
+ } else {
3906
+ t4 = $[16];
3907
+ }
3908
+ return t4;
3909
+ };
3910
+ const Studio = (t0) => {
3911
+ const $ = c(17);
3912
+ const {
3913
+ basePath,
3914
+ chrome,
3915
+ dataEditable,
3916
+ functions,
3917
+ i18n,
3918
+ initialShardKey,
3919
+ locale,
3920
+ openApiSpec,
3921
+ openRpcSpec,
3922
+ runAsIdentity,
3923
+ schemaEditable,
3924
+ scheduledCancel,
3925
+ scheduledCron,
3926
+ scheduledLoad
3927
+ } = t0;
3928
+ let t1;
3929
+ if ($[0] !== basePath || $[1] !== chrome || $[2] !== dataEditable || $[3] !== functions || $[4] !== initialShardKey || $[5] !== openApiSpec || $[6] !== openRpcSpec || $[7] !== runAsIdentity || $[8] !== scheduledCancel || $[9] !== scheduledCron || $[10] !== scheduledLoad || $[11] !== schemaEditable) {
3930
+ t1 = /* @__PURE__ */ jsxDEV(StudioShell, {
3931
+ basePath,
3932
+ chrome,
3933
+ dataEditable,
3934
+ functions,
3935
+ initialShardKey,
3936
+ openApiSpec,
3937
+ openRpcSpec,
3938
+ runAsIdentity,
3939
+ scheduledCancel,
3940
+ scheduledCron,
3941
+ scheduledLoad,
3942
+ schemaEditable
3943
+ }, void 0, false);
3944
+ $[0] = basePath;
3945
+ $[1] = chrome;
3946
+ $[2] = dataEditable;
3947
+ $[3] = functions;
3948
+ $[4] = initialShardKey;
3949
+ $[5] = openApiSpec;
3950
+ $[6] = openRpcSpec;
3951
+ $[7] = runAsIdentity;
3952
+ $[8] = scheduledCancel;
3953
+ $[9] = scheduledCron;
3954
+ $[10] = scheduledLoad;
3955
+ $[11] = schemaEditable;
3956
+ $[12] = t1;
3957
+ } else {
3958
+ t1 = $[12];
3959
+ }
3960
+ const shell = t1;
3961
+ if (i18n === void 0 && locale === void 0) {
3962
+ return shell;
3963
+ }
3964
+ let t2;
3965
+ if ($[13] !== i18n || $[14] !== locale || $[15] !== shell) {
3966
+ t2 = /* @__PURE__ */ jsxDEV(StudioI18nProvider, {
3967
+ i18n,
3968
+ locale,
3969
+ children: shell
3970
+ }, void 0, false);
3971
+ $[13] = i18n;
3972
+ $[14] = locale;
3973
+ $[15] = shell;
3974
+ $[16] = t2;
3975
+ } else {
3976
+ t2 = $[16];
3977
+ }
3978
+ return t2;
3979
+ };
3980
+ function _temp(state) {
3981
+ return state.location.pathname;
3982
+ }
3983
+ function _temp2(group_0) {
3984
+ return group_0.tabs.length > 0;
3985
+ }
3986
+
3987
+ export { BrandMark as B, Studio as S, ThemeProvider as T, TooltipProvider as a, Sheet as b, SheetContent as c, SheetHeader as d, SheetTitle as e, useTheme as u };