@lunora/studio 1.0.0-alpha.2 → 1.0.0-alpha.200

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 (334) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/__assets__/package-og.svg +1 -1
  4. package/dist/index.d.mts +1566 -0
  5. package/dist/index.d.ts +967 -803
  6. package/dist/index.mjs +1 -0
  7. package/dist/mount.d.mts +22 -0
  8. package/dist/mount.d.ts +11 -10
  9. package/dist/mount.mjs +1 -0
  10. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
  11. package/dist/packem_chunks/ApiTab.mjs +1 -0
  12. package/dist/packem_chunks/AuditPanel.mjs +1 -0
  13. package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
  14. package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
  15. package/dist/packem_chunks/FileBrowser.mjs +4 -0
  16. package/dist/packem_chunks/FunctionRunner.mjs +1 -0
  17. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
  18. package/dist/packem_chunks/HealthPanel.mjs +1 -0
  19. package/dist/packem_chunks/InsightsPanel.mjs +1 -0
  20. package/dist/packem_chunks/LogsPanel.mjs +1 -0
  21. package/dist/packem_chunks/MailPanel.mjs +2 -0
  22. package/dist/packem_chunks/MetricsPanel.mjs +1 -0
  23. package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
  24. package/dist/packem_chunks/PitrPanel.mjs +1 -0
  25. package/dist/packem_chunks/SchemaViewer.mjs +1 -0
  26. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
  27. package/dist/packem_chunks/SettingsPanel.mjs +1 -0
  28. package/dist/packem_chunks/SqlEditorPanel.mjs +8 -0
  29. package/dist/packem_chunks/TableEditor.mjs +1 -0
  30. package/dist/packem_chunks/agents-panel.mjs +1 -0
  31. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  32. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  33. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  34. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  35. package/dist/packem_chunks/containers-panel.mjs +1 -0
  36. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  37. package/dist/packem_chunks/evals-panel.mjs +1 -0
  38. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  39. package/dist/packem_chunks/flags-panel.mjs +1 -0
  40. package/dist/packem_chunks/issues-panel.mjs +1 -0
  41. package/dist/packem_chunks/kv-browser.mjs +1 -0
  42. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  43. package/dist/packem_chunks/migrations-route.mjs +1 -0
  44. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  45. package/dist/packem_chunks/payments-panel.mjs +1 -0
  46. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  47. package/dist/packem_chunks/queues-panel.mjs +1 -0
  48. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  49. package/dist/packem_chunks/rls-panel.mjs +1 -0
  50. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  51. package/dist/packem_chunks/sparkline.mjs +1 -0
  52. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  53. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  54. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  55. package/dist/packem_chunks/traces-panel.mjs +1 -0
  56. package/dist/packem_chunks/users-panel.mjs +1 -0
  57. package/dist/packem_chunks/vector-browser.mjs +1 -0
  58. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  59. package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
  60. package/dist/packem_shared/ApiDocsPanel-BImfQhyJ.mjs +2 -0
  61. package/dist/packem_shared/ApiReferencePanel-CigvHhCa.mjs +1 -0
  62. package/dist/packem_shared/CommandPalette-CSdz9zax.mjs +1 -0
  63. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  64. package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
  65. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
  66. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  67. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
  68. package/dist/packem_shared/DataBrowser-DLRa1EYq.mjs +4 -0
  69. package/dist/packem_shared/DataFilters-Cocu-WWE.mjs +1 -0
  70. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  71. package/dist/packem_shared/GlobalDataBrowser-BTbqR6Wc.mjs +1 -0
  72. package/dist/packem_shared/HomePanel-_BwLI4TQ.mjs +1 -0
  73. package/dist/packem_shared/MigrationsPanel-BPWzFdxC.mjs +1 -0
  74. package/dist/packem_shared/OpenRpcReferencePanel-C6CM791D.mjs +1 -0
  75. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  76. package/dist/packem_shared/ScheduledJobs-B4DPADwk.mjs +1 -0
  77. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  78. package/dist/packem_shared/Studio-CcWQdYrV.mjs +1 -0
  79. package/dist/packem_shared/StudioApp-fYFz6zZQ.mjs +1 -0
  80. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  81. package/dist/packem_shared/advisor-view-CPgOok_h.mjs +1 -0
  82. package/dist/packem_shared/aggregateMetrics-CY05xrYU.mjs +1 -0
  83. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  84. package/dist/packem_shared/app.d-BbmO2HA2.d.mts +301 -0
  85. package/dist/packem_shared/app.d-BbmO2HA2.d.ts +301 -0
  86. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  87. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  88. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  89. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  90. package/dist/packem_shared/card--2hKx4L2.mjs +1 -0
  91. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  92. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  93. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  94. package/dist/packem_shared/data-grid-DTBAKZlm.mjs +1 -0
  95. package/dist/packem_shared/data-view-params-qoSTqjAj.mjs +1 -0
  96. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  97. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  98. package/dist/packem_shared/error-alert-tf5zvSLV.mjs +1 -0
  99. package/dist/packem_shared/grid-features-Dm80ngyR.mjs +6 -0
  100. package/dist/packem_shared/home-panel-DCUKd8Uk.mjs +3 -0
  101. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  102. package/dist/packem_shared/internal-B6haJbiP.mjs +2 -0
  103. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  104. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  105. package/dist/packem_shared/log-fields-SBxKyBug.mjs +1 -0
  106. package/dist/packem_shared/log-line-BoObzuue.mjs +1 -0
  107. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  108. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  109. package/dist/packem_shared/recording-client-BXUIyBL4.mjs +1 -0
  110. package/dist/packem_shared/reference-view-DiikOols.mjs +13 -0
  111. package/dist/packem_shared/schema-diagram-CDj_69jF.mjs +2 -0
  112. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  113. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  114. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  115. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  116. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  117. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  118. package/dist/packem_shared/sql-result-table-C5y0jwaK.mjs +1 -0
  119. package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
  120. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  121. package/dist/packem_shared/studio-OqNyRY1N.mjs +2 -0
  122. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  123. package/dist/packem_shared/table-list-sidebar-DHG1UJC4.mjs +1 -0
  124. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  125. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  126. package/dist/packem_shared/use-admin-query-BKXiqLci.mjs +1 -0
  127. package/dist/packem_shared/use-async-submit-BTr3w2-K.mjs +1 -0
  128. package/dist/packem_shared/use-auth-config-CuM3eJZz.mjs +1 -0
  129. package/dist/packem_shared/use-open-trace-BCW0c9qq.mjs +1 -0
  130. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  131. package/dist/packem_shared/use-sql-assistant-BhIMDQHV.mjs +1 -0
  132. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  133. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  134. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  135. package/dist/packem_shared/wire-codec-Bk4XZGE4.mjs +1 -0
  136. package/dist/standalone/chunk-225VJ77I.js +1 -0
  137. package/dist/standalone/chunk-23C2QL7Z.js +8 -0
  138. package/dist/standalone/chunk-2DX5MROH.js +1 -0
  139. package/dist/standalone/chunk-2HFEYNGZ.js +1 -0
  140. package/dist/standalone/chunk-2URQKGWU.js +1 -0
  141. package/dist/standalone/chunk-35DM4JJG.js +1 -0
  142. package/dist/standalone/chunk-3CCIROFZ.js +1 -0
  143. package/dist/standalone/chunk-3FBLWUXD.js +1 -0
  144. package/dist/standalone/chunk-3NWLVUAS.js +1 -0
  145. package/dist/standalone/chunk-3Q2P62UR.js +1 -0
  146. package/dist/standalone/chunk-4ATHFUMH.js +1 -0
  147. package/dist/standalone/chunk-4C3MG76K.js +1 -0
  148. package/dist/standalone/chunk-4G53FSGN.js +1 -0
  149. package/dist/standalone/chunk-4GTO7FL5.js +1 -0
  150. package/dist/standalone/chunk-4JJEP7LF.js +1 -0
  151. package/dist/standalone/chunk-4JLGLPWV.js +1 -0
  152. package/dist/standalone/chunk-4KXVY5LG.js +1 -0
  153. package/dist/standalone/chunk-4L4WTGN5.js +1 -0
  154. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  155. package/dist/standalone/chunk-54BDTYMC.js +1 -0
  156. package/dist/standalone/chunk-54S5V7YR.js +3 -0
  157. package/dist/standalone/chunk-55754F6H.js +1 -0
  158. package/dist/standalone/chunk-5JDWLCSH.js +1 -0
  159. package/dist/standalone/chunk-5R7DNF7C.js +4 -0
  160. package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
  161. package/dist/standalone/chunk-5YNR3G3E.js +1 -0
  162. package/dist/standalone/chunk-5ZMBICI6.js +1 -0
  163. package/dist/standalone/chunk-66UGPQVC.js +1 -0
  164. package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
  165. package/dist/standalone/chunk-6P3POBSU.js +1 -0
  166. package/dist/standalone/chunk-74LPCD76.js +1 -0
  167. package/dist/standalone/chunk-7NRK3UZ3.js +1 -0
  168. package/dist/standalone/chunk-A3JCPBOZ.js +1 -0
  169. package/dist/standalone/chunk-AAVLPU5Q.js +1 -0
  170. package/dist/standalone/chunk-AWHXPIXU.js +1 -0
  171. package/dist/standalone/chunk-BDO4YYBB.js +6 -0
  172. package/dist/standalone/chunk-BOTGXX4H.js +1 -0
  173. package/dist/standalone/chunk-C6T7K5XP.js +1 -0
  174. package/dist/standalone/chunk-CAHVOTZA.js +1 -0
  175. package/dist/standalone/chunk-CMA4PTV7.js +1 -0
  176. package/dist/standalone/chunk-COXVHN6E.js +1 -0
  177. package/dist/standalone/chunk-CSUROWL2.js +1 -0
  178. package/dist/standalone/chunk-CSZUHTON.js +1 -0
  179. package/dist/standalone/chunk-DNNWYXLD.js +1 -0
  180. package/dist/standalone/chunk-DTVF7X3F.js +1 -0
  181. package/dist/standalone/chunk-DX6FAHR2.js +1 -0
  182. package/dist/standalone/chunk-E7TOMONS.js +4 -0
  183. package/dist/standalone/chunk-EA2JKR5D.js +1 -0
  184. package/dist/standalone/chunk-EHADDOX7.js +1 -0
  185. package/dist/standalone/chunk-EVTM6Q43.js +1 -0
  186. package/dist/standalone/chunk-F7UC63UN.js +1 -0
  187. package/dist/standalone/chunk-FEWMAPNI.js +1 -0
  188. package/dist/standalone/chunk-FKVZRPV5.js +1 -0
  189. package/dist/standalone/chunk-FODLDLE2.js +19 -0
  190. package/dist/standalone/chunk-FPG5ZRPW.js +1 -0
  191. package/dist/standalone/chunk-FSRSK4LY.js +1 -0
  192. package/dist/standalone/chunk-FTOTZ5ZX.js +1 -0
  193. package/dist/standalone/chunk-G4PC65C6.js +1 -0
  194. package/dist/standalone/chunk-GGPSI4ZR.js +1 -0
  195. package/dist/standalone/chunk-GK2VTVJQ.js +1 -0
  196. package/dist/standalone/chunk-GMS77BZD.js +1 -0
  197. package/dist/standalone/chunk-GWFZ7WCP.js +1 -0
  198. package/dist/standalone/chunk-GZ3EDDP7.js +1 -0
  199. package/dist/standalone/chunk-HEAQVSNS.js +1 -0
  200. package/dist/standalone/chunk-HOIVU2H7.js +1 -0
  201. package/dist/standalone/chunk-HXXKZOZO.js +1 -0
  202. package/dist/standalone/chunk-IHMGCHAA.js +1 -0
  203. package/dist/standalone/chunk-IMOHEGMV.js +1 -0
  204. package/dist/standalone/chunk-IS6LVJ6L.js +1 -0
  205. package/dist/standalone/chunk-IWOLH2P2.js +1 -0
  206. package/dist/standalone/chunk-JBLAVREZ.js +1 -0
  207. package/dist/standalone/chunk-JWO4CGLV.js +5 -0
  208. package/dist/standalone/chunk-K7AJEMKE.js +1 -0
  209. package/dist/standalone/chunk-LBMSRD6N.js +1 -0
  210. package/dist/standalone/chunk-LG52A5TG.js +1 -0
  211. package/dist/standalone/chunk-LIEKK2VL.js +11 -0
  212. package/dist/standalone/chunk-LWT6QDJ3.js +1 -0
  213. package/dist/standalone/chunk-LYDV7Y4R.js +8 -0
  214. package/dist/standalone/chunk-MCTFHKVC.js +1 -0
  215. package/dist/standalone/chunk-MKL7VDTL.js +15 -0
  216. package/dist/standalone/chunk-MU3P2FI7.js +1 -0
  217. package/dist/standalone/chunk-MXLAOCAN.js +1 -0
  218. package/dist/standalone/chunk-OGUKYRFM.js +1 -0
  219. package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
  220. package/dist/standalone/chunk-OMNXRJSM.js +1 -0
  221. package/dist/standalone/chunk-OZ5VOVBO.js +2 -0
  222. package/dist/standalone/chunk-P5RUFDVX.js +59 -0
  223. package/dist/standalone/chunk-PD6WIDY6.js +1 -0
  224. package/dist/standalone/chunk-PLHA3OWK.js +3 -0
  225. package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
  226. package/dist/standalone/chunk-QBV3C2HK.js +1 -0
  227. package/dist/standalone/chunk-QKEJLVC5.js +1 -0
  228. package/dist/standalone/chunk-QUNKRCBP.js +1 -0
  229. package/dist/standalone/chunk-RDA5NLFX.js +1 -0
  230. package/dist/standalone/chunk-RFNGDE33.js +1 -0
  231. package/dist/standalone/chunk-RLLKECZT.js +1 -0
  232. package/dist/standalone/chunk-RPQL45FL.js +1 -0
  233. package/dist/standalone/chunk-S3CRZLGS.js +1 -0
  234. package/dist/standalone/chunk-SU5NQREA.js +1 -0
  235. package/dist/standalone/chunk-SUDJTC4S.js +1 -0
  236. package/dist/standalone/chunk-SV5XEZUN.js +1 -0
  237. package/dist/standalone/chunk-TIUMFAN2.js +1 -0
  238. package/dist/standalone/chunk-UCG3QPFD.js +1 -0
  239. package/dist/standalone/chunk-ULIQFBZU.js +1 -0
  240. package/dist/standalone/chunk-USCV7TYG.js +1 -0
  241. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  242. package/dist/standalone/chunk-V32I7IJL.js +3 -0
  243. package/dist/standalone/chunk-V3CZW3JB.js +1 -0
  244. package/dist/standalone/chunk-V3VJAA4D.js +1 -0
  245. package/dist/standalone/chunk-VMVIL7J7.js +1 -0
  246. package/dist/standalone/chunk-VOZRZLXT.js +1 -0
  247. package/dist/standalone/chunk-W3SCOCGB.js +1 -0
  248. package/dist/standalone/chunk-WBNKZBWC.js +1 -0
  249. package/dist/standalone/chunk-WUWBZPUK.js +1 -0
  250. package/dist/standalone/chunk-X7GEIRBP.js +1 -0
  251. package/dist/standalone/chunk-XT5WRPP2.js +1 -0
  252. package/dist/standalone/chunk-XZMOZFE6.js +1 -0
  253. package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
  254. package/dist/standalone/chunk-YHLDMYGP.js +14 -0
  255. package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
  256. package/dist/standalone/chunk-YOB2X3FZ.js +1 -0
  257. package/dist/standalone/chunk-YPRQLCKF.js +1 -0
  258. package/dist/standalone/chunk-YVVP4DRM.js +1 -0
  259. package/dist/standalone/chunk-ZOBUTUUF.js +1 -0
  260. package/dist/standalone/studio.js +9 -356
  261. package/dist/styles.css +2 -2
  262. package/package.json +24 -20
  263. package/dist/index.js +0 -41
  264. package/dist/mount.js +0 -26
  265. package/dist/packem_shared/ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js +0 -45
  266. package/dist/packem_shared/ApiDocsPanel-DpRjJhG5.js +0 -842
  267. package/dist/packem_shared/ApiReferencePanel-DMIUp-kK.js +0 -229
  268. package/dist/packem_shared/ApiTab-DURGU15e.js +0 -251
  269. package/dist/packem_shared/AuditPanel-BC59Nhst.js +0 -212
  270. package/dist/packem_shared/CommandPalette-Dx_CoB9i.js +0 -373
  271. package/dist/packem_shared/ConfirmButton-WQVUoGFb.js +0 -59
  272. package/dist/packem_shared/ConnectionBadge-Bxagrip8.js +0 -111
  273. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  274. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  275. package/dist/packem_shared/DataBrowser-Coz6jJE6.js +0 -4542
  276. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  277. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  278. package/dist/packem_shared/ExportImportPanel-WO34fJxy.js +0 -193
  279. package/dist/packem_shared/FileBrowser-Zcr-Qgxo.js +0 -2932
  280. package/dist/packem_shared/FunctionRunner-j0Rd5m9t.js +0 -343
  281. package/dist/packem_shared/FunctionStatsPanel-DboBl-XL.js +0 -432
  282. package/dist/packem_shared/GlobalDataBrowser-9MhPEfgN.js +0 -318
  283. package/dist/packem_shared/HealthPanel-DOIgbUtx.js +0 -640
  284. package/dist/packem_shared/HomePanel-bdOCNA-p.js +0 -1273
  285. package/dist/packem_shared/InsightsPanel-DaZPnSgt.js +0 -423
  286. package/dist/packem_shared/LogsPanel-CWdqAGpQ.js +0 -839
  287. package/dist/packem_shared/MailPanel-D_EGtDnS.js +0 -447
  288. package/dist/packem_shared/MetricsPanel-E4Gv6wTO.js +0 -1625
  289. package/dist/packem_shared/MigrationsPanel-DQdPY9io.js +0 -246
  290. package/dist/packem_shared/OpenRpcReferencePanel-j2p3HB0s.js +0 -191
  291. package/dist/packem_shared/PitrPanel-BbBkQR6t.js +0 -252
  292. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  293. package/dist/packem_shared/ScheduledJobs-Ok1CYYwI.js +0 -159
  294. package/dist/packem_shared/SchemaViewer-D8XGnp-X.js +0 -2512
  295. package/dist/packem_shared/SecurityAdvisorPanel-Cdm2IxLW.js +0 -79
  296. package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +0 -176
  297. package/dist/packem_shared/ShardInput-DNCsT1KW.js +0 -107
  298. package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +0 -13
  299. package/dist/packem_shared/Studio-D36od9Oz.js +0 -33
  300. package/dist/packem_shared/StudioApp-dvywkJ8I.js +0 -383
  301. package/dist/packem_shared/StudioI18nProvider-Dcajsznk.js +0 -48
  302. package/dist/packem_shared/TableEditor-DIVDk3vT.js +0 -371
  303. package/dist/packem_shared/advisor-view-DBlzJi6C.js +0 -159
  304. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  305. package/dist/packem_shared/app.d-CCmwDEVs.d.ts +0 -300
  306. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  307. package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
  308. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  309. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  310. package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
  311. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  312. package/dist/packem_shared/createStudioI18n-CgvlmDkN.js +0 -27
  313. package/dist/packem_shared/data-grid-CCh2Couo.js +0 -183
  314. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  315. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  316. package/dist/packem_shared/grid-features-DTjG6Sex.js +0 -840
  317. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  318. package/dist/packem_shared/internal-BBZYexre.js +0 -68
  319. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  320. package/dist/packem_shared/live-status-bPff1O7Y.js +0 -44
  321. package/dist/packem_shared/reference-view-BCKIoai7.js +0 -2180
  322. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  323. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  324. package/dist/packem_shared/sql-editor-panel-CW2y2x9h.js +0 -2562
  325. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  326. package/dist/packem_shared/studio-BDVd7rIV.js +0 -10303
  327. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  328. package/dist/packem_shared/table-list-sidebar-aZHLq70w.js +0 -832
  329. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  330. package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +0 -73
  331. package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +0 -76
  332. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  333. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  334. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-55754F6H.js";import{d}from"./chunk-FODLDLE2.js";import{a as e,d as r,e as h,g as k}from"./chunk-YKXDMIHQ.js";var l=r(h(),1);var t=r(k(),1);var g=e(({children:m,confirmLabel:c,disabled:a=!1,onConfirm:p,testId:i})=>{let o=d(),[f,n]=(0,l.useState)(!1),u=e(()=>{n(!0)},"f"),C=e(()=>{n(!1)},"l"),b=e(()=>{n(!1),p()},"p");return f?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(s,{"data-testid":`${i}-confirm`,disabled:a,onClick:b,size:"sm",type:"button",variant:"destructive",children:c??o("Confirm")}),(0,t.jsx)(s,{"data-testid":`${i}-cancel`,onClick:C,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(s,{"data-testid":i,disabled:a,onClick:u,size:"sm",type:"button",variant:"outline",children:m})},"k");export{g as a};
