@lunora/studio 1.0.0-alpha.13 → 1.0.0-alpha.131

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 (329) hide show
  1. package/LICENSE.md +6 -0
  2. package/dist/index.d.ts +881 -786
  3. package/dist/index.js +1 -41
  4. package/dist/mount.d.ts +10 -10
  5. package/dist/mount.js +1 -26
  6. package/dist/packem_chunks/AdvisorHealthPanel.js +1 -0
  7. package/dist/packem_chunks/ApiTab.js +1 -0
  8. package/dist/packem_chunks/AuditPanel.js +1 -0
  9. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
  10. package/dist/packem_chunks/ExportImportPanel.js +3 -0
  11. package/dist/packem_chunks/FileBrowser.js +4 -0
  12. package/dist/packem_chunks/FunctionRunner.js +1 -0
  13. package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
  14. package/dist/packem_chunks/HealthPanel.js +1 -0
  15. package/dist/packem_chunks/InsightsPanel.js +1 -0
  16. package/dist/packem_chunks/LogsPanel.js +1 -0
  17. package/dist/packem_chunks/MailPanel.js +2 -0
  18. package/dist/packem_chunks/MetricsPanel.js +1 -0
  19. package/dist/packem_chunks/NotificationsPanel.js +1 -0
  20. package/dist/packem_chunks/PitrPanel.js +1 -0
  21. package/dist/packem_chunks/SchemaViewer.js +1 -0
  22. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
  23. package/dist/packem_chunks/SettingsPanel.js +1 -0
  24. package/dist/packem_chunks/SqlEditorPanel.js +9 -0
  25. package/dist/packem_chunks/TableEditor.js +1 -0
  26. package/dist/packem_chunks/agents-panel.js +1 -0
  27. package/dist/packem_chunks/analytics-panel.js +1 -0
  28. package/dist/packem_chunks/auth-audit-panel.js +1 -0
  29. package/dist/packem_chunks/auth-config-panel.js +1 -0
  30. package/dist/packem_chunks/auth-sessions-panel.js +1 -0
  31. package/dist/packem_chunks/containers-panel.js +1 -0
  32. package/dist/packem_chunks/dashboards-panel.js +1 -0
  33. package/dist/packem_chunks/evals-panel.js +1 -0
  34. package/dist/packem_chunks/fanout-panel.js +1 -0
  35. package/dist/packem_chunks/flags-panel.js +1 -0
  36. package/dist/packem_chunks/issues-panel.js +1 -0
  37. package/dist/packem_chunks/kv-browser.js +1 -0
  38. package/dist/packem_chunks/log-drains-panel.js +4 -0
  39. package/dist/packem_chunks/migrations-route.js +1 -0
  40. package/dist/packem_chunks/organizations-panel.js +1 -0
  41. package/dist/packem_chunks/payments-panel.js +1 -0
  42. package/dist/packem_chunks/permissions-panel.js +1 -0
  43. package/dist/packem_chunks/queues-panel.js +1 -0
  44. package/dist/packem_chunks/reactors-panel.js +1 -0
  45. package/dist/packem_chunks/rls-panel.js +1 -0
  46. package/dist/packem_chunks/schedule-panel.js +1 -0
  47. package/dist/packem_chunks/sparkline.js +1 -0
  48. package/dist/packem_chunks/storage-rules-panel.js +1 -0
  49. package/dist/packem_chunks/subscriptions-panel.js +1 -0
  50. package/dist/packem_chunks/sync-client-panel.js +1 -0
  51. package/dist/packem_chunks/traces-panel.js +1 -0
  52. package/dist/packem_chunks/users-panel.js +1 -0
  53. package/dist/packem_chunks/vector-browser.js +1 -0
  54. package/dist/packem_chunks/workflows-panel.js +1 -0
  55. package/dist/packem_shared/ADMIN_FUNCTIONS-B6z7VLYt.js +1 -0
  56. package/dist/packem_shared/ApiDocsPanel-Du1L7Ysj.js +2 -0
  57. package/dist/packem_shared/ApiReferencePanel-uGgGOBYj.js +1 -0
  58. package/dist/packem_shared/CommandPalette-HqiXrWIm.js +1 -0
  59. package/dist/packem_shared/ConfirmButton-Cj2SOapE.js +1 -0
  60. package/dist/packem_shared/ConnectionBadge-Bh16X9-u.js +1 -0
  61. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.js +1 -0
  62. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-1Lrg55IV.js +1 -0
  63. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js +1 -0
  64. package/dist/packem_shared/DataBrowser-W5TxvLB8.js +4 -0
  65. package/dist/packem_shared/DataFilters-3nbW0uax.js +1 -0
  66. package/dist/packem_shared/ErrorBoundary-BWNF98VF.js +1 -0
  67. package/dist/packem_shared/GlobalDataBrowser-LFznuyGe.js +1 -0
  68. package/dist/packem_shared/HomePanel-DmB0EKjl.js +1 -0
  69. package/dist/packem_shared/MigrationsPanel-BDNt136v.js +1 -0
  70. package/dist/packem_shared/OpenRpcReferencePanel-DgrpASYD.js +1 -0
  71. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
  72. package/dist/packem_shared/ScheduledJobs-CiO3eXgI.js +1 -0
  73. package/dist/packem_shared/ShardInput-CdawpUiS.js +1 -0
  74. package/dist/packem_shared/Studio-CkNE_tEy.js +1 -0
  75. package/dist/packem_shared/StudioApp-BZP_0E2n.js +1 -0
  76. package/dist/packem_shared/StudioI18nProvider-Bl547evf.js +1 -0
  77. package/dist/packem_shared/advisor-view-C1KFTXSH.js +1 -0
  78. package/dist/packem_shared/aggregateMetrics-A-Y7OH6R.js +1 -0
  79. package/dist/packem_shared/alert-C2SEhYS9.js +1 -0
  80. package/dist/packem_shared/app.d-D1bPR8FO.d.ts +252 -0
  81. package/dist/packem_shared/badge-cAk9Di1Q.js +1 -0
  82. package/dist/packem_shared/bar-chart-B6gzp_f9.js +6 -0
  83. package/dist/packem_shared/browser-storage-BH1MxLZs.js +1 -0
  84. package/dist/packem_shared/button-BOPLD1un.js +1 -0
  85. package/dist/packem_shared/card-BGlQzQY-.js +1 -0
  86. package/dist/packem_shared/cf-links-CBJ5SywP.js +1 -0
  87. package/dist/packem_shared/checkbox-C5w53W-E.js +1 -0
  88. package/dist/packem_shared/control-button-BOZ5K-FC.js +1 -0
  89. package/dist/packem_shared/data-grid-BFTQnkXq.js +1 -0
  90. package/dist/packem_shared/data-view-params-qoSTqjAj.js +1 -0
  91. package/dist/packem_shared/dropdown-menu-U7Tjg1Nb.js +2 -0
  92. package/dist/packem_shared/empty-state-B939z6K2.js +1 -0
  93. package/dist/packem_shared/error-alert-TYdKetJd.js +1 -0
  94. package/dist/packem_shared/grid-features-jBzZGauv.js +6 -0
  95. package/dist/packem_shared/home-panel-DHOa3sxt.js +3 -0
  96. package/dist/packem_shared/input-CY5W3wzv.js +1 -0
  97. package/dist/packem_shared/internal-CwaF9YNk.js +2 -0
  98. package/dist/packem_shared/label-BOUo-DP0.js +1 -0
  99. package/dist/packem_shared/live-status-Bf7rR8o8.js +1 -0
  100. package/dist/packem_shared/log-fields-SBxKyBug.js +1 -0
  101. package/dist/packem_shared/log-line-UnE93Ovi.js +1 -0
  102. package/dist/packem_shared/modal-shell-wGW4CKEW.js +1 -0
  103. package/dist/packem_shared/operation-console-provider-DoloEvon.js +1 -0
  104. package/dist/packem_shared/quote-identifier-CGiYFBvY.js +1 -0
  105. package/dist/packem_shared/recording-client-CKn4-vUx.js +1 -0
  106. package/dist/packem_shared/reference-view-BU2dNK9Z.js +13 -0
  107. package/dist/packem_shared/schema-diagram-DOaIh1y6.js +2 -0
  108. package/dist/packem_shared/scroll-area-DSJftwu_.js +2 -0
  109. package/dist/packem_shared/select-BPISLTcv.js +2 -0
  110. package/dist/packem_shared/shard-history-DU5b3QDI.js +1 -0
  111. package/dist/packem_shared/shortcuts-lH4Vaqjc.js +1 -0
  112. package/dist/packem_shared/skeleton-DFBBaJU6.js +1 -0
  113. package/dist/packem_shared/sparkline-CYbJzfA1.js +1 -0
  114. package/dist/packem_shared/sql-result-table-CqlZo2QN.js +1 -0
  115. package/dist/packem_shared/stat-card-B9uIvAHg.js +1 -0
  116. package/dist/packem_shared/storage-tier-C2mKwYRj.js +1 -0
  117. package/dist/packem_shared/studio-CXai1O2K.js +2 -0
  118. package/dist/packem_shared/table-BMsuYFhk.js +2 -0
  119. package/dist/packem_shared/table-list-sidebar-BWq_-gtu.js +1 -0
  120. package/dist/packem_shared/textarea-DpO3i-Qo.js +1 -0
  121. package/dist/packem_shared/trace-handoff-z9sy89Ci.js +1 -0
  122. package/dist/packem_shared/use-admin-query-P0RJrjsD.js +1 -0
  123. package/dist/packem_shared/use-async-submit-DdLd0MdK.js +1 -0
  124. package/dist/packem_shared/use-auth-config-z3KRWAqD.js +1 -0
  125. package/dist/packem_shared/use-open-trace-4mqqFWrn.js +1 -0
  126. package/dist/packem_shared/use-shard-key-BsP3o5wT.js +1 -0
  127. package/dist/packem_shared/use-sql-assistant-D1K2LqpO.js +1 -0
  128. package/dist/packem_shared/useDebounced-DVeQ5-oW.js +1 -0
  129. package/dist/packem_shared/utils-bhneXptQ.js +1 -0
  130. package/dist/packem_shared/virtual-rect-D_j7aLxX.js +1 -0
  131. package/dist/packem_shared/wire-codec-Dl3VeNrd.js +1 -0
  132. package/dist/standalone/chunk-26VREVWU.js +1 -0
  133. package/dist/standalone/chunk-2SFSTQS4.js +1 -0
  134. package/dist/standalone/chunk-2VGV6RPS.js +1 -0
  135. package/dist/standalone/chunk-2XOGZAF4.js +3 -0
  136. package/dist/standalone/chunk-333WFRWG.js +1 -0
  137. package/dist/standalone/chunk-362AVHNC.js +1 -0
  138. package/dist/standalone/chunk-3NXFFXQ2.js +1 -0
  139. package/dist/standalone/chunk-3S4VZ2ZM.js +1 -0
  140. package/dist/standalone/chunk-443UDYWL.js +6 -0
  141. package/dist/standalone/chunk-4PZEPCO7.js +1 -0
  142. package/dist/standalone/chunk-4YTSKL4R.js +1 -0
  143. package/dist/standalone/chunk-4ZCENYC3.js +1 -0
  144. package/dist/standalone/chunk-57VX76PR.js +1 -0
  145. package/dist/standalone/chunk-5EW733RQ.js +1 -0
  146. package/dist/standalone/chunk-5JLIP2HH.js +1 -0
  147. package/dist/standalone/chunk-6CBLYGXJ.js +1 -0
  148. package/dist/standalone/chunk-6UPO6ELN.js +1 -0
  149. package/dist/standalone/chunk-6ZPTNC34.js +19 -0
  150. package/dist/standalone/chunk-74ASA4WU.js +1 -0
  151. package/dist/standalone/chunk-76YLMHR3.js +1 -0
  152. package/dist/standalone/chunk-77JLGJ7V.js +1 -0
  153. package/dist/standalone/chunk-7PIHTTND.js +1 -0
  154. package/dist/standalone/chunk-7SROZWKL.js +1 -0
  155. package/dist/standalone/chunk-AFKLFS74.js +1 -0
  156. package/dist/standalone/chunk-AOAJGSYZ.js +2 -0
  157. package/dist/standalone/chunk-AXXNMZQ4.js +1 -0
  158. package/dist/standalone/chunk-BFCUKERU.js +8 -0
  159. package/dist/standalone/chunk-BQK2C2Z4.js +1 -0
  160. package/dist/standalone/chunk-BUIAZFSC.js +1 -0
  161. package/dist/standalone/chunk-BWEXJENB.js +1 -0
  162. package/dist/standalone/chunk-CA5ILAW2.js +14 -0
  163. package/dist/standalone/chunk-CAOUXOL7.js +1 -0
  164. package/dist/standalone/chunk-CKTKI4IY.js +1 -0
  165. package/dist/standalone/chunk-CL76PTLM.js +2 -0
  166. package/dist/standalone/chunk-CN2AINNY.js +1 -0
  167. package/dist/standalone/chunk-CP4ZFBVW.js +1 -0
  168. package/dist/standalone/chunk-CSYDKCNQ.js +1 -0
  169. package/dist/standalone/chunk-CYX3OHJ3.js +1 -0
  170. package/dist/standalone/chunk-DKSLOJDQ.js +1 -0
  171. package/dist/standalone/chunk-DPNEFSEC.js +1 -0
  172. package/dist/standalone/chunk-DUDQV6XJ.js +1 -0
  173. package/dist/standalone/chunk-DZGOHOOE.js +1 -0
  174. package/dist/standalone/chunk-EBI7CCQQ.js +1 -0
  175. package/dist/standalone/chunk-EDHW2EEG.js +1 -0
  176. package/dist/standalone/chunk-EE63P4VX.js +1 -0
  177. package/dist/standalone/chunk-ELO3V35K.js +1 -0
  178. package/dist/standalone/chunk-EVQ6LHI6.js +1 -0
  179. package/dist/standalone/chunk-EYGF6TQS.js +1 -0
  180. package/dist/standalone/chunk-F7JOSNAT.js +1 -0
  181. package/dist/standalone/chunk-FB5DOMZF.js +4 -0
  182. package/dist/standalone/chunk-FDLSPDIC.js +15 -0
  183. package/dist/standalone/chunk-FJ6G6FNE.js +1 -0
  184. package/dist/standalone/chunk-GIQDEWC4.js +1 -0
  185. package/dist/standalone/chunk-GSQURGCT.js +1 -0
  186. package/dist/standalone/chunk-H3BH6X3G.js +1 -0
  187. package/dist/standalone/chunk-H7YVFLA5.js +7 -0
  188. package/dist/standalone/chunk-HAIBZTXF.js +1 -0
  189. package/dist/standalone/chunk-HRD2DVIW.js +1 -0
  190. package/dist/standalone/chunk-IE5S3JMD.js +1 -0
  191. package/dist/standalone/chunk-INQICZYC.js +1 -0
  192. package/dist/standalone/chunk-IYWVSMAY.js +1 -0
  193. package/dist/standalone/chunk-IZXGBTPE.js +1 -0
  194. package/dist/standalone/chunk-JHXEEPRG.js +1 -0
  195. package/dist/standalone/chunk-JURAVSE7.js +1 -0
  196. package/dist/standalone/chunk-JUWOEHDD.js +1 -0
  197. package/dist/standalone/chunk-JV7KTJPY.js +1 -0
  198. package/dist/standalone/chunk-KTXD2N6F.js +1 -0
  199. package/dist/standalone/chunk-KVSQKUWD.js +1 -0
  200. package/dist/standalone/chunk-L4EZAHCD.js +1 -0
  201. package/dist/standalone/chunk-M3NNNOD5.js +1 -0
  202. package/dist/standalone/chunk-MCLM2QJI.js +1 -0
  203. package/dist/standalone/chunk-METRMDIQ.js +1 -0
  204. package/dist/standalone/chunk-MPYVZLYP.js +1 -0
  205. package/dist/standalone/chunk-MSCK3V6U.js +1 -0
  206. package/dist/standalone/chunk-MVZARXDR.js +1 -0
  207. package/dist/standalone/chunk-MYFFCV2R.js +1 -0
  208. package/dist/standalone/chunk-NIX2QSSN.js +1 -0
  209. package/dist/standalone/chunk-NNLNQKT7.js +59 -0
  210. package/dist/standalone/chunk-NSOLPNU7.js +1 -0
  211. package/dist/standalone/chunk-NXXGISFB.js +1 -0
  212. package/dist/standalone/chunk-O5MAFDY2.js +1 -0
  213. package/dist/standalone/chunk-OE4KGVJW.js +4 -0
  214. package/dist/standalone/chunk-OEGE3YDK.js +11 -0
  215. package/dist/standalone/chunk-OG57FC7W.js +1 -0
  216. package/dist/standalone/chunk-PQICDSPP.js +1 -0
  217. package/dist/standalone/chunk-PSPJORP6.js +1 -0
  218. package/dist/standalone/chunk-PZ4QDWTI.js +1 -0
  219. package/dist/standalone/chunk-QHQTOESO.js +1 -0
  220. package/dist/standalone/chunk-QO4SZ4WH.js +1 -0
  221. package/dist/standalone/chunk-R5ZTCHCE.js +1 -0
  222. package/dist/standalone/chunk-RCZTUWG3.js +1 -0
  223. package/dist/standalone/chunk-RJINX3H6.js +1 -0
  224. package/dist/standalone/chunk-RLRTQOFQ.js +1 -0
  225. package/dist/standalone/chunk-RPCMQE4A.js +1 -0
  226. package/dist/standalone/chunk-SJ4CA7QG.js +1 -0
  227. package/dist/standalone/chunk-SPDZUX4P.js +1 -0
  228. package/dist/standalone/chunk-SQMJUXBA.js +1 -0
  229. package/dist/standalone/chunk-SRQP7SLQ.js +1 -0
  230. package/dist/standalone/chunk-TB5N24CM.js +1 -0
  231. package/dist/standalone/chunk-TFMQSCGC.js +1 -0
  232. package/dist/standalone/chunk-TIANWRSD.js +1 -0
  233. package/dist/standalone/chunk-TNKECJW4.js +1 -0
  234. package/dist/standalone/chunk-TPAZM36C.js +1 -0
  235. package/dist/standalone/chunk-TV2M3PHL.js +1 -0
  236. package/dist/standalone/chunk-TVGQ7K5I.js +1 -0
  237. package/dist/standalone/chunk-U7LNRJHZ.js +1 -0
  238. package/dist/standalone/chunk-UANVABQG.js +1 -0
  239. package/dist/standalone/chunk-V6QPVFDL.js +1 -0
  240. package/dist/standalone/chunk-VHXQGKA7.js +1 -0
  241. package/dist/standalone/chunk-VLW547U6.js +1 -0
  242. package/dist/standalone/chunk-VR3UJA7B.js +1 -0
  243. package/dist/standalone/chunk-VZCS5GXZ.js +1 -0
  244. package/dist/standalone/chunk-W2FXNIVC.js +1 -0
  245. package/dist/standalone/chunk-W2JBKQNU.js +1 -0
  246. package/dist/standalone/chunk-WUW4ZHRL.js +1 -0
  247. package/dist/standalone/chunk-WXBTOI6T.js +1 -0
  248. package/dist/standalone/chunk-WY33QRLH.js +9 -0
  249. package/dist/standalone/chunk-XJSWM47N.js +1 -0
  250. package/dist/standalone/chunk-XNBAJ6XA.js +1 -0
  251. package/dist/standalone/chunk-XQS7KSHL.js +1 -0
  252. package/dist/standalone/chunk-Y2YQITGI.js +1 -0
  253. package/dist/standalone/chunk-Z6SECRFO.js +3 -0
  254. package/dist/standalone/chunk-ZHPDAJBM.js +1 -0
  255. package/dist/standalone/chunk-ZPGNTTQ3.js +1 -0
  256. package/dist/standalone/chunk-ZSOLGJFC.js +1 -0
  257. package/dist/standalone/studio.js +9 -378
  258. package/dist/styles.css +2 -2
  259. package/package.json +16 -15
  260. package/dist/packem_shared/ADMIN_FUNCTIONS-CZJCZ4c7.js +0 -47
  261. package/dist/packem_shared/ApiDocsPanel-yEz0fiof.js +0 -842
  262. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
  263. package/dist/packem_shared/ApiTab-DdubReQI.js +0 -251
  264. package/dist/packem_shared/AuditPanel-CE5ofjCc.js +0 -200
  265. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
  266. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  267. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  268. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  269. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  270. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  271. package/dist/packem_shared/DataBrowser-DpL8U-Nf.js +0 -4475
  272. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  273. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  274. package/dist/packem_shared/ExportImportPanel-ChsSUCYZ.js +0 -197
  275. package/dist/packem_shared/FileBrowser-DsRBnVhZ.js +0 -2932
  276. package/dist/packem_shared/FunctionRunner-D4cZ6fuA.js +0 -343
  277. package/dist/packem_shared/FunctionStatsPanel-BVelWgNv.js +0 -375
  278. package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
  279. package/dist/packem_shared/HealthPanel-CxUVKfvo.js +0 -648
  280. package/dist/packem_shared/HomePanel-tfqpZxuu.js +0 -1334
  281. package/dist/packem_shared/InsightsPanel-DNg3K9XN.js +0 -461
  282. package/dist/packem_shared/LogsPanel-B4LoSRj0.js +0 -827
  283. package/dist/packem_shared/MailPanel-CcpdyWYs.js +0 -440
  284. package/dist/packem_shared/MetricsPanel-CxoyWbNb.js +0 -1611
  285. package/dist/packem_shared/MigrationsPanel-DGwJGWDA.js +0 -239
  286. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
  287. package/dist/packem_shared/PitrPanel-CKUzyyHi.js +0 -252
  288. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  289. package/dist/packem_shared/ScheduledJobs-BWNwIN3I.js +0 -262
  290. package/dist/packem_shared/SchemaViewer-RclXFo9Q.js +0 -2512
  291. package/dist/packem_shared/SecurityAdvisorPanel-Dqql1Z5O.js +0 -92
  292. package/dist/packem_shared/SettingsPanel-D5iTY0YE.js +0 -390
  293. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  294. package/dist/packem_shared/SqlEditorPanel-Dj-In-B3.js +0 -13
  295. package/dist/packem_shared/Studio-VWvKNOw4.js +0 -33
  296. package/dist/packem_shared/StudioApp-BhQ6T2pn.js +0 -657
  297. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  298. package/dist/packem_shared/TableEditor-BY8bTpCl.js +0 -11
  299. package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
  300. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  301. package/dist/packem_shared/app.d-BVJFkXyj.d.ts +0 -300
  302. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  303. package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
  304. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  305. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  306. package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
  307. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  308. package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
  309. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  310. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  311. package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
  312. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  313. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  314. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  315. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  316. package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
  317. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  318. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  319. package/dist/packem_shared/sql-editor-panel-CMdxstu5.js +0 -2562
  320. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  321. package/dist/packem_shared/studio-D8ry3tJR.js +0 -11043
  322. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  323. package/dist/packem_shared/table-editor-CWx68ZCg.js +0 -407
  324. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
  325. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  326. package/dist/packem_shared/use-admin-query-BkbdNFNz.js +0 -105
  327. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  328. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  329. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -0,0 +1 @@
