@lunora/studio 1.0.0-alpha.376 → 1.0.0-alpha.378

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 (222) hide show
  1. package/dist/index.d.mts +16 -5
  2. package/dist/index.d.ts +16 -5
  3. package/dist/index.mjs +1 -1
  4. package/dist/mount.d.mts +1 -1
  5. package/dist/mount.d.ts +1 -1
  6. package/dist/mount.mjs +1 -1
  7. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
  8. package/dist/packem_chunks/ApiTab.mjs +1 -1
  9. package/dist/packem_chunks/AuditPanel.mjs +1 -1
  10. package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
  11. package/dist/packem_chunks/FileBrowser.mjs +1 -1
  12. package/dist/packem_chunks/FunctionRunner.mjs +1 -1
  13. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
  14. package/dist/packem_chunks/HealthPanel.mjs +1 -1
  15. package/dist/packem_chunks/InsightsPanel.mjs +1 -1
  16. package/dist/packem_chunks/LogsPanel.mjs +1 -1
  17. package/dist/packem_chunks/MailPanel.mjs +1 -1
  18. package/dist/packem_chunks/MetricsPanel.mjs +1 -1
  19. package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
  20. package/dist/packem_chunks/PitrPanel.mjs +1 -1
  21. package/dist/packem_chunks/SchemaViewer.mjs +1 -1
  22. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
  23. package/dist/packem_chunks/SettingsPanel.mjs +1 -1
  24. package/dist/packem_chunks/SqlEditorPanel.mjs +1 -1
  25. package/dist/packem_chunks/TableEditor.mjs +1 -1
  26. package/dist/packem_chunks/agents-panel.mjs +1 -1
  27. package/dist/packem_chunks/ai-knowledge.mjs +1 -1
  28. package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
  29. package/dist/packem_chunks/assistant-panel.mjs +1 -1
  30. package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
  31. package/dist/packem_chunks/containers-panel.mjs +1 -1
  32. package/dist/packem_chunks/dashboards-panel.mjs +1 -1
  33. package/dist/packem_chunks/evals-panel.mjs +1 -1
  34. package/dist/packem_chunks/fanout-panel.mjs +1 -1
  35. package/dist/packem_chunks/flags-panel.mjs +1 -1
  36. package/dist/packem_chunks/issues-panel.mjs +1 -1
  37. package/dist/packem_chunks/kv-browser.mjs +1 -1
  38. package/dist/packem_chunks/migrations-route.mjs +1 -1
  39. package/dist/packem_chunks/payments-panel.mjs +1 -1
  40. package/dist/packem_chunks/permissions-panel.mjs +1 -1
  41. package/dist/packem_chunks/privacy-requests-panel.mjs +1 -1
  42. package/dist/packem_chunks/queues-panel.mjs +1 -1
  43. package/dist/packem_chunks/reactors-panel.mjs +1 -1
  44. package/dist/packem_chunks/rls-panel.mjs +1 -1
  45. package/dist/packem_chunks/schedule-panel.mjs +1 -1
  46. package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
  47. package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
  48. package/dist/packem_chunks/traces-panel.mjs +1 -1
  49. package/dist/packem_chunks/workflows-panel.mjs +1 -1
  50. package/dist/packem_shared/ADMIN_FUNCTIONS-DAHZ35kM.mjs +1 -0
  51. package/dist/packem_shared/{ApiDocsPanel-xqgxgYCy.mjs → ApiDocsPanel-sEDqUNQq.mjs} +1 -1
  52. package/dist/packem_shared/{DataBrowser-BR2nrvMW.mjs → DataBrowser-CkVOu6py.mjs} +1 -1
  53. package/dist/packem_shared/{GlobalDataBrowser-Df5S1NxG.mjs → GlobalDataBrowser-l2ECwXCm.mjs} +1 -1
  54. package/dist/packem_shared/{HomePanel-CHq9VBrh.mjs → HomePanel-c7as4tvl.mjs} +1 -1
  55. package/dist/packem_shared/{MigrationsPanel-BWGgOwmX.mjs → MigrationsPanel-BQol4Un1.mjs} +1 -1
  56. package/dist/packem_shared/{Studio-JuMI1hpi.mjs → Studio-BmbkaUrx.mjs} +1 -1
  57. package/dist/packem_shared/{StudioApp-02dw_keu.mjs → StudioApp-CsyDnrg2.mjs} +1 -1
  58. package/dist/packem_shared/{advisor-view-Dj-mZPAq.mjs → advisor-view-gtf_DhUU.mjs} +1 -1
  59. package/dist/packem_shared/{app.d-BXrVLb99.d.mts → app.d-DpxFQ0qO.d.mts} +14 -0
  60. package/dist/packem_shared/{app.d-BXrVLb99.d.ts → app.d-DpxFQ0qO.d.ts} +14 -0
  61. package/dist/packem_shared/{assistant-provider-BQG7QZAu.mjs → assistant-provider-Dw0roZh3.mjs} +1 -1
  62. package/dist/packem_shared/{error-alert-BzZfqmf4.mjs → error-alert-3AR_-s_s.mjs} +1 -1
  63. package/dist/packem_shared/{home-panel-DTWHlX5S.mjs → home-panel-TpxiaHgB.mjs} +1 -1
  64. package/dist/packem_shared/log-fields-PjFFEqv0.mjs +8 -0
  65. package/dist/packem_shared/log-line-DnvvQnY5.mjs +1 -0
  66. package/dist/packem_shared/{studio-DtxNxSjs.mjs → studio-DZlpp4Vx.mjs} +1 -1
  67. package/dist/packem_shared/{table-list-sidebar-C8qPvzGk.mjs → table-list-sidebar-Bfmg04MD.mjs} +1 -1
  68. package/dist/packem_shared/{use-assistant-rpc-DCC6ph2u.mjs → use-assistant-rpc-AKu8hvPm.mjs} +1 -1
  69. package/dist/standalone/{chunk-SW52HGM4.js → chunk-27YLJQRE.js} +1 -1
  70. package/dist/standalone/{chunk-J45HAKBU.js → chunk-2KTN53PK.js} +1 -1
  71. package/dist/standalone/chunk-2NUCBQFU.js +1 -0
  72. package/dist/standalone/{chunk-CCETXQNF.js → chunk-2Q66YTBU.js} +1 -1
  73. package/dist/standalone/{chunk-WSG35SRF.js → chunk-2RL5YVB7.js} +1 -1
  74. package/dist/standalone/chunk-2SWWUGUK.js +1 -0
  75. package/dist/standalone/{chunk-VXZAS5VS.js → chunk-3OVNOP65.js} +1 -1
  76. package/dist/standalone/{chunk-AFVVESAA.js → chunk-3PRGO2WY.js} +1 -1
  77. package/dist/standalone/{chunk-N3FNOCHB.js → chunk-3RZB5QXH.js} +1 -1
  78. package/dist/standalone/{chunk-4EPW63HS.js → chunk-4AG356VE.js} +1 -1
  79. package/dist/standalone/{chunk-IJNP6YSD.js → chunk-4I23RURI.js} +1 -1
  80. package/dist/standalone/{chunk-ZSWW2UGP.js → chunk-4KPATTV6.js} +1 -1
  81. package/dist/standalone/chunk-4S7ZIMWI.js +33 -0
  82. package/dist/standalone/{chunk-HFBSWKJS.js → chunk-4SY2N2RS.js} +1 -1
  83. package/dist/standalone/{chunk-25WEL5RI.js → chunk-4XNMLHOA.js} +1 -1
  84. package/dist/standalone/{chunk-4NKJV7YX.js → chunk-4YENBZSS.js} +1 -1
  85. package/dist/standalone/{chunk-645S7KRU.js → chunk-5G2OOLMF.js} +1 -1
  86. package/dist/standalone/{chunk-B76HLC52.js → chunk-66PQJM66.js} +1 -1
  87. package/dist/standalone/{chunk-K3MVWN6E.js → chunk-6DKBHMBL.js} +1 -1
  88. package/dist/standalone/{chunk-YTPE33AO.js → chunk-6EPIINAW.js} +1 -1
  89. package/dist/standalone/{chunk-QURCU2N2.js → chunk-6IECLZ2U.js} +1 -1
  90. package/dist/standalone/{chunk-SUUBCPUD.js → chunk-77PKR3WU.js} +1 -1
  91. package/dist/standalone/{chunk-6BH5TIGF.js → chunk-7MQI2RNF.js} +1 -1
  92. package/dist/standalone/chunk-7WGZSDRS.js +2 -0
  93. package/dist/standalone/{chunk-64LU3VU6.js → chunk-A5HJXHD2.js} +1 -1
  94. package/dist/standalone/{chunk-MWYGLPDV.js → chunk-A5INOAIL.js} +1 -1
  95. package/dist/standalone/{chunk-FEHRNTIU.js → chunk-A6E46F3B.js} +1 -1
  96. package/dist/standalone/{chunk-GWNGVKLG.js → chunk-A6TVTNKO.js} +1 -1
  97. package/dist/standalone/{chunk-6G3E4PJ2.js → chunk-ADABTCDI.js} +1 -1
  98. package/dist/standalone/{chunk-GXTSE66Z.js → chunk-AFLNQEZ5.js} +1 -1
  99. package/dist/standalone/{chunk-CLQKKJHL.js → chunk-AKC4XWCD.js} +1 -1
  100. package/dist/standalone/{chunk-BE3FD3E6.js → chunk-APTQ5BDE.js} +1 -1
  101. package/dist/standalone/{chunk-B4PRNI7H.js → chunk-ASSIQ4W7.js} +1 -1
  102. package/dist/standalone/{chunk-PEVNCIZQ.js → chunk-BEC2C3JD.js} +1 -1
  103. package/dist/standalone/{chunk-HSI24FPH.js → chunk-BMGCCYQL.js} +1 -1
  104. package/dist/standalone/{chunk-F4S2YEYW.js → chunk-BMS6CAKT.js} +1 -1
  105. package/dist/standalone/{chunk-D3DZZHZA.js → chunk-BOYBN3TE.js} +1 -1
  106. package/dist/standalone/{chunk-BQS3C5V3.js → chunk-BR2A4DYH.js} +1 -1
  107. package/dist/standalone/{chunk-OSHODLMU.js → chunk-CB22PV3X.js} +1 -1
  108. package/dist/standalone/chunk-CX2T7TTB.js +5 -0
  109. package/dist/standalone/{chunk-WB6VGH7X.js → chunk-CXAPSZF2.js} +1 -1
  110. package/dist/standalone/{chunk-CAEJQOMU.js → chunk-D5VO54BI.js} +1 -1
  111. package/dist/standalone/chunk-DKEK4ZO6.js +8 -0
  112. package/dist/standalone/{chunk-G6VBT4AU.js → chunk-DQWEVUGA.js} +1 -1
  113. package/dist/standalone/{chunk-2DT3QG6Q.js → chunk-DRHZZ7IN.js} +1 -1
  114. package/dist/standalone/{chunk-GMT66LBU.js → chunk-EA3RERQQ.js} +1 -1
  115. package/dist/standalone/{chunk-3D67ZJRW.js → chunk-EDL46BPM.js} +1 -1
  116. package/dist/standalone/{chunk-EYJX6GXU.js → chunk-ELXPUNSN.js} +1 -1
  117. package/dist/standalone/{chunk-4PI2OSSP.js → chunk-EOFWXI3T.js} +1 -1
  118. package/dist/standalone/{chunk-UBTKEHX6.js → chunk-F2EGC6HE.js} +1 -1
  119. package/dist/standalone/{chunk-HPD2PZP2.js → chunk-F32O6VAS.js} +1 -1
  120. package/dist/standalone/{chunk-X72A525Z.js → chunk-F5DCBRCJ.js} +1 -1
  121. package/dist/standalone/{chunk-OT2YNQPU.js → chunk-FBG5SSXS.js} +1 -1
  122. package/dist/standalone/chunk-FFQISGOB.js +1 -0
  123. package/dist/standalone/{chunk-QAQ3KMY6.js → chunk-FGEN2V4E.js} +1 -1
  124. package/dist/standalone/{chunk-7LCGAQWG.js → chunk-FNE6FFFN.js} +1 -1
  125. package/dist/standalone/{chunk-RDS46R5R.js → chunk-FOURRGSO.js} +1 -1
  126. package/dist/standalone/chunk-FPRVR763.js +8 -0
  127. package/dist/standalone/{chunk-PUU56AIE.js → chunk-FXSY2FCG.js} +1 -1
  128. package/dist/standalone/{chunk-C4BS3LHQ.js → chunk-FXZ6GEUP.js} +1 -1
  129. package/dist/standalone/{chunk-HAK2T6YN.js → chunk-H5AOMWTU.js} +1 -1
  130. package/dist/standalone/{chunk-2EB7FN5S.js → chunk-H6VTIXVB.js} +1 -1
  131. package/dist/standalone/{chunk-LQCF6SZW.js → chunk-HNNAMZHQ.js} +1 -1
  132. package/dist/standalone/{chunk-2BQNNRAP.js → chunk-IIIAOQ22.js} +1 -1
  133. package/dist/standalone/{chunk-LKML3CX4.js → chunk-IO3TEFOW.js} +1 -1
  134. package/dist/standalone/{chunk-KTK4NDWQ.js → chunk-IQ5CIBXJ.js} +1 -1
  135. package/dist/standalone/{chunk-QGAWQTUE.js → chunk-J76P372V.js} +1 -1
  136. package/dist/standalone/{chunk-7SNL633X.js → chunk-J7M7G2BA.js} +1 -1
  137. package/dist/standalone/{chunk-2MZLFQR5.js → chunk-JAY3ZKY6.js} +1 -1
  138. package/dist/standalone/{chunk-ELUYMLPL.js → chunk-JLPBW5EC.js} +1 -1
  139. package/dist/standalone/{chunk-HCOF7HOM.js → chunk-JNWK5MJC.js} +1 -1
  140. package/dist/standalone/{chunk-4DIRNQHR.js → chunk-KEICHBPK.js} +1 -1
  141. package/dist/standalone/{chunk-F5WJCL3F.js → chunk-KFDOGDD2.js} +1 -1
  142. package/dist/standalone/{chunk-MGFELY5Q.js → chunk-KMEDIMYZ.js} +1 -1
  143. package/dist/standalone/{chunk-YUVGMKHG.js → chunk-L27FKJTG.js} +1 -1
  144. package/dist/standalone/chunk-LDWYV63L.js +1 -0
  145. package/dist/standalone/{chunk-UBX5ZPLV.js → chunk-LMCBMC2V.js} +1 -1
  146. package/dist/standalone/chunk-LYVYUTQY.js +1 -0
  147. package/dist/standalone/{chunk-JIBRGVA7.js → chunk-MFVL3BKJ.js} +1 -1
  148. package/dist/standalone/chunk-MHZNDDGI.js +1 -0
  149. package/dist/standalone/{chunk-FERYOTLW.js → chunk-MSZMSG3J.js} +1 -1
  150. package/dist/standalone/{chunk-X45MVUVK.js → chunk-N5A7KU32.js} +1 -1
  151. package/dist/standalone/{chunk-QRA7AKYO.js → chunk-N7FOBAV3.js} +1 -1
  152. package/dist/standalone/{chunk-ZFEDRJ7R.js → chunk-NIGA74BG.js} +1 -1
  153. package/dist/standalone/{chunk-RTE7SDRS.js → chunk-NOJMUWHR.js} +1 -1
  154. package/dist/standalone/{chunk-QXNMGPXW.js → chunk-NSPPZR3Q.js} +1 -1
  155. package/dist/standalone/{chunk-CURIWKKC.js → chunk-O5NP5MVG.js} +1 -1
  156. package/dist/standalone/{chunk-TW4O2BA5.js → chunk-O5QATFN3.js} +3 -3
  157. package/dist/standalone/{chunk-PYQUCCUO.js → chunk-O65MHZCA.js} +1 -1
  158. package/dist/standalone/{chunk-6FPV3EK2.js → chunk-ODEIAS3V.js} +1 -1
  159. package/dist/standalone/{chunk-D65UVZIA.js → chunk-OWRWDDJT.js} +1 -1
  160. package/dist/standalone/{chunk-VUOEJJUH.js → chunk-OZID3UYF.js} +1 -1
  161. package/dist/standalone/{chunk-K46QTJR6.js → chunk-PKOFJJA2.js} +1 -1
  162. package/dist/standalone/{chunk-UVNJG3UL.js → chunk-PLONGJJL.js} +1 -1
  163. package/dist/standalone/{chunk-W2FHSEQW.js → chunk-QEQGGAZQ.js} +1 -1
  164. package/dist/standalone/{chunk-VNH4OBJS.js → chunk-QF743FSL.js} +1 -1
  165. package/dist/standalone/{chunk-ONTGYVAN.js → chunk-QLZGKBOW.js} +1 -1
  166. package/dist/standalone/chunk-R3RIZDUS.js +1 -0
  167. package/dist/standalone/{chunk-4RGKUS3H.js → chunk-R55GP52Y.js} +1 -1
  168. package/dist/standalone/{chunk-WAIESA3E.js → chunk-R6B5XFEW.js} +1 -1
  169. package/dist/standalone/chunk-SAV5V3DG.js +7 -0
  170. package/dist/standalone/{chunk-JYCGHNPF.js → chunk-SBY32RYL.js} +1 -1
  171. package/dist/standalone/{chunk-JMZT3CEW.js → chunk-SCTYLLJT.js} +1 -1
  172. package/dist/standalone/{chunk-BYUXIOPZ.js → chunk-SHTZR3TU.js} +1 -1
  173. package/dist/standalone/{chunk-KBYFBEG2.js → chunk-SZCXVIVT.js} +1 -1
  174. package/dist/standalone/{chunk-O3AZ7JKE.js → chunk-T7UKRA6J.js} +1 -1
  175. package/dist/standalone/{chunk-EX2DUBRT.js → chunk-TOBQK3ZF.js} +1 -1
  176. package/dist/standalone/{chunk-M4TCBPSY.js → chunk-TRJMN2YI.js} +1 -1
  177. package/dist/standalone/{chunk-ZCXG3567.js → chunk-TU2IB3GT.js} +1 -1
  178. package/dist/standalone/{chunk-EVJSGZXV.js → chunk-UA7DC3LX.js} +1 -1
  179. package/dist/standalone/{chunk-ALNEZ5D2.js → chunk-UCOKDCSX.js} +1 -1
  180. package/dist/standalone/{chunk-SWFSB4QT.js → chunk-UEM26EYR.js} +1 -1
  181. package/dist/standalone/{chunk-SZBLYYV6.js → chunk-UL5GMSAW.js} +1 -1
  182. package/dist/standalone/{chunk-EYMLYHWK.js → chunk-UVMD7C4J.js} +1 -1
  183. package/dist/standalone/{chunk-6YBEKVUG.js → chunk-V4D77Q45.js} +1 -1
  184. package/dist/standalone/{chunk-D6CDIHHL.js → chunk-VONBNFUJ.js} +1 -1
  185. package/dist/standalone/{chunk-3D2E7WXH.js → chunk-VY5KDMVO.js} +1 -1
  186. package/dist/standalone/{chunk-CHIQ3CJZ.js → chunk-W46UJQN7.js} +1 -1
  187. package/dist/standalone/{chunk-AQ62YJJ5.js → chunk-W5LH6U6X.js} +1 -1
  188. package/dist/standalone/{chunk-S36FVTKK.js → chunk-W7CLOQOU.js} +1 -1
  189. package/dist/standalone/{chunk-FWOOA2ZR.js → chunk-X26D3KTK.js} +1 -1
  190. package/dist/standalone/chunk-X2KZTOZR.js +1 -0
  191. package/dist/standalone/chunk-Y6OVSHPH.js +1 -0
  192. package/dist/standalone/{chunk-B3TXCZUI.js → chunk-YIOJWQ3G.js} +1 -1
  193. package/dist/standalone/{chunk-XLYFGUEF.js → chunk-YNCZVYCO.js} +1 -1
  194. package/dist/standalone/{chunk-OVEOTKK5.js → chunk-YU67D2FL.js} +1 -1
  195. package/dist/standalone/{chunk-AERXMIND.js → chunk-YV6YBDCS.js} +1 -1
  196. package/dist/standalone/{chunk-A2Q3TGIQ.js → chunk-YYJGL32M.js} +1 -1
  197. package/dist/standalone/{chunk-R3P6KKUH.js → chunk-YZUJTBSJ.js} +1 -1
  198. package/dist/standalone/{chunk-42RZZFLX.js → chunk-ZBP4ZBS6.js} +1 -1
  199. package/dist/standalone/{chunk-QHKR5JW4.js → chunk-ZF4WXT7S.js} +1 -1
  200. package/dist/standalone/{chunk-JAAXDIR5.js → chunk-ZK2HQFGQ.js} +1 -1
  201. package/dist/standalone/studio.js +3 -3
  202. package/dist/styles.css +1 -1
  203. package/package.json +10 -10
  204. package/dist/packem_shared/ADMIN_FUNCTIONS-C6U-ugro.mjs +0 -1
  205. package/dist/packem_shared/log-fields-BolUoZ9g.mjs +0 -1
  206. package/dist/packem_shared/log-line-BH0iWiBv.mjs +0 -1
  207. package/dist/standalone/chunk-3BQ6FMEA.js +0 -5
  208. package/dist/standalone/chunk-6A6AELDJ.js +0 -1
  209. package/dist/standalone/chunk-ASD6UAND.js +0 -1
  210. package/dist/standalone/chunk-BG2CJOVS.js +0 -1
  211. package/dist/standalone/chunk-BKI3JMXQ.js +0 -1
  212. package/dist/standalone/chunk-CZA2P2TU.js +0 -1
  213. package/dist/standalone/chunk-KGLIQIZU.js +0 -1
  214. package/dist/standalone/chunk-PFPJA2HR.js +0 -7
  215. package/dist/standalone/chunk-PUK3H4RN.js +0 -33
  216. package/dist/standalone/chunk-QAOZXPLU.js +0 -1
  217. package/dist/standalone/chunk-RTS5G3ET.js +0 -2
  218. package/dist/standalone/chunk-RWMOWRJX.js +0 -1
  219. package/dist/standalone/chunk-U4X2I55T.js +0 -1
  220. package/dist/standalone/chunk-YORPLSI5.js +0 -1
  221. package/dist/standalone/chunk-Z7ZGAQ5J.js +0 -8
  222. /package/dist/standalone/{chunk-NGVP66OH.js → chunk-QHVUXMRV.js} +0 -0