@@ -0,0 +1,3 @@
1
+ import{a as Vr}from"./chunk-4L4WTGN5.js";import{a as D,b as _t,c as I,h as Pt,i as Fe,j as Mt,w as De}from"./chunk-AAVLPU5Q.js";import{a as wt,c as ye,d as Y,g as N,h as Lt,i as ge,j as z}from"./chunk-225VJ77I.js";import{a as r,c as Z,d as R,e as T,f as Nr,g as le,i as Nt}from"./chunk-YKXDMIHQ.js";var Sr=R(Nr(),1);var Fr=R(T(),1);var Qe={};Z(Qe,{Control:()=>Cr,Description:()=>br,Error:()=>pr,Item:()=>yr,Label:()=>ar,Root:()=>sr,Validity:()=>Ir});var M=R(T(),1);var Se=R(T(),1);var kt="data-valid",Ut="data-invalid";var ce={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Lr={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Bt={disabled:!1,...Lr},G={valid(e){return e===null?null:e?{[kt]:""}:{[Ut]:""}}};var _r={invalid:void 0,name:void 0,validityData:{state:ce,errors:[],error:"",value:"",initialValue:null},setValidityData:N,disabled:void 0,setTouched:N,setDirty:N,setFilled:N,setFocused:N,validationMode:"onSubmit",shouldValidateOnChange:r(()=>!1,"shouldValidateOnChange"),state:Bt,registerFieldControl:N,validation:{getValidationProps:r((e,t=ge)=>t,"getValidationProps"),inputRef:{current:null},registeredInputs:new Map,registerInput:N,getInputControl:r(()=>null,"getInputControl"),commit:r(async()=>{},"commit"),change:N}},Xe=Se.createContext(_r);function W(e=!0){let t=Se.useContext(Xe);if(t.setValidityData===N&&!e)throw new Error(ye(28));return t}r(W,"useFieldRootContext");var Ae=R(T(),1);var Pr=Ae.createContext(void 0);function jt(e=!1){let t=Ae.useContext(Pr);if(!t&&!e)throw new Error(ye(86));return t}r(jt,"useFieldsetRootContext");var Te=R(T(),1);var Mr=Te.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:N,validationMode:"onSubmit",submitCountRef:{current:0}});function ee(){return Te.useContext(Mr)}r(ee,"useFormContext");var ae=R(T(),1);var Oe=R(T(),1);var $t=0;function kr(e,t="mui"){let[o,n]=Oe.useState(e),i=e||o;return Oe.useEffect(()=>{o==null&&($t+=1,n(`${t}-${$t}`))},[o,t]),i}r(kr,"useGlobalId");var Wt=_t.useId;function qt(e,t){if(Wt!==void 0){let o=Wt();return e??(t?`${t}-${o}`:o)}return kr(e,t)}r(qt,"useId");function te(e){return qt(e,"base-ui")}r(te,"useBaseUiId");var Ve=R(T(),1);var Ze=Ve.createContext({controlId:void 0,registerControlId:N,resetControlId:N,labelId:void 0,setLabelId:N,messageIds:[],setMessageIds:N,getDescriptionProps:r(e=>e,"getDescriptionProps")});function U(){return Ve.useContext(Ze)}r(U,"useLabelableContext");var Ht=R(le(),1);var Ne=r(function(t){let o=te(),[n,i]=ae.useState(o),[a,s]=ae.useState(),[d,f]=ae.useState([]),p=n===void 0?o:n,l=Y(()=>new Map),{messageIds:m}=U(),C=I((O,F)=>{let v=l.current;F===void 0?v.delete(O):v.set(O,F),i(_=>{if(v.size===0)return _;let k;for(let c of v.values()){if(c===_)return _;k===void 0&&(k=c)}return k})}),x=I(()=>{l.current.size===0&&i(o)}),h=ae.useCallback(O=>{let F=O["aria-describedby"]?O["aria-describedby"].split(" "):[];return F.push(...m,...d),{...O,"aria-describedby":Array.from(new Set(F)).join(" ")||void 0}},[m,d]),V=ae.useMemo(()=>({controlId:p,registerControlId:C,resetControlId:x,labelId:a,setLabelId:s,messageIds:d,setMessageIds:f,getDescriptionProps:h}),[p,C,x,a,s,d,f,h]);return(0,Ht.jsx)(Ze.Provider,{value:V,children:t.children})},"LabelableProvider");var et=R(T(),1);function Kt(e={}){let{id:t,enabled:o=!0}=e,{controlId:n,registerControlId:i,resetControlId:a}=U(),s=te(),d=Y(()=>Symbol()),f=et.useRef(!1),p=et.useRef(!1),l=I(()=>{!f.current||i===N||(f.current=!1,i(d.current,void 0))});return D(()=>{if(!o||i===N){l();return}let m;if(t!==void 0)p.current=!0,m=t;else if(p.current)m=s;else{a();return}if(m===void 0){l();return}f.current=!0,i(d.current,m)},[t,o,i,a,s,d,l]),D(()=>l,[l]),(o?n:void 0)??t??s}r(Kt,"useLabelableId");var we={};Z(we,{engine:()=>it,env:()=>at,mediaQuery:()=>lt,os:()=>ot,screenReader:()=>st});var ot={};Z(ot,{android:()=>Gt,apple:()=>rt,ios:()=>tt,linux:()=>Wr,mac:()=>Jt,windows:()=>$r});function Ur(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}r(Ur,"readRawData");var{userAgent:Br,platform:jr,maxTouchPoints:Yt}=Ur(),ue=Br.toLowerCase(),de=jr.toLowerCase();var tt=/^i(os$|p)/.test(de)||de==="macintel"&&Yt>1,zt="android",Gt=de===zt||ue.includes(zt),Jt=!tt&&de.startsWith("mac"),$r=de.startsWith("win"),Wr=!Gt&&/^(linux|chrome os)/.test(de),rt=Jt||tt;var it={};Z(it,{blink:()=>Hr,gecko:()=>qr,webkit:()=>nt});var nt=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),qr=!nt&&ue.includes("firefox"),Hr=!nt&&ue.includes("chrom");var st={};Z(st,{voiceOver:()=>Kr});var Kr=rt;var at={};Z(at,{jsdom:()=>Yr});var Yr=/jsdom|happydom/.test(ue);var lt={};Z(lt,{iOS:()=>zr});var zr="@supports (-webkit-touch-callout: none)";function ct(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}r(ct,"activeElement");function Qt(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&Mt(o)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}r(Qt,"contains");function ut(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}r(ut,"getTarget");var dt="data-base-ui-focusable";var ft="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Hn="ArrowLeft",Kn="ArrowRight",Yn="ArrowUp",zn="ArrowDown";var xe="data-starting-style",Le="data-ending-style";var Gr={[xe]:""},Jr={[Le]:""},_e={transitionStatus(e){return e==="starting"?Gr:e==="ending"?Jr:null}};var Xt={};Z(Xt,{align:()=>eo,anchorHidden:()=>gt,closed:()=>bt,endingStyle:()=>Xr,open:()=>mt,side:()=>Zr,startingStyle:()=>Qr});var mt="data-open",bt="data-closed",Qr=xe,Xr=Le,gt="data-anchor-hidden",Zr="data-side",eo="data-align";var Me={};Z(Me,{popupOpen:()=>Pe,pressed:()=>xt});var Pe="data-popup-open",xt="data-pressed";var to={[Pe]:""},ro={[Pe]:"",[xt]:""},oo={[mt]:""},no={[bt]:""},io={[gt]:""},Xn={open(e){return e?to:null}},Zn={open(e){return e?ro:null}},so={open(e){return e?oo:no},anchorHidden(e){return e?io:null}},ei={...so,..._e};var oi=Me.popupOpen,Rt="data-trigger-disabled";function li(e,t){if(!Pt(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(Rt);for(let[,n]of t.entries())if(Qt(n,o))return!n.hasAttribute(Rt);return!1}r(li,"isTargetInsideEnabledTrigger");function ci(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(ci,"isEventTargetWithin");function ui(e){return e.matches("html,body")}r(ui,"isRootElement");function lo(e){return Fe(e)&&e.matches(ft)}r(lo,"isTypeableElement");function di(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ft}`)!=null}r(di,"isInteractiveElement");function fi(e){return e?e.getAttribute("role")==="combobox"&&lo(e):!1}r(fi,"isTypeableCombobox");function pi(e){if(!e||we.env.jsdom)return!0;try{return e.matches(":focus-visible")}catch{return!0}}r(pi,"matchesFocusVisible");function mi(e){return e?e.hasAttribute(dt)?e:e.querySelector(`[${dt}]`)||e:null}r(mi,"getFloatingFocusElement");function Zt(e,t){let o=te(e);return D(()=>(t(o),()=>{t(n=>n===o?void 0:n)}),[o,t]),o}r(Zt,"useRegisteredLabelId");function er(e={}){let{id:t,fallbackControlId:o,native:n=!1,setLabelId:i,focusControl:a}=e,{controlId:s,setLabelId:d}=U(),f=I(x=>{d(x),i?.(x)}),p=Zt(t,f),l=s??o;function m(x){if(a){a(x,l);return}if(!l)return;let h=De(x.currentTarget).getElementById(l);Fe(h)&&co(h)}r(m,"focusControl");function C(x){ut(x.nativeEvent)?.closest("button,input,select,textarea")||(!x.defaultPrevented&&x.detail>1&&x.preventDefault(),!n&&m(x))}return r(C,"handleInteraction"),n?{id:p,htmlFor:l,onMouseDown:C}:{id:p,onClick:C,onPointerDown(x){x.preventDefault()}}}r(er,"useLabel");function co(e){e.focus({focusVisible:!0})}r(co,"focusElementWithVisible");var se=R(T(),1);var tr=R(T(),1);function ke(e){tr.useEffect(e,Lt)}r(ke,"useOnMount");var Re=0,ht=class e{static{r(this,"Timeout")}static create(){return new e}currentId=Re;start(t,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Re,o()},t)}isStarted(){return this.currentId!==Re}clear=r(()=>{this.currentId!==Re&&(clearTimeout(this.currentId),this.currentId=Re)},"clear");disposeEffect=r(()=>this.clear,"disposeEffect")};function Ue(){let e=Y(ht.create).current;return ke(e.disposeEffect),e}r(Ue,"useTimeout");function fe(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}r(fe,"getCombinedFieldValidityData");var vt=Object.keys(ce);function uo(e,t){return e.matches(":disabled")?!1:!t||e.form===t?!0:e.form===null&&!e.hasAttribute("form")}r(uo,"isEligibleInput");function rr(e,t){let o=null;for(let n of e.keys())if(uo(n,t)){if(!n.validity.valid)return n;o??=n}return o}r(rr,"findRepresentativeInput");function or(e){return{...ce,valid:!e,customError:e}}r(or,"makeState");function Ct(e){return e&&e.validationMessage?[e.validationMessage]:[]}r(Ct,"getNativeErrors");function nr(e){let{elementRef:t,formRef:o}=ee(),{setValidityData:n,validate:i,validityData:a,validationDebounceTime:s,invalid:d,markedDirtyRef:f,state:p,shouldValidateOnChange:l,validationMode:m,registeredFieldIdRef:C}=e,{controlId:x,getDescriptionProps:h}=U(),V=Ue(),O=se.useRef(null),F=Y(()=>new Map).current,v=se.useRef(0),_=se.useRef(null),k=se.useCallback((w,B)=>(F.set(w,B),()=>{F.delete(w)}),[F]),c=I(()=>{let w=rr(F,t.current);return w&&F.get(w)?.controlRef.current||null}),S=I(async(w,B=!1)=>{v.current+=1;let A=v.current;function K(u,b=d){let g=C.current??x;if(g==null)return;let y=o.current.fields.get(g);if(!y)return;let $=fe(u,b);o.current.fields.set(g,{...y,validityData:$})}r(K,"updateRegisteredFieldValidity");function oe(u,b){let g=u.valid===!1?b:[];return{value:w,state:u,error:g[0]??"",errors:g,initialValue:a.initialValue}}r(oe,"makeValidityData");function ne(u,b){let g=u.validity.customError?u.validationMessage:"",y=b.replace(/\r\n?/g,`
2
+ `);u.setCustomValidity(y),_.current=[u,y,g]}r(ne,"setCustomValidity");function Q(){let u=_.current;_.current=null,u&&(!u[0].willValidate||u[0].validationMessage===u[1])&&u[0].setCustomValidity(u[2])}r(Q,"clearCustomValidity");function P(u,b,g){let y=oe(u,b);K(y,g),n(y)}r(P,"publish");function J(u){let b=vt.reduce((y,$)=>(y[$]=u.validity[$],y),{}),g=!1;for(let y of vt)if(y!=="valid"){if(y==="valueMissing"&&b[y])g=!0;else if(b[y])return b}return g&&!f.current&&(b.valid=!0,b.valueMissing=!1),b}r(J,"getState");function ie(){return F.size>0?rr(F,t.current):O.current}r(ie,"resolveRepresentativeInput");let L=ie();function X(){return L=ie(),L?.willValidate?J(L):or(!1)}if(r(X,"refreshState"),B){if(p.valid!==!1||!L)return;if(!L.validity.valueMissing){Q();let u=ie(),b=u?.validity.customError?Ct(u):[];P(or(b.length>0),b,!1);return}for(let u of vt)if(u!=="valid"&&u!=="valueMissing"&&u!=="customError"&&L.validity[u])return}V.clear(),Q();let j=X(),q=Ct(L),be=l();if(q.length===0||be){let u=Array.from(o.current.fields.values()).reduce((y,$)=>($.name&&(y[$.name]=$.getValue()),y),{}),b=i(w,u),g;if(typeof b=="object"&&b!==null&&"then"in b){if(j.valid===!1?P(j,q):(m==="onSubmit"||!a.state.customError)&&(j.valid=null,P(j,q)),g=await b,A!==v.current)return;j=X()}else g=b;q=g?[].concat(g).filter(Boolean):[],q.length>0?(j.valid=!1,j.customError=!0,L?.willValidate&&ne(L,q.join(`
3
+ `))):q=Ct(L)}P(j,q)}),E=I((w,B=!1)=>{if(V.clear(),v.current+=1,B)return;let A=l();A&&w!==""&&s?V.start(s,()=>{S(w)}):S(w,!A)}),H=se.useCallback((w,B={})=>wt(h(B),p.valid===!1&&!p.disabled&&!w?{"aria-invalid":!0}:ge),[h,p.disabled,p.valid]);return se.useMemo(()=>({getValidationProps:H,inputRef:O,registeredInputs:F,registerInput:k,getInputControl:c,commit:S,change:E}),[H,F,k,c,S,E])}r(nr,"useFieldValidation");var Be=R(T(),1);function ir(e){let{change:t,commit:o,invalid:n,markedDirtyRef:i,name:a,setRegisteredFieldName:s,registeredFieldIdRef:d,setValidityData:f,validityData:p}=e,{formRef:l}=ee(),m=Be.useRef(null),C=Be.useRef(null),x=Be.useRef(!1),h=I(()=>{let c=C.current;if(c)return c.getValue?c.getValue():c.value});function V(c){return c.value===void 0?h():c.value}r(V,"getRegistrationValue");let O=I(()=>{let c=C.current;if(i.current=!0,!c){o(p.value);return}o(V(c))});function F(){let c=C.current;!c||!c.id||l.current.fields.set(c.id,{getValue:h,name:a??c.name,controlRef:c.controlRef,validityData:fe(p,n),validate:O})}r(F,"refreshRegistration");function v(c=C.current?.id){c&&l.current.fields.delete(c)}r(v,"deleteRegistration");function _(c){if(x.current)return;x.current=!0;let S=V(c);f(E=>E.initialValue===S?E:{...E,initialValue:S})}r(_,"captureInitialValue"),D(()=>{let c=C.current;!c||!c.id||(s(a?void 0:c.name),l.current.fields.set(c.id,{getValue:h,name:a??c.name,controlRef:c.controlRef,validityData:fe(p,n),validate:O}))},[l,h,n,a,s,O,p]),D(()=>{let c=l.current.fields;return()=>{let S=C.current?.id;S&&c.delete(S)}},[l]);let k=I((c,S)=>{if(!S){m.current===c&&(m.current=null,t(void 0,!0),v(),C.current=null,s(void 0),d.current=void 0);return}let E=C.current?.id,H=m.current;H&&H!==c&&t(void 0,!0),m.current=c,C.current=S,a||s(S.name),d.current=S.id,E&&E!==S.id&&v(E),_(S),F()});return[O,k]}r(ir,"useFieldControlRegistration");var je=R(le(),1);var fo=M.forwardRef(r(function(t,o){let{errors:n,validationMode:i,submitCountRef:a}=ee(),{render:s,className:d,validate:f,validationDebounceTime:p=0,validationMode:l=i,name:m,disabled:C=!1,invalid:x,dirty:h,touched:V,actionsRef:O,style:F,...v}=t,_=jt(!0)?.disabled,k=I(f||(()=>null)),c=_||C,[S,E]=M.useState(!1),[H,w]=M.useState(!1),[B,A]=M.useState(!1),[K,oe]=M.useState(!1),ne=h??H,Q=V??S,P=M.useRef(ne),J=M.useRef(void 0),[ie,L]=M.useState(),X=m??ie;D(()=>{h!==void 0&&(P.current=h)},[h]);let j=I(Ie=>{h===void 0&&(Ie&&(P.current=!0),w(Ie))}),q=I(Ie=>{V===void 0&&E(Ie)}),be=I(()=>l==="onChange"||l==="onSubmit"&&a.current>0),u=X&&Object.hasOwn(n,X)?n[X]:null,b=!!(Array.isArray(u)?u.length:u),g=x===!0||b,[y,$]=M.useState({state:ce,error:"",errors:[],value:null,initialValue:null}),Tt=!g&&(c?null:y.state.valid),Ce=M.useMemo(()=>({disabled:c,touched:Q,dirty:ne,valid:Tt,filled:B,focused:K}),[c,Q,ne,Tt,B,K]),Ee=nr({setValidityData:$,validate:k,validityData:y,validationDebounceTime:p,invalid:g,markedDirtyRef:P,state:Ce,shouldValidateOnChange:be,validationMode:l,registeredFieldIdRef:J}),[Ot,Vt]=ir({change:Ee.change,commit:Ee.commit,invalid:g,markedDirtyRef:P,name:m,setRegisteredFieldName:L,registeredFieldIdRef:J,setValidityData:$,validityData:y});M.useImperativeHandle(O,()=>({validate:Ot}),[Ot]);let Tr=M.useMemo(()=>({invalid:g,name:X,validityData:y,setValidityData:$,disabled:c,setTouched:q,setDirty:j,setFilled:A,setFocused:oe,validationMode:l,shouldValidateOnChange:be,state:Ce,registerFieldControl:Vt,validation:Ee}),[g,X,y,c,q,j,A,oe,l,be,Ce,Vt,Ee]),Or=z("div",t,{ref:o,state:Ce,props:v,stateAttributesMapping:G});return(0,je.jsx)(Xe.Provider,{value:Tr,children:Or})},"FieldRootInner")),sr=M.forwardRef(r(function(t,o){return(0,je.jsx)(Ne,{children:(0,je.jsx)(fo,{...t,ref:o})})},"FieldRoot"));var he=R(T(),1);var $e=R(T(),1);var Et=$e.createContext({disabled:!1});function We(){return $e.useContext(Et)}r(We,"useFieldItemContext");var ar=he.forwardRef(r(function(t,o){let{render:n,className:i,style:a,id:s,nativeLabel:d=!0,...f}=t,p=W(!1),l=We(),{labelId:m}=U(),C={...p.state,disabled:p.disabled||l.disabled},x=he.useRef(null),h=er({id:m??s,native:d});return z("label",t,{ref:[o,x],state:C,props:[h,f],stateAttributesMapping:G})},"FieldLabel"));var pe=R(T(),1);var dr=R(T(),1);var yt=R(Vr(),1);var qe=null,Fs=globalThis.requestAnimationFrame,It=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.callbacks[o]=null,this.callbacksCount-=1)}},He=new It;var re=class e{static{r(this,"AnimationFrame")}static create(){return new e}static request(t){return He.request(t)}static cancel(t){return He.cancel(t)}currentId=qe;request(t){this.cancel(),this.currentId=He.request(()=>{this.currentId=qe,t()})}cancel=r(()=>{this.currentId!==qe&&(He.cancel(this.currentId),this.currentId=qe)},"cancel");disposeEffect=r(()=>this.cancel,"disposeEffect")};function lr(){let e=Y(re.create).current;return ke(e.disposeEffect),e}r(lr,"useAnimationFrame");function cr(e){return e==null?e:"current"in e?e.current:e}r(cr,"resolveRef");var Ke=null;function po(e){if(!Ke){let t=[];Ke=t,queueMicrotask(()=>{Ke=null,yt.flushSync(()=>{for(let o of t)o()})})}Ke.push(e)}r(po,"flushBeforePaint");function ur(e,t=!1,o=!1){let n=lr();return I((i,a=null)=>{n.cancel();let s=cr(e);if(s==null)return;let d=s,f=r(()=>{if(!o){yt.flushSync(i);return}po(()=>{a?.aborted||i()})},"done");if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function p(){Promise.all(d.getAnimations().map(l=>l.finished)).then(()=>{a?.aborted||f()},()=>{if(a?.aborted)return;if(d.getAnimations().some(m=>m.pending||m.playState!=="finished")){p();return}f()})}if(r(p,"exec"),t){let l=xe;if(!d.hasAttribute(l)){n.request(p);return}let m=new MutationObserver(()=>{d.hasAttribute(l)||(m.disconnect(),p())});m.observe(d,{attributes:!0,attributeFilter:[l]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}n.request(p)})}r(ur,"useAnimationsFinished");function fr(e){let{enabled:t=!0,open:o,ref:n,batch:i=!1,onComplete:a}=e,s=I(a),d=ur(n,o,i);dr.useEffect(()=>{if(!t)return;let f=new AbortController;return d(s,f.signal),()=>{f.abort()}},[t,o,s,d])}r(fr,"useOpenChangeComplete");var Ft=R(T(),1);function Ye(e,t=!1,o=!1,n=!1){let[i,a]=Ft.useState(e&&t?"idle":void 0),[s,d]=Ft.useState(e&&!n);return e&&!s&&(d(!0),a("starting")),!e&&s&&i!=="ending"&&!o&&a("ending"),!e&&!s&&i==="ending"&&a(void 0),D(()=>{if(!e&&s&&i!=="ending"&&o){let f=re.request(()=>{a("ending")});return()=>{re.cancel(f)}}},[e,s,i,o]),D(()=>{if(!e||t)return;let f=re.request(()=>{a(void 0)});return()=>{re.cancel(f)}},[t,e]),D(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&a("starting");let f=re.request(()=>{a("idle")});return()=>{re.cancel(f)}},[t,e,s,i]),{mounted:s,setMounted:d,transitionStatus:i}}r(Ye,"useTransitionStatus");var Dt=R(le(),1);var mo={...G,..._e},pr=pe.forwardRef(r(function(t,o){let{render:n,id:i,className:a,match:s,style:d,...f}=t,p=te(i),{validityData:l,state:m,name:C}=W(!1),{setMessageIds:x}=U(),{errors:h}=ee(),V=C&&Object.hasOwn(h,C)?h[C]:null,O=!!(Array.isArray(V)?V.length:V),F=typeof s=="string",v=!1;s===!0?v=!0:m.disabled?v=!1:F?v=!!l.state[s]:v=O||l.state.valid===!1;let{mounted:_,transitionStatus:k,setMounted:c}=Ye(v);D(()=>{if(!(!v||!p))return x(P=>P.concat(p)),()=>{x(P=>P.filter(J=>J!==p))}},[v,p,x]);let S=pe.useRef(null),[E,H]=pe.useState(null),[w,B]=pe.useState(null),A=l.error;!F&&O?A=V:l.errors.length>1&&(A=l.errors);let K=A;Array.isArray(A)&&(K=A.length>1?(0,Dt.jsx)("ul",{children:A.map(P=>(0,Dt.jsx)("li",{children:P},P))}):A[0]);let oe=Array.isArray(A)?JSON.stringify(A):A;v&&oe!==w&&(B(oe),H(K)),fr({open:v,ref:S,onComplete(){v||c(!1)}});let ne={...m,transitionStatus:k},Q=z("div",t,{ref:[o,S],state:ne,props:[{id:p,children:v?K:E},f],stateAttributesMapping:mo,enabled:_});return _?Q:null},"FieldError"));var mr=R(T(),1);var br=mr.forwardRef(r(function(t,o){let{render:n,id:i,className:a,style:s,...d}=t,f=te(i),p=W(!1),l=We(),{setMessageIds:m}=U(),C={...p.state,disabled:p.disabled||l.disabled};return D(()=>{if(f)return m(h=>h.concat(f)),()=>{m(h=>h.filter(V=>V!==f))}},[f,m]),z("p",t,{ref:o,state:C,props:[{id:f},d],stateAttributesMapping:G})},"FieldDescription"));var Ge=R(T(),1);var me=R(T(),1);function gr({controlled:e,default:t,name:o,state:n="value"}){let{current:i}=me.useRef(e!==void 0),[a,s]=me.useState(t),d=i&&e!==void 0?e:a,f=me.useCallback(p=>{i||s(p)},[]);return[d,f]}r(gr,"useControlled");function xr(e,t,o,n,i=!0,a){let{registerFieldControl:s}=W(),d=Y(()=>Symbol());D(()=>{let f=d.current;if(!i){s(f,void 0);return}s(f,{controlRef:e,getValue:n,id:t,name:a,value:o})},[e,i,n,t,a,s,d,o]),D(()=>{let f=d.current;return()=>{s(f,void 0)}},[s,d])}r(xr,"useRegisterFieldControl");var Rr=R(T(),1);function hr(e,t){let o=Rr.useRef(e),n=I(t);D(()=>{o.current!==e&&n(o.current),o.current=e},[e,n])}r(hr,"useValueChanged");var ze={};Z(ze,{cancelOpen:()=>$o,chipRemovePress:()=>yo,clearPress:()=>Io,closePress:()=>Co,closeWatcher:()=>_o,decrementPress:()=>So,disabled:()=>qo,drag:()=>Uo,escapeKey:()=>Lo,focusOut:()=>wo,imperativeAction:()=>Yo,incrementPress:()=>Do,initial:()=>Ko,inputBlur:()=>Oo,inputChange:()=>Ao,inputClear:()=>To,inputPaste:()=>Vo,inputPress:()=>No,itemPress:()=>vo,keyboard:()=>Mo,linkPress:()=>Eo,listNavigation:()=>Po,missing:()=>Ho,none:()=>bo,outsidePress:()=>ho,pointer:()=>ko,scrub:()=>jo,siblingOpen:()=>Wo,swipe:()=>zo,trackPress:()=>Fo,triggerFocus:()=>Ro,triggerHover:()=>xo,triggerPress:()=>go,wheel:()=>Bo,windowResize:()=>Go});var bo="none",go="trigger-press",xo="trigger-hover",Ro="trigger-focus",ho="outside-press",vo="item-press",Co="close-press",Eo="link-press",Io="clear-press",yo="chip-remove-press",Fo="track-press",Do="increment-press",So="decrement-press",Ao="input-change",To="input-clear",Oo="input-blur",Vo="input-paste",No="input-press",wo="focus-out",Lo="escape-key",_o="close-watcher",Po="list-navigation",Mo="keyboard",ko="pointer",Uo="drag",Bo="wheel",jo="scrub",$o="cancel-open",Wo="sibling-open",qo="disabled",Ho="missing",Ko="initial",Yo="imperative-action",zo="swipe",Go="window-resize";function vr(e,t,o,n){let i=!1,a=!1,s=n??ge;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:o,...s}}r(vr,"createChangeEventDetails");var Cr=Ge.forwardRef(r(function(t,o){let{render:n,className:i,id:a,name:s,value:d,disabled:f=!1,onValueChange:p,defaultValue:l,autoFocus:m=!1,style:C,...x}=t,{state:h,name:V,disabled:O,setTouched:F,setDirty:v,validityData:_,setFocused:k,setFilled:c,validationMode:S,validation:E}=W(),{clearErrors:H,elementRef:w,submitCountRef:B}=ee(),A=O||f,K=V??s,oe={...h,disabled:A},{labelId:ne}=U(),Q=Kt({id:a}),[P]=gr({controlled:d,default:l,name:"FieldControl",state:"value"}),J=d!==void 0,ie=J?P:void 0,L=ie==null?void 0:String(ie),X=I(()=>E.inputRef.current?.value);xr(E.inputRef,Q,L,X,!A,s),D(()=>{let u=L??E.inputRef.current?.value;u!==void 0&&c(u!=="")},[L,E.inputRef,c]),hr(L,()=>{L!==void 0&&(H(K),v(L!==(_.initialValue??"")),E.change(L))});let j=Ge.useRef(null),q=Ue();return D(()=>{m&&j.current===ct(De(j.current))&&k(!0)},[m,k]),z("input",t,{ref:[o,j],state:oe,props:[{id:Q,disabled:A,name:K,ref:E.inputRef,"aria-labelledby":ne,autoFocus:m,...J?{value:ie}:{defaultValue:l},onChange(u){let b=u.currentTarget.value,g=vr(ze.none,u.nativeEvent);p?.(b,g),!J&&(v(b!==(_.initialValue??"")),c(b!==""),!u.nativeEvent.defaultPrevented&&!g.isCanceled&&(H(K),E.change(b)))},onFocus(){k(!0)},onBlur(u){if(F(!0),k(!1),S==="onBlur"){let b=u.currentTarget.value;E.commit(b),J&&queueMicrotask(()=>{let g=E.inputRef.current?.value;g!==void 0&&g!==b&&g!==(_.initialValue??"")&&E.commit(g)})}},onKeyDown(u){if(u.currentTarget.tagName==="INPUT"&&u.key==="Enter"){F(!0);let b=u.currentTarget.value,g=u.currentTarget.form;if(g&&g===w.current&&!u.defaultPrevented){let y=u.currentTarget,$=B.current;q.start(0,()=>{B.current===$&&E.commit(y.value)})}else E.commit(b)}}},x,u=>E.getValidationProps(A,u)],stateAttributesMapping:G})},"FieldControl"));var ve=R(T(),1);var Er=R(le(),1);var Ir=r(function(t){let{children:o}=t,{validityData:n,invalid:i}=W(!1),a=ve.useMemo(()=>fe(n,i),[n,i]),s=a.state.valid===!1,{transitionStatus:d}=Ye(s),f=ve.useMemo(()=>({...a,validity:a.state,transitionStatus:d}),[a,d]);return(0,Er.jsx)(ve.Fragment,{children:o(f)})},"FieldValidity");var Je=R(T(),1);var St=R(le(),1);var yr=Je.forwardRef(r(function(t,o){let{render:n,className:i,style:a,disabled:s=!1,...d}=t,{state:f,disabled:p}=W(!1),l=p||s,m={...f,disabled:l},C=Je.useMemo(()=>({disabled:l}),[l]),x=z("div",t,{ref:o,state:m,props:d,stateAttributesMapping:G});return(0,St.jsx)(Ne,{children:(0,St.jsx)(Et.Provider,{value:C,children:x})})},"FieldItem"));var Dr=R(le(),1);var At=Fr.forwardRef(r(function(t,o){return(0,Dr.jsx)(Qe.Control,{ref:o,...t})},"Input"));var Ar=R(le(),1);function gl(e){let t=(0,Sr.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 a;t[4]!==o?(a=Nt("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]=a):a=t[5];let s;return t[6]!==n||t[7]!==a||t[8]!==i?(s=(0,Ar.jsx)(At,{type:i,"data-slot":"input",className:a,...n}),t[6]=n,t[7]=a,t[8]=i,t[9]=s):s=t[9],s}r(gl,"m");export{G as a,W as b,ee as c,qt as d,te as e,U as f,Kt as g,we as h,ct as i,Qt as j,ut as k,dt as l,Hn as m,Kn as n,Yn as o,zn as p,_e as q,Xt as r,Me as s,Xn as t,Zn as u,so as v,ei as w,Rt as x,li as y,ci as z,ui as A,lo as B,di as C,fi as D,pi as E,mi as F,er as G,ke as H,ht as I,Ue as J,We as K,re as L,lr as M,cr as N,ur as O,fr as P,Ye as Q,gr as R,xr as S,hr as T,ze as U,vr as V,gl as W};
@@ -0,0 +1 @@
1
+ import{b as p,c as l}from"./chunk-OKG3HWSJ.js";import{a as t,d as g,e as h}from"./chunk-YKXDMIHQ.js";var u=g(h(),1);var a={console:"`",palette:"k"},c="lunora-studio-shortcuts",r=new Set,w=t(o=>{let n=typeof o?.console=="string"?o.console.toLowerCase():void 0,s=typeof o?.palette=="string"?o.palette.toLowerCase():void 0;return n?.length===1&&s?.length===1&&n!==s?{console:n,palette:s}:a},"p"),e=a,m=t(()=>{e=w(p(c)[0]);for(let o of r)o()},"S");m();var y=t(o=>(r.add(o),()=>{r.delete(o)}),"g"),i=t(()=>e,"a"),S=t(()=>(0,u.useSyncExternalStore)(y,i,i),"w"),L=t((o,n)=>{if(n.length!==1)return;let s=n.toLowerCase(),f=o==="console"?"palette":"console";e=e[f]===s?{...e,[o]:s,[f]:e[o]}:{...e,[o]:s},l(c,[e]);for(let d of r)d()},"y"),v=t(()=>{e=a,l(c,[e]);for(let o of r)o()},"C");export{S as a,L as b,v as c};
@@ -0,0 +1 @@
1
+ import{a as H}from"./chunk-66UGPQVC.js";import{b as x}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as z}from"./chunk-FPG5ZRPW.js";import{f as O}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as _}from"./chunk-FKVZRPV5.js";import{a as q,b as B,c as E,d as S,e as i,f as s}from"./chunk-HEAQVSNS.js";import{a as A,e as L}from"./chunk-WUWBZPUK.js";import{d as W}from"./chunk-FODLDLE2.js";import{a as R,d as M,f as $,g as D}from"./chunk-YKXDMIHQ.js";var I=M($(),1);var n=M(D(),1);var F=2e3,G=new Set(["open"]),ie=R(Q=>{let e=(0,I.c)(41),{read:y}=Q,t=W(),j=O(),v;e[0]!==j||e[1]!==y?(v=R(()=>Promise.resolve(y?y():j.debug()),"T"),e[0]=j,e[1]=y,e[2]=v):v=e[2];let V=v,K=y?"injected":"live",b;e[3]!==K?(b=["lunora-studio","sync-client-debug",K],e[3]=K,e[4]=b):b=e[4];let{data:c,refetch:Y}=z(b,V);if(H(Y,!0,F),!c){let r;e[5]!==t?(r=t("Reading the sync client's state\u2026"),e[5]=t,e[6]=r):r=e[6];let g;e[7]!==t?(g=t("Sync client"),e[7]=t,e[8]=g):g=e[8];let T;return e[9]!==r||e[10]!==g?(T=(0,n.jsx)(A,{children:(0,n.jsx)(L,{children:(0,n.jsx)(_,{description:r,title:g})})}),e[9]=r,e[10]=g,e[11]=T):T=e[11],T}let{pendingWrites:k,shards:N,subscriptions:w}=c,a;e[12]!==t?(a=t("This Studio session's sync client"),e[12]=t,e[13]=a):a=e[13];let l;e[14]!==a?(l=(0,n.jsx)("span",{className:"text-sm font-medium",children:a}),e[14]=a,e[15]=l):l=e[15];let P=c.connectionStatus==="connected"?"default":"secondary",o;e[16]!==c.connectionStatus||e[17]!==P?(o=(0,n.jsx)(x,{variant:P,children:c.connectionStatus}),e[16]=c.connectionStatus,e[17]=P,e[18]=o):o=e[18];let d;e[19]!==k||e[20]!==t?(d=k>0?(0,n.jsx)(x,{variant:"secondary",children:t("{count} pending writes",{count:k})}):null,e[19]=k,e[20]=t,e[21]=d):d=e[21];let h;e[22]!==l||e[23]!==o||e[24]!==d?(h=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[l,o,d]}),e[22]=l,e[23]=o,e[24]=d,e[25]=h):h=e[25];let u;e[26]!==t?(u=t("Reads client.debug() for the client running in this page \u2014 not your application's client. Call client.debug() in your app to diagnose a specific stuck overlay there."),e[26]=t,e[27]=u):u=e[27];let m;e[28]!==u?(m=(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:u}),e[28]=u,e[29]=m):m=e[29];let p;e[30]!==N||e[31]!==t?(p=N.length===0?(0,n.jsx)(_,{description:t("No shard connection has been opened yet."),title:t("No shards")}):(0,n.jsxs)(q,{children:[(0,n.jsx)(B,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(i,{children:t("Shard")}),(0,n.jsx)(i,{children:t("Socket")}),(0,n.jsx)(i,{children:t("Confirmed watermark")})]})}),(0,n.jsx)(E,{children:N.map(r=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{children:r.shardKey??t("(default)")}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:G.has(r.wsState)?"default":"secondary",children:r.wsState})}),(0,n.jsx)(s,{children:r.confirmedMutationWatermark})]},r.shardKey??"__default__"))})]}),e[30]=N,e[31]=t,e[32]=p):p=e[32];let f;e[33]!==w||e[34]!==t?(f=w.length===0?(0,n.jsx)(_,{description:t("This client holds no live queries or shapes."),title:t("No subscriptions")}):(0,n.jsxs)(q,{children:[(0,n.jsx)(B,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(i,{children:t("Subscription")}),(0,n.jsx)(i,{children:t("Kind")}),(0,n.jsx)(i,{children:t("Acked")}),(0,n.jsx)(i,{children:t("Cursor")}),(0,n.jsx)(i,{children:t("Pending overlays")})]})}),(0,n.jsx)(E,{children:w.map(r=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{className:"font-mono text-xs",children:r.functionPath}),(0,n.jsx)(s,{children:r.kind}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:r.acked?"default":"secondary",children:r.acked?t("yes"):t("no")})}),(0,n.jsx)(s,{children:r.serverCursor??"\u2014"}),(0,n.jsx)(s,{children:r.pendingOptimisticLayers})]},r.id))})]}),e[33]=w,e[34]=t,e[35]=f):f=e[35];let C;return e[36]!==m||e[37]!==p||e[38]!==f||e[39]!==h?(C=(0,n.jsx)(A,{children:(0,n.jsxs)(L,{className:"flex flex-col gap-4",children:[h,m,p,f]})}),e[36]=m,e[37]=p,e[38]=f,e[39]=h,e[40]=C):C=e[40],C},"ie");export{ie as default};
@@ -0,0 +1 @@
1
+ import{a as i,d as m,e as v,f as b}from"./chunk-YKXDMIHQ.js";var n=m(b(),1),r=m(v(),1);var x=i(function(t,a,s){let e=(0,n.c)(4),o=a===void 0?300:a,[d,f]=(0,r.useState)(t),[p,l]=(0,r.useState)(s);s!==void 0&&s!==p&&(l(s),f(t));let u,c;return e[0]!==o||e[1]!==t?(u=i(()=>{let T=setTimeout(()=>{f(t)},o);return()=>{clearTimeout(T)}},"c"),c=[t,o],e[0]=o,e[1]=t,e[2]=u,e[3]=c):(u=e[2],c=e[3]),(0,r.useEffect)(u,c),d},"T");export{x as a};
@@ -0,0 +1 @@
1
+ import{a as v}from"./chunk-F7UC63UN.js";import{a as Q}from"./chunk-66UGPQVC.js";import{a as L}from"./chunk-S3CRZLGS.js";import{a as G}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import"./chunk-AAVLPU5Q.js";import{b as $}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as W}from"./chunk-GWFZ7WCP.js";import"./chunk-ULIQFBZU.js";import"./chunk-4JJEP7LF.js";import"./chunk-35DM4JJG.js";import{a as E}from"./chunk-4ZEL6BYL.js";import{c as B}from"./chunk-FPG5ZRPW.js";import"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as A}from"./chunk-FKVZRPV5.js";import{a as q,b as H,c as O,d as K,e as T,f as D}from"./chunk-HEAQVSNS.js";import{a as _}from"./chunk-WUWBZPUK.js";import{d as j}from"./chunk-FODLDLE2.js";import{a as S,d as F,f as J,g as V}from"./chunk-YKXDMIHQ.js";var R=F(J(),1);var t=F(V(),1);var U=S(c=>`${c.toString()} ms`,"D"),X=S(c=>c.totalConnections===0&&c.shapePoke.passes===0&&c.whisper.passes===0&&c.shapeProbe.run===0&&c.shapeProbe.served===0&&c.globalPoll.drains===0&&c.globalPoll.pairsSkipped===0,"J"),z=S(c=>{let e=(0,R.c)(48),{counters:o,includeTiming:a,prefix:r,t:l,title:u}=c,d=`${r}-section`,n;e[0]!==u?(n=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:u}),e[0]=u,e[1]=n):n=e[1];let s=`${r}-stats`,i;e[2]!==l?(i=l("Passes"),e[2]=l,e[3]=i):i=e[3];let m=`${r}-passes`,I;e[4]!==o.passes||e[5]!==i||e[6]!==m?(I=(0,t.jsx)(v,{label:i,testId:m,value:o.passes}),e[4]=o.passes,e[5]=i,e[6]=m,e[7]=I):I=e[7];let g;e[8]!==l?(g=l("Sockets iterated"),e[8]=l,e[9]=g):g=e[9];let k=`${r}-iterated`,p;e[10]!==o.socketsIterated||e[11]!==g||e[12]!==k?(p=(0,t.jsx)(v,{label:g,testId:k,value:o.socketsIterated}),e[10]=o.socketsIterated,e[11]=g,e[12]=k,e[13]=p):p=e[13];let f;e[14]!==l?(f=l("Delivered"),e[14]=l,e[15]=f):f=e[15];let y=`${r}-delivered`,h;e[16]!==o.socketsDelivered||e[17]!==f||e[18]!==y?(h=(0,t.jsx)(v,{label:f,testId:y,value:o.socketsDelivered}),e[16]=o.socketsDelivered,e[17]=f,e[18]=y,e[19]=h):h=e[19];let x;e[20]!==l?(x=l("Peak width"),e[20]=l,e[21]=x):x=e[21];let N=`${r}-peak`,b;e[22]!==o.peakSocketsIterated||e[23]!==x||e[24]!==N?(b=(0,t.jsx)(v,{label:x,testId:N,value:o.peakSocketsIterated}),e[22]=o.peakSocketsIterated,e[23]=x,e[24]=N,e[25]=b):b=e[25];let C;e[26]!==o.totalMs||e[27]!==a||e[28]!==r||e[29]!==l?(C=a&&(0,t.jsx)(v,{label:l("Total time"),testId:`${r}-total-ms`,value:U(o.totalMs)}),e[26]=o.totalMs,e[27]=a,e[28]=r,e[29]=l,e[30]=C):C=e[30];let P;e[31]!==o.maxMs||e[32]!==a||e[33]!==r||e[34]!==l?(P=a&&(0,t.jsx)(v,{label:l("Max time"),testId:`${r}-max-ms`,value:U(o.maxMs)}),e[31]=o.maxMs,e[32]=a,e[33]=r,e[34]=l,e[35]=P):P=e[35];let M;e[36]!==h||e[37]!==b||e[38]!==C||e[39]!==P||e[40]!==s||e[41]!==I||e[42]!==p?(M=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":s,children:[I,p,h,b,C,P]}),e[36]=h,e[37]=b,e[38]=C,e[39]=P,e[40]=s,e[41]=I,e[42]=p,e[43]=M):M=e[43];let w;return e[44]!==d||e[45]!==M||e[46]!==n?(w=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":d,children:[n,M]}),e[44]=d,e[45]=M,e[46]=n,e[47]=w):w=e[47],w},"F"),Y=S(c=>{let e=(0,R.c)(20),{counters:o,t:a}=c,r;e[0]!==a?(r=a("Membership probes"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==a?(u=a("Queries run"),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==o.run||e[7]!==u?(d=(0,t.jsx)(v,{label:u,testId:"fanout-probe-run",value:o.run}),e[6]=o.run,e[7]=u,e[8]=d):d=e[8];let n;e[9]!==a?(n=a("Shared from cache"),e[9]=a,e[10]=n):n=e[10];let s;e[11]!==o.served||e[12]!==n?(s=(0,t.jsx)(v,{label:n,testId:"fanout-probe-served",value:o.served}),e[11]=o.served,e[12]=n,e[13]=s):s=e[13];let i;e[14]!==d||e[15]!==s?(i=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"fanout-probe-stats",children:[d,s]}),e[14]=d,e[15]=s,e[16]=i):i=e[16];let m;return e[17]!==l||e[18]!==i?(m=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-probe-section",children:[l,i]}),e[17]=l,e[18]=i,e[19]=m):m=e[19],m},"V"),Z=S(c=>{let e=(0,R.c)(20),{counters:o,t:a}=c,r;e[0]!==a?(r=a("Global shape polls"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==a?(u=a("Global reads"),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==o.drains||e[7]!==u?(d=(0,t.jsx)(v,{label:u,testId:"fanout-global-poll-drains",value:o.drains}),e[6]=o.drains,e[7]=u,e[8]=d):d=e[8];let n;e[9]!==a?(n=a("Pairs skipped"),e[9]=a,e[10]=n):n=e[10];let s;e[11]!==o.pairsSkipped||e[12]!==n?(s=(0,t.jsx)(v,{label:n,testId:"fanout-global-poll-pairs-skipped",value:o.pairsSkipped}),e[11]=o.pairsSkipped,e[12]=n,e[13]=s):s=e[13];let i;e[14]!==d||e[15]!==s?(i=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"fanout-global-poll-stats",children:[d,s]}),e[14]=d,e[15]=s,e[16]=i):i=e[16];let m;return e[17]!==l||e[18]!==i?(m=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-global-poll-section",children:[l,i]}),e[17]=l,e[18]=i,e[19]=m):m=e[19],m},"X"),pe=S(c=>{let e=(0,R.c)(31),{initialShardKey:o}=c,a=j(),{queryShardKey:r,setShardKey:l,shardKey:u}=L(o),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={},e[0]=d):d=e[0];let n;e[1]!==r?(n={keepPreviousData:!0,shardKey:r},e[1]=r,e[2]=n):n=e[2];let{data:s,error:i,errorSource:m,refetch:I}=B(E.getFanoutMetrics,d,n);Q(I,!0);let g;e[3]!==s?(g=s!==void 0&&X(s),e[3]=s,e[4]=g):g=e[4];let k=g,p;e[5]!==l||e[6]!==u?(p=(0,t.jsx)(G,{onChange:l,testId:"fanout-shard-input",value:u}),e[5]=l,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==s||e[9]!==a?(f=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"fanout-count",children:[s.promoted&&(0,t.jsx)($,{"data-testid":"fanout-promoted",variant:s.relayCount>=s.maxRelays?"destructive":"default",children:s.relayCount>=s.maxRelays?a("auto-scaled: {relayCount}/{maxRelays} relays (at ceiling)",{maxRelays:s.maxRelays,relayCount:s.relayCount}):a("auto-scaled: {relayCount}/{maxRelays} relays",{maxRelays:s.maxRelays,relayCount:s.relayCount})}),(0,t.jsx)($,{variant:"secondary",children:a("{count} connections",{count:s.totalConnections})}),(0,t.jsx)($,{variant:"secondary",children:a("peak {count} subscribers",{count:s.peakSubscribers})})]}),e[8]=s,e[9]=a,e[10]=f):f=e[10];let y;e[11]!==p||e[12]!==f?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13];let h;e[14]!==i||e[15]!==m?(h=i!==null&&(0,t.jsx)(W,{error:m,testId:"fanout-error"}),e[14]=i,e[15]=m,e[16]=h):h=e[16];let x;e[17]!==i||e[18]!==k||e[19]!==a?(x=i===null&&k&&(0,t.jsx)(A,{description:a("Realtime fan-out cost and per-topic subscriber counts for this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 12h4l3 7 4-14 3 7h2"})}),testId:"fanout-empty",title:a("No fan-out activity yet.")}),e[17]=i,e[18]=k,e[19]=a,e[20]=x):x=e[20];let N;e[21]!==i||e[22]!==k||e[23]!==s||e[24]!==a?(N=i===null&&s!==void 0&&!k&&(0,t.jsxs)(t.Fragment,{children:[s.topics.length>0&&(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-topics-section",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:a("Hot topics")}),(0,t.jsx)(_,{className:"overflow-hidden py-0",children:(0,t.jsxs)(q,{"data-testid":"fanout-topics-table",children:[(0,t.jsx)(H,{children:(0,t.jsxs)(K,{children:[(0,t.jsx)(T,{children:a("Topic")}),(0,t.jsx)(T,{children:a("Kind")}),(0,t.jsx)(T,{className:"text-right",children:a("Subscribers")})]})}),(0,t.jsx)(O,{children:s.topics.map(ee)})]})})]}),(0,t.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"fanout-cost",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:a("Fan-out cost since this instance woke")}),(0,t.jsx)(z,{counters:s.shapePoke,includeTiming:!0,prefix:"fanout-poke",t:a,title:a("Shape pokes")}),(0,t.jsx)(z,{counters:s.whisper,includeTiming:!1,prefix:"fanout-whisper",t:a,title:a("Whisper broadcasts")}),(0,t.jsx)(Y,{counters:s.shapeProbe,t:a}),(0,t.jsx)(Z,{counters:s.globalPoll,t:a})]})]}),e[21]=i,e[22]=k,e[23]=s,e[24]=a,e[25]=N):N=e[25];let b;return e[26]!==y||e[27]!==h||e[28]!==x||e[29]!==N?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"fanout-panel",children:[y,h,x,N]}),e[26]=y,e[27]=h,e[28]=x,e[29]=N,e[30]=b):b=e[30],b},"me");function ee(c){return(0,t.jsxs)(K,{"data-testid":"fanout-topic-row",children:[(0,t.jsx)(D,{className:"font-mono text-xs",children:c.topic}),(0,t.jsx)(D,{children:(0,t.jsx)($,{variant:"outline",children:c.kind})}),(0,t.jsx)(D,{className:"text-right font-medium tabular-nums",children:c.subscribers})]},`${c.kind}:${c.topic}`)}S(ee,"Y");export{pe as default};
@@ -0,0 +1 @@
1
+ import{b as g}from"./chunk-JBLAVREZ.js";import"./chunk-GWFZ7WCP.js";import"./chunk-ULIQFBZU.js";import"./chunk-4JJEP7LF.js";import"./chunk-35DM4JJG.js";import{a as f}from"./chunk-4ZEL6BYL.js";import{c as m}from"./chunk-FPG5ZRPW.js";import"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import"./chunk-HEAQVSNS.js";import"./chunk-WUWBZPUK.js";import{d as p}from"./chunk-FODLDLE2.js";import{a as r,d as h,f as S,g as A}from"./chunk-YKXDMIHQ.js";var R=h(S(),1);var k=h(A(),1);var _=r((e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("User subscriptions are ungated")})[s.kind],"k"),w=r(e=>Array.isArray(e.findings)?e.findings:[],"g"),b=r(e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],"S"),E=r((e,s)=>({"admin-token-weak":e("Your admin token is {length} characters \u2014 use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters \u2014 use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed \u2014 browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: anyone who can reach the worker can open a socket and run ordinary user subscriptions. Admin subscriptions are unaffected \u2014 they need the admin token. Set it if subscribers should present a shared credential.")})[s.kind],"A"),O=r(()=>{let e=(0,R.c)(8),s=p(),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let{data:a,error:d,errorSource:c}=m(f.getSecurityAudit,i),n;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:w(a);n=u===null?null:u.map(t=>({description:E(s,t),entity:b(t),issueType:_(s,t),key:t.kind,level:t.level})),e[1]=a,e[2]=s,e[3]=n}else n=e[3];let l=n,o;return e[4]!==d||e[5]!==c||e[6]!==l?(o=(0,k.jsx)(g,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"}),e[4]=d,e[5]=c,e[6]=l,e[7]=o):o=e[7],o},"T");export{O as default};
@@ -0,0 +1 @@
1
+ import{a as ae,b as tn,c as on}from"./chunk-V3CZW3JB.js";import{a as nn}from"./chunk-MU3P2FI7.js";import{a as ho,b as ko,c as wo,d as _o,e as Lo,f as Go,g as qo,h as Qo}from"./chunk-YPRQLCKF.js";import{$ as dt,A as Ro,B as xo,C as ct,E as Mo,G as bo,I as Co,J as vo,M as Io,N as Eo,O as yo,P as Po,R as So,S as No,T as Oo,U as To,W as Ut,Y as Do,_ as Ao,aa as Vo,ba as Bo,ca as pt,ea as Uo,fa as Ho,j as uo,k as co,la as zo,ma as Yo,na as Ko,oa as $o,p as Gt,qa as Wo,r as po,ra as Jo,s as lo,sa as Xo,u as mo,v as it,w as at,x as fo,y as ut,z as go}from"./chunk-GMS77BZD.js";import{b as jo}from"./chunk-3Q2P62UR.js";import{i as Zo,k as en}from"./chunk-V3VJAA4D.js";import{J as Ne,O as nt,P as Ue,Q as rt,R as st,U as y,V as re,d as Bt,e as Z,h as tt,j as Lt,q as so,t as io,u as Ft,v as ao,w as ot}from"./chunk-PLHA3OWK.js";import{a as lt,b as Fo,c as He}from"./chunk-IS6LVJ6L.js";import{a as ie,c as Se,i as oo,q as no,t as ro,w as $e}from"./chunk-AAVLPU5Q.js";import{a as he,c as G,d as Ze,e as et,g as Ge,h as Ke,i as se,j as O}from"./chunk-225VJ77I.js";import{a as o,c as sr,d as M,e as E,f as ir,g as me,i as Fe}from"./chunk-YKXDMIHQ.js";var Ve=M(ir(),1);var ee={};sr(ee,{Arrow:()=>sn,Backdrop:()=>un,CheckboxItem:()=>fn,CheckboxItemIndicator:()=>gn,Group:()=>Mn,GroupLabel:()=>bn,Handle:()=>qe,Item:()=>vn,LinkItem:()=>In,Popup:()=>yn,Portal:()=>Nn,Positioner:()=>On,RadioGroup:()=>kn,RadioItem:()=>Dn,RadioItemIndicator:()=>An,Root:()=>Dt,Separator:()=>nn,SubmenuRoot:()=>Un,SubmenuTrigger:()=>Jn,Trigger:()=>Kn,Viewport:()=>Wn,createHandle:()=>Xn});var rn=M(E(),1);var mt=M(E(),1);var Ht=mt.createContext(void 0);function K(t){let e=mt.useContext(Ht);if(e===void 0&&!t)throw new Error(G(33));return e}o(K,"useMenuPositionerContext");var ft=M(E(),1);var jt=ft.createContext(void 0);function D(t){let e=ft.useContext(jt);if(e===void 0&&!t)throw new Error(G(36));return e}o(D,"useMenuRootContext");var sn=rn.forwardRef(o(function(e,n){let{render:s,className:u,style:c,...i}=e,{store:p}=D(),{arrowRef:r,side:m,align:f,arrowUncentered:R,arrowStyles:h}=K(),P={open:p.useState("open"),side:m,align:f,uncentered:R};return O("div",e,{ref:[r,n],stateAttributesMapping:ao,state:P,props:{style:h,"aria-hidden":!0,...i}})},"MenuArrow"));var an=M(E(),1);var gt=M(E(),1);var ar=gt.createContext(void 0);function Oe(t=!0){let e=gt.useContext(ar);if(e===void 0&&!t)throw new Error(G(25));return e}o(Oe,"useContextMenuRootContext");var un=an.forwardRef(o(function(e,n){let{render:s,className:u,style:c,...i}=e,{store:p}=D(),r=p.useState("open"),m=p.useState("mounted"),f=p.useState("transitionStatus"),R=p.useState("lastOpenChangeReason"),h=Oe(),x={open:r,transitionStatus:f};return O("div",e,{ref:h?.backdropRef?[n,h.backdropRef]:n,state:x,stateAttributesMapping:ot,props:[{role:"presentation",hidden:!m,style:{pointerEvents:R===y.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i]})},"MenuBackdrop"));var Mt=M(E(),1);var Rt=M(E(),1);var zt=Rt.createContext(void 0);function cn(){let t=Rt.useContext(zt);if(t===void 0)throw new Error(G(30));return t}o(cn,"useMenuCheckboxItemContext");var je=M(E(),1);var dn=M(E(),1);function xt(t){let{closeOnClick:e,highlighted:n,id:s,nodeId:u,store:c,typingRef:i,itemRef:p,itemMetadata:r}=t,{events:m}=c.useState("floatingTreeRoot"),f=c.useState("open"),R=Oe(!0),h=R!==void 0;return dn.useMemo(()=>({id:s,role:"menuitem",tabIndex:f&&n?0:-1,onKeyDown(x){x.key===" "&&i?.current&&x.preventDefault()},onMouseMove(x){u&&m.emit("itemhover",{nodeId:u,target:x.currentTarget})},onClick(x){e&&m.emit("close",{domEvent:x,reason:y.itemPress})},onMouseUp(x){if(R){let P=R.initialCursorPointRef.current;if(R.initialCursorPointRef.current=null,h&&P&&Math.abs(x.clientX-P.x)<=1&&Math.abs(x.clientY-P.y)<=1||h&&!tt.os.mac&&x.button===2)return}p.current&&c.context.allowMouseUpTriggerRef.current&&(!h||x.button===2)&&r.type==="regular-item"&&Fo(p.current,x,{detail:1})}}),[e,n,s,m,u,f,c,i,p,R,h,r])}o(xt,"useMenuItemCommonProps");var Te={type:"regular-item"};function ke(t){let{closeOnClick:e,disabled:n,highlighted:s,id:u,store:c,typingRef:i=c.context.typingRef,nativeButton:p,itemMetadata:r,nodeId:m}=t,f=je.useRef(null),{getButtonProps:R,buttonRef:h}=He({disabled:n,focusableWhenDisabled:!0,native:p,composite:!0}),x=xt({closeOnClick:e,highlighted:s,id:u,nodeId:m,store:c,typingRef:i,itemRef:f,itemMetadata:r}),P=je.useCallback(A=>he(x,{onMouseEnter(){r.type==="submenu-trigger"&&r.setActive()}},A,R),[x,R,r]),S=et(f,h);return je.useMemo(()=>({getItemProps:P,itemRef:S}),[P,S])}o(ke,"useMenuItem");var pn="data-checked",ln="data-unchecked";var we={checked(t){return t?{[pn]:""}:{[ln]:""}},...so};var mn=M(me(),1);var fn=Mt.forwardRef(o(function(e,n){let{render:s,className:u,id:c,label:i,nativeButton:p=!1,disabled:r=!1,closeOnClick:m=!1,checked:f,defaultChecked:R,onCheckedChange:h,style:x,...P}=e,S=ae({guess:!0,label:i}),A=K(!0),d=Z(c),{store:g}=D(),l=g.useState("disabled"),V=r||l,v=g.useState("isActive",S.index),C=g.useState("itemProps"),[B,b]=st({controlled:f,default:R??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:z,itemRef:F}=ke({closeOnClick:m,disabled:V,highlighted:v,id:d,store:g,nativeButton:p,nodeId:A?.context.nodeId,itemMetadata:Te}),N=Mt.useMemo(()=>({disabled:V,highlighted:v,checked:B}),[V,v,B]);function a(Y){let T=re(y.itemPress,Y.nativeEvent,void 0,{preventUnmountOnClose:Ge});h?.(!B,T),!T.isCanceled&&b(k=>!k)}o(a,"handleClick");let H=O("div",e,{state:N,stateAttributesMapping:we,props:[C,{role:"menuitemcheckbox","aria-checked":B,onClick:a},P,z],ref:[F,n,S.ref]});return(0,mn.jsx)(zt.Provider,{value:N,children:H})},"MenuCheckboxItem"));var ht=M(E(),1);var gn=ht.forwardRef(o(function(e,n){let{render:s,className:u,style:c,keepMounted:i=!1,...p}=e,r=cn(),m=ht.useRef(null),{transitionStatus:f,mounted:R,setMounted:h}=rt(r.checked);Ue({batch:!0,enabled:!r.checked,open:r.checked,ref:m,onComplete(){r.checked||h(!1)}});let x={checked:r.checked,disabled:r.disabled,highlighted:r.highlighted,transitionStatus:f};return O("span",e,{state:x,ref:[n,m],stateAttributesMapping:we,props:{"aria-hidden":!0,...p},enabled:i||R})},"MenuCheckboxItemIndicator"));var Ct=M(E(),1);var bt=M(E(),1);var We=bt.createContext(void 0);function Rn(){let t=bt.useContext(We);if(t===void 0)throw new Error(G(31));return t}o(Rn,"useMenuGroupRootContext");var xn=M(me(),1);var Mn=Ct.forwardRef(o(function(e,n){let{render:s,className:u,style:c,...i}=e,[p,r]=Ct.useState(void 0),m=O("div",e,{ref:n,props:{role:"group","aria-labelledby":p,...i}});return(0,xn.jsx)(We.Provider,{value:r,children:m})},"MenuGroup"));var hn=M(E(),1);var bn=hn.forwardRef(o(function(e,n){let{render:s,className:u,style:c,id:i,...p}=e,r=Z(i),m=Rn();return ie(()=>(m(r),()=>{m(f=>f===r?void 0:f)}),[m,r]),O("div",e,{ref:n,props:{id:r,"aria-hidden":!0,...p}})},"MenuGroupLabel"));var Cn=M(E(),1);var vn=Cn.forwardRef(o(function(e,n){let{render:s,className:u,id:c,label:i,nativeButton:p=!1,disabled:r=!1,closeOnClick:m=!0,style:f,...R}=e,h=ae({guess:!0,label:i}),x=K(!0),P=Z(c),{store:S}=D(),A=S.useState("disabled"),d=r||A,g=S.useState("isActive",h.index),l=S.useState("itemProps"),{getItemProps:V,itemRef:v}=ke({closeOnClick:m,disabled:d,highlighted:g,id:P,store:S,nativeButton:p,nodeId:x?.context.nodeId,itemMetadata:Te});return O("div",e,{state:{disabled:d,highlighted:g},props:[l,R,V],ref:[v,n,h.ref]})},"MenuItem"));var vt=M(E(),1);var In=vt.forwardRef(o(function(e,n){let{render:s,className:u,id:c,label:i,closeOnClick:p=!1,style:r,...m}=e,f=vt.useRef(null),R=ae({guess:!0,label:i}),x=K(!0)?.context.nodeId,P=Z(c),{store:S}=D(),A=S.useState("isActive",R.index),d=S.useState("itemProps"),g=S.context.typingRef,{getButtonProps:l,buttonRef:V}=He({native:!1,composite:!0}),v=xt({closeOnClick:p,highlighted:A,id:P,nodeId:x,store:S,typingRef:g,itemRef:f,itemMetadata:Te});function C(b){return he(v,b,l)}return o(C,"getItemProps"),O("a",e,{state:{highlighted:A},props:[d,m,C],ref:[f,V,n,R.ref]})},"MenuLinkItem"));var It=M(E(),1);var En=M(me(),1);var yn=It.forwardRef(o(function(e,n){let{render:s,className:u,style:c,finalFocus:i,...p}=e,{store:r}=D(),{side:m,align:f}=K(),R=Xo(!0)!=null,h=r.useState("open"),x=r.useState("transitionStatus"),P=r.useState("popupProps"),S=r.useState("mounted"),A=r.useState("instantType"),d=r.useState("activeTriggerElement"),g=r.useState("parent"),l=r.useState("lastOpenChangeReason"),V=r.useState("rootId"),v=r.useState("floatingRootContext"),C=r.useState("floatingTreeRoot"),B=r.useState("closeDelay"),b=r.useState("hoverEnabled"),z=r.useState("disabled"),F=r.useState("openMethod"),N=g.type==="context-menu";Ue({open:h,ref:r.context.popupRef,onComplete(){h&&r.context.onOpenChangeComplete?.(!0)}}),It.useEffect(()=>{function k(ue){r.setOpen(!1,re(ue.reason,ue.domEvent))}return o(k,"handleClose"),C.events.on("close",k),()=>{C.events.off("close",k)}},[C.events,r]),Ao(v,{enabled:b&&!z&&!N&&g.type!=="menubar",closeDelay:B});let a=r.useStateSetter("popupElement"),H={transitionStatus:x,side:m,align:f,open:h,nested:g.type==="menu",instant:A},Y=O("div",e,{state:H,ref:[n,r.context.popupRef,a],stateAttributesMapping:ot,props:[P,{onKeyDown(k){R&&Jo.has(k.key)&&k.stopPropagation()}},Ko(x),p,{"data-rootownerid":V}]}),T=g.type===void 0||N;return(d||g.type==="menubar"&&l!==y.outsidePress)&&(T=!0),(0,En.jsx)(xo,{context:v,openInteractionType:F,modal:N,disabled:!S,returnFocus:i===void 0?T:i,initialFocus:g.type!=="menu",restoreFocus:!0,externalTree:g.type!=="menubar"?C:void 0,previousFocusableElement:d,nextFocusableElement:g.type===void 0?r.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?r.context.beforeContentFocusGuardRef:void 0,children:Y})},"MenuPopup"));var Sn=M(E(),1);var Et=M(E(),1);var Yt=Et.createContext(void 0);function Pn(){let t=Et.useContext(Yt);if(t===void 0)throw new Error(G(32));return t}o(Pn,"useMenuPortalContext");var Kt=M(me(),1);var Nn=Sn.forwardRef(o(function(e,n){let{keepMounted:s=!1,...u}=e,{store:c,parent:i}=D();if(!(c.useState("mounted")||s))return null;let m=i.type==="menu"||i.type==="menubar"?"group":void 0;return(0,Kt.jsx)(Yt.Provider,{value:s,children:(0,Kt.jsx)(mo,{ref:n,...u,portalOwnerRole:m})})},"MenuPortal"));var be=M(E(),1);var ze=M(me(),1);var On=be.forwardRef(o(function(e,n){let{anchor:s,positionMethod:u="absolute",className:c,render:i,side:p,align:r,sideOffset:m=0,alignOffset:f=0,collisionBoundary:R="clipping-ancestors",collisionPadding:h=5,arrowPadding:x=5,sticky:P=!1,disableAnchorTracking:S=!1,collisionAvoidance:A=po,style:d,...g}=e,{store:l}=D(),V=Pn(),v=Oe(!0),C=l.useState("parent"),B=l.useState("floatingRootContext"),b=l.useState("floatingTreeRoot"),z=l.useState("mounted"),F=l.useState("open"),N=l.useState("modal"),a=l.useState("openMethod"),H=l.useState("activeTriggerElement"),Y=l.useState("transitionStatus"),T=l.useState("positionerElement"),k=l.useState("instantType"),ue=l.useState("adaptiveOrigin"),te=l.useState("lastOpenChangeReason"),W=l.useState("floatingNodeId"),ye=l.useState("floatingParentNodeId"),w=B.useState("domReferenceElement"),fe=be.useRef(null),ge=nt(T),ce=s,Ce=m,Re=f,de=r,X=A;C.type==="context-menu"&&(ce=s??C.context?.anchor,de=de??"start",!p&&de!=="center"&&(Re=e.alignOffset??2,Ce=e.sideOffset??-5));let oe=p,pe=de;C.type==="menu"?(oe=oe??"inline-end",pe=pe??"start",X=e.collisionAvoidance??lo):C.type==="menubar"&&(oe=oe??(C.context.orientation==="vertical"?"inline-end":"bottom"),pe=pe??"start");let q=C.type==="context-menu",ne=zo({anchor:ce,floatingRootContext:B,positionMethod:v?"fixed":u,mounted:z,side:oe,sideOffset:Ce,align:pe,alignOffset:Re,arrowPadding:q?0:x,collisionBoundary:R,collisionPadding:h,sticky:P,nodeId:W,keepMounted:V,disableAnchorTracking:S,collisionAvoidance:X,shift:q?{crossAxis:!("side"in X&&X.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:b,adaptiveOrigin:ue});be.useEffect(()=>{function L(_){_.open&&(_.parentNodeId===W&&l.set("hoverEnabled",!1),_.nodeId!==W&&_.parentNodeId===l.select("floatingParentNodeId")&&l.setOpen(!1,re(y.siblingOpen)))}return o(L,"onMenuOpenChange"),b.events.on("menuopenchange",L),()=>{b.events.off("menuopenchange",L)}},[l,b.events,W]),be.useEffect(()=>{if(l.select("floatingParentNodeId")==null)return;function L(_){if(_.open||_.nodeId!==l.select("floatingParentNodeId"))return;let Ie=_.reason??y.siblingOpen;l.setOpen(!1,re(Ie))}return o(L,"onParentClose"),b.events.on("menuopenchange",L),()=>{b.events.off("menuopenchange",L)}},[b.events,l]);let le=Ne();be.useEffect(()=>{F||le.clear()},[F,le]),be.useEffect(()=>{function L(_){if(!(!F||_.nodeId!==l.select("floatingParentNodeId")))if(_.target&&H&&H!==_.target){let Ie=l.select("closeDelay");Ie>0?le.isStarted()||le.start(Ie,()=>{l.setOpen(!1,re(y.siblingOpen))}):l.setOpen(!1,re(y.siblingOpen))}else le.clear()}return o(L,"onItemHover"),b.events.on("itemhover",L),()=>{b.events.off("itemhover",L)}},[b.events,F,H,l,le]),be.useEffect(()=>{let L={open:F,nodeId:W,parentNodeId:ye,reason:l.select("lastOpenChangeReason")};b.events.emit("menuopenchange",L)},[b.events,F,l,W,ye]),ie(()=>{let L=w,_=fe.current;if(L&&(fe.current=L),_&&L&&L!==_){l.set("instantType",void 0);let Ie=new AbortController;return ge(()=>{l.set("instantType","trigger-change")},Ie.signal),()=>{Ie.abort()}}},[w,ge,l]);let Be={open:F,side:ne.side,align:ne.align,anchorHidden:ne.anchorHidden,nested:C.type==="menu",instant:k},Le=C.type==="menubar"&&C.context.modal,xe=N&&te!==y.triggerHover;Wo(F&&(Le||xe),a==="touch",T,H);let Me=$o(e,Be,{styles:ne.positionerStyles,transitionStatus:Y,props:g,refs:[n,l.useStateSetter("positionerElement")],hidden:!z,inert:!F}),Pe=z&&C.type!=="menu"&&(C.type!=="menubar"&&N&&te!==y.triggerHover||C.type==="menubar"&&C.context.modal),ve=null;return C.type==="menubar"?ve=C.context.contentElement:C.type===void 0&&(ve=H),(0,ze.jsxs)(Ht.Provider,{value:ne,children:[Pe&&(0,ze.jsx)(Yo,{ref:C.type==="context-menu"||C.type==="nested-context-menu"?C.context.internalBackdropRef:null,inert:Ho(!F),cutout:ve}),(0,ze.jsx)(go,{id:W,children:(0,ze.jsx)(tn,{elementsRef:l.context.itemDomElements,labelsRef:l.context.itemLabels,children:Me})})]})},"MenuPositioner"));var _e=M(E(),1);var yt=M(E(),1);var $t=yt.createContext(void 0);function Tn(){let t=yt.useContext($t);if(t===void 0)throw new Error(G(34));return t}o(Tn,"useMenuRadioGroupContext");var Wt=M(me(),1);var kn=_e.memo(_e.forwardRef(o(function(e,n){let{render:s,className:u,value:c,defaultValue:i,onValueChange:p,disabled:r=!1,style:m,"aria-labelledby":f,...R}=e,[h,x]=_e.useState(void 0),[P,S]=st({controlled:c,default:i,name:"MenuRadioGroup"}),A=Se((V,v)=>{p?.(V,v),!v.isCanceled&&S(V)}),g=O("div",e,{state:{disabled:r},ref:n,props:{role:"group","aria-labelledby":f??h,"aria-disabled":r||void 0,...R}}),l=_e.useMemo(()=>({value:P,setValue:A,disabled:r}),[P,A,r]);return(0,Wt.jsx)(We.Provider,{value:x,children:(0,Wt.jsx)($t.Provider,{value:l,children:g})})},"MenuRadioGroup")));var St=M(E(),1);var Pt=M(E(),1);var Jt=Pt.createContext(void 0);function wn(){let t=Pt.useContext(Jt);if(t===void 0)throw new Error(G(35));return t}o(wn,"useMenuRadioItemContext");var _n=M(me(),1);var Dn=St.forwardRef(o(function(e,n){let{render:s,className:u,id:c,label:i,nativeButton:p=!1,disabled:r=!1,closeOnClick:m=!1,value:f,style:R,...h}=e,x=ae({guess:!0,label:i}),P=K(!0),S=Z(c),{store:A}=D(),d=A.useState("isActive",x.index),g=A.useState("itemProps"),{value:l,setValue:V,disabled:v}=Tn(),C=A.useState("disabled"),B=r||v||C,b=l===f,{getItemProps:z,itemRef:F}=ke({closeOnClick:m,disabled:B,highlighted:d,id:S,store:A,nativeButton:p,nodeId:P?.context.nodeId,itemMetadata:Te}),N=St.useMemo(()=>({disabled:B,highlighted:d,checked:b}),[B,d,b]);function a(Y){let T=re(y.itemPress,Y.nativeEvent,void 0,{preventUnmountOnClose:Ge});V(f,T)}o(a,"handleClick");let H=O("div",e,{state:N,stateAttributesMapping:we,props:[g,{role:"menuitemradio","aria-checked":b,onClick:a},h,z],ref:[F,n,x.ref]});return(0,_n.jsx)(Jt.Provider,{value:N,children:H})},"MenuRadioItem"));var Nt=M(E(),1);var An=Nt.forwardRef(o(function(e,n){let{render:s,className:u,style:c,keepMounted:i=!1,...p}=e,r=wn(),m=Nt.useRef(null),{transitionStatus:f,mounted:R,setMounted:h}=rt(r.checked);Ue({batch:!0,enabled:!r.checked,open:r.checked,ref:m,onComplete(){r.checked||h(!1)}});let x={checked:r.checked,disabled:r.disabled,highlighted:r.highlighted,transitionStatus:f};return O("span",e,{state:x,stateAttributesMapping:we,ref:[n,m],props:{"aria-hidden":!0,...p},enabled:i||R})},"MenuRadioItemIndicator"));var U=M(E(),1);var Ot=M(E(),1);var cr=Ot.createContext(null);function Tt(t){let e=Ot.useContext(cr);if(e===null&&!t)throw new Error(G(5));return e}o(Tt,"useMenubarContext");var Je=M(E(),1);var Vn={...wo,disabled:o(t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,"disabled"),modal:o(t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),"modal"),openMethod:o(t=>t.openMethod,"openMethod"),allowMouseEnter:o(t=>t.allowMouseEnter,"allowMouseEnter"),highlightItemOnHover:o(t=>t.highlightItemOnHover,"highlightItemOnHover"),parent:o(t=>t.parent,"parent"),rootId:o(t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,"rootId"),activeIndex:o(t=>t.activeIndex,"activeIndex"),isActive:o((t,e)=>t.activeIndex===e,"isActive"),hoverEnabled:o(t=>t.hoverEnabled,"hoverEnabled"),instantType:o(t=>t.instantType,"instantType"),lastOpenChangeReason:o(t=>t.openChangeReason,"lastOpenChangeReason"),floatingTreeRoot:o(t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,"floatingTreeRoot"),floatingNodeId:o(t=>t.floatingNodeId,"floatingNodeId"),floatingParentNodeId:o(t=>t.floatingParentNodeId,"floatingParentNodeId"),itemProps:o(t=>t.itemProps,"itemProps"),closeDelay:o(t=>t.closeDelay,"closeDelay"),adaptiveOrigin:o(t=>t.adaptiveOrigin,"adaptiveOrigin"),keyboardEventRelay:o(t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")},"keyboardEventRelay")},kt=class extends bo{static{o(this,"MenuStore")}constructor(e,n,s=!1){let u=new Ut,c=Fn(u,n,s,e);super(c,Ln(u),Vn),this.unsubscribeParentListener=this.observe("parent",i=>{if(this.unsubscribeParentListener?.(),i.type==="menu"){let p=i.store.select("rootId"),r=i.store.select("floatingTreeRoot"),m=i.store.select("keyboardEventRelay");this.unsubscribeParentListener=i.store.subscribe(()=>{let f=i.store.select("rootId"),R=i.store.select("floatingTreeRoot"),h=i.store.select("keyboardEventRelay");p===f&&r===R&&m===h||(p=f,r=R,m=h,this.notifyAll())}),this.context.allowMouseUpTriggerRef=i.store.context.allowMouseUpTriggerRef;return}i.type!==void 0&&(this.context.allowMouseUpTriggerRef=i.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:n})}unsubscribeParentListener=null};function Bn(){let t=new Ut,e=new Lo(Object.freeze(Fn(t)),Object.freeze(Ln(t)),Vn);return Object.assign(e,{setOpen:Ge})}o(Bn,"createNullMenuStore");function Ln(t){return{positionerRef:Je.createRef(),popupRef:Je.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Je.createRef(),beforeContentFocusGuardRef:Je.createRef(),onOpenChangeComplete:void 0,triggerElements:t}}o(Ln,"createInitialContext");function Fn(t,e,n=!1,s){return{...ko(t,e,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new it,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:se,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...s}}o(Fn,"createInitialState");var wt=M(E(),1);var Xt=wt.createContext(void 0);function _t(){return wt.useContext(Xt)}o(_t,"useMenuSubmenuRootContext");var Xe=M(me(),1);var Dt=uo(o(function(e){let{children:n,open:s,onOpenChange:u,onOpenChangeComplete:c,defaultOpen:i=!1,disabled:p=!1,modal:r,loopFocus:m=!0,orientation:f="vertical",actionsRef:R,closeParentOnEsc:h=!1,handle:x,triggerId:P,defaultTriggerId:S=null,highlightItemOnHover:A=!0}=e,d=Oe(!0),g=D(!0),l=Tt(!0),V=_t(),v=U.useMemo(()=>V&&g?{type:"menu",store:g.store}:l?{type:"menubar",context:l}:d&&!g?{type:"context-menu",context:d}:{type:void 0},[d,g,l,V]),C=Bt(),B=Bt(),b=at(),z=v.type==="menu"?v.store:void 0,F=(s??i)&&z?.state.transitionStatus==="starting",N=Ze(()=>F?z?.state.instantType:void 0).current,a=dr({open:i,openProp:s,activeTriggerId:S,triggerIdProp:P,parent:v,disabled:p,highlightItemOnHover:A,modal:v.type===void 0?r:void 0,rootId:C,instantType:N},B,b!=null);a.useControlledProp("openProp",s),a.useControlledProp("triggerIdProp",P),a.useContextCallback("onOpenChangeComplete",c);let H=a.useState("floatingTreeRoot"),Y=ut(H),T=a.useState("open"),k=a.useState("activeTriggerElement"),ue=a.useState("positionerElement"),te=a.useState("hoverEnabled"),W=a.useState("disabled"),ye=a.useState("lastOpenChangeReason"),w=a.useState("parent"),fe=a.useState("activeIndex"),ge=a.useState("payload"),ce=a.useState("floatingParentNodeId"),Ce=U.useRef(null),Re=U.useRef(w.type!=="context-menu"),de=Ne(),X=U.useRef(!0),oe=Ne(),pe=ce!=null,{openMethod:q,triggerProps:ne}=Uo(T);a.useSyncedValues({disabled:p,highlightItemOnHover:A,modal:w.type===void 0?r:void 0,openMethod:q,rootId:C}),No(a);let{forceUnmount:le,transitionStatus:Be}=Oo(T,a,()=>{a.set("allowMouseEnter",!1)},F),Le=nt(a.context.popupRef);U.useEffect(()=>{if(N===void 0)return;let I=o(()=>{a.state.instantType===N&&a.set("instantType",void 0)},"clearSeededInstantType");if(!T){I();return}if(Be!==void 0)return;if(a.context.popupRef.current==null){I();return}let j=new AbortController;return Le(I,j.signal),()=>{j.abort()}},[N,T,Be,Le,a]),ie(()=>{d&&!g?a.update({parent:{type:"context-menu",context:d},floatingNodeId:Y,floatingParentNodeId:b}):g&&a.update({floatingNodeId:Y,floatingParentNodeId:b})},[d,g,Y,b,a]),U.useEffect(()=>{if(T||(Ce.current=null),w.type==="context-menu"){if(!T){de.clear(),Re.current=!1;return}de.start(500,()=>{Re.current=!0})}},[de,T,w.type]),ie(()=>{!T&&!te&&a.set("hoverEnabled",!0)},[T,te,a]);let xe=Se((I,j)=>{let Q=j.reason;if(!I&&!a.select("open")||T===I&&j.trigger===k&&ye===Q)return;let nr=Po(j);if(!I&&j.trigger==null&&(j.trigger=k??void 0),u?.(I,j),j.isCanceled)return;a.state.floatingRootContext.dispatchOpenChange(I,j);let Vt=j.event;if(I===!1&&Vt?.type==="click"&&Vt.pointerType==="touch"&&!X.current)return;I&&Q===y.triggerFocus?(X.current=!1,oe.start(300,()=>{X.current=!0})):(X.current=!0,oe.clear());let to=(Q===y.triggerPress||Q===y.itemPress)&&Vt.detail===0,rr=!I&&(Q===y.escapeKey||Q==null);Ce.current=j.event;let Ye=yo(a.state,I,j.trigger,nr());Ye.openChangeReason=Q,w.type==="menubar"&&(Q===y.triggerFocus||Q===y.focusOut||Q===y.triggerHover||Q===y.listNavigation||Q===y.siblingOpen)?Ye.instantType="group":to||rr?Ye.instantType=to?"click":"dismiss":Ye.instantType=void 0,a.update(Ye)}),Me=Co({popupStore:a,floatingRootContext:a.state.floatingRootContext,floatingId:B,nested:b!=null,onOpenChange:xe}),Pe=Me.context.events;ie(()=>{let I=o(({open:j,eventDetails:Q})=>xe(j,Q),"handleSetOpenEvent");return Pe.on("setOpen",I),()=>{Pe?.off("setOpen",I)}},[Pe,xe]);let ve=U.useCallback(()=>{a.setOpen(!1,re(y.imperativeAction))},[a]);U.useImperativeHandle(R,()=>({unmount:le,close:ve}),[le,ve]);let L;w.type==="context-menu"&&(L=w.context),U.useImperativeHandle(L?.positionerRef,()=>ue,[ue]),U.useImperativeHandle(L?.actionsRef,()=>({setOpen:xe}),[xe]);let _=Mo(Me,{enabled:!W,bubbles:{escapeKey:h&&w.type==="menu"},outsidePress(){return w.type!=="context-menu"||Ce.current?.type==="contextmenu"?!0:Re.current},externalTree:pe?H:void 0}),Ie=jo(),qn=U.useCallback(I=>{a.select("activeIndex")!==I&&a.set("activeIndex",I)},[a]),Ae=Vo(Me,{enabled:!W,listRef:a.context.itemDomElements,activeIndex:fe,nested:w.type!==void 0,loopFocus:m,orientation:f,parentOrientation:w.type==="menubar"?w.context.orientation:void 0,rtl:Ie==="rtl",disabledIndices:Ke,onNavigate:qn,openOnArrowKeyDown:w.type!=="context-menu",externalTree:pe?H:void 0,focusItemOnHover:A}),Qn=U.useCallback(I=>{a.context.typingRef.current=I},[a]),Qe=Bo(Me,{enabled:!W,listRef:a.context.itemLabels,elementsRef:a.context.itemDomElements,activeIndex:fe,resetMs:500,onMatch:o(I=>{T&&I!==fe&&a.set("activeIndex",I)},"onMatch"),onTyping:Qn}),Zn=U.useMemo(()=>{let I=he(Qe.reference,Ae.reference,_.reference,{onMouseMove(){a.set("allowMouseEnter",!0)}},ne);return I["aria-haspopup"]="menu",I["aria-expanded"]=T,I},[a,Qe.reference,Ae.reference,_.reference,ne,T]),Zt=U.useMemo(()=>{let I=he(Ae.trigger,_.trigger,ne);return I["aria-haspopup"]="menu",I["aria-expanded"]=!1,I},[Ae.trigger,_.trigger,ne]);Ze(()=>(a.update({inactiveTriggerProps:Zt}),null));let er=U.useMemo(()=>he(vo,{id:B,role:"menu","aria-orientation":f==="horizontal"?"horizontal":void 0,"aria-labelledby":k?.id,onMouseMove(){a.set("allowMouseEnter",!0),w.type==="menu"&&a.set("hoverEnabled",!1)},onClick(){a.select("hoverEnabled")&&a.set("hoverEnabled",!1)},onKeyDown(I){let j=a.select("keyboardEventRelay");j&&!I.isPropagationStopped()&&j(I)}},Qe.floating,Ae.floating,_.floating),[k,B,f,w.type,a,Qe.floating,Ae.floating,_.floating]),tr=Ae.item??se;To(a,{floatingRootContext:Me,activeTriggerProps:Zn,inactiveTriggerProps:Zt,popupProps:er,itemProps:tr});let or=U.useMemo(()=>({store:a,parent:v}),[a,v]),eo=(0,Xe.jsxs)(jt.Provider,{value:or,children:[x&&(0,Xe.jsx)(Io,{handle:x,store:a}),typeof n=="function"?n({payload:ge}):n]});return w.type===void 0||w.type==="context-menu"?(0,Xe.jsx)(Ro,{externalTree:H,children:eo}):eo},"MenuRoot"));function dr(t,e,n){return Ze(()=>new kt(t,e,n)).current}o(dr,"useMenuRootStore");var Gn=M(E(),1);var qt=M(me(),1);function Un(t){let e=D().store,n=Gn.useMemo(()=>({parentMenu:e}),[e]);return(0,qt.jsx)(Xt.Provider,{value:n,children:(0,qt.jsx)(Dt,{...t})})}o(Un,"MenuSubmenuRoot");var $=M(E(),1);var Hn=M(E(),1);function jn(t={}){let{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:s}=lt(),{ref:u,index:c}=ae(t),i=n===c,p=Hn.useRef(null),r=et(u,p);return{compositeProps:{tabIndex:i?0:-1,onFocus(){s(c)},onMouseMove(){let f=p.current;if(!e||!f)return;let R=f.hasAttribute("disabled")||f.ariaDisabled==="true";!i&&!R&&f.focus()}},compositeRef:r,index:c}}o(jn,"useCompositeItem");function zn(t){let{render:e,className:n,style:s,state:u=se,props:c=Ke,refs:i=Ke,metadata:p,stateAttributesMapping:r,tag:m="div",...f}=t,{compositeProps:R,compositeRef:h}=jn({metadata:p});return O(m,t,{state:u,ref:[h,...i],props:[R,...c,f],stateAttributesMapping:r})}o(zn,"CompositeItem");function Qt(t){if(oo(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!no(t))return Qt(ro(t))}o(Qt,"findRootOwnerId");var At=M(E(),1);function Yn(t){let{enabled:e=!0,mouseDownAction:n,open:s}=t,u=At.useRef(!1);return At.useMemo(()=>e?{onMouseDown:o(c=>{(n==="open"&&!s||n==="close"&&s)&&(u.current=!0,$e(c.currentTarget).addEventListener("click",()=>{u.current=!1},{once:!0}))},"onMouseDown"),onClick:o(c=>{u.current&&(u.current=!1,c.preventBaseUIHandler())},"onClick")}:se,[e,n,s])}o(Yn,"useMixedToggleClickHandler");var De=M(me(),1);var Kn=co(o(function(e,n){let{render:s,className:u,style:c,disabled:i=!1,nativeButton:p=!0,id:r,openOnHover:m,delay:f=100,closeDelay:R=0,handle:h,payload:x,...P}=e,S=D(!0),d=_o(h)??S?.store;if(!d)throw new Error(G(85));let g=Z(r),l=d.useState("isTriggerActive",g),V=d.useState("floatingRootContext"),v=d.useState("isOpenedByTrigger",g),C=d.useState("triggerPopupId",g),B=$.useRef(null),b=lr(),z=lt(!0),F=fo(),N=$.useMemo(()=>F??new it,[F]),a=ut(N),H=at(),{registerTrigger:Y,isMountedByThisTrigger:T}=So(g,B,d,{payload:x,closeDelay:R,parent:b,floatingTreeRoot:N,floatingNodeId:a,floatingParentNodeId:H,keyboardEventRelay:z?.relayKeyboardEvent}),k=b.type==="menubar",ue=d.useState("disabled"),te=i||ue||k&&b.context.disabled,{getButtonProps:W,buttonRef:ye}=He({disabled:te,native:p});$.useEffect(()=>{!v&&b.type===void 0&&(d.context.allowMouseUpTriggerRef.current=!1)},[d,v,b.type]);let w=$.useRef(null),fe=Ne(),ge=Se(L=>{if(!w.current)return;fe.clear(),d.context.allowMouseUpTriggerRef.current=!1;let _=L.target;Lt(w.current,_)||Lt(d.select("positionerElement"),_)||_===w.current||_!=null&&Qt(_)===d.select("rootId")||on(L,w.current)||N.events.emit("close",{domEvent:L,reason:y.cancelOpen})});$.useEffect(()=>{v&&d.select("lastOpenChangeReason")===y.triggerHover&&$e(w.current).addEventListener("mouseup",ge,{once:!0})},[v,ge,d]);let ce=k&&b.context.hasSubmenuOpen,Re=dt(V,{enabled:(m??ce)&&!te&&(!k||ce&&!T),handleClose:pt({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:b.type===void 0?f:void 0,delay:{close:R},triggerElementRef:B,externalTree:N,isActiveTrigger:l,isClosing:o(()=>d.select("transitionStatus")==="ending","isClosing")}),de=pr(v,d.select("lastOpenChangeReason")),X=ct(V,{enabled:!te,event:v&&k?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:b.type===void 0?de:!1}),oe=Do(V,{enabled:!te&&ce}),pe=Yn({open:v,enabled:k,mouseDownAction:"open"}),q=$.useMemo(()=>he(oe.reference,X.reference),[oe.reference,X.reference]),ne=d.useState("triggerProps",T),{preFocusGuardRef:le,handlePreFocusGuardFocus:Be,handleFocusTargetFocus:Le}=Go(d,B),xe={disabled:te,open:v},Me=[w,n,ye,Y,B],Pe=[q,Re??se,ne,{"aria-haspopup":"menu","aria-controls":C,id:g,onMouseDown:o(L=>{if(d.select("open"))return;fe.start(200,()=>{d.context.allowMouseUpTriggerRef.current=!0}),$e(L.currentTarget).addEventListener("mouseup",ge,{once:!0})},"onMouseDown")},k?{role:"menuitem"}:{},pe,P,W],ve=O("button",e,{enabled:!k,stateAttributesMapping:Ft,state:xe,ref:Me,props:Pe});return k?(0,De.jsx)(zn,{tag:"button",render:s,className:u,style:c,state:xe,refs:Me,props:Pe,stateAttributesMapping:Ft}):v?(0,De.jsxs)($.Fragment,{children:[(0,De.jsx)(Gt,{ref:le,onFocus:Be},`${g}-pre-focus-guard`),(0,De.jsx)($.Fragment,{children:ve},g),(0,De.jsx)(Gt,{ref:d.context.triggerFocusTargetRef,onFocus:Le},`${g}-post-focus-guard`)]}):(0,De.jsx)($.Fragment,{children:ve},g)},"MenuTrigger"));function pr(t,e){let n=Ne(),[s,u]=$.useState(!1);return ie(()=>{t&&e===y.triggerHover?(u(!0),n.start(500,()=>{u(!1)})):t||(n.clear(),u(!1))},[t,e,n]),s}o(pr,"useStickIfOpen");function lr(){let t=Tt(!0);return $.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}o(lr,"useMenuParent");var $n=M(E(),1);var Wn=$n.forwardRef(o(function(e,n){let{render:s,className:u,style:c,children:i,...p}=e,{store:r}=D(),{side:m}=K(),f=r.useState("instantType"),{children:R,state:h}=Qo({store:r,side:m,children:i}),x={activationDirection:h.activationDirection,transitioning:h.transitioning,instant:f};return O("div",e,{state:x,ref:n,props:[p,{children:R}],stateAttributesMapping:qo})},"MenuViewport"));var Ee=M(E(),1);var mr={"aria-expanded":void 0},Jn=Ee.forwardRef(o(function(e,n){let{render:s,className:u,style:c,label:i,id:p,nativeButton:r=!1,openOnHover:m=!0,delay:f=100,closeDelay:R=0,disabled:h=!1,...x}=e,P=_t();if(!P?.parentMenu)throw new Error(G(37));let S=ae({guess:!0,label:i}),A=K(),{store:d}=D(),g=Z(p),l=d.useState("open"),V=d.useState("floatingRootContext"),v=d.useState("floatingTreeRoot"),C=d.useState("triggerPopupId",g),B=Eo(g,d),b=Se(q=>{B(q),q!==null&&d.select("open")&&d.select("activeTriggerId")==null&&d.update({activeTriggerId:g??null,activeTriggerElement:q,closeDelay:R})}),z=Ee.useRef(null),F=Ee.useCallback(q=>{z.current=q,d.set("activeTriggerElement",q)},[d]);ie(()=>(b(z.current),()=>b(null)),[b,g,d]),d.useSyncedValue("closeDelay",R);let N=P.parentMenu,a=d.useState("disabled"),H=N.useState("disabled"),Y=h||a||H,T=N.useState("itemProps"),k=N.useState("isActive",S.index),ue=Ee.useMemo(()=>({type:"submenu-trigger",setActive(){N.select("highlightItemOnHover")&&N.set("activeIndex",S.index)}}),[N,S.index]),{getItemProps:te,itemRef:W}=ke({closeOnClick:!1,disabled:Y,highlighted:k,id:g,store:d,typingRef:N.context.typingRef,nativeButton:r,itemMetadata:ue,nodeId:A?.context.nodeId}),ye=d.useState("hoverEnabled"),w=dt(V,{enabled:ye&&m&&!Y,handleClose:pt({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:f,delay:{open:f,close:R},shouldOpen:f>0?()=>N.select("allowMouseEnter"):void 0,triggerElementRef:z,externalTree:v,isClosing:o(()=>d.select("transitionStatus")==="ending","isClosing"),guardStaleOpen:!0}),ge=ct(V,{enabled:!Y,event:"mousedown",toggle:!m,ignoreMouse:m,stickIfOpen:!1}).reference??se,ce=d.useState("triggerProps",!0);delete ce.id;let Ce={disabled:Y,highlighted:k,open:l},Re=d.useState("openMethod"),X=d.useState("lastOpenChangeReason")===y.listNavigation||Re==="keyboard",oe=l&&X&&tt.screenReader.voiceOver;return O("div",e,{state:Ce,stateAttributesMapping:io,props:[ge,w,ce,T,oe?mr:void 0,{"aria-controls":C,tabIndex:l||k?0:-1,onBlur(){k&&N.set("activeIndex",null)}},x,te],ref:[n,S.ref,W,b,F]})},"MenuSubmenuTrigger"));var qe=class extends ho{static{o(this,"MenuHandle")}constructor(){super(Bn(),"Menu")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function Xn(){return new qe}o(Xn,"createMenuHandle");var J=M(me(),1);function Xc(t){let e=(0,Ve.c)(4),n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=(0,J.jsx)(ee.Root,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=s):s=e[3],s}o(Xc,"N");function qc(t){let e=(0,Ve.c)(4),n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=(0,J.jsx)(ee.Trigger,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}o(qc,"z");function Qc({align:t="start",alignOffset:e=0,side:n="bottom",sideOffset:s=4,className:u,...c}){return(0,J.jsx)(ee.Portal,{children:(0,J.jsx)(ee.Positioner,{className:"isolate z-50 outline-none",align:t,alignOffset:e,side:n,sideOffset:s,children:(0,J.jsx)(ee.Popup,{"data-slot":"dropdown-menu-content",className:Fe("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",u),...c})})})}o(Qc,"D");function Zc(t){let e=(0,Ve.c)(4),n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=(0,J.jsx)(ee.Group,{"data-slot":"dropdown-menu-group",...n}),e[2]=n,e[3]=s):s=e[3],s}o(Zc,"M");function ed(t){let e=(0,Ve.c)(10),n,s,u;e[0]!==t?({className:n,inset:s,...u}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=u):(n=e[1],s=e[2],u=e[3]);let c;e[4]!==n?(c=Fe("px-2 py-2 text-xs text-muted-foreground data-inset:ps-7",n),e[4]=n,e[5]=c):c=e[5];let i;return e[6]!==s||e[7]!==u||e[8]!==c?(i=(0,J.jsx)(ee.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":s,className:c,...u}),e[6]=s,e[7]=u,e[8]=c,e[9]=i):i=e[9],i}o(ed,"y");function td({className:t,inset:e,variant:n="default",...s}){return(0,J.jsx)(ee.Item,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:Fe("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",t),...s})}o(td,"I");function od(t){let e=(0,Ve.c)(15),n,s,u,c,i;e[0]!==t?({className:u,children:s,checked:n,inset:c,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=u,e[4]=c,e[5]=i):(n=e[1],s=e[2],u=e[3],c=e[4],i=e[5]);let p;e[6]!==u?(p=Fe("relative flex cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",u),e[6]=u,e[7]=p):p=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=(0,J.jsx)("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:(0,J.jsx)(ee.CheckboxItemIndicator,{children:(0,J.jsx)(en,{icon:Zo,strokeWidth:2})})}),e[8]=r):r=e[8];let m;return e[9]!==n||e[10]!==s||e[11]!==c||e[12]!==i||e[13]!==p?(m=(0,J.jsxs)(ee.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":c,className:p,checked:n,...i,children:[r,s]}),e[9]=n,e[10]=s,e[11]=c,e[12]=i,e[13]=p,e[14]=m):m=e[14],m}o(od,"_");function nd(t){let e=(0,Ve.c)(8),n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let u;e[3]!==n?(u=Fe("-mx-1 h-px bg-border",n),e[3]=n,e[4]=u):u=e[4];let c;return e[5]!==s||e[6]!==u?(c=(0,J.jsx)(ee.Separator,{"data-slot":"dropdown-menu-separator",className:u,...s}),e[5]=s,e[6]=u,e[7]=c):c=e[7],c}o(nd,"C");export{Xc as a,qc as b,Qc as c,Zc as d,ed as e,td as f,od as g,nd as h};
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-YKXDMIHQ.js";var g=new Set(["contains","eq","gt","gte","lt","lte","ne"]),n=s(r=>{if(typeof r!="string")return;let e=r.trim();return e===""?void 0:e},"s"),v=s(r=>{if(r===null||typeof r!="object")return!1;let e=r;return typeof e.column=="string"&&typeof e.operator=="string"&&g.has(e.operator)},"p"),h=s(r=>{if(typeof r!="string"||r==="")return[];try{let e=JSON.parse(r);return Array.isArray(e)?e.filter(v):[]}catch{return[]}},"c"),f=s(r=>{if(typeof r!="string"||r==="")return;let e=r.lastIndexOf(":");if(e<=0)return;let o=r.slice(0,e),i=r.slice(e+1);if(!(i!=="asc"&&i!=="desc"))return{column:o,direction:i}},"f"),p=/^[\da-f]{16}$/u,u=s(r=>{let e={};if(typeof r.pins=="string"&&r.pins!==""){let l=r.pins.split(",").filter(c=>c!==""&&c.length<=64).slice(0,12);l.length>0&&(e.pins=l.join(","))}r.schema==="global"&&(e.schema="global");let o=n(r.table);o!==void 0&&(e.table=o);let i=n(r.shard);i!==void 0&&(e.shard=i);let d=n(r.search);d!==void 0&&(e.search=d);let a=n(r.order);a!==void 0&&f(a)!==void 0&&(e.order=a);let t=n(r.filters);return t!==void 0&&h(t).length>0&&(e.filters=t),e},"h"),y=s(r=>{let e=h(r.filters),o=f(r.order);return{filters:e.length>0?e:void 0,orderBy:o,search:typeof r.search=="string"&&r.search!==""?r.search:void 0,shard:typeof r.shard=="string"&&r.shard!==""?r.shard:void 0,table:typeof r.table=="string"&&r.table!==""?r.table:void 0,tier:r.schema==="global"?"global":"shard"}},"b"),b=s(r=>{let e=r.filters??[];return{filters:e.length>0?JSON.stringify(e):void 0,order:r.orderBy===void 0?void 0:`${r.orderBy.column}:${r.orderBy.direction}`,schema:r.tier==="global"?"global":void 0,search:r.search!==void 0&&r.search!==""?r.search:void 0,shard:r.shard!==void 0&&r.shard!==""?r.shard:void 0,table:r.table!==void 0&&r.table!==""?r.table:void 0}},"v"),m=s(r=>{let{version:e}=r;return typeof e=="string"&&p.test(e)?{version:e}:{}},"y");export{u as a,y as b,b as c,m as d};
@@ -0,0 +1 @@
1
+ import{a as n}from"./chunk-YKXDMIHQ.js";var r=n(t=>{if(typeof t=="string")return t;try{return JSON.stringify(t)??String(t)}catch{return String(t)}},"i"),o=n(t=>typeof t!="object"||t===null||Array.isArray(t)?"":Object.entries(t).map(([e,i])=>`${e}=${r(i)}`).join(" "),"o");export{o as a};
@@ -0,0 +1 @@
1
+ import{a as u,d as y,e as d}from"./chunk-YKXDMIHQ.js";var t=y(d(),1);var S=u((r,a=400)=>{let e=(r??"").trim(),[o,c]=(0,t.useState)(e),[i,n]=(0,t.useState)(e),m=(0,t.useRef)(r);m.current!==r&&(m.current=r,c(e),n(e));let f=o.trim();return(0,t.useEffect)(()=>{let s=setTimeout(()=>{n(f)},a);return()=>{clearTimeout(s)}},[f,a]),{queryShardKey:i,setShardKey:u(s=>{c(s)},"setShardKey"),shardKey:o}},"f");export{S as a};
@@ -0,0 +1 @@
1
+ import{a as w}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as y}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as C}from"./chunk-GWFZ7WCP.js";import"./chunk-ULIQFBZU.js";import"./chunk-4JJEP7LF.js";import"./chunk-35DM4JJG.js";import{a as h}from"./chunk-4ZEL6BYL.js";import{c as u}from"./chunk-FPG5ZRPW.js";import"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as T}from"./chunk-FKVZRPV5.js";import{a as S,b as K,c as $,d as g,e as o,f as i}from"./chunk-HEAQVSNS.js";import{a as A,e as k}from"./chunk-WUWBZPUK.js";import{d as M,r as D}from"./chunk-FODLDLE2.js";import{a as d,d as z,e as ae,g as re}from"./chunk-YKXDMIHQ.js";var O=z(ae(),1);var e=z(re(),1);var Q="agent_threads",se="agent_messages",F="agent_run_queue",R=100,ne=250,oe={},ie={filters:[],limit:R,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:Q},l=d((s,t)=>{let r=s[t];return typeof r=="string"?r:void 0},"i"),j=d((s,t)=>{let r=s[t];return typeof r=="number"?r:void 0},"A"),L=d(s=>{let{usage:t}=s;if(t===null||typeof t!="object")return;let{totalTokens:r}=t;return typeof r=="number"?r:void 0},"U"),de=d(s=>{let{toolCalls:t}=s;return Array.isArray(t)?t.map(r=>r!==null&&typeof r=="object"?r.name:void 0).filter(r=>typeof r=="string"):[]},"ne"),le=d(s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},"oe"),ce=d(s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},"de"),Ne=d(({initialShardKey:s=""})=>{let t=M(),[r,I]=(0,O.useState)(void 0),{data:c}=u(h.listTables,oe,{live:!0,shardKey:s}),G=c!==void 0,p=Array.isArray(c)&&c.some(a=>a.name===Q),H=Array.isArray(c)&&c.some(a=>a.name===F),{data:_,error:J,errorSource:V,liveError:W}=u(h.readTablePage,ie,{enabled:p,live:!0,shardKey:s}),X={filters:[{column:"threadKey",operator:"eq",value:r??""}],limit:ne,offset:0,orderBy:{column:"seq",direction:"asc"},skipCount:!0,table:se},{data:q}=u(h.readTablePage,{limit:R,offset:0,orderBy:{column:"position",direction:"asc"},skipCount:!0,table:F},{enabled:H,live:!0,shardKey:s}),{data:B,error:Y,errorSource:Z}=u(h.readTablePage,X,{enabled:p&&r!==void 0,live:!0,shardKey:s}),v=Array.isArray(_?.rows)?_.rows:[],ee=Array.isArray(q?.rows)?q.rows:[],E=d(a=>ee.filter(n=>l(n,"threadKey")===a).length,"w"),P=Array.isArray(B?.rows)?B.rows:[],U=v.find(a=>l(a,"key")===r),f;return G&&!p?f=(0,e.jsx)(T,{description:t("No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents."),testId:"agents-unconfigured",title:t("No agents configured")}):p&&v.length===0?f=(0,e.jsx)(T,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):f=(0,e.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,e.jsx)(A,{className:"overflow-hidden py-0",children:(0,e.jsx)(k,{className:"px-0",children:(0,e.jsxs)(S,{"data-testid":"agents-threads-table",children:[(0,e.jsx)(K,{children:(0,e.jsxs)(g,{children:[(0,e.jsx)(o,{children:t("Agent")}),(0,e.jsx)(o,{children:t("Key")}),(0,e.jsx)(o,{children:t("Status")}),(0,e.jsx)(o,{children:t("Queued")}),(0,e.jsx)(o,{children:t("Messages")}),(0,e.jsx)(o,{children:t("Tokens")}),(0,e.jsx)(o,{children:t("Updated")}),(0,e.jsx)(o,{"aria-label":t("Actions")})]})}),(0,e.jsx)($,{children:v.map(a=>{let n=l(a,"key")??"",m=l(a,"status"),x=L(a);return(0,e.jsxs)(g,{"data-active":n===r?"":void 0,"data-testid":`agents-thread-${n}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:l(a,"agent")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:n}),(0,e.jsx)(i,{children:(0,e.jsx)(y,{"data-testid":`agents-thread-status-${n}`,variant:le(m),children:m??"\u2014"})}),(0,e.jsx)(i,{className:"tabular-nums",children:E(n)===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,e.jsx)(y,{"data-testid":`agents-thread-queued-${n}`,variant:"warning",children:E(n)})}),(0,e.jsx)(i,{className:"tabular-nums",children:j(a,"messageCount")??"\u2014"}),(0,e.jsx)(i,{className:"tabular-nums text-muted-foreground",children:x??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:D(j(a,"updatedAt"),"\u2014")}),(0,e.jsx)(i,{className:"text-right",children:(0,e.jsx)(w,{"data-testid":`agents-thread-open-${n}`,onClick:d(()=>{I(n)},"onClick"),size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},n)})})]})})}),Y!==null&&(0,e.jsx)(C,{error:Z,testId:"agents-messages-error"}),r!==void 0&&(0,e.jsx)(A,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:(0,e.jsxs)(k,{className:"flex flex-col gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t("Timeline")," \xB7 ",r,U!==void 0&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",t("Usage"),": ",L(U)??0," ",t("Tokens")]})]}),(0,e.jsx)(w,{"data-testid":"agents-thread-detail-close",onClick:d(()=>{I(void 0)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),P.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):(0,e.jsxs)(S,{"data-testid":"agents-messages-table",children:[(0,e.jsx)(K,{children:(0,e.jsxs)(g,{children:[(0,e.jsx)(o,{children:t("Role")}),(0,e.jsx)(o,{children:t("Content")}),(0,e.jsx)(o,{children:t("Tool")}),(0,e.jsx)(o,{children:t("Approval")})]})}),(0,e.jsx)($,{children:P.map((a,n)=>{let m=l(a,"role")??"\u2014",x=de(a),te=l(a,"toolName"),b=l(a,"status"),N=j(a,"seq")??n;return(0,e.jsxs)(g,{"data-testid":`agents-message-${String(N)}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:m}),(0,e.jsx)(i,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:l(a,"content")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:te??(x.length>0?x.join(", "):"\u2014")}),(0,e.jsx)(i,{className:"align-top",children:b===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"}):(0,e.jsx)(y,{"data-testid":`agents-message-approval-${String(N)}`,variant:ce(b),children:b})})]},l(a,"messageKey")??`${m}:${String(N)}`)})})]})]})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[J!==null&&(0,e.jsx)(C,{error:V,testId:"agents-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.")}),W!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),f]})},"be");export{Ne as default};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-YKXDMIHQ.js";var h=o(e=>{let t=0,n=0,a=0,s=0,l=0,i=0,c=0;for(let{metrics:r}of e){if(r===null){l+=1;continue}s+=1,t+=r.requests,n+=r.errors,a+=r.databaseSize??0,r.cache&&(i+=r.cache.hits,c+=r.cache.hits+r.cache.misses)}return{failed:l,hitRate:c===0?null:i/c,reachable:s,totalDatabaseSize:a,totalErrors:n,totalRequests:t}},"u"),f=o((e,t)=>{let n=new Set,a=[];for(let s of["",e.trim(),...t])n.has(s)||(n.add(s),a.push(s));return a},"h"),u=o((e,t)=>{if(e.length===0)return 0;if(e.sort((a,s)=>a-s),t<=0)return e[0]??0;if(t>=100)return e.at(-1)??0;let n=Math.ceil(t/100*e.length)-1;return e[n]??0},"l"),p=o(e=>{let t=e.functions;if(!t||t.length===0)return{p90:0,p95:0};let n=1e3,a=[];for(let s of t){if(s.calls<=0)continue;let l=s.totalDurationMs/s.calls,i=Math.min(s.calls,n);for(let c=0;c<i;c+=1)a.push(l)}return a.length===0?{p90:0,p95:0}:{p90:u([...a],90),p95:u([...a],95)}},"f");var g=o(e=>e.map(t=>({...t,avgDurationMs:t.execCount>0?t.totalDurationMs/t.execCount:0})),"g");export{h as a,f as b,p as c,g as d};
@@ -0,0 +1 @@
1
+ import{a as F,b as O}from"./chunk-CMA4PTV7.js";import{a as B}from"./chunk-BOTGXX4H.js";import{a as V}from"./chunk-S3CRZLGS.js";import{a as T}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as L}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import"./chunk-AAVLPU5Q.js";import{b as C}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as j}from"./chunk-GWFZ7WCP.js";import"./chunk-ULIQFBZU.js";import"./chunk-4JJEP7LF.js";import"./chunk-35DM4JJG.js";import{a as R}from"./chunk-4ZEL6BYL.js";import{c as M}from"./chunk-FPG5ZRPW.js";import"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as K}from"./chunk-FKVZRPV5.js";import{a as z,b as A,c as q,d as p,e as n,f as d}from"./chunk-HEAQVSNS.js";import{a as I,e as E}from"./chunk-WUWBZPUK.js";import{d as b,r as k}from"./chunk-FODLDLE2.js";import{a as i,d as y,e as ee,g as te}from"./chunk-YKXDMIHQ.js";var o=y(ee(),1);var e=y(te(),1);var D=80,re=i(s=>{if(s===void 0)return"";let t=JSON.stringify(s);return t.length>D?`${t.slice(0,D)}\u2026`:t},"te"),ae=41,J=480,H=5,ie=i((s,t)=>F(s,l=>{t(l.height>0?l:{height:J,width:l.width})}),"ae"),Ne=i(({initialShardKey:s})=>{let t=b(),{queryShardKey:l,setShardKey:P,shardKey:U}=V(s),[h,W]=(0,o.useState)(""),{data:f,error:g,errorSource:Z,isLoading:_,liveError:$}=M(R.getAuditLog,{},{live:!0,shardKey:l}),m=(0,o.useMemo)(()=>f?.entries??[],[f]),c=(0,o.useMemo)(()=>{let a=h.trim().toLowerCase();return a===""?m:m.filter(r=>r.op.toLowerCase().includes(a)||(r.table??"").toLowerCase().includes(a)||(r.id??"").toLowerCase().includes(a))},[m,h]),x=(0,o.useRef)(null),v=O({count:c.length,estimateSize:i(()=>ae,"estimateSize"),getScrollElement:i(()=>x.current,"getScrollElement"),initialRect:{height:J,width:800},observeElementRect:ie,overscan:8}),u=v.getVirtualItems(),G=v.getTotalSize(),N=u[0]?.start??0,w=G-(u.at(-1)?.end??0),Q={height:N},X={height:w},Y=i(a=>{W(a.target.value)},"_");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(T,{onChange:P,testId:"au-shard-input",value:U}),(0,e.jsx)(B,{message:$,prefix:"au"}),(0,e.jsx)(L,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:Y,placeholder:t("filter op, table, id"),value:h})]}),g!==null&&(0,e.jsx)(j,{error:Z,testId:"au-error"}),g===null&&!_&&c.length===0&&(0,e.jsx)(K,{description:t("State-changing admin operations are recorded here."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"})}),testId:"au-empty",title:t("No audit entries.")}),c.length>0&&(0,e.jsx)(I,{className:"overflow-hidden py-0",children:(0,e.jsx)(E,{className:"max-h-[30rem] overflow-auto px-0",ref:x,children:(0,e.jsxs)(z,{"data-testid":"au-table",children:[(0,e.jsx)(A,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(n,{children:t("time")}),(0,e.jsx)(n,{children:t("op")}),(0,e.jsx)(n,{children:t("table")}),(0,e.jsx)(n,{children:t("id")}),(0,e.jsx)(n,{children:t("detail")})]})}),(0,e.jsxs)(q,{children:[N>0&&(0,e.jsx)("tr",{"aria-hidden":"true",children:(0,e.jsx)("td",{colSpan:H,style:Q})}),u.map(a=>{let r=c[a.index],S=re(r.detail);return(0,e.jsxs)(p,{"data-testid":"au-row",children:[(0,e.jsx)(d,{className:"text-muted-foreground tabular-nums",children:k(r.ts,"\u2014")}),(0,e.jsx)(d,{children:(0,e.jsx)(C,{variant:"secondary",children:r.op})}),(0,e.jsx)(d,{className:"font-medium",children:r.table??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,e.jsx)(d,{className:"max-w-[20ch] truncate font-mono text-xs",children:r.id??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,e.jsx)(d,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:S||void 0,children:S||(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},r.seq)}),w>0&&(0,e.jsx)("tr",{"aria-hidden":"true",children:(0,e.jsx)("td",{colSpan:H,style:X})})]})]})})})]})},"Ne");export{Ne as AuditPanel};
@@ -0,0 +1 @@
1
+ import{h as u,o as f}from"./chunk-FODLDLE2.js";import{a as s,d as l,e as h,f as S}from"./chunk-YKXDMIHQ.js";var i=l(S(),1),c=l(h(),1);var g=s(()=>{let t=(0,i.c)(4),[a,n]=(0,c.useState)(!1),[e,m]=(0,c.useState)(null),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s(p=>{f((async()=>{n(!0),m(null);try{await p()}catch(b){m(u(b))}n(!1)})())},"e"),t[0]=r):r=t[0];let y=r,o;return t[1]!==a||t[2]!==e?(o={busy:a,error:e,run:y},t[1]=a,t[2]=e,t[3]=o):o=t[3],o},"g");export{g as a};
@@ -0,0 +1 @@
1
+ import{W as R}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as B}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as S}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as q}from"./chunk-GWFZ7WCP.js";import"./chunk-ULIQFBZU.js";import"./chunk-4JJEP7LF.js";import"./chunk-35DM4JJG.js";import{a as U}from"./chunk-4ZEL6BYL.js";import{c as O}from"./chunk-FPG5ZRPW.js";import"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as D}from"./chunk-FKVZRPV5.js";import{a as G,b as J,c as K,d as F,e as s,f as o}from"./chunk-HEAQVSNS.js";import{a as V,e as W}from"./chunk-WUWBZPUK.js";import{d as P,r as H}from"./chunk-FODLDLE2.js";import{a as n,d as j,e as re,f as ae,g as ie}from"./chunk-YKXDMIHQ.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 @@
1
+ import{a as b}from"./chunk-FSRSK4LY.js";import{a as c,d as l,f as x,g,i as v}from"./chunk-YKXDMIHQ.js";var u=l(x(),1);var s=l(g(),1);var p=b("flex items-start gap-2 rounded-md border px-3 py-2 text-sm [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0",{defaultVariants:{variant:"default"},variants:{variant:{default:"border-border bg-muted/40 text-foreground",destructive:"border-destructive/40 bg-destructive/5 text-destructive",warning:"border-amber-500/40 bg-amber-500/5 text-amber-700 dark:text-amber-400"}}}),j=c(f=>{let t=(0,u.c)(10),{children:d,className:i,icon:m,testId:o,variant:n}=f,e;t[0]!==i||t[1]!==n?(e=v(p({variant:n}),i),t[0]=i,t[1]=n,t[2]=e):e=t[2];let r;t[3]!==d?(r=(0,s.jsx)("div",{className:"min-w-0 flex-1",children:d}),t[3]=d,t[4]=r):r=t[4];let a;return t[5]!==m||t[6]!==e||t[7]!==r||t[8]!==o?(a=(0,s.jsxs)("div",{className:e,"data-testid":o,role:"alert",children:[m,r]}),t[5]=m,t[6]=e,t[7]=r,t[8]=o,t[9]=a):a=t[9],a},"N");export{j as a};
@@ -0,0 +1 @@
1
+ import{m as u,n as d}from"./chunk-P5RUFDVX.js";import"./chunk-5JDWLCSH.js";import"./chunk-EVTM6Q43.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import"./chunk-MKL7VDTL.js";import{a as c,d as m,f as y,g as b}from"./chunk-YKXDMIHQ.js";var h=m(y(),1);var n=m(b(),1);var p={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},_=c(o=>{let e=(0,h.c)(6),{data:i}=o,a,r;if(e[0]!==i){r=Symbol.for("react.early_return_sentinel");e:{let f=i.slice(-16);if(f.length<3){r=null;break e}a=f.map(g)}e[0]=i,e[1]=a,e[2]=r}else a=e[1],r=e[2];if(r!==Symbol.for("react.early_return_sentinel"))return r;let s=a,t;e[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(d,{dataKey:"value"}),e[3]=t):t=e[3];let l;return e[4]!==s?(l=(0,n.jsx)("div",{"aria-hidden":"true",className:"h-8 w-28",children:(0,n.jsx)(u,{animationType:"none",barCategoryGap:1,className:"h-8 w-full",config:p,data:s,children:t})}),e[4]=s,e[5]=l):l=e[5],l},"b");function g(o,e){return{index:e,value:o}}c(g,"h");export{_ as default};
@@ -0,0 +1 @@
1
+ var s="https://dash.cloudflare.com/?to=/:account",a=`${s}/workers-and-pages/observability`,r=`${s}/workers-and-pages`,o=`${s}/r2`,e=`${s}/workers/d1`,t=`${s}/workers/durable-objects`;export{a,r as b,o as c,e as d,t as e};
@@ -0,0 +1,3 @@
1
+ import{b as Se,c as Ie}from"./chunk-YOB2X3FZ.js";import{a as we}from"./chunk-EA2JKR5D.js";import{a as ye}from"./chunk-PD6WIDY6.js";import{a as Ne}from"./chunk-2DX5MROH.js";import{b as pe}from"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as he}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-225VJ77I.js";import{a as H}from"./chunk-4ZEL6BYL.js";import{d as ge}from"./chunk-FPG5ZRPW.js";import{f as xe}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import{d as se}from"./chunk-MKL7VDTL.js";import{a as ne,e as ie}from"./chunk-WUWBZPUK.js";import{d as be,f as ce,g as de,h as ee,o as me}from"./chunk-FODLDLE2.js";import{a as s,d as le,e as Ce,f as Te,g as Ee}from"./chunk-YKXDMIHQ.js";var ve=le(Te(),1);var g=le(Ce(),1);var r=le(Ee(),1);var Ae=ce(H.exportShard),Oe=ce(H.importShard),Le=s(x=>x.map(e=>JSON.stringify(Se(e))).join(`
2
+ `),"Ce"),Je=s(x=>{let e=[],te=x.split(`
3
+ `);for(let[n,N]of te.entries()){let t=N.trim();if(t==="")continue;let o=Ie(JSON.parse(t));if(typeof o!="object"||o===null)throw new se("INTERNAL",`line ${(n+1).toString()}: expected a { table, doc } object`);let b=o;if(typeof b.table!="string"||typeof b.doc!="object"||b.doc===null||Array.isArray(b.doc))throw new se("INTERNAL",`line ${(n+1).toString()}: expected a { table, doc } object`);e.push(b)}return e},"Te"),He=s(x=>{let e=(0,ve.c)(94),{initialShardKey:te}=x,n=xe(),N=ge(),t=be(),[o,b]=(0,g.useState)(te??""),[a,fe]=(0,g.useState)(""),[d,K]=(0,g.useState)(!1),[Q,M]=(0,g.useState)(null),[i,re]=(0,g.useState)(null),[y,ue]=(0,g.useState)(null),V;e[0]!==n||e[1]!==o?(V=s(async()=>{K(!0),M(null),re(null);try{let c=await n.query(Ae,{},de(o));pe(o),fe(Le(c.rows)),ue(c.rows.length)}catch(c){M(ee(c))}K(!1)},"G"),e[0]=n,e[1]=o,e[2]=V):V=e[2];let z=V,W;e[3]!==n||e[4]!==N||e[5]!==a||e[6]!==o||e[7]!==t?(W=s(async()=>{K(!0),M(null),re(null),ue(null);let c;try{c=Je(a)}catch(l){M(t("Invalid NDJSON: {message}",{message:ee(l)})),K(!1);return}try{let l=await n.query(Oe,{rows:c},de(o));pe(o),re(l),N(H.readTablePage),N(H.listTables)}catch(l){M(ee(l))}K(!1)},"Q"),e[3]=n,e[4]=N,e[5]=a,e[6]=o,e[7]=t,e[8]=W):W=e[8];let G=W,w,S,I,m,v,p,f,j,C,u,T;if(e[9]!==d||e[10]!==y||e[11]!==z||e[12]!==i||e[13]!==G||e[14]!==a||e[15]!==o||e[16]!==t){let c=i===null?0:Object.values(i.inserted).reduce(_e,0),l;e[28]!==z?(l=s(()=>{me(z())},"o"),e[28]=z,e[29]=l):l=e[29];let oe=l,Y;e[30]!==G?(Y=s(()=>{me(G())},"Y"),e[30]=G,e[31]=Y):Y=e[31];let ae=Y,Z;e[32]===Symbol.for("react.memo_cache_sentinel")?(Z=s(h=>{fe(h.target.value)},"Z"),e[32]=Z):Z=e[32];let je=Z;T="flex flex-col gap-4",I="lunora-export-import";let L;e[33]!==t?(L=t("Export"),e[33]=t,e[34]=L):L=e[34];let J;e[35]!==L?(J=(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:L})}),e[35]=L,e[36]=J):J=e[36];let _;e[37]!==o?(_=(0,r.jsx)(Ne,{onChange:b,testId:"ei-shard-input",value:o}),e[37]=o,e[38]=_):_=e[38];let $;e[39]!==t?($=t("Export"),e[39]=t,e[40]=$):$=e[40];let k;e[41]!==d||e[42]!==oe||e[43]!==$?(k=(0,r.jsx)(he,{"data-testid":"ei-export",disabled:d,onClick:oe,type:"button",children:$}),e[41]=d,e[42]=oe,e[43]=$,e[44]=k):k=e[44];let D;e[45]!==_||e[46]!==k?(D=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[_,k]}),e[45]=_,e[46]=k,e[47]=D):D=e[47];let q;e[48]!==y||e[49]!==t?(q=y!==null&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:t("Exported {count} rows.",{count:y})}),e[48]=y,e[49]=t,e[50]=q):q=e[50];let B;e[51]!==D||e[52]!==q?(B=(0,r.jsxs)(ie,{className:"flex flex-col gap-3 p-4",children:[D,q]}),e[51]=D,e[52]=q,e[53]=B):B=e[53],e[54]!==J||e[55]!==B?(m=(0,r.jsxs)(ne,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[J,B]}),e[54]=J,e[55]=B,e[56]=m):m=e[56],S=ne,C="gap-0 py-0 rounded-xl border border-border bg-card shadow-xs";let P;e[57]!==t?(P=t("Import"),e[57]=t,e[58]=P):P=e[58],e[59]!==P?(u=(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:P})}),e[59]=P,e[60]=u):u=e[60],w=ie,v="flex flex-col gap-3 p-4",e[61]!==a?(p=(0,r.jsx)(we,{"aria-label":"NDJSON",className:"font-mono text-xs min-h-40 rounded-md","data-testid":"ei-ndjson",onChange:je,placeholder:'{"table":"messages","doc":{\u2026}}',value:a}),e[61]=a,e[62]=p):p=e[62];let R;e[63]!==t?(R=t("Import (writes rows)?"),e[63]=t,e[64]=R):R=e[64];let U;e[65]!==d||e[66]!==a?(U=d||a.trim()==="",e[65]=d,e[66]=a,e[67]=U):U=e[67];let F;e[68]!==t?(F=t("Import"),e[68]=t,e[69]=F):F=e[69],e[70]!==ae||e[71]!==R||e[72]!==U||e[73]!==F?(f=(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,r.jsx)(ye,{confirmLabel:R,disabled:U,onConfirm:ae,testId:"ei-import",children:F})}),e[70]=ae,e[71]=R,e[72]=U,e[73]=F,e[74]=f):f=e[74],j=i!==null&&(0,r.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:i.conflicts,errors:i.errors.length,inserted:c})}),i.errors.length>0&&(0,r.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:i.errors.map(h=>(0,r.jsx)("li",{className:"text-xs text-destructive",children:t("line {line} ({table}): {message}",{line:h.line,message:h.message,table:h.table})},`${h.table}-${h.line.toString()}`))})]}),e[9]=d,e[10]=y,e[11]=z,e[12]=i,e[13]=G,e[14]=a,e[15]=o,e[16]=t,e[17]=w,e[18]=S,e[19]=I,e[20]=m,e[21]=v,e[22]=p,e[23]=f,e[24]=j,e[25]=C,e[26]=u,e[27]=T}else w=e[17],S=e[18],I=e[19],m=e[20],v=e[21],p=e[22],f=e[23],j=e[24],C=e[25],u=e[26],T=e[27];let E;e[75]!==w||e[76]!==v||e[77]!==p||e[78]!==f||e[79]!==j?(E=(0,r.jsxs)(w,{className:v,children:[p,f,j]}),e[75]=w,e[76]=v,e[77]=p,e[78]=f,e[79]=j,e[80]=E):E=e[80];let A;e[81]!==S||e[82]!==E||e[83]!==C||e[84]!==u?(A=(0,r.jsxs)(S,{className:C,children:[u,E]}),e[81]=S,e[82]=E,e[83]=C,e[84]=u,e[85]=A):A=e[85];let O;e[86]!==Q?(O=Q!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:Q}),e[86]=Q,e[87]=O):O=e[87];let X;return e[88]!==I||e[89]!==m||e[90]!==A||e[91]!==O||e[92]!==T?(X=(0,r.jsxs)("div",{className:T,"data-testid":I,children:[m,A,O]}),e[88]=I,e[89]=m,e[90]=A,e[91]=O,e[92]=T,e[93]=X):X=e[93],X},"Ue");function _e(x,e){return x+e}s(_e,"Ae");export{He as ExportImportPanel};
@@ -0,0 +1 @@
1
+ import{h as T}from"./chunk-PLHA3OWK.js";import{a as S,c as w,e as _}from"./chunk-AAVLPU5Q.js";import{d as W}from"./chunk-225VJ77I.js";import{a as s,d as N,e as F,g as X}from"./chunk-YKXDMIHQ.js";var L=N(F(),1);var D=N(F(),1);var A=D.createContext({register:s(()=>{},"register"),unregister:s(()=>{},"unregister"),subscribeMapChange:s(()=>()=>{},"subscribeMapChange"),nextIndexRef:{current:0}});function j(){return D.useContext(A)}s(j,"useCompositeListContext");function ne(n={}){let{guess:t,label:e,metadata:i,textRef:u,index:r}=n,{register:a,unregister:f,subscribeMapChange:m,nextIndexRef:C}=j(),l=L.useRef(-1),[b,g]=L.useState(r==null&&t?()=>{if(l.current===-1){let p=C.current;C.current+=1,l.current=p}return l.current}:-1),M=r??b,E=L.useRef(null),y=L.useCallback(p=>{let v=E.current;v&&f(v),E.current=p,p&&a(p,{metadata:i??null,index:r??null,label:e,textRef:u})},[r,a,f,i,e,u]);return S(()=>{if(r==null)return m(p=>{let v=E.current?p.get(E.current)?.index:null;v!=null&&g(v)})},[r,m]),{ref:y,index:M}}s(ne,"useCompositeListItem");var R=N(F(),1);var k=N(X(),1);function ae(n){let{children:t,elementsRef:e,labelsRef:i,onMapChange:u}=n,r=w(u),[,a]=R.useState(!1),f=W(G).current,m=W(z).current,C=R.useRef(0),l=R.useRef(!0),b=R.useRef(null),g=R.useRef(null),M=w(()=>{l.current||(l.current=!0,a(o=>!o))}),E=w((o,h)=>{m.set(o,h),M()}),y=w(o=>{m.delete(o),M()}),p=w(o=>{let h=new Map;return e.current.length=0,i&&(i.current.length=0),o.forEach(c=>{h.set(c.element,{...c.registration.metadata??{},index:c.index}),e.current[c.index]=c.element,i&&(i.current[c.index]=c.registration.label!==void 0?c.registration.label:c.registration.textRef?.current?.textContent??c.element.textContent)}),C.current=e.current.length,h});function v(o){if(g.current?.disconnect(),g.current=null,typeof MutationObserver!="function"||o.length<2)return;let h=new MutationObserver(d=>{if(!K(d))return;let I=null;for(let x of o)if(x.isConnected){if(I&&H(I,x)>0){h.disconnect(),M();return}I=x}});g.current=h;let c=new Set;for(let d=1;d<o.length;d+=1){let I=J(o[d-1],o[d]);I&&c.add(I)}c.forEach(d=>h.observe(d,{childList:!0}))}s(v,"observe");let U=w(()=>{let[o,h]=q(m),c=p(o),d=b.current,I=!d||d.length!==o.length||o.some((x,V)=>{let O=d[V];return x.index!==O.index||x.element!==O.element||x.registration.index!==O.registration.index||x.registration.metadata!==O.registration.metadata});v(h),b.current=o,l.current=!1,I&&(f.forEach(x=>x(c)),r(c))});S(()=>(!l.current&&b.current&&p(b.current),()=>{e.current=[],i&&(i.current=[])}),[e,i,p]),S(()=>{l.current&&U()}),S(()=>()=>{g.current?.disconnect(),l.current=!0},[]);let B=w(o=>(f.add(o),()=>{f.delete(o)})),Y=R.useMemo(()=>({register:E,unregister:y,subscribeMapChange:B,nextIndexRef:C}),[E,y,B,C]);return(0,k.jsx)(A.Provider,{value:Y,children:t})}s(ae,"CompositeList");function z(){return new Map}s(z,"createMap");function G(){return new Set}s(G,"createListeners");function q(n){let t=new Set,e=[],i=[];n.forEach((r,a)=>{if(!a.isConnected)return;let f=r.index,m={index:f??-1,element:a,registration:r};f===null?i.push(m):f>=0&&(t.add(f),e.push(m))});let u=0;return i.sort((r,a)=>H(r.element,a.element)),i.forEach(r=>{for(;t.has(u);)u+=1;r.index=u,e.push(r),u+=1}),t.size>0&&e.sort((r,a)=>r.index-a.index),[e,i.map(r=>r.element)]}s(q,"getCompositeListSnapshot");function J(n,t){let e=n.parentElement;for(;e&&!e.contains(t);)e=e.parentElement;return e}s(J,"getCommonAncestor");function K(n){for(let t of n)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}s(K,"hasMovedNode");function H(n,t){return n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}s(H,"sortByDocumentPosition");var P=5;function pe(n,t){let e=Q(t);return n.clientX>=e.left-P&&n.clientX<=e.right+P&&n.clientY>=e.top-P&&n.clientY<=e.bottom+P}s(pe,"isMouseWithinBounds");function Q(n){let t=n.getBoundingClientRect(),e=_(n);if(T.env.jsdom)return t;let i=e.getComputedStyle(n,"::before"),u=e.getComputedStyle(n,"::after");if(!(i.content!=="none"||u.content!=="none"))return t;let a=parseFloat(i.width)||0,f=parseFloat(i.height)||0,m=parseFloat(u.width)||0,C=parseFloat(u.height)||0,l=Math.max(t.width,a,m),b=Math.max(t.height,f,C),g=l-t.width,M=b-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-M/2,bottom:t.bottom+M/2}}s(Q,"getPseudoElementBounds");function ge(n){return n==null||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true"}s(ge,"isElementDisabled");export{ne as a,ae as b,pe as c,ge as d};
@@ -0,0 +1 @@
1
+ import{d as v,e as U}from"./chunk-YKXDMIHQ.js";var q=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],a=q;var H=[["path",{d:"M17.9998 15C17.9998 15 13.5809 9.00001 11.9998 9C10.4187 8.99999 5.99985 15 5.99985 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],o=H;var W=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],r=W;var O=[["path",{d:"M2.99969 17.0002C2.99969 17.9302 2.99969 18.3952 3.10192 18.7767C3.37932 19.8119 4.18796 20.6206 5.22324 20.898C5.60474 21.0002 6.06972 21.0002 6.99969 21.0002L16.9997 21.0002C17.9297 21.0002 18.3947 21.0002 18.7762 20.898C19.8114 20.6206 20.6201 19.8119 20.8975 18.7767C20.9997 18.3952 20.9997 17.9302 20.9997 17.0002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.4998 11.5002C16.4998 11.5002 13.1856 16.0002 11.9997 16.0002C10.8139 16.0002 7.49976 11.5002 7.49976 11.5002M11.9997 15.0002V3.00016",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],s=O;var E=[["path",{d:"M2 12C2 8.31087 2 6.4663 2.81382 5.15877C3.1149 4.67502 3.48891 4.25427 3.91891 3.91554C5.08116 3 6.72077 3 10 3H14C17.2792 3 18.9188 3 20.0811 3.91554C20.5111 4.25427 20.8851 4.67502 21.1862 5.15877C22 6.4663 22 8.31087 22 12C22 15.6891 22 17.5337 21.1862 18.8412C20.8851 19.325 20.5111 19.7457 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7457 3.1149 19.325 2.81382 18.8412C2 17.5337 2 15.6891 2 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 3L9.5 21",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 7H6M5 10H6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],m=E;var G=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],S=G;var V=[["path",{d:"M18 14C18 14 13.5811 19 12 19C10.4188 19 6 14 6 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 9.99996C18 9.99996 13.5811 5.00001 12 5C10.4188 4.99999 6 10 6 10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],h=V;var N=[["path",{d:"M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],e=N;var z=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],f=z;var K=[["path",{d:"M21.0477 3.05293C18.8697 0.707363 2.48648 6.4532 2.50001 8.551C2.51535 10.9299 8.89809 11.6617 10.6672 12.1581C11.7311 12.4565 12.016 12.7625 12.2613 13.8781C13.3723 18.9305 13.9301 21.4435 15.2014 21.4996C17.2278 21.5892 23.1733 5.342 21.0477 3.05293Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.4999 12.5L14.9999 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],k=K;var n=v(U(),1),Z={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},A=(0,n.forwardRef)(({color:u="currentColor",size:d=24,strokeWidth:c,absoluteStrokeWidth:M=!1,className:w="",altIcon:F,showAlt:B=!1,icon:P,primaryColor:I,secondaryColor:i,disableSecondaryOpacity:L=!1,...T},D)=>{let x=c!==void 0?M?Number(c)*24/Number(d):c:void 0,C=x!==void 0?{strokeWidth:x,stroke:"currentColor"}:{},R={ref:D,...Z,width:d,height:d,color:I||u,className:w,...C,...T},y=[...B&&F?F:P].sort(([,p],[,t])=>{let l=p.opacity!==void 0;return t.opacity!==void 0?1:l?-1:0}).map(([p,t])=>{let l=t.opacity!==void 0,g=l&&!L?t.opacity:void 0,b=i?{...t.stroke!==void 0?{stroke:l?i:I||u}:{fill:l?i:I||u}}:{};return(0,n.createElement)(p,{...t,...C,...b,opacity:g,key:t.key})});return(0,n.createElement)("svg",R,y)});A.displayName="HugeiconsIcon";export{a,o as b,r as c,e as d,s as e,f,k as g,m as h,S as i,h as j,A as k};
@@ -0,0 +1 @@
1
+ import{a as O}from"./chunk-66UGPQVC.js";import{a as H}from"./chunk-PD6WIDY6.js";import{a as ee}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as Z}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as E}from"./chunk-FPG5ZRPW.js";import{f as R}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as _}from"./chunk-FKVZRPV5.js";import{a as K,b as V,c as z,d as F,e as u,f as p}from"./chunk-HEAQVSNS.js";import{a as A,e as T}from"./chunk-WUWBZPUK.js";import{d as M,h as G,o as W,r as X}from"./chunk-FODLDLE2.js";import{a as c,d as P,e as oe,f as re,g as ae}from"./chunk-YKXDMIHQ.js";var U=P(re(),1),Y=P(oe(),1);var t=P(ae(),1);var se=P(re(),1);var Q=P(oe(),1);var h=P(ae(),1);var ie=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","X"),le=c(a=>a.toSorted((e,i)=>e.scheduledFor-i.scheduledFor),"F"),ce=c((a,e,i)=>e!==void 0?e:i===void 0?d=>a.cancelScheduledJob(d):void 0,"Y"),de=c(a=>{let e=(0,se.c)(16),{cancelJob:i,loadJobs:d}=a===void 0?{}:a,f=R(),r=M(),l=d===void 0,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["lunora-scheduled-jobs"],e[0]=o):o=e[0];let N=E(o,async()=>{let v=await(d??(()=>f.listScheduledJobs()))();return le(v)}),[x,n]=(0,Q.useState)(void 0),[s,m]=(0,Q.useState)(void 0),y,k;e[1]!==f||e[2]!==l?(y=c(()=>{if(l)return f.subscribeScheduledJobs(v=>{m(void 0),n(le(v))})},"v"),k=[l,f],e[1]=f,e[2]=l,e[3]=y,e[4]=k):(y=e[3],k=e[4]),(0,Q.useEffect)(y,k);let g;e[5]!==N?(g=c(()=>{N.refetch()},"y"),e[5]=N,e[6]=g):g=e[6],O(g,!l);let J=ce(f,i,d),b=x??N.data,j=s??N.error,I=c(async v=>{if(J!==void 0){m(void 0);try{await J(v),l||N.refetch()}catch(D){m(G(D))}}},"A"),q="flex flex-col gap-3",B="lunora-scheduled-jobs",S;e[7]!==j?(S=j!==null&&(0,h.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:j}),e[7]=j,e[8]=S):S=e[8];let L;e[9]!==b?.length||e[10]!==r?(L=b?.length===0&&(0,h.jsx)(_,{description:r("Jobs queued with runAfter / runAt will appear here."),icon:(0,h.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,h.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,h.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:r("No scheduled jobs.")}),e[9]=b?.length,e[10]=r,e[11]=L):L=e[11];let $=b!==void 0&&b.length>0&&(0,h.jsx)(A,{className:"overflow-hidden py-0",children:(0,h.jsx)(T,{className:"px-0",children:(0,h.jsxs)(K,{"data-testid":"sj-table",children:[(0,h.jsx)(V,{children:(0,h.jsxs)(F,{children:[(0,h.jsx)(u,{children:r("function")}),(0,h.jsx)(u,{children:r("scheduled for")}),(0,h.jsx)(u,{children:r("pool")}),(0,h.jsx)(u,{children:r("attempts")}),(0,h.jsx)(u,{children:r("shard")}),(0,h.jsx)(u,{children:r("id")}),J!==void 0&&(0,h.jsx)(u,{"aria-label":r("Actions")})]})}),(0,h.jsx)(z,{children:b.map(v=>(0,h.jsxs)(F,{"data-testid":`sj-row-${v.id}`,children:[(0,h.jsx)(p,{className:"font-mono text-xs",children:v.workflow??v.functionPath}),(0,h.jsx)(p,{className:"text-muted-foreground tabular-nums",children:ie(v.scheduledFor)}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.pool??""}),(0,h.jsx)(p,{className:"tabular-nums",children:v.attempts??0}),(0,h.jsx)(p,{children:v.shardKey??""}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.id}),J!==void 0&&(0,h.jsx)(p,{className:"text-right",children:(0,h.jsx)(H,{confirmLabel:r("Cancel job?"),onConfirm:c(()=>{W(I(v.id))},"onConfirm"),testId:`sj-cancel-${v.id}`,children:r("Cancel")})})]},v.id))})]})})}),w;return e[12]!==$||e[13]!==S||e[14]!==L?(w=(0,h.jsxs)("div",{className:q,"data-testid":B,children:[S,L,$]}),e[12]=$,e[13]=S,e[14]=L,e[15]=w):w=e[15],w},"he");var he={kind:"idle"},me=c((a,e,i)=>i!==void 0?i:e===void 0?d=>a.runCronJob(d):void 0,"re"),ue=c(({loadCronJobs:a,runCronJob:e}={})=>{let i=R(),d=M(),[f,r]=(0,Y.useState)({}),l=E(["lunora-cron-jobs",a?"custom":"default"],()=>(a??(()=>i.getCronJobs()))()),{data:o,error:N}=l,x=me(i,a,e),n=c(async s=>{if(x!==void 0){r(m=>({...m,[s]:{kind:"running"}}));try{await x(s),r(m=>({...m,[s]:{kind:"ok"}})),l.refetch()}catch(m){r(y=>({...y,[s]:{kind:"error",message:G(m)}}))}}},"i");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[N!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:N}),o?.length===0&&(0,t.jsx)(_,{description:d("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:d("No cron triggers.")}),o!==void 0&&o.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"cron-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:d("name")}),(0,t.jsx)(u,{children:d("schedule")}),(0,t.jsx)(u,{children:d("target")}),(0,t.jsx)(u,{children:d("shard")}),x!==void 0&&(0,t.jsx)(u,{"aria-label":d("Actions")})]})}),(0,t.jsx)(z,{children:o.map(s=>{let m=f[s.name]??he;return(0,t.jsxs)(F,{"data-testid":`cron-row-${s.name}`,children:[(0,t.jsx)(p,{children:s.name}),(0,t.jsx)(p,{className:"font-mono text-xs tabular-nums",children:s.cron}),(0,t.jsx)(p,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[s.workflow===void 0?(0,t.jsx)(Z,{variant:"outline",children:d("function")}):(0,t.jsx)(Z,{variant:"secondary",children:d("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.workflow??s.functionPath})]})}),(0,t.jsx)(p,{children:s.shardKey??""}),x!==void 0&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[m.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${s.name}`,children:d("ran")}),m.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${s.name}`,role:"alert",children:m.message}),(0,t.jsx)(H,{confirmLabel:d("Run now?"),disabled:m.kind==="running",onConfirm:c(()=>{W(n(s.name))},"onConfirm"),testId:`cron-run-${s.name}`,children:m.kind==="running"?d("Running\u2026"):d("Run now")})]})})]},`${s.cron}:${s.name}`)})})]})})})]})},"le"),pe=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","se"),fe=c(a=>{let e=(0,U.c)(34),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadJobs:d,removeJob:f,retryJob:r}=i,l=R(),o=M(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let x;e[3]!==l||e[4]!==d?(x=c(async()=>(await(d??(()=>l.listDeadJobs()))()).toSorted(be),"h"),e[3]=l,e[4]=d,e[5]=x):x=e[5];let n=E(N,x),s=n.data,[m,y]=(0,Y.useState)(void 0),k=n.error??m,g=d===void 0,J;e[6]!==l||e[7]!==g||e[8]!==r?(J=r??(g?C=>l.retryDeadJob(C):void 0),e[6]=l,e[7]=g,e[8]=r,e[9]=J):J=e[9];let b=J,j;e[10]!==l||e[11]!==g||e[12]!==f?(j=f??(g?C=>l.removeDeadJob(C):void 0),e[10]=l,e[11]=g,e[12]=f,e[13]=j):j=e[13];let I=j,q;e[14]!==n?(q=c(()=>{n.refetch()},"$"),e[14]=n,e[15]=q):q=e[15],O(q,!0);let B;e[16]!==n?(B=c(async C=>{y(void 0);try{await C,n.refetch()}catch(ne){y(G(ne))}},"I"),e[16]=n,e[17]=B):B=e[17];let S=B,L=b!==void 0||I!==void 0,$;e[18]!==k?($=k!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:k}),e[18]=k,e[19]=$):$=e[19];let w;e[20]!==s?.length||e[21]!==o?(w=s?.length===0&&(0,t.jsx)(_,{description:o("Jobs that exhaust their retry budget are parked here instead of being dropped."),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:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:o("No dead-letter jobs.")}),e[20]=s?.length,e[21]=o,e[22]=w):w=e[22];let v;e[23]!==S||e[24]!==L||e[25]!==s||e[26]!==I||e[27]!==b||e[28]!==o?(v=s!==void 0&&s.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"dlq-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:o("function")}),(0,t.jsx)(u,{children:o("attempts")}),(0,t.jsx)(u,{children:o("last tried")}),(0,t.jsx)(u,{children:o("pool")}),(0,t.jsx)(u,{children:o("shard")}),(0,t.jsx)(u,{children:o("id")}),L&&(0,t.jsx)(u,{"aria-label":o("Actions")})]})}),(0,t.jsx)(z,{children:s.map(C=>(0,t.jsxs)(F,{"data-testid":`dlq-row-${C.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:C.workflow??C.functionPath}),(0,t.jsx)(p,{className:"tabular-nums",children:C.attempts??0}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:pe(C.scheduledFor)}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.pool??""}),(0,t.jsx)(p,{children:C.shardKey??""}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.id}),L&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[b!==void 0&&(0,t.jsx)(ee,{"data-testid":`dlq-retry-${C.id}`,onClick:c(()=>{W(S(b(C.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:o("Retry")}),I!==void 0&&(0,t.jsx)(H,{confirmLabel:o("Drop job?"),onConfirm:c(()=>{W(S(I(C.id)))},"onConfirm"),testId:`dlq-remove-${C.id}`,children:o("Drop")})]})})]},C.id))})]})})}),e[23]=S,e[24]=L,e[25]=s,e[26]=I,e[27]=b,e[28]=o,e[29]=v):v=e[29];let D;return e[30]!==v||e[31]!==$||e[32]!==w?(D=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[$,w,v]}),e[30]=v,e[31]=$,e[32]=w,e[33]=D):D=e[33],D},"ne");function be(a,e){return(e.attempts??0)-(a.attempts??0)}c(be,"oe");var te=c(a=>{let e=(0,U.c)(8),{label:i,testId:d,value:f}=a,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==d||e[3]!==f?(l=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":d,children:f}),e[2]=d,e[3]=f,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o=(0,t.jsx)(A,{className:"flex-1 py-0",children:(0,t.jsxs)(T,{className:"flex flex-col gap-1 p-4",children:[r,l]})}),e[5]=r,e[6]=l,e[7]=o):o=e[7],o},"E"),ve=c(a=>{let e=(0,U.c)(25),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadStatus:d}=i,f=R(),r=M(),l=d===void 0,o;e[2]!==l?(o=["lunora-scheduler-status",l],e[2]=l,e[3]=o):o=e[3];let N;e[4]!==f||e[5]!==d?(N=c(async()=>{let j=await(d??(()=>f.schedulerStatus()))();return{...j,pools:j.pools.toSorted(xe)}},"y"),e[4]=f,e[5]=d,e[6]=N):N=e[6];let x=E(o,N),{data:n,error:s}=x,m;e[7]!==x?(m=c(()=>{x.refetch()},"d"),e[7]=x,e[8]=m):m=e[8],O(m,!0);let y;e[9]!==s?(y=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:s}),e[9]=s,e[10]=y):y=e[10];let k;e[11]!==n||e[12]!==r?(k=n!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(te,{label:r("backlog"),testId:"pools-backlog",value:n.backlog}),(0,t.jsx)(te,{label:r("in flight"),testId:"pools-inflight",value:n.inFlight}),(0,t.jsx)(te,{label:r("pools"),testId:"pools-count",value:n.pools.length})]}),e[11]=n,e[12]=r,e[13]=k):k=e[13];let g;e[14]!==n?.pools.length||e[15]!==r?(g=n?.pools.length===0&&(0,t.jsx)(_,{description:r("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:r("No workpools.")}),e[14]=n?.pools.length,e[15]=r,e[16]=g):g=e[16];let J;e[17]!==n||e[18]!==r?(J=n!==void 0&&n.pools.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"pools-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:r("pool")}),(0,t.jsx)(u,{children:r("queued")}),(0,t.jsx)(u,{children:r("in flight")}),(0,t.jsx)(u,{children:r("max concurrency")})]})}),(0,t.jsx)(z,{children:n.pools.map(ge)})]})})}),e[17]=n,e[18]=r,e[19]=J):J=e[19];let b;return e[20]!==y||e[21]!==k||e[22]!==g||e[23]!==J?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[y,k,g,J]}),e[20]=y,e[21]=k,e[22]=g,e[23]=J,e[24]=b):b=e[24],b},"ae");function xe(a,e){return e.queued-a.queued}c(xe,"ie");function ge(a){return(0,t.jsxs)(F,{"data-testid":`pools-row-${a.name}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:a.name}),(0,t.jsx)(p,{className:"tabular-nums",children:a.queued}),(0,t.jsxs)(p,{className:"tabular-nums",children:[a.inFlight," / ",a.maxConcurrency]}),(0,t.jsx)(p,{className:"tabular-nums",children:a.maxConcurrency})]},a.name)}c(ge,"de");var Ne=["jobs","dead","pools","cron"],Ve=c(a=>{let e=(0,U.c)(41),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadCronJobs:d,scheduledCancel:f,scheduledLoad:r}=i,l=M(),[o,N]=(0,Y.useState)("jobs"),x;e[2]!==l?(x=l("Cron triggers"),e[2]=l,e[3]=x):x=e[3];let n;e[4]!==l?(n=l("Dead letter"),e[4]=l,e[5]=n):n=e[5];let s;e[6]!==l?(s=l("Scheduled jobs"),e[6]=l,e[7]=s):s=e[7];let m;e[8]!==l?(m=l("Pools"),e[8]=l,e[9]=m):m=e[9];let y;e[10]!==x||e[11]!==n||e[12]!==s||e[13]!==m?(y={cron:x,dead:n,jobs:s,pools:m},e[10]=x,e[11]=n,e[12]=s,e[13]=m,e[14]=y):y=e[14];let k=y,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=c(w=>{N(w.currentTarget.dataset.view)},"f"),e[15]=g):g=e[15];let J=g,b;e[16]!==l?(b=l("Schedule view"),e[16]=l,e[17]=b):b=e[17];let j;e[18]!==o||e[19]!==k?(j=Ne.map(w=>(0,t.jsx)(ee,{"aria-selected":o===w,"data-testid":`schedule-view-${w}`,"data-view":w,onClick:J,role:"tab",size:"sm",type:"button",variant:o===w?"default":"outline",children:k[w]},w)),e[18]=o,e[19]=k,e[20]=j):j=e[20];let I;e[21]!==b||e[22]!==j?(I=(0,t.jsx)("div",{"aria-label":b,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:j}),e[21]=b,e[22]=j,e[23]=I):I=e[23];let q;e[24]!==f||e[25]!==r||e[26]!==o?(q=o==="jobs"&&(0,t.jsx)(de,{cancelJob:f,loadJobs:r}),e[24]=f,e[25]=r,e[26]=o,e[27]=q):q=e[27];let B;e[28]!==o?(B=o==="dead"&&(0,t.jsx)(fe,{}),e[28]=o,e[29]=B):B=e[29];let S;e[30]!==o?(S=o==="pools"&&(0,t.jsx)(ve,{}),e[30]=o,e[31]=S):S=e[31];let L;e[32]!==d||e[33]!==o?(L=o==="cron"&&(0,t.jsx)(ue,{loadCronJobs:d}),e[32]=d,e[33]=o,e[34]=L):L=e[34];let $;return e[35]!==I||e[36]!==q||e[37]!==B||e[38]!==S||e[39]!==L?($=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[I,q,B,S,L]}),e[35]=I,e[36]=q,e[37]=B,e[38]=S,e[39]=L,e[40]=$):$=e[40],$},"Ie");export{Ve as SchedulePanel};
@@ -0,0 +1 @@
1
+ import{b as h}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as A}from"./chunk-FPG5ZRPW.js";import{f as k}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as y,e as S}from"./chunk-WUWBZPUK.js";import{d as I}from"./chunk-FODLDLE2.js";import{a as u,d as w,f as z,g as P}from"./chunk-YKXDMIHQ.js";var N=w(z(),1);var a=w(P(),1);var j=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),p=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:n}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let s;i[2]!==t?(s=(0,a.jsx)(S,{className:"p-3",children:t}),i[2]=t,i[3]=s):s=i[3];let c;return i[4]!==l||i[5]!==s||i[6]!==n?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":n,children:[l,s]}),i[4]=l,i[5]=s,i[6]=n,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,n;i[0]!==t?(n=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=n):n=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let s;return i[4]!==n||i[5]!==l?(s=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[n,l]}),i[4]=n,i[5]=l,i[6]=s):s=i[6],s},"c"),M=u(()=>{let e=(0,N.c)(20),i=k(),t=I(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let n;e[1]!==i?(n=u(()=>i.getAuthConfig(),"r"),e[1]=i,e[2]=n):n=e[2];let{data:l,error:s}=A(d,n),c;e[3]!==t?(c=u(r=>(0,a.jsx)(h,{variant:r?"success":"outline",children:t(r?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,g;e[5]!==s?(g=s!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:s}),e[5]=s,e[6]=g):g=e[6];let f;e[7]!==l||e[8]!==s||e[9]!==t?(f=s===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=s,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==s||e[13]!==m||e[14]!==t?(x=s===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:j.map(r=>{let $=l.capabilities[r.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${r.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(r.label)}),m($)]},r.key)})})}),(0,a.jsx)(p,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(C)})}),(0,a.jsx)(p,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(L)})})]})}),l.organization.enabled&&(0,a.jsx)(p,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(p,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(p,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(p,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(r=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${r.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:r.name}),r.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:r.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:r.type}),r.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),r.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},r.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=s,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==g||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[g,f,x]}),e[16]=g,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"O");function C(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(C,"P");function L(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(L,"z");export{M as default};
@@ -0,0 +1 @@
1
+ import{b as C}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as J}from"./chunk-GWFZ7WCP.js";import"./chunk-ULIQFBZU.js";import"./chunk-4JJEP7LF.js";import"./chunk-35DM4JJG.js";import{a as H}from"./chunk-4ZEL6BYL.js";import{c as z}from"./chunk-FPG5ZRPW.js";import"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as E}from"./chunk-FKVZRPV5.js";import{a as G,b as M,c as U,d as P,e as d,f as c}from"./chunk-HEAQVSNS.js";import{a as D,e as _}from"./chunk-WUWBZPUK.js";import{d as q}from"./chunk-FODLDLE2.js";import{a as S,d as O,f as Q,g as V}from"./chunk-YKXDMIHQ.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{b as P}from"./chunk-2HFEYNGZ.js";import{c as K,d as X,e as z,f as L,h as B,i as E,j as G,k as q,l as A,m as O,n as W,o as $,p as D}from"./chunk-P5RUFDVX.js";import{a as F,b as H,c as I,d as S,e as J,f as M}from"./chunk-HEAQVSNS.js";import{d as C,n as j}from"./chunk-FODLDLE2.js";import{a as f,d as T,f as U,g as V}from"./chunk-YKXDMIHQ.js";var N=T(U(),1);var t=T(V(),1);var _=50,R={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},Q=f(r=>{let a=r.columns.find(e=>r.rows.length>0&&r.rows.every(n=>typeof n[e]=="number"))??null;return{label:r.columns.find(e=>e!==a)??null,value:a}},"D"),Y=f(r=>{let a=(0,N.c)(3),{data:e,kind:n}=r,l;return a[0]!==e||a[1]!==n?(l=(0,t.jsx)(G,{className:"h-full w-full",config:R,children:n==="area"?(0,t.jsxs)(E,{data:e,children:[(0,t.jsx)(K,{vertical:!1}),(0,t.jsx)(L,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(A,{content:(0,t.jsx)(q,{})}),(0,t.jsx)(z,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):(0,t.jsxs)(B,{data:e,children:[(0,t.jsx)(K,{vertical:!1}),(0,t.jsx)(L,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(A,{content:(0,t.jsx)(q,{})}),(0,t.jsx)(X,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),a[0]=e,a[1]=n,a[2]=l):l=a[2],l},"J"),na=f(r=>{let a=(0,N.c)(21),{axes:e,kind:n,result:l}=r,u=C(),o;a[0]!==l?(o=Q(l),a[0]=l,a[1]=o):o=a[1];let d=o,m;a[2]!==l.columns?(m=new Set(l.columns),a[2]=l.columns,a[3]=m):m=a[3];let s=m,c=e!==void 0&&s.has(e.x)?e.x:d.label,p;a[4]!==e?.y||a[5]!==s?(p=e?.y.find(i=>s.has(i)),a[4]=e?.y,a[5]=s,a[6]=p):p=a[6];let x=p,y=x??d.value,b;a[7]!==c||a[8]!==l.rows||a[9]!==y?(b=y===null?[]:l.rows.slice(0,_).map((i,w)=>({label:c===null?`#${(w+1).toString()}`:j(i[c]),value:Number(i[y])||0})),a[7]=c,a[8]=l.rows,a[9]=y,a[10]=b):b=a[10];let k=b;if(y===null){let i;a[11]!==u?(i=u("No numeric column to chart."),a[11]=u,a[12]=i):i=a[12];let w;return a[13]!==i?(w=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:i}),a[13]=i,a[14]=w):w=a[14],w}let h=n??(e!==void 0&&x!==void 0?e.kind:"bar"),v;a[15]!==k||a[16]!==h?(v=h==="bar"?(0,t.jsxs)(O,{className:"h-full w-full",config:R,data:k,children:[(0,t.jsx)($,{dataKey:"label"}),(0,t.jsx)(W,{dataKey:"value"}),(0,t.jsx)(D,{})]}):(0,t.jsx)(Y,{data:k,kind:h}),a[15]=k,a[16]=h,a[17]=v):v=a[17];let g;return a[18]!==h||a[19]!==v?(g=(0,t.jsx)("div",{className:"h-80 w-full p-3","data-chart-kind":h,"data-testid":"sql-chart",children:v}),a[18]=h,a[19]=v,a[20]=g):g=a[20],g},"oe"),oa=f(r=>{let a=(0,N.c)(19),{result:e}=r,n=C();if(e.columns.length===0){let s;a[0]!==e.rowCount||a[1]!==n?(s=n("{count} rows",{count:e.rowCount}),a[0]=e.rowCount,a[1]=n,a[2]=s):s=a[2];let c;return a[3]!==s?(c=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:s}),a[3]=s,a[4]=c):c=a[4],c}let l;a[5]!==e.columns?(l=e.columns.map(Z),a[5]=e.columns,a[6]=l):l=a[6];let u;a[7]!==l?(u=(0,t.jsx)(H,{className:"sticky top-0 z-10 bg-muted",children:(0,t.jsx)(S,{children:l})}),a[7]=l,a[8]=u):u=a[8];let o;if(a[9]!==e.columns||a[10]!==e.rows){let s;a[12]!==e.columns?(s=f((c,p)=>(0,t.jsx)(S,{"data-testid":"sql-row",children:e.columns.map(x=>(0,t.jsx)(M,{className:"max-w-md truncate font-mono text-xs",children:(0,t.jsx)(P,{value:c[x]})},x))},p),"s"),a[12]=e.columns,a[13]=s):s=a[13],o=e.rows.map(s),a[9]=e.columns,a[10]=e.rows,a[11]=o}else o=a[11];let d;a[14]!==o?(d=(0,t.jsx)(I,{children:o}),a[14]=o,a[15]=d):d=a[15];let m;return a[16]!==u||a[17]!==d?(m=(0,t.jsxs)(F,{"data-testid":"sql-rows",children:[u,d]}),a[16]=u,a[17]=d,a[18]=m):m=a[18],m},"ne");function Z(r){return(0,t.jsx)(J,{children:r},r)}f(Z,"P");export{na as a,oa as b};
@@ -0,0 +1 @@
1
+ import{a as o,d as n,f as m,g as u,i as c}from"./chunk-YKXDMIHQ.js";var l=n(m(),1);var i=n(u(),1);function f({className:d,size:a="default",...t}){return(0,i.jsx)("div",{"data-slot":"card","data-size":a,className:c("group/card flex flex-col gap-4 overflow-hidden rounded-xl border border-border bg-card py-4 text-xs/relaxed text-card-foreground shadow-xs has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-2 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-md *:[img:last-child]:rounded-md",d),...t})}o(f,"p");function x(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-md px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-header",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(x,"f");function g(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("font-heading text-sm font-medium group-data-[size=sm]/card:text-sm",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-title",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(g,"u");function h(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("text-xs/relaxed text-muted-foreground",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-description",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(h,"x");function b(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("px-4 group-data-[size=sm]/card:px-3",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-content",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(b,"g");export{f as a,x as b,g as c,h as d,b as e};
@@ -0,0 +1 @@
1
+ import{b as u}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as y}from"./chunk-GWFZ7WCP.js";import"./chunk-ULIQFBZU.js";import"./chunk-4JJEP7LF.js";import"./chunk-35DM4JJG.js";import{a as N}from"./chunk-4ZEL6BYL.js";import{c as v}from"./chunk-FPG5ZRPW.js";import"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as g}from"./chunk-FKVZRPV5.js";import{a as w,b,c as S,d as c,e as s,f as o}from"./chunk-HEAQVSNS.js";import{a as f,e as x}from"./chunk-WUWBZPUK.js";import{d as p}from"./chunk-FODLDLE2.js";import{a as n,d as R,g as T}from"./chunk-YKXDMIHQ.js";var e=R(T(),1);var $={active:"default",failing:"destructive",idle:"secondary"},j=n(a=>a===void 0?"\u2014":`${new Date(a).toISOString().slice(0,19).replace("T"," ")} UTC`,"I"),U=n(a=>{let t=a.runs+a.suppressed;return t===0?void 0:Math.round(a.suppressed/t*100)},"$"),F=n(({initialShardKey:a=""})=>{let t=p(),{data:l,error:E,errorSource:A,liveError:I}=v(N.listReactors,{},{live:!0,shardKey:a}),C=l!==void 0,i=Array.isArray(l?.reactors)?l.reactors:[],d;C&&i.length===0?d=(0,e.jsx)(g,{description:t("No reactor is declared in this deployment. Export an onQueryChange(select, handler) from lunora/ to run server-side logic when a query's result changes."),testId:"reactors-empty",title:t("No reactors declared")}):d=(0,e.jsx)(f,{className:"overflow-hidden py-0",children:(0,e.jsx)(x,{className:"px-0",children:(0,e.jsxs)(w,{"data-testid":"reactors-table",children:[(0,e.jsx)(b,{children:(0,e.jsxs)(c,{children:[(0,e.jsx)(s,{children:t("Reactor")}),(0,e.jsx)(s,{children:t("State")}),(0,e.jsx)(s,{children:t("Ran")}),(0,e.jsx)(s,{children:t("Suppressed")}),(0,e.jsx)(s,{children:t("Errors")}),(0,e.jsx)(s,{children:t("Watches")}),(0,e.jsx)(s,{children:t("Last dispatch")})]})}),(0,e.jsx)(S,{children:i.map(r=>{let m=U(r);return(0,e.jsxs)(c,{"data-testid":`reactors-row-${r.path}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:r.path}),(0,e.jsx)(o,{children:(0,e.jsx)(u,{"data-testid":`reactors-state-${r.path}`,variant:$[r.state],children:r.state})}),(0,e.jsx)(o,{className:"font-mono text-xs",children:r.runs}),(0,e.jsxs)(o,{className:"font-mono text-xs text-muted-foreground",children:[r.suppressed,m===void 0?"":` (${String(m)}%)`]}),(0,e.jsx)(o,{className:"font-mono text-xs",children:r.errors===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"0"}):(0,e.jsx)("span",{className:"text-destructive",children:r.errors})}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:r.tables===void 0||r.tables.length===0?"\u2014":r.tables.join(", ")}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:j(r.lastRanAt)})]},r.path)})})]})})});let h=i.filter(r=>r.state==="failing");return(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-reactors-panel",children:[E!==null&&(0,e.jsx)(y,{error:A,testId:"reactors-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("A reactor runs after a write flush, but only when the result of the query it watches actually changed \u2014 a trigger fires on a row write, a reactor fires on a result changing. Suppressed dispatches are the ones where the read re-ran and nothing had moved.")}),h.length>0&&(0,e.jsx)("div",{className:"flex flex-col gap-2","data-testid":"reactors-failing",children:h.map(r=>(0,e.jsxs)("p",{className:"text-xs text-destructive",role:"alert",children:[(0,e.jsx)("span",{className:"font-mono",children:r.path}),": ",r.lastError??t("last dispatch failed")]},r.path))}),I!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"reactors-live-error",role:"alert",children:t("Live updates unavailable; showing the last reading.")}),d]})},"U");export{F as default};