1
+ import{a as me}from"./chunk-ZPGNTTQ3.js";import{a as Ft,b as Lt,c as At,d as Kt}from"./chunk-EYGF6TQS.js";import{a as it}from"./chunk-SRQP7SLQ.js";import{a as Ct,b as It,c as Tt,d as Rt,e as je}from"./chunk-VR3UJA7B.js";import{a as Ot}from"./chunk-CAOUXOL7.js";import{a as zt}from"./chunk-76YLMHR3.js";import"./chunk-2SFSTQS4.js";import"./chunk-AFKLFS74.js";import{e as _t}from"./chunk-W2JBKQNU.js";import"./chunk-CP4ZFBVW.js";import{a as $t}from"./chunk-JURAVSE7.js";import"./chunk-ZSOLGJFC.js";import"./chunk-DUDQV6XJ.js";import"./chunk-VZCS5GXZ.js";import"./chunk-DKSLOJDQ.js";import{a as Ze,b as et,c as tt,d as vt,e as yt,f as rt,g as at,h as Nt,i as St}from"./chunk-NNLNQKT7.js";import"./chunk-JV7KTJPY.js";import"./chunk-DPNEFSEC.js";import{a as Mt}from"./chunk-CKTKI4IY.js";import{a as kt}from"./chunk-TB5N24CM.js";import{a as wt,b as qt}from"./chunk-KVSQKUWD.js";import"./chunk-4YTSKL4R.js";import"./chunk-ZHPDAJBM.js";import"./chunk-AOAJGSYZ.js";import"./chunk-INQICZYC.js";import"./chunk-TFMQSCGC.js";import{a as Ye}from"./chunk-BWEXJENB.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import{b as Ue}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import"./chunk-F7JOSNAT.js";import{a as Le}from"./chunk-DZGOHOOE.js";import{c as De}from"./chunk-PSPJORP6.js";import{f as dt}from"./chunk-OEGE3YDK.js";import"./chunk-RCZTUWG3.js";import{a as ht}from"./chunk-UANVABQG.js";import{a as st,b as lt,c as nt,d as Ee,e as de,f as H}from"./chunk-L4EZAHCD.js";import{a as fe,b as Ae,c as Ke,d as ut,e as pe}from"./chunk-IYWVSMAY.js";import{d as ge,f as gt,g as ft,h as pt,i as xt,l as We,o as bt}from"./chunk-6ZPTNC34.js";import"./chunk-FDLSPDIC.js";import{a as o,d as Xe,e as Qt,f as Jt,g as Bt,i as mt}from"./chunk-R5ZTCHCE.js";var j=Xe(Qt(),1);var xe=Xe(Jt(),1);var t=Xe(Bt(),1);var Ht=/["\\\u0000-\u001F\uD800-\uDFFF]/,Dt=o(s=>Ht.test(s)?JSON.stringify(s):`"${s}"`,"ot"),ct=o(s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(typeof s=="number"){if(Number.isNaN(s))return"nan";if(s===1/0)return"inf";if(s===-1/0)return"-inf";if(Object.is(s,-0))return"-0"}if(typeof s=="string")return Dt(s);if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s)){let i="[";for(let n=0;n<s.length;n++)n>0&&(i+=","),i+=ct(s[n]);return i+"]"}let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let i=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${i} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let l=s,a=Object.keys(l).sort(),r="{",u=!0;for(let i of a){let n=l[i];n!==void 0&&(u?u=!1:r+=",",r+=Dt(i),r+=":",r+=ct(n))}return r+"}"},"Ze"),jt=o((s,e,l)=>`${s}:${e}:${ct(l??{})}`,"ht"),Pt=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"gt"),Ut=o((s,e)=>Pt(s,e),"Jt"),Wt=o(s=>Pt(s.kind,s),"Vt"),ot=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"We"),Gt=o(s=>Array.isArray(s?.series)?s.series:[],"Gt"),Vt="FUNCTION_NOT_FOUND",Xt=o(s=>{let e=new Map;if(!Array.isArray(s?.series))return e;for(let l of s.series)e.set(jt(l.kind,l.name,l.attributes),l.points);return e},"Xt"),Yt={counter:"secondary",gauge:"default",histogram:"outline"},Zt=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,u=ge();if(r===void 0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=d):d=e[0],d}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let d=`mt-instrument-trace-${l}`,g;return e[3]!==n||e[4]!==d||e[5]!==r?(g=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":d,title:r,children:n}),e[3]=n,e[4]=d,e[5]=r,e[6]=g):g=e[6],g}let S=`mt-instrument-trace-${l}`,v;e[7]!==a||e[8]!==r?(v=o(()=>{a(r)},"y"),e[7]=a,e[8]=r,e[9]=v):v=e[9];let w;e[10]!==u||e[11]!==r?(w=u("Open the exemplar trace {trace}",{trace:r}),e[10]=u,e[11]=r,e[12]=w):w=e[12];let h;return e[13]!==n||e[14]!==S||e[15]!==v||e[16]!==w?(h=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":S,onClick:v,title:w,type:"button",children:n}),e[13]=n,e[14]=S,e[15]=v,e[16]=w,e[17]=h):h=e[17],h},"Zt"),er=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={},e[0]=u):u=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:S,errorSource:v}=De(Le.getMetricSeries,u,i),w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w={},e[3]=w):w=e[3];let h;e[4]!==a?(h={live:!0,shardKey:a},e[4]=a,e[5]=h):h=e[5];let{data:d}=De(Le.getMetricHistory,w,h),g,y,q,$,c,p,f,x,k,_,N,I,C;if(e[6]!==n||e[7]!==S||e[8]!==v||e[9]!==d||e[10]!==l||e[11]!==r){x=Symbol.for("react.early_return_sentinel");e:{let L=Gt(n),K=xt(v)===Vt;if(S!==null&&!K){let m;e[25]!==r?(m=r("Instruments"),e[25]=r,e[26]=m):m=e[26];let E;e[27]!==m?(E=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[27]=m,e[28]=E):E=e[28];let Q;e[29]!==S||e[30]!==r?(Q=r("Instruments unavailable: {error}",{error:S}),e[29]=S,e[30]=r,e[31]=Q):Q=e[31];let J;e[32]!==Q?(J=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:Q}),e[32]=Q,e[33]=J):J=e[33];let ce;e[34]!==E||e[35]!==J?(ce=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[E,J]}),e[34]=E,e[35]=J,e[36]=ce):ce=e[36],x=ce;break e}if(L.length===0){x=null;break e}let F=Xt(d),D;e[37]!==r?(D=o(m=>r(m==="counter"?"Counter":m==="gauge"?"Gauge":"Histogram"),"z"),e[37]=r,e[38]=D):D=e[38];let P=D;c="flex flex-col gap-2",p="mt-instruments";let A;e[39]!==r?(A=r("Instruments"),e[39]=r,e[40]=A):A=e[40],e[41]!==A?(f=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:A}),e[41]=A,e[42]=f):f=e[42],$=fe,C="overflow-hidden py-0",q=pe,I="px-0",y=st,_="mt-instruments-table";let U;e[43]!==r?(U=r("name"),e[43]=r,e[44]=U):U=e[44];let W;e[45]!==U?(W=(0,t.jsx)(de,{children:U}),e[45]=U,e[46]=W):W=e[46];let G;e[47]!==r?(G=r("kind"),e[47]=r,e[48]=G):G=e[48];let V;e[49]!==G?(V=(0,t.jsx)(de,{children:G}),e[49]=G,e[50]=V):V=e[50];let X;e[51]!==r?(X=r("value"),e[51]=r,e[52]=X):X=e[52];let Y;e[53]!==X?(Y=(0,t.jsx)(de,{className:"text-right",children:X}),e[53]=X,e[54]=Y):Y=e[54];let Z;e[55]!==r?(Z=r("count"),e[55]=r,e[56]=Z):Z=e[56];let ee;e[57]!==Z?(ee=(0,t.jsx)(de,{className:"text-right",children:Z}),e[57]=Z,e[58]=ee):ee=e[58];let te;e[59]!==r?(te=r("range"),e[59]=r,e[60]=te):te=e[60];let re;e[61]!==te?(re=(0,t.jsx)(de,{className:"text-right",children:te}),e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==r?(ae=r("trend"),e[63]=r,e[64]=ae):ae=e[64];let se;e[65]!==ae?(se=(0,t.jsx)(de,{children:ae}),e[65]=ae,e[66]=se):se=e[66];let le;e[67]!==r?(le=r("trace"),e[67]=r,e[68]=le):le=e[68];let ne;e[69]!==le?(ne=(0,t.jsx)(de,{children:le}),e[69]=le,e[70]=ne):ne=e[70];let ie;e[71]!==r?(ie=r("dimensions"),e[71]=r,e[72]=ie):ie=e[72];let oe;e[73]!==ie?(oe=(0,t.jsx)(de,{children:ie}),e[73]=ie,e[74]=oe):oe=e[74],e[75]!==W||e[76]!==V||e[77]!==Y||e[78]!==ee||e[79]!==re||e[80]!==se||e[81]!==ne||e[82]!==oe?(N=(0,t.jsx)(lt,{children:(0,t.jsxs)(Ee,{children:[W,V,Y,ee,re,se,ne,oe]})}),e[75]=W,e[76]=V,e[77]=Y,e[78]=ee,e[79]=re,e[80]=se,e[81]=ne,e[82]=oe,e[83]=N):N=e[83],g=nt,k=L.map(m=>{let E=Ot(m.attributes),Q=jt(m.kind,m.name,m.attributes),J=(F.get(Q)??[]).map(ce=>Ut(m.kind,ce));return(0,t.jsxs)(Ee,{"data-testid":`mt-instrument-${m.name}`,children:[(0,t.jsx)(H,{className:"font-mono text-xs",title:m.functionPath,children:m.name}),(0,t.jsx)(H,{children:(0,t.jsx)(Ue,{variant:Yt[m.kind],children:P(m.kind)})}),(0,t.jsx)(H,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${m.name}`,children:ot(Wt(m))}),(0,t.jsx)(H,{className:"text-right tabular-nums text-muted-foreground",children:m.count.toLocaleString()}),(0,t.jsx)(H,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:m.min===m.max?"\u2014":`${ot(m.min)}\u2013${ot(m.max)}`}),(0,t.jsx)(H,{children:J.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:m.name}),className:"h-6 w-24 text-foreground",series:J,testId:`mt-instrument-trend-${m.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(H,{className:"font-mono text-xs",children:(0,t.jsx)(Zt,{name:m.name,onOpenTrace:l,traceId:m.exemplarTraceId})}),(0,t.jsx)(H,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:E,children:E===""?"\u2014":E})]},Q)})}e[6]=n,e[7]=S,e[8]=v,e[9]=d,e[10]=l,e[11]=r,e[12]=g,e[13]=y,e[14]=q,e[15]=$,e[16]=c,e[17]=p,e[18]=f,e[19]=x,e[20]=k,e[21]=_,e[22]=N,e[23]=I,e[24]=C}else g=e[12],y=e[13],q=e[14],$=e[15],c=e[16],p=e[17],f=e[18],x=e[19],k=e[20],_=e[21],N=e[22],I=e[23],C=e[24];if(x!==Symbol.for("react.early_return_sentinel"))return x;let T;e[84]!==g||e[85]!==k?(T=(0,t.jsx)(g,{children:k}),e[84]=g,e[85]=k,e[86]=T):T=e[86];let M;e[87]!==y||e[88]!==T||e[89]!==_||e[90]!==N?(M=(0,t.jsxs)(y,{"data-testid":_,children:[N,T]}),e[87]=y,e[88]=T,e[89]=_,e[90]=N,e[91]=M):M=e[91];let b;e[92]!==q||e[93]!==M||e[94]!==I?(b=(0,t.jsx)(q,{className:I,children:M}),e[92]=q,e[93]=M,e[94]=I,e[95]=b):b=e[95];let R;e[96]!==$||e[97]!==b||e[98]!==C?(R=(0,t.jsx)($,{className:C,children:b}),e[96]=$,e[97]=b,e[98]=C,e[99]=R):R=e[99];let z;return e[100]!==c||e[101]!==p||e[102]!==f||e[103]!==R?(z=(0,t.jsxs)("section",{className:c,"data-testid":p,children:[f,R]}),e[100]=c,e[101]=p,e[102]=f,e[103]=R,e[104]=z):z=e[104],z},"er"),tr=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),u;e[0]!==r?(u=r("Shards"),e[0]=r,e[1]=u):u=e[1];let i;e[2]!==l.failed||e[3]!==l.reachable||e[4]!==r?(i=l.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:l.failed,reachable:l.reachable}):r("{reachable} reachable",{reachable:l.reachable}),e[2]=l.failed,e[3]=l.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==u||e[7]!==i?(n=(0,t.jsx)(me,{label:u,testId:"mt-agg-shards",value:i}),e[6]=u,e[7]=i,e[8]=n):n=e[8];let S;e[9]!==r?(S=r("Total requests"),e[9]=r,e[10]=S):S=e[10];let v;e[11]!==l.totalRequests||e[12]!==S?(v=(0,t.jsx)(me,{label:S,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=S,e[13]=v):v=e[13];let w;e[14]!==r?(w=r("Total errors"),e[14]=r,e[15]=w):w=e[15];let h;e[16]!==l.totalErrors||e[17]!==w?(h=(0,t.jsx)(me,{label:w,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=w,e[18]=h):h=e[18];let d;e[19]!==r?(d=r("Total database size"),e[19]=r,e[20]=d):d=e[20];let g;e[21]!==l.totalDatabaseSize?(g=We(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=g):g=e[22];let y;e[23]!==d||e[24]!==g?(y=(0,t.jsx)(me,{label:d,testId:"mt-agg-db-size",value:g}),e[23]=d,e[24]=g,e[25]=y):y=e[25];let q;e[26]!==r?(q=r("Combined cache hit rate"),e[26]=r,e[27]=q):q=e[27];let $;e[28]!==l.hitRate||e[29]!==r?($=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=$):$=e[30];let c;e[31]!==q||e[32]!==$?(c=(0,t.jsx)(me,{label:q,testId:"mt-agg-cache",value:$}),e[31]=q,e[32]=$,e[33]=c):c=e[33];let p;e[34]!==y||e[35]!==c||e[36]!==n||e[37]!==v||e[38]!==h?(p=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,v,h,y,c]}),e[34]=y,e[35]=c,e[36]=n,e[37]=v,e[38]=h,e[39]=p):p=e[39];let f;e[40]!==r?(f=r("shard"),e[40]=r,e[41]=f):f=e[41];let x;e[42]!==f?(x=(0,t.jsx)(de,{children:f}),e[42]=f,e[43]=x):x=e[43];let k;e[44]!==r?(k=r("requests"),e[44]=r,e[45]=k):k=e[45];let _;e[46]!==k?(_=(0,t.jsx)(de,{children:k}),e[46]=k,e[47]=_):_=e[47];let N;e[48]!==r?(N=r("errors"),e[48]=r,e[49]=N):N=e[49];let I;e[50]!==N?(I=(0,t.jsx)(de,{children:N}),e[50]=N,e[51]=I):I=e[51];let C;e[52]!==r?(C=r("db size"),e[52]=r,e[53]=C):C=e[53];let T;e[54]!==C?(T=(0,t.jsx)(de,{children:C}),e[54]=C,e[55]=T):T=e[55];let M;e[56]!==x||e[57]!==_||e[58]!==I||e[59]!==T?(M=(0,t.jsx)(lt,{children:(0,t.jsxs)(Ee,{children:[x,_,I,T]})}),e[56]=x,e[57]=_,e[58]=I,e[59]=T,e[60]=M):M=e[60];let b;if(e[61]!==a||e[62]!==r){let K;e[64]!==r?(K=o(F=>(0,t.jsxs)(Ee,{"data-testid":`mt-agg-row-${F.shard}`,children:[(0,t.jsx)(H,{children:F.shard}),F.metrics===null?(0,t.jsx)(H,{className:"text-destructive",colSpan:3,children:F.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H,{className:"tabular-nums",children:F.metrics.requests}),(0,t.jsx)(H,{className:"tabular-nums",children:F.metrics.errors}),(0,t.jsx)(H,{className:"tabular-nums",children:We(F.metrics.databaseSize)})]})]},F.shard),"L"),e[64]=r,e[65]=K):K=e[65],b=a.map(K),e[61]=a,e[62]=r,e[63]=b}else b=e[63];let R;e[66]!==b?(R=(0,t.jsx)(nt,{children:b}),e[66]=b,e[67]=R):R=e[67];let z;e[68]!==M||e[69]!==R?(z=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(st,{"data-testid":"mt-agg-table",children:[M,R]})})}),e[68]=M,e[69]=R,e[70]=z):z=e[70];let L;return e[71]!==p||e[72]!==z?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[p,z]}),e[71]=p,e[72]=z,e[73]=L):L=e[73],L},"tr"),rr=o(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return l>0?`${l.toString()}h ${a.toString()}m`:a>0?`${a.toString()}m ${r.toString()}s`:`${r.toString()}s`},"rr"),ar=o((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"sr"),Et=o(s=>s<=0?"\u2014":s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"ct"),sr=o(s=>{let e=(0,xe.c)(75),{currentDelta:l,errorRate:a,history:r,latencyPercentiles:u,metrics:i}=s,n=ge(),S;e[0]!==r||e[1]!==n?(S=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=S):S=e[2];let v;e[3]!==l||e[4]!==r.length||e[5]!==n?(v=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${l.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=l,e[4]=r.length,e[5]=n,e[6]=v):v=e[6];let w;e[7]!==n?(w=n("Requests"),e[7]=n,e[8]=w):w=e[8];let h;e[9]!==i.requests||e[10]!==S||e[11]!==v||e[12]!==w?(h=(0,t.jsx)(me,{chart:S,footer:v,label:w,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=S,e[11]=v,e[12]=w,e[13]=h):h=e[13];let d;e[14]!==a||e[15]!==n?(d=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=d):d=e[16];let g;e[17]!==n?(g=n("Errors"),e[17]=n,e[18]=g):g=e[18];let y;e[19]!==a||e[20]!==i.errors?(y=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=y):y=e[21];let q;e[22]!==d||e[23]!==g||e[24]!==y?(q=(0,t.jsx)(me,{footer:d,label:g,testId:"mt-errors",value:y}),e[22]=d,e[23]=g,e[24]=y,e[25]=q):q=e[25];let $;e[26]!==u.p90?($=u.p90>0?`P90 ${Et(u.p90)}`:void 0,e[26]=u.p90,e[27]=$):$=e[27];let c;e[28]!==n?(c=n("P95 latency"),e[28]=n,e[29]=c):c=e[29];let p;e[30]!==u.p95?(p=u.p95>0?Et(u.p95):"\u2014",e[30]=u.p95,e[31]=p):p=e[31];let f;e[32]!==c||e[33]!==p||e[34]!==$?(f=(0,t.jsx)(me,{footer:$,label:c,testId:"mt-p95",value:p}),e[32]=c,e[33]=p,e[34]=$,e[35]=f):f=e[35];let x;e[36]!==i.cache||e[37]!==n?(x=i.cache===null?void 0:`${i.cache.entries.toLocaleString()} ${n("cache entries")}`,e[36]=i.cache,e[37]=n,e[38]=x):x=e[38];let k;e[39]!==n?(k=n("Database size"),e[39]=n,e[40]=k):k=e[40];let _;e[41]!==i.databaseSize?(_=We(i.databaseSize),e[41]=i.databaseSize,e[42]=_):_=e[42];let N;e[43]!==x||e[44]!==k||e[45]!==_?(N=(0,t.jsx)(me,{footer:x,label:k,testId:"mt-db-size",value:_}),e[43]=x,e[44]=k,e[45]=_,e[46]=N):N=e[46];let I;e[47]!==n?(I=n("Shard"),e[47]=n,e[48]=I):I=e[48];let C;e[49]!==i.shard||e[50]!==I?(C=(0,t.jsx)(me,{label:I,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=I,e[51]=C):C=e[51];let T;e[52]!==n?(T=n("Uptime"),e[52]=n,e[53]=T):T=e[53];let M;e[54]!==i.uptimeMs?(M=rr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=M):M=e[55];let b;e[56]!==T||e[57]!==M?(b=(0,t.jsx)(me,{label:T,testId:"mt-uptime",value:M}),e[56]=T,e[57]=M,e[58]=b):b=e[58];let R;e[59]!==n?(R=n("Cache hit rate"),e[59]=n,e[60]=R):R=e[60];let z;e[61]!==i.cache||e[62]!==n?(z=i.cache===null?n("no cache configured"):n("{rate} ({count} entries)",{count:i.cache.entries,rate:ar(i.cache.hits,i.cache.misses)}),e[61]=i.cache,e[62]=n,e[63]=z):z=e[63];let L;e[64]!==R||e[65]!==z?(L=(0,t.jsx)(me,{label:R,testId:"mt-cache",value:z}),e[64]=R,e[65]=z,e[66]=L):L=e[66];let K;return e[67]!==f||e[68]!==N||e[69]!==C||e[70]!==b||e[71]!==L||e[72]!==h||e[73]!==q?(K=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[h,q,f,N,C,b,L]}),e[67]=f,e[68]=N,e[69]=C,e[70]=b,e[71]=L,e[72]=h,e[73]=q,e[74]=K):K=e[74],K},"lr"),Ve=o(s=>s>=100?"critical":s>=50?"warning":"good","Ve"),Pe=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Ae"),Ge=o(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"He"),lr=o(s=>{let e=(0,xe.c)(3),{level:l}=s;if(l==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(Ue,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(l==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"ar"),nr=o((s,e)=>{let l=[...s];return l.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),l},"ir"),ir=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,u]=(0,j.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,S]=(0,j.useState)(i),v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=o(C=>{C!==null&&u(C)},"y"),e[1]=v):v=e[1];let w=v,h,d,g,y,q,$,c,p,f,x;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){g=Symbol.for("react.early_return_sentinel");e:{let C=nr(l,r),T;e[16]!==l?(T=l.filter(or),e[16]=l,e[17]=T):T=e[17];let M=T.length,b;e[18]!==l?(b=l.filter(cr),e[18]=l,e[19]=b):b=e[19];let R=b.length,z;e[20]!==l?(z=l.filter(dr),e[20]=l,e[21]=z):z=e[21];let L=z.length,K;e[22]===Symbol.for("react.memo_cache_sentinel")?(K=o(O=>{S(ue=>{let B=new Set(ue);return B.has(O)?B.delete(O):B.add(O),B})},"L"),e[22]=K):K=e[22];let F=K;if(l.length===0){let O;e[23]!==a?(O=a("No query insights yet"),e[23]=a,e[24]=O):O=e[24];let ue;e[25]!==O?(ue=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:O}),e[25]=O,e[26]=ue):ue=e[26];let B;e[27]!==a?(B=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=B):B=e[28];let he;e[29]!==B?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:B}),e[29]=B,e[30]=he):he=e[30];let He;e[31]!==ue||e[32]!==he?(He=(0,t.jsx)(fe,{children:(0,t.jsx)(pe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ue,he]})})}),e[31]=ue,e[32]=he,e[33]=He):He=e[33],g=He;break e}c="space-y-4",p="qi-root";let D;e[34]!==a?(D=a("Critical queries"),e[34]=a,e[35]=D):D=e[35];let P;e[36]!==D?(P=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:D})}),e[36]=D,e[37]=P):P=e[37];let A;e[38]!==M?(A=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:M}),e[38]=M,e[39]=A):A=e[39];let U;e[40]!==a?(U=a(">100ms avg execution"),e[40]=a,e[41]=U):U=e[41];let W;e[42]!==U?(W=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:U}),e[42]=U,e[43]=W):W=e[43];let G;e[44]!==A||e[45]!==W?(G=(0,t.jsxs)(pe,{children:[A,W]}),e[44]=A,e[45]=W,e[46]=G):G=e[46];let V;e[47]!==P||e[48]!==G?(V=(0,t.jsxs)(fe,{children:[P,G]}),e[47]=P,e[48]=G,e[49]=V):V=e[49];let X;e[50]!==a?(X=a("Moderate queries"),e[50]=a,e[51]=X):X=e[51];let Y;e[52]!==X?(Y=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:X})}),e[52]=X,e[53]=Y):Y=e[53];let Z;e[54]!==R?(Z=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:R}),e[54]=R,e[55]=Z):Z=e[55];let ee;e[56]!==a?(ee=a("50\u2013100ms avg execution"),e[56]=a,e[57]=ee):ee=e[57];let te;e[58]!==ee?(te=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ee}),e[58]=ee,e[59]=te):te=e[59];let re;e[60]!==Z||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[Z,te]}),e[60]=Z,e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==Y||e[64]!==re?(ae=(0,t.jsxs)(fe,{children:[Y,re]}),e[63]=Y,e[64]=re,e[65]=ae):ae=e[65];let se;e[66]!==a?(se=a("Fast queries"),e[66]=a,e[67]=se):se=e[67];let le;e[68]!==se?(le=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==L?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:L}),e[70]=L,e[71]=ne):ne=e[71];let ie;e[72]!==a?(ie=a("<50ms avg execution"),e[72]=a,e[73]=ie):ie=e[73];let oe;e[74]!==ie?(oe=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ie}),e[74]=ie,e[75]=oe):oe=e[75];let m;e[76]!==ne||e[77]!==oe?(m=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=m):m=e[78];let E;e[79]!==le||e[80]!==m?(E=(0,t.jsxs)(fe,{children:[le,m]}),e[79]=le,e[80]=m,e[81]=E):E=e[81],e[82]!==V||e[83]!==ae||e[84]!==E?(f=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[V,ae,E]}),e[82]=V,e[83]=ae,e[84]=E,e[85]=f):f=e[85];let Q;e[86]!==a?(Q=a("Query leaderboard"),e[86]=a,e[87]=Q):Q=e[87];let J;e[88]!==Q?(J=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:Q}),e[88]=Q,e[89]=J):J=e[89];let ce;e[90]!==r||e[91]!==a?(ce=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=ce):ce=e[92];let be;e[93]!==ce?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:ce}),e[93]=ce,e[94]=be):be=e[94];let ve;e[95]!==J||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[J,be]}),e[95]=J,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Qe;e[104]===Symbol.for("react.memo_cache_sentinel")?(Qe=(0,t.jsx)(It,{}),e[104]=Qe):Qe=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(Tt,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Qe}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let ke;e[109]!==qe?(ke=(0,t.jsx)(je,{value:"totalTime",children:qe}),e[109]=qe,e[110]=ke):ke=e[110];let Me;e[111]!==a?(Me=a("Avg time"),e[111]=a,e[112]=Me):Me=e[112];let $e;e[113]!==Me?($e=(0,t.jsx)(je,{value:"avgTime",children:Me}),e[113]=Me,e[114]=$e):$e=e[114];let _e;e[115]!==a?(_e=a("Execution count"),e[115]=a,e[116]=_e):_e=e[116];let Ce;e[117]!==_e?(Ce=(0,t.jsx)(je,{value:"execCount",children:_e}),e[117]=_e,e[118]=Ce):Ce=e[118];let Ie;e[119]!==a?(Ie=a("Rows read"),e[119]=a,e[120]=Ie):Ie=e[120];let Te;e[121]!==Ie?(Te=(0,t.jsx)(je,{value:"rowsRead",children:Ie}),e[121]=Ie,e[122]=Te):Te=e[122];let Re;e[123]!==ke||e[124]!==$e||e[125]!==Ce||e[126]!==Te?(Re=(0,t.jsxs)(Rt,{children:[ke,$e,Ce,Te]}),e[123]=ke,e[124]=$e,e[125]=Ce,e[126]=Te,e[127]=Re):Re=e[127];let Oe;e[128]!==r||e[129]!==we||e[130]!==Re?(Oe=(0,t.jsxs)(Ct,{onValueChange:w,value:r,children:[we,Re]}),e[128]=r,e[129]=we,e[130]=Re,e[131]=Oe):Oe=e[131];let ze;e[132]!==Ne||e[133]!==Oe?(ze=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,Oe]}),e[132]=Ne,e[133]=Oe,e[134]=ze):ze=e[134],e[135]!==ve||e[136]!==ze?(x=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,ze]}),e[135]=ve,e[136]=ze,e[137]=x):x=e[137],d=fe;let Fe;e[138]!==a?(Fe=a("Statements"),e[138]=a,e[139]=Fe):Fe=e[139];let Je;e[140]!==Fe?(Je=(0,t.jsx)(Ke,{children:Fe}),e[140]=Fe,e[141]=Je):Je=e[141],$=(0,t.jsxs)(Ae,{children:[Je,(0,t.jsx)(ut,{children:a("{count} tracked statements",{count:C.length})})]}),h=pe,y="space-y-2";let Be;e[142]!==n||e[143]!==a?(Be=o(O=>{let ue=O.normalizedSql,B=n.has(ue),he=Ve(O.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":B,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{F(ue)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(lr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:O.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Pe(O.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Pe(O.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),O.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Pe(O.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Ge(O.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),B&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:O.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[O.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Pe(O.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ge(O.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Pe(O.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ge(O.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ge(O.rowsWritten)})]})]})]})]},ue)},"Ke"),e[142]=n,e[143]=a,e[144]=Be):Be=e[144],q=C.map(Be)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=h,e[7]=d,e[8]=g,e[9]=y,e[10]=q,e[11]=$,e[12]=c,e[13]=p,e[14]=f,e[15]=x}else h=e[6],d=e[7],g=e[8],y=e[9],q=e[10],$=e[11],c=e[12],p=e[13],f=e[14],x=e[15];if(g!==Symbol.for("react.early_return_sentinel"))return g;let k;e[145]!==y||e[146]!==q?(k=(0,t.jsx)("div",{className:y,children:q}),e[145]=y,e[146]=q,e[147]=k):k=e[147];let _;e[148]!==h||e[149]!==k?(_=(0,t.jsx)(h,{children:k}),e[148]=h,e[149]=k,e[150]=_):_=e[150];let N;e[151]!==d||e[152]!==_||e[153]!==$?(N=(0,t.jsxs)(d,{children:[$,_]}),e[151]=d,e[152]=_,e[153]=$,e[154]=N):N=e[154];let I;return e[155]!==N||e[156]!==c||e[157]!==p||e[158]!==f||e[159]!==x?(I=(0,t.jsxs)("div",{className:c,"data-testid":p,children:[f,x,N]}),e[155]=N,e[156]=c,e[157]=p,e[158]=f,e[159]=x,e[160]=I):I=e[160],I},"nr");function or(s){return Ve(s.avgDurationMs)==="critical"}o(or,"or");function cr(s){return Ve(s.avgDurationMs)==="warning"}o(cr,"cr");function dr(s){return Ve(s.avgDurationMs)==="good"}o(dr,"dr");var mr=["1m","5m","15m","1h"],ur=o(s=>new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"ur"),hr=o(s=>s.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:ur(e.bucketMs)})),"fr"),gr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,j.useState)("15m"),r=De(Le.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,u=hr(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:mr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===l,className:mt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===l&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:o(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(Ue,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),u.length===0?(0,t.jsx)(ht,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(Ze,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(yt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(Ze,{height:140,width:"100%",children:(0,t.jsxs)(Nt,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(vt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(ir,{queryStats:r?.entries??[]})]})},"hr"),fr=gt(Le.getMetrics),pr=o((s,e)=>s?e:"overview","pr"),Er=o(({initialShardKey:s})=>{let e=dt(),l=ge(),{queryShardKey:a,setShardKey:r,shardKey:u}=Mt(s),[i,n]=(0,j.useState)("overview"),[S,v]=(0,j.useState)([]),w=(0,j.useRef)(null),h=(0,j.useRef)(null),d=(0,j.useRef)(!0);(0,j.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);let g=zt(a),{data:y,error:q,liveError:$}=De(Le.getMetrics,{},{live:!0,shardKey:a}),c=y??null;(0,j.useEffect)(()=>{if(y===void 0)return;qt(a);let F=y,D=w.current,P=h.current!==null&&h.current!==F.shard;if(h.current=F.shard,w.current=F.requests,P){v([]);return}D!==null&&F.requests>=D&&v(A=>[...A,F.requests-D].slice(-30))},[y,a]);let[p,f]=(0,j.useState)(null),[x,k]=(0,j.useState)(!1),_=o(async()=>{k(!0);let F=Lt(u,wt());try{let D=await Promise.all(F.map(async P=>{try{let A=await e.query(fr,{},ft(P));return{error:null,metrics:A,shard:P===""?A.shard:P}}catch(A){return{error:pt(A),metrics:null,shard:P===""?"__root__":P}}}));d.current&&f(D)}finally{d.current&&k(!1)}},"R"),N=p===null?null:Ft(p),I=c===null||c.requests===0?"\u2014":`${(c.errors/c.requests*100).toFixed(1)}%`,C=S.length>0?S.at(-1):0,T=c?At(c):{p90:0,p95:0},M=(0,j.useMemo)(()=>{if(!c||!("queryStats"in c))return;let F=c.queryStats;if(!(!F||!Array.isArray(F)))return Kt(F)},[c]),b=pr(M!==void 0,i),R=o(()=>{bt(_())},"I"),z=o(()=>{f(null)},"E"),L=o(()=>{n("overview")},"A"),K=o(()=>{n("query-insights")},"L");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(kt,{onChange:r,testId:"mt-shard-input",value:u}),(0,t.jsx)($t,{message:$,prefix:"mt"}),(0,t.jsx)(Ye,{"data-testid":"mt-aggregate",disabled:x,onClick:R,size:"sm",type:"button",variant:"secondary",children:l(x?"Aggregating\u2026":"All shards")}),p!==null&&(0,t.jsx)(Ye,{"data-testid":"mt-aggregate-clear",onClick:z,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:_t,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),q!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:q}),M!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${b==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:L,type:"button",children:l("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${b==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:K,type:"button",children:[l("Query insights"),M.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:M.length})]})]}),b==="query-insights"&&M!==void 0&&(0,t.jsx)(gr,{shardKey:a}),b==="overview"&&c!==null&&(0,t.jsx)(sr,{currentDelta:C,errorRate:I,history:S,latencyPercentiles:T,metrics:c}),b==="overview"&&c===null&&null,b==="overview"&&(0,t.jsx)(er,{onOpenTrace:g,shardKey:a}),b==="overview"&&N!==null&&p!==null&&(0,t.jsx)(tr,{aggregate:N,shardResults:p})]})},"jr");export{Er as MetricsPanel};
@@ -0,0 +1 @@
1
+ import{a as n,d as v,f as N,g as z,i as k}from"./chunk-R5ZTCHCE.js";var y=v(N(),1);var u=v(z(),1);var C={dialog:"fixed inset-0 z-[1000] flex justify-center bg-black/20 pt-[10vh]",drawer:"fixed inset-0 z-[1000] flex justify-end bg-black/20"},I={dialog:"flex h-fit w-[min(28rem,92vw)] flex-col gap-3 rounded-lg border border-border bg-background p-4 shadow-xl",drawer:"flex h-full w-[min(34rem,100vw)] flex-col gap-4 overflow-auto border-l border-border bg-background p-4 shadow-xl"},A=n(j=>{let e=(0,y.c)(18),{className:i,children:c,label:b,onClose:r,panelTestId:f,testId:g,variant:h}=j,o;e[0]!==r?(o=n(s=>{s.target===s.currentTarget&&r()},"r"),e[0]=r,e[1]=o):o=e[1];let m=o,t;e[2]!==r?(t=n(s=>{s.key==="Escape"&&r()},"a"),e[2]=r,e[3]=t):t=e[3];let p=t,x=C[h],w=I[h],l;e[4]!==i||e[5]!==w?(l=k(w,i),e[4]=i,e[5]=w,e[6]=l):l=e[6];let a;e[7]!==c||e[8]!==b||e[9]!==f||e[10]!==l?(a=(0,u.jsx)("div",{"aria-label":b,className:l,"data-testid":f,role:"dialog",children:c}),e[7]=c,e[8]=b,e[9]=f,e[10]=l,e[11]=a):a=e[11];let d;return e[12]!==m||e[13]!==p||e[14]!==x||e[15]!==a||e[16]!==g?(d=(0,u.jsx)("div",{className:x,"data-testid":g,onClick:m,onKeyDown:p,role:"presentation",children:a}),e[12]=m,e[13]=p,e[14]=x,e[15]=a,e[16]=g,e[17]=d):d=e[17],d},"_");export{A as a};
@@ -0,0 +1 @@
1
+ import{a as Qe}from"./chunk-BFCUKERU.js";import{a as Me,b as Re}from"./chunk-7SROZWKL.js";import"./chunk-FJ6G6FNE.js";import"./chunk-CP4ZFBVW.js";import"./chunk-CN2AINNY.js";import{a as we}from"./chunk-NXXGISFB.js";import"./chunk-EDHW2EEG.js";import"./chunk-ZSOLGJFC.js";import"./chunk-DUDQV6XJ.js";import"./chunk-VZCS5GXZ.js";import"./chunk-DKSLOJDQ.js";import"./chunk-JV7KTJPY.js";import{a as He}from"./chunk-CKTKI4IY.js";import{a as Xe}from"./chunk-TB5N24CM.js";import{b as Je}from"./chunk-KVSQKUWD.js";import{e as Ue}from"./chunk-4YTSKL4R.js";import"./chunk-ZHPDAJBM.js";import{P as Ae}from"./chunk-AOAJGSYZ.js";import"./chunk-INQICZYC.js";import"./chunk-TFMQSCGC.js";import{a as me}from"./chunk-BWEXJENB.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import{b as ze}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as je}from"./chunk-DZGOHOOE.js";import{f as Ve}from"./chunk-OEGE3YDK.js";import"./chunk-RCZTUWG3.js";import{a as We}from"./chunk-UANVABQG.js";import{a as qe,b as Pe,c as Ge,d as Ke,e as Le}from"./chunk-IYWVSMAY.js";import{d as Fe,f as Ee,g as $e,h as Oe,o as ue}from"./chunk-6ZPTNC34.js";import"./chunk-FDLSPDIC.js";import{a as r,d as Be,e as at,f as nt,g as st,i as De}from"./chunk-R5ZTCHCE.js";var Ce=Be(nt(),1);var x=Be(at(),1);var t=Be(st(),1);var rt=Ee(je.listTables),ot=Ee(je.listTableIndexes),it=Ee(je.readTablePage),dt=Ee(je.describeTables),ct={},Ye=[],mt=r(s=>{let e=(0,Ce.c)(74),{initialShardKey:u,initialTable:n}=s,l=Ve(),[a,m]=(0,x.useState)("graph"),{queryShardKey:c,setShardKey:d,shardKey:g}=He(u),[o,p]=(0,x.useState)(""),[i,v]=(0,x.useState)(null),[b,P]=(0,x.useState)(null),_;e[0]===Symbol.for("react.memo_cache_sentinel")?(_={},e[0]=_):_=e[0];let[L,y]=(0,x.useState)(_),G;e[1]===Symbol.for("react.memo_cache_sentinel")?(G={},e[1]=G):G=e[1];let[E,M]=(0,x.useState)(G),[S,C]=(0,x.useState)(null),F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F={},e[2]=F):F=e[2];let[$,he]=(0,x.useState)(F),Q;e[3]===Symbol.for("react.memo_cache_sentinel")?(Q={},e[3]=Q):Q=e[3];let[I,K]=(0,x.useState)(Q),[k,pe]=(0,x.useState)(null),[B,oe]=(0,x.useState)(null),Y;e[4]===Symbol.for("react.memo_cache_sentinel")?(Y={},e[4]=Y):Y=e[4];let[W,xe]=(0,x.useState)(Y),[J,ie]=(0,x.useState)(null),ve;e[5]!==l?(ve=r(async h=>{P(null);try{let w=await l.query(rt,{},$e(h));Je(h),v(w),y({}),M({}),C(null),he(N=>Object.fromEntries(Object.entries(N).filter(q=>{let[A]=q;return A!==h}))),K(N=>Object.fromEntries(Object.entries(N).filter(q=>{let[A]=q;return A!==h})))}catch(w){let N=w;v(null),P(Oe(N))}},"ve"),e[5]=l,e[6]=ve):ve=e[6];let O=ve,Z;e[7]!==l?(Z=r(async()=>{oe(null);try{pe(await l.listGlobalTables())}catch(h){let w=h;pe(null),oe(Oe(w))}},"Z"),e[7]=l,e[8]=Z):Z=e[8];let ee=Z,de,D;e[9]!==c||e[10]!==O||e[11]!==ee?(de=r(()=>{ue(O(c)),ue(ee())},"de"),D=[O,ee,c],e[9]=c,e[10]=O,e[11]=ee,e[12]=de,e[13]=D):(de=e[12],D=e[13]),(0,x.useEffect)(de,D);let te;e[14]!==l||e[15]!==L||e[16]!==S||e[17]!==c?(te=r(async h=>{if(S===h){C(null);return}C(h);let w=`${c}:${h}`;if(L[w]!==void 0)return;let[N,q]=await Promise.allSettled([l.query(it,{limit:1,offset:0,table:h},$e(c)),l.query(ot,{table:h},$e(c))]);N.status==="fulfilled"?y(A=>({...A,[w]:N.value.columns})):P(Oe(N.reason)),q.status==="fulfilled"&&M(A=>({...A,[w]:q.value.indexes}))},"te"),e[14]=l,e[15]=L,e[16]=S,e[17]=c,e[18]=te):te=e[18];let j=te,ye;e[19]!==l||e[20]!==W||e[21]!==J?(ye=r(async h=>{if(J===h){ie(null);return}if(ie(h),W[h]===void 0)try{let w=await l.readGlobalTablePage({limit:1,offset:0,table:h});xe(N=>({...N,[h]:w.columns}))}catch(w){oe(Oe(w))}},"ye"),e[19]=l,e[20]=W,e[21]=J,e[22]=ye):ye=e[22];let ce=ye,be=(0,x.useRef)(void 0),R,X;e[23]!==n||e[24]!==i||e[25]!==j?(R=r(()=>{n===void 0||i===null||be.current===n||i.some(h=>h.name===n)&&(be.current=n,ue(j(n)))},"K"),X=[n,i,j],e[23]=n,e[24]=i,e[25]=j,e[26]=R,e[27]=X):(R=e[26],X=e[27]),(0,x.useEffect)(R,X);let V;e[28]!==l?(V=r(async(h,w,N)=>{let[q,A]=await Promise.all([Promise.allSettled([l.query(dt,{tables:[...w,...N]},$e(h))]),Promise.all(N.map(async T=>{let ge=await Promise.allSettled([l.readGlobalTablePage({limit:1,offset:0,table:T})]),Ie=ge[0].status==="fulfilled"?ge[0].value:void 0;return{columns:Ie?.columns??[],refs:Ie?.refs??{},table:T}}))]),Te=q[0].status==="fulfilled"?q[0].value?.columnsByTable??{}:{},Se=q[0].status==="rejected",_e=new Map(A.map(ut)),ke=[...w,...N].map(T=>{let ge=Te[T]??[];return[T,ge.length>0?ge:_e.get(T)??[]]});he(T=>({...T,[h]:Object.fromEntries(ke)})),K(T=>({...T,[h]:Se}))},"U"),e[28]=l,e[29]=V):V=e[29];let le=V,U,ae;e[30]!==B||e[31]!==k||e[32]!==le||e[33]!==c||e[34]!==$||e[35]!==i||e[36]!==a?(U=r(()=>{a!=="graph"||i===null||k===null&&B===null||$[c]!==void 0||ue(le(c,i.map(ht),(k??[]).map(pt)))},"V"),ae=[a,i,k,B,c,$,le],e[30]=B,e[31]=k,e[32]=le,e[33]=c,e[34]=$,e[35]=i,e[36]=a,e[37]=U,e[38]=ae):(U=e[37],ae=e[38]),(0,x.useEffect)(U,ae);let z=$[c]??ct,ne;if(e[39]!==z||e[40]!==k||e[41]!==i){let h;e[43]!==z?(h=r(A=>({columns:z[A.name]??Ye,name:A.name,tier:"shard"}),"u"),e[43]=z,e[44]=h):h=e[44];let w=(i??[]).map(h),N;e[45]!==z?(N=r(A=>({columns:z[A.name]??Ye,name:A.name,tier:"global"}),"x"),e[45]=z,e[46]=N):N=e[46];let q=(k??[]).map(N);ne=[...w,...q],e[39]=z,e[40]=k,e[41]=i,e[42]=ne}else ne=e[42];let se=ne,f;if(e[47]!==o||e[48]!==i){let h=o.trim().toLowerCase();f=(i??[]).filter(w=>w.name.toLowerCase().includes(h)),e[47]=o,e[48]=i,e[49]=f}else f=e[49];let re=f,H;if(e[50]!==k||e[51]!==o){let h=o.trim().toLowerCase();H=(k??[]).filter(w=>w.name.toLowerCase().includes(h)),e[50]=k,e[51]=o,e[52]=H}else H=e[52];let Ne=H,fe;return e[53]!==L||e[54]!==se||e[55]!==b||e[56]!==S||e[57]!==Ne||e[58]!==re||e[59]!==W||e[60]!==B||e[61]!==J||e[62]!==k||e[63]!==E||e[64]!==O||e[65]!==d||e[66]!==I||e[67]!==g||e[68]!==o||e[69]!==i||e[70]!==j||e[71]!==ce||e[72]!==a?(fe={columns:L,diagramTables:se,error:b,expanded:S,filteredGlobalTables:Ne,filteredTables:re,globalColumns:W,globalError:B,globalExpanded:J,globalTables:k,indexes:E,refresh:O,setShardKey:d,setTableFilter:p,setView:m,shardColumnsError:I,shardKey:g,tableFilter:o,tables:i,toggle:j,toggleGlobal:ce,view:a},e[53]=L,e[54]=se,e[55]=b,e[56]=S,e[57]=Ne,e[58]=re,e[59]=W,e[60]=B,e[61]=J,e[62]=k,e[63]=E,e[64]=O,e[65]=d,e[66]=I,e[67]=g,e[68]=o,e[69]=i,e[70]=j,e[71]=ce,e[72]=a,e[73]=fe):fe=e[73],fe},"ct");function ut(s){let{columns:e,refs:u,table:n}=s;return[n,e.map(l=>{let a=u[l];return a===void 0?{name:l,optional:!1,type:""}:{name:l,optional:!1,ref:a,type:"id"}})]}r(ut,"mt");function ht(s){return s.name}r(ht,"ut");function pt(s){return s.name}r(pt,"ft");var bt="/__lunora/schema-edit",ft=r(async s=>{let e=await fetch(bt,{body:JSON.stringify(s),headers:{"Content-Type":"application/json","X-Lunora-Studio":"1"},method:"POST"}),u=await e.json();return u.needsMigration===!0?{kind:"needs-migration",message:u.message??"This edit needs a migration."}:e.ok&&u.tables!==void 0?{diagnostics:u.diagnostics??[],kind:"ok",tables:u.tables}:{kind:"error",message:u.error??`schema edit failed (${String(e.status)})`}},"pt"),gt=r(s=>{let e=(0,Ce.c)(32),{hasTables:u,mode:n,onAddColumn:l,onAddIndex:a,onAddTable:m,onDestructive:c}=s,d=Fe(),g=n==="addTable"?"default":"outline",o;e[0]!==d?(o=d("Add table"),e[0]=d,e[1]=o):o=e[1];let p;e[2]!==m||e[3]!==g||e[4]!==o?(p=(0,t.jsx)(me,{"data-testid":"sc-editor-add-table",onClick:m,size:"xs",type:"button",variant:g,children:o}),e[2]=m,e[3]=g,e[4]=o,e[5]=p):p=e[5];let i=!u,v=n==="addColumn"?"default":"outline",b;e[6]!==d?(b=d("Add column"),e[6]=d,e[7]=b):b=e[7];let P;e[8]!==l||e[9]!==i||e[10]!==v||e[11]!==b?(P=(0,t.jsx)(me,{"data-testid":"sc-editor-add-column",disabled:i,onClick:l,size:"xs",type:"button",variant:v,children:b}),e[8]=l,e[9]=i,e[10]=v,e[11]=b,e[12]=P):P=e[12];let _=!u,L=n==="addIndex"?"default":"outline",y;e[13]!==d?(y=d("Add index"),e[13]=d,e[14]=y):y=e[14];let G;e[15]!==a||e[16]!==y||e[17]!==_||e[18]!==L?(G=(0,t.jsx)(me,{"data-testid":"sc-editor-add-index",disabled:_,onClick:a,size:"xs",type:"button",variant:L,children:y}),e[15]=a,e[16]=y,e[17]=_,e[18]=L,e[19]=G):G=e[19];let E=!u,M=n==="destructive"?"default":"ghost",S;e[20]!==d?(S=d("Rename / drop / change type\u2026"),e[20]=d,e[21]=S):S=e[21];let C;e[22]!==c||e[23]!==E||e[24]!==M||e[25]!==S?(C=(0,t.jsx)(me,{"data-testid":"sc-editor-destructive",disabled:E,onClick:c,size:"xs",type:"button",variant:M,children:S}),e[22]=c,e[23]=E,e[24]=M,e[25]=S,e[26]=C):C=e[26];let F;return e[27]!==G||e[28]!==C||e[29]!==p||e[30]!==P?(F=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[p,P,G,C]}),e[27]=G,e[28]=C,e[29]=p,e[30]=P,e[31]=F):F=e[31],F},"gt"),xt=r(s=>{let e=(0,Ce.c)(28),{onOpenMigrations:u,result:n}=s,l=Fe();if(n===null){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(t.Fragment,{}),e[0]=o):o=e[0],o}if(n.kind==="error"){let o;return e[1]!==n.message?(o=(0,t.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"sc-editor-error",role:"alert",children:n.message}),e[1]=n.message,e[2]=o):o=e[2],o}if(n.kind==="needs-migration"){let o;e[3]!==n.message||e[4]!==l?(o=n.message===""?l("This edit changes stored data and must go through a migration. Review the migration before applying."):n.message,e[3]=n.message,e[4]=l,e[5]=o):o=e[5];let p;e[6]!==o?(p=(0,t.jsx)("p",{className:"text-sm text-warning",role:"alert",children:o}),e[6]=o,e[7]=p):p=e[7];let i;e[8]!==l?(i=l("Open Migrations"),e[8]=l,e[9]=i):i=e[9];let v;e[10]!==u||e[11]!==i?(v=(0,t.jsx)(me,{className:"self-start","data-testid":"sc-editor-open-migrations",onClick:u,size:"xs",type:"button",variant:"outline",children:i}),e[10]=u,e[11]=i,e[12]=v):v=e[12];let b;return e[13]!==p||e[14]!==v?(b=(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2","data-testid":"sc-editor-needs-migration",children:[p,v]}),e[13]=p,e[14]=v,e[15]=b):b=e[15],b}if(n.diagnostics.length===0){let o;return e[16]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(t.Fragment,{}),e[16]=o):o=e[16],o}let a;e[17]!==l?(a=l("Codegen reported diagnostics:"),e[17]=l,e[18]=a):a=e[18];let m;e[19]!==a?(m=(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:a}),e[19]=a,e[20]=m):m=e[20];let c;e[21]!==n.diagnostics?(c=n.diagnostics.map(vt),e[21]=n.diagnostics,e[22]=c):c=e[22];let d;e[23]!==c?(d=(0,t.jsx)("ul",{className:"flex flex-col gap-0.5",children:c}),e[23]=c,e[24]=d):d=e[24];let g;return e[25]!==m||e[26]!==d?(g=(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"sc-editor-diagnostics",children:[m,d]}),e[25]=m,e[26]=d,e[27]=g):g=e[27],g},"bt");function vt(s){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:s},s)}r(vt,"xt");var yt=[{label:"string",validator:"v.string()"},{label:"number",validator:"v.number()"},{label:"boolean",validator:"v.boolean()"},{label:"bigint",validator:"v.int64()"},{label:"bytes",validator:"v.bytes()"},{label:"any",validator:"v.any()"}],Nt="v.string()",Ct=r(s=>s.split(",").map(e=>e.trim()).filter(e=>e!==""),"Ct"),wt=r(s=>{let e=(0,Ce.c)(83),{onApplied:u,tableNames:n}=s,l=Fe(),a=Ue(),[m,c]=(0,x.useState)(null),[d,g]=(0,x.useState)(!1),[o,p]=(0,x.useState)(null),[i,v]=(0,x.useState)(""),[b,P]=(0,x.useState)(""),[_,L]=(0,x.useState)(Nt),[y,G]=(0,x.useState)(n[0]??""),[E,M]=(0,x.useState)(""),[S,C]=(0,x.useState)(""),[F,$]=(0,x.useState)(!1),he;e[0]===Symbol.for("react.memo_cache_sentinel")?(he=r(()=>{c(null),v(""),P(""),M(""),C(""),$(!1)},"me"),e[0]=he):he=e[0];let Q=he,I;e[1]!==u?(I=r(async T=>{g(!0),p(null);try{let ge=await ft(T);p(ge),ge.kind==="ok"&&(u(ge.tables),Q())}catch(ge){let Ie=ge;p({kind:"error",message:Ie instanceof Error?Ie.message:String(Ie)})}g(!1)},"I"),e[1]=u,e[2]=I):I=e[2];let K=I,k;e[3]!==K||e[4]!==i?(k=r(()=>{ue(K({kind:"addTable",table:i.trim()}))},"_"),e[3]=K,e[4]=i,e[5]=k):k=e[5];let pe=k,B;e[6]!==b||e[7]!==K||e[8]!==y||e[9]!==_?(B=r(()=>{ue(K({column:b.trim(),kind:"addOptionalColumn",table:y,validator:_}))},"j"),e[6]=b,e[7]=K,e[8]=y,e[9]=_,e[10]=B):B=e[10];let oe=B,Y;e[11]!==S||e[12]!==E||e[13]!==K||e[14]!==y||e[15]!==F?(Y=r(()=>{ue(K({fields:Ct(S),kind:"addIndex",name:E.trim(),table:y,unique:F}))},"Q"),e[11]=S,e[12]=E,e[13]=K,e[14]=y,e[15]=F,e[16]=Y):Y=e[16];let W=Y,xe;e[17]===Symbol.for("react.memo_cache_sentinel")?(xe=r(()=>{p(null),c("addTable")},"xe"),e[17]=xe):xe=e[17];let J=xe,ie;e[18]===Symbol.for("react.memo_cache_sentinel")?(ie=r(()=>{p(null),c("addColumn")},"re"),e[18]=ie):ie=e[18];let ve=ie,O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=r(()=>{p(null),c("addIndex")},"O"),e[19]=O):O=e[19];let Z=O,ee;e[20]!==l?(ee=r(()=>{c("destructive"),p({kind:"needs-migration",message:l("This edit changes stored data and must go through a migration. Review the migration before applying.")})},"ee"),e[20]=l,e[21]=ee):ee=e[21];let de=ee,D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=r(T=>{v(T.target.value)},"R"),e[22]=D):D=e[22];let te=D,j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=r(T=>{P(T.target.value)},"M"),e[23]=j):j=e[23];let ye=j,ce;e[24]===Symbol.for("react.memo_cache_sentinel")?(ce=r(T=>{L(T.target.value)},"ce"),e[24]=ce):ce=e[24];let be=ce,R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=r(T=>{G(T.target.value)},"K"),e[25]=R):R=e[25];let X=R,V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=r(T=>{M(T.target.value)},"U"),e[26]=V):V=e[26];let le=V,U;e[27]===Symbol.for("react.memo_cache_sentinel")?(U=r(T=>{C(T.target.value)},"V"),e[27]=U):U=e[27];let ae=U,z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=r(T=>{$(T.target.checked)},"$"),e[28]=z):z=e[28];let ne=z,se;e[29]!==a?(se=r(()=>{ue(a({to:"/migrations"}))},"ne"),e[29]=a,e[30]=se):se=e[30];let f=se,re;e[31]!==l?(re=l("Edit schema"),e[31]=l,e[32]=re):re=e[32];let H;e[33]!==re?(H=(0,t.jsx)(Ge,{children:re}),e[33]=re,e[34]=H):H=e[34];let Ne;e[35]!==l?(Ne=l("Adds a table, column, or index to lunora/schema.ts and reruns codegen."),e[35]=l,e[36]=Ne):Ne=e[36];let fe;e[37]!==Ne?(fe=(0,t.jsx)(Ke,{children:Ne}),e[37]=Ne,e[38]=fe):fe=e[38];let h;e[39]!==H||e[40]!==fe?(h=(0,t.jsxs)(Pe,{children:[H,fe]}),e[39]=H,e[40]=fe,e[41]=h):h=e[41];let w=n.length>0,N;e[42]!==m||e[43]!==de||e[44]!==w?(N=(0,t.jsx)(gt,{hasTables:w,mode:m,onAddColumn:ve,onAddIndex:Z,onAddTable:J,onDestructive:de}),e[42]=m,e[43]=de,e[44]=w,e[45]=N):N=e[45];let q;e[46]!==d||e[47]!==m||e[48]!==pe||e[49]!==l||e[50]!==i?(q=m==="addTable"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-table-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-table-name",children:l("Table name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-table-name",id:"sc-editor-table-name",onChange:te,value:i})]}),(0,t.jsx)(me,{"data-testid":"sc-editor-table-apply",disabled:d||i.trim()==="",onClick:pe,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:Q,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[46]=d,e[47]=m,e[48]=pe,e[49]=l,e[50]=i,e[51]=q):q=e[51];let A;e[52]!==d||e[53]!==b||e[54]!==m||e[55]!==oe||e[56]!==l||e[57]!==n||e[58]!==y||e[59]!==_?(A=m==="addColumn"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-column-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-table",id:"sc-editor-column-table",onChange:X,value:y,children:n.map(Tt)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-name",children:l("Column name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-column-name",id:"sc-editor-column-name",onChange:ye,value:b})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-type",children:l("Column type")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-type",id:"sc-editor-column-type",onChange:be,value:_,children:yt.map(St)})]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l("Optional")}),(0,t.jsx)(me,{"data-testid":"sc-editor-column-apply",disabled:d||b.trim()===""||y==="",onClick:oe,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:Q,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[52]=d,e[53]=b,e[54]=m,e[55]=oe,e[56]=l,e[57]=n,e[58]=y,e[59]=_,e[60]=A):A=e[60];let Te;e[61]!==d||e[62]!==S||e[63]!==E||e[64]!==m||e[65]!==W||e[66]!==l||e[67]!==n||e[68]!==y||e[69]!==F?(Te=m==="addIndex"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-index-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-index-table",id:"sc-editor-index-table",onChange:X,value:y,children:n.map(_t)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-name",children:l("Index name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-index-name",id:"sc-editor-index-name",onChange:le,value:E})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-fields",children:l("Index fields (comma-separated)")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-index-fields",id:"sc-editor-index-fields",onChange:ae,value:S})]}),(0,t.jsxs)(we,{className:"flex items-center gap-1 text-xs",htmlFor:"sc-editor-index-unique",children:[(0,t.jsx)("input",{checked:F,"data-testid":"sc-editor-index-unique",id:"sc-editor-index-unique",onChange:ne,type:"checkbox"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:l("Unique")})]}),(0,t.jsx)(me,{"data-testid":"sc-editor-index-apply",disabled:d||E.trim()===""||S.trim()==="",onClick:W,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:Q,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[61]=d,e[62]=S,e[63]=E,e[64]=m,e[65]=W,e[66]=l,e[67]=n,e[68]=y,e[69]=F,e[70]=Te):Te=e[70];let Se;e[71]!==f||e[72]!==o?(Se=(0,t.jsx)(xt,{onOpenMigrations:f,result:o}),e[71]=f,e[72]=o,e[73]=Se):Se=e[73];let _e;e[74]!==N||e[75]!==q||e[76]!==A||e[77]!==Te||e[78]!==Se?(_e=(0,t.jsxs)(Le,{children:[N,q,A,Te,Se]}),e[74]=N,e[75]=q,e[76]=A,e[77]=Te,e[78]=Se,e[79]=_e):_e=e[79];let ke;return e[80]!==h||e[81]!==_e?(ke=(0,t.jsxs)(qe,{"data-testid":"sc-editor",size:"sm",children:[h,_e]}),e[80]=h,e[81]=_e,e[82]=ke):ke=e[82],ke},"Nt");function Tt(s){return(0,t.jsx)("option",{value:s,children:s},s)}r(Tt,"Tt");function St(s){return(0,t.jsx)("option",{value:s.validator,children:s.label},s.validator)}r(St,"St");function _t(s){return(0,t.jsx)("option",{value:s,children:s},s)}r(_t,"wt");var Ze=[],kt=r(s=>{let e=(0,Ce.c)(5),{open:u}=s,n=u&&"rotate-90",l;e[0]!==n?(l=De("size-3.5 shrink-0 text-muted-foreground transition-transform duration-150",n),e[0]=n,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[2]=a):a=e[2];let m;return e[3]!==l?(m=(0,t.jsx)("svg",{"aria-hidden":"true",className:l,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:a}),e[3]=l,e[4]=m):m=e[4],m},"_t"),et=r(s=>{let e=(0,Ce.c)(20),{children:u,expanded:n,name:l,onToggle:a,rowCount:m,rowTestId:c,toggleTestId:d}=s,g;e[0]!==n?(g=(0,t.jsx)(kt,{open:n}),e[0]=n,e[1]=g):g=e[1];let o;e[2]!==l?(o=(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l,children:l}),e[2]=l,e[3]=o):o=e[3];let p;e[4]!==m?(p=(0,t.jsxs)("span",{className:"ms-auto shrink-0 text-xs text-muted-foreground tabular-nums",children:["(",m,")"]}),e[4]=m,e[5]=p):p=e[5];let i;e[6]!==n||e[7]!==a||e[8]!==g||e[9]!==o||e[10]!==p||e[11]!==d?(i=(0,t.jsxs)("button",{"aria-expanded":n,className:"flex w-full items-center gap-2 px-3 py-2 text-start transition-colors hover:bg-muted/50 aria-expanded:bg-muted/40","data-testid":d,onClick:a,type:"button",children:[g,o," ",p]}),e[6]=n,e[7]=a,e[8]=g,e[9]=o,e[10]=p,e[11]=d,e[12]=i):i=e[12];let v;e[13]!==u||e[14]!==n?(v=n&&(0,t.jsx)("div",{className:"px-3 pb-3 ps-8",children:u}),e[13]=u,e[14]=n,e[15]=v):v=e[15];let b;return e[16]!==c||e[17]!==i||e[18]!==v?(b=(0,t.jsxs)("li",{className:"border-t border-border/60 first:border-t-0","data-testid":c,children:[i,v]}),e[16]=c,e[17]=i,e[18]=v,e[19]=b):b=e[19],b},"Ye"),tt=r(s=>{let e=(0,Ce.c)(5),{columns:u,testId:n}=s,l;e[0]!==u?(l=u.map(At),e[0]=u,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==n?(a=(0,t.jsx)("ul",{className:"flex flex-wrap gap-1.5 pt-1","data-testid":n,children:l}),e[2]=l,e[3]=n,e[4]=a):a=e[4],a},"He"),It=r(s=>{let e=(0,Ce.c)(10),{heading:u,indexes:n,testId:l}=s,a;e[0]!==u?(a=(0,t.jsx)("p",{className:"mb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:u}),e[0]=u,e[1]=a):a=e[1];let m;e[2]!==n?(m=n.map(Ft),e[2]=n,e[3]=m):m=e[3];let c;e[4]!==m||e[5]!==l?(c=(0,t.jsx)("ul",{className:"flex flex-col gap-1","data-testid":l,children:m}),e[4]=m,e[5]=l,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==c?(d=(0,t.jsxs)("div",{className:"pt-3",children:[a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9],d},"Et"),lt=r(s=>De("border-b-2 px-3 py-2 font-mono text-[11px] tracking-widest uppercase outline-none transition-colors",s?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"Xe"),Xt=r(s=>{let e=(0,Ce.c)(85),{initialShardKey:u,initialTable:n,schemaEditable:l}=s,a=Fe(),m;e[0]!==u||e[1]!==n?(m={initialShardKey:u,initialTable:n},e[0]=u,e[1]=n,e[2]=m):m=e[2];let{columns:c,diagramTables:d,error:g,expanded:o,filteredGlobalTables:p,filteredTables:i,globalColumns:v,globalError:b,globalExpanded:P,globalTables:_,indexes:L,refresh:y,setShardKey:G,setTableFilter:E,setView:M,shardColumnsError:S,shardKey:C,tableFilter:F,tables:$,toggle:he,toggleGlobal:Q,view:I}=mt(m),K;e[3]!==M?(K=r(()=>{M("list")},"q"),e[3]=M,e[4]=K):K=e[4];let k=K,pe;e[5]!==M?(pe=r(()=>{M("graph")},"ue"),e[5]=M,e[6]=pe):pe=e[6];let B=pe,oe;e[7]!==E?(oe=r(f=>{E(f.target.value)},"ie"),e[7]=E,e[8]=oe):oe=e[8];let Y=oe,W;e[9]!==y||e[10]!==C?(W=r(f=>{ue(y(C))},"Y"),e[9]=y,e[10]=C,e[11]=W):W=e[11];let xe=W,J;e[12]!==$?(J=$??[],e[12]=$,e[13]=J):J=e[13];let ie;e[14]!==J?(ie=J.map(zt),e[14]=J,e[15]=ie):ie=e[15];let ve=ie,O;e[16]!==G||e[17]!==C?(O=(0,t.jsx)(Xe,{onChange:G,testId:"sc-shard-input",value:C}),e[16]=G,e[17]=C,e[18]=O):O=e[18];let Z;e[19]!==a?(Z=a("Schema view"),e[19]=a,e[20]=Z):Z=e[20];let ee=I==="graph",de=I==="graph",D;e[21]!==de?(D=lt(de),e[21]=de,e[22]=D):D=e[22];let te;e[23]!==a?(te=a("Graph"),e[23]=a,e[24]=te):te=e[24];let j;e[25]!==B||e[26]!==ee||e[27]!==D||e[28]!==te?(j=(0,t.jsx)("button",{"aria-selected":ee,className:D,"data-testid":"sc-view-graph",onClick:B,role:"tab",type:"button",children:te}),e[25]=B,e[26]=ee,e[27]=D,e[28]=te,e[29]=j):j=e[29];let ye=I==="list",ce=I==="list",be;e[30]!==ce?(be=lt(ce),e[30]=ce,e[31]=be):be=e[31];let R;e[32]!==a?(R=a("Table list"),e[32]=a,e[33]=R):R=e[33];let X;e[34]!==k||e[35]!==ye||e[36]!==be||e[37]!==R?(X=(0,t.jsx)("button",{"aria-selected":ye,className:be,"data-testid":"sc-view-list",onClick:k,role:"tab",type:"button",children:R}),e[34]=k,e[35]=ye,e[36]=be,e[37]=R,e[38]=X):X=e[38];let V;e[39]!==j||e[40]!==X||e[41]!==Z?(V=(0,t.jsxs)("div",{"aria-label":Z,className:"flex items-center gap-1","data-testid":"sc-view-toggle",role:"tablist",children:[j,X]}),e[39]=j,e[40]=X,e[41]=Z,e[42]=V):V=e[42];let le;e[43]!==V||e[44]!==O?(le=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[O,V]}),e[43]=V,e[44]=O,e[45]=le):le=e[45];let U;e[46]!==xe||e[47]!==l||e[48]!==ve?(U=l===!0&&(0,t.jsx)(wt,{onApplied:xe,tableNames:ve}),e[46]=xe,e[47]=l,e[48]=ve,e[49]=U):U=e[49];let ae;e[50]!==Y||e[51]!==a||e[52]!==F||e[53]!==I?(ae=I==="list"&&(0,t.jsx)(Ae,{"aria-label":a("Filter tables"),className:"h-8 max-w-xs","data-testid":"sc-filter",onChange:Y,placeholder:a("Filter tables"),value:F}),e[50]=Y,e[51]=a,e[52]=F,e[53]=I,e[54]=ae):ae=e[54];let z;e[55]!==d||e[56]!==g||e[57]!==b||e[58]!==S||e[59]!==C||e[60]!==I?(z=I==="graph"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"sc-graph-view",children:[g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:g}),b!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:b}),(0,t.jsx)(Qe,{columnsError:S[C]===!0,tables:d,testIdPrefix:"sc-graph"})]}),e[55]=d,e[56]=g,e[57]=b,e[58]=S,e[59]=C,e[60]=I,e[61]=z):z=e[61];let ne;e[62]!==c||e[63]!==g||e[64]!==o||e[65]!==p||e[66]!==i||e[67]!==v||e[68]!==b||e[69]!==P||e[70]!==_||e[71]!==L||e[72]!==C||e[73]!==a||e[74]!==$||e[75]!==he||e[76]!==Q||e[77]!==I?(ne=I==="list"&&(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)(qe,{"data-testid":"sc-shard-section",size:"sm",children:[(0,t.jsxs)(Pe,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Re,{tier:"shard"}),(0,t.jsx)(Ge,{children:a("Shard tables")}),$!==null&&(0,t.jsx)(ze,{className:"ms-auto tabular-nums",variant:"outline",children:i.length})]}),(0,t.jsx)(Ke,{children:Me.shard.hint})]}),(0,t.jsxs)(Le,{children:[g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:g}),$!==null&&$.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-empty",children:a("No tables in this shard.")}),$!==null&&$.length>0&&i.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-no-match",children:a("No tables match your filter.")}),i.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-table-list",children:i.map(f=>{let re=`${C}:${f.name}`,H=L[re]??[];return(0,t.jsxs)(et,{expanded:o===f.name,name:f.name,onToggle:r(()=>{ue(he(f.name))},"onToggle"),rowCount:f.rowCount,rowTestId:`sc-table-${f.name}`,toggleTestId:`sc-toggle-${f.name}`,children:[(0,t.jsx)(tt,{columns:c[re]??Ze,testId:`sc-columns-${f.name}`}),H.length>0&&(0,t.jsx)(It,{heading:a("Indexes"),indexes:H,testId:`sc-indexes-${f.name}`})]},f.name)})})]})]}),(0,t.jsxs)(qe,{"data-testid":"sc-global-section",size:"sm",children:[(0,t.jsxs)(Pe,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Re,{tier:"global"}),(0,t.jsx)(Ge,{children:a("Global tables (D1)")}),_!==null&&(0,t.jsx)(ze,{className:"ms-auto tabular-nums",variant:"outline",children:p.length})]}),(0,t.jsx)(Ke,{children:Me.global.hint})]}),(0,t.jsxs)(Le,{children:[b!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:b}),_!==null&&_.length===0&&(0,t.jsx)(We,{description:Me.global.hint,testId:"sc-global-empty",title:a("No global tables.")}),_!==null&&_.length>0&&p.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-global-no-match",children:a("No tables match your filter.")}),p.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-global-table-list",children:p.map(f=>(0,t.jsx)(et,{expanded:P===f.name,name:f.name,onToggle:r(()=>{ue(Q(f.name))},"onToggle"),rowCount:f.rowCount,rowTestId:`sc-global-table-${f.name}`,toggleTestId:`sc-global-toggle-${f.name}`,children:(0,t.jsx)(tt,{columns:v[f.name]??Ze,testId:`sc-global-columns-${f.name}`})},f.name))})]})]})]}),e[62]=c,e[63]=g,e[64]=o,e[65]=p,e[66]=i,e[67]=v,e[68]=b,e[69]=P,e[70]=_,e[71]=L,e[72]=C,e[73]=a,e[74]=$,e[75]=he,e[76]=Q,e[77]=I,e[78]=ne):ne=e[78];let se;return e[79]!==le||e[80]!==U||e[81]!==ae||e[82]!==z||e[83]!==ne?(se=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schema",children:[le,U,ae,z,ne]}),e[79]=le,e[80]=U,e[81]=ae,e[82]=z,e[83]=ne,e[84]=se):se=e[84],se},"Wt");function At(s){return(0,t.jsx)("li",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:s},s)}r(At,"It");function Ft(s){return(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,t.jsx)("span",{className:"font-mono",children:s.name}),(0,t.jsx)(ze,{variant:"outline",children:s.type}),s.unique===!0&&(0,t.jsx)(ze,{variant:"secondary",children:"unique"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:s.fields.join(", ")})]},`${s.type}:${s.name}`)}r(Ft,"kt");function zt(s){return s.name}r(zt,"At");export{Xt as SchemaViewer};
@@ -0,0 +1 @@
1
+ import{P as R}from"./chunk-AOAJGSYZ.js";import"./chunk-TFMQSCGC.js";import{a as B}from"./chunk-BWEXJENB.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import{b as S}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as q}from"./chunk-Y2YQITGI.js";import"./chunk-PZ4QDWTI.js";import"./chunk-VLW547U6.js";import"./chunk-F7JOSNAT.js";import{a as U}from"./chunk-DZGOHOOE.js";import{c as O}from"./chunk-PSPJORP6.js";import"./chunk-OEGE3YDK.js";import"./chunk-RCZTUWG3.js";import{a as D}from"./chunk-UANVABQG.js";import{a as G,b as J,c as K,d as F,e as s,f as o}from"./chunk-L4EZAHCD.js";import{a as V,e as W}from"./chunk-IYWVSMAY.js";import{d as P,r as H}from"./chunk-6ZPTNC34.js";import"./chunk-FDLSPDIC.js";import{a as n,d as j,e as re,f as ae,g as ie}from"./chunk-R5ZTCHCE.js";var X=j(ae(),1),M=j(re(),1);var t=j(ie(),1);var ne=n(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","te"),Q=n(e=>e.endpoint??e.id,"M"),ve=n(()=>{let e=(0,X.c)(38),r=P(),[i,Y]=(0,M.useState)("all"),[l,Z]=(0,M.useState)(""),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let{data:I,error:d,errorSource:x,isLoading:_,refetch:v}=O(U.listPushSubscriptions,g),N;if(e[1]!==I?.subscriptions||e[2]!==d||e[3]!==x||e[4]!==_||e[5]!==i||e[6]!==v||e[7]!==l||e[8]!==r){let L=I?.subscriptions??[],T=l.trim().toLowerCase(),A=L.filter(a=>i!=="all"&&a.kind!==i?!1:T===""?!0:`${Q(a)} ${a.userId??""}`.toLowerCase().includes(T)),b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n(a=>{Z(a.target.value)},"w"),e[10]=b):b=e[10];let ee=b,w;e[11]!==v?(w=n(()=>{v()},"y"),e[11]=v,e[12]=w):w=e[12];let E=w,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=["all","web-push","fcm"],e[13]=k):k=e[13];let te=k,c;e[14]!==i||e[15]!==r?(c=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:te.map(a=>(0,t.jsx)(B,{"aria-selected":i===a,"data-testid":`nt-kind-${a}`,onClick:n(()=>{Y(a)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===a?"secondary":"ghost",children:a==="all"?r("All"):a},a))}),e[14]=i,e[15]=r,e[16]=c):c=e[16];let m;e[17]!==r?(m=r("Filter devices"),e[17]=r,e[18]=m):m=e[18];let h;e[19]!==r?(h=r("filter endpoint, user"),e[19]=r,e[20]=h):h=e[20];let u;e[21]!==l||e[22]!==m||e[23]!==h?(u=(0,t.jsx)(R,{"aria-label":m,className:"h-8 w-56","data-testid":"nt-search",onChange:ee,placeholder:h,value:l}),e[21]=l,e[22]=m,e[23]=h,e[24]=u):u=e[24];let f;e[25]!==r?(f=r("Refresh"),e[25]=r,e[26]=f):f=e[26];let p;e[27]!==E||e[28]!==f?(p=(0,t.jsx)(B,{className:"ml-auto","data-testid":"nt-refresh",onClick:E,size:"sm",type:"button",variant:"outline",children:f}),e[27]=E,e[28]=f,e[29]=p):p=e[29];let $=L.length>0&&(0,t.jsx)(S,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:L.length})}),y;e[30]!==p||e[31]!==$||e[32]!==c||e[33]!==u?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,u,p,$]}),e[30]=p,e[31]=$,e[32]=c,e[33]=u,e[34]=y):y=e[34];let C;e[35]!==d||e[36]!==x?(C=d!==null&&(0,t.jsx)(q,{error:x,testId:"nt-error"}),e[35]=d,e[36]=x,e[37]=C):C=e[37],N=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[y,C,d===null&&!_&&A.length===0&&(0,t.jsx)(D,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&(0,t.jsx)(V,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"nt-table",children:[(0,t.jsx)(J,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(s,{children:r("kind")}),(0,t.jsx)(s,{children:r("endpoint")}),(0,t.jsx)(s,{children:r("user")}),(0,t.jsx)(s,{children:r("last seen")}),(0,t.jsx)(s,{children:r("status")}),(0,t.jsx)(s,{children:r("error")})]})}),(0,t.jsx)(K,{children:A.map(a=>{let z=Q(a);return(0,t.jsxs)(F,{"data-testid":"nt-row",children:[(0,t.jsx)(o,{children:(0,t.jsx)(S,{variant:"outline",children:a.kind})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs",title:z,children:z}),(0,t.jsx)(o,{className:"max-w-[16ch] truncate font-mono text-xs",children:a.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(o,{className:"text-muted-foreground tabular-nums",children:H(a.lastSeenAt,"\u2014")}),(0,t.jsx)(o,{children:(0,t.jsx)(S,{"data-testid":`nt-status-${a.id}`,variant:ne(a.lastStatus),children:a.lastStatus??r("n/a")})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:a.lastError??void 0,children:a.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},a.id)})})]})})})]}),e[1]=I?.subscriptions,e[2]=d,e[3]=x,e[4]=_,e[5]=i,e[6]=v,e[7]=l,e[8]=r,e[9]=N}else N=e[9];return N},"ge");export{ve as default};
@@ -0,0 +1,19 @@
1
+ import{a,b as ee,d as fe,e as Pe}from"./chunk-R5ZTCHCE.js";var he=ee((de,W)=>{(function(e,r){typeof define=="function"&&define.amd?define([],r):typeof W=="object"&&W.exports?W.exports=r():e.moo=r()})(de,function(){"use strict";var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,t=typeof new RegExp().sticky=="boolean";function s(n){return n&&r.call(n)==="[object RegExp]"}a(s,"isRegExp");function i(n){return n&&typeof n=="object"&&!s(n)&&!Array.isArray(n)}a(i,"isObject");function l(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,function(o){return o==="-"?"\\x2d":"\\"+o})}a(l,"reEscape");function c(n){var o=new RegExp("|"+n);return o.exec("").length-1}a(c,"reGroups");function h(n){return"("+n+")"}a(h,"reCapture");function v(n){if(!n.length)return"(?!)";var o=n.map(function(u){return"(?:"+u+")"}).join("|");return"(?:"+o+")"}a(v,"reUnion");function S(n){if(typeof n=="string")return"(?:"+l(n)+")";if(s(n)){if(n.ignoreCase)throw new Error("RegExp /i flag not allowed");if(n.global)throw new Error("RegExp /g flag is implied");if(n.sticky)throw new Error("RegExp /y flag is implied");if(n.multiline)throw new Error("RegExp /m flag is implied");return n.source}else throw new Error("Not a pattern: "+n)}a(S,"regexpOrLiteral");function k(n,o){return n.length>o?n:Array(o-n.length+1).join(" ")+n}a(k,"pad");function $(n,o){for(var u=n.length,f=0;;){var g=n.lastIndexOf(`
2
+ `,u-1);if(g===-1||(f++,u=g,f===o)||u===0)break}var d=f<o?0:u+1;return n.substring(d).split(`
3
+ `)}a($,"lastNLines");function K(n){for(var o=Object.getOwnPropertyNames(n),u=[],f=0;f<o.length;f++){var g=o[f],d=n[g],y=[].concat(d);if(g==="include"){for(var w=0;w<y.length;w++)u.push({include:y[w]});continue}var m=[];y.forEach(function(p){i(p)?(m.length&&u.push(M(g,m)),u.push(M(g,p)),m=[]):m.push(p)}),m.length&&u.push(M(g,m))}return u}a(K,"objectToRules");function O(n){for(var o=[],u=0;u<n.length;u++){var f=n[u];if(f.include){for(var g=[].concat(f.include),d=0;d<g.length;d++)o.push({include:g[d]});continue}if(!f.type)throw new Error("Rule has no type: "+JSON.stringify(f));o.push(M(f.type,f))}return o}a(O,"arrayToRules");function M(n,o){if(i(o)||(o={match:o}),o.include)throw new Error("Matching rules cannot also include states");var u={defaultType:n,lineBreaks:!!o.error||!!o.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var f in o)e.call(o,f)&&(u[f]=o[f]);if(typeof u.type=="string"&&n!==u.type)throw new Error("Type transform cannot be a string (type '"+u.type+"' for token '"+n+"')");var g=u.match;return u.match=Array.isArray(g)?g:g?[g]:[],u.match.sort(function(d,y){return s(d)&&s(y)?0:s(y)?-1:s(d)?1:y.length-d.length}),u}a(M,"ruleOptions");function D(n){return Array.isArray(n)?O(n):K(n)}a(D,"toRules");var N=M("error",{lineBreaks:!0,shouldThrow:!0});function F(n,o){for(var u=null,f=Object.create(null),g=!0,d=null,y=[],w=[],m=0;m<n.length;m++)n[m].fallback&&(g=!1);for(var m=0;m<n.length;m++){var p=n[m];if(p.include)throw new Error("Inheritance is not allowed in stateless lexers");if(p.error||p.fallback){if(u)throw!p.fallback==!u.fallback?new Error("Multiple "+(p.fallback?"fallback":"error")+" rules not allowed (for token '"+p.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+p.defaultType+"')");u=p}var b=p.match.slice();if(g)for(;b.length&&typeof b[0]=="string"&&b[0].length===1;){var q=b.shift();f[q.charCodeAt(0)]=p}if(p.pop||p.push||p.next){if(!o)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+p.defaultType+"')");if(p.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+p.defaultType+"')")}if(b.length!==0){g=!1,y.push(p);for(var C=0;C<b.length;C++){var P=b[C];if(s(P)){if(d===null)d=P.unicode;else if(d!==P.unicode&&p.fallback===!1)throw new Error("If one rule is /u then all must be")}}var I=v(b.map(S)),T=new RegExp(I);if(T.test(""))throw new Error("RegExp matches empty string: "+T);var U=c(I);if(U>0)throw new Error("RegExp has capture groups: "+T+`
4
+ Use (?: \u2026 ) instead`);if(!p.lineBreaks&&T.test(`
5
+ `))throw new Error("Rule should declare lineBreaks: "+T);w.push(h(I))}}var R=u&&u.fallback,L=t&&!R?"ym":"gm",H=t||R?"":"|";d===!0&&(L+="u");var Ce=new RegExp(v(w)+H,L);return{regexp:Ce,groups:y,fast:f,error:u||N}}a(F,"compileRules");function Q(n){var o=F(D(n));return new _({start:o},"start")}a(Q,"compile");function ue(n,o,u){var f=n&&(n.push||n.next);if(f&&!u[f])throw new Error("Missing state '"+f+"' (in token '"+n.defaultType+"' of state '"+o+"')");if(n&&n.pop&&+n.pop!=1)throw new Error("pop must be 1 (in token '"+n.defaultType+"' of state '"+o+"')")}a(ue,"checkStateGroup");function Me(n,o){var u=n.$all?D(n.$all):[];delete n.$all;var f=Object.getOwnPropertyNames(n);o||(o=f[0]);for(var g=Object.create(null),d=0;d<f.length;d++){var y=f[d];g[y]=D(n[y]).concat(u)}for(var d=0;d<f.length;d++)for(var y=f[d],w=g[y],m=Object.create(null),p=0;p<w.length;p++){var b=w[p];if(b.include){var q=[p,1];if(b.include!==y&&!m[b.include]){m[b.include]=!0;var C=g[b.include];if(!C)throw new Error("Cannot include nonexistent state '"+b.include+"' (in state '"+y+"')");for(var P=0;P<C.length;P++){var I=C[P];w.indexOf(I)===-1&&q.push(I)}}w.splice.apply(w,q),p--}}for(var T=Object.create(null),d=0;d<f.length;d++){var y=f[d];T[y]=F(g[y],!0)}for(var d=0;d<f.length;d++){for(var U=f[d],R=T[U],L=R.groups,p=0;p<L.length;p++)ue(L[p],U,T);for(var H=Object.getOwnPropertyNames(R.fast),p=0;p<H.length;p++)ue(R.fast[H[p]],U,T)}return new _(T,o)}a(Me,"compileStates");function Be(n){for(var o=typeof Map<"u",u=o?new Map:Object.create(null),f=Object.getOwnPropertyNames(n),g=0;g<f.length;g++){var d=f[g],y=n[d],w=Array.isArray(y)?y:[y];w.forEach(function(m){if(typeof m!="string")throw new Error("keyword must be string (in keyword '"+d+"')");o?u.set(m,d):u[m]=d})}return function(m){return o?u.get(m):u[m]}}a(Be,"keywordTransform");var _=a(function(n,o){this.startState=o,this.states=n,this.buffer="",this.stack=[],this.reset()},"Lexer");_.prototype.reset=function(n,o){return this.buffer=n||"",this.index=0,this.line=o?o.line:1,this.col=o?o.col:1,this.queuedToken=o?o.queuedToken:null,this.queuedText=o?o.queuedText:"",this.queuedThrow=o?o.queuedThrow:null,this.setState(o?o.state:this.startState),this.stack=o&&o.stack?o.stack.slice():[],this},_.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},_.prototype.setState=function(n){if(!(!n||this.state===n)){this.state=n;var o=this.states[n];this.groups=o.groups,this.error=o.error,this.re=o.regexp,this.fast=o.fast}},_.prototype.popState=function(){this.setState(this.stack.pop())},_.prototype.pushState=function(n){this.stack.push(this.state),this.setState(n)};var De=t?function(n,o){return n.exec(o)}:function(n,o){var u=n.exec(o);return u[0].length===0?null:u};_.prototype._getGroup=function(n){for(var o=this.groups.length,u=0;u<o;u++)if(n[u+1]!==void 0)return this.groups[u];throw new Error("Cannot find token type for matched text")};function qe(){return this.value}if(a(qe,"tokenToString"),_.prototype.next=function(){var n=this.index;if(this.queuedGroup){var o=this._token(this.queuedGroup,this.queuedText,n);return this.queuedGroup=null,this.queuedText="",o}var u=this.buffer;if(n!==u.length){var y=this.fast[u.charCodeAt(n)];if(y)return this._token(y,u.charAt(n),n);var f=this.re;f.lastIndex=n;var g=De(f,u),d=this.error;if(g==null)return this._token(d,u.slice(n,u.length),n);var y=this._getGroup(g),w=g[0];return d.fallback&&g.index!==n?(this.queuedGroup=y,this.queuedText=w,this._token(d,u.slice(n,g.index),n)):this._token(y,w,n)}},_.prototype._token=function(n,o,u){var f=0;if(n.lineBreaks){var g=/\n/g,d=1;if(o===`
6
+ `)f=1;else for(;g.exec(o);)f++,d=g.lastIndex}var y={type:typeof n.type=="function"&&n.type(o)||n.defaultType,value:typeof n.value=="function"?n.value(o):o,text:o,toString:qe,offset:u,lineBreaks:f,line:this.line,col:this.col},w=o.length;if(this.index+=w,this.line+=f,f!==0?this.col=w-d+1:this.col+=w,n.shouldThrow){var m=new Error(this.formatError(y,"invalid syntax"));throw m}return n.pop?this.popState():n.push?this.pushState(n.push):n.next&&this.setState(n.next),y},typeof Symbol<"u"&&Symbol.iterator){var X=a(function(n){this.lexer=n},"LexerIterator");X.prototype.next=function(){var n=this.lexer.next();return{value:n,done:!n}},X.prototype[Symbol.iterator]=function(){return this},_.prototype[Symbol.iterator]=function(){return new X(this)}}return _.prototype.formatError=function(n,o){if(n==null)var u=this.buffer.slice(this.index),n={text:u,offset:this.index,lineBreaks:u.indexOf(`
7
+ `)===-1?0:1,line:this.line,col:this.col};var f=2,g=Math.max(n.line-f,1),d=n.line+f,y=String(d).length,w=$(this.buffer,this.line-n.line+f+1).slice(0,5),m=[];m.push(o+" at line "+n.line+" col "+n.col+":"),m.push("");for(var p=0;p<w.length;p++){var b=w[p],q=g+p;m.push(k(String(q),y)+" "+b),q===n.line&&m.push(k("",y+n.col+1)+"^")}return m.join(`
8
+ `)},_.prototype.clone=function(){return new _(this.states,this.state)},_.prototype.has=function(n){return!0},{compile:Q,states:Me,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:Be}})});var pe=ee(A=>{"use strict";var Ne=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A,"__esModule",{value:!0});A.lexer=A.states=void 0;var Fe=Ne(he());A.states={body:{doubleapos:{match:"''",value:a(()=>"'","value")},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:a(e=>e.slice(1,-1).replace(/''/g,"'"),"value")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:a(e=>e.substring(1).trim(),"value")},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:a(e=>e.split(",")[1].trim(),"value")},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:a(e=>e.split(",")[1].trim(),"value")},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:a(e=>e.substring(1).trim(),"value")},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:a(e=>e.split(":")[1].trim(),"value")},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:a(e=>e.substring(0,e.indexOf("{")).trim(),"value")},end:{match:/\s*\}/u,pop:1}}};A.lexer=Fe.default.states(A.states)});var me=ee(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.ParseError=void 0;z.parse=Ue;var ye=pe(),j=a(e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),"getContext"),te=a(e=>e==="plural"||e==="select"||e==="selectordinal","isSelectType");function Ie(e,r){let t="",s="";for(let l of r){let c=l.ctx.text;switch(s+=c,l.type){case"content":t+=l.value;break;case"argument":case"function":case"octothorpe":t+=c;break;default:throw new x(e,`Unsupported part in strict mode function arg style: ${c}`)}}return[{type:"content",value:t.trim(),ctx:Object.assign({},r[0].ctx,{text:s})}]}a(Ie,"strictArgStyleParam");var Re=["number","date","time","spellout","ordinal","duration"],ge=["zero","one","two","few","many","other"],x=class extends Error{static{a(this,"ParseError")}constructor(r,t){super(ye.lexer.formatError(r,t))}};z.ParseError=x;var re=class{static{a(this,"Parser")}constructor(r,t){var s,i,l,c;this.lexer=ye.lexer.reset(r),this.cardinalKeys=(s=t?.cardinal)!==null&&s!==void 0?s:ge,this.ordinalKeys=(i=t?.ordinal)!==null&&i!==void 0?i:ge,this.strict=(l=t?.strict)!==null&&l!==void 0?l:!1,this.strictPluralKeys=(c=t?.strictPluralKeys)!==null&&c!==void 0?c:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(r,t,s){if(s[0]==="="){if(t==="select")throw new x(r,`The case ${s} is not valid with select`)}else if(t!=="select"){let i=t==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&i.length>0&&!i.includes(s)){let l=`The ${t} case ${s} is not valid in this locale`;throw new x(r,l)}}}parseSelect({value:r},t,s,i){let l={type:i,arg:r,cases:[],ctx:s};i==="plural"||i==="selectordinal"?t=!0:this.strict&&(t=!1);for(let c of this.lexer)switch(c.type){case"offset":if(i==="select")throw new x(c,"Unexpected plural offset for select");if(l.cases.length>0)throw new x(c,"Plural offset must be set before cases");l.pluralOffset=Number(c.value),s.text+=c.text,s.lineBreaks+=c.lineBreaks;break;case"case":{this.checkSelectKey(c,i,c.value),l.cases.push({key:c.value,tokens:this.parseBody(t),ctx:j(c)});break}case"end":return l;default:throw new x(c,`Unexpected lexer token: ${c.type}`)}throw new x(null,"Unexpected message end")}parseArgToken(r,t){let s=j(r),i=this.lexer.next();if(!i)throw new x(null,"Unexpected message end");if(s.text+=i.text,s.lineBreaks+=i.lineBreaks,this.strict&&(i.type==="func-simple"||i.type==="func-args")&&!Re.includes(i.value)){let l=`Invalid strict mode function arg type: ${i.value}`;throw new x(r,l)}switch(i.type){case"end":return{type:"argument",arg:r.value,ctx:s};case"func-simple":{let l=this.lexer.next();if(!l)throw new x(null,"Unexpected message end");if(l.type!=="end")throw new x(l,`Unexpected lexer token: ${l.type}`);if(s.text+=l.text,te(i.value.toLowerCase()))throw new x(i,`Invalid type identifier: ${i.value}`);return{type:"function",arg:r.value,key:i.value,ctx:s}}case"func-args":{if(te(i.value.toLowerCase())){let c=`Invalid type identifier: ${i.value}`;throw new x(i,c)}let l=this.parseBody(this.strict?!1:t);return this.strict&&l.length>0&&(l=Ie(r,l)),{type:"function",arg:r.value,key:i.value,param:l,ctx:s}}case"select":if(te(i.value))return this.parseSelect(r,t,s,i.value);throw new x(i,`Unexpected select type ${i.value}`);default:throw new x(i,`Unexpected lexer token: ${i.type}`)}}parseBody(r,t){let s=[],i=null;for(let l of this.lexer)if(l.type==="argument")i&&(i=null),s.push(this.parseArgToken(l,r));else if(l.type==="octothorpe"&&r)i&&(i=null),s.push({type:"octothorpe",ctx:j(l)});else{if(l.type==="end"&&!t)return s;{let c=l.value;if(!r&&l.type==="quoted"&&c[0]==="#"){if(c.includes("{")){let h=`Unsupported escape pattern: ${c}`;throw new x(l,h)}c=l.text}i?(i.value+=c,i.ctx.text+=l.text,i.ctx.lineBreaks+=l.lineBreaks):(i={type:"content",value:c,ctx:j(l)},s.push(i))}}if(t)return s;throw new x(null,"Unexpected message end")}};function Ue(e,r={}){return new re(e,r).parse()}a(Ue,"parse")});var xe=fe(me(),1);var E=class extends Error{static{a(this,"DateFormatError")}constructor(r,t,s){super(r),this.token=t,this.type=s||"error"}},ve=a(e=>e<4?"short":e===4?"long":"narrow","alpha"),G=a(e=>e%2===0?"2-digit":"numeric","numeric");function Le(e,r){switch(e.char){case"y":return{year:G(e.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return r(`${e.desc} is not supported; falling back to year:numeric`,E.WARNING),{year:"numeric"}}}a(Le,"yearOptions");function ze(e,r){switch(e.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:r(`${e.desc} is not supported with width ${e.width}`);return}}a(ze,"monthStyle");function Ge(e,r){let{char:t,desc:s,width:i}=e;if(t==="d")return G(i);r(`${s} is not supported`)}a(Ge,"dayStyle");function Ke(e,r){let{char:t,desc:s,width:i}=e;if((t==="c"||t==="e")&&i<3){let l=`Numeric value is not supported for ${s}; falling back to weekday:short`;r(l,E.WARNING)}return ve(i)}a(Ke,"weekdayStyle");function He(e){let r=G(e.width),t;switch(e.char){case"h":t="h12";break;case"H":t="h23";break;case"k":t="h24";break;case"K":t="h11";break}return t?{hour:r,hourCycle:t}:{hour:r}}a(He,"hourOptions");function We(e,r){let{char:t,desc:s,width:i}=e;switch(t){case"v":case"z":return i===4?"long":"short";case"V":if(i===4)return"long";r(`${s} is not supported with width ${i}`);return;case"X":r(`${s} is not supported`);return}return"short"}a(We,"timeZoneNameStyle");function je(e,r){switch(e.field){case"era":return{era:ve(e.width)};case"year":return Le(e,r);case"month":return{month:ze(e,r)};case"day":return{day:Ge(e,r)};case"weekday":return{weekday:Ke(e,r)};case"period":return;case"hour":return He(e);case"min":return{minute:G(e.width)};case"sec":return{second:G(e.width)};case"tz":return{timeZoneName:We(e,r)};case"quarter":case"week":case"sec-frac":case"ms":r(`${e.desc} is not supported`)}}a(je,"compileOptions");function ne(e,r,t=s=>{throw s}){let s={timeZone:r},i=[];for(let l of e){let{error:c,field:h,str:v}=l;if(c){let k=new E(c.message,l);k.stack=c.stack,t(k)}if(v){let k=`Ignoring string part: ${v}`;t(new E(k,l,E.WARNING))}h&&(i.indexOf(h)===-1?i.push(h):t(new E(`Duplicate ${h} token`,l)));let S=je(l,(k,$)=>t(new E(k,l,$)));S&&Object.assign(s,S)}return s}a(ne,"getDateFormatOptions");var Ze={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},we=a(e=>e>="A"&&e<="Z"||e>="a"&&e<="z","isLetter");function Je(e,r){let t=e[r],s=1;for(;e[++r]===t;)++s;let i=Ze[t];if(!i){let l=`The letter ${t} is not a valid field identifier`;return{char:t,error:new Error(l),width:s}}return{char:t,field:i.field,desc:i.desc,width:s}}a(Je,"readFieldToken");function Ve(e,r){let t=e[++r],s=2;if(t==="'")return{char:"'",str:t,width:s};for(;;){let i=e[++r];if(++s,i===void 0){let l=`Unterminated quoted literal in pattern: ${t||e}`;return{char:"'",error:new Error(l),str:t,width:s}}else if(i==="'"){if(e[++r]!=="'")return{char:"'",str:t,width:s};++s}t+=i}}a(Ve,"readQuotedToken");function Ye(e,r){let t=e[r];if(!t)return null;if(we(t))return Je(e,r);if(t==="'")return Ve(e,r);let s=t,i=1;for(;;){let l=e[++r];if(!l||we(l)||l==="'")return{char:t,str:s,width:i};s+=l,i+=1}}a(Ye,"readToken");function Z(e){let r=[],t=0;for(;;){let s=Ye(e,t);if(!s)return r;r.push(s),t+=s.width}}a(Z,"parseDateTokens");function be(e,r){return e.filter(t=>t.type!=="content").length?e.map(t=>{if(t.type==="content")return r(t.value);if(t.type==="octothorpe")return"#";if(t.type==="argument")return[t.arg];if(t.type==="function"){let l=t?.param?.[0];if(t.key==="date"&&l){let c=Qe(l.value.trim(),h=>{throw new Error(`Unable to compile date expression: ${h.message}`)});return[t.arg,t.key,c]}return l?[t.arg,t.key,l.value.trim()]:[t.arg,t.key]}let s=t.pluralOffset,i={};return t.cases.forEach(({key:l,tokens:c})=>{let h=l[0]==="="?l.slice(1):l;i[h]=be(c,r)}),[t.arg,t.type,{offset:s,...i}]}):e.map(t=>r(t.value))}a(be,"processTokens");function Qe(e,r){if(/^::/.test(e)){let t=Z(e.substring(2));return ne(t,void 0,r)}return e}a(Qe,"compileDateExpression");function Xe(e,r=t=>t){return be((0,xe.parse)(e),r)}a(Xe,"compileMessageOrThrow");function _e(e,r=t=>t){try{return Xe(e,r)}catch(t){return console.error(`${t.message}
9
+
10
+ Message: ${e}`),[e]}}a(_e,"compileMessage");var B=a(e=>typeof e=="string","isString"),et=a(e=>typeof e=="function","isFunction"),ke=new Map,Te="en";function oe(e){return[...Array.isArray(e)?e:[e],Te]}a(oe,"normalizeLocales");function le(e,r,t){let s=oe(e);t||(t="default");let i;if(typeof t=="string")switch(i={day:"numeric",month:"short",year:"numeric"},t){case"full":i.weekday="long";case"long":i.month="long";break;case"short":i.month="numeric";break}else i=t;return J(()=>V("date",s,t),()=>new Intl.DateTimeFormat(s,i)).format(B(r)?new Date(r):r)}a(le,"date");function tt(e,r,t){let s;if(t||(t="default"),typeof t=="string")switch(s={second:"numeric",minute:"numeric",hour:"numeric"},t){case"full":case"long":s.timeZoneName="short";break;case"short":delete s.second}else s=t;return le(e,r,s)}a(tt,"time");function se(e,r,t){let s=oe(e);return J(()=>V("number",s,t),()=>new Intl.NumberFormat(s,t)).format(r)}a(se,"number");function Se(e,r,t,{offset:s=0,...i}){let l=oe(e),c=r?J(()=>V("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):J(()=>V("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return i[t]??i[c.select(t-s)]??i.other}a(Se,"plural");function J(e,r){let t=e(),s=ke.get(t);return s||(s=r(),ke.set(t,s)),s}a(J,"getMemoized");function V(e,r,t){let s=r.join("-");return`${e}-${s}-${JSON.stringify(t)}`}a(V,"cacheKey");var Ee=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Oe=a(e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(r,t,s)=>{if(t){let i=parseInt(t,16);return String.fromCharCode(i)}else{let i=parseInt(s,16);return String.fromCharCode(i)}}),"decodeEscapeSequences"),Ae="%__lingui_octothorpe__%",rt=a((e,r,t={})=>{let s=r||e,i=a(c=>typeof c=="object"?c:t[c],"style"),l=a((c,h)=>{let v=Object.keys(t).length?i("number"):void 0,S=se(s,c,v);return h.replace(new RegExp(Ae,"g"),S)},"replaceOctothorpe");return{plural:a((c,h)=>{let{offset:v=0}=h,S=Se(s,!1,c,h);return l(c-v,S)},"plural"),selectordinal:a((c,h)=>{let{offset:v=0}=h,S=Se(s,!0,c,h);return l(c-v,S)},"selectordinal"),select:nt,number:a((c,h)=>se(s,c,i(h)||{style:h}),"number"),date:a((c,h)=>le(s,c,i(h)||h),"date"),time:a((c,h)=>tt(s,c,i(h)||h),"time")}},"getDefaultFormats"),nt=a((e,r)=>r[e]??r.other,"selectFormatter");function st(e,r,t){return(s={},i)=>{let l=rt(r,t,i),c=a((v,S=!1)=>Array.isArray(v)?v.reduce((k,$)=>{if($==="#"&&S)return k+Ae;if(B($))return k+$;let[K,O,M]=$,D={};O==="plural"||O==="selectordinal"||O==="select"?Object.entries(M).forEach(([F,Q])=>{D[F]=c(Q,O==="plural"||O==="selectordinal")}):D=M;let N;if(O){let F=l[O];N=F(s[K],D)}else N=s[K];return N==null?k:k+N},""):v,"formatMessage"),h=c(e);return B(h)&&Ee.test(h)?Oe(h):B(h)?h:h?String(h):""}}a(st,"interpolate");var ie=class{static{a(this,"EventEmitter")}_events={};on(r,t){return this._events[r]??=new Set,this._events[r].add(t),()=>this.removeListener(r,t)}removeListener(r,t){let s=this._events[r];s?.delete(t),s?.size===0&&delete this._events[r]}emit(r,...t){let s=this._events[r];if(s)for(let i of[...s])i.apply(this,t)}},ae=class extends ie{static{a(this,"I18n")}_locale="";_locales;_messages={};_missing;_messageCompiler;constructor(r){super(),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),(typeof r.locale=="string"||r.locales)&&this.activate(r.locale??Te,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}setMessagesCompiler(r){return this._messageCompiler=r,this}_load(r,t){let s=this._messages[r];s?Object.assign(s,t):this._messages[r]=t}load(r,t){typeof r=="string"&&typeof t=="object"?this._load(r,t):Object.entries(r).forEach(([s,i])=>this._load(s,i)),this.emit("change")}loadAndActivate({locale:r,locales:t,messages:s}){this._locale=r,this._locales=t||void 0,this._messages[this._locale]=s,this.emit("change")}activate(r,t){this._locale=r,this._locales=t,this.emit("change")}_(r,t,s){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let i=s?.message;r||(r=""),B(r)||(t=r.values||t,i=r.message,r=r.id);let l=this.messages[r],c=l===void 0,h=this._missing;if(h&&c)return et(h)?h(this._locale,r):h;c&&this.emit("missing",{id:r,locale:this._locale});let v=l||i||r;return B(v)&&(this._messageCompiler?v=this._messageCompiler(v):console.warn(`Uncompiled message detected! Message:
11
+
12
+ > ${v}
13
+
14
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
15
+ ICU features such as interpolation and plurals will not work properly for that message.
16
+
17
+ Please compile your catalog first.
18
+ `)),B(v)&&Ee.test(v)?Oe(v):B(v)?v:st(v,this._locale,this._locales)(t,s?.formats)}t=this._.bind(this);date(r,t){return le(this._locales||this._locale,r,t)}number(r,t){return se(this._locales||this._locale,r,t)}};function ce(e={}){return new ae(e)}a(ce,"setupI18n");var Nt=ce();var Y=fe(Pe(),1);var it={},$e="en",at={en:it},ot=a((e=$e,r=at)=>{let t=ce();t.setMessagesCompiler(_e);for(let[s,i]of Object.entries(r))t.load(s,i);return t.activate(r[e]===void 0?$e:e),t},"d"),lt=ot(),ct=(0,Y.createContext)(lt),Lt=a(()=>{let e=(0,Y.use)(ct);return(r,t)=>e._(r,t)},"T");var Kt=a((e,r,t,s,i)=>{switch(r){case"action":return e.action(t,s,i);case"mutation":return e.mutation(t,s,i);default:return e.query(t,s,i)}},"a"),Ht=a(e=>({__lunoraRef:e}),"f"),Wt=a(e=>{let r=e.trim();return r===""?{}:{shardKey:r}},"u"),jt=a(e=>e instanceof Error?e.message:String(e),"d"),Zt=a(e=>{if(e===null||typeof e!="object"||!("code"in e))return;let{code:r}=e;return typeof r=="string"?r:void 0},"l"),Jt=a(e=>{if(e===null||typeof e!="object"||!("hint"in e))return;let{hint:r}=e;return typeof r=="string"?r:Array.isArray(r)?r.filter(t=>typeof t=="string").join(`
19
+ `):void 0},"g"),Vt=a(e=>{if(e===null||typeof e!="object"||!("docsUrl"in e))return;let r=e.docsUrl;if(typeof r=="string")try{let{protocol:t}=new URL(r);return t==="http:"||t==="https:"?r:void 0}catch{return}},"y"),ut=a(e=>{if(e==null)return"\u2014";if(e<1024)return`${e.toString()} B`;let r=["KB","MB","GB","TB"],t=e/1024,s=0;for(;t>=1024&&s<r.length-1;)t/=1024,s+=1;return`${t.toFixed(1)} ${r[s]??"TB"}`},"s"),ft=a(e=>{if(e==null)return"";switch(typeof e){case"bigint":case"boolean":case"number":return e.toString();case"string":return e;case"symbol":return e.toString();default:return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?`<bytes: ${ut(e.byteLength)}>`:JSON.stringify(e)}},"e"),Yt=a((e,r)=>typeof r=="bigint"||r instanceof ArrayBuffer||ArrayBuffer.isView(r)?ft(r):r,"h"),dt=a((e,r)=>{e.catch(t=>{})},"c"),Qt=a(e=>{if(e!==void 0&&e!=="")return e;let r=globalThis.location;return r?.origin!==void 0&&r.origin!==""?r.origin:"http://localhost:5173"},"m"),Xt=a(e=>{let r="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return r===void 0?!1:(dt(r.writeText(e)),!0)},"p"),er=a((e,r="")=>{if(e==null||e==="")return r;let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString()},"b");export{ot as a,lt as b,ct as c,Lt as d,Kt as e,Ht as f,Wt as g,jt as h,Zt as i,Jt as j,Vt as k,ut as l,ft as m,Yt as n,dt as o,Qt as p,Xt as q,er as r};
@@ -0,0 +1 @@
1
+ import{a as M,c as O,e as S,i as E}from"./chunk-XQS7KSHL.js";import{a as I,b as B,c as U}from"./chunk-7PIHTTND.js";import{a as s,d as k,e as w}from"./chunk-R5ZTCHCE.js";var f=k(w(),1);var g=k(w(),1);var z=g.createContext(void 0);function W(o=!1){let t=g.useContext(z);if(t===void 0&&!o)throw new Error(U(16));return t}s(W,"useCompositeRootContext");var H=k(w(),1);function A(o){let{focusableWhenDisabled:t,disabled:r,composite:l=!1,tabIndex:n=0,isNativeButton:u}=o,d=l&&t!==!1,b=l&&t===!1;return{props:H.useMemo(()=>{let a={onKeyDown(p){r&&t&&p.key!=="Tab"&&p.preventDefault()}};return l||(a.tabIndex=n,!u&&r&&(a.tabIndex=t?n:-1)),(u&&(t||d)||!u&&r)&&(a["aria-disabled"]=r),u&&(!t||b)&&(a.disabled=r),a},[l,r,t,d,b,u,n])}}s(A,"useFocusableWhenDisabled");function h(o,t,{detail:r=0}={}){o.dispatchEvent(new(S(o)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}s(h,"dispatchClickWithModifiers");function le(o={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:l=0,native:n=!0,composite:u}=o,d=f.useRef(null),b=W(!0),i=u??b!==void 0,{props:a}=A({focusableWhenDisabled:r,disabled:t,composite:i,tabIndex:l,isNativeButton:n}),p=f.useCallback(()=>{let c=d.current;K(c)&&i&&t&&a.disabled===void 0&&c.disabled&&(c.disabled=!1)},[t,a.disabled,i]);M(p,[p]);let F=f.useCallback((c={})=>{let{onClick:x,onMouseDown:C,onKeyUp:V,onKeyDown:_,onPointerDown:$,...v}=c;return I({onClick(e){if(t){e.preventDefault();return}x?.(e)},onMouseDown(e){t||C?.(e)},onKeyDown(e){if(t||(B(e),_?.(e),e.baseUIHandlerPrevented))return;let R=e.target===e.currentTarget,m=e.currentTarget,P=K(m),N=!n&&G(m),j=R&&(n?P:!N),T=e.key==="Enter",y=e.key===" ",D=m.getAttribute("role"),q=D?.startsWith("menuitem")||D==="option"||D==="gridcell";if(R&&i&&y){if(e.defaultPrevented&&q)return;e.preventDefault(),(!n||P)&&(e.preventBaseUIHandler(),h(m,e));return}if(!j||n||!y&&!T){R&&N&&y&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),T&&(e.preventBaseUIHandler(),h(m,e)))},onKeyUp(e){if(!t){if(B(e),V?.(e),e.target===e.currentTarget&&n&&i&&K(e.currentTarget)&&e.key===" "){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!n&&!i&&!e.defaultPrevented&&e.key===" "&&(e.preventBaseUIHandler(),h(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}$?.(e)}},n?{type:"button"}:{role:"button"},a,v)},[t,a,i,n]),L=O(c=>{d.current=c,p()});return{getButtonProps:F,buttonRef:L}}s(le,"useButton");function K(o){return E(o)&&o.tagName==="BUTTON"}s(K,"isButtonElement");function G(o){return E(o)&&o.tagName==="A"&&!!o.href}s(G,"isValidLinkElement");export{W as a,h as b,le as c};
@@ -0,0 +1 @@
1
+ import{a as c}from"./chunk-2SFSTQS4.js";import{e}from"./chunk-4YTSKL4R.js";import{o as m}from"./chunk-6ZPTNC34.js";import{a as s,d as p,f as n}from"./chunk-R5ZTCHCE.js";var f=p(n(),1);var h=s(r=>{let t=(0,f.c)(3),a=e(),o;return t[0]!==a||t[1]!==r?(o=s(i=>{c({shardKey:r,traceId:i}),m(a({to:"/traces"}))},"e"),t[0]=a,t[1]=r,t[2]=o):o=t[2],o},"u");export{h as a};
@@ -0,0 +1 @@
1
+ import{b as C}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as J}from"./chunk-Y2YQITGI.js";import"./chunk-PZ4QDWTI.js";import"./chunk-VLW547U6.js";import"./chunk-F7JOSNAT.js";import{a as H}from"./chunk-DZGOHOOE.js";import{c as z}from"./chunk-PSPJORP6.js";import"./chunk-OEGE3YDK.js";import"./chunk-RCZTUWG3.js";import{a as E}from"./chunk-UANVABQG.js";import{a as G,b as M,c as U,d as P,e as d,f as c}from"./chunk-L4EZAHCD.js";import{a as D,e as _}from"./chunk-IYWVSMAY.js";import{d as q}from"./chunk-6ZPTNC34.js";import"./chunk-FDLSPDIC.js";import{a as S,d as O,f as Q,g as V}from"./chunk-R5ZTCHCE.js";var L=O(Q(),1);var r=O(V(),1);var K=["read","insert","update","delete"],B=S((e,s)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[s],"z"),W=S(e=>{let s=new Map;for(let a of e){let t=s.get(a.table)??{operations:new Set,procedures:new Set,table:a.table};t.operations.add(a.on),t.procedures.add(a.procedure),s.set(a.table,t)}return[...s.values()].toSorted((a,t)=>a.table.localeCompare(t.table))},"J"),ie=S(()=>{let e=(0,L.c)(49),s=q(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:t,error:R,errorSource:k}=z(H.rlsPolicies,a),p=t!==void 0,m,n,h,l,f,u,x,b,o;if(e[1]!==t||e[2]!==R||e[3]!==k||e[4]!==p||e[5]!==s){let $=W(Array.isArray(t?.policies)?t.policies:[]),j;e[15]!==t?(j=Array.isArray(t?.roles)?t.roles:[],e[15]=t,e[16]=j):j=e[16],n=j,x="flex flex-col gap-6",b="lunora-rls-panel",e[17]!==R||e[18]!==k?(o=R!==null&&(0,r.jsx)(J,{error:k,testId:"rls-error"}),e[17]=R,e[18]=k,e[19]=o):o=e[19],u="flex flex-col gap-2",m=D,h="overflow-hidden py-0";let I;e[20]!==s?(I=s("Policies"),e[20]=s,e[21]=I):I=e[21],e[22]!==I?(l=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:I})}),e[22]=I,e[23]=l):l=e[23],f=p&&$.length===0?(0,r.jsx)(E,{description:s("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),testId:"rls-policies-empty",title:s("No policies defined")}):(0,r.jsx)(_,{className:"px-0",children:(0,r.jsxs)(G,{"data-testid":"rls-policies-table",children:[(0,r.jsx)(M,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(d,{children:s("Table")}),K.map(i=>(0,r.jsx)(d,{children:B(s,i)},i)),(0,r.jsx)(d,{children:s("Guarded by")})]})}),(0,r.jsx)(U,{children:$.map(i=>(0,r.jsxs)(P,{"data-testid":`rls-table-${i.table}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:i.table}),K.map(F=>(0,r.jsx)(c,{children:i.operations.has(F)?(0,r.jsx)(C,{variant:"secondary",children:s("Guarded")}):(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"})},F)),(0,r.jsx)(c,{className:"font-mono text-xs text-muted-foreground",children:[...i.procedures].join(", ")})]},i.table))})]})}),e[1]=t,e[2]=R,e[3]=k,e[4]=p,e[5]=s,e[6]=m,e[7]=n,e[8]=h,e[9]=l,e[10]=f,e[11]=u,e[12]=x,e[13]=b,e[14]=o}else m=e[6],n=e[7],h=e[8],l=e[9],f=e[10],u=e[11],x=e[12],b=e[13],o=e[14];let N;e[24]!==m||e[25]!==h||e[26]!==l||e[27]!==f?(N=(0,r.jsxs)(m,{className:h,children:[l,f]}),e[24]=m,e[25]=h,e[26]=l,e[27]=f,e[28]=N):N=e[28];let g;e[29]!==u||e[30]!==N?(g=(0,r.jsx)("section",{className:u,children:N}),e[29]=u,e[30]=N,e[31]=g):g=e[31];let y;e[32]!==s?(y=s("Roles"),e[32]=s,e[33]=y):y=e[33];let w;e[34]!==y?(w=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y})}),e[34]=y,e[35]=w):w=e[35];let v;e[36]!==p||e[37]!==n||e[38]!==s?(v=p&&n.length===0?(0,r.jsx)(E,{description:s("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),testId:"rls-roles-empty",title:s("No roles defined")}):(0,r.jsx)(_,{className:"px-0",children:(0,r.jsxs)(G,{"data-testid":"rls-roles-table",children:[(0,r.jsx)(M,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(d,{children:s("Role")}),(0,r.jsx)(d,{children:s("Description")}),(0,r.jsx)(d,{children:s("Permissions")})]})}),(0,r.jsx)(U,{children:n.map(Y)})]})}),e[36]=p,e[37]=n,e[38]=s,e[39]=v):v=e[39];let A;e[40]!==w||e[41]!==v?(A=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[w,v]})}),e[40]=w,e[41]=v,e[42]=A):A=e[42];let T;return e[43]!==A||e[44]!==x||e[45]!==b||e[46]!==o||e[47]!==g?(T=(0,r.jsxs)("div",{className:x,"data-testid":b,children:[o,g,A]}),e[43]=A,e[44]=x,e[45]=b,e[46]=o,e[47]=g,e[48]=T):T=e[48],T},"oe");function X(e){return(0,r.jsx)(C,{variant:"outline",children:e},e)}S(X,"K");function Y(e){return(0,r.jsxs)(P,{"data-testid":`rls-role-${e.name}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:e.name}),(0,r.jsx)(c,{className:"text-muted-foreground",children:e.description??""}),(0,r.jsx)(c,{children:e.permissions.length===0?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,r.jsx)("span",{className:"flex flex-wrap gap-1",children:e.permissions.map(X)})})]},e.name)}S(Y,"V");export{ie as default};
@@ -0,0 +1 @@
1
+ import{a as r,d as p,e as m}from"./chunk-R5ZTCHCE.js";function d(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}r(d,"mergeObjects");var y={};function R(e,t,n,o,i){if(!n&&!o&&!i&&!e)return h(t);let c=h(e);return t&&(c=E(c,t)),n&&(c=E(c,n)),o&&(c=E(c,o)),i&&(c=E(c,i)),c}r(R,"mergeProps");function x(e){if(e.length===0)return y;if(e.length===1)return h(e[0]);let t=h(e[0]);for(let n=1;n<e.length;n+=1)t=E(t,e[n]);return t}r(x,"mergePropsN");function h(e){return b(e)?{...T(e,y)}:J(e)}r(h,"createInitialMergedProps");function E(e,t){return b(t)?T(t,e):q(e,t)}r(E,"mergeInto");function J(e){let t={...e};for(let n in t){let o=t[n];O(n,o)&&(t[n]=k(o))}return t}r(J,"copyInitialProps");function q(e,t){if(!t)return e;for(let n in t){let o=t[n];switch(n){case"style":{e[n]=d(e.style,o);break}case"className":{e[n]=g(e.className,o);break}default:O(n,o)?e[n]=K(e[n],o):e[n]=o}}return e}r(q,"mutablyMergeInto");function O(e,t){let n=e.charCodeAt(0),o=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&o===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}r(O,"isEventHandler");function b(e){return typeof e=="function"}r(b,"isPropsGetter");function T(e,t){return b(e)?e(t):e??y}r(T,"resolvePropsGetter");function K(e,t){return t?e?(...n)=>{let o=n[0];if(_(o)){let c=o;M(c);let s=t(...n);return c.baseUIHandlerPrevented||e?.(...n),s}let i=t(...n);return e?.(...n),i}:k(t):e}r(K,"mergeEventHandlers");function k(e){return e&&((...t)=>{let n=t[0];return _(n)&&M(n),e(...t)})}r(k,"wrapEventHandler");function M(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}r(M,"makeEventPreventable");function g(e,t){return t?e?t+" "+e:t:e}r(g,"mergeClassNames");function _(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}r(_,"isSyntheticEvent");function Q(e,t){return r(function(o,...i){let c=new URL(e);return c.searchParams.set("code",o.toString()),i.forEach(s=>c.searchParams.append("args[]",s)),`${t} error #${o}; visit ${c} for the full message.`},"formatErrorMessage")}r(Q,"createFormatErrorMessage");var X=Q("https://base-ui.com/production-error","Base UI"),L=X;var f=p(m(),1);var U=p(m(),1);var j={};function v(e,t){let n=U.useRef(j);return n.current===j&&(n.current=e(t)),n}r(v,"useRefWithInit");function A(e,t,n,o){let i=v(S).current;return ee(i,e,t,n,o)&&$(i,[e,t,n,o]),i.callback}r(A,"useMergedRefs");function V(e){let t=v(S).current;return te(t,e)&&$(t,e),t.callback}r(V,"useMergedRefsN");function S(){return{callback:null,cleanup:null,refs:[]}}r(S,"createForkRef");function ee(e,t,n,o,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==i}r(ee,"didChange");function te(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}r(te,"didChangeN");function $(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){let o=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){let c=t[i];if(c!=null)switch(typeof c){case"function":{let s=c(n);typeof s=="function"&&(o[i]=s);break}case"object":{c.current=n;break}default:}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){let c=t[i];if(c!=null)switch(typeof c){case"function":{let s=o[i];typeof s=="function"?s():c(null);break}case"object":{c.current=null;break}default:}}}}}}r($,"update");var z=p(m(),1);var B=p(m(),1);var ne=parseInt(B.version,10);function Y(e){return ne>=e}r(Y,"isReactVersionAtLeast");function N(e){if(!z.isValidElement(e))return null;let t=e,n=t.props;return(Y(19)?n?.ref:t.ref)??null}r(N,"getReactElementRef");function Ie(){}r(Ie,"NOOP");var we=Object.freeze([]),l=Object.freeze({});function D(e,t){let n={};for(let o in e){let i=e[o];if(t?.hasOwnProperty(o)){let c=t[o](i);c!=null&&Object.assign(n,c);continue}i===!0?n[`data-${o.toLowerCase()}`]="":i&&(n[`data-${o.toLowerCase()}`]=i.toString())}return n}r(D,"getStateAttributesProps");function F(e,t){return typeof e=="function"?e(t):e}r(F,"resolveClassName");function W(e,t){return typeof e=="function"?e(t):e}r(W,"resolveStyle");var P=p(m(),1);function Fe(e,t,n={}){let o=t.render,i=re(t,n);if(n.enabled===!1)return null;let c=n.state??l;return ce(e,o,i,c)}r(Fe,"useRenderElement");function re(e,t={}){let{className:n,style:o,render:i}=e,{state:c=l,ref:s,props:I,stateAttributesMapping:Z,enabled:a=!0}=t,w=a?F(n,c):void 0,C=a?W(o,c):void 0,G=a?D(c,Z):l,H=a&&I?oe(I):void 0,u=a?d(G,H)??{}:l;return typeof document<"u"&&(a?Array.isArray(s)?u.ref=V([u.ref,N(i),...s]):u.ref=A(u.ref,N(i),s):A(null,null)),a?(w!==void 0&&(u.className=g(u.className,w)),C!==void 0&&(u.style=d(u.style,C)),u):l}r(re,"useRenderElementProps");function oe(e){return Array.isArray(e)?x(e):R(void 0,e)}r(oe,"resolveRenderFunctionProps");var ie=Symbol.for("react.lazy");function ce(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);let i=R(n,t.props);i.ref=n.ref;let c=t;return c?.$$typeof===ie&&(c=f.Children.toArray(t)[0]),f.cloneElement(c,i)}if(e&&typeof e=="string")return se(e,n);throw new Error(L(8))}r(ce,"evaluateRenderProp");function se(e,t){return e==="button"?(0,P.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,P.createElement)("img",{alt:"",...t,key:t.key}):f.createElement(e,t)}r(se,"renderTag");export{R as a,M as b,L as c,v as d,A as e,Y as f,Ie as g,we as h,l as i,Fe as j};
@@ -0,0 +1 @@
1
+ import{a as d,d as n,f as c,g as p}from"./chunk-R5ZTCHCE.js";var b=n(c(),1),s=n(p(),1);var y={alignItems:"center",border:"1px solid",borderRadius:4,display:"inline-flex",fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:11,fontWeight:400,gap:6,letterSpacing:"0.06em",lineHeight:1.4,padding:"1px 8px",textTransform:"uppercase"},g={borderRadius:"50%",display:"inline-block",height:7,width:7},h=d((l,e,t,a)=>({badgeStyle:{...y,borderColor:l,color:l},color:l,dotStyle:{...g,backgroundColor:l},hint:a,label:e,title:t}),"i"),S={global:h("var(--royal-amethyst)","Global \xB7 D1","Global table \u2014 a single D1 table shared across all shards","Declared .global() and stored once in Cloudflare D1, shared across every shard and tenant. Auth tables (user, session, \u2026) live here too."),shard:h("var(--sky-sapphire)","Shard-local","Shard-local table \u2014 per-shard SQLite inside a Durable Object","Stored per shard key in a Durable Object's SQLite (.shardBy(...)). You are viewing one shard at a time \u2014 change the shard key to inspect another.")},m=d(l=>{let e=(0,b.c)(9),{tier:t}=l,a=S[t],i=`storage-tier-${t}`,r;e[0]!==a.dotStyle?(r=(0,s.jsx)("span",{"aria-hidden":"true",style:a.dotStyle}),e[0]=a.dotStyle,e[1]=r):r=e[1];let o;return e[2]!==a.badgeStyle||e[3]!==a.label||e[4]!==a.title||e[5]!==i||e[6]!==r||e[7]!==t?(o=(0,s.jsxs)("span",{"data-testid":i,"data-tier":t,style:a.badgeStyle,title:a.title,children:[r,a.label]}),e[2]=a.badgeStyle,e[3]=a.label,e[4]=a.title,e[5]=i,e[6]=r,e[7]=t,e[8]=o):o=e[8],o},"y");export{S as a,m as b};
@@ -0,0 +1 @@
1
+ import{a as n,d as E,e as S,g as m}from"./chunk-R5ZTCHCE.js";function u(t,e=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,r))}n(u,"clamp");var p=1;function x(t,e){return Math.max(0,t-e)}n(x,"getMaxScrollOffset");function A(t,e){if(e<=0)return 0;let r=u(t,0,e),l=r,c=e-r,a=l<=p,i=c<=p;return a&&i?l<=c?0:e:a?0:i?e:r}n(A,"normalizeScrollOffset");var f=E(m(),1),o="base-ui-disable-scrollbar",R={className:o,getElement(t){return(0,f.jsx)("style",{nonce:t,href:o,precedence:"base-ui:low",children:`.${o}{scrollbar-width:none}.${o}::-webkit-scrollbar{display:none}`})}};var s=E(S(),1);var b=s.createContext(void 0),C={disableStyleElements:!1};function y(){return s.useContext(b)??C}n(y,"useCSPContext");export{u as a,p as b,x as c,A as d,R as e,y as f};
@@ -0,0 +1,2 @@
1
+ import{a as mr}from"./chunk-TFMQSCGC.js";import{a as D,b as ht,c as A,h as Ee,i as Ie,j as vt,w as ye}from"./chunk-XQS7KSHL.js";import{a as Rt,c as Ce,d as W,g as L,h as xt,i as de,j as q}from"./chunk-7PIHTTND.js";import{a as r,c as oe,d as g,e as S,f as pr,g as ne,i as gt}from"./chunk-R5ZTCHCE.js";var lr=g(pr(),1);var sr=g(S(),1);var We={};oe(We,{Control:()=>rr,Description:()=>Qt,Error:()=>Jt,Item:()=>ir,Label:()=>$t,Root:()=>Bt,Validity:()=>nr});var _=g(S(),1);var Fe=g(S(),1);var ee={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},br={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ct={disabled:!1,...br},Y={valid(e){return e===null?null:e?{"data-valid":""}:{"data-invalid":""}}};var gr={invalid:void 0,name:void 0,validityData:{state:ee,errors:[],error:"",value:"",initialValue:null},setValidityData:L,disabled:void 0,setTouched:L,setDirty:L,setFilled:L,setFocused:L,validationMode:"onSubmit",shouldValidateOnChange:r(()=>!1,"shouldValidateOnChange"),state:Ct,registerFieldControl:L,validation:{getValidationProps:r((e,t=de)=>t,"getValidationProps"),inputRef:{current:null},registeredInputs:new Map,registerInput:L,getInputControl:r(()=>null,"getInputControl"),commit:r(async()=>{},"commit"),change:L}},Ke=Fe.createContext(gr);function B(e=!0){let t=Fe.useContext(Ke);if(t.setValidityData===L&&!e)throw new Error(Ce(28));return t}r(B,"useFieldRootContext");var Ae=g(S(),1);var Rr=Ae.createContext(void 0);function Et(e=!1){let t=Ae.useContext(Rr);if(!t&&!e)throw new Error(Ce(86));return t}r(Et,"useFieldsetRootContext");var De=g(S(),1);var xr=De.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:L,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function J(){return De.useContext(xr)}r(J,"useFormContext");var te=g(S(),1);var Te=g(S(),1);var It=0;function hr(e,t="mui"){let[o,n]=Te.useState(e),i=e||o;return Te.useEffect(()=>{o==null&&(It+=1,n(`${t}-${It}`))},[o,t]),i}r(hr,"useGlobalId");var yt=ht.useId;function Ft(e,t){if(yt!==void 0){let o=yt();return e??(t?`${t}-${o}`:o)}return hr(e,t)}r(Ft,"useId");function X(e){return Ft(e,"base-ui")}r(X,"useBaseUiId");var Se=g(S(),1);var ze=Se.createContext({controlId:void 0,registerControlId:L,labelId:void 0,setLabelId:L,messageIds:[],setMessageIds:L,getDescriptionProps:r(e=>e,"getDescriptionProps")});function P(){return Se.useContext(ze)}r(P,"useLabelableContext");var At=g(ne(),1);var Ve=r(function(t){let o=X(),n=t.controlId===void 0?o:t.controlId,[i,s]=te.useState(n),[a,u]=te.useState(t.labelId),[d,l]=te.useState([]),f=W(()=>new Map),{messageIds:m}=P(),R=A((E,I)=>{let V=f.current;if(I===void 0){V.delete(E);return}V.set(E,I),s(F=>{if(V.size===0)return;let k;for(let c of V.values()){if(F!==void 0&&c===F)return F;k===void 0&&(k=c)}return k})}),p=te.useCallback(E=>{let I=E["aria-describedby"]?E["aria-describedby"].split(" "):[];return I.push(...m,...d),{...E,"aria-describedby":Array.from(new Set(I)).join(" ")||void 0}},[m,d]),x=te.useMemo(()=>({controlId:i,registerControlId:R,labelId:a,setLabelId:u,messageIds:d,setMessageIds:l,getDescriptionProps:p}),[i,R,a,u,d,l,p]);return(0,At.jsx)(ze.Provider,{value:x,children:t.children})},"LabelableProvider");var be=g(S(),1);function Dt(e={}){let{id:t,implicit:o=!1,controlRef:n}=e,{controlId:i,registerControlId:s}=P(),a=X(t),u=o?i:void 0,d=W(()=>Symbol()),l=be.useRef(!1),f=be.useRef(t!=null),m=A(()=>{!l.current||s===L||(l.current=!1,s(d.current,void 0))});return D(()=>{if(s===L)return;let R;if(o){let p=n?.current;Ee(p)&&p.closest("label")!=null?R=t??null:R=u??a}else if(t!=null)f.current=!0,R=t;else if(f.current)R=a;else{m();return}if(R===void 0){m();return}l.current=!0,s(d.current,R)},[t,n,u,s,o,a,d,m]),be.useEffect(()=>m,[m]),i??a}r(Dt,"useLabelableId");var Ne={};oe(Ne,{engine:()=>Qe,env:()=>et,os:()=>Je,screenReader:()=>Ze});var Je={};oe(Je,{android:()=>Vt,apple:()=>Ge,ios:()=>He,linux:()=>yr,mac:()=>Nt,windows:()=>Ir});function vr(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}r(vr,"readRawData");var{userAgent:Cr,platform:Er,maxTouchPoints:Tt}=vr(),ie=Cr.toLowerCase(),se=Er.toLowerCase();var He=/^i(os$|p)/.test(se)||se==="macintel"&&Tt>1,St="android",Vt=se===St||ie.includes(St),Nt=!He&&se.startsWith("mac"),Ir=se.startsWith("win"),yr=!Vt&&/^(linux|chrome os)/.test(se),Ge=Nt||He;var Qe={};oe(Qe,{blink:()=>Ar,gecko:()=>Fr,webkit:()=>Xe});var Xe=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),Fr=!Xe&&ie.includes("firefox"),Ar=!Xe&&ie.includes("chrom");var Ze={};oe(Ze,{voiceOver:()=>Dr});var Dr=Ge;var et={};oe(et,{jsdom:()=>Tr});var Tr=/jsdom|happydom/.test(ie);var tt="data-base-ui-focusable";var rt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",dn="ArrowLeft",fn="ArrowRight",mn="ArrowUp",pn="ArrowDown";function ot(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}r(ot,"activeElement");function Lt(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&vt(o)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}r(Lt,"contains");function nt(e){return"composedPath"in e?e.composedPath()[0]:e.target}r(nt,"getTarget");function In(e,t){if(!Ee(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute("data-trigger-disabled");for(let[,n]of t.entries())if(Lt(n,o))return!n.hasAttribute("data-trigger-disabled");return!1}r(In,"isTargetInsideEnabledTrigger");function yn(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}r(yn,"isEventTargetWithin");function Fn(e){return e.matches("html,body")}r(Fn,"isRootElement");function Sr(e){return Ie(e)&&e.matches(rt)}r(Sr,"isTypeableElement");function An(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${rt}`)!=null}r(An,"isInteractiveElement");function Dn(e){return e?e.getAttribute("role")==="combobox"&&Sr(e):!1}r(Dn,"isTypeableCombobox");function Tn(e){if(!e||Ne.env.jsdom)return!0;try{return e.matches(":focus-visible")}catch{return!0}}r(Tn,"matchesFocusVisible");function Sn(e){return e?e.hasAttribute(tt)?e:e.querySelector(`[${tt}]`)||e:null}r(Sn,"getFloatingFocusElement");function wt(e,t){let o=X(e);return D(()=>(t(o),()=>{t(n=>n===o?void 0:n)}),[o,t]),o}r(wt,"useRegisteredLabelId");function _t(e={}){let{id:t,fallbackControlId:o,native:n=!1,setLabelId:i,focusControl:s}=e,{controlId:a,setLabelId:u}=P(),d=A(p=>{u(p),i?.(p)}),l=wt(t,d),f=a??o;function m(p){if(s){s(p,f);return}if(!f)return;let x=ye(p.currentTarget).getElementById(f);Ie(x)&&Vr(x)}r(m,"focusControl");function R(p){nt(p.nativeEvent)?.closest("button,input,select,textarea")||(!p.defaultPrevented&&p.detail>1&&p.preventDefault(),!n&&m(p))}return r(R,"handleInteraction"),n?{id:l,htmlFor:f??void 0,onMouseDown:R}:{id:l,onClick:R,onPointerDown(p){p.preventDefault()}}}r(_t,"useLabel");function Vr(e){e.focus({focusVisible:!0})}r(Vr,"focusElementWithVisible");var re=g(S(),1);var Mt=g(S(),1);function Le(e){Mt.useEffect(e,xt)}r(Le,"useOnMount");var ge=0,it=class e{static{r(this,"Timeout")}static create(){return new e}currentId=ge;start(t,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ge,o()},t)}isStarted(){return this.currentId!==ge}clear=r(()=>{this.currentId!==ge&&(clearTimeout(this.currentId),this.currentId=ge)},"clear");disposeEffect=r(()=>this.clear,"disposeEffect")};function Ot(){let e=W(it.create).current;return Le(e.disposeEffect),e}r(Ot,"useTimeout");function ae(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}r(ae,"getCombinedFieldValidityData");var st=Object.keys(ee);function Nr(e,t){return e.matches(":disabled")?!1:!t||e.form===t?!0:e.form===null&&!e.hasAttribute("form")}r(Nr,"isEligibleInput");function Pt(e,t){let o=null;for(let n of e.keys())if(Nr(n,t)){if(!n.validity.valid)return n;o??=n}return o}r(Pt,"findRepresentativeInput");function kt(e,t){for(let o of t.keys())o.setCustomValidity("");e?.setCustomValidity("")}r(kt,"clearCustomValidity");function Ut(e){let{elementRef:t,formRef:o}=J(),{setValidityData:n,validate:i,validityData:s,validationDebounceTime:a,invalid:u,markedDirtyRef:d,state:l,shouldValidateOnChange:f,registeredFieldIdRef:m}=e,{controlId:R,getDescriptionProps:p}=P(),x=Ot(),E=re.useRef(null),I=W(()=>new Map).current,V=re.useRef(0),F=re.useCallback((h,j)=>(I.set(h,j),()=>{I.delete(h)}),[I]),k=A(()=>{let h=Pt(I,t.current);return h&&I.get(h)?.controlRef.current||null}),c=A(async(h,j=!1)=>{V.current+=1;let z=V.current;function H(b,v=u){let U=m.current??R;if(U==null)return;let w=o.current.fields.get(U);if(!w)return;let Z=ae(b,v);o.current.fields.set(U,{...w,validityData:Z})}r(H,"updateRegisteredFieldValidity");function O(b,v){let U={value:h,state:{...ee,valid:!0},error:"",errors:[],initialValue:s.initialValue};kt(b,I),H(U,v),n(U)}r(O,"publishAllValid");let y=I.size>0?Pt(I,t.current):E.current;if(j){if(l.valid!==!1||!y)return;let b=y.validity;if(!b.valueMissing){O(y,!1);return}for(let v of st)if(v!=="valid"&&v!=="valueMissing"&&v!=="customError"&&b[v])return}function G(b){let v=st.reduce((w,Z)=>(w[Z]=b.validity[Z],w),{}),U=!1;for(let w of st)if(w!=="valid"){if(w==="valueMissing"&&v[w])U=!0;else if(v[w])return v}return U&&!d.current&&(v.valid=!0,v.valueMissing=!1),v}r(G,"getState"),x.clear();let T=null,$=[],N=y?G(y):{...ee,valid:!0},K,ue=f();if(y&&y.validationMessage&&!ue)K=y.validationMessage,$=[y.validationMessage];else{let b=Array.from(o.current.fields.values()).reduce((U,w)=>(w.name&&(U[w.name]=w.getValue()),U),{}),v=i(h,b);if(typeof v=="object"&&v!==null&&"then"in v){if(T=await v,z!==V.current)return}else T=v;T!==null?(N.valid=!1,N.customError=!0,Array.isArray(T)?($=T,y?.setCustomValidity(T.join(`
2
+ `))):T&&($=[T],y?.setCustomValidity(T))):ue&&(kt(y,I),N.customError=!1,y&&y.validationMessage?(K=y.validationMessage,$=[y.validationMessage]):(!y||y.validity.valid)&&!N.valid&&(N.valid=!0))}let fe={value:h,state:N,error:K??(Array.isArray(T)?T[0]:T??""),errors:$,initialValue:s.initialValue};H(fe),n(fe)}),C=A(h=>{x.clear();let j=f();j&&h!==""&&a?(V.current+=1,x.start(a,()=>{c(h)})):c(h,!j)}),M=re.useCallback((h,j={})=>Rt(p(j),l.valid===!1&&!l.disabled&&!h?{"aria-invalid":!0}:de),[p,l.disabled,l.valid]);return re.useMemo(()=>({getValidationProps:M,inputRef:E,registeredInputs:I,registerInput:F,getInputControl:k,commit:c,change:C}),[M,I,F,k,c,C])}r(Ut,"useFieldValidation");var we=g(S(),1);function jt(e){let{commit:t,invalid:o,markedDirtyRef:n,name:i,setRegisteredFieldName:s,registeredFieldIdRef:a,setValidityData:u,validityData:d}=e,{formRef:l}=J(),f=we.useRef(null),m=we.useRef(null),R=we.useRef(!1),p=A(()=>{let c=m.current;if(c)return c.getValue?c.getValue():c.value});function x(c){return c.value===void 0?p():c.value}r(x,"getRegistrationValue");let E=A(()=>{let c=m.current;if(n.current=!0,!c){t(d.value);return}t(x(c))});function I(){let c=m.current;!c||!c.id||l.current.fields.set(c.id,{getValue:p,name:i??c.name,controlRef:c.controlRef,validityData:ae(d,o),validate:E})}r(I,"refreshRegistration");function V(c=m.current?.id){c&&l.current.fields.delete(c)}r(V,"deleteRegistration");function F(c){if(R.current)return;R.current=!0;let C=x(c);u(M=>M.initialValue===C?M:{...M,initialValue:C})}r(F,"captureInitialValue"),D(()=>{let c=m.current;!c||!c.id||(s(i?void 0:c.name),l.current.fields.set(c.id,{getValue:p,name:i??c.name,controlRef:c.controlRef,validityData:ae(d,o),validate:E}))},[l,p,o,i,s,E,d]),D(()=>{let c=l.current.fields;return()=>{let C=m.current?.id;C&&c.delete(C)}},[l]);let k=A((c,C)=>{if(!C){f.current===c&&(f.current=null,V(),m.current=null,s(void 0),a.current=void 0);return}let M=m.current?.id;f.current=c,m.current=C,i||s(C.name),a.current=C.id,M&&M!==C.id&&V(M),F(C),I()});return[E,k]}r(jt,"useFieldControlRegistration");var _e=g(ne(),1);var Lr=_.forwardRef(r(function(t,o){let{errors:n,validationMode:i,submitAttemptedRef:s}=J(),{render:a,className:u,validate:d,validationDebounceTime:l=0,validationMode:f=i,name:m,disabled:R=!1,invalid:p,dirty:x,touched:E,actionsRef:I,style:V,...F}=t,k=Et(!0)?.disabled,c=A(d||(()=>null)),C=k||R,[M,h]=_.useState(!1),[j,z]=_.useState(!1),[H,O]=_.useState(!1),[y,G]=_.useState(!1),T=x??j,$=E??M,N=_.useRef(T),K=_.useRef(void 0),[ue,fe]=_.useState(),b=m??ue;D(()=>{x!==void 0&&(N.current=x)},[x]);let v=A(ve=>{x===void 0&&(ve&&(N.current=!0),z(ve))}),U=A(ve=>{E===void 0&&h(ve)}),w=A(()=>f==="onChange"||f==="onSubmit"&&s.current),Z=b&&Object.hasOwn(n,b)?n[b]:null,ur=!!(Array.isArray(Z)?Z.length:Z),me=p===!0||ur,[pe,qe]=_.useState({state:ee,error:"",errors:[],value:null,initialValue:null}),mt=!me&&(C?null:pe.state.valid),he=_.useMemo(()=>({disabled:C,touched:$,dirty:T,valid:mt,filled:H,focused:y}),[C,$,T,mt,H,y]),Ye=Ut({setValidityData:qe,validate:c,validityData:pe,validationDebounceTime:l,invalid:me,markedDirtyRef:N,state:he,shouldValidateOnChange:w,registeredFieldIdRef:K}),[pt,bt]=jt({commit:Ye.commit,invalid:me,markedDirtyRef:N,name:m,setRegisteredFieldName:fe,registeredFieldIdRef:K,setValidityData:qe,validityData:pe});_.useImperativeHandle(I,()=>({validate:pt}),[pt]);let dr=_.useMemo(()=>({invalid:me,name:b,validityData:pe,setValidityData:qe,disabled:C,setTouched:U,setDirty:v,setFilled:O,setFocused:G,validationMode:f,shouldValidateOnChange:w,state:he,registerFieldControl:bt,validation:Ye}),[me,b,pe,C,U,v,O,G,f,w,he,bt,Ye]),fr=q("div",t,{ref:o,state:he,props:F,stateAttributesMapping:Y});return(0,_e.jsx)(Ke.Provider,{value:dr,children:fr})},"FieldRootInner")),Bt=_.forwardRef(r(function(t,o){return(0,_e.jsx)(Ve,{children:(0,_e.jsx)(Lr,{...t,ref:o})})},"FieldRoot"));var Re=g(S(),1);var Me=g(S(),1);var at=Me.createContext({disabled:!1});function Oe(){return Me.useContext(at)}r(Oe,"useFieldItemContext");var $t=Re.forwardRef(r(function(t,o){let{render:n,className:i,style:s,id:a,nativeLabel:u=!0,...d}=t,l=B(!1),f=Oe(),{labelId:m}=P(),R={...l.state,disabled:l.disabled||f.disabled},p=Re.useRef(null),x=_t({id:m??a,native:u});return q("label",t,{ref:[o,p],state:R,props:[x,d],stateAttributesMapping:Y})},"FieldLabel"));var le=g(S(),1);var zt=g(S(),1);var Yt=g(mr(),1);var Pe=null,ji=globalThis.requestAnimationFrame,lt=class{static{r(this,"Scheduler")}callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=r(t=>{this.isScheduled=!1;let o=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let i=0;i<o.length;i+=1)o[i]?.(t)},"tick");request(t){let o=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),o}cancel(t){let o=t-this.startId;o<0||o>=this.callbacks.length||(this.callbacks[o]=null,this.callbacksCount-=1)}},ke=new lt;var Q=class e{static{r(this,"AnimationFrame")}static create(){return new e}static request(t){return ke.request(t)}static cancel(t){return ke.cancel(t)}currentId=Pe;request(t){this.cancel(),this.currentId=ke.request(()=>{this.currentId=Pe,t()})}cancel=r(()=>{this.currentId!==Pe&&(ke.cancel(this.currentId),this.currentId=Pe)},"cancel");disposeEffect=r(()=>this.cancel,"disposeEffect")};function Wt(){let e=W(Q.create).current;return Le(e.disposeEffect),e}r(Wt,"useAnimationFrame");function qt(e){return e==null?e:"current"in e?e.current:e}r(qt,"resolveRef");function Kt(e,t=!1){let o=Wt();return A((n,i=null)=>{o.cancel();let s=qt(e);if(s==null)return;let a=s,u=r(()=>{Yt.flushSync(n)},"done");if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function d(){Promise.all(a.getAnimations().map(l=>l.finished)).then(()=>{i?.aborted||u()},()=>{if(i?.aborted)return;if(a.getAnimations().some(f=>f.pending||f.playState!=="finished")){d();return}u()})}if(r(d,"exec"),t){let l="data-starting-style";if(!a.hasAttribute(l)){o.request(d);return}let f=new MutationObserver(()=>{a.hasAttribute(l)||(f.disconnect(),d())});f.observe(a,{attributes:!0,attributeFilter:[l]}),i?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}o.request(d)})}r(Kt,"useAnimationsFinished");function Ht(e){let{enabled:t=!0,open:o,ref:n,onComplete:i}=e,s=A(i),a=Kt(n,o);zt.useEffect(()=>{if(!t)return;let u=new AbortController;return a(s,u.signal),()=>{u.abort()}},[t,o,s,a])}r(Ht,"useOpenChangeComplete");var es=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({}),wr={"data-starting-style":""},_r={"data-ending-style":""},Gt={transitionStatus(e){return e==="starting"?wr:e==="ending"?_r:null}};var ct=g(S(),1);function Ue(e,t=!1,o=!1){let[n,i]=ct.useState(e&&t?"idle":void 0),[s,a]=ct.useState(e);return e&&!s&&(a(!0),i("starting")),!e&&s&&n!=="ending"&&!o&&i("ending"),!e&&!s&&n==="ending"&&i(void 0),D(()=>{if(!e&&s&&n!=="ending"&&o){let u=Q.request(()=>{i("ending")});return()=>{Q.cancel(u)}}},[e,s,n,o]),D(()=>{if(!e||t)return;let u=Q.request(()=>{i(void 0)});return()=>{Q.cancel(u)}},[t,e]),D(()=>{if(!e||!t)return;e&&s&&n!=="idle"&&i("starting");let u=Q.request(()=>{i("idle")});return()=>{Q.cancel(u)}},[t,e,s,n]),{mounted:s,setMounted:a,transitionStatus:n}}r(Ue,"useTransitionStatus");var ut=g(ne(),1);var Mr={...Y,...Gt},Jt=le.forwardRef(r(function(t,o){let{render:n,id:i,className:s,match:a,style:u,...d}=t,l=X(i),{validityData:f,state:m,name:R}=B(!1),{setMessageIds:p}=P(),{errors:x}=J(),E=R&&Object.hasOwn(x,R)?x[R]:null,I=!!(Array.isArray(E)?E.length:E),V=typeof a=="string",F=!1;a===!0?F=!0:m.disabled?F=!1:V?F=!!f.state[a]:F=I||f.state.valid===!1;let{mounted:k,transitionStatus:c,setMounted:C}=Ue(F);D(()=>{if(!(!F||!l))return p(N=>N.concat(l)),()=>{p(N=>N.filter(K=>K!==l))}},[F,l,p]);let M=le.useRef(null),[h,j]=le.useState(null),[z,H]=le.useState(null),O=f.error;!V&&I?O=E:f.errors.length>1&&(O=f.errors);let y=O;Array.isArray(O)&&(y=O.length>1?(0,ut.jsx)("ul",{children:O.map(N=>(0,ut.jsx)("li",{children:N},N))}):O[0]);let G=Array.isArray(O)?JSON.stringify(O):O;F&&G!==z&&(H(G),j(y)),Ht({open:F,ref:M,onComplete(){F||C(!1)}});let T={...m,transitionStatus:c},$=q("div",t,{ref:[o,M],state:T,props:[{id:l,children:F?y:h},d],stateAttributesMapping:Mr,enabled:k});return k?$:null},"FieldError"));var Xt=g(S(),1);var Qt=Xt.forwardRef(r(function(t,o){let{render:n,id:i,className:s,style:a,...u}=t,d=X(i),l=B(!1),f=Oe(),{setMessageIds:m}=P(),R={...l.state,disabled:l.disabled||f.disabled};return D(()=>{if(d)return m(x=>x.concat(d)),()=>{m(x=>x.filter(E=>E!==d))}},[d,m]),q("p",t,{ref:o,state:R,props:[{id:d},u],stateAttributesMapping:Y})},"FieldDescription"));var Be=g(S(),1);var ce=g(S(),1);function Zt({controlled:e,default:t,name:o,state:n="value"}){let{current:i}=ce.useRef(e!==void 0),[s,a]=ce.useState(t),u=i?e:s,d=ce.useCallback(l=>{i||a(l)},[]);return[u,d]}r(Zt,"useControlled");function er(e,t,o,n,i=!0,s){let{registerFieldControl:a}=B(),u=W(()=>Symbol());D(()=>{let d=u.current;if(!i){a(d,void 0);return}a(d,{controlRef:e,getValue:n,id:t,name:s,value:o})},[e,i,n,t,s,a,u,o]),D(()=>{let d=u.current;return()=>{a(d,void 0)}},[a,u])}r(er,"useRegisterFieldControl");var je={};oe(je,{cancelOpen:()=>co,chipRemovePress:()=>Yr,clearPress:()=>qr,closePress:()=>$r,closeWatcher:()=>ro,decrementPress:()=>Hr,disabled:()=>fo,drag:()=>so,escapeKey:()=>to,focusOut:()=>eo,imperativeAction:()=>bo,incrementPress:()=>zr,initial:()=>po,inputBlur:()=>Xr,inputChange:()=>Gr,inputClear:()=>Jr,inputPaste:()=>Qr,inputPress:()=>Zr,itemPress:()=>Br,keyboard:()=>no,linkPress:()=>Wr,listNavigation:()=>oo,missing:()=>mo,none:()=>Or,outsidePress:()=>jr,pointer:()=>io,scrub:()=>lo,siblingOpen:()=>uo,swipe:()=>go,trackPress:()=>Kr,triggerFocus:()=>Ur,triggerHover:()=>kr,triggerPress:()=>Pr,wheel:()=>ao,windowResize:()=>Ro});var Or="none",Pr="trigger-press",kr="trigger-hover",Ur="trigger-focus",jr="outside-press",Br="item-press",$r="close-press",Wr="link-press",qr="clear-press",Yr="chip-remove-press",Kr="track-press",zr="increment-press",Hr="decrement-press",Gr="input-change",Jr="input-clear",Xr="input-blur",Qr="input-paste",Zr="input-press",eo="focus-out",to="escape-key",ro="close-watcher",oo="list-navigation",no="keyboard",io="pointer",so="drag",ao="wheel",lo="scrub",co="cancel-open",uo="sibling-open",fo="disabled",mo="missing",po="initial",bo="imperative-action",go="swipe",Ro="window-resize";function tr(e,t,o,n){let i=!1,s=!1,a=n??de;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:o,...a}}r(tr,"createChangeEventDetails");var rr=Be.forwardRef(r(function(t,o){let{render:n,className:i,id:s,name:a,value:u,disabled:d=!1,onValueChange:l,defaultValue:f,autoFocus:m=!1,style:R,...p}=t,{state:x,name:E,disabled:I,setTouched:V,setDirty:F,validityData:k,setFocused:c,setFilled:C,validationMode:M,validation:h}=B(),{clearErrors:j}=J(),z=I||d,H=E??a,O={...x,disabled:z},{labelId:y}=P(),G=Dt({id:s});D(()=>{let b=u!=null;h.inputRef.current?.value||b&&u!==""?C(!0):b&&u===""&&C(!1)},[h.inputRef,C,u]);let T=Be.useRef(null);D(()=>{m&&T.current===ot(ye(T.current))&&c(!0)},[m,c]);let[$]=Zt({controlled:u,default:f,name:"FieldControl",state:"value"}),N=u!==void 0,K=N?$:void 0,ue=A(()=>h.inputRef.current?.value);return er(h.inputRef,G,K,ue,!z,a),q("input",t,{ref:[o,T],state:O,props:[{id:G,disabled:z,name:H,ref:h.inputRef,"aria-labelledby":y,autoFocus:m,...N?{value:K}:{defaultValue:f},onChange(b){let v=b.currentTarget.value;l?.(v,tr(je.none,b.nativeEvent)),F(v!==(k.initialValue??"")),C(v!==""),b.nativeEvent.defaultPrevented||(j(H),h.change(v))},onFocus(){c(!0)},onBlur(b){V(!0),c(!1),M==="onBlur"&&h.commit(b.currentTarget.value)},onKeyDown(b){b.currentTarget.tagName==="INPUT"&&b.key==="Enter"&&(V(!0),h.commit(b.currentTarget.value))}},p,b=>h.getValidationProps(z,b)],stateAttributesMapping:Y})},"FieldControl"));var xe=g(S(),1);var or=g(ne(),1);var nr=r(function(t){let{children:o}=t,{validityData:n,invalid:i}=B(!1),s=xe.useMemo(()=>ae(n,i),[n,i]),a=s.state.valid===!1,{transitionStatus:u}=Ue(a),d=xe.useMemo(()=>({...s,validity:s.state,transitionStatus:u}),[s,u]);return(0,or.jsx)(xe.Fragment,{children:o(d)})},"FieldValidity");var $e=g(S(),1);var dt=g(ne(),1);var ir=$e.forwardRef(r(function(t,o){let{render:n,className:i,style:s,disabled:a=!1,...u}=t,{state:d,disabled:l}=B(!1),f=l||a,m={...d,disabled:f},R=$e.useMemo(()=>({disabled:f}),[f]),p=q("div",t,{ref:o,state:m,props:u,stateAttributesMapping:Y});return(0,dt.jsx)(Ve,{children:(0,dt.jsx)(at.Provider,{value:R,children:p})})},"FieldItem"));var ar=g(ne(),1);var ft=sr.forwardRef(r(function(t,o){return(0,ar.jsx)(We.Control,{ref:o,...t})},"Input"));var cr=g(ne(),1);function Da(e){let t=(0,lr.c)(10),o,n,i;t[0]!==e?({className:o,type:i,...n}=e,t[0]=e,t[1]=o,t[2]=n,t[3]=i):(o=t[1],n=t[2],i=t[3]);let s;t[4]!==o?(s=gt("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",o),t[4]=o,t[5]=s):s=t[5];let a;return t[6]!==n||t[7]!==s||t[8]!==i?(a=(0,cr.jsx)(ft,{type:i,"data-slot":"input",className:s,...n}),t[6]=n,t[7]=s,t[8]=i,t[9]=a):a=t[9],a}r(Da,"m");export{Y as a,B as b,J as c,Ft as d,X as e,P as f,Dt as g,Ne as h,tt as i,dn as j,fn as k,mn as l,pn as m,ot as n,Lt as o,nt as p,In as q,yn as r,Fn as s,Sr as t,An as u,Dn as v,Tn as w,Sn as x,_t as y,Le as z,it as A,Ot as B,Oe as C,Q as D,Wt as E,qt as F,Kt as G,Ht as H,es as I,Gt as J,Ue as K,Zt as L,er as M,je as N,tr as O,Da as P};
@@ -0,0 +1 @@
1
+ import{b as de}from"./chunk-W2JBKQNU.js";import{a as te,b as re,c as ne}from"./chunk-TPAZM36C.js";import"./chunk-ZHPDAJBM.js";import{b as Y}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as ae}from"./chunk-Y2YQITGI.js";import"./chunk-PZ4QDWTI.js";import"./chunk-VLW547U6.js";import"./chunk-F7JOSNAT.js";import{a as ee}from"./chunk-DZGOHOOE.js";import{c as Z}from"./chunk-PSPJORP6.js";import"./chunk-OEGE3YDK.js";import"./chunk-RCZTUWG3.js";import{a as le,b as oe,c as se,d as H,e as z,f as G}from"./chunk-L4EZAHCD.js";import{a as P,e as q}from"./chunk-IYWVSMAY.js";import{d as X}from"./chunk-6ZPTNC34.js";import"./chunk-FDLSPDIC.js";import{a as g,d as W,f as ce,g as me}from"./chunk-R5ZTCHCE.js";var J=W(ce(),1);var t=W(me(),1);var ue={binding:"outline",secret:"destructive",var:"secondary"},pe=g((n,e)=>{if(n===void 0)return[];let u=[];return n.workerUrl!==void 0&&u.push({label:e("URL"),value:n.workerUrl}),n.environment!==void 0&&u.push({label:e("Environment"),value:n.environment}),n.deploymentId!==void 0&&u.push({label:e("Deployment"),value:n.deploymentId}),n.versionTag!==void 0&&u.push({label:e("Version"),value:n.versionTag}),u},"ce"),ie=g(n=>{let e=(0,J.c)(18),{modifier:u,name:r,label:p}=n,A=te(),x;e[0]!==r?(x=g(o=>{if(!["Escape","Tab"].includes(o.key)){if(o.shiftKey){o.preventDefault();return}o.preventDefault(),re(r,o.key)}},"b"),e[0]=r,e[1]=x):x=e[1];let i=x,c=`set-shortcut-${r}`,m;e[2]!==p?(m=(0,t.jsx)("dt",{className:"text-muted-foreground",children:p}),e[2]=p,e[3]=m):m=e[3];let h;e[4]!==u?(h=(0,t.jsx)("kbd",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:u}),e[4]=u,e[5]=h):h=e[5];let l=`set-shortcut-input-${r}`,f=A[r],s;e[6]!==p||e[7]!==i||e[8]!==l||e[9]!==f?(s=(0,t.jsx)("input",{"aria-label":p,className:"h-7 w-12 rounded-md border border-border bg-background text-center font-mono text-xs uppercase outline-none focus-visible:border-ring","data-testid":l,onKeyDown:i,readOnly:!0,value:f}),e[6]=p,e[7]=i,e[8]=l,e[9]=f,e[10]=s):s=e[10];let a;e[11]!==h||e[12]!==s?(a=(0,t.jsxs)("dd",{className:"flex items-center gap-1.5",children:[h,s]}),e[11]=h,e[12]=s,e[13]=a):a=e[13];let d;return e[14]!==c||e[15]!==m||e[16]!==a?(d=(0,t.jsxs)("div",{className:"contents","data-testid":c,children:[m,a]}),e[14]=c,e[15]=m,e[16]=a,e[17]=d):d=e[17],d},"z"),Se=g(n=>{let e=(0,J.c)(85),{initialShardKey:u}=n,r=X(),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let A=u??"",x;e[1]!==A?(x={shardKey:A},e[1]=A,e[2]=x):x=e[2];let{data:i,error:c,errorSource:m,isLoading:h}=Z(ee.getSettings,p,x),l,f,s,a,d,o,b;if(e[3]!==c||e[4]!==m||e[5]!==i?.deploy||e[6]!==i?.settings||e[7]!==r){let Q=pe(i?.deploy,r),M;e[15]!==i?.settings?(M=i?.settings??[],e[15]=i?.settings,e[16]=M):M=e[16],l=M,f="flex flex-col gap-4",s="lunora-settings";let V;e[17]!==r?(V=r("Open in Cloudflare"),e[17]=r,e[18]=V):V=e[18],e[19]!==V?(a=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:de,rel:"noreferrer",target:"_blank",children:V})}),e[19]=V,e[20]=a):a=e[20];let $;e[21]!==r?($=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=$):$=e[22],e[23]!==$?(d=(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:$}),e[23]=$,e[24]=d):d=e[24],e[25]!==c||e[26]!==m?(o=c!==null&&(0,t.jsx)(ae,{error:m,testId:"set-error"}),e[25]=c,e[26]=m,e[27]=o):o=e[27],b=Q.length>0&&(0,t.jsxs)(P,{className:"py-0","data-testid":"set-deploy",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,t.jsx)(q,{className:"py-3",children:(0,t.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:Q.map(he)})})]}),e[3]=c,e[4]=m,e[5]=i?.deploy,e[6]=i?.settings,e[7]=r,e[8]=l,e[9]=f,e[10]=s,e[11]=a,e[12]=d,e[13]=o,e[14]=b}else l=e[8],f=e[9],s=e[10],a=e[11],d=e[12],o=e[13],b=e[14];let y;e[28]!==r?(y=r("Keyboard shortcuts"),e[28]=r,e[29]=y):y=e[29];let v;e[30]!==y?(v=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y}),e[30]=y,e[31]=v):v=e[31];let N;e[32]!==r?(N=r("Reset"),e[32]=r,e[33]=N):N=e[33];let k;e[34]!==N?(k=(0,t.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"set-shortcut-reset",onClick:ne,type:"button",children:N}),e[34]=N,e[35]=k):k=e[35];let w;e[36]!==v||e[37]!==k?(w=(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[v,k]}),e[36]=v,e[37]=k,e[38]=w):w=e[38];let C;e[39]!==r?(C=r("Command palette"),e[39]=r,e[40]=C):C=e[40];let S;e[41]!==C?(S=(0,t.jsx)(ie,{label:C,modifier:"\u2318/Ctrl",name:"palette"}),e[41]=C,e[42]=S):S=e[42];let T;e[43]!==r?(T=r("Operation console"),e[43]=r,e[44]=T):T=e[44];let D;e[45]!==T?(D=(0,t.jsx)(ie,{label:T,modifier:"Ctrl",name:"console"}),e[45]=T,e[46]=D):D=e[46];let _;e[47]!==S||e[48]!==D?(_=(0,t.jsxs)("dl",{className:"grid grid-cols-[10rem_minmax(0,1fr)] items-center gap-x-4 gap-y-2 text-sm",children:[S,D]}),e[47]=S,e[48]=D,e[49]=_):_=e[49];let E;e[50]!==r?(E=r("Stored in this browser. Focus a box and press a key to rebind it."),e[50]=r,e[51]=E):E=e[51];let I;e[52]!==E?(I=(0,t.jsx)("p",{className:"pt-3 text-xs text-muted-foreground",children:E}),e[52]=E,e[53]=I):I=e[53];let K;e[54]!==_||e[55]!==I?(K=(0,t.jsxs)(q,{className:"py-3",children:[_,I]}),e[54]=_,e[55]=I,e[56]=K):K=e[56];let O;e[57]!==w||e[58]!==K?(O=(0,t.jsxs)(P,{className:"py-0","data-testid":"set-preferences",children:[w,K]}),e[57]=w,e[58]=K,e[59]=O):O=e[59];let U;e[60]!==r?(U=r("Environment & bindings"),e[60]=r,e[61]=U):U=e[61];let j;e[62]!==U?(j=(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:U})}),e[62]=U,e[63]=j):j=e[63];let F;e[64]!==c||e[65]!==h||e[66]!==l.length||e[67]!==r?(F=c===null&&!h&&l.length===0&&(0,t.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[64]=c,e[65]=h,e[66]=l.length,e[67]=r,e[68]=F):F=e[68];let L;e[69]!==l||e[70]!==r?(L=l.length>0&&(0,t.jsx)(q,{className:"px-0 py-0",children:(0,t.jsxs)(le,{"data-testid":"set-table",children:[(0,t.jsx)(oe,{children:(0,t.jsxs)(H,{children:[(0,t.jsx)(z,{children:r("name")}),(0,t.jsx)(z,{children:r("kind")}),(0,t.jsx)(z,{children:r("value")})]})}),(0,t.jsx)(se,{children:l.map(fe)})]})}),e[69]=l,e[70]=r,e[71]=L):L=e[71];let R;e[72]!==j||e[73]!==F||e[74]!==L?(R=(0,t.jsxs)(P,{className:"py-0",children:[j,F,L]}),e[72]=j,e[73]=F,e[74]=L,e[75]=R):R=e[75];let B;return e[76]!==O||e[77]!==R||e[78]!==f||e[79]!==s||e[80]!==a||e[81]!==d||e[82]!==o||e[83]!==b?(B=(0,t.jsxs)("div",{className:f,"data-testid":s,children:[a,d,o,b,O,R]}),e[76]=O,e[77]=R,e[78]=f,e[79]=s,e[80]=a,e[81]=d,e[82]=o,e[83]=b,e[84]=B):B=e[84],B},"Ce");function he(n){return(0,t.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:n.label}),(0,t.jsx)("dd",{className:"truncate font-mono text-xs",title:n.value,children:n.value})]},n.label)}g(he,"me");function fe(n){return(0,t.jsxs)(H,{"data-testid":"set-row",children:[(0,t.jsx)(G,{className:"font-mono text-xs font-medium",children:n.name}),(0,t.jsx)(G,{children:(0,t.jsx)(Y,{variant:ue[n.kind],children:n.bindingType??n.kind})}),(0,t.jsx)(G,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:n.value??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},n.name)}g(fe,"fe");export{Se as SettingsPanel};