@lunora/studio 1.0.0-alpha.59 → 1.0.0-alpha.60

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 (381) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -43
  3. package/dist/mount.js +1 -27
  4. package/dist/packem_chunks/ApiTab.js +1 -251
  5. package/dist/packem_chunks/AuditPanel.js +1 -200
  6. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -664
  7. package/dist/packem_chunks/ExportImportPanel.js +3 -198
  8. package/dist/packem_chunks/FileBrowser.js +4 -2955
  9. package/dist/packem_chunks/FunctionRunner.js +1 -326
  10. package/dist/packem_chunks/FunctionStatsPanel.js +1 -377
  11. package/dist/packem_chunks/HealthPanel.js +1 -648
  12. package/dist/packem_chunks/InsightsPanel.js +1 -462
  13. package/dist/packem_chunks/LogsPanel.js +1 -1303
  14. package/dist/packem_chunks/MailPanel.js +2 -353
  15. package/dist/packem_chunks/MetricsPanel.js +1 -1960
  16. package/dist/packem_chunks/MigrationsPanel.js +1 -239
  17. package/dist/packem_chunks/NotificationsPanel.js +1 -306
  18. package/dist/packem_chunks/PitrPanel.js +1 -252
  19. package/dist/packem_chunks/SchemaViewer.js +1 -2512
  20. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -95
  21. package/dist/packem_chunks/SettingsPanel.js +1 -391
  22. package/dist/packem_chunks/SqlEditorPanel.js +4 -2340
  23. package/dist/packem_chunks/TableEditor.js +1 -290
  24. package/dist/packem_chunks/agents-panel.js +1 -326
  25. package/dist/packem_chunks/analytics-panel.js +1 -261
  26. package/dist/packem_chunks/auth-audit-panel.js +1 -247
  27. package/dist/packem_chunks/auth-config-panel.js +1 -365
  28. package/dist/packem_chunks/auth-sessions-panel.js +1 -175
  29. package/dist/packem_chunks/containers-panel.js +1 -261
  30. package/dist/packem_chunks/dashboards-panel.js +1 -781
  31. package/dist/packem_chunks/fanout-panel.js +1 -482
  32. package/dist/packem_chunks/flags-panel.js +1 -176
  33. package/dist/packem_chunks/issues-panel.js +1 -427
  34. package/dist/packem_chunks/kv-browser.js +1 -1896
  35. package/dist/packem_chunks/log-drains-panel.js +4 -273
  36. package/dist/packem_chunks/organizations-panel.js +1 -3209
  37. package/dist/packem_chunks/payments-panel.js +1 -213
  38. package/dist/packem_chunks/permissions-panel.js +1 -805
  39. package/dist/packem_chunks/queues-panel.js +1 -1075
  40. package/dist/packem_chunks/rls-panel.js +1 -315
  41. package/dist/packem_chunks/schedule-panel.js +1 -831
  42. package/dist/packem_chunks/sparkline.js +1 -79
  43. package/dist/packem_chunks/storage-rules-panel.js +1 -140
  44. package/dist/packem_chunks/subscriptions-panel.js +1 -238
  45. package/dist/packem_chunks/sync-client-panel.js +1 -0
  46. package/dist/packem_chunks/traces-panel.js +1 -747
  47. package/dist/packem_chunks/users-panel.js +1 -1731
  48. package/dist/packem_chunks/vector-browser.js +1 -281
  49. package/dist/packem_chunks/workflows-panel.js +1 -562
  50. package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
  51. package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
  52. package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
  53. package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
  54. package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
  55. package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
  56. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
  57. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
  58. package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
  59. package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
  60. package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
  61. package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
  62. package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
  63. package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
  64. package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
  65. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
  66. package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
  67. package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
  68. package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
  69. package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
  70. package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
  71. package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
  72. package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
  73. package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
  74. package/dist/packem_shared/badge-BbuuAio7.js +1 -0
  75. package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
  76. package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
  77. package/dist/packem_shared/button-BkCrNcAs.js +1 -0
  78. package/dist/packem_shared/card-CIDGUN6K.js +1 -0
  79. package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
  80. package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
  81. package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
  82. package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
  83. package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
  84. package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
  85. package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
  86. package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
  87. package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
  88. package/dist/packem_shared/input-JHu63lTv.js +1 -0
  89. package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
  90. package/dist/packem_shared/label-6uP1obNF.js +1 -0
  91. package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
  92. package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
  93. package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
  94. package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
  95. package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
  96. package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
  97. package/dist/packem_shared/select-Bul-DeII.js +2 -0
  98. package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
  99. package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
  100. package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
  101. package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
  102. package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
  103. package/dist/packem_shared/table-DdJBrClo.js +2 -0
  104. package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
  105. package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
  106. package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
  107. package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
  108. package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
  109. package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
  110. package/dist/packem_shared/utils-bhneXptQ.js +1 -0
  111. package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
  112. package/dist/standalone/chunk-23HKRH5H.js +13 -0
  113. package/dist/standalone/chunk-2A4RKII2.js +1 -0
  114. package/dist/standalone/chunk-3DTM4GI5.js +1 -0
  115. package/dist/standalone/chunk-3MHKT76P.js +1 -0
  116. package/dist/standalone/chunk-46IB4C4Q.js +1 -0
  117. package/dist/standalone/chunk-4AYEV5UN.js +1 -0
  118. package/dist/standalone/chunk-4FNHHFWR.js +1 -0
  119. package/dist/standalone/chunk-6CLVIOCB.js +1 -0
  120. package/dist/standalone/chunk-6I62RSI5.js +1 -0
  121. package/dist/standalone/chunk-6OKDCV7J.js +1 -0
  122. package/dist/standalone/chunk-6P7HIPUE.js +1 -0
  123. package/dist/standalone/chunk-6UYILUSX.js +1 -0
  124. package/dist/standalone/chunk-725RLB7D.js +1 -0
  125. package/dist/standalone/chunk-7AZZ7OJO.js +1 -0
  126. package/dist/standalone/chunk-7CRLAMGB.js +1 -0
  127. package/dist/standalone/chunk-7Z5QEFR4.js +2 -0
  128. package/dist/standalone/chunk-AGVJJQFL.js +1 -0
  129. package/dist/standalone/chunk-AKTGRZXN.js +1 -0
  130. package/dist/standalone/chunk-BAIN7UJ4.js +1 -0
  131. package/dist/standalone/chunk-BHWSIIDT.js +1 -0
  132. package/dist/standalone/{chunk-L7SK4ZZD.js → chunk-C4O5UR4Y.js} +1 -1
  133. package/dist/standalone/chunk-C4VURT57.js +1 -0
  134. package/dist/standalone/chunk-CKO3F55C.js +4 -0
  135. package/dist/standalone/chunk-CVMRZUF5.js +4 -0
  136. package/dist/standalone/chunk-CWWGDW4V.js +1 -0
  137. package/dist/standalone/chunk-CYET4BRZ.js +1 -0
  138. package/dist/standalone/chunk-CZEUVNCQ.js +1 -0
  139. package/dist/standalone/chunk-FXFK4M4E.js +1 -0
  140. package/dist/standalone/chunk-FYAJPWE7.js +1 -0
  141. package/dist/standalone/chunk-GS7OBQO5.js +1 -0
  142. package/dist/standalone/chunk-GTXVH7I5.js +1 -0
  143. package/dist/standalone/chunk-H6SIM4BT.js +1 -0
  144. package/dist/standalone/chunk-H6WOFY6A.js +8 -0
  145. package/dist/standalone/chunk-HA34GYEX.js +1 -0
  146. package/dist/standalone/chunk-HMIOF5GV.js +1 -0
  147. package/dist/standalone/chunk-HY46NTNW.js +6 -0
  148. package/dist/standalone/chunk-IBCKC2BO.js +1 -0
  149. package/dist/standalone/chunk-ICKBVXPP.js +1 -0
  150. package/dist/standalone/chunk-IE4ROTQD.js +1 -0
  151. package/dist/standalone/chunk-IYYTWZ2E.js +2 -0
  152. package/dist/standalone/chunk-J2LMP2A7.js +1 -0
  153. package/dist/standalone/chunk-JC6WYIHM.js +1 -0
  154. package/dist/standalone/chunk-JKPK25JO.js +1 -0
  155. package/dist/standalone/chunk-JLFCXBNQ.js +1 -0
  156. package/dist/standalone/chunk-JRWBGR5B.js +1 -0
  157. package/dist/standalone/chunk-K5PFWU5J.js +1 -0
  158. package/dist/standalone/chunk-KJTLW5W2.js +11 -0
  159. package/dist/standalone/{chunk-HBGS4SEX.js → chunk-KLLYGWNF.js} +9 -9
  160. package/dist/standalone/chunk-KNN3ZEQ7.js +1 -0
  161. package/dist/standalone/{chunk-4QHKBC77.js → chunk-KOC5KV3E.js} +1 -1
  162. package/dist/standalone/chunk-KSRXMTBV.js +1 -0
  163. package/dist/standalone/chunk-KYCAYNXM.js +1 -0
  164. package/dist/standalone/chunk-KZ2YUNMR.js +1 -0
  165. package/dist/standalone/chunk-LKHUVEHX.js +1 -0
  166. package/dist/standalone/chunk-LPOKAJT4.js +4 -0
  167. package/dist/standalone/chunk-MZEK4SGD.js +1 -0
  168. package/dist/standalone/chunk-NCCUM26H.js +1 -0
  169. package/dist/standalone/chunk-O62HJZV3.js +1 -0
  170. package/dist/standalone/chunk-OTJOI23O.js +62 -0
  171. package/dist/standalone/chunk-P2NBOUGZ.js +1 -0
  172. package/dist/standalone/chunk-P4J6XNG3.js +1 -0
  173. package/dist/standalone/chunk-PGDWFWH5.js +1 -0
  174. package/dist/standalone/chunk-PR2SE2MD.js +1 -0
  175. package/dist/standalone/chunk-PTTDIYGP.js +1 -0
  176. package/dist/standalone/chunk-PWDMXMRD.js +1 -0
  177. package/dist/standalone/chunk-Q34MSC2F.js +1 -0
  178. package/dist/standalone/chunk-Q5WXTZWX.js +1 -0
  179. package/dist/standalone/chunk-QC5HCNJZ.js +4 -0
  180. package/dist/standalone/chunk-QJKRHZYV.js +1 -0
  181. package/dist/standalone/chunk-R43KHQDA.js +1 -0
  182. package/dist/standalone/chunk-RC2K5RBE.js +1 -0
  183. package/dist/standalone/chunk-RE6UWCMG.js +1 -0
  184. package/dist/standalone/chunk-RUP3M2GF.js +3 -0
  185. package/dist/standalone/chunk-SA6MBPBL.js +1 -0
  186. package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SEDZDNQF.js} +1 -1
  187. package/dist/standalone/chunk-SKHEGARW.js +1 -0
  188. package/dist/standalone/chunk-SKJZDOHG.js +1 -0
  189. package/dist/standalone/chunk-SNDYNCAA.js +1 -0
  190. package/dist/standalone/chunk-SZUHZ2OG.js +1 -0
  191. package/dist/standalone/chunk-TAE2H7PU.js +1 -0
  192. package/dist/standalone/chunk-TEIBKU46.js +1 -0
  193. package/dist/standalone/chunk-TO6NLVFD.js +1 -0
  194. package/dist/standalone/chunk-TYTJDFX2.js +1 -0
  195. package/dist/standalone/{chunk-LXULVPEM.js → chunk-UDZY7MKE.js} +3 -3
  196. package/dist/standalone/chunk-UHHTEBC3.js +1 -0
  197. package/dist/standalone/chunk-UNDFOYRI.js +1 -0
  198. package/dist/standalone/chunk-UNN4CESU.js +1 -0
  199. package/dist/standalone/chunk-UNXX5GQH.js +1 -0
  200. package/dist/standalone/{chunk-ZHVTQ37P.js → chunk-UREY4GLG.js} +1 -1
  201. package/dist/standalone/chunk-UWF5DOGV.js +1 -0
  202. package/dist/standalone/chunk-UY2Y5CXB.js +1 -0
  203. package/dist/standalone/{chunk-VLXV72QE.js → chunk-UZYGEOWY.js} +1 -1
  204. package/dist/standalone/chunk-V66TSUKV.js +1 -0
  205. package/dist/standalone/chunk-VEFNSN7P.js +1 -0
  206. package/dist/standalone/chunk-VUJGR4PB.js +1 -0
  207. package/dist/standalone/chunk-VUXJER3D.js +1 -0
  208. package/dist/standalone/chunk-W572365D.js +1 -0
  209. package/dist/standalone/chunk-WYFLGXZ3.js +3 -0
  210. package/dist/standalone/chunk-XDKFPBIL.js +1 -0
  211. package/dist/standalone/chunk-XRKCGQM2.js +1 -0
  212. package/dist/standalone/chunk-YNBJ6ICE.js +1 -0
  213. package/dist/standalone/chunk-YQ5PILIJ.js +1 -0
  214. package/dist/standalone/chunk-YT7VXQVX.js +1 -0
  215. package/dist/standalone/chunk-Z7MUQMLE.js +1 -0
  216. package/dist/standalone/chunk-ZFWEPGWG.js +1 -0
  217. package/dist/standalone/chunk-ZMFZRGAN.js +1 -0
  218. package/dist/standalone/studio.js +9 -214
  219. package/package.json +4 -4
  220. package/dist/packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js +0 -62
  221. package/dist/packem_shared/ApiDocsPanel-DNDpeR5O.js +0 -842
  222. package/dist/packem_shared/ApiReferencePanel-ChlRsAXU.js +0 -230
  223. package/dist/packem_shared/CommandPalette-BpkopP5f.js +0 -373
  224. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  225. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  226. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  227. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  228. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  229. package/dist/packem_shared/DataBrowser-obTn4sKX.js +0 -4493
  230. package/dist/packem_shared/DataFilters-B1Q7mrt7.js +0 -253
  231. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  232. package/dist/packem_shared/GlobalDataBrowser-BCaohHZ5.js +0 -293
  233. package/dist/packem_shared/HomePanel-DCRj3hGB.js +0 -14
  234. package/dist/packem_shared/OpenRpcReferencePanel-CIeQE1aE.js +0 -192
  235. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  236. package/dist/packem_shared/ScheduledJobs-BQzQo84k.js +0 -262
  237. package/dist/packem_shared/ShardInput-CZnpHILL.js +0 -107
  238. package/dist/packem_shared/Studio-DnlPCbID.js +0 -16
  239. package/dist/packem_shared/StudioApp-CzqlB4zO.js +0 -708
  240. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  241. package/dist/packem_shared/advisor-view-D95sN-wO.js +0 -159
  242. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  243. package/dist/packem_shared/alert-CdAET2K_.js +0 -68
  244. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  245. package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
  246. package/dist/packem_shared/browser-storage-L4gOP5gJ.js +0 -105
  247. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  248. package/dist/packem_shared/card-F2vH_aj2.js +0 -175
  249. package/dist/packem_shared/cf-links-SIbyi4Y1.js +0 -8
  250. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  251. package/dist/packem_shared/data-grid-BywzWfek.js +0 -183
  252. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
  253. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  254. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  255. package/dist/packem_shared/error-alert-D9uIFJUS.js +0 -114
  256. package/dist/packem_shared/grid-features-ZOLhHKrR.js +0 -809
  257. package/dist/packem_shared/home-panel-BRAA2UlM.js +0 -1889
  258. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  259. package/dist/packem_shared/internal-DzHCc2Rq.js +0 -131
  260. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  261. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  262. package/dist/packem_shared/log-fields-jEH83H2G.js +0 -18
  263. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
  264. package/dist/packem_shared/reference-view-DfXN7oWP.js +0 -2127
  265. package/dist/packem_shared/result-chart-Bf9mbCIo.js +0 -119
  266. package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
  267. package/dist/packem_shared/select-D9OwHEch.js +0 -273
  268. package/dist/packem_shared/shard-history-AxiJ1WPP.js +0 -16
  269. package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
  270. package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
  271. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  272. package/dist/packem_shared/studio-8QSXbZ98.js +0 -4192
  273. package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
  274. package/dist/packem_shared/table-list-sidebar-gCE17v9B.js +0 -842
  275. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  276. package/dist/packem_shared/trace-handoff-CGolF3KS.js +0 -38
  277. package/dist/packem_shared/use-admin-query-C7JNuQp-.js +0 -106
  278. package/dist/packem_shared/use-async-submit-rnSk_jXl.js +0 -91
  279. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  280. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  281. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
  282. package/dist/standalone/chunk-2K47A3P6.js +0 -1
  283. package/dist/standalone/chunk-2MLA6WFH.js +0 -1
  284. package/dist/standalone/chunk-2NGUNNGW.js +0 -1
  285. package/dist/standalone/chunk-2TJVFKD2.js +0 -1
  286. package/dist/standalone/chunk-2YTF6LJ6.js +0 -1
  287. package/dist/standalone/chunk-3GXGLNKW.js +0 -1
  288. package/dist/standalone/chunk-3HGNPZBN.js +0 -1
  289. package/dist/standalone/chunk-3LJEGSMK.js +0 -11
  290. package/dist/standalone/chunk-3OA7PECS.js +0 -6
  291. package/dist/standalone/chunk-4PC7IXNY.js +0 -1
  292. package/dist/standalone/chunk-56XQYNUJ.js +0 -1
  293. package/dist/standalone/chunk-5OIBXYZM.js +0 -1
  294. package/dist/standalone/chunk-5QT5JRXD.js +0 -3
  295. package/dist/standalone/chunk-6RLPR7PL.js +0 -1
  296. package/dist/standalone/chunk-6V74EUPK.js +0 -1
  297. package/dist/standalone/chunk-7EE33WLB.js +0 -1
  298. package/dist/standalone/chunk-7TJJXVSE.js +0 -1
  299. package/dist/standalone/chunk-AHILM3ZP.js +0 -1
  300. package/dist/standalone/chunk-AN4RKMKW.js +0 -1
  301. package/dist/standalone/chunk-APSSZB6Z.js +0 -1
  302. package/dist/standalone/chunk-AXNGWSBM.js +0 -1
  303. package/dist/standalone/chunk-AXZILWRM.js +0 -1
  304. package/dist/standalone/chunk-C7RHEBOH.js +0 -1
  305. package/dist/standalone/chunk-CKSHCYGC.js +0 -2
  306. package/dist/standalone/chunk-CSWIYOB3.js +0 -1
  307. package/dist/standalone/chunk-D3VAON25.js +0 -1
  308. package/dist/standalone/chunk-DDLQN67F.js +0 -1
  309. package/dist/standalone/chunk-DGHW5JG5.js +0 -1
  310. package/dist/standalone/chunk-DMCSOTAE.js +0 -3
  311. package/dist/standalone/chunk-E3BKETAS.js +0 -1
  312. package/dist/standalone/chunk-E3OXNN6O.js +0 -1
  313. package/dist/standalone/chunk-E6BOGDIS.js +0 -1
  314. package/dist/standalone/chunk-F2YMCQ6B.js +0 -1
  315. package/dist/standalone/chunk-F7GE4X2U.js +0 -1
  316. package/dist/standalone/chunk-FAVUOGJR.js +0 -1
  317. package/dist/standalone/chunk-FXP6256Q.js +0 -1
  318. package/dist/standalone/chunk-G6CTAYHJ.js +0 -1
  319. package/dist/standalone/chunk-GTM65MVX.js +0 -1
  320. package/dist/standalone/chunk-H42W62SE.js +0 -1
  321. package/dist/standalone/chunk-HTF5ZX4I.js +0 -8
  322. package/dist/standalone/chunk-HV7G6DFP.js +0 -5
  323. package/dist/standalone/chunk-I2PS4L74.js +0 -1
  324. package/dist/standalone/chunk-IYHPYY4A.js +0 -1
  325. package/dist/standalone/chunk-J6J54MBP.js +0 -1
  326. package/dist/standalone/chunk-J7OGP4NN.js +0 -1
  327. package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
  328. package/dist/standalone/chunk-JZLGLG4T.js +0 -1
  329. package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
  330. package/dist/standalone/chunk-KZ6INM5M.js +0 -1
  331. package/dist/standalone/chunk-L2LN3MK4.js +0 -4
  332. package/dist/standalone/chunk-LT3FH6MW.js +0 -1
  333. package/dist/standalone/chunk-LZUWZBPE.js +0 -1
  334. package/dist/standalone/chunk-M4JM3TOY.js +0 -1
  335. package/dist/standalone/chunk-MLA5ZAEB.js +0 -1
  336. package/dist/standalone/chunk-MRBI5HNQ.js +0 -1
  337. package/dist/standalone/chunk-N5XX4HOL.js +0 -6
  338. package/dist/standalone/chunk-N7SVJOHN.js +0 -1
  339. package/dist/standalone/chunk-NKFXMDOD.js +0 -1
  340. package/dist/standalone/chunk-NPSNKFHE.js +0 -1
  341. package/dist/standalone/chunk-O3NAGRTR.js +0 -1
  342. package/dist/standalone/chunk-O7FVPUCO.js +0 -1
  343. package/dist/standalone/chunk-OKQXTLFX.js +0 -1
  344. package/dist/standalone/chunk-OXHHSUXO.js +0 -1
  345. package/dist/standalone/chunk-QAFAJBAW.js +0 -1
  346. package/dist/standalone/chunk-QAIM6KWT.js +0 -1
  347. package/dist/standalone/chunk-QCPMTB6W.js +0 -1
  348. package/dist/standalone/chunk-QQ2LOSZL.js +0 -1
  349. package/dist/standalone/chunk-QVIPA6UJ.js +0 -1
  350. package/dist/standalone/chunk-QVUQXJCT.js +0 -4
  351. package/dist/standalone/chunk-R2GMHLJY.js +0 -1
  352. package/dist/standalone/chunk-RD5UG2YL.js +0 -1
  353. package/dist/standalone/chunk-RJTIP3WF.js +0 -1
  354. package/dist/standalone/chunk-RRCPZMC2.js +0 -22
  355. package/dist/standalone/chunk-SHERR7ZP.js +0 -1
  356. package/dist/standalone/chunk-SOC5CY3F.js +0 -1
  357. package/dist/standalone/chunk-SS7JLF2I.js +0 -4
  358. package/dist/standalone/chunk-SWWYUGPL.js +0 -2
  359. package/dist/standalone/chunk-TAD43CG5.js +0 -1
  360. package/dist/standalone/chunk-TTXRHJUP.js +0 -4
  361. package/dist/standalone/chunk-UK64ZSUW.js +0 -1
  362. package/dist/standalone/chunk-UKDHGVOC.js +0 -1
  363. package/dist/standalone/chunk-UPNTMJFF.js +0 -1
  364. package/dist/standalone/chunk-V43BLH4J.js +0 -1
  365. package/dist/standalone/chunk-VL23Y44O.js +0 -4
  366. package/dist/standalone/chunk-VXM5H542.js +0 -4
  367. package/dist/standalone/chunk-WMDH2CIZ.js +0 -1
  368. package/dist/standalone/chunk-WVTPZ6CM.js +0 -1
  369. package/dist/standalone/chunk-XN6QYJQ6.js +0 -13
  370. package/dist/standalone/chunk-XNJNSCLM.js +0 -1
  371. package/dist/standalone/chunk-Y4U6CC22.js +0 -1
  372. package/dist/standalone/chunk-Y572GMZE.js +0 -1
  373. package/dist/standalone/chunk-Y7PD5KP4.js +0 -76
  374. package/dist/standalone/chunk-YFIPHCEC.js +0 -1
  375. package/dist/standalone/chunk-YJXOWLFJ.js +0 -1
  376. package/dist/standalone/chunk-YNN6NFRZ.js +0 -1
  377. package/dist/standalone/chunk-YUGHRVPD.js +0 -1
  378. package/dist/standalone/chunk-ZIGWVHCS.js +0 -1
  379. package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
  380. package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
  381. /package/dist/standalone/{chunk-TEWVD66F.js → chunk-GXZAXNZI.js} +0 -0
