@lunora/studio 1.0.0-alpha.361 → 1.0.0-alpha.363

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 (327) hide show
  1. package/dist/index.d.mts +4 -1
  2. package/dist/index.d.ts +4 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/mount.mjs +1 -1
  5. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
  6. package/dist/packem_chunks/ApiTab.mjs +1 -1
  7. package/dist/packem_chunks/AuditPanel.mjs +1 -1
  8. package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
  9. package/dist/packem_chunks/FileBrowser.mjs +1 -1
  10. package/dist/packem_chunks/FunctionRunner.mjs +1 -1
  11. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
  12. package/dist/packem_chunks/HealthPanel.mjs +1 -1
  13. package/dist/packem_chunks/InsightsPanel.mjs +1 -1
  14. package/dist/packem_chunks/LogsPanel.mjs +1 -1
  15. package/dist/packem_chunks/MailPanel.mjs +1 -1
  16. package/dist/packem_chunks/MetricsPanel.mjs +1 -1
  17. package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
  18. package/dist/packem_chunks/PitrPanel.mjs +1 -1
  19. package/dist/packem_chunks/SchemaViewer.mjs +1 -1
  20. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
  21. package/dist/packem_chunks/SettingsPanel.mjs +1 -1
  22. package/dist/packem_chunks/SqlEditorPanel.mjs +24 -9
  23. package/dist/packem_chunks/TableEditor.mjs +1 -1
  24. package/dist/packem_chunks/agents-panel.mjs +1 -1
  25. package/dist/packem_chunks/ai-knowledge.mjs +1 -0
  26. package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
  27. package/dist/packem_chunks/assistant-panel.mjs +3 -0
  28. package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
  29. package/dist/packem_chunks/containers-panel.mjs +1 -1
  30. package/dist/packem_chunks/dashboards-panel.mjs +1 -1
  31. package/dist/packem_chunks/evals-panel.mjs +1 -1
  32. package/dist/packem_chunks/fanout-panel.mjs +1 -1
  33. package/dist/packem_chunks/flags-panel.mjs +1 -1
  34. package/dist/packem_chunks/issues-panel.mjs +1 -1
  35. package/dist/packem_chunks/kv-browser.mjs +1 -1
  36. package/dist/packem_chunks/log-drains-panel.mjs +1 -1
  37. package/dist/packem_chunks/migrations-route.mjs +1 -1
  38. package/dist/packem_chunks/payments-panel.mjs +1 -1
  39. package/dist/packem_chunks/permissions-panel.mjs +1 -1
  40. package/dist/packem_chunks/privacy-requests-panel.mjs +1 -1
  41. package/dist/packem_chunks/queues-panel.mjs +1 -1
  42. package/dist/packem_chunks/reactors-panel.mjs +1 -1
  43. package/dist/packem_chunks/rls-panel.mjs +1 -1
  44. package/dist/packem_chunks/schedule-panel.mjs +1 -1
  45. package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
  46. package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
  47. package/dist/packem_chunks/traces-panel.mjs +1 -1
  48. package/dist/packem_chunks/workflows-panel.mjs +1 -1
  49. package/dist/packem_shared/ADMIN_FUNCTIONS-DUXsXId1.mjs +1 -0
  50. package/dist/packem_shared/{ApiDocsPanel-DD2Uns6b.mjs → ApiDocsPanel-B9S9l1Ce.mjs} +1 -1
  51. package/dist/packem_shared/{DataBrowser-CVRWnNWu.mjs → DataBrowser-Dm-jhIUP.mjs} +2 -2
  52. package/dist/packem_shared/{GlobalDataBrowser-DC47T6Zl.mjs → GlobalDataBrowser-C1Y8GUhe.mjs} +1 -1
  53. package/dist/packem_shared/{HomePanel-D12HxHQo.mjs → HomePanel-B5ytwPIo.mjs} +1 -1
  54. package/dist/packem_shared/{MigrationsPanel-DMkxSXNl.mjs → MigrationsPanel-CwLikxDT.mjs} +1 -1
  55. package/dist/packem_shared/Studio-B89ZNMOD.mjs +1 -0
  56. package/dist/packem_shared/{StudioApp-isdWpF9P.mjs → StudioApp-C9l1a3A8.mjs} +1 -1
  57. package/dist/packem_shared/advisor-view-CzieqKMe.mjs +5 -0
  58. package/dist/packem_shared/assistant-provider-Bp72uWsq.mjs +1 -0
  59. package/dist/packem_shared/assistant-reason-D6EwMCxT.mjs +1 -0
  60. package/dist/packem_shared/{cf-links-CBJ5SywP.mjs → cf-links-C4DVTr8A.mjs} +1 -1
  61. package/dist/packem_shared/error-alert-DKXm5h19.mjs +6 -0
  62. package/dist/packem_shared/{home-panel-CDVTuTF8.mjs → home-panel-5fGktYeD.mjs} +1 -1
  63. package/dist/packem_shared/recording-client-z4CBi0y8.mjs +1 -0
  64. package/dist/packem_shared/studio-gZfpz1wC.mjs +2 -0
  65. package/dist/packem_shared/{table-list-sidebar-CNadcIgG.mjs → table-list-sidebar-kpHaDWjy.mjs} +1 -1
  66. package/dist/packem_shared/use-assistant-rpc-GCUK2zPa.mjs +1 -0
  67. package/dist/standalone/chunk-2DT3QG6Q.js +1 -0
  68. package/dist/standalone/chunk-2EB7FN5S.js +1 -0
  69. package/dist/standalone/chunk-2H6VLY2M.js +1 -0
  70. package/dist/standalone/chunk-2NGKUO32.js +1 -0
  71. package/dist/standalone/chunk-2SNHKJXK.js +1 -0
  72. package/dist/standalone/chunk-2W4UO5BC.js +1 -0
  73. package/dist/standalone/chunk-32V7XGNC.js +1 -0
  74. package/dist/standalone/{chunk-SLIDAWNX.js → chunk-3D67ZJRW.js} +1 -1
  75. package/dist/standalone/chunk-3X3NXJBR.js +1 -0
  76. package/dist/standalone/chunk-4EPW63HS.js +1 -0
  77. package/dist/standalone/chunk-4L55URI5.js +2 -0
  78. package/dist/standalone/chunk-4N76XUNG.js +1 -0
  79. package/dist/standalone/{chunk-WS36BO4R.js → chunk-4NKJV7YX.js} +1 -1
  80. package/dist/standalone/chunk-4PI2OSSP.js +1 -0
  81. package/dist/standalone/chunk-53XKGQEE.js +1 -0
  82. package/dist/standalone/chunk-5GYHGDIF.js +8 -0
  83. package/dist/standalone/chunk-5PEAXTYQ.js +1 -0
  84. package/dist/standalone/chunk-5QUTVSHM.js +1 -0
  85. package/dist/standalone/{chunk-BYOGQ2IV.js → chunk-5RX5CQSU.js} +2 -2
  86. package/dist/standalone/{chunk-O2NMPIV2.js → chunk-5WNGRT7N.js} +1 -1
  87. package/dist/standalone/chunk-5Z2U4KBN.js +1 -0
  88. package/dist/standalone/chunk-66BMMNUR.js +1 -0
  89. package/dist/standalone/chunk-6FPV3EK2.js +1 -0
  90. package/dist/standalone/chunk-6G3E4PJ2.js +1 -0
  91. package/dist/standalone/chunk-75TRPM7O.js +1 -0
  92. package/dist/standalone/chunk-7MLX5CGD.js +1 -0
  93. package/dist/standalone/chunk-7QEZ2SFW.js +1 -0
  94. package/dist/standalone/chunk-7TQ7BZ67.js +1 -0
  95. package/dist/standalone/chunk-A2Q3TGIQ.js +1 -0
  96. package/dist/standalone/chunk-AD5J2ANS.js +1 -0
  97. package/dist/standalone/chunk-ALR4VAUE.js +1 -0
  98. package/dist/standalone/chunk-AXE2SDRU.js +1 -0
  99. package/dist/standalone/chunk-AZIKM5BA.js +1 -0
  100. package/dist/standalone/chunk-BAEIW3YS.js +1 -0
  101. package/dist/standalone/chunk-BBDTJG2K.js +1 -0
  102. package/dist/standalone/chunk-BCUOQNI2.js +1 -0
  103. package/dist/standalone/chunk-BG2CJOVS.js +1 -0
  104. package/dist/standalone/chunk-BI6MZHZJ.js +1 -0
  105. package/dist/standalone/chunk-BKI3JMXQ.js +1 -0
  106. package/dist/standalone/chunk-CKEQX655.js +1 -0
  107. package/dist/standalone/{chunk-DX55P3KZ.js → chunk-CL3JOU6F.js} +1 -1
  108. package/dist/standalone/chunk-CP7QNLR4.js +1 -0
  109. package/dist/standalone/chunk-CVSIFPI5.js +1 -0
  110. package/dist/standalone/chunk-D57B4MFK.js +1 -0
  111. package/dist/standalone/chunk-D65UVZIA.js +1 -0
  112. package/dist/standalone/{chunk-DBVJ5VLI.js → chunk-DA2CAFXI.js} +1 -1
  113. package/dist/standalone/chunk-DB6QX4X6.js +1 -0
  114. package/dist/standalone/chunk-DZFXH55R.js +1 -0
  115. package/dist/standalone/chunk-ELSQ4FVH.js +1 -0
  116. package/dist/standalone/chunk-EPWCW2DF.js +1 -0
  117. package/dist/standalone/chunk-FHLODLBC.js +1 -0
  118. package/dist/standalone/chunk-FJLRSFTE.js +1 -0
  119. package/dist/standalone/{chunk-3FS22LNI.js → chunk-FVCBNFQW.js} +3 -3
  120. package/dist/standalone/{chunk-VEWQWS3J.js → chunk-FWM5Z6CH.js} +1 -1
  121. package/dist/standalone/chunk-GJXCPZDN.js +1 -0
  122. package/dist/standalone/chunk-GNI37YCV.js +33 -0
  123. package/dist/standalone/chunk-GVQPNM3T.js +3 -0
  124. package/dist/standalone/chunk-GWNGVKLG.js +1 -0
  125. package/dist/standalone/chunk-GXTSE66Z.js +1 -0
  126. package/dist/standalone/chunk-H3EIPYRZ.js +1 -0
  127. package/dist/standalone/chunk-H5TMLWIS.js +1 -0
  128. package/dist/standalone/{chunk-XIRKBJPD.js → chunk-HBG6SSE2.js} +5 -5
  129. package/dist/standalone/chunk-HC2B7SXW.js +1 -0
  130. package/dist/standalone/chunk-HCOF7HOM.js +1 -0
  131. package/dist/standalone/chunk-HGCOTYPV.js +1 -0
  132. package/dist/standalone/chunk-HLHMHCXS.js +1 -0
  133. package/dist/standalone/chunk-HSF2DCJ2.js +30 -0
  134. package/dist/standalone/chunk-HZDLUAWS.js +1 -0
  135. package/dist/standalone/{chunk-3PAYDWHN.js → chunk-I3SSF2T6.js} +2 -2
  136. package/dist/standalone/chunk-I5QX75DE.js +1 -0
  137. package/dist/standalone/chunk-ICHZ2IBL.js +1 -0
  138. package/dist/standalone/{chunk-7ZIYHKLX.js → chunk-IG5VD7R7.js} +3 -3
  139. package/dist/standalone/{chunk-SU5DTRGK.js → chunk-IHGRWY3Y.js} +1 -1
  140. package/dist/standalone/chunk-J45HAKBU.js +1 -0
  141. package/dist/standalone/chunk-J4PQAVOF.js +1 -0
  142. package/dist/standalone/chunk-JD6PRRFO.js +1 -0
  143. package/dist/standalone/chunk-JOPNP4EO.js +1 -0
  144. package/dist/standalone/chunk-JVP3TR3A.js +1 -0
  145. package/dist/standalone/chunk-KGLIQIZU.js +1 -0
  146. package/dist/standalone/{chunk-ONWGX5Y4.js → chunk-KH6OXCG3.js} +1 -1
  147. package/dist/standalone/chunk-KKMQUBYH.js +1 -0
  148. package/dist/standalone/chunk-L2FYX4FN.js +1 -0
  149. package/dist/standalone/chunk-LDHJRHPZ.js +1 -0
  150. package/dist/standalone/chunk-LSEUUZN4.js +1 -0
  151. package/dist/standalone/chunk-MNYDT3RH.js +1 -0
  152. package/dist/standalone/chunk-MT4ICMXJ.js +1 -0
  153. package/dist/standalone/chunk-MXJTD2OX.js +1 -0
  154. package/dist/standalone/chunk-NGZNXNRD.js +1 -0
  155. package/dist/standalone/chunk-O3AZ7JKE.js +1 -0
  156. package/dist/standalone/chunk-OK2QU2EV.js +1 -0
  157. package/dist/standalone/{chunk-IH2CJZF2.js → chunk-ONTGYVAN.js} +1 -1
  158. package/dist/standalone/chunk-OWRKSQPE.js +1 -0
  159. package/dist/standalone/chunk-OZAOWE7T.js +1 -0
  160. package/dist/standalone/chunk-P5EVJEGC.js +1 -0
  161. package/dist/standalone/chunk-PDBW6GTJ.js +1 -0
  162. package/dist/standalone/chunk-PJUVJTDR.js +1 -0
  163. package/dist/standalone/chunk-Q3IA6HPX.js +1 -0
  164. package/dist/standalone/chunk-QAOZXPLU.js +1 -0
  165. package/dist/standalone/chunk-QKUVJIRX.js +1 -0
  166. package/dist/standalone/chunk-QNM2J7MG.js +1 -0
  167. package/dist/standalone/chunk-QRA7AKYO.js +1 -0
  168. package/dist/standalone/chunk-RBIVXSXT.js +1 -0
  169. package/dist/standalone/chunk-RCXNYW7P.js +1 -0
  170. package/dist/standalone/{chunk-TDVDZ7XQ.js → chunk-RIAOZECW.js} +1 -1
  171. package/dist/standalone/{chunk-LUHXNZI4.js → chunk-RTS5G3ET.js} +1 -1
  172. package/dist/standalone/chunk-S36FVTKK.js +1 -0
  173. package/dist/standalone/chunk-SDDEOSQB.js +1 -0
  174. package/dist/standalone/chunk-SHHGIT7M.js +7 -0
  175. package/dist/standalone/chunk-SR6CPTRT.js +1 -0
  176. package/dist/standalone/chunk-SVQWZPO4.js +1 -0
  177. package/dist/standalone/chunk-T3ZCW3RG.js +1 -0
  178. package/dist/standalone/chunk-TEMI7MVE.js +1 -0
  179. package/dist/standalone/chunk-TKBTZX4K.js +1 -0
  180. package/dist/standalone/chunk-TW4O2BA5.js +159 -0
  181. package/dist/standalone/chunk-U5MPNEM2.js +1 -0
  182. package/dist/standalone/chunk-UD5REVU2.js +1 -0
  183. package/dist/standalone/chunk-ULQNADMJ.js +1 -0
  184. package/dist/standalone/chunk-UPPNZ6MI.js +1 -0
  185. package/dist/standalone/{chunk-PQH2LSJX.js → chunk-UQA2AJGI.js} +1 -1
  186. package/dist/standalone/chunk-UTQLJKHH.js +1 -0
  187. package/dist/standalone/chunk-UVG3ZISC.js +1 -0
  188. package/dist/standalone/chunk-UXBNXITB.js +1 -0
  189. package/dist/standalone/chunk-UZ2ZXB74.js +1 -0
  190. package/dist/standalone/chunk-V3BE427M.js +1 -0
  191. package/dist/standalone/chunk-VQDTA4P6.js +1 -0
  192. package/dist/standalone/chunk-W4LJQYCI.js +1 -0
  193. package/dist/standalone/chunk-WLHQ4FKC.js +1 -0
  194. package/dist/standalone/chunk-XPFVUAPX.js +1 -0
  195. package/dist/standalone/{chunk-SYGCASPT.js → chunk-Y2YLTUMD.js} +1 -1
  196. package/dist/standalone/chunk-Y3IGTWUE.js +1 -0
  197. package/dist/standalone/chunk-Y64STA6O.js +1 -0
  198. package/dist/standalone/chunk-YEVTA35E.js +1 -0
  199. package/dist/standalone/chunk-YEXTJUKQ.js +6 -0
  200. package/dist/standalone/chunk-YFTPHGS2.js +1 -0
  201. package/dist/standalone/{chunk-R36QXQZX.js → chunk-YORPLSI5.js} +1 -1
  202. package/dist/standalone/chunk-Z64BZNPS.js +1 -0
  203. package/dist/standalone/chunk-Z6VILGGP.js +5 -0
  204. package/dist/standalone/chunk-ZBOB33BA.js +1 -0
  205. package/dist/standalone/{chunk-5R2YO7HF.js → chunk-ZOKSVUID.js} +4 -4
  206. package/dist/standalone/{chunk-H7HZ42JY.js → chunk-ZPQBVYNN.js} +1 -1
  207. package/dist/standalone/chunk-ZSWW2UGP.js +1 -0
  208. package/dist/standalone/studio.js +2 -2
  209. package/dist/styles.css +1 -1
  210. package/package.json +7 -6
  211. package/dist/packem_shared/ADMIN_FUNCTIONS-4aGsMs95.mjs +0 -1
  212. package/dist/packem_shared/Studio-MA8kKZLu.mjs +0 -1
  213. package/dist/packem_shared/advisor-view-tBumWci_.mjs +0 -1
  214. package/dist/packem_shared/error-alert-C0R39DO1.mjs +0 -1
  215. package/dist/packem_shared/recording-client-DAipTA_n.mjs +0 -1
  216. package/dist/packem_shared/studio-UhUrPz5J.mjs +0 -2
  217. package/dist/packem_shared/use-sql-assistant-rZPs3LC3.mjs +0 -1
  218. package/dist/standalone/chunk-2AH4ABE5.js +0 -1
  219. package/dist/standalone/chunk-2G57ENH5.js +0 -1
  220. package/dist/standalone/chunk-3GXPALXG.js +0 -1
  221. package/dist/standalone/chunk-3GYLOE4V.js +0 -1
  222. package/dist/standalone/chunk-473JK2PQ.js +0 -1
  223. package/dist/standalone/chunk-4C4THJUD.js +0 -1
  224. package/dist/standalone/chunk-4DAKKAK7.js +0 -1
  225. package/dist/standalone/chunk-4M57OYFX.js +0 -1
  226. package/dist/standalone/chunk-4SQBAPY6.js +0 -1
  227. package/dist/standalone/chunk-5DNGK3NT.js +0 -1
  228. package/dist/standalone/chunk-5GIQ6C5N.js +0 -1
  229. package/dist/standalone/chunk-5WJG7FMH.js +0 -1
  230. package/dist/standalone/chunk-63KDHS3H.js +0 -1
  231. package/dist/standalone/chunk-6B6ARRMI.js +0 -1
  232. package/dist/standalone/chunk-6LMO2D54.js +0 -1
  233. package/dist/standalone/chunk-6M7FLLMT.js +0 -1
  234. package/dist/standalone/chunk-6QEXGYWH.js +0 -1
  235. package/dist/standalone/chunk-6UTZXEW3.js +0 -1
  236. package/dist/standalone/chunk-6VAY6L4J.js +0 -1
  237. package/dist/standalone/chunk-7PADVGQX.js +0 -1
  238. package/dist/standalone/chunk-7RGYCU6F.js +0 -1
  239. package/dist/standalone/chunk-7UM5ROG6.js +0 -1
  240. package/dist/standalone/chunk-A566HCBX.js +0 -1
  241. package/dist/standalone/chunk-A5JISKHE.js +0 -1
  242. package/dist/standalone/chunk-ADNRFCMZ.js +0 -1
  243. package/dist/standalone/chunk-AP4PC2M4.js +0 -1
  244. package/dist/standalone/chunk-BFE2DRP6.js +0 -33
  245. package/dist/standalone/chunk-BPEB4KFE.js +0 -1
  246. package/dist/standalone/chunk-BVX45MU5.js +0 -7
  247. package/dist/standalone/chunk-C6GN7ZXJ.js +0 -1
  248. package/dist/standalone/chunk-CL2VZNDI.js +0 -1
  249. package/dist/standalone/chunk-CNA3TVUK.js +0 -1
  250. package/dist/standalone/chunk-CZ6HBDIL.js +0 -1
  251. package/dist/standalone/chunk-D6S7MXW4.js +0 -1
  252. package/dist/standalone/chunk-E26OT26O.js +0 -1
  253. package/dist/standalone/chunk-FCAXVYAX.js +0 -1
  254. package/dist/standalone/chunk-FXPAJDES.js +0 -1
  255. package/dist/standalone/chunk-HHRYM6UW.js +0 -1
  256. package/dist/standalone/chunk-HPRF5LMA.js +0 -1
  257. package/dist/standalone/chunk-IB22LETR.js +0 -1
  258. package/dist/standalone/chunk-IBJVVHV5.js +0 -1
  259. package/dist/standalone/chunk-IENQRRQT.js +0 -1
  260. package/dist/standalone/chunk-IQ4TTHQT.js +0 -1
  261. package/dist/standalone/chunk-ITH5LRWM.js +0 -1
  262. package/dist/standalone/chunk-J6VFG6M5.js +0 -1
  263. package/dist/standalone/chunk-JSDKOE4U.js +0 -1
  264. package/dist/standalone/chunk-JTGGWF7R.js +0 -1
  265. package/dist/standalone/chunk-JZD7ZN3F.js +0 -1
  266. package/dist/standalone/chunk-K3CWB3AM.js +0 -1
  267. package/dist/standalone/chunk-KNFB3FGW.js +0 -1
  268. package/dist/standalone/chunk-KNXWDE4N.js +0 -1
  269. package/dist/standalone/chunk-KRPXOSBL.js +0 -1
  270. package/dist/standalone/chunk-KRY7BYHT.js +0 -1
  271. package/dist/standalone/chunk-KYAG2YMF.js +0 -1
  272. package/dist/standalone/chunk-KZCEJFZF.js +0 -1
  273. package/dist/standalone/chunk-KZILJQX3.js +0 -8
  274. package/dist/standalone/chunk-LEYUH5TS.js +0 -1
  275. package/dist/standalone/chunk-LFM672WN.js +0 -1
  276. package/dist/standalone/chunk-LIGOLZND.js +0 -1
  277. package/dist/standalone/chunk-LPU6YTSU.js +0 -1
  278. package/dist/standalone/chunk-MWJC3S62.js +0 -1
  279. package/dist/standalone/chunk-NP2AQOLE.js +0 -1
  280. package/dist/standalone/chunk-NVKLYDOH.js +0 -1
  281. package/dist/standalone/chunk-O2X2XYCM.js +0 -1
  282. package/dist/standalone/chunk-O3MDWYXF.js +0 -1
  283. package/dist/standalone/chunk-ONG4JEZD.js +0 -1
  284. package/dist/standalone/chunk-OS26JXYA.js +0 -1
  285. package/dist/standalone/chunk-OXFKZ4BM.js +0 -1
  286. package/dist/standalone/chunk-PGTEGUAB.js +0 -1
  287. package/dist/standalone/chunk-PTBUWRBY.js +0 -1
  288. package/dist/standalone/chunk-Q6HA3L2H.js +0 -1
  289. package/dist/standalone/chunk-QGV5ARD2.js +0 -1
  290. package/dist/standalone/chunk-QWRK4ESB.js +0 -1
  291. package/dist/standalone/chunk-RL2ITK2N.js +0 -1
  292. package/dist/standalone/chunk-RTJO3AR4.js +0 -1
  293. package/dist/standalone/chunk-SFY646MC.js +0 -1
  294. package/dist/standalone/chunk-T5UMHPAB.js +0 -1
  295. package/dist/standalone/chunk-T6HV2FQP.js +0 -2
  296. package/dist/standalone/chunk-T7ZKNNGX.js +0 -1
  297. package/dist/standalone/chunk-TCYPNSTV.js +0 -1
  298. package/dist/standalone/chunk-TQM6XHBA.js +0 -1
  299. package/dist/standalone/chunk-TRMWBRRU.js +0 -1
  300. package/dist/standalone/chunk-TW7KJSMR.js +0 -15
  301. package/dist/standalone/chunk-TYD3V4NB.js +0 -1
  302. package/dist/standalone/chunk-TZKLK52W.js +0 -1
  303. package/dist/standalone/chunk-U4RXQSQ7.js +0 -1
  304. package/dist/standalone/chunk-UNZ2UBVL.js +0 -1
  305. package/dist/standalone/chunk-VJRNOSRY.js +0 -1
  306. package/dist/standalone/chunk-W2BCSK5S.js +0 -1
  307. package/dist/standalone/chunk-W7MRISE3.js +0 -1
  308. package/dist/standalone/chunk-WM72PRE3.js +0 -1
  309. package/dist/standalone/chunk-X4WHMCOZ.js +0 -1
  310. package/dist/standalone/chunk-X74GEPSG.js +0 -1
  311. package/dist/standalone/chunk-XKPD4SFN.js +0 -1
  312. package/dist/standalone/chunk-XMSNLMWU.js +0 -1
  313. package/dist/standalone/chunk-XOPFDWXX.js +0 -1
  314. package/dist/standalone/chunk-XQLOVFPP.js +0 -1
  315. package/dist/standalone/chunk-XSHYZPGF.js +0 -1
  316. package/dist/standalone/chunk-XST3UEHU.js +0 -1
  317. package/dist/standalone/chunk-XYR5NST4.js +0 -1
  318. package/dist/standalone/chunk-Y74LIFSL.js +0 -1
  319. package/dist/standalone/chunk-YHTHRYP5.js +0 -1
  320. package/dist/standalone/chunk-YMEKCV27.js +0 -1
  321. package/dist/standalone/chunk-Z5EV64KS.js +0 -1
  322. package/dist/standalone/chunk-ZBON5T5A.js +0 -1
  323. package/dist/standalone/chunk-ZGSL4DPP.js +0 -1
  324. package/dist/standalone/chunk-ZOQTXWPK.js +0 -1
  325. package/dist/standalone/chunk-ZTOREMGH.js +0 -1
  326. package/dist/standalone/chunk-ZZ5GICTF.js +0 -1
  327. /package/dist/standalone/{chunk-UYEZR3BI.js → chunk-P6VNMPWR.js} +0 -0
