@lunora/studio 1.0.0-alpha.20 → 1.0.0-alpha.201

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 (333) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.mts +1566 -0
  4. package/dist/index.d.ts +961 -803
  5. package/dist/index.mjs +1 -0
  6. package/dist/mount.d.mts +22 -0
  7. package/dist/mount.d.ts +11 -10
  8. package/dist/mount.mjs +1 -0
  9. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
  10. package/dist/packem_chunks/ApiTab.mjs +1 -0
  11. package/dist/packem_chunks/AuditPanel.mjs +1 -0
  12. package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
  13. package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
  14. package/dist/packem_chunks/FileBrowser.mjs +4 -0
  15. package/dist/packem_chunks/FunctionRunner.mjs +1 -0
  16. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
  17. package/dist/packem_chunks/HealthPanel.mjs +1 -0
  18. package/dist/packem_chunks/InsightsPanel.mjs +1 -0
  19. package/dist/packem_chunks/LogsPanel.mjs +1 -0
  20. package/dist/packem_chunks/MailPanel.mjs +2 -0
  21. package/dist/packem_chunks/MetricsPanel.mjs +1 -0
  22. package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
  23. package/dist/packem_chunks/PitrPanel.mjs +1 -0
  24. package/dist/packem_chunks/SchemaViewer.mjs +1 -0
  25. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
  26. package/dist/packem_chunks/SettingsPanel.mjs +1 -0
  27. package/dist/packem_chunks/SqlEditorPanel.mjs +8 -0
  28. package/dist/packem_chunks/TableEditor.mjs +1 -0
  29. package/dist/packem_chunks/agents-panel.mjs +1 -0
  30. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  31. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  32. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  33. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  34. package/dist/packem_chunks/containers-panel.mjs +1 -0
  35. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  36. package/dist/packem_chunks/evals-panel.mjs +1 -0
  37. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  38. package/dist/packem_chunks/flags-panel.mjs +1 -0
  39. package/dist/packem_chunks/issues-panel.mjs +1 -0
  40. package/dist/packem_chunks/kv-browser.mjs +1 -0
  41. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  42. package/dist/packem_chunks/migrations-route.mjs +1 -0
  43. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  44. package/dist/packem_chunks/payments-panel.mjs +1 -0
  45. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  46. package/dist/packem_chunks/queues-panel.mjs +1 -0
  47. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  48. package/dist/packem_chunks/rls-panel.mjs +1 -0
  49. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  50. package/dist/packem_chunks/sparkline.mjs +1 -0
  51. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  52. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  53. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  54. package/dist/packem_chunks/traces-panel.mjs +1 -0
  55. package/dist/packem_chunks/users-panel.mjs +1 -0
  56. package/dist/packem_chunks/vector-browser.mjs +1 -0
  57. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  58. package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
  59. package/dist/packem_shared/ApiDocsPanel-BImfQhyJ.mjs +2 -0
  60. package/dist/packem_shared/ApiReferencePanel-CigvHhCa.mjs +1 -0
  61. package/dist/packem_shared/CommandPalette-CSdz9zax.mjs +1 -0
  62. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  63. package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
  64. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
  65. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  66. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
  67. package/dist/packem_shared/DataBrowser-DLRa1EYq.mjs +4 -0
  68. package/dist/packem_shared/DataFilters-Cocu-WWE.mjs +1 -0
  69. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  70. package/dist/packem_shared/GlobalDataBrowser-BTbqR6Wc.mjs +1 -0
  71. package/dist/packem_shared/HomePanel-_BwLI4TQ.mjs +1 -0
  72. package/dist/packem_shared/MigrationsPanel-BPWzFdxC.mjs +1 -0
  73. package/dist/packem_shared/OpenRpcReferencePanel-C6CM791D.mjs +1 -0
  74. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  75. package/dist/packem_shared/ScheduledJobs-B4DPADwk.mjs +1 -0
  76. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  77. package/dist/packem_shared/Studio-CcWQdYrV.mjs +1 -0
  78. package/dist/packem_shared/StudioApp-fYFz6zZQ.mjs +1 -0
  79. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  80. package/dist/packem_shared/advisor-view-CPgOok_h.mjs +1 -0
  81. package/dist/packem_shared/aggregateMetrics-CY05xrYU.mjs +1 -0
  82. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  83. package/dist/packem_shared/app.d-BbmO2HA2.d.mts +301 -0
  84. package/dist/packem_shared/app.d-BbmO2HA2.d.ts +301 -0
  85. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  86. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  87. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  88. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  89. package/dist/packem_shared/card--2hKx4L2.mjs +1 -0
  90. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  91. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  92. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  93. package/dist/packem_shared/data-grid-DTBAKZlm.mjs +1 -0
  94. package/dist/packem_shared/data-view-params-qoSTqjAj.mjs +1 -0
  95. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  96. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  97. package/dist/packem_shared/error-alert-tf5zvSLV.mjs +1 -0
  98. package/dist/packem_shared/grid-features-Dm80ngyR.mjs +6 -0
  99. package/dist/packem_shared/home-panel-DCUKd8Uk.mjs +3 -0
  100. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  101. package/dist/packem_shared/internal-B6haJbiP.mjs +2 -0
  102. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  103. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  104. package/dist/packem_shared/log-fields-SBxKyBug.mjs +1 -0
  105. package/dist/packem_shared/log-line-BoObzuue.mjs +1 -0
  106. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  107. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  108. package/dist/packem_shared/recording-client-BXUIyBL4.mjs +1 -0
  109. package/dist/packem_shared/reference-view-DiikOols.mjs +13 -0
  110. package/dist/packem_shared/schema-diagram-CDj_69jF.mjs +2 -0
  111. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  112. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  113. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  114. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  115. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  116. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  117. package/dist/packem_shared/sql-result-table-C5y0jwaK.mjs +1 -0
  118. package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
  119. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  120. package/dist/packem_shared/studio-OqNyRY1N.mjs +2 -0
  121. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  122. package/dist/packem_shared/table-list-sidebar-DHG1UJC4.mjs +1 -0
  123. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  124. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  125. package/dist/packem_shared/use-admin-query-BKXiqLci.mjs +1 -0
  126. package/dist/packem_shared/use-async-submit-BTr3w2-K.mjs +1 -0
  127. package/dist/packem_shared/use-auth-config-CuM3eJZz.mjs +1 -0
  128. package/dist/packem_shared/use-open-trace-BCW0c9qq.mjs +1 -0
  129. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  130. package/dist/packem_shared/use-sql-assistant-BhIMDQHV.mjs +1 -0
  131. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  132. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  133. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  134. package/dist/packem_shared/wire-codec-Bk4XZGE4.mjs +1 -0
  135. package/dist/standalone/chunk-225VJ77I.js +1 -0
  136. package/dist/standalone/chunk-2DX5MROH.js +1 -0
  137. package/dist/standalone/chunk-2KN4I7HE.js +1 -0
  138. package/dist/standalone/chunk-2URQKGWU.js +1 -0
  139. package/dist/standalone/chunk-35DM4JJG.js +1 -0
  140. package/dist/standalone/chunk-3FBLWUXD.js +1 -0
  141. package/dist/standalone/chunk-3Q2P62UR.js +1 -0
  142. package/dist/standalone/chunk-3SSNMKL6.js +1 -0
  143. package/dist/standalone/chunk-3XMMUGIH.js +1 -0
  144. package/dist/standalone/chunk-3ZQEIVTV.js +1 -0
  145. package/dist/standalone/chunk-4GTO7FL5.js +1 -0
  146. package/dist/standalone/chunk-4JLGLPWV.js +1 -0
  147. package/dist/standalone/chunk-4L4WTGN5.js +1 -0
  148. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  149. package/dist/standalone/chunk-55754F6H.js +1 -0
  150. package/dist/standalone/chunk-56Y26MOD.js +2 -0
  151. package/dist/standalone/chunk-576LE6SL.js +14 -0
  152. package/dist/standalone/chunk-5CEAO2OT.js +15 -0
  153. package/dist/standalone/chunk-5FG7IYMP.js +1 -0
  154. package/dist/standalone/chunk-5JDWLCSH.js +1 -0
  155. package/dist/standalone/chunk-5MPUGVON.js +1 -0
  156. package/dist/standalone/chunk-5SCR3S7R.js +3 -0
  157. package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
  158. package/dist/standalone/chunk-66UGPQVC.js +1 -0
  159. package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
  160. package/dist/standalone/chunk-6TN5UDKA.js +1 -0
  161. package/dist/standalone/chunk-6VAKPAHP.js +1 -0
  162. package/dist/standalone/chunk-6XNP2NTT.js +1 -0
  163. package/dist/standalone/chunk-7HLP4FYY.js +1 -0
  164. package/dist/standalone/chunk-7UP3YP2W.js +1 -0
  165. package/dist/standalone/chunk-AAVLPU5Q.js +1 -0
  166. package/dist/standalone/chunk-AWHXPIXU.js +1 -0
  167. package/dist/standalone/chunk-AWJTTLN3.js +1 -0
  168. package/dist/standalone/chunk-AWWI2VYF.js +1 -0
  169. package/dist/standalone/chunk-B6TFVYOB.js +1 -0
  170. package/dist/standalone/chunk-BDO4YYBB.js +6 -0
  171. package/dist/standalone/chunk-BI7C76FR.js +1 -0
  172. package/dist/standalone/chunk-BOTGXX4H.js +1 -0
  173. package/dist/standalone/chunk-C3CSNZEU.js +8 -0
  174. package/dist/standalone/chunk-CMA4PTV7.js +1 -0
  175. package/dist/standalone/chunk-CSAYVVS7.js +1 -0
  176. package/dist/standalone/chunk-CSUROWL2.js +1 -0
  177. package/dist/standalone/chunk-DX6FAHR2.js +1 -0
  178. package/dist/standalone/chunk-DYG4U5PH.js +1 -0
  179. package/dist/standalone/chunk-E7TOMONS.js +4 -0
  180. package/dist/standalone/chunk-EA2JKR5D.js +1 -0
  181. package/dist/standalone/chunk-EHW7NMV7.js +1 -0
  182. package/dist/standalone/chunk-EVTM6Q43.js +1 -0
  183. package/dist/standalone/chunk-F7I3C4I6.js +1 -0
  184. package/dist/standalone/chunk-F7UC63UN.js +1 -0
  185. package/dist/standalone/chunk-FEWMAPNI.js +1 -0
  186. package/dist/standalone/chunk-FKVZRPV5.js +1 -0
  187. package/dist/standalone/chunk-FODLDLE2.js +19 -0
  188. package/dist/standalone/chunk-FSRSK4LY.js +1 -0
  189. package/dist/standalone/chunk-GGPSI4ZR.js +1 -0
  190. package/dist/standalone/chunk-GMS77BZD.js +1 -0
  191. package/dist/standalone/chunk-GXRFTRVN.js +1 -0
  192. package/dist/standalone/chunk-HE4J46G2.js +1 -0
  193. package/dist/standalone/chunk-HE5HTGOF.js +1 -0
  194. package/dist/standalone/chunk-HEAQVSNS.js +1 -0
  195. package/dist/standalone/chunk-IAA25OZH.js +1 -0
  196. package/dist/standalone/chunk-IHMGCHAA.js +1 -0
  197. package/dist/standalone/chunk-IJZT6UQS.js +1 -0
  198. package/dist/standalone/chunk-IMOHEGMV.js +1 -0
  199. package/dist/standalone/chunk-IS6LVJ6L.js +1 -0
  200. package/dist/standalone/chunk-JNREG6BJ.js +1 -0
  201. package/dist/standalone/chunk-JZBD2LVF.js +1 -0
  202. package/dist/standalone/chunk-K7AJEMKE.js +1 -0
  203. package/dist/standalone/chunk-KC5F2JH4.js +1 -0
  204. package/dist/standalone/chunk-KKJDR66W.js +1 -0
  205. package/dist/standalone/chunk-LBMSRD6N.js +1 -0
  206. package/dist/standalone/chunk-ML7GYWXD.js +11 -0
  207. package/dist/standalone/chunk-MU3P2FI7.js +1 -0
  208. package/dist/standalone/chunk-MXLAOCAN.js +1 -0
  209. package/dist/standalone/chunk-NO22645L.js +1 -0
  210. package/dist/standalone/chunk-OGUKYRFM.js +1 -0
  211. package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
  212. package/dist/standalone/chunk-PD2GWOPN.js +1 -0
  213. package/dist/standalone/chunk-PD6WIDY6.js +1 -0
  214. package/dist/standalone/chunk-PLHA3OWK.js +3 -0
  215. package/dist/standalone/chunk-POP5A2JQ.js +1 -0
  216. package/dist/standalone/chunk-PRYJEMYP.js +8 -0
  217. package/dist/standalone/chunk-PTBWRF5A.js +1 -0
  218. package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
  219. package/dist/standalone/chunk-QDVYJS6Q.js +1 -0
  220. package/dist/standalone/chunk-QH245NVY.js +5 -0
  221. package/dist/standalone/chunk-QKEJLVC5.js +1 -0
  222. package/dist/standalone/chunk-QNIA4ZS7.js +1 -0
  223. package/dist/standalone/chunk-QP2FHSXU.js +3 -0
  224. package/dist/standalone/chunk-QPYWFVDD.js +1 -0
  225. package/dist/standalone/chunk-QVNTRTB2.js +1 -0
  226. package/dist/standalone/chunk-QXOGCZWM.js +1 -0
  227. package/dist/standalone/chunk-RAQNNV2D.js +59 -0
  228. package/dist/standalone/chunk-RFEU2YRN.js +1 -0
  229. package/dist/standalone/chunk-RFNGDE33.js +1 -0
  230. package/dist/standalone/chunk-RLLKECZT.js +1 -0
  231. package/dist/standalone/chunk-RPQL45FL.js +1 -0
  232. package/dist/standalone/chunk-S3CRZLGS.js +1 -0
  233. package/dist/standalone/chunk-SUDJTC4S.js +1 -0
  234. package/dist/standalone/chunk-TIUMFAN2.js +1 -0
  235. package/dist/standalone/chunk-U6XZFNKM.js +1 -0
  236. package/dist/standalone/chunk-UAV4RDNG.js +1 -0
  237. package/dist/standalone/chunk-ULIQFBZU.js +1 -0
  238. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  239. package/dist/standalone/chunk-V3CZW3JB.js +1 -0
  240. package/dist/standalone/chunk-V3VJAA4D.js +1 -0
  241. package/dist/standalone/chunk-V7VNQHEY.js +1 -0
  242. package/dist/standalone/chunk-VMBF4JUM.js +1 -0
  243. package/dist/standalone/chunk-VVZAPXUZ.js +1 -0
  244. package/dist/standalone/chunk-W5DFMJJW.js +1 -0
  245. package/dist/standalone/chunk-W6PEAF4Z.js +4 -0
  246. package/dist/standalone/chunk-WG44WM7I.js +1 -0
  247. package/dist/standalone/chunk-WUWBZPUK.js +1 -0
  248. package/dist/standalone/chunk-XFXYDKOW.js +1 -0
  249. package/dist/standalone/chunk-XMCWOQ4I.js +1 -0
  250. package/dist/standalone/chunk-XZMOZFE6.js +1 -0
  251. package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
  252. package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
  253. package/dist/standalone/chunk-YLEFHYPD.js +1 -0
  254. package/dist/standalone/chunk-YOB2X3FZ.js +1 -0
  255. package/dist/standalone/chunk-YPRQLCKF.js +1 -0
  256. package/dist/standalone/chunk-ZIXQNRYF.js +1 -0
  257. package/dist/standalone/chunk-ZJZ4RRQL.js +1 -0
  258. package/dist/standalone/chunk-ZMKTNBHL.js +1 -0
  259. package/dist/standalone/studio.js +9 -378
  260. package/dist/styles.css +2 -2
  261. package/package.json +23 -20
  262. package/dist/index.js +0 -41
  263. package/dist/mount.js +0 -26
  264. package/dist/packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js +0 -48
  265. package/dist/packem_shared/ApiDocsPanel-BgrN4kml.js +0 -842
  266. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
  267. package/dist/packem_shared/ApiTab-CHkX49o_.js +0 -251
  268. package/dist/packem_shared/AuditPanel-CP9HM9nq.js +0 -200
  269. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
  270. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  271. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  272. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  273. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  274. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  275. package/dist/packem_shared/DataBrowser-Bb1gTQ6c.js +0 -4475
  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-Dj87tRa5.js +0 -197
  279. package/dist/packem_shared/FileBrowser-CWvxp_is.js +0 -2932
  280. package/dist/packem_shared/FunctionRunner-DlWApMCH.js +0 -343
  281. package/dist/packem_shared/FunctionStatsPanel-CuO2Tmw-.js +0 -375
  282. package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
  283. package/dist/packem_shared/HealthPanel-Dj0GRo5P.js +0 -648
  284. package/dist/packem_shared/HomePanel-BewOCuag.js +0 -1334
  285. package/dist/packem_shared/InsightsPanel-y_Q-xdPY.js +0 -461
  286. package/dist/packem_shared/LogsPanel-C7crgYoS.js +0 -827
  287. package/dist/packem_shared/MailPanel-PILidruz.js +0 -440
  288. package/dist/packem_shared/MetricsPanel-DioILzgf.js +0 -1611
  289. package/dist/packem_shared/MigrationsPanel-DkIcRoE5.js +0 -239
  290. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
  291. package/dist/packem_shared/PitrPanel-yKJ1JPPk.js +0 -252
  292. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  293. package/dist/packem_shared/ScheduledJobs-BWNwIN3I.js +0 -262
  294. package/dist/packem_shared/SchemaViewer-CNr8Wame.js +0 -2512
  295. package/dist/packem_shared/SecurityAdvisorPanel-BBzv7L3c.js +0 -92
  296. package/dist/packem_shared/SettingsPanel-BKSKl8tl.js +0 -390
  297. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  298. package/dist/packem_shared/SqlEditorPanel-CkemCQvy.js +0 -13
  299. package/dist/packem_shared/Studio-QkOjc2NS.js +0 -33
  300. package/dist/packem_shared/StudioApp-TEElspKL.js +0 -657
  301. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  302. package/dist/packem_shared/TableEditor-JS3sXYgS.js +0 -11
  303. package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
  304. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  305. package/dist/packem_shared/app.d-Cnij4Zp5.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-2cktDedA.js +0 -8
  311. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  312. package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
  313. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  314. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  315. package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
  316. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  317. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  318. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  319. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  320. package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
  321. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  322. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  323. package/dist/packem_shared/sql-editor-panel-CUJoYF1Z.js +0 -2562
  324. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  325. package/dist/packem_shared/studio-c5Vf7kSh.js +0 -11532
  326. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  327. package/dist/packem_shared/table-editor-9fhJ4hMJ.js +0 -407
  328. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
  329. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  330. package/dist/packem_shared/use-admin-query-BkbdNFNz.js +0 -105
  331. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  332. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  333. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -0,0 +1 @@
