@lunora/studio 1.0.0-alpha.79 → 1.0.0-alpha.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/dist/index.d.ts +28 -14
  2. package/dist/index.js +1 -1
  3. package/dist/mount.d.ts +1 -1
  4. package/dist/mount.js +1 -1
  5. package/dist/packem_chunks/ApiTab.js +1 -1
  6. package/dist/packem_chunks/AuditPanel.js +1 -1
  7. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -1
  8. package/dist/packem_chunks/ExportImportPanel.js +3 -3
  9. package/dist/packem_chunks/FileBrowser.js +4 -4
  10. package/dist/packem_chunks/FunctionRunner.js +1 -1
  11. package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
  12. package/dist/packem_chunks/HealthPanel.js +1 -1
  13. package/dist/packem_chunks/InsightsPanel.js +1 -1
  14. package/dist/packem_chunks/LogsPanel.js +1 -1
  15. package/dist/packem_chunks/MailPanel.js +2 -2
  16. package/dist/packem_chunks/MetricsPanel.js +1 -1
  17. package/dist/packem_chunks/NotificationsPanel.js +1 -1
  18. package/dist/packem_chunks/PitrPanel.js +1 -1
  19. package/dist/packem_chunks/SchemaViewer.js +1 -2
  20. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -1
  21. package/dist/packem_chunks/SettingsPanel.js +1 -1
  22. package/dist/packem_chunks/SqlEditorPanel.js +6 -4
  23. package/dist/packem_chunks/TableEditor.js +1 -1
  24. package/dist/packem_chunks/agents-panel.js +1 -1
  25. package/dist/packem_chunks/analytics-panel.js +1 -1
  26. package/dist/packem_chunks/auth-audit-panel.js +1 -1
  27. package/dist/packem_chunks/auth-config-panel.js +1 -1
  28. package/dist/packem_chunks/auth-sessions-panel.js +1 -1
  29. package/dist/packem_chunks/containers-panel.js +1 -1
  30. package/dist/packem_chunks/dashboards-panel.js +1 -1
  31. package/dist/packem_chunks/fanout-panel.js +1 -1
  32. package/dist/packem_chunks/flags-panel.js +1 -1
  33. package/dist/packem_chunks/issues-panel.js +1 -1
  34. package/dist/packem_chunks/kv-browser.js +1 -1
  35. package/dist/packem_chunks/log-drains-panel.js +4 -4
  36. package/dist/packem_chunks/migrations-route.js +1 -0
  37. package/dist/packem_chunks/organizations-panel.js +1 -1
  38. package/dist/packem_chunks/payments-panel.js +1 -1
  39. package/dist/packem_chunks/permissions-panel.js +1 -1
  40. package/dist/packem_chunks/queues-panel.js +1 -1
  41. package/dist/packem_chunks/rls-panel.js +1 -1
  42. package/dist/packem_chunks/schedule-panel.js +1 -1
  43. package/dist/packem_chunks/sparkline.js +1 -1
  44. package/dist/packem_chunks/storage-rules-panel.js +1 -1
  45. package/dist/packem_chunks/subscriptions-panel.js +1 -1
  46. package/dist/packem_chunks/sync-client-panel.js +1 -1
  47. package/dist/packem_chunks/traces-panel.js +1 -1
  48. package/dist/packem_chunks/users-panel.js +1 -1
  49. package/dist/packem_chunks/vector-browser.js +1 -1
  50. package/dist/packem_chunks/workflows-panel.js +1 -1
  51. package/dist/packem_shared/ADMIN_FUNCTIONS-BnD4aovm.js +1 -0
  52. package/dist/packem_shared/ApiDocsPanel-DfUQ1ZAF.js +2 -0
  53. package/dist/packem_shared/{ApiReferencePanel-C42v1jr6.js → ApiReferencePanel-9q8BbJl-.js} +1 -1
  54. package/dist/packem_shared/CommandPalette--SQwfTW1.js +1 -0
  55. package/dist/packem_shared/DataBrowser-CuRlztBz.js +1 -0
  56. package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
  57. package/dist/packem_shared/GlobalDataBrowser-DB-vQ2_H.js +1 -0
  58. package/dist/packem_shared/HomePanel-Dcs4a3Ax.js +1 -0
  59. package/dist/packem_shared/MigrationsPanel-C2OnsqRb.js +1 -0
  60. package/dist/packem_shared/{OpenRpcReferencePanel-sGsIgYWj.js → OpenRpcReferencePanel-qOZcWXMs.js} +1 -1
  61. package/dist/packem_shared/ScheduledJobs-D8kBZWBu.js +1 -0
  62. package/dist/packem_shared/Studio-B26_pT8J.js +1 -0
  63. package/dist/packem_shared/StudioApp-bXhJeLlZ.js +1 -0
  64. package/dist/packem_shared/advisor-view-Pa8HLtBv.js +1 -0
  65. package/dist/packem_shared/{app.d-bRPJhby-.d.ts → app.d-DW7yZsfu.d.ts} +1 -3
  66. package/dist/packem_shared/bar-chart-DraN_srt.js +9 -0
  67. package/dist/packem_shared/data-grid-DcxyIXwG.js +1 -0
  68. package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
  69. package/dist/packem_shared/error-alert-t6cpEi0z.js +1 -0
  70. package/dist/packem_shared/grid-features-jnrD0SpX.js +6 -0
  71. package/dist/packem_shared/{home-panel-Cm88Nvqh.js → home-panel-CU6MWLHG.js} +2 -2
  72. package/dist/packem_shared/{internal-AtZ4bTal.js → internal-BSIsQVC6.js} +1 -1
  73. package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
  74. package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
  75. package/dist/packem_shared/recording-client-DRAZEmzE.js +1 -0
  76. package/dist/packem_shared/reference-view-DnYYWr7I.js +12 -0
  77. package/dist/packem_shared/result-chart-DzJOVsaw.js +1 -0
  78. package/dist/packem_shared/schema-diagram-cg-bz_VL.js +2 -0
  79. package/dist/packem_shared/{sparkline-DtcZoU48.js → sparkline-CgjeUU2I.js} +1 -1
  80. package/dist/packem_shared/studio-q-C-acL7.js +2 -0
  81. package/dist/packem_shared/table-list-sidebar-BFkSQwlB.js +1 -0
  82. package/dist/packem_shared/use-admin-query-QJ-ibl5u.js +1 -0
  83. package/dist/packem_shared/use-async-submit-q3ymBJkD.js +1 -0
  84. package/dist/packem_shared/{use-auth-config-9S_K_W-G.js → use-auth-config-BObBpdsi.js} +1 -1
  85. package/dist/packem_shared/use-sql-assistant-CHEu2-Rk.js +1 -0
  86. package/dist/standalone/chunk-2GA4SHO7.js +1 -0
  87. package/dist/standalone/{chunk-NG6LYBPJ.js → chunk-2VDFV5TD.js} +1 -1
  88. package/dist/standalone/chunk-2WOIRKEI.js +1 -0
  89. package/dist/standalone/chunk-33CL6OHR.js +1 -0
  90. package/dist/standalone/{chunk-EIT7ERYE.js → chunk-34D36UCW.js} +1 -1
  91. package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
  92. package/dist/standalone/{chunk-6CULAILE.js → chunk-3O3HAXW7.js} +1 -1
  93. package/dist/standalone/{chunk-LSEZN2ZL.js → chunk-3STOIE7Q.js} +1 -1
  94. package/dist/standalone/chunk-53WEPGUD.js +1 -0
  95. package/dist/standalone/chunk-5CVJS7ON.js +1 -0
  96. package/dist/standalone/chunk-6IKEW5LG.js +1 -0
  97. package/dist/standalone/chunk-6LNCYDZO.js +1 -0
  98. package/dist/standalone/chunk-6NY7SPDL.js +1 -0
  99. package/dist/standalone/chunk-6PNPIW6I.js +2 -0
  100. package/dist/standalone/{chunk-AVZGVZZ7.js → chunk-6VAKZALJ.js} +1 -1
  101. package/dist/standalone/chunk-6YI4WJO4.js +1 -0
  102. package/dist/standalone/{chunk-HYT2ZUNP.js → chunk-6YTSSIEJ.js} +2 -2
  103. package/dist/standalone/{chunk-KYF2E5CJ.js → chunk-7LWMHTJ3.js} +1 -1
  104. package/dist/standalone/chunk-A74VSSA2.js +4 -0
  105. package/dist/standalone/chunk-CCVXYYPJ.js +1 -0
  106. package/dist/standalone/chunk-CT5MMH4O.js +1 -0
  107. package/dist/standalone/chunk-CTNB2KIA.js +1 -0
  108. package/dist/standalone/chunk-CU55Y5TV.js +62 -0
  109. package/dist/standalone/chunk-D2RKH6JK.js +1 -0
  110. package/dist/standalone/chunk-E3NMX2VU.js +4 -0
  111. package/dist/standalone/chunk-FNPJ7GJZ.js +1 -0
  112. package/dist/standalone/chunk-FOBRNWBG.js +3 -0
  113. package/dist/standalone/chunk-G6PSMGLD.js +1 -0
  114. package/dist/standalone/chunk-GAX5IZYG.js +8 -0
  115. package/dist/standalone/chunk-GB6U2BPU.js +1 -0
  116. package/dist/standalone/chunk-GEDMLM4A.js +6 -0
  117. package/dist/standalone/chunk-GXSZH7VJ.js +13 -0
  118. package/dist/standalone/chunk-GYKVBKT5.js +1 -0
  119. package/dist/standalone/chunk-H6YOWRFB.js +1 -0
  120. package/dist/standalone/chunk-HJ3E4YF5.js +1 -0
  121. package/dist/standalone/chunk-HJD2YUQS.js +1 -0
  122. package/dist/standalone/chunk-IHQC7J35.js +1 -0
  123. package/dist/standalone/chunk-JLOWAJRR.js +1 -0
  124. package/dist/standalone/chunk-JRMMYIAF.js +1 -0
  125. package/dist/standalone/{chunk-W6TE2I2D.js → chunk-KC44QCN6.js} +1 -1
  126. package/dist/standalone/chunk-KJB7YAKB.js +1 -0
  127. package/dist/standalone/chunk-KLQYC6CC.js +1 -0
  128. package/dist/standalone/{chunk-XQGANNLS.js → chunk-KZ3ALMMP.js} +1 -1
  129. package/dist/standalone/chunk-L7R74G63.js +1 -0
  130. package/dist/standalone/{chunk-3RTTXLMU.js → chunk-OY2RVUZL.js} +1 -1
  131. package/dist/standalone/chunk-P4YLIBCN.js +1 -0
  132. package/dist/standalone/chunk-PZVU2QMX.js +1 -0
  133. package/dist/standalone/{chunk-PRJ4RJDU.js → chunk-Q7O6B7WC.js} +1 -1
  134. package/dist/standalone/chunk-QLQADHFE.js +1 -0
  135. package/dist/standalone/{chunk-7LQWFOEU.js → chunk-QXXIJAD5.js} +1 -1
  136. package/dist/standalone/chunk-QZGTH6WH.js +1 -0
  137. package/dist/standalone/chunk-RJP3WBZ4.js +1 -0
  138. package/dist/standalone/chunk-RNL6BSFM.js +1 -0
  139. package/dist/standalone/chunk-RNRJKBY3.js +4 -0
  140. package/dist/standalone/{chunk-7YEFOSPH.js → chunk-RQ7AFLIV.js} +1 -1
  141. package/dist/standalone/chunk-S252DAFP.js +1 -0
  142. package/dist/standalone/chunk-S2VVR7HI.js +1 -0
  143. package/dist/standalone/chunk-SKW6J4VW.js +1 -0
  144. package/dist/standalone/chunk-T7IUZIF4.js +1 -0
  145. package/dist/standalone/chunk-TTGOOYLF.js +1 -0
  146. package/dist/standalone/chunk-U6TNNM5U.js +1 -0
  147. package/dist/standalone/chunk-VHWOCPRK.js +1 -0
  148. package/dist/standalone/chunk-W6SAOXGH.js +6 -0
  149. package/dist/standalone/{chunk-YCRMVBPW.js → chunk-WBYSSCV2.js} +1 -1
  150. package/dist/standalone/{chunk-LFXFP4IF.js → chunk-X665E2HU.js} +1 -1
  151. package/dist/standalone/chunk-XDAT7LHC.js +1 -0
  152. package/dist/standalone/chunk-XS5LDR52.js +1 -0
  153. package/dist/standalone/chunk-Y5Y7DHFW.js +1 -0
  154. package/dist/standalone/chunk-YJYTMQJI.js +1 -0
  155. package/dist/standalone/chunk-Z2V42P7J.js +1 -0
  156. package/dist/standalone/studio.js +5 -5
  157. package/dist/styles.css +1 -1
  158. package/package.json +1 -1
  159. package/dist/packem_chunks/MigrationsPanel.js +0 -1
  160. package/dist/packem_shared/ADMIN_FUNCTIONS-CpgIo9pj.js +0 -1
  161. package/dist/packem_shared/ApiDocsPanel-CjdsxN1t.js +0 -2
  162. package/dist/packem_shared/CommandPalette-CVIaY3j8.js +0 -1
  163. package/dist/packem_shared/DataBrowser-Bfstz_au.js +0 -1
  164. package/dist/packem_shared/DataFilters-Csb30F0C.js +0 -1
  165. package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +0 -1
  166. package/dist/packem_shared/HomePanel-B8EFM4u3.js +0 -1
  167. package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +0 -1
  168. package/dist/packem_shared/Studio-BDtS9C5g.js +0 -1
  169. package/dist/packem_shared/StudioApp-DjLzIO9E.js +0 -1
  170. package/dist/packem_shared/advisor-view-DaCX9Jy5.js +0 -1
  171. package/dist/packem_shared/bar-chart-AryFCeoa.js +0 -9
  172. package/dist/packem_shared/data-grid-BMBKzMEJ.js +0 -1
  173. package/dist/packem_shared/data-view-params-C8T3bW1z.js +0 -1
  174. package/dist/packem_shared/error-alert-B59DnrDI.js +0 -1
  175. package/dist/packem_shared/grid-features-uZCUj955.js +0 -6
  176. package/dist/packem_shared/live-status-CGW2JHf_.js +0 -1
  177. package/dist/packem_shared/reference-view-KvhektwF.js +0 -12
  178. package/dist/packem_shared/result-chart-CwKhhKM0.js +0 -1
  179. package/dist/packem_shared/studio-BmWFd-Rz.js +0 -2
  180. package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +0 -1
  181. package/dist/packem_shared/use-admin-query-Di3fLE8H.js +0 -1
  182. package/dist/packem_shared/use-async-submit-DLNCqLFq.js +0 -1
  183. package/dist/standalone/chunk-2SHUN7KF.js +0 -1
  184. package/dist/standalone/chunk-2Y36BVVM.js +0 -4
  185. package/dist/standalone/chunk-3EXLKL6V.js +0 -1
  186. package/dist/standalone/chunk-3KAERFMC.js +0 -1
  187. package/dist/standalone/chunk-4XDMVUS5.js +0 -1
  188. package/dist/standalone/chunk-5RF4QDDA.js +0 -6
  189. package/dist/standalone/chunk-5YWJNF5X.js +0 -1
  190. package/dist/standalone/chunk-66YJ3IOZ.js +0 -1
  191. package/dist/standalone/chunk-6KHEBRBB.js +0 -1
  192. package/dist/standalone/chunk-6WCIFGDW.js +0 -1
  193. package/dist/standalone/chunk-7RG3AKPY.js +0 -1
  194. package/dist/standalone/chunk-A2FPLOMJ.js +0 -1
  195. package/dist/standalone/chunk-AADXUXZO.js +0 -1
  196. package/dist/standalone/chunk-ARI4JTIH.js +0 -1
  197. package/dist/standalone/chunk-BDO4J5AP.js +0 -1
  198. package/dist/standalone/chunk-BMQJ4CAO.js +0 -1
  199. package/dist/standalone/chunk-CMUP7HPS.js +0 -1
  200. package/dist/standalone/chunk-CP7AUUOU.js +0 -1
  201. package/dist/standalone/chunk-DX3RMFQU.js +0 -8
  202. package/dist/standalone/chunk-E2CJUP53.js +0 -13
  203. package/dist/standalone/chunk-FLYO3XY5.js +0 -1
  204. package/dist/standalone/chunk-FWCKM2CU.js +0 -1
  205. package/dist/standalone/chunk-GITJXQOS.js +0 -4
  206. package/dist/standalone/chunk-GP6IRITM.js +0 -1
  207. package/dist/standalone/chunk-GXU3ATKS.js +0 -1
  208. package/dist/standalone/chunk-H5Y5NQPL.js +0 -1
  209. package/dist/standalone/chunk-HALNNKTC.js +0 -1
  210. package/dist/standalone/chunk-HK4OVYG3.js +0 -1
  211. package/dist/standalone/chunk-HQEMYD2K.js +0 -1
  212. package/dist/standalone/chunk-I4WGRDL2.js +0 -1
  213. package/dist/standalone/chunk-ISZSYNTI.js +0 -4
  214. package/dist/standalone/chunk-JWG3VRGB.js +0 -1
  215. package/dist/standalone/chunk-KDYNM3GV.js +0 -1
  216. package/dist/standalone/chunk-KP6JQSH2.js +0 -4
  217. package/dist/standalone/chunk-LLXFYRGQ.js +0 -1
  218. package/dist/standalone/chunk-LU3GW7HI.js +0 -1
  219. package/dist/standalone/chunk-M536Y2KX.js +0 -1
  220. package/dist/standalone/chunk-MVGE3JJN.js +0 -1
  221. package/dist/standalone/chunk-MXSHWB3M.js +0 -1
  222. package/dist/standalone/chunk-NL2DZKFI.js +0 -1
  223. package/dist/standalone/chunk-OGVCXKRL.js +0 -2
  224. package/dist/standalone/chunk-OPC233PZ.js +0 -1
  225. package/dist/standalone/chunk-P4CWOYFL.js +0 -1
  226. package/dist/standalone/chunk-PUY3YDXI.js +0 -1
  227. package/dist/standalone/chunk-QZMR6MUG.js +0 -1
  228. package/dist/standalone/chunk-WCWYSOCN.js +0 -62
  229. package/dist/standalone/chunk-WEO3YVP6.js +0 -3
  230. package/dist/standalone/chunk-X2FQ6B5V.js +0 -1
  231. package/dist/standalone/chunk-XIZNYKOD.js +0 -1
  232. package/dist/standalone/chunk-XS6Q6GGV.js +0 -1
  233. package/dist/standalone/chunk-Y3CQDULJ.js +0 -1
  234. package/dist/standalone/chunk-Z2JPEI2V.js +0 -1
  235. /package/dist/standalone/{chunk-4CGALXS3.js → chunk-OG4N2XHD.js} +0 -0