@@ -1 +1 @@
1
- import{b as be}from"./chunk-RIAOZECW.js";import{a as le}from"./chunk-ELUYMLPL.js";import"./chunk-BQS3C5V3.js";import{a as ve}from"./chunk-7SNL633X.js";import"./chunk-Y2YLTUMD.js";import"./chunk-BG2CJOVS.js";import{a as xe}from"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-QRA7AKYO.js";import"./chunk-4EPW63HS.js";import{b as ee}from"./chunk-M4TCBPSY.js";import"./chunk-YUVGMKHG.js";import"./chunk-4PI2OSSP.js";import{a as B}from"./chunk-6A6AELDJ.js";import{c as ge}from"./chunk-CLQKKJHL.js";import{a as X}from"./chunk-OSHODLMU.js";import{m as he,n as fe}from"./chunk-PFPJA2HR.js";import"./chunk-ZPQBVYNN.js";import{B as U,h as W,i as ie,j as ce,s as se,w as pe,x as $}from"./chunk-PUK3H4RN.js";import"./chunk-PDBW6GTJ.js";import{a as ue}from"./chunk-GWNGVKLG.js";import{a as Ae,b as me}from"./chunk-6G3E4PJ2.js";import{a as h,d as Z}from"./chunk-5PEAXTYQ.js";var te=Z(ue(),1),x=Z(Ae(),1);var Ne=Z(ue(),1);var ae=Z(me(),1);var je={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive",polling:"bg-warning"},ye=h(()=>{let t=(0,Ne.c)(18),e=U(),n=he(),r;e:switch(n){case"connected":{let l;t[0]!==e?(l=e("Connected"),t[0]=e,t[1]=l):l=t[1],r=l;break e}case"connecting":{let l;t[2]!==e?(l=e("Connecting\u2026"),t[2]=e,t[3]=l):l=t[3],r=l;break e}case"idle":{let l;t[4]!==e?(l=e("Idle"),t[4]=e,t[5]=l):l=t[5],r=l;break e}case"offline":{let l;t[6]!==e?(l=e("Offline"),t[6]=e,t[7]=l):l=t[7],r=l;break e}case"polling":{let l;t[8]!==e?(l=e("Polling"),t[8]=e,t[9]=l):l=t[9],r=l;break e}default:r=n}let a=je[n],c;t[10]!==a?(c=$("size-2 rounded-full",a),t[10]=a,t[11]=c):c=t[11];let i;t[12]!==c?(i=(0,ae.jsx)("span",{"aria-hidden":"true",className:c}),t[12]=c,t[13]=i):i=t[13];let o;return t[14]!==n||t[15]!==i||t[16]!==r?(o=(0,ae.jsxs)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":n,"data-testid":"dash-connection",role:"status",children:[i,r]}),t[14]=n,t[15]=i,t[16]=r,t[17]=o):o=t[17],o},"T");var s=Z(me(),1);var Te={crit:"destructive",ok:"secondary",warn:"default"},oe=h((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"re"),de=h((t,e,n)=>Number.isNaN(t)?"ok":t>=n?"crit":t>=e?"warn":"ok","oe"),Se=.01,Ee=.05,Ce=h(t=>{let e=(0,te.c)(36),{errorCount:n,logsError:r,topErrors:a,worstFunctions:c}=t,i=U(),o;e[0]!==i?(o=i("Functions by error rate"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==o?(l=(0,s.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,s.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o})}),e[2]=o,e[3]=l):l=e[3];let u;e[4]!==i||e[5]!==c?(u=c.length===0?(0,s.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:i("No function activity yet.")}):(0,s.jsx)("ul",{className:"divide-y divide-border",children:c.map(y=>(0,s.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,s.jsx)("span",{className:"truncate font-mono text-foreground",children:y.path}),(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,s.jsx)("span",{className:"tabular-nums text-muted-foreground",children:i("{count} calls",{count:y.calls.toString()})}),(0,s.jsx)(ee,{variant:Te[de(y.errors/y.calls,Se,Ee)],children:oe(y.errors,y.calls)})]})]},y.path))}),e[4]=i,e[5]=c,e[6]=u):u=e[6];let f;e[7]!==l||e[8]!==u?(f=(0,s.jsxs)(X,{className:"gap-0 py-0","data-testid":"hl-functions",children:[l,u]}),e[7]=l,e[8]=u,e[9]=f):f=e[9];let v;e[10]!==i?(v=i("Recent errors"),e[10]=i,e[11]=v):v=e[11];let m;e[12]!==v?(m=(0,s.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:v}),e[12]=v,e[13]=m):m=e[13];let d=n>0?"destructive":"outline",g;e[14]!==n||e[15]!==d?(g=(0,s.jsx)(ee,{"data-testid":"hl-error-count",variant:d,children:n}),e[14]=n,e[15]=d,e[16]=g):g=e[16];let p;e[17]!==m||e[18]!==g?(p=(0,s.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[m,g]}),e[17]=m,e[18]=g,e[19]=p):p=e[19];let S;e[20]!==r?(S=r!==null&&(0,s.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:r}),e[20]=r,e[21]=S):S=e[21];let E;e[22]!==r||e[23]!==i||e[24]!==a.length?(E=r===null&&a.length===0&&(0,s.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:i("No recent errors.")}),e[22]=r,e[23]=i,e[24]=a.length,e[25]=E):E=e[25];let q;e[26]!==a?(q=a.length>0&&(0,s.jsx)("ul",{className:"divide-y divide-border",children:a.map(Ie)}),e[26]=a,e[27]=q):q=e[27];let w;e[28]!==S||e[29]!==E||e[30]!==q||e[31]!==p?(w=(0,s.jsxs)(X,{className:"gap-0 py-0",children:[p,S,E,q]}),e[28]=S,e[29]=E,e[30]=q,e[31]=p,e[32]=w):w=e[32];let k;return e[33]!==w||e[34]!==f?(k=(0,s.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[f,w]}),e[33]=w,e[34]=f,e[35]=k):k=e[35],k},"_e");function Ie(t,e){return(0,s.jsxs)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("time",{className:"shrink-0 text-muted-foreground",children:pe(t.timestamp)}),t.functionPath!==void 0&&(0,s.jsx)("span",{className:"truncate font-mono text-foreground",children:t.functionPath})]}),(0,s.jsx)("span",{className:"text-destructive",children:t.message})]},`${t.timestamp.toString()}-${e.toString()}`)}h(Ie,"Ae");var we={completed:0,failed:2,in_progress:1},De=h(t=>{let e=0,n=0,r=0,a=0,c=!1,i=[];for(let{metrics:o}of t){if(o===null){a+=1;continue}r+=1,e+=o.requests,n+=o.errors,i.push(...o.history??[]),c||=o.historyTruncated===!0}return{errors:n,failed:a,history:i,historyTruncated:c,reachable:r,requests:e}},"ke"),_e=h(t=>{let e=new Map;for(let n of t)for(let r of n){let a=e.get(r.path);if(a===void 0){e.set(r.path,{...r});continue}a.calls+=r.calls,a.errors+=r.errors,a.totalDurationMs+=r.totalDurationMs,a.scans=(a.scans??0)+(r.scans??0),a.maxDurationMs=Math.max(a.maxDurationMs,r.maxDurationMs),a.lastCalledAt=Math.max(a.lastCalledAt,r.lastCalledAt),(r.lastErrorAt??0)>(a.lastErrorAt??0)&&(a.lastErrorAt=r.lastErrorAt,a.lastErrorMessage=r.lastErrorMessage)}return[...e.values()]},"Re"),Pe=h(t=>{let e=new Map;for(let n of t)for(let r of n){let a=e.get(r.id);if(a===void 0){e.set(r.id,r);continue}let c=we[r.status]-we[a.status];(c>0||c===0&&(r.updatedAt??0)>(a.updatedAt??0))&&e.set(r.id,r)}return[...e.values()]},"Me"),Le=W(B.getAuthMetrics),Fe=W(B.getFunctionStats),Re=W(B.getLogs),Oe=W(B.getMetrics),ze=W(B.migrationStatus),$e=5,ke=2e3,Ke=5,Be=.1,Ue=.3,Ge=1,He=50,Qe=h((t,e,n)=>t>=n?"crit":t>=e?"warn":"ok","$e"),Je=h(t=>{let e=new Map;for(let r of t??[]){let a=e.get(r.bucketMs)??{calls:0,errors:0};a.calls+=r.calls,a.errors+=r.errors,e.set(r.bucketMs,a)}let n=[...e.entries()].toSorted((r,a)=>r[0]-a[0]);return{errors:n.map(([,r])=>r.errors),requests:n.map(([,r])=>r.calls)}},"Be"),Ve=h(t=>{let e=0,n=0;for(let a of t)a.status==="failed"?e+=1:a.status==="in_progress"&&(n+=1);let r="ok";return e>0?r="crit":n>0&&(r="warn"),{failed:e,level:r,running:n}},"Ve"),We=h((t,e)=>t.failed>0?e("{count} failed",{count:t.failed.toString()}):t.running>0?e("{count} running",{count:t.running.toString()}):e("OK"),"He"),qe={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},Me={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},Xe={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Ye=h(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","ze"),ne=h(t=>{let e=(0,te.c)(19),{chart:n,label:r,level:a,testId:c,value:i}=t,o=qe[a],l;e[0]!==o?(l=$("size-1.5 shrink-0 rounded-full",o),e[0]=o,e[1]=l):l=e[1];let u;e[2]!==l?(u=(0,s.jsx)("span",{"aria-hidden":"true",className:l}),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==u?(f=(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[u,r]}),e[4]=r,e[5]=u,e[6]=f):f=e[6];let v=Me[a],m;e[7]!==v?(m=$("truncate text-2xl font-semibold tabular-nums",v),e[7]=v,e[8]=m):m=e[8];let d;e[9]!==m||e[10]!==c||e[11]!==i?(d=(0,s.jsx)("span",{className:m,"data-testid":c,children:i}),e[9]=m,e[10]=c,e[11]=i,e[12]=d):d=e[12];let g;e[13]!==n||e[14]!==d?(g=(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[d,n]}),e[13]=n,e[14]=d,e[15]=g):g=e[15];let p;return e[16]!==f||e[17]!==g?(p=(0,s.jsx)(X,{className:"gap-0 py-0",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[f,g]})}),e[16]=f,e[17]=g,e[18]=p):p=e[18],p},"ee"),Ze=h(async(t,e,n)=>{let r=await Promise.all(n.map(m=>{let d=ie(m);return Promise.allSettled([t.query(Oe,{},d),t.query(Fe,{},d),t.query(ze,{},d)])})),a=ie(e),c=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[i,o,l]=await Promise.allSettled([t.query(Re,{},a),t.query(Le,{},a),c]),u=r.map(([m,d,g])=>({functions:d.status==="fulfilled"?d.value.functions:[],metrics:m.status==="fulfilled"?m.value:null,migrations:g.status==="fulfilled"?g.value.migrations:[]})),f=De(u),v=r[0]?.[0];return{auth:o.status==="fulfilled"?o.value:null,entries:i.status==="fulfilled"?i.value.entries:[],functions:_e(u.map(m=>m.functions)),logsError:i.status==="rejected"?ce(i.reason):null,metricsError:f.reachable===0&&v?.status==="rejected"?ce(v.reason):null,migrations:Pe(u.map(m=>m.migrations)),scheduler:l.status==="fulfilled"?l.value:null,totals:f}},"Qe"),et=h(t=>{let e=t?.history??[];return{attempts:e.map(n=>n.attempts),failures:e.map(n=>n.failures)}},"We"),tt=h((t,e)=>t==="crit"?{description:e("One or more service levels are breached."),label:e("Critical")}:t==="warn"?{description:e("Some service levels need attention."),label:e("Degraded")}:{description:e("All service levels are within target."),label:e("All systems healthy")},"Xe"),rt=h(t=>{let e=(0,te.c)(75),{errorLevel:n,liveError:r,metricsError:a,overall:c,requestSeries:i,totals:o}=t,l=U(),u;e[0]!==c||e[1]!==l?(u=tt(c,l),e[0]=c,e[1]=l,e[2]=u):u=e[2];let{description:f,label:v}=u,m=Xe[c],d;e[3]!==m?(d=$("flex size-10 shrink-0 items-center justify-center rounded-full",m),e[3]=m,e[4]=d):d=e[4];let g=qe[c],p;e[5]!==g?(p=$("size-3 rounded-full",g),e[5]=g,e[6]=p):p=e[6];let S;e[7]!==p?(S=(0,s.jsx)("span",{className:p}),e[7]=p,e[8]=S):S=e[8];let E;e[9]!==d||e[10]!==S?(E=(0,s.jsx)("span",{"aria-hidden":"true",className:d,children:S}),e[9]=d,e[10]=S,e[11]=E):E=e[11];let q;e[12]!==v?(q=(0,s.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:v}),e[12]=v,e[13]=q):q=e[13];let w;e[14]!==f?(w=(0,s.jsx)("span",{className:"text-[13px] text-muted-foreground",children:f}),e[14]=f,e[15]=w):w=e[15];let k;e[16]!==q||e[17]!==w?(k=(0,s.jsxs)("div",{className:"grid leading-tight",children:[q,w]}),e[16]=q,e[17]=w,e[18]=k):k=e[18];let y;e[19]!==k||e[20]!==E?(y=(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[E,k]}),e[19]=k,e[20]=E,e[21]=y):y=e[21];let j;e[22]!==l?(j=l("Requests"),e[22]=l,e[23]=j):j=e[23];let M;e[24]!==j?(M=(0,s.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:j}),e[24]=j,e[25]=M):M=e[25];let A;e[26]!==i||e[27]!==l?(A=i.length>=2&&(0,s.jsx)(le,{ariaLabel:l("Requests over time"),className:"h-6 w-20 text-foreground",series:i,testId:"hl-spark-requests"}),e[26]=i,e[27]=l,e[28]=A):A=e[28];let F=o?.requests??0,R;e[29]!==F?(R=F.toString(),e[29]=F,e[30]=R):R=e[30];let D;e[31]!==R?(D=(0,s.jsx)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:R}),e[31]=R,e[32]=D):D=e[32];let O;e[33]!==A||e[34]!==D?(O=(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[A,D]}),e[33]=A,e[34]=D,e[35]=O):O=e[35];let _;e[36]!==M||e[37]!==O?(_=(0,s.jsxs)("div",{className:"text-end",children:[M,O]}),e[36]=M,e[37]=O,e[38]=_):_=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=(0,s.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),e[39]=G):G=e[39];let T;e[40]!==l?(T=l("Error rate"),e[40]=l,e[41]=T):T=e[41];let P;e[42]!==T?(P=(0,s.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:T}),e[42]=T,e[43]=P):P=e[43];let Y=Me[n],C;e[44]!==Y?(C=$("text-lg font-semibold tabular-nums",Y),e[44]=Y,e[45]=C):C=e[45];let z;e[46]!==o?(z=o===null?"\u2014":oe(o.errors,o.requests),e[46]=o,e[47]=z):z=e[47];let I;e[48]!==C||e[49]!==z?(I=(0,s.jsx)("div",{className:C,"data-testid":"hl-error-rate",children:z}),e[48]=C,e[49]=z,e[50]=I):I=e[50];let L;e[51]!==P||e[52]!==I?(L=(0,s.jsxs)("div",{className:"text-end",children:[P,I]}),e[51]=P,e[52]=I,e[53]=L):L=e[53];let K;e[54]===Symbol.for("react.memo_cache_sentinel")?(K=(0,s.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),e[54]=K):K=e[54];let H;e[55]===Symbol.for("react.memo_cache_sentinel")?(H=(0,s.jsx)(ye,{}),e[55]=H):H=e[55];let b;e[56]!==r?(b=(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[H,(0,s.jsx)(ve,{message:r,prefix:"hl"})]}),e[56]=r,e[57]=b):b=e[57];let N;e[58]!==_||e[59]!==L||e[60]!==b?(N=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[_,G,L,K,b]}),e[58]=_,e[59]=L,e[60]=b,e[61]=N):N=e[61];let Q;e[62]!==y||e[63]!==N?(Q=(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[y,N]}),e[62]=y,e[63]=N,e[64]=Q):Q=e[64];let J;e[65]!==a?(J=a!==null&&(0,s.jsx)("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive","data-testid":"hl-metrics-error",role:"alert",children:a}),e[65]=a,e[66]=J):J=e[66];let V;e[67]!==a||e[68]!==l||e[69]!==o?.historyTruncated?(V=a===null&&o?.historyTruncated===!0&&(0,s.jsx)("div",{className:"border-t border-border bg-warning/5 px-4 py-2 text-sm text-muted-foreground","data-testid":"hl-history-truncated",children:l("Showing a partial request/error history \u2014 one or more shards have more data than the trend chart can display.")}),e[67]=a,e[68]=l,e[69]=o?.historyTruncated,e[70]=V):V=e[70];let re;return e[71]!==Q||e[72]!==J||e[73]!==V?(re=(0,s.jsxs)(X,{className:"gap-0 py-0",children:[Q,J,V]}),e[71]=Q,e[72]=J,e[73]=V,e[74]=re):re=e[74],re},"Je"),st=h(t=>{let e=(0,te.c)(14),{shards:n}=t,r=U(),a;e[0]!==r?(a=r("Shards seen"),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==a?(c=(0,s.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a}),e[2]=a,e[3]=c):c=e[3];let i;e[4]!==n.length?(i=(0,s.jsx)(ee,{"data-testid":"hl-shard-count",variant:"outline",children:n.length}),e[4]=n.length,e[5]=i):i=e[5];let o;e[6]!==c||e[7]!==i?(o=(0,s.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[c,i]}),e[6]=c,e[7]=i,e[8]=o):o=e[8];let l;e[9]!==n?(l=n.length>0&&(0,s.jsx)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:n.map(lt)}),e[9]=n,e[10]=l):l=e[10];let u;return e[11]!==o||e[12]!==l?(u=(0,s.jsxs)(X,{className:"gap-0 py-0",children:[o,l]}),e[11]=o,e[12]=l,e[13]=u):u=e[13],u},"Ye"),kt=h(({initialShardKey:t})=>{let e=fe(),n=U(),[r,a]=(0,x.useState)([]),[c,i]=(0,x.useState)(null),[o,l]=(0,x.useState)(null),[u,f]=(0,x.useState)(null),[v,m]=(0,x.useState)([]),[d,g]=(0,x.useState)(null),[p,S]=(0,x.useState)(null),[E,q]=(0,x.useState)([]),[w]=(0,x.useState)(xe),k=(0,x.useRef)(!1),y=(0,x.useRef)(0),j=(0,x.useRef)(0),M=(0,x.useRef)(null),A=t??"",F=(0,x.useCallback)(async()=>{if(k.current)return;k.current=!0;let b=y.current,N=await Ze(e,A,be(A,w));b===y.current&&(l(N.totals),f(N.metricsError),m(N.functions),q(N.migrations),a(N.entries),i(N.logsError),g(N.auth),S(N.scheduler),k.current=!1)},[e,w,A]);(0,x.useEffect)(()=>(se(F()),()=>{y.current+=1,k.current=!1,M.current!==null&&(clearTimeout(M.current),M.current=null)}),[F]);let R=h(()=>{let b=Date.now()-j.current;if(b>=ke){j.current=Date.now(),se(F());return}M.current===null&&(M.current=setTimeout(()=>{M.current=null,j.current=Date.now(),se(F())},ke-b))},"j"),{data:D,liveError:O}=ge(B.getMetrics,{},{live:!0,shardKey:A});(0,x.useEffect)(()=>{D!==void 0&&R()},[D]);let _=r.filter(b=>b.level==="error"),G=_.slice(0,$e),T=Je(o?.history),P=et(d),Y=v.filter(b=>b.calls>0).toSorted((b,N)=>N.errors/N.calls-b.errors/b.calls||N.calls-b.calls).slice(0,Ke),C=Ve(E),z=o===null||o.requests===0?0:o.errors/o.requests,I=de(z,Se,Ee),L=d===null?"ok":de(d.failureRate,Be,Ue),K=p===null?"ok":Qe(p.backlog,Ge,He),H=Ye([I,L,K,C.level]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,s.jsx)(rt,{errorLevel:I,liveError:O,metricsError:u,overall:H,requestSeries:T.requests,totals:o}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,s.jsx)(ne,{chart:T.errors.length>=2?(0,s.jsx)(le,{ariaLabel:n("Errors over time"),className:"h-7 w-20 text-destructive",series:T.errors,testId:"hl-spark-errors"}):void 0,label:n("Error rate"),level:I,testId:"hl-slo-errorrate",value:o===null?"\u2014":oe(o.errors,o.requests)}),(0,s.jsx)(ne,{chart:P.failures.length>=2?(0,s.jsx)(le,{ariaLabel:n("Auth failures over time"),className:"h-7 w-20 text-destructive",series:P.failures,testId:"hl-spark-auth"}):void 0,label:n("Auth failures"),level:L,testId:"hl-slo-auth",value:d===null?"\u2014":oe(d.failures,d.attempts)}),(0,s.jsx)(ne,{label:n("Scheduler backlog"),level:K,testId:"hl-slo-backlog",value:p===null?"\u2014":p.backlog.toString()}),(0,s.jsx)(ne,{label:n("Migrations"),level:C.level,testId:"hl-slo-migrations",value:We(C,n)})]}),(0,s.jsx)(Ce,{errorCount:_.length,logsError:c,topErrors:G,worstFunctions:Y}),(0,s.jsx)(st,{shards:w})]})},"gt");function lt(t){return(0,s.jsx)("li",{"data-testid":"hl-shard",children:(0,s.jsx)(ee,{variant:"secondary",children:t})},t)}h(lt,"Ze");export{kt as HealthPanel};
1
+ import{b as be}from"./chunk-RIAOZECW.js";import{a as le}from"./chunk-JLPBW5EC.js";import"./chunk-BR2A4DYH.js";import{a as ve}from"./chunk-J7M7G2BA.js";import"./chunk-Y2YLTUMD.js";import"./chunk-R3RIZDUS.js";import{a as xe}from"./chunk-EDL46BPM.js";import"./chunk-4KPATTV6.js";import"./chunk-N7FOBAV3.js";import"./chunk-4AG356VE.js";import{b as ee}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import"./chunk-EOFWXI3T.js";import{a as B}from"./chunk-LYVYUTQY.js";import{c as ge}from"./chunk-AKC4XWCD.js";import{a as X}from"./chunk-CB22PV3X.js";import{m as he,n as fe}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as U,h as W,i as ie,j as ce,s as se,w as pe,x as $}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as ue}from"./chunk-A6TVTNKO.js";import{a as Ae,b as me}from"./chunk-ADABTCDI.js";import{a as h,d as Z}from"./chunk-5PEAXTYQ.js";var te=Z(ue(),1),x=Z(Ae(),1);var Ne=Z(ue(),1);var ae=Z(me(),1);var je={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive",polling:"bg-warning"},ye=h(()=>{let t=(0,Ne.c)(18),e=U(),n=he(),r;e:switch(n){case"connected":{let l;t[0]!==e?(l=e("Connected"),t[0]=e,t[1]=l):l=t[1],r=l;break e}case"connecting":{let l;t[2]!==e?(l=e("Connecting\u2026"),t[2]=e,t[3]=l):l=t[3],r=l;break e}case"idle":{let l;t[4]!==e?(l=e("Idle"),t[4]=e,t[5]=l):l=t[5],r=l;break e}case"offline":{let l;t[6]!==e?(l=e("Offline"),t[6]=e,t[7]=l):l=t[7],r=l;break e}case"polling":{let l;t[8]!==e?(l=e("Polling"),t[8]=e,t[9]=l):l=t[9],r=l;break e}default:r=n}let a=je[n],c;t[10]!==a?(c=$("size-2 rounded-full",a),t[10]=a,t[11]=c):c=t[11];let i;t[12]!==c?(i=(0,ae.jsx)("span",{"aria-hidden":"true",className:c}),t[12]=c,t[13]=i):i=t[13];let o;return t[14]!==n||t[15]!==i||t[16]!==r?(o=(0,ae.jsxs)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":n,"data-testid":"dash-connection",role:"status",children:[i,r]}),t[14]=n,t[15]=i,t[16]=r,t[17]=o):o=t[17],o},"T");var s=Z(me(),1);var Te={crit:"destructive",ok:"secondary",warn:"default"},oe=h((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"re"),de=h((t,e,n)=>Number.isNaN(t)?"ok":t>=n?"crit":t>=e?"warn":"ok","oe"),Se=.01,Ee=.05,Ce=h(t=>{let e=(0,te.c)(36),{errorCount:n,logsError:r,topErrors:a,worstFunctions:c}=t,i=U(),o;e[0]!==i?(o=i("Functions by error rate"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==o?(l=(0,s.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,s.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o})}),e[2]=o,e[3]=l):l=e[3];let u;e[4]!==i||e[5]!==c?(u=c.length===0?(0,s.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:i("No function activity yet.")}):(0,s.jsx)("ul",{className:"divide-y divide-border",children:c.map(y=>(0,s.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,s.jsx)("span",{className:"truncate font-mono text-foreground",children:y.path}),(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,s.jsx)("span",{className:"tabular-nums text-muted-foreground",children:i("{count} calls",{count:y.calls.toString()})}),(0,s.jsx)(ee,{variant:Te[de(y.errors/y.calls,Se,Ee)],children:oe(y.errors,y.calls)})]})]},y.path))}),e[4]=i,e[5]=c,e[6]=u):u=e[6];let f;e[7]!==l||e[8]!==u?(f=(0,s.jsxs)(X,{className:"gap-0 py-0","data-testid":"hl-functions",children:[l,u]}),e[7]=l,e[8]=u,e[9]=f):f=e[9];let v;e[10]!==i?(v=i("Recent errors"),e[10]=i,e[11]=v):v=e[11];let m;e[12]!==v?(m=(0,s.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:v}),e[12]=v,e[13]=m):m=e[13];let d=n>0?"destructive":"outline",g;e[14]!==n||e[15]!==d?(g=(0,s.jsx)(ee,{"data-testid":"hl-error-count",variant:d,children:n}),e[14]=n,e[15]=d,e[16]=g):g=e[16];let p;e[17]!==m||e[18]!==g?(p=(0,s.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[m,g]}),e[17]=m,e[18]=g,e[19]=p):p=e[19];let S;e[20]!==r?(S=r!==null&&(0,s.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:r}),e[20]=r,e[21]=S):S=e[21];let E;e[22]!==r||e[23]!==i||e[24]!==a.length?(E=r===null&&a.length===0&&(0,s.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:i("No recent errors.")}),e[22]=r,e[23]=i,e[24]=a.length,e[25]=E):E=e[25];let q;e[26]!==a?(q=a.length>0&&(0,s.jsx)("ul",{className:"divide-y divide-border",children:a.map(Ie)}),e[26]=a,e[27]=q):q=e[27];let w;e[28]!==S||e[29]!==E||e[30]!==q||e[31]!==p?(w=(0,s.jsxs)(X,{className:"gap-0 py-0",children:[p,S,E,q]}),e[28]=S,e[29]=E,e[30]=q,e[31]=p,e[32]=w):w=e[32];let k;return e[33]!==w||e[34]!==f?(k=(0,s.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[f,w]}),e[33]=w,e[34]=f,e[35]=k):k=e[35],k},"_e");function Ie(t,e){return(0,s.jsxs)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("time",{className:"shrink-0 text-muted-foreground",children:pe(t.timestamp)}),t.functionPath!==void 0&&(0,s.jsx)("span",{className:"truncate font-mono text-foreground",children:t.functionPath})]}),(0,s.jsx)("span",{className:"text-destructive",children:t.message})]},`${t.timestamp.toString()}-${e.toString()}`)}h(Ie,"Ae");var we={completed:0,failed:2,in_progress:1},De=h(t=>{let e=0,n=0,r=0,a=0,c=!1,i=[];for(let{metrics:o}of t){if(o===null){a+=1;continue}r+=1,e+=o.requests,n+=o.errors,i.push(...o.history??[]),c||=o.historyTruncated===!0}return{errors:n,failed:a,history:i,historyTruncated:c,reachable:r,requests:e}},"ke"),_e=h(t=>{let e=new Map;for(let n of t)for(let r of n){let a=e.get(r.path);if(a===void 0){e.set(r.path,{...r});continue}a.calls+=r.calls,a.errors+=r.errors,a.totalDurationMs+=r.totalDurationMs,a.scans=(a.scans??0)+(r.scans??0),a.maxDurationMs=Math.max(a.maxDurationMs,r.maxDurationMs),a.lastCalledAt=Math.max(a.lastCalledAt,r.lastCalledAt),(r.lastErrorAt??0)>(a.lastErrorAt??0)&&(a.lastErrorAt=r.lastErrorAt,a.lastErrorMessage=r.lastErrorMessage)}return[...e.values()]},"Re"),Pe=h(t=>{let e=new Map;for(let n of t)for(let r of n){let a=e.get(r.id);if(a===void 0){e.set(r.id,r);continue}let c=we[r.status]-we[a.status];(c>0||c===0&&(r.updatedAt??0)>(a.updatedAt??0))&&e.set(r.id,r)}return[...e.values()]},"Me"),Le=W(B.getAuthMetrics),Fe=W(B.getFunctionStats),Re=W(B.getLogs),Oe=W(B.getMetrics),ze=W(B.migrationStatus),$e=5,ke=2e3,Ke=5,Be=.1,Ue=.3,Ge=1,He=50,Qe=h((t,e,n)=>t>=n?"crit":t>=e?"warn":"ok","$e"),Je=h(t=>{let e=new Map;for(let r of t??[]){let a=e.get(r.bucketMs)??{calls:0,errors:0};a.calls+=r.calls,a.errors+=r.errors,e.set(r.bucketMs,a)}let n=[...e.entries()].toSorted((r,a)=>r[0]-a[0]);return{errors:n.map(([,r])=>r.errors),requests:n.map(([,r])=>r.calls)}},"Be"),Ve=h(t=>{let e=0,n=0;for(let a of t)a.status==="failed"?e+=1:a.status==="in_progress"&&(n+=1);let r="ok";return e>0?r="crit":n>0&&(r="warn"),{failed:e,level:r,running:n}},"Ve"),We=h((t,e)=>t.failed>0?e("{count} failed",{count:t.failed.toString()}):t.running>0?e("{count} running",{count:t.running.toString()}):e("OK"),"He"),qe={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},Me={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},Xe={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Ye=h(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","ze"),ne=h(t=>{let e=(0,te.c)(19),{chart:n,label:r,level:a,testId:c,value:i}=t,o=qe[a],l;e[0]!==o?(l=$("size-1.5 shrink-0 rounded-full",o),e[0]=o,e[1]=l):l=e[1];let u;e[2]!==l?(u=(0,s.jsx)("span",{"aria-hidden":"true",className:l}),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==u?(f=(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[u,r]}),e[4]=r,e[5]=u,e[6]=f):f=e[6];let v=Me[a],m;e[7]!==v?(m=$("truncate text-2xl font-semibold tabular-nums",v),e[7]=v,e[8]=m):m=e[8];let d;e[9]!==m||e[10]!==c||e[11]!==i?(d=(0,s.jsx)("span",{className:m,"data-testid":c,children:i}),e[9]=m,e[10]=c,e[11]=i,e[12]=d):d=e[12];let g;e[13]!==n||e[14]!==d?(g=(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[d,n]}),e[13]=n,e[14]=d,e[15]=g):g=e[15];let p;return e[16]!==f||e[17]!==g?(p=(0,s.jsx)(X,{className:"gap-0 py-0",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[f,g]})}),e[16]=f,e[17]=g,e[18]=p):p=e[18],p},"ee"),Ze=h(async(t,e,n)=>{let r=await Promise.all(n.map(m=>{let d=ie(m);return Promise.allSettled([t.query(Oe,{},d),t.query(Fe,{},d),t.query(ze,{},d)])})),a=ie(e),c=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[i,o,l]=await Promise.allSettled([t.query(Re,{},a),t.query(Le,{},a),c]),u=r.map(([m,d,g])=>({functions:d.status==="fulfilled"?d.value.functions:[],metrics:m.status==="fulfilled"?m.value:null,migrations:g.status==="fulfilled"?g.value.migrations:[]})),f=De(u),v=r[0]?.[0];return{auth:o.status==="fulfilled"?o.value:null,entries:i.status==="fulfilled"?i.value.entries:[],functions:_e(u.map(m=>m.functions)),logsError:i.status==="rejected"?ce(i.reason):null,metricsError:f.reachable===0&&v?.status==="rejected"?ce(v.reason):null,migrations:Pe(u.map(m=>m.migrations)),scheduler:l.status==="fulfilled"?l.value:null,totals:f}},"Qe"),et=h(t=>{let e=t?.history??[];return{attempts:e.map(n=>n.attempts),failures:e.map(n=>n.failures)}},"We"),tt=h((t,e)=>t==="crit"?{description:e("One or more service levels are breached."),label:e("Critical")}:t==="warn"?{description:e("Some service levels need attention."),label:e("Degraded")}:{description:e("All service levels are within target."),label:e("All systems healthy")},"Xe"),rt=h(t=>{let e=(0,te.c)(75),{errorLevel:n,liveError:r,metricsError:a,overall:c,requestSeries:i,totals:o}=t,l=U(),u;e[0]!==c||e[1]!==l?(u=tt(c,l),e[0]=c,e[1]=l,e[2]=u):u=e[2];let{description:f,label:v}=u,m=Xe[c],d;e[3]!==m?(d=$("flex size-10 shrink-0 items-center justify-center rounded-full",m),e[3]=m,e[4]=d):d=e[4];let g=qe[c],p;e[5]!==g?(p=$("size-3 rounded-full",g),e[5]=g,e[6]=p):p=e[6];let S;e[7]!==p?(S=(0,s.jsx)("span",{className:p}),e[7]=p,e[8]=S):S=e[8];let E;e[9]!==d||e[10]!==S?(E=(0,s.jsx)("span",{"aria-hidden":"true",className:d,children:S}),e[9]=d,e[10]=S,e[11]=E):E=e[11];let q;e[12]!==v?(q=(0,s.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:v}),e[12]=v,e[13]=q):q=e[13];let w;e[14]!==f?(w=(0,s.jsx)("span",{className:"text-[13px] text-muted-foreground",children:f}),e[14]=f,e[15]=w):w=e[15];let k;e[16]!==q||e[17]!==w?(k=(0,s.jsxs)("div",{className:"grid leading-tight",children:[q,w]}),e[16]=q,e[17]=w,e[18]=k):k=e[18];let y;e[19]!==k||e[20]!==E?(y=(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[E,k]}),e[19]=k,e[20]=E,e[21]=y):y=e[21];let j;e[22]!==l?(j=l("Requests"),e[22]=l,e[23]=j):j=e[23];let M;e[24]!==j?(M=(0,s.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:j}),e[24]=j,e[25]=M):M=e[25];let A;e[26]!==i||e[27]!==l?(A=i.length>=2&&(0,s.jsx)(le,{ariaLabel:l("Requests over time"),className:"h-6 w-20 text-foreground",series:i,testId:"hl-spark-requests"}),e[26]=i,e[27]=l,e[28]=A):A=e[28];let F=o?.requests??0,R;e[29]!==F?(R=F.toString(),e[29]=F,e[30]=R):R=e[30];let D;e[31]!==R?(D=(0,s.jsx)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:R}),e[31]=R,e[32]=D):D=e[32];let O;e[33]!==A||e[34]!==D?(O=(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[A,D]}),e[33]=A,e[34]=D,e[35]=O):O=e[35];let _;e[36]!==M||e[37]!==O?(_=(0,s.jsxs)("div",{className:"text-end",children:[M,O]}),e[36]=M,e[37]=O,e[38]=_):_=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=(0,s.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),e[39]=G):G=e[39];let T;e[40]!==l?(T=l("Error rate"),e[40]=l,e[41]=T):T=e[41];let P;e[42]!==T?(P=(0,s.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:T}),e[42]=T,e[43]=P):P=e[43];let Y=Me[n],C;e[44]!==Y?(C=$("text-lg font-semibold tabular-nums",Y),e[44]=Y,e[45]=C):C=e[45];let z;e[46]!==o?(z=o===null?"\u2014":oe(o.errors,o.requests),e[46]=o,e[47]=z):z=e[47];let I;e[48]!==C||e[49]!==z?(I=(0,s.jsx)("div",{className:C,"data-testid":"hl-error-rate",children:z}),e[48]=C,e[49]=z,e[50]=I):I=e[50];let L;e[51]!==P||e[52]!==I?(L=(0,s.jsxs)("div",{className:"text-end",children:[P,I]}),e[51]=P,e[52]=I,e[53]=L):L=e[53];let K;e[54]===Symbol.for("react.memo_cache_sentinel")?(K=(0,s.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),e[54]=K):K=e[54];let H;e[55]===Symbol.for("react.memo_cache_sentinel")?(H=(0,s.jsx)(ye,{}),e[55]=H):H=e[55];let b;e[56]!==r?(b=(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[H,(0,s.jsx)(ve,{message:r,prefix:"hl"})]}),e[56]=r,e[57]=b):b=e[57];let N;e[58]!==_||e[59]!==L||e[60]!==b?(N=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[_,G,L,K,b]}),e[58]=_,e[59]=L,e[60]=b,e[61]=N):N=e[61];let Q;e[62]!==y||e[63]!==N?(Q=(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[y,N]}),e[62]=y,e[63]=N,e[64]=Q):Q=e[64];let J;e[65]!==a?(J=a!==null&&(0,s.jsx)("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive","data-testid":"hl-metrics-error",role:"alert",children:a}),e[65]=a,e[66]=J):J=e[66];let V;e[67]!==a||e[68]!==l||e[69]!==o?.historyTruncated?(V=a===null&&o?.historyTruncated===!0&&(0,s.jsx)("div",{className:"border-t border-border bg-warning/5 px-4 py-2 text-sm text-muted-foreground","data-testid":"hl-history-truncated",children:l("Showing a partial request/error history \u2014 one or more shards have more data than the trend chart can display.")}),e[67]=a,e[68]=l,e[69]=o?.historyTruncated,e[70]=V):V=e[70];let re;return e[71]!==Q||e[72]!==J||e[73]!==V?(re=(0,s.jsxs)(X,{className:"gap-0 py-0",children:[Q,J,V]}),e[71]=Q,e[72]=J,e[73]=V,e[74]=re):re=e[74],re},"Je"),st=h(t=>{let e=(0,te.c)(14),{shards:n}=t,r=U(),a;e[0]!==r?(a=r("Shards seen"),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==a?(c=(0,s.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a}),e[2]=a,e[3]=c):c=e[3];let i;e[4]!==n.length?(i=(0,s.jsx)(ee,{"data-testid":"hl-shard-count",variant:"outline",children:n.length}),e[4]=n.length,e[5]=i):i=e[5];let o;e[6]!==c||e[7]!==i?(o=(0,s.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[c,i]}),e[6]=c,e[7]=i,e[8]=o):o=e[8];let l;e[9]!==n?(l=n.length>0&&(0,s.jsx)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:n.map(lt)}),e[9]=n,e[10]=l):l=e[10];let u;return e[11]!==o||e[12]!==l?(u=(0,s.jsxs)(X,{className:"gap-0 py-0",children:[o,l]}),e[11]=o,e[12]=l,e[13]=u):u=e[13],u},"Ye"),kt=h(({initialShardKey:t})=>{let e=fe(),n=U(),[r,a]=(0,x.useState)([]),[c,i]=(0,x.useState)(null),[o,l]=(0,x.useState)(null),[u,f]=(0,x.useState)(null),[v,m]=(0,x.useState)([]),[d,g]=(0,x.useState)(null),[p,S]=(0,x.useState)(null),[E,q]=(0,x.useState)([]),[w]=(0,x.useState)(xe),k=(0,x.useRef)(!1),y=(0,x.useRef)(0),j=(0,x.useRef)(0),M=(0,x.useRef)(null),A=t??"",F=(0,x.useCallback)(async()=>{if(k.current)return;k.current=!0;let b=y.current,N=await Ze(e,A,be(A,w));b===y.current&&(l(N.totals),f(N.metricsError),m(N.functions),q(N.migrations),a(N.entries),i(N.logsError),g(N.auth),S(N.scheduler),k.current=!1)},[e,w,A]);(0,x.useEffect)(()=>(se(F()),()=>{y.current+=1,k.current=!1,M.current!==null&&(clearTimeout(M.current),M.current=null)}),[F]);let R=h(()=>{let b=Date.now()-j.current;if(b>=ke){j.current=Date.now(),se(F());return}M.current===null&&(M.current=setTimeout(()=>{M.current=null,j.current=Date.now(),se(F())},ke-b))},"j"),{data:D,liveError:O}=ge(B.getMetrics,{},{live:!0,shardKey:A});(0,x.useEffect)(()=>{D!==void 0&&R()},[D]);let _=r.filter(b=>b.level==="error"),G=_.slice(0,$e),T=Je(o?.history),P=et(d),Y=v.filter(b=>b.calls>0).toSorted((b,N)=>N.errors/N.calls-b.errors/b.calls||N.calls-b.calls).slice(0,Ke),C=Ve(E),z=o===null||o.requests===0?0:o.errors/o.requests,I=de(z,Se,Ee),L=d===null?"ok":de(d.failureRate,Be,Ue),K=p===null?"ok":Qe(p.backlog,Ge,He),H=Ye([I,L,K,C.level]);return(0,s.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,s.jsx)(rt,{errorLevel:I,liveError:O,metricsError:u,overall:H,requestSeries:T.requests,totals:o}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,s.jsx)(ne,{chart:T.errors.length>=2?(0,s.jsx)(le,{ariaLabel:n("Errors over time"),className:"h-7 w-20 text-destructive",series:T.errors,testId:"hl-spark-errors"}):void 0,label:n("Error rate"),level:I,testId:"hl-slo-errorrate",value:o===null?"\u2014":oe(o.errors,o.requests)}),(0,s.jsx)(ne,{chart:P.failures.length>=2?(0,s.jsx)(le,{ariaLabel:n("Auth failures over time"),className:"h-7 w-20 text-destructive",series:P.failures,testId:"hl-spark-auth"}):void 0,label:n("Auth failures"),level:L,testId:"hl-slo-auth",value:d===null?"\u2014":oe(d.failures,d.attempts)}),(0,s.jsx)(ne,{label:n("Scheduler backlog"),level:K,testId:"hl-slo-backlog",value:p===null?"\u2014":p.backlog.toString()}),(0,s.jsx)(ne,{label:n("Migrations"),level:C.level,testId:"hl-slo-migrations",value:We(C,n)})]}),(0,s.jsx)(Ce,{errorCount:_.length,logsError:c,topErrors:G,worstFunctions:Y}),(0,s.jsx)(st,{shards:w})]})},"gt");function lt(t){return(0,s.jsx)("li",{"data-testid":"hl-shard",children:(0,s.jsx)(ee,{variant:"secondary",children:t})},t)}h(lt,"Ze");export{kt as HealthPanel};
@@ -1 +1 @@
1
- import{b as I,f as B,u as U,v as M}from"./chunk-VUOEJJUH.js";import{b as O,c as E,d as S}from"./chunk-YUVGMKHG.js";import{a as w}from"./chunk-6G3E4PJ2.js";import{a as s,d as k}from"./chunk-5PEAXTYQ.js";var f=k(w(),1);var g=k(w(),1);var z=g.createContext(void 0);function W(o=!1){let t=g.useContext(z);if(t===void 0&&!o)throw new Error(S(16));return t}s(W,"useCompositeRootContext");var H=k(w(),1);function A(o){let{focusableWhenDisabled:t,disabled:r,composite:l=!1,tabIndex:n=0,isNativeButton:u}=o,d=l&&t!==!1,b=l&&t===!1;return{props:H.useMemo(()=>{let a={onKeyDown(p){r&&t&&p.key!=="Tab"&&p.preventDefault()}};return l||(a.tabIndex=n,!u&&r&&(a.tabIndex=t?n:-1)),(u&&(t||d)||!u&&r)&&(a["aria-disabled"]=r),u&&(!t||b)&&(a.disabled=r),a},[l,r,t,d,b,u,n])}}s(A,"useFocusableWhenDisabled");function h(o,t,{detail:r=0}={}){o.dispatchEvent(new(I(o)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}s(h,"dispatchClickWithModifiers");function le(o={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:l=0,native:n=!0,composite:u}=o,d=f.useRef(null),b=W(!0),i=u??b!==void 0,{props:a}=A({focusableWhenDisabled:r,disabled:t,composite:i,tabIndex:l,isNativeButton:n}),p=f.useCallback(()=>{let c=d.current;K(c)&&i&&t&&a.disabled===void 0&&c.disabled&&(c.disabled=!1)},[t,a.disabled,i]);M(p,[p]);let F=f.useCallback((c={})=>{let{onClick:x,onMouseDown:C,onKeyUp:V,onKeyDown:_,onPointerDown:$,...v}=c;return O({onClick(e){if(t){e.preventDefault();return}x?.(e)},onMouseDown(e){t||C?.(e)},onKeyDown(e){if(t||(E(e),_?.(e),e.baseUIHandlerPrevented))return;let R=e.target===e.currentTarget,m=e.currentTarget,P=K(m),N=!n&&G(m),j=R&&(n?P:!N),T=e.key==="Enter",y=e.key===" ",D=m.getAttribute("role"),q=D?.startsWith("menuitem")||D==="option"||D==="gridcell";if(R&&i&&y){if(e.defaultPrevented&&q)return;e.preventDefault(),(!n||P)&&(e.preventBaseUIHandler(),h(m,e));return}if(!j||n||!y&&!T){R&&N&&y&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),T&&(e.preventBaseUIHandler(),h(m,e)))},onKeyUp(e){if(!t){if(E(e),V?.(e),e.target===e.currentTarget&&n&&i&&K(e.currentTarget)&&e.key===" "){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!n&&!i&&!e.defaultPrevented&&e.key===" "&&(e.preventBaseUIHandler(),h(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}$?.(e)}},n?{type:"button"}:{role:"button"},a,v)},[t,a,i,n]),L=U(c=>{d.current=c,p()});return{getButtonProps:F,buttonRef:L}}s(le,"useButton");function K(o){return B(o)&&o.tagName==="BUTTON"}s(K,"isButtonElement");function G(o){return B(o)&&o.tagName==="A"&&!!o.href}s(G,"isValidLinkElement");export{W as a,h as b,le as c};
1
+ import{b as I,f as B,u as U,v as M}from"./chunk-OZID3UYF.js";import{b as O,c as E,d as S}from"./chunk-L27FKJTG.js";import{a as w}from"./chunk-ADABTCDI.js";import{a as s,d as k}from"./chunk-5PEAXTYQ.js";var f=k(w(),1);var g=k(w(),1);var z=g.createContext(void 0);function W(o=!1){let t=g.useContext(z);if(t===void 0&&!o)throw new Error(S(16));return t}s(W,"useCompositeRootContext");var H=k(w(),1);function A(o){let{focusableWhenDisabled:t,disabled:r,composite:l=!1,tabIndex:n=0,isNativeButton:u}=o,d=l&&t!==!1,b=l&&t===!1;return{props:H.useMemo(()=>{let a={onKeyDown(p){r&&t&&p.key!=="Tab"&&p.preventDefault()}};return l||(a.tabIndex=n,!u&&r&&(a.tabIndex=t?n:-1)),(u&&(t||d)||!u&&r)&&(a["aria-disabled"]=r),u&&(!t||b)&&(a.disabled=r),a},[l,r,t,d,b,u,n])}}s(A,"useFocusableWhenDisabled");function h(o,t,{detail:r=0}={}){o.dispatchEvent(new(I(o)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}s(h,"dispatchClickWithModifiers");function le(o={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:l=0,native:n=!0,composite:u}=o,d=f.useRef(null),b=W(!0),i=u??b!==void 0,{props:a}=A({focusableWhenDisabled:r,disabled:t,composite:i,tabIndex:l,isNativeButton:n}),p=f.useCallback(()=>{let c=d.current;K(c)&&i&&t&&a.disabled===void 0&&c.disabled&&(c.disabled=!1)},[t,a.disabled,i]);M(p,[p]);let F=f.useCallback((c={})=>{let{onClick:x,onMouseDown:C,onKeyUp:V,onKeyDown:_,onPointerDown:$,...v}=c;return O({onClick(e){if(t){e.preventDefault();return}x?.(e)},onMouseDown(e){t||C?.(e)},onKeyDown(e){if(t||(E(e),_?.(e),e.baseUIHandlerPrevented))return;let R=e.target===e.currentTarget,m=e.currentTarget,P=K(m),N=!n&&G(m),j=R&&(n?P:!N),T=e.key==="Enter",y=e.key===" ",D=m.getAttribute("role"),q=D?.startsWith("menuitem")||D==="option"||D==="gridcell";if(R&&i&&y){if(e.defaultPrevented&&q)return;e.preventDefault(),(!n||P)&&(e.preventBaseUIHandler(),h(m,e));return}if(!j||n||!y&&!T){R&&N&&y&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),T&&(e.preventBaseUIHandler(),h(m,e)))},onKeyUp(e){if(!t){if(E(e),V?.(e),e.target===e.currentTarget&&n&&i&&K(e.currentTarget)&&e.key===" "){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!n&&!i&&!e.defaultPrevented&&e.key===" "&&(e.preventBaseUIHandler(),h(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}$?.(e)}},n?{type:"button"}:{role:"button"},a,v)},[t,a,i,n]),L=U(c=>{d.current=c,p()});return{getButtonProps:F,buttonRef:L}}s(le,"useButton");function K(o){return B(o)&&o.tagName==="BUTTON"}s(K,"isButtonElement");function G(o){return B(o)&&o.tagName==="A"&&!!o.href}s(G,"isValidLinkElement");export{W as a,h as b,le as c};
@@ -1 +1 @@
1
- import{a as je}from"./chunk-HPD2PZP2.js";import{a as Be,b as Ue,c as We,d as De,e as we}from"./chunk-25WEL5RI.js";import"./chunk-O3AZ7JKE.js";import{a as qe}from"./chunk-7SNL633X.js";import"./chunk-VNH4OBJS.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import{a as ze}from"./chunk-J45HAKBU.js";import{a as _e}from"./chunk-645S7KRU.js";import"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-QRA7AKYO.js";import{i as Ae}from"./chunk-MWYGLPDV.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as le}from"./chunk-KBYFBEG2.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as Ee}from"./chunk-FWOOA2ZR.js";import{b as me}from"./chunk-M4TCBPSY.js";import"./chunk-YUVGMKHG.js";import{a as Le,b as Re,c as Ve,d as pe,e as B,f as L}from"./chunk-VXZAS5VS.js";import"./chunk-4PI2OSSP.js";import{a as U}from"./chunk-6A6AELDJ.js";import{c as Ce}from"./chunk-CLQKKJHL.js";import{a as Ke,e as Te}from"./chunk-OSHODLMU.js";import{n as be}from"./chunk-PFPJA2HR.js";import"./chunk-ZPQBVYNN.js";import{B as ue,e as Se,f as $e,h as ie,i as Ne,j as ke,s as re,w as Me}from"./chunk-PUK3H4RN.js";import"./chunk-PDBW6GTJ.js";import{a as Ge}from"./chunk-GWNGVKLG.js";import{a as Oe,b as He}from"./chunk-6G3E4PJ2.js";import{a as d,d as ye}from"./chunk-5PEAXTYQ.js";var ge=ye(Ge(),1);var ne=ye(Oe(),1);var t=ye(He(),1);var Ie="none",Je=["all","open","resolved","ignored"],Pe=["critical","high","medium","low"],Qe=ie(U.resolveIssue),Xe=ie(U.ignoreIssue),Fe=ie(U.assignIssue),Ye=ie(U.setIssueSeverity),Ze=ie(U.explainIssue),es=d(n=>Array.isArray(n?.issues)?n.issues:[],"Xe"),ss=d(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Je"),ts=d(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Ze"),as=d(n=>{let e=(0,ge.c)(44),{expanded:u,issue:s,shardKey:$}=n,i=be(),l=ue(),[a,o]=(0,ne.useState)(void 0),{busy:_,error:A,run:R}=je(),K;e[0]!==i||e[1]!==s||e[2]!==R||e[3]!==$?(K=d(()=>{o(void 0),R(async()=>{let g={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},S=await i.query(Ze,g,Ne($));o(S)})},"C"),e[0]=i,e[1]=s,e[2]=R,e[3]=$,e[4]=K):K=e[4];let z=K;if(!u)return null;let k;if(e[5]!==s.sampleMessage){let g=$e(s.sampleMessage);k=g===void 0?void 0:Se(g.body),e[5]=s.sampleMessage,e[6]=k}else k=e[6];let T=k,E=`issues-detail-${s.hash}`,h;e[7]!==s.sampleMessage?(h=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=h):h=e[8];let x;e[9]!==l?(x=l("Suggested fix"),e[9]=l,e[10]=x):x=e[10];let M;e[11]!==x?(M=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=M):M=e[12];let v;e[13]!==T||e[14]!==s.hash||e[15]!==l?(v=T===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:l("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:T}),e[13]=T,e[14]=s.hash,e[15]=l,e[16]=v):v=e[16];let y;e[17]!==M||e[18]!==v?(y=(0,t.jsxs)("div",{children:[M,v]}),e[17]=M,e[18]=v,e[19]=y):y=e[19];let b=`issues-explain-${s.hash}`,w;e[20]!==_||e[21]!==l?(w=l(_?"Explaining\u2026":"Explain in plain language"),e[20]=_,e[21]=l,e[22]=w):w=e[22];let m;e[23]!==_||e[24]!==z||e[25]!==w||e[26]!==b?(m=(0,t.jsx)("div",{children:(0,t.jsx)(le,{"data-testid":b,disabled:_,onClick:z,size:"sm",type:"button",variant:"outline",children:w})}),e[23]=_,e[24]=z,e[25]=w,e[26]=b,e[27]=m):m=e[27];let f;e[28]!==A||e[29]!==s.hash?(f=A!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:A}),e[28]=A,e[29]=s.hash,e[30]=f):f=e[30];let p;e[31]!==a||e[32]!==s.hash||e[33]!==l?(p=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?l("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):l("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:l("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:l("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:l("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=l,e[34]=p):p=e[34];let c;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==h||e[39]!==y?(c=(0,t.jsx)(L,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[h,y,m,f,p]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=h,e[39]=y,e[40]=c):c=e[40];let I;return e[41]!==c||e[42]!==E?(I=(0,t.jsx)(pe,{"data-testid":E,children:c}),e[41]=c,e[42]=E,e[43]=I):I=e[43],I},"et"),is=d(n=>{let e=(0,ge.c)(119),{busy:u,issue:s,rowError:$,runTriage:i,shardKey:l}=n,a=ue(),[o,_]=(0,ne.useState)(!1),A;e[0]===Symbol.for("react.memo_cache_sentinel")?(A=d(()=>{_(rs)},"A"),e[0]=A):A=e[0];let R=A,K;e[1]!==s.hash||e[2]!==i?(K=d(ae=>{let ce=ae===null||ae===Ie?null:ae;re(i(s.hash,Ye,{severity:ce}))},"C"),e[1]=s.hash,e[2]=i,e[3]=K):K=e[3];let z=K,k;e[4]!==s.hash||e[5]!==i?(k=d(ae=>{if(ae.key!=="Enter")return;let ce=ae.currentTarget.value.trim();re(i(s.hash,Fe,{assignee:ce===""?null:ce}))},"T"),e[4]=s.hash,e[5]=i,e[6]=k):k=e[6];let T=k,E=`issues-row-${s.hash}`,h;e[7]!==a?(h=a("Toggle issue details"),e[7]=a,e[8]=h):h=e[8];let x=`issues-toggle-${s.hash}`,M=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=v):v=e[9];let y;e[10]!==M?(y=(0,t.jsx)("svg",{"aria-hidden":"true",className:M,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:v}),e[10]=M,e[11]=y):y=e[11];let b;e[12]!==s.title?(b=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=b):b=e[13];let w;e[14]!==s.culprit?(w=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=w):w=e[15];let m;e[16]!==b||e[17]!==w?(m=(0,t.jsxs)("span",{className:"min-w-0",children:[b,w]}),e[16]=b,e[17]=w,e[18]=m):m=e[18];let f;e[19]!==o||e[20]!==m||e[21]!==h||e[22]!==x||e[23]!==y?(f=(0,t.jsxs)("button",{"aria-expanded":o,"aria-label":h,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:R,type:"button",children:[y,m]}),e[19]=o,e[20]=m,e[21]=h,e[22]=x,e[23]=y,e[24]=f):f=e[24];let p;e[25]!==s.hash||e[26]!==$?(p=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=p):p=e[27];let c;e[28]!==f||e[29]!==p?(c=(0,t.jsxs)(L,{className:"max-w-80",children:[f,p]}),e[28]=f,e[29]=p,e[30]=c):c=e[30];let I=`issues-status-${s.hash}`,g;e[31]!==s.status?(g=ss(s.status),e[31]=s.status,e[32]=g):g=e[32];let S;e[33]!==s.status||e[34]!==I||e[35]!==g?(S=(0,t.jsx)(L,{children:(0,t.jsx)(me,{"data-testid":I,variant:g,children:s.status})}),e[33]=s.status,e[34]=I,e[35]=g,e[36]=S):S=e[36];let V=s.severity??Ie,r;e[37]!==a?(r=a("Set severity"),e[37]=a,e[38]=r):r=e[38];let oe=`issues-severity-${s.hash}`,j;e[39]!==a?(j=a("\u2014"),e[39]=a,e[40]=j):j=e[40];let N;e[41]!==s.severity||e[42]!==a?(N=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=N):N=e[43];let C;e[44]!==j||e[45]!==N?(C=(0,t.jsx)(Ue,{placeholder:j,children:N}),e[44]=j,e[45]=N,e[46]=C):C=e[46];let q;e[47]!==r||e[48]!==oe||e[49]!==C?(q=(0,t.jsx)(We,{"aria-label":r,className:"h-7 w-[110px]","data-testid":oe,children:C}),e[47]=r,e[48]=oe,e[49]=C,e[50]=q):q=e[50];let de;e[51]===Symbol.for("react.memo_cache_sentinel")?(de=Pe.map(ls),e[51]=de):de=e[51];let W;e[52]!==a?(W=a("Clear"),e[52]=a,e[53]=W):W=e[53];let D;e[54]!==W?(D=(0,t.jsxs)(De,{children:[de,(0,t.jsx)(we,{value:Ie,children:W})]}),e[54]=W,e[55]=D):D=e[55];let F;e[56]!==u||e[57]!==z||e[58]!==V||e[59]!==q||e[60]!==D?(F=(0,t.jsx)(L,{children:(0,t.jsxs)(Be,{disabled:u,onValueChange:z,value:V,children:[q,D]})}),e[56]=u,e[57]=z,e[58]=V,e[59]=q,e[60]=D,e[61]=F):F=e[61];let O;e[62]!==a?(O=a("Assignee"),e[62]=a,e[63]=O):O=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",G;e[64]!==a?(G=a("Unassigned"),e[64]=a,e[65]=G):G=e[65];let H;e[66]!==u||e[67]!==T||e[68]!==O||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==G?(H=(0,t.jsx)(L,{children:(0,t.jsx)(Ae,{"aria-label":O,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:u,onKeyDown:T,placeholder:G},ve)}),e[66]=u,e[67]=T,e[68]=O,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=G,e[73]=H):H=e[73];let J;e[74]!==s.count?(J=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=J):J=e[75];let P;e[76]!==s.lastSeen?(P=Me(s.lastSeen),e[76]=s.lastSeen,e[77]=P):P=e[77];let Q;e[78]!==P?(Q=(0,t.jsx)(L,{className:"text-xs tabular-nums text-muted-foreground",children:P}),e[78]=P,e[79]=Q):Q=e[79];let X;e[80]!==u||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(X=s.status!=="resolved"&&(0,t.jsx)(le,{"data-testid":`issues-resolve-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=u,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=X):X=e[85];let Y;e[86]!==u||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(Y=s.status!=="ignored"&&(0,t.jsx)(le,{"data-testid":`issues-ignore-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=u,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=Y):Y=e[91];let Z;e[92]!==u||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(Z=s.status!=="open"&&(0,t.jsx)(le,{"data-testid":`issues-reopen-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Fe,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=u,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=Z):Z=e[98];let ee;e[99]!==X||e[100]!==Y||e[101]!==Z?(ee=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[X,Y,Z]})}),e[99]=X,e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let se;e[103]!==c||e[104]!==S||e[105]!==F||e[106]!==H||e[107]!==J||e[108]!==Q||e[109]!==E||e[110]!==ee?(se=(0,t.jsxs)(pe,{"data-testid":E,children:[c,S,F,H,J,Q,ee]}),e[103]=c,e[104]=S,e[105]=F,e[106]=H,e[107]=J,e[108]=Q,e[109]=E,e[110]=ee,e[111]=se):se=e[111];let te;e[112]!==o||e[113]!==s||e[114]!==l?(te=(0,t.jsx)(as,{expanded:o,issue:s,shardKey:l},s.sampleMessage),e[112]=o,e[113]=s,e[114]=l,e[115]=te):te=e[115];let he;return e[116]!==se||e[117]!==te?(he=(0,t.jsxs)(t.Fragment,{children:[se,te]}),e[116]=se,e[117]=te,e[118]=he):he=e[118],he},"tt"),ks=d(n=>{let e=(0,ge.c)(38),{initialShardKey:u}=n,s=ue(),$=be(),{queryShardKey:i,setShardKey:l,shardKey:a}=ze(u),[o,_]=(0,ne.useState)("all"),[A,R]=(0,ne.useState)(ns),[K,z]=(0,ne.useState)(os),k;e[0]!==o?(k=o==="all"?{}:{status:o},e[0]=o,e[1]=k):k=e[1];let T;e[2]!==i?(T={live:!0,shardKey:i},e[2]=i,e[3]=T):T=e[3];let{data:E,error:h,liveError:x}=Ce(U.getIssues,k,T),M=E!==void 0,v;if(e[4]!==K||e[5]!==A||e[6]!==$||e[7]!==E||e[8]!==h||e[9]!==x||e[10]!==M||e[11]!==i||e[12]!==l||e[13]!==a||e[14]!==o||e[15]!==s){let y=es(E),b;e[17]!==$||e[18]!==i?(b=d(async(r,oe,j)=>{z(N=>{if(!N.has(r))return N;let C=new Map(N);return C.delete(r),C}),R(N=>new Set(N).add(r));try{await $.query(oe,{...j,hash:r},Ne(i))}catch(N){let C=ke(N);z(q=>new Map(q).set(r,C))}R(N=>{let C=new Set(N);return C.delete(r),C})},"v"),e[17]=$,e[18]=i,e[19]=b):b=e[19];let w=b,m;e[20]!==s?(m=d(r=>s(r==="all"?"All":r==="open"?"Open":r==="resolved"?"Resolved":"Ignored"),"u"),e[20]=s,e[21]=m):m=e[21];let f=m,p;e[22]!==h?(p=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:h}),e[22]=h,e[23]=p):p=e[23];let c;e[24]!==l||e[25]!==a?(c=(0,t.jsx)(_e,{onChange:l,testId:"issues-shard-input",value:a}),e[24]=l,e[25]=a,e[26]=c):c=e[26];let I;e[27]!==x?(I=(0,t.jsx)(qe,{message:x,prefix:"issues"}),e[27]=x,e[28]=I):I=e[28];let g;e[29]!==o||e[30]!==f?(g=Je.map(r=>(0,t.jsx)(le,{"data-active":o===r?"":void 0,"data-testid":`issues-filter-${r}`,onClick:d(()=>{_(r)},"onClick"),size:"xs",variant:o===r?"default":"outline",children:f(r)},r)),e[29]=o,e[30]=f,e[31]=g):g=e[31];let S;e[32]!==g?(S=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:g}),e[32]=g,e[33]=S):S=e[33];let V;e[34]!==S||e[35]!==c||e[36]!==I?(V=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,I,S]}),e[34]=S,e[35]=c,e[36]=I,e[37]=V):V=e[37],v=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,V,M&&y.length===0?(0,t.jsx)(Ee,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Ke,{className:"overflow-hidden py-0",children:(0,t.jsx)(Te,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(Re,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(B,{children:s("Issue")}),(0,t.jsx)(B,{children:s("Status")}),(0,t.jsx)(B,{children:s("Severity")}),(0,t.jsx)(B,{children:s("Assignee")}),(0,t.jsx)(B,{className:"text-right",children:s("Events")}),(0,t.jsx)(B,{children:s("Last seen")}),(0,t.jsx)(B,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Ve,{children:y.map(r=>(0,t.jsx)(is,{busy:A.has(r.hash),issue:r,rowError:K.get(r.hash),runTriage:w,shardKey:i},r.hash))})]})})})]}),e[4]=K,e[5]=A,e[6]=$,e[7]=E,e[8]=h,e[9]=x,e[10]=M,e[11]=i,e[12]=l,e[13]=a,e[14]=o,e[15]=s,e[16]=v}else v=e[16];return v},"Tt");function rs(n){return!n}d(rs,"st");function ls(n){return(0,t.jsx)(we,{value:n,children:n},n)}d(ls,"at");function ns(){return new Set}d(ns,"it");function os(){return new Map}d(os,"lt");export{ks as default};
1
+ import{a as je}from"./chunk-F32O6VAS.js";import{a as Be,b as Ue,c as We,d as De,e as we}from"./chunk-4XNMLHOA.js";import"./chunk-T7UKRA6J.js";import{a as qe}from"./chunk-J7M7G2BA.js";import"./chunk-QF743FSL.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import{a as ze}from"./chunk-2KTN53PK.js";import{a as _e}from"./chunk-5G2OOLMF.js";import"./chunk-EDL46BPM.js";import"./chunk-4KPATTV6.js";import"./chunk-N7FOBAV3.js";import{i as Ae}from"./chunk-A5INOAIL.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as le}from"./chunk-SZCXVIVT.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as Ee}from"./chunk-X26D3KTK.js";import{b as me}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{a as Le,b as Re,c as Ve,d as pe,e as B,f as L}from"./chunk-3OVNOP65.js";import"./chunk-EOFWXI3T.js";import{a as U}from"./chunk-LYVYUTQY.js";import{c as Ce}from"./chunk-AKC4XWCD.js";import{a as Ke,e as Te}from"./chunk-CB22PV3X.js";import{n as be}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as ue,e as Se,f as $e,h as ie,i as Ne,j as ke,s as re,w as Me}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as Ge}from"./chunk-A6TVTNKO.js";import{a as Oe,b as He}from"./chunk-ADABTCDI.js";import{a as d,d as ye}from"./chunk-5PEAXTYQ.js";var ge=ye(Ge(),1);var ne=ye(Oe(),1);var t=ye(He(),1);var Ie="none",Je=["all","open","resolved","ignored"],Pe=["critical","high","medium","low"],Qe=ie(U.resolveIssue),Xe=ie(U.ignoreIssue),Fe=ie(U.assignIssue),Ye=ie(U.setIssueSeverity),Ze=ie(U.explainIssue),es=d(n=>Array.isArray(n?.issues)?n.issues:[],"Xe"),ss=d(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Je"),ts=d(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Ze"),as=d(n=>{let e=(0,ge.c)(44),{expanded:u,issue:s,shardKey:$}=n,i=be(),l=ue(),[a,o]=(0,ne.useState)(void 0),{busy:_,error:A,run:R}=je(),K;e[0]!==i||e[1]!==s||e[2]!==R||e[3]!==$?(K=d(()=>{o(void 0),R(async()=>{let g={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},S=await i.query(Ze,g,Ne($));o(S)})},"C"),e[0]=i,e[1]=s,e[2]=R,e[3]=$,e[4]=K):K=e[4];let z=K;if(!u)return null;let k;if(e[5]!==s.sampleMessage){let g=$e(s.sampleMessage);k=g===void 0?void 0:Se(g.body),e[5]=s.sampleMessage,e[6]=k}else k=e[6];let T=k,E=`issues-detail-${s.hash}`,h;e[7]!==s.sampleMessage?(h=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=h):h=e[8];let x;e[9]!==l?(x=l("Suggested fix"),e[9]=l,e[10]=x):x=e[10];let M;e[11]!==x?(M=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=M):M=e[12];let v;e[13]!==T||e[14]!==s.hash||e[15]!==l?(v=T===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:l("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:T}),e[13]=T,e[14]=s.hash,e[15]=l,e[16]=v):v=e[16];let y;e[17]!==M||e[18]!==v?(y=(0,t.jsxs)("div",{children:[M,v]}),e[17]=M,e[18]=v,e[19]=y):y=e[19];let b=`issues-explain-${s.hash}`,w;e[20]!==_||e[21]!==l?(w=l(_?"Explaining\u2026":"Explain in plain language"),e[20]=_,e[21]=l,e[22]=w):w=e[22];let m;e[23]!==_||e[24]!==z||e[25]!==w||e[26]!==b?(m=(0,t.jsx)("div",{children:(0,t.jsx)(le,{"data-testid":b,disabled:_,onClick:z,size:"sm",type:"button",variant:"outline",children:w})}),e[23]=_,e[24]=z,e[25]=w,e[26]=b,e[27]=m):m=e[27];let f;e[28]!==A||e[29]!==s.hash?(f=A!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:A}),e[28]=A,e[29]=s.hash,e[30]=f):f=e[30];let p;e[31]!==a||e[32]!==s.hash||e[33]!==l?(p=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?l("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):l("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:l("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:l("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:l("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=l,e[34]=p):p=e[34];let c;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==h||e[39]!==y?(c=(0,t.jsx)(L,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[h,y,m,f,p]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=h,e[39]=y,e[40]=c):c=e[40];let I;return e[41]!==c||e[42]!==E?(I=(0,t.jsx)(pe,{"data-testid":E,children:c}),e[41]=c,e[42]=E,e[43]=I):I=e[43],I},"et"),is=d(n=>{let e=(0,ge.c)(119),{busy:u,issue:s,rowError:$,runTriage:i,shardKey:l}=n,a=ue(),[o,_]=(0,ne.useState)(!1),A;e[0]===Symbol.for("react.memo_cache_sentinel")?(A=d(()=>{_(rs)},"A"),e[0]=A):A=e[0];let R=A,K;e[1]!==s.hash||e[2]!==i?(K=d(ae=>{let ce=ae===null||ae===Ie?null:ae;re(i(s.hash,Ye,{severity:ce}))},"C"),e[1]=s.hash,e[2]=i,e[3]=K):K=e[3];let z=K,k;e[4]!==s.hash||e[5]!==i?(k=d(ae=>{if(ae.key!=="Enter")return;let ce=ae.currentTarget.value.trim();re(i(s.hash,Fe,{assignee:ce===""?null:ce}))},"T"),e[4]=s.hash,e[5]=i,e[6]=k):k=e[6];let T=k,E=`issues-row-${s.hash}`,h;e[7]!==a?(h=a("Toggle issue details"),e[7]=a,e[8]=h):h=e[8];let x=`issues-toggle-${s.hash}`,M=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=v):v=e[9];let y;e[10]!==M?(y=(0,t.jsx)("svg",{"aria-hidden":"true",className:M,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:v}),e[10]=M,e[11]=y):y=e[11];let b;e[12]!==s.title?(b=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=b):b=e[13];let w;e[14]!==s.culprit?(w=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=w):w=e[15];let m;e[16]!==b||e[17]!==w?(m=(0,t.jsxs)("span",{className:"min-w-0",children:[b,w]}),e[16]=b,e[17]=w,e[18]=m):m=e[18];let f;e[19]!==o||e[20]!==m||e[21]!==h||e[22]!==x||e[23]!==y?(f=(0,t.jsxs)("button",{"aria-expanded":o,"aria-label":h,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:R,type:"button",children:[y,m]}),e[19]=o,e[20]=m,e[21]=h,e[22]=x,e[23]=y,e[24]=f):f=e[24];let p;e[25]!==s.hash||e[26]!==$?(p=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=p):p=e[27];let c;e[28]!==f||e[29]!==p?(c=(0,t.jsxs)(L,{className:"max-w-80",children:[f,p]}),e[28]=f,e[29]=p,e[30]=c):c=e[30];let I=`issues-status-${s.hash}`,g;e[31]!==s.status?(g=ss(s.status),e[31]=s.status,e[32]=g):g=e[32];let S;e[33]!==s.status||e[34]!==I||e[35]!==g?(S=(0,t.jsx)(L,{children:(0,t.jsx)(me,{"data-testid":I,variant:g,children:s.status})}),e[33]=s.status,e[34]=I,e[35]=g,e[36]=S):S=e[36];let V=s.severity??Ie,r;e[37]!==a?(r=a("Set severity"),e[37]=a,e[38]=r):r=e[38];let oe=`issues-severity-${s.hash}`,j;e[39]!==a?(j=a("\u2014"),e[39]=a,e[40]=j):j=e[40];let N;e[41]!==s.severity||e[42]!==a?(N=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=N):N=e[43];let C;e[44]!==j||e[45]!==N?(C=(0,t.jsx)(Ue,{placeholder:j,children:N}),e[44]=j,e[45]=N,e[46]=C):C=e[46];let q;e[47]!==r||e[48]!==oe||e[49]!==C?(q=(0,t.jsx)(We,{"aria-label":r,className:"h-7 w-[110px]","data-testid":oe,children:C}),e[47]=r,e[48]=oe,e[49]=C,e[50]=q):q=e[50];let de;e[51]===Symbol.for("react.memo_cache_sentinel")?(de=Pe.map(ls),e[51]=de):de=e[51];let W;e[52]!==a?(W=a("Clear"),e[52]=a,e[53]=W):W=e[53];let D;e[54]!==W?(D=(0,t.jsxs)(De,{children:[de,(0,t.jsx)(we,{value:Ie,children:W})]}),e[54]=W,e[55]=D):D=e[55];let F;e[56]!==u||e[57]!==z||e[58]!==V||e[59]!==q||e[60]!==D?(F=(0,t.jsx)(L,{children:(0,t.jsxs)(Be,{disabled:u,onValueChange:z,value:V,children:[q,D]})}),e[56]=u,e[57]=z,e[58]=V,e[59]=q,e[60]=D,e[61]=F):F=e[61];let O;e[62]!==a?(O=a("Assignee"),e[62]=a,e[63]=O):O=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",G;e[64]!==a?(G=a("Unassigned"),e[64]=a,e[65]=G):G=e[65];let H;e[66]!==u||e[67]!==T||e[68]!==O||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==G?(H=(0,t.jsx)(L,{children:(0,t.jsx)(Ae,{"aria-label":O,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:u,onKeyDown:T,placeholder:G},ve)}),e[66]=u,e[67]=T,e[68]=O,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=G,e[73]=H):H=e[73];let J;e[74]!==s.count?(J=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=J):J=e[75];let P;e[76]!==s.lastSeen?(P=Me(s.lastSeen),e[76]=s.lastSeen,e[77]=P):P=e[77];let Q;e[78]!==P?(Q=(0,t.jsx)(L,{className:"text-xs tabular-nums text-muted-foreground",children:P}),e[78]=P,e[79]=Q):Q=e[79];let X;e[80]!==u||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(X=s.status!=="resolved"&&(0,t.jsx)(le,{"data-testid":`issues-resolve-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=u,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=X):X=e[85];let Y;e[86]!==u||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(Y=s.status!=="ignored"&&(0,t.jsx)(le,{"data-testid":`issues-ignore-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=u,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=Y):Y=e[91];let Z;e[92]!==u||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(Z=s.status!=="open"&&(0,t.jsx)(le,{"data-testid":`issues-reopen-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Fe,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=u,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=Z):Z=e[98];let ee;e[99]!==X||e[100]!==Y||e[101]!==Z?(ee=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[X,Y,Z]})}),e[99]=X,e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let se;e[103]!==c||e[104]!==S||e[105]!==F||e[106]!==H||e[107]!==J||e[108]!==Q||e[109]!==E||e[110]!==ee?(se=(0,t.jsxs)(pe,{"data-testid":E,children:[c,S,F,H,J,Q,ee]}),e[103]=c,e[104]=S,e[105]=F,e[106]=H,e[107]=J,e[108]=Q,e[109]=E,e[110]=ee,e[111]=se):se=e[111];let te;e[112]!==o||e[113]!==s||e[114]!==l?(te=(0,t.jsx)(as,{expanded:o,issue:s,shardKey:l},s.sampleMessage),e[112]=o,e[113]=s,e[114]=l,e[115]=te):te=e[115];let he;return e[116]!==se||e[117]!==te?(he=(0,t.jsxs)(t.Fragment,{children:[se,te]}),e[116]=se,e[117]=te,e[118]=he):he=e[118],he},"tt"),ks=d(n=>{let e=(0,ge.c)(38),{initialShardKey:u}=n,s=ue(),$=be(),{queryShardKey:i,setShardKey:l,shardKey:a}=ze(u),[o,_]=(0,ne.useState)("all"),[A,R]=(0,ne.useState)(ns),[K,z]=(0,ne.useState)(os),k;e[0]!==o?(k=o==="all"?{}:{status:o},e[0]=o,e[1]=k):k=e[1];let T;e[2]!==i?(T={live:!0,shardKey:i},e[2]=i,e[3]=T):T=e[3];let{data:E,error:h,liveError:x}=Ce(U.getIssues,k,T),M=E!==void 0,v;if(e[4]!==K||e[5]!==A||e[6]!==$||e[7]!==E||e[8]!==h||e[9]!==x||e[10]!==M||e[11]!==i||e[12]!==l||e[13]!==a||e[14]!==o||e[15]!==s){let y=es(E),b;e[17]!==$||e[18]!==i?(b=d(async(r,oe,j)=>{z(N=>{if(!N.has(r))return N;let C=new Map(N);return C.delete(r),C}),R(N=>new Set(N).add(r));try{await $.query(oe,{...j,hash:r},Ne(i))}catch(N){let C=ke(N);z(q=>new Map(q).set(r,C))}R(N=>{let C=new Set(N);return C.delete(r),C})},"v"),e[17]=$,e[18]=i,e[19]=b):b=e[19];let w=b,m;e[20]!==s?(m=d(r=>s(r==="all"?"All":r==="open"?"Open":r==="resolved"?"Resolved":"Ignored"),"u"),e[20]=s,e[21]=m):m=e[21];let f=m,p;e[22]!==h?(p=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:h}),e[22]=h,e[23]=p):p=e[23];let c;e[24]!==l||e[25]!==a?(c=(0,t.jsx)(_e,{onChange:l,testId:"issues-shard-input",value:a}),e[24]=l,e[25]=a,e[26]=c):c=e[26];let I;e[27]!==x?(I=(0,t.jsx)(qe,{message:x,prefix:"issues"}),e[27]=x,e[28]=I):I=e[28];let g;e[29]!==o||e[30]!==f?(g=Je.map(r=>(0,t.jsx)(le,{"data-active":o===r?"":void 0,"data-testid":`issues-filter-${r}`,onClick:d(()=>{_(r)},"onClick"),size:"xs",variant:o===r?"default":"outline",children:f(r)},r)),e[29]=o,e[30]=f,e[31]=g):g=e[31];let S;e[32]!==g?(S=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:g}),e[32]=g,e[33]=S):S=e[33];let V;e[34]!==S||e[35]!==c||e[36]!==I?(V=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,I,S]}),e[34]=S,e[35]=c,e[36]=I,e[37]=V):V=e[37],v=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,V,M&&y.length===0?(0,t.jsx)(Ee,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Ke,{className:"overflow-hidden py-0",children:(0,t.jsx)(Te,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(Re,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(B,{children:s("Issue")}),(0,t.jsx)(B,{children:s("Status")}),(0,t.jsx)(B,{children:s("Severity")}),(0,t.jsx)(B,{children:s("Assignee")}),(0,t.jsx)(B,{className:"text-right",children:s("Events")}),(0,t.jsx)(B,{children:s("Last seen")}),(0,t.jsx)(B,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Ve,{children:y.map(r=>(0,t.jsx)(is,{busy:A.has(r.hash),issue:r,rowError:K.get(r.hash),runTriage:w,shardKey:i},r.hash))})]})})})]}),e[4]=K,e[5]=A,e[6]=$,e[7]=E,e[8]=h,e[9]=x,e[10]=M,e[11]=i,e[12]=l,e[13]=a,e[14]=o,e[15]=s,e[16]=v}else v=e[16];return v},"Tt");function rs(n){return!n}d(rs,"st");function ls(n){return(0,t.jsx)(we,{value:n,children:n},n)}d(ls,"at");function ns(){return new Set}d(ns,"it");function os(){return new Map}d(os,"lt");export{ks as default};
@@ -1 +1 @@
1
- import{c as u}from"./chunk-JMZT3CEW.js";import{j as c}from"./chunk-YUVGMKHG.js";import{a as l}from"./chunk-ZPQBVYNN.js";import{x as d}from"./chunk-PUK3H4RN.js";import{a as h,b as z}from"./chunk-6G3E4PJ2.js";import{a as t,d as o}from"./chunk-5PEAXTYQ.js";var p=o(h(),1);var a=p.forwardRef(t(function(e,r){let{render:n,className:k,disabled:s=!1,focusableWhenDisabled:g=!1,nativeButton:f=!0,style:B,...b}=e,{getButtonProps:m,buttonRef:x}=u({disabled:s,focusableWhenDisabled:g,native:f});return c("button",e,{state:{disabled:s},ref:[r,x],props:[b,m]})},"Button"));var v=o(z(),1);var y=l("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function W({className:i,variant:e="default",size:r="default",...n}){return(0,v.jsx)(a,{"data-slot":"button",className:d(y({variant:e,size:r,className:i})),...n})}t(W,"v");export{W as a};
1
+ import{c as u}from"./chunk-SCTYLLJT.js";import{j as c}from"./chunk-L27FKJTG.js";import{a as l}from"./chunk-ZPQBVYNN.js";import{x as d}from"./chunk-4S7ZIMWI.js";import{a as h,b as z}from"./chunk-ADABTCDI.js";import{a as t,d as o}from"./chunk-5PEAXTYQ.js";var p=o(h(),1);var a=p.forwardRef(t(function(e,r){let{render:n,className:k,disabled:s=!1,focusableWhenDisabled:g=!1,nativeButton:f=!0,style:B,...b}=e,{getButtonProps:m,buttonRef:x}=u({disabled:s,focusableWhenDisabled:g,native:f});return c("button",e,{state:{disabled:s},ref:[r,x],props:[b,m]})},"Button"));var v=o(z(),1);var y=l("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function W({className:i,variant:e="default",size:r="default",...n}){return(0,v.jsx)(a,{"data-slot":"button",className:d(y({variant:e,size:r,className:i})),...n})}t(W,"v");export{W as a};
@@ -1 +1 @@
1
- import{a as S,b as m}from"./chunk-6G3E4PJ2.js";import{a as n,d as E}from"./chunk-5PEAXTYQ.js";function u(t,e=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,r))}n(u,"clamp");var p=1;function x(t,e){return Math.max(0,t-e)}n(x,"getMaxScrollOffset");function A(t,e){if(e<=0)return 0;let r=u(t,0,e),l=r,c=e-r,a=l<=p,i=c<=p;return a&&i?l<=c?0:e:a?0:i?e:r}n(A,"normalizeScrollOffset");var f=E(m(),1),o="base-ui-disable-scrollbar",R={className:o,getElement(t){return(0,f.jsx)("style",{nonce:t,href:o,precedence:"base-ui:low",children:`.${o}{scrollbar-width:none}.${o}::-webkit-scrollbar{display:none}`})}};var s=E(S(),1);var b=s.createContext(void 0),C={disableStyleElements:!1};function y(){return s.useContext(b)??C}n(y,"useCSPContext");export{u as a,p as b,x as c,A as d,R as e,y as f};
1
+ import{a as S,b as m}from"./chunk-ADABTCDI.js";import{a as n,d as E}from"./chunk-5PEAXTYQ.js";function u(t,e=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,r))}n(u,"clamp");var p=1;function x(t,e){return Math.max(0,t-e)}n(x,"getMaxScrollOffset");function A(t,e){if(e<=0)return 0;let r=u(t,0,e),l=r,c=e-r,a=l<=p,i=c<=p;return a&&i?l<=c?0:e:a?0:i?e:r}n(A,"normalizeScrollOffset");var f=E(m(),1),o="base-ui-disable-scrollbar",R={className:o,getElement(t){return(0,f.jsx)("style",{nonce:t,href:o,precedence:"base-ui:low",children:`.${o}{scrollbar-width:none}.${o}::-webkit-scrollbar{display:none}`})}};var s=E(S(),1);var b=s.createContext(void 0),C={disableStyleElements:!1};function y(){return s.useContext(b)??C}n(y,"useCSPContext");export{u as a,p as b,x as c,A as d,R as e,y as f};
@@ -1 +1 @@
1
- import{a as f}from"./chunk-OSHODLMU.js";import{a as h}from"./chunk-GWNGVKLG.js";import{b as N}from"./chunk-6G3E4PJ2.js";import{a as u,d as x}from"./chunk-5PEAXTYQ.js";var b=x(h(),1);var t=x(N(),1);var v=u(g=>{let e=(0,b.c)(16),{chart:c,footer:n,label:i,testId:m,value:p}=g,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==m||e[3]!==p?(a=(0,t.jsx)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":m,children:p}),e[2]=m,e[3]=p,e[4]=a):a=e[4];let s;e[5]!==c||e[6]!==a?(s=(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[5]=c,e[6]=a,e[7]=s):s=e[7];let l;e[8]!==r||e[9]!==s?(l=(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[r,s]}),e[8]=r,e[9]=s,e[10]=l):l=e[10];let o;e[11]!==n?(o=n!=null&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:n}),e[11]=n,e[12]=o):o=e[12];let d;return e[13]!==l||e[14]!==o?(d=(0,t.jsxs)(f,{className:"justify-between gap-0 py-0",children:[l,o]}),e[13]=l,e[14]=o,e[15]=d):d=e[15],d},"j");export{v as a};
1
+ import{a as f}from"./chunk-CB22PV3X.js";import{a as h}from"./chunk-A6TVTNKO.js";import{b as N}from"./chunk-ADABTCDI.js";import{a as u,d as x}from"./chunk-5PEAXTYQ.js";var b=x(h(),1);var t=x(N(),1);var v=u(g=>{let e=(0,b.c)(16),{chart:c,footer:n,label:i,testId:m,value:p}=g,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==m||e[3]!==p?(a=(0,t.jsx)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":m,children:p}),e[2]=m,e[3]=p,e[4]=a):a=e[4];let s;e[5]!==c||e[6]!==a?(s=(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[5]=c,e[6]=a,e[7]=s):s=e[7];let l;e[8]!==r||e[9]!==s?(l=(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[r,s]}),e[8]=r,e[9]=s,e[10]=l):l=e[10];let o;e[11]!==n?(o=n!=null&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:n}),e[11]=n,e[12]=o):o=e[12];let d;return e[13]!==l||e[14]!==o?(d=(0,t.jsxs)(f,{className:"justify-between gap-0 py-0",children:[l,o]}),e[13]=l,e[14]=o,e[15]=d):d=e[15],d},"j");export{v as a};
@@ -1 +1 @@
1
- import{b as i,j as a}from"./chunk-YUVGMKHG.js";import{a as o}from"./chunk-ZPQBVYNN.js";import{x as n}from"./chunk-PUK3H4RN.js";import{a as r}from"./chunk-5PEAXTYQ.js";function s(e){return a(e.defaultTagName??"div",e,e)}r(s,"useRender");var g=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function x({className:e,variant:t="default",render:d,...u}){return s({defaultTagName:"span",props:i({className:n(g({variant:t}),e)},u),render:d,state:{slot:"badge",variant:t}})}r(x,"f");export{s as a,x as b};
1
+ import{b as i,j as a}from"./chunk-L27FKJTG.js";import{a as o}from"./chunk-ZPQBVYNN.js";import{x as n}from"./chunk-4S7ZIMWI.js";import{a as r}from"./chunk-5PEAXTYQ.js";function s(e){return a(e.defaultTagName??"div",e,e)}r(s,"useRender");var g=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function x({className:e,variant:t="default",render:d,...u}){return s({defaultTagName:"span",props:i({className:n(g({variant:t}),e)},u),render:d,state:{slot:"badge",variant:t}})}r(x,"f");export{s as a,x as b};
@@ -1 +1 @@
1
- import{b as c}from"./chunk-CLQKKJHL.js";import{n as l}from"./chunk-PFPJA2HR.js";import{a as g}from"./chunk-GWNGVKLG.js";import{a as r,d as f}from"./chunk-5PEAXTYQ.js";var m=f(g(),1);var p={capabilities:{accounts:!0,admin:!0,inviteOnly:!1,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},h=r(()=>{let o=(0,m.c)(6),t=l(),a;o[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],o[0]=a):a=o[0];let e;o[1]!==t?(e=r(()=>t.getAuthConfig(),"t"),o[1]=t,o[2]=e):e=o[2];let{data:d,isLoading:u}=c(a,e),n=d??p,s=!u,i;return o[3]!==n||o[4]!==s?(i={config:n,ready:s},o[3]=n,o[4]=s,o[5]=i):i=o[5],i},"y");export{h as a};
1
+ import{b as c}from"./chunk-AKC4XWCD.js";import{n as l}from"./chunk-SAV5V3DG.js";import{a as g}from"./chunk-A6TVTNKO.js";import{a as r,d as f}from"./chunk-5PEAXTYQ.js";var m=f(g(),1);var p={capabilities:{accounts:!0,admin:!0,inviteOnly:!1,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},h=r(()=>{let o=(0,m.c)(6),t=l(),a;o[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],o[0]=a):a=o[0];let e;o[1]!==t?(e=r(()=>t.getAuthConfig(),"t"),o[1]=t,o[2]=e):e=o[2];let{data:d,isLoading:u}=c(a,e),n=d??p,s=!u,i;return o[3]!==n||o[4]!==s?(i={config:n,ready:s},o[3]=n,o[4]=s,o[5]=i):i=o[5],i},"y");export{h as a};
@@ -1,4 +1,4 @@
1
- import{a as H}from"./chunk-F5WJCL3F.js";import{a as B}from"./chunk-EYMLYHWK.js";import{b as _}from"./chunk-PUU56AIE.js";import{b as z}from"./chunk-4PI2OSSP.js";import{B as $,e as D,j as E,m as S,n as W}from"./chunk-PUK3H4RN.js";import{a as F}from"./chunk-GWNGVKLG.js";import{b as G}from"./chunk-6G3E4PJ2.js";import{a as I,d as O}from"./chunk-5PEAXTYQ.js";var M=O(F(),1);var o=O(G(),1);var ee=I(U=>{let e=(0,M.c)(51),{className:T,error:t,shardKey:j,testId:K}=U,s=$(),r=z(),v=_(),V=v!==void 0&&!v.unavailable,l,c,a,m,d,u,p,i,n,h;if(e[0]!==v||e[1]!==T||e[2]!==t||e[3]!==r||e[4]!==j||e[5]!==s||e[6]!==K){let y=S(t),w;e[17]!==t?(w=W(t),e[17]=t,e[18]=w):w=e[18],a=w;let N;e[19]!==t?(N=B(t),e[19]=t,e[20]=N):N=e[20];let q=N,A=t?.why,C;e[21]!==r||e[22]!==q?(C=I(()=>{r?.openConsole({errorsOnly:!0,seq:q})},"C"),e[21]=r,e[22]=q,e[23]=C):C=e[23],m=C,c=I(()=>{let Z=y===void 0?"":`
1
+ import{a as H}from"./chunk-KFDOGDD2.js";import{a as B}from"./chunk-UVMD7C4J.js";import{b as _}from"./chunk-FXSY2FCG.js";import{b as z}from"./chunk-EOFWXI3T.js";import{B as $,e as D,j as E,m as S,n as W}from"./chunk-4S7ZIMWI.js";import{a as F}from"./chunk-A6TVTNKO.js";import{b as G}from"./chunk-ADABTCDI.js";import{a as I,d as O}from"./chunk-5PEAXTYQ.js";var M=O(F(),1);var o=O(G(),1);var ee=I(U=>{let e=(0,M.c)(51),{className:T,error:t,shardKey:j,testId:K}=U,s=$(),r=z(),v=_(),V=v!==void 0&&!v.unavailable,l,c,a,m,d,u,p,i,n,h;if(e[0]!==v||e[1]!==T||e[2]!==t||e[3]!==r||e[4]!==j||e[5]!==s||e[6]!==K){let y=S(t),w;e[17]!==t?(w=W(t),e[17]=t,e[18]=w):w=e[18],a=w;let N;e[19]!==t?(N=B(t),e[19]=t,e[20]=N):N=e[20];let q=N,A=t?.why,C;e[21]!==r||e[22]!==q?(C=I(()=>{r?.openConsole({errorsOnly:!0,seq:q})},"C"),e[21]=r,e[22]=q,e[23]=C):C=e[23],m=C,c=I(()=>{let Z=y===void 0?"":`
2
2
 
3
3
  ${s("The studio suggested: {hint}",{hint:D(y)})}`;v?.openAssistant({ask:s(`The studio reported this error:
4
4
  {message}{detail}
@@ -1 +1 @@
1
- import{a as ne}from"./chunk-SUUBCPUD.js";import{a as A}from"./chunk-RDS46R5R.js";import{a as re}from"./chunk-645S7KRU.js";import{b as te}from"./chunk-3D67ZJRW.js";import{a as Q}from"./chunk-6YBEKVUG.js";import"./chunk-ZSWW2UGP.js";import{i as ee}from"./chunk-MWYGLPDV.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as w}from"./chunk-KBYFBEG2.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{b as j}from"./chunk-M4TCBPSY.js";import"./chunk-YUVGMKHG.js";import{a as X}from"./chunk-6A6AELDJ.js";import{c as I,d as P,n as H}from"./chunk-PFPJA2HR.js";import"./chunk-ZPQBVYNN.js";import{B as Y,g as U,h as q,j as O,p as W,s as G,w as V}from"./chunk-PUK3H4RN.js";import"./chunk-PDBW6GTJ.js";import"./chunk-GWNGVKLG.js";import{a as he,b as ge}from"./chunk-6G3E4PJ2.js";import{a as o,d as M}from"./chunk-5PEAXTYQ.js";var c=M(he(),1);var n=M(ge(),1);var be=o(t=>t.kind==="id"?t.table===void 0?"id":`id<${t.table}>`:t.kind==="array"?t.element===void 0?"array":`${t.element}[]`:t.kind,"me"),xe=o(t=>t===void 0||t.length===0?"()":`(${t.map(e=>`${e.name}${e.optional?"?":""}: ${be(e)}`).join(", ")})`,"ge"),ye=o(t=>{switch(t){case"array":return[];case"bigint":return I(0n);case"boolean":return!1;case"bytes":return I(new ArrayBuffer(0));case"number":return 0;case"object":case"record":return{};default:return""}},"be"),ve=o(t=>{let e={};for(let r of t??[])r.optional||(e[r.name]=ye(r.kind));return JSON.stringify(e,void 0,2)},"xe"),Ne=q(X.runAs),h="\xABsensitive\xBB",we=o(t=>(t??[]).filter(e=>e.sensitive===!0).map(e=>e.name),"ve"),Ae=o((t,e)=>{if(e.length===0)return t;try{let r=JSON.parse(t);if(typeof r!="object"||r===null||Array.isArray(r))return"";let l={...r};for(let i of e)Object.hasOwn(l,i)&&(l[i]=h);return JSON.stringify(l,null,2)}catch{return""}},"Ne"),Se=4,ke=o(t=>{let e=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{return}},"Ae"),$e=o(t=>Array.isArray(t)?[]:Object.keys(t).filter(e=>e.length>0),"we"),Ie=o(t=>{let e=[],r=new Set,l=[t];for(;l.length>0;){let i=l.pop();if(typeof i=="string")i.length>0&&e.push(i);else if(typeof i=="number"||typeof i=="bigint")e.push(String(i));else if(i instanceof ArrayBuffer||ArrayBuffer.isView(i)){let u=ke(i);u!==void 0&&u.length>0&&e.push(u)}else typeof i=="object"&&i!==null&&!r.has(i)&&(r.add(i),e.push(...$e(i)),l.push(...Object.values(i)))}return e},"ke"),Oe=o((t,e)=>{let r=[],l=new Set,i=[[t,e]];for(;i.length>0;){let[u,s]=i.pop()??[void 0,void 0];typeof s=="boolean"?r.push({key:u,text:s?"true":"false"}):typeof s=="object"&&s!==null&&!l.has(s)&&(l.add(s),Array.isArray(s)?i.push(...s.map(p=>[void 0,p])):i.push(...Object.entries(s)))}return r},"Re"),ae=o(t=>t.replaceAll(/[$()*+.?[\\\]^{|}]/gu,String.raw`\$&`),"P"),je=o((t,e)=>e.length>=Se?t.replaceAll(e,h):t.replaceAll(new RegExp(`(?<![A-Za-z0-9])${ae(e)}(?![A-Za-z0-9])`,"gu"),h),"Oe"),Re=o((t,e)=>{let r=t.replaceAll(`"${e.text}"`,h);if(e.key===void 0)return r;let l=ae(e.key);return r.replaceAll(new RegExp(`(?<![A-Za-z0-9_])${l}=${e.text}(?![A-Za-z0-9_])`,"gu"),`${e.key}=${h}`).replaceAll(new RegExp(String.raw`"${l}":\s*${e.text}(?![A-Za-z0-9_])`,"gu"),`"${e.key}":${h}`)},"Ie"),Ce=o((t,e,r)=>{if(r.length===0||typeof e!="object"||e===null)return t;let l=r.flatMap(s=>Oe(s,e[s])),i=r.flatMap(s=>Ie(e[s])).flatMap(s=>{let p=JSON.stringify(s).slice(1,-1);return p===s?[s]:[s,p]}).toSorted((s,p)=>p.length-s.length),u=t;for(let s of l)u=Re(u,s);for(let s of i)u=je(u,s);return u},"$e"),Te=10,Fe=o(t=>t===void 0?"undefined":JSON.stringify(t,W,2),"Ce"),ze=o((t,e)=>[{argsText:Ae(e.argsText,e.sensitive),at:Date.now(),id:(t[0]?.id??0)+1,kind:e.selected.kind,path:e.selected.path,redacted:e.sensitive.length>0,shardKey:e.shardKey,status:e.runStatus},...t].slice(0,Te),"Ee"),Ge=o(({functions:t,runAsIdentity:e=!1}={})=>{let r=Y(),l=H(),[i,u]=(0,c.useState)(null),[s,p]=(0,c.useState)(null),S=t??i??[],[R,C]=(0,c.useState)(""),[y,k]=(0,c.useState)("{}"),[g,T]=(0,c.useState)(""),[b,se]=(0,c.useState)(""),[$,x]=(0,c.useState)("idle"),[ie,v]=(0,c.useState)(void 0),[F,N]=(0,c.useState)(null),[z,oe]=(0,c.useState)([]);(0,c.useEffect)(()=>{if(t!==void 0)return;let a=!1;return l.listFunctions().then(f=>(a||u(f),f)).catch(f=>{a||p(O(f))}),()=>{a=!0}},[l,t]);let B=R===""?S[0]?.path??"":R,d=S.find(a=>a.path===B),le=o(async()=>{if(!d)return;let a;try{a=y.trim()===""?{}:P(JSON.parse(y))}catch(m){x("error"),v(void 0),N(r("Invalid JSON args: {message}",{message:m.message}));return}let f={__lunoraRef:d.path},E=g.trim()===""?{}:{shardKey:g.trim()},K=e?b.trim():"",Z=we(d.args),D=o(m=>{oe(me=>ze(me,{argsText:y,runStatus:m,selected:d,sensitive:Z,shardKey:g}))},"M");x("running"),N(null);try{let m=K===""?await U(l,d.kind,f,a,E):await l.query(Ne,{args:a,functionPath:d.path,userId:K},E);te(g),v(m),x("success"),D("success")}catch(m){v(void 0),N(Ce(O(m),a,Z)),x("error"),D("error")}},"H"),de=o(a=>{if(C(a.path),T(a.shardKey),a.redacted){v(void 0),N(r("Re-enter the sensitive values before running this again.")),x("error");return}k(a.argsText)},"G"),ue=o(a=>{C(a.target.value)},"W"),ce=o(a=>{k(a.target.value)},"X"),fe=o(a=>{se(a.target.value)},"Y"),J=o(()=>{G(le())},"j"),L=e?b.trim():"",_=$==="running"||d===void 0,pe=o(()=>{k(ve(d?.args))},"_");return(0,n.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[s!==null&&(0,n.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:s}),(0,n.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)(A,{htmlFor:"function-select",children:r("Function")}),(0,n.jsx)("select",{"aria-label":r("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:ue,value:B,children:S.map(a=>(0,n.jsxs)("option",{value:a.path,children:[a.path," (",a.kind,")"]},a.path))}),d!==void 0&&(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,n.jsx)("span",{className:"mr-1.5 font-medium",children:r("Signature")}),(0,n.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:xe(d.args)})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)(A,{htmlFor:"args-input",children:r("Arguments")}),(0,n.jsx)(w,{"data-testid":"prefill-button",disabled:d===void 0,onClick:pe,size:"xs",type:"button",variant:"ghost",children:r("Prefill")})]}),(0,n.jsx)(ne,{"aria-label":r("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:ce,value:y})]}),(0,n.jsx)(re,{onChange:T,testId:"shard-input",value:g}),e&&(0,n.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,n.jsx)(A,{htmlFor:"run-as-input",children:r("Run as identity (userId)")}),(0,n.jsx)(ee,{"aria-label":r("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:fe,placeholder:r("Leave empty to run as admin"),value:b}),(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground",children:r("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[L!==""&&d!==void 0&&d.kind!=="query"?(0,n.jsx)(Q,{confirmLabel:r("This will execute `{functionPath}` as user `{userId}`.",{functionPath:d.path,userId:L}),disabled:_,onConfirm:J,testId:"run-button",children:r("Run")}):(0,n.jsx)(w,{"data-testid":"run-button",disabled:_,onClick:J,type:"button",children:r("Run")}),d!==void 0&&(0,n.jsx)(j,{variant:"outline",children:d.kind}),e&&b.trim()!==""&&(0,n.jsx)(j,{"data-testid":"run-as-badge",variant:"secondary",children:r("as {userId}",{userId:b.trim()})})]})]}),$==="error"&&F!==null&&(0,n.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:F}),$==="success"&&(0,n.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:Fe(ie)}),z.length>0&&(0,n.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:z.map((a,f)=>(0,n.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,n.jsx)("span",{className:a.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${f.toString()}`,children:a.status==="success"?"\u2713":"\u2717"})," ",(0,n.jsxs)("span",{className:"font-mono text-xs",children:[a.path," (",a.kind,")"]})," ",(0,n.jsx)("time",{className:"text-xs text-muted-foreground",children:V(a.at)})," ",(0,n.jsx)(w,{className:"ml-auto","data-testid":`fn-history-load-${f.toString()}`,onClick:o(()=>{de(a)},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Load")})]},a.id))})]})},"Ge");export{Ge as FunctionRunner};
1
+ import{a as ne}from"./chunk-77PKR3WU.js";import{a as A}from"./chunk-FOURRGSO.js";import{a as re}from"./chunk-5G2OOLMF.js";import{b as te}from"./chunk-EDL46BPM.js";import{a as Q}from"./chunk-V4D77Q45.js";import"./chunk-4KPATTV6.js";import{i as ee}from"./chunk-A5INOAIL.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as w}from"./chunk-SZCXVIVT.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{b as j}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{a as X}from"./chunk-LYVYUTQY.js";import{c as I,d as P,n as H}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as Y,g as U,h as q,j as O,p as W,s as G,w as V}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import"./chunk-A6TVTNKO.js";import{a as he,b as ge}from"./chunk-ADABTCDI.js";import{a as o,d as M}from"./chunk-5PEAXTYQ.js";var c=M(he(),1);var n=M(ge(),1);var be=o(t=>t.kind==="id"?t.table===void 0?"id":`id<${t.table}>`:t.kind==="array"?t.element===void 0?"array":`${t.element}[]`:t.kind,"me"),xe=o(t=>t===void 0||t.length===0?"()":`(${t.map(e=>`${e.name}${e.optional?"?":""}: ${be(e)}`).join(", ")})`,"ge"),ye=o(t=>{switch(t){case"array":return[];case"bigint":return I(0n);case"boolean":return!1;case"bytes":return I(new ArrayBuffer(0));case"number":return 0;case"object":case"record":return{};default:return""}},"be"),ve=o(t=>{let e={};for(let r of t??[])r.optional||(e[r.name]=ye(r.kind));return JSON.stringify(e,void 0,2)},"xe"),Ne=q(X.runAs),h="\xABsensitive\xBB",we=o(t=>(t??[]).filter(e=>e.sensitive===!0).map(e=>e.name),"ve"),Ae=o((t,e)=>{if(e.length===0)return t;try{let r=JSON.parse(t);if(typeof r!="object"||r===null||Array.isArray(r))return"";let l={...r};for(let i of e)Object.hasOwn(l,i)&&(l[i]=h);return JSON.stringify(l,null,2)}catch{return""}},"Ne"),Se=4,ke=o(t=>{let e=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{return}},"Ae"),$e=o(t=>Array.isArray(t)?[]:Object.keys(t).filter(e=>e.length>0),"we"),Ie=o(t=>{let e=[],r=new Set,l=[t];for(;l.length>0;){let i=l.pop();if(typeof i=="string")i.length>0&&e.push(i);else if(typeof i=="number"||typeof i=="bigint")e.push(String(i));else if(i instanceof ArrayBuffer||ArrayBuffer.isView(i)){let u=ke(i);u!==void 0&&u.length>0&&e.push(u)}else typeof i=="object"&&i!==null&&!r.has(i)&&(r.add(i),e.push(...$e(i)),l.push(...Object.values(i)))}return e},"ke"),Oe=o((t,e)=>{let r=[],l=new Set,i=[[t,e]];for(;i.length>0;){let[u,s]=i.pop()??[void 0,void 0];typeof s=="boolean"?r.push({key:u,text:s?"true":"false"}):typeof s=="object"&&s!==null&&!l.has(s)&&(l.add(s),Array.isArray(s)?i.push(...s.map(p=>[void 0,p])):i.push(...Object.entries(s)))}return r},"Re"),ae=o(t=>t.replaceAll(/[$()*+.?[\\\]^{|}]/gu,String.raw`\$&`),"P"),je=o((t,e)=>e.length>=Se?t.replaceAll(e,h):t.replaceAll(new RegExp(`(?<![A-Za-z0-9])${ae(e)}(?![A-Za-z0-9])`,"gu"),h),"Oe"),Re=o((t,e)=>{let r=t.replaceAll(`"${e.text}"`,h);if(e.key===void 0)return r;let l=ae(e.key);return r.replaceAll(new RegExp(`(?<![A-Za-z0-9_])${l}=${e.text}(?![A-Za-z0-9_])`,"gu"),`${e.key}=${h}`).replaceAll(new RegExp(String.raw`"${l}":\s*${e.text}(?![A-Za-z0-9_])`,"gu"),`"${e.key}":${h}`)},"Ie"),Ce=o((t,e,r)=>{if(r.length===0||typeof e!="object"||e===null)return t;let l=r.flatMap(s=>Oe(s,e[s])),i=r.flatMap(s=>Ie(e[s])).flatMap(s=>{let p=JSON.stringify(s).slice(1,-1);return p===s?[s]:[s,p]}).toSorted((s,p)=>p.length-s.length),u=t;for(let s of l)u=Re(u,s);for(let s of i)u=je(u,s);return u},"$e"),Te=10,Fe=o(t=>t===void 0?"undefined":JSON.stringify(t,W,2),"Ce"),ze=o((t,e)=>[{argsText:Ae(e.argsText,e.sensitive),at:Date.now(),id:(t[0]?.id??0)+1,kind:e.selected.kind,path:e.selected.path,redacted:e.sensitive.length>0,shardKey:e.shardKey,status:e.runStatus},...t].slice(0,Te),"Ee"),Ge=o(({functions:t,runAsIdentity:e=!1}={})=>{let r=Y(),l=H(),[i,u]=(0,c.useState)(null),[s,p]=(0,c.useState)(null),S=t??i??[],[R,C]=(0,c.useState)(""),[y,k]=(0,c.useState)("{}"),[g,T]=(0,c.useState)(""),[b,se]=(0,c.useState)(""),[$,x]=(0,c.useState)("idle"),[ie,v]=(0,c.useState)(void 0),[F,N]=(0,c.useState)(null),[z,oe]=(0,c.useState)([]);(0,c.useEffect)(()=>{if(t!==void 0)return;let a=!1;return l.listFunctions().then(f=>(a||u(f),f)).catch(f=>{a||p(O(f))}),()=>{a=!0}},[l,t]);let B=R===""?S[0]?.path??"":R,d=S.find(a=>a.path===B),le=o(async()=>{if(!d)return;let a;try{a=y.trim()===""?{}:P(JSON.parse(y))}catch(m){x("error"),v(void 0),N(r("Invalid JSON args: {message}",{message:m.message}));return}let f={__lunoraRef:d.path},E=g.trim()===""?{}:{shardKey:g.trim()},K=e?b.trim():"",Z=we(d.args),D=o(m=>{oe(me=>ze(me,{argsText:y,runStatus:m,selected:d,sensitive:Z,shardKey:g}))},"M");x("running"),N(null);try{let m=K===""?await U(l,d.kind,f,a,E):await l.query(Ne,{args:a,functionPath:d.path,userId:K},E);te(g),v(m),x("success"),D("success")}catch(m){v(void 0),N(Ce(O(m),a,Z)),x("error"),D("error")}},"H"),de=o(a=>{if(C(a.path),T(a.shardKey),a.redacted){v(void 0),N(r("Re-enter the sensitive values before running this again.")),x("error");return}k(a.argsText)},"G"),ue=o(a=>{C(a.target.value)},"W"),ce=o(a=>{k(a.target.value)},"X"),fe=o(a=>{se(a.target.value)},"Y"),J=o(()=>{G(le())},"j"),L=e?b.trim():"",_=$==="running"||d===void 0,pe=o(()=>{k(ve(d?.args))},"_");return(0,n.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[s!==null&&(0,n.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:s}),(0,n.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)(A,{htmlFor:"function-select",children:r("Function")}),(0,n.jsx)("select",{"aria-label":r("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:ue,value:B,children:S.map(a=>(0,n.jsxs)("option",{value:a.path,children:[a.path," (",a.kind,")"]},a.path))}),d!==void 0&&(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,n.jsx)("span",{className:"mr-1.5 font-medium",children:r("Signature")}),(0,n.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:xe(d.args)})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)(A,{htmlFor:"args-input",children:r("Arguments")}),(0,n.jsx)(w,{"data-testid":"prefill-button",disabled:d===void 0,onClick:pe,size:"xs",type:"button",variant:"ghost",children:r("Prefill")})]}),(0,n.jsx)(ne,{"aria-label":r("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:ce,value:y})]}),(0,n.jsx)(re,{onChange:T,testId:"shard-input",value:g}),e&&(0,n.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,n.jsx)(A,{htmlFor:"run-as-input",children:r("Run as identity (userId)")}),(0,n.jsx)(ee,{"aria-label":r("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:fe,placeholder:r("Leave empty to run as admin"),value:b}),(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground",children:r("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[L!==""&&d!==void 0&&d.kind!=="query"?(0,n.jsx)(Q,{confirmLabel:r("This will execute `{functionPath}` as user `{userId}`.",{functionPath:d.path,userId:L}),disabled:_,onConfirm:J,testId:"run-button",children:r("Run")}):(0,n.jsx)(w,{"data-testid":"run-button",disabled:_,onClick:J,type:"button",children:r("Run")}),d!==void 0&&(0,n.jsx)(j,{variant:"outline",children:d.kind}),e&&b.trim()!==""&&(0,n.jsx)(j,{"data-testid":"run-as-badge",variant:"secondary",children:r("as {userId}",{userId:b.trim()})})]})]}),$==="error"&&F!==null&&(0,n.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:F}),$==="success"&&(0,n.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:Fe(ie)}),z.length>0&&(0,n.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:z.map((a,f)=>(0,n.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,n.jsx)("span",{className:a.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${f.toString()}`,children:a.status==="success"?"\u2713":"\u2717"})," ",(0,n.jsxs)("span",{className:"font-mono text-xs",children:[a.path," (",a.kind,")"]})," ",(0,n.jsx)("time",{className:"text-xs text-muted-foreground",children:V(a.at)})," ",(0,n.jsx)(w,{className:"ml-auto","data-testid":`fn-history-load-${f.toString()}`,onClick:o(()=>{de(a)},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Load")})]},a.id))})]})},"Ge");export{Ge as FunctionRunner};
@@ -1,3 +1,3 @@
1
- import{a as at}from"./chunk-DA2CAFXI.js";import{i as Ee}from"./chunk-RTS5G3ET.js";import{a as We}from"./chunk-KBYFBEG2.js";import{a as nt}from"./chunk-FWOOA2ZR.js";import{b as Fe}from"./chunk-M4TCBPSY.js";import{a as D}from"./chunk-6A6AELDJ.js";import{c as _e}from"./chunk-CLQKKJHL.js";import{a as j,e as Ue}from"./chunk-OSHODLMU.js";import{n as Te}from"./chunk-PFPJA2HR.js";import{B as $,h as Ze,i as Qe,o as Xe,s as Ne,u as et,v as tt,x as Ve}from"./chunk-PUK3H4RN.js";import{a as mt}from"./chunk-GWNGVKLG.js";import{a as dt,b as ut}from"./chunk-6G3E4PJ2.js";import{a as c,d as ze}from"./chunk-5PEAXTYQ.js";var _=ze(mt(),1);var B=ze(dt(),1);var a=ze(ut(),1);var pt=Ze(D.studioFeatures),Ge={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},ft=c(t=>{if(t===null||typeof t!="object")return;let{id:e,name:r,unsupported:n}=t;if(!(typeof e!="string"||typeof r!="string"||!Array.isArray(n)))return{id:e,name:r,unsupported:n.filter(s=>typeof s=="string")}},"ut"),ht=c(t=>{if(t===null||typeof t!="object")return Ge;let e=t,r=c(n=>typeof e[n]=="boolean"?e[n]:!0,"n");return{analytics:r("analytics"),auth:r("auth"),containers:r("containers"),flags:r("flags"),kv:r("kv"),mail:r("mail"),notifications:r("notifications"),payments:r("payments"),privacy:r("privacy"),platform:ft(e.platform),queues:r("queues"),scheduler:r("scheduler"),storage:r("storage"),vectors:r("vectors"),workflows:r("workflows")}},"mt"),gt={...Ge,settled:!1},xt=c(()=>{let t=(0,_.c)(3),e=Te(),[r,n]=(0,B.useState)(void 0),s,l;return t[0]!==e?(s=c(()=>{let i=new AbortController;return Ne((async()=>{let o;try{o={...ht(await e.query(pt,{},Qe(""))),settled:!0}}catch{o={...Ge,settled:!0}}i.signal.aborted||n({client:e,features:o})})()),()=>{i.abort()}},"l"),l=[e],t[0]=e,t[1]=s,t[2]=l):(s=t[1],l=t[2]),(0,B.useEffect)(s,l),r?.client===e?r.features:gt},"pt"),bt=c(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},"ht"),yt=c(t=>{let e=(0,_.c)(24),{group:r}=t,n=$(),s=Ee(),l;e[0]!==r.tab||e[1]!==s?(l=c(()=>{Ne(s({to:`/${r.tab}`}))},"r"),e[0]=r.tab,e[1]=s,e[2]=l):l=e[2];let i=l,o=r.bindings.length,d;e[3]!==r.label?(d=(0,a.jsx)("span",{className:"text-sm font-medium text-foreground",children:r.label}),e[3]=r.label,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)(bt,{}),e[5]=u):u=e[5];let p;e[6]!==d?(p=(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[d,u]}),e[6]=d,e[7]=p):p=e[7];let m;e[8]!==o||e[9]!==n?(m=o===1?n("1 binding"):n("{count} bindings",{count:o}),e[8]=o,e[9]=n,e[10]=m):m=e[10];let f;e[11]!==m?(f=(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:m}),e[11]=m,e[12]=f):f=e[12];let h;e[13]!==o||e[14]!==r.bindings?(h=o>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.bindings.map(_t)}),e[13]=o,e[14]=r.bindings,e[15]=h):h=e[15];let g;e[16]!==p||e[17]!==f||e[18]!==h?(g=(0,a.jsxs)(Ue,{className:"flex flex-col gap-2 py-4",children:[p,f,h]}),e[16]=p,e[17]=f,e[18]=h,e[19]=g):g=e[19];let x;return e[20]!==r.testId||e[21]!==i||e[22]!==g?(x=(0,a.jsx)(j,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":r.testId,onClick:i,children:g}),e[20]=r.testId,e[21]=i,e[22]=g,e[23]=x):x=e[23],x},"gt"),rt=["kv","files","vectors"],vt=c((t,e)=>[...t.filter(r=>r.tab!==e.tab),e].toSorted((r,n)=>rt.indexOf(r.tab)-rt.indexOf(n.tab)),"xt"),Nt=c(()=>{let t=(0,_.c)(19),e=Te(),r=xt(),n=$(),s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0];let[l,i]=(0,B.useState)(s),o,d;if(t[1]!==e||t[2]!==r.kv||t[3]!==r.storage||t[4]!==r.vectors||t[5]!==n?(o=c(()=>{let g={cancelled:!1},x=[{enabled:r.kv,label:n("KV Namespaces"),load:c(async()=>(await e.listKvNamespaces()).map(wt),"load"),tab:"kv",testId:"home-binding-kv"},{enabled:r.storage,label:n("R2 Buckets"),load:c(()=>e.listStorageBuckets(),"load"),tab:"files",testId:"home-binding-r2"},{enabled:r.vectors,label:n("Vectorize Indexes"),load:c(async()=>(await e.listVectorIndexes()).map(kt),"load"),tab:"vectors",testId:"home-binding-vectors"}];for(let b of x)b.enabled&&Ne((async()=>{try{let v=await b.load();if(!g.cancelled){let w={bindings:v,label:b.label,tab:b.tab,testId:b.testId};i(k=>vt(k,w))}}catch{}})());return()=>{g.cancelled=!0}},"o"),d=[e,r.kv,r.storage,r.vectors,n],t[1]=e,t[2]=r.kv,t[3]=r.storage,t[4]=r.vectors,t[5]=n,t[6]=o,t[7]=d):(o=t[6],d=t[7]),(0,B.useEffect)(o,d),l.length===0)return null;let u;t[8]!==n?(u=n("Bindings"),t[8]=n,t[9]=u):u=t[9];let p;t[10]!==u?(p=(0,a.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:u}),t[10]=u,t[11]=p):p=t[11];let m;t[12]!==l?(m=l.map(St),t[12]=l,t[13]=m):m=t[13];let f;t[14]!==m?(f=(0,a.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:m}),t[14]=m,t[15]=f):f=t[15];let h;return t[16]!==p||t[17]!==f?(h=(0,a.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[p,f]}),t[16]=p,t[17]=f,t[18]=h):h=t[18],h},"bt");function _t(t){return(0,a.jsx)(Fe,{variant:"secondary",children:t},t)}c(_t,"yt");function wt(t){return t.binding}c(wt,"vt");function kt(t){return t.name}c(kt,"Nt");function St(t){return(0,a.jsx)(yt,{group:t},t.tab)}c(St,"_t");var Mt=[{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 \u2014 writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action \u2014 writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],At=c(t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),"wt"),Ct=c(t=>{let e=Mt.map(r=>`- ${r.name} \u2014 ${r.summary}`).join(`
1
+ import{a as at}from"./chunk-DA2CAFXI.js";import{i as Ee}from"./chunk-7WGZSDRS.js";import{a as We}from"./chunk-SZCXVIVT.js";import{a as nt}from"./chunk-X26D3KTK.js";import{b as Fe}from"./chunk-TRJMN2YI.js";import{a as D}from"./chunk-LYVYUTQY.js";import{c as _e}from"./chunk-AKC4XWCD.js";import{a as j,e as Ue}from"./chunk-CB22PV3X.js";import{n as Te}from"./chunk-SAV5V3DG.js";import{B as $,h as Ze,i as Qe,o as Xe,s as Ne,u as et,v as tt,x as Ve}from"./chunk-4S7ZIMWI.js";import{a as mt}from"./chunk-A6TVTNKO.js";import{a as dt,b as ut}from"./chunk-ADABTCDI.js";import{a as c,d as ze}from"./chunk-5PEAXTYQ.js";var _=ze(mt(),1);var B=ze(dt(),1);var a=ze(ut(),1);var pt=Ze(D.studioFeatures),Ge={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},ft=c(t=>{if(t===null||typeof t!="object")return;let{id:e,name:r,unsupported:n}=t;if(!(typeof e!="string"||typeof r!="string"||!Array.isArray(n)))return{id:e,name:r,unsupported:n.filter(s=>typeof s=="string")}},"ut"),ht=c(t=>{if(t===null||typeof t!="object")return Ge;let e=t,r=c(n=>typeof e[n]=="boolean"?e[n]:!0,"n");return{analytics:r("analytics"),auth:r("auth"),containers:r("containers"),flags:r("flags"),kv:r("kv"),mail:r("mail"),notifications:r("notifications"),payments:r("payments"),privacy:r("privacy"),platform:ft(e.platform),queues:r("queues"),scheduler:r("scheduler"),storage:r("storage"),vectors:r("vectors"),workflows:r("workflows")}},"mt"),gt={...Ge,settled:!1},xt=c(()=>{let t=(0,_.c)(3),e=Te(),[r,n]=(0,B.useState)(void 0),s,l;return t[0]!==e?(s=c(()=>{let i=new AbortController;return Ne((async()=>{let o;try{o={...ht(await e.query(pt,{},Qe(""))),settled:!0}}catch{o={...Ge,settled:!0}}i.signal.aborted||n({client:e,features:o})})()),()=>{i.abort()}},"l"),l=[e],t[0]=e,t[1]=s,t[2]=l):(s=t[1],l=t[2]),(0,B.useEffect)(s,l),r?.client===e?r.features:gt},"pt"),bt=c(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},"ht"),yt=c(t=>{let e=(0,_.c)(24),{group:r}=t,n=$(),s=Ee(),l;e[0]!==r.tab||e[1]!==s?(l=c(()=>{Ne(s({to:`/${r.tab}`}))},"r"),e[0]=r.tab,e[1]=s,e[2]=l):l=e[2];let i=l,o=r.bindings.length,d;e[3]!==r.label?(d=(0,a.jsx)("span",{className:"text-sm font-medium text-foreground",children:r.label}),e[3]=r.label,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)(bt,{}),e[5]=u):u=e[5];let p;e[6]!==d?(p=(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[d,u]}),e[6]=d,e[7]=p):p=e[7];let m;e[8]!==o||e[9]!==n?(m=o===1?n("1 binding"):n("{count} bindings",{count:o}),e[8]=o,e[9]=n,e[10]=m):m=e[10];let f;e[11]!==m?(f=(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:m}),e[11]=m,e[12]=f):f=e[12];let h;e[13]!==o||e[14]!==r.bindings?(h=o>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.bindings.map(_t)}),e[13]=o,e[14]=r.bindings,e[15]=h):h=e[15];let g;e[16]!==p||e[17]!==f||e[18]!==h?(g=(0,a.jsxs)(Ue,{className:"flex flex-col gap-2 py-4",children:[p,f,h]}),e[16]=p,e[17]=f,e[18]=h,e[19]=g):g=e[19];let x;return e[20]!==r.testId||e[21]!==i||e[22]!==g?(x=(0,a.jsx)(j,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":r.testId,onClick:i,children:g}),e[20]=r.testId,e[21]=i,e[22]=g,e[23]=x):x=e[23],x},"gt"),rt=["kv","files","vectors"],vt=c((t,e)=>[...t.filter(r=>r.tab!==e.tab),e].toSorted((r,n)=>rt.indexOf(r.tab)-rt.indexOf(n.tab)),"xt"),Nt=c(()=>{let t=(0,_.c)(19),e=Te(),r=xt(),n=$(),s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0];let[l,i]=(0,B.useState)(s),o,d;if(t[1]!==e||t[2]!==r.kv||t[3]!==r.storage||t[4]!==r.vectors||t[5]!==n?(o=c(()=>{let g={cancelled:!1},x=[{enabled:r.kv,label:n("KV Namespaces"),load:c(async()=>(await e.listKvNamespaces()).map(wt),"load"),tab:"kv",testId:"home-binding-kv"},{enabled:r.storage,label:n("R2 Buckets"),load:c(()=>e.listStorageBuckets(),"load"),tab:"files",testId:"home-binding-r2"},{enabled:r.vectors,label:n("Vectorize Indexes"),load:c(async()=>(await e.listVectorIndexes()).map(kt),"load"),tab:"vectors",testId:"home-binding-vectors"}];for(let b of x)b.enabled&&Ne((async()=>{try{let v=await b.load();if(!g.cancelled){let w={bindings:v,label:b.label,tab:b.tab,testId:b.testId};i(k=>vt(k,w))}}catch{}})());return()=>{g.cancelled=!0}},"o"),d=[e,r.kv,r.storage,r.vectors,n],t[1]=e,t[2]=r.kv,t[3]=r.storage,t[4]=r.vectors,t[5]=n,t[6]=o,t[7]=d):(o=t[6],d=t[7]),(0,B.useEffect)(o,d),l.length===0)return null;let u;t[8]!==n?(u=n("Bindings"),t[8]=n,t[9]=u):u=t[9];let p;t[10]!==u?(p=(0,a.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:u}),t[10]=u,t[11]=p):p=t[11];let m;t[12]!==l?(m=l.map(St),t[12]=l,t[13]=m):m=t[13];let f;t[14]!==m?(f=(0,a.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:m}),t[14]=m,t[15]=f):f=t[15];let h;return t[16]!==p||t[17]!==f?(h=(0,a.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[p,f]}),t[16]=p,t[17]=f,t[18]=h):h=t[18],h},"bt");function _t(t){return(0,a.jsx)(Fe,{variant:"secondary",children:t},t)}c(_t,"yt");function wt(t){return t.binding}c(wt,"vt");function kt(t){return t.name}c(kt,"Nt");function St(t){return(0,a.jsx)(yt,{group:t},t.tab)}c(St,"_t");var Mt=[{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 \u2014 writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action \u2014 writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],At=c(t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),"wt"),Ct=c(t=>{let e=Mt.map(r=>`- ${r.name} \u2014 ${r.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
  `)},"kt"),It=1500,Lt=c(()=>{let t=(0,_.c)(40),e=$(),{url:r}=Te(),n;t[0]!==r?(n=et(r),t[0]=r,t[1]=n):n=t[1];let s=n,[l,i]=(0,B.useState)(null),o,d;t[2]!==l?(o=c(()=>{if(l===null)return;let L=globalThis.setTimeout(()=>{i(null)},It);return()=>{globalThis.clearTimeout(L)}},"o"),d=[l],t[2]=l,t[3]=o,t[4]=d):(o=t[3],d=t[4]),(0,B.useEffect)(o,d);let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=c((L,T)=>{tt(T)&&i(L)},"u"),t[5]=u):u=t[5];let p=u,m;t[6]!==s?(m=c(()=>{p("config",At(s))},"d"),t[6]=s,t[7]=m):m=t[7];let f=m,h;t[8]!==s?(h=c(()=>{p("prompt",Ct(s))},"p"),t[8]=s,t[9]=h):h=t[9];let g=h,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=(0,a.jsx)("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 \u2014 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 w;t[16]!==v?(w=(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:v}),t[16]=v,t[17]=w):w=t[17];let k;t[18]!==b||t[19]!==w?(k=(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 p-4",children:[b,w]}),t[18]=b,t[19]=w,t[20]=k):k=t[20];let I;t[21]===Symbol.for("react.memo_cache_sentinel")?(I=(0,a.jsx)("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[21]=I):I=t[21];let y;t[22]!==l||t[23]!==e?(y=e(l==="config"?"Copied":"Copy MCP config"),t[22]=l,t[23]=e,t[24]=y):y=t[24];let S;t[25]!==f||t[26]!==y?(S=(0,a.jsx)(We,{"data-testid":"home-connect-agent-copy-config",onClick:f,size:"xs",variant:"outline",children:y}),t[25]=f,t[26]=y,t[27]=S):S=t[27];let M;t[28]!==l||t[29]!==e?(M=e(l==="prompt"?"Copied":"Copy agent prompt"),t[28]=l,t[29]=e,t[30]=M):M=t[30];let A;t[31]!==g||t[32]!==M?(A=(0,a.jsx)(We,{"data-testid":"home-connect-agent-copy-prompt",onClick:g,size:"xs",variant:"outline",children:M}),t[31]=g,t[32]=M,t[33]=A):A=t[33];let N;t[34]!==S||t[35]!==A?(N=(0,a.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[I,(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[S,A]})]}),t[34]=S,t[35]=A,t[36]=N):N=t[36];let C;return t[37]!==k||t[38]!==N?(C=(0,a.jsxs)(j,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[k,N]}),t[37]=k,t[38]=N,t[39]=C):C=t[39],C},"At"),$t=112,st=32,Oe=5,lt=1,jt=3,Tt=c(t=>{let e=t.slice(-16),r=Math.max(0,...e),n=st-Oe*2,s=($t-Oe*2)/e.length;return e.map((l,i)=>{let o=r>0?Math.max(0,l)/r*n:0;return{height:Math.max(0,o-jt),width:Math.max(0,s-lt*2),x:Oe+i*s+lt,y:st-Oe-o}})},"It"),Ot=c(t=>{let e=(0,_.c)(4),{data:r}=t,n;e[0]!==r?(n=Tt(r).map(qt),e[0]=r,e[1]=n):n=e[1];let s;return e[2]!==n?(s=(0,a.jsx)("svg",{"aria-hidden":"true",className:"h-8 w-28 fill-foreground","data-testid":"home-sparkline",viewBox:"0 0 112 32",children:n}),e[2]=n,e[3]=s):s=e[3],s},"Tt");function qt(t){return(0,a.jsx)("rect",{height:t.height,rx:2,width:t.width,x:t.x,y:t.y},t.x)}c(qt,"Lt");var Rt=3,Kt=c((t,e)=>{if(e==null)return t("cache not enabled");let r=e.hits+e.misses;return r===0?t("no cache traffic yet"):`${Math.round(e.hits/r*100).toString()}% ${t("cache hit")}`},"Rt"),Je=c(t=>{if(t<1e3)return`${String(Math.round(t))}ms`;let e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},"Fe"),Bt=c((t,e)=>{let r=Math.max(0,Math.round((e-t)/1e3));if(r<60)return`${String(r)}s ago`;let n=Math.round(r/60);if(n<60)return`${String(n)}m ago`;let s=Math.round(n/60);return s<24?`${String(s)}h ago`:`${String(Math.round(s/24))}d ago`},"Et"),ot=c((t,e)=>{if(t===void 0||t.length===0)return[];let r=new Map;for(let n of t)r.set(n.bucketMs,(r.get(n.bucketMs)??0)+n[e]);return[...r.entries()].toSorted(([n],[s])=>n-s).map(([,n])=>n)},"Je"),it=c((t,e=!0)=>{if(t.length<4)return null;let r=Math.floor(t.length/2),n=t.slice(0,r).reduce((i,o)=>i+o,0),s=t.slice(r).reduce((i,o)=>i+o,0);if(n===0)return null;let l=(s-n)/n*100;return{positive:e?l>=0:l<=0,text:`${l>=0?"+":""}${l.toFixed(1)}%`}},"Ye"),qe=c(t=>{let e=(0,_.c)(24),{delta:r,footer:n,label:s,trend:l,unit:i,value:o}=t,d=$(),u;e[0]!==s?(u=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s}),e[0]=s,e[1]=u):u=e[1];let p;e[2]!==o?(p=(0,a.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[2]=o,e[3]=p):p=e[3];let m;e[4]!==i?(m=i!==void 0&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:i}),e[4]=i,e[5]=m):m=e[5];let f;e[6]!==p||e[7]!==m?(f=(0,a.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[p,m]}),e[6]=p,e[7]=m,e[8]=f):f=e[8];let h;e[9]!==l?(h=l!==void 0&&l.length>=Rt&&(0,a.jsx)(Ot,{data:l}),e[9]=l,e[10]=h):h=e[10];let g;e[11]!==f||e[12]!==h?(g=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[f,h]}),e[11]=f,e[12]=h,e[13]=g):g=e[13];let x;e[14]!==u||e[15]!==g?(x=(0,a.jsxs)("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]!==r||e[18]!==n||e[19]!==d?(b=r==null?n!=null&&(0,a.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:n}):(0,a.jsxs)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[(0,a.jsx)("span",{className:Ve("font-semibold",r.positive?"text-success":"text-destructive"),children:r.text})," ",(0,a.jsx)("span",{className:"text-muted-foreground",children:d("vs. prev.")})]}),e[17]=r,e[18]=n,e[19]=d,e[20]=b):b=e[20];let v;return e[21]!==x||e[22]!==b?(v=(0,a.jsxs)(j,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=v):v=e[23],v},"Oe"),Dt=c(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("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:(0,a.jsx)("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},"Bt"),He=c(t=>{let e=(0,_.c)(7),{command:r,label:n}=t,s;e[0]!==n?(s=(0,a.jsx)("div",{className:"p-4",children:(0,a.jsx)("span",{className:"text-sm font-medium text-foreground",children:n})}),e[0]=n,e[1]=s):s=e[1];let l;e[2]!==r?(l=(0,a.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:(0,a.jsx)("code",{className:"font-mono text-xs text-muted-foreground",children:r})}),e[2]=r,e[3]=l):l=e[3];let i;return e[4]!==s||e[5]!==l?(i=(0,a.jsxs)(j,{className:"justify-between gap-0 py-0",children:[s,l]}),e[4]=s,e[5]=l,e[6]=i):i=e[6],i},"je"),ct=c(t=>{let e=(0,_.c)(18),{count:r,onView:n,testId:s,title:l}=t,i=$(),o;e[0]!==l?(o=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==r||e[3]!==i?(d=r===null?(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:i("No data yet")}):(0,a.jsx)(Fe,{variant:r>0?"destructive":"success",children:r>0?r:i("All clear")}),e[2]=r,e[3]=i,e[4]=d):d=e[4];let u;e[5]!==o||e[6]!==d?(u=(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2 p-4",children:[o,d]}),e[5]=o,e[6]=d,e[7]=u):u=e[7];let p;e[8]!==i?(p=i("View"),e[8]=i,e[9]=p):p=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(Dt,{}),e[10]=m):m=e[10];let f;e[11]!==n||e[12]!==p?(f=(0,a.jsxs)("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:n,type:"button",children:[p,m]}),e[11]=n,e[12]=p,e[13]=f):f=e[13];let h;return e[14]!==u||e[15]!==f||e[16]!==s?(h=(0,a.jsxs)(j,{className:"justify-between gap-0 py-0","data-testid":s,children:[u,f]}),e[14]=u,e[15]=f,e[16]=s,e[17]=h):h=e[17],h},"Ze"),Pt=c(t=>{let e=(0,_.c)(7),{functions:r}=t,n=$(),s;if(e[0]!==r||e[1]!==n){let l=[...r].toSorted(Wt).slice(0,5),i;e[3]!==n?(i=n("Top functions"),e[3]=n,e[4]=i):i=e[4];let o;e[5]!==i?(o=(0,a.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],s=(0,a.jsxs)(j,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[o,l.length===0?(0,a.jsx)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:n("No functions called yet.")}):(0,a.jsxs)("div",{className:"divide-y divide-border",children:[(0,a.jsxs)("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:[(0,a.jsx)("span",{children:n("Function")}),(0,a.jsx)("span",{className:"text-end",children:n("Calls")}),(0,a.jsx)("span",{className:"w-12 text-end",children:n("Avg")}),(0,a.jsx)("span",{className:"w-8 text-end",children:n("Err")})]}),l.map(Ft)]})]}),e[0]=r,e[1]=n,e[2]=s}else s=e[2];return s},"Pt"),zt=c(t=>{let e=(0,_.c)(26),{subs:r}=t,n=$(),s;e[0]!==n?(s=n("Live connections"),e[0]=n,e[1]=s):s=e[1];let l;e[2]!==s?(l=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s}),e[2]=s,e[3]=l):l=e[3];let i=r?.totalConnections??0,o;e[4]!==i?(o=i.toLocaleString(),e[4]=i,e[5]=o):o=e[5];let d;e[6]!==o?(d=(0,a.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[6]=o,e[7]=d):d=e[7];let u;e[8]!==n?(u=n("sockets"),e[8]=n,e[9]=u):u=e[9];let p;e[10]!==u?(p=(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:u}),e[10]=u,e[11]=p):p=e[11];let m;e[12]!==d||e[13]!==p?(m=(0,a.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[d,p]}),e[12]=d,e[13]=p,e[14]=m):m=e[14];let f=r?.totalSubscriptions??0,h;e[15]!==f?(h=f.toLocaleString(),e[15]=f,e[16]=h):h=e[16];let g;e[17]!==n?(g=n("active subscriptions"),e[17]=n,e[18]=g):g=e[18];let x;e[19]!==h||e[20]!==g?(x=(0,a.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[h," ",g]}),e[19]=h,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==l||e[24]!==m?(b=(0,a.jsx)(j,{"data-testid":"home-live-connections",children:(0,a.jsxs)(Ue,{className:"flex flex-col gap-2.5 py-4",children:[l,m,x]})}),e[22]=x,e[23]=l,e[24]=m,e[25]=b):b=e[25],b},"Dt"),Et=c(t=>{let e=(0,_.c)(7),{entries:r}=t,n=$(),s;if(e[0]!==r||e[1]!==n){let l=Date.now(),i;e[3]!==n?(i=n("Recent activity"),e[3]=n,e[4]=i):i=e[4];let o;e[5]!==i?(o=(0,a.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],s=(0,a.jsxs)(j,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[o,r.length===0?(0,a.jsx)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:n("No recent activity.")}):(0,a.jsx)("ul",{className:"divide-y divide-border",children:r.slice(0,5).map(d=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),(0,a.jsxs)("span",{className:"truncate text-foreground",children:[d.op,d.table!==void 0&&(0,a.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",d.table,d.id===void 0?"":`#${d.id}`]})]})]}),(0,a.jsx)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Bt(d.ts,l)})]},d.seq))})]}),e[0]=r,e[1]=n,e[2]=s}else s=e[2];return s},"jt"),Vt=c(t=>{let e=t.reduce((r,n)=>r+n.calls,0);return e===0?null:t.reduce((r,n)=>r+n.totalDurationMs,0)/e},"Ft"),sn=c(t=>{let e=(0,_.c)(149),{initialShardKey:r}=t,n=$(),s=Ee(),l=r??"",i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let o;e[1]!==l?(o={shardKey:l},e[1]=l,e[2]=o):o=e[2];let d=_e(D.getMetrics,i,o),u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let p;e[4]!==l?(p={shardKey:l},e[4]=l,e[5]=p):p=e[5];let m=_e(D.getFunctionStats,u,p),f,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(f={},h={shardKey:""},e[6]=f,e[7]=h):(f=e[6],h=e[7]);let g=_e(D.getSecurityAudit,f,h),x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==l?(b={shardKey:l},e[9]=l,e[10]=b):b=e[10];let v=_e(D.listSubscriptions,x,b),w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w={},e[11]=w):w=e[11];let k;e[12]!==l?(k={shardKey:l},e[12]=l,e[13]=k):k=e[13];let I=_e(D.getAuditLog,w,k),y=d.data??null,S,M,A,N,C,L,T,O,q,P,z,E,R,K,V,W,F,U;if(e[14]!==I.data||e[15]!==g.data||e[16]!==y||e[17]!==d.data||e[18]!==s||e[19]!==m.data||e[20]!==v.data||e[21]!==n){N=Array.isArray(m.data?.functions)?m.data.functions:[],T=v.data??null;let Me;e[40]!==I.data?(Me=Array.isArray(I.data?.entries)?I.data.entries:[],e[40]=I.data,e[41]=Me):Me=e[41],M=Me,C=d.data===void 0||m.data===void 0?null:at(y,N).length,L=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Ae;e[42]!==s?(Ae=c(()=>{Ne(s({to:"/security"}))},"Ce"),e[42]=s,e[43]=Ae):Ae=e[43],U=Ae;let Ce;e[44]!==s?(Ce=c(()=>{Ne(s({to:"/insights"}))},"Ae"),e[44]=s,e[45]=Ce):Ce=e[45],F=Ce;let Ie=ot(y?.history,"calls"),Le=ot(y?.history,"errors"),Ye=Vt(N),$e=Math.max(0,...N.map(Ut)),je;e[46]!==y||e[47]!==n?(je=y===null?void 0:Kt(n,y.cache),e[46]=y,e[47]=n,e[48]=je):je=e[48],A=je,V="flex flex-col gap-6",W="lunora-home",z="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",E="home-health";let Ke=it(Ie),xe;e[49]!==n?(xe=n("Requests"),e[49]=n,e[50]=xe):xe=e[50];let Be=y?.requests??0,be;e[51]!==Be?(be=Be.toLocaleString(),e[51]=Be,e[52]=be):be=e[52],e[53]!==Ie||e[54]!==Ke||e[55]!==xe||e[56]!==be?(R=(0,a.jsx)(qe,{delta:Ke,label:xe,trend:Ie,value:be}),e[53]=Ie,e[54]=Ke,e[55]=xe,e[56]=be,e[57]=R):R=e[57];let De=it(Le,!1),ye;e[58]!==n?(ye=n("Errors"),e[58]=n,e[59]=ye):ye=e[59];let Pe=y?.errors??0,ve;e[60]!==Pe?(ve=Pe.toLocaleString(),e[60]=Pe,e[61]=ve):ve=e[61],e[62]!==Le||e[63]!==De||e[64]!==ye||e[65]!==ve?(K=(0,a.jsx)(qe,{delta:De,label:ye,trend:Le,value:ve}),e[62]=Le,e[63]=De,e[64]=ye,e[65]=ve,e[66]=K):K=e[66],S=qe,e[67]!==$e||e[68]!==n?(O=$e>0?`${n("max")} ${Je($e)}`:void 0,e[67]=$e,e[68]=n,e[69]=O):O=e[69],e[70]!==n?(q=n("Avg latency"),e[70]=n,e[71]=q):q=e[71],P=Ye===null?"\u2014":Je(Ye),e[14]=I.data,e[15]=g.data,e[16]=y,e[17]=d.data,e[18]=s,e[19]=m.data,e[20]=v.data,e[21]=n,e[22]=S,e[23]=M,e[24]=A,e[25]=N,e[26]=C,e[27]=L,e[28]=T,e[29]=O,e[30]=q,e[31]=P,e[32]=z,e[33]=E,e[34]=R,e[35]=K,e[36]=V,e[37]=W,e[38]=F,e[39]=U}else S=e[22],M=e[23],A=e[24],N=e[25],C=e[26],L=e[27],T=e[28],O=e[29],q=e[30],P=e[31],z=e[32],E=e[33],R=e[34],K=e[35],V=e[36],W=e[37],F=e[38],U=e[39];let H;e[72]!==S||e[73]!==O||e[74]!==q||e[75]!==P?(H=(0,a.jsx)(S,{footer:O,label:q,value:P}),e[72]=S,e[73]=O,e[74]=q,e[75]=P,e[76]=H):H=e[76];let J;e[77]!==n?(J=n("Database size"),e[77]=n,e[78]=J):J=e[78];let Re=y?.databaseSize??null,G;e[79]!==Re?(G=Xe(Re),e[79]=Re,e[80]=G):G=e[80];let Y;e[81]!==A||e[82]!==J||e[83]!==G?(Y=(0,a.jsx)(qe,{footer:A,label:J,value:G}),e[81]=A,e[82]=J,e[83]=G,e[84]=Y):Y=e[84];let Z;e[85]!==z||e[86]!==E||e[87]!==R||e[88]!==K||e[89]!==H||e[90]!==Y?(Z=(0,a.jsxs)("div",{className:z,"data-testid":E,children:[R,K,H,Y]}),e[85]=z,e[86]=E,e[87]=R,e[88]=K,e[89]=H,e[90]=Y,e[91]=Z):Z=e[91];let we;e[92]===Symbol.for("react.memo_cache_sentinel")?(we=(0,a.jsx)(Nt,{}),e[92]=we):we=e[92];let Q;e[93]!==N?(Q=(0,a.jsx)("div",{className:"lg:col-span-2",children:(0,a.jsx)(Pt,{functions:N})}),e[93]=N,e[94]=Q):Q=e[94];let X;e[95]!==T?(X=(0,a.jsx)(zt,{subs:T}),e[95]=T,e[96]=X):X=e[96];let ee;e[97]!==M?(ee=(0,a.jsx)(Et,{entries:M}),e[97]=M,e[98]=ee):ee=e[98];let te;e[99]!==X||e[100]!==ee?(te=(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[X,ee]}),e[99]=X,e[100]=ee,e[101]=te):te=e[101];let ne;e[102]!==Q||e[103]!==te?(ne=(0,a.jsxs)("div",{className:"grid gap-3 lg:grid-cols-3",children:[Q,te]}),e[102]=Q,e[103]=te,e[104]=ne):ne=e[104];let ae;e[105]!==n?(ae=n("Advisors"),e[105]=n,e[106]=ae):ae=e[106];let re;e[107]!==ae?(re=(0,a.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ae}),e[107]=ae,e[108]=re):re=e[108];let se;e[109]!==C||e[110]!==L||e[111]!==n||e[112]!==F||e[113]!==U?(se=L===0&&C===0?(0,a.jsx)(nt,{description:n("No security or performance issues detected."),icon:(0,a.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),(0,a.jsx)("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:n("No issues found")}):(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsx)(ct,{count:L,onView:U,testId:"home-security",title:n("Security findings")}),(0,a.jsx)(ct,{count:C,onView:F,testId:"home-performance",title:n("Performance issues")})]}),e[109]=C,e[110]=L,e[111]=n,e[112]=F,e[113]=U,e[114]=se):se=e[114];let le;e[115]!==re||e[116]!==se?(le=(0,a.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[re,se]}),e[115]=re,e[116]=se,e[117]=le):le=e[117];let oe;e[118]!==n?(oe=n("Get connected"),e[118]=n,e[119]=oe):oe=e[119];let ie;e[120]!==oe?(ie=(0,a.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:oe}),e[120]=oe,e[121]=ie):ie=e[121];let ce;e[122]!==n?(ce=n("Client SDK"),e[122]=n,e[123]=ce):ce=e[123];let de;e[124]!==ce?(de=(0,a.jsx)(He,{command:"npm i @lunora/client",label:ce}),e[124]=ce,e[125]=de):de=e[125];let me;e[126]!==n?(me=n("React"),e[126]=n,e[127]=me):me=e[127];let ue;e[128]!==me?(ue=(0,a.jsx)(He,{command:"npm i @lunora/react",label:me}),e[128]=me,e[129]=ue):ue=e[129];let pe;e[130]!==n?(pe=n("CLI"),e[130]=n,e[131]=pe):pe=e[131];let fe;e[132]!==pe?(fe=(0,a.jsx)(He,{command:"lunora dev",label:pe}),e[132]=pe,e[133]=fe):fe=e[133];let he;e[134]!==de||e[135]!==ue||e[136]!==fe?(he=(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[de,ue,fe]}),e[134]=de,e[135]=ue,e[136]=fe,e[137]=he):he=e[137];let ke;e[138]===Symbol.for("react.memo_cache_sentinel")?(ke=(0,a.jsx)(Lt,{}),e[138]=ke):ke=e[138];let ge;e[139]!==ie||e[140]!==he?(ge=(0,a.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[ie,he,ke]}),e[139]=ie,e[140]=he,e[141]=ge):ge=e[141];let Se;return e[142]!==V||e[143]!==W||e[144]!==Z||e[145]!==ne||e[146]!==le||e[147]!==ge?(Se=(0,a.jsxs)("div",{className:V,"data-testid":W,children:[Z,we,ne,le,ge]}),e[142]=V,e[143]=W,e[144]=Z,e[145]=ne,e[146]=le,e[147]=ge,e[148]=Se):Se=e[148],Se},"as");function Wt(t,e){return e.calls-t.calls}c(Wt,"Ut");function Ft(t){return(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[(0,a.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),(0,a.jsx)("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),(0,a.jsx)("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:Je(t.calls>0?t.totalDurationMs/t.calls:0)}),(0,a.jsx)("span",{className:Ve("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}c(Ft,"qt");function Ut(t){return t.maxDurationMs}c(Ut,"Kt");export{xt as a,sn as b};
@@ -1 +1 @@
1
- import{b as g}from"./chunk-6BH5TIGF.js";import"./chunk-EVJSGZXV.js";import"./chunk-F5WJCL3F.js";import"./chunk-VXZAS5VS.js";import"./chunk-EYMLYHWK.js";import"./chunk-PUU56AIE.js";import"./chunk-4PI2OSSP.js";import{a as m}from"./chunk-6A6AELDJ.js";import{c as p}from"./chunk-CLQKKJHL.js";import"./chunk-OSHODLMU.js";import"./chunk-PFPJA2HR.js";import"./chunk-ZPQBVYNN.js";import{B as f}from"./chunk-PUK3H4RN.js";import"./chunk-PDBW6GTJ.js";import{a as S}from"./chunk-GWNGVKLG.js";import{b as A}from"./chunk-6G3E4PJ2.js";import{a as r,d as h}from"./chunk-5PEAXTYQ.js";var R=h(S(),1);var k=h(A(),1);var _=r((e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("User subscriptions are ungated")})[s.kind],"k"),w=r(e=>Array.isArray(e.findings)?e.findings:[],"g"),b=r(e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],"S"),E=r((e,s)=>({"admin-token-weak":e("Your admin token is {length} characters \u2014 use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters \u2014 use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed \u2014 browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: anyone who can reach the worker can open a socket and run ordinary user subscriptions. Admin subscriptions are unaffected \u2014 they need the admin token. Set it if subscribers should present a shared credential.")})[s.kind],"A"),O=r(()=>{let e=(0,R.c)(8),s=f(),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let{data:a,error:d,errorSource:c}=p(m.getSecurityAudit,i),n;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:w(a);n=u===null?null:u.map(t=>({description:E(s,t),entity:b(t),issueType:_(s,t),key:t.kind,level:t.level})),e[1]=a,e[2]=s,e[3]=n}else n=e[3];let l=n,o;return e[4]!==d||e[5]!==c||e[6]!==l?(o=(0,k.jsx)(g,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"}),e[4]=d,e[5]=c,e[6]=l,e[7]=o):o=e[7],o},"T");export{O as default};
1
+ import{b as g}from"./chunk-7MQI2RNF.js";import"./chunk-UA7DC3LX.js";import"./chunk-KFDOGDD2.js";import"./chunk-3OVNOP65.js";import"./chunk-UVMD7C4J.js";import"./chunk-FXSY2FCG.js";import"./chunk-EOFWXI3T.js";import{a as m}from"./chunk-LYVYUTQY.js";import{c as p}from"./chunk-AKC4XWCD.js";import"./chunk-CB22PV3X.js";import"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as f}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as S}from"./chunk-A6TVTNKO.js";import{b as A}from"./chunk-ADABTCDI.js";import{a as r,d as h}from"./chunk-5PEAXTYQ.js";var R=h(S(),1);var k=h(A(),1);var _=r((e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("User subscriptions are ungated")})[s.kind],"k"),w=r(e=>Array.isArray(e.findings)?e.findings:[],"g"),b=r(e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],"S"),E=r((e,s)=>({"admin-token-weak":e("Your admin token is {length} characters \u2014 use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters \u2014 use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed \u2014 browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: anyone who can reach the worker can open a socket and run ordinary user subscriptions. Admin subscriptions are unaffected \u2014 they need the admin token. Set it if subscribers should present a shared credential.")})[s.kind],"A"),O=r(()=>{let e=(0,R.c)(8),s=f(),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let{data:a,error:d,errorSource:c}=p(m.getSecurityAudit,i),n;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:w(a);n=u===null?null:u.map(t=>({description:E(s,t),entity:b(t),issueType:_(s,t),key:t.kind,level:t.level})),e[1]=a,e[2]=s,e[3]=n}else n=e[3];let l=n,o;return e[4]!==d||e[5]!==c||e[6]!==l?(o=(0,k.jsx)(g,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"}),e[4]=d,e[5]=c,e[6]=l,e[7]=o):o=e[7],o},"T");export{O as default};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-CLQKKJHL.js";import{a as n}from"./chunk-5PEAXTYQ.js";var d="__lunora_admin__:",g=new Set(["action","mutation","query","streamRpc"]),y=Symbol("lunora.operationSeq"),w=n(t=>{if(typeof t!="object"||t===null)return;let e=t[y];return typeof e=="number"?e:void 0},"R"),_=n((t,e)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,y,{configurable:!0,enumerable:!1,value:e,writable:!0})}catch{}},"O"),h=n(t=>{if(typeof t!="object"||t===null)return;let e=t.__lunoraRef;return typeof e=="string"&&e.startsWith(d)?e:void 0},"_"),p=n(t=>{if(typeof t!="object"||t===null)return"";let{shardKey:e}=t;return typeof e=="string"?e:""},"l"),R=n(t=>new Proxy(t,{get(e,a,b){let s=Reflect.get(e,a,b);if(typeof s!="function"||typeof a!="string"||!g.has(a))return typeof s=="function"?s.bind(e):s;let c=s;return async(...o)=>{let f=h(o[0]);if(f===void 0)return c.apply(e,o);let l=typeof o[1]=="object"&&o[1]!==null?o[1]:{},m=p(o[2])||(a==="streamRpc"?p(l):""),u=i.start(f,l,m);try{let r=await c.apply(e,o);return i.settle(u,{result:r}),r}catch(r){throw i.settle(u,{error:r instanceof Error?r.message:String(r)}),_(r,u),r}}}}),"E");export{w as a,R as b};
1
+ import{a as i}from"./chunk-AKC4XWCD.js";import{a as n}from"./chunk-5PEAXTYQ.js";var d="__lunora_admin__:",g=new Set(["action","mutation","query","streamRpc"]),y=Symbol("lunora.operationSeq"),w=n(t=>{if(typeof t!="object"||t===null)return;let e=t[y];return typeof e=="number"?e:void 0},"R"),_=n((t,e)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,y,{configurable:!0,enumerable:!1,value:e,writable:!0})}catch{}},"O"),h=n(t=>{if(typeof t!="object"||t===null)return;let e=t.__lunoraRef;return typeof e=="string"&&e.startsWith(d)?e:void 0},"_"),p=n(t=>{if(typeof t!="object"||t===null)return"";let{shardKey:e}=t;return typeof e=="string"?e:""},"l"),R=n(t=>new Proxy(t,{get(e,a,b){let s=Reflect.get(e,a,b);if(typeof s!="function"||typeof a!="string"||!g.has(a))return typeof s=="function"?s.bind(e):s;let c=s;return async(...o)=>{let f=h(o[0]);if(f===void 0)return c.apply(e,o);let l=typeof o[1]=="object"&&o[1]!==null?o[1]:{},m=p(o[2])||(a==="streamRpc"?p(l):""),u=i.start(f,l,m);try{let r=await c.apply(e,o);return i.settle(u,{result:r}),r}catch(r){throw i.settle(u,{error:r instanceof Error?r.message:String(r)}),_(r,u),r}}}}),"E");export{w as a,R as b};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-KBYFBEG2.js";import{B as d}from"./chunk-PUK3H4RN.js";import{a as h,b as k}from"./chunk-6G3E4PJ2.js";import{a as e,d as r}from"./chunk-5PEAXTYQ.js";var l=r(h(),1);var t=r(k(),1);var g=e(({children:m,confirmLabel:c,disabled:a=!1,onConfirm:p,testId:i})=>{let o=d(),[f,n]=(0,l.useState)(!1),u=e(()=>{n(!0)},"f"),C=e(()=>{n(!1)},"l"),b=e(()=>{n(!1),p()},"p");return f?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(s,{"data-testid":`${i}-confirm`,disabled:a,onClick:b,size:"sm",type:"button",variant:"destructive",children:c??o("Confirm")}),(0,t.jsx)(s,{"data-testid":`${i}-cancel`,onClick:C,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(s,{"data-testid":i,disabled:a,onClick:u,size:"sm",type:"button",variant:"outline",children:m})},"k");export{g as a};
1
+ import{a as s}from"./chunk-SZCXVIVT.js";import{B as d}from"./chunk-4S7ZIMWI.js";import{a as h,b as k}from"./chunk-ADABTCDI.js";import{a as e,d as r}from"./chunk-5PEAXTYQ.js";var l=r(h(),1);var t=r(k(),1);var g=e(({children:m,confirmLabel:c,disabled:a=!1,onConfirm:p,testId:i})=>{let o=d(),[f,n]=(0,l.useState)(!1),u=e(()=>{n(!0)},"f"),C=e(()=>{n(!1)},"l"),b=e(()=>{n(!1),p()},"p");return f?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(s,{"data-testid":`${i}-confirm`,disabled:a,onClick:b,size:"sm",type:"button",variant:"destructive",children:c??o("Confirm")}),(0,t.jsx)(s,{"data-testid":`${i}-cancel`,onClick:C,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(s,{"data-testid":i,disabled:a,onClick:u,size:"sm",type:"button",variant:"outline",children:m})},"k");export{g as a};
@@ -1 +1 @@
1
- import{a as pe,d as ne,e as kt,f as me}from"./chunk-O3AZ7JKE.js";import{a as de,b as Ut}from"./chunk-D65UVZIA.js";import{D as gt,b as ie,c as fe,e as Lt,f as ue}from"./chunk-HFBSWKJS.js";import{u as lt,v as ht}from"./chunk-VUOEJJUH.js";import{d as At,j as X}from"./chunk-YUVGMKHG.js";import{x as oe}from"./chunk-PUK3H4RN.js";import{a as Ke}from"./chunk-GWNGVKLG.js";import{a as Q,b as _t}from"./chunk-6G3E4PJ2.js";import{a as o,c as Ge,d as O}from"./chunk-5PEAXTYQ.js";var je=O(Ke(),1);var at={};Ge(at,{Content:()=>Le,Corner:()=>Fe,Root:()=>ye,Scrollbar:()=>_e,Thumb:()=>ke,Viewport:()=>We});var s=O(Q(),1);var $t=O(Q(),1);var le=$t.createContext(void 0);function j(){let e=$t.useContext(le);if(e===void 0)throw new Error(At(53));return e}o(j,"useScrollAreaRootContext");function I(e,t,l){if(!e)return 0;let v=getComputedStyle(e),g=`${t}${l==="x"?"Inline":"Block"}`,p=parseFloat(v[`${g}Start`]);return l==="x"&&t==="margin"?p*2:p+parseFloat(v[`${g}End`])}o(I,"getOffset");var he="data-has-overflow-x",Se="data-has-overflow-y",xe="data-overflow-x-start",be="data-overflow-x-end",Re="data-overflow-y-start",we="data-overflow-y-end";var Et=o(e=>t=>t?{[e]:""}:null,"attr"),st={hasOverflowX:Et(he),hasOverflowY:Et(Se),overflowXStart:Et(xe),overflowXEnd:Et(be),overflowYStart:Et(Re),overflowYEnd:Et(we),cornerHidden:o(()=>null,"cornerHidden")};var Ft="--scroll-area-corner-height",jt="--scroll-area-corner-width";var Ae="data-orientation";var Ee=O(_t(),1);var Je={x:0,y:0},ge={width:0,height:0},Qe={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},tr={x:!0,y:!0,corner:!0},ye=s.forwardRef(o(function(t,l){let{render:v,className:g,overflowEdgeThreshold:p,style:x,...c}=t,{xStart:m,xEnd:b,yStart:E,yEnd:P}=er(p),_=ie(),y=gt(),T=gt(),{nonce:L,disableStyleElements:U}=me(),[it,k]=s.useState(!1),[B,tt]=s.useState(!1),[et,rt]=s.useState(!1),[ft,M]=s.useState(!1),[xt,d]=s.useState(!1),[$,G]=s.useState(ge),[bt,ut]=s.useState(ge),[R,ot]=s.useState(Qe),[H,h]=s.useState(tr),K=s.useRef(null),n=s.useRef(null),a=s.useRef(null),f=s.useRef(null),u=s.useRef(null),S=s.useRef(null),F=s.useRef(null),A=s.useRef(null),C=s.useRef(0),N=s.useRef(0),Z=s.useRef(0),dt=s.useRef(0),D=s.useRef("vertical"),Y=s.useRef(Je),W=s.useRef(null);function z(r){let i=r?rt:tt,w=r?y:T;i(!0),w.start(500,()=>{i(!1)})}o(z,"startScrolling");let q=lt(r=>{let i=r.x-Y.current.x,w=r.y-Y.current.y;Y.current=r,w!==0&&z(!0),i!==0&&z(!1)}),J=lt(()=>{let r=n.current;r&&W.current===null&&(W.current=r.style.scrollSnapType,r.style.scrollSnapType="none")}),Mt=lt(r=>{if(r.button!==0||A.current!==null&&(D.current==="vertical"?u.current:S.current)?.hasPointerCapture(A.current))return;A.current=r.pointerId,C.current=r.clientY,N.current=r.clientX,D.current=r.currentTarget.getAttribute(Ae);let i=n.current;i&&(Z.current=i.scrollTop,dt.current=i.scrollLeft,J()),(D.current==="vertical"?u.current:S.current)?.setPointerCapture(r.pointerId)}),yt=lt(r=>{if(r.pointerId!==A.current)return;A.current=null,(D.current==="vertical"?rt:tt)(!1),W.current!==null&&(n.current&&(n.current.style.scrollSnapType=W.current),W.current=null);let i=D.current==="vertical"?u.current:S.current;i?.hasPointerCapture(r.pointerId)&&i.releasePointerCapture(r.pointerId)}),Rt=lt(r=>{if(r.pointerId!==A.current)return;if(r.buttons%2===0){yt(r);return}let i=n.current;if(!i)return;let w=D.current==="vertical",nt=w?u.current:S.current,vt=w?a.current:f.current;if(!nt||!vt)return;let Dt=w?"y":"x",Yt=I(vt,"padding",Dt),Xt=I(nt,"margin",Dt),Pt=w?nt.offsetHeight:nt.offsetWidth,Ot=(w?vt.offsetHeight:vt.offsetWidth)-Pt-Yt-Xt,Wt=w?r.clientY-C.current:r.clientX-N.current,ee=Ot<=0?0:Wt/Ot,re=w?i.scrollHeight:i.scrollWidth,Tt=w?i.clientHeight:i.clientWidth,It=(w?Z.current:dt.current)+ee*(re-Tt);w?i.scrollTop=It:i.scrollLeft=It,r.preventDefault(),z(w)});function wt(r){M(r.pointerType==="touch")}o(wt,"handleTouchModalityChange");function pt(r){if(wt(r),r.pointerType!=="touch"){let i=Lt(K.current,r.target);k(i)}}o(pt,"handlePointerEnterOrMove");let mt=s.useMemo(()=>({scrolling:B||et,hasOverflowX:!H.x,hasOverflowY:!H.y,overflowXStart:R.xStart,overflowXEnd:R.xEnd,overflowYStart:R.yStart,overflowYEnd:R.yEnd,cornerHidden:H.corner}),[B,et,H.x,H.y,H.corner,R]),Ct={role:"presentation",onPointerEnter:pt,onPointerMove:pt,onPointerDown:wt,onPointerLeave(){k(!1)},style:{position:"relative",[Ft]:`${$.height}px`,[jt]:`${$.width}px`}},Ht=X("div",t,{state:mt,ref:[l,K],props:[Ct,c],stateAttributesMapping:st}),Qt=s.useMemo(()=>({handlePointerDown:Mt,handlePointerMove:Rt,handlePointerUp:yt,handleScroll:q,disableViewportSnap:J,cornerSize:$,setCornerSize:G,thumbSize:bt,setThumbSize:ut,hasMeasuredScrollbar:xt,setHasMeasuredScrollbar:d,touchModality:ft,cornerRef:F,scrollingX:B,scrollingY:et,hovering:it,setHovering:k,viewportRef:n,scrollbarYRef:a,scrollbarXRef:f,thumbYRef:u,thumbXRef:S,rootId:_,hiddenState:H,setHiddenState:h,overflowEdges:R,setOverflowEdges:ot,viewportState:mt,overflowEdgeThreshold:{xStart:m,xEnd:b,yStart:E,yEnd:P}}),[Mt,Rt,yt,q,J,$,bt,xt,ft,B,et,it,_,H,R,mt,m,b,E,P]);return(0,Ee.jsxs)(le.Provider,{value:Qt,children:[!U&&kt.getElement(L),Ht]})},"ScrollAreaRoot"));function er(e){let t=typeof e=="number"?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}o(er,"normalizeOverflowEdgeThreshold");var St=O(Q(),1);var Bt=O(Q(),1);var se=Bt.createContext(void 0);function Ce(){let e=Bt.useContext(se);if(e===void 0)throw new Error(At(55));return e}o(Ce,"useScrollAreaViewportContext");var Oe="--scroll-area-overflow-x-start",Te="--scroll-area-overflow-x-end",Ne="--scroll-area-overflow-y-start",Ve="--scroll-area-overflow-y-end";var Gt="--scroll-area-thumb-height",Kt="--scroll-area-thumb-width";var Xe=O(_t(),1);var Pe=[Oe,Te,Ne,Ve],De=!1;function or(){De||fe.engine.webkit||(typeof CSS<"u"&&"registerProperty"in CSS&&Pe.forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),De=!0)}o(or,"removeCSSVariableInheritance");var We=St.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{viewportRef:c,scrollbarYRef:m,scrollbarXRef:b,thumbYRef:E,thumbXRef:P,cornerRef:_,cornerSize:y,setCornerSize:T,setThumbSize:L,rootId:U,setHiddenState:it,hiddenState:k,setHasMeasuredScrollbar:B,handleScroll:tt,touchModality:et,setHovering:rt,setOverflowEdges:ft,overflowEdgeThreshold:M,viewportState:xt}=j(),d=Ut(),$=St.useRef(!0),G=St.useRef([NaN,NaN,NaN,NaN]),bt=gt(),ut=gt(),R=lt(()=>{let n=c.current,a=m.current,f=b.current,u=E.current,S=P.current,F=_.current;if(!n)return;let A=n.scrollHeight,C=n.scrollWidth,N=n.clientHeight,Z=n.clientWidth,dt=n.scrollTop,D=n.scrollLeft,Y=G.current,W=Number.isNaN(Y[0]);if(Y[0]=N,Y[1]=A,Y[2]=Z,Y[3]=C,W&&B(!0),A===0||C===0)return;let z=nr(n),q=z.y,J=z.x,Mt=Z/C,yt=N/A,Rt=Math.max(0,C-Z),wt=Math.max(0,A-N),pt=0,mt=0;J||(pt=ne(d==="rtl"?-D:D,Rt),mt=Rt-pt);let Ct=q?0:ne(dt,wt),Ht=q?0:wt-Ct,Qt=J?0:Z,r=q?0:N,i=0,w=0;!J&&!q&&(i=a?.offsetWidth||0,w=f?.offsetHeight||0);let nt=y.width===0&&y.height===0,vt=nt?i:0,Dt=nt?w:0,Yt=I(f,"padding","x"),Xt=I(a,"padding","y"),Pt=I(S,"margin","x"),te=I(u,"margin","y"),Ot=Qt-Yt-Pt,Wt=r-Xt-te,ee=f?Math.min(f.offsetWidth-vt,Ot):Ot,re=a?Math.min(a.offsetHeight-Dt,Wt):Wt,Tt=Math.max(16,ee*Mt),zt=Math.max(16,re*yt);if(L(V=>Zt(V,{width:Tt,height:zt})),a&&u){let V=a.offsetHeight-zt-Xt-te,Nt=Ye(u,Gt,dt,wt,A,zt,V);u.style.transform=`translate3d(0,${Nt}px,0)`}if(f&&S){let V=f.offsetWidth-Tt-Yt-Pt,Nt=d==="rtl"?-D:D,ce=Ye(S,Kt,Nt,Rt,C,Tt,V);S.style.transform=`translate3d(${d==="rtl"?-ce:ce}px,0,0)`}let It=[pt,mt,Ct,Ht];Pe.forEach((V,Nt)=>{n.style.setProperty(V,`${It[Nt]}px`)}),F&&T(V=>Zt(V,{width:i,height:w})),it(V=>Zt(V,z));let Be={xStart:!J&&pt>M.xStart,xEnd:!J&&mt>M.xEnd,yStart:!q&&Ct>M.yStart,yEnd:!q&&Ht>M.yEnd};ft(V=>Zt(V,Be))});ht(()=>{or()},[]),ht(()=>{queueMicrotask(R)},[R,k,d,M.xStart,M.xEnd,M.yStart,M.yEnd]),ht(()=>{c.current?.matches(":hover")&&rt(!0)},[c,rt]),ht(()=>{let n=c.current;if(typeof ResizeObserver>"u"||!n)return;let a=!1,f=new ResizeObserver(()=>{if(!a){a=!0;let u=G.current;if(u[0]===n.clientHeight&&u[1]===n.scrollHeight&&u[2]===n.clientWidth&&u[3]===n.scrollWidth)return}R()});return f.observe(n),ut.start(0,()=>{let u=n.getAnimations({subtree:!0});u.length!==0&&Promise.allSettled(u.map(S=>S.finished)).then(R).catch(()=>{})}),()=>{f.disconnect(),ut.clear()}},[R,c,ut]);function ot(){$.current=!1}o(ot,"handleUserInteraction");let H={role:"presentation",...U&&{"data-id":`${U}-viewport`},tabIndex:k.x&&k.y?-1:0,className:kt.className,style:{overflow:"scroll"},onScroll(){c.current&&(R(),(et||!$.current)&&tt({x:c.current.scrollLeft,y:c.current.scrollTop}),bt.start(100,()=>{$.current=!0}))},onWheel:ot,onPointerMove:ot,onPointerEnter:ot,onKeyDown:ot},h=X("div",t,{ref:[l,c],state:xt,props:[H,x],stateAttributesMapping:st}),K=St.useMemo(()=>({computeThumbPosition:R}),[R]);return(0,Xe.jsx)(se.Provider,{value:K,children:h})},"ScrollAreaViewport"));function nr(e){let t=e.clientHeight>=e.scrollHeight,l=e.clientWidth>=e.scrollWidth;return{y:t,x:l,corner:t||l}}o(nr,"getHiddenState");function Zt(e,t){for(let l in t)if(e[l]!==t[l])return t;return e}o(Zt,"pickState");function Ye(e,t,l,v,g,p,x){let c=pe(l,0,v),m=l-c,b=Math.max(16,p*g/(g+Math.abs(m)));return e.style.setProperty(t,m?`${b}px`:""),(v?c/v*x:0)+(m>0?p-b:0)}o(Ye,"applyOverscrollThumb");var Jt=O(Q(),1);var qt=O(Q(),1);var ae=qt.createContext(void 0);function ze(){let e=qt.useContext(ae);if(e===void 0)throw new Error(At(54));return e}o(ze,"useScrollAreaScrollbarContext");var Ie=O(_t(),1);var _e=Jt.forwardRef(o(function(t,l){let{render:v,className:g,orientation:p="vertical",keepMounted:x=!1,style:c,...m}=t,{hovering:b,scrollingX:E,scrollingY:P,hiddenState:_,scrollbarYRef:y,scrollbarXRef:T,viewportRef:L,thumbYRef:U,thumbXRef:it,handlePointerDown:k,handlePointerUp:B,handleScroll:tt,disableViewportSnap:et,rootId:rt,thumbSize:ft,hasMeasuredScrollbar:M,viewportState:xt}=j(),d=p==="vertical",$={...xt,hovering:b,scrolling:d?P:E,orientation:p},G=Ut(),bt=!M&&!x,ut=d?_.y:_.x,R=x||!ut;Jt.useEffect(()=>{if(!R)return;let h=L.current,K=d?y.current:T.current;if(!K)return;function n(a){if(!h||a.ctrlKey)return;let f=!d,u=f?"scrollLeft":"scrollTop",S=f?a.deltaX:a.deltaY;if(S===0)return;let F=f?h.scrollWidth-h.clientWidth:h.scrollHeight-h.clientHeight,A=f&&G==="rtl"?-F:0,C=f&&G==="rtl"?0:F,N=h[u];N<=A&&S<0||N>=C&&S>0||(a.preventDefault(),h[u]=Math.min(C,Math.max(A,N+S)),tt({x:h.scrollLeft,y:h.scrollTop}))}return o(n,"handleWheel"),de(K,"wheel",n,{passive:!1})},[G,tt,d,T,y,R,L]);let ot={...rt&&{"data-id":`${rt}-scrollbar`},"aria-hidden":!0,onPointerDown(h){if(h.button!==0)return;let K=ue(h.nativeEvent),n=d?U.current:it.current;if(n&&Lt(n,K))return;let a=L.current;if(!a)return;let f=d?y.current:T.current;if(!n||!f)return;let u=d?"y":"x",S=I(n,"margin",u),F=I(f,"padding",u),A=d?n.offsetHeight:n.offsetWidth,C=f.getBoundingClientRect(),N=d?h.clientY-C.top-A/2-F+S/2:h.clientX-C.left-A/2-F+S/2,Z=d?a.scrollHeight:a.scrollWidth,dt=d?a.clientHeight:a.clientWidth,Y=(d?f.offsetHeight:f.offsetWidth)-A-F-S;if(Y<=0)return;let W=N/Y,z=Z-dt;et(),d?a.scrollTop=W*z:G==="rtl"?a.scrollLeft=-(1-W)*z:a.scrollLeft=W*z,tt({x:a.scrollLeft,y:a.scrollTop}),k(h)},onMouseDown(h){h.preventDefault()},onPointerUp:B,onPointerCancel:B,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:bt?"hidden":void 0,...d?{top:0,bottom:`var(${Ft})`,insetInlineEnd:0,[Gt]:`${ft.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${jt})`,bottom:0,[Kt]:`${ft.width}px`}}},H=X("div",t,{ref:[l,d?y:T],state:$,props:[ot,m],stateAttributesMapping:st});return R?(0,Ie.jsx)(ae.Provider,{value:p,children:H}):null},"ScrollAreaScrollbar"));var Vt=O(Q(),1);var Le=Vt.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{computeThumbPosition:c}=Ce(),{hasMeasuredScrollbar:m,viewportState:b}=j(),E=Vt.useRef(null),P=Vt.useRef(m);return ht(()=>{if(typeof ResizeObserver>"u")return;let y=!1,T=new ResizeObserver(()=>{!y&&(y=!0,!P.current)||c()});return E.current&&T.observe(E.current),()=>{T.disconnect()}},[c]),X("div",t,{ref:[l,E],state:b,stateAttributesMapping:st,props:[{role:"presentation",style:{minWidth:"fit-content"}},x]})},"ScrollAreaContent"));var Ue=O(Q(),1);var ke=Ue.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{thumbYRef:c,thumbXRef:m,handlePointerDown:b,handlePointerMove:E,handlePointerUp:P,scrollingX:_,scrollingY:y,hasMeasuredScrollbar:T}=j(),L=ze(),U=L==="vertical";return X("div",t,{ref:[l,U?c:m],state:{scrolling:U?y:_,orientation:L},props:[{onPointerDown:b,onPointerMove:E,onPointerUp:P,onPointerCancel:P,style:{visibility:T?void 0:"hidden",...U?{height:"var(--scroll-area-thumb-height)"}:{width:"var(--scroll-area-thumb-width)"}}},x]})},"ScrollAreaThumb"));var $e=O(Q(),1);var Fe=$e.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{cornerRef:c,cornerSize:m,hiddenState:b}=j(),E=X("div",t,{ref:[l,c],props:[{"aria-hidden":!0,style:{position:"absolute",bottom:0,insetInlineEnd:0,width:m.width,height:m.height}},x]});return b.corner?null:E},"ScrollAreaCorner"));var ct=O(_t(),1);function No(e){let t=(0,je.c)(14),l,v,g;t[0]!==e?({className:v,children:l,...g}=e,t[0]=e,t[1]=l,t[2]=v,t[3]=g):(l=t[1],v=t[2],g=t[3]);let p;t[4]!==v?(p=oe("relative",v),t[4]=v,t[5]=p):p=t[5];let x;t[6]!==l?(x=(0,ct.jsx)(at.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:l}),t[6]=l,t[7]=x):x=t[7];let c,m;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,ct.jsx)(lr,{}),m=(0,ct.jsx)(at.Corner,{}),t[8]=c,t[9]=m):(c=t[8],m=t[9]);let b;return t[10]!==g||t[11]!==p||t[12]!==x?(b=(0,ct.jsxs)(at.Root,{"data-slot":"scroll-area",className:p,...g,children:[x,c,m]}),t[10]=g,t[11]=p,t[12]=x,t[13]=b):b=t[13],b}o(No,"z");function lr({className:e,orientation:t="vertical",...l}){return(0,ct.jsx)(at.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:oe("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-s data-vertical:border-s-transparent",e),...l,children:(0,ct.jsx)(at.Thumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-md bg-border"})})}o(lr,"h");export{No as a};
1
+ import{a as pe,d as ne,e as kt,f as me}from"./chunk-T7UKRA6J.js";import{a as de,b as Ut}from"./chunk-OWRWDDJT.js";import{D as gt,b as ie,c as fe,e as Lt,f as ue}from"./chunk-4SY2N2RS.js";import{u as lt,v as ht}from"./chunk-OZID3UYF.js";import{d as At,j as X}from"./chunk-L27FKJTG.js";import{x as oe}from"./chunk-4S7ZIMWI.js";import{a as Ke}from"./chunk-A6TVTNKO.js";import{a as Q,b as _t}from"./chunk-ADABTCDI.js";import{a as o,c as Ge,d as O}from"./chunk-5PEAXTYQ.js";var je=O(Ke(),1);var at={};Ge(at,{Content:()=>Le,Corner:()=>Fe,Root:()=>ye,Scrollbar:()=>_e,Thumb:()=>ke,Viewport:()=>We});var s=O(Q(),1);var $t=O(Q(),1);var le=$t.createContext(void 0);function j(){let e=$t.useContext(le);if(e===void 0)throw new Error(At(53));return e}o(j,"useScrollAreaRootContext");function I(e,t,l){if(!e)return 0;let v=getComputedStyle(e),g=`${t}${l==="x"?"Inline":"Block"}`,p=parseFloat(v[`${g}Start`]);return l==="x"&&t==="margin"?p*2:p+parseFloat(v[`${g}End`])}o(I,"getOffset");var he="data-has-overflow-x",Se="data-has-overflow-y",xe="data-overflow-x-start",be="data-overflow-x-end",Re="data-overflow-y-start",we="data-overflow-y-end";var Et=o(e=>t=>t?{[e]:""}:null,"attr"),st={hasOverflowX:Et(he),hasOverflowY:Et(Se),overflowXStart:Et(xe),overflowXEnd:Et(be),overflowYStart:Et(Re),overflowYEnd:Et(we),cornerHidden:o(()=>null,"cornerHidden")};var Ft="--scroll-area-corner-height",jt="--scroll-area-corner-width";var Ae="data-orientation";var Ee=O(_t(),1);var Je={x:0,y:0},ge={width:0,height:0},Qe={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},tr={x:!0,y:!0,corner:!0},ye=s.forwardRef(o(function(t,l){let{render:v,className:g,overflowEdgeThreshold:p,style:x,...c}=t,{xStart:m,xEnd:b,yStart:E,yEnd:P}=er(p),_=ie(),y=gt(),T=gt(),{nonce:L,disableStyleElements:U}=me(),[it,k]=s.useState(!1),[B,tt]=s.useState(!1),[et,rt]=s.useState(!1),[ft,M]=s.useState(!1),[xt,d]=s.useState(!1),[$,G]=s.useState(ge),[bt,ut]=s.useState(ge),[R,ot]=s.useState(Qe),[H,h]=s.useState(tr),K=s.useRef(null),n=s.useRef(null),a=s.useRef(null),f=s.useRef(null),u=s.useRef(null),S=s.useRef(null),F=s.useRef(null),A=s.useRef(null),C=s.useRef(0),N=s.useRef(0),Z=s.useRef(0),dt=s.useRef(0),D=s.useRef("vertical"),Y=s.useRef(Je),W=s.useRef(null);function z(r){let i=r?rt:tt,w=r?y:T;i(!0),w.start(500,()=>{i(!1)})}o(z,"startScrolling");let q=lt(r=>{let i=r.x-Y.current.x,w=r.y-Y.current.y;Y.current=r,w!==0&&z(!0),i!==0&&z(!1)}),J=lt(()=>{let r=n.current;r&&W.current===null&&(W.current=r.style.scrollSnapType,r.style.scrollSnapType="none")}),Mt=lt(r=>{if(r.button!==0||A.current!==null&&(D.current==="vertical"?u.current:S.current)?.hasPointerCapture(A.current))return;A.current=r.pointerId,C.current=r.clientY,N.current=r.clientX,D.current=r.currentTarget.getAttribute(Ae);let i=n.current;i&&(Z.current=i.scrollTop,dt.current=i.scrollLeft,J()),(D.current==="vertical"?u.current:S.current)?.setPointerCapture(r.pointerId)}),yt=lt(r=>{if(r.pointerId!==A.current)return;A.current=null,(D.current==="vertical"?rt:tt)(!1),W.current!==null&&(n.current&&(n.current.style.scrollSnapType=W.current),W.current=null);let i=D.current==="vertical"?u.current:S.current;i?.hasPointerCapture(r.pointerId)&&i.releasePointerCapture(r.pointerId)}),Rt=lt(r=>{if(r.pointerId!==A.current)return;if(r.buttons%2===0){yt(r);return}let i=n.current;if(!i)return;let w=D.current==="vertical",nt=w?u.current:S.current,vt=w?a.current:f.current;if(!nt||!vt)return;let Dt=w?"y":"x",Yt=I(vt,"padding",Dt),Xt=I(nt,"margin",Dt),Pt=w?nt.offsetHeight:nt.offsetWidth,Ot=(w?vt.offsetHeight:vt.offsetWidth)-Pt-Yt-Xt,Wt=w?r.clientY-C.current:r.clientX-N.current,ee=Ot<=0?0:Wt/Ot,re=w?i.scrollHeight:i.scrollWidth,Tt=w?i.clientHeight:i.clientWidth,It=(w?Z.current:dt.current)+ee*(re-Tt);w?i.scrollTop=It:i.scrollLeft=It,r.preventDefault(),z(w)});function wt(r){M(r.pointerType==="touch")}o(wt,"handleTouchModalityChange");function pt(r){if(wt(r),r.pointerType!=="touch"){let i=Lt(K.current,r.target);k(i)}}o(pt,"handlePointerEnterOrMove");let mt=s.useMemo(()=>({scrolling:B||et,hasOverflowX:!H.x,hasOverflowY:!H.y,overflowXStart:R.xStart,overflowXEnd:R.xEnd,overflowYStart:R.yStart,overflowYEnd:R.yEnd,cornerHidden:H.corner}),[B,et,H.x,H.y,H.corner,R]),Ct={role:"presentation",onPointerEnter:pt,onPointerMove:pt,onPointerDown:wt,onPointerLeave(){k(!1)},style:{position:"relative",[Ft]:`${$.height}px`,[jt]:`${$.width}px`}},Ht=X("div",t,{state:mt,ref:[l,K],props:[Ct,c],stateAttributesMapping:st}),Qt=s.useMemo(()=>({handlePointerDown:Mt,handlePointerMove:Rt,handlePointerUp:yt,handleScroll:q,disableViewportSnap:J,cornerSize:$,setCornerSize:G,thumbSize:bt,setThumbSize:ut,hasMeasuredScrollbar:xt,setHasMeasuredScrollbar:d,touchModality:ft,cornerRef:F,scrollingX:B,scrollingY:et,hovering:it,setHovering:k,viewportRef:n,scrollbarYRef:a,scrollbarXRef:f,thumbYRef:u,thumbXRef:S,rootId:_,hiddenState:H,setHiddenState:h,overflowEdges:R,setOverflowEdges:ot,viewportState:mt,overflowEdgeThreshold:{xStart:m,xEnd:b,yStart:E,yEnd:P}}),[Mt,Rt,yt,q,J,$,bt,xt,ft,B,et,it,_,H,R,mt,m,b,E,P]);return(0,Ee.jsxs)(le.Provider,{value:Qt,children:[!U&&kt.getElement(L),Ht]})},"ScrollAreaRoot"));function er(e){let t=typeof e=="number"?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}o(er,"normalizeOverflowEdgeThreshold");var St=O(Q(),1);var Bt=O(Q(),1);var se=Bt.createContext(void 0);function Ce(){let e=Bt.useContext(se);if(e===void 0)throw new Error(At(55));return e}o(Ce,"useScrollAreaViewportContext");var Oe="--scroll-area-overflow-x-start",Te="--scroll-area-overflow-x-end",Ne="--scroll-area-overflow-y-start",Ve="--scroll-area-overflow-y-end";var Gt="--scroll-area-thumb-height",Kt="--scroll-area-thumb-width";var Xe=O(_t(),1);var Pe=[Oe,Te,Ne,Ve],De=!1;function or(){De||fe.engine.webkit||(typeof CSS<"u"&&"registerProperty"in CSS&&Pe.forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),De=!0)}o(or,"removeCSSVariableInheritance");var We=St.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{viewportRef:c,scrollbarYRef:m,scrollbarXRef:b,thumbYRef:E,thumbXRef:P,cornerRef:_,cornerSize:y,setCornerSize:T,setThumbSize:L,rootId:U,setHiddenState:it,hiddenState:k,setHasMeasuredScrollbar:B,handleScroll:tt,touchModality:et,setHovering:rt,setOverflowEdges:ft,overflowEdgeThreshold:M,viewportState:xt}=j(),d=Ut(),$=St.useRef(!0),G=St.useRef([NaN,NaN,NaN,NaN]),bt=gt(),ut=gt(),R=lt(()=>{let n=c.current,a=m.current,f=b.current,u=E.current,S=P.current,F=_.current;if(!n)return;let A=n.scrollHeight,C=n.scrollWidth,N=n.clientHeight,Z=n.clientWidth,dt=n.scrollTop,D=n.scrollLeft,Y=G.current,W=Number.isNaN(Y[0]);if(Y[0]=N,Y[1]=A,Y[2]=Z,Y[3]=C,W&&B(!0),A===0||C===0)return;let z=nr(n),q=z.y,J=z.x,Mt=Z/C,yt=N/A,Rt=Math.max(0,C-Z),wt=Math.max(0,A-N),pt=0,mt=0;J||(pt=ne(d==="rtl"?-D:D,Rt),mt=Rt-pt);let Ct=q?0:ne(dt,wt),Ht=q?0:wt-Ct,Qt=J?0:Z,r=q?0:N,i=0,w=0;!J&&!q&&(i=a?.offsetWidth||0,w=f?.offsetHeight||0);let nt=y.width===0&&y.height===0,vt=nt?i:0,Dt=nt?w:0,Yt=I(f,"padding","x"),Xt=I(a,"padding","y"),Pt=I(S,"margin","x"),te=I(u,"margin","y"),Ot=Qt-Yt-Pt,Wt=r-Xt-te,ee=f?Math.min(f.offsetWidth-vt,Ot):Ot,re=a?Math.min(a.offsetHeight-Dt,Wt):Wt,Tt=Math.max(16,ee*Mt),zt=Math.max(16,re*yt);if(L(V=>Zt(V,{width:Tt,height:zt})),a&&u){let V=a.offsetHeight-zt-Xt-te,Nt=Ye(u,Gt,dt,wt,A,zt,V);u.style.transform=`translate3d(0,${Nt}px,0)`}if(f&&S){let V=f.offsetWidth-Tt-Yt-Pt,Nt=d==="rtl"?-D:D,ce=Ye(S,Kt,Nt,Rt,C,Tt,V);S.style.transform=`translate3d(${d==="rtl"?-ce:ce}px,0,0)`}let It=[pt,mt,Ct,Ht];Pe.forEach((V,Nt)=>{n.style.setProperty(V,`${It[Nt]}px`)}),F&&T(V=>Zt(V,{width:i,height:w})),it(V=>Zt(V,z));let Be={xStart:!J&&pt>M.xStart,xEnd:!J&&mt>M.xEnd,yStart:!q&&Ct>M.yStart,yEnd:!q&&Ht>M.yEnd};ft(V=>Zt(V,Be))});ht(()=>{or()},[]),ht(()=>{queueMicrotask(R)},[R,k,d,M.xStart,M.xEnd,M.yStart,M.yEnd]),ht(()=>{c.current?.matches(":hover")&&rt(!0)},[c,rt]),ht(()=>{let n=c.current;if(typeof ResizeObserver>"u"||!n)return;let a=!1,f=new ResizeObserver(()=>{if(!a){a=!0;let u=G.current;if(u[0]===n.clientHeight&&u[1]===n.scrollHeight&&u[2]===n.clientWidth&&u[3]===n.scrollWidth)return}R()});return f.observe(n),ut.start(0,()=>{let u=n.getAnimations({subtree:!0});u.length!==0&&Promise.allSettled(u.map(S=>S.finished)).then(R).catch(()=>{})}),()=>{f.disconnect(),ut.clear()}},[R,c,ut]);function ot(){$.current=!1}o(ot,"handleUserInteraction");let H={role:"presentation",...U&&{"data-id":`${U}-viewport`},tabIndex:k.x&&k.y?-1:0,className:kt.className,style:{overflow:"scroll"},onScroll(){c.current&&(R(),(et||!$.current)&&tt({x:c.current.scrollLeft,y:c.current.scrollTop}),bt.start(100,()=>{$.current=!0}))},onWheel:ot,onPointerMove:ot,onPointerEnter:ot,onKeyDown:ot},h=X("div",t,{ref:[l,c],state:xt,props:[H,x],stateAttributesMapping:st}),K=St.useMemo(()=>({computeThumbPosition:R}),[R]);return(0,Xe.jsx)(se.Provider,{value:K,children:h})},"ScrollAreaViewport"));function nr(e){let t=e.clientHeight>=e.scrollHeight,l=e.clientWidth>=e.scrollWidth;return{y:t,x:l,corner:t||l}}o(nr,"getHiddenState");function Zt(e,t){for(let l in t)if(e[l]!==t[l])return t;return e}o(Zt,"pickState");function Ye(e,t,l,v,g,p,x){let c=pe(l,0,v),m=l-c,b=Math.max(16,p*g/(g+Math.abs(m)));return e.style.setProperty(t,m?`${b}px`:""),(v?c/v*x:0)+(m>0?p-b:0)}o(Ye,"applyOverscrollThumb");var Jt=O(Q(),1);var qt=O(Q(),1);var ae=qt.createContext(void 0);function ze(){let e=qt.useContext(ae);if(e===void 0)throw new Error(At(54));return e}o(ze,"useScrollAreaScrollbarContext");var Ie=O(_t(),1);var _e=Jt.forwardRef(o(function(t,l){let{render:v,className:g,orientation:p="vertical",keepMounted:x=!1,style:c,...m}=t,{hovering:b,scrollingX:E,scrollingY:P,hiddenState:_,scrollbarYRef:y,scrollbarXRef:T,viewportRef:L,thumbYRef:U,thumbXRef:it,handlePointerDown:k,handlePointerUp:B,handleScroll:tt,disableViewportSnap:et,rootId:rt,thumbSize:ft,hasMeasuredScrollbar:M,viewportState:xt}=j(),d=p==="vertical",$={...xt,hovering:b,scrolling:d?P:E,orientation:p},G=Ut(),bt=!M&&!x,ut=d?_.y:_.x,R=x||!ut;Jt.useEffect(()=>{if(!R)return;let h=L.current,K=d?y.current:T.current;if(!K)return;function n(a){if(!h||a.ctrlKey)return;let f=!d,u=f?"scrollLeft":"scrollTop",S=f?a.deltaX:a.deltaY;if(S===0)return;let F=f?h.scrollWidth-h.clientWidth:h.scrollHeight-h.clientHeight,A=f&&G==="rtl"?-F:0,C=f&&G==="rtl"?0:F,N=h[u];N<=A&&S<0||N>=C&&S>0||(a.preventDefault(),h[u]=Math.min(C,Math.max(A,N+S)),tt({x:h.scrollLeft,y:h.scrollTop}))}return o(n,"handleWheel"),de(K,"wheel",n,{passive:!1})},[G,tt,d,T,y,R,L]);let ot={...rt&&{"data-id":`${rt}-scrollbar`},"aria-hidden":!0,onPointerDown(h){if(h.button!==0)return;let K=ue(h.nativeEvent),n=d?U.current:it.current;if(n&&Lt(n,K))return;let a=L.current;if(!a)return;let f=d?y.current:T.current;if(!n||!f)return;let u=d?"y":"x",S=I(n,"margin",u),F=I(f,"padding",u),A=d?n.offsetHeight:n.offsetWidth,C=f.getBoundingClientRect(),N=d?h.clientY-C.top-A/2-F+S/2:h.clientX-C.left-A/2-F+S/2,Z=d?a.scrollHeight:a.scrollWidth,dt=d?a.clientHeight:a.clientWidth,Y=(d?f.offsetHeight:f.offsetWidth)-A-F-S;if(Y<=0)return;let W=N/Y,z=Z-dt;et(),d?a.scrollTop=W*z:G==="rtl"?a.scrollLeft=-(1-W)*z:a.scrollLeft=W*z,tt({x:a.scrollLeft,y:a.scrollTop}),k(h)},onMouseDown(h){h.preventDefault()},onPointerUp:B,onPointerCancel:B,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:bt?"hidden":void 0,...d?{top:0,bottom:`var(${Ft})`,insetInlineEnd:0,[Gt]:`${ft.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${jt})`,bottom:0,[Kt]:`${ft.width}px`}}},H=X("div",t,{ref:[l,d?y:T],state:$,props:[ot,m],stateAttributesMapping:st});return R?(0,Ie.jsx)(ae.Provider,{value:p,children:H}):null},"ScrollAreaScrollbar"));var Vt=O(Q(),1);var Le=Vt.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{computeThumbPosition:c}=Ce(),{hasMeasuredScrollbar:m,viewportState:b}=j(),E=Vt.useRef(null),P=Vt.useRef(m);return ht(()=>{if(typeof ResizeObserver>"u")return;let y=!1,T=new ResizeObserver(()=>{!y&&(y=!0,!P.current)||c()});return E.current&&T.observe(E.current),()=>{T.disconnect()}},[c]),X("div",t,{ref:[l,E],state:b,stateAttributesMapping:st,props:[{role:"presentation",style:{minWidth:"fit-content"}},x]})},"ScrollAreaContent"));var Ue=O(Q(),1);var ke=Ue.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{thumbYRef:c,thumbXRef:m,handlePointerDown:b,handlePointerMove:E,handlePointerUp:P,scrollingX:_,scrollingY:y,hasMeasuredScrollbar:T}=j(),L=ze(),U=L==="vertical";return X("div",t,{ref:[l,U?c:m],state:{scrolling:U?y:_,orientation:L},props:[{onPointerDown:b,onPointerMove:E,onPointerUp:P,onPointerCancel:P,style:{visibility:T?void 0:"hidden",...U?{height:"var(--scroll-area-thumb-height)"}:{width:"var(--scroll-area-thumb-width)"}}},x]})},"ScrollAreaThumb"));var $e=O(Q(),1);var Fe=$e.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{cornerRef:c,cornerSize:m,hiddenState:b}=j(),E=X("div",t,{ref:[l,c],props:[{"aria-hidden":!0,style:{position:"absolute",bottom:0,insetInlineEnd:0,width:m.width,height:m.height}},x]});return b.corner?null:E},"ScrollAreaCorner"));var ct=O(_t(),1);function No(e){let t=(0,je.c)(14),l,v,g;t[0]!==e?({className:v,children:l,...g}=e,t[0]=e,t[1]=l,t[2]=v,t[3]=g):(l=t[1],v=t[2],g=t[3]);let p;t[4]!==v?(p=oe("relative",v),t[4]=v,t[5]=p):p=t[5];let x;t[6]!==l?(x=(0,ct.jsx)(at.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:l}),t[6]=l,t[7]=x):x=t[7];let c,m;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,ct.jsx)(lr,{}),m=(0,ct.jsx)(at.Corner,{}),t[8]=c,t[9]=m):(c=t[8],m=t[9]);let b;return t[10]!==g||t[11]!==p||t[12]!==x?(b=(0,ct.jsxs)(at.Root,{"data-slot":"scroll-area",className:p,...g,children:[x,c,m]}),t[10]=g,t[11]=p,t[12]=x,t[13]=b):b=t[13],b}o(No,"z");function lr({className:e,orientation:t="vertical",...l}){return(0,ct.jsx)(at.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:oe("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-s data-vertical:border-s-transparent",e),...l,children:(0,ct.jsx)(at.Thumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-md bg-border"})})}o(lr,"h");export{No as a};
@@ -1,4 +1,4 @@
1
- import{a as Ie,b as Te,c as $e,d as je,e as Ee}from"./chunk-25WEL5RI.js";import"./chunk-O3AZ7JKE.js";import{c as Se}from"./chunk-CAEJQOMU.js";import"./chunk-D3DZZHZA.js";import{a as Ce}from"./chunk-RDS46R5R.js";import"./chunk-OVEOTKK5.js";import"./chunk-UBX5ZPLV.js";import"./chunk-VNH4OBJS.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import{a as ke}from"./chunk-645S7KRU.js";import{b as he}from"./chunk-3D67ZJRW.js";import{a as Ne}from"./chunk-6YBEKVUG.js";import"./chunk-ZSWW2UGP.js";import"./chunk-QRA7AKYO.js";import"./chunk-MWYGLPDV.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as se}from"./chunk-KBYFBEG2.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import"./chunk-YUVGMKHG.js";import{a as Q}from"./chunk-6A6AELDJ.js";import{c as xe,d as ve}from"./chunk-CLQKKJHL.js";import{a as pe,e as fe}from"./chunk-OSHODLMU.js";import{c as oe,d as be,n as ye}from"./chunk-PFPJA2HR.js";import"./chunk-ZPQBVYNN.js";import{B as re,b as Y,h as te,i as B,j as U,s as le}from"./chunk-PUK3H4RN.js";import"./chunk-PDBW6GTJ.js";import{a as Je}from"./chunk-GWNGVKLG.js";import{a as Pe,b as Ve}from"./chunk-6G3E4PJ2.js";import{a,d as me}from"./chunk-5PEAXTYQ.js";var ce=me(Je(),1);var E=me(Pe(),1);var m=me(Ve(),1);var We=a(t=>`${JSON.stringify({end:!0,rows:t})}
1
+ import{a as Ie,b as Te,c as $e,d as je,e as Ee}from"./chunk-4XNMLHOA.js";import"./chunk-T7UKRA6J.js";import{c as Se}from"./chunk-D5VO54BI.js";import"./chunk-BOYBN3TE.js";import{a as Ce}from"./chunk-FOURRGSO.js";import"./chunk-YU67D2FL.js";import"./chunk-LMCBMC2V.js";import"./chunk-QF743FSL.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import{a as ke}from"./chunk-5G2OOLMF.js";import{b as he}from"./chunk-EDL46BPM.js";import{a as Ne}from"./chunk-V4D77Q45.js";import"./chunk-4KPATTV6.js";import"./chunk-N7FOBAV3.js";import"./chunk-A5INOAIL.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as se}from"./chunk-SZCXVIVT.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import"./chunk-L27FKJTG.js";import{a as Q}from"./chunk-LYVYUTQY.js";import{c as xe,d as ve}from"./chunk-AKC4XWCD.js";import{a as pe,e as fe}from"./chunk-CB22PV3X.js";import{c as oe,d as be,n as ye}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as re,b as Y,h as te,i as B,j as U,s as le}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as Je}from"./chunk-A6TVTNKO.js";import{a as Pe,b as Ve}from"./chunk-ADABTCDI.js";import{a,d as me}from"./chunk-5PEAXTYQ.js";var ce=me(Je(),1);var E=me(Pe(),1);var m=me(Ve(),1);var We=a(t=>`${JSON.stringify({end:!0,rows:t})}
2
2
  `,"Ue"),ze=a(t=>{if(t===null||typeof t!="object"||Array.isArray(t))return;let e=t;if(!(e.end!==!0||e.table!==void 0))return typeof e.rows=="number"&&Number.isSafeInteger(e.rows)&&e.rows>=0?e.rows:Number.NaN},"Ve"),He=a(()=>{let t=0,e;return{problem:a(()=>e===void 0?'the export has no end marker: it was written before exports carried an end marker, or it was cut short. If you have checked that the file is complete, append {"end":true,"rows":N} as its last line, N being its exact row count':e===t?void 0:`the export's end marker declares ${String(e)} row(s) but ${String(t)} were read`,"problem"),read:a(r=>{if(e!==void 0)throw new Error("the export continues after its end marker");let n=ze(r);return n===void 0?(t+=1,!0):(e=n,!1)},"read")}},"Xe"),_=class extends Error{static{a(this,"Z")}problem;constructor(e){super(e.kind),this.name="CsvFormatError",this.problem=e}},Ze="\uFEFF",Ge=a(()=>{let t=[],e=1,r=!1,n=!1,o="start",l="",i=a(()=>{t.push(o==="closing"||l!==""?l:void 0),o="start",l=""},"l"),c=a(s=>{i(),t.some(p=>p!==void 0)&&s.push({cells:t,number:e}),t=[],e+=1},"c"),u=a((s,p)=>{let f=r;if(r=!1,!(f&&s===`
3
3
  `)){if(o==="quoted"){s==='"'?o="closing":l+=s;return}if(o==="closing"&&s==='"'){l+=s,o="quoted";return}if(s===","){i();return}if(s==="\r"){c(p),r=!0;return}if(s===`
4
4
  `){c(p);return}if(o==="closing")throw new _({kind:"text-after-quote",record:e});if(o==="start"&&s==='"'){o="quoted";return}o="unquoted",l+=s}},"d");return{finish:a(()=>{if(o==="quoted")throw new _({kind:"unterminated-quote",record:e});let s=[];return c(s),s},"finish"),push:a(s=>{let p=[],f=0;for(!n&&s!==""&&(n=!0,f=s.startsWith(Ze)?1:0);f<s.length;f+=1)u(s.charAt(f),p);return p},"push")}},"He"),Oe=a(async function*(t){let e=Ge();for await(let r of t)yield*e.push(r);yield*e.finish()},"be"),ie=a((t,e,r)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0})},"ne"),Ae=a(t=>{let e=[],r=new Set;return t.forEach((n,o)=>{let l=(n??"").trim();if(l==="")throw new _({column:o+1,kind:"empty-header"});if(r.has(l))throw new _({kind:"duplicate-header",name:l});r.add(l),e.push(l)}),e},"Ne"),Ke=a(({cells:t,number:e},r,n)=>{if(t.length!==r.length)throw new _({expected:r.length,found:t.length,kind:"ragged",record:e});let o={};return r.forEach((l,i)=>{let c=t[i];c!==void 0?ie(o,l,c):n.has(l)&&ie(o,l,null)}),{doc:o,record:e}},"Ce"),Qe=/^-?\d+$/u,Xe=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/iu,Ye=/^-?\d{11,}$/u,et=/^(\d{4})-(\d{2})-(\d{2})$/u,tt=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:\d{2})?$/u,rt=/\.(\d+)/u,nt=/[1-9]/u,ot=/^[+-]?(\d*)(?:\.(\d*))?(?:e([+-]?\d+))?$/iu,Le=a(t=>{let[,e="",r="",n="0"]=ot.exec(t)??[],o=`${e}${r}`,l=0,i=o.length;for(;l<i&&o.charAt(l)==="0";)l+=1;for(;i>l&&o.charAt(i-1)==="0";)i-=1;return l===i?{digits:"",exponent:0}:{digits:o.slice(l,i),exponent:Number(n)-r.length+(o.length-i)}},"he"),lt=a((t,e)=>{let r=Le(t),n=Le(e.toExponential());return r.digits===n.digits&&r.exponent===n.exponent?!0:r.digits!==""&&r.exponent>=0&&Number.isInteger(e)&&BigInt(r.digits)*10n**BigInt(r.exponent)===BigInt(Math.abs(e))},"rt"),st=a(t=>{let e=t.trim();if(!Xe.test(e))return;let r=Number(e);if(Number.isFinite(r))return lt(e,r)?{number:r}:{inexact:!0}},"nt"),at=a((t,e,r)=>{let n=new Date(0);return n.setUTCFullYear(t,e-1,r),n.getUTCMonth()===e-1&&n.getUTCDate()===r},"ot"),it=a((t,e,r,n)=>Number(t)<=23&&Number(e)<=59&&Number(r)<=59&&(n==="Z"||Number(n.slice(1,3))<=23&&Number(n.slice(4,6))<=59),"st"),dt=a(t=>{let[e="",r,...n]=t.split("T"),o=et.exec(e),l=r===void 0?void 0:tt.exec(r);if(o===null||n.length>0||r!==void 0&&l===null)return;let[,i="",c="",u=""]=o;if(!at(Number(i),Number(c),Number(u)))return;let[,s="0",p="0",f="0",w]=l??[];if(!it(s,p,f,w??"Z"))return;let g=rt.exec(r??"")?.[1]??"";if(nt.test(g.slice(3)))return;let x=Date.parse(l!==void 0&&w===void 0?`${t}Z`:t);return Number.isFinite(x)?x:void 0},"it"),ct=a(t=>{let e=st(t);return e===void 0?{expected:"number",kind:"rejected"}:"number"in e?{kind:"ok",value:e.number}:{expected:"number",inexact:!0,kind:"rejected"}},"lt"),ut=a(t=>{let e=t.trim(),r=dt(e);return r===void 0&&Ye.test(e)&&(r=Number(e)),r===void 0||!Number.isFinite(new Date(r).getTime())?{expected:"date",kind:"rejected"}:{kind:"ok",value:r}},"at"),mt=a(t=>{try{return oe(t),!0}catch{return!1}},"ct"),pt=a((t,e)=>{if(e==="bigint"){let r=t.trim();if(!Qe.test(r))return{expected:"bigint",kind:"rejected"};let n=BigInt(r);return mt(n)?{kind:"ok",value:n}:{expected:"bigint",kind:"rejected",tooLong:!0}}if(e==="boolean"){let r=t.trim().toLowerCase();return r==="true"||r==="false"?{kind:"ok",value:r==="true"}:{expected:"boolean",kind:"rejected"}}return e==="number"?ct(t):e==="date"||e==="timestamp"?ut(t):{kind:"ok",value:t}},"dt"),De=a(({doc:t,record:e},r)=>{let n={};for(let[o,l]of Object.entries(t)){if(l===null){ie(n,o,null);continue}let i=pt(l,r.get(o));if(i.kind==="rejected")throw new _({column:o,expected:i.expected,...i.inexact===!0&&{inexact:!0},kind:"cell-type",record:e,...i.tooLong===!0&&{tooLong:!0},value:l});ie(n,o,i.value)}return{doc:n,record:e}},"ke"),ft=a(async function*(t,e,r){let n;for await(let o of Oe(t))n===void 0?n=Ae(o.cells):yield De(Ke(o,n,r),e)},"ut"),ht=a(t=>new Set(t.filter(e=>e.nullable===!0&&!e.optional).map(e=>e.name)),"ft"),qe=a(t=>{if(t instanceof _)return t;throw t},"we"),wt=a(async(t,e,r,n)=>{let o,l,i;for await(let u of Oe(t)){if(o===void 0){try{o=Ae(u.cells)}catch(p){l=qe(p),o=[]}continue}let s;try{s=De(Ke(u,o,r),e)}catch(p){i??=qe(p);continue}n(s)}let c=l??i;if(c!==void 0)throw c},"mt"),Be=te(Q.exportShard),ne=te(Q.importShard),gt=te(Q.listTables),bt=te(Q.describeTable),yt={},xt=a(t=>t.map(e=>JSON.stringify(oe(e))).join(`