@@ -1 +1 @@
1
- import{c as Ne}from"react/compiler-runtime";import{useState as Q,useEffect as Se}from"react";import{ConfirmButton as Ie}from"./ConfirmButton-CIXYF6Mg.mjs";import{E as Ee}from"./error-alert-C0R39DO1.mjs";import{L as Me}from"./live-status-D1GasNsH.mjs";import{ShardInput as Te}from"./ShardInput-CoySruKZ.mjs";import{B as _e}from"./badge-r_5B4LHP.mjs";import{B as ke}from"./button-q0UYSmrn.mjs";import{C as we,a as De}from"./card-By2O8ULa.mjs";import{E as Le}from"./empty-state-D7jEML_T.mjs";import{I as Be}from"./input-CXhxesPC.mjs";import{L as me}from"./label-DKFzyHq6.mjs";import{T as Ae,a as Ke,b as fe,c as m,d as je,e as f}from"./table-D0SBiDu-.mjs";import{u as Fe}from"./use-admin-query-CaOm4JS3.mjs";import{u as Oe}from"./use-shard-key-BsP3o5wT.mjs";import{u as qe}from"./use-studio-client-DCA50tF2.mjs";import{useT as He}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as he}from"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import{h as Qe,c as Ue,f as $e,d as ze,b as Ge}from"./internal-hIuTpSbx.mjs";import{r as Pe}from"./shard-history-CaO3C4KQ.mjs";import{jsx as r,jsxs as s}from"react/jsx-runtime";const We=Ue(he.runMigration),yt=i=>{const e=Ne(98),{initialShardKey:pe}=i,re=qe(),t=He(),{queryShardKey:d,setShardKey:ie,shardKey:a}=Oe(pe),[h,ge]=Q(""),[p,ye]=Q("up"),[l,be]=Q(!0),[g,ce]=Q(!1),[c,ne]=Q(null),[U,se]=Q(null);let $;e[0]!==a?($=a.trim(),e[0]=a,e[1]=$):$=e[1];const z=$===d;let G;e[2]===Symbol.for("react.memo_cache_sentinel")?(G={},e[2]=G):G=e[2];let P;e[3]!==d?(P={live:!0,shardKey:d},e[3]=d,e[4]=P):P=e[4];const n=Fe(he.migrationStatus,G,P),o=n.data?.migrations??null,ae=n.error,{errorSource:le,liveError:oe}=n;let W,J;e[5]!==d||e[6]!==n.data?(W=()=>{n.data!==void 0&&Pe(d)},J=[n.data,d],e[5]=d,e[6]=n.data,e[7]=W,e[8]=J):(W=e[7],J=e[8]),Se(W,J);let V;if(e[9]!==re||e[10]!==p||e[11]!==l||e[12]!==h||e[13]!==a||e[14]!==n||e[15]!==t){const u=async()=>{const ue=h.trim();if(ue===""){se(t("Enter a migration id")),ne(null);return}ce(!0),se(null);try{const de=await re.query(We,{direction:p,dryRun:l,id:ue},ze(a));ne(de),n.refetch()}catch(de){const Ce=de;ne(null),se(Ge(Ce))}ce(!1)};V=()=>{$e(u())},e[9]=re,e[10]=p,e[11]=l,e[12]=h,e[13]=a,e[14]=n,e[15]=t,e[16]=V}else V=e[16];const X=V;let Y;e[17]===Symbol.for("react.memo_cache_sentinel")?(Y=u=>{ge(u.target.value)},e[17]=Y):Y=e[17];const ve=Y;let Z;e[18]===Symbol.for("react.memo_cache_sentinel")?(Z=u=>{ye(u.target.value==="down"?"down":"up")},e[18]=Z):Z=e[18];const xe=Z;let ee;e[19]===Symbol.for("react.memo_cache_sentinel")?(ee=u=>{be(u.target.checked)},e[19]=ee):ee=e[19];const Re=ee;let y;e[20]!==ie||e[21]!==a?(y=r(Te,{onChange:ie,testId:"mg-shard-input",value:a}),e[20]=ie,e[21]=a,e[22]=y):y=e[22];let b;e[23]!==oe?(b=r(Me,{message:oe,prefix:"mg"}),e[23]=oe,e[24]=b):b=e[24];let v;e[25]!==y||e[26]!==b?(v=s("div",{className:"flex flex-wrap items-center gap-2",children:[y,b]}),e[25]=y,e[26]=b,e[27]=v):v=e[27];let x;e[28]!==ae||e[29]!==le?(x=ae!==null&&r(Ee,{error:le,testId:"mg-status-error"}),e[28]=ae,e[29]=le,e[30]=x):x=e[30];let R;e[31]!==o||e[32]!==t?(R=o!==null&&o.length===0&&r(Le,{description:t("Data migrations you run against this shard will be tracked here."),icon:r("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children: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"})}),testId:"mg-empty",title:t("No migrations have run on this shard.")}),e[31]=o,e[32]=t,e[33]=R):R=e[33];let C;e[34]!==o||e[35]!==t?(C=o!==null&&o.length>0&&r(we,{className:"overflow-hidden py-0",children:r(De,{className:"px-0",children:s(Ae,{"data-testid":"mg-table",children:[r(Ke,{children:s(fe,{children:[r(m,{children:t("id")}),r(m,{children:t("direction")}),r(m,{children:t("status")}),r(m,{children:t("processed")}),r(m,{children:t("changed")}),r(m,{children:t("updated")}),r(m,{children:t("error")})]})}),r(je,{children:o.map(Je)})]})})}),e[34]=o,e[35]=t,e[36]=C):C=e[36];let N;e[37]!==t?(N=t("Run migration"),e[37]=t,e[38]=N):N=e[38];let S;e[39]!==N?(S=r(me,{children:N}),e[39]=N,e[40]=S):S=e[40];let I;e[41]!==t?(I=t("Migration id"),e[41]=t,e[42]=I):I=e[42];let E;e[43]!==t?(E=t("migration id"),e[43]=t,e[44]=E):E=e[44];let M;e[45]!==h||e[46]!==I||e[47]!==E?(M=r(Be,{"aria-label":I,className:"w-auto","data-testid":"mg-id-input",onChange:ve,placeholder:E,value:h}),e[45]=h,e[46]=I,e[47]=E,e[48]=M):M=e[48];let T;e[49]!==t?(T=t("Direction"),e[49]=t,e[50]=T):T=e[50];let _;e[51]!==t?(_=t("up"),e[51]=t,e[52]=_):_=e[52];let k;e[53]!==_?(k=r("option",{value:"up",children:_}),e[53]=_,e[54]=k):k=e[54];let w;e[55]!==t?(w=t("down"),e[55]=t,e[56]=w):w=e[56];let D;e[57]!==w?(D=r("option",{value:"down",children:w}),e[57]=w,e[58]=D):D=e[58];let L;e[59]!==p||e[60]!==T||e[61]!==k||e[62]!==D?(L=s("select",{"aria-label":T,className:"flex h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"mg-direction",onChange:xe,value:p,children:[k,D]}),e[59]=p,e[60]=T,e[61]=k,e[62]=D,e[63]=L):L=e[63];let B;e[64]!==l?(B=r("input",{checked:l,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:Re,type:"checkbox"}),e[64]=l,e[65]=B):B=e[65];let A;e[66]!==t?(A=t("Dry run"),e[66]=t,e[67]=A):A=e[67];let K;e[68]!==B||e[69]!==A?(K=s(me,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[B,A]}),e[68]=B,e[69]=A,e[70]=K):K=e[70];let j;e[71]!==l||e[72]!==X||e[73]!==g||e[74]!==z||e[75]!==t?(j=l?r(ke,{"data-testid":"mg-run",disabled:g||!z,onClick:X,type:"button",children:t(g?"Running…":"Run")}):r(Ie,{confirmLabel:t(g?"Running…":"Run migration?"),disabled:g||!z,onConfirm:X,testId:"mg-run",children:t("Run")}),e[71]=l,e[72]=X,e[73]=g,e[74]=z,e[75]=t,e[76]=j):j=e[76];let F;e[77]!==M||e[78]!==L||e[79]!==K||e[80]!==j?(F=s("div",{className:"flex flex-wrap items-center gap-2",children:[M,L,K,j]}),e[77]=M,e[78]=L,e[79]=K,e[80]=j,e[81]=F):F=e[81];let O;e[82]!==S||e[83]!==F?(O=s("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[S,F]}),e[82]=S,e[83]=F,e[84]=O):O=e[84];let q;e[85]!==U?(q=U!==null&&r("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:U}),e[85]=U,e[86]=q):q=e[86];let H;e[87]!==c||e[88]!==t?(H=c!==null&&s("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[c.dryRun?t("Dry run: "):"",t("{status} — processed",{status:c.status}),c.processed,t(", changed"),c.changed]}),e[87]=c,e[88]=t,e[89]=H):H=e[89];let te;return e[90]!==v||e[91]!==x||e[92]!==R||e[93]!==C||e[94]!==O||e[95]!==q||e[96]!==H?(te=s("div",{className:"flex flex-col gap-3 pt-4","data-testid":"lunora-migrations",children:[v,x,R,C,O,q,H]}),e[90]=v,e[91]=x,e[92]=R,e[93]=C,e[94]=O,e[95]=q,e[96]=H,e[97]=te):te=e[97],te};function Je(i){return s(fe,{"data-testid":`mg-row-${i.id}`,children:[r(f,{children:i.id}),r(f,{children:i.direction}),r(f,{children:r(_e,{variant:"secondary",children:i.status})}),r(f,{children:i.processed}),r(f,{children:i.changed}),r(f,{children:Qe(i.updatedAt)}),r(f,{children:i.error??""})]},i.id)}export{yt as MigrationsPanel};
1
+ import{c as Ne}from"react/compiler-runtime";import{useState as Q,useEffect as Se}from"react";import{ConfirmButton as Ie}from"./ConfirmButton-CIXYF6Mg.mjs";import{E as Ee}from"./error-alert-DKXm5h19.mjs";import{L as Me}from"./live-status-D1GasNsH.mjs";import{ShardInput as Te}from"./ShardInput-CoySruKZ.mjs";import{B as _e}from"./badge-r_5B4LHP.mjs";import{B as ke}from"./button-q0UYSmrn.mjs";import{C as we,a as De}from"./card-By2O8ULa.mjs";import{E as Le}from"./empty-state-D7jEML_T.mjs";import{I as Be}from"./input-CXhxesPC.mjs";import{L as me}from"./label-DKFzyHq6.mjs";import{T as Ae,a as Ke,b as fe,c as m,d as je,e as f}from"./table-D0SBiDu-.mjs";import{u as Fe}from"./use-admin-query-CaOm4JS3.mjs";import{u as Oe}from"./use-shard-key-BsP3o5wT.mjs";import{u as qe}from"./use-studio-client-DCA50tF2.mjs";import{useT as He}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as he}from"./ADMIN_FUNCTIONS-DUXsXId1.mjs";import{h as Qe,c as Ue,f as $e,d as ze,b as Ge}from"./internal-hIuTpSbx.mjs";import{r as Pe}from"./shard-history-CaO3C4KQ.mjs";import{jsx as r,jsxs as s}from"react/jsx-runtime";const We=Ue(he.runMigration),yt=i=>{const e=Ne(98),{initialShardKey:pe}=i,re=qe(),t=He(),{queryShardKey:d,setShardKey:ie,shardKey:a}=Oe(pe),[h,ge]=Q(""),[p,ye]=Q("up"),[l,be]=Q(!0),[g,ce]=Q(!1),[c,ne]=Q(null),[U,se]=Q(null);let $;e[0]!==a?($=a.trim(),e[0]=a,e[1]=$):$=e[1];const z=$===d;let G;e[2]===Symbol.for("react.memo_cache_sentinel")?(G={},e[2]=G):G=e[2];let P;e[3]!==d?(P={live:!0,shardKey:d},e[3]=d,e[4]=P):P=e[4];const n=Fe(he.migrationStatus,G,P),o=n.data?.migrations??null,ae=n.error,{errorSource:le,liveError:oe}=n;let W,J;e[5]!==d||e[6]!==n.data?(W=()=>{n.data!==void 0&&Pe(d)},J=[n.data,d],e[5]=d,e[6]=n.data,e[7]=W,e[8]=J):(W=e[7],J=e[8]),Se(W,J);let V;if(e[9]!==re||e[10]!==p||e[11]!==l||e[12]!==h||e[13]!==a||e[14]!==n||e[15]!==t){const u=async()=>{const ue=h.trim();if(ue===""){se(t("Enter a migration id")),ne(null);return}ce(!0),se(null);try{const de=await re.query(We,{direction:p,dryRun:l,id:ue},ze(a));ne(de),n.refetch()}catch(de){const Ce=de;ne(null),se(Ge(Ce))}ce(!1)};V=()=>{$e(u())},e[9]=re,e[10]=p,e[11]=l,e[12]=h,e[13]=a,e[14]=n,e[15]=t,e[16]=V}else V=e[16];const X=V;let Y;e[17]===Symbol.for("react.memo_cache_sentinel")?(Y=u=>{ge(u.target.value)},e[17]=Y):Y=e[17];const ve=Y;let Z;e[18]===Symbol.for("react.memo_cache_sentinel")?(Z=u=>{ye(u.target.value==="down"?"down":"up")},e[18]=Z):Z=e[18];const xe=Z;let ee;e[19]===Symbol.for("react.memo_cache_sentinel")?(ee=u=>{be(u.target.checked)},e[19]=ee):ee=e[19];const Re=ee;let y;e[20]!==ie||e[21]!==a?(y=r(Te,{onChange:ie,testId:"mg-shard-input",value:a}),e[20]=ie,e[21]=a,e[22]=y):y=e[22];let b;e[23]!==oe?(b=r(Me,{message:oe,prefix:"mg"}),e[23]=oe,e[24]=b):b=e[24];let v;e[25]!==y||e[26]!==b?(v=s("div",{className:"flex flex-wrap items-center gap-2",children:[y,b]}),e[25]=y,e[26]=b,e[27]=v):v=e[27];let x;e[28]!==ae||e[29]!==le?(x=ae!==null&&r(Ee,{error:le,testId:"mg-status-error"}),e[28]=ae,e[29]=le,e[30]=x):x=e[30];let R;e[31]!==o||e[32]!==t?(R=o!==null&&o.length===0&&r(Le,{description:t("Data migrations you run against this shard will be tracked here."),icon:r("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children: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"})}),testId:"mg-empty",title:t("No migrations have run on this shard.")}),e[31]=o,e[32]=t,e[33]=R):R=e[33];let C;e[34]!==o||e[35]!==t?(C=o!==null&&o.length>0&&r(we,{className:"overflow-hidden py-0",children:r(De,{className:"px-0",children:s(Ae,{"data-testid":"mg-table",children:[r(Ke,{children:s(fe,{children:[r(m,{children:t("id")}),r(m,{children:t("direction")}),r(m,{children:t("status")}),r(m,{children:t("processed")}),r(m,{children:t("changed")}),r(m,{children:t("updated")}),r(m,{children:t("error")})]})}),r(je,{children:o.map(Je)})]})})}),e[34]=o,e[35]=t,e[36]=C):C=e[36];let N;e[37]!==t?(N=t("Run migration"),e[37]=t,e[38]=N):N=e[38];let S;e[39]!==N?(S=r(me,{children:N}),e[39]=N,e[40]=S):S=e[40];let I;e[41]!==t?(I=t("Migration id"),e[41]=t,e[42]=I):I=e[42];let E;e[43]!==t?(E=t("migration id"),e[43]=t,e[44]=E):E=e[44];let M;e[45]!==h||e[46]!==I||e[47]!==E?(M=r(Be,{"aria-label":I,className:"w-auto","data-testid":"mg-id-input",onChange:ve,placeholder:E,value:h}),e[45]=h,e[46]=I,e[47]=E,e[48]=M):M=e[48];let T;e[49]!==t?(T=t("Direction"),e[49]=t,e[50]=T):T=e[50];let _;e[51]!==t?(_=t("up"),e[51]=t,e[52]=_):_=e[52];let k;e[53]!==_?(k=r("option",{value:"up",children:_}),e[53]=_,e[54]=k):k=e[54];let w;e[55]!==t?(w=t("down"),e[55]=t,e[56]=w):w=e[56];let D;e[57]!==w?(D=r("option",{value:"down",children:w}),e[57]=w,e[58]=D):D=e[58];let L;e[59]!==p||e[60]!==T||e[61]!==k||e[62]!==D?(L=s("select",{"aria-label":T,className:"flex h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"mg-direction",onChange:xe,value:p,children:[k,D]}),e[59]=p,e[60]=T,e[61]=k,e[62]=D,e[63]=L):L=e[63];let B;e[64]!==l?(B=r("input",{checked:l,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:Re,type:"checkbox"}),e[64]=l,e[65]=B):B=e[65];let A;e[66]!==t?(A=t("Dry run"),e[66]=t,e[67]=A):A=e[67];let K;e[68]!==B||e[69]!==A?(K=s(me,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[B,A]}),e[68]=B,e[69]=A,e[70]=K):K=e[70];let j;e[71]!==l||e[72]!==X||e[73]!==g||e[74]!==z||e[75]!==t?(j=l?r(ke,{"data-testid":"mg-run",disabled:g||!z,onClick:X,type:"button",children:t(g?"Running…":"Run")}):r(Ie,{confirmLabel:t(g?"Running…":"Run migration?"),disabled:g||!z,onConfirm:X,testId:"mg-run",children:t("Run")}),e[71]=l,e[72]=X,e[73]=g,e[74]=z,e[75]=t,e[76]=j):j=e[76];let F;e[77]!==M||e[78]!==L||e[79]!==K||e[80]!==j?(F=s("div",{className:"flex flex-wrap items-center gap-2",children:[M,L,K,j]}),e[77]=M,e[78]=L,e[79]=K,e[80]=j,e[81]=F):F=e[81];let O;e[82]!==S||e[83]!==F?(O=s("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[S,F]}),e[82]=S,e[83]=F,e[84]=O):O=e[84];let q;e[85]!==U?(q=U!==null&&r("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:U}),e[85]=U,e[86]=q):q=e[86];let H;e[87]!==c||e[88]!==t?(H=c!==null&&s("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[c.dryRun?t("Dry run: "):"",t("{status} — processed",{status:c.status}),c.processed,t(", changed"),c.changed]}),e[87]=c,e[88]=t,e[89]=H):H=e[89];let te;return e[90]!==v||e[91]!==x||e[92]!==R||e[93]!==C||e[94]!==O||e[95]!==q||e[96]!==H?(te=s("div",{className:"flex flex-col gap-3 pt-4","data-testid":"lunora-migrations",children:[v,x,R,C,O,q,H]}),e[90]=v,e[91]=x,e[92]=R,e[93]=C,e[94]=O,e[95]=q,e[96]=H,e[97]=te):te=e[97],te};function Je(i){return s(fe,{"data-testid":`mg-row-${i.id}`,children:[r(f,{children:i.id}),r(f,{children:i.direction}),r(f,{children:r(_e,{variant:"secondary",children:i.status})}),r(f,{children:i.processed}),r(f,{children:i.changed}),r(f,{children:Qe(i.updatedAt)}),r(f,{children:i.error??""})]},i.id)}export{yt as MigrationsPanel};
@@ -0,0 +1 @@
1
+ import"./assistant-provider-Bp72uWsq.mjs";import{S as c}from"./studio-gZfpz1wC.mjs";import"./ErrorBoundary-BWNF98VF.mjs";import"./operation-console-provider-DoloEvon.mjs";import"./badge-r_5B4LHP.mjs";import"./input-CXhxesPC.mjs";import"./skeleton-DX1gfixl.mjs";import"./home-panel-5fGktYeD.mjs";import"./DEFAULT_LOCALE-BQ3jRT74.mjs";import"./StudioI18nProvider-CGXCPnQn.mjs";import"./data-view-params-C-_G-biH.mjs";import"./internal-hIuTpSbx.mjs";import"./utils-bhneXptQ.mjs";import"./CommandPalette-BZCHLpst.mjs";export{c as Studio};
@@ -1 +1 @@
1
- import{c as O}from"react/compiler-runtime";import{LunoraAdminClient as G}from"@lunora/client/admin";import{LunoraProvider as H}from"@lunora/react";import{useState as B,useEffect as $}from"react";import{ErrorBoundary as z}from"./ErrorBoundary-BWNF98VF.mjs";import{u as U,B as V,T as Y,a as q,S as J}from"./studio-UhUrPz5J.mjs";import Q from"./useDebounced-DVeQ5-oW.mjs";import{useT as j,createStudioI18n as X}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{StudioI18nProvider as D}from"./StudioI18nProvider-CGXCPnQn.mjs";import{r as Z}from"./internal-hIuTpSbx.mjs";import{w as R}from"./recording-client-DAipTA_n.mjs";import F from"./STUDIO_ROOT_CLASS-C6MccdVk.mjs";import{a as K}from"./browser-storage-BH1MxLZs.mjs";import{c as W}from"./utils-bhneXptQ.mjs";import{B as ee}from"./button-q0UYSmrn.mjs";import{I as te}from"./input-CXhxesPC.mjs";import{jsx as f,jsxs as C}from"react/jsx-runtime";const M="lunora-studio-admin-token",oe=()=>{try{return K("session")?.getItem(M)??""}catch{return""}},ne=m=>{const e=K("session");if(e!==void 0)try{m===""?e.removeItem(M):e.setItem(M,m)}catch{}},ie="/_lunora/admin/ws-token",se=1e4,le=m=>{const e=m;return typeof e?.token=="string"&&e.token.length>0&&typeof e.expiresAtMs=="number"},re=m=>{const{adminToken:e,baseUrl:a}=m,o=m.fetchImpl??fetch;let l=a;for(;l.endsWith("/");)l=l.slice(0,-1);const r=`${l}${ie}`;let t,n;const i=async()=>{const s=await o(r,{headers:{authorization:`Bearer ${e}`},method:"POST"});if(!s.ok)throw new Error(`ws-token mint failed: ${String(s.status)}`);const u=await s.json().catch(()=>{});if(!le(u))throw new Error("ws-token mint failed: malformed response body");return t=u,u.token};return{getToken:async()=>t!==void 0&&t.expiresAtMs-se>Date.now()?t.token:(n??=i().finally(()=>{n=void 0}),n),invalidate:()=>{t=void 0}}},ae=m=>{const e=O(42),{onSubmit:a}=m,o=j(),[l,r]=B("");let t;e[0]!==l?(t=l.trim(),e[0]=l,e[1]=t):t=e[1];const n=t;let i;e[2]!==a||e[3]!==n?(i=_=>{_.preventDefault(),n!==""&&a(n)},e[2]=a,e[3]=n,e[4]=i):i=e[4];const s=i;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=f("div",{className:"h-10 w-10 text-foreground",children:f(V,{})}),e[5]=u):u=e[5];let d;e[6]!==o?(d=o("Connect to Lunora Studio"),e[6]=o,e[7]=d):d=e[7];let v;e[8]!==d?(v=f("h1",{className:"text-base font-semibold text-foreground",children:d}),e[8]=d,e[9]=v):v=e[9];let k;e[10]!==o?(k=o("Enter your admin token to access the studio."),e[10]=o,e[11]=k):k=e[11];let p;e[12]!==k?(p=f("p",{className:"text-[13px] text-muted-foreground",children:k}),e[12]=k,e[13]=p):p=e[13];let h;e[14]!==v||e[15]!==p?(h=C("div",{className:"flex flex-col items-center gap-3 text-center",children:[u,C("div",{className:"flex flex-col gap-1",children:[v,p]})]}),e[14]=v,e[15]=p,e[16]=h):h=e[16];let g;e[17]!==o?(g=o("admin token"),e[17]=o,e[18]=g):g=e[18];let c;e[19]!==g?(c=f("label",{className:"text-xs font-medium text-foreground",htmlFor:"lunora-studio-login-token",children:g}),e[19]=g,e[20]=c):c=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=_=>{r(_.target.value)},e[21]=b):b=e[21];let x;e[22]!==l?(x=f(te,{autoComplete:"off",autoFocus:!0,"data-testid":"lunora-studio-login-token",id:"lunora-studio-login-token",onChange:b,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:l}),e[22]=l,e[23]=x):x=e[23];let T;e[24]!==o?(T=o("From your worker's LUNORA_ADMIN_TOKEN — your project's .dev.vars in dev, or a deployment secret in production."),e[24]=o,e[25]=T):T=e[25];let I;e[26]!==T?(I=f("p",{className:"text-[11px] text-muted-foreground",children:T}),e[26]=T,e[27]=I):I=e[27];let S;e[28]!==c||e[29]!==x||e[30]!==I?(S=C("div",{className:"flex flex-col gap-1.5",children:[c,x,I]}),e[28]=c,e[29]=x,e[30]=I,e[31]=S):S=e[31];const E=n==="";let y;e[32]!==o?(y=o("Connect"),e[32]=o,e[33]=y):y=e[33];let w;e[34]!==E||e[35]!==y?(w=f(ee,{"data-testid":"lunora-studio-login-submit",disabled:E,type:"submit",children:y}),e[34]=E,e[35]=y,e[36]=w):w=e[36];let N;return e[37]!==s||e[38]!==S||e[39]!==w||e[40]!==h?(N=C("form",{className:"flex w-full max-w-sm flex-col gap-5 rounded-xl border border-border bg-card p-7 shadow-lg","data-testid":"lunora-studio-login",onSubmit:s,children:[h,S,w]}),e[37]=s,e[38]=S,e[39]=w,e[40]=h,e[41]=N):N=e[41],N},de=m=>{const e=O(10),{i18n:a,onSubmit:o}=m,{resolvedTheme:l}=U(),r=l==="dark"&&"dark";let t;e[0]!==r?(t=W(F,r,"flex h-dvh items-center justify-center bg-sidebar p-6 text-sm text-foreground"),e[0]=r,e[1]=t):t=e[1];let n;e[2]!==o?(n=f(ae,{onSubmit:o}),e[2]=o,e[3]=n):n=e[3];let i;e[4]!==a||e[5]!==n?(i=f(D,{i18n:a,children:n}),e[4]=a,e[5]=n,e[6]=i):i=e[6];let s;return e[7]!==t||e[8]!==i?(s=f("div",{className:t,"data-testid":"lunora-studio-login-root",children:i}),e[7]=t,e[8]=i,e[9]=s):s=e[9],s},ce=m=>{const e=O(15),{basePath:a,chrome:o,studio:l}=m,r=j();let t;e[0]!==r?(t=r("Studio failed"),e[0]=r,e[1]=t):t=e[1];let n;e[2]!==r?(n=r("Studio"),e[2]=r,e[3]=n):n=e[3];let i;e[4]!==r?(i=r("Try again"),e[4]=r,e[5]=i):i=e[5];let s;e[6]!==a||e[7]!==o||e[8]!==l?(s=f(J,{...l,basePath:a,chrome:o}),e[6]=a,e[7]=o,e[8]=l,e[9]=s):s=e[9];let u;return e[10]!==t||e[11]!==n||e[12]!==i||e[13]!==s?(u=f(z,{fallbackTitle:t,label:n,retryLabel:i,children:s}),e[10]=t,e[11]=n,e[12]=i,e[13]=s,e[14]=u):u=e[14],u},fe=m=>{const e=O(20),{basePath:a,clearToken:o,client:l,i18n:r,onTokenChange:t,rulesInstalled:n,studio:i,token:s}=m,{resolvedTheme:u}=U();let d;e[0]!==o||e[1]!==t||e[2]!==n||e[3]!==s?(d={clearToken:o,onTokenChange:t,rulesInstalled:n,token:s},e[0]=o,e[1]=t,e[2]=n,e[3]=s,e[4]=d):d=e[4];const v=d,k=u==="dark"&&"dark";let p;e[5]!==k?(p=W(F,k,"flex h-dvh flex-col overflow-hidden bg-sidebar text-sm text-foreground"),e[5]=k,e[6]=p):p=e[6];let h;e[7]!==a||e[8]!==v||e[9]!==i?(h=f(q,{children:f(ce,{basePath:a,chrome:v,studio:i})}),e[7]=a,e[8]=v,e[9]=i,e[10]=h):h=e[10];let g;e[11]!==r||e[12]!==h?(g=f(D,{i18n:r,children:h}),e[11]=r,e[12]=h,e[13]=g):g=e[13];let c;e[14]!==l||e[15]!==g?(c=f(H,{client:l,children:g}),e[14]=l,e[15]=g,e[16]=c):c=e[16];let b;return e[17]!==p||e[18]!==c?(b=f("div",{className:p,"data-testid":"lunora-studio-app",children:c}),e[17]=p,e[18]=c,e[19]=b):b=e[19],b},Ee=m=>{const e=O(28);let a;e[0]!==m?(a=m===void 0?{}:m,e[0]=m,e[1]=a):a=e[1];const{adminToken:o,basePath:l,baseUrl:r,client:t,rulesInstalled:n,studio:i,locale:s}=a;let u;e[2]!==o?(u=()=>o??oe(),e[2]=o,e[3]=u):u=e[3];const[d,v]=B(u);let k,p;e[4]!==d?(k=()=>{ne(d)},p=[d],e[4]=d,e[5]=k,e[6]=p):(k=e[5],p=e[6]),$(k,p);const h=Q(d,300,d==="");let g;e:{if(t!==void 0){let A;e[7]!==t?(A=R(t),e[7]=t,e[8]=A):A=e[8],g=A;break e}let _;if(e[9]!==r||e[10]!==h){const A=Z(r),P=h===""?void 0:re({adminToken:h,baseUrl:A}),L=new G({url:A,...P===void 0?{}:{wsTicket:P.getToken}});P!==void 0&&(L.setAuthToken(h),L.onTokenExpired(P.invalidate)),_=R(L),e[9]=r,e[10]=h,e[11]=_}else _=e[11];g=_}const c=g;let b,x;e[12]!==c||e[13]!==t?(b=()=>()=>{t===void 0&&c.close()},x=[c,t],e[12]=c,e[13]=t,e[14]=b,e[15]=x):(b=e[14],x=e[15]),$(b,x);let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=_=>{v(_.target.value)},e[16]=T):T=e[16];const I=T;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{v("")},e[17]=S):S=e[17];const E=S;let y;e[18]!==s?(y=X(s),e[18]=s,e[19]=y):y=e[19];const w=y;let N;return e[20]!==l||e[21]!==c||e[22]!==w||e[23]!==t||e[24]!==n||e[25]!==i||e[26]!==d?(N=f(Y,{children:d===""&&t===void 0?f(de,{i18n:w,onSubmit:v}):f(fe,{basePath:l,clearToken:E,client:c,i18n:w,onTokenChange:I,rulesInstalled:n,studio:i,token:d})}),e[20]=l,e[21]=c,e[22]=w,e[23]=t,e[24]=n,e[25]=i,e[26]=d,e[27]=N):N=e[27],N};export{Ee as StudioApp};
1
+ import{c as O}from"react/compiler-runtime";import{LunoraAdminClient as G}from"@lunora/client/admin";import{LunoraProvider as H}from"@lunora/react";import{useState as B,useEffect as $}from"react";import{ErrorBoundary as z}from"./ErrorBoundary-BWNF98VF.mjs";import{u as U,B as V,T as Y,a as q,S as J}from"./studio-gZfpz1wC.mjs";import Q from"./useDebounced-DVeQ5-oW.mjs";import{useT as j,createStudioI18n as X}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{StudioI18nProvider as D}from"./StudioI18nProvider-CGXCPnQn.mjs";import{r as Z}from"./internal-hIuTpSbx.mjs";import{w as R}from"./recording-client-z4CBi0y8.mjs";import F from"./STUDIO_ROOT_CLASS-C6MccdVk.mjs";import{a as K}from"./browser-storage-BH1MxLZs.mjs";import{c as W}from"./utils-bhneXptQ.mjs";import{B as ee}from"./button-q0UYSmrn.mjs";import{I as te}from"./input-CXhxesPC.mjs";import{jsx as f,jsxs as C}from"react/jsx-runtime";const M="lunora-studio-admin-token",oe=()=>{try{return K("session")?.getItem(M)??""}catch{return""}},ne=m=>{const e=K("session");if(e!==void 0)try{m===""?e.removeItem(M):e.setItem(M,m)}catch{}},ie="/_lunora/admin/ws-token",se=1e4,le=m=>{const e=m;return typeof e?.token=="string"&&e.token.length>0&&typeof e.expiresAtMs=="number"},re=m=>{const{adminToken:e,baseUrl:a}=m,o=m.fetchImpl??fetch;let l=a;for(;l.endsWith("/");)l=l.slice(0,-1);const r=`${l}${ie}`;let t,n;const i=async()=>{const s=await o(r,{headers:{authorization:`Bearer ${e}`},method:"POST"});if(!s.ok)throw new Error(`ws-token mint failed: ${String(s.status)}`);const u=await s.json().catch(()=>{});if(!le(u))throw new Error("ws-token mint failed: malformed response body");return t=u,u.token};return{getToken:async()=>t!==void 0&&t.expiresAtMs-se>Date.now()?t.token:(n??=i().finally(()=>{n=void 0}),n),invalidate:()=>{t=void 0}}},ae=m=>{const e=O(42),{onSubmit:a}=m,o=j(),[l,r]=B("");let t;e[0]!==l?(t=l.trim(),e[0]=l,e[1]=t):t=e[1];const n=t;let i;e[2]!==a||e[3]!==n?(i=_=>{_.preventDefault(),n!==""&&a(n)},e[2]=a,e[3]=n,e[4]=i):i=e[4];const s=i;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=f("div",{className:"h-10 w-10 text-foreground",children:f(V,{})}),e[5]=u):u=e[5];let d;e[6]!==o?(d=o("Connect to Lunora Studio"),e[6]=o,e[7]=d):d=e[7];let v;e[8]!==d?(v=f("h1",{className:"text-base font-semibold text-foreground",children:d}),e[8]=d,e[9]=v):v=e[9];let k;e[10]!==o?(k=o("Enter your admin token to access the studio."),e[10]=o,e[11]=k):k=e[11];let p;e[12]!==k?(p=f("p",{className:"text-[13px] text-muted-foreground",children:k}),e[12]=k,e[13]=p):p=e[13];let h;e[14]!==v||e[15]!==p?(h=C("div",{className:"flex flex-col items-center gap-3 text-center",children:[u,C("div",{className:"flex flex-col gap-1",children:[v,p]})]}),e[14]=v,e[15]=p,e[16]=h):h=e[16];let g;e[17]!==o?(g=o("admin token"),e[17]=o,e[18]=g):g=e[18];let c;e[19]!==g?(c=f("label",{className:"text-xs font-medium text-foreground",htmlFor:"lunora-studio-login-token",children:g}),e[19]=g,e[20]=c):c=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=_=>{r(_.target.value)},e[21]=b):b=e[21];let x;e[22]!==l?(x=f(te,{autoComplete:"off",autoFocus:!0,"data-testid":"lunora-studio-login-token",id:"lunora-studio-login-token",onChange:b,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:l}),e[22]=l,e[23]=x):x=e[23];let T;e[24]!==o?(T=o("From your worker's LUNORA_ADMIN_TOKEN — your project's .dev.vars in dev, or a deployment secret in production."),e[24]=o,e[25]=T):T=e[25];let I;e[26]!==T?(I=f("p",{className:"text-[11px] text-muted-foreground",children:T}),e[26]=T,e[27]=I):I=e[27];let S;e[28]!==c||e[29]!==x||e[30]!==I?(S=C("div",{className:"flex flex-col gap-1.5",children:[c,x,I]}),e[28]=c,e[29]=x,e[30]=I,e[31]=S):S=e[31];const E=n==="";let y;e[32]!==o?(y=o("Connect"),e[32]=o,e[33]=y):y=e[33];let w;e[34]!==E||e[35]!==y?(w=f(ee,{"data-testid":"lunora-studio-login-submit",disabled:E,type:"submit",children:y}),e[34]=E,e[35]=y,e[36]=w):w=e[36];let N;return e[37]!==s||e[38]!==S||e[39]!==w||e[40]!==h?(N=C("form",{className:"flex w-full max-w-sm flex-col gap-5 rounded-xl border border-border bg-card p-7 shadow-lg","data-testid":"lunora-studio-login",onSubmit:s,children:[h,S,w]}),e[37]=s,e[38]=S,e[39]=w,e[40]=h,e[41]=N):N=e[41],N},de=m=>{const e=O(10),{i18n:a,onSubmit:o}=m,{resolvedTheme:l}=U(),r=l==="dark"&&"dark";let t;e[0]!==r?(t=W(F,r,"flex h-dvh items-center justify-center bg-sidebar p-6 text-sm text-foreground"),e[0]=r,e[1]=t):t=e[1];let n;e[2]!==o?(n=f(ae,{onSubmit:o}),e[2]=o,e[3]=n):n=e[3];let i;e[4]!==a||e[5]!==n?(i=f(D,{i18n:a,children:n}),e[4]=a,e[5]=n,e[6]=i):i=e[6];let s;return e[7]!==t||e[8]!==i?(s=f("div",{className:t,"data-testid":"lunora-studio-login-root",children:i}),e[7]=t,e[8]=i,e[9]=s):s=e[9],s},ce=m=>{const e=O(15),{basePath:a,chrome:o,studio:l}=m,r=j();let t;e[0]!==r?(t=r("Studio failed"),e[0]=r,e[1]=t):t=e[1];let n;e[2]!==r?(n=r("Studio"),e[2]=r,e[3]=n):n=e[3];let i;e[4]!==r?(i=r("Try again"),e[4]=r,e[5]=i):i=e[5];let s;e[6]!==a||e[7]!==o||e[8]!==l?(s=f(J,{...l,basePath:a,chrome:o}),e[6]=a,e[7]=o,e[8]=l,e[9]=s):s=e[9];let u;return e[10]!==t||e[11]!==n||e[12]!==i||e[13]!==s?(u=f(z,{fallbackTitle:t,label:n,retryLabel:i,children:s}),e[10]=t,e[11]=n,e[12]=i,e[13]=s,e[14]=u):u=e[14],u},fe=m=>{const e=O(20),{basePath:a,clearToken:o,client:l,i18n:r,onTokenChange:t,rulesInstalled:n,studio:i,token:s}=m,{resolvedTheme:u}=U();let d;e[0]!==o||e[1]!==t||e[2]!==n||e[3]!==s?(d={clearToken:o,onTokenChange:t,rulesInstalled:n,token:s},e[0]=o,e[1]=t,e[2]=n,e[3]=s,e[4]=d):d=e[4];const v=d,k=u==="dark"&&"dark";let p;e[5]!==k?(p=W(F,k,"flex h-dvh flex-col overflow-hidden bg-sidebar text-sm text-foreground"),e[5]=k,e[6]=p):p=e[6];let h;e[7]!==a||e[8]!==v||e[9]!==i?(h=f(q,{children:f(ce,{basePath:a,chrome:v,studio:i})}),e[7]=a,e[8]=v,e[9]=i,e[10]=h):h=e[10];let g;e[11]!==r||e[12]!==h?(g=f(D,{i18n:r,children:h}),e[11]=r,e[12]=h,e[13]=g):g=e[13];let c;e[14]!==l||e[15]!==g?(c=f(H,{client:l,children:g}),e[14]=l,e[15]=g,e[16]=c):c=e[16];let b;return e[17]!==p||e[18]!==c?(b=f("div",{className:p,"data-testid":"lunora-studio-app",children:c}),e[17]=p,e[18]=c,e[19]=b):b=e[19],b},Ee=m=>{const e=O(28);let a;e[0]!==m?(a=m===void 0?{}:m,e[0]=m,e[1]=a):a=e[1];const{adminToken:o,basePath:l,baseUrl:r,client:t,rulesInstalled:n,studio:i,locale:s}=a;let u;e[2]!==o?(u=()=>o??oe(),e[2]=o,e[3]=u):u=e[3];const[d,v]=B(u);let k,p;e[4]!==d?(k=()=>{ne(d)},p=[d],e[4]=d,e[5]=k,e[6]=p):(k=e[5],p=e[6]),$(k,p);const h=Q(d,300,d==="");let g;e:{if(t!==void 0){let A;e[7]!==t?(A=R(t),e[7]=t,e[8]=A):A=e[8],g=A;break e}let _;if(e[9]!==r||e[10]!==h){const A=Z(r),P=h===""?void 0:re({adminToken:h,baseUrl:A}),L=new G({url:A,...P===void 0?{}:{wsTicket:P.getToken}});P!==void 0&&(L.setAuthToken(h),L.onTokenExpired(P.invalidate)),_=R(L),e[9]=r,e[10]=h,e[11]=_}else _=e[11];g=_}const c=g;let b,x;e[12]!==c||e[13]!==t?(b=()=>()=>{t===void 0&&c.close()},x=[c,t],e[12]=c,e[13]=t,e[14]=b,e[15]=x):(b=e[14],x=e[15]),$(b,x);let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=_=>{v(_.target.value)},e[16]=T):T=e[16];const I=T;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{v("")},e[17]=S):S=e[17];const E=S;let y;e[18]!==s?(y=X(s),e[18]=s,e[19]=y):y=e[19];const w=y;let N;return e[20]!==l||e[21]!==c||e[22]!==w||e[23]!==t||e[24]!==n||e[25]!==i||e[26]!==d?(N=f(Y,{children:d===""&&t===void 0?f(de,{i18n:w,onSubmit:v}):f(fe,{basePath:l,clearToken:E,client:c,i18n:w,onTokenChange:I,rulesInstalled:n,studio:i,token:d})}),e[20]=l,e[21]=c,e[22]=w,e[23]=t,e[24]=n,e[25]=i,e[26]=d,e[27]=N):N=e[27],N};export{Ee as StudioApp};
@@ -0,0 +1,5 @@
1
+ import{useState as v}from"react";import{u as N}from"./assistant-provider-Bp72uWsq.mjs";import{E as T}from"./error-alert-DKXm5h19.mjs";import{C as E,a as k}from"./card-By2O8ULa.mjs";import{T as A,a as L,b as m,c as p,d as w,e as l}from"./table-D0SBiDu-.mjs";import{useT as C}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{c as R}from"./utils-bhneXptQ.mjs";import{jsxs as a,jsx as s}from"react/jsx-runtime";const $={ERROR:"error",INFO:"info",WARN:"warning"},J=t=>{const n=typeof t.metadata.table=="string"?t.metadata.table:void 0;return{description:`${t.detail} ${t.remediation}`,entity:n,issueType:t.title,key:t.cacheKey,level:$[t.level]}},V=["error","warning","info"],I={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},O=(t,n)=>({error:t("Errors"),info:t("Info"),warning:t("Warnings")})[n],S=(t,n,i)=>({error:t("{count} errors",{count:i}),info:t("{count} suggestions",{count:i}),warning:t("{count} warnings",{count:i})})[n],D=(t,n)=>({error:t("No errors detected"),info:t("No suggestions"),warning:t("No warnings detected")})[n],H=t=>{const n={error:0,info:0,warning:0};for(const i of t??[])n[i.level]+=1;return n},K=({error:t=null,errorSource:n,rows:i,shardKey:u,testId:o,toolbar:f})=>{const r=C(),c=N(),h=c!==void 0&&!c.unavailable,[d,b]=v("error"),x=H(i),g=(i??[]).filter(e=>e.level===d),y=e=>{b(e.currentTarget.dataset.level)};return a("div",{className:"flex flex-col gap-3","data-testid":o,children:[s("div",{className:"flex border-b border-border",role:"tablist",children:V.map(e=>a("button",{"aria-selected":d===e,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":e,"data-testid":`${o}-tab-${e}`,onClick:y,role:"tab",type:"button",children:[a("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[s("span",{"aria-hidden":"true",className:R("size-2 rounded-sm",I[e])}),O(r,e)]}),s("span",{className:"ps-4 text-xs text-muted-foreground",children:S(r,e,x[e])})]},e))}),f!==void 0&&s("div",{className:"flex flex-wrap items-center gap-2",children:f}),t!==null&&s(T,{error:n??t,shardKey:u,testId:`${o}-error`}),s(E,{className:"overflow-hidden py-0",children:s(k,{className:"px-0",children:a(A,{children:[s(L,{children:a(m,{children:[s(p,{children:r("Issue type")}),s(p,{children:r("Entity/item")}),s(p,{children:r("Description")})]})}),s(w,{children:g.length===0?s(m,{children:a(l,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${o}-empty`,children:[s("span",{className:"block text-sm font-medium text-foreground",children:D(r,d)}),s("span",{className:"block text-sm",children:r("Nothing to report for this deployment.")})]})}):g.map(e=>a(m,{children:[s(l,{className:"font-medium text-foreground",children:e.issueType}),s(l,{className:"font-mono text-xs text-muted-foreground",children:e.entity??"—"}),a(l,{className:"text-muted-foreground",children:[s("span",{children:e.description}),(e.action!==void 0||h)&&a("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.action,h&&s("button",{className:"text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"advisor-ask-assistant",onClick:()=>{c.openAssistant({ask:r(`The Lunora advisor reported: {finding}.
2
+
3
+ {description}
4
+
5
+ What does this mean for my app, and how should I fix it?`,{description:e.description,finding:e.entity===void 0?e.issueType:r("{issueType} on {entity}",{entity:e.entity,issueType:e.issueType})}),shardKey:u,suggestions:[r("How do I verify this is fixed?")],title:e.issueType})},type:"button",children:r("Ask the assistant")})]})]})]},e.key))})]})})})]})};export{K as A,J as a};
@@ -0,0 +1 @@
1
+ import{c as R}from"react/compiler-runtime";import{use as b,createContext as u,useState as k}from"react";import{u as K}from"./use-admin-query-CaOm4JS3.mjs";import{ADMIN_FUNCTIONS as x}from"./ADMIN_FUNCTIONS-DUXsXId1.mjs";import{jsx as w}from"react/jsx-runtime";const S=u(void 0),C={},N="New chat",F=(t,s)=>({id:t,name:s?.title??N,schema:s?.schema??[],shardKey:s?.shardKey,suggestions:s?.suggestions??[],turns:[]}),T=(t,s)=>[...t.sessions,s].slice(-10),f=(t,s)=>{const n=`chat-${String(t.seq+1)}`;return{activeId:n,draft:s?.draft===void 0?void 0:{id:t.seq+1,text:s.draft},hasEditor:t.hasEditor,insertRequest:void 0,open:!0,pendingAsk:s?.ask===void 0?void 0:{id:t.seq+1,sessionId:n,text:s.ask},seq:t.seq+1,sessions:T(t,F(n,s))}},l=(t,s)=>t.find(n=>n.id===s),D=(t,s,n)=>t.map(v=>v.id===s?{...v,schema:n}:v),O=(t,s,n)=>t.map(v=>v.id===s?{...v,schema:[],shardKey:n}:v),U=(t,s)=>t.filter(n=>n.id!==s),y=(t,s,n)=>t.map(v=>v.id===s?{...v,turns:n}:v),P=t=>{const s=R(16),{children:n}=t;let v;s[0]===Symbol.for("react.memo_cache_sentinel")?(v={shardKey:""},s[0]=v):v=s[0];const E=K(x.aiAvailable,C,v);let m;s[1]===Symbol.for("react.memo_cache_sentinel")?(m={activeId:void 0,draft:void 0,hasEditor:!1,insertRequest:void 0,open:!1,pendingAsk:void 0,seq:0,sessions:[]},s[1]=m):m=s[1];const[a,h]=k(m);let c;s[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>({close:()=>{h($)},deleteChat:i=>{h(e=>{const o=U(e.sessions,i);return{...e,activeId:e.activeId===i?o.at(-1)?.id:e.activeId,open:o.length===0?!1:e.open,sessions:o}})},newChat:i=>{h(e=>f(e,i))},openAssistant:i=>{h(e=>{const o=e.activeId===void 0?void 0:l(e.sessions,e.activeId);return i?.ask!==void 0||o===void 0||(i?.shardKey??"")!==(o.shardKey??"")?f(e,i):{...e,draft:i?.draft===void 0?e.draft:{id:e.seq+1,text:i.draft},open:!0,sessions:i?.schema===void 0?e.sessions:D(e.sessions,o.id,i.schema),seq:e.seq+1}})},rebindShard:(i,e)=>{h(o=>{const d=o.activeId===void 0?void 0:l(o.sessions,o.activeId);return!o.open||d===void 0||(d.shardKey??"")!==i||i===e?o:d.turns.length===0?{...o,sessions:O(o.sessions,d.id,e)}:f(o,{shardKey:e,title:d.name})})},requestInsert:i=>{h(e=>({...e,insertRequest:{id:e.seq+1,sql:i},seq:e.seq+1}))},setHasEditor:i=>{h(e=>e.hasEditor===i?e:{...e,hasEditor:i})},takeInsert:i=>{h(e=>e.insertRequest?.id===i?{...e,insertRequest:void 0}:e)},selectChat:i=>{h(e=>({...e,activeId:i,open:!0}))},branchFrom:(i,e)=>{h(o=>{const d=l(o.sessions,i);if(d===void 0)return o;const g=f(o,{schema:d.schema,shardKey:d.shardKey,title:d.name});return{...g,sessions:y(g.sessions,g.activeId??"",d.turns.slice(0,e+1))}})},setTurns:(i,e)=>{h(o=>{const d=l(o.sessions,i);return d===void 0?o:{...o,sessions:y(o.sessions,i,typeof e=="function"?e(d.turns):e)}})},toggle:()=>{h(j)},truncateFrom:(i,e)=>{h(o=>{const d=l(o.sessions,i);return d===void 0?o:{...o,sessions:y(o.sessions,i,d.turns.slice(0,e))}})},takeAsk:i=>{h(e=>e.pendingAsk?.id===i?{...e,pendingAsk:void 0}:e)}}),s[2]=c):c=s[2];const[I]=k(c),q=E.data?.available!==!0;let p;s[3]!==I||s[4]!==a.activeId||s[5]!==a.draft||s[6]!==a.hasEditor||s[7]!==a.insertRequest||s[8]!==a.open||s[9]!==a.pendingAsk||s[10]!==a.sessions||s[11]!==q?(p={...I,activeId:a.activeId,draft:a.draft,hasEditor:a.hasEditor,insertRequest:a.insertRequest,open:a.open,pendingAsk:a.pendingAsk,sessions:a.sessions,unavailable:q},s[3]=I,s[4]=a.activeId,s[5]=a.draft,s[6]=a.hasEditor,s[7]=a.insertRequest,s[8]=a.open,s[9]=a.pendingAsk,s[10]=a.sessions,s[11]=q,s[12]=p):p=s[12];const A=p;let r;return s[13]!==n||s[14]!==A?(r=w(S,{value:A,children:n}),s[13]=n,s[14]=A,s[15]=r):r=s[15],r},Q=()=>b(S);function $(t){return{...t,open:!1}}function j(t){return!t.open&&t.activeId===void 0?f(t,void 0):{...t,open:!t.open}}export{P as A,Q as u};
@@ -0,0 +1 @@
1
+ const o=(t,e)=>e(t==="unsafe-response"?"The model returned a statement that is not read-only, so it was discarded.":t==="too-long"?"The statement is too long to rewrite. Select a shorter part of it.":t==="empty-response"?"The model returned nothing usable.":"The model could not be reached.");export{o as a};
@@ -1 +1 @@
1
- const s="https://dash.cloudflare.com/?to=/:account",L=`${s}/workers-and-pages/observability`,o=`${s}/workers-and-pages`,R=`${s}/r2`,a=`${s}/workers/d1`,r=`${s}/workers/durable-objects`;export{o as C,L as a,a as b,r as c,R as d};
1
+ const s="https://dash.cloudflare.com/?to=/:account",L=`${s}/workers-and-pages/observability`,o=`${s}/workers-and-pages`,R=`${s}/r2`,a=`${s}/workers/d1`,r=`${s}/workers/durable-objects`;export{L as C,o as a,a as b,r as c,R as d};
@@ -0,0 +1,6 @@
1
+ import{c as U}from"react/compiler-runtime";import{flattenHint as D}from"@lunora/errors";import{useT as V}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{e as $,a as K,b as E}from"./internal-hIuTpSbx.mjs";import{o as M}from"./recording-client-z4CBi0y8.mjs";import{u as W}from"./assistant-provider-Bp72uWsq.mjs";import{u as _}from"./operation-console-provider-DoloEvon.mjs";import{A as z}from"./alert-PB5W11MM.mjs";import{jsx as x,jsxs as B}from"react/jsx-runtime";const Z=H=>{const e=U(51),{className:I,error:t,shardKey:T,testId:O}=H,s=V(),o=_(),v=W(),j=v!==void 0&&!v.unavailable;let l,a,n,c,m,u,d,r,i,f;if(e[0]!==v||e[1]!==I||e[2]!==t||e[3]!==o||e[4]!==T||e[5]!==s||e[6]!==O){const w=$(t);let y;e[17]!==t?(y=K(t),e[17]=t,e[18]=y):y=e[18],n=y;let A;e[19]!==t?(A=M(t),e[19]=t,e[20]=A):A=e[20];const q=A,N=t?.why;let C;e[21]!==o||e[22]!==q?(C=()=>{o?.openConsole({errorsOnly:!0,seq:q})},e[21]=o,e[22]=q,e[23]=C):C=e[23],c=C,a=()=>{const S=w===void 0?"":`
2
+
3
+ ${s("The studio suggested: {hint}",{hint:D(w)})}`;v?.openAssistant({ask:s(`The studio reported this error:
4
+ {message}{detail}
5
+
6
+ What causes it, and how do I fix it?`,{detail:S,message:E(t)}),shardKey:T,title:s("Debug error")})},l=z,m=I,u=O,d="destructive";let g;e[24]!==t?(g=E(t),e[24]=t,e[25]=g):g=e[25],e[26]!==g?(r=x("p",{className:"font-medium",children:g}),e[26]=g,e[27]=r):r=e[27],e[28]!==N?(i=typeof N=="string"?x("p",{className:"mt-1 text-xs opacity-90",children:N}):null,e[28]=N,e[29]=i):i=e[29],f=w===void 0?null:x("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:D(w)}),e[0]=v,e[1]=I,e[2]=t,e[3]=o,e[4]=T,e[5]=s,e[6]=O,e[7]=l,e[8]=a,e[9]=n,e[10]=c,e[11]=m,e[12]=u,e[13]=d,e[14]=r,e[15]=i,e[16]=f}else l=e[7],a=e[8],n=e[9],c=e[10],m=e[11],u=e[12],d=e[13],r=e[14],i=e[15],f=e[16];let p;e[30]!==n?(p=n===void 0?null:x("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:n,rel:"noreferrer",target:"_blank",children:"View error docs"}),e[30]=n,e[31]=p):p=e[31];let h;e[32]!==o||e[33]!==c||e[34]!==s?(h=o===void 0?null:x("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-show-in-console",onClick:c,type:"button",children:s("Show in console")}),e[32]=o,e[33]=c,e[34]=s,e[35]=h):h=e[35];let b;e[36]!==a||e[37]!==j||e[38]!==s?(b=j?x("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-ask-assistant",onClick:a,type:"button",children:s("Ask the assistant")}):null,e[36]=a,e[37]=j,e[38]=s,e[39]=b):b=e[39];let k;return e[40]!==l||e[41]!==m||e[42]!==u||e[43]!==d||e[44]!==r||e[45]!==i||e[46]!==f||e[47]!==p||e[48]!==h||e[49]!==b?(k=B(l,{className:m,testId:u,variant:d,children:[r,i,f,p,h,b]}),e[40]=l,e[41]=m,e[42]=u,e[43]=d,e[44]=r,e[45]=i,e[46]=f,e[47]=p,e[48]=h,e[49]=b,e[50]=k):k=e[50],k};export{Z as E};
@@ -1,3 +1,3 @@
1
- import{c as _}from"react/compiler-runtime";import{useNavigate as Xe}from"@tanstack/react-router";import{B as et}from"./badge-r_5B4LHP.mjs";import{C as P,a as tt}from"./card-By2O8ULa.mjs";import{E as nt}from"./empty-state-D7jEML_T.mjs";import{u as ve}from"./use-admin-query-CaOm4JS3.mjs";import{useT as T}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as ye}from"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import{c as lt,f as Ne,d as at,w as rt,g as ot,n as it}from"./internal-hIuTpSbx.mjs";import{c as st}from"./utils-bhneXptQ.mjs";import{deriveInsights as ct}from"./DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs";import{useState as Ue,useEffect as qe}from"react";import{u as Ke}from"./use-studio-client-DCA50tF2.mjs";import{jsx as a,jsxs as h}from"react/jsx-runtime";import{B as He}from"./button-q0UYSmrn.mjs";const dt=lt(ye.studioFeatures),We={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,notifications:!0,payments:!0,privacy:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},ut=t=>{if(t===null||typeof t!="object")return;const{id:e,name:n,unsupported:s}=t;if(!(typeof e!="string"||typeof n!="string"||!Array.isArray(s)))return{id:e,name:n,unsupported:s.filter(l=>typeof l=="string")}},mt=t=>{if(t===null||typeof t!="object")return We;const e=t,n=s=>typeof e[s]=="boolean"?e[s]:!0;return{analytics:n("analytics"),auth:n("auth"),containers:n("containers"),flags:n("flags"),kv:n("kv"),mail:n("mail"),notifications:n("notifications"),payments:n("payments"),privacy:n("privacy"),platform:ut(e.platform),queues:n("queues"),scheduler:n("scheduler"),storage:n("storage"),vectors:n("vectors"),workflows:n("workflows")}},ft={...We,settled:!1},pt=()=>{const t=_(3),e=Ke(),[n,s]=Ue(void 0);let l,r;return t[0]!==e?(l=()=>{const i=new AbortController;return Ne((async()=>{let o;try{o={...mt(await e.query(dt,{},at(""))),settled:!0}}catch{o={...We,settled:!0}}i.signal.aborted||s({client:e,features:o})})()),()=>{i.abort()}},r=[e],t[0]=e,t[1]=l,t[2]=r):(l=t[1],r=t[2]),qe(l,r),n?.client===e?n.features:ft},ht=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:a("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},gt=t=>{const e=_(24),{group:n}=t,s=T(),l=Xe();let r;e[0]!==n.tab||e[1]!==l?(r=()=>{Ne(l({to:`/${n.tab}`}))},e[0]=n.tab,e[1]=l,e[2]=r):r=e[2];const i=r,o=n.bindings.length;let c;e[3]!==n.label?(c=a("span",{className:"text-sm font-medium text-foreground",children:n.label}),e[3]=n.label,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=a(ht,{}),e[5]=u):u=e[5];let m;e[6]!==c?(m=h("div",{className:"flex items-center justify-between",children:[c,u]}),e[6]=c,e[7]=m):m=e[7];let d;e[8]!==o||e[9]!==s?(d=o===1?s("1 binding"):s("{count} bindings",{count:o}),e[8]=o,e[9]=s,e[10]=d):d=e[10];let f;e[11]!==d?(f=a("span",{className:"text-xs text-muted-foreground",children:d}),e[11]=d,e[12]=f):f=e[12];let p;e[13]!==o||e[14]!==n.bindings?(p=o>0&&a("div",{className:"flex flex-wrap gap-1.5",children:n.bindings.map(yt)}),e[13]=o,e[14]=n.bindings,e[15]=p):p=e[15];let g;e[16]!==m||e[17]!==f||e[18]!==p?(g=h(tt,{className:"flex flex-col gap-2 py-4",children:[m,f,p]}),e[16]=m,e[17]=f,e[18]=p,e[19]=g):g=e[19];let x;return e[20]!==n.testId||e[21]!==i||e[22]!==g?(x=a(P,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":n.testId,onClick:i,children:g}),e[20]=n.testId,e[21]=i,e[22]=g,e[23]=x):x=e[23],x},Ve=["kv","files","vectors"],xt=(t,e)=>[...t.filter(n=>n.tab!==e.tab),e].toSorted((n,s)=>Ve.indexOf(n.tab)-Ve.indexOf(s.tab)),bt=()=>{const t=_(19),e=Ke(),n=pt(),s=T();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],t[0]=l):l=t[0];const[r,i]=Ue(l);let o,c;if(t[1]!==e||t[2]!==n.kv||t[3]!==n.storage||t[4]!==n.vectors||t[5]!==s?(o=()=>{const g={cancelled:!1},x=[{enabled:n.kv,label:s("KV Namespaces"),load:async()=>(await e.listKvNamespaces()).map(vt),tab:"kv",testId:"home-binding-kv"},{enabled:n.storage,label:s("R2 Buckets"),load:()=>e.listStorageBuckets(),tab:"files",testId:"home-binding-r2"},{enabled:n.vectors,label:s("Vectorize Indexes"),load:async()=>(await e.listVectorIndexes()).map(Nt),tab:"vectors",testId:"home-binding-vectors"}];for(const b of x)b.enabled&&Ne((async()=>{try{const v=await b.load();if(!g.cancelled){const S={bindings:v,label:b.label,tab:b.tab,testId:b.testId};i(w=>xt(w,S))}}catch{}})());return()=>{g.cancelled=!0}},c=[e,n.kv,n.storage,n.vectors,s],t[1]=e,t[2]=n.kv,t[3]=n.storage,t[4]=n.vectors,t[5]=s,t[6]=o,t[7]=c):(o=t[6],c=t[7]),qe(o,c),r.length===0)return null;let u;t[8]!==s?(u=s("Bindings"),t[8]=s,t[9]=u):u=t[9];let m;t[10]!==u?(m=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:u}),t[10]=u,t[11]=m):m=t[11];let d;t[12]!==r?(d=r.map(_t),t[12]=r,t[13]=d):d=t[13];let f;t[14]!==d?(f=a("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:d}),t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==m||t[17]!==f?(p=h("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[m,f]}),t[16]=m,t[17]=f,t[18]=p):p=t[18],p};function yt(t){return a(et,{variant:"secondary",children:t},t)}function vt(t){return t.binding}function Nt(t){return t.name}function _t(t){return a(gt,{group:t},t.tab)}const St=[{name:"lunora_list_functions",summary:"list every query, mutation, and action with its path"},{name:"lunora_list_tables",summary:"list the schema's tables"},{name:"lunora_get_function_schema",summary:"read a function's argument JSON Schema before calling it"},{name:"lunora_run_query",summary:"run a read-only query"},{name:"lunora_run_mutation",summary:"run a mutation — writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action — writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],wt=t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),kt=t=>{const e=St.map(n=>`- ${n.name} — ${n.summary}`).join(`
1
+ import{c as _}from"react/compiler-runtime";import{useNavigate as Xe}from"@tanstack/react-router";import{B as et}from"./badge-r_5B4LHP.mjs";import{C as P,a as tt}from"./card-By2O8ULa.mjs";import{E as nt}from"./empty-state-D7jEML_T.mjs";import{u as ve}from"./use-admin-query-CaOm4JS3.mjs";import{useT as T}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as ye}from"./ADMIN_FUNCTIONS-DUXsXId1.mjs";import{c as lt,f as Ne,d as at,w as rt,g as ot,n as it}from"./internal-hIuTpSbx.mjs";import{c as st}from"./utils-bhneXptQ.mjs";import{deriveInsights as ct}from"./DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs";import{useState as Ue,useEffect as qe}from"react";import{u as Ke}from"./use-studio-client-DCA50tF2.mjs";import{jsx as a,jsxs as h}from"react/jsx-runtime";import{B as He}from"./button-q0UYSmrn.mjs";const dt=lt(ye.studioFeatures),We={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,notifications:!0,payments:!0,privacy:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},ut=t=>{if(t===null||typeof t!="object")return;const{id:e,name:n,unsupported:s}=t;if(!(typeof e!="string"||typeof n!="string"||!Array.isArray(s)))return{id:e,name:n,unsupported:s.filter(l=>typeof l=="string")}},mt=t=>{if(t===null||typeof t!="object")return We;const e=t,n=s=>typeof e[s]=="boolean"?e[s]:!0;return{analytics:n("analytics"),auth:n("auth"),containers:n("containers"),flags:n("flags"),kv:n("kv"),mail:n("mail"),notifications:n("notifications"),payments:n("payments"),privacy:n("privacy"),platform:ut(e.platform),queues:n("queues"),scheduler:n("scheduler"),storage:n("storage"),vectors:n("vectors"),workflows:n("workflows")}},ft={...We,settled:!1},pt=()=>{const t=_(3),e=Ke(),[n,s]=Ue(void 0);let l,r;return t[0]!==e?(l=()=>{const i=new AbortController;return Ne((async()=>{let o;try{o={...mt(await e.query(dt,{},at(""))),settled:!0}}catch{o={...We,settled:!0}}i.signal.aborted||s({client:e,features:o})})()),()=>{i.abort()}},r=[e],t[0]=e,t[1]=l,t[2]=r):(l=t[1],r=t[2]),qe(l,r),n?.client===e?n.features:ft},ht=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:a("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},gt=t=>{const e=_(24),{group:n}=t,s=T(),l=Xe();let r;e[0]!==n.tab||e[1]!==l?(r=()=>{Ne(l({to:`/${n.tab}`}))},e[0]=n.tab,e[1]=l,e[2]=r):r=e[2];const i=r,o=n.bindings.length;let c;e[3]!==n.label?(c=a("span",{className:"text-sm font-medium text-foreground",children:n.label}),e[3]=n.label,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=a(ht,{}),e[5]=u):u=e[5];let m;e[6]!==c?(m=h("div",{className:"flex items-center justify-between",children:[c,u]}),e[6]=c,e[7]=m):m=e[7];let d;e[8]!==o||e[9]!==s?(d=o===1?s("1 binding"):s("{count} bindings",{count:o}),e[8]=o,e[9]=s,e[10]=d):d=e[10];let f;e[11]!==d?(f=a("span",{className:"text-xs text-muted-foreground",children:d}),e[11]=d,e[12]=f):f=e[12];let p;e[13]!==o||e[14]!==n.bindings?(p=o>0&&a("div",{className:"flex flex-wrap gap-1.5",children:n.bindings.map(yt)}),e[13]=o,e[14]=n.bindings,e[15]=p):p=e[15];let g;e[16]!==m||e[17]!==f||e[18]!==p?(g=h(tt,{className:"flex flex-col gap-2 py-4",children:[m,f,p]}),e[16]=m,e[17]=f,e[18]=p,e[19]=g):g=e[19];let x;return e[20]!==n.testId||e[21]!==i||e[22]!==g?(x=a(P,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":n.testId,onClick:i,children:g}),e[20]=n.testId,e[21]=i,e[22]=g,e[23]=x):x=e[23],x},Ve=["kv","files","vectors"],xt=(t,e)=>[...t.filter(n=>n.tab!==e.tab),e].toSorted((n,s)=>Ve.indexOf(n.tab)-Ve.indexOf(s.tab)),bt=()=>{const t=_(19),e=Ke(),n=pt(),s=T();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],t[0]=l):l=t[0];const[r,i]=Ue(l);let o,c;if(t[1]!==e||t[2]!==n.kv||t[3]!==n.storage||t[4]!==n.vectors||t[5]!==s?(o=()=>{const g={cancelled:!1},x=[{enabled:n.kv,label:s("KV Namespaces"),load:async()=>(await e.listKvNamespaces()).map(vt),tab:"kv",testId:"home-binding-kv"},{enabled:n.storage,label:s("R2 Buckets"),load:()=>e.listStorageBuckets(),tab:"files",testId:"home-binding-r2"},{enabled:n.vectors,label:s("Vectorize Indexes"),load:async()=>(await e.listVectorIndexes()).map(Nt),tab:"vectors",testId:"home-binding-vectors"}];for(const b of x)b.enabled&&Ne((async()=>{try{const v=await b.load();if(!g.cancelled){const S={bindings:v,label:b.label,tab:b.tab,testId:b.testId};i(w=>xt(w,S))}}catch{}})());return()=>{g.cancelled=!0}},c=[e,n.kv,n.storage,n.vectors,s],t[1]=e,t[2]=n.kv,t[3]=n.storage,t[4]=n.vectors,t[5]=s,t[6]=o,t[7]=c):(o=t[6],c=t[7]),qe(o,c),r.length===0)return null;let u;t[8]!==s?(u=s("Bindings"),t[8]=s,t[9]=u):u=t[9];let m;t[10]!==u?(m=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:u}),t[10]=u,t[11]=m):m=t[11];let d;t[12]!==r?(d=r.map(_t),t[12]=r,t[13]=d):d=t[13];let f;t[14]!==d?(f=a("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:d}),t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==m||t[17]!==f?(p=h("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[m,f]}),t[16]=m,t[17]=f,t[18]=p):p=t[18],p};function yt(t){return a(et,{variant:"secondary",children:t},t)}function vt(t){return t.binding}function Nt(t){return t.name}function _t(t){return a(gt,{group:t},t.tab)}const St=[{name:"lunora_list_functions",summary:"list every query, mutation, and action with its path"},{name:"lunora_list_tables",summary:"list the schema's tables"},{name:"lunora_get_function_schema",summary:"read a function's argument JSON Schema before calling it"},{name:"lunora_run_query",summary:"run a read-only query"},{name:"lunora_run_mutation",summary:"run a mutation — writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action — writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],wt=t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),kt=t=>{const e=St.map(n=>`- ${n.name} — ${n.summary}`).join(`
2
2
  `);return[`You have a Lunora MCP server connected to the deployment at ${t}.`,"It exposes this backend's functions and schema so you can inspect and operate it:",e,"",`Start by calling lunora_list_functions and lunora_list_tables to learn what exists, then lunora_get_function_schema before any run call. The full HTTP API is also documented at ${t}/_lunora/admin/openapi (that endpoint needs the same admin token the MCP server is configured with).`].join(`
3
3
  `)},Ct=1500,At=()=>{const t=_(40),e=T(),{url:n}=Ke();let s;t[0]!==n?(s=rt(n),t[0]=n,t[1]=s):s=t[1];const l=s,[r,i]=Ue(null);let o,c;t[2]!==r?(o=()=>{if(r===null)return;const I=globalThis.setTimeout(()=>{i(null)},Ct);return()=>{globalThis.clearTimeout(I)}},c=[r],t[2]=r,t[3]=o,t[4]=c):(o=t[3],c=t[4]),qe(o,c);let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=(I,L)=>{ot(L)&&i(I)},t[5]=u):u=t[5];const m=u;let d;t[6]!==l?(d=()=>{m("config",wt(l))},t[6]=l,t[7]=d):d=t[7];const f=d;let p;t[8]!==l?(p=()=>{m("prompt",kt(l))},t[8]=l,t[9]=p):p=t[9];const g=p;let x;t[10]!==e?(x=e("Connect an AI agent"),t[10]=e,t[11]=x):x=t[11];let b;t[12]!==x?(b=a("span",{className:"text-sm font-medium text-foreground",children:x}),t[12]=x,t[13]=b):b=t[13];let v;t[14]!==e?(v=e("Drive this deployment from an AI agent over the Model Context Protocol — it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in."),t[14]=e,t[15]=v):v=t[15];let S;t[16]!==v?(S=a("span",{className:"text-xs text-muted-foreground",children:v}),t[16]=v,t[17]=S):S=t[17];let w;t[18]!==b||t[19]!==S?(w=h("div",{className:"flex flex-col gap-1.5 p-4",children:[b,S]}),t[18]=b,t[19]=S,t[20]=w):w=t[20];let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=a("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[21]=$):$=t[21];let y;t[22]!==r||t[23]!==e?(y=e(r==="config"?"Copied":"Copy MCP config"),t[22]=r,t[23]=e,t[24]=y):y=t[24];let k;t[25]!==f||t[26]!==y?(k=a(He,{"data-testid":"home-connect-agent-copy-config",onClick:f,size:"xs",variant:"outline",children:y}),t[25]=f,t[26]=y,t[27]=k):k=t[27];let C;t[28]!==r||t[29]!==e?(C=e(r==="prompt"?"Copied":"Copy agent prompt"),t[28]=r,t[29]=e,t[30]=C):C=t[30];let A;t[31]!==g||t[32]!==C?(A=a(He,{"data-testid":"home-connect-agent-copy-prompt",onClick:g,size:"xs",variant:"outline",children:C}),t[31]=g,t[32]=C,t[33]=A):A=t[33];let N;t[34]!==k||t[35]!==A?(N=h("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[$,h("div",{className:"flex flex-wrap gap-2",children:[k,A]})]}),t[34]=k,t[35]=A,t[36]=N):N=t[36];let M;return t[37]!==w||t[38]!==N?(M=h(P,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[w,N]}),t[37]=w,t[38]=N,t[39]=M):M=t[39],M},Mt=112,Qe=32,Le=5,Ge=1,$t=3,It=t=>{const e=t.slice(-16),n=Math.max(0,...e),s=Qe-Le*2,l=(Mt-Le*2)/e.length;return e.map((r,i)=>{const o=n>0?Math.max(0,r)/n*s:0;return{height:Math.max(0,o-$t),width:Math.max(0,l-Ge*2),x:Le+i*l+Ge,y:Qe-Le-o}})},Tt=t=>{const e=_(4),{data:n}=t;let s;e[0]!==n?(s=It(n).map(Lt),e[0]=n,e[1]=s):s=e[1];let l;return e[2]!==s?(l=a("svg",{"aria-hidden":"true",className:"h-8 w-28 fill-foreground","data-testid":"home-sparkline",viewBox:"0 0 112 32",children:s}),e[2]=s,e[3]=l):l=e[3],l};function Lt(t){return a("rect",{height:t.height,rx:2,width:t.width,x:t.x,y:t.y},t.x)}const Ot=3,Rt=(t,e)=>{if(e==null)return t("cache not enabled");const n=e.hits+e.misses;return n===0?t("no cache traffic yet"):`${Math.round(e.hits/n*100).toString()}% ${t("cache hit")}`},Fe=t=>{if(t<1e3)return`${String(Math.round(t))}ms`;const e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},Et=(t,e)=>{const n=Math.max(0,Math.round((e-t)/1e3));if(n<60)return`${String(n)}s ago`;const s=Math.round(n/60);if(s<60)return`${String(s)}m ago`;const l=Math.round(s/60);return l<24?`${String(l)}h ago`:`${String(Math.round(l/24))}d ago`},Je=(t,e)=>{if(t===void 0||t.length===0)return[];const n=new Map;for(const s of t)n.set(s.bucketMs,(n.get(s.bucketMs)??0)+s[e]);return[...n.entries()].toSorted(([s],[l])=>s-l).map(([,s])=>s)},Ye=(t,e=!0)=>{if(t.length<4)return null;const n=Math.floor(t.length/2),s=t.slice(0,n).reduce((i,o)=>i+o,0),l=t.slice(n).reduce((i,o)=>i+o,0);if(s===0)return null;const r=(l-s)/s*100;return{positive:e?r>=0:r<=0,text:`${r>=0?"+":""}${r.toFixed(1)}%`}},Oe=t=>{const e=_(24),{delta:n,footer:s,label:l,trend:r,unit:i,value:o}=t,c=T();let u;e[0]!==l?(u=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[0]=l,e[1]=u):u=e[1];let m;e[2]!==o?(m=a("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[2]=o,e[3]=m):m=e[3];let d;e[4]!==i?(d=i!==void 0&&a("span",{className:"text-xs text-muted-foreground",children:i}),e[4]=i,e[5]=d):d=e[5];let f;e[6]!==m||e[7]!==d?(f=h("span",{className:"flex items-baseline gap-1.5",children:[m,d]}),e[6]=m,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==r?(p=r!==void 0&&r.length>=Ot&&a(Tt,{data:r}),e[9]=r,e[10]=p):p=e[10];let g;e[11]!==f||e[12]!==p?(g=h("div",{className:"flex items-center justify-between gap-3",children:[f,p]}),e[11]=f,e[12]=p,e[13]=g):g=e[13];let x;e[14]!==u||e[15]!==g?(x=h("div",{className:"flex flex-col gap-2.5 p-4",children:[u,g]}),e[14]=u,e[15]=g,e[16]=x):x=e[16];let b;e[17]!==n||e[18]!==s||e[19]!==c?(b=n==null?s!=null&&a("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s}):h("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[a("span",{className:st("font-semibold",n.positive?"text-success":"text-destructive"),children:n.text})," ",a("span",{className:"text-muted-foreground",children:c("vs. prev.")})]}),e[17]=n,e[18]=s,e[19]=c,e[20]=b):b=e[20];let v;return e[21]!==x||e[22]!==b?(v=h(P,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=v):v=e[23],v},Bt=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("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:a("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},je=t=>{const e=_(7),{command:n,label:s}=t;let l;e[0]!==s?(l=a("div",{className:"p-4",children:a("span",{className:"text-sm font-medium text-foreground",children:s})}),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==n?(r=a("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:a("code",{className:"font-mono text-xs text-muted-foreground",children:n})}),e[2]=n,e[3]=r):r=e[3];let i;return e[4]!==l||e[5]!==r?(i=h(P,{className:"justify-between gap-0 py-0",children:[l,r]}),e[4]=l,e[5]=r,e[6]=i):i=e[6],i},Ze=t=>{const e=_(18),{count:n,onView:s,testId:l,title:r}=t,i=T();let o;e[0]!==r?(o=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[0]=r,e[1]=o):o=e[1];let c;e[2]!==n||e[3]!==i?(c=n===null?a("span",{className:"text-xs text-muted-foreground",children:i("No data yet")}):a(et,{variant:n>0?"destructive":"success",children:n>0?n:i("All clear")}),e[2]=n,e[3]=i,e[4]=c):c=e[4];let u;e[5]!==o||e[6]!==c?(u=h("div",{className:"flex items-start justify-between gap-2 p-4",children:[o,c]}),e[5]=o,e[6]=c,e[7]=u):u=e[7];let m;e[8]!==i?(m=i("View"),e[8]=i,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=a(Bt,{}),e[10]=d):d=e[10];let f;e[11]!==s||e[12]!==m?(f=h("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:s,type:"button",children:[m,d]}),e[11]=s,e[12]=m,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f||e[16]!==l?(p=h(P,{className:"justify-between gap-0 py-0","data-testid":l,children:[u,f]}),e[14]=u,e[15]=f,e[16]=l,e[17]=p):p=e[17],p},Pt=t=>{const e=_(7),{functions:n}=t,s=T();let l;if(e[0]!==n||e[1]!==s){const r=[...n].toSorted(Ut).slice(0,5);let i;e[3]!==s?(i=s("Top functions"),e[3]=s,e[4]=i):i=e[4];let o;e[5]!==i?(o=a("div",{className:"border-b border-border px-4 py-3",children:a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],l=h(P,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[o,r.length===0?a("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No functions called yet.")}):h("div",{className:"divide-y divide-border",children:[h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[a("span",{children:s("Function")}),a("span",{className:"text-end",children:s("Calls")}),a("span",{className:"w-12 text-end",children:s("Avg")}),a("span",{className:"w-8 text-end",children:s("Err")})]}),r.map(qt)]})]}),e[0]=n,e[1]=s,e[2]=l}else l=e[2];return l},Dt=t=>{const e=_(26),{subs:n}=t,s=T();let l;e[0]!==s?(l=s("Live connections"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==l?(r=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[2]=l,e[3]=r):r=e[3];const i=n?.totalConnections??0;let o;e[4]!==i?(o=i.toLocaleString(),e[4]=i,e[5]=o):o=e[5];let c;e[6]!==o?(c=a("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let u;e[8]!==s?(u=s("sockets"),e[8]=s,e[9]=u):u=e[9];let m;e[10]!==u?(m=a("span",{className:"text-xs text-muted-foreground",children:u}),e[10]=u,e[11]=m):m=e[11];let d;e[12]!==c||e[13]!==m?(d=h("span",{className:"flex items-baseline gap-1.5",children:[c,m]}),e[12]=c,e[13]=m,e[14]=d):d=e[14];const f=n?.totalSubscriptions??0;let p;e[15]!==f?(p=f.toLocaleString(),e[15]=f,e[16]=p):p=e[16];let g;e[17]!==s?(g=s("active subscriptions"),e[17]=s,e[18]=g):g=e[18];let x;e[19]!==p||e[20]!==g?(x=h("span",{className:"text-[11px] text-muted-foreground",children:[p," ",g]}),e[19]=p,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==r||e[24]!==d?(b=a(P,{"data-testid":"home-live-connections",children:h(tt,{className:"flex flex-col gap-2.5 py-4",children:[r,d,x]})}),e[22]=x,e[23]=r,e[24]=d,e[25]=b):b=e[25],b},jt=t=>{const e=_(7),{entries:n}=t,s=T();let l;if(e[0]!==n||e[1]!==s){const r=Date.now();let i;e[3]!==s?(i=s("Recent activity"),e[3]=s,e[4]=i):i=e[4];let o;e[5]!==i?(o=a("div",{className:"border-b border-border px-4 py-3",children:a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],l=h(P,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[o,n.length===0?a("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No recent activity.")}):a("ul",{className:"divide-y divide-border",children:n.slice(0,5).map(c=>h("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[h("span",{className:"flex min-w-0 items-center gap-2",children:[a("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),h("span",{className:"truncate text-foreground",children:[c.op,c.table!==void 0&&h("span",{className:"text-muted-foreground",children:[" · ",c.table,c.id===void 0?"":`#${c.id}`]})]})]}),a("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Et(c.ts,r)})]},c.seq))})]}),e[0]=n,e[1]=s,e[2]=l}else l=e[2];return l},Ft=t=>{const e=t.reduce((n,s)=>n+s.calls,0);return e===0?null:t.reduce((n,s)=>n+s.totalDurationMs,0)/e},as=t=>{const e=_(149),{initialShardKey:n}=t,s=T(),l=Xe(),r=n??"";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let o;e[1]!==r?(o={shardKey:r},e[1]=r,e[2]=o):o=e[2];const c=ve(ye.getMetrics,i,o);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let m;e[4]!==r?(m={shardKey:r},e[4]=r,e[5]=m):m=e[5];const d=ve(ye.getFunctionStats,u,m);let f,p;e[6]===Symbol.for("react.memo_cache_sentinel")?(f={},p={shardKey:""},e[6]=f,e[7]=p):(f=e[6],p=e[7]);const g=ve(ye.getSecurityAudit,f,p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==r?(b={shardKey:r},e[9]=r,e[10]=b):b=e[10];const v=ve(ye.listSubscriptions,x,b);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={},e[11]=S):S=e[11];let w;e[12]!==r?(w={shardKey:r},e[12]=r,e[13]=w):w=e[13];const $=ve(ye.getAuditLog,S,w),y=c.data??null;let k,C,A,N,M,I,L,O,R,D,j,F,E,B,U,q,K,W;if(e[14]!==$.data||e[15]!==g.data||e[16]!==y||e[17]!==c.data||e[18]!==l||e[19]!==d.data||e[20]!==v.data||e[21]!==s){N=Array.isArray(d.data?.functions)?d.data.functions:[],L=v.data??null;let ke;e[40]!==$.data?(ke=Array.isArray($.data?.entries)?$.data.entries:[],e[40]=$.data,e[41]=ke):ke=e[41],C=ke,M=c.data===void 0||d.data===void 0?null:ct(y,N).length,I=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Ce;e[42]!==l?(Ce=()=>{Ne(l({to:"/security"}))},e[42]=l,e[43]=Ce):Ce=e[43],W=Ce;let Ae;e[44]!==l?(Ae=()=>{Ne(l({to:"/insights"}))},e[44]=l,e[45]=Ae):Ae=e[45],K=Ae;const Me=Je(y?.history,"calls"),$e=Je(y?.history,"errors"),ze=Ft(N),Ie=Math.max(0,...N.map(Kt));let Te;e[46]!==y||e[47]!==s?(Te=y===null?void 0:Rt(s,y.cache),e[46]=y,e[47]=s,e[48]=Te):Te=e[48],A=Te,U="flex flex-col gap-6",q="lunora-home",j="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",F="home-health";const Ee=Ye(Me);let he;e[49]!==s?(he=s("Requests"),e[49]=s,e[50]=he):he=e[50];const Be=y?.requests??0;let ge;e[51]!==Be?(ge=Be.toLocaleString(),e[51]=Be,e[52]=ge):ge=e[52],e[53]!==Me||e[54]!==Ee||e[55]!==he||e[56]!==ge?(E=a(Oe,{delta:Ee,label:he,trend:Me,value:ge}),e[53]=Me,e[54]=Ee,e[55]=he,e[56]=ge,e[57]=E):E=e[57];const Pe=Ye($e,!1);let xe;e[58]!==s?(xe=s("Errors"),e[58]=s,e[59]=xe):xe=e[59];const De=y?.errors??0;let be;e[60]!==De?(be=De.toLocaleString(),e[60]=De,e[61]=be):be=e[61],e[62]!==$e||e[63]!==Pe||e[64]!==xe||e[65]!==be?(B=a(Oe,{delta:Pe,label:xe,trend:$e,value:be}),e[62]=$e,e[63]=Pe,e[64]=xe,e[65]=be,e[66]=B):B=e[66],k=Oe,e[67]!==Ie||e[68]!==s?(O=Ie>0?`${s("max")} ${Fe(Ie)}`:void 0,e[67]=Ie,e[68]=s,e[69]=O):O=e[69],e[70]!==s?(R=s("Avg latency"),e[70]=s,e[71]=R):R=e[71],D=ze===null?"—":Fe(ze),e[14]=$.data,e[15]=g.data,e[16]=y,e[17]=c.data,e[18]=l,e[19]=d.data,e[20]=v.data,e[21]=s,e[22]=k,e[23]=C,e[24]=A,e[25]=N,e[26]=M,e[27]=I,e[28]=L,e[29]=O,e[30]=R,e[31]=D,e[32]=j,e[33]=F,e[34]=E,e[35]=B,e[36]=U,e[37]=q,e[38]=K,e[39]=W}else k=e[22],C=e[23],A=e[24],N=e[25],M=e[26],I=e[27],L=e[28],O=e[29],R=e[30],D=e[31],j=e[32],F=e[33],E=e[34],B=e[35],U=e[36],q=e[37],K=e[38],W=e[39];let z;e[72]!==k||e[73]!==O||e[74]!==R||e[75]!==D?(z=a(k,{footer:O,label:R,value:D}),e[72]=k,e[73]=O,e[74]=R,e[75]=D,e[76]=z):z=e[76];let H;e[77]!==s?(H=s("Database size"),e[77]=s,e[78]=H):H=e[78];const Re=y?.databaseSize??null;let V;e[79]!==Re?(V=it(Re),e[79]=Re,e[80]=V):V=e[80];let Q;e[81]!==A||e[82]!==H||e[83]!==V?(Q=a(Oe,{footer:A,label:H,value:V}),e[81]=A,e[82]=H,e[83]=V,e[84]=Q):Q=e[84];let G;e[85]!==j||e[86]!==F||e[87]!==E||e[88]!==B||e[89]!==z||e[90]!==Q?(G=h("div",{className:j,"data-testid":F,children:[E,B,z,Q]}),e[85]=j,e[86]=F,e[87]=E,e[88]=B,e[89]=z,e[90]=Q,e[91]=G):G=e[91];let _e;e[92]===Symbol.for("react.memo_cache_sentinel")?(_e=a(bt,{}),e[92]=_e):_e=e[92];let J;e[93]!==N?(J=a("div",{className:"lg:col-span-2",children:a(Pt,{functions:N})}),e[93]=N,e[94]=J):J=e[94];let Y;e[95]!==L?(Y=a(Dt,{subs:L}),e[95]=L,e[96]=Y):Y=e[96];let Z;e[97]!==C?(Z=a(jt,{entries:C}),e[97]=C,e[98]=Z):Z=e[98];let X;e[99]!==Y||e[100]!==Z?(X=h("div",{className:"flex flex-col gap-3",children:[Y,Z]}),e[99]=Y,e[100]=Z,e[101]=X):X=e[101];let ee;e[102]!==J||e[103]!==X?(ee=h("div",{className:"grid gap-3 lg:grid-cols-3",children:[J,X]}),e[102]=J,e[103]=X,e[104]=ee):ee=e[104];let te;e[105]!==s?(te=s("Advisors"),e[105]=s,e[106]=te):te=e[106];let se;e[107]!==te?(se=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:te}),e[107]=te,e[108]=se):se=e[108];let ne;e[109]!==M||e[110]!==I||e[111]!==s||e[112]!==K||e[113]!==W?(ne=I===0&&M===0?a(nt,{description:s("No security or performance issues detected."),icon:h("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[a("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),a("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:s("No issues found")}):h("div",{className:"grid gap-3 sm:grid-cols-2",children:[a(Ze,{count:I,onView:W,testId:"home-security",title:s("Security findings")}),a(Ze,{count:M,onView:K,testId:"home-performance",title:s("Performance issues")})]}),e[109]=M,e[110]=I,e[111]=s,e[112]=K,e[113]=W,e[114]=ne):ne=e[114];let le;e[115]!==se||e[116]!==ne?(le=h("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[se,ne]}),e[115]=se,e[116]=ne,e[117]=le):le=e[117];let ae;e[118]!==s?(ae=s("Get connected"),e[118]=s,e[119]=ae):ae=e[119];let re;e[120]!==ae?(re=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ae}),e[120]=ae,e[121]=re):re=e[121];let oe;e[122]!==s?(oe=s("Client SDK"),e[122]=s,e[123]=oe):oe=e[123];let ie;e[124]!==oe?(ie=a(je,{command:"npm i @lunora/client",label:oe}),e[124]=oe,e[125]=ie):ie=e[125];let ce;e[126]!==s?(ce=s("React"),e[126]=s,e[127]=ce):ce=e[127];let de;e[128]!==ce?(de=a(je,{command:"npm i @lunora/react",label:ce}),e[128]=ce,e[129]=de):de=e[129];let ue;e[130]!==s?(ue=s("CLI"),e[130]=s,e[131]=ue):ue=e[131];let me;e[132]!==ue?(me=a(je,{command:"lunora dev",label:ue}),e[132]=ue,e[133]=me):me=e[133];let fe;e[134]!==ie||e[135]!==de||e[136]!==me?(fe=h("div",{className:"grid gap-3 sm:grid-cols-3",children:[ie,de,me]}),e[134]=ie,e[135]=de,e[136]=me,e[137]=fe):fe=e[137];let Se;e[138]===Symbol.for("react.memo_cache_sentinel")?(Se=a(At,{}),e[138]=Se):Se=e[138];let pe;e[139]!==re||e[140]!==fe?(pe=h("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[re,fe,Se]}),e[139]=re,e[140]=fe,e[141]=pe):pe=e[141];let we;return e[142]!==U||e[143]!==q||e[144]!==G||e[145]!==ee||e[146]!==le||e[147]!==pe?(we=h("div",{className:U,"data-testid":q,children:[G,_e,ee,le,pe]}),e[142]=U,e[143]=q,e[144]=G,e[145]=ee,e[146]=le,e[147]=pe,e[148]=we):we=e[148],we};function Ut(t,e){return e.calls-t.calls}function qt(t){return h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[a("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),a("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),a("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:Fe(t.calls>0?t.totalDurationMs/t.calls:0)}),a("span",{className:st("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}function Kt(t){return t.maxDurationMs}export{as as H,Rt as c,pt as u};
@@ -0,0 +1 @@
1
+ import{o as u}from"./use-admin-query-CaOm4JS3.mjs";const h="__lunora_admin__:",p=new Set(["action","mutation","query","streamRpc"]),y=Symbol("lunora.operationSeq"),R=t=>{if(typeof t!="object"||t===null)return;const n=t[y];return typeof n=="number"?n:void 0},O=(t,n)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,y,{configurable:!0,enumerable:!1,value:n,writable:!0})}catch{}},_=t=>{if(typeof t!="object"||t===null)return;const n=t.__lunoraRef;return typeof n=="string"&&n.startsWith(h)?n:void 0},l=t=>{if(typeof t!="object"||t===null)return"";const{shardKey:n}=t;return typeof n=="string"?n:""},E=t=>new Proxy(t,{get(n,c,b){const s=Reflect.get(n,c,b);if(typeof s!="function"||typeof c!="string"||!p.has(c))return typeof s=="function"?s.bind(n):s;const a=s;return async(...e)=>{const r=_(e[0]);if(r===void 0)return a.apply(n,e);const f=typeof e[1]=="object"&&e[1]!==null?e[1]:{},d=l(e[2])||(c==="streamRpc"?l(f):""),i=u.start(r,f,d);try{const o=await a.apply(n,e);return u.settle(i,{result:o}),o}catch(o){throw u.settle(i,{error:o instanceof Error?o.message:String(o)}),O(o,i),o}}}});export{R as o,E as w};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{c as M}from"react/compiler-runtime";import{createRootRoute as us,createRoute as Ht,createBrowserHistory as fs,createMemoryHistory as ms,createRouter as hs,useNavigate as Zt,useSearch as ps,RouterProvider as gs,useRouterState as bs,Outlet as vs}from"@tanstack/react-router";import*as ht from"react";import{use as It,createContext as qt,useState as pt,useEffect as gt,useSyncExternalStore as xs,Suspense as At,lazy as T}from"react";import{A as ys,u as ws}from"./assistant-provider-Bp72uWsq.mjs";import{c as _}from"./utils-bhneXptQ.mjs";import{jsx as o,jsxs as k,Fragment as Ft}from"react/jsx-runtime";import{ErrorBoundary as ks}from"./ErrorBoundary-BWNF98VF.mjs";import{O as Ms,u as Ns}from"./operation-console-provider-DoloEvon.mjs";import{useT as re}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{LunoraError as Wt}from"@lunora/errors";import{B as vt}from"./badge-r_5B4LHP.mjs";import{I as Ut}from"./input-CXhxesPC.mjs";import{Popover as bt}from"@base-ui/react/popover";import{Cancel01Icon as Ss,SidebarLeftIcon as Cs}from"@hugeicons/core-free-icons";import{HugeiconsIcon as jt}from"@hugeicons/react";import{mergeProps as Gt}from"@base-ui/react/merge-props";import{useRender as Kt}from"@base-ui/react/use-render";import{cva as Ps}from"class-variance-authority";import{B as Qt}from"./button-q0UYSmrn.mjs";import{Dialog as le}from"@base-ui/react/dialog";import{Tooltip as ie}from"@base-ui/react/tooltip";import{S as Ct}from"./skeleton-DX1gfixl.mjs";import{H as _s,u as Ts}from"./home-panel-5fGktYeD.mjs";import{g as As,f as Rt}from"./internal-hIuTpSbx.mjs";import{o as kt}from"./use-admin-query-CaOm4JS3.mjs";import{StudioI18nProvider as Rs}from"./StudioI18nProvider-CGXCPnQn.mjs";import{v as Ls,a as Is}from"./data-view-params-C-_G-biH.mjs";import{CommandPalette as Es,openCommandPalette as $s}from"./CommandPalette-BZCHLpst.mjs";import{E as Hs}from"./empty-state-D7jEML_T.mjs";import{u as Vs}from"./shortcuts-B9gDaXmw.mjs";const Yt="(prefers-color-scheme: dark)",Jt=()=>{try{return globalThis.localStorage}catch{return}},Bs=t=>t==="system"||t==="light"||t==="dark",Xt=()=>globalThis.matchMedia,es="lunora-studio-theme",Pt=["system","light","dark"],zs=(t="system")=>{try{const e=Jt()?.getItem(es);return Bs(e)?e:t}catch{return t}},Vt=t=>{const e=Jt();if(e!==void 0)try{e.setItem(es,t)}catch{}},Ds=()=>{try{return Xt()?.(Yt).matches?"dark":"light"}catch{return"light"}},Os=(t,e)=>t==="system"?e:t,Zs=t=>{let e;try{e=Xt()?.(Yt)}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)}},Et=qt(null),qs=({children:t,defaultTheme:e="system"})=>{const[s,a]=pt(()=>zs(e)),[r,n]=pt(()=>Ds());gt(()=>Zs(n),[]);const i=d=>{Vt(d),a(d)},c={cycleTheme:()=>{a(d=>{const f=Pt[(Pt.indexOf(d)+1)%Pt.length]??d;return Vt(f),f})},resolvedTheme:Os(s,r),setTheme:i,systemTheme:r,theme:s};return o(Et,{value:c,children:t})},Fs=t=>{const e=M(3),{children:s}=t,a=It(Et);let r;return e[0]!==s||e[1]!==a?(r=a===null?o(qs,{children:s}):s,e[0]=s,e[1]=a,e[2]=r):r=e[2],r},Ws=()=>{const t=It(Et);if(t===null)throw new Wt("INTERNAL","useTheme must be used within a <ThemeProvider>");return t};function Dr({delay:t=0,...e}){return o(ie.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function Us(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(ie.Root,{"data-slot":"tooltip",...s}),e[2]=s,e[3]=a):a=e[3],a}function js(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(ie.Trigger,{"data-slot":"tooltip-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Gs({className:t,side:e="top",sideOffset:s=4,align:a="center",alignOffset:r=0,children:n,...i}){return o(ie.Portal,{children:o(ie.Positioner,{align:a,alignOffset:r,side:e,sideOffset:s,className:"isolate z-50",children:k(ie.Popup,{"data-slot":"tooltip-content",className:_("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),...i,children:[n,o(ie.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 Ks=t=>{const e=M(5),{className:s}=t;let a;e[0]!==s?(a=_("h-full w-full text-foreground",s),e[0]=s,e[1]=a):a=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=o("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]=r):r=e[2];let n;return e[3]!==a?(n=o("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 543 446",children:r}),e[3]=a,e[4]=n):n=e[4],n},ts="lunora.studio.rulesBannerDismissed",Qs=()=>{try{return globalThis.localStorage.getItem(ts)==="1"}catch{return!1}},Ys=()=>{try{globalThis.localStorage.setItem(ts,"1")}catch{}},Js=()=>{const t=M(18),e=re(),[s,a]=pt(Xs);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{a(!0),Ys()},t[0]=r):r=t[0];const n=r;if(s)return null;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),t[1]=i):i=t[1];let l;t[2]!==e?(l=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=l):l=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=o("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=c):c=t[4];let d;t[5]!==e?(d=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=d):d=t[6];let f;t[7]!==l||t[8]!==d?(f=k("span",{children:[l," ",c," ",d]}),t[7]=l,t[8]=d,t[9]=f):f=t[9];let h;t[10]!==e?(h=e("Dismiss"),t[10]=e,t[11]=h):h=t[11];let x;t[12]===Symbol.for("react.memo_cache_sentinel")?(x=o("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:o("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=x):x=t[12];let u;t[13]!==h?(u=o("button",{"aria-label":h,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:n,type:"button",children:x}),t[13]=h,t[14]=u):u=t[14];let g;return t[15]!==f||t[16]!==u?(g=k("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:[i,f,u]}),t[15]=f,t[16]=u,t[17]=g):g=t[17],g};function Xs(){return Qs()}function ss(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(bt.Root,{"data-slot":"popover",...s}),e[2]=s,e[3]=a):a=e[3],a}function as(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(bt.Trigger,{"data-slot":"popover-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function os({align:t="end",alignOffset:e=0,className:s,keepMounted:a=!1,side:r="bottom",sideOffset:n=6,...i}){return o(bt.Portal,{keepMounted:a,children:o(bt.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:r,sideOffset:n,children:o(bt.Popup,{className:_("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",...i})})})}const _t=768;function ea(){const t=M(2),[e,s]=pt(void 0);let a,r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const n=globalThis.matchMedia(`(max-width: ${_t-1}px)`),i=()=>{s(globalThis.innerWidth<_t)};return n.addEventListener("change",i),s(globalThis.innerWidth<_t),()=>{n.removeEventListener("change",i)}},r=[],t[0]=a,t[1]=r):(a=t[0],r=t[1]),gt(a,r),!!e}function ta(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(le.Root,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function sa(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(le.Portal,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function aa(t){const e=M(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 r;e[3]!==s?(r=_("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]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o(le.Backdrop,{"data-slot":"sheet-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function oa({className:t,children:e,side:s="right",showCloseButton:a=!0,...r}){return k(sa,{children:[o(aa,{}),k(le.Popup,{"data-slot":"sheet-content","data-side":s,className:_("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),...r,children:[e,a&&k(le.Close,{"data-slot":"sheet-close",render:o(Qt,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[o(jt,{icon:Ss,strokeWidth:2}),o("span",{className:"sr-only",children:"Close"})]})]})]})}function ra(t){const e=M(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 r;e[3]!==s?(r=_("flex flex-col gap-0.5 p-4",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sheet-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function na(t){const e=M(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 r;e[3]!==s?(r=_("text-sm font-medium text-foreground",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o(le.Title,{"data-slot":"sheet-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function ia(t){const e=M(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 r;e[3]!==s?(r=_("text-xs/relaxed text-muted-foreground",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o(le.Description,{"data-slot":"sheet-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}const la="sidebar_state",ca=3600*24*7,da="16rem",ua="18rem",fa="3rem",ma="b",rs=ht.createContext(null);function Mt(){const t=ht.useContext(rs);if(!t)throw new Wt("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}function ha({defaultOpen:t=!0,open:e,onOpenChange:s,className:a,style:r,children:n,...i}){const l=ea(),[c,d]=ht.useState(!1),[f,h]=ht.useState(t),x=e??f,u=p=>{const m=typeof p=="function"?p(x):p;s?s(m):h(m),document.cookie=`${la}=${m}; path=/; max-age=${ca}`},g=()=>l?d(p=>!p):u(p=>!p),v=ht.useEffectEvent(()=>{g()});ht.useEffect(()=>{const p=m=>{m.key===ma&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),v())};return globalThis.addEventListener("keydown",p),()=>globalThis.removeEventListener("keydown",p)},[]);const b={state:x?"expanded":"collapsed",open:x,setOpen:u,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g};return o(rs.Provider,{value:b,children:o("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":da,"--sidebar-width-icon":fa,...r},className:_("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...i,children:n})})}function pa({side:t="left",variant:e="sidebar",collapsible:s="offcanvas",className:a,children:r,dir:n,...i}){const{isMobile:l,state:c,openMobile:d,setOpenMobile:f}=Mt();return s==="none"?o("div",{"data-slot":"sidebar",className:_("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...i,children:r}):l?o(ta,{open:d,onOpenChange:f,...i,children:k(oa,{dir:n,"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":ua},side:t,children:[k(ra,{className:"sr-only",children:[o(na,{children:"Sidebar"}),o(ia,{children:"Displays the mobile sidebar."})]}),o("div",{className:"flex h-full w-full flex-col",children:r})]})}):k("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?s:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[o("div",{"data-slot":"sidebar-gap",className:_("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)")}),o("div",{"data-slot":"sidebar-container","data-side":t,className:_("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),...i,children:o("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:r})})]})}function ga(t){const e=M(15);let s,a,r;e[0]!==t?({className:s,onClick:a,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r):(s=e[1],a=e[2],r=e[3]);const{toggleSidebar:n}=Mt();let i;e[4]!==s?(i=_(s),e[4]=s,e[5]=i):i=e[5];let l;e[6]!==a||e[7]!==n?(l=h=>{a?.(h),n()},e[6]=a,e[7]=n,e[8]=l):l=e[8];let c,d;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=o(jt,{icon:Cs,strokeWidth:2,className:"rtl:rotate-180"}),d=o("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=c,e[10]=d):(c=e[9],d=e[10]);let f;return e[11]!==r||e[12]!==i||e[13]!==l?(f=k(Qt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:i,onClick:l,...r,children:[c,d]}),e[11]=r,e[12]=i,e[13]=l,e[14]=f):f=e[14],f}function ba(t){const e=M(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 r;e[3]!==s?(r=_("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]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("main",{"data-slot":"sidebar-inset",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function va(t){const e=M(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 r;e[3]!==s?(r=_("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function xa(t){const e=M(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 r;e[3]!==s?(r=_("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function ya(t){const e=M(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 r;e[3]!==s?(r=_("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]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function wa(t){const e=M(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 r;e[3]!==s?(r=_("relative flex w-full min-w-0 flex-col p-2",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function ka(t){const e=M(10);let s,a,r,n;if(e[0]!==t){const{className:c,render:d,...f}=t;s=d,n=Kt,a="div",r=Gt({className:_("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",c)},f),e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=n}else s=e[1],a=e[2],r=e[3],n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==a||e[8]!==r?(l={defaultTagName:a,props:r,render:s,state:i},e[6]=s,e[7]=a,e[8]=r,e[9]=l):l=e[9],n(l)}function Ma(t){const e=M(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 r;e[3]!==s?(r=_("w-full text-xs",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function Bt(t){const e=M(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 r;e[3]!==s?(r=_("flex w-full min-w-0 flex-col gap-0",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}function zt(t){const e=M(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 r;e[3]!==s?(r=_("group/menu-item relative",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==r?(n=o("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r,...a}),e[5]=a,e[6]=r,e[7]=n):n=e[7],n}const Na=Ps("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 ns({render:t,isActive:e=!1,variant:s="default",size:a="default",tooltip:r,className:n,...i}){const{isMobile:l,state:c}=Mt(),d=Kt({defaultTagName:"button",props:Gt({className:_(Na({variant:s,size:a}),n)},i),render:r?o(js,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:e}});return r?(typeof r=="string"&&(r={children:r}),k(Us,{children:[d,o(Gs,{side:"right",align:"center",hidden:c!=="collapsed"||l,...r})]})):d}const Sa=t=>t.replace("__lunora_admin__:",""),Ca=()=>xs(kt.subscribe,kt.getSnapshot,kt.getSnapshot),Pa=t=>t==="error"?"destructive":t==="pending"?"secondary":"default",_a=t=>{const e=M(56),{entry:s,focused:a}=t,r=re();let n;e[0]!==a?(n=V=>{V!==null&&a&&V.scrollIntoView({block:"nearest"})},e[0]=a,e[1]=n):n=e[1];const i=n;let l;e[2]!==s.functionPath||e[3]!==s.shardKey||e[4]!==s.summary?(l=()=>{As(`${s.functionPath} ${s.summary}${s.shardKey===""?"":` (shard ${s.shardKey})`}`)},e[2]=s.functionPath,e[3]=s.shardKey,e[4]=s.summary,e[5]=l):l=e[5];const c=l,d=a&&"bg-accent ring-1 ring-inset ring-primary/40";let f;e[6]!==d?(f=_("border-b border-border/60 last:border-b-0",d),e[6]=d,e[7]=f):f=e[7];let h;e[8]!==s.status?(h=Pa(s.status),e[8]=s.status,e[9]=h):h=e[9];const x=s.status==="pending"?"…":s.status;let u;e[10]!==h||e[11]!==x?(u=o(vt,{className:"mt-px shrink-0",variant:h,children:x}),e[10]=h,e[11]=x,e[12]=u):u=e[12];let g;e[13]!==s.functionPath?(g=Sa(s.functionPath),e[13]=s.functionPath,e[14]=g):g=e[14];let v;e[15]!==g?(v=o("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:g}),e[15]=g,e[16]=v):v=e[16];let y;e[17]!==s.kind||e[18]!==r?(y=s.kind==="subscription"&&o(vt,{className:"shrink-0",variant:"outline",children:r("live")}),e[17]=s.kind,e[18]=r,e[19]=y):y=e[19];let b;e[20]!==s.summary?(b=s.summary!==""&&o("span",{className:"min-w-0 truncate text-muted-foreground",children:s.summary}),e[20]=s.summary,e[21]=b):b=e[21];let p;e[22]!==s.shardKey?(p=s.shardKey!==""&&o("span",{className:"font-mono",children:s.shardKey}),e[22]=s.shardKey,e[23]=p):p=e[23];let m;e[24]!==s.resultCount||e[25]!==r?(m=s.resultCount!==void 0&&o("span",{children:r("{count} rows",{count:s.resultCount})}),e[24]=s.resultCount,e[25]=r,e[26]=m):m=e[26];let w;e[27]!==s.pushes||e[28]!==r?(w=s.pushes!==void 0&&s.pushes>0&&o("span",{children:r("{count} pushes",{count:s.pushes})}),e[27]=s.pushes,e[28]=r,e[29]=w):w=e[29];let C;e[30]!==s.durationMs?(C=s.durationMs!==void 0&&k("span",{children:[s.durationMs,"ms"]}),e[30]=s.durationMs,e[31]=C):C=e[31];let P;e[32]!==r?(P=r("Copy"),e[32]=r,e[33]=P):P=e[33];let S;e[34]!==c||e[35]!==P?(S=o("button",{"aria-label":P,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:c,type:"button",children:"⧉"}),e[34]=c,e[35]=P,e[36]=S):S=e[36];let N;e[37]!==p||e[38]!==m||e[39]!==w||e[40]!==C||e[41]!==S?(N=k("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[p,m,w,C,S]}),e[37]=p,e[38]=m,e[39]=w,e[40]=C,e[41]=S,e[42]=N):N=e[42];let A;e[43]!==y||e[44]!==b||e[45]!==N||e[46]!==u||e[47]!==v?(A=k("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[u,v,y,b,N]}),e[43]=y,e[44]=b,e[45]=N,e[46]=u,e[47]=v,e[48]=A):A=e[48];let R;e[49]!==s.error?(R=s.error!==void 0&&o("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:s.error}),e[49]=s.error,e[50]=R):R=e[50];let L;return e[51]!==i||e[52]!==A||e[53]!==R||e[54]!==f?(L=k("li",{className:f,"data-testid":"oc-row",ref:i,children:[A,R]}),e[51]=i,e[52]=A,e[53]=R,e[54]=f,e[55]=L):L=e[55],L},Ta=t=>{const e=M(62),{focusSeq:s,onClose:a,onShownChange:r,shown:n}=t,i=re(),l=Ca(),[c,d]=pt("");let f;if(e[0]!==l||e[1]!==s||e[2]!==c||e[3]!==a||e[4]!==r||e[5]!==n||e[6]!==i){const h=c.trim().toLowerCase(),x=l.filter(E=>(n==="errors"?E.status==="error":!0)&&(h===""||`${E.functionPath} ${E.summary} ${E.shardKey}`.toLowerCase().includes(h))).toReversed();let u;e[8]!==l?(u=l.filter(Aa),e[8]=l,e[9]=u):u=e[9];const g=u.length;let v;e[10]!==i?(v=i("Operation console"),e[10]=i,e[11]=v):v=e[11];let y;e[12]!==i?(y=i("Operation console"),e[12]=i,e[13]=y):y=e[13];let b;e[14]!==y?(b=o("span",{className:"text-xs font-medium",children:y}),e[14]=y,e[15]=b):b=e[15];let p;e[16]!==l.length||e[17]!==i?(p=i("{count} calls",{count:l.length}),e[16]=l.length,e[17]=i,e[18]=p):p=e[18];let m;e[19]!==p?(m=o(vt,{variant:"secondary",children:p}),e[19]=p,e[20]=m):m=e[20];let w;e[21]!==g||e[22]!==i?(w=g>0&&o(vt,{variant:"destructive",children:i("{count} failed",{count:g})}),e[21]=g,e[22]=i,e[23]=w):w=e[23];const C=n==="errors",P=n==="errors"&&"bg-accent";let S;e[24]!==P?(S=_("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",P),e[24]=P,e[25]=S):S=e[25];let N;e[26]!==r||e[27]!==n?(N=()=>{r(n==="errors"?"all":"errors")},e[26]=r,e[27]=n,e[28]=N):N=e[28];let A;e[29]!==i?(A=i("Errors"),e[29]=i,e[30]=A):A=e[30];let R;e[31]!==S||e[32]!==N||e[33]!==A||e[34]!==C?(R=o("button",{"aria-pressed":C,className:S,"data-testid":"oc-filter-errors",onClick:N,type:"button",children:A}),e[31]=S,e[32]=N,e[33]=A,e[34]=C,e[35]=R):R=e[35];let L;e[36]!==i?(L=i("Filter"),e[36]=i,e[37]=L):L=e[37];let V;e[38]===Symbol.for("react.memo_cache_sentinel")?(V=E=>{d(E.target.value)},e[38]=V):V=e[38];let O;e[39]!==i?(O=i("Filter"),e[39]=i,e[40]=O):O=e[40];let $;e[41]!==c||e[42]!==L||e[43]!==O?($=o(Ut,{"aria-label":L,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:V,placeholder:O,value:c}),e[41]=c,e[42]=L,e[43]=O,e[44]=$):$=e[44];let Z;e[45]!==i?(Z=i("Clear"),e[45]=i,e[46]=Z):Z=e[46];let z;e[47]!==Z?(z=o("button",{className:"ms-auto rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-clear",onClick:Ra,type:"button",children:Z}),e[47]=Z,e[48]=z):z=e[48];let D;e[49]!==i?(D=i("Hide"),e[49]=i,e[50]=D):D=e[50];let H;e[51]!==a||e[52]!==D?(H=o("button",{"aria-label":D,className:"rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-close",onClick:a,type:"button",children:"✕"}),e[51]=a,e[52]=D,e[53]=H):H=e[53];let B;e[54]!==R||e[55]!==$||e[56]!==z||e[57]!==H||e[58]!==b||e[59]!==m||e[60]!==w?(B=k("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[b,m,w,R,$,z,H]}),e[54]=R,e[55]=$,e[56]=z,e[57]=H,e[58]=b,e[59]=m,e[60]=w,e[61]=B):B=e[61],f=k("section",{"aria-label":v,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[B,x.length===0?o("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:i("Every admin call this studio makes is recorded here.")}):o("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:x.map(E=>o(_a,{entry:E,focused:E.seq===s},E.seq))})]}),e[0]=l,e[1]=s,e[2]=c,e[3]=a,e[4]=r,e[5]=n,e[6]=i,e[7]=f}else f=e[7];return f};function Aa(t){return t.status==="error"}function Ra(){kt.clear()}const La=()=>{const t=M(334),e=re();let s;t[0]!==e?(s=e("Health score"),t[0]=e,t[1]=s):s=t[1];let a;t[2]!==e?(a=e("Agents"),t[2]=e,t[3]=a):a=t[3];let r;t[4]!==e?(r=e("Evals"),t[4]=e,t[5]=r):r=t[5];let n;t[6]!==e?(n=e("AI usage"),t[6]=e,t[7]=n):n=t[7];let i;t[8]!==e?(i=e("Analytics"),t[8]=e,t[9]=i):i=t[9];let l;t[10]!==e?(l=e("API"),t[10]=e,t[11]=l):l=t[11];let c;t[12]!==e?(c=e("Architecture"),t[12]=e,t[13]=c):c=t[13];let d;t[14]!==e?(d=e("Audit"),t[14]=e,t[15]=d):d=t[15];let f;t[16]!==e?(f=e("Auth audit"),t[16]=e,t[17]=f):f=t[17];let h;t[18]!==e?(h=e("Configuration"),t[18]=e,t[19]=h):h=t[19];let x;t[20]!==e?(x=e("Sessions"),t[20]=e,t[21]=x):x=t[21];let u;t[22]!==e?(u=e("Containers"),t[22]=e,t[23]=u):u=t[23];let g;t[24]!==e?(g=e("Dashboards"),t[24]=e,t[25]=g):g=t[25];let v;t[26]!==e?(v=e("Data"),t[26]=e,t[27]=v):v=t[27];let y;t[28]!==e?(y=e("Deployment health"),t[28]=e,t[29]=y):y=t[29];let b;t[30]!==e?(b=e("Log drains"),t[30]=e,t[31]=b):b=t[31];let p;t[32]!==e?(p=e("Export / Import"),t[32]=e,t[33]=p):p=t[33];let m;t[34]!==e?(m=e("Fan-out"),t[34]=e,t[35]=m):m=t[35];let w;t[36]!==e?(w=e("Files"),t[36]=e,t[37]=w):w=t[37];let C;t[38]!==e?(C=e("Flags"),t[38]=e,t[39]=C):C=t[39];let P;t[40]!==e?(P=e("Functions"),t[40]=e,t[41]=P):P=t[41];let S;t[42]!==e?(S=e("Health"),t[42]=e,t[43]=S):S=t[43];let N;t[44]!==e?(N=e("Home"),t[44]=e,t[45]=N):N=t[45];let A;t[46]!==e?(A=e("Performance"),t[46]=e,t[47]=A):A=t[47];let R;t[48]!==e?(R=e("Issues"),t[48]=e,t[49]=R):R=t[49];let L;t[50]!==e?(L=e("KV"),t[50]=e,t[51]=L):L=t[51];let V;t[52]!==e?(V=e("Logs"),t[52]=e,t[53]=V):V=t[53];let O;t[54]!==e?(O=e("Metrics"),t[54]=e,t[55]=O):O=t[55];let $;t[56]!==e?($=e("Migrations"),t[56]=e,t[57]=$):$=t[57];let Z;t[58]!==e?(Z=e("Notifications"),t[58]=e,t[59]=Z):Z=t[59];let z;t[60]!==e?(z=e("Organizations"),t[60]=e,t[61]=z):z=t[61];let D;t[62]!==e?(D=e("Time Travel"),t[62]=e,t[63]=D):D=t[63];let H;t[64]!==e?(H=e("Privacy requests"),t[64]=e,t[65]=H):H=t[65];let B;t[66]!==e?(B=e("Mail"),t[66]=e,t[67]=B):B=t[67];let E;t[68]!==e?(E=e("Payments"),t[68]=e,t[69]=E):E=t[69];let te;t[70]!==e?(te=e("Permissions"),t[70]=e,t[71]=te):te=t[71];let se;t[72]!==e?(se=e("Queues"),t[72]=e,t[73]=se):se=t[73];let q;t[74]!==e?(q=e("Reactors"),t[74]=e,t[75]=q):q=t[75];let ae;t[76]!==e?(ae=e("Realtime"),t[76]=e,t[77]=ae):ae=t[77];let F;t[78]!==e?(F=e("RLS Policies"),t[78]=e,t[79]=F):F=t[79];let J;t[80]!==e?(J=e("Scheduled"),t[80]=e,t[81]=J):J=t[81];let oe;t[82]!==e?(oe=e("Schema"),t[82]=e,t[83]=oe):oe=t[83];let W;t[84]!==e?(W=e("Security"),t[84]=e,t[85]=W):W=t[85];let U;t[86]!==e?(U=e("Settings"),t[86]=e,t[87]=U):U=t[87];let j;t[88]!==e?(j=e("SQL editor"),t[88]=e,t[89]=j):j=t[89];let G;t[90]!==e?(G=e("Traces"),t[90]=e,t[91]=G):G=t[91];let K;t[92]!==e?(K=e("Access Rules"),t[92]=e,t[93]=K):K=t[93];let Q;t[94]!==e?(Q=e("Users"),t[94]=e,t[95]=Q):Q=t[95];let Y;t[96]!==e?(Y=e("Vectors"),t[96]=e,t[97]=Y):Y=t[97];let X;t[98]!==e?(X=e("Workflows"),t[98]=e,t[99]=X):X=t[99];let ee;t[100]!==s||t[101]!==a||t[102]!==x||t[103]!==u||t[104]!==g||t[105]!==v||t[106]!==y||t[107]!==b||t[108]!==p||t[109]!==m||t[110]!==w||t[111]!==C||t[112]!==r||t[113]!==P||t[114]!==S||t[115]!==N||t[116]!==A||t[117]!==R||t[118]!==L||t[119]!==V||t[120]!==O||t[121]!==$||t[122]!==Z||t[123]!==n||t[124]!==z||t[125]!==D||t[126]!==H||t[127]!==B||t[128]!==E||t[129]!==te||t[130]!==se||t[131]!==q||t[132]!==ae||t[133]!==F||t[134]!==i||t[135]!==J||t[136]!==oe||t[137]!==W||t[138]!==U||t[139]!==j||t[140]!==G||t[141]!==K||t[142]!==Q||t[143]!==Y||t[144]!==X||t[145]!==l||t[146]!==c||t[147]!==d||t[148]!==f||t[149]!==h?(ee={advisorHealth:s,agents:a,evals:r,aiUsage:n,analytics:i,api:l,architecture:c,audit:d,authAudit:f,authConfig:h,authSessions:x,containers:u,dashboards:g,data:v,deploymentHealth:y,drains:b,export:p,fanout:m,files:w,flags:C,functions:P,health:S,home:N,insights:A,issues:R,kv:L,logs:V,metrics:O,migrations:$,notifications:Z,organizations:z,pitr:D,privacyRequests:H,mail:B,payments:E,permissions:te,queues:se,reactors:q,realtime:ae,rls:F,schedule:J,schema:oe,security:W,settings:U,sql:j,traces:G,storageRules:K,users:Q,vectors:Y,workflows:X},t[100]=s,t[101]=a,t[102]=x,t[103]=u,t[104]=g,t[105]=v,t[106]=y,t[107]=b,t[108]=p,t[109]=m,t[110]=w,t[111]=C,t[112]=r,t[113]=P,t[114]=S,t[115]=N,t[116]=A,t[117]=R,t[118]=L,t[119]=V,t[120]=O,t[121]=$,t[122]=Z,t[123]=n,t[124]=z,t[125]=D,t[126]=H,t[127]=B,t[128]=E,t[129]=te,t[130]=se,t[131]=q,t[132]=ae,t[133]=F,t[134]=i,t[135]=J,t[136]=oe,t[137]=W,t[138]=U,t[139]=j,t[140]=G,t[141]=K,t[142]=Q,t[143]=Y,t[144]=X,t[145]=l,t[146]=c,t[147]=d,t[148]=f,t[149]=h,t[150]=ee):ee=t[150];const ne=ee;let ce;t[151]!==e?(ce=e("Advisors"),t[151]=e,t[152]=ce):ce=t[152];let de;t[153]!==e?(de=e("Auth"),t[153]=e,t[154]=de):de=t[154];let ue;t[155]!==e?(ue=e("Database"),t[155]=e,t[156]=ue):ue=t[156];let fe;t[157]!==e?(fe=e("Functions"),t[157]=e,t[158]=fe):fe=t[158];let me;t[159]!==e?(me=e("Observability"),t[159]=e,t[160]=me):me=t[160];let he;t[161]!==e?(he=e("Operations"),t[161]=e,t[162]=he):he=t[162];let pe;t[163]!==e?(pe=e("Overview"),t[163]=e,t[164]=pe):pe=t[164];let ge;t[165]!==e?(ge=e("Settings"),t[165]=e,t[166]=ge):ge=t[166];let be;t[167]!==e?(be=e("Storage"),t[167]=e,t[168]=be):be=t[168];let xt;t[169]!==ce||t[170]!==de||t[171]!==ue||t[172]!==fe||t[173]!==me||t[174]!==he||t[175]!==pe||t[176]!==ge||t[177]!==be?(xt={advisors:ce,auth:de,database:ue,functions:fe,observability:me,operations:he,overview:pe,settings:ge,storage:be},t[169]=ce,t[170]=de,t[171]=ue,t[172]=fe,t[173]=me,t[174]=he,t[175]=pe,t[176]=ge,t[177]=be,t[178]=xt):xt=t[178];const Nt=xt;let ve;t[179]!==e?(ve=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[179]=e,t[180]=ve):ve=t[180];let xe;t[181]!==e?(xe=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[181]=e,t[182]=xe):xe=t[182];let ye;t[183]!==e?(ye=e("Scores recorded by recordEvaluation — the latest verdict per eval, its trend, and the graded runs behind it."),t[183]=e,t[184]=ye):ye=t[184];let we;t[185]!==e?(we=e("Tokens and spend from ctx.ai.model calls — totals, per function and per model, and the recent calls behind them."),t[185]=e,t[186]=we):we=t[186];let ke;t[187]!==e?(ke=e("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards."),t[187]=e,t[188]=ke):ke=t[188];let Me;t[189]!==e?(Me=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[189]=e,t[190]=Me):Me=t[190];let Ne;t[191]!==e?(Ne=e("A durable log of admin state-changing operations."),t[191]=e,t[192]=Ne):Ne=t[192];let Se;t[193]!==e?(Se=e("Authentication and security events — sign-ins, MFA, and session changes."),t[193]=e,t[194]=Se):Se=t[194];let Ce;t[195]!==e?(Ce=e("Enabled plugins and session config (read-only)."),t[195]=e,t[196]=Ce):Ce=t[196];let Pe;t[197]!==e?(Pe=e("Your modules, and the calls, reads, writes and hand-offs between them, from codegen."),t[197]=e,t[198]=Pe):Pe=t[198];let _e;t[199]!==e?(_e=e("Browse and revoke active sessions across all users."),t[199]=e,t[200]=_e):_e=t[200];let Te;t[201]!==e?(Te=e("Live Cloudflare Containers — current lifecycle state per instance from the log stream."),t[201]=e,t[202]=Te):Te=t[202];let Ae;t[203]!==e?(Ae=e("Chart widgets backed by saved read-only SQL queries."),t[203]=e,t[204]=Ae):Ae=t[204];let Re;t[205]!==e?(Re=e("Browse and edit rows across your shard and global tables."),t[205]=e,t[206]=Re):Re=t[206];let Le;t[207]!==e?(Le=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[207]=e,t[208]=Le):Le=t[208];let Ie;t[209]!==e?(Ie=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[209]=e,t[210]=Ie):Ie=t[210];let Ee;t[211]!==e?(Ee=e("Export a shard to NDJSON, or import rows from it."),t[211]=e,t[212]=Ee):Ee=t[212];let $e;t[213]!==e?($e=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[213]=e,t[214]=$e):$e=t[214];let He;t[215]!==e?(He=e("Browse objects in your R2 storage buckets."),t[215]=e,t[216]=He):He=t[216];let Ve;t[217]!==e?(Ve=e("Inspect feature flags and their live evaluation under a targeting context."),t[217]=e,t[218]=Ve):Ve=t[218];let Be;t[219]!==e?(Be=e("Run registered queries, mutations, and actions."),t[219]=e,t[220]=Be):Be=t[220];let ze;t[221]!==e?(ze=e("At-a-glance connection, error, and shard signals."),t[221]=e,t[222]=ze):ze=t[222];let De;t[223]!==e?(De=e("Connection, health, and advisor summary for your deployment."),t[223]=e,t[224]=De):De=t[224];let Oe;t[225]!==e?(Oe=e("Surface slow functions, error spikes, and cache problems."),t[225]=e,t[226]=Oe):Oe=t[226];let Ze;t[227]!==e?(Ze=e("Grouped error triage — Worker throws and container crashes folded by fingerprint."),t[227]=e,t[228]=Ze):Ze=t[228];let qe;t[229]!==e?(qe=e("A live stream of recent function logs."),t[229]=e,t[230]=qe):qe=t[230];let Fe;t[231]!==e?(Fe=e("Per-shard health and aggregate metrics."),t[231]=e,t[232]=Fe):Fe=t[232];let We;t[233]!==e?(We=e("Review migration status and run them."),t[233]=e,t[234]=We):We=t[234];let Ue;t[235]!==e?(Ue=e("Registered push devices — endpoint, kind, last-send status, and delivery errors."),t[235]=e,t[236]=Ue):Ue=t[236];let je;t[237]!==e?(je=e("Browse and manage organizations, members, and invitations."),t[237]=e,t[238]=je):je=t[238];let Ge;t[239]!==e?(Ge=e("Restore a shard to a point in the last 30 days."),t[239]=e,t[240]=Ge):Ge=t[240];let Ke;t[241]!==e?(Ke=e("Open data-subject export and erasure requests, with due dates and failed-run retries."),t[241]=e,t[242]=Ke):Ke=t[242];let Qe;t[243]!==e?(Qe=e("Email your app sent, captured in dev."),t[243]=e,t[244]=Qe):Qe=t[244];let Ye;t[245]!==e?(Ye=e("Synced customers, subscriptions, and webhook events."),t[245]=e,t[246]=Ye):Ye=t[246];let Je;t[247]!==e?(Je=e("Inspect access policies per table, and probe a function as any identity."),t[247]=e,t[248]=Je):Je=t[248];let Xe;t[249]!==e?(Xe=e("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue."),t[249]=e,t[250]=Xe):Xe=t[250];let et;t[251]!==e?(et=e("Server-side onQueryChange reactors: what has run, what was suppressed, and what is failing."),t[251]=e,t[252]=et):et=t[252];let tt;t[253]!==e?(tt=e("Active WebSocket subscriptions on this shard."),t[253]=e,t[254]=tt):tt=t[254];let st;t[255]!==e?(st=e("Inspect row-level-security policies and roles, per table."),t[255]=e,t[256]=st):st=t[256];let at;t[257]!==e?(at=e("Inspect and cancel scheduled jobs."),t[257]=e,t[258]=at):at=t[258];let ot;t[259]!==e?(ot=e("Inspect each table and its columns."),t[259]=e,t[260]=ot):ot=t[260];let rt;t[261]!==e?(rt=e("Review admin gates, credentials, and log redaction."),t[261]=e,t[262]=rt):rt=t[262];let nt;t[263]!==e?(nt=e("Read-only deployment config — vars, secrets, and bindings."),t[263]=e,t[264]=nt):nt=t[264];let it;t[265]!==e?(it=e("Run read-only SQL against a shard."),t[265]=e,t[266]=it):it=t[266];let lt;t[267]!==e?(lt=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[267]=e,t[268]=lt):lt=t[268];let ct;t[269]!==e?(ct=e("Inspect storage access rules — per bucket, operation, and key prefix."),t[269]=e,t[270]=ct):ct=t[270];let dt;t[271]!==e?(dt=e("Recent ctx.trace waterfalls for this shard — the drill-down from a log line."),t[271]=e,t[272]=dt):dt=t[272];let ut;t[273]!==e?(ut=e("Manage auth users — roles, bans, sessions, and identity."),t[273]=e,t[274]=ut):ut=t[274];let ft;t[275]!==e?(ft=e("Browse Vectorize indexes and run similarity searches."),t[275]=e,t[276]=ft):ft=t[276];let mt;t[277]!==e?(mt=e("Inspect declared Cloudflare Workflows and their bindings."),t[277]=e,t[278]=mt):mt=t[278];let yt;t[279]!==at||t[280]!==ot||t[281]!==rt||t[282]!==nt||t[283]!==it||t[284]!==lt||t[285]!==ct||t[286]!==dt||t[287]!==ut||t[288]!==ft||t[289]!==mt||t[290]!==ve||t[291]!==xe||t[292]!==ye||t[293]!==we||t[294]!==ke||t[295]!==Me||t[296]!==Ne||t[297]!==Se||t[298]!==Ce||t[299]!==Pe||t[300]!==_e||t[301]!==Te||t[302]!==Ae||t[303]!==Re||t[304]!==Le||t[305]!==Ie||t[306]!==Ee||t[307]!==$e||t[308]!==He||t[309]!==Ve||t[310]!==Be||t[311]!==ze||t[312]!==De||t[313]!==Oe||t[314]!==Ze||t[315]!==qe||t[316]!==Fe||t[317]!==We||t[318]!==Ue||t[319]!==je||t[320]!==Ge||t[321]!==Ke||t[322]!==Qe||t[323]!==Ye||t[324]!==Je||t[325]!==Xe||t[326]!==et||t[327]!==tt||t[328]!==st?(yt={advisorHealth:ve,agents:xe,evals:ye,aiUsage:we,analytics:ke,api:Me,audit:Ne,authAudit:Se,authConfig:Ce,architecture:Pe,authSessions:_e,containers:Te,dashboards:Ae,data:Re,deploymentHealth:Le,drains:Ie,export:Ee,fanout:$e,files:He,flags:Ve,functions:Be,health:ze,home:De,insights:Oe,issues:Ze,logs:qe,metrics:Fe,migrations:We,notifications:Ue,organizations:je,pitr:Ge,privacyRequests:Ke,mail:Qe,payments:Ye,permissions:Je,queues:Xe,reactors:et,realtime:tt,rls:st,schedule:at,schema:ot,security:rt,settings:nt,sql:it,kv:lt,storageRules:ct,traces:dt,users:ut,vectors:ft,workflows:mt},t[279]=at,t[280]=ot,t[281]=rt,t[282]=nt,t[283]=it,t[284]=lt,t[285]=ct,t[286]=dt,t[287]=ut,t[288]=ft,t[289]=mt,t[290]=ve,t[291]=xe,t[292]=ye,t[293]=we,t[294]=ke,t[295]=Me,t[296]=Ne,t[297]=Se,t[298]=Ce,t[299]=Pe,t[300]=_e,t[301]=Te,t[302]=Ae,t[303]=Re,t[304]=Le,t[305]=Ie,t[306]=Ee,t[307]=$e,t[308]=He,t[309]=Ve,t[310]=Be,t[311]=ze,t[312]=De,t[313]=Oe,t[314]=Ze,t[315]=qe,t[316]=Fe,t[317]=We,t[318]=Ue,t[319]=je,t[320]=Ge,t[321]=Ke,t[322]=Qe,t[323]=Ye,t[324]=Je,t[325]=Xe,t[326]=et,t[327]=tt,t[328]=st,t[329]=yt):yt=t[329];const St=yt;let wt;return t[330]!==Nt||t[331]!==St||t[332]!==ne?(wt={groupLabel:Nt,tabDescription:St,tabLabel:ne},t[330]=Nt,t[331]=St,t[332]=ne,t[333]=wt):wt=t[333],wt},Ia=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=k("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:[o("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),o("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},Ea=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=k("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:[o("circle",{cx:"12",cy:"12",r:"4"}),o("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},$a=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o("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:o("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},Ha=t=>{const e=M(2),{className:s}=t;let a;return e[0]!==s?(a=o("span",{className:s}),e[0]=s,e[1]=a):a=e[1],a},Va=T(()=>import("../packem_chunks/theme-indicator.mjs").catch(()=>({default:Ha}))),Tt="absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",Ba=[{Icon:Ia,value:"system"},{Icon:Ea,value:"light"},{Icon:$a,value:"dark"}],za=()=>{const t=M(21),{theme:e,setTheme:s}=Ws(),a=re(),[r,n]=pt(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{n(!0)},t[0]=i):i=t[0];const l=i;let c;t[1]!==a?(c=a("Dark theme"),t[1]=a,t[2]=c):c=t[2];let d;t[3]!==a?(d=a("Light theme"),t[3]=a,t[4]=d):d=t[4];let f;t[5]!==a?(f=a("System theme"),t[5]=a,t[6]=f):f=t[6];let h;t[7]!==c||t[8]!==d||t[9]!==f?(h={dark:c,light:d,system:f},t[7]=c,t[8]=d,t[9]=f,t[10]=h):h=t[10];const x=h;let u;t[11]!==a?(u=a("Theme"),t[11]=a,t[12]=u):u=t[12];let g;t[13]!==r||t[14]!==x||t[15]!==s||t[16]!==e?(g=Ba.map(y=>{const{Icon:b,value:p}=y,m=e===p;return k("button",{"aria-checked":m,"aria-label":x[p],className:_("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",m?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${p}`,onClick:()=>{l(),s(p)},role:"radio",title:x[p],type:"button",children:[m&&(r?o(At,{fallback:o("span",{className:Tt}),children:o(Va,{className:Tt})}):o("span",{className:Tt})),o("span",{className:"relative",children:o(b,{})})]},p)}),t[13]=r,t[14]=x,t[15]=s,t[16]=e,t[17]=g):g=t[17];let v;return t[18]!==u||t[19]!==g?(v=o("div",{"aria-label":u,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",onFocus:l,onPointerEnter:l,role:"radiogroup",children:g}),t[18]=u,t[19]=g,t[20]=v):v=t[20],v},Da=t=>{const e=M(23),{domain:s,onOpenCommandPalette:a,page:r}=t,n=re();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(ga,{className:"-ms-1"}),e[0]=i):i=e[0];let l;e[1]!==n?(l=n("Breadcrumb"),e[1]=n,e[2]=l):l=e[2];let c;e[3]!==s?(c=o("span",{className:"text-muted-foreground",children:s}),e[3]=s,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=o("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:o("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=d):d=e[5];let f;e[6]!==r?(f=o("span",{className:"font-medium text-foreground",children:r}),e[6]=r,e[7]=f):f=e[7];let h;e[8]!==l||e[9]!==c||e[10]!==f?(h=k("nav",{"aria-label":l,className:"flex items-center gap-1.5 text-[13px]",children:[c,d,f]}),e[8]=l,e[9]=c,e[10]=f,e[11]=h):h=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=k("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[o("circle",{cx:"11",cy:"11",r:"7"}),o("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=x):x=e[12];let u;e[13]!==n?(u=n("Search…"),e[13]=n,e[14]=u):u=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=o("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"⌘K"}),e[15]=g):g=e[15];let v;e[16]!==a||e[17]!==u?(v=k("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:a,type:"button",children:[x,u,g]}),e[16]=a,e[17]=u,e[18]=v):v=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=o("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:o(za,{})}),e[19]=y):y=e[19];let b;return e[20]!==v||e[21]!==h?(b=k("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[i,h,v,y]}),e[20]=v,e[21]=h,e[22]=b):b=e[22],b},Oa={agents:{capability:"agents"},analytics:{capability:"analytics",feature:"analytics"},authAudit:{feature:"auth"},authConfig:{feature:"auth"},authSessions:{feature:"auth"},containers:{capability:"containers",feature:"containers"},fanout:{capability:"crossShardFanout"},files:{capability:"objectStorage",feature:"storage"},flags:{feature:"flags"},kv:{capability:"keyValueStore",feature:"kv"},mail:{capability:"mail",feature:"mail"},notifications:{feature:"notifications"},organizations:{feature:"auth"},payments:{feature:"payments"},pitr:{capability:"pointInTimeRecovery"},privacyRequests:{feature:"privacy"},queues:{capability:"queues",feature:"queues"},reactors:{capability:"serverReactors"},schedule:{capability:"scheduler",feature:"scheduler"},storageRules:{feature:"storage"},users:{feature:"auth"},vectors:{capability:"vectorStore",feature:"vectors"},workflows:{capability:"workflows",feature:"workflows"}},Za={agents:"Durable agents",analytics:"Analytics",containers:"Containers",crossShardFanout:"Cross-shard fan-out",keyValueStore:"Key-value storage",mail:"Mail delivery",objectStorage:"Object storage",pointInTimeRecovery:"Point-in-time recovery",queues:"Queues",scheduler:"Scheduling",serverReactors:"Server reactors",vectorStore:"Vector search",workflows:"Workflows"},qa={kind:"hidden"},Dt={kind:"ok"},Fa={kind:"pending"},is=(t,e,s)=>{const a=Oa[t];return a?.feature!==void 0&&!e[a.feature]?qa:a?.capability===void 0?Dt:e.settled?e.platform?.unsupported.includes(a.capability)===!0?{kind:"unavailable",reason:s("{capability} is not supported on {platform}.",{capability:s(Za[a.capability]),platform:e.platform.name})}:Dt:Fa},Wa=(t,e,s)=>{const a={},r=[];for(const n of t){const i=[];for(const l of n.tabs){const c=is(l,e,s);c.kind!=="hidden"&&i.push(l),c.kind==="unavailable"&&(a[l]=c.reason)}i.length>0&&r.push({...n,tabs:i})}return{unavailable:a,visibleGroups:r}},Ua=t=>{const e=M(3),{reason:s,title:a}=t;let r;return e[0]!==s||e[1]!==a?(r=o(Hs,{description:s,testId:"dash-unsupported",title:a}),e[0]=s,e[1]=a,e[2]=r):r=e[2],r},ja=t=>{const e=M(4),{console:s}=Vs();let a,r;e[0]!==s||e[1]!==t?(a=()=>{if(t===void 0)return;const n=i=>{if(!i.ctrlKey||i.metaKey||i.altKey||i.shiftKey||i.repeat||i.key.toLowerCase()!==s)return;const{target:l}=i;l instanceof HTMLElement&&(l.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(l.tagName))||(i.preventDefault(),t())};return globalThis.addEventListener("keydown",n),()=>{globalThis.removeEventListener("keydown",n)}},r=[s,t],e[0]=s,e[1]=t,e[2]=a,e[3]=r):(a=e[2],r=e[3]),gt(a,r)},I=(t,e)=>T(()=>t().then(s=>({default:s[e]}))),Ga=I(()=>import("../packem_chunks/InsightsPanel.mjs"),"InsightsPanel"),Ka=T(()=>import("../packem_chunks/rls-panel.mjs")),Qa=T(()=>import("../packem_chunks/AdvisorHealthPanel.mjs")),Ya=T(()=>import("../packem_chunks/SecurityAdvisorPanel.mjs")),Ja=T(()=>import("../packem_chunks/agents-panel.mjs")),Xa=T(()=>import("../packem_chunks/assistant-panel.mjs")),eo=I(()=>import("../packem_chunks/analytics-panel.mjs"),"AnalyticsPanel"),to=T(()=>import("../packem_chunks/ApiTab.mjs")),so=T(()=>import("../packem_chunks/architecture-panel.mjs")),ao=T(()=>import("../packem_chunks/auth-audit-panel.mjs")),oo=T(()=>import("../packem_chunks/auth-config-panel.mjs")),ro=T(()=>import("../packem_chunks/auth-sessions-panel.mjs")),no=T(()=>import("../packem_chunks/organizations-panel.mjs")),io=I(()=>import("../packem_chunks/users-panel.mjs"),"UsersPanel"),lo=T(()=>import("../packem_chunks/containers-panel.mjs")),co=I(()=>import("../packem_chunks/DeploymentHealthPanel.mjs"),"DeploymentHealthPanel"),uo=I(()=>import("../packem_chunks/TableEditor.mjs"),"TableEditor"),fo=I(()=>import("../packem_chunks/ExportImportPanel.mjs"),"ExportImportPanel"),mo=T(()=>import("../packem_chunks/migrations-route.mjs")),ho={data:Is,migrations:Ls},po=I(()=>import("../packem_chunks/PitrPanel.mjs"),"PitrPanel"),go=I(()=>import("../packem_chunks/privacy-requests-panel.mjs"),"PrivacyRequestsPanel"),bo=T(()=>import("../packem_chunks/flags-panel.mjs")),vo=T(()=>import("../packem_chunks/reactors-panel.mjs")),xo=I(()=>import("../packem_chunks/FunctionRunner.mjs"),"FunctionRunner"),yo=I(()=>import("../packem_chunks/FunctionStatsPanel.mjs"),"FunctionStatsPanel"),wo=T(()=>import("../packem_chunks/issues-panel.mjs")),ko=I(()=>import("../packem_chunks/AuditPanel.mjs"),"AuditPanel"),Mo=T(()=>import("../packem_chunks/log-drains-panel.mjs")),No=T(()=>import("../packem_chunks/LogsPanel.mjs").then(t=>({default:t.LogsPanel}))),So=I(()=>import("../packem_chunks/MailPanel.mjs"),"MailPanel"),Co=I(()=>import("../packem_chunks/schedule-panel.mjs"),"SchedulePanel"),Po=T(()=>import("../packem_chunks/subscriptions-panel.mjs")),_o=T(()=>import("../packem_chunks/sync-client-panel.mjs")),To=I(()=>import("../packem_chunks/kv-browser.mjs"),"KvBrowser"),Ao=T(()=>import("../packem_chunks/NotificationsPanel.mjs")),Ro=I(()=>import("../packem_chunks/payments-panel.mjs"),"PaymentsPanel"),Lo=I(()=>import("../packem_chunks/permissions-panel.mjs"),"PermissionsPanel"),Io=T(()=>import("../packem_chunks/queues-panel.mjs")),Eo=T(()=>import("../packem_chunks/dashboards-panel.mjs")),$o=T(()=>import("../packem_chunks/fanout-panel.mjs")),Ho=I(()=>import("../packem_chunks/HealthPanel.mjs"),"HealthPanel"),Vo=I(()=>import("../packem_chunks/MetricsPanel.mjs"),"MetricsPanel"),Bo=I(()=>import("../packem_chunks/SchemaViewer.mjs"),"SchemaViewer"),zo=I(()=>import("../packem_chunks/SettingsPanel.mjs"),"SettingsPanel"),Do=I(()=>import("../packem_chunks/SqlEditorPanel.mjs"),"SqlEditorPanel"),Oo=I(()=>import("../packem_chunks/FileBrowser.mjs"),"FileBrowser"),Zo=T(()=>import("../packem_chunks/storage-rules-panel.mjs")),qo=T(()=>import("../packem_chunks/traces-panel.mjs")),Fo=T(()=>import("../packem_chunks/evals-panel.mjs")),Wo=T(()=>import("../packem_chunks/ai-usage-panel.mjs")),Uo=I(()=>import("../packem_chunks/vector-browser.mjs"),"VectorBrowser"),jo=T(()=>import("../packem_chunks/workflows-panel.mjs")),ls=qt(null),Go={analytics:o("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:o("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),architecture:o("path",{d:"M4 4h6v5H4V4Zm10 0h6v5h-6V4ZM9 15h6v5H9v-5ZM7 9v3h10V9M12 12v3"}),audit:o("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:o("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:o("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:o("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:o("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:o("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:o("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:o("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:o("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:o("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:o("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:o("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:o("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:o("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:o("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),evals:o("path",{d:"M4 19V5m0 14h16M8 15l3-4 3 3 4-6M8 15v.01"}),aiUsage:o("path",{d:"M12 3v3m0 12v3M5.6 5.6l2.1 2.1m8.6 8.6 2.1 2.1M3 12h3m12 0h3M5.6 18.4l2.1-2.1m8.6-8.6 2.1-2.1M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z"}),health:o("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:o("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:o("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:o("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:o("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:o("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:o("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:o("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:o("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:o("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:o("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:o("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:o("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:o("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),privacyRequests:o("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 3h4"}),queues:o("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),reactors:o("path",{d:"M4 4v6h6M20 20v-6h-6M20 9a8 8 0 0 0-14.7-3M4 15a8 8 0 0 0 14.7 3"}),realtime:o("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:o("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:o("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:o("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:o("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:o("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"}),advisorHealth:o("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:o("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:o("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:o("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:o("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:o("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:o("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},Ot=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","architecture","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","evals","aiUsage","audit","realtime","reactors","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["advisorHealth","security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags","privacyRequests"]},{key:"settings",tabs:["settings"]}],Lt=t=>{const e=M(2),{tab:s}=t,a=Go[s];let r;return e[0]!==a?(r=o("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]=r):r=e[1],r},Ko=t=>t,cs=Ko(["home","data","sql","functions","api","architecture","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","advisorHealth","security","rls","permissions","insights","issues","logs","traces","evals","aiUsage","reactors","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","privacyRequests","settings"]),Qo=new Set(["api","data","migrations","sql"]),Yo=t=>{const e=t.split("/").findLast(Boolean)??"";return cs.includes(e)?e:"home"},Jo=t=>{const e=M(19),{chrome:s,connected:a}=t,r=re();let n;e[0]!==r?(n=r("admin token"),e[0]=r,e[1]=n):n=e[1];let i;e[2]!==n?(i=o("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:n}),e[2]=n,e[3]=i):i=e[3];let l;e[4]!==s.onTokenChange||e[5]!==s.token?(l=o(Ut,{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]=l):l=e[6];let c;e[7]!==a||e[8]!==r?(c=a&&k("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[o("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),r("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=a,e[8]=r,e[9]=c):c=e[9];let d;e[10]!==s.clearToken||e[11]!==a||e[12]!==r?(d=a&&o("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:r("Clear")}),e[10]=s.clearToken,e[11]=a,e[12]=r,e[13]=d):d=e[13];let f;return e[14]!==i||e[15]!==l||e[16]!==c||e[17]!==d?(f=k("div",{className:"flex flex-col gap-2",children:[i,l,c,d]}),e[14]=i,e[15]=l,e[16]=c,e[17]=d,e[18]=f):f=e[18],f},ds="opacity-50",Xo=t=>{const e=M(27),{current:s,group:a,groupLabel:r,selectTab:n,tabDescription:i,tabLabel:l,unavailable:c}=t,d=a.tabs.includes(s)?"page":void 0,f=r[a.key],h=a.tabs[0];let x;e[0]!==h?(x=o(Lt,{tab:h}),e[0]=h,e[1]=x):x=e[1];let u;e[2]!==d||e[3]!==f||e[4]!==x?(u=o(as,{"aria-current":d,"aria-label":f,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:x}),e[2]=d,e[3]=f,e[4]=x,e[5]=u):u=e[5];const g=r[a.key];let v;e[6]!==g?(v=o("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:g}),e[6]=g,e[7]=v):v=e[7];let y;if(e[8]!==s||e[9]!==a.tabs||e[10]!==n||e[11]!==i||e[12]!==l||e[13]!==c){let m;e[15]!==s||e[16]!==n||e[17]!==i||e[18]!==l||e[19]!==c?(m=w=>k("button",{"aria-current":s===w?"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",c[w]!==void 0&&ds),"data-tab":w,"data-testid":`dash-tab-${w}`,"data-unsupported":c[w]===void 0?void 0:"true",onClick:n,title:i[w],type:"button",children:[o(Lt,{tab:w}),o("span",{children:l[w]})]},w),e[15]=s,e[16]=n,e[17]=i,e[18]=l,e[19]=c,e[20]=m):m=e[20],y=a.tabs.map(m),e[8]=s,e[9]=a.tabs,e[10]=n,e[11]=i,e[12]=l,e[13]=c,e[14]=y}else y=e[14];let b;e[21]!==v||e[22]!==y?(b=k(os,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[v,y]}),e[21]=v,e[22]=y,e[23]=b):b=e[23];let p;return e[24]!==u||e[25]!==b?(p=k(ss,{children:[u,b]}),e[24]=u,e[25]=b,e[26]=p):p=e[26],p},er=t=>{const e=M(45),{chrome:s,collapsed:a,connected:r}=t,n=re();if(s===null){let m;e[0]!==n?(m=n("Admin"),e[0]=n,e[1]=m):m=e[1];let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=o("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=w):w=e[2];let C;e[3]!==n?(C=n("Admin"),e[3]=n,e[4]=C):C=e[4];let P;e[5]!==C?(P=o("span",{className:"truncate text-[13px] font-medium",children:C}),e[5]=C,e[6]=P):P=e[6];let S;e[7]!==n?(S=n("Studio"),e[7]=n,e[8]=S):S=e[8];let N;e[9]!==S?(N=o("span",{className:"truncate text-[11px] text-muted-foreground",children:S}),e[9]=S,e[10]=N):N=e[10];let A;e[11]!==P||e[12]!==N?(A=k("span",{className:"grid flex-1 text-start leading-tight",children:[P,N]}),e[11]=P,e[12]=N,e[13]=A):A=e[13];let R;return e[14]!==m||e[15]!==A?(R=k(ns,{className:"data-active:bg-transparent",size:"lg",tooltip:m,children:[w,A]}),e[14]=m,e[15]=A,e[16]=R):R=e[16],R}const i=a?"mx-auto size-8 justify-center":"w-full p-2";let l;e[17]!==i?(l=_("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",i),e[17]=i,e[18]=l):l=e[18];let c;e[19]!==r||e[20]!==n?(c=n(r?"Connected":"Not connected"),e[19]=r,e[20]=n,e[21]=c):c=e[21];const d=r?"bg-success":"bg-muted-foreground/50";let f;e[22]!==d?(f=_("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",d),e[22]=d,e[23]=f):f=e[23];let h;e[24]!==f?(h=k("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",o("span",{"aria-hidden":"true",className:f})]}),e[24]=f,e[25]=h):h=e[25];let x;e[26]!==a||e[27]!==r||e[28]!==n?(x=!a&&k(Ft,{children:[k("span",{className:"grid flex-1 text-start leading-tight",children:[o("span",{className:"truncate text-[13px] font-medium",children:n("Admin")}),o("span",{className:"truncate text-[11px] text-muted-foreground",children:n(r?"Connected":"Not connected")})]}),o("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:o("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=a,e[27]=r,e[28]=n,e[29]=x):x=e[29];let u;e[30]!==l||e[31]!==c||e[32]!==h||e[33]!==x?(u=k(as,{className:l,"data-testid":"dash-app-connect",title:c,children:[h,x]}),e[30]=l,e[31]=c,e[32]=h,e[33]=x,e[34]=u):u=e[34];const g=a?"end":"start",v=a?"right":"top";let y;e[35]!==s||e[36]!==r?(y=o(Jo,{chrome:s,connected:r}),e[35]=s,e[36]=r,e[37]=y):y=e[37];let b;e[38]!==v||e[39]!==y||e[40]!==g?(b=o(os,{align:g,keepMounted:!0,side:v,children:y}),e[38]=v,e[39]=y,e[40]=g,e[41]=b):b=e[41];let p;return e[42]!==b||e[43]!==u?(p=k(ss,{children:[u,b]}),e[42]=b,e[43]=u,e[44]=p):p=e[44],p},tr=t=>{const e=M(29),{chrome:s,connected:a,current:r,groupLabel:n,groups:i,selectTab:l,tabDescription:c,tabLabel:d,unavailable:f}=t,h=re(),{state:x}=Mt(),u=x==="collapsed",g=u&&"justify-center px-0";let v;e[0]!==g?(v=_("flex items-center gap-2.5 px-1.5 py-1",g),e[0]=g,e[1]=v):v=e[1];let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=o(Ks,{className:"size-9 shrink-0 text-foreground"}),e[2]=y):y=e[2];let b;e[3]!==u||e[4]!==a||e[5]!==h?(b=!u&&k(Ft,{children:[k("span",{className:"grid flex-1 leading-tight",children:[o("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),o("span",{className:"truncate text-[11px] text-muted-foreground",children:h("Studio")})]}),o(vt,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:h(a?"Live":"Local")})]}),e[3]=u,e[4]=a,e[5]=h,e[6]=b):b=e[6];let p;e[7]!==v||e[8]!==b?(p=o(va,{children:k("div",{className:v,children:[y,b]})}),e[7]=v,e[8]=b,e[9]=p):p=e[9];let m;e[10]!==u||e[11]!==r||e[12]!==n||e[13]!==i||e[14]!==l||e[15]!==c||e[16]!==d||e[17]!==f?(m=u?i.map(S=>o(Xo,{current:r,group:S,groupLabel:n,selectTab:l,tabDescription:c,tabLabel:d,unavailable:f},S.key)):i.map(S=>k(wa,{children:[o(ka,{className:"text-[11px] font-medium tracking-wider uppercase",children:n[S.key]}),o(Ma,{children:o(Bt,{children:S.tabs.map(N=>o(zt,{children:k(ns,{className:_("data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",f[N]!==void 0&&ds),"data-tab":N,"data-testid":`dash-tab-${N}`,"data-unsupported":f[N]===void 0?void 0:"true",isActive:r===N,onClick:l,title:c[N],tooltip:c[N],children:[o(Lt,{tab:N}),o("span",{children:d[N]})]})},N))})})]},S.key)),e[10]=u,e[11]=r,e[12]=n,e[13]=i,e[14]=l,e[15]=c,e[16]=d,e[17]=f,e[18]=m):m=e[18];let w;e[19]!==m?(w=o(ya,{children:m}),e[19]=m,e[20]=w):w=e[20];let C;e[21]!==s||e[22]!==u||e[23]!==a?(C=o(xa,{children:o(Bt,{children:o(zt,{children:o(er,{chrome:s,collapsed:u,connected:a})})})}),e[21]=s,e[22]=u,e[23]=a,e[24]=C):C=e[24];let P;return e[25]!==p||e[26]!==w||e[27]!==C?(P=k(pa,{collapsible:"icon",variant:"inset",children:[p,w,C]}),e[25]=p,e[26]=w,e[27]=C,e[28]=P):P=e[28],P},$t=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=k("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[k("div",{className:"flex items-center gap-2",children:[o(Ct,{className:"h-8 w-40"}),o(Ct,{className:"h-8 w-24"})]}),o(Ct,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},sr=t=>{const e=M(5),{title:s,verdict:a}=t;if(a.kind==="pending"){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o($t,{}),e[0]=n):n=e[0],n}if(a.kind==="unavailable"){let n;return e[1]!==s||e[2]!==a.reason?(n=o(Ua,{reason:a.reason,title:s}),e[1]=s,e[2]=a.reason,e[3]=n):n=e[3],n}let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=o(vs,{}),e[4]=r):r=e[4],r},ar=()=>{const t=M(55),e=re(),s=Zt();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:cr},t[0]=a):a=t[0];const r=bs(a),n=Yo(r),i=Qo.has(n),l=Ns(),c=l?.toggle,d=ws();ja(c);const f=Ts(),{groupLabel:h,tabDescription:x,tabLabel:u}=La(),{unavailable:g,visibleGroups:v}=Wa(Ot,f,e),y={...x,...g},b=is(n,f,e),p=b.kind==="hidden";let m,w;t[1]!==p||t[2]!==s?(m=()=>{p&&Rt(s({replace:!0,to:"/home"}))},w=[p,s],t[1]=p,t[2]=s,t[3]=m,t[4]=w):(m=t[3],w=t[4]),gt(m,w);let C;t[5]!==s?(C=ee=>{Rt(s({to:`/${ee.currentTarget.dataset.tab??""}`}))},t[5]=s,t[6]=C):C=t[6];const P=C;let S,N;t[7]!==n||t[8]!==u?(S=()=>{typeof document<"u"&&(document.title=`${u[n]} · lunora`)},N=[n,u],t[7]=n,t[8]=u,t[9]=S,t[10]=N):(S=t[9],N=t[10]),gt(S,N);const A=v.find(ee=>ee.tabs.includes(n))??Ot[0],R=v.flatMap(ee=>ee.tabs.filter(ne=>g[ne]===void 0).map(ne=>({group:h[ee.key],label:u[ne],to:`/${ne}`})));let L;t[11]!==e||t[12]!==c?(L=c===void 0?[]:[{group:e("Operations"),label:e("Toggle operation console"),run:c}],t[11]=e,t[12]=c,t[13]=L):L=t[13];let V;t[14]!==d||t[15]!==e?(V=d===void 0||d.unavailable?[]:[{group:e("Operations"),label:e("Ask the assistant"),run:d.toggle}],t[14]=d,t[15]=e,t[16]=V):V=t[16];const O=[...R,...L,...V],$=It(ls),Z=$!==null&&$.token!=="",z=h[A.key],D=u[n];let H;t[17]!==z||t[18]!==D?(H=o(Da,{domain:z,onOpenCommandPalette:$s,page:D}),t[17]=z,t[18]=D,t[19]=H):H=t[19];let B;t[20]!==$?.rulesInstalled?(B=$?.rulesInstalled===!1&&o(Js,{}),t[20]=$?.rulesInstalled,t[21]=B):B=t[21];const E=`dash-tab-${n}`,te=i?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",se=u[n];let q;t[22]!==e||t[23]!==se?(q=e("{title} failed",{title:se}),t[22]=e,t[23]=se,t[24]=q):q=t[24];const ae=u[n];let F;t[25]!==e?(F=e("Try again"),t[25]=e,t[26]=F):F=t[26];let J;t[27]===Symbol.for("react.memo_cache_sentinel")?(J=o($t,{}),t[27]=J):J=t[27];const oe=u[n];let W;t[28]!==oe||t[29]!==b?(W=o(At,{fallback:J,children:o(sr,{title:oe,verdict:b})}),t[28]=oe,t[29]=b,t[30]=W):W=t[30];let U;t[31]!==n||t[32]!==q||t[33]!==ae||t[34]!==F||t[35]!==W?(U=o(ks,{fallbackTitle:q,label:ae,retryLabel:F,children:W},n),t[31]=n,t[32]=q,t[33]=ae,t[34]=F,t[35]=W,t[36]=U):U=t[36];let j;t[37]!==te||t[38]!==U?(j=o("div",{className:te,children:U}),t[37]=te,t[38]=U,t[39]=j):j=t[39];let G;t[40]!==l?(G=l?.open===!0&&o(Ta,{focusSeq:l.focusSeq,onClose:l.close,onShownChange:l.setShown,shown:l.shown}),t[40]=l,t[41]=G):G=t[41];let K;t[42]!==E||t[43]!==j||t[44]!==G?(K=k("div",{"aria-labelledby":E,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[j,G]}),t[42]=E,t[43]=j,t[44]=G,t[45]=K):K=t[45];let Q;t[46]!==H||t[47]!==B||t[48]!==K?(Q=k("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[H,B,K]}),t[46]=H,t[47]=B,t[48]=K,t[49]=Q):Q=t[49];let Y;t[50]!==d?(Y=d!==void 0&&d.open&&!d.unavailable&&o(At,{fallback:null,children:o(Xa,{assistant:d})}),t[50]=d,t[51]=Y):Y=t[51];let X;return t[52]!==Q||t[53]!==Y?(X=k(ba,{className:"flex flex-row overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[Q,Y]}),t[52]=Q,t[53]=Y,t[54]=X):X=t[54],k(ha,{className:"min-h-0 flex-1","data-platform":f.platform?.id,"data-testid":"lunora-studio",children:[o(Es,{items:O}),o(tr,{chrome:$,connected:Z,current:n,groupLabel:h,groups:v,selectTab:P,tabDescription:y,tabLabel:u,unavailable:g}),X]})},or=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o(Ms,{children:o(ys,{children:o(ar,{})})}),t[0]=e):e=t[0],e},rr=t=>{const e=M(5),{initialShardKey:s,schemaEditable:a}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const n=ps(r),{table:i}=n,l=typeof i=="string"?i:void 0;let c;return e[1]!==s||e[2]!==l||e[3]!==a?(c=o(Bo,{initialShardKey:s,initialTable:l,schemaEditable:a}),e[1]=s,e[2]=l,e[3]=a,e[4]=c):c=e[4],c},nr=()=>{const t=M(3),e=Zt();let s,a;return t[0]!==e?(s=()=>{Rt(e({replace:!0,to:"/home"}))},a=[e],t[0]=e,t[1]=s,t[2]=a):(s=t[1],a=t[2]),gt(s,a),null},ir=({analyticsSqlQuery:t,basePath:e,privacyRequests:s,dataEditable:a=!1,functions:r,initialShardKey:n,openApiSpec:i,openRpcSpec:l,runAsIdentity:c=!1,schemaEditable:d=!1,scheduledCancel:f,scheduledCron:h,scheduledLoad:x})=>{const u=us({component:or}),g={agents:o(Ja,{initialShardKey:n}),analytics:o(eo,{runQuery:t}),api:o(to,{functions:r,initialShardKey:n,openApiSpec:i,openRpcSpec:l}),architecture:o(so,{}),audit:o(ko,{initialShardKey:n}),authAudit:o(ao,{}),authConfig:o(oo,{}),authSessions:o(ro,{}),containers:o(lo,{}),dashboards:o(Eo,{initialShardKey:n}),data:o(uo,{canGenerateRows:a&&d,editable:a,initialShardKey:n}),deploymentHealth:o(co,{}),drains:o(Mo,{}),export:o(fo,{initialShardKey:n}),fanout:o($o,{initialShardKey:n}),files:o(Oo,{}),kv:o(To,{}),flags:o(bo,{initialShardKey:n}),reactors:o(vo,{initialShardKey:n}),functions:k("div",{className:"flex flex-col gap-8",children:[o(yo,{functions:r,initialShardKey:n}),o(xo,{functions:r,runAsIdentity:c})]}),health:o(Ho,{initialShardKey:n}),home:o(_s,{initialShardKey:n}),insights:o(Ga,{initialShardKey:n}),issues:o(wo,{initialShardKey:n}),logs:o(No,{initialShardKey:n}),traces:o(qo,{initialShardKey:n}),evals:o(Fo,{initialShardKey:n}),aiUsage:o(Wo,{initialShardKey:n}),metrics:o(Vo,{initialShardKey:n}),migrations:o(mo,{initialShardKey:n}),notifications:o(Ao,{}),organizations:o(no,{}),permissions:o(Lo,{functions:r,runAsIdentity:c,schemaEditable:d}),pitr:o(po,{initialShardKey:n}),privacyRequests:o(go,{source:s}),mail:o(So,{}),payments:o(Ro,{}),queues:o(Io,{}),realtime:k("div",{className:"flex flex-col gap-8",children:[o(Po,{initialShardKey:n}),o(_o,{})]}),rls:o(Ka,{}),schedule:o(Co,{loadCronJobs:h,scheduledCancel:f,scheduledLoad:x}),schema:o(rr,{initialShardKey:n,schemaEditable:d}),advisorHealth:o(Qa,{}),security:o(Ya,{}),settings:o(zo,{initialShardKey:n}),sql:o(Do,{initialShardKey:n}),storageRules:o(Zo,{}),users:o(io,{}),vectors:o(Uo,{}),workflows:o(jo,{})},v=Ht({component:()=>g.home,getParentRoute:()=>u,path:"/"}),y=cs.map(m=>Ht({component:()=>g[m],getParentRoute:()=>u,path:`/${m}`,validateSearch:ho[m]})),b=u.addChildren([v,...y]),p="window"in globalThis?fs():ms({initialEntries:["/home"]});return hs({...e===void 0||e==="/"?{}:{basepath:e},defaultNotFoundComponent:nr,defaultPendingComponent:$t,defaultPendingMinMs:0,defaultPendingMs:0,history:p,routeTree:b})},lr=t=>{const e=M(19),{analyticsSqlQuery:s,basePath:a,chrome:r,dataEditable:n,functions:i,initialShardKey:l,openApiSpec:c,openRpcSpec:d,privacyRequests:f,runAsIdentity:h,schemaEditable:x,scheduledCancel:u,scheduledCron:g,scheduledLoad:v}=t;let y;e[0]!==s||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==l||e[5]!==c||e[6]!==d||e[7]!==f||e[8]!==h||e[9]!==u||e[10]!==g||e[11]!==v||e[12]!==x?(y=ir({analyticsSqlQuery:s,basePath:a,privacyRequests:f,dataEditable:n,functions:i,initialShardKey:l,openApiSpec:c,openRpcSpec:d,runAsIdentity:h,schemaEditable:x,scheduledCancel:u,scheduledCron:g,scheduledLoad:v}),e[0]=s,e[1]=a,e[2]=n,e[3]=i,e[4]=l,e[5]=c,e[6]=d,e[7]=f,e[8]=h,e[9]=u,e[10]=g,e[11]=v,e[12]=x,e[13]=y):y=e[13];const b=y,p=r??null;let m;e[14]!==b?(m=o(gs,{router:b}),e[14]=b,e[15]=m):m=e[15];let w;return e[16]!==p||e[17]!==m?(w=o(ls,{value:p,children:m}),e[16]=p,e[17]=m,e[18]=w):w=e[18],w},Or=t=>{const e=M(10);let s,a,r;e[0]!==t?({i18n:s,locale:a,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r):(s=e[1],a=e[2],r=e[3]);let n;e[4]!==r?(n=o(Fs,{children:o(lr,{...r})}),e[4]=r,e[5]=n):n=e[5];const i=n;if(s===void 0&&a===void 0)return i;let l;return e[6]!==s||e[7]!==a||e[8]!==i?(l=o(Rs,{i18n:s,locale:a,children:i}),e[6]=s,e[7]=a,e[8]=i,e[9]=l):l=e[9],l};function cr(t){return t.location.pathname}export{Ks as B,Or as S,qs as T,Dr as a,ta as b,oa as c,ra as d,na as e,Ws as u};
@@ -1 +1 @@
1
- import{c as $}from"react/compiler-runtime";import{useT as O}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as q,f as H,b as Q}from"./internal-hIuTpSbx.mjs";import{jsx as p,jsxs as S}from"react/jsx-runtime";import{useState as E,useRef as D,useMemo as Y}from"react";import{settlePolls as G}from"./DEFAULT_AUTO_REFRESH_MS-Py5Yx7rP.mjs";import{u as J}from"./use-mirrored-ref-CVDf2z1M.mjs";import{u as K}from"./use-admin-query-CaOm4JS3.mjs";import{ADMIN_FUNCTIONS as Z}from"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import{useVirtualizer as X}from"@tanstack/react-virtual";import{c as ee}from"./utils-bhneXptQ.mjs";import{f as te}from"./virtual-rect-D_j7aLxX.mjs";const re=2166136261,se=16777619,L=(s,e=re)=>{let t=e;for(let r=0;r<s.length;r+=1)t^=s.charCodeAt(r),t=Math.imul(t,se);return(t>>>0).toString(16).padStart(8,"0")},ne=/([a-z\d])([A-Z])/gu,oe=/[\s_-]+/u,le=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),ae=s=>{const e=s.replaceAll(ne,"$1 $2").split(oe).map(r=>r.toLowerCase()).filter(r=>r.length>0),t=new Set(e);for(let r=0;r<e.length-1;r+=1){const n=e[r],u=e[r+1];n===void 0||u===void 0||(t.add(`${n}${u}`),t.add(`${n}_${u}`))}return[...t]},I="•••",U=(s,e)=>{try{return e==="redact"?null:e==="hash"?s==null?s:L(typeof s=="bigint"?s.toString():typeof s=="string"?s:JSON.stringify(s)):I}catch{return I}},V=(s,e)=>{const t=new Map;for(const r of s)r.table===e&&t.set(r.column,r.strategy);return t},ce=s=>{for(const e of ae(s))if(le.has(e))return!0;return!1},j=(s,e)=>{const t=e.filter(n=>!s.has(n)&&ce(n));if(t.length===0)return s;const r=new Map(s);for(const n of t)r.set(n,"redact");return r},_e=(s,e,t)=>{if(!t.enabled)return s;const r=t.columns.get(e);return r===void 0?s:U(s,r)},ie=(s,e)=>{if(!e.enabled||e.columns.size===0)return s;const t={...s};for(const[r,n]of e.columns)r in t&&(t[r]=U(t[r],n));return t},Me=(s,e)=>!e.enabled||e.columns.size===0?s:s.map(t=>ie(t,e)),z=s=>s==null?"∅":s===""?"(empty)":q(s),ue=s=>{const e=$(32),{column:t,onFacetFilter:r,state:n}=s,u=O();let x;e[0]!==t||e[1]!==r||e[2]!==n.result?.values?(x=c=>{const m=Number(c.currentTarget.dataset.index),k=n.result?.values[m];k!==void 0&&r(t,k.value)},e[0]=t,e[1]=r,e[2]=n.result?.values,e[3]=x):x=e[3];const g=x,o=`db-facet-${t}`;let d;e[4]!==t?(d=p("span",{className:"font-medium text-foreground",children:t}),e[4]=t,e[5]=d):d=e[5];let a;e[6]!==n.loading||e[7]!==n.result||e[8]!==u?(a=n.loading&&n.result===null&&p("span",{className:"text-muted-foreground",children:u("Loading…")}),e[6]=n.loading,e[7]=n.result,e[8]=u,e[9]=a):a=e[9];let l;e[10]!==n.error?(l=n.error!==null&&p("span",{className:"text-destructive",role:"alert",children:n.error}),e[10]=n.error,e[11]=l):l=e[11];let i;e[12]!==n.result?.values?(i=n.result?.values??[],e[12]=n.result?.values,e[13]=i):i=e[13];let f;if(e[14]!==t||e[15]!==g||e[16]!==i){let c;e[18]!==t||e[19]!==g?(c=(m,k)=>S("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":k,"data-testid":`db-facet-value-${t}`,onClick:g,type:"button",children:[p("span",{className:"truncate",children:z(m.value)}),p("span",{className:"shrink-0 tabular-nums text-foreground/70",children:m.count})]},z(m.value)),e[18]=t,e[19]=g,e[20]=c):c=e[20],f=i.map(c),e[14]=t,e[15]=g,e[16]=i,e[17]=f}else f=e[17];let b;e[21]!==t||e[22]!==n.result||e[23]!==u?(b=n.result?.truncated===!0&&p("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${t}`,children:u("Showing the {n} most common values.",{n:n.result.values.length})}),e[21]=t,e[22]=n.result,e[23]=u,e[24]=b):b=e[24];let h;return e[25]!==o||e[26]!==d||e[27]!==a||e[28]!==l||e[29]!==f||e[30]!==b?(h=S("section",{className:"flex flex-col gap-1","data-testid":o,children:[d,a,l,f,b]}),e[25]=o,e[26]=d,e[27]=a,e[28]=l,e[29]=f,e[30]=b,e[31]=h):h=e[31],h},Te=s=>{const e=$(44),{columns:t,facets:r,mask:n,onFacetFilter:u,onToggleFacet:x}=s,g=O();let o;e[0]!==x?(o=y=>{const{column:v}=y.currentTarget.dataset;v!==void 0&&x(v)},e[0]=x,e[1]=o):o=e[1];const d=o;let a;e[2]!==n?(a=y=>n.enabled&&n.columns.has(y),e[2]=n,e[3]=a):a=e[3];const l=a;let i,f,b,h,c,m,k,w;if(e[4]!==t||e[5]!==r||e[6]!==l||e[7]!==g||e[8]!==d){w=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==l?(y=N=>!l(N),e[17]=l,e[18]=y):y=e[18];const v=t.filter(y);let M;if(e[19]!==r||e[20]!==l?(M=Object.entries(r).filter(N=>{const[W]=N;return!l(W)}),e[19]=r,e[20]=l,e[21]=M):M=e[21],i=M,v.length===0){w=null;break e}m="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",k="db-facets",h="flex flex-col gap-1.5";let T;e[22]!==g?(T=g("Facets"),e[22]=g,e[23]=T):T=e[23],e[24]!==T?(c=p("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:T}),e[24]=T,e[25]=c):c=e[25],f="flex flex-wrap gap-1";let A;e[26]!==r||e[27]!==d?(A=N=>p("button",{"aria-pressed":N in r,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":N,"data-testid":`db-facet-toggle-${N}`,onClick:d,type:"button",children:N},N),e[26]=r,e[27]=d,e[28]=A):A=e[28],b=v.map(A)}e[4]=t,e[5]=r,e[6]=l,e[7]=g,e[8]=d,e[9]=i,e[10]=f,e[11]=b,e[12]=h,e[13]=c,e[14]=m,e[15]=k,e[16]=w}else i=e[9],f=e[10],b=e[11],h=e[12],c=e[13],m=e[14],k=e[15],w=e[16];if(w!==Symbol.for("react.early_return_sentinel"))return w;let C;e[29]!==f||e[30]!==b?(C=p("div",{className:f,children:b}),e[29]=f,e[30]=b,e[31]=C):C=e[31];let F;e[32]!==C||e[33]!==h||e[34]!==c?(F=S("div",{className:h,children:[c,C]}),e[32]=C,e[33]=h,e[34]=c,e[35]=F):F=e[35];let _;e[36]!==u||e[37]!==i?(_=i.map(y=>{const[v,M]=y;return p(ue,{column:v,onFacetFilter:u,state:M},v)}),e[36]=u,e[37]=i,e[38]=_):_=e[38];let R;return e[39]!==F||e[40]!==_||e[41]!==m||e[42]!==k?(R=S("aside",{className:m,"data-testid":k,children:[F,_]}),e[39]=F,e[40]=_,e[41]=m,e[42]=k,e[43]=R):R=e[43],R},$e=()=>{const[s,e]=E({}),t=J(s),r=D({}),n=async(o,d)=>{const a=(r.current[o]??0)+1;r.current[o]=a,e(l=>o in l?{...l,[o]:{error:null,loading:!0,result:l[o]?.result??null}}:l);try{const l=await d(o);if(r.current[o]!==a)return;e(i=>o in i?{...i,[o]:{error:null,loading:!1,result:l}}:i)}catch(l){if(r.current[o]!==a)return;throw e(i=>o in i?{...i,[o]:{error:Q(l),loading:!1,result:null}}:i),l}};return{clearFacets:()=>{e({})},facets:s,facetsRef:t,refetchFacets:o=>G(Object.keys(t.current).map(d=>n(d,o))),toggleFacet:(o,d)=>{if(o in t.current){e(a=>Object.fromEntries(Object.entries(a).filter(([l])=>l!==o)));return}e(a=>({...a,[o]:{error:null,loading:!0,result:null}})),d!==null&&H(n(o,d))}}},de=[],fe=()=>{const s=$(1);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={},s[0]=e):e=s[0];const{data:t}=K(Z.maskPolicies,e);return Array.isArray(t?.columns)?t.columns:de},Re=s=>{const e=$(16),{columns:t,selectedTable:r}=s,n=fe(),[u,x]=E(!0);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{x(me)},e[0]=g):g=e[0];const o=g;let d;if(e[1]!==t||e[2]!==n||e[3]!==r){const h=V(n,r??"");d=j(h,t),e[1]=t,e[2]=n,e[3]=r,e[4]=d}else d=e[4];const a=d;let l;e[5]!==u||e[6]!==n?(l=(h,c)=>({columns:j(V(n,h),c),enabled:u}),e[5]=u,e[6]=n,e[7]=l):l=e[7];const i=l;let f;e[8]!==a||e[9]!==u?(f={columns:a,enabled:u},e[8]=a,e[9]=u,e[10]=f):f=e[10];let b;return e[11]!==a||e[12]!==u||e[13]!==i||e[14]!==f?(b={maskColumns:a,maskOn:u,maskView:f,maskViewFor:i,onToggleMask:o},e[11]=a,e[12]=u,e[13]=i,e[14]=f,e[15]=b):b=e[15],b};function me(s){return!s}const P=34,B=600,ge=s=>{const e=$(21),{item:t,onSelect:r,prefix:n,selected:u,start:x}=s;let g;e[0]!==t.name||e[1]!==r?(g=()=>{r(t.name)},e[0]=t.name,e[1]=r,e[2]=g):g=e[2];const o=g,d=`translateY(${String(x)}px)`;let a;e[3]!==d?(a={insetInline:0,position:"absolute",top:0,transform:d},e[3]=d,e[4]=a):a=e[4];const l=a,i=u?"bg-accent font-medium text-accent-foreground":"text-foreground";let f;e[5]!==i?(f=ee("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",i),e[5]=i,e[6]=f):f=e[6];const b=`${n}-table-${t.name}`;let h;e[7]!==t.name?(h=p("span",{className:"truncate",children:t.name}),e[7]=t.name,e[8]=h):h=e[8];let c;e[9]!==t.rowCount?(c=p("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]=c):c=e[10];let m;e[11]!==o||e[12]!==u||e[13]!==f||e[14]!==b||e[15]!==h||e[16]!==c?(m=S("button",{"aria-pressed":u,className:f,"data-testid":b,onClick:o,type:"button",children:[h,c]}),e[11]=o,e[12]=u,e[13]=f,e[14]=b,e[15]=h,e[16]=c,e[17]=m):m=e[17];let k;return e[18]!==l||e[19]!==m?(k=p("li",{style:l,children:m}),e[18]=l,e[19]=m,e[20]=k):k=e[20],k},Ae=({header:s,onReload:e,onSelect:t,prefix:r,reloadLabel:n,selected:u,tables:x})=>{const g=O(),[o,d]=E(""),a=D(null),l=c=>{d(c.target.value)},i=Y(()=>{const c=o.trim().toLowerCase();return c===""?x:x.filter(m=>m.name.toLowerCase().includes(c))},[o,x]),b=X({count:i.length,estimateSize:()=>P,getScrollElement:()=>a.current,initialRect:{height:B,width:240},observeElementRect:(c,m)=>te(c,m,B),overscan:12}).getVirtualItems(),h={height:i.length*P};return S("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${r}-table-list`,children:[s,S("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[p("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:g("Tables")}),e!==void 0&&p("button",{"aria-label":n??g("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":`${r}-load-tables`,onClick:e,title:n??g("Refresh"),type:"button",children:p("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:p("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"})})})]}),p("div",{className:"shrink-0 border-b border-border p-2",children:p("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":`${r}-table-search`,onChange:l,placeholder:g("search table…"),type:"search",value:o})}),S("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${r}-table-list-rows`,ref:a,children:[p("li",{"aria-hidden":"true",style:h}),b.map(c=>{const m=i[c.index];return m===void 0?null:p(ge,{item:m,onSelect:t,prefix:r,selected:u===m.name,start:c.start},m.name)})]})]})};export{Te as D,Ae as T,Re as a,ie as b,Me as c,_e as m,$e as u};
1
+ import{c as $}from"react/compiler-runtime";import{useT as O}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as q,f as H,b as Q}from"./internal-hIuTpSbx.mjs";import{jsx as p,jsxs as S}from"react/jsx-runtime";import{useState as E,useRef as D,useMemo as Y}from"react";import{settlePolls as G}from"./DEFAULT_AUTO_REFRESH_MS-Py5Yx7rP.mjs";import{u as J}from"./use-mirrored-ref-CVDf2z1M.mjs";import{u as K}from"./use-admin-query-CaOm4JS3.mjs";import{ADMIN_FUNCTIONS as Z}from"./ADMIN_FUNCTIONS-DUXsXId1.mjs";import{useVirtualizer as X}from"@tanstack/react-virtual";import{c as ee}from"./utils-bhneXptQ.mjs";import{f as te}from"./virtual-rect-D_j7aLxX.mjs";const re=2166136261,se=16777619,L=(s,e=re)=>{let t=e;for(let r=0;r<s.length;r+=1)t^=s.charCodeAt(r),t=Math.imul(t,se);return(t>>>0).toString(16).padStart(8,"0")},ne=/([a-z\d])([A-Z])/gu,oe=/[\s_-]+/u,le=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),ae=s=>{const e=s.replaceAll(ne,"$1 $2").split(oe).map(r=>r.toLowerCase()).filter(r=>r.length>0),t=new Set(e);for(let r=0;r<e.length-1;r+=1){const n=e[r],u=e[r+1];n===void 0||u===void 0||(t.add(`${n}${u}`),t.add(`${n}_${u}`))}return[...t]},I="•••",U=(s,e)=>{try{return e==="redact"?null:e==="hash"?s==null?s:L(typeof s=="bigint"?s.toString():typeof s=="string"?s:JSON.stringify(s)):I}catch{return I}},V=(s,e)=>{const t=new Map;for(const r of s)r.table===e&&t.set(r.column,r.strategy);return t},ce=s=>{for(const e of ae(s))if(le.has(e))return!0;return!1},j=(s,e)=>{const t=e.filter(n=>!s.has(n)&&ce(n));if(t.length===0)return s;const r=new Map(s);for(const n of t)r.set(n,"redact");return r},_e=(s,e,t)=>{if(!t.enabled)return s;const r=t.columns.get(e);return r===void 0?s:U(s,r)},ie=(s,e)=>{if(!e.enabled||e.columns.size===0)return s;const t={...s};for(const[r,n]of e.columns)r in t&&(t[r]=U(t[r],n));return t},Me=(s,e)=>!e.enabled||e.columns.size===0?s:s.map(t=>ie(t,e)),z=s=>s==null?"∅":s===""?"(empty)":q(s),ue=s=>{const e=$(32),{column:t,onFacetFilter:r,state:n}=s,u=O();let x;e[0]!==t||e[1]!==r||e[2]!==n.result?.values?(x=c=>{const m=Number(c.currentTarget.dataset.index),k=n.result?.values[m];k!==void 0&&r(t,k.value)},e[0]=t,e[1]=r,e[2]=n.result?.values,e[3]=x):x=e[3];const g=x,o=`db-facet-${t}`;let d;e[4]!==t?(d=p("span",{className:"font-medium text-foreground",children:t}),e[4]=t,e[5]=d):d=e[5];let a;e[6]!==n.loading||e[7]!==n.result||e[8]!==u?(a=n.loading&&n.result===null&&p("span",{className:"text-muted-foreground",children:u("Loading…")}),e[6]=n.loading,e[7]=n.result,e[8]=u,e[9]=a):a=e[9];let l;e[10]!==n.error?(l=n.error!==null&&p("span",{className:"text-destructive",role:"alert",children:n.error}),e[10]=n.error,e[11]=l):l=e[11];let i;e[12]!==n.result?.values?(i=n.result?.values??[],e[12]=n.result?.values,e[13]=i):i=e[13];let f;if(e[14]!==t||e[15]!==g||e[16]!==i){let c;e[18]!==t||e[19]!==g?(c=(m,k)=>S("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":k,"data-testid":`db-facet-value-${t}`,onClick:g,type:"button",children:[p("span",{className:"truncate",children:z(m.value)}),p("span",{className:"shrink-0 tabular-nums text-foreground/70",children:m.count})]},z(m.value)),e[18]=t,e[19]=g,e[20]=c):c=e[20],f=i.map(c),e[14]=t,e[15]=g,e[16]=i,e[17]=f}else f=e[17];let b;e[21]!==t||e[22]!==n.result||e[23]!==u?(b=n.result?.truncated===!0&&p("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${t}`,children:u("Showing the {n} most common values.",{n:n.result.values.length})}),e[21]=t,e[22]=n.result,e[23]=u,e[24]=b):b=e[24];let h;return e[25]!==o||e[26]!==d||e[27]!==a||e[28]!==l||e[29]!==f||e[30]!==b?(h=S("section",{className:"flex flex-col gap-1","data-testid":o,children:[d,a,l,f,b]}),e[25]=o,e[26]=d,e[27]=a,e[28]=l,e[29]=f,e[30]=b,e[31]=h):h=e[31],h},Te=s=>{const e=$(44),{columns:t,facets:r,mask:n,onFacetFilter:u,onToggleFacet:x}=s,g=O();let o;e[0]!==x?(o=y=>{const{column:v}=y.currentTarget.dataset;v!==void 0&&x(v)},e[0]=x,e[1]=o):o=e[1];const d=o;let a;e[2]!==n?(a=y=>n.enabled&&n.columns.has(y),e[2]=n,e[3]=a):a=e[3];const l=a;let i,f,b,h,c,m,k,w;if(e[4]!==t||e[5]!==r||e[6]!==l||e[7]!==g||e[8]!==d){w=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==l?(y=N=>!l(N),e[17]=l,e[18]=y):y=e[18];const v=t.filter(y);let M;if(e[19]!==r||e[20]!==l?(M=Object.entries(r).filter(N=>{const[W]=N;return!l(W)}),e[19]=r,e[20]=l,e[21]=M):M=e[21],i=M,v.length===0){w=null;break e}m="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",k="db-facets",h="flex flex-col gap-1.5";let T;e[22]!==g?(T=g("Facets"),e[22]=g,e[23]=T):T=e[23],e[24]!==T?(c=p("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:T}),e[24]=T,e[25]=c):c=e[25],f="flex flex-wrap gap-1";let A;e[26]!==r||e[27]!==d?(A=N=>p("button",{"aria-pressed":N in r,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":N,"data-testid":`db-facet-toggle-${N}`,onClick:d,type:"button",children:N},N),e[26]=r,e[27]=d,e[28]=A):A=e[28],b=v.map(A)}e[4]=t,e[5]=r,e[6]=l,e[7]=g,e[8]=d,e[9]=i,e[10]=f,e[11]=b,e[12]=h,e[13]=c,e[14]=m,e[15]=k,e[16]=w}else i=e[9],f=e[10],b=e[11],h=e[12],c=e[13],m=e[14],k=e[15],w=e[16];if(w!==Symbol.for("react.early_return_sentinel"))return w;let C;e[29]!==f||e[30]!==b?(C=p("div",{className:f,children:b}),e[29]=f,e[30]=b,e[31]=C):C=e[31];let F;e[32]!==C||e[33]!==h||e[34]!==c?(F=S("div",{className:h,children:[c,C]}),e[32]=C,e[33]=h,e[34]=c,e[35]=F):F=e[35];let _;e[36]!==u||e[37]!==i?(_=i.map(y=>{const[v,M]=y;return p(ue,{column:v,onFacetFilter:u,state:M},v)}),e[36]=u,e[37]=i,e[38]=_):_=e[38];let R;return e[39]!==F||e[40]!==_||e[41]!==m||e[42]!==k?(R=S("aside",{className:m,"data-testid":k,children:[F,_]}),e[39]=F,e[40]=_,e[41]=m,e[42]=k,e[43]=R):R=e[43],R},$e=()=>{const[s,e]=E({}),t=J(s),r=D({}),n=async(o,d)=>{const a=(r.current[o]??0)+1;r.current[o]=a,e(l=>o in l?{...l,[o]:{error:null,loading:!0,result:l[o]?.result??null}}:l);try{const l=await d(o);if(r.current[o]!==a)return;e(i=>o in i?{...i,[o]:{error:null,loading:!1,result:l}}:i)}catch(l){if(r.current[o]!==a)return;throw e(i=>o in i?{...i,[o]:{error:Q(l),loading:!1,result:null}}:i),l}};return{clearFacets:()=>{e({})},facets:s,facetsRef:t,refetchFacets:o=>G(Object.keys(t.current).map(d=>n(d,o))),toggleFacet:(o,d)=>{if(o in t.current){e(a=>Object.fromEntries(Object.entries(a).filter(([l])=>l!==o)));return}e(a=>({...a,[o]:{error:null,loading:!0,result:null}})),d!==null&&H(n(o,d))}}},de=[],fe=()=>{const s=$(1);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={},s[0]=e):e=s[0];const{data:t}=K(Z.maskPolicies,e);return Array.isArray(t?.columns)?t.columns:de},Re=s=>{const e=$(16),{columns:t,selectedTable:r}=s,n=fe(),[u,x]=E(!0);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{x(me)},e[0]=g):g=e[0];const o=g;let d;if(e[1]!==t||e[2]!==n||e[3]!==r){const h=V(n,r??"");d=j(h,t),e[1]=t,e[2]=n,e[3]=r,e[4]=d}else d=e[4];const a=d;let l;e[5]!==u||e[6]!==n?(l=(h,c)=>({columns:j(V(n,h),c),enabled:u}),e[5]=u,e[6]=n,e[7]=l):l=e[7];const i=l;let f;e[8]!==a||e[9]!==u?(f={columns:a,enabled:u},e[8]=a,e[9]=u,e[10]=f):f=e[10];let b;return e[11]!==a||e[12]!==u||e[13]!==i||e[14]!==f?(b={maskColumns:a,maskOn:u,maskView:f,maskViewFor:i,onToggleMask:o},e[11]=a,e[12]=u,e[13]=i,e[14]=f,e[15]=b):b=e[15],b};function me(s){return!s}const P=34,B=600,ge=s=>{const e=$(21),{item:t,onSelect:r,prefix:n,selected:u,start:x}=s;let g;e[0]!==t.name||e[1]!==r?(g=()=>{r(t.name)},e[0]=t.name,e[1]=r,e[2]=g):g=e[2];const o=g,d=`translateY(${String(x)}px)`;let a;e[3]!==d?(a={insetInline:0,position:"absolute",top:0,transform:d},e[3]=d,e[4]=a):a=e[4];const l=a,i=u?"bg-accent font-medium text-accent-foreground":"text-foreground";let f;e[5]!==i?(f=ee("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",i),e[5]=i,e[6]=f):f=e[6];const b=`${n}-table-${t.name}`;let h;e[7]!==t.name?(h=p("span",{className:"truncate",children:t.name}),e[7]=t.name,e[8]=h):h=e[8];let c;e[9]!==t.rowCount?(c=p("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]=c):c=e[10];let m;e[11]!==o||e[12]!==u||e[13]!==f||e[14]!==b||e[15]!==h||e[16]!==c?(m=S("button",{"aria-pressed":u,className:f,"data-testid":b,onClick:o,type:"button",children:[h,c]}),e[11]=o,e[12]=u,e[13]=f,e[14]=b,e[15]=h,e[16]=c,e[17]=m):m=e[17];let k;return e[18]!==l||e[19]!==m?(k=p("li",{style:l,children:m}),e[18]=l,e[19]=m,e[20]=k):k=e[20],k},Ae=({header:s,onReload:e,onSelect:t,prefix:r,reloadLabel:n,selected:u,tables:x})=>{const g=O(),[o,d]=E(""),a=D(null),l=c=>{d(c.target.value)},i=Y(()=>{const c=o.trim().toLowerCase();return c===""?x:x.filter(m=>m.name.toLowerCase().includes(c))},[o,x]),b=X({count:i.length,estimateSize:()=>P,getScrollElement:()=>a.current,initialRect:{height:B,width:240},observeElementRect:(c,m)=>te(c,m,B),overscan:12}).getVirtualItems(),h={height:i.length*P};return S("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${r}-table-list`,children:[s,S("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[p("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:g("Tables")}),e!==void 0&&p("button",{"aria-label":n??g("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":`${r}-load-tables`,onClick:e,title:n??g("Refresh"),type:"button",children:p("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:p("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"})})})]}),p("div",{className:"shrink-0 border-b border-border p-2",children:p("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":`${r}-table-search`,onChange:l,placeholder:g("search table…"),type:"search",value:o})}),S("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${r}-table-list-rows`,ref:a,children:[p("li",{"aria-hidden":"true",style:h}),b.map(c=>{const m=i[c.index];return m===void 0?null:p(ge,{item:m,onSelect:t,prefix:r,selected:u===m.name,start:c.start},m.name)})]})]})};export{Te as D,Ae as T,Re as a,ie as b,Me as c,_e as m,$e as u};
@@ -0,0 +1 @@
1
+ import{useState as u}from"react";import{ADMIN_FUNCTIONS as s}from"./ADMIN_FUNCTIONS-DUXsXId1.mjs";import{d,c}from"./internal-hIuTpSbx.mjs";import{u as B}from"./use-admin-query-CaOm4JS3.mjs";import{u as Q}from"./use-studio-client-DCA50tF2.mjs";const x=async n=>{try{const{knowledgeExcerpts:o}=await import("../packem_chunks/ai-knowledge.mjs");return o(n)}catch{return[]}},G={},L=c(s.aiGenerateSql),H=c(s.aiTableFilter),M=c(s.aiChartConfig),P=c(s.aiChat),U=c(s.aiNameQuery),D=c(s.aiCronExpression),V=n=>{const o=Q(),[f,v]=u({}),[A,g]=u({}),m=B(s.aiAvailable,G,{shardKey:n}),[h,q]=u(!1),_=h||m.data?.available===!1,i=t=>{v(r=>({...r,[t]:!0})),g(r=>({...r,[t]:void 0}))},e=(t,r)=>{v(a=>({...a,[t]:!1})),r!==void 0&&g(a=>({...a,[t]:r})),(r==="ai-disabled"||r==="no-ai-binding")&&q(!0)},p=async t=>{i("sql");try{const r=await o.query(L,t,d(n));return e("sql",r.degraded?r.reason:void 0),r.degraded?void 0:r.sql}catch{e("sql","ai-error");return}},E=async(t,r)=>p({failedError:r?.error,failedSql:r?.sql,prompt:t}),w=async(t,r)=>p({editSql:r,prompt:t}),C=async(t,r,a,F,O,y)=>{i("chat");try{const l=await o.streamRpc(P,{approval:F,knowledge:await x(t),prompt:t,schema:a,shardKey:n,transcript:r},{onFrame:k=>{O?.(k)},...y===void 0?{}:{signal:y}});return e("chat",l.degraded?l.reason:void 0),l.degraded?void 0:l}catch{e("chat","ai-error");return}},I=async(t,r)=>{i("filter");try{const a=await o.query(H,{prompt:t,table:r},d(n));return e("filter",a.degraded?a.reason:void 0),a.degraded?void 0:a.clauses}catch{e("filter","ai-error");return}},R=async t=>{i("chart");try{const r=await o.query(M,t,d(n));return e("chart",r.degraded?r.reason:void 0),r.degraded?void 0:r.chart}catch{e("chart","ai-error");return}},S=async t=>{i("name");try{const r=await o.query(U,{sql:t},d(n));return e("name",r.degraded?r.reason:void 0),r.degraded?void 0:{description:r.description,title:r.title}}catch{e("name","ai-error");return}},T=async t=>{i("cron");try{const r=await o.query(D,{prompt:t},d(n));return e("cron",r.degraded?r.reason:void 0),r.degraded?void 0:r.cron}catch{e("cron","ai-error");return}},N=t=>f[t]===!0,b=t=>A[t];return{chat:C,generate:E,inferChart:R,level:m.data?.level,nameQuery:S,pending:N,reason:b,rewrite:w,suggestCron:T,suggestFilter:I,unavailable:_}};export{V as u};
@@ -0,0 +1 @@
1
+ import{a as b}from"./chunk-GWNGVKLG.js";import{a as v}from"./chunk-6G3E4PJ2.js";import{a as i,d as m}from"./chunk-5PEAXTYQ.js";var n=m(b(),1),r=m(v(),1);var x=i(function(t,a,s){let e=(0,n.c)(4),o=a===void 0?300:a,[d,f]=(0,r.useState)(t),[p,l]=(0,r.useState)(s);s!==void 0&&s!==p&&(l(s),f(t));let u,c;return e[0]!==o||e[1]!==t?(u=i(()=>{let T=setTimeout(()=>{f(t)},o);return()=>{clearTimeout(T)}},"c"),c=[t,o],e[0]=o,e[1]=t,e[2]=u,e[3]=c):(u=e[2],c=e[3]),(0,r.useEffect)(u,c),d},"T");export{x as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-BG2CJOVS.js";import{a as c}from"./chunk-GWNGVKLG.js";import{b as p}from"./chunk-6G3E4PJ2.js";import{a,d as r}from"./chunk-5PEAXTYQ.js";var i=r(c(),1);var m=r(p(),1);var u={bounce:.1,duration:.45,type:"spring"},d=a(n=>{let t=(0,i.c)(2),{className:s}=n,o;return t[0]!==s?(o=(0,m.jsx)(e.span,{className:s,layoutId:"studio-theme-active",transition:u}),t[0]=s,t[1]=o):o=t[1],o},"u");export{d as default};