@@ -1,2 +0,0 @@
1
- 'use client';
2
- import{c as y}from"react/compiler-runtime";import{RouterProvider as Pa,createRootRoute as Aa,createRoute as Wt,createBrowserHistory as Ta,createMemoryHistory as za,createRouter as $a,useNavigate as ra,useRouterState as Ra,Outlet as Ia,useSearch as Va}from"@tanstack/react-router";import*as vt from"react";import{useState as It,useEffect as xt,use as Jt,createContext as na,lazy as z,Suspense as Za}from"react";import{c as M}from"./utils-bhneXptQ.js";import{jsx as r,jsxs as v,Fragment as ia}from"react/jsx-runtime";import{ErrorBoundary as Ka}from"./ErrorBoundary-DvzYskH7.js";import{useT as bt}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{LunoraError as oa}from"@lunora/errors";import{motion as Ea}from"motion/react";import{g as Ha}from"./badge-BbuuAio7.js";import{u as Oa}from"./input-JHu63lTv.js";import{Popover as yt}from"@base-ui/react/popover";import{Cancel01Icon as Ba,SidebarLeftIcon as Da}from"@hugeicons/core-free-icons";import{HugeiconsIcon as la}from"@hugeicons/react";import{mergeProps as da}from"@base-ui/react/merge-props";import{useRender as ca}from"@base-ui/react/use-render";import{cva as qa}from"class-variance-authority";import{u as ua}from"./button-BkCrNcAs.js";import{Dialog as V}from"@base-ui/react/dialog";import{Tooltip as I}from"@base-ui/react/tooltip";import{n as jt}from"./skeleton-C1wQ9M5t.js";import{H as Wa,S as ja}from"./home-panel-Cm88Nvqh.js";import{StudioI18nProvider as Fa}from"./StudioI18nProvider-CZ5h4nrV.js";import{v as Ua}from"./data-view-params-C8T3bW1z.js";import{f as Qt}from"./internal-AtZ4bTal.js";import{CommandPalette as Qa,openCommandPalette as Ga}from"./CommandPalette-CVIaY3j8.js";const ha="(prefers-color-scheme: dark)",ma=()=>{try{return globalThis.localStorage}catch{return}},Ja=t=>t==="system"||t==="light"||t==="dark",pa=()=>globalThis.matchMedia,ga="lunora-studio-theme",Ft=["system","light","dark"],Xa=(t="system")=>{try{const e=ma()?.getItem(ga);return Ja(e)?e:t}catch{return t}},Yt=t=>{const e=ma();if(e!==void 0)try{e.setItem(ga,t)}catch{}},Ya=()=>{try{return pa()?.(ha).matches?"dark":"light"}catch{return"light"}},es=(t,e)=>t==="system"?e:t,ts=t=>{let e;try{e=pa()?.(ha)}catch{e=void 0}if(e===void 0)return()=>{};const s=a=>{t(a.matches?"dark":"light")};return e.addEventListener("change",s),()=>{e.removeEventListener("change",s)}},Xt=na(null),as=({children:t,defaultTheme:e="system"})=>{const[s,a]=It(()=>Xa(e)),[n,i]=It(()=>Ya());xt(()=>ts(i),[]);const o=l=>{Yt(l),a(l)},d={cycleTheme:()=>{a(l=>{const c=Ft[(Ft.indexOf(l)+1)%Ft.length]??l;return Yt(c),c})},resolvedTheme:es(s,n),setTheme:o,systemTheme:n,theme:s};return r(Xt,{value:d,children:t})},ss=t=>{const e=y(3),{children:s}=t,a=Jt(Xt);let n;return e[0]!==s||e[1]!==a?(n=a===null?r(as,{children:s}):s,e[0]=s,e[1]=a,e[2]=n):n=e[2],n},rs=()=>{const t=Jt(Xt);if(t===null)throw new oa("INTERNAL","useTheme must be used within a <ThemeProvider>");return t};function Nn({delay:t=0,...e}){return r(I.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function ns(t){const e=y(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r(I.Root,{"data-slot":"tooltip",...s}),e[2]=s,e[3]=a):a=e[3],a}function is(t){const e=y(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r(I.Trigger,{"data-slot":"tooltip-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function os({className:t,side:e="top",sideOffset:s=4,align:a="center",alignOffset:n=0,children:i,...o}){return r(I.Portal,{children:r(I.Positioner,{align:a,alignOffset:n,side:e,sideOffset:s,className:"isolate z-50",children:v(I.Popup,{"data-slot":"tooltip-content",className:M("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",t),...o,children:[i,r(I.Arrow,{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"})]})})})}const ls=t=>{const e=y(5),{className:s}=t;let a;e[0]!==s?(a=M("h-full w-full text-foreground",s),e[0]=s,e[1]=a):a=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=r("path",{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",fillRule:"evenodd"}),e[2]=n):n=e[2];let i;return e[3]!==a?(i=r("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 543 446",children:n}),e[3]=a,e[4]=i):i=e[4],i},fa="lunora.studio.rulesBannerDismissed",ds=()=>{try{return globalThis.localStorage.getItem(fa)==="1"}catch{return!1}},cs=()=>{try{globalThis.localStorage.setItem(fa,"1")}catch{}},us=()=>{const t=y(18),e=bt(),[s,a]=It(hs);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{a(!0),cs()},t[0]=n):n=t[0];const i=n;if(s)return null;let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=r("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),t[1]=o):o=t[1];let d;t[2]!==e?(d=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=d):d=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=r("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=l):l=t[4];let c;t[5]!==e?(c=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=c):c=t[6];let u;t[7]!==d||t[8]!==c?(u=v("span",{children:[d," ",l," ",c]}),t[7]=d,t[8]=c,t[9]=u):u=t[9];let g;t[10]!==e?(g=e("Dismiss"),t[10]=e,t[11]=g):g=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=r("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=h):h=t[12];let b;t[13]!==g?(b=r("button",{"aria-label":g,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","data-testid":"dash-app-rules-banner-dismiss",onClick:i,type:"button",children:h}),t[13]=g,t[14]=b):b=t[14];let p;return t[15]!==u||t[16]!==b?(p=v("div",{className:"flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground","data-testid":"dash-app-rules-banner",role:"note",children:[o,u,b]}),t[15]=u,t[16]=b,t[17]=p):p=t[17],p};function hs(){return ds()}const ms=()=>{const t=y(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=v("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[r("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),r("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},ps=()=>{const t=y(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=v("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{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"})]}),t[0]=e):e=t[0],e},gs=()=>{const t=y(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:r("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),t[0]=e):e=t[0],e},fs=[{Icon:ms,value:"system"},{Icon:ps,value:"light"},{Icon:gs,value:"dark"}],bs=()=>{const t=y(19),{theme:e,setTheme:s}=rs(),a=bt();let n;t[0]!==a?(n=a("Dark theme"),t[0]=a,t[1]=n):n=t[1];let i;t[2]!==a?(i=a("Light theme"),t[2]=a,t[3]=i):i=t[3];let o;t[4]!==a?(o=a("System theme"),t[4]=a,t[5]=o):o=t[5];let d;t[6]!==n||t[7]!==i||t[8]!==o?(d={dark:n,light:i,system:o},t[6]=n,t[7]=i,t[8]=o,t[9]=d):d=t[9];const l=d;let c;t[10]!==a?(c=a("Theme"),t[10]=a,t[11]=c):c=t[11];let u;t[12]!==l||t[13]!==s||t[14]!==e?(u=fs.map(h=>{const{Icon:b,value:p}=h,x=e===p;return v("button",{"aria-checked":x,"aria-label":l[p],className:M("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",x?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${p}`,onClick:()=>{s(p)},role:"radio",title:l[p],type:"button",children:[x&&r(Ea.span,{className:"absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",layoutId:"studio-theme-active",transition:{bounce:.1,duration:.45,type:"spring"}}),r("span",{className:"relative",children:r(b,{})})]},p)}),t[12]=l,t[13]=s,t[14]=e,t[15]=u):u=t[15];let g;return t[16]!==c||t[17]!==u?(g=r("div",{"aria-label":c,className:"inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5","data-testid":"dash-app-theme",role:"radiogroup",children:u}),t[16]=c,t[17]=u,t[18]=g):g=t[18],g};function ba(t){const e=y(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r(yt.Root,{"data-slot":"popover",...s}),e[2]=s,e[3]=a):a=e[3],a}function va(t){const e=y(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r(yt.Trigger,{"data-slot":"popover-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function ya({align:t="end",alignOffset:e=0,className:s,keepMounted:a=!1,side:n="bottom",sideOffset:i=6,...o}){return r(yt.Portal,{keepMounted:a,children:r(yt.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:n,sideOffset:i,children:r(yt.Popup,{className:M("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",s),"data-slot":"popover-content",...o})})})}const Ut=768;function vs(){const t=y(2),[e,s]=It(void 0);let a,n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const i=globalThis.matchMedia(`(max-width: ${Ut-1}px)`),o=()=>{s(globalThis.innerWidth<Ut)};return i.addEventListener("change",o),s(globalThis.innerWidth<Ut),()=>{i.removeEventListener("change",o)}},n=[],t[0]=a,t[1]=n):(a=t[0],n=t[1]),xt(a,n),!!e}function ys(t){const e=y(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r(V.Root,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function xs(t){const e=y(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r(V.Portal,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function ws(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("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:",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r(V.Backdrop,{"data-slot":"sheet-overlay",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function ks({className:t,children:e,side:s="right",showCloseButton:a=!0,...n}){return v(xs,{children:[r(ws,{}),v(V.Popup,{"data-slot":"sheet-content","data-side":s,className:M("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",t),...n,children:[e,a&&v(V.Close,{"data-slot":"sheet-close",render:r(ua,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[r(la,{icon:Ba,strokeWidth:2}),r("span",{className:"sr-only",children:"Close"})]})]})]})}function Ns(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("flex flex-col gap-0.5 p-4",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("div",{"data-slot":"sheet-header",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function Ms(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("text-sm font-medium text-foreground",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r(V.Title,{"data-slot":"sheet-title",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function Ss(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("text-xs/relaxed text-muted-foreground",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r(V.Description,{"data-slot":"sheet-description",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}const Cs="sidebar_state",_s=3600*24*7,Ls="16rem",Ps="18rem",As="3rem",Ts="b",xa=vt.createContext(null);function Vt(){const t=vt.useContext(xa);if(!t)throw new oa("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}function zs({defaultOpen:t=!0,open:e,onOpenChange:s,className:a,style:n,children:i,...o}){const d=vs(),[l,c]=vt.useState(!1),[u,g]=vt.useState(t),h=e??u,b=f=>{const m=typeof f=="function"?f(h):f;s?s(m):g(m),document.cookie=`${Cs}=${m}; path=/; max-age=${_s}`},p=()=>d?c(f=>!f):b(f=>!f);vt.useEffect(()=>{const f=m=>{m.key===Ts&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),p())};return globalThis.addEventListener("keydown",f),()=>globalThis.removeEventListener("keydown",f)},[p]);const x={state:h?"expanded":"collapsed",open:h,setOpen:b,isMobile:d,openMobile:l,setOpenMobile:c,toggleSidebar:p};return r(xa.Provider,{value:x,children:r("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ls,"--sidebar-width-icon":As,...n},className:M("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...o,children:i})})}function $s({side:t="left",variant:e="sidebar",collapsible:s="offcanvas",className:a,children:n,dir:i,...o}){const{isMobile:d,state:l,openMobile:c,setOpenMobile:u}=Vt();return s==="none"?r("div",{"data-slot":"sidebar",className:M("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...o,children:n}):d?r(ys,{open:c,onOpenChange:u,...o,children:v(ks,{dir:i,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ps},side:t,children:[v(Ns,{className:"sr-only",children:[r(Ms,{children:"Sidebar"}),r(Ss,{children:"Displays the mobile sidebar."})]}),r("div",{className:"flex h-full w-full flex-col",children:n})]})}):v("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":l==="collapsed"?s:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[r("div",{"data-slot":"sidebar-gap",className:M("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),r("div",{"data-slot":"sidebar-container","data-side":t,className:M("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",e==="floating"||e==="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",a),...o,children:r("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",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",children:n})})]})}function Rs(t){const e=y(15);let s,a,n;e[0]!==t?({className:s,onClick:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);const{toggleSidebar:i}=Vt();let o;e[4]!==s?(o=M(s),e[4]=s,e[5]=o):o=e[5];let d;e[6]!==a||e[7]!==i?(d=g=>{a?.(g),i()},e[6]=a,e[7]=i,e[8]=d):d=e[8];let l,c;e[9]===Symbol.for("react.memo_cache_sentinel")?(l=r(la,{icon:Da,strokeWidth:2,className:"rtl:rotate-180"}),c=r("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=l,e[10]=c):(l=e[9],c=e[10]);let u;return e[11]!==n||e[12]!==o||e[13]!==d?(u=v(ua,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:o,onClick:d,...n,children:[l,c]}),e[11]=n,e[12]=o,e[13]=d,e[14]=u):u=e[14],u}function Is(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("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",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("main",{"data-slot":"sidebar-inset",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function Vs(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function Zs(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function Ks(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("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",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function Es(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("relative flex w-full min-w-0 flex-col p-2",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function Hs(t){const e=y(10);let s,a,n,i;if(e[0]!==t){const{className:l,render:c,...u}=t;s=c,i=ca,a="div",n=da({className:M("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",l)},u),e[0]=t,e[1]=s,e[2]=a,e[3]=n,e[4]=i}else s=e[1],a=e[2],n=e[3],i=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==a||e[8]!==n?(d={defaultTagName:a,props:n,render:s,state:o},e[6]=s,e[7]=a,e[8]=n,e[9]=d):d=e[9],i(d)}function Os(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("w-full text-xs",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function ea(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("flex w-full min-w-0 flex-col gap-0",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}function ta(t){const e=y(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("group/menu-item relative",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==n?(i=r("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...a}),e[5]=a,e[6]=n,e[7]=i):i=e[7],i}const Bs=qa("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",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",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)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function wa({render:t,isActive:e=!1,variant:s="default",size:a="default",tooltip:n,className:i,...o}){const{isMobile:d,state:l}=Vt(),c=ca({defaultTagName:"button",props:da({className:M(Bs({variant:s,size:a}),i)},o),render:n?r(is,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:e}});return n?(typeof n=="string"&&(n={children:n}),v(ns,{children:[c,r(os,{side:"right",align:"center",hidden:l!=="collapsed"||d,...n})]})):c}const w=(t,e)=>z(()=>t().then(s=>({default:s[e]}))),Ds=w(()=>import("../packem_chunks/InsightsPanel.js"),"InsightsPanel"),qs=z(()=>import("../packem_chunks/rls-panel.js")),Ws=z(()=>import("../packem_chunks/SecurityAdvisorPanel.js")),js=w(()=>import("../packem_chunks/agents-panel.js"),"AgentsPanel"),Fs=w(()=>import("../packem_chunks/analytics-panel.js"),"AnalyticsPanel"),Us=z(()=>import("../packem_chunks/ApiTab.js")),Qs=w(()=>import("../packem_chunks/auth-audit-panel.js"),"AuthAuditPanel"),Gs=w(()=>import("../packem_chunks/auth-config-panel.js"),"AuthConfigPanel"),Js=w(()=>import("../packem_chunks/auth-sessions-panel.js"),"AuthSessionsPanel"),Xs=w(()=>import("../packem_chunks/organizations-panel.js"),"OrganizationsPanel"),Ys=w(()=>import("../packem_chunks/users-panel.js"),"UsersPanel"),er=w(()=>import("../packem_chunks/containers-panel.js"),"ContainersPanel"),tr=w(()=>import("../packem_chunks/DeploymentHealthPanel.js"),"DeploymentHealthPanel"),ar=w(()=>import("../packem_chunks/TableEditor.js"),"TableEditor"),sr=w(()=>import("../packem_chunks/ExportImportPanel.js"),"ExportImportPanel"),rr=w(()=>import("../packem_chunks/MigrationsPanel.js"),"MigrationsPanel"),nr=w(()=>import("../packem_chunks/PitrPanel.js"),"PitrPanel"),ir=w(()=>import("../packem_chunks/flags-panel.js"),"FlagsPanel"),or=w(()=>import("../packem_chunks/FunctionRunner.js"),"FunctionRunner"),lr=w(()=>import("../packem_chunks/FunctionStatsPanel.js"),"FunctionStatsPanel"),dr=w(()=>import("../packem_chunks/issues-panel.js"),"IssuesPanel"),cr=w(()=>import("../packem_chunks/AuditPanel.js"),"AuditPanel"),ur=w(()=>import("../packem_chunks/log-drains-panel.js"),"LogDrainsPanel"),hr=z(()=>import("../packem_chunks/LogsPanel.js").then(t=>({default:t.LogsPanel}))),mr=w(()=>import("../packem_chunks/MailPanel.js"),"MailPanel"),pr=w(()=>import("../packem_chunks/schedule-panel.js"),"SchedulePanel"),gr=z(()=>import("../packem_chunks/subscriptions-panel.js")),fr=z(()=>import("../packem_chunks/sync-client-panel.js")),br=w(()=>import("../packem_chunks/kv-browser.js"),"KvBrowser"),vr=w(()=>import("../packem_chunks/NotificationsPanel.js"),"NotificationsPanel"),yr=w(()=>import("../packem_chunks/payments-panel.js"),"PaymentsPanel"),xr=w(()=>import("../packem_chunks/permissions-panel.js"),"PermissionsPanel"),wr=z(()=>import("../packem_chunks/queues-panel.js")),kr=z(()=>import("../packem_chunks/dashboards-panel.js")),Nr=z(()=>import("../packem_chunks/fanout-panel.js")),Mr=w(()=>import("../packem_chunks/HealthPanel.js"),"HealthPanel"),Sr=w(()=>import("../packem_chunks/MetricsPanel.js"),"MetricsPanel"),Cr=w(()=>import("../packem_chunks/SchemaViewer.js"),"SchemaViewer"),_r=w(()=>import("../packem_chunks/SettingsPanel.js"),"SettingsPanel"),Lr=w(()=>import("../packem_chunks/SqlEditorPanel.js"),"SqlEditorPanel"),Pr=w(()=>import("../packem_chunks/FileBrowser.js"),"FileBrowser"),Ar=w(()=>import("../packem_chunks/storage-rules-panel.js"),"StorageRulesPanel"),Tr=w(()=>import("../packem_chunks/traces-panel.js"),"TracesPanel"),zr=w(()=>import("../packem_chunks/vector-browser.js"),"VectorBrowser"),$r=z(()=>import("../packem_chunks/workflows-panel.js")),ka=na(null),Rr={analytics:r("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:r("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),audit:r("path",{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"}),authAudit:r("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8h6m-6 3h6"}),authConfig:r("path",{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"}),agents:r("path",{d:"M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"}),authSessions:r("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:r("path",{d:"M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"}),dashboards:r("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:r("path",{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 3 4-5"}),drains:r("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:r("path",{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"}),export:r("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}),fanout:r("path",{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"}),files:r("path",{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"}),flags:r("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:r("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),health:r("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:r("path",{d:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"}),insights:r("path",{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"}),issues:r("path",{d:"M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"}),kv:r("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:r("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:r("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:r("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:r("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:r("path",{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"}),notifications:r("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"}),organizations:r("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:r("path",{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"}),pitr:r("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),queues:r("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),realtime:r("path",{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"}),rls:r("path",{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"}),schedule:r("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:r("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:r("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:r("path",{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"}),security:r("path",{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"}),traces:r("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:r("path",{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"}),users:r("path",{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"}),vectors:r("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:r("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},aa=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","audit","realtime","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags"]},{key:"settings",tabs:["settings"]}],Ir={analytics:"analytics",authConfig:"auth",authSessions:"auth",containers:"containers",files:"storage",flags:"flags",kv:"kv",mail:"mail",organizations:"auth",payments:"payments",queues:"queues",schedule:"scheduler",storageRules:"storage",users:"auth",vectors:"vectors",workflows:"workflows"},sa=(t,e)=>{const s=Ir[t];return s===void 0||e[s]},Gt=t=>{const e=y(2),{tab:s}=t,a=Rr[s];let n;return e[0]!==a?(n=r("svg",{"aria-hidden":"true",className:"size-4 shrink-0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:a}),e[0]=a,e[1]=n):n=e[1],n},Vr=t=>t,Na=Vr(["home","data","sql","functions","api","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","security","rls","permissions","insights","issues","logs","traces","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","settings"]),Zr=new Set(["api","data","sql"]),Kr=t=>{const e=t.split("/").findLast(Boolean)??"";return Na.includes(e)?e:"home"},Er=t=>{const e=y(19),{chrome:s,connected:a}=t,n=bt();let i;e[0]!==n?(i=n("admin token"),e[0]=n,e[1]=i):i=e[1];let o;e[2]!==i?(o=r("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:i}),e[2]=i,e[3]=o):o=e[3];let d;e[4]!==s.onTokenChange||e[5]!==s.token?(d=r(Oa,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:s.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:s.token}),e[4]=s.onTokenChange,e[5]=s.token,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==n?(l=a&&v("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[r("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),n("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=a,e[8]=n,e[9]=l):l=e[9];let c;e[10]!==s.clearToken||e[11]!==a||e[12]!==n?(c=a&&r("button",{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","data-testid":"dash-app-clear-token",onClick:s.clearToken,type:"button",children:n("Clear")}),e[10]=s.clearToken,e[11]=a,e[12]=n,e[13]=c):c=e[13];let u;return e[14]!==o||e[15]!==d||e[16]!==l||e[17]!==c?(u=v("div",{className:"flex flex-col gap-2",children:[o,d,l,c]}),e[14]=o,e[15]=d,e[16]=l,e[17]=c,e[18]=u):u=e[18],u},Hr=t=>{const e=y(25),{current:s,group:a,groupLabel:n,selectTab:i,tabDescription:o,tabLabel:d}=t,l=a.tabs.includes(s)?"page":void 0,c=n[a.key],u=a.tabs[0];let g;e[0]!==u?(g=r(Gt,{tab:u}),e[0]=u,e[1]=g):g=e[1];let h;e[2]!==l||e[3]!==c||e[4]!==g?(h=r(va,{"aria-current":l,"aria-label":c,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",delay:120,openOnHover:!0,children:g}),e[2]=l,e[3]=c,e[4]=g,e[5]=h):h=e[5];const b=n[a.key];let p;e[6]!==b?(p=r("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:b}),e[6]=b,e[7]=p):p=e[7];let x;if(e[8]!==s||e[9]!==a.tabs||e[10]!==i||e[11]!==o||e[12]!==d){let k;e[14]!==s||e[15]!==i||e[16]!==o||e[17]!==d?(k=N=>v("button",{"aria-current":s===N?"page":void 0,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","data-tab":N,"data-testid":`dash-tab-${N}`,onClick:i,title:o[N],type:"button",children:[r(Gt,{tab:N}),r("span",{children:d[N]})]},N),e[14]=s,e[15]=i,e[16]=o,e[17]=d,e[18]=k):k=e[18],x=a.tabs.map(k),e[8]=s,e[9]=a.tabs,e[10]=i,e[11]=o,e[12]=d,e[13]=x}else x=e[13];let f;e[19]!==p||e[20]!==x?(f=v(ya,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[p,x]}),e[19]=p,e[20]=x,e[21]=f):f=e[21];let m;return e[22]!==h||e[23]!==f?(m=v(ba,{children:[h,f]}),e[22]=h,e[23]=f,e[24]=m):m=e[24],m},Or=t=>{const e=y(45),{chrome:s,collapsed:a,connected:n}=t,i=bt();if(s===null){let N;e[0]!==i?(N=i("Admin"),e[0]=i,e[1]=N):N=e[1];let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=r("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=_):_=e[2];let L;e[3]!==i?(L=i("Admin"),e[3]=i,e[4]=L):L=e[4];let C;e[5]!==L?(C=r("span",{className:"truncate text-[13px] font-medium",children:L}),e[5]=L,e[6]=C):C=e[6];let S;e[7]!==i?(S=i("Studio"),e[7]=i,e[8]=S):S=e[8];let P;e[9]!==S?(P=r("span",{className:"truncate text-[11px] text-muted-foreground",children:S}),e[9]=S,e[10]=P):P=e[10];let A;e[11]!==C||e[12]!==P?(A=v("span",{className:"grid flex-1 text-start leading-tight",children:[C,P]}),e[11]=C,e[12]=P,e[13]=A):A=e[13];let T;return e[14]!==N||e[15]!==A?(T=v(wa,{className:"data-active:bg-transparent",size:"lg",tooltip:N,children:[_,A]}),e[14]=N,e[15]=A,e[16]=T):T=e[16],T}const o=a?"mx-auto size-8 justify-center":"w-full p-2";let d;e[17]!==o?(d=M("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",o),e[17]=o,e[18]=d):d=e[18];let l;e[19]!==n||e[20]!==i?(l=i(n?"Connected":"Not connected"),e[19]=n,e[20]=i,e[21]=l):l=e[21];const c=n?"bg-success":"bg-muted-foreground/50";let u;e[22]!==c?(u=M("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",c),e[22]=c,e[23]=u):u=e[23];let g;e[24]!==u?(g=v("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",r("span",{"aria-hidden":"true",className:u})]}),e[24]=u,e[25]=g):g=e[25];let h;e[26]!==a||e[27]!==n||e[28]!==i?(h=!a&&v(ia,{children:[v("span",{className:"grid flex-1 text-start leading-tight",children:[r("span",{className:"truncate text-[13px] font-medium",children:i("Admin")}),r("span",{className:"truncate text-[11px] text-muted-foreground",children:i(n?"Connected":"Not connected")})]}),r("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:r("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=a,e[27]=n,e[28]=i,e[29]=h):h=e[29];let b;e[30]!==d||e[31]!==l||e[32]!==g||e[33]!==h?(b=v(va,{className:d,"data-testid":"dash-app-connect",title:l,children:[g,h]}),e[30]=d,e[31]=l,e[32]=g,e[33]=h,e[34]=b):b=e[34];const p=a?"end":"start",x=a?"right":"top";let f;e[35]!==s||e[36]!==n?(f=r(Er,{chrome:s,connected:n}),e[35]=s,e[36]=n,e[37]=f):f=e[37];let m;e[38]!==x||e[39]!==f||e[40]!==p?(m=r(ya,{align:p,keepMounted:!0,side:x,children:f}),e[38]=x,e[39]=f,e[40]=p,e[41]=m):m=e[41];let k;return e[42]!==m||e[43]!==b?(k=v(ba,{children:[b,m]}),e[42]=m,e[43]=b,e[44]=k):k=e[44],k},Br=t=>{const e=y(28),{chrome:s,connected:a,current:n,groupLabel:i,groups:o,selectTab:d,tabDescription:l,tabLabel:c}=t,u=bt(),{state:g}=Vt(),h=g==="collapsed",b=h&&"justify-center px-0";let p;e[0]!==b?(p=M("flex items-center gap-2.5 px-1.5 py-1",b),e[0]=b,e[1]=p):p=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=r(ls,{className:"size-9 shrink-0 text-foreground"}),e[2]=x):x=e[2];let f;e[3]!==h||e[4]!==a||e[5]!==u?(f=!h&&v(ia,{children:[v("span",{className:"grid flex-1 leading-tight",children:[r("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),r("span",{className:"truncate text-[11px] text-muted-foreground",children:u("Studio")})]}),r(Ha,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:u(a?"Live":"Local")})]}),e[3]=h,e[4]=a,e[5]=u,e[6]=f):f=e[6];let m;e[7]!==p||e[8]!==f?(m=r(Vs,{children:v("div",{className:p,children:[x,f]})}),e[7]=p,e[8]=f,e[9]=m):m=e[9];let k;e[10]!==h||e[11]!==n||e[12]!==i||e[13]!==o||e[14]!==d||e[15]!==l||e[16]!==c?(k=h?o.map(C=>r(Hr,{current:n,group:C,groupLabel:i,selectTab:d,tabDescription:l,tabLabel:c},C.key)):o.map(C=>v(Es,{children:[r(Hs,{className:"text-[11px] font-medium tracking-wider uppercase",children:i[C.key]}),r(Os,{children:r(ea,{children:C.tabs.map(S=>r(ta,{children:v(wa,{className:"data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]","data-tab":S,"data-testid":`dash-tab-${S}`,isActive:n===S,onClick:d,title:l[S],tooltip:l[S],children:[r(Gt,{tab:S}),r("span",{children:c[S]})]})},S))})})]},C.key)),e[10]=h,e[11]=n,e[12]=i,e[13]=o,e[14]=d,e[15]=l,e[16]=c,e[17]=k):k=e[17];let N;e[18]!==k?(N=r(Ks,{children:k}),e[18]=k,e[19]=N):N=e[19];let _;e[20]!==s||e[21]!==h||e[22]!==a?(_=r(Zs,{children:r(ea,{children:r(ta,{children:r(Or,{chrome:s,collapsed:h,connected:a})})})}),e[20]=s,e[21]=h,e[22]=a,e[23]=_):_=e[23];let L;return e[24]!==m||e[25]!==N||e[26]!==_?(L=v($s,{collapsible:"icon",variant:"inset",children:[m,N,_]}),e[24]=m,e[25]=N,e[26]=_,e[27]=L):L=e[27],L},Ma=()=>{const t=y(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=v("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[v("div",{className:"flex items-center gap-2",children:[r(jt,{className:"h-8 w-40"}),r(jt,{className:"h-8 w-24"})]}),r(jt,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},Dr=()=>{const t=y(330),e=bt(),s=ra();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:Ur},t[0]=a):a=t[0];const n=Ra(a);let i,o;t[1]!==n?(i=Kr(n),o=Zr.has(i),t[1]=n,t[2]=i,t[3]=o):(i=t[2],o=t[3]);const d=o,l=ja();let c;t[4]!==l?(c=R=>({...R,tabs:R.tabs.filter(Rt=>sa(Rt,l))}),t[4]=l,t[5]=c):c=t[5];const u=aa.map(c).filter(Qr);let g,h;t[6]!==i||t[7]!==l||t[8]!==s?(g=()=>{sa(i,l)||Qt(s({replace:!0,to:"/home"}))},h=[i,l,s],t[6]=i,t[7]=l,t[8]=s,t[9]=g,t[10]=h):(g=t[9],h=t[10]),xt(g,h);let b;t[11]!==e?(b=e("Agents"),t[11]=e,t[12]=b):b=t[12];let p;t[13]!==e?(p=e("Analytics"),t[13]=e,t[14]=p):p=t[14];let x;t[15]!==e?(x=e("API"),t[15]=e,t[16]=x):x=t[16];let f;t[17]!==e?(f=e("Audit"),t[17]=e,t[18]=f):f=t[18];let m;t[19]!==e?(m=e("Auth audit"),t[19]=e,t[20]=m):m=t[20];let k;t[21]!==e?(k=e("Configuration"),t[21]=e,t[22]=k):k=t[22];let N;t[23]!==e?(N=e("Sessions"),t[23]=e,t[24]=N):N=t[24];let _;t[25]!==e?(_=e("Containers"),t[25]=e,t[26]=_):_=t[26];let L;t[27]!==e?(L=e("Dashboards"),t[27]=e,t[28]=L):L=t[28];let C;t[29]!==e?(C=e("Data"),t[29]=e,t[30]=C):C=t[30];let S;t[31]!==e?(S=e("Deployment health"),t[31]=e,t[32]=S):S=t[32];let P;t[33]!==e?(P=e("Log drains"),t[33]=e,t[34]=P):P=t[34];let A;t[35]!==e?(A=e("Export / Import"),t[35]=e,t[36]=A):A=t[36];let T;t[37]!==e?(T=e("Fan-out"),t[37]=e,t[38]=T):T=t[38];let Z;t[39]!==e?(Z=e("Files"),t[39]=e,t[40]=Z):Z=t[40];let K;t[41]!==e?(K=e("Flags"),t[41]=e,t[42]=K):K=t[42];let E;t[43]!==e?(E=e("Functions"),t[43]=e,t[44]=E):E=t[44];let H;t[45]!==e?(H=e("Health"),t[45]=e,t[46]=H):H=t[46];let O;t[47]!==e?(O=e("Home"),t[47]=e,t[48]=O):O=t[48];let B;t[49]!==e?(B=e("Performance"),t[49]=e,t[50]=B):B=t[50];let D;t[51]!==e?(D=e("Issues"),t[51]=e,t[52]=D):D=t[52];let q;t[53]!==e?(q=e("KV"),t[53]=e,t[54]=q):q=t[54];let W;t[55]!==e?(W=e("Logs"),t[55]=e,t[56]=W):W=t[56];let j;t[57]!==e?(j=e("Metrics"),t[57]=e,t[58]=j):j=t[58];let F;t[59]!==e?(F=e("Migrations"),t[59]=e,t[60]=F):F=t[60];let U;t[61]!==e?(U=e("Notifications"),t[61]=e,t[62]=U):U=t[62];let Q;t[63]!==e?(Q=e("Organizations"),t[63]=e,t[64]=Q):Q=t[64];let G;t[65]!==e?(G=e("Time Travel"),t[65]=e,t[66]=G):G=t[66];let J;t[67]!==e?(J=e("Mail"),t[67]=e,t[68]=J):J=t[68];let X;t[69]!==e?(X=e("Payments"),t[69]=e,t[70]=X):X=t[70];let Y;t[71]!==e?(Y=e("Permissions"),t[71]=e,t[72]=Y):Y=t[72];let ee;t[73]!==e?(ee=e("Queues"),t[73]=e,t[74]=ee):ee=t[74];let te;t[75]!==e?(te=e("Realtime"),t[75]=e,t[76]=te):te=t[76];let ae;t[77]!==e?(ae=e("RLS Policies"),t[77]=e,t[78]=ae):ae=t[78];let se;t[79]!==e?(se=e("Scheduled"),t[79]=e,t[80]=se):se=t[80];let re;t[81]!==e?(re=e("Schema"),t[81]=e,t[82]=re):re=t[82];let ne;t[83]!==e?(ne=e("Security"),t[83]=e,t[84]=ne):ne=t[84];let ie;t[85]!==e?(ie=e("Settings"),t[85]=e,t[86]=ie):ie=t[86];let oe;t[87]!==e?(oe=e("SQL editor"),t[87]=e,t[88]=oe):oe=t[88];let le;t[89]!==e?(le=e("Traces"),t[89]=e,t[90]=le):le=t[90];let de;t[91]!==e?(de=e("Access Rules"),t[91]=e,t[92]=de):de=t[92];let ce;t[93]!==e?(ce=e("Users"),t[93]=e,t[94]=ce):ce=t[94];let ue;t[95]!==e?(ue=e("Vectors"),t[95]=e,t[96]=ue):ue=t[96];let he;t[97]!==e?(he=e("Workflows"),t[97]=e,t[98]=he):he=t[98];let wt;t[99]!==k||t[100]!==N||t[101]!==_||t[102]!==L||t[103]!==C||t[104]!==S||t[105]!==P||t[106]!==A||t[107]!==T||t[108]!==Z||t[109]!==K||t[110]!==E||t[111]!==H||t[112]!==O||t[113]!==B||t[114]!==D||t[115]!==q||t[116]!==W||t[117]!==j||t[118]!==F||t[119]!==U||t[120]!==Q||t[121]!==G||t[122]!==J||t[123]!==X||t[124]!==Y||t[125]!==ee||t[126]!==te||t[127]!==ae||t[128]!==se||t[129]!==re||t[130]!==ne||t[131]!==ie||t[132]!==oe||t[133]!==le||t[134]!==de||t[135]!==ce||t[136]!==ue||t[137]!==he||t[138]!==b||t[139]!==p||t[140]!==x||t[141]!==f||t[142]!==m?(wt={agents:b,analytics:p,api:x,audit:f,authAudit:m,authConfig:k,authSessions:N,containers:_,dashboards:L,data:C,deploymentHealth:S,drains:P,export:A,fanout:T,files:Z,flags:K,functions:E,health:H,home:O,insights:B,issues:D,kv:q,logs:W,metrics:j,migrations:F,notifications:U,organizations:Q,pitr:G,mail:J,payments:X,permissions:Y,queues:ee,realtime:te,rls:ae,schedule:se,schema:re,security:ne,settings:ie,sql:oe,traces:le,storageRules:de,users:ce,vectors:ue,workflows:he},t[99]=k,t[100]=N,t[101]=_,t[102]=L,t[103]=C,t[104]=S,t[105]=P,t[106]=A,t[107]=T,t[108]=Z,t[109]=K,t[110]=E,t[111]=H,t[112]=O,t[113]=B,t[114]=D,t[115]=q,t[116]=W,t[117]=j,t[118]=F,t[119]=U,t[120]=Q,t[121]=G,t[122]=J,t[123]=X,t[124]=Y,t[125]=ee,t[126]=te,t[127]=ae,t[128]=se,t[129]=re,t[130]=ne,t[131]=ie,t[132]=oe,t[133]=le,t[134]=de,t[135]=ce,t[136]=ue,t[137]=he,t[138]=b,t[139]=p,t[140]=x,t[141]=f,t[142]=m,t[143]=wt):wt=t[143];const $=wt,Zt={advisors:e("Advisors"),auth:e("Auth"),database:e("Database"),functions:e("Functions"),observability:e("Observability"),operations:e("Operations"),overview:e("Overview"),settings:e("Settings"),storage:e("Storage")};let me;t[144]!==e?(me=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[144]=e,t[145]=me):me=t[145];let pe;t[146]!==e?(pe=e("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards."),t[146]=e,t[147]=pe):pe=t[147];let ge;t[148]!==e?(ge=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[148]=e,t[149]=ge):ge=t[149];let fe;t[150]!==e?(fe=e("A durable log of admin state-changing operations."),t[150]=e,t[151]=fe):fe=t[151];let be;t[152]!==e?(be=e("Authentication and security events — sign-ins, MFA, and session changes."),t[152]=e,t[153]=be):be=t[153];let ve;t[154]!==e?(ve=e("Enabled plugins and session config (read-only)."),t[154]=e,t[155]=ve):ve=t[155];let ye;t[156]!==e?(ye=e("Browse and revoke active sessions across all users."),t[156]=e,t[157]=ye):ye=t[157];let xe;t[158]!==e?(xe=e("Live Cloudflare Containers — current lifecycle state per instance from the log stream."),t[158]=e,t[159]=xe):xe=t[159];let we;t[160]!==e?(we=e("Chart widgets backed by saved read-only SQL queries."),t[160]=e,t[161]=we):we=t[161];let ke;t[162]!==e?(ke=e("Browse and edit rows across your shard and global tables."),t[162]=e,t[163]=ke):ke=t[163];let Ne;t[164]!==e?(Ne=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[164]=e,t[165]=Ne):Ne=t[165];let Me;t[166]!==e?(Me=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[166]=e,t[167]=Me):Me=t[167];let Se;t[168]!==e?(Se=e("Export a shard to NDJSON, or import rows from it."),t[168]=e,t[169]=Se):Se=t[169];let Ce;t[170]!==e?(Ce=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[170]=e,t[171]=Ce):Ce=t[171];let _e;t[172]!==e?(_e=e("Browse objects in your R2 storage buckets."),t[172]=e,t[173]=_e):_e=t[173];let Le;t[174]!==e?(Le=e("Inspect feature flags and their live evaluation under a targeting context."),t[174]=e,t[175]=Le):Le=t[175];let Pe;t[176]!==e?(Pe=e("Run registered queries, mutations, and actions."),t[176]=e,t[177]=Pe):Pe=t[177];let Ae;t[178]!==e?(Ae=e("At-a-glance connection, error, and shard signals."),t[178]=e,t[179]=Ae):Ae=t[179];let Te;t[180]!==e?(Te=e("Connection, health, and advisor summary for your deployment."),t[180]=e,t[181]=Te):Te=t[181];let ze;t[182]!==e?(ze=e("Surface slow functions, error spikes, and cache problems."),t[182]=e,t[183]=ze):ze=t[183];let $e;t[184]!==e?($e=e("Grouped error triage — Worker throws and container crashes folded by fingerprint."),t[184]=e,t[185]=$e):$e=t[185];let Re;t[186]!==e?(Re=e("A live stream of recent function logs."),t[186]=e,t[187]=Re):Re=t[187];let Ie;t[188]!==e?(Ie=e("Per-shard health and aggregate metrics."),t[188]=e,t[189]=Ie):Ie=t[189];let Ve;t[190]!==e?(Ve=e("Review migration status and run them."),t[190]=e,t[191]=Ve):Ve=t[191];let Ze;t[192]!==e?(Ze=e("Registered push devices — endpoint, kind, last-send status, and delivery errors."),t[192]=e,t[193]=Ze):Ze=t[193];let Ke;t[194]!==e?(Ke=e("Browse and manage organizations, members, and invitations."),t[194]=e,t[195]=Ke):Ke=t[195];let Ee;t[196]!==e?(Ee=e("Restore a shard to a point in the last 30 days."),t[196]=e,t[197]=Ee):Ee=t[197];let He;t[198]!==e?(He=e("Email your app sent, captured in dev."),t[198]=e,t[199]=He):He=t[199];let Oe;t[200]!==e?(Oe=e("Synced customers, subscriptions, and webhook events."),t[200]=e,t[201]=Oe):Oe=t[201];let Be;t[202]!==e?(Be=e("Inspect access policies per table, and probe a function as any identity."),t[202]=e,t[203]=Be):Be=t[203];let De;t[204]!==e?(De=e("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue."),t[204]=e,t[205]=De):De=t[205];let qe;t[206]!==e?(qe=e("Active WebSocket subscriptions on this shard."),t[206]=e,t[207]=qe):qe=t[207];let We;t[208]!==e?(We=e("Inspect row-level-security policies and roles, per table."),t[208]=e,t[209]=We):We=t[209];let je;t[210]!==e?(je=e("Inspect and cancel scheduled jobs."),t[210]=e,t[211]=je):je=t[211];let Fe;t[212]!==e?(Fe=e("Inspect each table and its columns."),t[212]=e,t[213]=Fe):Fe=t[213];let Ue;t[214]!==e?(Ue=e("Review admin gates, credentials, and log redaction."),t[214]=e,t[215]=Ue):Ue=t[215];let Qe;t[216]!==e?(Qe=e("Read-only deployment config — vars, secrets, and bindings."),t[216]=e,t[217]=Qe):Qe=t[217];let Ge;t[218]!==e?(Ge=e("Run read-only SQL against a shard."),t[218]=e,t[219]=Ge):Ge=t[219];let Je;t[220]!==e?(Je=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[220]=e,t[221]=Je):Je=t[221];let Xe;t[222]!==e?(Xe=e("Inspect storage access rules — per bucket, operation, and key prefix."),t[222]=e,t[223]=Xe):Xe=t[223];let Ye;t[224]!==e?(Ye=e("Recent ctx.trace waterfalls for this shard — the drill-down from a log line."),t[224]=e,t[225]=Ye):Ye=t[225];let et;t[226]!==e?(et=e("Manage auth users — roles, bans, sessions, and identity."),t[226]=e,t[227]=et):et=t[227];let tt;t[228]!==e?(tt=e("Browse Vectorize indexes and run similarity searches."),t[228]=e,t[229]=tt):tt=t[229];let at;t[230]!==e?(at=e("Inspect declared Cloudflare Workflows and their bindings."),t[230]=e,t[231]=at):at=t[231];let kt;t[232]!==me||t[233]!==pe||t[234]!==ge||t[235]!==fe||t[236]!==be||t[237]!==ve||t[238]!==ye||t[239]!==xe||t[240]!==we||t[241]!==ke||t[242]!==Ne||t[243]!==Me||t[244]!==Se||t[245]!==Ce||t[246]!==_e||t[247]!==Le||t[248]!==Pe||t[249]!==Ae||t[250]!==Te||t[251]!==ze||t[252]!==$e||t[253]!==Re||t[254]!==Ie||t[255]!==Ve||t[256]!==Ze||t[257]!==Ke||t[258]!==Ee||t[259]!==He||t[260]!==Oe||t[261]!==Be||t[262]!==De||t[263]!==qe||t[264]!==We||t[265]!==je||t[266]!==Fe||t[267]!==Ue||t[268]!==Qe||t[269]!==Ge||t[270]!==Je||t[271]!==Xe||t[272]!==Ye||t[273]!==et||t[274]!==tt||t[275]!==at?(kt={agents:me,analytics:pe,api:ge,audit:fe,authAudit:be,authConfig:ve,authSessions:ye,containers:xe,dashboards:we,data:ke,deploymentHealth:Ne,drains:Me,export:Se,fanout:Ce,files:_e,flags:Le,functions:Pe,health:Ae,home:Te,insights:ze,issues:$e,logs:Re,metrics:Ie,migrations:Ve,notifications:Ze,organizations:Ke,pitr:Ee,mail:He,payments:Oe,permissions:Be,queues:De,realtime:qe,rls:We,schedule:je,schema:Fe,security:Ue,settings:Qe,sql:Ge,kv:Je,storageRules:Xe,traces:Ye,users:et,vectors:tt,workflows:at},t[232]=me,t[233]=pe,t[234]=ge,t[235]=fe,t[236]=be,t[237]=ve,t[238]=ye,t[239]=xe,t[240]=we,t[241]=ke,t[242]=Ne,t[243]=Me,t[244]=Se,t[245]=Ce,t[246]=_e,t[247]=Le,t[248]=Pe,t[249]=Ae,t[250]=Te,t[251]=ze,t[252]=$e,t[253]=Re,t[254]=Ie,t[255]=Ve,t[256]=Ze,t[257]=Ke,t[258]=Ee,t[259]=He,t[260]=Oe,t[261]=Be,t[262]=De,t[263]=qe,t[264]=We,t[265]=je,t[266]=Fe,t[267]=Ue,t[268]=Qe,t[269]=Ge,t[270]=Je,t[271]=Xe,t[272]=Ye,t[273]=et,t[274]=tt,t[275]=at,t[276]=kt):kt=t[276];const Sa=kt;let Nt;t[277]!==s?(Nt=R=>{Qt(s({to:`/${R.currentTarget.dataset.tab??""}`}))},t[277]=s,t[278]=Nt):Nt=t[278];const Ca=Nt;let Mt,St;t[279]!==i||t[280]!==$?(Mt=()=>{typeof document<"u"&&(document.title=`${$[i]} · lunora`)},St=[i,$],t[279]=i,t[280]=$,t[281]=Mt,t[282]=St):(Mt=t[281],St=t[282]),xt(Mt,St);const _a=u.find(R=>R.tabs.includes(i))??aa[0],Kt=u.flatMap(R=>R.tabs.map(Rt=>({group:Zt[R.key],label:$[Rt],to:`/${Rt}`}))),st=Jt(ka),La=st!==null&&st.token!=="";let Ct;t[283]!==Kt?(Ct=r(Qa,{items:Kt}),t[283]=Kt,t[284]=Ct):Ct=t[284];let _t;t[285]===Symbol.for("react.memo_cache_sentinel")?(_t=r(Rs,{className:"-ms-1"}),t[285]=_t):_t=t[285];let rt;t[286]!==e?(rt=e("Breadcrumb"),t[286]=e,t[287]=rt):rt=t[287];const Et=Zt[_a.key];let nt;t[288]!==Et?(nt=r("span",{className:"text-muted-foreground",children:Et}),t[288]=Et,t[289]=nt):nt=t[289];let Lt;t[290]===Symbol.for("react.memo_cache_sentinel")?(Lt=r("svg",{"aria-hidden":"true",className:"size-3.5 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:r("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[290]=Lt):Lt=t[290];const Ht=$[i];let it;t[291]!==Ht?(it=r("span",{className:"font-medium text-foreground",children:Ht}),t[291]=Ht,t[292]=it):it=t[292];let ot;t[293]!==rt||t[294]!==nt||t[295]!==it?(ot=v("nav",{"aria-label":rt,className:"flex items-center gap-1.5 text-[13px]",children:[nt,Lt,it]}),t[293]=rt,t[294]=nt,t[295]=it,t[296]=ot):ot=t[296];let Pt;t[297]===Symbol.for("react.memo_cache_sentinel")?(Pt=v("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),t[297]=Pt):Pt=t[297];let lt;t[298]!==e?(lt=e("Search…"),t[298]=e,t[299]=lt):lt=t[299];let At;t[300]===Symbol.for("react.memo_cache_sentinel")?(At=r("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"⌘K"}),t[300]=At):At=t[300];let dt;t[301]!==lt?(dt=v("button",{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","data-testid":"dash-app-search",onClick:Ga,type:"button",children:[Pt,lt,At]}),t[301]=lt,t[302]=dt):dt=t[302];let Tt;t[303]===Symbol.for("react.memo_cache_sentinel")?(Tt=r("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:r(bs,{})}),t[303]=Tt):Tt=t[303];let ct;t[304]!==ot||t[305]!==dt?(ct=v("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[_t,ot,dt,Tt]}),t[304]=ot,t[305]=dt,t[306]=ct):ct=t[306];let ut;t[307]!==st?.rulesInstalled?(ut=st?.rulesInstalled===!1&&r(us,{}),t[307]=st?.rulesInstalled,t[308]=ut):ut=t[308];const Ot=`dash-tab-${i}`,Bt=d?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",Dt=$[i];let ht;t[309]!==e||t[310]!==Dt?(ht=e("{title} failed",{title:Dt}),t[309]=e,t[310]=Dt,t[311]=ht):ht=t[311];const qt=$[i];let mt;t[312]!==e?(mt=e("Try again"),t[312]=e,t[313]=mt):mt=t[313];let zt;t[314]===Symbol.for("react.memo_cache_sentinel")?(zt=r(Za,{fallback:r(Ma,{}),children:r(Ia,{})}),t[314]=zt):zt=t[314];let pt;t[315]!==i||t[316]!==ht||t[317]!==qt||t[318]!==mt?(pt=r(Ka,{fallbackTitle:ht,label:qt,retryLabel:mt,children:zt},i),t[315]=i,t[316]=ht,t[317]=qt,t[318]=mt,t[319]=pt):pt=t[319];let gt;t[320]!==Bt||t[321]!==pt?(gt=r("div",{className:Bt,children:pt}),t[320]=Bt,t[321]=pt,t[322]=gt):gt=t[322];let ft;t[323]!==Ot||t[324]!==gt?(ft=r("div",{"aria-labelledby":Ot,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:gt}),t[323]=Ot,t[324]=gt,t[325]=ft):ft=t[325];let $t;return t[326]!==ct||t[327]!==ut||t[328]!==ft?($t=v(Is,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[ct,ut,ft]}),t[326]=ct,t[327]=ut,t[328]=ft,t[329]=$t):$t=t[329],v(zs,{className:"min-h-0 flex-1","data-testid":"lunora-studio",children:[Ct,r(Br,{chrome:st,connected:La,current:i,groupLabel:Zt,groups:u,selectTab:Ca,tabDescription:Sa,tabLabel:$}),$t]})},qr=t=>{const e=y(5),{initialShardKey:s,schemaEditable:a}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const i=Va(n),{table:o}=i,d=typeof o=="string"?o:void 0;let l;return e[1]!==s||e[2]!==d||e[3]!==a?(l=r(Cr,{initialShardKey:s,initialTable:d,schemaEditable:a}),e[1]=s,e[2]=d,e[3]=a,e[4]=l):l=e[4],l},Wr=()=>{const t=y(3),e=ra();let s,a;return t[0]!==e?(s=()=>{Qt(e({replace:!0,to:"/home"}))},a=[e],t[0]=e,t[1]=s,t[2]=a):(s=t[1],a=t[2]),xt(s,a),null},jr=({basePath:t,dataEditable:e=!1,functions:s,initialShardKey:a,openApiSpec:n,openRpcSpec:i,runAsIdentity:o=!1,schemaEditable:d=!1,scheduledCancel:l,scheduledCron:c,scheduledLoad:u})=>{const g=Aa({component:Dr}),h={agents:r(js,{initialShardKey:a}),analytics:r(Fs,{}),api:r(Us,{functions:s,initialShardKey:a,openApiSpec:n,openRpcSpec:i}),audit:r(cr,{initialShardKey:a}),authAudit:r(Qs,{}),authConfig:r(Gs,{}),authSessions:r(Js,{}),containers:r(er,{}),dashboards:r(kr,{initialShardKey:a}),data:r(ar,{editable:e,initialShardKey:a}),deploymentHealth:r(tr,{}),drains:r(ur,{}),export:r(sr,{initialShardKey:a}),fanout:r(Nr,{initialShardKey:a}),files:r(Pr,{}),kv:r(br,{}),flags:r(ir,{initialShardKey:a}),functions:v("div",{className:"flex flex-col gap-8",children:[r(lr,{functions:s,initialShardKey:a}),r(or,{functions:s,runAsIdentity:o})]}),health:r(Mr,{initialShardKey:a}),home:r(Wa,{initialShardKey:a}),insights:r(Ds,{initialShardKey:a}),issues:r(dr,{initialShardKey:a}),logs:r(hr,{initialShardKey:a}),traces:r(Tr,{initialShardKey:a}),metrics:r(Sr,{initialShardKey:a}),migrations:r(rr,{initialShardKey:a}),notifications:r(vr,{}),organizations:r(Xs,{}),permissions:r(xr,{functions:s,runAsIdentity:o,schemaEditable:d}),pitr:r(nr,{initialShardKey:a}),mail:r(mr,{}),payments:r(yr,{}),queues:r(wr,{}),realtime:v("div",{className:"flex flex-col gap-8",children:[r(gr,{initialShardKey:a}),r(fr,{})]}),rls:r(qs,{}),schedule:r(pr,{loadCronJobs:c,scheduledCancel:l,scheduledLoad:u}),schema:r(qr,{initialShardKey:a,schemaEditable:d}),security:r(Ws,{}),settings:r(_r,{initialShardKey:a}),sql:r(Lr,{initialShardKey:a}),storageRules:r(Ar,{}),users:r(Ys,{}),vectors:r(zr,{}),workflows:r($r,{})},b=Wt({component:()=>h.home,getParentRoute:()=>g,path:"/"}),p=Na.map(m=>m==="data"?Wt({component:()=>h[m],getParentRoute:()=>g,path:`/${m}`,validateSearch:Ua}):Wt({component:()=>h[m],getParentRoute:()=>g,path:`/${m}`})),x=g.addChildren([b,...p]),f="window"in globalThis?Ta():za({initialEntries:["/home"]});return $a({...t===void 0||t==="/"?{}:{basepath:t},defaultNotFoundComponent:Wr,defaultPendingComponent:Ma,defaultPendingMinMs:0,defaultPendingMs:0,history:f,routeTree:x})},Fr=t=>{const e=y(17),{basePath:s,chrome:a,dataEditable:n,functions:i,initialShardKey:o,openApiSpec:d,openRpcSpec:l,runAsIdentity:c,schemaEditable:u,scheduledCancel:g,scheduledCron:h,scheduledLoad:b}=t;let p;e[0]!==s||e[1]!==n||e[2]!==i||e[3]!==o||e[4]!==d||e[5]!==l||e[6]!==c||e[7]!==g||e[8]!==h||e[9]!==b||e[10]!==u?(p=jr({basePath:s,dataEditable:n,functions:i,initialShardKey:o,openApiSpec:d,openRpcSpec:l,runAsIdentity:c,schemaEditable:u,scheduledCancel:g,scheduledCron:h,scheduledLoad:b}),e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=d,e[5]=l,e[6]=c,e[7]=g,e[8]=h,e[9]=b,e[10]=u,e[11]=p):p=e[11];const x=p,f=a??null;let m;e[12]!==x?(m=r(Pa,{router:x}),e[12]=x,e[13]=m):m=e[13];let k;return e[14]!==f||e[15]!==m?(k=r(ka,{value:f,children:m}),e[14]=f,e[15]=m,e[16]=k):k=e[16],k},Mn=t=>{const e=y(17),{basePath:s,chrome:a,dataEditable:n,functions:i,i18n:o,initialShardKey:d,locale:l,openApiSpec:c,openRpcSpec:u,runAsIdentity:g,schemaEditable:h,scheduledCancel:b,scheduledCron:p,scheduledLoad:x}=t;let f;e[0]!==s||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==d||e[5]!==c||e[6]!==u||e[7]!==g||e[8]!==b||e[9]!==p||e[10]!==x||e[11]!==h?(f=r(ss,{children:r(Fr,{basePath:s,chrome:a,dataEditable:n,functions:i,initialShardKey:d,openApiSpec:c,openRpcSpec:u,runAsIdentity:g,scheduledCancel:b,scheduledCron:p,scheduledLoad:x,schemaEditable:h})}),e[0]=s,e[1]=a,e[2]=n,e[3]=i,e[4]=d,e[5]=c,e[6]=u,e[7]=g,e[8]=b,e[9]=p,e[10]=x,e[11]=h,e[12]=f):f=e[12];const m=f;if(o===void 0&&l===void 0)return m;let k;return e[13]!==o||e[14]!==l||e[15]!==m?(k=r(Fa,{i18n:o,locale:l,children:m}),e[13]=o,e[14]=l,e[15]=m,e[16]=k):k=e[16],k};function Ur(t){return t.location.pathname}function Qr(t){return t.tabs.length>0}export{Ns as N,Mn as S,as as a,rs as b,ks as c,ls as f,ys as g,Nn as m,Ms as v};
@@ -1 +0,0 @@
1
- import{c as k}from"react/compiler-runtime";import{useT as w}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{jsx as h,jsxs as N}from"react/jsx-runtime";import{useState as L,useRef as C,useMemo as T}from"react";import{f as F,e as P}from"./internal-AtZ4bTal.js";import{useVirtualizer as R}from"@tanstack/react-virtual";import{c as E}from"./utils-bhneXptQ.js";import{l as O}from"./virtual-rect-1o1veP7R.js";const S=v=>v==null?"∅":v===""?"(empty)":typeof v=="object"?JSON.stringify(v):String(v),I=v=>{const e=k(32),{column:t,onFacetFilter:i,state:r}=v,a=w();let n;e[0]!==t||e[1]!==i||e[2]!==r.result?.values?(n=u=>{const b=Number(u.currentTarget.dataset.index),x=r.result?.values[b];x!==void 0&&i(t,x.value)},e[0]=t,e[1]=i,e[2]=r.result?.values,e[3]=n):n=e[3];const s=n,o=`db-facet-${t}`;let c;e[4]!==t?(c=h("span",{className:"font-medium text-foreground",children:t}),e[4]=t,e[5]=c):c=e[5];let m;e[6]!==r.loading||e[7]!==r.result||e[8]!==a?(m=r.loading&&r.result===null&&h("span",{className:"text-muted-foreground",children:a("Loading…")}),e[6]=r.loading,e[7]=r.result,e[8]=a,e[9]=m):m=e[9];let f;e[10]!==r.error?(f=r.error!==null&&h("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=f):f=e[11];let p;e[12]!==r.result?.values?(p=r.result?.values??[],e[12]=r.result?.values,e[13]=p):p=e[13];let d;if(e[14]!==t||e[15]!==s||e[16]!==p){let u;e[18]!==t||e[19]!==s?(u=(b,x)=>N("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":x,"data-testid":`db-facet-value-${t}`,onClick:s,type:"button",children:[h("span",{className:"truncate",children:S(b.value)}),h("span",{className:"shrink-0 tabular-nums text-foreground/70",children:b.count})]},S(b.value)),e[18]=t,e[19]=s,e[20]=u):u=e[20],d=p.map(u),e[14]=t,e[15]=s,e[16]=p,e[17]=d}else d=e[17];let g;e[21]!==t||e[22]!==r.result||e[23]!==a?(g=r.result?.truncated===!0&&h("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${t}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=t,e[22]=r.result,e[23]=a,e[24]=g):g=e[24];let l;return e[25]!==o||e[26]!==c||e[27]!==m||e[28]!==f||e[29]!==d||e[30]!==g?(l=N("section",{className:"flex flex-col gap-1","data-testid":o,children:[c,m,f,d,g]}),e[25]=o,e[26]=c,e[27]=m,e[28]=f,e[29]=d,e[30]=g,e[31]=l):l=e[31],l},U=v=>{const e=k(26),{columns:t,facets:i,onFacetFilter:r,onToggleFacet:a}=v,n=w();let s;e[0]!==a?(s=b=>{const{column:x}=b.currentTarget.dataset;x!==void 0&&a(x)},e[0]=a,e[1]=s):s=e[1];const o=s;if(t.length===0)return null;let c;e[2]!==n?(c=n("Facets"),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==c?(m=h("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:c}),e[4]=c,e[5]=m):m=e[5];let f;if(e[6]!==t||e[7]!==i||e[8]!==o){let b;e[10]!==i||e[11]!==o?(b=x=>h("button",{"aria-pressed":x in i,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":x,"data-testid":`db-facet-toggle-${x}`,onClick:o,type:"button",children:x},x),e[10]=i,e[11]=o,e[12]=b):b=e[12],f=t.map(b),e[6]=t,e[7]=i,e[8]=o,e[9]=f}else f=e[9];let p;e[13]!==f?(p=h("div",{className:"flex flex-wrap gap-1",children:f}),e[13]=f,e[14]=p):p=e[14];let d;e[15]!==m||e[16]!==p?(d=N("div",{className:"flex flex-col gap-1.5",children:[m,p]}),e[15]=m,e[16]=p,e[17]=d):d=e[17];let g;e[18]!==i?(g=Object.entries(i),e[18]=i,e[19]=g):g=e[19];let l;e[20]!==r||e[21]!==g?(l=g.map(b=>{const[x,$]=b;return h(I,{column:x,onFacetFilter:r,state:$},x)}),e[20]=r,e[21]=g,e[22]=l):l=e[22];let u;return e[23]!==d||e[24]!==l?(u=N("aside",{className:"flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs","data-testid":"db-facets",children:[d,l]}),e[23]=d,e[24]=l,e[25]=u):u=e[25],u},J=[25,50,100,250],V=v=>{const e=k(18),{onChange:t,options:i,prefix:r,value:a}=v,n=w();let s;e[0]!==t?(s=b=>{t(Number.parseInt(b.target.value,10))},e[0]=t,e[1]=s):s=e[1];const o=s,c=`${r}-page-size`;let m;e[2]!==n?(m=n("Rows per page"),e[2]=n,e[3]=m):m=e[3];let f;e[4]!==m?(f=h("span",{children:m}),e[4]=m,e[5]=f):f=e[5];const p=`${r}-page-size`,d=`${r}-page-size`;let g;e[6]!==i?(g=i.map(_),e[6]=i,e[7]=g):g=e[7];let l;e[8]!==o||e[9]!==p||e[10]!==d||e[11]!==g||e[12]!==a?(l=h("select",{className:"h-6 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":p,id:d,onChange:o,value:a,children:g}),e[8]=o,e[9]=p,e[10]=d,e[11]=g,e[12]=a,e[13]=l):l=e[13];let u;return e[14]!==c||e[15]!==f||e[16]!==l?(u=N("label",{className:"flex items-center gap-1.5",htmlFor:c,children:[f,l]}),e[14]=c,e[15]=f,e[16]=l,e[17]=u):u=e[17],u},B=v=>{const e=k(25),{onJump:t,page:i,pages:r,prefix:a}=v,n=w();let s;e[0]!==t||e[1]!==r?(s=y=>{const j=Number.parseInt(y,10);Number.isNaN(j)||t(Math.min(Math.max(1,j),Math.max(1,r)))},e[0]=t,e[1]=r,e[2]=s):s=e[2];const o=s;let c;e[3]!==o?(c=y=>{y.key==="Enter"&&o(y.currentTarget.value)},e[3]=o,e[4]=c):c=e[4];const m=c;let f;e[5]!==o?(f=y=>{o(y.currentTarget.value)},e[5]=o,e[6]=f):f=e[6];const p=f;let d;e[7]!==n?(d=n("Page"),e[7]=n,e[8]=d):d=e[8];let g;e[9]!==n?(g=n("Page"),e[9]=n,e[10]=g):g=e[10];const l=`${a}-page-jump`,u=Math.max(1,r);let b;e[11]!==p||e[12]!==m||e[13]!==i||e[14]!==g||e[15]!==l||e[16]!==u?(b=h("input",{"aria-label":g,className:"h-6 w-12 rounded-md border border-border bg-background px-1 text-center tabular-nums outline-none focus-visible:border-ring","data-testid":l,defaultValue:i,max:u,min:1,onBlur:p,onKeyDown:m,type:"number"},i),e[11]=p,e[12]=m,e[13]=i,e[14]=g,e[15]=l,e[16]=u,e[17]=b):b=e[17];let x;e[18]!==r||e[19]!==n?(x=n("of {pages}",{pages:r}),e[18]=r,e[19]=n,e[20]=x):x=e[20];let $;return e[21]!==d||e[22]!==b||e[23]!==x?($=N("span",{className:"flex items-center gap-1.5 tabular-nums",children:[d,b,x]}),e[21]=d,e[22]=b,e[23]=x,e[24]=$):$=e[24],$},X=({hasNext:v,hasPrevious:e,onJumpToPage:t,onNext:i,onPageSizeChange:r,onPrevious:a,pageSize:n,pageSizeOptions:s=J,prefix:o,rangeEnd:c,rangeStart:m,total:f})=>{const p=w(),d="rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",g=n!==void 0&&n>0?Math.max(1,Math.ceil(f/n)):1,l=n!==void 0&&n>0?Math.floor(Math.max(0,m-1)/n)+1:1;return N("div",{className:"flex w-full items-center justify-between gap-3 text-xs text-muted-foreground",children:[N("div",{className:"flex items-center gap-3",children:[n!==void 0&&r!==void 0&&h(V,{onChange:r,options:s,prefix:o,value:n}),h("span",{className:"tabular-nums","data-testid":`${o}-page-info`,children:p("{rangeStart}-{rangeEnd} of {total}",{rangeEnd:c,rangeStart:m,total:f})})]}),N("div",{className:"flex items-center gap-3",children:[h("button",{className:d,"data-testid":`${o}-prev`,disabled:!e,onClick:a,type:"button",children:p("Previous")}),n!==void 0&&t!==void 0&&h(B,{onJump:t,page:l,pages:g,prefix:o}),h("button",{className:d,"data-testid":`${o}-next`,disabled:!v,onClick:i,type:"button",children:p("Next")})]})]})};function _(v){return h("option",{value:v,children:v},v)}const Z=()=>{const[v,e]=L({}),t=C(v);t.current=v;const i=C({}),r=async(a,n)=>{const s=(i.current[a]??0)+1;i.current[a]=s,e(o=>a in o?{...o,[a]:{error:null,loading:!0,result:o[a]?.result??null}}:o);try{const o=await n(a);if(i.current[a]!==s)return;e(c=>a in c?{...c,[a]:{error:null,loading:!1,result:o}}:c)}catch(o){if(i.current[a]!==s)return;e(c=>a in c?{...c,[a]:{error:P(o),loading:!1,result:null}}:c)}};return{clearFacets:()=>{e({}),t.current={}},facets:v,facetsRef:t,refetchFacets:a=>{for(const n of Object.keys(t.current))F(r(n,a))},toggleFacet:(a,n)=>{if(a in t.current){e(s=>Object.fromEntries(Object.entries(s).filter(([o])=>o!==a)));return}e(s=>({...s,[a]:{error:null,loading:!0,result:null}})),n!==null&&F(r(a,n))}}},M=34,z=600,A=v=>{const e=k(21),{item:t,onSelect:i,prefix:r,selected:a,start:n}=v;let s;e[0]!==t.name||e[1]!==i?(s=()=>{i(t.name)},e[0]=t.name,e[1]=i,e[2]=s):s=e[2];const o=s,c=`translateY(${String(n)}px)`;let m;e[3]!==c?(m={insetInline:0,position:"absolute",top:0,transform:c},e[3]=c,e[4]=m):m=e[4];const f=m,p=a?"bg-accent font-medium text-accent-foreground":"text-foreground";let d;e[5]!==p?(d=E("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",p),e[5]=p,e[6]=d):d=e[6];const g=`${r}-table-${t.name}`;let l;e[7]!==t.name?(l=h("span",{className:"truncate",children:t.name}),e[7]=t.name,e[8]=l):l=e[8];let u;e[9]!==t.rowCount?(u=h("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:t.rowCount}),e[9]=t.rowCount,e[10]=u):u=e[10];let b;e[11]!==o||e[12]!==a||e[13]!==d||e[14]!==g||e[15]!==l||e[16]!==u?(b=N("button",{"aria-pressed":a,className:d,"data-testid":g,onClick:o,type:"button",children:[l,u]}),e[11]=o,e[12]=a,e[13]=d,e[14]=g,e[15]=l,e[16]=u,e[17]=b):b=e[17];let x;return e[18]!==f||e[19]!==b?(x=h("li",{style:f,children:b}),e[18]=f,e[19]=b,e[20]=x):x=e[20],x},ee=({header:v,onReload:e,onSelect:t,prefix:i,reloadLabel:r,selected:a,tables:n})=>{const s=w(),[o,c]=L(""),m=C(null),f=l=>{c(l.target.value)},p=T(()=>{const l=o.trim().toLowerCase();return l===""?n:n.filter(u=>u.name.toLowerCase().includes(l))},[o,n]),d=R({count:p.length,estimateSize:()=>M,getScrollElement:()=>m.current,initialRect:{height:z,width:240},observeElementRect:(l,u)=>O(l,u,z),overscan:12}).getVirtualItems(),g={height:p.length*M};return N("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${i}-table-list`,children:[v,N("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[h("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:s("Tables")}),e!==void 0&&h("button",{"aria-label":r??s("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${i}-load-tables`,onClick:e,title:r??s("Refresh"),type:"button",children:h("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:h("path",{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"})})})]}),h("div",{className:"shrink-0 border-b border-border p-2",children:h("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${i}-table-search`,onChange:f,placeholder:s("search table…"),type:"search",value:o})}),N("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${i}-table-list-rows`,ref:m,children:[h("li",{"aria-hidden":"true",style:g}),d.map(l=>{const u=p[l.index];return u===void 0?null:h(A,{item:u,onSelect:t,prefix:i,selected:a===u.name,start:l.start},u.name)})]})]})};export{U as $,ee as _,X as a,Z as u};
@@ -1 +0,0 @@
1
- import{c as P}from"react/compiler-runtime";import{useLunora as k}from"@lunora/react";import{useQueryClient as v,useQuery as E,keepPreviousData as I}from"@tanstack/react-query";import{useState as h,useEffect as q}from"react";import{a as f,c,f as p,e as K}from"./internal-AtZ4bTal.js";const y=(e,r,a)=>["lunora-admin",e,r,a.trim()];function N(e,r,a={}){const{enabled:t=!0,keepPreviousData:s=!1,staleTime:i=0}=a,o=E({enabled:t,queryFn:r,placeholderData:s?I:void 0,queryKey:e,staleTime:i});return{data:o.data,error:o.error?K(o.error):o.error,errorSource:o.error??void 0,isLoading:o.isLoading,liveError:void 0,refetch:()=>{p(o.refetch())}}}function _(e,r,a={}){const t=k(),s=v(),{enabled:i=!0,keepPreviousData:o=!1,live:n=!1,shardKey:u="",staleTime:b}=a,d=y(e,r,u),T=N(d,()=>t.query(f(e),r,c(u)),{enabled:i,keepPreviousData:o,staleTime:b??(n?Number.POSITIVE_INFINITY:0)}),[g,l]=h(void 0),D=JSON.stringify(d);return q(()=>{if(!(!i||!n))return l(void 0),t.subscribe(f(e),r,m=>{l(void 0),s.setQueryData(d,m)},{...c(u),onError:m=>{l(m.message)}})},[D,i,n]),{...T,liveError:i&&n?g:void 0}}const x=()=>{const e=P(2),r=v();let a;return e[0]!==r?(a=(t,s,i)=>{const o=s===void 0?["lunora-admin",t]:y(t,s,i??"");p(r.invalidateQueries({queryKey:o}))},e[0]=r,e[1]=a):a=e[1],a};export{_ as K,N as T,x as _};
@@ -1 +0,0 @@
1
- import{useState as s}from"react";import{f as u,e as l}from"./internal-AtZ4bTal.js";const c=()=>{const[t,r]=s(!1),[a,e]=s(null);return{busy:t,error:a,run:n=>{u((async()=>{r(!0),e(null);try{await n()}catch(o){e(l(o))}finally{r(!1)}})())}}};export{c as u};
@@ -1 +0,0 @@
1
- import{a as ae}from"./chunk-I4WGRDL2.js";import"./chunk-WCWYSOCN.js";import"./chunk-4UOFSGUS.js";import"./chunk-ILNELDFC.js";import"./chunk-T6VMSOBB.js";import{a as te}from"./chunk-XXQUMVWH.js";import{a as Q,b as U,c as D,e as V}from"./chunk-UZERI5YC.js";import{d as Y,f as ee}from"./chunk-7T7UOTYK.js";import"./chunk-7QIFDWQV.js";import{c as T}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{a as X}from"./chunk-AADXUXZO.js";import{f as F}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as H}from"./chunk-XQCVZAGU.js";import{d as W,f as Z,g as G,h as J,m as P}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as C,e as O,f as de,g as le,h as ie}from"./chunk-3XIESWL4.js";var A=O(le(),1),$=O(de(),1);var i=O(ie(),1);var se=Z(X.runSql),re=C((M,e)=>{let a=F(),[m,t]=(0,$.useState)(void 0),[d,s]=(0,$.useState)(void 0),[l,c]=(0,$.useState)(!0),N=(0,$.useCallback)(async r=>{c(!0);try{let w=await a.query(se,{sql:M},G(e));r.cancelled||(t(w),s(void 0))}catch(w){r.cancelled||(t(void 0),s(J(w)))}finally{r.cancelled||c(!1)}},[a,M,e]);return(0,$.useEffect)(()=>{let r={cancelled:!1};return P(N(r)),()=>{r.cancelled=!0}},[N]),{error:d,loading:l,result:m}},"ie"),oe="lunora-studio-dashboards",B={shardKey:"",sql:"",title:""},ne=C(M=>{let e=(0,A.c)(54),{onEdit:a,onRemove:m,widget:t}=M,d=W(),{error:s,loading:l,result:c}=re(t.sql,t.shardKey??""),N;e[0]!==a||e[1]!==t.id?(N=C(()=>{a(t.id)},"C"),e[0]=a,e[1]=t.id,e[2]=N):N=e[2];let r=N,w;e[3]!==m||e[4]!==t.id?(w=C(()=>{m(t.id)},"w"),e[3]=m,e[4]=t.id,e[5]=w):w=e[5];let L=w,_=`dashboards-widget-${t.id}`,q;e[6]!==t.title?(q=(0,i.jsx)(D,{className:"min-w-0 truncate",title:t.title,children:t.title}),e[6]=t.title,e[7]=q):q=e[7];let E;e[8]!==d?(E=d("Edit widget"),e[8]=d,e[9]=E):E=e[9];let j=`dashboards-widget-edit-${t.id}`,R;e[10]!==d?(R=d("Edit widget"),e[10]=d,e[11]=R):R=e[11];let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k=(0,i.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M4 20h4L18 10l-4-4L4 16v4ZM14 6l4 4"})}),e[12]=k):k=e[12];let x;e[13]!==r||e[14]!==E||e[15]!==j||e[16]!==R?(x=(0,i.jsx)(T,{"aria-label":E,"data-testid":j,onClick:r,size:"icon-xs",title:R,type:"button",variant:"ghost",children:k}),e[13]=r,e[14]=E,e[15]=j,e[16]=R,e[17]=x):x=e[17];let p;e[18]!==d?(p=d("Remove widget"),e[18]=d,e[19]=p):p=e[19];let K=`dashboards-widget-remove-${t.id}`,h;e[20]!==d?(h=d("Remove widget"),e[20]=d,e[21]=h):h=e[21];let v;e[22]===Symbol.for("react.memo_cache_sentinel")?(v=(0,i.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,i.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[22]=v):v=e[22];let u;e[23]!==L||e[24]!==p||e[25]!==K||e[26]!==h?(u=(0,i.jsx)(T,{"aria-label":p,"data-testid":K,onClick:L,size:"icon-xs",title:h,type:"button",variant:"ghost",children:v}),e[23]=L,e[24]=p,e[25]=K,e[26]=h,e[27]=u):u=e[27];let b;e[28]!==u||e[29]!==x?(b=(0,i.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[x,u]}),e[28]=u,e[29]=x,e[30]=b):b=e[30];let g;e[31]!==b||e[32]!==q?(g=(0,i.jsxs)(U,{className:"flex flex-row items-start justify-between gap-2 border-b pb-3",children:[q,b]}),e[31]=b,e[32]=q,e[33]=g):g=e[33];let f;e[34]!==s||e[35]!==t.id?(f=s!==void 0&&(0,i.jsx)(te,{className:"font-mono text-xs",testId:`dashboards-widget-error-${t.id}`,variant:"destructive",children:s}),e[34]=s,e[35]=t.id,e[36]=f):f=e[36];let S;e[37]!==s||e[38]!==l||e[39]!==c||e[40]!==d||e[41]!==t.id?(S=s===void 0&&l&&c===void 0&&(0,i.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":`dashboards-widget-loading-${t.id}`,children:d("Running\u2026")}),e[37]=s,e[38]=l,e[39]=c,e[40]=d,e[41]=t.id,e[42]=S):S=e[42];let o;e[43]!==s||e[44]!==c?(o=s===void 0&&c!==void 0&&(0,i.jsx)(ae,{result:c}),e[43]=s,e[44]=c,e[45]=o):o=e[45];let n;e[46]!==f||e[47]!==S||e[48]!==o?(n=(0,i.jsxs)(V,{className:"min-h-32 py-2",children:[f,S,o]}),e[46]=f,e[47]=S,e[48]=o,e[49]=n):n=e[49];let y;return e[50]!==g||e[51]!==n||e[52]!==_?(y=(0,i.jsxs)(Q,{"data-testid":_,children:[g,n]}),e[50]=g,e[51]=n,e[52]=_,e[53]=y):y=e[53],y},"ae"),ce=C(M=>{let e=(0,A.c)(58),{draft:a,editing:m,onCancel:t,onChange:d,onSubmit:s}=M,l=W(),c;e[0]!==a||e[1]!==d?(c=C(z=>{d({...a,title:z.target.value})},"n"),e[0]=a,e[1]=d,e[2]=c):c=e[2];let N=c,r;e[3]!==a||e[4]!==d?(r=C(z=>{d({...a,sql:z.target.value})},"s"),e[3]=a,e[4]=d,e[5]=r):r=e[5];let w=r,L;e[6]!==a||e[7]!==d?(L=C(z=>{d({...a,shardKey:z.target.value})},"$"),e[6]=a,e[7]=d,e[8]=L):L=e[8];let _=L,q;e[9]!==s?(q=C(()=>{s()},"q"),e[9]=s,e[10]=q):q=e[10];let E=q,j;e[11]!==a.sql||e[12]!==a.title?(j=a.title.trim()!==""&&a.sql.trim()!=="",e[11]=a.sql,e[12]=a.title,e[13]=j):j=e[13];let R=j,k;e[14]!==l?(k=l("Widget title"),e[14]=l,e[15]=k):k=e[15];let x;e[16]!==l?(x=l("Widget title"),e[16]=l,e[17]=x):x=e[17];let p;e[18]!==a.title||e[19]!==N||e[20]!==k||e[21]!==x?(p=(0,i.jsx)("input",{"aria-label":k,className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-title",onChange:N,placeholder:x,type:"text",value:a.title}),e[18]=a.title,e[19]=N,e[20]=k,e[21]=x,e[22]=p):p=e[22];let K;e[23]!==l?(K=l("SQL query"),e[23]=l,e[24]=K):K=e[24];let h;e[25]!==a.sql||e[26]!==w||e[27]!==K?(h=(0,i.jsx)("textarea",{"aria-label":K,className:"min-h-24 resize-y rounded-md border border-border bg-background p-2 font-mono text-xs leading-5 outline-none focus-visible:border-ring","data-testid":"dashboards-form-sql",onChange:w,placeholder:"SELECT author, COUNT(*) AS messages FROM \u2026",spellCheck:!1,value:a.sql}),e[25]=a.sql,e[26]=w,e[27]=K,e[28]=h):h=e[28];let v;e[29]!==l?(v=l("Shard key (optional)"),e[29]=l,e[30]=v):v=e[30];let u;e[31]!==l?(u=l("Shard key (optional)"),e[31]=l,e[32]=u):u=e[32];let b;e[33]!==a.shardKey||e[34]!==_||e[35]!==v||e[36]!==u?(b=(0,i.jsx)("input",{"aria-label":v,className:"h-8 rounded-md border border-border bg-background px-2 font-mono text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-shard",onChange:_,placeholder:u,type:"text",value:a.shardKey}),e[33]=a.shardKey,e[34]=_,e[35]=v,e[36]=u,e[37]=b):b=e[37];let g;e[38]!==l?(g=l("Cancel"),e[38]=l,e[39]=g):g=e[39];let f;e[40]!==t||e[41]!==g?(f=(0,i.jsx)(T,{"data-testid":"dashboards-form-cancel",onClick:t,size:"sm",type:"button",variant:"outline",children:g}),e[40]=t,e[41]=g,e[42]=f):f=e[42];let S=!R,o;e[43]!==m||e[44]!==l?(o=l(m?"Save widget":"Add widget"),e[43]=m,e[44]=l,e[45]=o):o=e[45];let n;e[46]!==E||e[47]!==S||e[48]!==o?(n=(0,i.jsx)(T,{"data-testid":"dashboards-form-save",disabled:S,onClick:E,size:"sm",type:"button",children:o}),e[46]=E,e[47]=S,e[48]=o,e[49]=n):n=e[49];let y;e[50]!==f||e[51]!==n?(y=(0,i.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[f,n]}),e[50]=f,e[51]=n,e[52]=y):y=e[52];let I;return e[53]!==h||e[54]!==b||e[55]!==y||e[56]!==p?(I=(0,i.jsx)(Q,{"data-testid":"dashboards-form",children:(0,i.jsxs)(V,{className:"flex flex-col gap-3 py-4",children:[p,h,b,y]})}),e[53]=h,e[54]=b,e[55]=y,e[56]=p,e[57]=I):I=e[57],I},"oe"),we=C(M=>{let e=(0,A.c)(39),{initialShardKey:a}=M,m=W(),[t,d]=Y(oe),[s,l]=(0,$.useState)(B),[c,N]=(0,$.useState)(null),[r,w]=(0,$.useState)(!1),L;e[0]!==a?(L=C(()=>{N(null),l({...B,shardKey:a??""}),w(!0)},"$"),e[0]=a,e[1]=L):L=e[1];let _=L,q;e[2]===Symbol.for("react.memo_cache_sentinel")?(q=C(()=>{w(!1),N(null),l(B)},"q"),e[2]=q):q=e[2];let E=q,j;e[3]!==t?(j=C(o=>{let n=t.find(y=>y.id===o);n!==void 0&&(N(o),l({shardKey:n.shardKey??"",sql:n.sql,title:n.title}),w(!0))},"L"),e[3]=t,e[4]=j):j=e[4];let R=j,k;e[5]!==d?(k=C(o=>{d(n=>n.filter(y=>y.id!==o))},"k"),e[5]=d,e[6]=k):k=e[6];let x=k,p;e[7]!==s.shardKey||e[8]!==s.sql||e[9]!==s.title||e[10]!==c||e[11]!==d?(p=C(()=>{let o=s.title.trim(),n=s.sql.trim();if(o===""||n==="")return;let y=s.shardKey.trim();d(c===null?I=>[...I,{id:ee("w"),shardKey:y,sql:n,title:o}]:I=>I.map(z=>z.id===c?{...z,shardKey:y,sql:n,title:o}:z)),E()},"p"),e[7]=s.shardKey,e[8]=s.sql,e[9]=s.title,e[10]=c,e[11]=d,e[12]=p):p=e[12];let K=p,h;e[13]!==m?(h=m("Chart widgets backed by saved read-only SQL queries."),e[13]=m,e[14]=h):h=e[14];let v;e[15]!==h?(v=(0,i.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[15]=h,e[16]=v):v=e[16];let u;e[17]!==r||e[18]!==_||e[19]!==m?(u=!r&&(0,i.jsx)(T,{"data-testid":"dashboards-add",onClick:_,size:"sm",type:"button",children:m("Add widget")}),e[17]=r,e[18]=_,e[19]=m,e[20]=u):u=e[20];let b;e[21]!==v||e[22]!==u?(b=(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[v,u]}),e[21]=v,e[22]=u,e[23]=b):b=e[23];let g;e[24]!==s||e[25]!==c||e[26]!==r||e[27]!==K?(g=r&&(0,i.jsx)(ce,{draft:s,editing:c!==null,onCancel:E,onChange:l,onSubmit:K}),e[24]=s,e[25]=c,e[26]=r,e[27]=K,e[28]=g):g=e[28];let f;e[29]!==r||e[30]!==R||e[31]!==x||e[32]!==m||e[33]!==t?(f=t.length===0&&!r?(0,i.jsx)(H,{description:m("Add a widget to chart a saved SQL query on this browser."),testId:"dashboards-empty",title:m("No widgets yet")}):(0,i.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3","data-testid":"dashboards-grid",children:t.map(o=>(0,i.jsx)(ne,{onEdit:R,onRemove:x,widget:o},o.id))}),e[29]=r,e[30]=R,e[31]=x,e[32]=m,e[33]=t,e[34]=f):f=e[34];let S;return e[35]!==g||e[36]!==f||e[37]!==b?(S=(0,i.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-dashboards",children:[b,g,f]}),e[35]=g,e[36]=f,e[37]=b,e[38]=S):S=e[38],S},"qe");export{we as default};
@@ -1,4 +0,0 @@
1
- import{a as L}from"./chunk-SKHEGARW.js";import{a as w,e as N}from"./chunk-UZERI5YC.js";import{R as S}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as v}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import"./chunk-XBDKZZ67.js";import{d as k,h as C,m as j,o as T}from"./chunk-4CGALXS3.js";import{a as p,e as b,f as M,g as O,h as W}from"./chunk-3XIESWL4.js";var q=b(O(),1),x=b(M(),1);var t=b(W(),1);var D=p(s=>{let e=(0,q.c)(23),{destination:a}=s,h=k(),m;e[0]!==a.snippet?(m=p(()=>{T(a.snippet)},"m"),e[0]=a.snippet,e[1]=m):m=e[1];let u=m,r;e[2]!==a.title?(r=(0,t.jsx)("h4",{className:"text-sm font-semibold",children:a.title}),e[2]=a.title,e[3]=r):r=e[3];let o;e[4]!==a.description?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:a.description}),e[4]=a.description,e[5]=o):o=e[5];let l;e[6]!==r||e[7]!==o?(l=(0,t.jsxs)("div",{children:[r,o]}),e[6]=r,e[7]=o,e[8]=l):l=e[8];let g=`drain-copy-${a.id}`,d;e[9]!==h?(d=h("Copy"),e[9]=h,e[10]=d):d=e[10];let i;e[11]!==u||e[12]!==g||e[13]!==d?(i=(0,t.jsx)(v,{"data-testid":g,onClick:u,size:"sm",variant:"outline",children:d}),e[11]=u,e[12]=g,e[13]=d,e[14]=i):i=e[14];let n;e[15]!==l||e[16]!==i?(n=(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[l,i]}),e[15]=l,e[16]=i,e[17]=n):n=e[17];let c;e[18]!==a.snippet?(c=(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-muted p-2 font-mono text-xs",children:a.snippet}),e[18]=a.snippet,e[19]=c):c=e[19];let f;return e[20]!==n||e[21]!==c?(f=(0,t.jsx)(w,{className:"py-0","data-testid":"drain-card",children:(0,t.jsxs)(N,{className:"p-3",children:[n,c]})}),e[20]=n,e[21]=c,e[22]=f):f=e[22],f},"$"),z=p(()=>{let s=k(),e=[{description:s("Stream every request log to R2, a SIEM, or a third-party log service."),id:"logpush",snippet:["{",' "logpush": true',"}"].join(`
2
- `),title:s("Logpush")},{description:s("Send logs programmatically to a Worker for custom capture and forwarding."),id:"tail-worker",snippet:["{",' "tail_consumers": [{ "service": "my-log-forwarder" }]',"}"].join(`
3
- `),title:s("Tail Workers")},{description:s("Retain and query recent request logs directly in Cloudflare's dashboard."),id:"workers-logs",snippet:["{",' "observability": { "enabled": true }',"}"].join(`
4
- `),title:s("Workers Logs")}],[a,h]=(0,x.useState)(""),[m,u]=(0,x.useState)(!1),[r,o]=(0,x.useState)(null),l=p(async()=>{let i=a.trim();if(i==="")return;let n="fetch"in globalThis?globalThis.fetch:void 0;if(n===void 0){o({kind:"error",message:s("fetch is unavailable in this environment.")});return}let c={durationMs:12,function:"messages:list",outcome:"ok",shard:"root",source:"lunora",tablesRead:["messages"],tablesWritten:[],ts:new Date().toISOString(),type:"request"};u(!0),o(null);let f=performance.now();try{let y=await n(i,{body:JSON.stringify(c),headers:{"Content-Type":"application/json"},method:"POST"});o({kind:"success",latencyMs:Math.round(performance.now()-f),status:y.status})}catch(y){o({kind:"error",message:C(y)})}finally{u(!1)}},"l"),g=p(()=>{j(l())},"g"),d=p(i=>{h(i.target.value)},"d");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"log-drains",children:[(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"drain-cf-link",href:L,rel:"noreferrer",target:"_blank",children:s("Open in Cloudflare")})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"drain-readonly-note",children:s("Lunora does not ship logs itself \u2014 forwarding is handled by Cloudflare. Configure a destination below, then test your collector.")}),(0,t.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"drain-destinations",children:[(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Cloudflare destinations")}),e.map(i=>(0,t.jsx)(D,{destination:i},i.id))]}),(0,t.jsx)(w,{className:"py-0",children:(0,t.jsx)(N,{className:"p-3",children:(0,t.jsxs)("section",{"data-testid":"drain-webhook",children:[(0,t.jsx)("h3",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Webhook test")}),(0,t.jsx)("p",{className:"mb-2 text-sm text-muted-foreground",children:s("POST a sample Lunora request-log envelope to your collector to confirm it is reachable.")}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(S,{className:"min-w-[20rem] flex-1","data-testid":"drain-webhook-url",onChange:d,placeholder:s("https://example.com/logs"),type:"url",value:a}),(0,t.jsx)(v,{"data-testid":"drain-webhook-test",disabled:m||a.trim()==="",onClick:g,children:s(m?"Sending\u2026":"Send test event")})]}),r!==null&&(0,t.jsx)("p",{className:r.kind==="success"?"mt-2 text-sm text-muted-foreground":"mt-2 text-sm text-destructive","data-testid":"drain-webhook-result",role:r.kind==="error"?"alert":void 0,children:r.kind==="success"?s("Delivered \u2014 status {status} in {latency}ms",{latency:r.latencyMs,status:r.status}):s("Failed: {message}",{message:r.message})})]})})})]})},"E");export{z as LogDrainsPanel};
@@ -1 +0,0 @@
1
- import{a as z}from"./chunk-QWGT25SE.js";import{a as be}from"./chunk-X2FQ6B5V.js";import{a as we}from"./chunk-ZJGP6EKR.js";import{a as te}from"./chunk-SKHEGARW.js";import{b as xe}from"./chunk-AVAC26HJ.js";import{a as U}from"./chunk-LFKCLLPT.js";import{a as ge}from"./chunk-HK4OVYG3.js";import"./chunk-XXQUMVWH.js";import{b as Z}from"./chunk-BMQJ4CAO.js";import{a as fe,b as pe,c as ve,d as re,e as T,f as M}from"./chunk-MIQTKZAR.js";import{a as he}from"./chunk-LFXFP4IF.js";import{b as me}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as q}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as ce}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as $}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as ee}from"./chunk-AADXUXZO.js";import{f as de}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as D}from"./chunk-XQCVZAGU.js";import{d as H,h as J,i as ue,m as X}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as n,e as Y,f as Be,g as Ve,h as Ge,j as _}from"./chunk-3XIESWL4.js";var F=Y(Ve(),1);var b=Y(Be(),1);var t=Y(Ge(),1);var Ce=["trace","debug","log","info","warn","error","fatal"],Qe="LOG_ARCHIVE_NOT_CONFIGURED",Le={debug:"secondary",error:"destructive",fatal:"destructive",info:"outline",log:"outline",trace:"outline",warn:"secondary"},Ye={cursor:void 0,error:null,loading:!1,notConfigured:!1,rows:null},He=n((l,e)=>{switch(e.type){case"append":return{...l,cursor:e.cursor,error:null,loading:!1,rows:[...l.rows??[],...e.rows]};case"failed":return{cursor:void 0,error:e.message,loading:!1,notConfigured:!1,rows:null};case"loaded":return{cursor:e.cursor,error:null,loading:!1,notConfigured:!1,rows:e.rows};case"loading":return{...l,error:null,loading:!0,notConfigured:!1};case"notConfigured":return{cursor:void 0,error:null,loading:!1,notConfigured:!0,rows:null};case"pageFailed":return{...l,error:e.message,loading:!1};default:return l}},"Je"),Je=n(l=>{let e=(0,F.c)(33),{row:r}=l,o;e[0]!==r.fields?(o=z(r.fields),e[0]=r.fields,e[1]=o):o=e[1];let i=o,a=`lg-archive-row-${String(r.ts)}`,d;e[2]!==r.ts?(d=new Date(r.ts).toLocaleString(),e[2]=r.ts,e[3]=d):d=e[3];let m;e[4]!==d?(m=(0,t.jsx)(M,{className:"tabular-nums whitespace-nowrap text-xs text-muted-foreground",children:d}),e[4]=d,e[5]=m):m=e[5];let x=Le[r.level],u;e[6]!==r.level||e[7]!==x?(u=(0,t.jsx)(M,{children:(0,t.jsx)($,{variant:x,children:r.level})}),e[6]=r.level,e[7]=x,e[8]=u):u=e[8];let c;e[9]!==r.functionPath?(c=(0,t.jsx)(M,{className:"font-mono text-xs",children:r.functionPath}),e[9]=r.functionPath,e[10]=c):c=e[10];let w;e[11]!==r.message?(w=(0,t.jsx)("div",{className:"truncate",title:r.message,children:r.message}),e[11]=r.message,e[12]=w):w=e[12];let p;e[13]!==i?(p=i!==""&&(0,t.jsx)("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:i,children:i}),e[13]=i,e[14]=p):p=e[14];let h;e[15]!==w||e[16]!==p?(h=(0,t.jsxs)(M,{className:"max-w-md",children:[w,p]}),e[15]=w,e[16]=p,e[17]=h):h=e[17];let g=r.traceId??"\u2014",v;e[18]!==g?(v=(0,t.jsx)(M,{className:"font-mono text-[11px] text-muted-foreground",children:g}),e[18]=g,e[19]=v):v=e[19];let C=r.shardKey??"\u2014",f;e[20]!==C?(f=(0,t.jsx)(M,{className:"font-mono text-[11px] text-muted-foreground",children:C}),e[20]=C,e[21]=f):f=e[21];let y=r.userId??"\u2014",N;e[22]!==y?(N=(0,t.jsx)(M,{className:"font-mono text-[11px] text-muted-foreground",children:y}),e[22]=y,e[23]=N):N=e[23];let L;return e[24]!==h||e[25]!==v||e[26]!==f||e[27]!==N||e[28]!==a||e[29]!==m||e[30]!==u||e[31]!==c?(L=(0,t.jsxs)(re,{"data-testid":a,children:[m,u,c,h,v,f,N]}),e[24]=h,e[25]=v,e[26]=f,e[27]=N,e[28]=a,e[29]=m,e[30]=u,e[31]=c,e[32]=L):L=e[32],L},"Xe"),Xe=n(({shardKey:l})=>{let e=de(),r=H(),[o,i]=(0,b.useState)(""),[a,d]=(0,b.useState)(""),[m,x]=(0,b.useState)(""),[{cursor:u,error:c,loading:w,notConfigured:p,rows:h},g]=(0,b.useReducer)(He,Ye),v=U(o.trim(),400),C=U(a.trim(),400),f={...v===""?{}:{functionPathPrefix:v},...m===""?{}:{minLevel:m},...l===""?{}:{shardKey:l},...C===""?{}:{userId:C}},y=JSON.stringify(f),N=(0,b.useRef)(y);(0,b.useEffect)(()=>{let k={cancelled:!1};return N.current=y,X((async()=>{g({type:"loading"});try{let S=await e.queryLogArchive(f);k.cancelled||g({cursor:S.nextCursor,rows:S.rows,type:"loaded"})}catch(S){k.cancelled||g(ue(S)===Qe?{type:"notConfigured"}:{message:J(S),type:"failed"})}})()),()=>{k.cancelled=!0}},[e,y]);let L=n(async()=>{if(u===void 0)return;let k=y;g({type:"loading"});try{let S=await e.queryLogArchive({...f,cursor:u});N.current===k&&g({cursor:S.nextCursor,rows:S.rows,type:"append"})}catch(S){N.current===k&&g({message:J(S),type:"pageFailed"})}},"C"),P=n(k=>{i(k.target.value)},"R"),I=n(k=>{d(k.target.value)},"S"),R=n(k=>{x(k.target.value)},"I"),E=n(()=>{X(L())},"E");return p?(0,t.jsx)(D,{action:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline",href:te,rel:"noreferrer",target:"_blank",children:r("Open in Cloudflare")}),description:r("Wire pipelineLogSink to a Cloudflare Pipeline \u2192 R2 Data Catalog table and set R2_SQL_ACCOUNT_ID, R2_SQL_TOKEN, R2_SQL_BUCKET to browse the durable log archive here."),testId:"lg-archive-not-configured",title:r("Log archive not configured")}):(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lg-archive",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(q,{"aria-label":r("Function path prefix"),className:"h-8 w-48","data-testid":"lg-archive-path",onChange:P,placeholder:r("function path\u2026"),value:o}),(0,t.jsx)(q,{"aria-label":r("User id"),className:"h-8 w-40","data-testid":"lg-archive-user",onChange:I,placeholder:r("user id\u2026"),value:a}),(0,t.jsxs)("select",{"aria-label":r("Minimum level"),className:"h-8 rounded-md border border-border bg-background px-2 text-sm","data-testid":"lg-archive-min-level",onChange:R,value:m,children:[(0,t.jsx)("option",{value:"",children:r("min level")}),Ce.map(k=>(0,t.jsx)("option",{value:k,children:k},k))]})]}),c!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"lg-archive-error",role:"alert",children:c}),w&&h===null&&c===null&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"lg-archive-loading",children:r("Loading\u2026")}),h!==null&&h.length===0&&(0,t.jsx)(D,{description:r("No archived logs match these filters. The durable archive fills as pipelineLogSink flushes records to R2."),testId:"lg-archive-empty",title:r("No archived logs.")}),h!==null&&h.length>0&&(0,t.jsx)("div",{className:"overflow-hidden rounded-xl border border-border shadow-xs",children:(0,t.jsxs)(fe,{"data-testid":"lg-archive-table",children:[(0,t.jsx)(pe,{children:(0,t.jsxs)(re,{children:[(0,t.jsx)(T,{children:r("Time")}),(0,t.jsx)(T,{children:r("Level")}),(0,t.jsx)(T,{children:r("Function")}),(0,t.jsx)(T,{children:r("Message")}),(0,t.jsx)(T,{children:r("Trace")}),(0,t.jsx)(T,{children:r("Shard")}),(0,t.jsx)(T,{children:r("User")})]})}),(0,t.jsx)(ve,{children:h.map((k,S)=>(0,t.jsx)(Je,{row:k},`${String(k.ts)}-${String(S)}`))})]})}),u!==void 0&&(0,t.jsx)("div",{children:(0,t.jsx)(ce,{"data-testid":"lg-archive-more",disabled:w,onClick:E,size:"sm",variant:"outline",children:r(w?"Loading\u2026":"Load more")})})]})},"Ze"),ae=400,Ze=36,er={height:ae,overflow:"auto"},Se={left:0,position:"absolute",top:0,width:"100%"},rr={error:"destructive",ok:"secondary"},tr=n(l=>{let e=(0,F.c)(26),{entry:r,index:o,measureRef:i,start:a}=l,d=`translateY(${String(a)}px)`,m;e[0]!==d?(m={...Se,transform:d},e[0]=d,e[1]=m):m=e[1];let x=m,u;e[2]!==r.fields?(u=z(r.fields),e[2]=r.fields,e[3]=u):u=e[3];let c=u,w;e[4]!==r.timestamp?(w=new Date(r.timestamp).toLocaleString(),e[4]=r.timestamp,e[5]=w):w=e[5];let p;e[6]!==w?(p=(0,t.jsx)("span",{className:"w-44 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:w}),e[6]=w,e[7]=p):p=e[7];let h=Le[r.level],g;e[8]!==r.level||e[9]!==h?(g=(0,t.jsx)("span",{className:"w-20 shrink-0",role:"gridcell",children:(0,t.jsx)($,{variant:h,children:r.level})}),e[8]=r.level,e[9]=h,e[10]=g):g=e[10];let v=r.functionPath??"\u2014",C;e[11]!==v?(C=(0,t.jsx)("span",{className:"w-48 shrink-0 truncate text-muted-foreground",role:"gridcell",children:v}),e[11]=v,e[12]=C):C=e[12];let f;e[13]!==c?(f=c===""?null:(0,t.jsx)("span",{className:"ml-2 text-muted-foreground","data-testid":"lg-fields",children:c}),e[13]=c,e[14]=f):f=e[14];let y;e[15]!==r.message||e[16]!==f?(y=(0,t.jsxs)("span",{className:"flex-1 truncate",role:"gridcell",children:[r.message,f]}),e[15]=r.message,e[16]=f,e[17]=y):y=e[17];let N;return e[18]!==o||e[19]!==i||e[20]!==x||e[21]!==y||e[22]!==p||e[23]!==g||e[24]!==C?(N=(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":o,"data-testid":"lg-row",ref:i,role:"row",style:x,children:[p,g,C,y]}),e[18]=o,e[19]=i,e[20]=x,e[21]=y,e[22]=p,e[23]=g,e[24]=C,e[25]=N):N=e[25],N},"ar"),ye=n(l=>l.length===0?"\u2014":l.join(", "),"oe"),ar=n(l=>{let e=(0,F.c)(37),{entry:r,index:o,measureRef:i,start:a}=l,d=`translateY(${String(a)}px)`,m;e[0]!==d?(m={...Se,transform:d},e[0]=d,e[1]=m):m=e[1];let x=m,u;e[2]!==r.ts?(u=new Date(r.ts).toLocaleString(),e[2]=r.ts,e[3]=u):u=e[3];let c;e[4]!==u?(c=(0,t.jsx)("span",{className:"w-40 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:u}),e[4]=u,e[5]=c):c=e[5];let w=rr[r.outcome],p;e[6]!==r.outcome||e[7]!==w?(p=(0,t.jsx)("span",{className:"w-16 shrink-0",role:"gridcell",children:(0,t.jsx)($,{variant:w,children:r.outcome})}),e[6]=r.outcome,e[7]=w,e[8]=p):p=e[8];let h;e[9]!==r.functionPath?(h=(0,t.jsx)("span",{className:"w-44 shrink-0 truncate",role:"gridcell",title:r.functionPath,children:r.functionPath}),e[9]=r.functionPath,e[10]=h):h=e[10];let g=r.shardKey??"\u2014",v;e[11]!==g?(v=(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:g}),e[11]=g,e[12]=v):v=e[12];let C=r.userId??"\u2014",f;e[13]!==C?(f=(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:C}),e[13]=C,e[14]=f):f=e[14];let y;e[15]!==r.durationMs?(y=Math.round(r.durationMs),e[15]=r.durationMs,e[16]=y):y=e[16];let N=`${String(y)}ms`,L;e[17]!==N?(L=(0,t.jsx)("span",{className:"w-16 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:N}),e[17]=N,e[18]=L):L=e[18];let P;e[19]!==r.errorMessage||e[20]!==r.outcome||e[21]!==r.tablesRead||e[22]!==r.tablesWritten?(P=r.outcome==="error"&&r.errorMessage!==void 0?r.errorMessage:`r:${ye(r.tablesRead)} \xB7 w:${ye(r.tablesWritten)}`,e[19]=r.errorMessage,e[20]=r.outcome,e[21]=r.tablesRead,e[22]=r.tablesWritten,e[23]=P):P=e[23];let I;e[24]!==P?(I=(0,t.jsx)("span",{className:"flex-1 truncate text-muted-foreground",role:"gridcell",children:P}),e[24]=P,e[25]=I):I=e[25];let R;return e[26]!==o||e[27]!==i||e[28]!==x||e[29]!==f||e[30]!==L||e[31]!==I||e[32]!==c||e[33]!==p||e[34]!==h||e[35]!==v?(R=(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":o,"data-testid":"lg-req-row",ref:i,role:"row",style:x,children:[c,p,h,v,f,L,I]}),e[26]=o,e[27]=i,e[28]=x,e[29]=f,e[30]=L,e[31]=I,e[32]=c,e[33]=p,e[34]=h,e[35]=v,e[36]=R):R=e[36],R},"lr"),Ne=n(l=>{let{entries:e}=l??{};return Array.isArray(e)?e:[]},"se"),lr=n(l=>{let e={};return l.functionPathPrefix.trim()!==""&&(e.functionPathPrefix=l.functionPathPrefix.trim()),l.userId.trim()!==""&&(e.userId=l.userId.trim()),l.tableTouched.trim()!==""&&(e.tableTouched=l.tableTouched.trim()),(l.outcome==="ok"||l.outcome==="error")&&(e.outcome=l.outcome),e},"or"),Ie=Ce,sr={"5m":300*1e3,"15m":900*1e3,"1h":3600*1e3},or=n((l,e)=>{let r=e.search.trim().toLowerCase(),o=e.path.trim().toLowerCase(),i=e.range==="all"?Number.NEGATIVE_INFINITY:e.now-sr[e.range];return l.filter(a=>e.levels.size>0&&!e.levels.has(a.level)||a.timestamp<i||o!==""&&!(a.functionPath??"").toLowerCase().includes(o)?!1:r===""||a.message.toLowerCase().includes(r)||z(a.fields).toLowerCase().includes(r))},"nr"),nr="\u2014",ir=n(l=>{let e=new Map,r=new Map;for(let a of l){e.set(a.level,(e.get(a.level)??0)+1);let d=a.functionPath??nr;r.set(d,(r.get(d)??0)+1)}let o=Ie.filter(a=>e.has(a)).map(a=>({count:e.get(a)??0,key:a})),i=[...r.entries()].map(([a,d])=>({count:d,key:a})).toSorted((a,d)=>d.count===a.count?a.key.localeCompare(d.key):d.count-a.count);return{byLevel:o,byPath:i,total:l.length}},"dr"),dr=n(l=>{let e=(0,F.c)(11),{level:r,onToggle:o,selected:i}=l,a;e[0]!==r||e[1]!==o?(a=n(()=>{o(r)},"a"),e[0]=r,e[1]=o,e[2]=a):a=e[2];let d=a,m=i?"border-border bg-muted font-medium":"border-input text-muted-foreground",x;e[3]!==m?(x=_("rounded-md border px-2 py-1 text-xs",m),e[3]=m,e[4]=x):x=e[4];let u=`logs-level-${r}`,c;return e[5]!==r||e[6]!==d||e[7]!==i||e[8]!==x||e[9]!==u?(c=(0,t.jsx)("button",{"aria-pressed":i,className:x,"data-testid":u,onClick:d,type:"button",children:r}),e[5]=r,e[6]=d,e[7]=i,e[8]=x,e[9]=u,e[10]=c):c=e[10],c},"cr"),ke=n(l=>{let e=(0,F.c)(7),{bucket:r}=l,o;e[0]!==r.key?(o=(0,t.jsx)("span",{className:"truncate text-muted-foreground",role:"gridcell",children:r.key}),e[0]=r.key,e[1]=o):o=e[1];let i;e[2]!==r.count?(i=(0,t.jsx)("span",{className:"shrink-0 tabular-nums",role:"gridcell",children:r.count}),e[2]=r.count,e[3]=i):i=e[3];let a;return e[4]!==o||e[5]!==i?(a=(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 px-3 py-1 font-mono text-xs","data-testid":"logs-summary-row",role:"row",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a},"ne"),qr=n(({initialShardKey:l})=>{let e=H(),[r,o]=(0,b.useState)("requests"),[i,a]=(0,b.useState)(l??""),[d,m]=(0,b.useState)(""),[x,u]=(0,b.useState)(()=>new Set),[c,w]=(0,b.useState)(""),[p,h]=(0,b.useState)("all"),[g,v]=(0,b.useState)(!1),[C,f]=(0,b.useState)(""),[y,N]=(0,b.useState)(""),[L,P]=(0,b.useState)(""),[I,R]=(0,b.useState)("all"),E=U(i.trim(),400),k=lr({functionPathPrefix:C,outcome:I,tableTouched:L,userId:y}),S=Z(ee.getRequestLog,k,{enabled:r==="requests",live:!0,shardKey:E}),le=Z(ee.getLogs,{},{enabled:r==="errors",live:!0,shardKey:E}),W=r==="requests"?S:le,{error:se,errorSource:Pe,isLoading:oe,liveError:Re}=W,qe=Ne(le.data),ne=Ne(S.data);(0,b.useEffect)(()=>{W.data!==void 0&&me(E)},[W.data,E]);let j=or(qe,{levels:x,now:Date.now(),path:c,range:p,search:d}),B=ir(j),V=r==="requests"?ne.length:j.length,G=r==="errors"&&g,K=(0,b.useMemo)(()=>se!==null?"error":V===0?oe?G?"summary":"list":"empty":G?"summary":"list",[V,oe,se,G]),ie=(0,b.useRef)(null),A=xe({count:V,estimateSize:n(()=>Ze,"estimateSize"),getScrollElement:n(()=>ie.current,"getScrollElement"),initialRect:{height:ae,width:800},observeElementRect:n((s,Q)=>we(s,Q,ae),"observeElementRect"),overscan:8}),Te=A.getVirtualItems(),Me={height:A.getTotalSize(),position:"relative",width:"100%"},Ee=n(s=>{m(s.target.value)},"Ne"),_e=n(s=>{u(Q=>{let O=new Set(Q);return O.has(s)?O.delete(s):O.add(s),O})},"Le"),Fe=n(s=>{w(s.target.value)},"Ce"),Ke=n(s=>{h(s.target.value)},"ke"),Ae=n(()=>{v(s=>!s)},"$e"),Oe=n(s=>{f(s.target.value)},"Se"),$e=n(s=>{N(s.target.value)},"Re"),De=n(s=>{P(s.target.value)},"Ie"),Ue=n(s=>{R(s.target.value)},"Ee"),ze=n(()=>{o("requests"),v(!1)},"Pe"),We=n(()=>{o("errors"),v(!1)},"Te"),je=n(()=>{o("archive"),v(!1)},"_e");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-logs",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"inline-flex overflow-hidden rounded-lg border border-border",role:"tablist",children:[(0,t.jsx)("button",{"aria-selected":r==="requests",className:_("px-3 py-1 text-sm",r==="requests"?"bg-muted font-medium":"text-muted-foreground"),"data-testid":"lg-view-requests",onClick:ze,role:"tab",type:"button",children:e("Requests")}),(0,t.jsx)("button",{"aria-selected":r==="errors",className:_("px-3 py-1 text-sm",r==="errors"?"bg-muted font-medium":"text-muted-foreground"),"data-testid":"lg-view-errors",onClick:We,role:"tab",type:"button",children:e("Errors")}),(0,t.jsx)("button",{"aria-selected":r==="archive",className:_("px-3 py-1 text-sm",r==="archive"?"bg-muted font-medium":"text-muted-foreground"),"data-testid":"lg-view-archive",onClick:je,role:"tab",type:"button",children:e("Archive")})]}),(0,t.jsx)(he,{onChange:a,testId:"lg-shard-input",value:i}),r!=="archive"&&(0,t.jsx)(be,{message:Re,prefix:"lg"}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"lg-cf-link",href:te,rel:"noreferrer",target:"_blank",children:e("Open in Cloudflare")})]}),r==="errors"&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(q,{"aria-label":e("Search messages"),className:"h-8 w-48","data-testid":"lg-search",onChange:Ee,placeholder:e("search message"),value:d}),(0,t.jsx)(q,{"aria-label":e("Function path"),className:"h-8 w-40","data-testid":"logs-path-filter",onChange:Fe,placeholder:e("filter path"),value:c}),(0,t.jsx)("div",{"aria-label":e("Level filter"),className:"inline-flex items-center gap-1","data-testid":"logs-level-filter",role:"group",children:Ie.map(s=>(0,t.jsx)(dr,{level:s,onToggle:_e,selected:x.has(s)},s))}),(0,t.jsxs)("select",{"aria-label":e("Time range"),className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"logs-time-range",onChange:Ke,value:p,children:[(0,t.jsx)("option",{value:"all",children:e("All time")}),(0,t.jsx)("option",{value:"5m",children:e("Last 5m")}),(0,t.jsx)("option",{value:"15m",children:e("Last 15m")}),(0,t.jsx)("option",{value:"1h",children:e("Last hour")})]}),(0,t.jsx)("button",{"aria-pressed":g,className:_("h-8 rounded-md border px-3 text-sm",g?"border-border bg-muted font-medium":"border-input text-muted-foreground"),"data-testid":"logs-summary-toggle",onClick:Ae,type:"button",children:e(g?"List":"Summary")})]}),r==="requests"&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(q,{"aria-label":e("Function path"),className:"h-8 w-44","data-testid":"lg-req-path",onChange:Oe,placeholder:e("file:function"),value:C}),(0,t.jsx)(q,{"aria-label":e("User id"),className:"h-8 w-32","data-testid":"lg-req-user",onChange:$e,placeholder:e("userId"),value:y}),(0,t.jsx)(q,{"aria-label":e("Table touched"),className:"h-8 w-32","data-testid":"lg-req-table",onChange:De,placeholder:e("table"),value:L}),(0,t.jsxs)("select",{"aria-label":e("Outcome filter"),className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"lg-req-outcome",onChange:Ue,value:I,children:[(0,t.jsx)("option",{value:"all",children:e("all")}),(0,t.jsx)("option",{value:"ok",children:e("ok")}),(0,t.jsx)("option",{value:"error",children:e("error")})]})]}),r==="archive"?(0,t.jsx)(Xe,{shardKey:E}):(0,t.jsxs)(t.Fragment,{children:[K==="error"&&(0,t.jsx)(ge,{error:Pe,testId:"lg-error"}),K==="empty"&&(0,t.jsx)(D,{description:e("Function and request logs for this shard show up here as your app handles traffic."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 5h16M4 12h16M4 19h10"})}),testId:"lg-empty",title:e("No logs.")}),K==="summary"&&(0,t.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"logs-summary",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"logs-summary-total",children:e("{count} entries",{count:B.total})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:e("By level")}),(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-levels",role:"grid",children:B.byLevel.map(s=>(0,t.jsx)(ke,{bucket:s},s.key))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:e("By function")}),(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-paths",role:"grid",children:B.byPath.map(s=>(0,t.jsx)(ke,{bucket:s},s.key))})]})]}),K==="list"&&(0,t.jsx)("div",{className:"rounded-xl border border-border shadow-xs","data-testid":"lg-scroll",ref:ie,style:er,children:(0,t.jsx)("div",{"aria-label":e("Recent logs"),"data-testid":"lg-table",role:"grid",style:Me,children:Te.map(s=>r==="requests"?(0,t.jsx)(ar,{entry:ne[s.index],index:s.index,measureRef:A.measureElement,start:s.start},s.key):(0,t.jsx)(tr,{entry:j[s.index],index:s.index,measureRef:A.measureElement,start:s.start},s.key))})})]})]})},"qr");export{qr as LogsPanel,or as filterLogs,ir as summarizeLogs};
@@ -1 +0,0 @@
1
- import{a as U}from"./chunk-HK4OVYG3.js";import"./chunk-XXQUMVWH.js";import{b as K}from"./chunk-BMQJ4CAO.js";import{a as q,b as G,c as J,d as M,e as a,f as o}from"./chunk-MIQTKZAR.js";import{a as W,e as B}from"./chunk-UZERI5YC.js";import{R as V}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as F}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as O}from"./chunk-AADXUXZO.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as D}from"./chunk-XQCVZAGU.js";import{d as T,q as H}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as n,e as j,f as re,g as se,h as ie}from"./chunk-3XIESWL4.js";var X=j(se(),1),P=j(re(),1);var t=j(ie(),1);var ne=n(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","te"),Q=n(e=>e.endpoint??e.id,"P"),xe=n(()=>{let e=(0,X.c)(38),r=T(),[i,Y]=(0,P.useState)("all"),[l,Z]=(0,P.useState)(""),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let{data:_,error:c,errorSource:v,isLoading:I,refetch:x}=K(O.listPushSubscriptions,g),N;if(e[1]!==_?.subscriptions||e[2]!==c||e[3]!==v||e[4]!==I||e[5]!==i||e[6]!==x||e[7]!==l||e[8]!==r){let L=_?.subscriptions??[],z=l.trim().toLowerCase(),A=L.filter(s=>i!=="all"&&s.kind!==i?!1:z===""?!0:`${Q(s)} ${s.userId??""}`.toLowerCase().includes(z)),b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n(s=>{Z(s.target.value)},"b"),e[10]=b):b=e[10];let ee=b,w;e[11]!==x?(w=n(()=>{x()},"w"),e[11]=x,e[12]=w):w=e[12];let E=w,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=["all","web-push","fcm"],e[13]=k):k=e[13];let te=k,d;e[14]!==i||e[15]!==r?(d=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:te.map(s=>(0,t.jsx)(F,{"aria-selected":i===s,"data-testid":`nt-kind-${s}`,onClick:n(()=>{Y(s)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===s?"secondary":"ghost",children:s==="all"?r("All"):s},s))}),e[14]=i,e[15]=r,e[16]=d):d=e[16];let m;e[17]!==r?(m=r("Filter devices"),e[17]=r,e[18]=m):m=e[18];let h;e[19]!==r?(h=r("filter endpoint, user"),e[19]=r,e[20]=h):h=e[20];let u;e[21]!==l||e[22]!==m||e[23]!==h?(u=(0,t.jsx)(V,{"aria-label":m,className:"h-8 w-56","data-testid":"nt-search",onChange:ee,placeholder:h,value:l}),e[21]=l,e[22]=m,e[23]=h,e[24]=u):u=e[24];let f;e[25]!==r?(f=r("Refresh"),e[25]=r,e[26]=f):f=e[26];let p;e[27]!==E||e[28]!==f?(p=(0,t.jsx)(F,{className:"ml-auto","data-testid":"nt-refresh",onClick:E,size:"sm",type:"button",variant:"outline",children:f}),e[27]=E,e[28]=f,e[29]=p):p=e[29];let $=L.length>0&&(0,t.jsx)(C,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:L.length})}),y;e[30]!==p||e[31]!==$||e[32]!==d||e[33]!==u?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p,$]}),e[30]=p,e[31]=$,e[32]=d,e[33]=u,e[34]=y):y=e[34];let S;e[35]!==c||e[36]!==v?(S=c!==null&&(0,t.jsx)(U,{error:v,testId:"nt-error"}),e[35]=c,e[36]=v,e[37]=S):S=e[37],N=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[y,S,c===null&&!I&&A.length===0&&(0,t.jsx)(D,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&(0,t.jsx)(W,{className:"overflow-hidden py-0",children:(0,t.jsx)(B,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(q,{"data-testid":"nt-table",children:[(0,t.jsx)(G,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(a,{children:r("kind")}),(0,t.jsx)(a,{children:r("endpoint")}),(0,t.jsx)(a,{children:r("user")}),(0,t.jsx)(a,{children:r("last seen")}),(0,t.jsx)(a,{children:r("status")}),(0,t.jsx)(a,{children:r("error")})]})}),(0,t.jsx)(J,{children:A.map(s=>{let R=Q(s);return(0,t.jsxs)(M,{"data-testid":"nt-row",children:[(0,t.jsx)(o,{children:(0,t.jsx)(C,{variant:"outline",children:s.kind})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs",title:R,children:R}),(0,t.jsx)(o,{className:"max-w-[16ch] truncate font-mono text-xs",children:s.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(o,{className:"text-muted-foreground tabular-nums",children:H(s.lastSeenAt,"\u2014")}),(0,t.jsx)(o,{children:(0,t.jsx)(C,{"data-testid":`nt-status-${s.id}`,variant:ne(s.lastStatus),children:s.lastStatus??r("n/a")})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:s.lastError??void 0,children:s.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},s.id)})})]})})})]}),e[1]=_?.subscriptions,e[2]=c,e[3]=v,e[4]=I,e[5]=i,e[6]=x,e[7]=l,e[8]=r,e[9]=N}else N=e[9];return N},"ve");export{xe as NotificationsPanel};
@@ -1 +0,0 @@
1
- import{a as S}from"./chunk-HK4OVYG3.js";import"./chunk-XXQUMVWH.js";import{b as p}from"./chunk-BMQJ4CAO.js";import{a as C,b as K,c as j,d as m,e as n,f as o}from"./chunk-MIQTKZAR.js";import{a as A,e as k}from"./chunk-UZERI5YC.js";import{c as w}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as f}from"./chunk-AADXUXZO.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as T}from"./chunk-XQCVZAGU.js";import{d as z,q as B}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as i,e as U,f as W,h as X}from"./chunk-3XIESWL4.js";var D=U(W(),1);var e=U(X(),1);var F="agent_threads",Y="agent_messages",Z=100,ee=250,te={},ae={filters:[],limit:Z,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:F},l=i((s,t)=>{let a=s[t];return typeof a=="string"?a:void 0},"d"),I=i((s,t)=>{let a=s[t];return typeof a=="number"?a:void 0},"b"),M=i(s=>{let{usage:t}=s;if(t===null||typeof t!="object")return;let{totalTokens:a}=t;return typeof a=="number"?a:void 0},"z"),re=i(s=>{let{toolCalls:t}=s;return Array.isArray(t)?t.map(a=>a!==null&&typeof a=="object"?a.name:void 0).filter(a=>typeof a=="string"):[]},"ee"),se=i(s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},"te"),ne=i(s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},"ae"),fe=i(({initialShardKey:s=""})=>{let t=z(),[a,$]=(0,D.useState)(void 0),{data:x}=p(f.listTables,te,{live:!0,shardKey:s}),L=x!==void 0,u=Array.isArray(x)&&x.some(r=>r.name===F),{data:_,error:O,errorSource:R,liveError:G}=p(f.readTablePage,ae,{enabled:u,live:!0,shardKey:s}),H={filters:[{column:"threadKey",operator:"eq",value:a??""}],limit:ee,offset:0,orderBy:{column:"seq",direction:"asc"},skipCount:!0,table:Y},{data:q,error:J,errorSource:Q}=p(f.readTablePage,H,{enabled:u&&a!==void 0,live:!0,shardKey:s}),v=Array.isArray(_?.rows)?_.rows:[],E=Array.isArray(q?.rows)?q.rows:[],P=v.find(r=>l(r,"key")===a),h;return L&&!u?h=(0,e.jsx)(T,{description:t("No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents."),testId:"agents-unconfigured",title:t("No agents configured")}):u&&v.length===0?h=(0,e.jsx)(T,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):h=(0,e.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,e.jsx)(A,{className:"overflow-hidden py-0",children:(0,e.jsx)(k,{className:"px-0",children:(0,e.jsxs)(C,{"data-testid":"agents-threads-table",children:[(0,e.jsx)(K,{children:(0,e.jsxs)(m,{children:[(0,e.jsx)(n,{children:t("Agent")}),(0,e.jsx)(n,{children:t("Key")}),(0,e.jsx)(n,{children:t("Status")}),(0,e.jsx)(n,{children:t("Messages")}),(0,e.jsx)(n,{children:t("Tokens")}),(0,e.jsx)(n,{children:t("Updated")}),(0,e.jsx)(n,{"aria-label":t("Actions")})]})}),(0,e.jsx)(j,{children:v.map(r=>{let d=l(r,"key")??"",c=l(r,"status"),g=M(r);return(0,e.jsxs)(m,{"data-active":d===a?"":void 0,"data-testid":`agents-thread-${d}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:l(r,"agent")??"\u2014"}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:d}),(0,e.jsx)(o,{children:(0,e.jsx)(b,{"data-testid":`agents-thread-status-${d}`,variant:se(c),children:c??"\u2014"})}),(0,e.jsx)(o,{className:"tabular-nums",children:I(r,"messageCount")??"\u2014"}),(0,e.jsx)(o,{className:"tabular-nums text-muted-foreground",children:g??"\u2014"}),(0,e.jsx)(o,{className:"text-muted-foreground tabular-nums",children:B(I(r,"updatedAt"),"\u2014")}),(0,e.jsx)(o,{className:"text-right",children:(0,e.jsx)(w,{"data-testid":`agents-thread-open-${d}`,onClick:i(()=>{$(d)},"onClick"),size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},d)})})]})})}),J!==null&&(0,e.jsx)(S,{error:Q,testId:"agents-messages-error"}),a!==void 0&&(0,e.jsx)(A,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:(0,e.jsxs)(k,{className:"flex flex-col gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t("Timeline")," \xB7 ",a,P!==void 0&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",t("Usage"),": ",M(P)??0," ",t("Tokens")]})]}),(0,e.jsx)(w,{"data-testid":"agents-thread-detail-close",onClick:i(()=>{$(void 0)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),E.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):(0,e.jsxs)(C,{"data-testid":"agents-messages-table",children:[(0,e.jsx)(K,{children:(0,e.jsxs)(m,{children:[(0,e.jsx)(n,{children:t("Role")}),(0,e.jsx)(n,{children:t("Content")}),(0,e.jsx)(n,{children:t("Tool")}),(0,e.jsx)(n,{children:t("Approval")})]})}),(0,e.jsx)(j,{children:E.map((r,d)=>{let c=l(r,"role")??"\u2014",g=re(r),V=l(r,"toolName"),y=l(r,"status"),N=I(r,"seq")??d;return(0,e.jsxs)(m,{"data-testid":`agents-message-${String(N)}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs align-top text-muted-foreground",children:c}),(0,e.jsx)(o,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:l(r,"content")??"\u2014"}),(0,e.jsx)(o,{className:"font-mono text-xs align-top text-muted-foreground",children:V??(g.length>0?g.join(", "):"\u2014")}),(0,e.jsx)(o,{className:"align-top",children:y===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"}):(0,e.jsx)(b,{"data-testid":`agents-message-approval-${String(N)}`,variant:ne(y),children:y})})]},l(r,"messageKey")??`${c}:${String(N)}`)})})]})]})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[O!==null&&(0,e.jsx)(S,{error:R,testId:"agents-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.")}),G!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),h]})},"pe");export{fe as AgentsPanel};
@@ -1,6 +0,0 @@
1
- import{a as I,b as R,c as A,d as B,e as U,f as L,g as E,h as M}from"./chunk-XQGANNLS.js";import{a as q}from"./chunk-ESVP44Y3.js";import{a as _}from"./chunk-7LQWFOEU.js";import{d as j,l as D,o as J}from"./chunk-4CGALXS3.js";import{a as x,e as O,f as z,g as G,h as K}from"./chunk-3XIESWL4.js";var k=O(G(),1),Q=O(z(),1);var a=O(K(),1);var $="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",W=/["\n,]/u,X=/^[=+\-@\t\r]/u,F=x(n=>{if(n==null)return"";let e;return typeof n=="string"?e=X.test(n)?` ${n}`:n:typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?e=String(n):e=JSON.stringify(n),W.test(e)?`"${e.replaceAll('"','""')}"`:e},"A"),Y=x((n,e)=>{let l=n.map(r=>F(r)).join(","),o=e.map(r=>n.map(t=>F(r[t])).join(","));return[l,...o].join(`
2
- `)},"Y"),Z=x(n=>JSON.stringify(n,null,2),"Z"),H=500,P=x(n=>`"${n.replaceAll('"','""')}"`,"R"),ee=x(n=>n==null?"NULL":typeof n=="number"?Number.isFinite(n)?String(n):"NULL":typeof n=="bigint"?String(n):typeof n=="boolean"?n?"1":"0":`'${(typeof n=="string"?n:JSON.stringify(n)).replaceAll("'","''")}'`,"z"),te=x((n,e,l)=>{if(e.length===0||l.length===0)return"";let o=e.map(t=>P(t)).join(", "),r=[];for(let t=0;t<l.length;t+=H){let i=l.slice(t,t+H).map(u=>` (${e.map(s=>ee(u[s])).join(", ")})`).join(`,
3
- `);r.push(`INSERT INTO ${P(n)} (${o}) VALUES
4
- ${i};`)}return r.join(`
5
-
6
- `)},"K"),V=x((n,e,l)=>{if(!("document"in globalThis))return;let o=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:l})),r=globalThis.document.createElement("a");r.href=o,r.download=n,globalThis.document.body.append(r),r.click(),r.remove(),globalThis.URL.revokeObjectURL(o)},"O"),le=x(n=>{let e=(0,k.c)(36),{columns:l,name:o,rows:r}=n,t=j(),i;e[0]!==l||e[1]!==o||e[2]!==r?(i=x(()=>{V(`${o}.csv`,Y(l,r),"text/csv;charset=utf-8")},"i"),e[0]=l,e[1]=o,e[2]=r,e[3]=i):i=e[3];let u=i,s;e[4]!==o||e[5]!==r?(s=x(()=>{V(`${o}.json`,Z(r),"application/json")},"s"),e[4]=o,e[5]=r,e[6]=s):s=e[6];let m=s,c;e[7]!==l||e[8]!==o||e[9]!==r?(c=x(()=>{V(`${o}.sql`,te(o,l,r),"application/sql;charset=utf-8")},"a"),e[7]=l,e[8]=o,e[9]=r,e[10]=c):c=e[10];let p=c,d=r.length===0,g;e[11]!==d?(g=(0,a.jsx)(R,{className:$,"data-testid":"grid-export",disabled:d,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[11]=d,e[12]=g):g=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=(0,a.jsx)(U,{children:"Export loaded rows"}),e[13]=C):C=e[13];let h;e[14]!==t?(h=t("CSV"),e[14]=t,e[15]=h):h=e[15];let f;e[16]!==u||e[17]!==h?(f=(0,a.jsx)(L,{"data-testid":"grid-export-csv",onClick:u,children:h}),e[16]=u,e[17]=h,e[18]=f):f=e[18];let b;e[19]!==t?(b=t("JSON"),e[19]=t,e[20]=b):b=e[20];let y;e[21]!==m||e[22]!==b?(y=(0,a.jsx)(L,{"data-testid":"grid-export-json",onClick:m,children:b}),e[21]=m,e[22]=b,e[23]=y):y=e[23];let w;e[24]!==t?(w=t("SQL"),e[24]=t,e[25]=w):w=e[25];let N;e[26]!==p||e[27]!==w?(N=(0,a.jsx)(L,{"data-testid":"grid-export-sql",onClick:p,children:w}),e[26]=p,e[27]=w,e[28]=N):N=e[28];let v;e[29]!==y||e[30]!==N||e[31]!==f?(v=(0,a.jsxs)(A,{align:"end",children:[C,f,y,N]}),e[29]=y,e[30]=N,e[31]=f,e[32]=v):v=e[32];let S;return e[33]!==v||e[34]!==g?(S=(0,a.jsxs)(I,{children:[g,v]}),e[33]=v,e[34]=g,e[35]=S):S=e[35],S},"W"),ne=x(n=>{let e=(0,k.c)(9),{column:l}=n,o;e[0]!==l?(o=x(()=>{l.toggleVisibility()},"n"),e[0]=l,e[1]=o):o=e[1];let r=o,t;e[2]!==l?(t=l.getIsVisible(),e[2]=l,e[3]=t):t=e[3];let i=`grid-column-${l.id}`,u;return e[4]!==l.id||e[5]!==r||e[6]!==t||e[7]!==i?(u=(0,a.jsx)(E,{checked:t,closeOnClick:!1,"data-testid":i,onCheckedChange:r,children:l.id}),e[4]=l.id,e[5]=r,e[6]=t,e[7]=i,e[8]=u):u=e[8],u},"X"),oe=x(n=>{let e=(0,k.c)(30),{table:l}=n,o=j(),r;e[0]!==l?(r=l.getIsAllColumnsVisible(),e[0]=l,e[1]=r):r=e[1];let t=r,i;e[2]!==t||e[3]!==l?(i=x(()=>{l.toggleAllColumnsVisible(!t)},"i"),e[2]=t,e[3]=l,e[4]=i):i=e[4];let u=i,s;e[5]!==o?(s=o("Columns"),e[5]=o,e[6]=s):s=e[6];let m;e[7]!==s?(m=(0,a.jsx)(R,{className:$,"data-testid":"grid-columns",children:s}),e[7]=s,e[8]=m):m=e[8];let c;e[9]!==o?(c=o("Columns"),e[9]=o,e[10]=c):c=e[10];let p;e[11]!==c?(p=(0,a.jsx)(U,{children:c}),e[11]=c,e[12]=p):p=e[12];let d;e[13]!==t||e[14]!==o?(d=o(t?"Hide all":"Show all"),e[13]=t,e[14]=o,e[15]=d):d=e[15];let g;e[16]!==t||e[17]!==u||e[18]!==d?(g=(0,a.jsx)(E,{checked:t,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:u,children:d}),e[16]=t,e[17]=u,e[18]=d,e[19]=g):g=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,a.jsx)(M,{}),e[20]=C):C=e[20];let h;e[21]!==l?(h=l.getAllLeafColumns().map(se),e[21]=l,e[22]=h):h=e[22];let f;e[23]!==h||e[24]!==p||e[25]!==g?(f=(0,a.jsx)(A,{align:"end",className:"max-h-80 overflow-y-auto",children:(0,a.jsxs)(B,{children:[p,g,C,h]})}),e[23]=h,e[24]=p,e[25]=g,e[26]=f):f=e[26];let b;return e[27]!==f||e[28]!==m?(b=(0,a.jsxs)(I,{children:[m,f]}),e[27]=f,e[28]=m,e[29]=b):b=e[29],b},"ee"),re=x(n=>{let e=(0,k.c)(19),{count:l,editable:o,onClear:r,onDelete:t}=n,i=j(),u;e[0]!==l||e[1]!==i?(u=i("{count} selected",{count:l}),e[0]=l,e[1]=i,e[2]=u):u=e[2];let s;e[3]!==u?(s=(0,a.jsx)("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:u}),e[3]=u,e[4]=s):s=e[4];let m;e[5]!==i?(m=i("Clear"),e[5]=i,e[6]=m):m=e[6];let c;e[7]!==r||e[8]!==m?(c=(0,a.jsx)("button",{className:$,"data-testid":"grid-selection-clear",onClick:r,type:"button",children:m}),e[7]=r,e[8]=m,e[9]=c):c=e[9];let p;e[10]!==l||e[11]!==o||e[12]!==t||e[13]!==i?(p=o&&(0,a.jsx)(_,{confirmLabel:i("Delete {count} rows?",{count:l}),onConfirm:t,testId:"grid-selection-delete",children:i("Delete {count}",{count:l})}),e[10]=l,e[11]=o,e[12]=t,e[13]=i,e[14]=p):p=e[14];let d;return e[15]!==s||e[16]!==c||e[17]!==p?(d=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[s,c,p]}),e[15]=s,e[16]=c,e[17]=p,e[18]=d):d=e[18],d},"te"),pe=x(n=>{let e=(0,k.c)(32),{column:l,onClose:o,value:r}=n,t=j(),[i,u]=(0,Q.useState)(!1),s;e[0]!==r?(s=D(r),e[0]=r,e[1]=s):s=e[1];let m=s,c;e[2]!==m?(c=x(()=>{J(m)&&u(!0)},"a"),e[2]=m,e[3]=c):c=e[3];let p=c,d;e[4]!==t?(d=t("Cell value"),e[4]=t,e[5]=d):d=e[5];let g;e[6]!==l?(g=(0,a.jsx)("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:l}),e[6]=l,e[7]=g):g=e[7];let C;e[8]!==i||e[9]!==t?(C=t(i?"Copied":"Copy"),e[8]=i,e[9]=t,e[10]=C):C=e[10];let h;e[11]!==p||e[12]!==C?(h=(0,a.jsx)("button",{className:$,"data-testid":"grid-cell-copy",onClick:p,type:"button",children:C}),e[11]=p,e[12]=C,e[13]=h):h=e[13];let f;e[14]!==t?(f=t("Close"),e[14]=t,e[15]=f):f=e[15];let b;e[16]!==o||e[17]!==f?(b=(0,a.jsx)("button",{className:$,"data-testid":"grid-cell-close",onClick:o,type:"button",children:f}),e[16]=o,e[17]=f,e[18]=b):b=e[18];let y;e[19]!==h||e[20]!==b?(y=(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[h,b]}),e[19]=h,e[20]=b,e[21]=y):y=e[21];let w;e[22]!==g||e[23]!==y?(w=(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[g,y]}),e[22]=g,e[23]=y,e[24]=w):w=e[24];let N;e[25]!==m?(N=(0,a.jsx)("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:m}),e[25]=m,e[26]=N):N=e[26];let v;return e[27]!==o||e[28]!==w||e[29]!==N||e[30]!==d?(v=(0,a.jsxs)(q,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:d,onClose:o,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[w,N]}),e[27]=o,e[28]=w,e[29]=N,e[30]=d,e[31]=v):v=e[31],v},"ue"),ge=x(n=>{let e=(0,k.c)(33),{columns:l,editable:o,name:r,onBulkDelete:t,onToggleTranspose:i,rows:u,table:s,transposed:m}=n,c=j(),p;e[0]!==s?(p=s.getSelectedRowModel(),e[0]=s,e[1]=p):p=e[1];let d=p.rows,g;e[2]!==s?(g=x(()=>{s.resetRowSelection()},"p"),e[2]=s,e[3]=g):g=e[3];let C=g,h;e[4]!==t||e[5]!==d||e[6]!==s?(h=x(()=>{t(d.map(ie)),s.resetRowSelection()},"g"),e[4]=t,e[5]=d,e[6]=s,e[7]=h):h=e[7];let f=h,b;e[8]!==l||e[9]!==r||e[10]!==u?(b=(0,a.jsx)(le,{columns:l,name:r,rows:u}),e[8]=l,e[9]=r,e[10]=u,e[11]=b):b=e[11];let y;e[12]!==s?(y=(0,a.jsx)(oe,{table:s}),e[12]=s,e[13]=y):y=e[13];let w;e[14]!==c?(w=c("Swap rows and columns"),e[14]=c,e[15]=w):w=e[15];let N;e[16]!==c?(N=c("Transpose"),e[16]=c,e[17]=N):N=e[17];let v;e[18]!==i||e[19]!==w||e[20]!==N||e[21]!==m?(v=(0,a.jsx)("button",{"aria-pressed":m,className:$,"data-testid":"grid-transpose",onClick:i,title:w,type:"button",children:N}),e[18]=i,e[19]=w,e[20]=N,e[21]=m,e[22]=v):v=e[22];let S;e[23]!==o||e[24]!==C||e[25]!==f||e[26]!==d.length?(S=d.length>0&&(0,a.jsx)(re,{count:d.length,editable:o,onClear:C,onDelete:f}),e[23]=o,e[24]=C,e[25]=f,e[26]=d.length,e[27]=S):S=e[27];let T;return e[28]!==b||e[29]!==y||e[30]!==v||e[31]!==S?(T=(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[b,y,v,S]}),e[28]=b,e[29]=y,e[30]=v,e[31]=S,e[32]=T):T=e[32],T},"pe");function se(n){return(0,a.jsx)(ne,{column:n},n.id)}x(se,"le");function ie(n){return n.id}x(ie,"oe");export{le as a,re as b,pe as c,ge as d};
@@ -1 +0,0 @@
1
- import{a as z}from"./chunk-54MMVNPT.js";import{a as B}from"./chunk-LFKCLLPT.js";import{a as H}from"./chunk-HK4OVYG3.js";import"./chunk-XXQUMVWH.js";import{b as E}from"./chunk-BMQJ4CAO.js";import{a as O,b as U,c as q,d as j,e as T,f as D}from"./chunk-MIQTKZAR.js";import{a as K}from"./chunk-UZERI5YC.js";import{a as W}from"./chunk-LFXFP4IF.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as M}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as L}from"./chunk-AADXUXZO.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as A}from"./chunk-XQCVZAGU.js";import{d as _}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as S,e as F,f as X,g as Y,h as Q}from"./chunk-3XIESWL4.js";var P=F(Y(),1),V=F(X(),1);var t=F(Q(),1);var G=S(n=>`${n.toString()} ms`,"E"),Z=S(n=>n.totalConnections===0&&n.shapePoke.passes===0&&n.whisper.passes===0,"G"),w=S(n=>{let e=(0,P.c)(8),{label:r,testId:a,value:l}=n,o;e[0]!==r?(o=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[0]=r,e[1]=o):o=e[1];let i;e[2]!==a||e[3]!==l?(i=(0,t.jsx)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":a,children:l}),e[2]=a,e[3]=l,e[4]=i):i=e[4];let h;return e[5]!==o||e[6]!==i?(h=(0,t.jsx)(K,{className:"gap-0 py-0",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[o,i]})}),e[5]=o,e[6]=i,e[7]=h):h=e[7],h},"R"),J=S(n=>{let e=(0,P.c)(48),{counters:r,includeTiming:a,prefix:l,t:o,title:i}=n,h=`${l}-section`,x;e[0]!==i?(x=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:i}),e[0]=i,e[1]=x):x=e[1];let b=`${l}-stats`,s;e[2]!==o?(s=o("Passes"),e[2]=o,e[3]=s):s=e[3];let c=`${l}-passes`,k;e[4]!==r.passes||e[5]!==s||e[6]!==c?(k=(0,t.jsx)(w,{label:s,testId:c,value:r.passes}),e[4]=r.passes,e[5]=s,e[6]=c,e[7]=k):k=e[7];let N;e[8]!==o?(N=o("Sockets iterated"),e[8]=o,e[9]=N):N=e[9];let I=`${l}-iterated`,d;e[10]!==r.socketsIterated||e[11]!==N||e[12]!==I?(d=(0,t.jsx)(w,{label:N,testId:I,value:r.socketsIterated}),e[10]=r.socketsIterated,e[11]=N,e[12]=I,e[13]=d):d=e[13];let m;e[14]!==o?(m=o("Delivered"),e[14]=o,e[15]=m):m=e[15];let v=`${l}-delivered`,u;e[16]!==r.socketsDelivered||e[17]!==m||e[18]!==v?(u=(0,t.jsx)(w,{label:m,testId:v,value:r.socketsDelivered}),e[16]=r.socketsDelivered,e[17]=m,e[18]=v,e[19]=u):u=e[19];let p;e[20]!==o?(p=o("Peak width"),e[20]=o,e[21]=p):p=e[21];let y=`${l}-peak`,f;e[22]!==r.peakSocketsIterated||e[23]!==p||e[24]!==y?(f=(0,t.jsx)(w,{label:p,testId:y,value:r.peakSocketsIterated}),e[22]=r.peakSocketsIterated,e[23]=p,e[24]=y,e[25]=f):f=e[25];let g;e[26]!==r.totalMs||e[27]!==a||e[28]!==l||e[29]!==o?(g=a&&(0,t.jsx)(w,{label:o("Total time"),testId:`${l}-total-ms`,value:G(r.totalMs)}),e[26]=r.totalMs,e[27]=a,e[28]=l,e[29]=o,e[30]=g):g=e[30];let C;e[31]!==r.maxMs||e[32]!==a||e[33]!==l||e[34]!==o?(C=a&&(0,t.jsx)(w,{label:o("Max time"),testId:`${l}-max-ms`,value:G(r.maxMs)}),e[31]=r.maxMs,e[32]=a,e[33]=l,e[34]=o,e[35]=C):C=e[35];let $;e[36]!==u||e[37]!==f||e[38]!==g||e[39]!==C||e[40]!==b||e[41]!==k||e[42]!==d?($=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":b,children:[k,d,u,f,g,C]}),e[36]=u,e[37]=f,e[38]=g,e[39]=C,e[40]=b,e[41]=k,e[42]=d,e[43]=$):$=e[43];let R;return e[44]!==h||e[45]!==$||e[46]!==x?(R=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":h,children:[x,$]}),e[44]=h,e[45]=$,e[46]=x,e[47]=R):R=e[47],R},"F"),ue=S(n=>{let e=(0,P.c)(32),{initialShardKey:r}=n,a=_(),[l,o]=(0,V.useState)(r??""),i;e[0]!==l?(i=l.trim(),e[0]=l,e[1]=i):i=e[1];let h=B(i,400),x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x={},e[2]=x):x=e[2];let b;e[3]!==h?(b={keepPreviousData:!0,shardKey:h},e[3]=h,e[4]=b):b=e[4];let{data:s,error:c,errorSource:k,refetch:N}=E(L.getFanoutMetrics,x,b);z(N,!0);let I;e[5]!==s?(I=s!==void 0&&Z(s),e[5]=s,e[6]=I):I=e[6];let d=I,m;e[7]!==l?(m=(0,t.jsx)(W,{onChange:o,testId:"fanout-shard-input",value:l}),e[7]=l,e[8]=m):m=e[8];let v;e[9]!==s||e[10]!==a?(v=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"fanout-count",children:[s.promoted&&(0,t.jsx)(M,{"data-testid":"fanout-promoted",variant:s.relayCount>=s.maxRelays?"destructive":"default",children:s.relayCount>=s.maxRelays?a("auto-scaled: {relayCount}/{maxRelays} relays (at ceiling)",{maxRelays:s.maxRelays,relayCount:s.relayCount}):a("auto-scaled: {relayCount}/{maxRelays} relays",{maxRelays:s.maxRelays,relayCount:s.relayCount})}),(0,t.jsx)(M,{variant:"secondary",children:a("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(M,{variant:"secondary",children:a("peak {count} subscribers",{count:s.peakSubscribers})})]}),e[9]=s,e[10]=a,e[11]=v):v=e[11];let u;e[12]!==m||e[13]!==v?(u=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[m,v]}),e[12]=m,e[13]=v,e[14]=u):u=e[14];let p;e[15]!==c||e[16]!==k?(p=c!==null&&(0,t.jsx)(H,{error:k,testId:"fanout-error"}),e[15]=c,e[16]=k,e[17]=p):p=e[17];let y;e[18]!==c||e[19]!==d||e[20]!==a?(y=c===null&&d&&(0,t.jsx)(A,{description:a("Realtime fan-out cost and per-topic subscriber counts for this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 12h4l3 7 4-14 3 7h2"})}),testId:"fanout-empty",title:a("No fan-out activity yet.")}),e[18]=c,e[19]=d,e[20]=a,e[21]=y):y=e[21];let f;e[22]!==c||e[23]!==d||e[24]!==s||e[25]!==a?(f=c===null&&s!==void 0&&!d&&(0,t.jsxs)(t.Fragment,{children:[s.topics.length>0&&(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-topics-section",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:a("Hot topics")}),(0,t.jsx)(K,{className:"overflow-hidden py-0",children:(0,t.jsxs)(O,{"data-testid":"fanout-topics-table",children:[(0,t.jsx)(U,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(T,{children:a("Topic")}),(0,t.jsx)(T,{children:a("Kind")}),(0,t.jsx)(T,{className:"text-right",children:a("Subscribers")})]})}),(0,t.jsx)(q,{children:s.topics.map(ee)})]})})]}),(0,t.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"fanout-cost",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:a("Fan-out cost since this instance woke")}),(0,t.jsx)(J,{counters:s.shapePoke,includeTiming:!0,prefix:"fanout-poke",t:a,title:a("Shape pokes")}),(0,t.jsx)(J,{counters:s.whisper,includeTiming:!1,prefix:"fanout-whisper",t:a,title:a("Whisper broadcasts")})]})]}),e[22]=c,e[23]=d,e[24]=s,e[25]=a,e[26]=f):f=e[26];let g;return e[27]!==f||e[28]!==u||e[29]!==p||e[30]!==y?(g=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"fanout-panel",children:[u,p,y,f]}),e[27]=f,e[28]=u,e[29]=p,e[30]=y,e[31]=g):g=e[31],g},"ue");function ee(n){return(0,t.jsxs)(j,{"data-testid":"fanout-topic-row",children:[(0,t.jsx)(D,{className:"font-mono text-xs",children:n.topic}),(0,t.jsx)(D,{children:(0,t.jsx)(M,{variant:"outline",children:n.kind})}),(0,t.jsx)(D,{className:"text-right font-medium tabular-nums",children:n.subscribers})]},`${n.kind}:${n.topic}`)}S(ee,"J");export{ue as default};
@@ -1 +0,0 @@
1
- import{h as o,m as n}from"./chunk-4CGALXS3.js";import{a as r,e as f,f as i}from"./chunk-3XIESWL4.js";var t=f(i(),1);var y=r(()=>{let[u,a]=(0,t.useState)(!1),[e,s]=(0,t.useState)(null);return{busy:u,error:e,run:r(l=>{n((async()=>{a(!0),s(null);try{await l()}catch(c){s(o(c))}finally{a(!1)}})())},"run")}},"c");export{y as a};
@@ -1 +0,0 @@
1
- import{b as ee}from"./chunk-BMQJ4CAO.js";import{a as z,b as D,c as F,d as w,e as l,f as o}from"./chunk-MIQTKZAR.js";import{a as E,e as j}from"./chunk-UZERI5YC.js";import{a as te}from"./chunk-V53KNYRN.js";import{R as Z}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as I}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{a as K}from"./chunk-AADXUXZO.js";import{f as G}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as P}from"./chunk-XQCVZAGU.js";import{d as H,f as Q,g as V,h as W,m as $}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as n,e as Y,f as ne,h as le}from"./chunk-3XIESWL4.js";var i=Y(ne(),1);var e=Y(le(),1);var oe=["queued","running","paused","waiting","complete","errored","terminated"],ie=["pause","resume","terminate"],de="WORKFLOWS_NOT_CONFIGURED",ce=n(c=>typeof c=="object"&&c!==null&&c.code===de,"de"),me=n(c=>{let r=c.error??c.output;if(r===void 0)return"\u2014";try{return JSON.stringify(r)}catch{return"(unserializable)"}},"ce"),ue=n(({loadDetail:c,loadInstances:r,readOnly:b,runAction:_,workflowName:h})=>{let A=G(),s=H(),[N,g]=(0,i.useState)(null),[S,O]=(0,i.useState)(null),[k,J]=(0,i.useState)(""),[v,p]=(0,i.useState)(null),[L,C]=(0,i.useState)(!1),[R,U]=(0,i.useState)(null),f=c??(a=>A.getWorkflowInstance(a)),x=b?void 0:_??(r===void 0?a=>A.setWorkflowInstanceStatus(a):void 0),T=n(async()=>{p(null),C(!1);let a=k===""?void 0:k;try{if(r===void 0){let d=await A.listWorkflowInstances({name:h,status:a});if(d.configured===!1){g(null),C(!0);return}g(d.instances);return}g(await r({name:h,status:a}))}catch(d){g(null),ce(d)?C(!0):p(W(d))}},"O");(0,i.useEffect)(()=>{O(null),$(T())},[h,k]);let q=n(async a=>{p(null);try{O(await f({id:a,name:h}))}catch(d){p(W(d))}},"D"),M=n(async(a,d)=>{if(x!==void 0){U(a),p(null);try{await x({action:d,id:a,name:h}),await T()}catch(B){p(W(B))}finally{U(null)}}},"q");return(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:s("Instance history")}),(0,e.jsxs)("select",{"aria-label":s("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:n(a=>{J(a.target.value)},"onChange"),value:k,children:[(0,e.jsx)("option",{value:"",children:s("All statuses")}),oe.map(a=>(0,e.jsx)("option",{value:a,children:a},a))]})]}),v!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:v}),L&&(0,e.jsx)(P,{description:s("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:s("Workflow inspection not configured")}),!L&&N!==null&&N.length===0&&(0,e.jsx)(P,{description:s("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:s("No instances")}),N!==null&&N.length>0&&(0,e.jsx)(E,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflow-instances-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(w,{children:[(0,e.jsx)(l,{children:s("Instance id")}),(0,e.jsx)(l,{children:s("Status")}),(0,e.jsx)(l,{children:s("Created")}),(0,e.jsx)(l,{children:s("Ended")}),(0,e.jsx)(l,{"aria-label":s("Actions")})]})}),(0,e.jsx)(F,{children:N.map(a=>(0,e.jsxs)(w,{"data-testid":`workflow-instance-${a.id}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:a.id}),(0,e.jsx)(o,{className:"font-mono text-xs",children:a.status}),(0,e.jsx)(o,{className:"text-muted-foreground tabular-nums",children:a.createdOn??"\u2014"}),(0,e.jsx)(o,{className:"text-muted-foreground tabular-nums",children:a.endedOn??"\u2014"}),(0,e.jsx)(o,{className:"text-right",children:(0,e.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,e.jsx)(I,{"data-testid":`workflow-instance-steps-${a.id}`,onClick:n(()=>{$(q(a.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:s("Steps")}),x!==void 0&&ie.map(d=>(0,e.jsx)(I,{"data-testid":`workflow-instance-${d}-${a.id}`,disabled:R===a.id,onClick:n(()=>{$(M(a.id,d))},"onClick"),size:"sm",type:"button",variant:"ghost",children:s(d)},d))]})})]},a.id))})]})})}),S!==null&&(0,e.jsx)(E,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,e.jsxs)(j,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[s("Steps")," \xB7 ",S.id]}),(0,e.jsx)(I,{"data-testid":"workflow-instance-detail-close",onClick:n(()=>{O(null)},"onClick"),size:"xs",type:"button",variant:"ghost",children:s("Close")})]}),S.steps.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:s("This instance has no recorded steps yet.")}):(0,e.jsxs)(z,{"data-testid":"workflow-instance-steps",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(w,{children:[(0,e.jsx)(l,{children:s("Step")}),(0,e.jsx)(l,{children:s("Type")}),(0,e.jsx)(l,{children:s("Attempts")}),(0,e.jsx)(l,{children:s("Started")}),(0,e.jsx)(l,{children:s("Output")})]})}),(0,e.jsx)(F,{children:S.steps.map((a,d)=>(0,e.jsxs)(w,{"data-testid":`workflow-step-${String(d)}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:a.name}),(0,e.jsx)(o,{className:"text-xs text-muted-foreground",children:a.type??"\u2014"}),(0,e.jsx)(o,{className:"tabular-nums",children:a.attempts??"\u2014"}),(0,e.jsx)(o,{className:"text-muted-foreground tabular-nums",children:a.start??"\u2014"}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:me(a)})]},`${a.name}:${String(d)}`))})]})]})})]})},"me"),fe=Q(K.createWorkflowInstance),he=Q(K.getWorkflowInstanceStatus),pe=n(c=>{if(c.error)return`${c.error.name}: ${c.error.message}`;if(c.output===void 0)return"\u2014";try{return JSON.stringify(c.output)}catch{return"(unserializable)"}},"he"),Ie=n(()=>{let c=G(),r=H(),{data:b,error:_}=ee(K.listWorkflows,{}),[h,A]=(0,i.useState)(""),[s,N]=(0,i.useState)(""),[g,S]=(0,i.useState)(""),[O,k]=(0,i.useState)(!1),[J,v]=(0,i.useState)(null),[p,L]=(0,i.useState)([]),[C,R]=(0,i.useState)(null),U=b!==void 0,f=(0,i.useMemo)(()=>Array.isArray(b?.workflows)?[...b.workflows].toSorted((t,u)=>t.exportName.localeCompare(u.exportName)):[],[b]),x=(0,i.useMemo)(()=>f.some(t=>t.exportName===h)?h:f[0]?.exportName??"",[f,h]),T=(0,i.useMemo)(()=>f.find(t=>t.exportName===x),[f,x]),q=n(t=>{L(u=>{let m=u.filter(y=>!(y.exportName===t.exportName&&y.id===t.id));return[t,...m]})},"D"),M=n(async()=>{let t=x;if(t==="")return;let u,m=g.trim();if(m!=="")try{u=JSON.parse(m)}catch{v(r("Params must be valid JSON"));return}k(!0),v(null);try{let y=s.trim(),X=await c.query(fe,{exportName:t,id:y===""?void 0:y,params:u},V(""));q({exportName:t,id:X.id,status:X.status}),N("")}catch(y){v(W(y))}finally{k(!1)}},"q"),a=n(()=>{$(M())},"a"),d=n(async(t,u)=>{R(u);try{let m=await c.query(he,{exportName:t,id:u},V(""));q({error:m.error,exportName:t,id:m.id,output:m.output,status:m.status})}catch(m){v(W(m))}finally{R(null)}},"l"),B=n(t=>{A(t.target.value)},"M"),ae=n(t=>{N(t.target.value)},"Z"),re=n(t=>{S(t.target.value)},"ee"),se=n(t=>{let{export:u,id:m}=t.currentTarget.dataset;u!==void 0&&m!==void 0&&$(d(u,m))},"te");return(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[_!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:_}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:r("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),U&&f.length===0?(0,e.jsx)(P,{description:r("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:r("No workflows defined")}):(0,e.jsx)(E,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflows-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(w,{children:[(0,e.jsx)(l,{children:r("Export")}),(0,e.jsx)(l,{children:r("Name")}),(0,e.jsx)(l,{children:r("Class")}),(0,e.jsx)(l,{children:r("Binding")})]})}),(0,e.jsx)(F,{children:f.map(t=>(0,e.jsxs)(w,{"data-testid":`workflows-row-${t.exportName}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:t.exportName}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:t.name}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:t.className}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:t.binding})]},t.exportName))})]})})}),f.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:r("Start instance")}),J!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:J}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("select",{"aria-label":r("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:B,value:x,children:f.map(t=>(0,e.jsx)("option",{value:t.exportName,children:t.exportName},t.exportName))}),(0,e.jsx)(Z,{"aria-label":r("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:ae,placeholder:r("Instance id (optional)"),value:s}),(0,e.jsx)(I,{"data-testid":"workflows-start-button",disabled:O||x==="",onClick:a,children:r(O?"Starting\u2026":"Start instance")})]}),(0,e.jsx)(te,{"aria-label":r("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:re,placeholder:r("Params (JSON, optional)"),value:g})]}),p.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:r("Instances")}),(0,e.jsx)(E,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflows-instances-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(w,{children:[(0,e.jsx)(l,{children:r("Workflow")}),(0,e.jsx)(l,{children:r("Instance id")}),(0,e.jsx)(l,{children:r("Status")}),(0,e.jsx)(l,{children:r("Output")}),(0,e.jsx)(l,{})]})}),(0,e.jsx)(F,{children:p.map(t=>(0,e.jsxs)(w,{"data-testid":`workflows-instance-${t.id}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:t.exportName}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:t.id}),(0,e.jsx)(o,{className:"font-mono text-xs",children:t.status}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:pe(t)}),(0,e.jsx)(o,{children:(0,e.jsx)(I,{"data-export":t.exportName,"data-id":t.id,"data-testid":`workflows-instance-refresh-${t.id}`,disabled:C===t.id,onClick:se,size:"xs",variant:"outline",children:C===t.id?r("Refreshing\u2026"):r("Refresh")})})]},`${t.exportName}:${t.id}`))})]})})})]}),T!==void 0&&(0,e.jsx)(ue,{workflowName:T.name})]})},"Oe");export{Ie as default};
@@ -1 +0,0 @@
1
- import{a as Q}from"./chunk-X2FQ6B5V.js";import{a as J}from"./chunk-7LQWFOEU.js";import{a as W}from"./chunk-LFKCLLPT.js";import{a as _}from"./chunk-HK4OVYG3.js";import"./chunk-XXQUMVWH.js";import{b as O}from"./chunk-BMQJ4CAO.js";import{a as $,b as G,c as H,d as x,e as t,f as n}from"./chunk-MIQTKZAR.js";import{a as j,e as K}from"./chunk-UZERI5YC.js";import{a as y}from"./chunk-5Y3QLNWX.js";import{a as U}from"./chunk-LFXFP4IF.js";import{b as P}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as S}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as D}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as E}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as v}from"./chunk-AADXUXZO.js";import{f as L}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as z}from"./chunk-XQCVZAGU.js";import{d as M,f as A,g as B,h as F,m as T,q}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as s,e as I,f as lr,h as cr}from"./chunk-3XIESWL4.js";var i=I(lr(),1);var r=I(cr(),1);var mr=A(v.runMigration),Sr=s(({initialShardKey:V})=>{let X=L(),e=M(),[c,Y]=(0,i.useState)(V??""),[b,Z]=(0,i.useState)(""),[w,rr]=(0,i.useState)("up"),[h,er]=(0,i.useState)(!0),[m,N]=(0,i.useState)(!1),[d,p]=(0,i.useState)(null),[k,g]=(0,i.useState)(null),u=W(c.trim(),400),C=c.trim()===u,o=O(v.migrationStatus,{},{live:!0,shardKey:u}),l=o.data?.migrations??null,ar=o.error,{errorSource:ir,liveError:tr}=o;(0,i.useEffect)(()=>{o.data!==void 0&&P(u)},[o.data,u]);let nr=s(async()=>{let a=b.trim();if(a===""){g(e("Enter a migration id")),p(null);return}N(!0),g(null);try{let f=await X.query(mr,{direction:w,dryRun:h,id:a},B(c));p(f),o.refetch()}catch(f){p(null),g(F(f))}finally{N(!1)}},"K"),R=s(()=>{T(nr())},"N"),sr=s(a=>{Z(a.target.value)},"T"),or=s(a=>{rr(a.target.value==="down"?"down":"up")},"B"),dr=s(a=>{er(a.target.checked)},"F");return(0,r.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-migrations",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(U,{onChange:Y,testId:"mg-shard-input",value:c}),(0,r.jsx)(Q,{message:tr,prefix:"mg"})]}),ar!==null&&(0,r.jsx)(_,{error:ir,testId:"mg-status-error"}),l!==null&&l.length===0&&(0,r.jsx)(z,{description:e("Data migrations you run against this shard will be tracked here."),icon:(0,r.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{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"})}),testId:"mg-empty",title:e("No migrations have run on this shard.")}),l!==null&&l.length>0&&(0,r.jsx)(j,{className:"overflow-hidden py-0",children:(0,r.jsx)(K,{className:"px-0",children:(0,r.jsxs)($,{"data-testid":"mg-table",children:[(0,r.jsx)(G,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(t,{children:e("id")}),(0,r.jsx)(t,{children:e("direction")}),(0,r.jsx)(t,{children:e("status")}),(0,r.jsx)(t,{children:e("processed")}),(0,r.jsx)(t,{children:e("changed")}),(0,r.jsx)(t,{children:e("updated")}),(0,r.jsx)(t,{children:e("error")})]})}),(0,r.jsx)(H,{children:l.map(a=>(0,r.jsxs)(x,{"data-testid":`mg-row-${a.id}`,children:[(0,r.jsx)(n,{children:a.id}),(0,r.jsx)(n,{children:a.direction}),(0,r.jsx)(n,{children:(0,r.jsx)(E,{variant:"secondary",children:a.status})}),(0,r.jsx)(n,{children:a.processed}),(0,r.jsx)(n,{children:a.changed}),(0,r.jsx)(n,{children:q(a.updatedAt)}),(0,r.jsx)(n,{children:a.error??""})]},a.id))})]})})}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,r.jsx)(y,{children:e("Run migration")}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(S,{"aria-label":e("Migration id"),className:"w-auto","data-testid":"mg-id-input",onChange:sr,placeholder:e("migration id"),value:b}),(0,r.jsxs)("select",{"aria-label":e("Direction"),className:"flex h-9 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"mg-direction",onChange:or,value:w,children:[(0,r.jsx)("option",{value:"up",children:e("up")}),(0,r.jsx)("option",{value:"down",children:e("down")})]}),(0,r.jsxs)(y,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[(0,r.jsx)("input",{checked:h,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:dr,type:"checkbox"}),e("Dry run")]}),h?(0,r.jsx)(D,{"data-testid":"mg-run",disabled:m||!C,onClick:R,size:"sm",type:"button",children:e(m?"Running\u2026":"Run")}):(0,r.jsx)(J,{confirmLabel:e(m?"Running\u2026":"Run migration?"),disabled:m||!C,onConfirm:R,testId:"mg-run",children:e("Run")})]})]}),k!==null&&(0,r.jsx)("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:k}),d!==null&&(0,r.jsxs)("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[d.dryRun?e("Dry run: "):"",e("{status} \u2014 processed",{status:d.status}),d.processed,e(", changed"),d.changed]})]})},"Er");export{Sr as MigrationsPanel};
@@ -1 +0,0 @@
1
- import{a as T}from"./chunk-X2FQ6B5V.js";import{b as k}from"./chunk-BMQJ4CAO.js";import{a as D,b as E,c as O,d as C,e as i,f as o}from"./chunk-MIQTKZAR.js";import{a as I,e as $}from"./chunk-UZERI5YC.js";import{b}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as A}from"./chunk-AADXUXZO.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as L}from"./chunk-XQCVZAGU.js";import{d as S}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as v,e as w,f as K,g as M,h as P}from"./chunk-3XIESWL4.js";var j=w(M(),1),q=w(K(),1);var t=w(P(),1);var _="container:",W={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},B=v(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"j"),F=v(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(_))continue;let s=a.slice(_.length);if(s==="")continue;let c=JSON.stringify([s,r.instance??""]),m=n.get(c);if(m!==void 0&&m.timestamp>=r.timestamp)continue;let{detail:g,event:l}=B(r.message);n.set(c,{detail:g,event:l,exitCode:r.exitCode,instance:r.instance,level:r.level,name:s,state:W[l]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"K"),J={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},U=v(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"W"),ee=v(()=>{let e=(0,j.c)(23),n=S(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:s,error:c,liveError:m}=k(A.getLogs,r,a),g=s!==void 0,l;e[2]!==s?(l=F(U(s)),e[2]=s,e[3]=l):l=e[3];let N=l,d;e[4]!==c?(d=c!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:c}),e[4]=c,e[5]=d):d=e[5];let h;e[6]!==n?(h=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[6]=n,e[7]=h):h=e[7];let p;e[8]!==h?(p=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[8]=h,e[9]=p):p=e[9];let u;e[10]!==m?(u=(0,t.jsx)(T,{message:m,prefix:"containers"}),e[10]=m,e[11]=u):u=e[11];let f;e[12]!==p||e[13]!==u?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,u]}),e[12]=p,e[13]=u,e[14]=f):f=e[14];let x;e[15]!==g||e[16]!==N||e[17]!==n?(x=g&&N.length===0?(0,t.jsx)(L,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(I,{className:"overflow-hidden py-0",children:(0,t.jsx)($,{className:"px-0",children:(0,t.jsxs)(D,{"data-testid":"containers-table",children:[(0,t.jsx)(E,{children:(0,t.jsxs)(C,{children:[(0,t.jsx)(i,{children:n("Container")}),(0,t.jsx)(i,{children:n("Instance")}),(0,t.jsx)(i,{children:n("State")}),(0,t.jsx)(i,{children:n("Last event")}),(0,t.jsx)(i,{children:n("Detail")}),(0,t.jsx)(i,{children:n("Exit")}),(0,t.jsx)(i,{children:n("When")})]})}),(0,t.jsx)(O,{children:N.map(Y)})]})})}),e[15]=g,e[16]=N,e[17]=n,e[18]=x):x=e[18];let y;return e[19]!==d||e[20]!==f||e[21]!==x?(y=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[d,f,x]}),e[19]=d,e[20]=f,e[21]=x,e[22]=y):y=e[22],y},"Y");function Y(e){return(0,t.jsxs)(C,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(o,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(o,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(o,{children:(0,t.jsx)(b,{variant:J[e.state],children:e.state})}),(0,t.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(o,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(o,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(o,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}v(Y,"B");export{ee as ContainersPanel};
@@ -1 +0,0 @@
1
- import{a as He}from"./chunk-LEDWUPXM.js";import"./chunk-2PJNAWB3.js";import{a as Ge}from"./chunk-54MMVNPT.js";import"./chunk-BGBLQ563.js";import{a as Pe}from"./chunk-HK4OVYG3.js";import{a as Ke}from"./chunk-XXQUMVWH.js";import{b as _e}from"./chunk-BMQJ4CAO.js";import{a as De,b as ke,c as Be,d as G,e as w,f as C}from"./chunk-MIQTKZAR.js";import{a as Me,e as Te}from"./chunk-UZERI5YC.js";import{a as Ue}from"./chunk-V53KNYRN.js";import{R as We}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as U}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as le}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as z}from"./chunk-AADXUXZO.js";import{f as Fe}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as ue}from"./chunk-XQCVZAGU.js";import{d as $,f as ie,g as ce,h as me,m as he,q as je}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as h,e as Ee,f as st,g as nt,h as rt}from"./chunk-3XIESWL4.js";var F=Ee(nt(),1);var A=Ee(st(),1);var t=Ee(rt(),1);var dt=h((n,e)=>{let a=new Set(n.map(s=>s.deadLetterQueue).filter(s=>typeof s=="string"&&s!=="")),u=n.filter(s=>(s.deadLetterQueue===void 0||s.deadLetterQueue==="")&&!a.has(s.name)),o=e.filter(s=>s.deadLettered).length;return{deadLetteredCount:o,queuesWithoutDlq:u,showReliabilityWarning:u.length>0||o>0}},"st"),ot=200,lt=ie(z.sendQueueMessage),ut=ie(z.replayQueueMessage),it=ie(z.clearQueueMessages),Ve=96,ct=h(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n)}catch{return"[unserializable]"}},"lt"),mt=h(n=>n.length>Ve?`${n.slice(0,Ve)}\u2026`:n,"ut"),ht=h(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","ct"),pt=h((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"it"),gt=h(n=>{let e=(0,F.c)(11),{loaded:a,queues:u}=n,o=$(),s;e[0]!==o?(s=o("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[0]=o,e[1]=s):s=e[1];let d;e[2]!==s?(d=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),e[2]=s,e[3]=d):d=e[3];let r;e[4]!==a||e[5]!==u||e[6]!==o?(r=a&&u.length===0?(0,t.jsx)(ue,{description:o("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:o("No queues defined")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Te,{className:"px-0",children:(0,t.jsxs)(De,{"data-testid":"queues-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(w,{children:o("Export")}),(0,t.jsx)(w,{children:o("Queue")}),(0,t.jsx)(w,{children:o("Mode")}),(0,t.jsx)(w,{children:o("Binding")}),(0,t.jsx)(w,{children:o("Dead-letter")})]})}),(0,t.jsx)(Be,{children:u.map(Nt)})]})})}),e[4]=a,e[5]=u,e[6]=o,e[7]=r):r=e[7];let p;return e[8]!==d||e[9]!==r?(p=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[d,r]}),e[8]=d,e[9]=r,e[10]=p):p=e[10],p},"mt"),ft=h(n=>{let e=(0,F.c)(67),{message:a,onReplay:u,replayingId:o}=n,s=$(),d,r,p,c,N,g,y,l,m,f;if(e[0]!==a.attempts||e[1]!==a.body||e[2]!==a.deadLettered||e[3]!==a.exportName||e[4]!==a.id||e[5]!==a.messageId||e[6]!==a.outcome||e[7]!==a.queue||e[8]!==s){let W=ct(a.body);r=G,g=`queues-message-${a.id}`;let j=a.exportName??a.queue;e[19]!==j?(y=(0,t.jsx)(C,{className:"font-mono text-xs",children:j}),e[19]=j,e[20]=y):y=e[20],e[21]!==a.messageId?(l=(0,t.jsx)(C,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:a.messageId,children:a.messageId}),e[21]=a.messageId,e[22]=l):l=e[22],e[23]!==a.attempts?(m=(0,t.jsx)(C,{className:"font-mono text-xs tabular-nums",children:a.attempts}),e[23]=a.attempts,e[24]=m):m=e[24];let M=`queues-outcome-${a.id}`,T;e[25]!==a.outcome?(T=ht(a.outcome),e[25]=a.outcome,e[26]=T):T=e[26];let Q;e[27]!==a.outcome||e[28]!==M||e[29]!==T?(Q=(0,t.jsx)(le,{"data-testid":M,variant:T,children:a.outcome}),e[27]=a.outcome,e[28]=M,e[29]=T,e[30]=Q):Q=e[30];let _;e[31]!==a.deadLettered||e[32]!==a.id||e[33]!==s?(_=a.deadLettered&&(0,t.jsx)(le,{"data-testid":`queues-dlq-${a.id}`,variant:"destructive",children:s("DLQ")}),e[31]=a.deadLettered,e[32]=a.id,e[33]=s,e[34]=_):_=e[34],e[35]!==Q||e[36]!==_?(f=(0,t.jsx)(C,{children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[Q,_]})}),e[35]=Q,e[36]=_,e[37]=f):f=e[37],d=C,p="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",c=W,N=mt(W),e[0]=a.attempts,e[1]=a.body,e[2]=a.deadLettered,e[3]=a.exportName,e[4]=a.id,e[5]=a.messageId,e[6]=a.outcome,e[7]=a.queue,e[8]=s,e[9]=d,e[10]=r,e[11]=p,e[12]=c,e[13]=N,e[14]=g,e[15]=y,e[16]=l,e[17]=m,e[18]=f}else d=e[9],r=e[10],p=e[11],c=e[12],N=e[13],g=e[14],y=e[15],l=e[16],m=e[17],f=e[18];let x;e[38]!==d||e[39]!==p||e[40]!==c||e[41]!==N?(x=(0,t.jsx)(d,{className:p,title:c,children:N}),e[38]=d,e[39]=p,e[40]=c,e[41]=N,e[42]=x):x=e[42];let q;e[43]!==a.capturedAt?(q=je(a.capturedAt,"\u2014"),e[43]=a.capturedAt,e[44]=q):q=e[44];let b;e[45]!==q?(b=(0,t.jsx)(C,{className:"text-xs text-muted-foreground tabular-nums",children:q}),e[45]=q,e[46]=b):b=e[46];let S=`queues-replay-${a.id}`,E=o!==null,I;e[47]!==a.id||e[48]!==o||e[49]!==s?(I=o===a.id?s("Replaying\u2026"):s("Replay"),e[47]=a.id,e[48]=o,e[49]=s,e[50]=I):I=e[50];let L;e[51]!==a.id||e[52]!==u||e[53]!==S||e[54]!==E||e[55]!==I?(L=(0,t.jsx)(C,{children:(0,t.jsx)(U,{"data-id":a.id,"data-testid":S,disabled:E,onClick:u,size:"xs",type:"button",variant:"outline",children:I})}),e[51]=a.id,e[52]=u,e[53]=S,e[54]=E,e[55]=I,e[56]=L):L=e[56];let D;return e[57]!==r||e[58]!==b||e[59]!==L||e[60]!==g||e[61]!==y||e[62]!==l||e[63]!==m||e[64]!==f||e[65]!==x?(D=(0,t.jsxs)(r,{"data-testid":g,children:[y,l,m,f,x,b,L]}),e[57]=r,e[58]=b,e[59]=L,e[60]=g,e[61]=y,e[62]=l,e[63]=m,e[64]=f,e[65]=x,e[66]=D):D=e[66],D},"ht"),xt=h(n=>{let e=(0,F.c)(26),{hasError:a,messages:u,onClear:o,onReplay:s,replayingId:d}=n,r=$(),p;e[0]!==r?(p=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=p):p=e[1];let c;e[2]!==p?(c=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p}),e[2]=p,e[3]=c):c=e[3];let N=u.length===0,g;e[4]!==r?(g=r("Clear log"),e[4]=r,e[5]=g):g=e[5];let y;e[6]!==o||e[7]!==N||e[8]!==g?(y=(0,t.jsx)(U,{className:"ml-auto","data-testid":"queues-clear",disabled:N,onClick:o,size:"sm",type:"button",variant:"outline",children:g}),e[6]=o,e[7]=N,e[8]=g,e[9]=y):y=e[9];let l;e[10]!==u.length||e[11]!==r?(l=u.length>0&&(0,t.jsx)(le,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:u.length})}),e[10]=u.length,e[11]=r,e[12]=l):l=e[12];let m;e[13]!==c||e[14]!==y||e[15]!==l?(m=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,y,l]}),e[13]=c,e[14]=y,e[15]=l,e[16]=m):m=e[16];let f;e[17]!==a||e[18]!==u||e[19]!==s||e[20]!==d||e[21]!==r?(f=!a&&u.length===0?(0,t.jsx)(ue,{description:r("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:r("No consumed messages yet.")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Te,{className:"px-0",children:(0,t.jsx)(He,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxs)(De,{"data-testid":"queues-messages-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(w,{children:r("Export")}),(0,t.jsx)(w,{children:r("Message")}),(0,t.jsx)(w,{children:r("Attempts")}),(0,t.jsx)(w,{children:r("Outcome")}),(0,t.jsx)(w,{children:r("Body")}),(0,t.jsx)(w,{children:r("Captured")}),(0,t.jsx)(w,{})]})}),(0,t.jsx)(Be,{children:u.map(q=>(0,t.jsx)(ft,{message:q,onReplay:s,replayingId:d},q.id))})]})})})}),e[17]=a,e[18]=u,e[19]=s,e[20]=d,e[21]=r,e[22]=f):f=e[22];let x;return e[23]!==m||e[24]!==f?(x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[m,f]}),e[23]=m,e[24]=f,e[25]=x):x=e[25],x},"pt"),yt=h(n=>{let e=(0,F.c)(20),{batchMode:a,bodyText:u,delayText:o,onBatchModeChange:s,onBodyChange:d,onDelayChange:r,onSelectExport:p,onSend:c,queues:N,selectedExportName:g,sending:y}=n,l=$(),m;e[0]!==l?(m=l("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=l,e[1]=m):m=e[1];let f;e[2]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3];let x;e[4]!==a||e[5]!==u||e[6]!==o||e[7]!==s||e[8]!==d||e[9]!==r||e[10]!==p||e[11]!==c||e[12]!==N||e[13]!==g||e[14]!==y||e[15]!==l?(x=N.length===0?(0,t.jsx)(ue,{description:l("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:l("No queues to send to")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":l("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:p,value:g,children:N.map(bt)}),(0,t.jsx)(We,{"aria-label":l("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:l("Delay (s)"),type:"number",value:o}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsx)("input",{checked:a,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:s,type:"checkbox"}),l("Send as batch (JSON array)")]}),(0,t.jsx)(U,{className:"ml-auto","data-testid":"queues-send-button",disabled:y||g==="",onClick:c,type:"button",children:l(y?"Sending\u2026":"Send message")})]}),(0,t.jsx)(Ue,{"aria-label":l("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:d,placeholder:a?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:u})]}),e[4]=a,e[5]=u,e[6]=o,e[7]=s,e[8]=d,e[9]=r,e[10]=p,e[11]=c,e[12]=N,e[13]=g,e[14]=y,e[15]=l,e[16]=x):x=e[16];let q;return e[17]!==f||e[18]!==x?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[f,x]}),e[17]=f,e[18]=x,e[19]=q):q=e[19],q},"gt"),Jt=h(n=>{let e=(0,F.c)(59),{limit:a}=n,u=a??ot,o=Fe(),s=$(),[d,r]=(0,A.useState)("declared"),[p,c]=(0,A.useState)(null),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N={},e[0]=N):N=e[0];let{data:g,error:y,errorSource:l}=_e(z.listQueues,N),m;e[1]!==u?(m={limit:u},e[1]=u,e[2]=m):m=e[2];let{data:f,error:x,errorSource:q,refetch:b}=_e(z.getQueueMessages,m),S=Array.isArray(g?.queues)?[...g.queues].toSorted(qt):[],E=f?.entries??[],{deadLetteredCount:I,queuesWithoutDlq:L,showReliabilityWarning:D}=dt(S,E),[W,j]=(0,A.useState)(""),[M,T]=(0,A.useState)(""),[Q,_]=(0,A.useState)(""),[K,Xe]=(0,A.useState)(!1),[pe,Oe]=(0,A.useState)(!1),[ge,Re]=(0,A.useState)(null),H=S.some(i=>i.exportName===W)?W:S[0]?.exportName??"",Je=d==="messages"?x:y,Ye=d==="messages"?q:l,fe=Je??p,xe=Je===null?p:Ye,V;e[3]!==b?(V=h(()=>{b()},"K"),e[3]=b,e[4]=V):V=e[4],Ge(V,d==="messages");let ye=h(async()=>{c(null);let i=H;if(i==="")return;let v=null,$e=M.trim();if($e!=="")try{v=JSON.parse($e)}catch{c(s("Body must be valid JSON."));return}let Ae,ze=Q.trim();if(ze!==""){let P=Number(ze);if(!Number.isFinite(P)||P<0){c(s("Delay must be a non-negative number of seconds."));return}Ae=P}if(K&&!Array.isArray(v)){c(s("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let at=K?{batch:v,delaySeconds:Ae,exportName:i}:{body:v,delaySeconds:Ae,exportName:i};try{await o.query(lt,at,ce("")),b()}catch(P){c(me(P))}Oe(!1)},"me"),X;e[5]!==o||e[6]!==b?(X=h(async i=>{c(null),Re(i);try{await o.query(ut,{id:i},ce("")),b()}catch(v){c(me(v))}Re(null)},"H"),e[5]=o,e[6]=b,e[7]=X):X=e[7];let Ne=X,Y;e[8]!==o||e[9]!==b?(Y=h(async()=>{c(null);try{await o.query(it,{},ce("")),b()}catch(i){c(me(i))}},"V"),e[8]=o,e[9]=b,e[10]=Y):Y=e[10];let be=Y,Z;e[11]===Symbol.for("react.memo_cache_sentinel")?(Z=h(i=>{let v=i.currentTarget.dataset.tab;(v==="declared"||v==="messages"||v==="send")&&r(v)},"X"),e[11]=Z):Z=e[11];let Ze=Z,ee;e[12]===Symbol.for("react.memo_cache_sentinel")?(ee=h(i=>{j(i.currentTarget.value)},"Y"),e[12]=ee):ee=e[12];let qe=ee,te;e[13]===Symbol.for("react.memo_cache_sentinel")?(te=h(i=>{T(i.currentTarget.value)},"Z"),e[13]=te):te=e[13];let ve=te,ae;e[14]===Symbol.for("react.memo_cache_sentinel")?(ae=h(i=>{_(i.currentTarget.value)},"ee"),e[14]=ae):ae=e[14];let Se=ae,se;e[15]===Symbol.for("react.memo_cache_sentinel")?(se=h(i=>{Xe(i.currentTarget.checked)},"te"),e[15]=se):se=e[15];let we=se,ne;e[16]!==ye?(ne=h(()=>{he(ye())},"ae"),e[16]=ye,e[17]=ne):ne=e[17];let Ce=ne,re;e[18]!==Ne?(re=h(i=>{let{id:v}=i.currentTarget.dataset;v!==void 0&&he(Ne(v))},"se"),e[18]=Ne,e[19]=re):re=e[19];let Qe=re,de;e[20]!==be?(de=h(()=>{he(be())},"re"),e[20]=be,e[21]=de):de=e[21];let Ie=de,et="flex flex-col gap-6",tt="lunora-queues-panel",k;e[22]!==s||e[23]!==d?(k=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(i=>(0,t.jsx)(U,{"aria-selected":d===i,"data-tab":i,"data-testid":`queues-tab-${i}`,onClick:Ze,role:"tab",size:"sm",type:"button",variant:d===i?"secondary":"ghost",children:pt(i,s)},i))}),e[22]=s,e[23]=d,e[24]=k):k=e[24];let B;e[25]!==fe||e[26]!==xe?(B=fe!==null&&(0,t.jsx)(Pe,{error:xe,testId:"queues-error"}),e[25]=fe,e[26]=xe,e[27]=B):B=e[27];let Le=D&&(0,t.jsx)(Ke,{icon:(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[L.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-medium",children:s("No dead-letter queue on {queues}.",{queues:L.map(vt).join(", ")})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),I>0&&(0,t.jsx)("p",{className:L.length>0?"text-muted-foreground":"font-medium",children:I===1?s("1 message was recently dead-lettered."):s("{count} messages were recently dead-lettered.",{count:I})})]})}),O;e[28]!==S||e[29]!==g||e[30]!==d?(O=d==="declared"&&(0,t.jsx)(gt,{loaded:g!==void 0,queues:S}),e[28]=S,e[29]=g,e[30]=d,e[31]=O):O=e[31];let R;e[32]!==E||e[33]!==x||e[34]!==Ie||e[35]!==Qe||e[36]!==ge||e[37]!==d?(R=d==="messages"&&(0,t.jsx)(xt,{hasError:x!==null,messages:E,onClear:Ie,onReplay:Qe,replayingId:ge}),e[32]=E,e[33]=x,e[34]=Ie,e[35]=Qe,e[36]=ge,e[37]=d,e[38]=R):R=e[38];let J;e[39]!==K||e[40]!==M||e[41]!==Q||e[42]!==we||e[43]!==ve||e[44]!==Se||e[45]!==qe||e[46]!==Ce||e[47]!==S||e[48]!==H||e[49]!==pe||e[50]!==d?(J=d==="send"&&(0,t.jsx)(yt,{batchMode:K,bodyText:M,delayText:Q,onBatchModeChange:we,onBodyChange:ve,onDelayChange:Se,onSelectExport:qe,onSend:Ce,queues:S,selectedExportName:H,sending:pe}),e[39]=K,e[40]=M,e[41]=Q,e[42]=we,e[43]=ve,e[44]=Se,e[45]=qe,e[46]=Ce,e[47]=S,e[48]=H,e[49]=pe,e[50]=d,e[51]=J):J=e[51];let oe;return e[52]!==k||e[53]!==B||e[54]!==Le||e[55]!==O||e[56]!==R||e[57]!==J?(oe=(0,t.jsxs)("div",{className:et,"data-testid":tt,children:[k,B,Le,O,R,J]}),e[52]=k,e[53]=B,e[54]=Le,e[55]=O,e[56]=R,e[57]=J,e[58]=oe):oe=e[58],oe},"Bt");function Nt(n){return(0,t.jsxs)(G,{"data-testid":`queues-row-${n.exportName}`,children:[(0,t.jsx)(C,{className:"font-mono text-xs",children:n.exportName}),(0,t.jsx)(C,{className:"font-mono text-xs text-muted-foreground",children:n.name}),(0,t.jsx)(C,{className:"font-mono text-xs text-muted-foreground",children:n.mode}),(0,t.jsx)(C,{className:"font-mono text-xs text-muted-foreground",children:n.binding}),(0,t.jsx)(C,{className:"font-mono text-xs text-muted-foreground",children:n.deadLetterQueue??"\u2014"})]},n.exportName)}h(Nt,"ft");function bt(n){return(0,t.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}h(bt,"xt");function qt(n,e){return n.exportName.localeCompare(e.exportName)}h(qt,"yt");function vt(n){return n.name}h(vt,"Nt");export{Jt as default};
@@ -1 +0,0 @@
1
- var _={assignIssue:"__lunora_admin__:assignIssue",clearCapturedMail:"__lunora_admin__:clearCapturedMail",clearQueueMessages:"__lunora_admin__:clearQueueMessages",clearTable:"__lunora_admin__:clearTable",createWorkflowInstance:"__lunora_admin__:createWorkflowInstance",deleteRows:"__lunora_admin__:deleteRows",describeTable:"__lunora_admin__:describeTable",describeTables:"__lunora_admin__:describeTables",explainIssue:"__lunora_admin__:explainIssue",exportShard:"__lunora_admin__:exportShard",facetColumn:"__lunora_admin__:facetColumn",getAdvisories:"__lunora_admin__:getAdvisories",getAuditLog:"__lunora_admin__:getAuditLog",getAuthAuditLog:"__lunora_admin__:getAuthAuditLog",getAuthMetrics:"__lunora_admin__:getAuthMetrics",getCapturedMail:"__lunora_admin__:getCapturedMail",getFanoutMetrics:"__lunora_admin__:getFanoutMetrics",getFunctionStats:"__lunora_admin__:getFunctionStats",getIssues:"__lunora_admin__:getIssues",listFlags:"__lunora_admin__:listFlags",listPushSubscriptions:"__lunora_admin__:listPushSubscriptions",listQueues:"__lunora_admin__:listQueues",listSubscriptions:"__lunora_admin__:listSubscriptions",listTableIndexes:"__lunora_admin__:listTableIndexes",listWorkflows:"__lunora_admin__:listWorkflows",getLogs:"__lunora_admin__:getLogs",getMetricHistory:"__lunora_admin__:getMetricHistory",getMetricSeries:"__lunora_admin__:getMetricSeries",getMetrics:"__lunora_admin__:getMetrics",getPitrBookmark:"__lunora_admin__:getPitrBookmark",getQueueMessages:"__lunora_admin__:getQueueMessages",getRequestLog:"__lunora_admin__:getRequestLog",getSecurityAudit:"__lunora_admin__:getSecurityAudit",getSettings:"__lunora_admin__:getSettings",getTraces:"__lunora_admin__:getTraces",getWorkflowInstanceStatus:"__lunora_admin__:getWorkflowInstanceStatus",ignoreIssue:"__lunora_admin__:ignoreIssue",importShard:"__lunora_admin__:importShard",listTables:"__lunora_admin__:listTables",maskPolicies:"__lunora_admin__:maskPolicies",migrationStatus:"__lunora_admin__:migrationStatus",pitrRestore:"__lunora_admin__:pitrRestore",readTablePage:"__lunora_admin__:readTablePage",replayQueueMessage:"__lunora_admin__:replayQueueMessage",resolveIssue:"__lunora_admin__:resolveIssue",rlsPolicies:"__lunora_admin__:rlsPolicies",runAs:"__lunora_admin__:runAs",runMigration:"__lunora_admin__:runMigration",runSql:"__lunora_admin__:runSql",sendQueueMessage:"__lunora_admin__:sendQueueMessage",sendTestMail:"__lunora_admin__:sendTestMail",setIssueSeverity:"__lunora_admin__:setIssueSeverity",storageOrphans:"__lunora_admin__:storageOrphans",storageReferences:"__lunora_admin__:storageReferences",storageRules:"__lunora_admin__:storageRules",studioFeatures:"__lunora_admin__:studioFeatures",writeRow:"__lunora_admin__:writeRow"};export{_ as a};
@@ -1 +0,0 @@
1
- import{a as U}from"./chunk-54MMVNPT.js";import{a as C}from"./chunk-7LQWFOEU.js";import{a as f}from"./chunk-5Y3QLNWX.js";import{R as N}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as O}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as L}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as w}from"./chunk-AADXUXZO.js";import{f as P}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{d as q,f as v,g as c,h,m as p}from"./chunk-4CGALXS3.js";import"./chunk-AADILRJW.js";import{a as o,e as T,f as W,h as $}from"./chunk-3XIESWL4.js";var a=T(W(),1);var e=T($(),1);var R=v(w.getPitrBookmark),V=v(w.pitrRestore),ne=o(({initialShardKey:j})=>{let m=P(),r=q(),i=j??"",[z,x]=(0,a.useState)(null),[l,A]=(0,a.useState)(""),[B,I]=(0,a.useState)(null),[u,D]=(0,a.useState)(""),[k,E]=(0,a.useState)(!1),[s,K]=(0,a.useState)(null),[F,n]=(0,a.useState)(null),[b,d]=(0,a.useState)(!1),g=(0,a.useCallback)(async()=>{d(!0),n(null);try{let t=await m.query(R,{},c(i));x(t.current)}catch(t){n(h(t))}finally{d(!1)}},[m,i]);(0,a.useEffect)(()=>{p(g())},[g]),U(()=>{p((async()=>{try{let t=await m.query(R,{},c(i));x(t.current)}catch{}})())},!0);let M=o(t=>{A(t.target.value)},"U"),Z=o(t=>{D(t.target.value)},"j"),_=o(t=>{E(t.target.checked)},"M"),G=o(()=>{l.trim()!==""&&p((async()=>{d(!0),n(null);try{let t=await m.query(R,{time:l.trim()},c(i));I(t.forTime??null),x(t.current)}catch(t){I(null),n(h(t))}finally{d(!1)}})())},"z"),S=o(t=>{p((async()=>{d(!0),n(null);try{let y=await m.mutation(V,t,c(i));K(y),await g()}catch(y){n(h(y))}finally{d(!1)}})())},"R"),H=u.trim()!==""||l.trim()!=="",J=o(()=>{let t=k?{restart:!0}:{};u.trim()===""?t.time=l.trim():t.bookmark=u.trim(),S(t)},"$"),Q=o(()=>{s!==null&&S(k?{bookmark:s.undoBookmark,restart:!0}:{bookmark:s.undoBookmark})},"D");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[r("Shard"),": ",(0,e.jsx)("span",{className:"font-mono",children:i===""?r("root"):i})]})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:r("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier.")}),F!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:F}),(0,e.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:r("Current bookmark")}),(0,e.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:z??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]}),(0,e.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:r("Restore")}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-time",children:r("Time (ISO or epoch-ms, last 30 days)")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(N,{"data-testid":"pitr-time",id:"pitr-time",onChange:M,placeholder:"2026-06-01T00:00:00.000Z",value:l}),(0,e.jsx)(O,{"data-testid":"pitr-preview",disabled:b||l.trim()==="",onClick:G,size:"sm",type:"button",variant:"outline",children:r("Preview")})]}),B!==null&&(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[r("Bookmark for that time"),": ",B]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-bookmark",children:r("Or an explicit bookmark (wins over time)")}),(0,e.jsx)(N,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:Z,placeholder:r("bookmark string"),value:u})]}),(0,e.jsxs)(f,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[(0,e.jsx)("input",{checked:k,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:_,type:"checkbox"}),r("Restart the shard now so recovery applies immediately")]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:r("Confirm restore"),disabled:b||!H,onConfirm:J,testId:"pitr-restore",children:r("Restore")})})]}),s!==null&&(0,e.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:r("Restore armed")}),(0,e.jsx)(L,{variant:s.restarted?"destructive":"secondary",children:s.restarted?r("restarted now"):r("on next restart")})]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[r("Restored to"),": ",s.restoredTo]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[r("Undo bookmark"),": ",s.undoBookmark]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:r("Confirm undo"),disabled:b,onConfirm:Q,testId:"pitr-undo",children:r("Undo restore")})})]})]})},"de");export{ne as PitrPanel};