1
+ import{b as Nr}from"./chunk-Y6CXU7T4.js";import{a as i,d as k,e as B,g as Z}from"./chunk-YKXDMIHQ.js";var jn=k(B(),1),ie=jn.createContext(null);var Kn=k(B(),1);function D(t){return Kn.useContext(ie)}i(D,"useRouter");var Ue=k(B(),1),xt=Ue.createContext(void 0),qn=Ue.createContext(void 0);function dt(t){return t[t.length-1]}i(dt,"last");function q(t,e){return typeof t=="function"?t(e):t}i(q,"functionalUpdate");var Xn=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable;function ht(t){for(let e in t)if(Xn.call(t,e))return!0;return!1}i(ht,"hasKeys");var Tr=i(()=>Object.create(null),"createNull"),pt=i((t,e)=>rt(t,e,Tr),"nullReplaceEqualDeep");function rt(t,e,n=()=>({}),r=0){if(!1)return e;if(t===e)return t;if(r>500)return e;let o=e,s=Ve(t)&&Ve(o);if(!s&&!(Ht(t)&&Ht(o)))return o;let c=s?t:Gn(t);if(!c)return o;let a=s?o:Gn(o);if(!a)return o;let u=c.length,l=a.length,f=s?new Array(l):n(),d=0;for(let h=0;h<l;h++){let p=s?h:a[h],g=t[p],m=o[p];if(g===m){f[p]=g,(s?h<u:Xn.call(t,p))&&d++;continue}if(g===null||m===null||typeof g!="object"||typeof m!="object"){f[p]=m;continue}let y=rt(g,m,n,r+1);f[p]=y,y===g&&d++}return u===l&&d===u?t:f}i(rt,"replaceEqualDeep");function Gn(t){let e=Object.keys(t);if(e.length!==Object.getOwnPropertyNames(t).length)return!1;let n=Object.getOwnPropertySymbols(t);if(n.length===0)return e;for(let r of n){if(!Or.call(t,r))return!1;e.push(r)}return e}i(Gn,"getEnumerableOwnKeys");function Ht(t){if(!Jn(t))return!1;let e=t.constructor;if(typeof e>"u")return!0;let n=e.prototype;return!(!Jn(n)||!n.hasOwnProperty("isPrototypeOf"))}i(Ht,"isPlainObject");function Jn(t){return Object.prototype.toString.call(t)==="[object Object]"}i(Jn,"hasObjectPrototype");function Ve(t){return Array.isArray(t)&&t.length===Object.keys(t).length}i(Ve,"isPlainArray");function Q(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,o=t.length;r<o;r++)if(!Q(t[r],e[r],n))return!1;return!0}if(Ht(t)&&Ht(e)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let c in e)if((!r||e[c]!==void 0)&&!Q(t[c],e[c],n))return!1;return!0}let o=0;if(!r)o=Object.keys(t).length;else for(let c in t)t[c]!==void 0&&o++;let s=0;for(let c in e)if((!r||e[c]!==void 0)&&(s++,s>o||!Q(t[c],e[c],n)))return!1;return o===s}return!1}i(Q,"deepEqual");var Dr=/[\x00-\x1f\x7f"<>`{}]/g;function Fr(t){return t.replace(Dr,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}i(Fr,"sanitizePathSegment");function Yn(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Fr(e)}i(Yn,"decodeSegment");var We=["http:","https:","mailto:","tel:"];function st(t,e){if(!t)return!1;try{let n=new URL(t);return!e.has(n.protocol)}catch{return!1}}i(st,"isDangerousProtocol");function Dt(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let e=/%25|%5C/gi,n=0,r="",o;for(;(o=e.exec(t))!==null;)r+=Yn(t.slice(n,o.index))+o[0],n=e.lastIndex;r=r+Yn(n?t.slice(n):t);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}i(Dt,"decodePath");function Zn(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}i(Zn,"encodePathLikeUrl");function Qn(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}i(Qn,"arraysEqual");function mt(){throw new Error("Invariant failed")}i(mt,"invariant");function Ft(t){let e=new Map,n,r,o=i(s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)},"touch");return{get(s){let c=e.get(s);if(c)return o(c),c.value},set(s,c){if(e.size>=t&&n){let u=n;e.delete(u.key),u.next&&(n=u.next,u.next.prev=void 0),u===r&&(r=void 0)}let a=e.get(s);if(a)a.value=c,o(a);else{let u={key:s,value:c,prev:r};r&&(r.next=u),r=u,n||(n=u),e.set(s,u)}},clear(){e.clear(),n=void 0,r=void 0}}}i(Ft,"createLRUCache");var gt=4,eo=5;function ze(t,e,n=new Uint16Array(6)){let r=t.indexOf("/",e),o=r===-1?t.length:r,s=t.substring(e,o);if(!s||!s.includes("$"))return n[0]=0,n[1]=e,n[2]=e,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){let u=t.length;return n[0]=2,n[1]=e,n[2]=e,n[3]=u,n[4]=u,n[5]=u,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=e,n[2]=e+1,n[3]=o,n[4]=o,n[5]=o,n;let c=s.indexOf("{"),a;if(c!==-1&&c+1<s.length&&(a=s.indexOf("}",c))!==-1){let u=s.charCodeAt(c+1);if(u===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){let l=c+3,f=a;if(l<f)return n[0]=3,n[1]=e+c,n[2]=e+l,n[3]=e+f,n[4]=e+a+1,n[5]=o,n}}else if(u===36){let l=c+1,f=c+2;return f===a?(n[0]=2,n[1]=e+c,n[2]=e+l,n[3]=e+f,n[4]=e+a+1,n[5]=t.length,n):(n[0]=1,n[1]=e+c,n[2]=e+f,n[3]=e+a,n[4]=e+a+1,n[5]=o,n)}}return n[0]=0,n[1]=e,n[2]=e,n[3]=o,n[4]=o,n[5]=o,n}i(ze,"parseSegment");function le(t,e,n,r,o,s,c,a){a?.(n);let u=r;{let l=n.fullPath??n.from,f=n.options,d=l.length,h=f?.caseSensitive??t,p=f?.params?.parse??f?.parseParams;for(;u<d;){let m=ze(l,u,e),y,R=u,v=m[5];u=v+1,s++;let _=m[0];switch(_){case 0:{let x=l.substring(m[2],m[3]),L=x,b;h?b=o.static??=new Map:(L=x.toLowerCase(),b=o.staticInsensitive??=new Map);let S=b.get(L);if(S)y=S;else{let C=Mt(l);C.parent=o,C.depth=s,y=C,b.set(L,C)}break}case 1:case 3:case 2:{let x=l.substring(R,m[1]),L=l.substring(m[4],v),b=h&&!!(x||L);h||(x=x.toLowerCase(),L=L.toLowerCase());let S=_===1?o.dynamic:_===3?o.optional:o.wildcard,C=_!==2&&!p&&S?.find(w=>!w.parse&&w.caseSensitive===b&&w.prefix===x&&w.suffix===L);if(C)y=C;else{let w=Mr(_,l,b,x,L);y=w,w.parent=o,w.depth=s;let P;_===1?P=o.dynamic??=[]:_===3?P=o.optional??=[]:P=o.wildcard??=[],P.push(w),P.length===2&&c?.push(P)}break}}o=y}if(p&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){let m=Mt(l);m.kind=eo,m.parent=o,s++,m.depth=s,o.pathless??=[],o.pathless.push(m),o=m}let g=(n.path||!n.children)&&!n.isRoot;if(g&&l.endsWith("/")){let m=Mt(l);m.kind=gt,m.parent=o,s++,m.depth=s,o.index=m,o=m}o.parse=p??null,o.priority=f?.params?.priority??0,g&&!o.route&&(o.route=n,o.fullPath=l)}if(n.children)for(let l of n.children)le(t,e,l,u,o,s,c,a)}i(le,"parseSegments");function no(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}i(no,"sortDynamic");function Mt(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}i(Mt,"createStaticNode");function Mr(t,e,n,r,o){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:o}}i(Mr,"createDynamicNode");function oo(t,e){let n=Mt("/"),r=new Uint16Array(6),o=[];for(let s of t)le(!1,r,s,1,n,0,o);for(let s of o)s.sort(no);e.masksTree=n,e.flatCache=Ft(1e3)}i(oo,"processRouteMasks");function ro(t,e){t||="/";let n=e.flatCache.get(t);if(n!==void 0)return n;let r=He(t,e.masksTree);return e.flatCache.set(t,r),r}i(ro,"findFlatMatch");function so(t,e,n,r,o){t||="/",r||="/";let s=e?`case\0${t}`:t,c=o.singleCache.get(s);return c||(c=Mt("/"),le(e,new Uint16Array(6),{from:t},1,c,0),o.singleCache.set(s,c)),He(r,c,n)}i(so,"findSingleMatch");function io(t,e,n=!1){let r=n?t:`nofuzz\0${t}`,o=e.matchCache.get(r);if(o!==void 0)return o;t||="/";let s;try{s=He(t,e.segmentTree,n)}catch(c){if(c instanceof URIError)s=null;else throw c}return s&&(s.branch=je(s.route)),e.matchCache.set(r,s),s}i(io,"findRouteMatch");function Ar(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}i(Ar,"trimPathRight");function ao(t,e=!1,n){let r=Mt(t.fullPath),o=new Uint16Array(6),s=[],c={},a={},u=0;le(e,o,t,1,r,0,s,l=>{if(n?.(l,u),l.id in c&&mt(),c[l.id]=l,u!==0&&l.path){let f=Ar(l.fullPath);(!a[f]||l.fullPath.endsWith("/"))&&(a[f]=l)}u++});for(let l of s)l.sort(no);return{processedTree:{segmentTree:r,singleCache:Ft(1e3),matchCache:Ft(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:a}}i(ao,"processRouteTree");function He(t,e,n=!1){let r=t.split("/"),o=Br(t,r,e,n);if(!o)return null;let[s]=co(t,r,o);return{route:o.node.route,rawParams:s}}i(He,"findMatch");function co(t,e,n){let r=$r(n.node),o=null,s=Object.create(null),c=n.extract?.part??0,a=n.extract?.node??0,u=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;c++,a++,u++,l++){let f=r[a];if(f.kind===gt)break;if(f.kind===eo){l--,c--,u--;continue}let d=e[c],h=u;if(d&&(u+=d.length),f.kind===1){o??=n.node.fullPath.split("/");let p=o[l],g=f.prefix.length;if(p.charCodeAt(g)===123){let m=f.suffix.length,y=p.substring(g+2,p.length-m-1),R=d.substring(g,d.length-m);s[y]=decodeURIComponent(R)}else{let m=p.substring(1);s[m]=decodeURIComponent(d)}}else if(f.kind===3){if(n.skipped&1<<a){c--,u=h-1;continue}o??=n.node.fullPath.split("/");let p=o[l],g=f.prefix.length,m=f.suffix.length,y=p.substring(g+3,p.length-m-1),R=f.suffix||f.prefix?d.substring(g,d.length-m):d;R&&(s[y]=decodeURIComponent(R))}else if(f.kind===2){let p=f,g=t.substring(h+p.prefix.length,t.length-p.suffix.length),m=decodeURIComponent(g);s["*"]=m,s._splat=m;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:c,node:a,path:u,segment:l}]}i(co,"extractParams");function je(t){let e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}i(je,"buildRouteBranch");function $r(t){let e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}i($r,"buildBranch");function Br(t,e,n,r){if(t==="/"&&n.index)return{node:n.index,skipped:0};let o=!dt(e),s=o&&t!=="/",c=e.length-(o?1:0),a=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],u=null,l=null;for(;a.length;){let f=a.pop(),{node:d,index:h,skipped:p,statics:g,dynamics:m,optionals:y}=f,{extract:R,rawParams:v}=f;if(d.kind===2&&d.route&&!ce(l,f))continue;if(d.parse){if(!to(t,e,f))continue;v=f.rawParams,R=f.extract}r&&d.route&&d.kind!==gt&&ce(u,f)&&(u=f);let _=h===c;if(_&&(d.route&&(!s||d.kind===gt||d.kind===2)&&ce(l,f)&&(l=f),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;let x=_?void 0:e[h],L;if(_&&d.index){let b={node:d.index,index:h,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v},S=!0;if(d.index.parse&&(to(t,e,b)||(S=!1)),S){if(!m&&!y&&!p&&Ur(g,c))return b;ce(l,b)&&(l=b)}}if(d.wildcard)for(let b=d.wildcard.length-1;b>=0;b--){let S=d.wildcard[b],{prefix:C,suffix:w}=S;if(!(C&&(_||!(S.caseSensitive?x:L??=x.toLowerCase()).startsWith(C)))){if(w){if(_)continue;let P=e.slice(h).join("/"),E=P.slice(-w.length);if((S.caseSensitive?E:E.toLowerCase())!==w||P.length-w.length<C.length)continue}a.push({node:S,index:c,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}}if(d.optional){let b=p|1<<d.depth+1;for(let S=d.optional.length-1;S>=0;S--){let C=d.optional[S];a.push({node:C,index:h,skipped:b,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}if(!_)for(let S=d.optional.length-1;S>=0;S--){let C=d.optional[S],{prefix:w,suffix:P}=C;if(w||P){let E=C.caseSensitive?x:L??=x.toLowerCase();if(w&&!E.startsWith(w)||P&&E.indexOf(P,E.length-P.length)<w.length)continue}a.push({node:C,index:h+1,skipped:p,statics:g,dynamics:m,optionals:y+ae(c,h),extract:R,rawParams:v})}}if(!_&&d.dynamic&&x)for(let b=d.dynamic.length-1;b>=0;b--){let S=d.dynamic[b],{prefix:C,suffix:w}=S;if(C||w){let P=S.caseSensitive?x:L??=x.toLowerCase();if(C&&!P.startsWith(C)||w&&P.indexOf(w,P.length-w.length)<C.length)continue}a.push({node:S,index:h+1,skipped:p,statics:g,dynamics:m+ae(c,h),optionals:y,extract:R,rawParams:v})}if(!_&&d.staticInsensitive){let b=d.staticInsensitive.get(L??=x.toLowerCase());b&&a.push({node:b,index:h+1,skipped:p,statics:g+ae(c,h),dynamics:m,optionals:y,extract:R,rawParams:v})}if(!_&&d.static){let b=d.static.get(x);b&&a.push({node:b,index:h+1,skipped:p,statics:g+ae(c,h),dynamics:m,optionals:y,extract:R,rawParams:v})}if(d.pathless)for(let b=d.pathless.length-1;b>=0;b--){let S=d.pathless[b];a.push({node:S,index:h,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}}if(l)return l;if(r&&u){let f=u.index;for(let h=0;h<u.index;h++)f+=e[h].length;let d=f===t.length?"/":t.slice(f);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(d),u}return null}i(Br,"getNodeMatch");function ae(t,e){return 2**(t-e-1)}i(ae,"segmentScore");function Ur(t,e){return t===2**(e-1)-1}i(Ur,"isPerfectStaticMatch");function to(t,e,n){let r,o;try{[r,o]=co(t,e,n)}catch{return null}if(n.rawParams=r,n.extract=o,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}i(to,"validateParseParams");function ce(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===gt)>(t.node.kind===gt)||e.node.kind===gt==(t.node.kind===gt)&&e.node.depth>t.node.depth))):!0}i(ce,"isFrameMoreSpecific");function bt(t){return Kt(t.filter(e=>e!==void 0).join("/"))}i(bt,"joinPaths");function Kt(t){return t.replace(/\/{2,}/g,"/")}i(Kt,"cleanPath");function ue(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}i(ue,"trimPathLeft");function G(t){let e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}i(G,"trimPathRight");function qt(t){return G(ue(t))}i(qt,"trimPath");function yt(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}i(yt,"removeTrailingSlash");function fe(t,e,n){return yt(t,n)===yt(e,n)}i(fe,"exactPathTest");function Ke({base:t,to:e,trailingSlash:n="never",cache:r}){if(e.includes("//")&&(e=Kt(e)),e.startsWith("/"))return e.length===1||n==="preserve"?e:n==="always"?e.endsWith("/")?e:`${e}/`:e.endsWith("/")?e.slice(0,-1):e;let o=e===".",s;if(r){s=o?t:t+"\0"+e;let l=r.get(s);if(l)return l}let c;if(o)c=t.split("/");else{for(t.includes("//")&&(t=Kt(t)),c=t.split("/");c.length>1&&dt(c)==="";)c.pop();let l=e.split("/");for(let f=0,d=l.length;f<d;f++){let h=l[f];h===""?f?f===d-1&&c.push(h):c=[h]:h===".."?c.length>1?c.pop():c=[""]:h==="."||c.push(h)}}c.length>1&&(dt(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let a=c.join("/"),u=(o?Kt(a):a)||"/";return s&&r&&r.set(s,u),u}i(Ke,"resolvePath");function uo(t){let e=new Map(t.map(o=>[encodeURIComponent(o),o])),n=Array.from(e.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>e.get(s)??s)}i(uo,"compileDecodeCharMap");function jt(t,e,n){let r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>lo(o,n)).join("/"):lo(r,n)}i(jt,"encodeParam");function de({path:t,params:e,decoder:n,...r}){let o=!1,s=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!t.includes("$"))return{interpolatedPath:t,usedParams:s,isMissingParams:o};if(!1){let f=t.length,d=0,h="";for(;d<f;){for(;d<f&&t.charCodeAt(d)===47;)d++;if(d>=f)break;let p=d,g=t.indexOf("/",d);g===-1&&(g=f),d=g;let m=t.substring(p,g);if(m)if(m.charCodeAt(0)===36)if(m.length===1){let y=e._splat;if(s._splat=y,s["*"]=y,!y){o=!0;continue}let R=jt("_splat",e,n);h+="/"+R}else{let y=m.substring(1);!o&&!(y in e)&&(o=!0),s[y]=e[y];let R=jt(y,e,n)??"undefined";h+="/"+R}else h+="/"+m}return t.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:o}}let c=t.length,a=0,u,l="";for(;a<c;){let f=a;u=ze(t,f,u);let d=u[5];if(a=d+1,f===d)continue;let h=u[0];if(h===0){l+="/"+t.substring(f,d);continue}if(h===2){let p=e._splat;s._splat=p,s["*"]=p;let g=t.substring(f,u[1]),m=t.substring(u[4],d);if(!p){o=!0,(g||m)&&(l+="/"+g+m);continue}let y=jt("_splat",e,n);l+="/"+g+y+m;continue}if(h===1){let p=t.substring(u[2],u[3]);!o&&!(p in e)&&(o=!0),s[p]=e[p];let g=t.substring(f,u[1]),m=t.substring(u[4],d),y=jt(p,e,n)??"undefined";l+="/"+g+y+m;continue}if(h===3){let p=t.substring(u[2],u[3]),g=e[p];if(g==null)continue;s[p]=g;let m=t.substring(f,u[1]),y=t.substring(u[4],d),R=jt(p,e,n)??"";l+="/"+m+R+y;continue}}return t.endsWith("/")&&(l+="/"),{usedParams:s,interpolatedPath:l||"/",isMissingParams:o}}i(de,"interpolatePath");function lo(t,e){let n=encodeURIComponent(t);return e?.(n)??n}i(lo,"encodePathParam");function J(t){return t?.isNotFound===!0}i(J,"isNotFound");function Vr(){try{return sessionStorage}catch{return}}i(Vr,"getSafeSessionStorage");var Wr="tsr-scroll-restoration-v1_3",po=Vr();function zr(){try{return JSON.parse(po?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}i(zr,"createScrollRestorationCache");function Hr(){try{po?.setItem(Wr,JSON.stringify(At))}catch{}}i(Hr,"persistScrollRestorationCache");var At=zr(),fo="data-scroll-restoration-id",jr=i(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function Kr(t){let e=t.getAttribute(fo);if(e)return`[${fo}="${e}"]`;let n="",r=t,o;for(;o=r.parentNode;){let s=1,c=r;for(;c=c.previousElementSibling;)s++;let a=`${r.localName}:nth-child(${s})`;n=n?`${a} > ${n}`:a,r=o}return n}i(Kr,"getScrollRestorationSelector");var he=!1,pe="window";function qe(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}i(qe,"getElement");function ho(t){let e=new Set;for(let n of t){if(n===pe)continue;let r=qe(n);r&&e.add(r)}return e}i(ho,"getScrollToTopElements");function mo(t,e){let n=e??t.options.scrollRestoration,r=t._scroll;if(n&&(r.restoring=!0),!1)return;let o=t.options.getScrollRestorationKey||jr,s=new Set,c=i(a=>{let u=At[a]||={};for(let l of s)l===document?u[pe]={scrollX,scrollY}:l.isConnected&&(u[Kr(l)]={scrollX:l.scrollLeft,scrollY:l.scrollTop})},"snapshotCurrentScrollTargets");n&&!r.restoration&&(r.restoration=!0,he=!1,history.scrollRestoration="manual",document.addEventListener("scroll",a=>{he||s.add(a.target)},!0),t.subscribe("onBeforeLoad",a=>{a.fromLocation&&c(o(a.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{c(o(t.stores.resolvedLocation.get()??t.stores.location.get())),Hr()})),!r.reset&&(r.reset=!0,t.subscribe("onRendered",a=>{let u=t.options.scrollRestorationBehavior,l=t.options.scrollToTopSelectors,f=r.next,d=r.hash,h;if(s.clear(),r.next=!0,r.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let p=o(a.toLocation),g=a.fromLocation&&o(a.fromLocation);if(r.restoring&&g&&g!==p){let m=At[g];if(m){let y=At[p];for(let R in m){if(R===pe){if(f)continue}else{let v=qe(R);if(!v||f&&l&&(h??=ho(l),h.has(v)))continue}y||(y=At[p]={}),y[R]??=m[R]}}}he=!0;try{let m=a.toLocation.hash,y=a.toLocation.state.__hashScrollIntoViewOptions??!0,R=!1;if(f){!m&&l&&(h??=ho(l));let v=m&&y&&d,_=r.restoring?At[p]:void 0;if(_)for(let x in _){let{scrollX:L,scrollY:b}=_[x];if(x===pe){if(v)continue;scrollTo({top:b,left:L,behavior:u}),R=!0}else{let S=qe(x);S&&(S.scrollLeft=L,S.scrollTop=b,h?.delete(S))}}if(!m){let x={top:0,left:0,behavior:u};if(R||scrollTo(x),h)for(let L of h)L.scrollTo(x)}}!R&&m&&y&&document.getElementById(m)?.scrollIntoView(y)}finally{he=!1}}))}i(mo,"setupScrollRestoration");function go(t,e=String){let n=new URLSearchParams;for(let r in t){let o=t[r];o!==void 0&&n.set(r,e(o))}return n.toString()}i(go,"encode");function Ge(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}i(Ge,"toValue");function yo(t){let e=new URLSearchParams(t),n=Object.create(null);for(let[r,o]of e.entries()){let s=n[r];s==null?n[r]=Ge(o):Array.isArray(s)?s.push(Ge(o)):n[r]=[s,Ge(o)]}return n}i(yo,"decode");var qr=/^(?:\s|["[{\d-]|fa|nu|tr)/,vo=Gr(JSON.parse),Ro=Jr(JSON.stringify,JSON.parse);function Gr(t){return e=>{e[0]==="?"&&(e=e.substring(1));let n=yo(e);for(let r in n){let o=n[r];if(typeof o=="string")try{n[r]=t(o)}catch{}}return n}}i(Gr,"parseSearchWith");function Jr(t,e){let n=e===JSON.parse;function r(o){if(o&&typeof o=="object")try{return t(o)}catch{}else if(e&&typeof o=="string"){if(n&&!qr.test(o))return o;try{return e(o),t(o)}catch{}}return o}return i(r,"stringifyValue"),o=>{let s=go(o,r);return s?`?${s}`:""}}i(Jr,"stringifySearchWith");var tt="__root__";function So(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);let n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}i(So,"redirect");function me(t){return t instanceof Response&&!!t.options}i(me,"isRedirect");function _o(t){return{input:i(({url:e})=>{for(let n of t)e=ge(n,e);return e},"input"),output:i(({url:e})=>{for(let n=t.length-1;n>=0;n--)e=Je(t[n],e);return e},"output")}}i(_o,"composeRewrites");function wo(t){let e=qt(t.basepath),n=`/${e}`,r=t.caseSensitive?n:n.toLowerCase(),o=`${r}/`;return{input:i(({url:s})=>{let c=t.caseSensitive?s.pathname:s.pathname.toLowerCase();return c===r?s.pathname="/":c.startsWith(o)&&(s.pathname=s.pathname.slice(n.length)),s},"input"),output:i(({url:s})=>(s.pathname=bt(["/",e,s.pathname]),s),"output")}}i(wo,"rewriteBasepath");function ge(t,e){let n=t?.input?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}i(ge,"executeRewriteInput");function Je(t,e){let n=t?.output?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}i(Je,"executeRewriteOutput");function Ye(t){let e=t;return{get(){return e},set(n){e=q(n,e)}}}i(Ye,"createNonReactiveMutableStore");function Xe(t){return{get(){return t()}}}i(Xe,"createNonReactiveReadonlyStore");function xo(t,e){let{createMutableStore:n,createReadonlyStore:r,batch:o}=e,s=new Map,c=n("idle"),a=n(t),u=n(void 0),l=n([]),f=r(()=>l.get().map(m=>s.get(m).get())),d=r(()=>({status:c.get(),isLoading:c.get()==="pending",matches:f.get(),location:a.get(),resolvedLocation:u.get()}));function h(m){let y=s.get(m);return y||(y=n(void 0),s.set(m,y)),y}i(h,"getMatchStore");let p={status:c,location:a,resolvedLocation:u,ids:l,matches:f,byRoute:s,__store:d,getMatchStore:h,setMatches:g};function g(m){let y=l.get(),R=m.map(v=>v.routeId);o(()=>{Qn(y,R)||l.set(R);for(let v of y)R.includes(v)||s.get(v).set(()=>{});for(let v of m){let _=h(v.routeId);_.get()!==v&&_.set(v)}})}return i(g,"setMatches"),p}i(xo,"createRouterStores");var vt="__TSR_index",bo="popstate",Co="beforeunload";function Qe(t){let e=t.getLocation(),n=new Set,r=i(c=>{e=t.getLocation(),n.forEach(a=>a({location:e,action:c}))},"notify"),o=i(c=>{t.notifyOnIndexChange??!0?r(c):e=t.getLocation()},"handleIndexChange"),s=i(async({task:c,navigateOpts:a,...u})=>{if(a?.ignoreBlocker??!1){c();return}let l=t.getBlockers?.()??[],f=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&l.length&&f)for(let d of l){let h=$t(u.path,u.state);if(await d.blockerFn({currentLocation:e,nextLocation:h,action:u.type})){t.onBlocked?.();return}}c()},"tryNavigation");return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:i(c=>(n.add(c),()=>{n.delete(c)}),"subscribe"),push:i((c,a,u)=>{let l=e.state[vt];a=Ze(l+1,a),s({task:i(()=>{t.pushState(c,a),r({type:"PUSH"})},"task"),navigateOpts:u,type:"PUSH",path:c,state:a})},"push"),replace:i((c,a,u)=>{let l=e.state[vt];a=Ze(l,a),s({task:i(()=>{t.replaceState(c,a),r({type:"REPLACE"})},"task"),navigateOpts:u,type:"REPLACE",path:c,state:a})},"replace"),go:i((c,a)=>{s({task:i(()=>{t.go(c),o({type:"GO",index:c})},"task"),navigateOpts:a,type:"GO"})},"go"),back:i(c=>{s({task:i(()=>{t.back(c?.ignoreBlocker??!1),o({type:"BACK"})},"task"),navigateOpts:c,type:"BACK"})},"back"),forward:i(c=>{s({task:i(()=>{t.forward(c?.ignoreBlocker??!1),o({type:"FORWARD"})},"task"),navigateOpts:c,type:"FORWARD"})},"forward"),canGoBack:i(()=>e.state[vt]!==0,"canGoBack"),createHref:i(c=>t.createHref(c),"createHref"),block:i(c=>{if(!t.setBlockers)return()=>{};let a=t.getBlockers?.()??[];return t.setBlockers([...a,c]),()=>{let u=t.getBlockers?.()??[];t.setBlockers?.(u.filter(l=>l!==c))}},"block"),flush:i(()=>t.flush?.(),"flush"),destroy:i(()=>t.destroy?.(),"destroy"),notify:r}}i(Qe,"createHistory");function Ze(t,e){e||(e={});let n=en();return{...e,key:n,__TSR_key:n,[vt]:t}}i(Ze,"assignKeyAndIndex");function tn(t){let e=t?.window??(typeof document<"u"?window:void 0),n=e.history.pushState,r=e.history.replaceState,o=[],s=i(()=>o,"_getBlockers"),c=i(S=>o=S,"_setBlockers"),a=t?.createHref??(S=>S),u=t?.parseLocation??(()=>$t(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){let S=en();e.history.replaceState({[vt]:0,key:S,__TSR_key:S},"")}let l=u(),f,d=!1,h=!1,p=!1,g=!1,m=i(()=>l,"getLocation"),y,R=i(()=>{y&&(b._ignoreSubscribers=!0,(y[2]?e.history.pushState:e.history.replaceState)(y[1],"",y[0]),b._ignoreSubscribers=!1,y=void 0,f=void 0)},"flush"),v=i((S,C,w)=>{let P=a(C),E=!!y;E||(f=l),l=$t(C,w),y=[P,w,y?.[2]||S],E||queueMicrotask(()=>R())},"queueHistoryAction"),_=i(S=>{l=u(),b.notify({type:S})},"onPushPop"),x=i(async()=>{if(h){h=!1;return}let S=u(),C=S.state[vt]-l.state[vt],w=C===1,P=C===-1,E=!w&&!P||d;d=!1;let I=E?"GO":P?"BACK":"FORWARD",N=E?{type:"GO",index:C}:{type:P?"BACK":"FORWARD"};if(p)p=!1;else{let _t=s();if(typeof document<"u"&&_t.length){for(let nt of _t)if(await nt.blockerFn({currentLocation:l,nextLocation:S,action:I})){h=!0,e.history.go(1),b.notify(N);return}}}l=u(),b.notify(N)},"onPushPopEvent"),L=i(S=>{if(g){g=!1;return}let C=!1,w=s();if(typeof document<"u"&&w.length)for(let P of w){let E=P.enableBeforeUnload??!0;if(E===!0){C=!0;break}if(typeof E=="function"&&E()===!0){C=!0;break}}if(C)return S.preventDefault(),S.returnValue=""},"onBeforeUnload"),b=Qe({getLocation:m,getLength:i(()=>e.history.length,"getLength"),pushState:i((S,C)=>v(!0,S,C),"pushState"),replaceState:i((S,C)=>v(!1,S,C),"replaceState"),back:i(S=>(S&&(p=!0),g=!0,e.history.back()),"back"),forward:i(S=>{S&&(p=!0),g=!0,e.history.forward()},"forward"),go:i(S=>{d=!0,e.history.go(S)},"go"),createHref:i(S=>a(S),"createHref"),flush:R,destroy:i(()=>{e.history.pushState=n,e.history.replaceState=r,e.removeEventListener(Co,L,{capture:!0}),e.removeEventListener(bo,x)},"destroy"),onBlocked:i(()=>{f&&l!==f&&(l=f)},"onBlocked"),getBlockers:s,setBlockers:c,notifyOnIndexChange:!1});return e.addEventListener(Co,L,{capture:!0}),e.addEventListener(bo,x),e.history.pushState=function(...S){let C=n.apply(e.history,S);return b._ignoreSubscribers||_("PUSH"),C},e.history.replaceState=function(...S){let C=r.apply(e.history,S);return b._ignoreSubscribers||_("REPLACE"),C},b}i(tn,"createBrowserHistory");function Yr(t={initialEntries:["/"]}){let e=t.initialEntries,n=t.initialIndex?Math.min(Math.max(t.initialIndex,0),e.length-1):e.length-1,r=e.map((u,l)=>Ze(l,void 0)),o=i(()=>$t(e[n],r[n]),"getLocation"),s=[];return Qe({getLocation:o,getLength:i(()=>e.length,"getLength"),pushState:i((u,l)=>{n<e.length-1&&(e.splice(n+1),r.splice(n+1)),r.push(l),e.push(u),n=Math.max(e.length-1,0)},"pushState"),replaceState:i((u,l)=>{r[n]=l,e[n]=u},"replaceState"),back:i(()=>{n=Math.max(n-1,0)},"back"),forward:i(()=>{n=Math.min(n+1,e.length-1)},"forward"),go:i(u=>{n=Math.min(Math.max(n+u,0),e.length-1)},"go"),createHref:i(u=>u,"createHref"),getBlockers:i(()=>s,"_getBlockers"),setBlockers:i(u=>s=u,"_setBlockers")})}i(Yr,"createMemoryHistory");function Xr(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}i(Xr,"sanitizePath");function $t(t,e){let n=Xr(t),r=n.indexOf("#"),o=n.indexOf("?"),s=en();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:e||{[vt]:0,key:s,__TSR_key:s}}}i($t,"parseHref");function en(){return(Math.random()+1).toString(36).substring(7)}i(en,"createRandomKey");function Po(t){return t.options.loader||t.options.beforeLoad||t.lazyFn||t.options.component?.preload||t.options.pendingComponent?.preload}i(Po,"routeNeedsLoad");function Ct(t,e){return{fromLocation:e,toLocation:t,pathChanged:e?.pathname!==t.pathname,hrefChanged:e?.href!==t.href,hashChanged:e?.hash!==t.hash}}i(Ct,"getLocationChangeInfo");function Lo({key:t,__TSR_key:e,__TSR_index:n,__hashScrollIntoViewOptions:r,...o}){return o}i(Lo,"_getUserHistoryState");function Io(t,e,n,r){for(let o of e){if(r&&t._tx!==r)return;n.some(s=>s.routeId===o.routeId)||t.routesById[o.routeId].options.onLeave?.(o)}for(let o of n){if(r&&t._tx!==r)return;t.routesById[o.routeId].options[e.some(s=>s.routeId===o.routeId)?"onStay":"onEnter"]?.(o)}}i(Io,"runRouteLifecycle");var nn=class{static{i(this,"RouterCore")}constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async n=>(n(),!1),this.update=n=>{let r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,c=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??!1??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=uo(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tn()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let l;if(!1){let f=globalThis.__TSR_CACHE__;this.resolvePathCache=f.resolvePathCache,l=f.processRouteTreeResult}else this.resolvePathCache=Ft(1e3),l=this.buildRouteTree(),!1;this.setRoutes(l)}if(!this.stores&&this.latestLocation){let l=this.getStoreConfig(this);this.batch=l.batch,this.stores=xo(this.latestLocation,l),mo(this)}let a=this.options.basepath??"/",u=this.options.rewrite;if(s||o!==a||c!==u){this.basepath=a;let l=[],f=qt(a);f&&f!=="/"&&l.push(wo({basepath:a})),u&&l.push(u),this.rewrite=l.length===0?void 0:l.length===1?l[0]:_o(l),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let n=ao(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&oo(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{let o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{for(let r of this.subscribers)if(r.eventType===n.type)try{r.fn(n)}catch(o){console.error(o)}},this.parseLocation=(n,r)=>{let o=i(({pathname:u,search:l,hash:f,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){let R=this.options.parseSearch(l),v=this.options.stringifySearch(R);return{href:u+v+f,publicHref:u+v+f,pathname:Dt(u).path,external:!1,searchStr:v,search:pt(r?.search,R),hash:Dt(f.slice(1)).path,state:rt(r?.state,h)}}let p=new URL(d,this.origin),g=ge(this.rewrite,p),m=this.options.parseSearch(g.search),y=this.options.stringifySearch(m);return g.search=y,{href:g.href.replace(g.origin,""),publicHref:d,pathname:Dt(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:y,search:pt(r?.search,m),hash:Dt(g.hash.slice(1)).path,state:rt(r?.state,h)}},"parse"),s=o(n),{__tempLocation:c,__tempKey:a}=s.state;if(c&&(!a||a===this.tempLocationKey)){let u=o(c);return u.state.key=s.state.key,u.state.__TSR_key=s.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>Ke({base:n,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>{let r=Object.create(null),o=io(G(n),this.processedTree,!0);return o&&Object.assign(r,o.rawParams),[o?.branch||[this.routesById.__root__],r,o?.route]},this.buildLocation=n=>{let r=i((s={})=>{if(s.href){let w=$t(s.href,{});s={...s,to:ge(this.rewrite,new URL(w.pathname,this.origin)).pathname,search:this.options.parseSearch(w.search),hash:w.hash.slice(1)}}let c=s._fromLocation||this._pendingLocation||this.latestLocation,a=this.matchRoutesLightweight(c);s.from;let u=s.unsafeRelative==="path"?c.pathname:s.from??a[1],l=a[2],f=a[3],d=this.resolvePathWithBase(u,s.to?`${s.to}`:"."),h=Eo(s.params,f),p=this.routesByPath[G(d)],g;if(p)g=this.getRouteBranch(p);else if(d.includes("$"))g=[];else{let[w,P,E]=this.getMatchedRoutes(d);g=w,this.options.notFoundRoute&&(!E||E.path!=="/"&&P["**"])&&(g=[...g,this.options.notFoundRoute])}if(g.length&&ht(h))for(let w of g){let P=w.options.params?.stringify??w.options.stringifyParams;if(P){h===f&&(h=Object.assign(Object.create(null),h));try{Object.assign(h,P(h))}catch{}}}let m=n.leaveParams?d:Dt(de({path:d,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=l;if(n._includeValidateSearch&&this.options.search?.strict){let w={};g.forEach(P=>{if(P.options.validateSearch)try{Object.assign(w,ye(P.options.validateSearch,{...w,...y}))}catch{}}),y=w}y=Zr(y,s,g,n._includeValidateSearch),y=pt(l,y);let R=this.options.stringifySearch(y),v=s.hash===!0?c.hash:s.hash?q(s.hash,c.hash):void 0,_=v?`#${v}`:"",x=s.state===!0?c.state:s.state?q(s.state,c.state):{};s.state&&(x=rt(c.state,x));let L=`${m}${R}${_}`,b,S,C=!1;if(this.rewrite){let w=new URL(L,this.origin),P=Je(this.rewrite,w);b=w.href.replace(w.origin,""),P.origin!==this.origin?(S=P.href,C=!0):S=P.pathname+P.search+P.hash}else b=Zn(L),S=b;return{publicHref:S,href:b,pathname:m,search:y,searchStr:R,state:x,hash:v??"",external:C,unmaskOnReload:s.unmaskOnReload}},"build"),o=r(n);if(n.mask)o.maskedLocation=r({from:n.from,...n.mask});else if(this.options.routeMasks){let s=ro(o.pathname,this.processedTree);if(s){let c=Object.assign(Object.create(null),s.rawParams),{from:a,params:u,...l}=s.route,f=Eo(u,c);o.maskedLocation=r({from:n.from,...l,params:f})}}return o},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{let s,c=G(this.latestLocation.href)===G(o.href)&&Q(Lo(o.state),Lo(this.latestLocation.state)),a=this._commitPromise,u,l=new Promise(f=>{u=f});if(l.resolve=()=>{u(),a?.resolve()},this._commitPromise=l,c)this.load();else{let{maskedLocation:f,hashScrollIntoView:d,...h}=o;f&&(h={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,s=o.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:s}})}return this._scroll.next=o.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:c,...a}={})=>{let u=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=u;let l=this.commitLocation({...u,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:c});return queueMicrotask(()=>{this._pendingLocation===u&&(this._pendingLocation=void 0)}),l},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...c})=>{let a=!1;if(o)try{new URL(`${o}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!o){let l=this.buildLocation({to:n,...c});o=o??l.publicHref,s=s??l.publicHref}let u=!a&&s?s:o;if(st(u,this.protocolAllowlist))return;if(!c.ignoreBlocker){let l=this.history.getBlockers?.()??[];for(let f of l)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}c.replace?window.location.replace(u):window.location.href=u;return}return this.buildAndCommitLocation({...c,href:o,to:n,_isNavigate:!0})},this.load=async n=>{if(!1)return(void 0)(this,n);this.updateLatestLocation(),n?.action&&(this._scroll.hash=n.action.type==="PUSH"||n.action.type==="REPLACE"),await Oo(this,n)},this.startViewTransition=n=>{let r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&!!1&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&window.CSS?.supports?.("selector(:active-view-transition-type(a))")){let s=this.latestLocation,c=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(Ct(s,c)):r.types;if(a===!1)return n();o={update:n,types:a}}else o=n;return document.startViewTransition(o).updateCallbackDone}return n()},this.invalidate=n=>{let r=this._committed,o=n?.filter,s=this._preloads,c=new Set([...r,...this._cache.values(),...[...s?.values()??[]].flat(),...this._tx?.[3]??[]].filter(l=>!o||o(l)).map(l=>l.id)),a=[];for(let[l,f]of s??[])f.some(d=>c.has(d.id))&&(s.delete(l),a.push(l));let u=i(l=>{if(c.has(l.id)){let f=this.routesById[l.routeId],d={...l,invalid:!0,...(n?.forcePending||l.status==="error"||l.status==="notFound")&&Po(f)?{status:"pending",error:void 0}:void 0};return l._flight=void 0,d}return l},"invalidate");this._committed=r.map(u);for(let[l,f]of this._cache)c.has(l)&&(f.invalid=!0,n?.forcePending&&(f.status="pending"));for(let l of c)this._flights?.delete(l);for(let l of a)l.abort();return this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{let r=n.headers.get("Location");if(n.options.href){if(r)try{let o=new URL(r);if(this.origin&&o.origin===this.origin){let s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}}else{let o=this.buildLocation(n.options).publicHref||"/";n.options.href=o,n.headers.set("Location",o)}if(n.options.href&&st(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{let r=this._cache,o=this._preloads,s=n?.filter,c=[],a=[];for(let[l,f]of r)(!s||s(f))&&(a.push(l),c.push(f));let u=[];for(let[l,f]of o??[])(!s||f.some(s))&&(u.push(l),c.push(...f));for(let l of a)r.delete(l);for(let l of u)o.delete(l);for(let l of c){let f=l._flight;l._flight=void 0,f&&!--f[2]&&(this._flights?.get(l.id)===f&&this._flights.delete(l.id),u.push(f[1]))}for(let l of u)l.abort()},this.loadRouteChunk=Pt,this.preloadRoute=n=>To(this,n),this.matchRoute=(n,r)=>{let o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o),c=this.stores.status.get()==="pending";if(r?.pending&&!c)return!1;let a=r?.pending??!c?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=so(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!u||n.params&&!Q(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Q(a.search,s.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Ro,parseSearch:t.parseSearch??vo,protocolAllowlist:t.protocolAllowlist??We}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:n}){this.routesById=t,this.routesByPath=e,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=je(t),this.routeBranchCache.set(t,e)),e}matchRoutesInternal(t,e){let[n,r,o]=this.getMatchedRoutes(t.pathname),s=n,c=!1;(o?o.path!=="/"&&r["**"]:G(t.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:c=!0);let a=c?Qr(this.options.notFoundMode,s):void 0,u=new Array(s.length),l=this._committed,f=i((h,p)=>{let g=l[p];return g?.routeId===h.id?g:h===this.options.notFoundRoute?l.find(m=>m.routeId===h.id):void 0},"previousAt"),d;for(let h=0;h<s.length;h++){let p=s[h],g=u[h-1],m,y,R;{let N=g?.search??t.search,_t=g?._strictSearch??void 0;try{let nt=ye(p.options.validateSearch,{...N})??void 0;m={...N,...nt},y={..._t,...nt}}catch(nt){let oe=nt;if(nt instanceof Gt||(oe=new Gt(nt.message,{cause:nt})),e?.throwOnError)throw oe;m=N,y={},R=oe}}let v="",_="";try{v=p.options.loaderDeps?.({search:m})??"",_=v&&JSON.stringify(v)||""}catch(N){if(e?.throwOnError)throw N;R??=N}let{interpolatedPath:x,usedParams:L}=de({path:p.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),b=p.id+x+_,S=f(p,h),C=this._cache.get(b)??(S?.id===b?S:void 0);d=C?._strictParams??Object.assign(L,d);let w;if(!C)try{ko(p,d)}catch(N){if(J(N)||me(N)?w=N:w=new No(N.message,{cause:N}),e?.throwOnError)throw w}let P=S?"stay":"enter",E;if(C)E={...C,cause:P,search:S?pt(S.search,m):pt(C.search,m),_strictSearch:y,searchError:R};else{let N=Po(p)?"pending":"success";E={id:b,ssr:p.options.ssr,index:h,routeId:p.id,params:S?.params??d,_strictParams:d,pathname:x,updatedAt:Date.now(),search:S?pt(S.search,m):m,_strictSearch:y,searchError:R,status:N,isFetching:!1,error:void 0,paramsError:w,context:{},abortController:e?._controller??new AbortController,cause:P,loaderDeps:S?rt(S.loaderDeps,v):v,invalid:!1,preload:!1,staticData:p.options.staticData||{},fullPath:p.fullPath}}let I=a===p.id;E._notFound&&!I&&(E.error=void 0),E._notFound=I,u[h]=E}for(let h=0;h<u.length;h++){let p=u[h];p.params=p.cause==="stay"?pt(p.params,d):d,e?._controller&&(p.context={})}return u}matchRoutesLightweight(t){let e=dt(this.stores.ids.get()),n=e?this.stores.byRoute.get(e).get():void 0,r=n?.id,o=this.lightweightCache.get(t);if(o&&o[0]===r)return o[1];let[s,c]=this.getMatchedRoutes(t.pathname),a=dt(s),u={...t.search};for(let h of s)try{Object.assign(u,ye(h.options.validateSearch,u))}catch{}let l=n&&n.routeId===a.id&&n.pathname===t.pathname,f;if(l)f=n.params;else{let h=Object.assign(Object.create(null),c);for(let p of s)try{ko(p,h)}catch{}f=h}let d=[s,a.fullPath,u,f];return this.lightweightCache.set(t,[r,d]),d}},Gt=class extends Error{static{i(this,"SearchParamError")}},No=class extends Error{static{i(this,"PathParamError")}};function ye(t,e){if(t==null)return{};if("~standard"in t){let n=t["~standard"].validate(e);if(n instanceof Promise)throw new Gt("Async validation not supported");if(n.issues)throw new Gt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}i(ye,"validateSearch");function Zr(t,e,n,r){let o=[];for(let c of n){let a=c.options;if("search"in a)a.search?.middlewares&&o.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){let l=i(({search:f,next:d})=>{let h=d(a.preSearchFilters?a.preSearchFilters.reduce((p,g)=>g(p),f):f);return a.postSearchFilters?a.postSearchFilters.reduce((p,g)=>g(p),h):h},"legacyMiddleware");o.push(l)}let u=a.validateSearch;if(r&&u){let l=i(({search:f,next:d,meta:h})=>{let p=d(f);try{let g=ye(u,p);if(h&&g)for(let m in g)m in p||(h.defaulted||=new Map).set(m,g[m]);return{...p,...g}}catch{}return p},"validate");o.push(l)}}let s=i((c,a,u)=>{if(c>=o.length){if(!e.search)return{};if(e.search===!0)return a;let f=q(e.search,a);return u&&(u.explicit=f),f}let l=i((f,d)=>{if(d){let h=u||{};return{search:s(c+1,f,h),meta:h}}return s(c+1,f,u)},"next");return o[c]({search:a,next:l,meta:u})},"applyNext");return s(0,t)}i(Zr,"applySearchMiddleware");function Qr(t,e){if(t!=="root"){let n;for(let r=e.length-1;r>=0;r--){let o=e[r];if(o.options.notFoundComponent)return o.id;n||=o.children&&o.id}if(n)return n}return tt}i(Qr,"findGlobalNotFoundRouteId");function Eo(t,e){if(t===!1||t===null)return Object.create(null);if((t??!0)===!0)return e;let n=Object.assign(Object.create(null),e);return Object.assign(n,q(t,n))}i(Eo,"resolveNextParams");function ko(t,e){let n=t.options.params?.parse??t.options.parseParams;n&&Object.assign(e,n(e))}i(ko,"extractStrictParams");function on(t,e){return t.options[e]?.preload?.()}i(on,"preloadComponent");function ts(t,e){let n=on(t,"component"),r=on(t,"pendingComponent");return e&&(r?r=r.then(e):e()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}i(ts,"loadComponents");function Pt(t,e,n){let r=i(()=>e===!1?void 0:e?on(t,e):ts(t,n),"afterLazy"),o=t._lazy;if(o)return o===!0?r():o.then(r);if(!t.lazyFn)return r();let s=t.lazyFn().then(c=>{{let{id:a,...u}=c.options;Object.assign(t.options,u),t._lazy=!0}},c=>{throw t._lazy=void 0,c});return t._lazy=s,s.then(r)}i(Pt,"loadRouteChunk");function an(t){let e=t.findIndex(n=>n.status!=="success"||n._notFound)+1;return e&&e<t.length?t.slice(0,e):t}i(an,"_getRenderedMatches");var it=0,ft=1,Re=2,Y=3,Rt=[4];function Xt(t){return typeof t[0]=="number"}i(Xt,"isControl");function Et(t,e){return e.aborted?Promise.race([Promise.reject(e),t]):new Promise((n,r)=>{let o=i(()=>r(e),"abort");e.addEventListener("abort",o,{once:!0}),Promise.resolve(t).then(n,r).finally(()=>e.removeEventListener("abort",o))})}i(Et,"waitFor");function kt(t,e){return t.routesById[e.routeId]}i(kt,"getRoute");function Zt(t,e,n){return me(t)?[Y,t]:J(t)?(t.routeId||=n,[Re,t]):e?(typeof t?.then=="function"&&(t=new Error("A Promise was thrown",{cause:t})),[ft,t]):[it,t]}i(Zt,"normalize");function cn(t,e){let n=Zt(e,!0,t.id);if(n[0]!==ft)return n;try{t.options.onError?.(n[1])}catch(r){n=Zt(r,!0,t.id)}return n}i(cn,"normalizeError");function Yt(t,e,n,r,o){return o[0].signal.aborted?Rt:fn(t,e,n,cn(n,r),o)}i(Yt,"normalizeLaneError");async function es(t,e,n,r,o,s){let[c,a]=e,u=n[0].signal,l=!!n[3];for(let f=n[6]??0;f<r;f++){let d=a[f],h=kt(t,d);d.abortController=n[0];let p=a[f-1]?.context??t.options.context??{},g={params:d.params,location:c,navigate:i(v=>t.navigate({...v,_fromLocation:c}),"navigate"),buildLocation:t.buildLocation,cause:l?"preload":d.cause,abortController:n[0],preload:l,matches:a,routeId:h.id};try{let v=d._ctx||=h.options.context?h.options.context({...g,deps:d.loaderDeps,context:p})||{}:void 0;d.context={...p,...v}}catch(v){return ut(t,d),[f,Yt(t,e,h,v,n)]}if(u.aborted)return[f,Rt];let m=d.paramsError??d.searchError;if(m!==void 0)return ut(t,d),[f,Yt(t,e,h,m,n)];let y=h.options.beforeLoad;if(!y)continue;let R=d.status;f>=s&&(d.status="pending",n[7]?.());try{Qt(t,d,"beforeLoad",n[0]);let v=await Et(y({...g,search:d.search,context:d.context,...t.options.additionalContext}),u);if(u.aborted)return[f,Rt];let _=fn(t,e,h,Zt(v,!1,h.id),n);if(_[0]!==it)return ut(t,d),[f,_];d.context={...d.context,...v}}catch(v){return ut(t,d),[f,Yt(t,e,h,v,n)]}finally{d.status=R,Qt(t,d,!1,n[0])}}o()}i(es,"contextualize");function ln(t,e,n){if(!(!n||--n[2])){if(t._flights?.get(e.id)===n){let r=t._tx;if(r&&!r[0].signal.aborted&&!r[3].includes(e)&&r[3].some(o=>o.id===e.id)&&r[3].some(o=>o.isFetching==="beforeLoad"))return;t._flights.delete(e.id)}return n[1]}}i(ln,"releaseOwnedFlight");function ut(t,e){let n=e._flight;e._flight=void 0,ln(t,e,n)?.abort()}i(ut,"releaseFlight");function j(t,e,n,r){let o=[];for(let s of e)if(!n?.includes(s)){let c=s._flight;if(s._flight=void 0,r&&c?.[2]===1&&t._flights?.get(s.id)===c&&n?.some(a=>a.id===s.id))c[2]=0;else{let a=ln(t,s,c);a&&o.push(a)}}for(let s of o)s.abort()}i(j,"transferMatchResources");function un(t){for(let e of t){let n=e._flight;n&&n[2]++}}i(un,"acquireMatchResources");function Qt(t,e,n,r){if(e.isFetching=n,r&&t._tx?.[0]!==r)return;let o=t.stores.byRoute.get(e.routeId),s=o?.get();s?.id===e.id&&o.set({...s,isFetching:n})}i(Qt,"setFetching");function Bo(t,e,n,r,o,s,c){let a=e[0];return{params:n.params,location:a,navigate:i(u=>t.navigate({...u,_fromLocation:a}),"navigate"),cause:c?"preload":n.cause,abortController:o,preload:c,deps:n.loaderDeps,parentMatchPromise:s,context:n.context,route:r,...t.options.additionalContext}}i(Bo,"getLoaderContext");async function Do(t,e,n,r,o,s,c){let a=c[0],u=a.signal;if(u.aborted)return Rt;if(!o)return[it,void 0];let l=n._flight;Qt(t,n,"loader",a);try{if(!l){let f=new AbortController;l=[Promise.resolve().then(()=>o(Bo(t,e,n,r,f,s,!!c[3]))).then(d=>Zt(d,!1,r.id),d=>Zt(d,!0,r.id)).then(d=>(d[0]!==it&&t._flights?.get(n.id)===l&&(t._flights.delete(n.id),l[2]||f.abort()),d[0]===ft&&l[2]?cn(r,d[1]):d)),f,1],(t._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],fn(t,e,r,await Et(l[0],u),c)}catch(f){if(f!==u||!u.aborted)throw f;return ut(t,n),Rt}finally{Qt(t,n,!1,a)}}i(Do,"loadResource");function Fo(t,e,n){e[0]!==Y&&(t.status="success",t.error=void 0,e[0]===it?(t.loaderData=e[1],t.invalid=!1,t.updatedAt=Date.now(),t.preload=n):t.invalid=!0)}i(Fo,"settleInto");function ns(t,e,n){let r=t._cache.get(e.id);if(r!==n||t._committed.some(s=>s.id===e.id&&s._flight===e._flight))return;let o={...e,_notFound:void 0,context:{}};o._flight&&o._flight[2]++,t._cache.set(e.id,o),r&&ut(t,r)}i(ns,"cacheLoaderMatch");function Mo(t,e){return e[0]===ft||e[0]===Re?{...t,status:e[0]===ft?"error":"notFound",error:e[1],_flight:void 0}:t}i(Mo,"getParentSnapshot");function os(t,e,n,r,o,s,c){let a=e[1][n],u=kt(t,a),l=!!s[3],f=t._cache.get(a.id),d,h=!1,p;try{if(a.status==="success"&&(d=u.options.shouldReload,typeof d=="function"&&(d=d(Bo(t,e,a,u,s[0],o,l))),s[0].signal.aborted&&(p=Rt)),!p)if(a.status!=="success")h=!0;else{let I=l||a.preload?u.options.preloadStaleTime??t.options.defaultPreloadStaleTime??3e4:u.options.staleTime??t.options.defaultStaleTime??0;h=!!(a.invalid||d||d===void 0&&Date.now()-a.updatedAt>=I&&(s[5]||a.cause==="enter"||s[2].some(N=>N.routeId===a.routeId&&N.id!==a.id)))}}catch(I){a.invalid=!0,ut(t,a),p=Yt(t,e,u,I,s)}let g=u.options.loader,m=typeof g=="function",y=m?g:g?.handler,R=!l||u.options.preload!==!1,v=R&&g?t._flights?.get(a.id):void 0;v===a._flight||p?v=void 0:v&&!h&&!l&&d===void 0?h=!0:h||(v=void 0);let _=!!(g&&h&&a.status==="success"&&!l&&!s[4]&&((m?void 0:g.staleReloadMode)??t.options.defaultStaleReloadMode)!=="blocking"),x=h&&R,L=x&&!_&&(a.status!=="success"||!!g),b=n>=c?s[7]:void 0,S=u.lazyFn&&u._lazy!==!0?b:void 0;if(x&&!g&&(a.invalid=!1,a.updatedAt=Date.now()),v&&v[2]++,L){let I=a._flight;a._flight=v,ln(t,a,I)?.abort(),n>=c&&(a.status="pending"),b?.()}x||(a.isFetching=!1);let C=(p?Promise.resolve(p):L?Do(t,e,a,u,y,o,s):Promise.resolve([it,a.loaderData])).then(I=>(L&&(Fo(a,I,l),I[0]===it&&(g&&!s[0].signal.aborted&&ns(t,a,f),n>=c&&(a.status="pending"))),I)),w=Et(Promise.resolve().then(()=>Pt(u,void 0,S)),s[0].signal).then(()=>{},I=>e[1].some((N,_t)=>_t<=n&&(N.status==="error"||N.status==="notFound"||N._notFound))?void 0:[n,Yt(t,e,u,I,s)]).then(I=>C.then(N=>(L&&!I&&N[0]===it&&a.status==="pending"&&!s[0].signal.aborted&&(a.status="success",b?.()),I)));if(r.push([n,C,w]),!_)return C.then(I=>Mo(a,I));let P={...a,status:"pending",preload:!1,_flight:v};a.invalid=!1,a.isFetching="loader";let E=Do(t,e,P,u,y,o,s).then(I=>(a.isFetching=!1,Fo(P,I,!1),I));return(e[2]??=[]).push([n,E,w,P]),E.then(I=>Mo(P,I))}i(os,"createLoaderTask");async function rn(t,e,n,r,o=0){let s=n?.[1][1],c=s?.routeId?e.findIndex(a=>a.routeId===s.routeId):n?.[0]??e.length-1;c<0&&(c=0);for(let a=c;a>=0;a--){let u=kt(t,e[a]);try{let l=Pt(u,!1);l&&await Et(l,r)}catch(l){if(l===r&&r.aborted)throw l}if(u.options.notFoundComponent)return a}return s?.routeId?c:o}i(rn,"getNotFoundBoundary");function Lt(t,e){e[2]&&(j(t,e[2].map(n=>n[3])),e[2]=void 0)}i(Lt,"discardBackground");async function Ao(t,e,n,r){let o;try{await Promise.all(t.map(s=>s[1].then(async c=>{let a=s[0];if(!(r&&a>=await r)){if(c[0]>=Y)throw[a,c];!o&&c[0]!==it&&(o=[a,c],await Promise.all((n??[]).map(u=>{if(!(u[0]<=a))return u[1].then(l=>{if(l[0]===Y)throw[u[0],l]})})))}})))}catch(s){return s}return e??o}i(Ao,"settleTasks");function fn(t,e,n,r,o,s){for(;r[0]===Y;){let c=r[1],a=c.options;if(a.reloadDocument?o[3]:o[1]>=20)return r;try{return a.href&&a.reloadDocument?(t.resolveRedirect(c),r):[Y,c,t.buildLocation({...a,_fromLocation:e[0],_includeValidateSearch:!0})]}catch(u){r=s?[ft,u]:cn(n,u),s=!0}}return r}i(fn,"materializeRedirect");async function Uo(t,e,n,r,o,s){let c=e[1],a=await o,u=!1,l=c.findIndex(p=>p._notFound),f=i(p=>p[1][0]===Re?rn(t,c,p,r.signal):p[0],"boundaryOf"),d=l<0?c.length:l;if((a?.[1][0]??0)>=Y)d=0;else if(a){d=a[2]??=await f(a);for(let p of n){if(p[0]>=d)break;let g=await p[1];if(g[0]!==it&&g[0]<Y&&!("loaderData"in c[p[0]])){a=[p[0],g],d=a[2]=await f(a);break}}}for(let p of n){if(p[0]>=d)break;let g=await p[2];if(g){a=g;break}}if((a?.[1][0]??0)>=Y){let p=a[1];if(p[0]!==Y||p[1].options.reloadDocument||p[2])return Lt(t,e),p;u=!0,a=[0,[ft,new Error("Too many redirects")]]}let h=a?a[2]??await f(a):l;if(h>=0){let p=a?.[1],g=p?.[0],m=c[h],y=p?.[1],R=i(()=>{p&&(m._notFound=void 0,g===ft?m.status="error":(y.routeId=m.routeId,m.routeId===t.routeTree.id?(m.status="success",m._notFound=!0):m.status="notFound"),m.error=y,m.isFetching=!1)},"install");R(),p||s?.();let v=kt(t,m);try{await Et(p?Promise.resolve().then(()=>Pt(v,g===ft?"errorComponent":"notFoundComponent")):Promise.all([Pt(v),Pt(v,"notFoundComponent")]),r.signal)}catch(_){if(_===r.signal&&r.signal.aborted)return Lt(t,e),Rt}p?u&&(r.abort(),await Promise.all([...n.map(_=>_[1]),...n.map(_=>_[2]),...(e[2]??[]).map(_=>_[1])]),Lt(t,e),j(t,c),R()):m.status="success"}return e}i(Uo,"reduceLane");async function Vo(t,e,n,r=0,o=e[1].length){let s=e[1];for(let c=r;c<o;c++){let a=s[c],u=kt(t,a).options;if(u.head||u.scripts)try{let l={ssr:t.options.ssr,matches:s,match:a,params:a.params,loaderData:a.loaderData},[f,d]=await Et(Promise.all([u.head?.(l),u.scripts?.(l)]),n);a.meta=f?.meta,a.links=f?.links,a.headScripts=f?.scripts,a.styles=f?.styles,a.scripts=d}catch(l){if(l===n&&n.aborted)break;console.error(l)}if(a.status!=="success"||a._notFound)break}return e}i(Vo,"projectLane");async function Wo(t,e,n,r){let o=[e,n],s=r[0].signal,c;try{let a=t.stores.matches.get(),u=n.findIndex(R=>R._notFound);if(t.options.notFoundMode!=="root"&&u>=0){let R=await rn(t,n,void 0,s,u);n[u]._notFound=void 0,n[R]._notFound=!0,u=R}let l=u<0?n.length:u+1,f=0;for(;f<l&&f!==u;){let R=n[f],v=r[2][f],_=a[f];if(v?.id!==R.id||v.status!=="success"||v._notFound||R.preload||_?.id!==R.id||_.status!=="success"||_._notFound)break;f++}let d=[],h=r[6]??0,p=h?Promise.resolve(n[h-1]):void 0,g=i(()=>{for(let R=h;R<l&&!s.aborted;R++)p=os(t,o,R,d,p,r,f)},"planSuccessfulLane"),m=await es(t,o,r,l,g,f);if(m){if(r[4]=!0,l=m[0],m[1][0]===Re){let R=await rn(t,n,m,s);m[2]=R,l=Math.min(l,R+1)}else m[1][0]>=Y&&(l=0);g()}if(!s.aborted&&!r[3]){let R=[];for(let[v,_]of t._flights??[])_[2]||(t._flights.delete(v),R.push(_[1]));for(let v of R)v.abort()}let y=Uo(t,o,d,r[0],Ao(d,m,o[2]),r[7]);o[2]?.length&&(o[3]=Ao(o[2],void 0,void 0,y.then(R=>Xt(R)?0:an(n).length,()=>0))),c=await y}catch(a){if(Lt(t,o),a===s&&s.aborted)return Rt;throw a}return Xt(c)?c:Vo(t,c,s,r[6]===n.length?r[6]:0)}i(Wo,"executeClientLane");function sn(t,e){if(t._tx!==e)return;let n=e[3],r=t.stores.matches.get(),o=t._pending;for(let s=0;s<n.length;s++){let c=n[s],a=c.status==="success"&&!c._notFound,u=r[s]?.id===c.id&&r[s]?.status==="pending";if(a&&!u)continue;let l=kt(t,c),f=a||c.invalid?0:l.options.pendingMs??t.options.defaultPendingMs,d=l.options.pendingComponent??t.options.defaultPendingComponent;if(!d||typeof f!="number"||f===1/0){o&&(o[0]=e,o[2]=0,o[4]=!0);return}let h=l.options.pendingMinMs??t.options.defaultPendingMinMs??0,p=!1;if(o?.[1]===c.id?(p=o[0]!==e,o[0]=e):(clearTimeout(o?.[3]),t._pending=o=void 0),o||(t._pending=o=[e,c.id,u?Date.now()+h:e[4]+f,void 0,u||void 0,d]),o[4]&&!p&&o[5]===d)return;if(o[5]=d,!o[4]){clearTimeout(o[3]);let y=o[2]-Date.now();if(y>0){o[3]=setTimeout(()=>sn(t,e),y);return}o[2]=0}let g=n.map(y=>({...y,_flight:void 0}));g[s].status="pending";let m=o[4]=t.startTransition(()=>t.stores.setMatches(g),g).then(y=>(y&&t._pending===o&&o[4]===m&&!o[2]&&(o[2]=Date.now()+h),y));return}}i(sn,"offerPending");function Jt(t,e){let n=t._pending;(t._tx===e||!t._tx?.[3].some(r=>r.id===n?.[1]))&&(clearTimeout(n?.[3]),t._pending=void 0)}i(Jt,"finishPending");async function $o(t,e){let n=t._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!an(e[3]).some(s=>s.id===n[1]))return;let o;try{await Et(new Promise(s=>{o=setTimeout(s,r)}),e[0].signal)}catch{}clearTimeout(o)}i($o,"awaitPendingMinimum");function zo(t,e){t._committed=e,t.stores.setMatches(e)}i(zo,"publishMatches");function rs(t,e,n,r){let o=t._committed,s=t._cache;for(let u of n)u.preload=!1,r&&(u._assetEnd=void 0);let c=an(n).length,a=new Map;{let u=Date.now();for(let l of[...o,...s.values()]){if(l.status!=="success"||n.some((d,h)=>d.id===l.id&&(h<c||d.status==="success")))continue;let f=kt(t,l);!f.options.loader||u-l.updatedAt>=(l.preload?f.options.preloadGcTime??t.options.defaultPreloadGcTime??3e5:f.options.gcTime??t.options.defaultGcTime??3e5)||a.set(l.id,s.get(l.id)===l?l:{...l,_flight:void 0,isFetching:!1,context:{}})}}e[3]=[],t._cache=a,zo(t,n),j(t,[...s.values(),...o],[...n,...a.values()]),Io(t,o,n,e)}i(rs,"commitMatches");async function ve(t,e){let n=t._tx;for(;n&&n!==e;){if(await n[5],t._tx===n)return;n=t._tx}}i(ve,"awaitCurrent");function Ho(t,e,n){let r=n[1].options,o=n[2];if(!o)return t.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return t.navigate({href:o.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});o._redirects=e[1]+1,t._pendingLocation=o;let s=t.commitLocation({...o,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{t._pendingLocation===o&&(t._pendingLocation=void 0)}),s}i(Ho,"followRedirect");async function ss(t,e,n,r,o){let s=n.map(u=>({...u}));un(s);for(let u of r)ut(t,s[u[0]]),s[u[0]]=u[3];let c=[e[2],s],a;try{a=await Uo(t,c,r,e[0],o)}catch(u){throw j(t,s),u}if(Xt(a)){j(t,s),a[0]===Y&&t._tx===e&&t._committed===n&&await Ho(t,e,a);return}if(await Vo(t,a,e[0].signal),t._tx!==e||t._committed!==n){j(t,s);return}for(let u of s){let l=t._cache.get(u.id);l?._flight&&l._flight===u._flight&&(t._cache.delete(u.id),ut(t,l))}zo(t,s),j(t,n,s)}i(ss,"runBackground");async function is(t,e,n,r,o,s){let c=await Wo(t,e[2],e[3],[e[0],e[1],t._committed,void 0,o,n,s,r]);if(Xt(c)){let d=c[0]===Y&&t._tx===e;if((!d||c[1].options.reloadDocument)&&Jt(t,e),j(t,e[3]),e[3]=[],!d)return;if(t._tx!==e){Jt(t,e);return}await Ho(t,e,c);return}let a=c[1];if(t._tx===e&&await $o(t,e),t._tx!==e){Jt(t,e),j(t,a),Lt(t,c);return}let u=e[2],l=Ct(u,t.stores.resolvedLocation.get()),f=c[2];await t.startViewTransition(async()=>{if(t._tx===e&&await $o(t,e),t._tx!==e){Jt(t,e),j(t,a),Lt(t,c);return}let d=i(()=>{Jt(t,e),rs(t,e,a,s),t._tx===e&&(t.emit({type:"onLoad",...l}),t._tx===e&&t.emit({type:"onBeforeRouteMount",...l}))},"commit"),h=await t.startTransition(d,a);if(t._tx!==e){Lt(t,c);return}f?.length&&ss(t,e,a,f,c[3]).catch(console.error),t.batch(()=>{t.stores.resolvedLocation.set(u),t.stores.status.set("idle"),t._tx===e&&t.emit({type:"onResolved",...l}),h&&t._tx===e&&t.emit({type:"onRendered",...l})}),t._tx===e&&(t._commitPromise?.resolve(),t._commitPromise=void 0)})}i(is,"runClientTransaction");async function Oo(t,e){let n=!1,r=t._tx,o=t.stores.resolvedLocation.get(),s=o??t.stores.location.get(),c=t.latestLocation,a=t._pendingLocation,u=a?.href===c.href?a._redirects??0:0,l=t._handoff,f=n?void 0:l?.[0](),d=new AbortController,h=t._preflight;if(t._preflight=d,!n&&!f&&l?.[1](),h?.abort(),!d.signal.aborted){let L=Ct(c,o);t.emit({type:"onBeforeNavigate",...L}),d.signal.aborted||t.emit({type:"onBeforeLoad",...L})}if(d.signal.aborted){await ve(t,r);return}let p=s.href===c.href,g=d,m=t.matchRoutes(c,{_controller:d});un(m);let y=f?l[1](m):void 0;if(y?g=f:f?.abort(),d.signal.aborted){j(t,m),await ve(t,r);return}t._preflight=void 0;let R,v=i(()=>is(t,x,p,()=>sn(t,x),e?.sync,y),"run"),_=e?.sync?new Promise(L=>R=L):Promise.resolve().then(v).then(),x=[g,u,c,m,Date.now(),_];if(t._tx=x,r){for(let L of t.stores.matches.get()){if(t._tx!==x)break;L.isFetching&&Qt(t,L,!1)}r[0].abort(),j(t,r[3],x[3],!0)}if(t._tx!==x){j(t,x[3]),x[3]=[],R?.(),await ve(t,x);return}t.batch(()=>{t.stores.status.set("pending"),t.stores.location.set(c)}),(y||!t._committed.length&&m[0]?.status!=="success"&&!m.some(L=>L._notFound))&&sn(t,x),R?.(v()),await _,await ve(t,x)}i(Oo,"loadClientRoute");async function To(t,e){let n=t.buildLocation(e);for(let r=0;;r++){let o=t._committed,s=new AbortController,c,a,u;try{try{c=t.matchRoutes(n,{_controller:s}),un(c),a=(t._preloads??=new Map).set(s,c),u=await Wo(t,n,c,[s,r,o,!0])}finally{a&&(a=a.delete(s),j(t,c)),s.abort()}if(!Xt(u))return u[1];if(!a||u.length<3)return;n=u[2]}catch(l){J(l)||console.error(l);return}}}i(To,"preloadClientRoute");var dn="Error preloading route! \u261D\uFE0F";var Se=class{static{i(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;let n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=tt:this.parentRoute||mt();let o=r?tt:n?.path;o&&o!=="/"&&(o=ue(o));let s=n?.id||o,c=r?tt:bt([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);o==="__root__"&&(o="/"),c!=="__root__"&&(c=bt(["/",c]));let a=c==="__root__"?"/":bt([this.parentRoute.fullPath,o]);this._path=o,this._id=c,this._fullPath=a,this._to=G(a)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>So({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var hn=class extends Se{static{i(this,"BaseRootRoute")}constructor(t){super(t)}};var Ce=k(B(),1);var T=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(T||{});function jo({update:t,notify:e,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:c,shallowPropagate:a};function r(l,f,d){let h=f.depsTail;if(h!==void 0&&h.dep===l)return;let p=h!==void 0?h.nextDep:f.deps;if(p!==void 0&&p.dep===l){p.version=d,f.depsTail=p;return}let g=l.subsTail;if(g!==void 0&&g.version===d&&g.sub===f)return;let m=f.depsTail=l.subsTail={version:d,dep:l,sub:f,prevDep:h,nextDep:p,prevSub:g,nextSub:void 0};p!==void 0&&(p.prevDep=m),h!==void 0?h.nextDep=m:f.deps=m,g!==void 0?g.nextSub=m:l.subs=m}function o(l,f=l.sub){let d=l.dep,h=l.prevDep,p=l.nextDep,g=l.nextSub,m=l.prevSub;return p!==void 0?p.prevDep=h:f.depsTail=h,h!==void 0?h.nextDep=p:f.deps=p,g!==void 0?g.prevSub=m:d.subsTail=m,m!==void 0?m.nextSub=g:(d.subs=g)===void 0&&n(d),p}function s(l){let f=l.nextSub,d;t:do{let h=l.sub,p=h.flags;if(p&60?p&12?p&4?!(p&48)&&u(l,h)?(h.flags=p|40,p&=1):p=0:h.flags=p&-9|32:p=0:h.flags=p|32,p&2&&e(h),p&1){let g=h.subs;if(g!==void 0){let m=(l=g).nextSub;m!==void 0&&(d={value:f,prev:d},f=m);continue}}if((l=f)!==void 0){f=l.nextSub;continue}for(;d!==void 0;)if(l=d.value,d=d.prev,l!==void 0){f=l.nextSub;continue t}break}while(!0)}function c(l,f){let d,h=0,p=!1;t:do{let g=l.dep,m=g.flags;if(f.flags&16)p=!0;else if((m&17)===17){if(t(g)){let y=g.subs;y.nextSub!==void 0&&a(y),p=!0}}else if((m&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(d={value:l,prev:d}),l=g.deps,f=g,++h;continue}if(!p){let y=l.nextDep;if(y!==void 0){l=y;continue}}for(;h--;){let y=f.subs,R=y.nextSub!==void 0;if(R?(l=d.value,d=d.prev):l=y,p){if(t(f)){R&&a(y),f=l.sub;continue}p=!1}else f.flags&=-33;f=l.sub;let v=l.nextDep;if(v!==void 0){l=v;continue t}}return p}while(!0)}function a(l){do{let f=l.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&e(f))}while((l=l.nextSub)!==void 0)}function u(l,f){let d=f.depsTail;for(;d!==void 0;){if(d===l)return!0;d=d.prevDep}return!1}}i(jo,"createReactiveSystem");function Go(t,e,n){let r=typeof t=="object",o=r?t:void 0;return{next:(r?t.next:t)?.bind(o),error:(r?t.error:e)?.bind(o),complete:(r?t.complete:n)?.bind(o)}}i(Go,"toObserver");var pn=[],we=0,{link:Ko,unlink:ls,propagate:us,checkDirty:Jo,shallowPropagate:qo}=jo({update(t){return t._update()},notify(t){pn[mn++]=t,t.flags&=~T.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=T.Mutable|T.Dirty,xe(t))}}),_e=0,mn=0,at,gn=0;function yn(t){try{++gn,t()}finally{--gn||vn()}}i(yn,"batch");function xe(t){let e=t.depsTail,n=e!==void 0?e.nextDep:t.deps;for(;n!==void 0;)n=ls(n,t)}i(xe,"purgeDeps");function vn(){if(!(gn>0)){for(;_e<mn;){let t=pn[_e];pn[_e++]=void 0,t.notify()}_e=0,mn=0}}i(vn,"flush");function be(t,e){let n=typeof t=="function",r=t,o={_snapshot:n?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?T.None:T.Mutable,get(){return at!==void 0&&Ko(o,at,we),o._snapshot},subscribe(s){let c=Go(s),a={current:!1},u=fs(()=>{o.get(),a.current?c.next?.(o._snapshot):a.current=!0});return{unsubscribe:i(()=>{u.stop()},"unsubscribe")}},_update(s){let c=at,a=e?.compare??Object.is;if(n)at=o,++we,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=T.Mutable|T.RecursedCheck);try{let u=o._snapshot,l=typeof s=="function"?s(u):s===void 0&&n?r(u):s;return u===void 0||!a(u,l)?(o._snapshot=l,!0):!1}finally{at=c,n&&(o.flags&=~T.RecursedCheck),xe(o)}}};return n?(o.flags=T.Mutable|T.Dirty,o.get=function(){let s=o.flags;if(s&T.Dirty||s&T.Pending&&Jo(o.deps,o)){if(o._update()){let c=o.subs;c!==void 0&&qo(c)}}else s&T.Pending&&(o.flags=s&~T.Pending);return at!==void 0&&Ko(o,at,we),o._snapshot}):o.set=function(s){if(o._update(s)){let c=o.subs;c!==void 0&&(us(c),qo(c),vn())}},o}i(be,"createAtom");function fs(t){let e=i(()=>{let r=at;at=n,++we,n.depsTail=void 0,n.flags=T.Watching|T.RecursedCheck;try{return t()}finally{at=r,n.flags&=~T.RecursedCheck,xe(n)}},"run"),n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:T.Watching|T.RecursedCheck,notify(){let r=this.flags;r&T.Dirty||r&T.Pending&&Jo(this.deps,this)?e():this.flags=T.Watching},stop(){this.flags=T.None,this.depsTail=void 0,xe(this)}};return e(),n}i(fs,"effect");var Rn=k(B(),1),Yo=k(Nr(),1);function ds(t,e){return t===e}i(ds,"defaultCompare");function V(t,e,n=ds){let r=(0,Rn.useCallback)(c=>{if(!t)return()=>{};let{unsubscribe:a}=t.subscribe(c);return a},[t]),o=(0,Rn.useCallback)(()=>t?.get(),[t]);return(0,Yo.useSyncExternalStoreWithSelector)(r,o,o,e,n)}i(V,"useStore");var Xo={};function Sn(t,e){let n=Ce.useRef();return r=>{let o=t?.select?t.select(r):r;return t?.structuralSharing??e.options.defaultStructuralSharing?n.current=rt(n.current,o):o}}i(Sn,"useStructuralSharing");function X(t){let e=D(),n=Ce.useContext(t.from?qn:xt),r=t.from??n,o=e.stores.getMatchStore(r);if(!1){let a=o.get();if(!a){(t.shouldThrow??!0)&&mt();return}return t.select?t.select(a):a}let s=Sn(t,e),c=V(o,a=>a?s(a):Xo);if(c!==Xo)return c;(t.shouldThrow??!0)&&mt()}i(X,"useMatch");function Pe(t){return X({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:i(e=>t.select?t.select(e.search):e.search,"select")})}i(Pe,"useSearch");var ct=k(B(),1);var Le=ct.useLayoutEffect;function Zo(t,e,n){ct.useEffect(()=>{if(!t.current||n||typeof IntersectionObserver!="function")return()=>e();let r=new IntersectionObserver(o=>{e(o.pop())},{rootMargin:"100px"});return r.observe(t.current),()=>{r.disconnect(),e()}},[e,n,t])}i(Zo,"useIntersectionObserver");function Qo(t){let e=ct.useRef(null);return ct.useImperativeHandle(t,()=>e.current,[]),e}i(Qo,"useForwardedRef");var _n=k(B(),1);function Ee(t){let e=D();return _n.useCallback(n=>e.navigate({...n,from:n.from??t?.from}),[t?.from,e])}i(Ee,"useNavigate");var Bt=k(B(),1),lt=k(Z(),1);var It=class extends Bt.Component{static{i(this,"CatchBoundary")}constructor(...t){super(...t),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(t,e){let n=t.getResetKey();return e.error&&e.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,e){this.props.onCatch?.(t,e)}render(){let t=this.state.error;return t?Bt.createElement(this.props.errorComponent??wn,{error:t,reset:this.reset}):this.props.children}};function wn({error:t}){let[e,n]=Bt.useState(!1);return(0,lt.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,lt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,lt.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,lt.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:i(()=>n(r=>!r),"onClick"),children:e?"Hide Error":"Show Error"})]}),(0,lt.jsx)("div",{style:{height:".25rem"}}),e?(0,lt.jsx)("div",{children:(0,lt.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,lt.jsx)("code",{children:t.message}):null})}):null]})}i(wn,"ErrorComponent");var xn=k(B(),1),tr=k(Z(),1);function er({children:t,fallback:e=null}){return(0,tr.jsx)(xn.default.Fragment,{children:bn()?t:e})}i(er,"ClientOnly");function bn(){return xn.default.useSyncExternalStore(hs,()=>!0,()=>!1)}i(bn,"useHydrated");function hs(){return()=>{}}i(hs,"subscribe");function Cn(t){return X({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:i(e=>t.select?t.select(e.loaderData):e.loaderData,"select")})}i(Cn,"useLoaderData");function Pn(t){let{select:e,...n}=t;return X({...n,select:i(r=>e?e(r.loaderDeps):r.loaderDeps,"select")})}i(Pn,"useLoaderDeps");function Ln(t){return X({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:i(e=>{let n=t.strict===!1?e.params:e._strictParams;return t.select?t.select(n):n},"select")})}i(Ln,"useParams");function En(t){return X({...t,select:i(e=>t.select?t.select(e.context):e.context,"select")})}i(En,"useRouteContext");var W=k(B(),1);var ps=k(Z(),1);function kn(t){let e=W.useRef(t);return Q(e.current,t,{ignoreUndefined:!1})||(e.current=t),e.current}i(kn,"useValueStable");function ms(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}i(ms,"compareLinkState");function gs(t,e,n){if(t?.external)return st(t.href,n)?void 0:t.href;if(!ir(e)&&!(typeof e!="string"||e.indexOf(":")===-1))try{return new URL(e),st(e,n)?void 0:e}catch{}}i(gs,"resolveExternalLink");function ys(t,e,n,r,o,s){if(s)return!1;if(n?.exact){if(!fe(t.pathname,e.pathname,r))return!1}else{let c=yt(t.pathname,r),a=yt(e.pathname,r);if(!(c.startsWith(a)&&(c.length===a.length||c[a.length]==="/")))return!1}return(n?.includeSearch??!0)&&!Q(t.search,e.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:n?.includeHash?o&&t.hash===e.hash:!0}i(ys,"resolveIsActive");function vs(t,e){let n=D(),r=Qo(e),{activeProps:o,inactiveProps:s,activeOptions:c,to:a,preload:u,preloadDelay:l,preloadIntentProximity:f,hashScrollIntoView:d,replace:h,startTransition:p,resetScroll:g,viewTransition:m,children:y,target:R,disabled:v,style:_,className:x,onClick:L,onBlur:b,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:P,ignoreBlocker:E,params:I,search:N,hash:_t,state:nt,mask:oe,reloadDocument:Ps,unsafeRelative:Ls,from:Es,_fromLocation:ks,...Nt}=t;if(!1){let M=ir(a);if(typeof a=="string"&&!M&&a.indexOf(":")>-1)try{return new URL(a),st(a,n.protocolAllowlist)?{...Nt,ref:r,href:void 0,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}}:{...Nt,ref:r,href:a,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}}}catch{}let F=n.buildLocation({...t,from:t.from}),ot=sr(F.maskedLocation?F.maskedLocation.publicHref:F.publicHref,F.maskedLocation?F.maskedLocation.external:F.external,n.history,v),Tt=(()=>{if(ot?.external)return st(ot.href,n.protocolAllowlist)?void 0:ot.href;if(!M&&typeof a=="string"&&a.indexOf(":")>-1)try{return new URL(a),st(a,n.protocolAllowlist)?void 0:a}catch{}})(),Ae=(()=>{if(Tt)return!1;let $=n.stores.location.get(),z=c?.exact??!1;if(z){if(!fe($.pathname,F.pathname,n.basepath))return!1}else{let U=yt($.pathname,n.basepath),H=yt(F.pathname,n.basepath);if(!(U.startsWith(H)&&(U.length===H.length||U[H.length]==="/")))return!1}if((c?.includeSearch??!0)&&$.search!==F.search){let U=!$.search||typeof $.search=="object"&&!ht($.search),H=!F.search||typeof F.search=="object"&&!ht(F.search);if(!(U&&H)&&!Q($.search,F.search,{partial:!z,ignoreUndefined:!c?.explicitUndefined}))return!1}return!c?.includeHash})();if(Tt)return{...Nt,ref:r,href:Tt,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}};let $e=Ae?q(o,{})??nr:Ut,Be=Ae?Ut:q(s,{})??Ut,zn=(()=>{let $=_,z=$e.style,U=Be.style;if(!(!$&&!z&&!U))return $&&!z&&!U?$:!$&&z&&!U?z:!$&&!z&&U?U:{...$,...z,...U}})(),Hn=(()=>{let $=x,z=$e.className,U=Be.className;if(!$&&!z&&!U)return"";let H="";return $&&(H=$),z&&(H=H?`${H} ${z}`:z),U&&(H=H?`${H} ${U}`:U),H})();return{...Nt,...$e,...Be,href:ot?.href,ref:r,disabled:!!v,target:R,...zn&&{style:zn},...Hn&&{className:Hn},...v&&or,...Ae&&rr}}let An=bn(),Cr=kn(t.search),Pr=kn(t.params),$n=kn(c),zt=W.useMemo(()=>t,[n,t.from,t._fromLocation,t.hash,t.to,Cr,Pr,t.state,t.mask,t.unsafeRelative]),Lr=W.useCallback(M=>{let F=n.buildLocation({_fromLocation:M,...zt}),ot=sr(F.maskedLocation?F.maskedLocation.publicHref:F.publicHref,F.maskedLocation?F.maskedLocation.external:F.external,n.history,v),Tt=gs(ot,a,n.protocolAllowlist);return[ot?.href,Tt,ys(M,F,$n,n.basepath,An,Tt!==void 0)]},[$n,v,An,zt,n,a]),[Er,Te,De]=V(n.stores.location,Lr,ms),re=De?q(o,{})??nr:Ut,se=De?Ut:q(s,{})??Ut,Bn=[x,re.className,se.className].filter(Boolean).join(" "),Un=(_||re.style||se.style)&&{..._,...re.style,...se.style},Vn=W.useRef(!1),wt=t.reloadDocument||Te||v?!1:u??n.options.defaultPreload,Fe=l??n.options.defaultPreloadDelay??0,Ot=W.useCallback(()=>{n.preloadRoute(zt).catch(M=>{console.warn(M),console.warn(dn)})},[n,zt]),Me=W.useCallback(M=>{if(!M){In(r);return}if(!(M.isIntersecting??wt==="intent")){M.isIntersecting===!1&&In(r);return}if(!Fe){Ot();return}te.has(r)||te.set(r,setTimeout(()=>{te.delete(r),Ot()},Fe))},[Ot,r,wt,Fe]);Zo(r,Me,wt!=="viewport"),W.useEffect(()=>{Vn.current||wt==="render"&&(Ot(),Vn.current=!0)},[Ot,wt]);let kr=i(M=>{let F=M.currentTarget.getAttribute("target"),ot=R!==void 0?R:F;!v&&!(M.metaKey||M.altKey||M.ctrlKey||M.shiftKey)&&!M.defaultPrevented&&(!ot||ot==="_self")&&M.button===0&&(M.preventDefault(),n.navigate({...zt,replace:h,resetScroll:g,hashScrollIntoView:d,startTransition:p,viewTransition:m,ignoreBlocker:E}))},"handleClick");if(Te)return{...Nt,ref:r,href:Te,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x},...L&&{onClick:L},...b&&{onBlur:b},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...P&&{onTouchStart:P}};let Ir=i(()=>{wt==="intent"&&Ot()},"handleTouchStart"),Wn=i(()=>{wt==="intent"&&In(r)},"handleLeave");return{...Nt,...re,...se,href:Er,ref:r,onClick:Vt([L,kr]),onBlur:Vt([b,Wn]),onFocus:Vt([S,Me]),onMouseEnter:Vt([C,Me]),onMouseLeave:Vt([w,Wn]),onTouchStart:Vt([P,Ir]),disabled:!!v,target:R,...Un&&{style:Un},...Bn&&{className:Bn},...v&&or,...De&&rr}}i(vs,"useLinkProps");var Ut={},nr={className:"active"},or={role:"link","aria-disabled":!0},rr={"data-status":"active","aria-current":"page"},te=new WeakMap,In=i(t=>{clearTimeout(te.get(t)),te.delete(t)},"cancelPreload"),Vt=i(t=>e=>{for(let n of t)if(n){if(e.defaultPrevented)return;n(e)}},"composeHandlers");function sr(t,e,n,r){if(!r)return e?{href:t,external:!0}:{href:n.createHref(t)||"/",external:!1}}i(sr,"getHrefOption");function ir(t){if(typeof t!="string")return!1;let e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}i(ir,"isSafeInternal");var Nn=W.forwardRef((t,e)=>{let{_asChild:n,...r}=t,{type:o,...s}=vs(r,e),c=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){let{disabled:a,...u}=s;return W.createElement("a",u,c)}return W.createElement(n,s,c)});var On=k(B(),1),Tn=k(Z(),1);var ar=class extends Se{static{i(this,"Route")}constructor(t){super(t),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>En({...e,from:this.id}),this.useSearch=e=>Pe({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ln({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Pn({...e,from:this.id}),this.useLoaderData=e=>Cn({...e,from:this.id}),this.useNavigate=()=>Ee({from:this.fullPath}),this.Link=On.default.forwardRef((e,n)=>(0,Tn.jsx)(Nn,{ref:n,from:this.fullPath,...e}))}};function Rs(t){return new ar(t)}i(Rs,"createRoute");var cr=class extends hn{static{i(this,"RootRoute")}constructor(t){super(t),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>En({...e,from:this.id}),this.useSearch=e=>Pe({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ln({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Pn({...e,from:this.id}),this.useLoaderData=e=>Cn({...e,from:this.id}),this.useNavigate=()=>Ee({from:this.fullPath}),this.Link=On.default.forwardRef((e,n)=>(0,Tn.jsx)(Nn,{ref:n,from:this.fullPath,...e}))}};function Ss(t){return new cr(t)}i(Ss,"createRootRoute");var Ic=k(B(),1);var ke=k(Z(),1);function lr(t){let e=D();if(!1){let r=`not-found-${e.stores.location.get().pathname}-${e.stores.status.get()}`;return(0,ke.jsx)(It,{getResetKey:i(()=>r,"getResetKey"),onCatch:i((o,s)=>{if(J(o))t.onCatch?.(o,s);else throw o},"onCatch"),errorComponent:i(({error:o})=>{if(J(o))return t.fallback?.(o);throw o},"errorComponent"),children:t.children})}let n=`not-found-${V(e.stores.location,r=>r.pathname)}-${V(e.stores.status,r=>r)}`;return(0,ke.jsx)(It,{getResetKey:i(()=>n,"getResetKey"),onCatch:i((r,o)=>{if(J(r))t.onCatch?.(r,o);else throw r},"onCatch"),errorComponent:i(({error:r})=>{if(J(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}i(lr,"CatchNotFound");function ur(){return(0,ke.jsx)("p",{children:"Not Found"})}i(ur,"DefaultGlobalNotFound");var fr=k(Z(),1);function dr({children:t}){let e=D();return null}i(dr,"ScriptOnce");var Ac=k(B(),1),Ie=k(Z(),1);function St(t){return(0,Ie.jsx)(Ie.Fragment,{children:t.children})}i(St,"SafeFragment");var Vc=k(B(),1),Ne=k(Z(),1);function Dn(t,e,n){return e.options.notFoundComponent?(0,Ne.jsx)(e.options.notFoundComponent,{...n}):t.options.defaultNotFoundComponent?(0,Ne.jsx)(t.options.defaultNotFoundComponent,{...n}):(0,Ne.jsx)(ur,{})}i(Dn,"renderRouteNotFound");var pr=k(Z(),1);function hr(t){return null}i(hr,"getScrollRestorationScriptForRouter");function mr(){let t=hr(D());return t?(0,pr.jsx)(dr,{children:t}):null}i(mr,"ScrollRestoration");var K=k(B(),1);var A=k(Z(),1);function ee(t,e){let n=e?.options.pendingComponent??t.options.defaultPendingComponent;return n?(0,A.jsx)(n,{}):null}i(ee,"renderPending");var _s=i((t,e)=>t[0]===e[0]&&t[1]===e[1],"outletMatchSelectionEqual"),vr=i((t,e,n)=>!e.isRoot||e.options.shellComponent||e.options.wrapInSuspense||n===!1||n==="data-only"||!t.ssr,"canWrapInSuspense"),Oe=K.memo(i(function({routeId:e}){let n=D();return(0,A.jsx)(gr,{router:n,match:V(n.stores.getMatchStore(e),r=>r)})},"MatchImpl"));function gr({router:t,match:e}){let n=t.routesById[e.routeId],r=ee(t,n),o=n.options.errorComponent??t.options.defaultErrorComponent,s=n.options.onCatch??t.options.defaultOnCatch,c=n.isRoot?n.options.notFoundComponent??t.options.notFoundRoute?.options.component:n.options.notFoundComponent,a=e.ssr===!1||e.ssr==="data-only",u=vr(t,n,e.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||a))?K.Suspense:St,l=o?It:St,f=c?lr:St;return(0,A.jsxs)(n.isRoot?n.options.shellComponent??St:St,{children:[(0,A.jsx)(xt.Provider,{value:e.routeId,children:(0,A.jsx)(u,{fallback:r,children:(0,A.jsx)(l,{getResetKey:i(()=>e,"getResetKey"),errorComponent:o,onCatch:i((d,h)=>{if(J(d))throw d.routeId??=e.routeId,d;s?.(d,h)},"onCatch"),children:(0,A.jsx)(f,{fallback:i(d=>{if(d.routeId??=e.routeId,d.routeId!==e.routeId)throw d;return K.createElement(c,d)},"fallback"),children:a?(0,A.jsx)(er,{fallback:r,children:(0,A.jsx)(yr,{match:e})}):(0,A.jsx)(yr,{match:e})})})})}),null]})}i(gr,"MatchView");var yr=K.memo(i(function({match:e}){let n=D(),r=e.routeId,o=n.routesById[r],s=K.useMemo(()=>{let a=(o.options.remountDeps??n.options.defaultRemountDeps)?.({routeId:r,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return a?JSON.stringify(a):void 0},[r,e.loaderDeps,e._strictParams,e._strictSearch,o.options.remountDeps,n.options.defaultRemountDeps]),c=K.useMemo(()=>{let a=o.options.component??n.options.defaultComponent;return a?(0,A.jsx)(a,{},s):(0,A.jsx)(Rr,{})},[s,o.options.component,n.options.defaultComponent]);if(e.status==="pending"){if(n.ssr&&!vr(n,o,e.ssr))return c;if(n._tx)throw n._tx[5];return ee(n,o)}if(e.status==="notFound")return Dn(n,o,e.error);if(e.status==="error"){if(!1)return(0,A.jsx)((o.options.errorComponent??n.options.defaultErrorComponent)||wn,{error:e.error,reset:void 0,info:{componentStack:""}});throw e.error}return c},"MatchInnerImpl")),Rr=K.memo(i(function(){let e=D(),n=K.useContext(xt),r,o,s;if(!1){let a=e.stores.matches.get(),u=a.findIndex(f=>f.routeId===n),l=a[u];r=!!l._notFound,o=l.error,s=a[u+1]?.routeId}else{let a=e.stores.getMatchStore(n);[r,o]=V(a,u=>[!!u._notFound,u.error],_s),s=V(e.stores.ids,u=>u[u.indexOf(n)+1])}if(r)return Dn(e,e.routesById[n],o);if(!s)return null;let c=(0,A.jsx)(Oe,{routeId:s});return n===tt?(0,A.jsx)(K.Suspense,{fallback:ee(e),children:c}):c},"OutletImpl"));var Fn=k(B(),1);function Mn(t,e){let n=t[1];t.length=0,n?.(e)}i(Mn,"settleOwner");function Sr({t}){let e=D(),n=e._rendered??=[],r=void 0;return e.startTransition=(o,s)=>new Promise(c=>{Mn(n,!1),n.push(s,c),t(e),Fn.startTransition(o)}),Le(()=>{let o=e.history.subscribe(e.load);if(r?.current)return o;r&&(r.current=!0),e.updateLatestLocation();let s=e.latestLocation,c=e.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(G(s.publicHref)!==G(c.publicHref))return e.commitLocation({...c,replace:!0,ignoreBlocker:!0}),o;let a=e.stores.resolvedLocation.get();return a?.href===s.href&&a.state.__TSR_key===s.state.__TSR_key?n.push(e.stores.matches.get(),u=>{u&&e.emit({type:"onRendered",...Ct(a,a)})}):e._tx||e.load({sync:!0}).catch(console.error),o},[e,e.history]),null}i(Sr,"Transitioner");var Wt=k(B(),1);var et=k(Z(),1);function _r(){let t=D(),e=t.routesById[tt],n=ee(t,e),r=t.ssr?St:Wt.Suspense,o=(0,et.jsxs)(et.Fragment,{children:[!!1&&(0,et.jsx)(Sr,{t:Wt.useState()[1]}),(0,et.jsx)(r,{fallback:n,children:(0,et.jsx)(ws,{})})]});return t.options.InnerWrap?(0,et.jsx)(t.options.InnerWrap,{children:o}):o}i(_r,"Matches");function ws(){let t=D(),e=t._rendered,n=V(t.stores.matches,c=>e[0]??c),r=n[0],o=r?.routeId;Le(()=>{e[0]===n&&Mn(e,!0)},[e,n]);let s=o?(0,et.jsx)(Oe,{routeId:o}):null;return(0,et.jsx)(xt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:(0,et.jsx)(It,{getResetKey:i(()=>r,"getResetKey"),onCatch:void 0,children:s})})}i(ws,"MatchesInner");var wr=i(t=>({createMutableStore:be,createReadonlyStore:be,batch:yn}),"getStoreFactory");var xs=i(t=>new xr(t),"createRouter"),xr=class extends nn{static{i(this,"Router")}constructor(t){super(t,wr)}};var Al=k(B(),1),ne=k(Z(),1);function br({router:t,children:e,...n}){ht(n)&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});let r=(0,ne.jsx)(ie.Provider,{value:t,children:e});return t.options.Wrap?(0,ne.jsx)(t.options.Wrap,{children:r}):r}i(br,"RouterContextProvider");function bs({router:t,...e}){return(0,ne.jsx)(br,{router:t,...e,children:(0,ne.jsx)(_r,{})})}i(bs,"RouterProvider");function Cs(t){let e=D({warn:t?.router===void 0}),n=t?.router||e;if(!1){let r=n.stores.__store.get();return t?.select?t.select(r):r}return V(n.stores.__store,Sn(t,n))}i(Cs,"useRouterState");export{tn as a,Yr as b,D as c,Pe as d,Ee as e,Rs as f,Ss as g,Rr as h,xs as i,bs as j,Cs as k};
@@ -0,0 +1 @@
1
+ import{a as G}from"./chunk-EA2JKR5D.js";import{a as x}from"./chunk-IMOHEGMV.js";import{a as U}from"./chunk-2DX5MROH.js";import{b as M}from"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as O}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as p}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as w}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as E}from"./chunk-4ZEL6BYL.js";import{f as D}from"./chunk-ML7GYWXD.js";import"./chunk-FSRSK4LY.js";import"./chunk-5CEAO2OT.js";import{d as K,e as _,f as z,h as B,o as P,r as q}from"./chunk-FODLDLE2.js";import{a as s,d as J,e as ie,g as oe}from"./chunk-YKXDMIHQ.js";var i=J(ie(),1);var e=J(oe(),1);var de=s(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"oe"),le=s(r=>r===void 0||r.length===0?"()":`(${r.map(o=>`${o.name}${o.optional?"?":""}: ${de(o)}`).join(", ")})`,"ie"),ce=s(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"de"),ue=s(r=>{let o={};for(let a of r??[])a.optional||(o[a.name]=ce(a.kind));return JSON.stringify(o,void 0,2)},"le"),me=z(E.runAs),fe=10,he=s(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"me"),Fe=s(({functions:r,runAsIdentity:o=!1}={})=>{let a=K(),u=D(),[H,Q]=(0,i.useState)(null),[k,V]=(0,i.useState)(null),g=r??H??[],[I,S]=(0,i.useState)(""),[m,b]=(0,i.useState)("{}"),[c,F]=(0,i.useState)(""),[f,W]=(0,i.useState)(""),[v,h]=(0,i.useState)("idle"),[X,y]=(0,i.useState)(void 0),[C,N]=(0,i.useState)(null),[$,Y]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(r!==void 0)return;let t=!1;return u.listFunctions().then(d=>(t||Q(d),d)).catch(d=>{t||V(B(d))}),()=>{t=!0}},[u,r]);let A=I===""?g[0]?.path??"":I,n=g.find(t=>t.path===A),Z=s(async()=>{if(!n)return;let t;try{t=m.trim()===""?{}:JSON.parse(m)}catch(l){h("error"),y(void 0),N(a("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:n.path},R=c.trim()===""?{}:{shardKey:c.trim()},j=o?f.trim():"",L=s(l=>{Y(T=>[{argsText:m,at:Date.now(),id:(T[0]?.id??0)+1,kind:n.kind,path:n.path,shardKey:c,status:l},...T].slice(0,fe))},"$");h("running"),N(null);try{let l=j===""?await _(u,n.kind,d,t,R):await u.query(me,{args:t,functionPath:n.path,userId:j},R);M(c),y(l),h("success"),L("success")}catch(l){y(void 0),N(l.message),h("error"),L("error")}},"J"),ee=s(t=>{S(t.path),b(t.argsText),F(t.shardKey)},"M"),te=s(t=>{S(t.target.value)},"P"),re=s(t=>{b(t.target.value)},"z"),ae=s(t=>{W(t.target.value)},"q"),se=s(()=>{P(Z())},"H"),ne=s(()=>{b(ue(n?.args))},"V");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[k!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:k}),(0,e.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(x,{htmlFor:"function-select",children:a("Function")}),(0,e.jsx)("select",{"aria-label":a("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:te,value:A,children:g.map(t=>(0,e.jsxs)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path))}),n!==void 0&&(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"mr-1.5 font-medium",children:a("Signature")}),(0,e.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:le(n.args)})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(x,{htmlFor:"args-input",children:a("Arguments")}),(0,e.jsx)(p,{"data-testid":"prefill-button",disabled:n===void 0,onClick:ne,size:"xs",type:"button",variant:"ghost",children:a("Prefill")})]}),(0,e.jsx)(G,{"aria-label":a("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:m})]}),(0,e.jsx)(U,{onChange:F,testId:"shard-input",value:c}),o&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsx)(x,{htmlFor:"run-as-input",children:a("Run as identity (userId)")}),(0,e.jsx)(O,{"aria-label":a("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:ae,placeholder:a("Leave empty to run as admin"),value:f}),(0,e.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(p,{"data-testid":"run-button",disabled:v==="running"||n===void 0,onClick:se,type:"button",children:a("Run")}),n!==void 0&&(0,e.jsx)(w,{variant:"outline",children:n.kind}),o&&f.trim()!==""&&(0,e.jsx)(w,{"data-testid":"run-as-badge",variant:"secondary",children:a("as {userId}",{userId:f.trim()})})]})]}),v==="error"&&C!==null&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:C}),v==="success"&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:he(X)}),$.length>0&&(0,e.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:$.map((t,d)=>(0,e.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,e.jsx)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"})," ",(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]})," ",(0,e.jsx)("time",{className:"text-xs text-muted-foreground",children:q(t.at)})," ",(0,e.jsx)(p,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:s(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:a("Load")})]},t.id))})]})},"Ae");export{Fe as FunctionRunner};
@@ -0,0 +1 @@
1
+ import{b as y}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as R}from"./chunk-U6XZFNKM.js";import"./chunk-ULIQFBZU.js";import"./chunk-XFXYDKOW.js";import"./chunk-35DM4JJG.js";import{a as v}from"./chunk-4ZEL6BYL.js";import{c as $}from"./chunk-AWWI2VYF.js";import"./chunk-ML7GYWXD.js";import"./chunk-FSRSK4LY.js";import"./chunk-5CEAO2OT.js";import{a as S}from"./chunk-FKVZRPV5.js";import{a as A,b as C,c as I,d as x,e as c,f as n}from"./chunk-HEAQVSNS.js";import{a as k,e as w}from"./chunk-WUWBZPUK.js";import{d as N}from"./chunk-FODLDLE2.js";import{a as f,d as b,f as E,g as O}from"./chunk-YKXDMIHQ.js";var j=b(E(),1);var r=b(O(),1);var _=f((e,t)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[t],"I"),T={delete:2,list:3,read:0,write:1},B=f(e=>[...e].toSorted((t,a)=>t.bucket.localeCompare(a.bucket)||T[t.on]-T[a.on]||(t.prefix??"").localeCompare(a.prefix??"")),"O"),q=f(()=>{let e=(0,j.c)(14),t=N(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:i,errorSource:d}=$(v.storageRules,a),h=l!==void 0,m;if(e[1]!==l||e[2]!==i||e[3]!==d||e[4]!==h||e[5]!==t){let g=B(Array.isArray(l?.rules)?l.rules:[]),u;e[7]!==i||e[8]!==d?(u=i!==null&&(0,r.jsx)(R,{error:d,testId:"storage-rules-error"}),e[7]=i,e[8]=d,e[9]=u):u=e[9];let o;e[10]!==t?(o=t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=t,e[11]=o):o=e[11];let p;e[12]!==o?(p=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:o}),e[12]=o,e[13]=p):p=e[13],m=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[u,p,h&&g.length===0?(0,r.jsx)(S,{description:t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:t("No storage rules defined")}):(0,r.jsx)(k,{className:"overflow-hidden py-0",children:(0,r.jsx)(w,{className:"px-0",children:(0,r.jsxs)(A,{"data-testid":"storage-rules-table",children:[(0,r.jsx)(C,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(c,{children:t("Bucket")}),(0,r.jsx)(c,{children:t("Operation")}),(0,r.jsx)(c,{children:t("Key prefix")}),(0,r.jsx)(c,{children:t("Guarded by")})]})}),(0,r.jsx)(I,{children:g.map(s=>(0,r.jsxs)(x,{"data-testid":`storage-rule-${s.bucket}-${s.on}-${s.prefix??""}`,children:[(0,r.jsx)(n,{className:"font-mono text-xs",children:s.bucket}),(0,r.jsx)(n,{children:(0,r.jsx)(y,{variant:"secondary",children:_(t,s.on)})}),(0,r.jsx)(n,{className:"font-mono text-xs",children:s.prefix??(0,r.jsx)("span",{className:"text-muted-foreground",children:t("(whole bucket)")})}),(0,r.jsx)(n,{className:"font-mono text-xs text-muted-foreground",children:s.procedure})]},`${s.bucket}:${s.on}:${s.prefix??""}:${s.procedure}`))})]})})})]}),e[1]=l,e[2]=i,e[3]=d,e[4]=h,e[5]=t,e[6]=m}else m=e[6];return m},"M");export{q as default};
@@ -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-U6XZFNKM.js";import"./chunk-ULIQFBZU.js";import"./chunk-XFXYDKOW.js";import"./chunk-35DM4JJG.js";import{a as U}from"./chunk-4ZEL6BYL.js";import{c as O}from"./chunk-AWWI2VYF.js";import"./chunk-ML7GYWXD.js";import"./chunk-FSRSK4LY.js";import"./chunk-5CEAO2OT.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 Ve}from"./chunk-2URQKGWU.js";import"./chunk-4JLGLPWV.js";import{a as He}from"./chunk-EA2JKR5D.js";import{a as Ke}from"./chunk-66UGPQVC.js";import"./chunk-3Q2P62UR.js";import{a as Ge}from"./chunk-PD6WIDY6.js";import{W as je}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as le}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as de}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as Pe}from"./chunk-U6XZFNKM.js";import{a as Ue}from"./chunk-ULIQFBZU.js";import"./chunk-XFXYDKOW.js";import"./chunk-35DM4JJG.js";import{a as F}from"./chunk-4ZEL6BYL.js";import{c as Me}from"./chunk-AWWI2VYF.js";import{f as We}from"./chunk-ML7GYWXD.js";import"./chunk-FSRSK4LY.js";import"./chunk-5CEAO2OT.js";import{a as ie}from"./chunk-FKVZRPV5.js";import{a as _e,b as Be,c as ke,d as G,e as C,f as w}from"./chunk-HEAQVSNS.js";import{a as Te,e as De}from"./chunk-WUWBZPUK.js";import{d as $,f as ue,g as ce,h as me,o as he,r as ze}from"./chunk-FODLDLE2.js";import{a as h,d as Ee,e as rt,f as nt,g as ot}from"./chunk-YKXDMIHQ.js";var W=Ee(nt(),1);var A=Ee(rt(),1);var t=Ee(ot(),1);var dt=h((n,e)=>{let a=new Set(n.map(s=>s.deadLetterQueue).filter(s=>typeof s=="string"&&s!=="")),i=n.filter(s=>(s.deadLetterQueue===void 0||s.deadLetterQueue==="")&&!a.has(s.name)),d=e.filter(s=>s.deadLettered).length;return{deadLetteredCount:d,queuesWithoutDlq:i,showReliabilityWarning:i.length>0||d>0}},"rt"),lt=200,it=ue(F.sendQueueMessage),ut=ue(F.replayQueueMessage),ct=ue(F.clearQueueMessages),Xe=96,mt=h(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n)}catch{return"[unserializable]"}},"it"),ht=h(n=>n.length>Xe?`${n.slice(0,Xe)}\u2026`:n,"ct"),pt=h(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","ut"),gt=h((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"mt"),ft=h(n=>{let e=(0,W.c)(11),{loaded:a,queues:i}=n,d=$(),s;e[0]!==d?(s=d("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[0]=d,e[1]=s):s=e[1];let o;e[2]!==s?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i||e[6]!==d?(r=a&&i.length===0?(0,t.jsx)(ie,{description:d("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:d("No queues defined")}):(0,t.jsx)(Te,{className:"overflow-hidden py-0",children:(0,t.jsx)(De,{className:"px-0",children:(0,t.jsxs)(_e,{"data-testid":"queues-table",children:[(0,t.jsx)(Be,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:d("Export")}),(0,t.jsx)(C,{children:d("Queue")}),(0,t.jsx)(C,{children:d("Mode")}),(0,t.jsx)(C,{children:d("Binding")}),(0,t.jsx)(C,{children:d("Dead-letter")})]})}),(0,t.jsx)(ke,{children:i.map(bt)})]})})}),e[4]=a,e[5]=i,e[6]=d,e[7]=r):r=e[7];let p;return e[8]!==o||e[9]!==r?(p=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[o,r]}),e[8]=o,e[9]=r,e[10]=p):p=e[10],p},"ft"),xt=h(n=>{let e=(0,W.c)(67),{message:a,onReplay:i,replayingId:d}=n,s=$(),o,r,p,c,x,N,y,l,m,f;if(e[0]!==a.attempts||e[1]!==a.body||e[2]!==a.deadLettered||e[3]!==a.exportName||e[4]!==a.id||e[5]!==a.messageId||e[6]!==a.outcome||e[7]!==a.queue||e[8]!==s){let j=mt(a.body);r=G,N=`queues-message-${a.id}`;let z=a.exportName??a.queue;e[19]!==z?(y=(0,t.jsx)(w,{className:"font-mono text-xs",children:z}),e[19]=z,e[20]=y):y=e[20],e[21]!==a.messageId?(l=(0,t.jsx)(w,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:a.messageId,children:a.messageId}),e[21]=a.messageId,e[22]=l):l=e[22],e[23]!==a.attempts?(m=(0,t.jsx)(w,{className:"font-mono text-xs tabular-nums",children:a.attempts}),e[23]=a.attempts,e[24]=m):m=e[24];let T=`queues-outcome-${a.id}`,D;e[25]!==a.outcome?(D=pt(a.outcome),e[25]=a.outcome,e[26]=D):D=e[26];let I;e[27]!==a.outcome||e[28]!==T||e[29]!==D?(I=(0,t.jsx)(de,{"data-testid":T,variant:D,children:a.outcome}),e[27]=a.outcome,e[28]=T,e[29]=D,e[30]=I):I=e[30];let M;e[31]!==a.deadLettered||e[32]!==a.id||e[33]!==s?(M=a.deadLettered&&(0,t.jsx)(de,{"data-testid":`queues-dlq-${a.id}`,variant:"destructive",children:s("DLQ")}),e[31]=a.deadLettered,e[32]=a.id,e[33]=s,e[34]=M):M=e[34],e[35]!==I||e[36]!==M?(f=(0,t.jsx)(w,{children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[I,M]})}),e[35]=I,e[36]=M,e[37]=f):f=e[37],o=w,p="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",c=j,x=ht(j),e[0]=a.attempts,e[1]=a.body,e[2]=a.deadLettered,e[3]=a.exportName,e[4]=a.id,e[5]=a.messageId,e[6]=a.outcome,e[7]=a.queue,e[8]=s,e[9]=o,e[10]=r,e[11]=p,e[12]=c,e[13]=x,e[14]=N,e[15]=y,e[16]=l,e[17]=m,e[18]=f}else o=e[9],r=e[10],p=e[11],c=e[12],x=e[13],N=e[14],y=e[15],l=e[16],m=e[17],f=e[18];let g;e[38]!==o||e[39]!==p||e[40]!==c||e[41]!==x?(g=(0,t.jsx)(o,{className:p,title:c,children:x}),e[38]=o,e[39]=p,e[40]=c,e[41]=x,e[42]=g):g=e[42];let q;e[43]!==a.capturedAt?(q=ze(a.capturedAt,"\u2014"),e[43]=a.capturedAt,e[44]=q):q=e[44];let b;e[45]!==q?(b=(0,t.jsx)(w,{className:"text-xs text-muted-foreground tabular-nums",children:q}),e[45]=q,e[46]=b):b=e[46];let S=`queues-replay-${a.id}`,E=d!==null,Q;e[47]!==a.id||e[48]!==d||e[49]!==s?(Q=d===a.id?s("Replaying\u2026"):s("Replay"),e[47]=a.id,e[48]=d,e[49]=s,e[50]=Q):Q=e[50];let L;e[51]!==a.id||e[52]!==i||e[53]!==S||e[54]!==E||e[55]!==Q?(L=(0,t.jsx)(w,{children:(0,t.jsx)(le,{"data-id":a.id,"data-testid":S,disabled:E,onClick:i,size:"xs",type:"button",variant:"outline",children:Q})}),e[51]=a.id,e[52]=i,e[53]=S,e[54]=E,e[55]=Q,e[56]=L):L=e[56];let _;return e[57]!==r||e[58]!==b||e[59]!==L||e[60]!==N||e[61]!==y||e[62]!==l||e[63]!==m||e[64]!==f||e[65]!==g?(_=(0,t.jsxs)(r,{"data-testid":N,children:[y,l,m,f,g,b,L]}),e[57]=r,e[58]=b,e[59]=L,e[60]=N,e[61]=y,e[62]=l,e[63]=m,e[64]=f,e[65]=g,e[66]=_):_=e[66],_},"ht"),yt=h(n=>{let e=(0,W.c)(29),{hasError:a,messages:i,onClear:d,onReplay:s,replayingId:o}=n,r=$(),p;e[0]!==r?(p=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=p):p=e[1];let c;e[2]!==p?(c=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p}),e[2]=p,e[3]=c):c=e[3];let x;e[4]!==r?(x=r("Clear the whole message log?"),e[4]=r,e[5]=x):x=e[5];let N=i.length===0,y;e[6]!==r?(y=r("Clear log"),e[6]=r,e[7]=y):y=e[7];let l;e[8]!==d||e[9]!==x||e[10]!==N||e[11]!==y?(l=(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(Ge,{confirmLabel:x,disabled:N,onConfirm:d,testId:"queues-clear",children:y})}),e[8]=d,e[9]=x,e[10]=N,e[11]=y,e[12]=l):l=e[12];let m;e[13]!==i.length||e[14]!==r?(m=i.length>0&&(0,t.jsx)(de,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:i.length})}),e[13]=i.length,e[14]=r,e[15]=m):m=e[15];let f;e[16]!==c||e[17]!==l||e[18]!==m?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,l,m]}),e[16]=c,e[17]=l,e[18]=m,e[19]=f):f=e[19];let g;e[20]!==a||e[21]!==i||e[22]!==s||e[23]!==o||e[24]!==r?(g=!a&&i.length===0?(0,t.jsx)(ie,{description:r("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:r("No consumed messages yet.")}):(0,t.jsx)(Te,{className:"overflow-hidden py-0",children:(0,t.jsx)(De,{className:"px-0",children:(0,t.jsx)(Ve,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxs)(_e,{"data-testid":"queues-messages-table",children:[(0,t.jsx)(Be,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:r("Export")}),(0,t.jsx)(C,{children:r("Message")}),(0,t.jsx)(C,{children:r("Attempts")}),(0,t.jsx)(C,{children:r("Outcome")}),(0,t.jsx)(C,{children:r("Body")}),(0,t.jsx)(C,{children:r("Captured")}),(0,t.jsx)(C,{})]})}),(0,t.jsx)(ke,{children:i.map(b=>(0,t.jsx)(xt,{message:b,onReplay:s,replayingId:o},b.id))})]})})})}),e[20]=a,e[21]=i,e[22]=s,e[23]=o,e[24]=r,e[25]=g):g=e[25];let q;return e[26]!==f||e[27]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[f,g]}),e[26]=f,e[27]=g,e[28]=q):q=e[28],q},"pt"),Nt=h(n=>{let e=(0,W.c)(20),{batchMode:a,bodyText:i,delayText:d,onBatchModeChange:s,onBodyChange:o,onDelayChange:r,onSelectExport:p,onSend:c,queues:x,selectedExportName:N,sending:y}=n,l=$(),m;e[0]!==l?(m=l("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=l,e[1]=m):m=e[1];let f;e[2]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==a||e[5]!==i||e[6]!==d||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==p||e[11]!==c||e[12]!==x||e[13]!==N||e[14]!==y||e[15]!==l?(g=x.length===0?(0,t.jsx)(ie,{description:l("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:l("No queues to send to")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":l("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:p,value:N,children:x.map(qt)}),(0,t.jsx)(je,{"aria-label":l("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:l("Delay (s)"),type:"number",value:d}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsx)("input",{checked:a,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:s,type:"checkbox"}),l("Send as batch (JSON array)")]}),(0,t.jsx)(le,{className:"ml-auto","data-testid":"queues-send-button",disabled:y||N==="",onClick:c,type:"button",children:l(y?"Sending\u2026":"Send message")})]}),(0,t.jsx)(He,{"aria-label":l("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:o,placeholder:a?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:i})]}),e[4]=a,e[5]=i,e[6]=d,e[7]=s,e[8]=o,e[9]=r,e[10]=p,e[11]=c,e[12]=x,e[13]=N,e[14]=y,e[15]=l,e[16]=g):g=e[16];let q;return e[17]!==f||e[18]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[f,g]}),e[17]=f,e[18]=g,e[19]=q):q=e[19],q},"gt"),Ft=h(n=>{let e=(0,W.c)(59),{limit:a}=n,i=a??lt,d=We(),s=$(),[o,r]=(0,A.useState)("declared"),[p,c]=(0,A.useState)(null),x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];let{data:N,error:y,errorSource:l}=Me(F.listQueues,x),m;e[1]!==i?(m={limit:i},e[1]=i,e[2]=m):m=e[2];let{data:f,error:g,errorSource:q,refetch:b}=Me(F.getQueueMessages,m),S=Array.isArray(N?.queues)?[...N.queues].toSorted(vt):[],E=f?.entries??[],{deadLetteredCount:Q,queuesWithoutDlq:L,showReliabilityWarning:_}=dt(S,E),[j,z]=(0,A.useState)(""),[T,D]=(0,A.useState)(""),[I,M]=(0,A.useState)(""),[U,Ye]=(0,A.useState)(!1),[pe,Oe]=(0,A.useState)(!1),[ge,Re]=(0,A.useState)(null),H=S.some(u=>u.exportName===j)?j:S[0]?.exportName??"",Je=o==="messages"?g:y,Ze=o==="messages"?q:l,fe=Je??p,xe=Je===null?p:Ze,K;e[3]!==b?(K=h(()=>{b()},"H"),e[3]=b,e[4]=K):K=e[4],Ke(K,o==="messages");let ye=h(async()=>{c(null);let u=H;if(u==="")return;let v=null,$e=T.trim();if($e!=="")try{v=JSON.parse($e)}catch{c(s("Body must be valid JSON."));return}let Ae,Fe=I.trim();if(Fe!==""){let P=Number(Fe);if(!Number.isFinite(P)||P<0){c(s("Delay must be a non-negative number of seconds."));return}Ae=P}if(U&&!Array.isArray(v)){c(s("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let st=U?{batch:v,delaySeconds:Ae,exportName:u}:{body:v,delaySeconds:Ae,exportName:u};try{await d.query(it,st,ce("")),b()}catch(P){c(me(P))}Oe(!1)},"ue"),V;e[5]!==d||e[6]!==b?(V=h(async u=>{c(null),Re(u);try{await d.query(ut,{id:u},ce("")),b()}catch(v){c(me(v))}Re(null)},"V"),e[5]=d,e[6]=b,e[7]=V):V=e[7];let Ne=V,X;e[8]!==d||e[9]!==b?(X=h(async()=>{c(null);try{await d.query(ct,{},ce("")),b()}catch(u){c(me(u))}},"Y"),e[8]=d,e[9]=b,e[10]=X):X=e[10];let be=X,Y;e[11]===Symbol.for("react.memo_cache_sentinel")?(Y=h(u=>{let v=u.currentTarget.dataset.tab;(v==="declared"||v==="messages"||v==="send")&&r(v)},"X"),e[11]=Y):Y=e[11];let et=Y,Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=h(u=>{z(u.currentTarget.value)},"K"),e[12]=Z):Z=e[12];let qe=Z,ee;e[13]===Symbol.for("react.memo_cache_sentinel")?(ee=h(u=>{D(u.currentTarget.value)},"Z"),e[13]=ee):ee=e[13];let ve=ee,te;e[14]===Symbol.for("react.memo_cache_sentinel")?(te=h(u=>{M(u.currentTarget.value)},"ee"),e[14]=te):te=e[14];let Se=te,ae;e[15]===Symbol.for("react.memo_cache_sentinel")?(ae=h(u=>{Ye(u.currentTarget.checked)},"te"),e[15]=ae):ae=e[15];let Ce=ae,se;e[16]!==ye?(se=h(()=>{he(ye())},"se"),e[16]=ye,e[17]=se):se=e[17];let we=se,re;e[18]!==Ne?(re=h(u=>{let{id:v}=u.currentTarget.dataset;v!==void 0&&he(Ne(v))},"ae"),e[18]=Ne,e[19]=re):re=e[19];let Ie=re,ne;e[20]!==be?(ne=h(()=>{he(be())},"re"),e[20]=be,e[21]=ne):ne=e[21];let Qe=ne,tt="flex flex-col gap-6",at="lunora-queues-panel",B;e[22]!==s||e[23]!==o?(B=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(u=>(0,t.jsx)(le,{"aria-selected":o===u,"data-tab":u,"data-testid":`queues-tab-${u}`,onClick:et,role:"tab",size:"sm",type:"button",variant:o===u?"secondary":"ghost",children:gt(u,s)},u))}),e[22]=s,e[23]=o,e[24]=B):B=e[24];let k;e[25]!==fe||e[26]!==xe?(k=fe!==null&&(0,t.jsx)(Pe,{error:xe,testId:"queues-error"}),e[25]=fe,e[26]=xe,e[27]=k):k=e[27];let Le=_&&(0,t.jsx)(Ue,{icon:(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[L.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-medium",children:s("No dead-letter queue on {queues}.",{queues:L.map(St).join(", ")})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),Q>0&&(0,t.jsx)("p",{className:L.length>0?"text-muted-foreground":"font-medium",children:Q===1?s("1 message was recently dead-lettered."):s("{count} messages were recently dead-lettered.",{count:Q})})]})}),O;e[28]!==S||e[29]!==N||e[30]!==o?(O=o==="declared"&&(0,t.jsx)(ft,{loaded:N!==void 0,queues:S}),e[28]=S,e[29]=N,e[30]=o,e[31]=O):O=e[31];let R;e[32]!==E||e[33]!==g||e[34]!==Qe||e[35]!==Ie||e[36]!==ge||e[37]!==o?(R=o==="messages"&&(0,t.jsx)(yt,{hasError:g!==null,messages:E,onClear:Qe,onReplay:Ie,replayingId:ge}),e[32]=E,e[33]=g,e[34]=Qe,e[35]=Ie,e[36]=ge,e[37]=o,e[38]=R):R=e[38];let J;e[39]!==U||e[40]!==T||e[41]!==I||e[42]!==Ce||e[43]!==ve||e[44]!==Se||e[45]!==qe||e[46]!==we||e[47]!==S||e[48]!==H||e[49]!==pe||e[50]!==o?(J=o==="send"&&(0,t.jsx)(Nt,{batchMode:U,bodyText:T,delayText:I,onBatchModeChange:Ce,onBodyChange:ve,onDelayChange:Se,onSelectExport:qe,onSend:we,queues:S,selectedExportName:H,sending:pe}),e[39]=U,e[40]=T,e[41]=I,e[42]=Ce,e[43]=ve,e[44]=Se,e[45]=qe,e[46]=we,e[47]=S,e[48]=H,e[49]=pe,e[50]=o,e[51]=J):J=e[51];let oe;return e[52]!==B||e[53]!==k||e[54]!==Le||e[55]!==O||e[56]!==R||e[57]!==J?(oe=(0,t.jsxs)("div",{className:tt,"data-testid":at,children:[B,k,Le,O,R,J]}),e[52]=B,e[53]=k,e[54]=Le,e[55]=O,e[56]=R,e[57]=J,e[58]=oe):oe=e[58],oe},"Ft");function bt(n){return(0,t.jsxs)(G,{"data-testid":`queues-row-${n.exportName}`,children:[(0,t.jsx)(w,{className:"font-mono text-xs",children:n.exportName}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.name}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.mode}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.binding}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.deadLetterQueue??"\u2014"})]},n.exportName)}h(bt,"xt");function qt(n){return(0,t.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}h(qt,"yt");function vt(n,e){return n.exportName.localeCompare(e.exportName)}h(vt,"bt");function St(n){return n.name}h(St,"Nt");export{Ft as default};
@@ -0,0 +1 @@
1
+ import{b as h}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as A}from"./chunk-AWWI2VYF.js";import{f as k}from"./chunk-ML7GYWXD.js";import"./chunk-FSRSK4LY.js";import"./chunk-5CEAO2OT.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{d as E}from"./chunk-225VJ77I.js";import{a as n,d as b,e as h}from"./chunk-YKXDMIHQ.js";var y=b(h(),1);var T=n(()=>{},"noop"),K=typeof document<"u"?y.useLayoutEffect:T;var W=b(h(),1),l={...W};var a=l.useInsertionEffect,_=a&&a!==l.useLayoutEffect?a:t=>t();function q(t){let e=E(B).current;return e.next=t,_(e.effect),e.trampoline}n(q,"useStableCallback");function B(){let t={next:void 0,callback:O,trampoline:n((...e)=>t.callback?.(...e),"trampoline"),effect:n(()=>{t.callback=t.next},"effect")};return t}n(B,"createStableCallback");function O(){}n(O,"assertNotCalled");function s(){return typeof window<"u"}n(s,"hasWindow");function m(t){return N(t)?(t.nodeName||"").toLowerCase():"#document"}n(m,"getNodeName");function c(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}n(c,"getWindow");function V(t){var e;return(e=(N(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}n(V,"getDocumentElement");function N(t){return s()?t instanceof Node||t instanceof c(t).Node:!1}n(N,"isNode");function C(t){return s()?t instanceof Element||t instanceof c(t).Element:!1}n(C,"isElement");function L(t){return s()?t instanceof HTMLElement||t instanceof c(t).HTMLElement:!1}n(L,"isHTMLElement");function g(t){return!s()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof c(t).ShadowRoot}n(g,"isShadowRoot");function R(t){let{overflow:e,overflowX:i,overflowY:u,display:o}=v(t);return/auto|scroll|overlay|hidden|clip/.test(e+u+i)&&o!=="inline"&&o!=="contents"}n(R,"isOverflowElement");function J(t){return/^(table|td|th)$/.test(m(t))}n(J,"isTableElement");function $(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}n($,"isTopLayer");var A=/transform|translate|scale|rotate|perspective|filter/,H=/paint|layout|strict|content/,r=n(t=>!!t&&t!=="none","isNotNone"),d;function I(t){let e=C(t)?v(t):t;return r(e.transform)||r(e.translate)||r(e.scale)||r(e.rotate)||r(e.perspective)||!M()&&(r(e.backdropFilter)||r(e.filter))||A.test(e.willChange||"")||H.test(e.contain||"")}n(I,"isContainingBlock");function Q(t){let e=p(t);for(;L(e)&&!k(e);){if(I(e))return e;if($(e))return null;e=p(e)}return null}n(Q,"getContainingBlock");function M(){return d==null&&(d=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),d}n(M,"isWebKit");function k(t){return/^(html|body|#document)$/.test(m(t))}n(k,"isLastTraversableNode");function v(t){return c(t).getComputedStyle(t)}n(v,"getComputedStyle");function Z(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}n(Z,"getNodeScroll");function p(t){if(m(t)==="html")return t;let e=t.assignedSlot||t.parentNode||g(t)&&t.host||V(t);return g(e)?e.host:e}n(p,"getParentNode");function D(t){let e=p(t);return k(e)?(t.ownerDocument||t).body:L(e)&&R(e)?e:D(e)}n(D,"getNearestOverflowAncestor");function S(t,e,i){var u;e===void 0&&(e=[]),i===void 0&&(i=!0);let o=D(t),x=o===((u=t.ownerDocument)==null?void 0:u.body),f=c(o);if(x){let w=F(f);return e.concat(f,f.visualViewport||[],R(o)?o:[],w&&i?S(w):[])}else return e.concat(o,S(o,[],i))}n(S,"getOverflowAncestors");function F(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}n(F,"getFrameElement");function nt(t){return t?.ownerDocument||document}n(nt,"ownerDocument");export{K as a,l as b,q as c,m as d,c as e,V as f,N as g,C as h,L as i,g as j,R as k,J as l,$ as m,I as n,Q as o,M as p,k as q,v as r,Z as s,p as t,S as u,F as v,nt as w};
@@ -0,0 +1 @@
1
+ var i={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},e={...i,position:"fixed",top:0,left:0},t={...i,position:"absolute"};export{e as a,t as b};
@@ -0,0 +1 @@
1
+ import{a as q}from"./chunk-XMCWOQ4I.js";import{a as k}from"./chunk-GGPSI4ZR.js";import"./chunk-4GTO7FL5.js";import"./chunk-RAQNNV2D.js";import"./chunk-5JDWLCSH.js";import"./chunk-EVTM6Q43.js";import{a as A}from"./chunk-S3CRZLGS.js";import{a as $}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-6D6Z2KXU.js";import"./chunk-OKG3HWSJ.js";import"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import"./chunk-AAVLPU5Q.js";import{b as K}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as F}from"./chunk-U6XZFNKM.js";import"./chunk-ULIQFBZU.js";import"./chunk-XFXYDKOW.js";import"./chunk-35DM4JJG.js";import{a as T}from"./chunk-4ZEL6BYL.js";import{c as S}from"./chunk-AWWI2VYF.js";import"./chunk-ML7GYWXD.js";import"./chunk-FSRSK4LY.js";import"./chunk-5CEAO2OT.js";import{a as O}from"./chunk-FKVZRPV5.js";import{a as j,e as w}from"./chunk-WUWBZPUK.js";import{d as I,r as E}from"./chunk-FODLDLE2.js";import{a as p,d as C,f as D,g as H}from"./chunk-YKXDMIHQ.js";var M=C(D(),1);var m=C(H(),1);var L=p(s=>s.length===0?void 0:{max:Math.max(...s),mean:s.reduce((e,t)=>e+t,0)/s.length,min:Math.min(...s)},"F"),B=/^gen_ai\.evaluation\.(.+)\.score$/u,P=p(s=>{let e=[];for(let t of s)for(let n of t.spans)for(let[a,l]of Object.entries(n.attributes??{})){let o=B.exec(a);if(!o||typeof l!="number")continue;let i=o[1],c=n.attributes?.[`gen_ai.evaluation.${i}.label`];e.push({...typeof c=="string"?{label:c}:{},name:i,score:l,spanName:n.name,startTs:t.startTs+n.offsetMs,traceId:t.traceId})}return e.toSorted((t,n)=>n.startTs-t.startTs)},"q"),Q=p(s=>{let e=[];for(let t of s?.series??[]){let n=B.exec(t.name);n&&e.push({name:n[1],points:t.points})}return e},"D"),R=p((s,e)=>{let t=new Set([...s.map(a=>a.name),...e.map(a=>a.name)]),n=[];for(let a of t){let l=s.filter(r=>r.name===a),o=e.find(r=>r.name===a)?.points??[],i=o.at(-1)?.last??l[0]?.score,c=o.length>0?{max:Math.max(...o.map(r=>r.max)),mean:o.reduce((r,d)=>r+d.sum,0)/o.reduce((r,d)=>r+d.count,0),min:Math.min(...o.map(r=>r.min))}:L(l.map(r=>r.score));n.push({...i===void 0?{}:{latest:i},...c,name:a,points:o,runs:l})}return n.toSorted((a,l)=>a.name.localeCompare(l.name))},"H"),U=p(s=>Array.isArray(s?.traces)?s.traces:[],"L"),N=p(s=>s===void 0?"\u2014":s.toFixed(2),"y"),z=p(s=>{let e=(0,M.c)(34),{card:t,onOpenTrace:n}=s,a=I(),l;e[0]!==t.name?(l=(0,m.jsx)("h3",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"ev-name",children:t.name}),e[0]=t.name,e[1]=l):l=e[1];let o;e[2]!==t.latest?(o=N(t.latest),e[2]=t.latest,e[3]=o):o=e[3];let i;e[4]!==o?(i=(0,m.jsx)("span",{className:"font-mono text-lg text-foreground","data-testid":"ev-latest",children:o}),e[4]=o,e[5]=i):i=e[5];let c;e[6]!==l||e[7]!==i?(c=(0,m.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[l,i]}),e[6]=l,e[7]=i,e[8]=c):c=e[8];let r;e[9]!==t.max||e[10]!==t.mean||e[11]!==t.min||e[12]!==a?(r=a("min {min} \xB7 mean {mean} \xB7 max {max}",{max:N(t.max),mean:N(t.mean),min:N(t.min)}),e[9]=t.max,e[10]=t.mean,e[11]=t.min,e[12]=a,e[13]=r):r=e[13];let d;e[14]!==r?(d=(0,m.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"ev-summary",children:r}),e[14]=r,e[15]=d):d=e[15];let u;e[16]!==t.name||e[17]!==t.points||e[18]!==a?(u=t.points.length>1?(0,m.jsx)(q,{ariaLabel:a("Score trend for {name}",{name:t.name}),className:"h-10 w-full",series:t.points.map(G),testId:"ev-trend"}):(0,m.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ev-no-trend",children:a("No durable history yet \u2014 pass ctx.metrics to recordEvaluation to chart a trend.")}),e[16]=t.name,e[17]=t.points,e[18]=a,e[19]=u):u=e[19];let h;if(e[20]!==t.runs||e[21]!==n||e[22]!==a){let v;e[24]!==n||e[25]!==a?(v=p(f=>(0,m.jsxs)("div",{className:"flex items-center justify-between gap-2 font-mono text-xs","data-testid":"ev-run",children:[(0,m.jsxs)("span",{className:"truncate text-muted-foreground",children:[E(f.startTs)," \xB7 ",f.spanName]}),(0,m.jsxs)("span",{className:"flex items-center gap-2",children:[f.label===void 0?null:(0,m.jsx)(K,{variant:"outline",children:f.label}),(0,m.jsx)("span",{className:"text-foreground",children:N(f.score)}),n===void 0?null:(0,m.jsx)("button",{className:"text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{n(f.traceId)},"onClick"),title:a("Open the trace {trace}",{trace:f.traceId}),type:"button",children:f.traceId.slice(0,8)})]})]},`${f.traceId}:${f.spanName}`),"x"),e[24]=n,e[25]=a,e[26]=v):v=e[26],h=t.runs.slice(0,5).map(v),e[20]=t.runs,e[21]=n,e[22]=a,e[23]=h}else h=e[23];let x;e[27]!==h?(x=(0,m.jsx)("div",{className:"flex flex-col gap-1",children:h}),e[27]=h,e[28]=x):x=e[28];let g;return e[29]!==c||e[30]!==d||e[31]!==u||e[32]!==x?(g=(0,m.jsx)(j,{"data-testid":"ev-card",children:(0,m.jsxs)(w,{className:"flex flex-col gap-3 p-4",children:[c,d,u,x]})}),e[29]=c,e[30]=d,e[31]=u,e[32]=x,e[33]=g):g=e[33],g},"P"),oe=p(s=>{let e=(0,M.c)(19),{initialShardKey:t}=s,n=I(),{queryShardKey:a,setShardKey:l,shardKey:o}=A(t),i=k(a),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let r;e[1]!==a?(r={live:!0,shardKey:a},e[1]=a,e[2]=r):r=e[2];let{data:d,error:u}=S(T.getTraces,c,r),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={},e[3]=h):h=e[3];let x;e[4]!==a?(x={live:!0,shardKey:a},e[4]=a,e[5]=x):x=e[5];let{data:g}=S(T.getMetricHistory,h,x),v;if(e[6]!==d||e[7]!==u||e[8]!==g||e[9]!==i||e[10]!==l||e[11]!==o||e[12]!==n){let f=R(P(U(d)),Q(g)),y;e[14]!==l||e[15]!==o?(y=(0,m.jsx)($,{onChange:l,testId:"ev-shard-input",value:o}),e[14]=l,e[15]=o,e[16]=y):y=e[16];let b;e[17]!==u?(b=u===null?null:(0,m.jsx)(F,{error:u,testId:"ev-error"}),e[17]=u,e[18]=b):b=e[18],v=(0,m.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ev-panel",children:[y,b,f.length===0?(0,m.jsx)(O,{description:n("Call recordEvaluation from a graded run and its score shows up here."),testId:"ev-empty",title:n("No evals recorded")}):(0,m.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(_=>(0,m.jsx)(z,{card:_,onOpenTrace:i},_.name))})]}),e[6]=d,e[7]=u,e[8]=g,e[9]=i,e[10]=l,e[11]=o,e[12]=n,e[13]=v}else v=e[13];return v},"re");function G(s){return s.last}p(G,"Q");export{oe as default};
@@ -0,0 +1 @@
1
+ import{b as j,c as v,d as D,f as g}from"./chunk-ML7GYWXD.js";import{f as S,g as w,h as P,o as q}from"./chunk-FODLDLE2.js";import{a as i,d as A,e as x,f as M}from"./chunk-YKXDMIHQ.js";var E=A(M(),1);var p=A(x(),1);var I=300,l=i(t=>typeof t=="string"?t===""?void 0:t:typeof t=="number"||typeof t=="boolean"?String(t):void 0,"a"),u=i(t=>t.filter(r=>r!==void 0).join(" "),"c"),T=i(t=>{let r=Array.isArray(t.filters)?t.filters.length:0,e=typeof t.search=="string"&&t.search!=="";return r===0&&!e?"no predicate":u([r===0?void 0:`${String(r)} filters`,e?"search":void 0])},"q"),N={clearTable:i(t=>u([l(t.table),"whole table"]),"clearTable"),deleteRows:i(t=>u([l(t.table),T(t)]),"deleteRows"),facetColumn:i(t=>u([l(t.table),l(t.column)]),"facetColumn"),importShard:i(t=>{if(!Array.isArray(t.rows))return"";let r=[...new Set(t.rows.filter(e=>typeof e=="object"&&e!==null).map(e=>e.table).filter(e=>typeof e=="string"))].toSorted((e,s)=>e.localeCompare(s));return u([`${String(t.rows.length)} rows`,r.length===0?void 0:`into ${r.join(", ")}`])},"importShard"),lintSql:i(()=>"sql","lintSql"),patchRows:i(t=>u([l(t.table),typeof t.doc=="object"&&t.doc!==null?`set ${Object.keys(t.doc).join(", ")}`:void 0,T(t)]),"patchRows"),pitrRestore:i(t=>u([l(t.time)===void 0?void 0:`to ${String(t.time)}`,typeof t.bookmark=="string"&&t.bookmark!==""?"from bookmark":void 0,t.restart===!0?"restart now":void 0]),"pitrRestore"),readTablePage:i(t=>u([l(t.table),Array.isArray(t.filters)&&t.filters.length>0?`${String(t.filters.length)} filters`:void 0,typeof t.search=="string"&&t.search!==""?"search":void 0,typeof t.limit=="number"?`limit ${String(t.limit)}`:void 0]),"readTablePage"),runMigration:i(t=>u([l(t.id),l(t.direction),t.dryRun===!0?"dry-run":void 0]),"runMigration"),runSql:i(t=>typeof t.sql=="string"?`${String(t.sql.length)} chars`:"","runSql"),schemaVersion:i(t=>typeof t.hash=="string"?t.hash.slice(0,8):"","schemaVersion"),writeRow:i(t=>u([l(t.table),"1 row"]),"writeRow")},$="__lunora_admin__:",F=i((t,r)=>{let e=t.startsWith($)?t.slice($.length):t,s=N[e];if(s!==void 0)return s(r);let n=Object.keys(r);return n.length===0?"":n.join(", ")},"M"),V=i(t=>{if(Array.isArray(t))return t.length;if(!(typeof t!="object"||t===null)){for(let r of Object.values(t))if(Array.isArray(r))return r.length}},"K"),k=class{static{i(this,"x")}entries=[];listeners=new Set;nextSeq=1;getSnapshot=i(()=>this.entries,"getSnapshot");subscribe=i(r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}),"subscribe");start(r,e,s){return this.append(r,e,s,"call","pending")}startSubscription(r,e,s){return this.append(r,e,s,"subscription","live")}recordPush(r){if(this.listeners.size===0){let e=this.entries.find(s=>s.seq===r);e!==void 0&&(e.pushes=(e.pushes??0)+1);return}this.patch(r,e=>({...e,pushes:(e.pushes??0)+1}))}failSubscription(r,e){this.patch(r,s=>({...s,error:e,status:"error"}))}endSubscription(r){this.patch(r,e=>e.status==="error"?e:{...e,durationMs:Date.now()-e.startedAt,status:"closed"})}lastErrorSeq(){return this.entries.findLast(r=>r.status==="error")?.seq}settle(r,e){this.patch(r,s=>({...s,durationMs:Date.now()-s.startedAt,...e.error===void 0?{resultCount:V(e.result),status:"ok"}:{error:e.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(r,e,s,n,a){let d=this.nextSeq;this.nextSeq+=1;let c={functionPath:r,kind:n,seq:d,shardKey:s,startedAt:Date.now(),status:a,summary:F(r,e),...n==="subscription"?{pushes:0}:{}},o=[...this.entries,c];return this.entries=o.length>I?o.slice(o.length-I):o,this.emit(),d}patch(r,e){let s=this.entries.findIndex(n=>n.seq===r);s!==-1&&(this.entries=this.entries.with(s,e(this.entries[s])),this.emit())}emit(){for(let r of this.listeners)r()}},f=new k,_=i((t,r,e)=>["lunora-admin",t,r,e.trim()],"j"),O=i((t,r)=>[...t,r],"E");function W(t,r,e={}){let s=g(),{enabled:n=!0,keepPreviousData:a=!1,staleTime:d=0}=e,c=O(t,s.clientIdentifier()),o=D({enabled:n,queryFn:r,placeholderData:a?j:void 0,queryKey:c,staleTime:d});return{data:o.data,error:o.error?P(o.error):o.error,errorSource:o.error??void 0,isLoading:o.isLoading,liveError:void 0,refetch:i(()=>{q(o.refetch())},"refetch")}}i(W,"F");function Y(t,r,e={}){let s=g(),n=v(),{enabled:a=!0,keepPreviousData:d=!1,live:c=!1,shardKey:o="",staleTime:R}=e,m=_(t,r,o),C=W(m,()=>s.query(S(t),r,w(o)),{enabled:a,keepPreviousData:d,staleTime:R??(c?Number.POSITIVE_INFINITY:0)}),[K,b]=(0,p.useState)(void 0),L=JSON.stringify(m);return(0,p.useEffect)(()=>{if(!a||!c)return;b(void 0);let y=f.startSubscription(t,r,o),Q=s.subscribe(S(t),r,h=>{f.recordPush(y),b(void 0),n.setQueryData(O(m,s.clientIdentifier()),h)},{...w(o),onError:i(h=>{f.failSubscription(y,h.message),b(h.message)},"onError")});return()=>{f.endSubscription(y),Q()}},[s,L,a,c]),{...C,liveError:a&&c?K:void 0}}i(Y,"U");var B=i(()=>{let t=(0,E.c)(2),r=v(),e;return t[0]!==r?(e=i((s,n,a)=>{let d=n===void 0?["lunora-admin",s]:_(s,n,a??"");q(r.invalidateQueries({queryKey:d}))},"r"),t[0]=r,t[1]=e):e=t[1],e},"W");export{f as a,W as b,Y as c,B as d};
@@ -0,0 +1 @@
1
+ import{a as me}from"./chunk-F7UC63UN.js";import{a as Ot,b as zt,c as At,d as Kt}from"./chunk-SUDJTC4S.js";import{a as it}from"./chunk-XMCWOQ4I.js";import{a as Dt,b as Ct,c as It,d as Ft,e as Pe}from"./chunk-IHMGCHAA.js";import{a as Tt}from"./chunk-RPQL45FL.js";import{a as Rt}from"./chunk-GGPSI4ZR.js";import"./chunk-4GTO7FL5.js";import"./chunk-4JLGLPWV.js";import{e as $t}from"./chunk-UYEZR3BI.js";import"./chunk-V3CZW3JB.js";import{a as _t}from"./chunk-BOTGXX4H.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import{a as Ee,b as et,c as tt,d as vt,e as yt,f as rt,g as at,h as Nt,i as St}from"./chunk-RAQNNV2D.js";import"./chunk-5JDWLCSH.js";import"./chunk-EVTM6Q43.js";import{a as kt}from"./chunk-S3CRZLGS.js";import{a as Mt}from"./chunk-2DX5MROH.js";import{a as wt,b as qt}from"./chunk-OGUKYRFM.js";import"./chunk-6D6Z2KXU.js";import"./chunk-OKG3HWSJ.js";import"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as Ze}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as We}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import"./chunk-35DM4JJG.js";import{a as ze}from"./chunk-4ZEL6BYL.js";import{c as Le}from"./chunk-AWWI2VYF.js";import{f as ct}from"./chunk-ML7GYWXD.js";import"./chunk-FSRSK4LY.js";import"./chunk-5CEAO2OT.js";import{a as ht}from"./chunk-FKVZRPV5.js";import{a as st,b as lt,c as nt,d as je,e as ce,f as U}from"./chunk-HEAQVSNS.js";import{a as fe,b as Ae,c as Ke,d as ut,e as pe}from"./chunk-WUWBZPUK.js";import{d as ge,f as gt,g as ft,h as pt,i as xt,l as Ge,o as bt}from"./chunk-FODLDLE2.js";import{a as o,d as Ye,e as Jt,f as Bt,g as Ht,i as mt}from"./chunk-YKXDMIHQ.js";var P=Ye(Jt(),1);var xe=Ye(Bt(),1);var t=Ye(Ht(),1);var Ut=/["\\\u0000-\u001F\uD800-\uDFFF]/,Lt=o(s=>Ut.test(s)?JSON.stringify(s):`"${s}"`,"ot"),dt=o(s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(typeof s=="number"){if(Number.isNaN(s))return"nan";if(s===1/0)return"inf";if(s===-1/0)return"-inf";if(Object.is(s,-0))return"-0"}if(typeof s=="string")return Lt(s);if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s)){let i="[";for(let n=0;n<s.length;n++)n>0&&(i+=","),i+=dt(s[n]);return i+"]"}let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let i=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${i} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let l=s,a=Object.keys(l).sort(),r="{",u=!0;for(let i of a){let n=l[i];n!==void 0&&(u?u=!1:r+=",",r+=Lt(i),r+=":",r+=dt(n))}return r+"}"},"Ze"),Pt=o((s,e,l)=>`${s}:${e}:${dt(l??{})}`,"ht"),Qt=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"gt"),Wt=o((s,e)=>Qt(s,e),"Jt"),Gt=o(s=>Qt(s.kind,s),"Vt"),ot=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"We"),Vt=o(s=>Array.isArray(s?.series)?s.series:[],"Gt"),Xt="FUNCTION_NOT_FOUND",Yt=o(s=>{let e=new Map;if(!Array.isArray(s?.series))return e;for(let l of s.series)e.set(Pt(l.kind,l.name,l.attributes),l.points);return e},"Xt"),Zt={counter:"secondary",gauge:"default",histogram:"outline"},Et=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,u=ge();if(r===void 0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=c):c=e[0],c}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let c=`mt-instrument-trace-${l}`,f;return e[3]!==n||e[4]!==c||e[5]!==r?(f=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":c,title:r,children:n}),e[3]=n,e[4]=c,e[5]=r,e[6]=f):f=e[6],f}let h=`mt-instrument-trace-${l}`,y;e[7]!==a||e[8]!==r?(y=o(()=>{a(r)},"v"),e[7]=a,e[8]=r,e[9]=y):y=e[9];let w;e[10]!==u||e[11]!==r?(w=u("Open the exemplar trace {trace}",{trace:r}),e[10]=u,e[11]=r,e[12]=w):w=e[12];let g;return e[13]!==n||e[14]!==h||e[15]!==y||e[16]!==w?(g=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":h,onClick:y,title:w,type:"button",children:n}),e[13]=n,e[14]=h,e[15]=y,e[16]=w,e[17]=g):g=e[17],g},"Zt"),er=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={},e[0]=u):u=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:h,errorSource:y}=Le(ze.getMetricSeries,u,i),w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w={},e[3]=w):w=e[3];let g;e[4]!==a?(g={live:!0,shardKey:a},e[4]=a,e[5]=g):g=e[5];let{data:c}=Le(ze.getMetricHistory,w,g),f,N,q,_,d,x,p,b,M,$,S,I,C;if(e[6]!==n||e[7]!==h||e[8]!==y||e[9]!==c||e[10]!==l||e[11]!==r){b=Symbol.for("react.early_return_sentinel");e:{let z=Vt(n),A=xt(y)===Xt;if(h!==null&&!A){let m;e[25]!==r?(m=r("Instruments"),e[25]=r,e[26]=m):m=e[26];let j;e[27]!==m?(j=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[27]=m,e[28]=j):j=e[28];let J;e[29]!==h||e[30]!==r?(J=r("Instruments unavailable: {error}",{error:h}),e[29]=h,e[30]=r,e[31]=J):J=e[31];let B;e[32]!==J?(B=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:J}),e[32]=J,e[33]=B):B=e[33];let de;e[34]!==j||e[35]!==B?(de=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[j,B]}),e[34]=j,e[35]=B,e[36]=de):de=e[36],b=de;break e}if(z.length===0){b=null;break e}let D=Yt(c),L;e[37]!==r?(L=o(m=>r(m==="counter"?"Counter":m==="gauge"?"Gauge":"Histogram"),"z"),e[37]=r,e[38]=L):L=e[38];let Q=L;d="flex flex-col gap-2",x="mt-instruments";let K;e[39]!==r?(K=r("Instruments"),e[39]=r,e[40]=K):K=e[40],e[41]!==K?(p=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:K}),e[41]=K,e[42]=p):p=e[42],_=fe,C="overflow-hidden py-0",q=pe,I="px-0",N=st,$="mt-instruments-table";let W;e[43]!==r?(W=r("name"),e[43]=r,e[44]=W):W=e[44];let G;e[45]!==W?(G=(0,t.jsx)(ce,{children:W}),e[45]=W,e[46]=G):G=e[46];let V;e[47]!==r?(V=r("kind"),e[47]=r,e[48]=V):V=e[48];let X;e[49]!==V?(X=(0,t.jsx)(ce,{children:V}),e[49]=V,e[50]=X):X=e[50];let Y;e[51]!==r?(Y=r("value"),e[51]=r,e[52]=Y):Y=e[52];let Z;e[53]!==Y?(Z=(0,t.jsx)(ce,{className:"text-right",children:Y}),e[53]=Y,e[54]=Z):Z=e[54];let E;e[55]!==r?(E=r("count"),e[55]=r,e[56]=E):E=e[56];let ee;e[57]!==E?(ee=(0,t.jsx)(ce,{className:"text-right",children:E}),e[57]=E,e[58]=ee):ee=e[58];let te;e[59]!==r?(te=r("range"),e[59]=r,e[60]=te):te=e[60];let re;e[61]!==te?(re=(0,t.jsx)(ce,{className:"text-right",children:te}),e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==r?(ae=r("trend"),e[63]=r,e[64]=ae):ae=e[64];let se;e[65]!==ae?(se=(0,t.jsx)(ce,{children:ae}),e[65]=ae,e[66]=se):se=e[66];let le;e[67]!==r?(le=r("trace"),e[67]=r,e[68]=le):le=e[68];let ne;e[69]!==le?(ne=(0,t.jsx)(ce,{children:le}),e[69]=le,e[70]=ne):ne=e[70];let ie;e[71]!==r?(ie=r("dimensions"),e[71]=r,e[72]=ie):ie=e[72];let oe;e[73]!==ie?(oe=(0,t.jsx)(ce,{children:ie}),e[73]=ie,e[74]=oe):oe=e[74],e[75]!==G||e[76]!==X||e[77]!==Z||e[78]!==ee||e[79]!==re||e[80]!==se||e[81]!==ne||e[82]!==oe?(S=(0,t.jsx)(lt,{children:(0,t.jsxs)(je,{children:[G,X,Z,ee,re,se,ne,oe]})}),e[75]=G,e[76]=X,e[77]=Z,e[78]=ee,e[79]=re,e[80]=se,e[81]=ne,e[82]=oe,e[83]=S):S=e[83],f=nt,M=z.map(m=>{let j=Tt(m.attributes),J=Pt(m.kind,m.name,m.attributes),B=(D.get(J)??[]).map(de=>Wt(m.kind,de));return(0,t.jsxs)(je,{"data-testid":`mt-instrument-${m.name}`,children:[(0,t.jsx)(U,{className:"font-mono text-xs",title:m.functionPath,children:m.name}),(0,t.jsx)(U,{children:(0,t.jsx)(We,{variant:Zt[m.kind],children:Q(m.kind)})}),(0,t.jsx)(U,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${m.name}`,children:ot(Gt(m))}),(0,t.jsx)(U,{className:"text-right tabular-nums text-muted-foreground",children:m.count.toLocaleString()}),(0,t.jsx)(U,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:m.min===m.max?"\u2014":`${ot(m.min)}\u2013${ot(m.max)}`}),(0,t.jsx)(U,{children:B.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:m.name}),className:"h-6 w-24 text-foreground",series:B,testId:`mt-instrument-trend-${m.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(U,{className:"font-mono text-xs",children:(0,t.jsx)(Et,{name:m.name,onOpenTrace:l,traceId:m.exemplarTraceId})}),(0,t.jsx)(U,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:j,children:j===""?"\u2014":j})]},J)})}e[6]=n,e[7]=h,e[8]=y,e[9]=c,e[10]=l,e[11]=r,e[12]=f,e[13]=N,e[14]=q,e[15]=_,e[16]=d,e[17]=x,e[18]=p,e[19]=b,e[20]=M,e[21]=$,e[22]=S,e[23]=I,e[24]=C}else f=e[12],N=e[13],q=e[14],_=e[15],d=e[16],x=e[17],p=e[18],b=e[19],M=e[20],$=e[21],S=e[22],I=e[23],C=e[24];if(b!==Symbol.for("react.early_return_sentinel"))return b;let F;e[84]!==f||e[85]!==M?(F=(0,t.jsx)(f,{children:M}),e[84]=f,e[85]=M,e[86]=F):F=e[86];let k;e[87]!==N||e[88]!==F||e[89]!==$||e[90]!==S?(k=(0,t.jsxs)(N,{"data-testid":$,children:[S,F]}),e[87]=N,e[88]=F,e[89]=$,e[90]=S,e[91]=k):k=e[91];let v;e[92]!==q||e[93]!==k||e[94]!==I?(v=(0,t.jsx)(q,{className:I,children:k}),e[92]=q,e[93]=k,e[94]=I,e[95]=v):v=e[95];let T;e[96]!==_||e[97]!==v||e[98]!==C?(T=(0,t.jsx)(_,{className:C,children:v}),e[96]=_,e[97]=v,e[98]=C,e[99]=T):T=e[99];let O;return e[100]!==d||e[101]!==x||e[102]!==p||e[103]!==T?(O=(0,t.jsxs)("section",{className:d,"data-testid":x,children:[p,T]}),e[100]=d,e[101]=x,e[102]=p,e[103]=T,e[104]=O):O=e[104],O},"er"),tr=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),u;e[0]!==r?(u=r("Shards"),e[0]=r,e[1]=u):u=e[1];let i;e[2]!==l.failed||e[3]!==l.reachable||e[4]!==r?(i=l.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:l.failed,reachable:l.reachable}):r("{reachable} reachable",{reachable:l.reachable}),e[2]=l.failed,e[3]=l.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==u||e[7]!==i?(n=(0,t.jsx)(me,{label:u,testId:"mt-agg-shards",value:i}),e[6]=u,e[7]=i,e[8]=n):n=e[8];let h;e[9]!==r?(h=r("Total requests"),e[9]=r,e[10]=h):h=e[10];let y;e[11]!==l.totalRequests||e[12]!==h?(y=(0,t.jsx)(me,{label:h,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=h,e[13]=y):y=e[13];let w;e[14]!==r?(w=r("Total errors"),e[14]=r,e[15]=w):w=e[15];let g;e[16]!==l.totalErrors||e[17]!==w?(g=(0,t.jsx)(me,{label:w,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=w,e[18]=g):g=e[18];let c;e[19]!==r?(c=r("Total database size"),e[19]=r,e[20]=c):c=e[20];let f;e[21]!==l.totalDatabaseSize?(f=Ge(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=f):f=e[22];let N;e[23]!==c||e[24]!==f?(N=(0,t.jsx)(me,{label:c,testId:"mt-agg-db-size",value:f}),e[23]=c,e[24]=f,e[25]=N):N=e[25];let q;e[26]!==r?(q=r("Combined cache hit rate"),e[26]=r,e[27]=q):q=e[27];let _;e[28]!==l.hitRate||e[29]!==r?(_=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=_):_=e[30];let d;e[31]!==q||e[32]!==_?(d=(0,t.jsx)(me,{label:q,testId:"mt-agg-cache",value:_}),e[31]=q,e[32]=_,e[33]=d):d=e[33];let x;e[34]!==N||e[35]!==d||e[36]!==n||e[37]!==y||e[38]!==g?(x=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,y,g,N,d]}),e[34]=N,e[35]=d,e[36]=n,e[37]=y,e[38]=g,e[39]=x):x=e[39];let p;e[40]!==r?(p=r("shard"),e[40]=r,e[41]=p):p=e[41];let b;e[42]!==p?(b=(0,t.jsx)(ce,{children:p}),e[42]=p,e[43]=b):b=e[43];let M;e[44]!==r?(M=r("requests"),e[44]=r,e[45]=M):M=e[45];let $;e[46]!==M?($=(0,t.jsx)(ce,{children:M}),e[46]=M,e[47]=$):$=e[47];let S;e[48]!==r?(S=r("errors"),e[48]=r,e[49]=S):S=e[49];let I;e[50]!==S?(I=(0,t.jsx)(ce,{children:S}),e[50]=S,e[51]=I):I=e[51];let C;e[52]!==r?(C=r("db size"),e[52]=r,e[53]=C):C=e[53];let F;e[54]!==C?(F=(0,t.jsx)(ce,{children:C}),e[54]=C,e[55]=F):F=e[55];let k;e[56]!==b||e[57]!==$||e[58]!==I||e[59]!==F?(k=(0,t.jsx)(lt,{children:(0,t.jsxs)(je,{children:[b,$,I,F]})}),e[56]=b,e[57]=$,e[58]=I,e[59]=F,e[60]=k):k=e[60];let v;if(e[61]!==a||e[62]!==r){let A;e[64]!==r?(A=o(D=>(0,t.jsxs)(je,{"data-testid":`mt-agg-row-${D.shard}`,children:[(0,t.jsx)(U,{children:D.shard}),D.metrics===null?(0,t.jsx)(U,{className:"text-destructive",colSpan:3,children:D.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(U,{className:"tabular-nums",children:D.metrics.requests}),(0,t.jsx)(U,{className:"tabular-nums",children:D.metrics.errors}),(0,t.jsx)(U,{className:"tabular-nums",children:Ge(D.metrics.databaseSize)})]})]},D.shard),"O"),e[64]=r,e[65]=A):A=e[65],v=a.map(A),e[61]=a,e[62]=r,e[63]=v}else v=e[63];let T;e[66]!==v?(T=(0,t.jsx)(nt,{children:v}),e[66]=v,e[67]=T):T=e[67];let O;e[68]!==k||e[69]!==T?(O=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(st,{"data-testid":"mt-agg-table",children:[k,T]})})}),e[68]=k,e[69]=T,e[70]=O):O=e[70];let z;return e[71]!==x||e[72]!==O?(z=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[x,O]}),e[71]=x,e[72]=O,e[73]=z):z=e[73],z},"tr"),rr=o(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return l>0?`${l.toString()}h ${a.toString()}m`:a>0?`${a.toString()}m ${r.toString()}s`:`${r.toString()}s`},"rr"),ar=o((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"sr"),jt=o(s=>s<=0?"\u2014":s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"ct"),sr=o(s=>{let e=(0,xe.c)(75),{currentDelta:l,errorRate:a,history:r,latencyPercentiles:u,metrics:i}=s,n=ge(),{cache:h}=i,y;e[0]!==r||e[1]!==n?(y=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=y):y=e[2];let w;e[3]!==l||e[4]!==r.length||e[5]!==n?(w=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${l.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=l,e[4]=r.length,e[5]=n,e[6]=w):w=e[6];let g;e[7]!==n?(g=n("Requests"),e[7]=n,e[8]=g):g=e[8];let c;e[9]!==i.requests||e[10]!==y||e[11]!==w||e[12]!==g?(c=(0,t.jsx)(me,{chart:y,footer:w,label:g,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=y,e[11]=w,e[12]=g,e[13]=c):c=e[13];let f;e[14]!==a||e[15]!==n?(f=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=f):f=e[16];let N;e[17]!==n?(N=n("Errors"),e[17]=n,e[18]=N):N=e[18];let q;e[19]!==a||e[20]!==i.errors?(q=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=q):q=e[21];let _;e[22]!==f||e[23]!==N||e[24]!==q?(_=(0,t.jsx)(me,{footer:f,label:N,testId:"mt-errors",value:q}),e[22]=f,e[23]=N,e[24]=q,e[25]=_):_=e[25];let d;e[26]!==u.p90?(d=u.p90>0?`P90 ${jt(u.p90)}`:void 0,e[26]=u.p90,e[27]=d):d=e[27];let x;e[28]!==n?(x=n("P95 latency"),e[28]=n,e[29]=x):x=e[29];let p;e[30]!==u.p95?(p=u.p95>0?jt(u.p95):"\u2014",e[30]=u.p95,e[31]=p):p=e[31];let b;e[32]!==x||e[33]!==p||e[34]!==d?(b=(0,t.jsx)(me,{footer:d,label:x,testId:"mt-p95",value:p}),e[32]=x,e[33]=p,e[34]=d,e[35]=b):b=e[35];let M;e[36]!==h||e[37]!==n?(M=h?`${h.entries.toLocaleString()} ${n("cache entries")}`:void 0,e[36]=h,e[37]=n,e[38]=M):M=e[38];let $;e[39]!==n?($=n("Database size"),e[39]=n,e[40]=$):$=e[40];let S;e[41]!==i.databaseSize?(S=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=S):S=e[42];let I;e[43]!==M||e[44]!==$||e[45]!==S?(I=(0,t.jsx)(me,{footer:M,label:$,testId:"mt-db-size",value:S}),e[43]=M,e[44]=$,e[45]=S,e[46]=I):I=e[46];let C;e[47]!==n?(C=n("Shard"),e[47]=n,e[48]=C):C=e[48];let F;e[49]!==i.shard||e[50]!==C?(F=(0,t.jsx)(me,{label:C,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=C,e[51]=F):F=e[51];let k;e[52]!==n?(k=n("Uptime"),e[52]=n,e[53]=k):k=e[53];let v;e[54]!==i.uptimeMs?(v=rr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=v):v=e[55];let T;e[56]!==k||e[57]!==v?(T=(0,t.jsx)(me,{label:k,testId:"mt-uptime",value:v}),e[56]=k,e[57]=v,e[58]=T):T=e[58];let O;e[59]!==n?(O=n("Cache hit rate"),e[59]=n,e[60]=O):O=e[60];let z;e[61]!==h||e[62]!==n?(z=h?n("{rate} ({count} entries)",{count:h.entries,rate:ar(h.hits,h.misses)}):n("no cache configured"),e[61]=h,e[62]=n,e[63]=z):z=e[63];let A;e[64]!==O||e[65]!==z?(A=(0,t.jsx)(me,{label:O,testId:"mt-cache",value:z}),e[64]=O,e[65]=z,e[66]=A):A=e[66];let D;return e[67]!==b||e[68]!==I||e[69]!==F||e[70]!==T||e[71]!==A||e[72]!==c||e[73]!==_?(D=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[c,_,b,I,F,T,A]}),e[67]=b,e[68]=I,e[69]=F,e[70]=T,e[71]=A,e[72]=c,e[73]=_,e[74]=D):D=e[74],D},"lr"),Xe=o(s=>s>=100?"critical":s>=50?"warning":"good","Ve"),Qe=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Ae"),Ve=o(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"He"),lr=o(s=>{let e=(0,xe.c)(3),{level:l}=s;if(l==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(We,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(l==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"ir"),nr=o((s,e)=>{let l=[...s];return l.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),l},"ar"),ir=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,u]=(0,P.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,h]=(0,P.useState)(i),y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=o(C=>{C!==null&&u(C)},"v"),e[1]=y):y=e[1];let w=y,g,c,f,N,q,_,d,x,p,b;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){f=Symbol.for("react.early_return_sentinel");e:{let C=nr(l,r),F;e[16]!==l?(F=l.filter(or),e[16]=l,e[17]=F):F=e[17];let k=F.length,v;e[18]!==l?(v=l.filter(dr),e[18]=l,e[19]=v):v=e[19];let T=v.length,O;e[20]!==l?(O=l.filter(cr),e[20]=l,e[21]=O):O=e[21];let z=O.length,A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=o(R=>{h(ue=>{let H=new Set(ue);return H.has(R)?H.delete(R):H.add(R),H})},"O"),e[22]=A):A=e[22];let D=A;if(l.length===0){let R;e[23]!==a?(R=a("No query insights yet"),e[23]=a,e[24]=R):R=e[24];let ue;e[25]!==R?(ue=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:R}),e[25]=R,e[26]=ue):ue=e[26];let H;e[27]!==a?(H=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=H):H=e[28];let he;e[29]!==H?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:H}),e[29]=H,e[30]=he):he=e[30];let Ue;e[31]!==ue||e[32]!==he?(Ue=(0,t.jsx)(fe,{children:(0,t.jsx)(pe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ue,he]})})}),e[31]=ue,e[32]=he,e[33]=Ue):Ue=e[33],f=Ue;break e}d="space-y-4",x="qi-root";let L;e[34]!==a?(L=a("Critical queries"),e[34]=a,e[35]=L):L=e[35];let Q;e[36]!==L?(Q=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:L})}),e[36]=L,e[37]=Q):Q=e[37];let K;e[38]!==k?(K=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:k}),e[38]=k,e[39]=K):K=e[39];let W;e[40]!==a?(W=a(">100ms avg execution"),e[40]=a,e[41]=W):W=e[41];let G;e[42]!==W?(G=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:W}),e[42]=W,e[43]=G):G=e[43];let V;e[44]!==K||e[45]!==G?(V=(0,t.jsxs)(pe,{children:[K,G]}),e[44]=K,e[45]=G,e[46]=V):V=e[46];let X;e[47]!==Q||e[48]!==V?(X=(0,t.jsxs)(fe,{children:[Q,V]}),e[47]=Q,e[48]=V,e[49]=X):X=e[49];let Y;e[50]!==a?(Y=a("Moderate queries"),e[50]=a,e[51]=Y):Y=e[51];let Z;e[52]!==Y?(Z=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:Y})}),e[52]=Y,e[53]=Z):Z=e[53];let E;e[54]!==T?(E=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:T}),e[54]=T,e[55]=E):E=e[55];let ee;e[56]!==a?(ee=a("50\u2013100ms avg execution"),e[56]=a,e[57]=ee):ee=e[57];let te;e[58]!==ee?(te=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ee}),e[58]=ee,e[59]=te):te=e[59];let re;e[60]!==E||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[E,te]}),e[60]=E,e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==Z||e[64]!==re?(ae=(0,t.jsxs)(fe,{children:[Z,re]}),e[63]=Z,e[64]=re,e[65]=ae):ae=e[65];let se;e[66]!==a?(se=a("Fast queries"),e[66]=a,e[67]=se):se=e[67];let le;e[68]!==se?(le=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==z?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:z}),e[70]=z,e[71]=ne):ne=e[71];let ie;e[72]!==a?(ie=a("<50ms avg execution"),e[72]=a,e[73]=ie):ie=e[73];let oe;e[74]!==ie?(oe=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ie}),e[74]=ie,e[75]=oe):oe=e[75];let m;e[76]!==ne||e[77]!==oe?(m=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=m):m=e[78];let j;e[79]!==le||e[80]!==m?(j=(0,t.jsxs)(fe,{children:[le,m]}),e[79]=le,e[80]=m,e[81]=j):j=e[81],e[82]!==X||e[83]!==ae||e[84]!==j?(p=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[X,ae,j]}),e[82]=X,e[83]=ae,e[84]=j,e[85]=p):p=e[85];let J;e[86]!==a?(J=a("Query leaderboard"),e[86]=a,e[87]=J):J=e[87];let B;e[88]!==J?(B=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:J}),e[88]=J,e[89]=B):B=e[89];let de;e[90]!==r||e[91]!==a?(de=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=de):de=e[92];let be;e[93]!==de?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:de}),e[93]=de,e[94]=be):be=e[94];let ve;e[95]!==B||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[B,be]}),e[95]=B,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Je;e[104]===Symbol.for("react.memo_cache_sentinel")?(Je=(0,t.jsx)(Ct,{}),e[104]=Je):Je=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(It,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Je}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let Me;e[109]!==qe?(Me=(0,t.jsx)(Pe,{value:"totalTime",children:qe}),e[109]=qe,e[110]=Me):Me=e[110];let ke;e[111]!==a?(ke=a("Avg time"),e[111]=a,e[112]=ke):ke=e[112];let _e;e[113]!==ke?(_e=(0,t.jsx)(Pe,{value:"avgTime",children:ke}),e[113]=ke,e[114]=_e):_e=e[114];let $e;e[115]!==a?($e=a("Execution count"),e[115]=a,e[116]=$e):$e=e[116];let De;e[117]!==$e?(De=(0,t.jsx)(Pe,{value:"execCount",children:$e}),e[117]=$e,e[118]=De):De=e[118];let Ce;e[119]!==a?(Ce=a("Rows read"),e[119]=a,e[120]=Ce):Ce=e[120];let Ie;e[121]!==Ce?(Ie=(0,t.jsx)(Pe,{value:"rowsRead",children:Ce}),e[121]=Ce,e[122]=Ie):Ie=e[122];let Fe;e[123]!==Me||e[124]!==_e||e[125]!==De||e[126]!==Ie?(Fe=(0,t.jsxs)(Ft,{children:[Me,_e,De,Ie]}),e[123]=Me,e[124]=_e,e[125]=De,e[126]=Ie,e[127]=Fe):Fe=e[127];let Te;e[128]!==r||e[129]!==we||e[130]!==Fe?(Te=(0,t.jsxs)(Dt,{onValueChange:w,value:r,children:[we,Fe]}),e[128]=r,e[129]=we,e[130]=Fe,e[131]=Te):Te=e[131];let Re;e[132]!==Ne||e[133]!==Te?(Re=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,Te]}),e[132]=Ne,e[133]=Te,e[134]=Re):Re=e[134],e[135]!==ve||e[136]!==Re?(b=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,Re]}),e[135]=ve,e[136]=Re,e[137]=b):b=e[137],c=fe;let Oe;e[138]!==a?(Oe=a("Statements"),e[138]=a,e[139]=Oe):Oe=e[139];let Be;e[140]!==Oe?(Be=(0,t.jsx)(Ke,{children:Oe}),e[140]=Oe,e[141]=Be):Be=e[141],_=(0,t.jsxs)(Ae,{children:[Be,(0,t.jsx)(ut,{children:a("{count} tracked statements",{count:C.length})})]}),g=pe,N="space-y-2";let He;e[142]!==n||e[143]!==a?(He=o(R=>{let ue=R.normalizedSql,H=n.has(ue),he=Xe(R.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":H,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{D(ue)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(lr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),R.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Ve(R.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),H&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[R.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsWritten)})]})]})]})]},ue)},"Ke"),e[142]=n,e[143]=a,e[144]=He):He=e[144],q=C.map(He)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=g,e[7]=c,e[8]=f,e[9]=N,e[10]=q,e[11]=_,e[12]=d,e[13]=x,e[14]=p,e[15]=b}else g=e[6],c=e[7],f=e[8],N=e[9],q=e[10],_=e[11],d=e[12],x=e[13],p=e[14],b=e[15];if(f!==Symbol.for("react.early_return_sentinel"))return f;let M;e[145]!==N||e[146]!==q?(M=(0,t.jsx)("div",{className:N,children:q}),e[145]=N,e[146]=q,e[147]=M):M=e[147];let $;e[148]!==g||e[149]!==M?($=(0,t.jsx)(g,{children:M}),e[148]=g,e[149]=M,e[150]=$):$=e[150];let S;e[151]!==c||e[152]!==$||e[153]!==_?(S=(0,t.jsxs)(c,{children:[_,$]}),e[151]=c,e[152]=$,e[153]=_,e[154]=S):S=e[154];let I;return e[155]!==S||e[156]!==d||e[157]!==x||e[158]!==p||e[159]!==b?(I=(0,t.jsxs)("div",{className:d,"data-testid":x,children:[p,b,S]}),e[155]=S,e[156]=d,e[157]=x,e[158]=p,e[159]=b,e[160]=I):I=e[160],I},"nr");function or(s){return Xe(s.avgDurationMs)==="critical"}o(or,"or");function dr(s){return Xe(s.avgDurationMs)==="warning"}o(dr,"cr");function cr(s){return Xe(s.avgDurationMs)==="good"}o(cr,"dr");var mr=["1m","5m","15m","1h"],ur=o(s=>new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"ur"),hr=o(s=>s.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:ur(e.bucketMs)})),"fr"),gr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,P.useState)("15m"),r=Le(ze.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,u=hr(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:mr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===l,className:mt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===l&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:o(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(We,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),u.length===0?(0,t.jsx)(ht,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(Ee,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(yt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(Ee,{height:140,width:"100%",children:(0,t.jsxs)(Nt,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(vt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(ir,{queryStats:r?.entries??[]})]})},"hr"),fr=gt(ze.getMetrics),pr=o((s,e)=>s?e:"overview","pr"),jr=o(({initialShardKey:s})=>{let e=ct(),l=ge(),{queryShardKey:a,setShardKey:r,shardKey:u}=kt(s),[i,n]=(0,P.useState)("overview"),[h,y]=(0,P.useState)([]),w=(0,P.useRef)(null),g=(0,P.useRef)(null),c=(0,P.useRef)(!0);(0,P.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]);let f=Rt(a),{data:N,error:q,liveError:_}=Le(ze.getMetrics,{},{live:!0,shardKey:a}),d=N??null;(0,P.useEffect)(()=>{if(N===void 0)return;qt(a);let D=N,L=w.current,Q=g.current!==null&&g.current!==D.shard;if(g.current=D.shard,w.current=D.requests,Q){y([]);return}L!==null&&D.requests>=L&&y(K=>[...K,D.requests-L].slice(-30))},[N,a]);let[x,p]=(0,P.useState)(null),[b,M]=(0,P.useState)(!1),$=o(async()=>{M(!0);let D=zt(u,wt());try{let L=await Promise.all(D.map(async Q=>{try{let K=await e.query(fr,{},ft(Q));return{error:null,metrics:K,shard:Q===""?K.shard:Q}}catch(K){return{error:pt(K),metrics:null,shard:Q===""?"__root__":Q}}}));c.current&&p(L)}finally{c.current&&M(!1)}},"R"),S=x===null?null:Ot(x),I=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,C=h.length>0?h.at(-1):0,F=d?At(d):{p90:0,p95:0},k=(0,P.useMemo)(()=>{if(!d||!("queryStats"in d))return;let D=d.queryStats;if(!(!D||!Array.isArray(D)))return Kt(D)},[d]),v=pr(k!==void 0,i),T=o(()=>{bt($())},"D"),O=o(()=>{p(null)},"F"),z=o(()=>{n("overview")},"A"),A=o(()=>{n("query-insights")},"O");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(Mt,{onChange:r,testId:"mt-shard-input",value:u}),(0,t.jsx)(_t,{message:_,prefix:"mt"}),(0,t.jsx)(Ze,{"data-testid":"mt-aggregate",disabled:b,onClick:T,size:"sm",type:"button",variant:"secondary",children:l(b?"Aggregating\u2026":"All shards")}),x!==null&&(0,t.jsx)(Ze,{"data-testid":"mt-aggregate-clear",onClick:O,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:$t,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),q!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:q}),k!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:z,type:"button",children:l("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:A,type:"button",children:[l("Query insights"),k.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:k.length})]})]}),v==="query-insights"&&k!==void 0&&(0,t.jsx)(gr,{shardKey:a}),v==="overview"&&d!==null&&(0,t.jsx)(sr,{currentDelta:C,errorRate:I,history:h,latencyPercentiles:F,metrics:d}),v==="overview"&&d===null&&null,v==="overview"&&(0,t.jsx)(er,{onOpenTrace:f,shardKey:a}),v==="overview"&&S!==null&&x!==null&&(0,t.jsx)(tr,{aggregate:S,shardResults:x})]})},"jr");export{jr as MetricsPanel};
@@ -0,0 +1,6 @@
1
+ import{a as V,b as J,c as K,d as M,e as B,f as A,g as I,h as F}from"./chunk-RFNGDE33.js";import{a as P}from"./chunk-XZMOZFE6.js";import{a as z}from"./chunk-PD6WIDY6.js";import{d as L,m as D,n as U,o as Q,q as W}from"./chunk-FODLDLE2.js";import{a as p,d as q,e as ee,f as te,g as le}from"./chunk-YKXDMIHQ.js";var R=q(te(),1),E=q(ee(),1);var $="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",fe=`${$} aria-pressed:bg-accent aria-pressed:text-accent-foreground`;var r=q(le(),1);var X=p(l=>`"${l.replaceAll('"','""')}"`,"F"),ne=/["\n,]/u,oe=/^[=+\-@\t\r]/u,Y=p(l=>{if(l==null)return"";let e;return typeof l=="string"?e=oe.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=U(l),ne.test(e)?`"${e.replaceAll('"','""')}"`:e},"J"),ae=p((l,e)=>{let n=l.map(t=>Y(t)).join(","),o=e.map(t=>l.map(i=>Y(t[i])).join(","));return[n,...o].join(`
2
+ `)},"ne"),se=p(l=>JSON.stringify(l,D,2),"oe"),Z=500,re=p(l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:U(l)).replaceAll("'","''")}'`,"K"),G="__doc__",ie=p((l,e,n,o)=>{if(e.length===0||n.length===0)return"";let t=o?.includes(G)===!0&&!e.includes(G)?e.filter(c=>!o.includes(c)):void 0,i=t===void 0?e:o,s=p((c,g)=>re(t===void 0||g!==G?c[g]:JSON.stringify(Object.fromEntries(t.map(d=>[d,c[d]])),D)),"i"),a=i.map(c=>X(c)).join(", "),u=[];for(let c=0;c<n.length;c+=Z){let g=n.slice(c,c+Z).map(d=>` (${i.map(m=>s(d,m)).join(", ")})`).join(`,
3
+ `);u.push(`INSERT INTO ${X(l)} (${a}) VALUES
4
+ ${g};`)}return u.join(`
5
+
6
+ `)},"se"),H=p((l,e,n)=>{if(!("document"in globalThis))return;let o=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),t=globalThis.document.createElement("a");t.href=o,t.download=l,globalThis.document.body.append(t),t.click(),t.remove(),globalThis.URL.revokeObjectURL(o)},"M"),ce=p(l=>{let e=(0,R.c)(37),{columns:n,name:o,rows:t,sqlColumns:i}=l,s=L(),a;e[0]!==n||e[1]!==o||e[2]!==t?(a=p(()=>{H(`${o}.csv`,ae(n,t),"text/csv;charset=utf-8")},"s"),e[0]=n,e[1]=o,e[2]=t,e[3]=a):a=e[3];let u=a,c;e[4]!==o||e[5]!==t?(c=p(()=>{H(`${o}.json`,se(t),"application/json")},"c"),e[4]=o,e[5]=t,e[6]=c):c=e[6];let g=c,d;e[7]!==n||e[8]!==o||e[9]!==t||e[10]!==i?(d=p(()=>{H(`${o}.sql`,ie(o,n,t,i),"application/sql;charset=utf-8")},"a"),e[7]=n,e[8]=o,e[9]=t,e[10]=i,e[11]=d):d=e[11];let m=d,j=t.length===0,b;e[12]!==j?(b=(0,r.jsx)(J,{className:$,"data-testid":"grid-export",disabled:j,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[12]=j,e[13]=b):b=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=(0,r.jsx)(B,{children:"Export loaded rows"}),e[14]=k):k=e[14];let h;e[15]!==s?(h=s("CSV"),e[15]=s,e[16]=h):h=e[16];let x;e[17]!==u||e[18]!==h?(x=(0,r.jsx)(A,{"data-testid":"grid-export-csv",onClick:u,children:h}),e[17]=u,e[18]=h,e[19]=x):x=e[19];let w;e[20]!==s?(w=s("JSON"),e[20]=s,e[21]=w):w=e[21];let y;e[22]!==g||e[23]!==w?(y=(0,r.jsx)(A,{"data-testid":"grid-export-json",onClick:g,children:w}),e[22]=g,e[23]=w,e[24]=y):y=e[24];let N;e[25]!==s?(N=s("SQL"),e[25]=s,e[26]=N):N=e[26];let f;e[27]!==m||e[28]!==N?(f=(0,r.jsx)(A,{"data-testid":"grid-export-sql",onClick:m,children:N}),e[27]=m,e[28]=N,e[29]=f):f=e[29];let C;e[30]!==y||e[31]!==f||e[32]!==x?(C=(0,r.jsxs)(K,{align:"end",children:[k,x,y,f]}),e[30]=y,e[31]=f,e[32]=x,e[33]=C):C=e[33];let v;return e[34]!==C||e[35]!==b?(v=(0,r.jsxs)(V,{children:[b,C]}),e[34]=C,e[35]=b,e[36]=v):v=e[36],v},"ie"),de=p(l=>{let e=(0,R.c)(9),{column:n}=l,o;e[0]!==n?(o=p(()=>{n.toggleVisibility()},"o"),e[0]=n,e[1]=o):o=e[1];let t=o,i;e[2]!==n?(i=n.getIsVisible(),e[2]=n,e[3]=i):i=e[3];let s=`grid-column-${n.id}`,a;return e[4]!==n.id||e[5]!==t||e[6]!==i||e[7]!==s?(a=(0,r.jsx)(I,{checked:i,closeOnClick:!1,"data-testid":s,onCheckedChange:t,children:n.id}),e[4]=n.id,e[5]=t,e[6]=i,e[7]=s,e[8]=a):a=e[8],a},"re"),me=[],ue=p(({backRelations:l=me,enabledBackRelations:e,onToggleBackRelation:n,table:o})=>{let t=L(),i=o.getIsAllColumnsVisible(),s=p(()=>{o.toggleAllColumnsVisible(!i)},"i");return(0,r.jsxs)(V,{children:[(0,r.jsx)(J,{className:$,"data-testid":"grid-columns",children:t("Columns")}),(0,r.jsxs)(K,{align:"end",className:"max-h-80 overflow-y-auto",children:[(0,r.jsxs)(M,{children:[(0,r.jsx)(B,{children:t("Columns")}),(0,r.jsx)(I,{checked:i,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:s,children:t(i?"Hide all":"Show all")}),(0,r.jsx)(F,{}),o.getAllLeafColumns().filter(a=>!a.id.startsWith("__back__:")).map(a=>(0,r.jsx)(de,{column:a},a.id))]}),l.length>0&&n!==void 0&&(0,r.jsxs)(M,{children:[(0,r.jsx)(F,{}),(0,r.jsx)(B,{children:t("Related")}),l.map(a=>{let u=`${a.table}.${a.column}`;return(0,r.jsx)(I,{checked:e?.has(u)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${u}`,onCheckedChange:p(()=>{n(u)},"onCheckedChange"),children:`\u2190 ${a.table}.${a.column}`},u)})]})]})]})},"ae"),ge=p(l=>{let e=(0,R.c)(19),{count:n,editable:o,onClear:t,onDelete:i}=l,s=L(),a;e[0]!==n||e[1]!==s?(a=s("{count} selected",{count:n}),e[0]=n,e[1]=s,e[2]=a):a=e[2];let u;e[3]!==a?(u=(0,r.jsx)("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:a}),e[3]=a,e[4]=u):u=e[4];let c;e[5]!==s?(c=s("Clear"),e[5]=s,e[6]=c):c=e[6];let g;e[7]!==t||e[8]!==c?(g=(0,r.jsx)("button",{className:$,"data-testid":"grid-selection-clear",onClick:t,type:"button",children:c}),e[7]=t,e[8]=c,e[9]=g):g=e[9];let d;e[10]!==n||e[11]!==o||e[12]!==i||e[13]!==s?(d=o&&(0,r.jsx)(z,{confirmLabel:s("Delete {count} rows and everything that cascades?",{count:n}),onConfirm:i,testId:"grid-selection-delete",children:s("Delete {count}",{count:n})}),e[10]=n,e[11]=o,e[12]=i,e[13]=s,e[14]=d):d=e[14];let m;return e[15]!==u||e[16]!==g||e[17]!==d?(m=(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[u,g,d]}),e[15]=u,e[16]=g,e[17]=d,e[18]=m):m=e[18],m},"de"),pe=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,be=p(l=>{let e=(0,R.c)(9),{bucket:n,objectKey:o,resolveUrl:t}=l,[i,s]=(0,E.useState)(null),[a,u]=(0,E.useState)(!1),c,g;e[0]!==n||e[1]!==o||e[2]!==t?(c=p(()=>{let b={cancelled:!1};return Q((async()=>{try{let k=await t(o,n);b.cancelled||s(k)}catch{b.cancelled||u(!0)}})()),()=>{b.cancelled=!0}},"c"),g=[n,o,t],e[0]=n,e[1]=o,e[2]=t,e[3]=c,e[4]=g):(c=e[3],g=e[4]),(0,E.useEffect)(c,g);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=p(()=>{u(!0)},"a"),e[5]=d):d=e[5];let m=d;if(i===null||a)return null;let j;return e[6]!==o||e[7]!==i?(j=(0,r.jsx)("div",{className:"flex max-h-64 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:(0,r.jsx)("img",{alt:o,className:"max-h-64 object-contain","data-testid":"grid-cell-image",onError:m,src:i})}),e[6]=o,e[7]=i,e[8]=j):j=e[8],j},"me"),je=p(l=>{let e=(0,R.c)(37),{bucket:n,column:o,onClose:t,resolveUrl:i,value:s}=l,a=L(),[u,c]=(0,E.useState)(!1),g;e[0]!==s?(g=U(s),e[0]=s,e[1]=g):g=e[1];let d=g,m;e[2]!==d?(m=p(()=>{W(d)&&c(!0)},"d"),e[2]=d,e[3]=m):m=e[3];let j=m,b;e[4]!==a?(b=a("Cell value"),e[4]=a,e[5]=b):b=e[5];let k;e[6]!==o?(k=(0,r.jsx)("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:o}),e[6]=o,e[7]=k):k=e[7];let h;e[8]!==u||e[9]!==a?(h=a(u?"Copied":"Copy"),e[8]=u,e[9]=a,e[10]=h):h=e[10];let x;e[11]!==j||e[12]!==h?(x=(0,r.jsx)("button",{className:$,"data-testid":"grid-cell-copy",onClick:j,type:"button",children:h}),e[11]=j,e[12]=h,e[13]=x):x=e[13];let w;e[14]!==a?(w=a("Close"),e[14]=a,e[15]=w):w=e[15];let y;e[16]!==t||e[17]!==w?(y=(0,r.jsx)("button",{className:$,"data-testid":"grid-cell-close",onClick:t,type:"button",children:w}),e[16]=t,e[17]=w,e[18]=y):y=e[18];let N;e[19]!==x||e[20]!==y?(N=(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[x,y]}),e[19]=x,e[20]=y,e[21]=N):N=e[21];let f;e[22]!==k||e[23]!==N?(f=(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[k,N]}),e[22]=k,e[23]=N,e[24]=f):f=e[24];let C;e[25]!==n||e[26]!==i||e[27]!==s?(C=i!==void 0&&typeof s=="string"&&pe.test(s)&&(0,r.jsx)(be,{bucket:n,objectKey:s,resolveUrl:i}),e[25]=n,e[26]=i,e[27]=s,e[28]=C):C=e[28];let v;e[29]!==d?(v=(0,r.jsx)("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:d}),e[29]=d,e[30]=v):v=e[30];let S;return e[31]!==t||e[32]!==f||e[33]!==C||e[34]!==v||e[35]!==b?(S=(0,r.jsxs)(P,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:b,onClose:t,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[f,C,v]}),e[31]=t,e[32]=f,e[33]=C,e[34]=v,e[35]=b,e[36]=S):S=e[36],S},"Se"),Se=p(l=>{let e=(0,R.c)(37),{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,columns:i,editable:s,name:a,onBulkDelete:u,onToggleTranspose:c,rows:g,sqlColumns:d,table:m,transposed:j}=l,b=L(),k;e[0]!==m?(k=m.getSelectedRowModel(),e[0]=m,e[1]=k):k=e[1];let h=k.rows,x;e[2]!==m?(x=p(()=>{m.resetRowSelection()},"y"),e[2]=m,e[3]=x):x=e[3];let w=x,y;e[4]!==u||e[5]!==h||e[6]!==m?(y=p(()=>{u(h.map(he)),m.resetRowSelection()},"x"),e[4]=u,e[5]=h,e[6]=m,e[7]=y):y=e[7];let N=y,f;e[8]!==i||e[9]!==a||e[10]!==g||e[11]!==d?(f=(0,r.jsx)(ce,{columns:i,name:a,rows:g,sqlColumns:d}),e[8]=i,e[9]=a,e[10]=g,e[11]=d,e[12]=f):f=e[12];let C;e[13]!==n||e[14]!==o||e[15]!==t||e[16]!==m?(C=(0,r.jsx)(ue,{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,table:m}),e[13]=n,e[14]=o,e[15]=t,e[16]=m,e[17]=C):C=e[17];let v;e[18]!==b?(v=b("Swap rows and columns"),e[18]=b,e[19]=v):v=e[19];let S;e[20]!==b?(S=b("Transpose"),e[20]=b,e[21]=S):S=e[21];let T;e[22]!==c||e[23]!==v||e[24]!==S||e[25]!==j?(T=(0,r.jsx)("button",{"aria-pressed":j,className:$,"data-testid":"grid-transpose",onClick:c,title:v,type:"button",children:S}),e[22]=c,e[23]=v,e[24]=S,e[25]=j,e[26]=T):T=e[26];let _;e[27]!==s||e[28]!==w||e[29]!==N||e[30]!==h.length?(_=h.length>0&&(0,r.jsx)(ge,{count:h.length,editable:s,onClear:w,onDelete:N}),e[27]=s,e[28]=w,e[29]=N,e[30]=h.length,e[31]=_):_=e[31];let O;return e[32]!==f||e[33]!==C||e[34]!==T||e[35]!==_?(O=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[f,C,T,_]}),e[32]=f,e[33]=C,e[34]=T,e[35]=_,e[36]=O):O=e[36],O},"ke");function he(l){return l.id}p(he,"ue");export{$ as a,fe as b,ce as c,ge as d,je as e,Se as f};
@@ -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-U6XZFNKM.js";import"./chunk-ULIQFBZU.js";import"./chunk-XFXYDKOW.js";import"./chunk-35DM4JJG.js";import{a as E}from"./chunk-4ZEL6BYL.js";import{c as B}from"./chunk-AWWI2VYF.js";import"./chunk-ML7GYWXD.js";import"./chunk-FSRSK4LY.js";import"./chunk-5CEAO2OT.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 p}from"./chunk-35DM4JJG.js";import{d as f}from"./chunk-FODLDLE2.js";import{a as v,d,f as g,g as h}from"./chunk-YKXDMIHQ.js";var x=d(g(),1);var c=d(h(),1);var y=v(b=>{let e=(0,x.c)(14),{message:i,prefix:n}=b,r=f(),t=p(),l;e[0]!==t?(l=v(()=>{t?.openConsole({errorsOnly:!0})},"l"),e[0]=t,e[1]=l):l=e[1];let u=l;if(i===void 0)return null;let m=`${n}-live-error`,o;e[2]!==i||e[3]!==r?(o=r("Live unavailable: {liveError}",{liveError:i}),e[2]=i,e[3]=r,e[4]=o):o=e[4];let s;e[5]!==t||e[6]!==n||e[7]!==u||e[8]!==r?(s=t===void 0?null:(0,c.jsx)("button",{className:"underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":`${n}-live-error-console`,onClick:u,type:"button",children:r("Show in console")}),e[5]=t,e[6]=n,e[7]=u,e[8]=r,e[9]=s):s=e[9];let a;return e[10]!==m||e[11]!==o||e[12]!==s?(a=(0,c.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-destructive","data-testid":m,role:"status",children:[o,s]}),e[10]=m,e[11]=o,e[12]=s,e[13]=a):a=e[13],a},"E");export{y as a};