@@ -1,5 +0,0 @@
1
- import{a as s,c as m,f as S}from"./chunk-RRCPZMC2.js";var O=m(o=>{"use strict";(function(){function c(){}s(c,"noop");function y(t){return""+t}s(y,"testStringCoercion");function _(t,e,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{y(a);var l=!1}catch{l=!0}return l&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object"),y(a)),{$$typeof:E,key:a==null?null:""+a,children:t,containerInfo:e,implementation:r}}s(_,"createPortal$1");function d(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(d,"getCrossOriginStringAs");function i(t){return t===null?"`null`":t===void 0?"`undefined`":t===""?"an empty string":'something with type "'+typeof t+'"'}s(i,"getValueDescriptorExpectingObjectForWarning");function u(t){return t===null?"`null`":t===void 0?"`undefined`":t===""?"an empty string":typeof t=="string"?JSON.stringify(t):typeof t=="number"?"`"+t+"`":'something with type "'+typeof t+'"'}s(u,"getValueDescriptorExpectingEnumForWarning");function p(){var t=f.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
2
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
3
- 2. You might be breaking the Rules of Hooks
4
- 3. You might have more than one copy of React in the same app
5
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t}s(p,"resolveDispatcher"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var v=S(),n={d:{f:c,r:s(function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},"r"),D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},E=Symbol.for("react.portal"),f=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,o.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error("Target container is not a DOM element.");return _(t,e,null,r)},o.flushSync=function(t){var e=f.T,r=n.p;try{if(f.T=null,n.p=2,t)return t()}finally{f.T=e,n.p=r,n.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},o.preconnect=function(t,e){typeof t=="string"&&t?e!=null&&typeof e!="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",u(e)):e!=null&&typeof e.crossOrigin!="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",i(e.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(t)),typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,n.d.C(t,e))},o.prefetchDNS=function(t){if(typeof t!="string"||!t)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(t));else if(1<arguments.length){var e=arguments[1];typeof e=="object"&&e.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",u(e)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",u(e))}typeof t=="string"&&n.d.D(t)},o.preinit=function(t,e){if(typeof t=="string"&&t?e==null||typeof e!="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",u(e)):e.as!=="style"&&e.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',u(e.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(t)),typeof t=="string"&&e&&typeof e.as=="string"){var r=e.as,a=d(r,e.crossOrigin),l=typeof e.integrity=="string"?e.integrity:void 0,g=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;r==="style"?n.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:a,integrity:l,fetchPriority:g}):r==="script"&&n.d.X(t,{crossOrigin:a,integrity:l,fetchPriority:g,nonce:typeof e.nonce=="string"?e.nonce:void 0})}},o.preinitModule=function(t,e){var r="";typeof t=="string"&&t||(r+=" The `href` argument encountered was "+i(t)+"."),e!==void 0&&typeof e!="object"?r+=" The `options` argument encountered was "+i(e)+".":e&&"as"in e&&e.as!=="script"&&(r+=" The `as` option encountered was "+u(e.as)+"."),r?console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",r):(r=e&&typeof e.as=="string"?e.as:"script",r)==="script"||(r=u(r),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',r,t)),typeof t=="string"&&(typeof e=="object"&&e!==null?(e.as==null||e.as==="script")&&(r=d(e.as,e.crossOrigin),n.d.M(t,{crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})):e==null&&n.d.M(t))},o.preload=function(t,e){var r="";if(typeof t=="string"&&t||(r+=" The `href` argument encountered was "+i(t)+"."),e==null||typeof e!="object"?r+=" The `options` argument encountered was "+i(e)+".":typeof e.as=="string"&&e.as||(r+=" The `as` option encountered was "+i(e.as)+"."),r&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',r),typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){r=e.as;var a=d(r,e.crossOrigin);n.d.L(t,r,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}},o.preloadModule=function(t,e){var r="";typeof t=="string"&&t||(r+=" The `href` argument encountered was "+i(t)+"."),e!==void 0&&typeof e!="object"?r+=" The `options` argument encountered was "+i(e)+".":e&&"as"in e&&typeof e.as!="string"&&(r+=" The `as` option encountered was "+i(e.as)+"."),r&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',r),typeof t=="string"&&(e?(r=d(e.as,e.crossOrigin),n.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0})):n.d.m(t))},o.requestFormReset=function(t){n.d.r(t)},o.unstable_batchedUpdates=function(t,e){return t(e)},o.useFormState=function(t,e,r){return p().useFormState(t,e,r)},o.useFormStatus=function(){return p().useHostTransitionStatus()},o.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var b=m((R,h)=>{"use strict";h.exports=O()});export{b as a};
@@ -1 +0,0 @@
1
- import{b as de,e as j}from"./chunk-QCPMTB6W.js";import{a as ce}from"./chunk-WMDH2CIZ.js";import"./chunk-Y7PD5KP4.js";import"./chunk-BJGBHGK3.js";import"./chunk-ZIGWVHCS.js";import"./chunk-KEGAWN6Y.js";import{b as ne}from"./chunk-RD5UG2YL.js";import{a as S}from"./chunk-Y572GMZE.js";import{a as ie}from"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import"./chunk-HV7G6DFP.js";import{b as A}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as E}from"./chunk-TEWVD66F.js";import{f as ae,g as le}from"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as D,f as T,g as H,h as Q,m as F,q as oe}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as h,e as k,f as ke,g as re,h as se,j as w}from"./chunk-RRCPZMC2.js";var ve=k(re(),1);var c=k(ke(),1);var ue=k(re(),1);var W=k(se(),1);var Ae={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive"},fe=h(()=>{let t=(0,ue.c)(16),e=D(),a=le(),s;e:switch(a){case"connected":{let n;t[0]!==e?(n=e("Connected"),t[0]=e,t[1]=n):n=t[1],s=n;break e}case"connecting":{let n;t[2]!==e?(n=e("Connecting\u2026"),t[2]=e,t[3]=n):n=t[3],s=n;break e}case"idle":{let n;t[4]!==e?(n=e("Idle"),t[4]=e,t[5]=n):n=t[5],s=n;break e}case"offline":{let n;t[6]!==e?(n=e("Offline"),t[6]=e,t[7]=n):n=t[7],s=n;break e}default:s=a}let l=Ae[a],d;t[8]!==l?(d=w("size-2 rounded-full",l),t[8]=l,t[9]=d):d=t[9];let u;t[10]!==d?(u=(0,W.jsxDEV)("span",{"aria-hidden":"true",className:d},void 0,!1),t[10]=d,t[11]=u):u=t[11];let i;return t[12]!==a||t[13]!==u||t[14]!==s?(i=(0,W.jsxDEV)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":a,"data-testid":"dash-connection",role:"status",children:[u,s]},void 0,!0),t[12]=a,t[13]=u,t[14]=s,t[15]=i):i=t[15],i},"ConnectionBadge");var r=k(se(),1);var me={completed:0,failed:2,in_progress:1},Re=h(t=>{let e=0,a=0,s=0,l=0,d=[];for(let{metrics:u}of t){if(u===null){l+=1;continue}s+=1,e+=u.requests,a+=u.errors,d.push(...u.history??[])}return{errors:a,failed:l,history:d,reachable:s,requests:e}},"sumShardMetrics"),Me=h(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.path);if(l===void 0){e.set(s.path,{...s});continue}l.calls+=s.calls,l.errors+=s.errors,l.totalDurationMs+=s.totalDurationMs,l.scans=(l.scans??0)+(s.scans??0),l.maxDurationMs=Math.max(l.maxDurationMs,s.maxDurationMs),l.lastCalledAt=Math.max(l.lastCalledAt,s.lastCalledAt),(s.lastErrorAt??0)>(l.lastErrorAt??0)&&(l.lastErrorAt=s.lastErrorAt,l.lastErrorMessage=s.lastErrorMessage)}return[...e.values()]},"mergeFunctionStats"),_e=h(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.id);if(l===void 0){e.set(s.id,s);continue}let d=me[s.status]-me[l.status];(d>0||d===0&&(s.updatedAt??0)>(l.updatedAt??0))&&e.set(s.id,s)}return[...e.values()]},"dedupeMigrations"),Ie=T(E.getAuthMetrics),Le=T(E.getFunctionStats),Ce=T(E.getLogs),Oe=T(E.getMetrics),qe=T(E.migrationStatus),De=5,he=2e3,Fe=5,pe=.01,ge=.05,je=.1,Ue=.3,Pe=1,Ge=50,X=h((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","rateLevel"),Ve=h((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","countLevel"),Be={crit:"destructive",ok:"secondary",warn:"default"},U=h((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"ratePercent"),Ke=h(t=>{let e=new Map;for(let s of t??[]){let l=e.get(s.bucketMs)??{calls:0,errors:0};l.calls+=s.calls,l.errors+=s.errors,e.set(s.bucketMs,l)}let a=[...e.entries()].toSorted((s,l)=>s[0]-l[0]);return{errors:a.map(([,s])=>s.errors),requests:a.map(([,s])=>s.calls)}},"requestErrorSeries"),$e=h(t=>{let e=0,a=0;for(let l of t)l.status==="failed"?e+=1:l.status==="in_progress"&&(a+=1);let s="ok";return e>0?s="crit":a>0&&(s="warn"),{failed:e,level:s,running:a}},"migrationSummary"),ze=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"),"migrationTileValue"),xe={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},Ne={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},He={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Qe=h(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","worstLevel"),P=h(t=>{let e=(0,ve.c)(19),{chart:a,label:s,level:l,testId:d,value:u}=t,i=xe[l],n;e[0]!==i?(n=w("size-1.5 shrink-0 rounded-full",i),e[0]=i,e[1]=n):n=e[1];let p;e[2]!==n?(p=(0,r.jsxDEV)("span",{"aria-hidden":"true",className:n},void 0,!1),e[2]=n,e[3]=p):p=e[3];let g;e[4]!==s||e[5]!==p?(g=(0,r.jsxDEV)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[p,s]},void 0,!0),e[4]=s,e[5]=p,e[6]=g):g=e[6];let b=Ne[l],m;e[7]!==b?(m=w("truncate text-2xl font-semibold tabular-nums",b),e[7]=b,e[8]=m):m=e[8];let f;e[9]!==m||e[10]!==d||e[11]!==u?(f=(0,r.jsxDEV)("span",{className:m,"data-testid":d,children:u},void 0,!1),e[9]=m,e[10]=d,e[11]=u,e[12]=f):f=e[12];let v;e[13]!==a||e[14]!==f?(v=(0,r.jsxDEV)("div",{className:"flex items-center justify-between gap-3",children:[f,a]},void 0,!0),e[13]=a,e[14]=f,e[15]=v):v=e[15];let x;return e[16]!==g||e[17]!==v?(x=(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:(0,r.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,v]},void 0,!0)},void 0,!1),e[16]=g,e[17]=v,e[18]=x):x=e[18],x},"SloCard"),We=h(async(t,e,a)=>{let s=await Promise.all(a.map(m=>{let f=H(m);return Promise.allSettled([t.query(Oe,{},f),t.query(Le,{},f),t.query(qe,{},f)])})),l=H(e),d=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[u,i,n]=await Promise.allSettled([t.query(Ce,{},l),t.query(Ie,{},l),d]),p=s.map(([m,f,v])=>({functions:f.status==="fulfilled"?f.value.functions:[],metrics:m.status==="fulfilled"?m.value:null,migrations:v.status==="fulfilled"?v.value.migrations:[]})),g=Re(p),b=s[0]?.[0];return{auth:i.status==="fulfilled"?i.value:null,entries:u.status==="fulfilled"?u.value.entries:[],functions:Me(p.map(m=>m.functions)),logsError:u.status==="rejected"?Q(u.reason):null,metricsError:g.reachable===0&&b?.status==="rejected"?Q(b.reason):null,migrations:_e(p.map(m=>m.migrations)),scheduler:n.status==="fulfilled"?n.value:null,totals:g}},"loadSloData"),ht=h(({initialShardKey:t})=>{let e=ae(),a=D(),[s,l]=(0,c.useState)([]),[d,u]=(0,c.useState)(null),[i,n]=(0,c.useState)(null),[p,g]=(0,c.useState)(null),[b,m]=(0,c.useState)([]),[f,v]=(0,c.useState)(null),[x,be]=(0,c.useState)(null),[we,Ee]=(0,c.useState)([]),[y]=(0,c.useState)(ie),R=(0,c.useRef)(!1),G=(0,c.useRef)(!0);(0,c.useEffect)(()=>(G.current=!0,()=>{G.current=!1}),[]);let M=t??"",_=(0,c.useCallback)(async()=>{if(R.current)return;R.current=!0;let o=await We(e,M,de(M,y));if(!G.current){R.current=!1;return}n(o.totals),g(o.metricsError),m(o.functions),Ee(o.migrations),l(o.entries),u(o.logsError),v(o.auth),be(o.scheduler),R.current=!1},[e,y,M]);(0,c.useEffect)(()=>{F(_())},[_]);let V=(0,c.useRef)(0),I=(0,c.useRef)(null),Se=h(()=>{let o=Date.now()-V.current;if(o>=he){V.current=Date.now(),F(_());return}I.current??=setTimeout(()=>{I.current=null,V.current=Date.now(),F(_())},he-o)},"scheduleFanOut");(0,c.useEffect)(()=>()=>{I.current!==null&&clearTimeout(I.current)},[]);let{data:J,liveError:Te}=ne(E.getMetrics,{},{live:!0,shardKey:M});(0,c.useEffect)(()=>{J!==void 0&&Se()},[J]);let B=s.filter(o=>o.level==="error"),K=B.slice(0,De),L=Ke(i?.history),Y=(0,c.useMemo)(()=>{let o=f?.history??[];return{attempts:o.map(N=>N.attempts),failures:o.map(N=>N.failures)}},[f?.history]),Z=b.filter(o=>o.calls>0).toSorted((o,N)=>N.errors/N.calls-o.errors/o.calls||N.calls-o.calls).slice(0,Fe),$=$e(we),ye=i===null||i.requests===0?0:i.errors/i.requests,z=X(ye,pe,ge),ee=f===null?"ok":X(f.failureRate,je,Ue),te=x===null?"ok":Ve(x.backlog,Pe,Ge),C=Qe([z,ee,te,$.level]),O,q;return C==="crit"?(O=a("Critical"),q=a("One or more service levels are breached.")):C==="warn"?(O=a("Degraded"),q=a("Some service levels need attention.")):(O=a("All systems healthy"),q=a("All service levels are within target.")),(0,r.jsxDEV)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[(0,r.jsxDEV)("div",{className:"flex items-center gap-3",children:[(0,r.jsxDEV)("span",{"aria-hidden":"true",className:w("flex size-10 shrink-0 items-center justify-center rounded-full",He[C]),children:(0,r.jsxDEV)("span",{className:w("size-3 rounded-full",xe[C])},void 0,!1)},void 0,!1),(0,r.jsxDEV)("div",{className:"grid leading-tight",children:[(0,r.jsxDEV)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:O},void 0,!1),(0,r.jsxDEV)("span",{className:"text-[13px] text-muted-foreground",children:q},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,r.jsxDEV)("div",{className:"text-end",children:[(0,r.jsxDEV)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Requests")},void 0,!1),(0,r.jsxDEV)("div",{className:"flex items-center justify-end gap-2",children:[L.requests.length>=2&&(0,r.jsxDEV)(j,{ariaLabel:a("Requests over time"),className:"h-6 w-20 text-foreground",series:L.requests,testId:"hl-spark-requests"},void 0,!1),(0,r.jsxDEV)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:(i?.requests??0).toString()},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"},void 0,!1),(0,r.jsxDEV)("div",{className:"text-end",children:[(0,r.jsxDEV)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Error rate")},void 0,!1),(0,r.jsxDEV)("div",{className:w("text-lg font-semibold tabular-nums",Ne[z]),"data-testid":"hl-error-rate",children:i===null?"\u2014":U(i.errors,i.requests)},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"},void 0,!1),(0,r.jsxDEV)("div",{className:"flex items-center gap-2",children:[(0,r.jsxDEV)(fe,{},void 0,!1),(0,r.jsxDEV)(ce,{message:Te,prefix:"hl"},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),p!==null&&(0,r.jsxDEV)("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:p},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,r.jsxDEV)(P,{chart:L.errors.length>=2?(0,r.jsxDEV)(j,{ariaLabel:a("Errors over time"),className:"h-7 w-20 text-destructive",series:L.errors,testId:"hl-spark-errors"},void 0,!1):void 0,label:a("Error rate"),level:z,testId:"hl-slo-errorrate",value:i===null?"\u2014":U(i.errors,i.requests)},void 0,!1),(0,r.jsxDEV)(P,{chart:Y.failures.length>=2?(0,r.jsxDEV)(j,{ariaLabel:a("Auth failures over time"),className:"h-7 w-20 text-destructive",series:Y.failures,testId:"hl-spark-auth"},void 0,!1):void 0,label:a("Auth failures"),level:ee,testId:"hl-slo-auth",value:f===null?"\u2014":U(f.failures,f.attempts)},void 0,!1),(0,r.jsxDEV)(P,{label:a("Scheduler backlog"),level:te,testId:"hl-slo-backlog",value:x===null?"\u2014":x.backlog.toString()},void 0,!1),(0,r.jsxDEV)(P,{label:a("Migrations"),level:$.level,testId:"hl-slo-migrations",value:ze($,a)},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,r.jsxDEV)(S,{className:"gap-0 py-0","data-testid":"hl-functions",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Functions by error rate")},void 0,!1)},void 0,!1),Z.length===0?(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:a("No function activity yet.")},void 0,!1):(0,r.jsxDEV)("ul",{className:"divide-y divide-border",children:Z.map(o=>(0,r.jsxDEV)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,r.jsxDEV)("span",{className:"truncate font-mono text-foreground",children:o.path},void 0,!1),(0,r.jsxDEV)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsxDEV)("span",{className:"tabular-nums text-muted-foreground",children:a("{count} calls",{count:o.calls.toString()})},void 0,!1),(0,r.jsxDEV)(A,{variant:Be[X(o.errors/o.calls,pe,ge)],children:U(o.errors,o.calls)},void 0,!1)]},void 0,!0)]},o.path,!0))},void 0,!1)]},void 0,!0),(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Recent errors")},void 0,!1),(0,r.jsxDEV)(A,{"data-testid":"hl-error-count",variant:B.length>0?"destructive":"outline",children:B.length},void 0,!1)]},void 0,!0),d!==null&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:d},void 0,!1),d===null&&K.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:a("No recent errors.")},void 0,!1),K.length>0&&(0,r.jsxDEV)("ul",{className:"divide-y divide-border",children:K.map((o,N)=>(0,r.jsxDEV)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,r.jsxDEV)("span",{className:"flex items-center gap-2",children:[(0,r.jsxDEV)("time",{className:"shrink-0 text-muted-foreground",children:oe(o.timestamp)},void 0,!1),o.functionPath!==void 0&&(0,r.jsxDEV)("span",{className:"truncate font-mono text-foreground",children:o.functionPath},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("span",{className:"text-destructive",children:o.message},void 0,!1)]},`${o.timestamp.toString()}-${N.toString()}`,!0))},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Shards seen")},void 0,!1),(0,r.jsxDEV)(A,{"data-testid":"hl-shard-count",variant:"outline",children:y.length},void 0,!1)]},void 0,!0),y.length>0&&(0,r.jsxDEV)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:y.map(o=>(0,r.jsxDEV)("li",{"data-testid":"hl-shard",children:(0,r.jsxDEV)(A,{variant:"secondary",children:o},void 0,!1)},o,!1))},void 0,!1)]},void 0,!0)]},void 0,!0)},"HealthPanel");export{ht as HealthPanel};
@@ -1 +0,0 @@
1
- var s="https://dash.cloudflare.com/?to=/:account",L=`${s}/workers-and-pages/observability`,o=`${s}/workers-and-pages`,R=`${s}/r2`,a=`${s}/workers/d1`,r=`${s}/workers/durable-objects`;export{L as a,o as b,R as c,a as d,r as e};
@@ -1 +0,0 @@
1
- import{a as l,e as m,f as v,g as E}from"./chunk-RRCPZMC2.js";var R=m(E(),1),e=m(v(),1);var g=5e3,p=l((r,o,f)=>{let t=(0,R.c)(6),s=f===void 0?g:f,i=(0,e.useRef)(r),c;t[0]!==r?(c=l(()=>{i.current=r},"t1"),t[0]=r,t[1]=c):c=t[1],(0,e.useEffect)(c);let n,u;t[2]!==o||t[3]!==s?(n=l(()=>{if(!o)return;let a=setInterval(()=>{globalThis.document?.hidden!==!0&&i.current()},s);return()=>{clearInterval(a)}},"t2"),u=[o,s],t[2]=o,t[3]=s,t[4]=n,t[5]=u):(n=t[4],u=t[5]),(0,e.useEffect)(n,u)},"useAutoRefresh");export{p as a};
@@ -1 +0,0 @@
1
- import{b as ae}from"./chunk-RD5UG2YL.js";import{a as $,b as F,c as D,d as p,e as l,f as i}from"./chunk-GTM65MVX.js";import{a as R,e as _}from"./chunk-Y572GMZE.js";import{a as se}from"./chunk-VLXV72QE.js";import{R as te}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as T}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-CKSHCYGC.js";import{a as K}from"./chunk-TEWVD66F.js";import{f as Q}from"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as B}from"./chunk-TAD43CG5.js";import{d as V,f as X,g as Y,h as E,m as W}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as r,e as ee,f as re,h as le}from"./chunk-RRCPZMC2.js";var n=ee(re(),1);var e=ee(le(),1);var ie=["queued","running","paused","waiting","complete","errored","terminated"],ne=["pause","resume","terminate"],de="WORKFLOWS_NOT_CONFIGURED",ce=r(c=>typeof c=="object"&&c!==null&&c.code===de,"isNotConfigured"),fe=r(c=>{let s=c.error??c.output;if(s===void 0)return"\u2014";try{return JSON.stringify(s)}catch{return"(unserializable)"}},"formatStepPayload"),ue=r(({loadDetail:c,loadInstances:s,readOnly:y,runAction:L,workflowName:v})=>{let A=Q(),o=V(),[x,N]=(0,n.useState)(null),[k,I]=(0,n.useState)(null),[w,P]=(0,n.useState)(""),[g,h]=(0,n.useState)(null),[U,S]=(0,n.useState)(!1),[z,J]=(0,n.useState)(null),m=c??(a=>A.getWorkflowInstance(a)),O=y?void 0:L??(s===void 0?a=>A.setWorkflowInstanceStatus(a):void 0),j=r(async()=>{h(null),S(!1);let a=w===""?void 0:w;try{if(s===void 0){let d=await A.listWorkflowInstances({name:v,status:a});if(d.configured===!1){N(null),S(!0);return}N(d.instances);return}N(await s({name:v,status:a}))}catch(d){N(null),ce(d)?S(!0):h(E(d))}},"load");(0,n.useEffect)(()=>{I(null),W(j())},[v,w]);let G=r(async a=>{h(null);try{I(await m({id:a,name:v}))}catch(d){h(E(d))}},"openDetail"),H=r(async(a,d)=>{if(O!==void 0){J(a),h(null);try{await O({action:d,id:a,name:v}),await j()}catch(M){h(E(M))}finally{J(null)}}},"act");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,e.jsxDEV)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxDEV)("h3",{className:"text-sm font-medium",children:o("Instance history")},void 0,!1),(0,e.jsxDEV)("select",{"aria-label":o("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:r(a=>{P(a.target.value)},"onChange"),value:w,children:[(0,e.jsxDEV)("option",{value:"",children:o("All statuses")},void 0,!1),ie.map(a=>(0,e.jsxDEV)("option",{value:a,children:a},a,!1))]},void 0,!0)]},void 0,!0),g!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:g},void 0,!1),U&&(0,e.jsxDEV)(B,{description:o("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:o("Workflow inspection not configured")},void 0,!1),!U&&x!==null&&x.length===0&&(0,e.jsxDEV)(B,{description:o("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:o("No instances")},void 0,!1),x!==null&&x.length>0&&(0,e.jsxDEV)(R,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(_,{className:"px-0",children:(0,e.jsxDEV)($,{"data-testid":"workflow-instances-table",children:[(0,e.jsxDEV)(F,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(l,{children:o("Instance id")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Status")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Created")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Ended")},void 0,!1),(0,e.jsxDEV)(l,{"aria-label":o("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(D,{children:x.map(a=>(0,e.jsxDEV)(p,{"data-testid":`workflow-instance-${a.id}`,children:[(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:a.id},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:a.status},void 0,!1),(0,e.jsxDEV)(i,{className:"text-muted-foreground tabular-nums",children:a.createdOn??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"text-muted-foreground tabular-nums",children:a.endedOn??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"text-right",children:(0,e.jsxDEV)("div",{className:"flex justify-end gap-1.5",children:[(0,e.jsxDEV)(T,{"data-testid":`workflow-instance-steps-${a.id}`,onClick:r(()=>{W(G(a.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:o("Steps")},void 0,!1),O!==void 0&&ne.map(d=>(0,e.jsxDEV)(T,{"data-testid":`workflow-instance-${d}-${a.id}`,disabled:z===a.id,onClick:r(()=>{W(H(a.id,d))},"onClick"),size:"sm",type:"button",variant:"ghost",children:o(d)},d,!1))]},void 0,!0)},void 0,!1)]},a.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),k!==null&&(0,e.jsxDEV)(R,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,e.jsxDEV)(_,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,e.jsxDEV)("div",{className:"flex items-center justify-between",children:[(0,e.jsxDEV)("span",{className:"font-mono text-xs",children:[o("Steps")," \xB7 ",k.id]},void 0,!0),(0,e.jsxDEV)(T,{"data-testid":"workflow-instance-detail-close",onClick:r(()=>{I(null)},"onClick"),size:"xs",type:"button",variant:"ghost",children:o("Close")},void 0,!1)]},void 0,!0),k.steps.length===0?(0,e.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:o("This instance has no recorded steps yet.")},void 0,!1):(0,e.jsxDEV)($,{"data-testid":"workflow-instance-steps",children:[(0,e.jsxDEV)(F,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(l,{children:o("Step")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Type")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Attempts")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Started")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Output")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(D,{children:k.steps.map((a,d)=>(0,e.jsxDEV)(p,{"data-testid":`workflow-step-${String(d)}`,children:[(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:a.name},void 0,!1),(0,e.jsxDEV)(i,{className:"text-xs text-muted-foreground",children:a.type??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"tabular-nums",children:a.attempts??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"text-muted-foreground tabular-nums",children:a.start??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:fe(a)},void 0,!1)]},`${a.name}:${String(d)}`,!0))},void 0,!1)]},void 0,!0)]},void 0,!0)},void 0,!1)]},void 0,!0)},"WorkflowInstanceHistory"),me=X(K.createWorkflowInstance),ve=X(K.getWorkflowInstanceStatus),he=r(c=>{if(c.error)return`${c.error.name}: ${c.error.message}`;if(c.output===void 0)return"\u2014";try{return JSON.stringify(c.output)}catch{return"(unserializable)"}},"formatPayload"),Oe=r(()=>{let c=Q(),s=V(),{data:y,error:L}=ae(K.listWorkflows,{}),[v,A]=(0,n.useState)(""),[o,x]=(0,n.useState)(""),[N,k]=(0,n.useState)(""),[I,w]=(0,n.useState)(!1),[P,g]=(0,n.useState)(null),[h,U]=(0,n.useState)([]),[S,z]=(0,n.useState)(null),J=y!==void 0,m=(0,n.useMemo)(()=>Array.isArray(y?.workflows)?[...y.workflows].toSorted((t,u)=>t.exportName.localeCompare(u.exportName)):[],[y]),C=(0,n.useMemo)(()=>m.some(t=>t.exportName===v)?v:m[0]?.exportName??"",[m,v]),q=(0,n.useMemo)(()=>m.find(t=>t.exportName===C),[m,C]),O=r(t=>{U(u=>{let f=u.filter(b=>!(b.exportName===t.exportName&&b.id===t.id));return[t,...f]})},"upsertInstance"),j=r(async()=>{let t=C;if(t==="")return;let u,f=N.trim();if(f!=="")try{u=JSON.parse(f)}catch{g(s("Params must be valid JSON"));return}w(!0),g(null);try{let b=o.trim(),Z=await c.query(me,{exportName:t,id:b===""?void 0:b,params:u},Y(""));O({exportName:t,id:Z.id,status:Z.status}),x("")}catch(b){g(E(b))}finally{w(!1)}},"start"),G=r(()=>{W(j())},"startInstance"),H=r(async(t,u)=>{z(u);try{let f=await c.query(ve,{exportName:t,id:u},Y(""));O({error:f.error,exportName:t,id:f.id,output:f.output,status:f.status})}catch(f){g(E(f))}finally{z(null)}},"refreshInstance"),a=r(t=>{A(t.target.value)},"onSelectedExportChange"),d=r(t=>{x(t.target.value)},"onInstanceIdChange"),M=r(t=>{k(t.target.value)},"onParamsChange"),oe=r(t=>{let{export:u,id:f}=t.currentTarget.dataset;u!==void 0&&f!==void 0&&W(H(u,f))},"onRefreshClick");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[L!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:L},void 0,!1),(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:s("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")},void 0,!1),J&&m.length===0?(0,e.jsxDEV)(B,{description:s("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:s("No workflows defined")},void 0,!1):(0,e.jsxDEV)(R,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(_,{className:"px-0",children:(0,e.jsxDEV)($,{"data-testid":"workflows-table",children:[(0,e.jsxDEV)(F,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(l,{children:s("Export")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Name")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Class")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Binding")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(D,{children:m.map(t=>(0,e.jsxDEV)(p,{"data-testid":`workflows-row-${t.exportName}`,children:[(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:t.exportName},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:t.name},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:t.className},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:t.binding},void 0,!1)]},t.exportName,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),m.length>0&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,e.jsxDEV)("h3",{className:"text-sm font-medium",children:s("Start instance")},void 0,!1),P!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:P},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)("select",{"aria-label":s("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:a,value:C,children:m.map(t=>(0,e.jsxDEV)("option",{value:t.exportName,children:t.exportName},t.exportName,!1))},void 0,!1),(0,e.jsxDEV)(te,{"aria-label":s("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:d,placeholder:s("Instance id (optional)"),value:o},void 0,!1),(0,e.jsxDEV)(T,{"data-testid":"workflows-start-button",disabled:I||C==="",onClick:G,children:s(I?"Starting\u2026":"Start instance")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(se,{"aria-label":s("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:M,placeholder:s("Params (JSON, optional)"),value:N},void 0,!1)]},void 0,!0),h.length>0&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,e.jsxDEV)("h3",{className:"text-sm font-medium",children:s("Instances")},void 0,!1),(0,e.jsxDEV)(R,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(_,{className:"px-0",children:(0,e.jsxDEV)($,{"data-testid":"workflows-instances-table",children:[(0,e.jsxDEV)(F,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(l,{children:s("Workflow")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Instance id")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Status")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Output")},void 0,!1),(0,e.jsxDEV)(l,{},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(D,{children:h.map(t=>(0,e.jsxDEV)(p,{"data-testid":`workflows-instance-${t.id}`,children:[(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:t.exportName},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:t.id},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:t.status},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:he(t)},void 0,!1),(0,e.jsxDEV)(i,{children:(0,e.jsxDEV)(T,{"data-export":t.exportName,"data-id":t.id,"data-testid":`workflows-instance-refresh-${t.id}`,disabled:S===t.id,onClick:oe,size:"xs",variant:"outline",children:S===t.id?s("Refreshing\u2026"):s("Refresh")},void 0,!1)},void 0,!1)]},`${t.exportName}:${t.id}`,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),q!==void 0&&(0,e.jsxDEV)(ue,{workflowName:q.name},void 0,!1)]},void 0,!0)},"WorkflowsPanel");export{Oe as default};
@@ -1 +0,0 @@
1
- import{a as i,e as r,f as c,g as m,h as f,j as n}from"./chunk-RRCPZMC2.js";var p=r(m(),1),b=r(c(),1);var d=r(f(),1);function x(s){let e=(0,p.c)(8),t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=n("flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=(0,d.jsxDEV)("label",{"data-slot":"label",className:l,...a},void 0,!1),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}i(x,"Label");export{x as a};
@@ -1 +0,0 @@
1
- import{a as Nt,b as Pe,c as mt,d as dt,e as At,f as Pr}from"./chunk-3HGNPZBN.js";import{a as wr,b as Cr,c as Nr,d as Ar,e as Mr}from"./chunk-APSSZB6Z.js";import{a as Tr}from"./chunk-QAFAJBAW.js";import{A as Qo,B as er,C as tr,D as M,G as a,H as or,L as rr,Z as nr,a as Ho,ca as sr,d as jo,da as lr,ha as ir,ia as ar,ja as pt,k as Ht,la as ur,ma as fr,n as Xo,oa as mr,pa as dr,q as Ko,qa as gr,ra as Sr,ta as hr,ua as xr,va as Rr,wa as br,x as Jo,y as Zo}from"./chunk-SHERR7ZP.js";import{a as Yo,b as pr}from"./chunk-5OIBXYZM.js";import{a as qo,b as $o,c as cr}from"./chunk-L7SK4ZZD.js";import{a as yr,b as vr,i as Ir,j as Er,k as Ct}from"./chunk-4QHKBC77.js";import{C as ut,F as Wo,I as Le,K as $e,L as ft,M as io,N as Go,O as ge,P as xe,a as Ut,b as ct,c as Lo,e as Uo,f as ko,g as Ft,h as wt,i as Fo,p as Bt,y as Bo,z as zo}from"./chunk-VL23Y44O.js";import{b as jt}from"./chunk-UK64ZSUW.js";import{a as ee,c as de,e as kt}from"./chunk-O3NAGRTR.js";import{a as Et,c as Oo,d as _o,h as lo,i as Do,j as O}from"./chunk-CKSHCYGC.js";import{a as De}from"./chunk-3OA7PECS.js";import{a as r,d as mn,e as v,f as L,g as dn,h as gn,j as tt}from"./chunk-RRCPZMC2.js";var Ot=v(dn(),1),bc=v(L(),1);var me={};mn(me,{Arrow:()=>Co,Backdrop:()=>Ro,Group:()=>To,GroupLabel:()=>Mo,Icon:()=>mo,Item:()=>Io,ItemIndicator:()=>Eo,ItemText:()=>wo,Label:()=>uo,List:()=>vo,Popup:()=>yo,Portal:()=>xo,Positioner:()=>bo,Root:()=>Hr,ScrollDownArrow:()=>No,ScrollUpArrow:()=>Ao,Separator:()=>Tr,Trigger:()=>fo,Value:()=>po});var j=v(L(),1);var gt=v(L(),1);var zt=gt.createContext(null);zt.displayName="SelectRootContext";var Wt=gt.createContext(null);Wt.displayName="SelectFloatingContext";function U(){let e=gt.useContext(zt);if(e===null)throw new Error("Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");return e}r(U,"useSelectRootContext");function Gt(){let e=gt.useContext(Wt);if(e===null)throw new Error("Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");return e}r(Gt,"useSelectFloatingContext");var Vr=r((e,t)=>Object.is(e,t),"defaultItemEquality");function Ue(e,t,o){return e==null||t==null?Object.is(e,t):o(e,t)}r(Ue,"compareItemEquality");function Or(e,t,o){return!e||e.length===0?!1:e.some(n=>n===void 0?!1:Ue(t,n,o))}r(Or,"selectedValueIncludes");function ot(e,t,o){return!e||e.length===0?-1:e.findIndex(n=>n===void 0?!1:Ue(n,t,o))}r(ot,"findItemIndex");function _r(e,t,o){return e.filter(n=>!Ue(t,n,o))}r(_r,"removeItem");var Dr=v(L(),1);function Yt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}r(Yt,"serializeValue");var Lr=v(De(),1);function Ur(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}r(Ur,"isGroupedItems");function kr(e){if(!Array.isArray(e))return e!=null&&"null"in e;let t=e;if(Ur(t)){for(let o of t)for(let n of o.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(let o of t)if(o&&o.value==null&&o.label!=null)return!0;return!1}r(kr,"hasNullItemLabel");function ao(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Yt(e)}r(ao,"stringifyAsLabel");function je(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Yt(e.value):Yt(e)}r(je,"stringifyAsValue");function co(e,t,o){function n(){return ao(e,o)}if(r(n,"fallback"),o&&e!=null)return o(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??n();if(Array.isArray(t)){let l=t,c=Ur(l)?l.flatMap(s=>s.items):l;if(e==null||typeof e!="object"){let s=c.find(m=>m.value===e);return s&&s.label!=null?s.label:n()}if("value"in e){let s=c.find(m=>m&&m.value===e.value);if(s&&s.label!=null)return s.label}}return n()}r(co,"resolveSelectedLabel");function Fr(e,t,o){return e.reduce((n,l,c)=>(c>0&&n.push(", "),n.push((0,Lr.jsx)(Dr.Fragment,{children:co(l,t,o)},c)),n),[])}r(Fr,"resolveMultipleLabels");var i={id:M(e=>e.id),labelId:M(e=>e.labelId),modal:M(e=>e.modal),multiple:M(e=>e.multiple),items:M(e=>e.items),itemToStringLabel:M(e=>e.itemToStringLabel),itemToStringValue:M(e=>e.itemToStringValue),isItemEqualToValue:M(e=>e.isItemEqualToValue),value:M(e=>e.value),hasSelectedValue:M(e=>{let{value:t,multiple:o,itemToStringValue:n}=e;return t==null?!1:o&&Array.isArray(t)?t.length>0:je(t,n)!==""}),hasNullItemLabel:M((e,t)=>t?kr(e.items):!1),open:M(e=>e.open),mounted:M(e=>e.mounted),forceMount:M(e=>e.forceMount),transitionStatus:M(e=>e.transitionStatus),openMethod:M(e=>e.openMethod),activeIndex:M(e=>e.activeIndex),selectedIndex:M(e=>e.selectedIndex),isActive:M((e,t)=>e.activeIndex===t),isSelected:M((e,t)=>{let o=e.isItemEqualToValue,n=e.value;return e.multiple?Array.isArray(n)&&n.some(l=>Ue(t,l,o)):Ue(t,n,o)}),isSelectedByFocus:M((e,t)=>e.selectedIndex===t),popupProps:M(e=>e.popupProps),triggerProps:M(e=>e.triggerProps),triggerElement:M(e=>e.triggerElement),positionerElement:M(e=>e.positionerElement),listElement:M(e=>e.listElement),popupSide:M(e=>e.popupSide),scrollUpArrowVisible:M(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:M(e=>e.scrollDownArrowVisible),hasScrollArrows:M(e=>e.hasScrollArrows)};function Br(e,t,o=(n,l)=>n===l){return e.length===t.length&&e.every((n,l)=>o(n,t[l]))}r(Br,"areArraysEqual");var St=v(De(),1);function Hr(e){let{id:t,value:o,defaultValue:n=null,onValueChange:l,open:c,defaultOpen:s=!1,onOpenChange:m,name:f,form:p,autoComplete:g,disabled:h=!1,readOnly:R=!1,required:I=!1,modal:C=!0,actionsRef:k,inputRef:x,onOpenChangeComplete:J,items:B,multiple:N=!1,itemToStringLabel:b,itemToStringValue:D,isItemEqualToValue:P=Vr,highlightItemOnHover:ae=!0,children:te}=e,{clearErrors:q}=Lo(),{setDirty:se,setTouched:Se,setFocused:Re,validityData:z,setFilled:$,name:_,disabled:ce,validation:A,validationMode:Z}=ct(),H=Ft({id:t}),V=ce||h,u=_??f,[S,le]=io({controlled:o,default:N?n??lo:n,name:"Select",state:"value"}),[F,be]=io({controlled:c,default:s,name:"Select",state:"open"}),he=j.useRef([]),d=j.useRef([]),w=j.useRef(null),ue=j.useRef(null),Ne=j.useRef(0),T=j.useRef(null),X=j.useRef([]),W=j.useRef(!1),ve=j.useRef(null),ie=j.useRef(null),fe=j.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),pe=j.useRef(!1),{mounted:oe,setMounted:Ae,transitionStatus:Q}=ft(F),{openMethod:G,triggerProps:re}=ur(F),y=Oo(()=>new or({id:H,labelId:void 0,modal:C,multiple:N,itemToStringLabel:b,itemToStringValue:D,isItemEqualToValue:P,value:S,open:F,mounted:oe,transitionStatus:Q,items:B,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ze=a(y,i.activeIndex),Te=a(y,i.selectedIndex),Ve=a(y,i.triggerElement),ke=a(y,i.positionerElement),We=br(G),Ke=G??We??null,yt=j.useMemo(()=>N?"":je(S,D),[N,S,D]),Fe=j.useMemo(()=>N&&Array.isArray(S)?S.map(E=>je(E,D)):je(S,D),[N,S,D]),Je=Ht(y.state.triggerElement),ne=de(()=>Fe);Go(Je,H,S,ne,!V,f);let Be=j.useRef(S),He=N?Array.isArray(S)&&S.length>0:S!=null&&je(S,D)!=="";ee(()=>{S!==Be.current&&y.set("forceMount",!0)},[y,S]),ee(()=>{$(He)},[He,$]),ee(r(function(){let Y=X.current,Ie;if(N){let ye=Array.isArray(S)?S:[];if(ye.length===0)Ie=null;else{let qe=ye[ye.length-1],et=ot(Y,qe,P);Ie=et===-1?null:et}}else{let ye=ot(Y,S,P);Ie=ye===-1?null:ye}Ie===null&&(ie.current=null),!F&&y.set("selectedIndex",Ie)},"syncSelectedIndex"),[He,N,F,S,X,P,y,ie]);function Oe(E){let Y=z.initialValue;return Array.isArray(E)&&Array.isArray(Y)?!Br(E,Y,(Ie,ye)=>Ue(Ie,ye,P)):E!==Y}r(Oe,"isSelectedValueDirty"),cr(S,()=>{q(u),se(Oe(S)),A.change(S)});let nt=de((E,Y)=>{m?.(E,Y),!Y.isCanceled&&(be(E),!E&&(Y.reason===ge.focusOut||Y.reason===ge.outsidePress)&&(Se(!0),Re(!1),Z==="onBlur"&&A.commit(S)))}),st=de(()=>{Ae(!1),y.update({activeIndex:null,openMethod:null}),J?.(!1)});$e({enabled:!k,open:F,ref:w,onComplete(){F||st()}}),j.useImperativeHandle(k,()=>({unmount:st}),[st]);let Ge=de((E,Y)=>{l?.(E,Y),!Y.isCanceled&&le(E)}),_e=de(()=>{let E=y.state.listElement||w.current;if(!E)return;let Y=mt(E.scrollHeight,E.clientHeight),Ie=dt(E.scrollTop,Y),ye=Ie>0,qe=Ie<Y;y.state.scrollUpArrowVisible!==ye&&y.set("scrollUpArrowVisible",ye),y.state.scrollDownArrowVisible!==qe&&y.set("scrollDownArrowVisible",qe)}),Ze=nr({open:F,onOpenChange:nt,elements:{reference:Ve,floating:ke}}),lt=Zo(Ze,{enabled:!R&&!V,event:"mousedown"}),it=Qo(Ze),Ye=sr(Ze,{enabled:!R&&!V,listRef:he,activeIndex:ze,selectedIndex:Te,disabledIndices:lo,onNavigate(E){E===null&&!F||y.set("activeIndex",E)},focusItemOnHover:ae}),Qe=lr(Ze,{enabled:!R&&!V&&(F||!N),listRef:d,activeIndex:ze,selectedIndex:Te,disabledIndices:r(E=>Mr(he.current[E]),"disabledIndices"),onMatch(E){F?y.set("activeIndex",E):Ge(X.current[E],xe("none"))},onTyping(E){W.current=E}}),vt=j.useMemo(()=>{let E=Et(Qe.reference,Ye.reference,it.reference,lt.reference,re);return H&&(E.id=H),E},[lt.reference,Qe.reference,Ye.reference,it.reference,re,H]),It=j.useMemo(()=>Et(rr,Qe.floating,Ye.floating,it.floating),[Qe.floating,Ye.floating,it.floating]),_t=Ye.item??Do;tr(()=>{y.update({popupProps:It,triggerProps:vt})}),ee(()=>{y.update({id:H,modal:C,multiple:N,value:S,open:F,mounted:oe,transitionStatus:Q,popupProps:It,triggerProps:vt,items:B,itemToStringLabel:b,itemToStringValue:D,isItemEqualToValue:P,openMethod:Ke})},[y,H,C,N,S,F,oe,Q,It,vt,B,b,D,P,Ke]);let Me=j.useMemo(()=>({store:y,name:u,required:I,disabled:V,readOnly:R,multiple:N,highlightItemOnHover:ae,setValue:Ge,setOpen:nt,listRef:he,popupRef:w,scrollHandlerRef:ue,handleScrollArrowVisibility:_e,scrollArrowsMountedCountRef:Ne,itemProps:_t,valueRef:T,valuesRef:X,labelsRef:d,typingRef:W,selectionRef:fe,firstItemTextRef:ve,selectedItemTextRef:ie,validation:A,onOpenChangeComplete:J,alignItemWithTriggerActiveRef:pe,initialValueRef:Be}),[y,u,I,V,R,N,ae,Ge,nt,_t,A,J,_e]),at=_o(x,A.inputRef),Dt=N&&Array.isArray(S)&&S.length>0,Lt=N?void 0:u,no=j.useMemo(()=>!N||!Array.isArray(S)||!u?null:S.map(E=>{let Y=je(E,D);return(0,St.jsx)("input",{type:"hidden",form:p,name:u,value:Y,disabled:V},Y)}),[N,S,p,u,D,V]);return(0,St.jsx)(zt.Provider,{value:Me,children:(0,St.jsxs)(Wt.Provider,{value:Ze,children:[te,(0,St.jsx)("input",{...A.getValidationProps(V,{onFocus(){y.state.triggerElement?.focus({focusVisible:!0})},onChange(E){if(E.nativeEvent.defaultPrevented||V||R)return;let Y=E.currentTarget.value,Ie=xe(ge.none,E.nativeEvent);function ye(){if(N)return;let qe=Y.toLowerCase(),et=X.current.findIndex(so=>je(so,D).toLowerCase()===qe||ao(so,b).toLowerCase()===qe);et===-1&&(et=X.current.findIndex((so,pn)=>{let Vo=d.current[pn];return Vo!=null&&Vo.toLowerCase()===qe}));let Po=et===-1?void 0:X.current[et];Po!=null&&Ge(Po,Ie)}r(ye,"handleChange"),y.set("forceMount",!0),queueMicrotask(ye)}}),id:H&&Lt==null?`${H}-hidden-input`:void 0,form:p,name:Lt,autoComplete:g,value:yt,disabled:V,required:I&&!Dt,readOnly:R,ref:at,style:u?$o:qo,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),no]})})}r(Hr,"SelectRoot");var Wr=v(L(),1);function jr(e){return e==null?void 0:`${e}-label`}r(jr,"getDefaultLabelId");function zr(e,t){return e??t}r(zr,"resolveAriaLabelledBy");var uo=Wr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,m=s;delete m.id;let f=ct(),{store:p}=U(),g=a(p,i.triggerElement),h=a(p,i.id),R=jr(h),I=zo({id:R,fallbackControlId:g?.id??h,setLabelId(C){p.set("labelId",C)}});return O("div",t,{ref:o,state:f.state,props:[I,s],stateAttributesMapping:Ut})},"SelectLabel"));uo.displayName="SelectLabel";var ht=v(L(),1);var qt=2,Sn=400,hn={...ar,...Ut,popupSide:r(e=>e?{"data-popup-side":e}:null,"popupSide"),value:r(()=>null,"value")},fo=ht.forwardRef(r(function(t,o){let{render:n,className:l,id:c,disabled:s=!1,nativeButton:m=!0,style:f,...p}=t,{setTouched:g,setFocused:h,validationMode:R,state:I,disabled:C}=ct(),{labelId:k}=ko(),{store:x,setOpen:J,selectionRef:B,validation:N,readOnly:b,required:D,alignItemWithTriggerActiveRef:P,disabled:ae}=U(),te=C||ae||s,q=a(x,i.open),se=a(x,i.mounted),Se=a(x,i.value),Re=a(x,i.triggerProps),z=a(x,i.positionerElement),$=a(x,i.listElement),_=a(x,i.popupSide),ce=a(x,i.id),A=a(x,i.labelId),Z=a(x,i.hasSelectedValue),H=se&&z?_:null,V=c??ce,u=zr(k,A);Ft({id:V});let S=Ht(z),le=ht.useRef(null),{getButtonProps:F,buttonRef:be}=jt({disabled:te,native:m}),he=de(W=>{x.set("triggerElement",W)}),d=ut(),w=ut(),ue=ut();ht.useEffect(()=>{if(q)return ue.start(Sn,()=>{B.current.allowUnselectedMouseUp=!0,B.current.allowSelectedMouseUp=!0}),()=>{ue.clear()};B.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},w.clear()},[q,B,w,ue]);let Ne=Et(Re,{id:V,role:"combobox","aria-expanded":q?"true":"false","aria-haspopup":"listbox","aria-controls":q?$?.id??Bo(z)?.id:void 0,"aria-labelledby":u,"aria-readonly":b||void 0,"aria-required":D||void 0,tabIndex:te?-1:0,onFocus(W){h(!0),q&&P.current&&J(!1,xe(ge.none,W.nativeEvent)),d.start(0,()=>{x.set("forceMount",!0)})},onBlur(W){Bt(z,W.relatedTarget)||(g(!0),h(!1),R==="onBlur"&&N.commit(Se))},onMouseDown(W){if(q)return;let ve=wt(W.currentTarget);function ie(fe){if(!le.current)return;let pe=fe.target;if(Bt(le.current,pe)||Bt(S.current,pe))return;let oe=Ar(le.current);fe.clientX>=oe.left-qt&&fe.clientX<=oe.right+qt&&fe.clientY>=oe.top-qt&&fe.clientY<=oe.bottom+qt||J(!1,xe(ge.cancelOpen,fe))}r(ie,"handleMouseUp"),w.start(0,()=>{ve.addEventListener("mouseup",ie,{once:!0})})}},p,F),T=N.getValidationProps(te,Ne);T.role="combobox";let X={...I,open:q,disabled:te,value:Se,readOnly:b,popupSide:H,placeholder:!Z};return O("button",t,{ref:[o,le,be,he],state:X,stateAttributesMapping:hn,props:T})},"SelectTrigger"));fo.displayName="SelectTrigger";var Gr=v(L(),1);var xn={value:r(()=>null,"value")},po=Gr.forwardRef(r(function(t,o){let{className:n,render:l,children:c,placeholder:s,style:m,...f}=t,{store:p,valueRef:g}=U(),h=a(p,i.value),R=a(p,i.items),I=a(p,i.itemToStringLabel),C=a(p,i.hasSelectedValue),k=!C&&s!=null&&c==null,x=a(p,i.hasNullItemLabel,k),J={value:h,placeholder:!C},B=null;return typeof c=="function"?B=c(h):c!=null?B=c:!C&&s!=null&&!x?B=s:Array.isArray(h)?B=Fr(h,R,I):B=co(h,R,I),O("span",t,{state:J,ref:[o,g],props:[{children:B},f],stateAttributesMapping:xn})},"SelectValue"));po.displayName="SelectValue";var Yr=v(L(),1);var mo=Yr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),p={open:a(m,i.open)};return O("span",t,{state:p,ref:o,props:[{"aria-hidden":!0,children:"\u25BC"},s],stateAttributesMapping:ir})},"SelectIcon"));mo.displayName="SelectIcon";var qr=v(L(),1);var go=v(L(),1);var So=go.createContext(void 0);So.displayName="SelectPortalContext";var ho=v(De(),1);var xo=qr.forwardRef(r(function(t,o){let{store:n}=U(),l=a(n,i.mounted),c=a(n,i.forceMount);return l||c?(0,ho.jsx)(So.Provider,{value:!0,children:(0,ho.jsx)(Ko,{ref:o,...t})}):null},"SelectPortal"));xo.displayName="SelectPortal";var $r=v(L(),1);var Rn={...pt,...Le},Ro=$r.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),f=a(m,i.open),p=a(m,i.mounted),g=a(m,i.transitionStatus);return O("div",t,{state:{open:f,transitionStatus:g},ref:o,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:Rn})},"SelectBackdrop"));Ro.displayName="SelectBackdrop";var Ee=v(L(),1);var $t=v(L(),1);var Xt=$t.createContext(void 0);Xt.displayName="SelectPositionerContext";function Xe(){let e=$t.useContext(Xt);if(!e)throw new Error("Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.");return e}r(Xe,"useSelectPositionerContext");function xt(e,t){e&&Object.assign(e.style,t)}r(xt,"clearStyles");var Kt={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var Tt=v(De(),1);var bn={position:"fixed"},bo=Ee.forwardRef(r(function(t,o){let{anchor:n,positionMethod:l="absolute",className:c,render:s,side:m="bottom",align:f="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:h="clipping-ancestors",collisionPadding:R,arrowPadding:I=5,sticky:C=!1,disableAnchorTracking:k,alignItemWithTrigger:x=!0,collisionAvoidance:J=Xo,style:B,...N}=t,{store:b,listRef:D,labelsRef:P,alignItemWithTriggerActiveRef:ae,selectedItemTextRef:te,valuesRef:q,initialValueRef:se,popupRef:Se,setValue:Re}=U(),z=Gt(),$=a(b,i.open),_=a(b,i.mounted),ce=a(b,i.modal),A=a(b,i.value),Z=a(b,i.openMethod),H=a(b,i.positionerElement),V=a(b,i.triggerElement),u=a(b,i.isItemEqualToValue),S=a(b,i.transitionStatus),le=Ee.useRef(null),F=Ee.useRef(null),[be,he]=Ee.useState(x),d=_&&be&&Z!=="touch";!_&&be!==x&&he(x),ee(()=>{_||(i.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),i.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,_]),Ee.useImperativeHandle(ae,()=>d),hr((d||ce)&&$,Z==="touch",H,V);let w=mr({anchor:n,floatingRootContext:z,positionMethod:l,mounted:_,side:m,sideOffset:p,align:f,alignOffset:g,arrowPadding:I,collisionBoundary:h,collisionPadding:R,sticky:C,disableAnchorTracking:k??d,collisionAvoidance:J,keepMounted:!0}),ue=d?"none":w.side,Ne=d?bn:w.positionerStyles,T={open:$,side:ue,align:w.align,anchorHidden:w.anchorHidden};ee(()=>{b.set("popupSide",w.side)},[b,w.side]);let X=de(pe=>{b.set("positionerElement",pe)}),W=Sr(t,T,{styles:Ne,transitionStatus:S,props:N,refs:[o,X],hidden:!_,inert:!$}),ve=Ee.useRef(0),ie=de(pe=>{if(pe.size===0&&ve.current===0||q.current.length===0)return;let oe=ve.current;if(ve.current=pe.size,pe.size===oe)return;let Ae=xe(ge.none);if(oe!==0&&!b.state.multiple&&A!==null&&ot(q.current,A,u)===-1){let G=se.current,y=G!=null&&ot(q.current,G,u)!==-1?G:null;Re(y,Ae),y===null&&(b.set("selectedIndex",null),te.current=null)}if(oe!==0&&b.state.multiple&&Array.isArray(A)){let Q=r(re=>ot(q.current,re,u)!==-1,"hasVisibleItem"),G=A.filter(re=>Q(re));(G.length!==A.length||G.some(re=>!Or(A,re,u)))&&(Re(G,Ae),G.length===0&&(b.set("selectedIndex",null),te.current=null))}if($&&d){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let Q={height:""};xt(H,Q),xt(Se.current,Q)}}),fe=Ee.useMemo(()=>({...w,side:ue,alignItemWithTriggerActive:d,setControlledAlignItemWithTrigger:he,scrollUpArrowRef:le,scrollDownArrowRef:F}),[w,ue,d,he]);return(0,Tt.jsx)(Nr,{elementsRef:D,labelsRef:P,onMapChange:ie,children:(0,Tt.jsxs)(Xt.Provider,{value:fe,children:[_&&ce&&(0,Tt.jsx)(dr,{inert:fr(!$),cutout:V}),W]})})},"SelectPositioner"));bo.displayName="SelectPositioner";var we=v(L(),1);var Qt=v(De(),1);var yn={...pt,...Le},yo=we.forwardRef(r(function(t,o){let{render:n,className:l,style:c,finalFocus:s,...m}=t,{store:f,popupRef:p,onOpenChangeComplete:g,setOpen:h,valueRef:R,firstItemTextRef:I,selectedItemTextRef:C,multiple:k,handleScrollArrowVisibility:x,scrollHandlerRef:J,listRef:B,highlightItemOnHover:N}=U(),{side:b,align:D,alignItemWithTriggerActive:P,isPositioned:ae,setControlledAlignItemWithTrigger:te}=Xe(),q=Rr(!0)!=null,se=Gt(),Se=pr(),{nonce:Re,disableStyleElements:z}=Pr(),$=a(f,i.id),_=a(f,i.open),ce=a(f,i.openMethod),A=a(f,i.mounted),Z=a(f,i.popupProps),H=a(f,i.transitionStatus),V=a(f,i.triggerElement),u=a(f,i.positionerElement),S=a(f,i.listElement),le=we.useRef(!1),F=we.useRef(!1),be=we.useRef({}),he=Wo(),d=de(T=>{if(!u||!p.current||!F.current)return;if(le.current||!P){x();return}let X=u.style.top==="0px",W=u.style.bottom==="0px";if(!X&&!W){x();return}let ve=Kr(u),ie=Mt(u.getBoundingClientRect().height,"y",ve),fe=wt(u),pe=kt(u),oe=pe.getComputedStyle(u),Ae=parseFloat(oe.marginTop),Q=parseFloat(oe.marginBottom),G=Xr(pe.getComputedStyle(p.current)),re=Math.min(fe.documentElement.clientHeight-Ae-Q,G),y=T.scrollTop,ze=Jt(T),Te=0,Ve=null,ke=!1,We=!1,Ke=r(ne=>{u.style.height=`${ne}px`},"setHeight"),yt=r((ne,Be)=>{let He=Nt(ne,0,re-ie);He>0&&Ke(ie+He),T.scrollTop=Be,re-(ie+He)<=Pe&&(le.current=!0),x()},"handleSmallDiff"),Fe=X?ze-y:y,Je=Math.min(ie+Fe,re);if(Te=Je,Fe<=Pe){yt(Fe,X?ze:0);return}if(re-Je>Pe)X?We=!0:Ve=0;else if(ke=!0,W&&y<ze){let ne=ie+Fe-re;Ve=y-(Fe-ne)}if(Te=Math.ceil(Te),Te!==0&&Ke(Te),We||Ve!=null){let ne=Jt(T),Be=We?ne:Nt(Ve,0,ne);Math.abs(T.scrollTop-Be)>Pe&&(T.scrollTop=Be)}(ke||Te>=re-Pe)&&(le.current=!0),x()});we.useImperativeHandle(J,()=>d,[d]),$e({open:_,ref:p,onComplete(){_&&g?.(!0)}});let w={open:_,transitionStatus:H,side:b,align:D};ee(()=>{!u||!p.current||Object.keys(be.current).length||(be.current={top:u.style.top||"0",left:u.style.left||"0",right:u.style.right,height:u.style.height,bottom:u.style.bottom,minHeight:u.style.minHeight,maxHeight:u.style.maxHeight,marginTop:u.style.marginTop,marginBottom:u.style.marginBottom})},[p,u]),ee(()=>{_||P||(F.current=!1,le.current=!1,xt(u,be.current))},[_,P,u,p]),ee(()=>{let T=p.current;if(!_||!V||!u||!T||P&&!ae||f.state.transitionStatus==="ending")return;if(!P){F.current=!0,he.request(x),T.style.removeProperty("--transform-origin");return}let X=vn(T);T.style.removeProperty("--transform-origin");try{let W=C.current;W?.isConnected||(W=!i.hasSelectedValue(f.state)&&I.current?.isConnected?I.current:null);let ve=R.current,ie=kt(u),fe=ie.getComputedStyle(u),pe=ie.getComputedStyle(T),oe=wt(V),Ae=Kr(V),Q=Zt(V.getBoundingClientRect(),Ae),G=Zt(u.getBoundingClientRect(),Ae),re=Q.height,y=S||T,ze=y.scrollHeight,Te=parseFloat(pe.borderBottomWidth),Ve=parseFloat(fe.marginTop)||10,ke=parseFloat(fe.marginBottom)||10,We=parseFloat(fe.minHeight)||100,Ke=Xr(pe),yt=5,Fe=5,Je=20,ne=oe.documentElement.clientHeight-Ve-ke,Be=oe.documentElement.clientWidth,He=ne-Q.bottom+re,Oe,nt=Se==="rtl"?Q.right-G.width:Q.left,st=0;if(W&&ve){let Me=Zt(ve.getBoundingClientRect(),Ae);Oe=Zt(W.getBoundingClientRect(),Ae),nt=G.left+(Se==="rtl"?Me.right-Oe.right:Me.left-Oe.left);let at=Me.top-Q.top+Me.height/2;st=Oe.top-G.top+Oe.height/2-at}let Ge=He+st+ke+Te,_e=Math.min(ne,Ge),Ze=ne-Ve-ke,lt=Ge-_e,it=Be-Fe;u.style.left=`${Nt(nt,yt,it-G.width)}px`,u.style.height=`${_e}px`,u.style.maxHeight="none",u.style.marginTop=`${Ve}px`,u.style.marginBottom=`${ke}px`,T.style.height="100%";let Ye=Jt(y),Qe=lt>=Ye-Pe;Qe&&(_e=Math.min(ne,G.height)-(lt-Ye));let vt=Q.top<Je||Q.bottom>ne-Je||Math.ceil(_e)+Pe<Math.min(ze,We),It=(ie.visualViewport?.scale??1)!==1&&Fo.engine.webkit;if(vt||It){F.current=!0,xt(u,be.current),te(!1);return}let _t=Math.max(We,_e);if(Qe){let Me=Math.max(0,ne-Ge);u.style.top=G.height>=Ze?"0":`${Me}px`,u.style.height=`${_e}px`,y.scrollTop=Jt(y)}else u.style.bottom="0",y.scrollTop=lt;if(Oe){let Me=G.top,at=G.height,Dt=Oe.top+Oe.height/2,Lt=at>0?(Dt-Me)/at*100:50,no=Nt(Lt,0,100);T.style.setProperty("--transform-origin",`50% ${no}%`)}(_t===ne||_e>=Ke)&&(le.current=!0),x(),N&&f.state.selectedIndex===null&&f.state.activeIndex===null&&B.current[0]!=null&&f.set("activeIndex",0),F.current=!0}finally{X()}},[f,_,u,V,R,I,C,p,x,P,te,he,S,B,N,Se,ae]),we.useEffect(()=>{if(!P||!u||!_)return;let T=kt(u);function X(W){h(!1,xe(ge.windowResize,W))}return r(X,"handleResize"),Yo(T,"resize",X)},[h,P,u,_]);let ue={...S?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":k||void 0,id:`${$}-list`},onKeyDown(T){q&&xr.has(T.key)&&T.stopPropagation()},onScroll(T){S||d(T.currentTarget)},...P&&{style:S?{height:"100%"}:Kt}},Ne=O("div",t,{ref:[o,p],state:w,stateAttributesMapping:yn,props:[Z,ue,gr(H),{className:!S&&P?At.className:void 0},m]});return(0,Qt.jsxs)(we.Fragment,{children:[!z&&At.getElement(Re),(0,Qt.jsx)(Jo,{context:se,modal:!1,disabled:!A,openInteractionType:ce,returnFocus:s,restoreFocus:!0,children:Ne})]})},"SelectPopup"));yo.displayName="SelectPopup";function Xr(e){let t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}r(Xr,"getMaxPopupHeight");function Jt(e){return mt(e.scrollHeight,e.clientHeight)}r(Jt,"getMaxScrollTop");function Kr(e){return er.getScale(e)}r(Kr,"getScale");function Mt(e,t,o){return e/o[t]}r(Mt,"normalizeSize");function Zt(e,t){return jo({x:Mt(e.x,"x",t),y:Mt(e.y,"y",t),width:Mt(e.width,"x",t),height:Mt(e.height,"y",t)})}r(Zt,"normalizeRect");var Jr=[["transform","none"],["scale","1"],["translate","0 0"]];function vn(e){let{style:t}=e,o={};for(let[n,l]of Jr)o[n]=t.getPropertyValue(n),t.setProperty(n,l,"important");return()=>{for(let[n]of Jr){let l=o[n];l?t.setProperty(n,l):t.removeProperty(n)}}}r(vn,"unsetTransformStyles");var Zr=v(L(),1);var vo=Zr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m,scrollHandlerRef:f}=U(),{alignItemWithTriggerActive:p}=Xe(),g=a(m,i.hasScrollArrows),h=a(m,i.openMethod),R=a(m,i.multiple),C={id:`${a(m,i.id)}-list`,role:"listbox","aria-multiselectable":R||void 0,onScroll(x){f.current?.(x.currentTarget)},...p&&{style:Kt},className:g&&h!=="touch"?At.className:void 0},k=de(x=>{m.set("listElement",x)});return O("div",t,{ref:[o,k],props:[C,s]})},"SelectList"));vo.displayName="SelectList";var Ce=v(L(),1);var eo=v(L(),1);var to=eo.createContext(void 0);to.displayName="SelectItemContext";function Pt(){let e=eo.useContext(to);if(!e)throw new Error("Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.");return e}r(Pt,"useSelectItemContext");var Qr=v(De(),1);var Io=Ce.memo(Ce.forwardRef(r(function(t,o){let{render:n,className:l,style:c,value:s=null,label:m,disabled:f=!1,nativeButton:p=!1,...g}=t,h=Ce.useRef(null),R=Cr({label:m,textRef:h,indexGuessBehavior:wr.GuessFromOrder}),{store:I,itemProps:C,setOpen:k,setValue:x,selectionRef:J,typingRef:B,valuesRef:N,multiple:b,selectedItemTextRef:D,disabled:P,readOnly:ae}=U(),te=a(I,i.isActive,R.index),q=a(I,i.open),se=a(I,i.isSelected,s),Se=a(I,i.isSelectedByFocus,R.index),Re=a(I,i.isItemEqualToValue),z=R.index,$=z!==-1,_=Ce.useRef(null);ee(()=>{if(!$)return;let d=N.current;return d[z]=s,()=>{delete d[z]}},[$,z,s,N]),ee(()=>{if(!$)return;let d=I.state.value,w=d;b&&Array.isArray(d)&&(w=d.length>0?d[d.length-1]:void 0),w!==void 0&&Ue(s,w,Re)&&(I.set("selectedIndex",z),h.current&&(D.current=h.current))},[$,z,b,Re,I,s,D]);let ce=Ce.useRef(null),A=Ce.useRef("mouse"),Z=Ce.useRef(!1),{getButtonProps:H,buttonRef:V}=jt({disabled:f,focusableWhenDisabled:!0,native:p,composite:!0}),u={disabled:f,selected:se,highlighted:te};function S(d){if(P||ae)return;let w=I.state.value;if(b){let ue=Array.isArray(w)?w:[],Ne=se?_r(ue,s,Re):[...ue,s];x(Ne,xe(ge.itemPress,d))}else x(s,xe(ge.itemPress,d)),k(!1,xe(ge.itemPress,d))}r(S,"commitSelection");function le(){J.current.dragY=0}r(le,"resetDragMovement");let F={role:"option","aria-selected":se,tabIndex:q&&te?0:-1,onKeyDown(d){ce.current=d.key,I.set("activeIndex",z),d.key===" "&&B.current&&d.preventDefault()},onClick(d){let w=d.type==="click"&&A.current!=="touch",ue=d.nativeEvent.pointerType,Ne=w&&Ho(d.nativeEvent)&&(ue!==void 0||te),T=w&&!Ne&&!Z.current;Z.current=!1,!(d.type==="keydown"&&ce.current===null)&&(f||d.type==="keydown"&&ce.current===" "&&B.current||T||(ce.current=null,S(d.nativeEvent)))},onPointerEnter(d){A.current=d.pointerType},onPointerMove(d){if(d.pointerType==="mouse"&&d.buttons===1){let w=J.current;w.dragY+=d.movementY,w.dragY**2>=64&&(w.allowUnselectedMouseUp=!0)}},onPointerDown(d){A.current=d.pointerType,Z.current=!0,le()},onMouseUp(){if(le(),f||A.current==="touch"||Z.current)return;let d=!J.current.allowSelectedMouseUp&&se,w=!J.current.allowUnselectedMouseUp&&!se;d||w||(Z.current=!0,_.current?.click(),Z.current=!1)}},be=O("div",t,{ref:[V,o,R.ref,_],state:u,props:[C,F,g,H]}),he=Ce.useMemo(()=>({selected:se,index:z,textRef:h,selectedByFocus:Se,hasRegistered:$}),[se,z,h,Se,$]);return(0,Qr.jsx)(to.Provider,{value:he,children:be})},"SelectItem")));Io.displayName="SelectItem";var rt=v(L(),1);var en=v(De(),1);var Eo=rt.forwardRef(r(function(t,o){let n=t.keepMounted??!1,{selected:l}=Pt();return n||l?(0,en.jsx)(tn,{...t,ref:o}):null},"SelectItemIndicator"));Eo.displayName="SelectItemIndicator";var tn=rt.memo(rt.forwardRef((e,t)=>{let{render:o,className:n,style:l,keepMounted:c,...s}=e,{selected:m}=Pt(),f=rt.useRef(null),{transitionStatus:p,setMounted:g}=ft(m),R=O("span",e,{ref:[t,f],state:{selected:m,transitionStatus:p},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},s],stateAttributesMapping:Le});return $e({open:m,ref:f,onComplete(){m||g(!1)}}),R}));tn.displayName="Inner";var Rt=v(L(),1);var wo=Rt.memo(Rt.forwardRef(r(function(t,o){let{index:n,textRef:l,selectedByFocus:c,hasRegistered:s}=Pt(),{firstItemTextRef:m,selectedItemTextRef:f}=U(),{render:p,className:g,style:h,...R}=t,I=Rt.useCallback(k=>{k&&(s&&n===0&&(m.current=k),s&&c&&(f.current=k))},[m,f,n,c,s]);return O("div",t,{ref:[I,o,l],props:R})},"SelectItemText")));wo.displayName="SelectItemText";var on=v(L(),1);var In={...pt,...Le},Co=on.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),{side:f,align:p,arrowRef:g,arrowStyles:h,arrowUncentered:R,alignItemWithTriggerActive:I}=Xe(),k={open:a(m,i.open),side:f,align:p,uncentered:R},x=O("div",t,{state:k,ref:[g,o],props:[{style:h,"aria-hidden":!0},s],stateAttributesMapping:In});return I?null:x},"SelectArrow"));Co.displayName="SelectArrow";var nn=v(L(),1);var rn=v(L(),1);var Vt=rn.forwardRef(r(function(t,o){let{render:n,className:l,style:c,direction:s,keepMounted:m=!1,...f}=t,p=s==="up",{store:g,popupRef:h,listRef:R,handleScrollArrowVisibility:I,scrollArrowsMountedCountRef:C}=U(),{side:k,scrollDownArrowRef:x,scrollUpArrowRef:J}=Xe(),B=p?i.scrollUpArrowVisible:i.scrollDownArrowVisible,N=a(g,B),b=a(g,i.openMethod),D=N&&b!=="touch",P=ut(),ae=p?J:x,{mounted:te,transitionStatus:q,setMounted:se}=ft(D);ee(()=>(C.current+=1,g.state.hasScrollArrows||g.set("hasScrollArrows",!0),()=>{C.current=Math.max(0,C.current-1),C.current===0&&g.state.hasScrollArrows&&g.set("hasScrollArrows",!1)}),[g,C]),$e({open:D,ref:ae,onComplete(){D||se(!1)}});let z=O("div",t,{ref:[o,ae],state:{direction:s,visible:D,side:k,transitionStatus:q},props:[{"aria-hidden":!0,children:p?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(_){if(_.movementX===0&&_.movementY===0||P.isStarted())return;g.set("activeIndex",null);function ce(){let A=g.state.listElement??h.current;if(!A)return;g.set("activeIndex",null),I();let Z=mt(A.scrollHeight,A.clientHeight),H=dt(A.scrollTop,Z),V=H===(p?0:Z),u=R.current;if(H!==A.scrollTop&&(A.scrollTop=H),u.length===0&&g.set(p?"scrollUpArrowVisible":"scrollDownArrowVisible",!V),V){P.clear();return}if(u.length>0){let S=ae.current?.offsetHeight||0;A.scrollTop=En(u,p,H,A.clientHeight,S,Z)}P.start(40,ce)}r(ce,"scrollNextItem"),P.start(40,ce)},onMouseLeave(){P.clear()}},f],stateAttributesMapping:Le});return te||m?z:null},"SelectScrollArrow"));Vt.displayName="SelectScrollArrow";function En(e,t,o,n,l,c){if(t){let g=0,h=o+l-Pe;for(let C=0;C<e.length;C+=1){let k=e[C];if(k&&k.offsetTop>=h){g=C;break}}let R=Math.max(0,g-1),I=e[R];return R<g&&I?dt(I.offsetTop-l,c):0}let s=e.length-1,m=o+n-l+Pe;for(let g=0;g<e.length;g+=1){let h=e[g];if(h&&h.offsetTop+h.offsetHeight>m){s=Math.max(0,g-1);break}}let f=Math.min(e.length-1,s+1),p=e[f];return f>s&&p?dt(p.offsetTop+p.offsetHeight-n+l,c):c}r(En,"getTargetScrollTop");var sn=v(De(),1);var No=nn.forwardRef(r(function(t,o){return(0,sn.jsx)(Vt,{...t,ref:o,direction:"down"})},"SelectScrollDownArrow"));No.displayName="SelectScrollDownArrow";var ln=v(L(),1);var an=v(De(),1);var Ao=ln.forwardRef(r(function(t,o){return(0,an.jsx)(Vt,{...t,ref:o,direction:"up"})},"SelectScrollUpArrow"));Ao.displayName="SelectScrollUpArrow";var bt=v(L(),1);var oo=v(L(),1);var ro=oo.createContext(void 0);ro.displayName="SelectGroupContext";function cn(){let e=oo.useContext(ro);if(e===void 0)throw new Error("Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.");return e}r(cn,"useSelectGroupContext");var un=v(De(),1);var To=bt.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,[m,f]=bt.useState(),p=bt.useMemo(()=>({labelId:m,setLabelId:f}),[m,f]),g=O("div",t,{ref:o,props:[{role:"group","aria-labelledby":m},s]});return(0,un.jsx)(ro.Provider,{value:p,children:g})},"SelectGroup"));To.displayName="SelectGroup";var fn=v(L(),1);var Mo=fn.forwardRef(r(function(t,o){let{render:n,className:l,style:c,id:s,...m}=t,{setLabelId:f}=cn(),p=Uo(s);return ee(()=>{f(p)},[p,f]),O("div",t,{ref:o,props:[{id:p},m]})},"SelectGroupLabel"));Mo.displayName="SelectGroupLabel";var K=v(gn(),1);var wc=me.Root;function Cc(e){let t=(0,Ot.c)(8),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=tt("flex flex-1 text-start",o),t[3]=o,t[4]=l):l=t[4];let c;return t[5]!==n||t[6]!==l?(c=(0,K.jsxDEV)(me.Value,{"data-slot":"select-value",className:l,...n},void 0,!1),t[5]=n,t[6]=l,t[7]=c):c=t[7],c}r(Cc,"SelectValue");function Nc({className:e,size:t="default",children:o,...n}){return(0,K.jsxDEV)(me.Trigger,{"data-slot":"select-trigger","data-size":t,className:tt("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[o,(0,K.jsxDEV)(me.Icon,{render:(0,K.jsxDEV)(Ct,{icon:Er,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"},void 0,!1)},void 0,!1)]},void 0,!0)}r(Nc,"SelectTrigger");function Ac({className:e,children:t,side:o="bottom",sideOffset:n=4,align:l="center",alignOffset:c=0,alignItemWithTrigger:s=!0,...m}){return(0,K.jsxDEV)(me.Portal,{children:(0,K.jsxDEV)(me.Positioner,{side:o,sideOffset:n,align:l,alignOffset:c,alignItemWithTrigger:s,className:"isolate z-50",children:(0,K.jsxDEV)(me.Popup,{"data-slot":"select-content","data-align-trigger":s,className:tt("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...m,children:[(0,K.jsxDEV)(wn,{},void 0,!1),(0,K.jsxDEV)(me.List,{children:t},void 0,!1),(0,K.jsxDEV)(Cn,{},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)}r(Ac,"SelectContent");function Tc(e){let t=(0,Ot.c)(13),o,n,l;t[0]!==e?({className:n,children:o,...l}=e,t[0]=e,t[1]=o,t[2]=n,t[3]=l):(o=t[1],n=t[2],l=t[3]);let c;t[4]!==n?(c=tt("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),t[4]=n,t[5]=c):c=t[5];let s;t[6]!==o?(s=(0,K.jsxDEV)(me.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:o},void 0,!1),t[6]=o,t[7]=s):s=t[7];let m;t[8]===Symbol.for("react.memo_cache_sentinel")?(m=(0,K.jsxDEV)(me.ItemIndicator,{render:(0,K.jsxDEV)("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"},void 0,!1),children:(0,K.jsxDEV)(Ct,{icon:Ir,strokeWidth:2,className:"pointer-events-none"},void 0,!1)},void 0,!1),t[8]=m):m=t[8];let f;return t[9]!==l||t[10]!==c||t[11]!==s?(f=(0,K.jsxDEV)(me.Item,{"data-slot":"select-item",className:c,...l,children:[s,m]},void 0,!0),t[9]=l,t[10]=c,t[11]=s,t[12]=f):f=t[12],f}r(Tc,"SelectItem");function wn(e){let t=(0,Ot.c)(9),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=tt("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",o),t[3]=o,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,K.jsxDEV)(Ct,{icon:vr,strokeWidth:2},void 0,!1),t[5]=c):c=t[5];let s;return t[6]!==n||t[7]!==l?(s=(0,K.jsxDEV)(me.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:l,...n,children:c},void 0,!1),t[6]=n,t[7]=l,t[8]=s):s=t[8],s}r(wn,"SelectScrollUpButton");function Cn(e){let t=(0,Ot.c)(9),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=tt("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",o),t[3]=o,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,K.jsxDEV)(Ct,{icon:yr,strokeWidth:2},void 0,!1),t[5]=c):c=t[5];let s;return t[6]!==n||t[7]!==l?(s=(0,K.jsxDEV)(me.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:l,...n,children:c},void 0,!1),t[6]=n,t[7]=l,t[8]=s):s=t[8],s}r(Cn,"SelectScrollDownButton");export{wc as a,Cc as b,Nc as c,Ac as d,Tc as e};
@@ -1 +0,0 @@
1
- import{a,c as v,f as G}from"./chunk-RRCPZMC2.js";var C=v(h=>{"use strict";(function(){function T(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}a(T,"is");function f(e,r){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var t=r();if(!c){var o=r();L(t,o)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}o=y({inst:{value:t,getSnapshot:r}});var n=o[0].inst,O=o[1];return D(function(){n.value=t,n.getSnapshot=r,d(n)&&O({inst:n})},[e,t,r]),m(function(){return d(n)&&O({inst:n}),e(function(){d(n)&&O({inst:n})})},[e]),_(t),t}a(f,"useSyncExternalStore$2");function d(e){var r=e.getSnapshot;e=e.value;try{var t=r();return!L(e,t)}catch{return!0}}a(d,"checkIfSnapshotChanged");function A(e,r){return r()}a(A,"useSyncExternalStore$1"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=G(),L=typeof Object.is=="function"?Object.is:T,y=i.useState,m=i.useEffect,D=i.useLayoutEffect,_=i.useDebugValue,u=!1,c=!1,E=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?A:f;h.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:E,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var B=v((w,g)=>{"use strict";g.exports=C()});var K=v(H=>{"use strict";(function(){function T(_,u){return _===u&&(_!==0||1/_===1/u)||_!==_&&u!==u}a(T,"is"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var f=G(),d=B(),A=typeof Object.is=="function"?Object.is:T,i=d.useSyncExternalStore,L=f.useRef,y=f.useEffect,m=f.useMemo,D=f.useDebugValue;H.useSyncExternalStoreWithSelector=function(_,u,c,E,e){var r=L(null);if(r.current===null){var t={hasValue:!1,value:null};r.current=t}else t=r.current;r=m(function(){function n(s){if(!O){if(O=!0,p=s,s=E(s),e!==void 0&&t.hasValue){var l=t.value;if(e(l,s))return S=l}return S=s}if(l=S,A(p,s))return l;var R=E(s);return e!==void 0&&e(l,R)?(p=s,l):(p=s,S=R)}a(n,"memoizedSelector");var O=!1,p,S,V=c===void 0?null:c;return[function(){return n(u())},V===null?void 0:function(){return n(V())}]},[u,c,E,e]);var o=i(_,r[0],r[1]);return y(function(){t.hasValue=!0,t.value=o},[o]),D(o),o},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var M=v((z,I)=>{"use strict";I.exports=K()});export{B as a,M as b};
@@ -1 +0,0 @@
1
- import{a as m,e as r,g as c,h as d,j as i}from"./chunk-RRCPZMC2.js";var n=r(c(),1);var f=r(d(),1);function u(a){let e=(0,n.c)(8),t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("animate-pulse rounded-md bg-muted",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=(0,f.jsxDEV)("div",{"data-slot":"skeleton",className:o,...s},void 0,!1),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}m(u,"Skeleton");export{u as a};
@@ -1,4 +0,0 @@
1
- import{b as Le}from"./chunk-N5XX4HOL.js";import"./chunk-V43BLH4J.js";import{c as Be}from"./chunk-IYHPYY4A.js";import"./chunk-APSSZB6Z.js";import"./chunk-QAFAJBAW.js";import{a as ye}from"./chunk-3GXGLNKW.js";import"./chunk-AHILM3ZP.js";import{a as Ke}from"./chunk-J6J54MBP.js";import"./chunk-WVTPZ6CM.js";import"./chunk-SHERR7ZP.js";import"./chunk-5OIBXYZM.js";import"./chunk-L7SK4ZZD.js";import{a as ze}from"./chunk-2YTF6LJ6.js";import"./chunk-KEGAWN6Y.js";import{a as Fe,b as De,c as Re,d as de,e as le,f as ee}from"./chunk-GTM65MVX.js";import{a as Te,e as _e}from"./chunk-Y572GMZE.js";import"./chunk-4QHKBC77.js";import{a as $e}from"./chunk-F2YMCQ6B.js";import"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import{R as Ne}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as se}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as ie}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as be}from"./chunk-TEWVD66F.js";import{f as we}from"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as me}from"./chunk-TAD43CG5.js";import{d as Ce,f as ge,g as pe,h as Q,m as H,o as Ee,p as ve}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as g,e as he,f as gt,g as pt,h as vt}from"./chunk-RRCPZMC2.js";var j=he(pt(),1),_=he(gt(),1);var l=he(vt(),1);var je=g((c,e,s)=>{let t=(0,j.c)(21),{onCopy:n,onDelete:o,onDownload:u,onToggleSelect:a}=s,r;t[0]!==c.key||t[1]!==n?(r=g(()=>{n(c.key)},"t0"),t[0]=c.key,t[1]=n,t[2]=r):r=t[2];let d=r,h;t[3]!==c.key||t[4]!==u?(h=g(()=>{u(c.key)},"t1"),t[3]=c.key,t[4]=u,t[5]=h):h=t[5];let f=h,m;t[6]!==c.key||t[7]!==o?(m=g(()=>{o(c.key)},"t2"),t[6]=c.key,t[7]=o,t[8]=m):m=t[8];let S=m,i;t[9]!==c.key||t[10]!==a?(i=g(()=>{a(c.key)},"t3"),t[9]=c.key,t[10]=a,t[11]=i):i=t[11];let x=i,y;t[12]!==c.key||t[13]!==e.length?(y=c.key.slice(e.length),t[12]=c.key,t[13]=e.length,t[14]=y):y=t[14];let v;return t[15]!==d||t[16]!==f||t[17]!==S||t[18]!==y||t[19]!==x?(v={copy:d,download:f,name:y,remove:S,toggle:x},t[15]=d,t[16]=f,t[17]=S,t[18]=y,t[19]=x,t[20]=v):v=t[20],v},"useFileItem"),Ue=g(c=>{let e=(0,j.c)(31),{busy:s,buttonClassName:t,copied:n,objectKey:o,onCopy:u,onDelete:a,onDownload:r,t:d}=c,h=`storage-copy-${o}`,f;e[0]!==n||e[1]!==d?(f=d(n?"Copied":"Copy URL"),e[0]=n,e[1]=d,e[2]=f):f=e[2];let m;e[3]!==s||e[4]!==t||e[5]!==u||e[6]!==h||e[7]!==f?(m=(0,l.jsxDEV)(se,{className:t,"data-testid":h,disabled:s,onClick:u,size:"sm",type:"button",variant:"ghost",children:f},void 0,!1),e[3]=s,e[4]=t,e[5]=u,e[6]=h,e[7]=f,e[8]=m):m=e[8];let S=`storage-download-${o}`,i;e[9]!==d?(i=d("Download"),e[9]=d,e[10]=i):i=e[10];let x;e[11]!==s||e[12]!==t||e[13]!==r||e[14]!==S||e[15]!==i?(x=(0,l.jsxDEV)(se,{className:t,"data-testid":S,disabled:s,onClick:r,size:"sm",type:"button",variant:"ghost",children:i},void 0,!1),e[11]=s,e[12]=t,e[13]=r,e[14]=S,e[15]=i,e[16]=x):x=e[16];let y;e[17]!==d?(y=d("Delete object?"),e[17]=d,e[18]=y):y=e[18];let v=`storage-delete-${o}`,b;e[19]!==d?(b=d("Delete"),e[19]=d,e[20]=b):b=e[20];let k;e[21]!==s||e[22]!==a||e[23]!==y||e[24]!==v||e[25]!==b?(k=(0,l.jsxDEV)(ze,{confirmLabel:y,disabled:s,onConfirm:a,testId:v,children:b},void 0,!1),e[21]=s,e[22]=a,e[23]=y,e[24]=v,e[25]=b,e[26]=k):k=e[26];let w;return e[27]!==k||e[28]!==m||e[29]!==x?(w=(0,l.jsxDEV)(l.Fragment,{children:[m,x,k]},void 0,!0),e[27]=k,e[28]=m,e[29]=x,e[30]=w):w=e[30],w},"FileActions"),Me=g(c=>{let e=(0,j.c)(14),{objectKey:s,references:t,t:n}=c;if(t===void 0)return null;if(t.length===0){let h=`storage-orphan-${s}`,f;e[0]!==n?(f=n("Orphan"),e[0]=n,e[1]=f):f=e[1];let m;return e[2]!==h||e[3]!==f?(m=(0,l.jsxDEV)(ie,{"data-testid":h,variant:"warning",children:f},void 0,!1),e[2]=h,e[3]=f,e[4]=m):m=e[4],m}let o;e[5]!==t?(o=t.map(bt).join(`
2
- `),e[5]=t,e[6]=o):o=e[6];let u=o,a=`storage-refs-${s}`,r;e[7]!==t.length||e[8]!==n?(r=t.length===1?n("1 record"):n("{count} records",{count:t.length}),e[7]=t.length,e[8]=n,e[9]=r):r=e[9];let d;return e[10]!==u||e[11]!==a||e[12]!==r?(d=(0,l.jsxDEV)(ie,{"data-testid":a,title:u,variant:"secondary",children:r},void 0,!1),e[10]=u,e[11]=a,e[12]=r,e[13]=d):d=e[13],d},"FileReferences"),Ge=g(c=>{let e=(0,j.c)(7),{objectKey:s,onToggle:t,selected:n,t:o}=c,u;e[0]!==o?(u=o("Select row"),e[0]=o,e[1]=u):u=e[1];let a=`storage-select-${s}`,r;return e[2]!==t||e[3]!==n||e[4]!==u||e[5]!==a?(r=(0,l.jsxDEV)(ye,{"aria-label":u,checked:n,"data-testid":a,onCheckedChange:t},void 0,!1),e[2]=t,e[3]=n,e[4]=u,e[5]=a,e[6]=r):r=e[6],r},"FileSelect");function bt(c){return`${c.table}\xB7${c.id}`}g(bt,"_temp$2");var yt=g(c=>{let e=(0,j.c)(10),{colSpan:s,name:t,onEnter:n}=c,o;e[0]!==t||e[1]!==n?(o=g(()=>{n(t)},"t1"),e[0]=t,e[1]=n,e[2]=o):o=e[2];let u=o,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsxDEV)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,l.jsxDEV)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"},void 0,!1)},void 0,!1),e[3]=a):a=e[3];let r;e[4]!==u||e[5]!==t?(r=(0,l.jsxDEV)("button",{className:"inline-flex items-center gap-2 font-mono text-xs outline-none hover:text-foreground focus-visible:text-foreground","data-testid":"fb-folder",onClick:u,type:"button",children:[a,t]},void 0,!0),e[4]=u,e[5]=t,e[6]=r):r=e[6];let d;return e[7]!==s||e[8]!==r?(d=(0,l.jsxDEV)(de,{children:(0,l.jsxDEV)(ee,{colSpan:s,children:r},void 0,!1)},void 0,!1),e[7]=s,e[8]=r,e[9]=d):d=e[9],d},"FolderRow"),xt=g(c=>{let e=(0,j.c)(33),{busy:s,copiedKey:t,handlers:n,object:o,prefix:u,references:a,selected:r,showReferences:d,t:h}=c,{copy:f,download:m,name:S,remove:i,toggle:x}=je(o,u,n),y;e[0]!==o.key||e[1]!==r||e[2]!==h||e[3]!==x?(y=(0,l.jsxDEV)(ee,{className:"w-8",children:(0,l.jsxDEV)(Ge,{objectKey:o.key,onToggle:x,selected:r,t:h},void 0,!1)},void 0,!1),e[0]=o.key,e[1]=r,e[2]=h,e[3]=x,e[4]=y):y=e[4];let v;e[5]!==S?(v=(0,l.jsxDEV)(ee,{className:"font-mono text-xs",children:S},void 0,!1),e[5]=S,e[6]=v):v=e[6];let b;e[7]!==o.size?(b=ve(o.size),e[7]=o.size,e[8]=b):b=e[8];let k;e[9]!==b?(k=(0,l.jsxDEV)(ee,{className:"tabular-nums text-muted-foreground",children:b},void 0,!1),e[9]=b,e[10]=k):k=e[10];let w=o.httpMetadata?.contentType??"",T;e[11]!==w?(T=(0,l.jsxDEV)(ee,{children:w},void 0,!1),e[11]=w,e[12]=T):T=e[12];let C;e[13]!==o.key||e[14]!==a||e[15]!==d||e[16]!==h?(C=d&&(0,l.jsxDEV)(ee,{children:(0,l.jsxDEV)(Me,{objectKey:o.key,references:a,t:h},void 0,!1)},void 0,!1),e[13]=o.key,e[14]=a,e[15]=d,e[16]=h,e[17]=C):C=e[17];let N=t===o.key,E;e[18]!==s||e[19]!==f||e[20]!==m||e[21]!==o.key||e[22]!==i||e[23]!==h||e[24]!==N?(E=(0,l.jsxDEV)(ee,{className:"text-right",children:(0,l.jsxDEV)("span",{className:"inline-flex items-center gap-1",children:(0,l.jsxDEV)(Ue,{busy:s,copied:N,objectKey:o.key,onCopy:f,onDelete:i,onDownload:m,t:h},void 0,!1)},void 0,!1)},void 0,!1),e[18]=s,e[19]=f,e[20]=m,e[21]=o.key,e[22]=i,e[23]=h,e[24]=N,e[25]=E):E=e[25];let F;return e[26]!==y||e[27]!==v||e[28]!==k||e[29]!==T||e[30]!==C||e[31]!==E?(F=(0,l.jsxDEV)(de,{"data-testid":"fb-row",children:[y,v,k,T,C,E]},void 0,!0),e[26]=y,e[27]=v,e[28]=k,e[29]=T,e[30]=C,e[31]=E,e[32]=F):F=e[32],F},"FileRow"),kt=g(c=>{let e=(0,j.c)(65),{allSelected:s,busy:t,copiedKey:n,files:o,folders:u,handlers:a,onEnterFolder:r,prefix:d,references:h,selected:f,showReferences:m,someSelected:S,t:i,toggleSelectAll:x}=c,y;e[0]!==i?(y=i("Select all rows"),e[0]=i,e[1]=y):y=e[1];let v;e[2]!==s||e[3]!==S||e[4]!==y||e[5]!==x?(v=(0,l.jsxDEV)(le,{className:"w-8",children:(0,l.jsxDEV)(ye,{"aria-label":y,checked:s,"data-testid":"storage-select-all",indeterminate:S,onCheckedChange:x},void 0,!1)},void 0,!1),e[2]=s,e[3]=S,e[4]=y,e[5]=x,e[6]=v):v=e[6];let b;e[7]!==i?(b=i("key"),e[7]=i,e[8]=b):b=e[8];let k;e[9]!==b?(k=(0,l.jsxDEV)(le,{children:b},void 0,!1),e[9]=b,e[10]=k):k=e[10];let w;e[11]!==i?(w=i("size"),e[11]=i,e[12]=w):w=e[12];let T;e[13]!==w?(T=(0,l.jsxDEV)(le,{children:w},void 0,!1),e[13]=w,e[14]=T):T=e[14];let C;e[15]!==i?(C=i("content-type"),e[15]=i,e[16]=C):C=e[16];let N;e[17]!==C?(N=(0,l.jsxDEV)(le,{children:C},void 0,!1),e[17]=C,e[18]=N):N=e[18];let E;e[19]!==m||e[20]!==i?(E=m&&(0,l.jsxDEV)(le,{children:i("used by")},void 0,!1),e[19]=m,e[20]=i,e[21]=E):E=e[21];let F;e[22]!==i?(F=i("Actions"),e[22]=i,e[23]=F):F=e[23];let R;e[24]!==F?(R=(0,l.jsxDEV)(le,{"aria-label":F},void 0,!1),e[24]=F,e[25]=R):R=e[25];let D;e[26]!==R||e[27]!==v||e[28]!==k||e[29]!==T||e[30]!==N||e[31]!==E?(D=(0,l.jsxDEV)(De,{children:(0,l.jsxDEV)(de,{children:[v,k,T,N,E,R]},void 0,!0)},void 0,!1),e[26]=R,e[27]=v,e[28]=k,e[29]=T,e[30]=N,e[31]=E,e[32]=D):D=e[32];let B;if(e[33]!==u||e[34]!==r||e[35]!==m){let z;e[37]!==r||e[38]!==m?(z=g(L=>(0,l.jsxDEV)(yt,{colSpan:m?6:5,name:L,onEnter:r},L,!1),"t142"),e[37]=r,e[38]=m,e[39]=z):z=e[39],B=u.map(z),e[33]=u,e[34]=r,e[35]=m,e[36]=B}else B=e[36];let I;if(e[40]!==t||e[41]!==n||e[42]!==o||e[43]!==a||e[44]!==d||e[45]!==h||e[46]!==f||e[47]!==m||e[48]!==i){let z;e[50]!==t||e[51]!==n||e[52]!==a||e[53]!==d||e[54]!==h||e[55]!==f||e[56]!==m||e[57]!==i?(z=g(L=>(0,l.jsxDEV)(xt,{busy:t,copiedKey:n,handlers:a,object:L,prefix:d,references:h[L.key],selected:f.has(L.key),showReferences:m,t:i},L.key,!1),"t152"),e[50]=t,e[51]=n,e[52]=a,e[53]=d,e[54]=h,e[55]=f,e[56]=m,e[57]=i,e[58]=z):z=e[58],I=o.map(z),e[40]=t,e[41]=n,e[42]=o,e[43]=a,e[44]=d,e[45]=h,e[46]=f,e[47]=m,e[48]=i,e[49]=I}else I=e[49];let K;e[59]!==B||e[60]!==I?(K=(0,l.jsxDEV)(Re,{children:[B,I]},void 0,!0),e[59]=B,e[60]=I,e[61]=K):K=e[61];let A;return e[62]!==D||e[63]!==K?(A=(0,l.jsxDEV)(Te,{className:"overflow-hidden py-0",children:(0,l.jsxDEV)(_e,{className:"px-0",children:(0,l.jsxDEV)(Fe,{"data-testid":"fb-table",children:[D,K]},void 0,!0)},void 0,!1)},void 0,!1),e[62]=D,e[63]=K,e[64]=A):A=e[64],A},"FileBrowserList"),St=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],wt=3600,Ie=g((c,e)=>{if(e==="size")return c.size;if(e==="type")return c.httpMetadata?.contentType??"";if(e==="date"){if(c.uploaded===void 0)return 0;let s=new Date(c.uploaded).getTime();return Number.isNaN(s)?0:s}return e.startsWith("tag:")?c.customMetadata?.[e.slice(4)]??"":c.key},"fileSortValue"),Ct=g((c,e,s)=>{let t=s==="desc"?-1:1;return c.toSorted((n,o)=>{let u=Ie(n,e),a=Ie(o,e);return(typeof u=="number"&&typeof a=="number"?u-a:String(u).localeCompare(String(a)))*t})},"sortFiles"),Nt=g((c,e)=>{let s=new Set,t=[];for(let n of c){let o=n.key.slice(e.length),u=o.indexOf("/");u===-1?t.push(n):s.add(o.slice(0,u+1))}return{files:t,folders:[...s].toSorted((n,o)=>n.localeCompare(o))}},"deriveEntries"),Tt=g(c=>{let e=(0,j.c)(59),{bucket:s,buckets:t,busy:n,draftPrefix:o,expiry:u,fileInputRef:a,onBucketChange:r,onExpiryChange:d,onFileChange:h,onList:f,onPrefixChange:m,onUploadClick:S,t:i}=c,x;e[0]!==m?(x=g(G=>{m(G.target.value)},"t1"),e[0]=m,e[1]=x):x=e[1];let y=x,v;e[2]!==r?(v=g(G=>{r(G.target.value)},"t2"),e[2]=r,e[3]=v):v=e[3];let b=v,k;e[4]!==d?(k=g(G=>{d(Number.parseInt(G.target.value,10))},"t3"),e[4]=d,e[5]=k):k=e[5];let w=k,T;e[6]!==s||e[7]!==t||e[8]!==b||e[9]!==i?(T=t.length>0&&(0,l.jsxDEV)("select",{"aria-label":i("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:b,value:s,children:t.map(Et)},void 0,!1),e[6]=s,e[7]=t,e[8]=b,e[9]=i,e[10]=T):T=e[10];let C;e[11]!==i?(C=i("Key prefix"),e[11]=i,e[12]=C):C=e[12];let N;e[13]!==i?(N=i("key prefix (optional)"),e[13]=i,e[14]=N):N=e[14];let E;e[15]!==o||e[16]!==y||e[17]!==C||e[18]!==N?(E=(0,l.jsxDEV)(Ne,{"aria-label":C,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:y,placeholder:N,value:o},void 0,!1),e[15]=o,e[16]=y,e[17]=C,e[18]=N,e[19]=E):E=e[19];let F;e[20]!==i?(F=i("List"),e[20]=i,e[21]=F):F=e[21];let R;e[22]!==n||e[23]!==f||e[24]!==F?(R=(0,l.jsxDEV)(se,{"data-testid":"fb-list",disabled:n,onClick:f,size:"sm",type:"button",children:F},void 0,!1),e[22]=n,e[23]=f,e[24]=F,e[25]=R):R=e[25];let D;e[26]!==n||e[27]!==i?(D=i(n?"Uploading\u2026":"Upload"),e[26]=n,e[27]=i,e[28]=D):D=e[28];let B;e[29]!==n||e[30]!==S||e[31]!==D?(B=(0,l.jsxDEV)(se,{"data-testid":"storage-upload",disabled:n,onClick:S,size:"sm",type:"button",variant:"outline",children:D},void 0,!1),e[29]=n,e[30]=S,e[31]=D,e[32]=B):B=e[32];let I;e[33]!==a||e[34]!==h?(I=(0,l.jsxDEV)("input",{className:"hidden","data-testid":"storage-file-input",onChange:h,ref:a,type:"file"},void 0,!1),e[33]=a,e[34]=h,e[35]=I):I=e[35];let K;e[36]!==i?(K=i("Link expiry"),e[36]=i,e[37]=K):K=e[37];let A;e[38]!==i?(A=St.map(G=>(0,l.jsxDEV)("option",{value:G.seconds,children:i(G.label)},G.seconds,!1)),e[38]=i,e[39]=A):A=e[39];let z;e[40]!==u||e[41]!==w||e[42]!==A?(z=(0,l.jsxDEV)("select",{className:"h-8 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":"storage-expiry",id:"storage-expiry",onChange:w,value:u,children:A},void 0,!1),e[40]=u,e[41]=w,e[42]=A,e[43]=z):z=e[43];let L;e[44]!==K||e[45]!==z?(L=(0,l.jsxDEV)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[K,z]},void 0,!0),e[44]=K,e[45]=z,e[46]=L):L=e[46];let U;e[47]!==i?(U=i("Open in Cloudflare"),e[47]=i,e[48]=U):U=e[48];let M;e[49]!==U?(M=(0,l.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:Be,rel:"noreferrer",target:"_blank",children:U},void 0,!1),e[49]=U,e[50]=M):M=e[50];let P;return e[51]!==B||e[52]!==I||e[53]!==L||e[54]!==M||e[55]!==T||e[56]!==E||e[57]!==R?(P=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[T,E,R,B,I,L,M]},void 0,!0),e[51]=B,e[52]=I,e[53]=L,e[54]=M,e[55]=T,e[56]=E,e[57]=R,e[58]=P):P=e[58],P},"FileBrowserToolbar"),_t=g(c=>{let e=(0,j.c)(66),{onSortKeyChange:s,onThumbSizeChange:t,showGrid:n,showList:o,sortDirection:u,sortKey:a,t:r,tagKeys:d,thumbSize:h,toggleSortDirection:f,view:m}=c,S;e[0]!==s?(S=g(W=>{s(W.target.value)},"t1"),e[0]=s,e[1]=S):S=e[1];let i=S,x;e[2]!==t?(x=g(W=>{t(Number.parseInt(W.target.value,10))},"t2"),e[2]=t,e[3]=x):x=e[3];let y=x,v=m==="list",b;e[4]!==r?(b=r("List"),e[4]=r,e[5]=b):b=e[5];let k;e[6]!==o||e[7]!==v||e[8]!==b?(k=(0,l.jsxDEV)("button",{"aria-pressed":v,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:o,type:"button",children:b},void 0,!1),e[6]=o,e[7]=v,e[8]=b,e[9]=k):k=e[9];let w=m==="grid",T;e[10]!==r?(T=r("Grid"),e[10]=r,e[11]=T):T=e[11];let C;e[12]!==n||e[13]!==w||e[14]!==T?(C=(0,l.jsxDEV)("button",{"aria-pressed":w,className:"border-s border-border px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-grid",onClick:n,type:"button",children:T},void 0,!1),e[12]=n,e[13]=w,e[14]=T,e[15]=C):C=e[15];let N;e[16]!==k||e[17]!==C?(N=(0,l.jsxDEV)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[k,C]},void 0,!0),e[16]=k,e[17]=C,e[18]=N):N=e[18];let E;e[19]!==r?(E=r("Sort"),e[19]=r,e[20]=E):E=e[20];let F;e[21]!==r?(F=r("Name"),e[21]=r,e[22]=F):F=e[22];let R;e[23]!==F?(R=(0,l.jsxDEV)("option",{value:"name",children:F},void 0,!1),e[23]=F,e[24]=R):R=e[24];let D;e[25]!==r?(D=r("size"),e[25]=r,e[26]=D):D=e[26];let B;e[27]!==D?(B=(0,l.jsxDEV)("option",{value:"size",children:D},void 0,!1),e[27]=D,e[28]=B):B=e[28];let I;e[29]!==r?(I=r("Type"),e[29]=r,e[30]=I):I=e[30];let K;e[31]!==I?(K=(0,l.jsxDEV)("option",{value:"type",children:I},void 0,!1),e[31]=I,e[32]=K):K=e[32];let A;e[33]!==r?(A=r("Modified"),e[33]=r,e[34]=A):A=e[34];let z;e[35]!==A?(z=(0,l.jsxDEV)("option",{value:"date",children:A},void 0,!1),e[35]=A,e[36]=z):z=e[36];let L;e[37]!==d?(L=d.map($t),e[37]=d,e[38]=L):L=e[38];let U;e[39]!==i||e[40]!==a||e[41]!==R||e[42]!==B||e[43]!==K||e[44]!==z||e[45]!==L?(U=(0,l.jsxDEV)("select",{className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-sort",id:"fb-sort",onChange:i,value:a,children:[R,B,K,z,L]},void 0,!0),e[39]=i,e[40]=a,e[41]=R,e[42]=B,e[43]=K,e[44]=z,e[45]=L,e[46]=U):U=e[46];let M;e[47]!==E||e[48]!==U?(M=(0,l.jsxDEV)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[E,U]},void 0,!0),e[47]=E,e[48]=U,e[49]=M):M=e[49];let P;e[50]!==r?(P=r("Toggle sort direction"),e[50]=r,e[51]=P):P=e[51];let G=u==="asc"?"\u2191":"\u2193",q;e[52]!==P||e[53]!==G||e[54]!==f?(q=(0,l.jsxDEV)("button",{"aria-label":P,className:"flex size-8 items-center justify-center rounded-md border border-border tabular-nums outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"fb-sort-dir",onClick:f,type:"button",children:G},void 0,!1),e[52]=P,e[53]=G,e[54]=f,e[55]=q):q=e[55];let Y;e[56]!==y||e[57]!==r||e[58]!==h||e[59]!==m?(Y=m==="grid"&&(0,l.jsxDEV)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[r("Thumbnail size"),(0,l.jsxDEV)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:y,step:8,type:"range",value:h},void 0,!1)]},void 0,!0),e[56]=y,e[57]=r,e[58]=h,e[59]=m,e[60]=Y):Y=e[60];let oe;return e[61]!==M||e[62]!==q||e[63]!==Y||e[64]!==N?(oe=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[N,M,q,Y]},void 0,!0),e[61]=M,e[62]=q,e[63]=Y,e[64]=N,e[65]=oe):oe=e[65],oe},"FileBrowserControls");function Et(c){return(0,l.jsxDEV)("option",{value:c,children:c},c,!1)}g(Et,"_temp$1");function $t(c){return(0,l.jsxDEV)("option",{value:`tag:${c}`,children:c},c,!1)}g($t,"_temp2");var Ft=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,Dt=g(c=>(c.httpMetadata?.contentType??"").startsWith("image/")||Ft.test(c.key),"isImage"),Rt=g(()=>{let c=(0,j.c)(1),e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsxDEV)("svg",{"aria-hidden":"true",className:"size-8 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,l.jsxDEV)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"},void 0,!1)},void 0,!1),c[0]=e):e=c[0],e},"FileGlyph"),zt=g(c=>{let e=(0,j.c)(13),{object:s,resolveUrl:t}=c,[n,o]=(0,_.useState)(null),[u,a]=(0,_.useState)(!1),r;e[0]!==s?(r=Dt(s),e[0]=s,e[1]=r):r=e[1];let d=r,h,f;e[2]!==d||e[3]!==s.key||e[4]!==t?(h=g(()=>{if(!d)return;let x={cancelled:!1};return H((async()=>{try{let y=await t(s.key);x.cancelled||o(y)}catch{x.cancelled||a(!0)}})()),()=>{x.cancelled=!0}},"t2"),f=[d,s.key,t],e[2]=d,e[3]=s.key,e[4]=t,e[5]=h,e[6]=f):(h=e[5],f=e[6]),(0,_.useEffect)(h,f);let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=g(()=>{a(!0)},"t4"),e[7]=m):m=e[7];let S=m,i;return e[8]!==u||e[9]!==d||e[10]!==s.key||e[11]!==n?(i=(0,l.jsxDEV)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:d&&n!==null&&!u?(0,l.jsxDEV)("img",{alt:s.key,className:"size-full object-cover",loading:"lazy",onError:S,src:n},void 0,!1):(0,l.jsxDEV)(Rt,{},void 0,!1)},void 0,!1),e[8]=u,e[9]=d,e[10]=s.key,e[11]=n,e[12]=i):i=e[12],i},"Thumbnail"),Kt=g(c=>{let e=(0,j.c)(38),{busy:s,copiedKey:t,handlers:n,object:o,prefix:u,references:a,resolveUrl:r,selected:d,showReferences:h,t:f}=c,{copy:m,download:S,name:i,remove:x,toggle:y}=je(o,u,n),v;e[0]!==o||e[1]!==r?(v=(0,l.jsxDEV)(zt,{object:o,resolveUrl:r},void 0,!1),e[0]=o,e[1]=r,e[2]=v):v=e[2];let b;e[3]!==o.key||e[4]!==d||e[5]!==f||e[6]!==y?(b=(0,l.jsxDEV)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,l.jsxDEV)(Ge,{objectKey:o.key,onToggle:y,selected:d,t:f},void 0,!1)},void 0,!1),e[3]=o.key,e[4]=d,e[5]=f,e[6]=y,e[7]=b):b=e[7];let k;e[8]!==v||e[9]!==b?(k=(0,l.jsxDEV)("div",{className:"relative",children:[v,b]},void 0,!0),e[8]=v,e[9]=b,e[10]=k):k=e[10];let w;e[11]!==i?(w=(0,l.jsxDEV)("p",{className:"truncate font-mono text-xs",title:i,children:i},void 0,!1),e[11]=i,e[12]=w):w=e[12];let T;e[13]!==o.size?(T=ve(o.size),e[13]=o.size,e[14]=T):T=e[14];let C;e[15]!==T?(C=(0,l.jsxDEV)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:T},void 0,!1),e[15]=T,e[16]=C):C=e[16];let N;e[17]!==o.key||e[18]!==a||e[19]!==h||e[20]!==f?(N=h&&(0,l.jsxDEV)("div",{className:"mt-1",children:(0,l.jsxDEV)(Me,{objectKey:o.key,references:a,t:f},void 0,!1)},void 0,!1),e[17]=o.key,e[18]=a,e[19]=h,e[20]=f,e[21]=N):N=e[21];let E;e[22]!==w||e[23]!==C||e[24]!==N?(E=(0,l.jsxDEV)("div",{className:"min-w-0",children:[w,C,N]},void 0,!0),e[22]=w,e[23]=C,e[24]=N,e[25]=E):E=e[25];let F=t===o.key,R;e[26]!==s||e[27]!==m||e[28]!==S||e[29]!==o.key||e[30]!==x||e[31]!==f||e[32]!==F?(R=(0,l.jsxDEV)("div",{className:"flex items-center gap-1",children:(0,l.jsxDEV)(Ue,{busy:s,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:o.key,onCopy:m,onDelete:x,onDownload:S,t:f},void 0,!1)},void 0,!1),e[26]=s,e[27]=m,e[28]=S,e[29]=o.key,e[30]=x,e[31]=f,e[32]=F,e[33]=R):R=e[33];let D;return e[34]!==R||e[35]!==k||e[36]!==E?(D=(0,l.jsxDEV)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[k,E,R]},void 0,!0),e[34]=R,e[35]=k,e[36]=E,e[37]=D):D=e[37],D},"GalleryTile"),Lt=g(c=>{let e=(0,j.c)(9),{name:s,onEnter:t}=c,n;e[0]!==s||e[1]!==t?(n=g(()=>{t(s)},"t1"),e[0]=s,e[1]=t,e[2]=n):n=e[2];let o=n,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsxDEV)("span",{className:"flex aspect-square w-full items-center justify-center rounded-md border border-border bg-muted/30 transition-colors hover:bg-accent",children:(0,l.jsxDEV)("svg",{"aria-hidden":"true",className:"size-10 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,l.jsxDEV)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"},void 0,!1)},void 0,!1)},void 0,!1),e[3]=u):u=e[3];let a;e[4]!==s?(a=(0,l.jsxDEV)("span",{className:"truncate font-mono text-xs",title:s,children:s},void 0,!1),e[4]=s,e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==a?(r=(0,l.jsxDEV)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:o,type:"button",children:[u,a]},void 0,!0),e[6]=o,e[7]=a,e[8]=r):r=e[8],r},"FolderTile"),Bt=g(c=>{let e=(0,j.c)(34),{busy:s,copiedKey:t,files:n,folders:o,handlers:u,onEnterFolder:a,prefix:r,references:d,resolveUrl:h,selected:f,showReferences:m,size:S,t:i}=c,x;e[0]!==S?(x=S.toString(),e[0]=S,e[1]=x):x=e[1];let y=`repeat(auto-fill, minmax(${x}px, 1fr))`,v;e[2]!==y?(v={gridTemplateColumns:y},e[2]=y,e[3]=v):v=e[3];let b=v,k;if(e[4]!==o||e[5]!==a){let C;e[7]!==a?(C=g(N=>(0,l.jsxDEV)(Lt,{name:N,onEnter:a},N,!1),"t52"),e[7]=a,e[8]=C):C=e[8],k=o.map(C),e[4]=o,e[5]=a,e[6]=k}else k=e[6];let w;if(e[9]!==s||e[10]!==t||e[11]!==n||e[12]!==u||e[13]!==r||e[14]!==d||e[15]!==h||e[16]!==f||e[17]!==m||e[18]!==i){let C;e[20]!==s||e[21]!==t||e[22]!==u||e[23]!==r||e[24]!==d||e[25]!==h||e[26]!==f||e[27]!==m||e[28]!==i?(C=g(N=>(0,l.jsxDEV)(Kt,{busy:s,copiedKey:t,handlers:u,object:N,prefix:r,references:d[N.key],resolveUrl:h,selected:f.has(N.key),showReferences:m,t:i},N.key,!1),"t62"),e[20]=s,e[21]=t,e[22]=u,e[23]=r,e[24]=d,e[25]=h,e[26]=f,e[27]=m,e[28]=i,e[29]=C):C=e[29],w=n.map(C),e[9]=s,e[10]=t,e[11]=n,e[12]=u,e[13]=r,e[14]=d,e[15]=h,e[16]=f,e[17]=m,e[18]=i,e[19]=w}else w=e[19];let T;return e[30]!==b||e[31]!==k||e[32]!==w?(T=(0,l.jsxDEV)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[k,w]},void 0,!0),e[30]=b,e[31]=k,e[32]=w,e[33]=T):T=e[33],T},"FileGallery"),It=g(c=>{let e=(0,j.c)(23),{reference:s,t}=c,n=`fb-dangling-${s.table}-${s.id}-${s.column}`,o=`${s.table}\xB7${s.id}`,u;e[0]!==o?(u=(0,l.jsxDEV)(ie,{variant:"secondary",children:o},void 0,!1),e[0]=o,e[1]=u):u=e[1];let a;e[2]!==s.column?(a=(0,l.jsxDEV)("span",{className:"text-muted-foreground",children:s.column},void 0,!1),e[2]=s.column,e[3]=a):a=e[3];let r;e[4]!==t?(r=t("\u2192"),e[4]=t,e[5]=r):r=e[5];let d;e[6]!==r?(d=(0,l.jsxDEV)("span",{className:"text-muted-foreground/60",children:r},void 0,!1),e[6]=r,e[7]=d):d=e[7];let h;e[8]!==s.key?(h=(0,l.jsxDEV)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:s.key},void 0,!1),e[8]=s.key,e[9]=h):h=e[9];let f;e[10]!==u||e[11]!==a||e[12]!==d||e[13]!==h?(f=(0,l.jsxDEV)("span",{className:"flex flex-wrap items-center gap-1.5",children:[u,a,d,h]},void 0,!0),e[10]=u,e[11]=a,e[12]=d,e[13]=h,e[14]=f):f=e[14];let m;e[15]!==t?(m=t("Missing object"),e[15]=t,e[16]=m):m=e[16];let S;e[17]!==m?(S=(0,l.jsxDEV)(ie,{className:"border-destructive/40 text-destructive",variant:"outline",children:m},void 0,!1),e[17]=m,e[18]=S):S=e[18];let i;return e[19]!==n||e[20]!==S||e[21]!==f?(i=(0,l.jsxDEV)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2 text-xs","data-testid":n,children:[f,S]},void 0,!0),e[19]=n,e[20]=S,e[21]=f,e[22]=i):i=e[22],i},"DanglingRow"),Ot=g(c=>{let e=(0,j.c)(37),{busy:s,onCheck:t,references:n,t:o,truncated:u}=c,a;e[0]!==o?(a=o("Integrity"),e[0]=o,e[1]=a):a=e[1];let r;e[2]!==a?(r=(0,l.jsxDEV)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:a},void 0,!1),e[2]=a,e[3]=r):r=e[3];let d;e[4]!==o?(d=o("Orphaned objects"),e[4]=o,e[5]=d):d=e[5];let h;e[6]!==d?(h=(0,l.jsxDEV)("span",{className:"text-sm font-medium text-foreground",children:d},void 0,!1),e[6]=d,e[7]=h):h=e[7];let f;e[8]!==o?(f=o("Find records whose file reference points at an object the bucket no longer has."),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=(0,l.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:f},void 0,!1),e[10]=f,e[11]=m):m=e[11];let S;e[12]!==r||e[13]!==h||e[14]!==m?(S=(0,l.jsxDEV)("div",{className:"flex flex-col gap-1",children:[r,h,m]},void 0,!0),e[12]=r,e[13]=h,e[14]=m,e[15]=S):S=e[15];let i;e[16]!==s||e[17]!==o?(i=o(s?"Checking\u2026":"Check for orphans"),e[16]=s,e[17]=o,e[18]=i):i=e[18];let x;e[19]!==s||e[20]!==t||e[21]!==i?(x=(0,l.jsxDEV)(se,{"data-testid":"fb-orphans-check",disabled:s,onClick:t,size:"sm",type:"button",variant:"outline",children:i},void 0,!1),e[19]=s,e[20]=t,e[21]=i,e[22]=x):x=e[22];let y;e[23]!==S||e[24]!==x?(y=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[S,x]},void 0,!0),e[23]=S,e[24]=x,e[25]=y):y=e[25];let v;e[26]!==n?.length||e[27]!==o?(v=n?.length===0&&(0,l.jsxDEV)(me,{description:o("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:o("No dangling references.")},void 0,!1),e[26]=n?.length,e[27]=o,e[28]=v):v=e[28];let b;e[29]!==n||e[30]!==o||e[31]!==u?(b=n!==void 0&&n.length>0&&(0,l.jsxDEV)(l.Fragment,{children:[u&&(0,l.jsxDEV)("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:o("Showing the first {count} dangling references \u2014 the scan was truncated.",{count:n.length})},void 0,!1),(0,l.jsxDEV)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:n.map(w=>(0,l.jsxDEV)(It,{reference:w,t:o},`${w.table}\xB7${w.id}\xB7${w.column}`,!1))},void 0,!1)]},void 0,!0),e[29]=n,e[30]=o,e[31]=u,e[32]=b):b=e[32];let k;return e[33]!==y||e[34]!==v||e[35]!==b?(k=(0,l.jsxDEV)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[y,v,b]},void 0,!0),e[33]=y,e[34]=v,e[35]=b,e[36]=k):k=e[36],k},"OrphanedObjectsSection"),At=g(function(c,e){let s=(0,j.c)(18),t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Set,s[0]=t):t=s[0];let[n,o]=(0,_.useState)(t),u;s[1]===Symbol.for("react.memo_cache_sentinel")?(u=g(v=>{o(b=>{let k=new Set(b);return k.has(v)?k.delete(v):k.add(v),k})},"t1"),s[1]=u):u=s[1];let a=u,r;s[2]===Symbol.for("react.memo_cache_sentinel")?(r=g(()=>{o(new Set)},"t2"),s[2]=r):r=s[2];let d=r,h,f,m;if(s[3]!==c||s[4]!==e||s[5]!==n){let v;s[9]!==e?(v=g(b=>e(b),"t42"),s[9]=e,s[10]=v):v=s[10],f=c.map(v),h=f.length>0&&f.every(b=>n.has(b)),m=!h&&f.some(b=>n.has(b)),s[3]=c,s[4]=e,s[5]=n,s[6]=h,s[7]=f,s[8]=m}else h=s[6],f=s[7],m=s[8];let S=m,i;s[11]!==f?(i=g(()=>{o(v=>f.every(b=>v.has(b))?new Set:new Set(f))},"t4"),s[11]=f,s[12]=i):i=s[12];let x=i,y;return s[13]!==h||s[14]!==n||s[15]!==S||s[16]!==x?(y={allSelected:h,clear:d,selected:n,someSelected:S,toggle:a,toggleAll:x},s[13]=h,s[14]=n,s[15]=S,s[16]=x,s[17]=y):y=s[17],y},"useKeySelection"),jt=ge(be.storageReferences),Ut=ge(be.storageOrphans),Oe=1e4,Mt=1e3,Gt=3600,Ht=g((c,e)=>{if(!("document"in globalThis))return;let s=globalThis.document.createElement("a");s.href=c,s.download=e,s.rel="noopener",globalThis.document.body.append(s),s.click(),s.remove()},"triggerDownload"),Pt=g(({initialPrefix:c,pageSize:e})=>{let s=we(),[t,n]=(0,_.useState)(c??""),[o,u]=(0,_.useState)(c??""),[a,r]=(0,_.useState)(wt),[d,h]=(0,_.useState)("list"),[f,m]=(0,_.useState)(128),[S,i]=(0,_.useState)("name"),[x,y]=(0,_.useState)("asc"),[v,b]=(0,_.useState)(void 0),[k,w]=(0,_.useState)(void 0),[T,C]=(0,_.useState)(!1),[N,E]=(0,_.useState)(void 0),[F,R]=(0,_.useState)(void 0),[D,B]=(0,_.useState)(""),[I,K]=(0,_.useState)({}),[A,z]=(0,_.useState)(!1),[L,U]=(0,_.useState)(void 0),[M,P]=(0,_.useState)(!1),[G,q]=(0,_.useState)(!1),[Y,oe]=(0,_.useState)([]),[W,xe]=(0,_.useState)(""),re=(0,_.useRef)(0),J=(0,_.useRef)(0);(0,_.useEffect)(()=>{let p={cancelled:!1};return H((async()=>{try{let $=await s.listStorageBuckets();if(!p.cancelled){oe($);let[O]=$;O!==void 0&&xe(te=>te===""?O:te)}}catch{}})()),()=>{p.cancelled=!0}},[s]);let Z=(0,_.useMemo)(()=>({list:g(p=>s.listStorageObjects({...p,bucket:W}),"list"),remove:g(p=>s.deleteStorageObject(p,{bucket:W}),"remove"),signedUrl:g((p,$)=>s.signedStorageUrl(p,{...$,bucket:W}),"signedUrl"),upload:g(p=>s.uploadStorageObject({...p,bucket:W}),"upload")}),[W,s]),X=(0,_.useCallback)(async(p,$,O)=>{re.current+=1;let te=re.current;w(void 0),C(!0);try{let V=await Z.list({cursor:$,limit:e,prefix:p});if(te!==re.current)return;b(ce=>O&&ce!==void 0?[...ce,...V.objects]:V.objects),R(V.cursor)}catch(V){if(te!==re.current)return;O||b(void 0),w(Q(V))}finally{te===re.current&&C(!1)}},[e,Z]);(0,_.useEffect)(()=>{H(X(c??"",void 0,!1))},[X,c]);let He=(v?.length??0)<=e;Ke(()=>{H(X(t,void 0,!1))},He);let{files:fe,folders:Pe}=Nt(v??[],t),qe=(0,_.useMemo)(()=>{let p=new Set;for(let $ of fe)for(let O of Object.keys($.customMetadata??{}))p.add(O);return[...p].toSorted(($,O)=>$.localeCompare(O))},[fe]),ae=Ct(fe,S,x),ue=(0,_.useMemo)(()=>[...new Set(ae.map(p=>p.key))].toSorted((p,$)=>p.localeCompare($)).join(`
3
- `),[ae]);(0,_.useEffect)(()=>{let p=ue===""?[]:ue.split(`
4
- `);if(p.length===0){K({});return}let $={current:!0};return H((async()=>{try{let O=await s.query(jt,{keys:p},pe(D));$.current&&(K(O.references??{}),z(Object.keys(O.storageColumns??{}).length>0))}catch{$.current&&(K({}),z(!1))}})()),()=>{$.current=!1}},[s,ue,D]);let Ve=g(p=>p.key,"keyOf"),{allSelected:We,clear:ne,selected:ke,someSelected:Ze,toggle:Xe,toggleAll:Ye}=At(ae,Ve),Je=g(()=>{n(o),ne(),H(X(o,void 0,!1))},"listFirst"),Qe=g(()=>{H(X(t,F,!0))},"loadMore"),Se=g(p=>{n(p),u(p),ne(),H(X(p,void 0,!1))},"navigate"),et=g(p=>{Se(`${t}${p}`)},"enterFolder"),tt=g(p=>Z.signedUrl(p,{expiresInSeconds:Gt}),"resolveUrl"),st=g(()=>{h("list")},"showList"),lt=g(()=>{h("grid")},"showGrid"),ot=g(p=>{i(p)},"onSortKeyChange"),rt=g(()=>{y(p=>p==="asc"?"desc":"asc")},"toggleSortDirection"),nt=g(p=>{m(p)},"onThumbSizeChange"),it=g(p=>{r(p)},"onExpiryChange"),at=g(()=>{w(void 0),C(!0),H((async()=>{try{for(let p of ke)await Z.remove(p);await X(t,void 0,!1),ne()}catch(p){w(Q(p))}finally{C(!1)}})())},"bulkDelete"),ct=g(p=>{w(void 0),H((async()=>{try{let $=await Z.signedUrl(p,{expiresInSeconds:a});Ee($)&&E(p)}catch($){w(Q($))}})())},"onCopy"),dt=g(p=>{w(void 0),H((async()=>{try{let $=await Z.signedUrl(p,{expiresInSeconds:a}),O=p.slice(p.lastIndexOf("/")+1)||p;Ht($,O)}catch($){w(Q($))}})())},"onDownload");(0,_.useEffect)(()=>{if(N===void 0)return;let p=globalThis.setTimeout(()=>{E(void 0)},2e3);return()=>{globalThis.clearTimeout(p)}},[N]);let ft=g(p=>{w(void 0),C(!0),H((async()=>{try{await Z.remove(p),await X(t,void 0,!1)}catch($){w(Q($))}finally{C(!1)}})())},"onDelete"),ut=g(p=>{let $=`${t}${p.name}`;w(void 0),C(!0),H((async()=>{try{let O=await p.arrayBuffer();await Z.upload({body:O,contentType:p.type===""?void 0:p.type,key:$}),await X(t,void 0,!1)}catch(O){w(Q(O))}finally{C(!1)}})())},"onFile");(0,_.useEffect)(()=>{J.current+=1,U(void 0),q(!1)},[D]);let ht=g(()=>{J.current+=1;let p=J.current;w(void 0),P(!0),H((async()=>{try{let $=[],O;do{let V=await Z.list({cursor:O,limit:Mt});for(let ce of V.objects)$.push(ce.key);O=$.length>=Oe?void 0:V.cursor}while(O!==void 0);if($.length>=Oe)p===J.current&&(U([]),q(!0));else{let V=await s.query(Ut,{liveKeys:$},pe(D));p===J.current&&(U(V.references??[]),q(V.truncated===!0))}}catch($){p===J.current&&(U([]),q(!1),w(Q($)))}finally{p===J.current&&P(!1)}})())},"checkOrphans"),mt=g(p=>{re.current+=1,J.current+=1,xe(p),n(c??""),u(c??""),b(void 0),U(void 0),q(!1),ne()},"selectBucket");return{allSelected:We,bucket:W,buckets:Y,bulkDelete:at,busy:T,checkOrphans:ht,clearSelection:ne,copiedKey:N,danglingBusy:M,danglingReferences:L,danglingTruncated:G,draftPrefix:o,enterFolder:et,error:k,expiry:a,files:ae,folders:Pe,hasObjects:v!==void 0&&v.length>0,hasStorageColumns:A,listFirst:Je,loaded:v!==void 0,loadMore:Qe,navigate:Se,nextCursor:F,onCopy:ct,onDelete:ft,onDownload:dt,onExpiryChange:it,onFile:ut,onSortKeyChange:ot,onThumbSizeChange:nt,prefix:t,referenceShard:D,references:I,resolveUrl:tt,selectBucket:mt,selected:ke,setDraftPrefix:u,setReferenceShard:B,showGrid:lt,showList:st,someSelected:Ze,sortDirection:x,sortKey:S,tagKeys:qe,thumbSize:f,toggleSelect:Xe,toggleSelectAll:Ye,toggleSortDirection:rt,view:d}},"useFileBrowser"),qt=100,Ae=g(c=>{let e=(0,j.c)(6),{label:s,onNavigate:t,target:n}=c,o;e[0]!==t||e[1]!==n?(o=g(()=>{t(n)},"t1"),e[0]=t,e[1]=n,e[2]=o):o=e[2];let u=o,a;return e[3]!==u||e[4]!==s?(a=(0,l.jsxDEV)("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:u,type:"button",children:s},void 0,!1),e[3]=u,e[4]=s,e[5]=a):a=e[5],a},"Crumb"),Vt=g(c=>{let e=(0,j.c)(11),{onNavigate:s,prefix:t,t:n}=c,o;if(e[0]!==s||e[1]!==t||e[2]!==n){let u=t.split("/").filter(Wt),a;e[4]!==n?(a=n("Folder path"),e[4]=n,e[5]=a):a=e[5];let r;e[6]!==n?(r=n("root"),e[6]=n,e[7]=r):r=e[7];let d;e[8]!==s||e[9]!==r?(d=(0,l.jsxDEV)(Ae,{label:r,onNavigate:s,target:""},void 0,!1),e[8]=s,e[9]=r,e[10]=d):d=e[10],o=(0,l.jsxDEV)("nav",{"aria-label":a,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[d,u.map((h,f)=>(0,l.jsxDEV)("span",{className:"flex items-center gap-0.5",children:[(0,l.jsxDEV)("span",{className:"text-muted-foreground/50",children:"/"},void 0,!1),(0,l.jsxDEV)(Ae,{label:h,onNavigate:s,target:`${u.slice(0,f+1).join("/")}/`},void 0,!1)]},`${h}-${f.toString()}`,!0))]},void 0,!0),e[0]=s,e[1]=t,e[2]=n,e[3]=o}else o=e[3];return o},"Breadcrumbs"),fs=g(({initialPrefix:c,pageSize:e=qt})=>{let s=Ce(),t=Pt({initialPrefix:c,pageSize:e}),n=(0,_.useRef)(null),{onCopy:o,onDelete:u,onDownload:a,onFile:r,toggleSelect:d}=t,h={onCopy:o,onDelete:u,onDownload:a,onToggleSelect:d},f=g(()=>{n.current?.click()},"onUploadClick"),m=g(i=>{let x=i.target,y=x.files?.[0];x.value="",y&&r(y)},"onFileChange"),S=t.loaded&&!t.hasObjects;return(0,l.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[(0,l.jsxDEV)(Tt,{bucket:t.bucket,buckets:t.buckets,busy:t.busy,draftPrefix:t.draftPrefix,expiry:t.expiry,fileInputRef:n,onBucketChange:t.selectBucket,onExpiryChange:t.onExpiryChange,onFileChange:m,onList:t.listFirst,onPrefixChange:t.setDraftPrefix,onUploadClick:f,t:s},void 0,!1),t.loaded&&(0,l.jsxDEV)(Vt,{onNavigate:t.navigate,prefix:t.prefix,t:s},void 0,!1),t.hasObjects&&(0,l.jsxDEV)(_t,{onSortKeyChange:t.onSortKeyChange,onThumbSizeChange:t.onThumbSizeChange,showGrid:t.showGrid,showList:t.showList,sortDirection:t.sortDirection,sortKey:t.sortKey,t:s,tagKeys:t.tagKeys,thumbSize:t.thumbSize,toggleSortDirection:t.toggleSortDirection,view:t.view},void 0,!1),t.hasStorageColumns&&(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[(0,l.jsxDEV)("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:s("References shard")},void 0,!1),(0,l.jsxDEV)($e,{id:"fb-reference-shard-input",onChange:t.setReferenceShard,testId:"fb-reference-shard-input",value:t.referenceShard},void 0,!1),(0,l.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:s("Which shard's records are checked for references to these files. Empty = root shard.")},void 0,!1)]},void 0,!0),t.hasStorageColumns&&(0,l.jsxDEV)(Ot,{busy:t.danglingBusy,onCheck:t.checkOrphans,references:t.danglingReferences,t:s,truncated:t.danglingTruncated},void 0,!1),t.selected.size>0&&(0,l.jsxDEV)(Le,{count:t.selected.size,editable:!0,onClear:t.clearSelection,onDelete:t.bulkDelete},void 0,!1),t.error!==void 0&&(0,l.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:t.error},void 0,!1),S&&(0,l.jsxDEV)(me,{description:s("Objects you upload to your R2 buckets will appear here."),icon:(0,l.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,l.jsxDEV)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"},void 0,!1),(0,l.jsxDEV)("path",{d:"M12 11v5m-2.5-2.5h5"},void 0,!1)]},void 0,!0),testId:"fb-empty",title:s("No objects.")},void 0,!1),t.hasObjects&&t.view==="list"&&(0,l.jsxDEV)(kt,{allSelected:t.allSelected,busy:t.busy,copiedKey:t.copiedKey,files:t.files,folders:t.folders,handlers:h,onEnterFolder:t.enterFolder,prefix:t.prefix,references:t.references,selected:t.selected,showReferences:t.hasStorageColumns,someSelected:t.someSelected,t:s,toggleSelectAll:t.toggleSelectAll},void 0,!1),t.hasObjects&&t.view==="grid"&&(0,l.jsxDEV)(Bt,{busy:t.busy,copiedKey:t.copiedKey,files:t.files,folders:t.folders,handlers:h,onEnterFolder:t.enterFolder,prefix:t.prefix,references:t.references,resolveUrl:t.resolveUrl,selected:t.selected,showReferences:t.hasStorageColumns,size:t.thumbSize,t:s},void 0,!1),t.nextCursor!==void 0&&(0,l.jsxDEV)("div",{children:(0,l.jsxDEV)(se,{"data-testid":"fb-next",disabled:t.busy,onClick:t.loadMore,size:"sm",type:"button",variant:"outline",children:s("Load more")},void 0,!1)},void 0,!1)]},void 0,!0)},"FileBrowser");function Wt(c){return c!==""}g(Wt,"_temp");export{fs as FileBrowser};
@@ -1 +0,0 @@
1
- import{a as H}from"./chunk-VLXV72QE.js";import{a as v}from"./chunk-JSEXCW5Q.js";import{a as q}from"./chunk-F2YMCQ6B.js";import{b as V}from"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import{R as B}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as p}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as S}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as z}from"./chunk-TEWVD66F.js";import{f as L}from"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as j,e as K,f as U,h as J,m as M,q as P}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a,e as D,f as ne,h as ie}from"./chunk-RRCPZMC2.js";var n=D(ne(),1);var e=D(ie(),1);var de=a(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"argumentType"),le=a(r=>r===void 0||r.length===0?"()":`(${r.map(i=>`${i.name}${i.optional?"?":""}: ${de(i)}`).join(", ")})`,"formatSignature"),ce=a(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"placeholderValue"),ue=a(r=>{let i={};for(let s of r??[])s.optional||(i[s.name]=ce(s.kind));return JSON.stringify(i,void 0,2)},"argumentsTemplate"),fe=U(z.runAs),me=10,he=a(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"formatResult"),Ae=a(({functions:r,runAsIdentity:i=!1}={})=>{let s=j(),u=L(),[X,Y]=(0,n.useState)(null),[w,G]=(0,n.useState)(null),g=r??X??[],[R,I]=(0,n.useState)(""),[f,x]=(0,n.useState)("{}"),[c,k]=(0,n.useState)(""),[m,Q]=(0,n.useState)(""),[b,h]=(0,n.useState)("idle"),[W,N]=(0,n.useState)(void 0),[A,y]=(0,n.useState)(null),[C,Z]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(r!==void 0)return;let t=!1;return u.listFunctions().then(d=>(t||Y(d),d)).catch(d=>{t||G(J(d))}),()=>{t=!0}},[u,r]);let T=R===""?g[0]?.path??"":R,o=g.find(t=>t.path===T),_=a(async()=>{if(!o)return;let t;try{t=f.trim()===""?{}:JSON.parse(f)}catch(l){h("error"),N(void 0),y(s("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:o.path},F=c.trim()===""?{}:{shardKey:c.trim()},$=i?m.trim():"",E=a(l=>{Z(O=>[{argsText:f,at:Date.now(),id:(O[0]?.id??0)+1,kind:o.kind,path:o.path,shardKey:c,status:l},...O].slice(0,me))},"record");h("running"),y(null);try{let l=$===""?await K(u,o.kind,d,t,F):await u.query(fe,{args:t,functionPath:o.path,userId:$},F);V(c),N(l),h("success"),E("success")}catch(l){N(void 0),y(l.message),h("error"),E("error")}},"run"),ee=a(t=>{I(t.path),x(t.argsText),k(t.shardKey)},"loadRun"),te=a(t=>{I(t.target.value)},"onSelectChange"),re=a(t=>{x(t.target.value)},"onArgsChange"),se=a(t=>{Q(t.target.value)},"onRunAsChange"),ae=a(()=>{M(_())},"runOnce"),oe=a(()=>{x(ue(o?.args))},"prefillArgs");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[w!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:w},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxDEV)(v,{htmlFor:"function-select",children:s("Function")},void 0,!1),(0,e.jsxDEV)("select",{"aria-label":s("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:te,value:T,children:g.map(t=>(0,e.jsxDEV)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path,!0))},void 0,!1),o!==void 0&&(0,e.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsxDEV)("span",{className:"mr-1.5 font-medium",children:s("Signature")},void 0,!1),(0,e.jsxDEV)("code",{className:"font-mono","data-testid":"function-signature",children:le(o.args)},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxDEV)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxDEV)(v,{htmlFor:"args-input",children:s("Arguments")},void 0,!1),(0,e.jsxDEV)(p,{"data-testid":"prefill-button",disabled:o===void 0,onClick:oe,size:"xs",type:"button",variant:"ghost",children:s("Prefill")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(H,{"aria-label":s("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:f},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(q,{onChange:k,testId:"shard-input",value:c},void 0,!1),i&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsxDEV)(v,{htmlFor:"run-as-input",children:s("Run as identity (userId)")},void 0,!1),(0,e.jsxDEV)(B,{"aria-label":s("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:se,placeholder:s("Leave empty to run as admin"),value:m},void 0,!1),(0,e.jsxDEV)("p",{className:"text-[11px] text-muted-foreground",children:s("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(p,{"data-testid":"run-button",disabled:b==="running"||o===void 0,onClick:ae,type:"button",children:s("Run")},void 0,!1),o!==void 0&&(0,e.jsxDEV)(S,{variant:"outline",children:o.kind},void 0,!1),i&&m.trim()!==""&&(0,e.jsxDEV)(S,{"data-testid":"run-as-badge",variant:"secondary",children:s("as {userId}",{userId:m.trim()})},void 0,!1)]},void 0,!0)]},void 0,!0),b==="error"&&A!==null&&(0,e.jsxDEV)("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:A},void 0,!1),b==="success"&&(0,e.jsxDEV)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:he(W)},void 0,!1),C.length>0&&(0,e.jsxDEV)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:C.map((t,d)=>(0,e.jsxDEV)("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,e.jsxDEV)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"},void 0,!1)," ",(0,e.jsxDEV)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]},void 0,!0)," ",(0,e.jsxDEV)("time",{className:"text-xs text-muted-foreground",children:P(t.at)},void 0,!1)," ",(0,e.jsxDEV)(p,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:a(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:s("Load")},void 0,!1)]},t.id,!0))},void 0,!1)]},void 0,!0)},"FunctionRunner");export{Ae as FunctionRunner};
@@ -1 +0,0 @@
1
- import{b as f}from"./chunk-DDLQN67F.js";import"./chunk-F7GE4X2U.js";import"./chunk-XNJNSCLM.js";import{b as p}from"./chunk-RD5UG2YL.js";import"./chunk-GTM65MVX.js";import"./chunk-Y572GMZE.js";import{a as R}from"./chunk-TEWVD66F.js";import"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as h}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as i,e as m,g as S,h as A}from"./chunk-RRCPZMC2.js";var g=m(S(),1);var k=m(A(),1);var _=i((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("Live admin subscriptions are ungated")})[s.kind],"findingTitle"),E=i(e=>Array.isArray(e.findings)?e.findings:[],"toFindings"),w=i(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],"findingEntity"),T=i((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: live admin subscriptions need no credential. Set it to gate them like the HTTP admin RPCs.")})[s.kind],"findingDetail"),v=i(()=>{let e=(0,g.c)(8),s=h(),r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},e[0]=r):r=e[0];let{data:a,error:d,errorSource:c}=p(R.getSecurityAudit,r),o;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:E(a);o=u===null?null:u.map(t=>({description:T(s,t),entity:w(t),issueType:_(s,t),key:t.kind,level:t.level})),e[1]=a,e[2]=s,e[3]=o}else o=e[3];let l=o,n;return e[4]!==d||e[5]!==c||e[6]!==l?(n=(0,k.jsxDEV)(f,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"},void 0,!1),e[4]=d,e[5]=c,e[6]=l,e[7]=n):n=e[7],n},"SecurityAdvisorPanel");export{v as default};
@@ -1 +0,0 @@
1
- import{a as se}from"./chunk-FAVUOGJR.js";import"./chunk-Y7PD5KP4.js";import"./chunk-BJGBHGK3.js";import"./chunk-ZIGWVHCS.js";import"./chunk-KEGAWN6Y.js";import{a as te}from"./chunk-XNJNSCLM.js";import{a as z,b as V,c as P,e as D}from"./chunk-Y572GMZE.js";import{d as X,f as ee}from"./chunk-2MLA6WFH.js";import"./chunk-HV7G6DFP.js";import{c as I}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-CKSHCYGC.js";import{a as J}from"./chunk-TEWVD66F.js";import{f as Q}from"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as U}from"./chunk-TAD43CG5.js";import{d as O,f as H,g as Y,h as G,m as Z}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as k,e as j,f as ie,g as le,h as oe}from"./chunk-RRCPZMC2.js";var W=j(le(),1),T=j(ie(),1);var o=j(oe(),1);var de=H(J.runSql),ae=k(($,e)=>{let s=Q(),[f,t]=(0,T.useState)(void 0),[i,d]=(0,T.useState)(void 0),[l,c]=(0,T.useState)(!0),q=(0,T.useCallback)(async a=>{c(!0);try{let x=await s.query(de,{sql:$},Y(e));a.cancelled||(t(x),d(void 0))}catch(x){a.cancelled||(t(void 0),d(G(x)))}finally{a.cancelled||c(!1)}},[s,$,e]);return(0,T.useEffect)(()=>{let a={cancelled:!1};return Z(q(a)),()=>{a.cancelled=!0}},[q]),{error:i,loading:l,result:f}},"useRunSql"),re="lunora-studio-dashboards",B={shardKey:"",sql:"",title:""},ne=k($=>{let e=(0,W.c)(54),{onEdit:s,onRemove:f,widget:t}=$,i=O(),{error:d,loading:l,result:c}=ae(t.sql,t.shardKey??""),q;e[0]!==s||e[1]!==t.id?(q=k(()=>{s(t.id)},"t1"),e[0]=s,e[1]=t.id,e[2]=q):q=e[2];let a=q,x;e[3]!==f||e[4]!==t.id?(x=k(()=>{f(t.id)},"t2"),e[3]=f,e[4]=t.id,e[5]=x):x=e[5];let K=x,M=`dashboards-widget-${t.id}`,S;e[6]!==t.title?(S=(0,o.jsxDEV)(P,{className:"min-w-0 truncate",title:t.title,children:t.title},void 0,!1),e[6]=t.title,e[7]=S):S=e[7];let L;e[8]!==i?(L=i("Edit widget"),e[8]=i,e[9]=L):L=e[9];let R=`dashboards-widget-edit-${t.id}`,A;e[10]!==i?(A=i("Edit widget"),e[10]=i,e[11]=A):A=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=(0,o.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,o.jsxDEV)("path",{d:"M4 20h4L18 10l-4-4L4 16v4ZM14 6l4 4"},void 0,!1)},void 0,!1),e[12]=w):w=e[12];let C;e[13]!==a||e[14]!==L||e[15]!==R||e[16]!==A?(C=(0,o.jsxDEV)(I,{"aria-label":L,"data-testid":R,onClick:a,size:"icon-xs",title:A,type:"button",variant:"ghost",children:w},void 0,!1),e[13]=a,e[14]=L,e[15]=R,e[16]=A,e[17]=C):C=e[17];let b;e[18]!==i?(b=i("Remove widget"),e[18]=i,e[19]=b):b=e[19];let E=`dashboards-widget-remove-${t.id}`,m;e[20]!==i?(m=i("Remove widget"),e[20]=i,e[21]=m):m=e[21];let p;e[22]===Symbol.for("react.memo_cache_sentinel")?(p=(0,o.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,o.jsxDEV)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"},void 0,!1)},void 0,!1),e[22]=p):p=e[22];let u;e[23]!==K||e[24]!==b||e[25]!==E||e[26]!==m?(u=(0,o.jsxDEV)(I,{"aria-label":b,"data-testid":E,onClick:K,size:"icon-xs",title:m,type:"button",variant:"ghost",children:p},void 0,!1),e[23]=K,e[24]=b,e[25]=E,e[26]=m,e[27]=u):u=e[27];let h;e[28]!==u||e[29]!==C?(h=(0,o.jsxDEV)("div",{className:"flex shrink-0 items-center gap-1",children:[C,u]},void 0,!0),e[28]=u,e[29]=C,e[30]=h):h=e[30];let v;e[31]!==h||e[32]!==S?(v=(0,o.jsxDEV)(V,{className:"flex flex-row items-start justify-between gap-2 border-b pb-3",children:[S,h]},void 0,!0),e[31]=h,e[32]=S,e[33]=v):v=e[33];let g;e[34]!==d||e[35]!==t.id?(g=d!==void 0&&(0,o.jsxDEV)(te,{className:"font-mono text-xs",testId:`dashboards-widget-error-${t.id}`,variant:"destructive",children:d},void 0,!1),e[34]=d,e[35]=t.id,e[36]=g):g=e[36];let N;e[37]!==d||e[38]!==l||e[39]!==c||e[40]!==i||e[41]!==t.id?(N=d===void 0&&l&&c===void 0&&(0,o.jsxDEV)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":`dashboards-widget-loading-${t.id}`,children:i("Running\u2026")},void 0,!1),e[37]=d,e[38]=l,e[39]=c,e[40]=i,e[41]=t.id,e[42]=N):N=e[42];let r;e[43]!==d||e[44]!==c?(r=d===void 0&&c!==void 0&&(0,o.jsxDEV)(se,{result:c},void 0,!1),e[43]=d,e[44]=c,e[45]=r):r=e[45];let n;e[46]!==g||e[47]!==N||e[48]!==r?(n=(0,o.jsxDEV)(D,{className:"min-h-32 py-2",children:[g,N,r]},void 0,!0),e[46]=g,e[47]=N,e[48]=r,e[49]=n):n=e[49];let y;return e[50]!==v||e[51]!==n||e[52]!==M?(y=(0,o.jsxDEV)(z,{"data-testid":M,children:[v,n]},void 0,!0),e[50]=v,e[51]=n,e[52]=M,e[53]=y):y=e[53],y},"WidgetCard"),ce=k($=>{let e=(0,W.c)(58),{draft:s,editing:f,onCancel:t,onChange:i,onSubmit:d}=$,l=O(),c;e[0]!==s||e[1]!==i?(c=k(_=>{i({...s,title:_.target.value})},"t1"),e[0]=s,e[1]=i,e[2]=c):c=e[2];let q=c,a;e[3]!==s||e[4]!==i?(a=k(_=>{i({...s,sql:_.target.value})},"t2"),e[3]=s,e[4]=i,e[5]=a):a=e[5];let x=a,K;e[6]!==s||e[7]!==i?(K=k(_=>{i({...s,shardKey:_.target.value})},"t3"),e[6]=s,e[7]=i,e[8]=K):K=e[8];let M=K,S;e[9]!==d?(S=k(()=>{d()},"t4"),e[9]=d,e[10]=S):S=e[10];let L=S,R;e[11]!==s.sql||e[12]!==s.title?(R=s.title.trim()!==""&&s.sql.trim()!=="",e[11]=s.sql,e[12]=s.title,e[13]=R):R=e[13];let A=R,w;e[14]!==l?(w=l("Widget title"),e[14]=l,e[15]=w):w=e[15];let C;e[16]!==l?(C=l("Widget title"),e[16]=l,e[17]=C):C=e[17];let b;e[18]!==s.title||e[19]!==q||e[20]!==w||e[21]!==C?(b=(0,o.jsxDEV)("input",{"aria-label":w,className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-title",onChange:q,placeholder:C,type:"text",value:s.title},void 0,!1),e[18]=s.title,e[19]=q,e[20]=w,e[21]=C,e[22]=b):b=e[22];let E;e[23]!==l?(E=l("SQL query"),e[23]=l,e[24]=E):E=e[24];let m;e[25]!==s.sql||e[26]!==x||e[27]!==E?(m=(0,o.jsxDEV)("textarea",{"aria-label":E,className:"min-h-24 resize-y rounded-md border border-border bg-background p-2 font-mono text-xs leading-5 outline-none focus-visible:border-ring","data-testid":"dashboards-form-sql",onChange:x,placeholder:"SELECT author, COUNT(*) AS messages FROM \u2026",spellCheck:!1,value:s.sql},void 0,!1),e[25]=s.sql,e[26]=x,e[27]=E,e[28]=m):m=e[28];let p;e[29]!==l?(p=l("Shard key (optional)"),e[29]=l,e[30]=p):p=e[30];let u;e[31]!==l?(u=l("Shard key (optional)"),e[31]=l,e[32]=u):u=e[32];let h;e[33]!==s.shardKey||e[34]!==M||e[35]!==p||e[36]!==u?(h=(0,o.jsxDEV)("input",{"aria-label":p,className:"h-8 rounded-md border border-border bg-background px-2 font-mono text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-shard",onChange:M,placeholder:u,type:"text",value:s.shardKey},void 0,!1),e[33]=s.shardKey,e[34]=M,e[35]=p,e[36]=u,e[37]=h):h=e[37];let v;e[38]!==l?(v=l("Cancel"),e[38]=l,e[39]=v):v=e[39];let g;e[40]!==t||e[41]!==v?(g=(0,o.jsxDEV)(I,{"data-testid":"dashboards-form-cancel",onClick:t,size:"sm",type:"button",variant:"outline",children:v},void 0,!1),e[40]=t,e[41]=v,e[42]=g):g=e[42];let N=!A,r;e[43]!==f||e[44]!==l?(r=l(f?"Save widget":"Add widget"),e[43]=f,e[44]=l,e[45]=r):r=e[45];let n;e[46]!==L||e[47]!==N||e[48]!==r?(n=(0,o.jsxDEV)(I,{"data-testid":"dashboards-form-save",disabled:N,onClick:L,size:"sm",type:"button",children:r},void 0,!1),e[46]=L,e[47]=N,e[48]=r,e[49]=n):n=e[49];let y;e[50]!==g||e[51]!==n?(y=(0,o.jsxDEV)("div",{className:"flex items-center justify-end gap-2",children:[g,n]},void 0,!0),e[50]=g,e[51]=n,e[52]=y):y=e[52];let F;return e[53]!==m||e[54]!==h||e[55]!==y||e[56]!==b?(F=(0,o.jsxDEV)(z,{"data-testid":"dashboards-form",children:(0,o.jsxDEV)(D,{className:"flex flex-col gap-3 py-4",children:[b,m,h,y]},void 0,!0)},void 0,!1),e[53]=m,e[54]=h,e[55]=y,e[56]=b,e[57]=F):F=e[57],F},"WidgetForm"),xe=k($=>{let e=(0,W.c)(39),{initialShardKey:s}=$,f=O(),[t,i]=X(re),[d,l]=(0,T.useState)(B),[c,q]=(0,T.useState)(null),[a,x]=(0,T.useState)(!1),K;e[0]!==s?(K=k(()=>{q(null),l({...B,shardKey:s??""}),x(!0)},"t1"),e[0]=s,e[1]=K):K=e[1];let M=K,S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=k(()=>{x(!1),q(null),l(B)},"t2"),e[2]=S):S=e[2];let L=S,R;e[3]!==t?(R=k(r=>{let n=t.find(y=>y.id===r);n!==void 0&&(q(r),l({shardKey:n.shardKey??"",sql:n.sql,title:n.title}),x(!0))},"t3"),e[3]=t,e[4]=R):R=e[4];let A=R,w;e[5]!==i?(w=k(r=>{i(n=>n.filter(y=>y.id!==r))},"t4"),e[5]=i,e[6]=w):w=e[6];let C=w,b;e[7]!==d.shardKey||e[8]!==d.sql||e[9]!==d.title||e[10]!==c||e[11]!==i?(b=k(()=>{let r=d.title.trim(),n=d.sql.trim();if(r===""||n==="")return;let y=d.shardKey.trim();i(c===null?F=>[...F,{id:ee("w"),shardKey:y,sql:n,title:r}]:F=>F.map(_=>_.id===c?{..._,shardKey:y,sql:n,title:r}:_)),L()},"t5"),e[7]=d.shardKey,e[8]=d.sql,e[9]=d.title,e[10]=c,e[11]=i,e[12]=b):b=e[12];let E=b,m;e[13]!==f?(m=f("Chart widgets backed by saved read-only SQL queries."),e[13]=f,e[14]=m):m=e[14];let p;e[15]!==m?(p=(0,o.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:m},void 0,!1),e[15]=m,e[16]=p):p=e[16];let u;e[17]!==a||e[18]!==M||e[19]!==f?(u=!a&&(0,o.jsxDEV)(I,{"data-testid":"dashboards-add",onClick:M,size:"sm",type:"button",children:f("Add widget")},void 0,!1),e[17]=a,e[18]=M,e[19]=f,e[20]=u):u=e[20];let h;e[21]!==p||e[22]!==u?(h=(0,o.jsxDEV)("div",{className:"flex items-center justify-between",children:[p,u]},void 0,!0),e[21]=p,e[22]=u,e[23]=h):h=e[23];let v;e[24]!==d||e[25]!==c||e[26]!==a||e[27]!==E?(v=a&&(0,o.jsxDEV)(ce,{draft:d,editing:c!==null,onCancel:L,onChange:l,onSubmit:E},void 0,!1),e[24]=d,e[25]=c,e[26]=a,e[27]=E,e[28]=v):v=e[28];let g;e[29]!==a||e[30]!==A||e[31]!==C||e[32]!==f||e[33]!==t?(g=t.length===0&&!a?(0,o.jsxDEV)(U,{description:f("Add a widget to chart a saved SQL query on this browser."),testId:"dashboards-empty",title:f("No widgets yet")},void 0,!1):(0,o.jsxDEV)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3","data-testid":"dashboards-grid",children:t.map(r=>(0,o.jsxDEV)(ne,{onEdit:A,onRemove:C,widget:r},r.id,!1))},void 0,!1),e[29]=a,e[30]=A,e[31]=C,e[32]=f,e[33]=t,e[34]=g):g=e[34];let N;return e[35]!==v||e[36]!==g||e[37]!==h?(N=(0,o.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-dashboards",children:[h,v,g]},void 0,!0),e[35]=v,e[36]=g,e[37]=h,e[38]=N):N=e[38],N},"DashboardsPanel");export{xe as default};
@@ -1 +0,0 @@
1
- import{a as $}from"./chunk-WMDH2CIZ.js";import{a as W}from"./chunk-2YTF6LJ6.js";import{a as _}from"./chunk-2K47A3P6.js";import{a as q}from"./chunk-F7GE4X2U.js";import"./chunk-XNJNSCLM.js";import{b as H}from"./chunk-RD5UG2YL.js";import{a as G,b as P,c as V,d as b,e as i,f as o}from"./chunk-GTM65MVX.js";import{a as k,e as B}from"./chunk-Y572GMZE.js";import{a as y}from"./chunk-JSEXCW5Q.js";import{a as U}from"./chunk-F2YMCQ6B.js";import{b as Q}from"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import{R as w}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as L}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as T}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as g}from"./chunk-TEWVD66F.js";import{f as M}from"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as A}from"./chunk-TAD43CG5.js";import{d as S,f as F,g as K,h as O,m as j,q as z}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as n,e as D,f as le,h as ce}from"./chunk-RRCPZMC2.js";var a=D(le(),1);var e=D(ce(),1);var ue=F(g.runMigration),we=n(({initialShardKey:J})=>{let X=M(),r=S(),[c,Y]=(0,a.useState)(J??""),[x,Z]=(0,a.useState)(""),[R,ee]=(0,a.useState)("up"),[f,re]=(0,a.useState)(!0),[u,N]=(0,a.useState)(!1),[d,h]=(0,a.useState)(null),[C,p]=(0,a.useState)(null),m=_(c.trim(),400),I=c.trim()===m,s=H(g.migrationStatus,{},{live:!0,shardKey:m}),l=s.data?.migrations??null,te=s.error,{errorSource:ae,liveError:ie}=s;(0,a.useEffect)(()=>{s.data!==void 0&&Q(m)},[s.data,m]);let oe=n(async()=>{let t=x.trim();if(t===""){p(r("Enter a migration id")),h(null);return}N(!0),p(null);try{let v=await X.query(ue,{direction:R,dryRun:f,id:t},K(c));h(v),s.refetch()}catch(v){h(null),p(O(v))}finally{N(!1)}},"run"),E=n(()=>{j(oe())},"runMigration"),ne=n(t=>{Z(t.target.value)},"onIdChange"),se=n(t=>{ee(t.target.value==="down"?"down":"up")},"onDirectionChange"),de=n(t=>{re(t.target.checked)},"onDryRunChange");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-migrations",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(U,{onChange:Y,testId:"mg-shard-input",value:c},void 0,!1),(0,e.jsxDEV)($,{message:ie,prefix:"mg"},void 0,!1)]},void 0,!0),te!==null&&(0,e.jsxDEV)(q,{error:ae,testId:"mg-status-error"},void 0,!1),l!==null&&l.length===0&&(0,e.jsxDEV)(A,{description:r("Data migrations you run against this shard will be tracked here."),icon:(0,e.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsxDEV)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"},void 0,!1)},void 0,!1),testId:"mg-empty",title:r("No migrations have run on this shard.")},void 0,!1),l!==null&&l.length>0&&(0,e.jsxDEV)(k,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(B,{className:"px-0",children:(0,e.jsxDEV)(G,{"data-testid":"mg-table",children:[(0,e.jsxDEV)(P,{children:(0,e.jsxDEV)(b,{children:[(0,e.jsxDEV)(i,{children:r("id")},void 0,!1),(0,e.jsxDEV)(i,{children:r("direction")},void 0,!1),(0,e.jsxDEV)(i,{children:r("status")},void 0,!1),(0,e.jsxDEV)(i,{children:r("processed")},void 0,!1),(0,e.jsxDEV)(i,{children:r("changed")},void 0,!1),(0,e.jsxDEV)(i,{children:r("updated")},void 0,!1),(0,e.jsxDEV)(i,{children:r("error")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(V,{children:l.map(t=>(0,e.jsxDEV)(b,{"data-testid":`mg-row-${t.id}`,children:[(0,e.jsxDEV)(o,{children:t.id},void 0,!1),(0,e.jsxDEV)(o,{children:t.direction},void 0,!1),(0,e.jsxDEV)(o,{children:(0,e.jsxDEV)(T,{variant:"secondary",children:t.status},void 0,!1)},void 0,!1),(0,e.jsxDEV)(o,{children:t.processed},void 0,!1),(0,e.jsxDEV)(o,{children:t.changed},void 0,!1),(0,e.jsxDEV)(o,{children:z(t.updatedAt)},void 0,!1),(0,e.jsxDEV)(o,{children:t.error??""},void 0,!1)]},t.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsxDEV)(y,{children:r("Run migration")},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(w,{"aria-label":r("Migration id"),className:"w-auto","data-testid":"mg-id-input",onChange:ne,placeholder:r("migration id"),value:x},void 0,!1),(0,e.jsxDEV)("select",{"aria-label":r("Direction"),className:"flex h-9 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"mg-direction",onChange:se,value:R,children:[(0,e.jsxDEV)("option",{value:"up",children:r("up")},void 0,!1),(0,e.jsxDEV)("option",{value:"down",children:r("down")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(y,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[(0,e.jsxDEV)("input",{checked:f,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:de,type:"checkbox"},void 0,!1),r("Dry run")]},void 0,!0),f?(0,e.jsxDEV)(L,{"data-testid":"mg-run",disabled:u||!I,onClick:E,size:"sm",type:"button",children:r(u?"Running\u2026":"Run")},void 0,!1):(0,e.jsxDEV)(W,{confirmLabel:r(u?"Running\u2026":"Run migration?"),disabled:u||!I,onConfirm:E,testId:"mg-run",children:r("Run")},void 0,!1)]},void 0,!0)]},void 0,!0),C!==null&&(0,e.jsxDEV)("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:C},void 0,!1),d!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[d.dryRun?r("Dry run: "):"",r("{status} \u2014 processed",{status:d.status}),d.processed,r(", changed"),d.changed]},void 0,!0)]},void 0,!0)},"MigrationsPanel");export{we as MigrationsPanel};
@@ -1 +0,0 @@
1
- import{a as w}from"./chunk-F7GE4X2U.js";import"./chunk-XNJNSCLM.js";import{b as k}from"./chunk-RD5UG2YL.js";import{a as C,b as $,c as A,d as v,e as n,f as c}from"./chunk-GTM65MVX.js";import{a as N,e as R}from"./chunk-Y572GMZE.js";import{b as y}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as S}from"./chunk-TEWVD66F.js";import"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as T}from"./chunk-TAD43CG5.js";import{d as b}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as p,e as x,g as O,h as B}from"./chunk-RRCPZMC2.js";var I=x(O(),1);var t=x(B(),1);var D=p((e,r)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[r],"operationLabel"),E={delete:2,list:3,read:0,write:1},_=p(e=>[...e].toSorted((r,a)=>r.bucket.localeCompare(a.bucket)||E[r.on]-E[a.on]||(r.prefix??"").localeCompare(a.prefix??"")),"sortRules"),Q=p(()=>{let e=(0,I.c)(14),r=b(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:d,errorSource:i}=k(S.storageRules,a),h=l!==void 0,f;if(e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==h||e[5]!==r){let g=_(Array.isArray(l?.rules)?l.rules:[]),m;e[7]!==d||e[8]!==i?(m=d!==null&&(0,t.jsxDEV)(w,{error:i,testId:"storage-rules-error"},void 0,!1),e[7]=d,e[8]=i,e[9]=m):m=e[9];let s;e[10]!==r?(s=r("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=r,e[11]=s):s=e[11];let u;e[12]!==s?(u=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:s},void 0,!1),e[12]=s,e[13]=u):u=e[13],f=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[m,u,h&&g.length===0?(0,t.jsxDEV)(T,{description:r("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:r("No storage rules defined")},void 0,!1):(0,t.jsxDEV)(N,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(R,{className:"px-0",children:(0,t.jsxDEV)(C,{"data-testid":"storage-rules-table",children:[(0,t.jsxDEV)($,{children:(0,t.jsxDEV)(v,{children:[(0,t.jsxDEV)(n,{children:r("Bucket")},void 0,!1),(0,t.jsxDEV)(n,{children:r("Operation")},void 0,!1),(0,t.jsxDEV)(n,{children:r("Key prefix")},void 0,!1),(0,t.jsxDEV)(n,{children:r("Guarded by")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(A,{children:g.map(o=>(0,t.jsxDEV)(v,{"data-testid":`storage-rule-${o.bucket}-${o.on}-${o.prefix??""}`,children:[(0,t.jsxDEV)(c,{className:"font-mono text-xs",children:o.bucket},void 0,!1),(0,t.jsxDEV)(c,{children:(0,t.jsxDEV)(y,{variant:"secondary",children:D(r,o.on)},void 0,!1)},void 0,!1),(0,t.jsxDEV)(c,{className:"font-mono text-xs",children:o.prefix??(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("(whole bucket)")},void 0,!1)},void 0,!1),(0,t.jsxDEV)(c,{className:"font-mono text-xs text-muted-foreground",children:o.procedure},void 0,!1)]},`${o.bucket}:${o.on}:${o.prefix??""}:${o.procedure}`,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),e[1]=l,e[2]=d,e[3]=i,e[4]=h,e[5]=r,e[6]=f}else f=e[6];return f},"StorageRulesPanel");export{Q as StorageRulesPanel};
@@ -1,6 +0,0 @@
1
- import{a as M,b as E,c as O,d as B,e as R,f as D,g as _,h as J}from"./chunk-V43BLH4J.js";import{a as q}from"./chunk-AHILM3ZP.js";import{a as U}from"./chunk-2YTF6LJ6.js";import{d as L,l as I,o as V}from"./chunk-HBGS4SEX.js";import{a as C,e as j,f as z,g as K,h as P}from"./chunk-RRCPZMC2.js";var T=j(K(),1),H=j(z(),1);var a=j(P(),1);var $="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",W=/["\n,]/u,X=/^[=+\-@\t\r]/u,F=C(l=>{if(l==null)return"";let e;return typeof l=="string"?e=X.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=JSON.stringify(l),W.test(e)?`"${e.replaceAll('"','""')}"`:e},"csvCell"),Y=C((l,e)=>{let o=l.map(n=>F(n)).join(","),s=e.map(n=>l.map(t=>F(n[t])).join(","));return[o,...s].join(`
2
- `)},"toCsv"),Z=C(l=>JSON.stringify(l,null,2),"toJson"),G=500,Q=C(l=>`"${l.replaceAll('"','""')}"`,"sqlIdentifier"),ee=C(l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:JSON.stringify(l)).replaceAll("'","''")}'`,"sqlLiteral"),te=C((l,e,o)=>{if(e.length===0||o.length===0)return"";let s=e.map(t=>Q(t)).join(", "),n=[];for(let t=0;t<o.length;t+=G){let r=o.slice(t,t+G).map(m=>` (${e.map(i=>ee(m[i])).join(", ")})`).join(`,
3
- `);n.push(`INSERT INTO ${Q(l)} (${s}) VALUES
4
- ${r};`)}return n.join(`
5
-
6
- `)},"toSql"),A=C((l,e,o)=>{if(!("document"in globalThis))return;let s=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:o})),n=globalThis.document.createElement("a");n.href=s,n.download=l,globalThis.document.body.append(n),n.click(),n.remove(),globalThis.URL.revokeObjectURL(s)},"downloadFile"),le=C(l=>{let e=(0,T.c)(36),{columns:o,name:s,rows:n}=l,t=L(),r;e[0]!==o||e[1]!==s||e[2]!==n?(r=C(()=>{A(`${s}.csv`,Y(o,n),"text/csv;charset=utf-8")},"t1"),e[0]=o,e[1]=s,e[2]=n,e[3]=r):r=e[3];let m=r,i;e[4]!==s||e[5]!==n?(i=C(()=>{A(`${s}.json`,Z(n),"application/json")},"t2"),e[4]=s,e[5]=n,e[6]=i):i=e[6];let f=i,d;e[7]!==o||e[8]!==s||e[9]!==n?(d=C(()=>{A(`${s}.sql`,te(s,o,n),"application/sql;charset=utf-8")},"t3"),e[7]=o,e[8]=s,e[9]=n,e[10]=d):d=e[10];let p=d,c=n.length===0,u;e[11]!==c?(u=(0,a.jsxDEV)(E,{className:$,"data-testid":"grid-export",disabled:c,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"},void 0,!1),e[11]=c,e[12]=u):u=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=(0,a.jsxDEV)(R,{children:"Export loaded rows"},void 0,!1),e[13]=v):v=e[13];let g;e[14]!==t?(g=t("CSV"),e[14]=t,e[15]=g):g=e[15];let b;e[16]!==m||e[17]!==g?(b=(0,a.jsxDEV)(D,{"data-testid":"grid-export-csv",onClick:m,children:g},void 0,!1),e[16]=m,e[17]=g,e[18]=b):b=e[18];let h;e[19]!==t?(h=t("JSON"),e[19]=t,e[20]=h):h=e[20];let x;e[21]!==f||e[22]!==h?(x=(0,a.jsxDEV)(D,{"data-testid":"grid-export-json",onClick:f,children:h},void 0,!1),e[21]=f,e[22]=h,e[23]=x):x=e[23];let y;e[24]!==t?(y=t("SQL"),e[24]=t,e[25]=y):y=e[25];let w;e[26]!==p||e[27]!==y?(w=(0,a.jsxDEV)(D,{"data-testid":"grid-export-sql",onClick:p,children:y},void 0,!1),e[26]=p,e[27]=y,e[28]=w):w=e[28];let S;e[29]!==x||e[30]!==w||e[31]!==b?(S=(0,a.jsxDEV)(O,{align:"end",children:[v,b,x,w]},void 0,!0),e[29]=x,e[30]=w,e[31]=b,e[32]=S):S=e[32];let N;return e[33]!==S||e[34]!==u?(N=(0,a.jsxDEV)(M,{children:[u,S]},void 0,!0),e[33]=S,e[34]=u,e[35]=N):N=e[35],N},"ExportMenu"),oe=C(l=>{let e=(0,T.c)(9),{column:o}=l,s;e[0]!==o?(s=C(()=>{o.toggleVisibility()},"t1"),e[0]=o,e[1]=s):s=e[1];let n=s,t;e[2]!==o?(t=o.getIsVisible(),e[2]=o,e[3]=t):t=e[3];let r=`grid-column-${o.id}`,m;return e[4]!==o.id||e[5]!==n||e[6]!==t||e[7]!==r?(m=(0,a.jsxDEV)(_,{checked:t,closeOnClick:!1,"data-testid":r,onCheckedChange:n,children:o.id},void 0,!1),e[4]=o.id,e[5]=n,e[6]=t,e[7]=r,e[8]=m):m=e[8],m},"ColumnToggle"),se=C(l=>{let e=(0,T.c)(30),{table:o}=l,s=L(),n;e[0]!==o?(n=o.getIsAllColumnsVisible(),e[0]=o,e[1]=n):n=e[1];let t=n,r;e[2]!==t||e[3]!==o?(r=C(()=>{o.toggleAllColumnsVisible(!t)},"t2"),e[2]=t,e[3]=o,e[4]=r):r=e[4];let m=r,i;e[5]!==s?(i=s("Columns"),e[5]=s,e[6]=i):i=e[6];let f;e[7]!==i?(f=(0,a.jsxDEV)(E,{className:$,"data-testid":"grid-columns",children:i},void 0,!1),e[7]=i,e[8]=f):f=e[8];let d;e[9]!==s?(d=s("Columns"),e[9]=s,e[10]=d):d=e[10];let p;e[11]!==d?(p=(0,a.jsxDEV)(R,{children:d},void 0,!1),e[11]=d,e[12]=p):p=e[12];let c;e[13]!==t||e[14]!==s?(c=s(t?"Hide all":"Show all"),e[13]=t,e[14]=s,e[15]=c):c=e[15];let u;e[16]!==t||e[17]!==m||e[18]!==c?(u=(0,a.jsxDEV)(_,{checked:t,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:m,children:c},void 0,!1),e[16]=t,e[17]=m,e[18]=c,e[19]=u):u=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=(0,a.jsxDEV)(J,{},void 0,!1),e[20]=v):v=e[20];let g;e[21]!==o?(g=o.getAllLeafColumns().map(ie),e[21]=o,e[22]=g):g=e[22];let b;e[23]!==g||e[24]!==p||e[25]!==u?(b=(0,a.jsxDEV)(O,{align:"end",className:"max-h-80 overflow-y-auto",children:(0,a.jsxDEV)(B,{children:[p,u,v,g]},void 0,!0)},void 0,!1),e[23]=g,e[24]=p,e[25]=u,e[26]=b):b=e[26];let h;return e[27]!==b||e[28]!==f?(h=(0,a.jsxDEV)(M,{children:[f,b]},void 0,!0),e[27]=b,e[28]=f,e[29]=h):h=e[29],h},"ColumnsMenu"),ne=C(l=>{let e=(0,T.c)(19),{count:o,editable:s,onClear:n,onDelete:t}=l,r=L(),m;e[0]!==o||e[1]!==r?(m=r("{count} selected",{count:o}),e[0]=o,e[1]=r,e[2]=m):m=e[2];let i;e[3]!==m?(i=(0,a.jsxDEV)("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:m},void 0,!1),e[3]=m,e[4]=i):i=e[4];let f;e[5]!==r?(f=r("Clear"),e[5]=r,e[6]=f):f=e[6];let d;e[7]!==n||e[8]!==f?(d=(0,a.jsxDEV)("button",{className:$,"data-testid":"grid-selection-clear",onClick:n,type:"button",children:f},void 0,!1),e[7]=n,e[8]=f,e[9]=d):d=e[9];let p;e[10]!==o||e[11]!==s||e[12]!==t||e[13]!==r?(p=s&&(0,a.jsxDEV)(U,{confirmLabel:r("Delete {count} rows?",{count:o}),onConfirm:t,testId:"grid-selection-delete",children:r("Delete {count}",{count:o})},void 0,!1),e[10]=o,e[11]=s,e[12]=t,e[13]=r,e[14]=p):p=e[14];let c;return e[15]!==i||e[16]!==d||e[17]!==p?(c=(0,a.jsxDEV)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[i,d,p]},void 0,!0),e[15]=i,e[16]=d,e[17]=p,e[18]=c):c=e[18],c},"SelectionBar"),pe=C(l=>{let e=(0,T.c)(32),{column:o,onClose:s,value:n}=l,t=L(),[r,m]=(0,H.useState)(!1),i;e[0]!==n?(i=I(n),e[0]=n,e[1]=i):i=e[1];let f=i,d;e[2]!==f?(d=C(()=>{V(f)&&m(!0)},"t2"),e[2]=f,e[3]=d):d=e[3];let p=d,c;e[4]!==t?(c=t("Cell value"),e[4]=t,e[5]=c):c=e[5];let u;e[6]!==o?(u=(0,a.jsxDEV)("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:o},void 0,!1),e[6]=o,e[7]=u):u=e[7];let v;e[8]!==r||e[9]!==t?(v=t(r?"Copied":"Copy"),e[8]=r,e[9]=t,e[10]=v):v=e[10];let g;e[11]!==p||e[12]!==v?(g=(0,a.jsxDEV)("button",{className:$,"data-testid":"grid-cell-copy",onClick:p,type:"button",children:v},void 0,!1),e[11]=p,e[12]=v,e[13]=g):g=e[13];let b;e[14]!==t?(b=t("Close"),e[14]=t,e[15]=b):b=e[15];let h;e[16]!==s||e[17]!==b?(h=(0,a.jsxDEV)("button",{className:$,"data-testid":"grid-cell-close",onClick:s,type:"button",children:b},void 0,!1),e[16]=s,e[17]=b,e[18]=h):h=e[18];let x;e[19]!==g||e[20]!==h?(x=(0,a.jsxDEV)("div",{className:"flex items-center gap-1.5",children:[g,h]},void 0,!0),e[19]=g,e[20]=h,e[21]=x):x=e[21];let y;e[22]!==u||e[23]!==x?(y=(0,a.jsxDEV)("div",{className:"flex items-center justify-between",children:[u,x]},void 0,!0),e[22]=u,e[23]=x,e[24]=y):y=e[24];let w;e[25]!==f?(w=(0,a.jsxDEV)("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:f},void 0,!1),e[25]=f,e[26]=w):w=e[26];let S;return e[27]!==s||e[28]!==y||e[29]!==w||e[30]!==c?(S=(0,a.jsxDEV)(q,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:c,onClose:s,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[y,w]},void 0,!0),e[27]=s,e[28]=y,e[29]=w,e[30]=c,e[31]=S):S=e[31],S},"CellDetailDialog"),ue=C(l=>{let e=(0,T.c)(33),{columns:o,editable:s,name:n,onBulkDelete:t,onToggleTranspose:r,rows:m,table:i,transposed:f}=l,d=L(),p;e[0]!==i?(p=i.getSelectedRowModel(),e[0]=i,e[1]=p):p=e[1];let c=p.rows,u;e[2]!==i?(u=C(()=>{i.resetRowSelection()},"t2"),e[2]=i,e[3]=u):u=e[3];let v=u,g;e[4]!==t||e[5]!==c||e[6]!==i?(g=C(()=>{t(c.map(re)),i.resetRowSelection()},"t3"),e[4]=t,e[5]=c,e[6]=i,e[7]=g):g=e[7];let b=g,h;e[8]!==o||e[9]!==n||e[10]!==m?(h=(0,a.jsxDEV)(le,{columns:o,name:n,rows:m},void 0,!1),e[8]=o,e[9]=n,e[10]=m,e[11]=h):h=e[11];let x;e[12]!==i?(x=(0,a.jsxDEV)(se,{table:i},void 0,!1),e[12]=i,e[13]=x):x=e[13];let y;e[14]!==d?(y=d("Swap rows and columns"),e[14]=d,e[15]=y):y=e[15];let w;e[16]!==d?(w=d("Transpose"),e[16]=d,e[17]=w):w=e[17];let S;e[18]!==r||e[19]!==y||e[20]!==w||e[21]!==f?(S=(0,a.jsxDEV)("button",{"aria-pressed":f,className:$,"data-testid":"grid-transpose",onClick:r,title:y,type:"button",children:w},void 0,!1),e[18]=r,e[19]=y,e[20]=w,e[21]=f,e[22]=S):S=e[22];let N;e[23]!==s||e[24]!==v||e[25]!==b||e[26]!==c.length?(N=c.length>0&&(0,a.jsxDEV)(ne,{count:c.length,editable:s,onClear:v,onDelete:b},void 0,!1),e[23]=s,e[24]=v,e[25]=b,e[26]=c.length,e[27]=N):N=e[27];let k;return e[28]!==h||e[29]!==x||e[30]!==S||e[31]!==N?(k=(0,a.jsxDEV)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[h,x,S,N]},void 0,!0),e[28]=h,e[29]=x,e[30]=S,e[31]=N,e[32]=k):k=e[32],k},"GridActionsBar");function ie(l){return(0,a.jsxDEV)(oe,{column:l},l.id,!1)}C(ie,"_temp");function re(l){return l.id}C(re,"_temp2");export{le as a,ne as b,pe as c,ue as d};
@@ -1 +0,0 @@
1
- import{a as t}from"./chunk-RRCPZMC2.js";var o=t(r=>{if(typeof r=="string")return r;try{return JSON.stringify(r)??String(r)}catch{return String(r)}},"stringifyFieldValue"),e=t(r=>typeof r!="object"||r===null||Array.isArray(r)?"":Object.entries(r).map(([n,i])=>`${n}=${o(i)}`).join(" "),"formatLogFields");export{e as a};
@@ -1 +0,0 @@
1
- import{a as k,b as N,c as O,d as x,e as q,f as D}from"./chunk-GTM65MVX.js";import{a as g}from"./chunk-Y572GMZE.js";import{a as C}from"./chunk-TAD43CG5.js";import{d as T,h as I,l as _,m as w}from"./chunk-HBGS4SEX.js";import{b as L}from"./chunk-LXULVPEM.js";import{a as d,e as b,f as U,g as Y,h as F}from"./chunk-RRCPZMC2.js";var M=b(Y(),1);var H="https://api.cloudflare.com/client/v4/accounts",E=class extends L{static{d(this,"AnalyticsSqlError")}constructor(e,f){super("ANALYTICS_SQL_ERROR",`Analytics Engine SQL API returned ${String(e)}: ${f}`,{name:"AnalyticsSqlError",status:e})}},v=d(t=>{let e=t.fetch??globalThis.fetch,f=`${H}/${encodeURIComponent(t.accountId)}/analytics_engine/sql`;return{query:d(async s=>{let l=await e(f,{body:s,headers:{Authorization:`Bearer ${t.apiToken}`,"Content-Type":"text/plain"},method:"POST"});if(!l.ok)throw new E(l.status,await l.text());let n;try{n=await l.json()}catch{throw new E(l.status,"Analytics Engine SQL API returned a non-JSON body.")}let o=n,a=o.data??[];return{columns:o.meta??[],rowCount:o.rows??a.length,rows:a}},"query")}},"createAnalyticsSqlClient");var m=b(U(),1);var r=b(F(),1);var W="ANALYTICS",P=[{key:"volume",sql:d(t=>`SELECT blob2 AS fn, count() AS calls FROM ${t} WHERE blob1 = 'function_call' GROUP BY fn ORDER BY calls DESC LIMIT 25`,"sql"),title:"Request volume per function"},{key:"latency",sql:d(t=>`SELECT blob2 AS fn, quantileWeighted(0.50)(double1, _sample_interval) AS p50, quantileWeighted(0.95)(double1, _sample_interval) AS p95 FROM ${t} WHERE blob1 = 'function_call' GROUP BY fn ORDER BY p95 DESC LIMIT 25`,"sql"),title:"Latency p50 / p95 per function"},{key:"hotShards",sql:d(t=>`SELECT blob3 AS shard, count() AS calls FROM ${t} WHERE blob1 = 'function_call' GROUP BY shard ORDER BY calls DESC LIMIT 25`,"sql"),title:"Hot shards"}],j={error:null,loading:!0,result:null},G=d(t=>{let e=(0,M.c)(27),{state:f,title:p}=t,s=T(),{error:l,loading:n,result:o}=f,a=`analytics-panel-${p}`,i;e[0]!==s||e[1]!==p?(i=s(p),e[0]=s,e[1]=p,e[2]=i):i=e[2];let c;e[3]!==i?(c=(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i},void 0,!1)},void 0,!1),e[3]=i,e[4]=c):c=e[4];let u;e[5]!==n||e[6]!==s?(u=n&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"analytics-loading",children:s("Loading\u2026")},void 0,!1),e[5]=n,e[6]=s,e[7]=u):u=e[7];let y;e[8]!==l||e[9]!==n?(y=!n&&l!==null&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"analytics-error",role:"alert",children:l},void 0,!1),e[8]=l,e[9]=n,e[10]=y):y=e[10];let h;e[11]!==l||e[12]!==n||e[13]!==o||e[14]!==s?(h=!n&&l===null&&o!==null&&o.rows.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"analytics-empty-rows",children:s("No data points yet.")},void 0,!1),e[11]=l,e[12]=n,e[13]=o,e[14]=s,e[15]=h):h=e[15];let A;e[16]!==l||e[17]!==n||e[18]!==o?(A=!n&&l===null&&o!==null&&o.rows.length>0&&(0,r.jsxDEV)(k,{children:[(0,r.jsxDEV)(N,{children:(0,r.jsxDEV)(x,{children:o.columns.map(Q)},void 0,!1)},void 0,!1),(0,r.jsxDEV)(O,{children:o.rows.map((B,$)=>(0,r.jsxDEV)(x,{children:o.columns.map(R=>(0,r.jsxDEV)(D,{className:"font-mono text-xs",children:_(B[R.name])},R.name,!1))},$,!1))},void 0,!1)]},void 0,!0),e[16]=l,e[17]=n,e[18]=o,e[19]=A):A=e[19];let S;return e[20]!==a||e[21]!==c||e[22]!==u||e[23]!==y||e[24]!==h||e[25]!==A?(S=(0,r.jsxDEV)(g,{className:"gap-0 py-0","data-testid":a,children:[c,u,y,h,A]},void 0,!0),e[20]=a,e[21]=c,e[22]=u,e[23]=y,e[24]=h,e[25]=A,e[26]=S):S=e[26],S},"PanelResult"),re=d(({config:t,dataset:e=W,runQuery:f}={})=>{let p=T(),[s,l]=(0,m.useState)({}),n=(0,m.useMemo)(()=>{if(f!==void 0)return f;if(t===void 0)return null;let a=v({accountId:t.accountId,apiToken:t.apiToken});return i=>a.query(i)},[t,f]),o=(0,m.useCallback)(async a=>{if(n!==null)for(let i of P){if(a.cancelled)return;l(c=>({...c,[i.key]:{error:null,loading:!0,result:null}}));try{let c=await n(i.sql(e));a.cancelled||l(u=>({...u,[i.key]:{error:null,loading:!1,result:c}}))}catch(c){a.cancelled||l(u=>({...u,[i.key]:{error:I(c),loading:!1,result:null}}))}}},[n,e]);return(0,m.useEffect)(()=>{let a={cancelled:!1};return w(o(a)),()=>{a.cancelled=!0}},[o]),n===null?(0,r.jsxDEV)(C,{description:p("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN (Analytics Read) in your .dev.vars to enable usage panels."),icon:(0,r.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsxDEV)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"},void 0,!1)},void 0,!1),testId:"analytics-not-configured",title:p("Analytics is not configured.")},void 0,!1):(0,r.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-analytics-panel",children:P.map(a=>(0,r.jsxDEV)(G,{state:s[a.key]??j,title:a.title},a.key,!1))},void 0,!1)},"AnalyticsPanel");function Q(t){return(0,r.jsxDEV)(q,{children:t.name},t.name,!1)}d(Q,"_temp");export{re as AnalyticsPanel};
@@ -1 +0,0 @@
1
- import{b as $}from"./chunk-IYHPYY4A.js";import{a as M}from"./chunk-F7GE4X2U.js";import"./chunk-XNJNSCLM.js";import{b as H}from"./chunk-RD5UG2YL.js";import{a as P,b as Q,c as W,d as V,e as C,f as E}from"./chunk-GTM65MVX.js";import{a as K,e as O}from"./chunk-Y572GMZE.js";import{b as F}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as j}from"./chunk-TEWVD66F.js";import"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as B}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as U,e as L,f as G,g as J,h as X}from"./chunk-RRCPZMC2.js";var q=L(J(),1),te=L(G(),1);var r=L(X(),1);var Y={binding:"outline",secret:"destructive",var:"secondary"},me=U(i=>{let e=(0,q.c)(68),{initialShardKey:z}=i,t=B(),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N={},e[0]=N):N=e[0];let R=z??"",T;e[1]!==R?(T={shardKey:R},e[1]=R,e[2]=T):T=e[2];let{data:k,error:d,errorSource:S,isLoading:A}=H(j.getSettings,N,T),D;e:{let s=k?.deploy;if(s===void 0){let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[3]=l):l=e[3],D=l;break e}let o;if(e[4]!==s.deploymentId||e[5]!==s.environment||e[6]!==s.versionTag||e[7]!==s.workerUrl||e[8]!==t){if(o=[],s.workerUrl!==void 0){let l;e[10]!==t?(l=t("URL"),e[10]=t,e[11]=l):l=e[11];let a;e[12]!==s.workerUrl||e[13]!==l?(a={label:l,value:s.workerUrl},e[12]=s.workerUrl,e[13]=l,e[14]=a):a=e[14],o.push(a)}if(s.environment!==void 0){let l;e[15]!==t?(l=t("Environment"),e[15]=t,e[16]=l):l=e[16];let a;e[17]!==s.environment||e[18]!==l?(a={label:l,value:s.environment},e[17]=s.environment,e[18]=l,e[19]=a):a=e[19],o.push(a)}if(s.deploymentId!==void 0){let l;e[20]!==t?(l=t("Deployment"),e[20]=t,e[21]=l):l=e[21];let a;e[22]!==s.deploymentId||e[23]!==l?(a={label:l,value:s.deploymentId},e[22]=s.deploymentId,e[23]=l,e[24]=a):a=e[24],o.push(a)}if(s.versionTag!==void 0){let l;e[25]!==t?(l=t("Version"),e[25]=t,e[26]=l):l=e[26];let a;e[27]!==s.versionTag||e[28]!==l?(a={label:l,value:s.versionTag},e[27]=s.versionTag,e[28]=l,e[29]=a):a=e[29],o.push(a)}e[4]=s.deploymentId,e[5]=s.environment,e[6]=s.versionTag,e[7]=s.workerUrl,e[8]=t,e[9]=o}else o=e[9];D=o}let w=D,_;e[30]!==k?.settings?(_=k?.settings??[],e[30]=k?.settings,e[31]=_):_=e[31];let n=_,m;e[32]!==t?(m=t("Open in Cloudflare"),e[32]=t,e[33]=m):m=e[33];let f;e[34]!==m?(f=(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:$,rel:"noreferrer",target:"_blank",children:m},void 0,!1)},void 0,!1),e[34]=m,e[35]=f):f=e[35];let c;e[36]!==t?(c=t("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[36]=t,e[37]=c):c=e[37];let v;e[38]!==c?(v=(0,r.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:c},void 0,!1),e[38]=c,e[39]=v):v=e[39];let p;e[40]!==d||e[41]!==S?(p=d!==null&&(0,r.jsxDEV)(M,{error:S,testId:"set-error"},void 0,!1),e[40]=d,e[41]=S,e[42]=p):p=e[42];let u;e[43]!==w||e[44]!==t?(u=w.length>0&&(0,r.jsxDEV)(K,{className:"py-0","data-testid":"set-deploy",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Deployment")},void 0,!1)},void 0,!1),(0,r.jsxDEV)(O,{className:"py-3",children:(0,r.jsxDEV)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:w.map(Z)},void 0,!1)},void 0,!1)]},void 0,!0),e[43]=w,e[44]=t,e[45]=u):u=e[45];let h;e[46]!==t?(h=t("Environment & bindings"),e[46]=t,e[47]=h):h=e[47];let g;e[48]!==h?(g=(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h},void 0,!1)},void 0,!1),e[48]=h,e[49]=g):g=e[49];let x;e[50]!==d||e[51]!==A||e[52]!==n.length||e[53]!==t?(x=d===null&&!A&&n.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:t("No environment variables or bindings.")},void 0,!1),e[50]=d,e[51]=A,e[52]=n.length,e[53]=t,e[54]=x):x=e[54];let b;e[55]!==n||e[56]!==t?(b=n.length>0&&(0,r.jsxDEV)(O,{className:"px-0 py-0",children:(0,r.jsxDEV)(P,{"data-testid":"set-table",children:[(0,r.jsxDEV)(Q,{children:(0,r.jsxDEV)(V,{children:[(0,r.jsxDEV)(C,{children:t("name")},void 0,!1),(0,r.jsxDEV)(C,{children:t("kind")},void 0,!1),(0,r.jsxDEV)(C,{children:t("value")},void 0,!1)]},void 0,!0)},void 0,!1),(0,r.jsxDEV)(W,{children:n.map(ee)},void 0,!1)]},void 0,!0)},void 0,!1),e[55]=n,e[56]=t,e[57]=b):b=e[57];let y;e[58]!==g||e[59]!==x||e[60]!==b?(y=(0,r.jsxDEV)(K,{className:"py-0",children:[g,x,b]},void 0,!0),e[58]=g,e[59]=x,e[60]=b,e[61]=y):y=e[61];let I;return e[62]!==p||e[63]!==u||e[64]!==y||e[65]!==f||e[66]!==v?(I=(0,r.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-settings",children:[f,v,p,u,y]},void 0,!0),e[62]=p,e[63]=u,e[64]=y,e[65]=f,e[66]=v,e[67]=I):I=e[67],I},"SettingsPanel");function Z(i){return(0,r.jsxDEV)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,r.jsxDEV)("dt",{className:"text-muted-foreground",children:i.label},void 0,!1),(0,r.jsxDEV)("dd",{className:"truncate font-mono text-xs",title:i.value,children:i.value},void 0,!1)]},i.label,!0)}U(Z,"_temp");function ee(i){return(0,r.jsxDEV)(V,{"data-testid":"set-row",children:[(0,r.jsxDEV)(E,{className:"font-mono text-xs font-medium",children:i.name},void 0,!1),(0,r.jsxDEV)(E,{children:(0,r.jsxDEV)(F,{variant:Y[i.kind],children:i.bindingType??i.kind},void 0,!1)},void 0,!1),(0,r.jsxDEV)(E,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:i.value??(0,r.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},i.name,!0)}U(ee,"_temp2");export{me as SettingsPanel};
@@ -1 +0,0 @@
1
- import{c as y}from"./chunk-CKSHCYGC.js";import{a as n,e as b,f as h}from"./chunk-RRCPZMC2.js";var N=b(h(),1);var _=n(()=>{},"noop"),F=typeof document<"u"?N.useLayoutEffect:_;var O=b(h(),1),l={...O};var a=l.useInsertionEffect,V=a&&a!==l.useLayoutEffect?a:t=>t();function z(t){let e=y(B).current;return e.next=t,V(e.effect),e.trampoline}n(z,"useStableCallback");function B(){let t={next:void 0,callback:W,trampoline:n((...e)=>t.callback?.(...e),"trampoline"),effect:n(()=>{t.callback=t.next},"effect")};return t}n(B,"createStableCallback");function W(){throw new Error("Base UI: Cannot call an event handler while rendering.")}n(W,"assertNotCalled");function u(){return typeof window<"u"}n(u,"hasWindow");function m(t){return v(t)?(t.nodeName||"").toLowerCase():"#document"}n(m,"getNodeName");function i(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}n(i,"getWindow");function $(t){var e;return(e=(v(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}n($,"getDocumentElement");function v(t){return u()?t instanceof Node||t instanceof i(t).Node:!1}n(v,"isNode");function C(t){return u()?t instanceof Element||t instanceof i(t).Element:!1}n(C,"isElement");function L(t){return u()?t instanceof HTMLElement||t instanceof i(t).HTMLElement:!1}n(L,"isHTMLElement");function S(t){return!u()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof i(t).ShadowRoot}n(S,"isShadowRoot");function R(t){let{overflow:e,overflowX:c,overflowY:s,display:o}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+c)&&o!=="inline"&&o!=="contents"}n(R,"isOverflowElement");function Q(t){return/^(table|td|th)$/.test(m(t))}n(Q,"isTableElement");function I(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}n(I,"isTopLayer");var A=/transform|translate|scale|rotate|perspective|filter/,H=/paint|layout|strict|content/,r=n(t=>!!t&&t!=="none","isNotNone"),d;function K(t){let e=C(t)?k(t):t;return r(e.transform)||r(e.translate)||r(e.scale)||r(e.rotate)||r(e.perspective)||!M()&&(r(e.backdropFilter)||r(e.filter))||A.test(e.willChange||"")||H.test(e.contain||"")}n(K,"isContainingBlock");function Z(t){let e=p(t);for(;L(e)&&!D(e);){if(K(e))return e;if(I(e))return null;e=p(e)}return null}n(Z,"getContainingBlock");function M(){return d==null&&(d=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),d}n(M,"isWebKit");function D(t){return/^(html|body|#document)$/.test(m(t))}n(D,"isLastTraversableNode");function k(t){return i(t).getComputedStyle(t)}n(k,"getComputedStyle");function tt(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}n(tt,"getNodeScroll");function p(t){if(m(t)==="html")return t;let e=t.assignedSlot||t.parentNode||S(t)&&t.host||$(t);return S(e)?e.host:e}n(p,"getParentNode");function x(t){let e=p(t);return D(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(e)&&R(e)?e:x(e)}n(x,"getNearestOverflowAncestor");function g(t,e,c){var s;e===void 0&&(e=[]),c===void 0&&(c=!0);let o=x(t),T=o===((s=t.ownerDocument)==null?void 0:s.body),f=i(o);if(T){let E=j(f);return e.concat(f,f.visualViewport||[],R(o)?o:[],E&&c?g(E):[])}else return e.concat(o,g(o,[],c))}n(g,"getOverflowAncestors");function j(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}n(j,"getFrameElement");var w;w=new Set;function ot(...t){{let e=t.join(" ");w.has(e)||(w.add(e),console.error(`Base UI: ${e}`))}}n(ot,"error");export{F as a,l as b,z as c,m as d,i as e,$ as f,v as g,C as h,L as i,S as j,R as k,Q as l,I as m,K as n,Z as o,M as p,D as q,k as r,tt as s,p as t,g as u,j as v,ot as w};
@@ -1 +0,0 @@
1
- import{a as q,b as B,c as V,d as p,e as d,f as n}from"./chunk-GTM65MVX.js";import{a as S,e as k}from"./chunk-Y572GMZE.js";import{R as $}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as A}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-CKSHCYGC.js";import{f as F}from"./chunk-3LJEGSMK.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as H}from"./chunk-TAD43CG5.js";import{d as Q,h as E,l as K,m as I}from"./chunk-HBGS4SEX.js";import"./chunk-LXULVPEM.js";import{a as f,e as C,f as Z,g as G,h as J}from"./chunk-RRCPZMC2.js";var z=C(G(),1);var s=C(Z(),1);var e=C(J(),1);var X=10,g=f(x=>{let l=(0,z.c)(7),{label:m,value:a}=x,r;l[0]!==m?(r=(0,e.jsxDEV)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:m},void 0,!1),l[0]=m,l[1]=r):r=l[1];let v=a??"\u2014",o;l[2]!==v?(o=(0,e.jsxDEV)("span",{className:"font-mono text-sm",children:v},void 0,!1),l[2]=v,l[3]=o):o=l[3];let u;return l[4]!==r||l[5]!==o?(u=(0,e.jsxDEV)("div",{className:"flex flex-col gap-0.5",children:[r,o]},void 0,!0),l[4]=r,l[5]=o,l[6]=u):u=l[6],u},"Detail"),oe=f(({loadIndexes:x,runQuery:l}={})=>{let m=F(),a=Q(),[r,v]=(0,s.useState)(null),[o,u]=(0,s.useState)(null),[b,L]=(0,s.useState)(null),[N,O]=(0,s.useState)(""),[h,y]=(0,s.useState)(null),[M,w]=(0,s.useState)(null),[j,D]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let t={cancelled:!1};return I((async()=>{try{let c=await(x??(()=>m.listVectorIndexes()))();t.cancelled||(v(c),u(null),L(T=>T??c[0]?.name??null))}catch(c){t.cancelled||(v(null),u(E(c)))}})()),()=>{t.cancelled=!0}},[m,x]);let i=r?.find(t=>t.name===b)??null,P=f(t=>{L(t.currentTarget.dataset.index??null),y(null),w(null)},"onSelect"),R=f(t=>{O(t.target.value)},"onQueryTextChange"),U=f(async()=>{let t=N.trim();if(!(b===null||t==="")){D(!0),w(null);try{let c=await(l??(T=>m.queryVectorIndex(T)))({name:b,text:t,topK:X});y(c)}catch(c){y(null),w(E(c))}finally{D(!1)}}},"search"),W=f(()=>{I(U())},"onSearch");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-vector-browser",children:[o!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"vector-error",role:"alert",children:o},void 0,!1),r!==null&&r.length===0&&(0,e.jsxDEV)(H,{description:a("Indexes declared with .vectorize() or defineVectorIndex() appear here."),icon:(0,e.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsxDEV)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"},void 0,!1)},void 0,!1),testId:"vector-empty",title:a("No vector indexes.")},void 0,!1),r!==null&&r.length>0&&(0,e.jsxDEV)(S,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(k,{className:"px-0",children:(0,e.jsxDEV)(q,{"data-testid":"vector-table",children:[(0,e.jsxDEV)(B,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(d,{children:a("name")},void 0,!1),(0,e.jsxDEV)(d,{children:a("table")},void 0,!1),(0,e.jsxDEV)(d,{children:a("dimensions")},void 0,!1),(0,e.jsxDEV)(d,{children:a("metric")},void 0,!1),(0,e.jsxDEV)(d,{children:a("vectors")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(V,{children:r.map(t=>(0,e.jsxDEV)(p,{className:t.name===b?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-index":t.name,"data-testid":`vector-row-${t.name}`,onClick:P,children:[(0,e.jsxDEV)(n,{className:"font-mono text-xs",children:t.name},void 0,!1),(0,e.jsxDEV)(n,{className:"font-mono text-xs",children:t.table},void 0,!1),(0,e.jsxDEV)(n,{className:"tabular-nums",children:t.dimensions??"\u2014"},void 0,!1),(0,e.jsxDEV)(n,{children:t.metric??"\u2014"},void 0,!1),(0,e.jsxDEV)(n,{className:"tabular-nums",children:t.vectorsCount??"\u2014"},void 0,!1)]},t.name,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),i!==null&&(0,e.jsxDEV)("section",{className:"border border-border bg-card p-3","data-testid":"vector-detail",children:[(0,e.jsxDEV)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,e.jsxDEV)(g,{label:a("field"),value:i.field},void 0,!1),(0,e.jsxDEV)(g,{label:a("dimensions"),value:i.dimensions},void 0,!1),(0,e.jsxDEV)(g,{label:a("metric"),value:i.metric},void 0,!1),(0,e.jsxDEV)(g,{label:a("vectors"),value:i.vectorsCount},void 0,!1)]},void 0,!0),i.metadata!==void 0&&i.metadata.length>0&&(0,e.jsxDEV)("p",{className:"mt-3 text-xs text-muted-foreground","data-testid":"vector-metadata",children:[a("metadata"),": ",(0,e.jsxDEV)("span",{className:"font-mono",children:i.metadata.join(", ")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)($,{className:"min-w-[18rem] flex-1","data-testid":"vector-query-input",onChange:R,placeholder:a("Search by similarity\u2026"),value:N},void 0,!1),(0,e.jsxDEV)(A,{"data-testid":"vector-search",disabled:j||N.trim()==="",onClick:W,children:a(j?"Searching\u2026":"Search")},void 0,!1)]},void 0,!0),M!==null&&(0,e.jsxDEV)("p",{className:"mt-2 text-sm text-destructive","data-testid":"vector-query-error",role:"alert",children:M},void 0,!1),h!==null&&h.length===0&&(0,e.jsxDEV)("p",{className:"mt-2 text-sm text-muted-foreground","data-testid":"vector-no-matches",children:a("No matches.")},void 0,!1),h!==null&&h.length>0&&(0,e.jsxDEV)(S,{className:"mt-3 overflow-hidden py-0",children:(0,e.jsxDEV)(k,{className:"px-0",children:(0,e.jsxDEV)(q,{"data-testid":"vector-matches",children:[(0,e.jsxDEV)(B,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(d,{children:a("id")},void 0,!1),(0,e.jsxDEV)(d,{children:a("score")},void 0,!1),(0,e.jsxDEV)(d,{children:a("metadata")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(V,{children:h.map(t=>(0,e.jsxDEV)(p,{"data-testid":`vector-match-${t.id}`,children:[(0,e.jsxDEV)(n,{className:"font-mono text-xs",children:t.id},void 0,!1),(0,e.jsxDEV)(n,{className:"tabular-nums",children:t.score.toFixed(4)},void 0,!1),(0,e.jsxDEV)(n,{className:"max-w-md truncate font-mono text-xs",children:t.metadata===void 0?"\u2014":K(t.metadata)},void 0,!1)]},t.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},"VectorBrowser");export{oe as VectorBrowser};
@@ -1 +0,0 @@
1
- import{a as y}from"./chunk-RD5UG2YL.js";import{f as m}from"./chunk-3LJEGSMK.js";import{h as d,m as g}from"./chunk-HBGS4SEX.js";import{a as o,e as f,f as A,g as b}from"./chunk-RRCPZMC2.js";var p=f(b(),1);var c=f(A(),1);var h={capabilities:{accounts:!0,admin:!0,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},L=o(()=>{let e=(0,p.c)(6),t=m(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],e[0]=a):a=e[0];let s;e[1]!==t?(s=o(()=>t.getAuthConfig(),"t1"),e[1]=t,e[2]=s):s=e[2];let{data:u,isLoading:i}=y(a,s),r=u??h,l=!i,n;return e[3]!==r||e[4]!==l?(n={config:r,ready:l},e[3]=r,e[4]=l,e[5]=n):n=e[5],n},"useAuthConfig"),w=o(()=>{let[e,t]=(0,c.useState)(!1),[a,s]=(0,c.useState)(null);return{busy:e,error:a,run:o(i=>{g((async()=>{t(!0),s(null);try{await i()}catch(r){s(d(r))}finally{t(!1)}})())},"run")}},"useAsyncSubmit");export{L as a,w as b};