@lunora/studio 1.0.0-alpha.39 → 1.0.0-alpha.390

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 (491) hide show
  1. package/LICENSE.md +201 -104
  2. package/README.md +7 -7
  3. package/dist/index.d.mts +1647 -0
  4. package/dist/index.d.ts +1039 -809
  5. package/dist/index.mjs +1 -0
  6. package/dist/mount.d.mts +23 -0
  7. package/dist/mount.d.ts +13 -11
  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 +10 -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 +26 -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/ai-knowledge.mjs +1 -0
  31. package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
  32. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  33. package/dist/packem_chunks/architecture-panel.mjs +1 -0
  34. package/dist/packem_chunks/assistant-panel.mjs +3 -0
  35. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  36. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  37. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  38. package/dist/packem_chunks/containers-panel.mjs +1 -0
  39. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  40. package/dist/packem_chunks/evals-panel.mjs +1 -0
  41. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  42. package/dist/packem_chunks/flags-panel.mjs +1 -0
  43. package/dist/packem_chunks/issues-panel.mjs +1 -0
  44. package/dist/packem_chunks/kv-browser.mjs +1 -0
  45. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  46. package/dist/packem_chunks/migrations-route.mjs +1 -0
  47. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  48. package/dist/packem_chunks/payments-panel.mjs +1 -0
  49. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  50. package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
  51. package/dist/packem_chunks/queues-panel.mjs +1 -0
  52. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  53. package/dist/packem_chunks/rls-panel.mjs +1 -0
  54. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  55. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  56. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  57. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  58. package/dist/packem_chunks/theme-indicator.mjs +1 -0
  59. package/dist/packem_chunks/traces-panel.mjs +1 -0
  60. package/dist/packem_chunks/users-panel.mjs +1 -0
  61. package/dist/packem_chunks/vector-browser.mjs +1 -0
  62. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  63. package/dist/packem_shared/ADMIN_FUNCTIONS-DAHZ35kM.mjs +1 -0
  64. package/dist/packem_shared/ApiDocsPanel-CgjWqkBr.mjs +2 -0
  65. package/dist/packem_shared/ApiReferencePanel-DDvLw7c1.mjs +1 -0
  66. package/dist/packem_shared/CommandPalette-BjHFgNA6.mjs +1 -0
  67. package/dist/packem_shared/ConfirmButton-CIXYF6Mg.mjs +1 -0
  68. package/dist/packem_shared/ConnectionBadge-BfcoN-VE.mjs +1 -0
  69. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-jK7srdI4.mjs +1 -0
  70. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  71. package/dist/packem_shared/DEFAULT_LOCALE-BQ3jRT74.mjs +1 -0
  72. package/dist/packem_shared/DataBrowser-Dp8ayK1S.mjs +4 -0
  73. package/dist/packem_shared/DataFilters--ocFTVT2.mjs +1 -0
  74. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  75. package/dist/packem_shared/GlobalDataBrowser-VehUMwUK.mjs +1 -0
  76. package/dist/packem_shared/HomePanel-D5-wWLAj.mjs +1 -0
  77. package/dist/packem_shared/MigrationsPanel-CTd2YSSk.mjs +1 -0
  78. package/dist/packem_shared/OpenRpcReferencePanel-dXFl95w8.mjs +1 -0
  79. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  80. package/dist/packem_shared/ScheduledJobs-DPQHuiy6.mjs +1 -0
  81. package/dist/packem_shared/ShardInput-CoySruKZ.mjs +1 -0
  82. package/dist/packem_shared/Studio-CrfDOmdv.mjs +1 -0
  83. package/dist/packem_shared/StudioApp-DKBDIF7N.mjs +1 -0
  84. package/dist/packem_shared/StudioI18nProvider-CGXCPnQn.mjs +1 -0
  85. package/dist/packem_shared/advisor-view-C6C3kmZj.mjs +5 -0
  86. package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
  87. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  88. package/dist/packem_shared/app.d-QqDN78r1.d.mts +374 -0
  89. package/dist/packem_shared/app.d-QqDN78r1.d.ts +374 -0
  90. package/dist/packem_shared/assistant-provider-b2GtJb5K.mjs +1 -0
  91. package/dist/packem_shared/assistant-reason-D6EwMCxT.mjs +1 -0
  92. package/dist/packem_shared/auth-pager-DW77WeZw.mjs +1 -0
  93. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  94. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  95. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  96. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  97. package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
  98. package/dist/packem_shared/cf-links-BPy1pJRO.mjs +1 -0
  99. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  100. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  101. package/dist/packem_shared/data-grid-GQLHcpMI.mjs +1 -0
  102. package/dist/packem_shared/data-view-params-C-_G-biH.mjs +1 -0
  103. package/dist/packem_shared/diagram-export-panel-miFPsocM.mjs +2 -0
  104. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  105. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  106. package/dist/packem_shared/error-alert-BxCd81tw.mjs +6 -0
  107. package/dist/packem_shared/grid-features-Cdy2nWxA.mjs +6 -0
  108. package/dist/packem_shared/grid-pagination-DY2erU65.mjs +1 -0
  109. package/dist/packem_shared/home-panel-BlvQ0xK2.mjs +3 -0
  110. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  111. package/dist/packem_shared/internal-BT5tH08j.mjs +2 -0
  112. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  113. package/dist/packem_shared/live-status-D1GasNsH.mjs +1 -0
  114. package/dist/packem_shared/log-fields-CV-9O0nh.mjs +8 -0
  115. package/dist/packem_shared/log-line-BmYn49u1.mjs +1 -0
  116. package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
  117. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  118. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  119. package/dist/packem_shared/recording-client-D_-eNapT.mjs +1 -0
  120. package/dist/packem_shared/reference-view-CRtrtDMy.mjs +13 -0
  121. package/dist/packem_shared/schema-diagram-Dbs7-jSJ.mjs +2 -0
  122. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  123. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  124. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  125. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  126. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  127. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  128. package/dist/packem_shared/sql-result-table-BuOHHoFG.mjs +1 -0
  129. package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
  130. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  131. package/dist/packem_shared/studio-CwelGawN.mjs +2 -0
  132. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  133. package/dist/packem_shared/table-list-sidebar-Cw7ll9yK.mjs +1 -0
  134. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  135. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  136. package/dist/packem_shared/use-admin-query-DMnTt_hg.mjs +1 -0
  137. package/dist/packem_shared/use-admin-spec-Cokw73Ks.mjs +1 -0
  138. package/dist/packem_shared/use-assistant-rpc-DLsuqTPB.mjs +1 -0
  139. package/dist/packem_shared/use-async-submit-CBFJevkc.mjs +1 -0
  140. package/dist/packem_shared/use-auth-config-xzSMjhOV.mjs +1 -0
  141. package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
  142. package/dist/packem_shared/use-open-trace-trRfFb77.mjs +1 -0
  143. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  144. package/dist/packem_shared/use-studio-client-DCA50tF2.mjs +1 -0
  145. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  146. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  147. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  148. package/dist/standalone/chunk-23MMGFHI.js +1 -0
  149. package/dist/standalone/chunk-2CDROYSG.js +1 -0
  150. package/dist/standalone/chunk-2D4WBSDO.js +3 -0
  151. package/dist/standalone/chunk-2KTN53PK.js +1 -0
  152. package/dist/standalone/chunk-2M37OAK3.js +1 -0
  153. package/dist/standalone/chunk-2NUCBQFU.js +1 -0
  154. package/dist/standalone/chunk-2OSZRVNW.js +1 -0
  155. package/dist/standalone/chunk-2YDK4MZM.js +1 -0
  156. package/dist/standalone/chunk-2ZJJH4YN.js +33 -0
  157. package/dist/standalone/chunk-375GZTYC.js +14 -0
  158. package/dist/standalone/chunk-3OVQC66W.js +1 -0
  159. package/dist/standalone/chunk-3WYPRZY3.js +1 -0
  160. package/dist/standalone/chunk-3YCWRKSW.js +1 -0
  161. package/dist/standalone/chunk-4AG356VE.js +1 -0
  162. package/dist/standalone/chunk-4KPATTV6.js +1 -0
  163. package/dist/standalone/chunk-4MFQ4XEJ.js +1 -0
  164. package/dist/standalone/chunk-4SY2N2RS.js +1 -0
  165. package/dist/standalone/chunk-4YVCKOYF.js +1 -0
  166. package/dist/standalone/chunk-5EIGSLIK.js +1 -0
  167. package/dist/standalone/chunk-5PEAXTYQ.js +1 -0
  168. package/dist/standalone/chunk-6K4F727K.js +1 -0
  169. package/dist/standalone/chunk-7ASIMMZY.js +1 -0
  170. package/dist/standalone/chunk-7WGZSDRS.js +2 -0
  171. package/dist/standalone/chunk-A6TVTNKO.js +1 -0
  172. package/dist/standalone/chunk-ADABTCDI.js +1 -0
  173. package/dist/standalone/chunk-ADS4BJ7K.js +1 -0
  174. package/dist/standalone/chunk-AFLNQEZ5.js +1 -0
  175. package/dist/standalone/chunk-APCHI5CD.js +1 -0
  176. package/dist/standalone/chunk-AQG5OGO4.js +5 -0
  177. package/dist/standalone/chunk-ATBPQT7F.js +1 -0
  178. package/dist/standalone/chunk-AXB32N5O.js +1 -0
  179. package/dist/standalone/chunk-AXDXIMCN.js +1 -0
  180. package/dist/standalone/chunk-BHUWAGFN.js +1 -0
  181. package/dist/standalone/chunk-BRPLE2Z6.js +4 -0
  182. package/dist/standalone/chunk-BU5VWXRR.js +1 -0
  183. package/dist/standalone/chunk-BWBECJFT.js +1 -0
  184. package/dist/standalone/chunk-BWHVY6L6.js +1 -0
  185. package/dist/standalone/chunk-CBTPJPCZ.js +1 -0
  186. package/dist/standalone/chunk-CFQQHZYU.js +1 -0
  187. package/dist/standalone/chunk-CL3JOU6F.js +1 -0
  188. package/dist/standalone/chunk-CO6R6GCX.js +1 -0
  189. package/dist/standalone/chunk-CP3LCFFM.js +8 -0
  190. package/dist/standalone/chunk-CQDENTSP.js +1 -0
  191. package/dist/standalone/chunk-CVJDEN5L.js +1 -0
  192. package/dist/standalone/chunk-CVSIFPI5.js +1 -0
  193. package/dist/standalone/chunk-CXXCVBMK.js +1 -0
  194. package/dist/standalone/chunk-CY45AO5T.js +1 -0
  195. package/dist/standalone/chunk-DA2CAFXI.js +1 -0
  196. package/dist/standalone/chunk-DRHZZ7IN.js +1 -0
  197. package/dist/standalone/chunk-DZV6YFWZ.js +1 -0
  198. package/dist/standalone/chunk-EDL46BPM.js +1 -0
  199. package/dist/standalone/chunk-EKXAE4PS.js +1 -0
  200. package/dist/standalone/chunk-ELPLRD4S.js +1 -0
  201. package/dist/standalone/chunk-EMZ7RPR3.js +4 -0
  202. package/dist/standalone/chunk-EOFWXI3T.js +1 -0
  203. package/dist/standalone/chunk-ERUKFS3I.js +1 -0
  204. package/dist/standalone/chunk-EYSF4DHD.js +1 -0
  205. package/dist/standalone/chunk-EZMAQE3T.js +59 -0
  206. package/dist/standalone/chunk-FKAOFBS3.js +1 -0
  207. package/dist/standalone/chunk-FWM5Z6CH.js +1 -0
  208. package/dist/standalone/chunk-FYAUOSTX.js +1 -0
  209. package/dist/standalone/chunk-H6VTIXVB.js +1 -0
  210. package/dist/standalone/chunk-HCK62XWB.js +1 -0
  211. package/dist/standalone/chunk-HJOXP6C3.js +2 -0
  212. package/dist/standalone/chunk-HLBZ7OAO.js +10 -0
  213. package/dist/standalone/chunk-HMMALUXM.js +1 -0
  214. package/dist/standalone/chunk-HUL247LG.js +1 -0
  215. package/dist/standalone/chunk-I6YVDNKQ.js +1 -0
  216. package/dist/standalone/chunk-IL64HWFW.js +1 -0
  217. package/dist/standalone/chunk-IQ5CIBXJ.js +1 -0
  218. package/dist/standalone/chunk-IXCSVK2Z.js +3 -0
  219. package/dist/standalone/chunk-JNWK5MJC.js +1 -0
  220. package/dist/standalone/chunk-JQBVRWFN.js +1 -0
  221. package/dist/standalone/chunk-JZN3MNJX.js +6 -0
  222. package/dist/standalone/chunk-K2LXQ3LS.js +1 -0
  223. package/dist/standalone/chunk-K5W5C237.js +1 -0
  224. package/dist/standalone/chunk-KGQPMSNY.js +1 -0
  225. package/dist/standalone/chunk-KIQ34774.js +1 -0
  226. package/dist/standalone/chunk-KZXSJF7K.js +1 -0
  227. package/dist/standalone/chunk-L27FKJTG.js +1 -0
  228. package/dist/standalone/chunk-L6VJTINV.js +1 -0
  229. package/dist/standalone/chunk-L7TFQUD7.js +1 -0
  230. package/dist/standalone/chunk-LJLNIVUA.js +8 -0
  231. package/dist/standalone/chunk-LLD7TMBV.js +1 -0
  232. package/dist/standalone/chunk-LLSK6QBX.js +1 -0
  233. package/dist/standalone/chunk-LMCBMC2V.js +1 -0
  234. package/dist/standalone/chunk-LOEVTOKP.js +6 -0
  235. package/dist/standalone/chunk-LRUYEVHH.js +1 -0
  236. package/dist/standalone/chunk-LYVYUTQY.js +1 -0
  237. package/dist/standalone/chunk-LYWT6GTX.js +1 -0
  238. package/dist/standalone/chunk-MHZNDDGI.js +1 -0
  239. package/dist/standalone/chunk-MNN3YCKF.js +1 -0
  240. package/dist/standalone/chunk-N7FOBAV3.js +1 -0
  241. package/dist/standalone/chunk-NAGIOR23.js +1 -0
  242. package/dist/standalone/chunk-NFI2TNKU.js +1 -0
  243. package/dist/standalone/chunk-NP6CBOPK.js +1 -0
  244. package/dist/standalone/chunk-O5QATFN3.js +159 -0
  245. package/dist/standalone/chunk-O66HDCZT.js +1 -0
  246. package/dist/standalone/chunk-ODEIAS3V.js +1 -0
  247. package/dist/standalone/chunk-OJR7BDKC.js +1 -0
  248. package/dist/standalone/chunk-OQTMT64P.js +5 -0
  249. package/dist/standalone/chunk-OWCTA7GY.js +1 -0
  250. package/dist/standalone/chunk-OWRWDDJT.js +1 -0
  251. package/dist/standalone/chunk-OZID3UYF.js +1 -0
  252. package/dist/standalone/chunk-P3ML7HGE.js +1 -0
  253. package/dist/standalone/chunk-PBXRUYD3.js +1 -0
  254. package/dist/standalone/chunk-PDBW6GTJ.js +1 -0
  255. package/dist/standalone/chunk-QF743FSL.js +1 -0
  256. package/dist/standalone/chunk-QFN62JQJ.js +7 -0
  257. package/dist/standalone/chunk-QHVUXMRV.js +1 -0
  258. package/dist/standalone/chunk-QLZGKBOW.js +1 -0
  259. package/dist/standalone/chunk-QTWNCDLK.js +1 -0
  260. package/dist/standalone/chunk-R3RIZDUS.js +1 -0
  261. package/dist/standalone/chunk-R6NJ4ER6.js +1 -0
  262. package/dist/standalone/chunk-RIAOZECW.js +1 -0
  263. package/dist/standalone/chunk-RJJRUUTE.js +1 -0
  264. package/dist/standalone/chunk-SCTYLLJT.js +1 -0
  265. package/dist/standalone/chunk-SGIEXE5J.js +1 -0
  266. package/dist/standalone/chunk-T7UKRA6J.js +1 -0
  267. package/dist/standalone/chunk-U5UEDY4E.js +1 -0
  268. package/dist/standalone/chunk-U7NVTULW.js +1 -0
  269. package/dist/standalone/chunk-UFS6UP4Z.js +1 -0
  270. package/dist/standalone/chunk-UL5XVKGR.js +1 -0
  271. package/dist/standalone/chunk-V3DOKU22.js +1 -0
  272. package/dist/standalone/chunk-V4B7ZPEG.js +1 -0
  273. package/dist/standalone/chunk-V5TGDG6U.js +1 -0
  274. package/dist/standalone/chunk-VQQEDEHH.js +1 -0
  275. package/dist/standalone/chunk-W5BTAOHO.js +1 -0
  276. package/dist/standalone/chunk-W7CLOQOU.js +1 -0
  277. package/dist/standalone/chunk-WEPANQGT.js +1 -0
  278. package/dist/standalone/chunk-WXZ334CL.js +1 -0
  279. package/dist/standalone/chunk-XV2XEUUB.js +1 -0
  280. package/dist/standalone/chunk-Y2AKO63C.js +31 -0
  281. package/dist/standalone/{chunk-BJGBHGK3.js → chunk-Y2YLTUMD.js} +1 -1
  282. package/dist/standalone/chunk-Y5QMX4YG.js +1 -0
  283. package/dist/standalone/chunk-Y6OVSHPH.js +1 -0
  284. package/dist/standalone/chunk-YLC2ZYCL.js +1 -0
  285. package/dist/standalone/chunk-YNCZVYCO.js +1 -0
  286. package/dist/standalone/chunk-YYJGL32M.js +1 -0
  287. package/dist/standalone/chunk-ZADOHFZB.js +3 -0
  288. package/dist/standalone/chunk-ZJIYJZ6F.js +1 -0
  289. package/dist/standalone/chunk-ZP453BM4.js +1 -0
  290. package/dist/standalone/chunk-ZPQBVYNN.js +1 -0
  291. package/dist/standalone/studio.js +9 -214
  292. package/dist/styles.css +2 -2
  293. package/package.json +28 -23
  294. package/dist/index.js +0 -41
  295. package/dist/mount.js +0 -27
  296. package/dist/packem_chunks/ApiTab.js +0 -251
  297. package/dist/packem_chunks/AuditPanel.js +0 -200
  298. package/dist/packem_chunks/ExportImportPanel.js +0 -198
  299. package/dist/packem_chunks/FileBrowser.js +0 -2932
  300. package/dist/packem_chunks/FunctionRunner.js +0 -343
  301. package/dist/packem_chunks/FunctionStatsPanel.js +0 -377
  302. package/dist/packem_chunks/HealthPanel.js +0 -648
  303. package/dist/packem_chunks/InsightsPanel.js +0 -462
  304. package/dist/packem_chunks/LogsPanel.js +0 -827
  305. package/dist/packem_chunks/MailPanel.js +0 -353
  306. package/dist/packem_chunks/MetricsPanel.js +0 -1344
  307. package/dist/packem_chunks/MigrationsPanel.js +0 -239
  308. package/dist/packem_chunks/PitrPanel.js +0 -252
  309. package/dist/packem_chunks/SchemaViewer.js +0 -2513
  310. package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -95
  311. package/dist/packem_chunks/SettingsPanel.js +0 -391
  312. package/dist/packem_chunks/SqlEditorPanel.js +0 -2333
  313. package/dist/packem_chunks/TableEditor.js +0 -313
  314. package/dist/packem_chunks/analytics-panel.js +0 -261
  315. package/dist/packem_chunks/auth-config-panel.js +0 -365
  316. package/dist/packem_chunks/auth-sessions-panel.js +0 -175
  317. package/dist/packem_chunks/containers-panel.js +0 -247
  318. package/dist/packem_chunks/dashboards-panel.js +0 -780
  319. package/dist/packem_chunks/fanout-panel.js +0 -482
  320. package/dist/packem_chunks/flags-panel.js +0 -176
  321. package/dist/packem_chunks/kv-browser.js +0 -1896
  322. package/dist/packem_chunks/log-drains-panel.js +0 -273
  323. package/dist/packem_chunks/organizations-panel.js +0 -3178
  324. package/dist/packem_chunks/payments-panel.js +0 -186
  325. package/dist/packem_chunks/permissions-panel.js +0 -805
  326. package/dist/packem_chunks/queues-panel.js +0 -1075
  327. package/dist/packem_chunks/rls-panel.js +0 -315
  328. package/dist/packem_chunks/schedule-panel.js +0 -831
  329. package/dist/packem_chunks/sparkline.js +0 -79
  330. package/dist/packem_chunks/storage-rules-panel.js +0 -140
  331. package/dist/packem_chunks/subscriptions-panel.js +0 -238
  332. package/dist/packem_chunks/users-panel.js +0 -1731
  333. package/dist/packem_chunks/vector-browser.js +0 -281
  334. package/dist/packem_chunks/workflows-panel.js +0 -562
  335. package/dist/packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js +0 -52
  336. package/dist/packem_shared/ApiDocsPanel-CBma-lnp.js +0 -842
  337. package/dist/packem_shared/ApiReferencePanel-CQM3pPN7.js +0 -230
  338. package/dist/packem_shared/CommandPalette-X2tkbyHk.js +0 -373
  339. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  340. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  341. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  342. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  343. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  344. package/dist/packem_shared/DataBrowser-D2ywrdId.js +0 -4493
  345. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  346. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  347. package/dist/packem_shared/GlobalDataBrowser-BkTPLzAY.js +0 -289
  348. package/dist/packem_shared/HomePanel-D1Q9LZgK.js +0 -14
  349. package/dist/packem_shared/OpenRpcReferencePanel-Dno-hfDb.js +0 -192
  350. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  351. package/dist/packem_shared/ScheduledJobs-Ctw4jYtU.js +0 -262
  352. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  353. package/dist/packem_shared/Studio-lJhzDAze.js +0 -16
  354. package/dist/packem_shared/StudioApp-DiMkupvZ.js +0 -648
  355. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  356. package/dist/packem_shared/advisor-view-BX8OhG0w.js +0 -159
  357. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  358. package/dist/packem_shared/alert-CdAET2K_.js +0 -68
  359. package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
  360. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  361. package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
  362. package/dist/packem_shared/browser-storage-BTrX4y3B.js +0 -215
  363. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  364. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  365. package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
  366. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  367. package/dist/packem_shared/data-grid-CdXztApG.js +0 -183
  368. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
  369. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  370. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  371. package/dist/packem_shared/error-alert-CXjqyGw9.js +0 -114
  372. package/dist/packem_shared/grid-features-BF-KBDFz.js +0 -808
  373. package/dist/packem_shared/home-panel-TFcRf9Ui.js +0 -1889
  374. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  375. package/dist/packem_shared/internal-CYcbqMjX.js +0 -109
  376. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  377. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  378. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
  379. package/dist/packem_shared/reference-view-DUiJcILV.js +0 -2141
  380. package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
  381. package/dist/packem_shared/select-UkNYCT3s.js +0 -273
  382. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  383. package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
  384. package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
  385. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  386. package/dist/packem_shared/studio-Dh9UlaF_.js +0 -4015
  387. package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
  388. package/dist/packem_shared/table-list-sidebar-UVIXQJdU.js +0 -832
  389. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  390. package/dist/packem_shared/use-admin-query-CfHYWx5n.js +0 -106
  391. package/dist/packem_shared/use-async-submit-DJQiPc-_.js +0 -91
  392. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  393. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  394. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
  395. package/dist/standalone/chunk-23C4TCRO.js +0 -1
  396. package/dist/standalone/chunk-2K47A3P6.js +0 -1
  397. package/dist/standalone/chunk-2NGUNNGW.js +0 -1
  398. package/dist/standalone/chunk-3CJW6NWG.js +0 -4
  399. package/dist/standalone/chunk-3OA7PECS.js +0 -6
  400. package/dist/standalone/chunk-4QHKBC77.js +0 -1
  401. package/dist/standalone/chunk-5OIBXYZM.js +0 -1
  402. package/dist/standalone/chunk-5ZAA2PVR.js +0 -1
  403. package/dist/standalone/chunk-676HEBIR.js +0 -3
  404. package/dist/standalone/chunk-6VO23MMW.js +0 -4
  405. package/dist/standalone/chunk-7RE5UW27.js +0 -8
  406. package/dist/standalone/chunk-7TJJXVSE.js +0 -1
  407. package/dist/standalone/chunk-7YXOPTWI.js +0 -1
  408. package/dist/standalone/chunk-AAVIFQ4Y.js +0 -2
  409. package/dist/standalone/chunk-AHILM3ZP.js +0 -1
  410. package/dist/standalone/chunk-AJFQ3LNM.js +0 -1
  411. package/dist/standalone/chunk-AJULNB46.js +0 -4
  412. package/dist/standalone/chunk-BGXOXASQ.js +0 -1
  413. package/dist/standalone/chunk-BKW7FFEO.js +0 -1
  414. package/dist/standalone/chunk-BOXSWNXZ.js +0 -1
  415. package/dist/standalone/chunk-BXOYVWJR.js +0 -13
  416. package/dist/standalone/chunk-C7WTJLC3.js +0 -1
  417. package/dist/standalone/chunk-CACB34RQ.js +0 -1
  418. package/dist/standalone/chunk-CICVBMEN.js +0 -1
  419. package/dist/standalone/chunk-CKSHCYGC.js +0 -2
  420. package/dist/standalone/chunk-CWEAJUHW.js +0 -1
  421. package/dist/standalone/chunk-DC72CQY4.js +0 -76
  422. package/dist/standalone/chunk-DECHEGIC.js +0 -1
  423. package/dist/standalone/chunk-DWDILV2E.js +0 -1
  424. package/dist/standalone/chunk-E75ANNWX.js +0 -19
  425. package/dist/standalone/chunk-ERJNDIXC.js +0 -1
  426. package/dist/standalone/chunk-FKACHRWO.js +0 -1
  427. package/dist/standalone/chunk-FSGCANAU.js +0 -1
  428. package/dist/standalone/chunk-GLUNBZRI.js +0 -1
  429. package/dist/standalone/chunk-GMSGZDDH.js +0 -13
  430. package/dist/standalone/chunk-GTM65MVX.js +0 -1
  431. package/dist/standalone/chunk-H6RKXQZU.js +0 -1
  432. package/dist/standalone/chunk-HV7G6DFP.js +0 -5
  433. package/dist/standalone/chunk-HZTGDL4L.js +0 -1
  434. package/dist/standalone/chunk-I7ZZRM7I.js +0 -1
  435. package/dist/standalone/chunk-IXDH4GL5.js +0 -1
  436. package/dist/standalone/chunk-J46WXQYL.js +0 -1
  437. package/dist/standalone/chunk-J6J54MBP.js +0 -1
  438. package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
  439. package/dist/standalone/chunk-JVODY4EP.js +0 -1
  440. package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
  441. package/dist/standalone/chunk-KJJ3WM6H.js +0 -4
  442. package/dist/standalone/chunk-KSKXW5PX.js +0 -1
  443. package/dist/standalone/chunk-KZ6INM5M.js +0 -1
  444. package/dist/standalone/chunk-L7SK4ZZD.js +0 -1
  445. package/dist/standalone/chunk-LAK5VSPI.js +0 -1
  446. package/dist/standalone/chunk-LNZIB2MD.js +0 -1
  447. package/dist/standalone/chunk-LYB5L53X.js +0 -1
  448. package/dist/standalone/chunk-MJWVMKQ4.js +0 -6
  449. package/dist/standalone/chunk-MT2J3H7O.js +0 -3
  450. package/dist/standalone/chunk-N746FOQP.js +0 -1
  451. package/dist/standalone/chunk-NC6MBMSI.js +0 -1
  452. package/dist/standalone/chunk-NN27EDQB.js +0 -1
  453. package/dist/standalone/chunk-NY6GDADQ.js +0 -1
  454. package/dist/standalone/chunk-O3NAGRTR.js +0 -1
  455. package/dist/standalone/chunk-OY3HD7BJ.js +0 -4
  456. package/dist/standalone/chunk-P5HJXCZS.js +0 -1
  457. package/dist/standalone/chunk-PTS5TW3J.js +0 -1
  458. package/dist/standalone/chunk-Q52CHOSY.js +0 -1
  459. package/dist/standalone/chunk-QAFAJBAW.js +0 -1
  460. package/dist/standalone/chunk-QBAT52GB.js +0 -1
  461. package/dist/standalone/chunk-QDBOPDJ7.js +0 -1
  462. package/dist/standalone/chunk-QHFTGJPS.js +0 -4
  463. package/dist/standalone/chunk-RRCPZMC2.js +0 -22
  464. package/dist/standalone/chunk-SEU5V7I6.js +0 -1
  465. package/dist/standalone/chunk-SG3ALJJU.js +0 -1
  466. package/dist/standalone/chunk-SSI4G2MY.js +0 -1
  467. package/dist/standalone/chunk-TAD43CG5.js +0 -1
  468. package/dist/standalone/chunk-TBMYIZIO.js +0 -1
  469. package/dist/standalone/chunk-TH45YG6Q.js +0 -1
  470. package/dist/standalone/chunk-TQ36RWOP.js +0 -1
  471. package/dist/standalone/chunk-UGUEC6BC.js +0 -1
  472. package/dist/standalone/chunk-UK64ZSUW.js +0 -1
  473. package/dist/standalone/chunk-UKDJ4H7I.js +0 -1
  474. package/dist/standalone/chunk-V6IWFYAQ.js +0 -1
  475. package/dist/standalone/chunk-V7SRH36W.js +0 -1
  476. package/dist/standalone/chunk-VLXV72QE.js +0 -1
  477. package/dist/standalone/chunk-VON7JUPG.js +0 -1
  478. package/dist/standalone/chunk-WI7GWFEG.js +0 -1
  479. package/dist/standalone/chunk-WPNXY7IS.js +0 -1
  480. package/dist/standalone/chunk-X33MSJPP.js +0 -1
  481. package/dist/standalone/chunk-XNJNSCLM.js +0 -1
  482. package/dist/standalone/chunk-XRNXOIVZ.js +0 -1
  483. package/dist/standalone/chunk-YAECF5LW.js +0 -1
  484. package/dist/standalone/chunk-YBGC4PPD.js +0 -1
  485. package/dist/standalone/chunk-YNZ7ARWW.js +0 -1
  486. package/dist/standalone/chunk-YTO65GHS.js +0 -1
  487. package/dist/standalone/chunk-ZE6FT5Z3.js +0 -1
  488. package/dist/standalone/chunk-ZHVTQ37P.js +0 -1
  489. package/dist/standalone/chunk-ZIGWVHCS.js +0 -1
  490. package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
  491. package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{b as ur}from"./chunk-N7FOBAV3.js";import{a as B,b as Q}from"./chunk-ADABTCDI.js";import{a,d as T}from"./chunk-5PEAXTYQ.js";var ko=T(B(),1),Yt=ko.createContext(null);var Io=T(B(),1);function M(t){let e=Io.useContext(Yt);return e||void 0,e}a(M,"useRouter");function et(t){return t[t.length-1]}a(et,"last");function mt(t,e){return typeof t=="function"?t(e):t}a(mt,"functionalUpdate");var Zt=Object.prototype.hasOwnProperty;function Tt(t){for(let e in t)if(Zt.call(t,e))return!0;return!1}a(Tt,"hasKeys");var Mt=a(()=>Object.create(null),"createNull"),gt=a((t,e)=>tt(t,e,!0),"nullReplaceEqualDeep");function tt(t,e,o,n=0){if(!1)return e;if(t===e)return t;if(n++>500)return e;let r=Array.isArray(t)&&Array.isArray(e);if(!r&&!(Xt(t)&&Xt(e)))return e;let i=Object.keys(t),s=i.length,c=Object.keys(e),l=c.length;if(r?s!==t.length||l!==e.length||s&&et(i)!==`${s-1}`||l&&et(c)!==`${l-1}`:s!==Object.getOwnPropertyNames(t).length||l!==Object.getOwnPropertyNames(e).length||Object.getOwnPropertySymbols(e).length)return e;let u=0,f,d,h;if(r){for(;u<l&&(h=u,d=t[h],f=e[h],f=d===f?d:typeof d=="object"?tt(d,f,o,n):f,f===d);u++);if(u===l&&s===l)return t}else{let m=s===l,g=!0;for(;u<l;u++){h=c[u],d=t[h];let S=e[h];f=d===S?d:typeof d=="object"?tt(d,S,o,n):S,m&&=f===d&&(i[u]===h||Zt.call(t,h)),g&&=Object.is(f,S),i[u]=f}if(m)return Object.getOwnPropertySymbols(t).length?e:t;if(g)return e}let p=r?c.fill(0):o?Mt():{};for(let m=0;m<l;m++)h=r?m:c[m],r?(d=t[h],m>u&&(f=e[h],f=d===f?d:typeof d=="object"?tt(d,f,o,n):f),p[h]=m<u?d:f):p[h]=i[m];return p}a(tt,"replaceEqualDeep");function Xt(t){return!t||typeof t!="object"?!1:(Object.getPrototypeOf(t)?.constructor??Object)===Object}a(Xt,"isPlainObject");function J(t,e,o,n){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r<i;r++){let s=t[r],c=e[r];if(s!==c&&!J(s,c,o,n))return!1}return!0}if(Xt(t)&&Xt(e)){if(o){for(let i in e)if((n||e[i]!==void 0)&&!J(t[i],e[i],o,n))return!1;return!0}let r=0;if(n)r=Object.keys(t).length;else for(let i in t)t[i]!==void 0&&r++;for(let i in e)if((n||e[i]!==void 0)&&(r--===0||!J(t[i],e[i],o,n)))return!1;return r===0}return!1}a(J,"deepEqual");var fr=/[\x00-\x1f\x7f"<>`{}]/g;function dr(t){return t.replace(fr,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}a(dr,"sanitizePathSegment");function Oo(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,o=>{try{return decodeURI(o)}catch{return o}})}return dr(e)}a(Oo,"decodeSegment");var Le=["http:","https:","mailto:","tel:"];function it(t){if(t[0]!=="/"&&t.includes(":"))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(t)?.[1]?.replace(/[\t\n\r]/g,"").toLowerCase()}a(it,"getUrlScheme");var ke=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function Dt(t,e){if(!t)return!1;if(ke.test(t))return!0;let o=it(t);return o?!e.has(o):!1}a(Dt,"isDangerousProtocol");function bt(t){if(!t)return t;let e=t;if(/[%\\\x00-\x1f\x7f]/.test(t)){let o=/%25|%5C/gi,n=0,r;for(e="";(r=o.exec(t))!==null;)e+=Oo(t.slice(n,r.index))+r[0],n=o.lastIndex;e+=Oo(n?t.slice(n):t)}return e}a(bt,"decodePath");function No(t){return/[\s\u0080-\uFFFF]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}a(No,"encodePathLikeUrl");function Fo(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}a(Fo,"arraysEqual");function ut(){throw new Error("Invariant failed")}a(ut,"invariant");function at(t){return t.replace(/\/{2,}/g,"/")}a(at,"cleanPath");function Qt(t){return t==="/"?t:t.replace(/^\/+/,"")}a(Qt,"trimPathLeft");function H(t){let e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/+$/,""):t}a(H,"trimPathRight");function At(t){return H(Qt(t))}a(At,"trimPath");function te(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}a(te,"removeTrailingSlash");function ee(t,e,o="never",n){if(e.includes("//")&&(e=at(e)),e.startsWith("/"))return e.length===1||o==="preserve"?e:o==="always"?e.endsWith("/")?e:`${e}/`:e.endsWith("/")?e.slice(0,-1):e;let r=e===".",i;if(n){i=r?t:t+"\0"+e;let u=n.get(i);if(u)return u}let s;if(r)s=t.split("/");else{for(t.includes("//")&&(t=at(t)),s=t.split("/");s.length>1&&et(s)==="";)s.pop();let u=e.split("/");for(let f=0,d=u.length;f<d;f++){let h=u[f];h===""?f?f===d-1&&s.push(h):s=[h]:h===".."?s.length>1?s.pop():s=[""]:h==="."||s.push(h)}}s.length>1&&(et(s)===""?o==="never"&&s.pop():o==="always"&&s.push(""));let c=s.join("/"),l=(r?at(c):c)||"/";return i&&n&&n.set(i,l),l}a(ee,"resolvePath");function To(t){let e=new Map(t.map(n=>[encodeURIComponent(n),n])),o=new RegExp([...e.keys()].join("|").replace(/[.*()]/g,"\\$&"),"g");return n=>n.replace(o,r=>e.get(r)??r)}a(To,"compileDecodeCharMap");function hr(t){return t==null||t===""}a(hr,"isMissingSplat");function pr(t,e,o){if(typeof e!="string")return""+(e??void 0);let n=t==="_splat";if(n&&(!e||/^[a-zA-Z0-9\-._~!/]*$/.test(e)))return e;let r=encodeURIComponent(e);return n&&(r=r.replaceAll("%2F","/")),o?o(r):r}a(pr,"encodeParam");function oe(t,e,o,n,r){let i=t.endsWith("/")?"/":"",s="";for(let c of e){if(typeof c=="string"){s+=c;continue}let[l,u,f,d]=c,h=l===2,p=h&&d!==void 0?d+i:d,m=o[u];if(!(l===3&&m==null)){if(r&&(r[u]=m,h&&(r["*"]=m)),h&&hr(m)){if(f==="/"&&!p)continue;m=""}s+=f+pr(u,m,n)+(p||"")}}return s+i||"/"}a(oe,"interpolatePath");function q(t){return t?.isNotFound===!0}a(q,"isNotFound");function mr(){try{return sessionStorage}catch{return}}a(mr,"getSafeSessionStorage");var gr="tsr-scroll-restoration-v1_3",Ao=mr();function yr(){try{return JSON.parse(Ao?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}a(yr,"createScrollRestorationCache");var Ct=yr(),Mo="data-scroll-restoration-id",vr=a(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function Sr(t){let e=t.getAttribute(Mo);if(e)return`[${Mo}="${e}"]`;let o="",n=t,r;for(;r=n.parentNode;){let i=1,s=n;for(;s=s.previousElementSibling;)i++;let c=`${n.localName}:nth-child(${i})`;o=o?`${c} > ${o}`:c,n=r}return o}a(Sr,"getScrollRestorationSelector");var ne=!1,re="window";function Ie(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}a(Ie,"getElement");function Do(t){let e=new Set;for(let o of t){if(o===re)continue;let n=Ie(o);n&&e.add(n)}return e}a(Do,"getScrollToTopElements");function $o(t,e){let o=e??t.options.scrollRestoration,n=t._scroll;if(o&&(n.e=!0),!1)return;let r=t.options.getScrollRestorationKey||vr,i=new Set,s=a(c=>{let l=Ct[c]||={};for(let u of i)u===document?l[re]={scrollX,scrollY}:u.isConnected&&(l[Sr(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})},"snapshotCurrentScrollTargets");o&&!n.s&&(n.s=!0,ne=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{ne||i.add(c.target)},!0),t.subscribe("onBeforeLoad",c=>{c.fromLocation&&s(r(c.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{history.scrollRestoration="auto",s(r(t.stores.resolvedLocation.get()??t.stores.location.get()));try{Ao?.setItem(gr,JSON.stringify(Ct))}catch{}}),addEventListener("pageshow",c=>{c.persisted&&(history.scrollRestoration="manual")})),!n.r&&(n.r=!0,t.subscribe("onRendered",c=>{let l=t.options.scrollRestorationBehavior,u=t.options.scrollToTopSelectors,f=n.n,d=n.h,h;if(i.clear(),n.n=!0,n.h=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let p=r(c.toLocation),m=c.fromLocation&&r(c.fromLocation);if(n.e&&m&&m!==p){let g=Ct[m];if(g){let S=Ct[p];for(let y in g){if(y===re){if(f)continue}else{let R=Ie(y);if(!R||f&&u&&(h??=Do(u),h.has(R)))continue}S||(S=Ct[p]={}),S[y]??=g[y]}}}ne=!0;try{let g=c.toLocation.hash,S=c.toLocation.state.__hashScrollIntoViewOptions??!0,y=!1;if(f){!g&&u&&(h??=Do(u));let R=g&&S&&d,b=n.e?Ct[p]:void 0;if(b)for(let w in b){let{scrollX:C,scrollY:_}=b[w];if(w===re){if(R)continue;scrollTo({top:_,left:C,behavior:l}),y=!0}else{let v=Ie(w);v&&(v.scrollLeft=C,v.scrollTop=_,h?.delete(v))}}if(!g){let w={top:0,left:0,behavior:l};if(y||scrollTo(w),h)for(let C of h)C.scrollTo(w)}}!y&&g&&S&&document.getElementById(g)?.scrollIntoView(S)}finally{ne=!1}}))}a($o,"setupScrollRestoration");function Bo(t,e=String){let o;for(let n in t){let r=t[n];r!==void 0&&(o||=new URLSearchParams).set(n,e(r))}return o?o.toString():""}a(Bo,"encode");function Oe(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}a(Oe,"toValue");function Vo(t){let e=new URLSearchParams(t),o=Object.create(null);for(let[n,r]of e.entries()){let i=o[n];i==null?o[n]=Oe(r):Array.isArray(i)?i.push(Oe(r)):o[n]=[i,Oe(r)]}return o}a(Vo,"decode");var Ho=/^(?:\s|["[{\d-]|fa|nu|tr)/,zo=Rr(JSON.parse),Uo=_r(JSON.stringify,JSON.parse);function Rr(t){let e=t===JSON.parse;return o=>{o[0]==="?"&&(o=o.slice(1));let n=Vo(o);for(let r in n){let i=n[r];if(typeof i=="string"){if(e&&!Ho.test(i))continue;try{n[r]=t(i)}catch{}}}return n}}a(Rr,"parseSearchWith");function _r(t,e){let o=e===JSON.parse;function n(r){if(r&&typeof r=="object")try{return t(r)}catch{}else if(e&&typeof r=="string"){if(o&&!Ho.test(r))return r;try{return e(r),t(r)}catch{}}return r}return a(n,"stringifyValue"),r=>{let i=Bo(r,n);return i?`?${i}`:""}}a(_r,"stringifySearchWith");var Y="__root__";function Wo(t){t.statusCode=t.statusCode||t.code||307;let e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);let o=new Response(null,{status:t.statusCode,headers:e});if(o.options=t,t.throw)throw o;return o}a(Wo,"redirect");function se(t){return t instanceof Response&&!!t.options}a(se,"isRedirect");function Pt(t){let e=new Map,o,n;return{get(r){let i=e.get(r);if(i)return i.visited=!0,i.value},set(r,i){let s=e.get(r);if(s){s.value=i;return}if(e.size>=t){let l=o?.next().value;for(;!l||l.visited;)l?l.visited=!1:o=e.values(),l=o.next().value;l===n&&(o=void 0),e.delete(l.key)}let c={key:r,value:i,visited:!1};n=c,e.set(r,c)},clear(){e.clear(),o=void 0,n=void 0}}}a(Pt,"createSieveCache");var ft=4,Ko=5;function wr(t){let e=t.names;if(e)return e;let o=[];for(let n of t)typeof n!="string"&&o.push(n[1]);return t.names=o}a(wr,"getParamNames");function xr(t,e,o){let n=t.slice(e,o);if(n.charCodeAt(0)===36)return n.length===1?[2,"_splat","",void 0]:[1,n.slice(1),"",""];let r=n.indexOf("{");if(r>=0){let i=n.indexOf("}",r),s=n.charCodeAt(r+1)===45,c=r+(s?3:2);if(i>=0&&n.charCodeAt(c-1)===36&&(!s||c<i)){let l=n.slice(c,i);return[s?3:l?1:2,l||"_splat",n.slice(0,r),t.slice(e+i+1,l?o:t.length)]}}return n}a(xr,"parseSegment");function Et(t,e,o,n,r,i){let s=o,c=e.fullPath??e.from,l=e.options,u=c.length,f=c.endsWith("/")?u-1:u,d=l?.caseSensitive??t,h=l?.params?.parse??l?.parseParams,p,m=i?o-1:0;if(!n||c.includes("$")){p=i?.slice()??[];let y=et(p);y&&typeof y!="string"&&y[0]===2&&(p[p.length-1]=[y[0],y[1],y[2],y[3]===void 0?void 0:y[3]+c.substring(o-(c[o-2]==="/"?2:1),f)],m=u)}for(;s<u;){let y=s,R=c.indexOf("/",y),b=R===-1?u:R,w=xr(c,y,b);s=b+1;let C;if(typeof w=="string"){if(!n)continue;let _=w,v;d?v=n.static??=new Map:(_=w.toLowerCase(),v=n.staticInsensitive??=new Map);let x=v.get(_);if(x)C=x;else{let P=yt(n);C=P,v.set(_,P)}}else{let _=w[0],v=w[2],x=w[3]??"";if(_===2&&(b=u,s=b+1),p&&m<b&&(m<y-1&&p.push(c.slice(m,y-1)),w[2]="/"+v,_===2&&w[3]!==void 0&&f<u&&(w[3]=x.slice(0,-1)),p.push(w),m=b),!n)continue;let P=d&&!!(v||x);d||(v=v.toLowerCase(),x=x.toLowerCase());let L=_===1?n.dynamic??=[]:_===3?n.optional??=[]:n.wildcard??=[],k=_!==2&&!h&&L.find(E=>!E.parse&&E.caseSensitive===P&&E.prefix===v&&E.suffix===x);if(k)C=k;else{let E=yt(n,_,P,v,x);C=E,L.push(E),L.length===2&&r?.push(L)}}n=C}p&&m<f&&p.push(c.slice(m,f));let g=p?.slice();if(!n)return g;if(h&&e.children&&!e.isRoot&&e.id&&e.id.charCodeAt(e.id.lastIndexOf("/")+1)===95){let y=yt(n,Ko);(n.pathless??=[]).push(y),n=y}let S=(e.path||!e.children)&&!e.isRoot;if(S&&f<u){let y=yt(n,ft);n.index=y,n=y}return n.parse=h??null,n.priority=l?.params?.priority??0,n.route||(n.data=g,S&&(n.route=e)),[n,s,g]}a(Et,"parseSegments");function qo(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}a(qo,"sortDynamic");function yt(t,e=0,o,n,r){return{kind:e,depth:t?t.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:t,parse:null,priority:0,caseSensitive:o,prefix:n,suffix:r}}a(yt,"createSegmentNode");function Go(t,e){let o=yt(),n=[];function r(i,s,c,l){let[u,f,d]=Et(!1,i,s,c,n,l);if(i.children)for(let h of i.children)r(h,f,u,d)}a(r,"visit");for(let i of t)r(i,1,o);for(let i of n)i.sort(qo);e.masksTree=o,e.flatCache=Pt(1e3)}a(Go,"processRouteMasks");function Jo(t,e){t||="/";let o=e.flatCache.get(t);if(o!==void 0)return o;let n=Ne(t,e.masksTree);return e.flatCache.set(t,n),n}a(Jo,"findFlatMatch");function Yo(t,e,o,n,r){t||="/",n||="/";let i=e?`case\0${t}`:t,s=r.singleCache.get(i);return s||(s=yt(),Et(e,{from:t},1,s),r.singleCache.set(i,s)),Ne(n,s,o)}a(Yo,"findSingleMatch");function Xo(t,e,o=!1){let n=o?t:`nofuzz\0${t}`,r=e.matchCache.get(n);if(r!==void 0)return r;t||="/";let i;try{i=Ne(t,e.segmentTree,o)}catch(s){if(s instanceof URIError)i=null;else throw s}return i&&(i.branch=Fe(i.route)),e.matchCache.set(n,i),i}a(Xo,"findRouteMatch");function Zo(t,e=!1){let o=yt(),n=[],r={},i={},s=0;function c(l,u,f,d){if(l.init(s),l.id in r&&ut(),r[l.id]=l,s!==0&&l.path){let g=H(l.fullPath);(!i[g]||l.fullPath.endsWith("/"))&&(i[g]=l)}s++;let[h,p,m]=Et(e,l,u,f,n,d);if(l._interpolation=m,l.children)for(let g of l.children)c(g,p,h,m)}a(c,"visit"),c(t,1,o);for(let l of n)l.sort(qo);return{processedTree:{segmentTree:o,singleCache:Pt(1e3),matchCache:Pt(1e3),flatCache:null,masksTree:null},routesById:r,routesByPath:i}}a(Zo,"processRouteTree");function Ne(t,e,o=!1){let n=t.split("/"),r=Cr(t,n,e,o);if(!r)return null;let[i]=Qo(t,n,r);return{route:r.node.route,rawParams:i}}a(Ne,"findMatch");function Qo(t,e,o){let n=br(o.node),r=o.node.data&&wr(o.node.data),i=Object.create(null),s=o.extract?.part??0,c=o.extract?.node??0,l=o.extract?.path??0,u=o.extract?.param??0;for(;c<n.length;s++,c++,l++){let f=n[c];if(f.kind===ft)break;if(f.kind===Ko){s--,l--;continue}let d=e[s],h=l;if(d&&(l+=d.length),f.kind===1||f.kind===3){let p=r[u++];if(f.kind===3&&o.skipped&1<<c){s--,l=h-1;continue}let m=f.suffix||f.prefix?d.substring(f.prefix.length,d.length-f.suffix.length):d;(m||f.kind===1)&&(i[p]=decodeURIComponent(m))}else if(f.kind===2){let p=f,m=t.substring(h+p.prefix.length,t.length-p.suffix.length),g=decodeURIComponent(m);i["*"]=g,i._splat=g;break}}return o.rawParams&&Object.assign(i,o.rawParams),[i,{part:s,node:c,path:l,param:u}]}a(Qo,"extractParams");function Fe(t){let e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}a(Fe,"buildRouteBranch");function br(t){let e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}a(br,"buildBranch");function Cr(t,e,o,n){if(t==="/"&&o.index)return{node:o.index,skipped:0};let r=!et(e),i=r&&t!=="/",s=e.length-(r?1:0),c=[{node:o,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],l=null,u=null;for(;c.length;){let f=c.pop(),{node:d,index:h,skipped:p,statics:m,dynamics:g,optionals:S}=f,{extract:y,rawParams:R}=f;if(d.kind===2&&d.route&&!ae(u,f))continue;if(d.parse){if(!jo(t,e,f))continue;R=f.rawParams,y=f.extract}n&&d.route&&d.kind!==ft&&ae(l,f)&&(l=f);let b=h===s;if(b&&(d.route&&(!i||d.kind===ft||d.kind===2)&&ae(u,f)&&(u=f),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;let w=b?void 0:e[h],C;if(b&&d.index){let _={node:d.index,index:h,skipped:p,statics:m,dynamics:g,optionals:S,extract:y,rawParams:R},v=!0;if(d.index.parse&&(jo(t,e,_)||(v=!1)),v){if(!g&&!S&&!p&&Pr(m,s))return _;ae(u,_)&&(u=_)}}if(d.wildcard)for(let _=d.wildcard.length-1;_>=0;_--){let v=d.wildcard[_],{prefix:x,suffix:P}=v;if(!(x&&(b||!(v.caseSensitive?w:C??=w.toLowerCase()).startsWith(x)))){if(P){if(b)continue;let L=e.slice(h).join("/"),k=L.slice(-P.length);if((v.caseSensitive?k:k.toLowerCase())!==P||L.length-P.length<x.length)continue}c.push({node:v,index:s,skipped:p,statics:m,dynamics:g,optionals:S,extract:y,rawParams:R})}}if(d.optional){let _=p|1<<d.depth+1;for(let v=d.optional.length-1;v>=0;v--){let x=d.optional[v];c.push({node:x,index:h,skipped:_,statics:m,dynamics:g,optionals:S,extract:y,rawParams:R})}if(!b)for(let v=d.optional.length-1;v>=0;v--){let x=d.optional[v],{prefix:P,suffix:L}=x;if(P||L){let k=x.caseSensitive?w:C??=w.toLowerCase();if(P&&!k.startsWith(P)||L&&k.indexOf(L,k.length-L.length)<P.length)continue}c.push({node:x,index:h+1,skipped:p,statics:m,dynamics:g,optionals:S+ie(s,h),extract:y,rawParams:R})}}if(!b&&d.dynamic&&w)for(let _=d.dynamic.length-1;_>=0;_--){let v=d.dynamic[_],{prefix:x,suffix:P}=v;if(x||P){let L=v.caseSensitive?w:C??=w.toLowerCase();if(x&&!L.startsWith(x)||P&&L.indexOf(P,L.length-P.length)<x.length)continue}c.push({node:v,index:h+1,skipped:p,statics:m,dynamics:g+ie(s,h),optionals:S,extract:y,rawParams:R})}if(!b&&d.staticInsensitive){let _=d.staticInsensitive.get(C??=w.toLowerCase());_&&c.push({node:_,index:h+1,skipped:p,statics:m+ie(s,h),dynamics:g,optionals:S,extract:y,rawParams:R})}if(!b&&d.static){let _=d.static.get(w);_&&c.push({node:_,index:h+1,skipped:p,statics:m+ie(s,h),dynamics:g,optionals:S,extract:y,rawParams:R})}if(d.pathless)for(let _=d.pathless.length-1;_>=0;_--){let v=d.pathless[_];c.push({node:v,index:h,skipped:p,statics:m,dynamics:g,optionals:S,extract:y,rawParams:R})}}if(u)return u;if(n&&l){let f=l.index;for(let h=0;h<l.index;h++)f+=e[h].length;let d=f===t.length?"/":t.slice(f);return l.rawParams??=Object.create(null),l.rawParams["**"]=decodeURIComponent(d),l}return null}a(Cr,"getNodeMatch");function ie(t,e){return 2**(t-e-1)}a(ie,"segmentScore");function Pr(t,e){return t===2**(e-1)-1}a(Pr,"isPerfectStaticMatch");function jo(t,e,o){let n,r;try{[n,r]=Qo(t,e,o)}catch{return null}if(o.rawParams=n,o.extract=r,!o.node.parse)return!0;try{if(o.node.parse(n)===!1)return null}catch{}return!0}a(jo,"validateParseParams");function ae(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===ft)>(t.node.kind===ft)||e.node.kind===ft==(t.node.kind===ft)&&e.node.depth>t.node.depth))):!0}a(ae,"isFrameMoreSpecific");function tn(t,e,o){let n=At(t),r=`/${n}`,i=e?r:r.toLowerCase(),s=`${i}/`,c={input:a(({url:l})=>{let u=e?l.pathname:l.pathname.toLowerCase();return u===i?l.pathname="/":u.startsWith(s)&&(l.pathname=l.pathname.slice(r.length)),l},"input"),output:a(({url:l})=>(l.pathname=at(`/${n}${l.pathname}`),l),"output")};return o?{input:a(({url:l})=>ce(o,c.input({url:l})),"input"),output:a(({url:l})=>c.output({url:Te(o,l)}),"output")}:c}a(tn,"rewriteBasepath");function ce(t,e){let o=t?.input?.({url:e});if(o){if(typeof o=="string")return new URL(o);if(o instanceof URL)return o}return e}a(ce,"executeRewriteInput");function Te(t,e){let o=t?.output?.({url:e});if(o){if(typeof o=="string")return new URL(o);if(o instanceof URL)return o}return e}a(Te,"executeRewriteOutput");function Me(t){let e=t;return{get(){return e},set(o){e=mt(o,e)}}}a(Me,"createNonReactiveMutableStore");function De(t){return{get(){return t()}}}a(De,"createNonReactiveReadonlyStore");function en(t,e){let{createMutableStore:o,createReadonlyStore:n,batch:r}=e,i=new Map,s=o("idle"),c=o(t),l=o(void 0),u=o([]),f=n(()=>u.get().map(g=>i.get(g).get())),d=n(()=>({status:s.get(),isLoading:s.get()==="pending",matches:f.get(),location:c.get(),resolvedLocation:l.get()}));function h(g){let S=i.get(g);return S||(S=o(void 0),i.set(g,S)),S}a(h,"getMatchStore");let p={status:s,location:c,resolvedLocation:l,ids:u,matches:f,byRoute:i,__store:d,getMatchStore:h,setMatches:m};function m(g){let S=u.get(),y=g.map(R=>R.routeId);r(()=>{Fo(S,y)||u.set(y);for(let R of S)y.includes(R)||i.get(R).set(()=>{});for(let R of g){let b=h(R.routeId);b.get()!==R&&b.set(R)}})}return a(m,"setMatches"),p}a(en,"createRouterStores");var dt="__TSR_index",on="popstate",nn="beforeunload",Er=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function $t(t){let e=Er.exec(t);return e?"/"+t.slice(e[0].length):t}a($t,"normalizeProtocolRelative");function $e(t){return/[\x00-\x1f\x7f]/.test(t)&&(t=t.replace(/[\x00-\x1f\x7f]/g,e=>`
2
+ \r`.includes(e)?"":encodeURIComponent(e))),$t(t)}a($e,"normalizeHref");function Be(t){let e=t.getLocation(),o=new Set,n=a(s=>{e=t.getLocation(),o.forEach(c=>c({location:e,action:s}))},"notify"),r=a(s=>{t.notifyOnIndexChange??!0?n(s):e=t.getLocation()},"handleIndexChange"),i=a(async s=>{let c=s.navigateOpts?.ignoreBlocker?void 0:t.getBlockers?.();if(typeof document<"u"&&c?.length&&(s.type==="PUSH"||s.type==="REPLACE"))for(let l of c){let u=Lt(s.path,s.state);if(await l.blockerFn({currentLocation:e,nextLocation:u,action:s.type})){t.onBlocked?.();return}}s.task()},"tryNavigation");return{get location(){return e},get length(){return t.getLength()},subscribers:o,subscribe:a(s=>(o.add(s),()=>{o.delete(s)}),"subscribe"),push:a((s,c,l)=>{let u=e.state[dt];c=Ae(u+1,c),i({task:a(()=>{t.pushState(s,c),n({type:"PUSH"})},"task"),navigateOpts:l,type:"PUSH",path:s,state:c})},"push"),replace:a((s,c,l)=>{let u=e.state[dt];c=Ae(u,c),i({task:a(()=>{t.replaceState(s,c),n({type:"REPLACE"})},"task"),navigateOpts:l,type:"REPLACE",path:s,state:c})},"replace"),go:a((s,c)=>{i({task:a(()=>{t.go(s,c?.ignoreBlocker??!1),r({type:"GO",index:s})},"task"),navigateOpts:c,type:"GO"})},"go"),back:a(s=>{i({task:a(()=>{t.back(s?.ignoreBlocker??!1),r({type:"BACK"})},"task"),navigateOpts:s,type:"BACK"})},"back"),forward:a(s=>{i({task:a(()=>{t.forward(s?.ignoreBlocker??!1),r({type:"FORWARD"})},"task"),navigateOpts:s,type:"FORWARD"})},"forward"),canGoBack:a(()=>e.state[dt]!==0,"canGoBack"),createHref:a(s=>t.createHref(s),"createHref"),block:a(s=>{if(!t.setBlockers)return()=>{};let c=t.getBlockers?.()??[];return t.setBlockers([...c,s]),()=>{let l=t.getBlockers?.()??[];t.setBlockers?.(l.filter(u=>u!==s))}},"block"),flush:a(()=>t.flush?.(),"flush"),destroy:a(()=>t.destroy?.(),"destroy"),notify:n,_getBlockers:a(()=>t.getBlockers?.()??[],"_getBlockers")}}a(Be,"createHistory");function Ae(t,e){let o=He();return{...e,key:o,__TSR_key:o,[dt]:t}}a(Ae,"assignKeyAndIndex");function Ve(t){let e=t?.window??(typeof document<"u"?window:void 0),o=e.history.pushState,n=e.history.replaceState,r=[],i=a(()=>r,"_getBlockers"),s=a(v=>r=v,"_setBlockers"),c=a(v=>$e(t?.createHref?t.createHref(v):v),"createHref"),l=t?.parseLocation??(()=>Lt(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){let v=He();e.history.replaceState({[dt]:0,key:v,__TSR_key:v},"")}let u=l(),f,d=!1,h=!1,p=!1,m=!1,g=a(()=>u,"getLocation"),S,y=a(()=>{S&&(_._ignoreSubscribers=!0,(S[2]?e.history.pushState:e.history.replaceState)(S[1],"",S[0]),_._ignoreSubscribers=!1,S=void 0,f=void 0)},"flush"),R=a((v,x,P)=>{let L=t?.createHref?c(x):void 0,k=!!S;k||(f=u),u=Lt(x,P),S=[L??u.href,P,S?.[2]||v],k||queueMicrotask(()=>y())},"queueHistoryAction"),b=a(v=>{u=l(),_.notify({type:v})},"onPushPop"),w=a(async()=>{if(m=!1,h){h=!1;return}let v=l(),x=v.state[dt]-u.state[dt],P=x===1,L=x===-1,k=!P&&!L||d;d=!1;let E=k?"GO":L?"BACK":"FORWARD",O=k?{type:"GO",index:x}:{type:L?"BACK":"FORWARD"};if(p)p=!1;else{let F=i();if(typeof document<"u"&&F.length){for(let N of F)if(await N.blockerFn({currentLocation:u,nextLocation:v,action:E})){h=!0,e.history.go(-x),_.notify(O);return}}}u=l(),_.notify(O)},"onPushPopEvent"),C=a(v=>{if(m){m=!1;return}let x=!1,P=i();if(typeof document<"u"&&P.length)for(let L of P){let k=L.enableBeforeUnload??!0;if(k===!0){x=!0;break}if(typeof k=="function"&&k()===!0){x=!0;break}}if(x)return v.preventDefault(),v.returnValue=""},"onBeforeUnload"),_=Be({getLocation:g,getLength:a(()=>e.history.length,"getLength"),pushState:a((v,x)=>R(!0,v,x),"pushState"),replaceState:a((v,x)=>R(!1,v,x),"replaceState"),back:a(v=>(v&&(p=!0,m=!0),e.history.back()),"back"),forward:a(v=>{v&&(p=!0,m=!0),e.history.forward()},"forward"),go:a((v,x)=>{d=!0,x&&(p=!0,m=!0),e.history.go(v)},"go"),createHref:c,flush:y,destroy:a(()=>{e.history.pushState=o,e.history.replaceState=n,e.removeEventListener(nn,C,{capture:!0}),e.removeEventListener(on,w)},"destroy"),onBlocked:a(()=>{f&&u!==f&&(u=f)},"onBlocked"),getBlockers:i,setBlockers:s,notifyOnIndexChange:!1});return _._ignoreNextBeforeUnload=v=>{m=!1;try{v=new URL(v,e.document.baseURI).href,m=/^https?:/.test(v)&&(!v.includes("#")||v.split("#")[0]!==e.location.href.split("#")[0])}catch{}},e.addEventListener(nn,C,{capture:!0}),e.addEventListener(on,w),e.history.pushState=function(...v){let x=o.apply(e.history,v);return _._ignoreSubscribers||b("PUSH"),x},e.history.replaceState=function(...v){let x=n.apply(e.history,v);return _._ignoreSubscribers||b("REPLACE"),x},_}a(Ve,"createBrowserHistory");function Lr(t={initialEntries:["/"]}){let e=t.initialEntries,o=t.initialIndex?Math.min(Math.max(t.initialIndex,0),e.length-1):e.length-1,n=e.map((l,u)=>Ae(u,void 0)),r=a(()=>Lt(e[o],n[o]),"getLocation"),i=[];return Be({getLocation:r,getLength:a(()=>e.length,"getLength"),pushState:a((l,u)=>{o=o<e.length-1?o+1:e.length,n[o]=u,e[o]=l,o<e.length-1&&(e.length=o+1,n.length=o+1)},"pushState"),replaceState:a((l,u)=>{n[o]=u,e[o]=l},"replaceState"),back:a(()=>{o=Math.max(o-1,0)},"back"),forward:a(()=>{o=Math.min(o+1,e.length-1)},"forward"),go:a(l=>{o=Math.min(Math.max(o+l,0),e.length-1)},"go"),createHref:$e,getBlockers:a(()=>i,"_getBlockers"),setBlockers:a(l=>i=l,"_setBlockers")})}a(Lr,"createMemoryHistory");function Lt(t,e){let o=$e(t),n=o.indexOf("#"),r=o.indexOf("?");if(!e){let i=He();e={[dt]:0,key:i,__TSR_key:i}}return{href:o,pathname:o.slice(0,n>-1?r>-1?Math.min(n,r):n:r>-1?r:o.length),hash:n>-1?o.slice(n):"",search:r>-1?o.slice(r,n===-1?void 0:n):"",state:e}}a(Lt,"parseHref");function He(){return(Math.random()+1).toString(36).slice(7)}a(He,"createRandomKey");function ze(t,e){return t.protocol!=="http:"&&t.protocol!=="https:"||t.origin!==e||!!t.username||!!t.password}a(ze,"isExternalUrl");function Ue(t){return t.pathname+t.search+t.hash}a(Ue,"getUrlPath");function rn(t){return t.options.loader||t.options.beforeLoad||t.lazyFn||t.options.component?.preload||t.options.pendingComponent?.preload}a(rn,"routeNeedsLoad");function vt(t,e){return{fromLocation:e,toLocation:t,pathChanged:e?.pathname!==t.pathname,hrefChanged:e?.href!==t.href,hashChanged:e?.hash!==t.hash}}a(vt,"getLocationChangeInfo");function sn({key:t,__TSR_key:e,__TSR_index:o,__hashScrollIntoViewOptions:n,...r}){return r}a(sn,"_getUserHistoryState");function ln(t){return t.findIndex(e=>e.status==="error"||e.status==="notFound"||e._notFound)+1}a(ln,"lifecycleEnd");function un(t,e,o,n,r,i){n&&(e=e.slice(0,n)),r&&(o=o.slice(0,r));for(let s of e){if(i&&t._tx!==i)return;o.some(c=>c.routeId===s.routeId)||t.routesById[s.routeId].options.onLeave?.(s)}for(let s of o){if(i&&t._tx!==i)return;t.routesById[s.routeId].options[e.some(c=>c.routeId===s.routeId)?"onStay":"onEnter"]?.(s)}}a(un,"runRouteLifecycle");var Ke=class{static{a(this,"RouterCore")}constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async o=>(o(),!1),this.update=o=>{let n=this.options;this.options={...n,...o},this.isServer=this.options.isServer??!1??typeof document>"u",this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Ve()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost");let r=this.options.basepath??"/",i=this.options.rewrite,s=this.basepath!==r||n?.rewrite!==i||n?.caseSensitive!==this.options.caseSensitive;if(s&&(this.basepath=r,this.rewrite=r!=="/"&&At(r)?tn(r,this.options.caseSensitive,i):i),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree||!1){this.routeTree=this.options.routeTree;let c;c=this.buildRouteTree(),!1,this.setRoutes(c)}if(this.stores)s&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let c=this.getStoreConfig(this);this.batch=c.batch,this.stores=en(this.latestLocation,c),$o(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let o=Zo(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Go(this.options.routeMasks,o.processedTree),{...o,resolvePathCache:Pt(1e3)}},this.subscribe=(o,n)=>{let r={eventType:o,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=o=>{for(let n of this.subscribers)if(n.eventType===o.type)try{n.fn(o)}catch(r){console.error(r)}},this.parseLocation=(o,n)=>{let r=a(({pathname:l,search:u,hash:f,href:d},h)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){let S=this.options.parseSearch(u),y=this.options.stringifySearch(S);return{href:l+y+f,publicHref:l+y+f,pathname:bt(l),external:!1,searchStr:y,search:gt(n?.search,S),hash:bt(f.slice(1)),state:tt(n?.state,h)}}let p=ce(this.rewrite,new URL(d,this.origin)),m=this.options.parseSearch(p.search),g=this.options.stringifySearch(m);return p.search=g,{href:p.href.replace(p.origin,""),publicHref:d,pathname:bt($t(p.pathname)),external:!!this.rewrite&&ze(p,this.origin),searchStr:g,search:gt(n?.search,m),hash:bt(p.hash.slice(1)),state:tt(n?.state,h)}},"parse"),i=r(o,o.state),{__tempLocation:s,__tempKey:c}=i.state;if(s&&(!c||c===this.tempLocationKey)){let l=r(s,{...s.state,__tempLocation:void 0,key:i.state.key,__TSR_key:i.state.__TSR_key});return l.maskedLocation=i,l}return i},this.matchRoutes=(o,n,r)=>typeof o=="string"?this.matchRoutesInternal({pathname:o,search:n},r):this.matchRoutesInternal(o,n),this.getMatchedRoutes=o=>{let n=Object.create(null),r=Xo(H(o),this.processedTree,!0);return r&&Object.assign(n,r.rawParams),[r?.branch||[this.routesById.__root__],n,r?.route]},this.buildLocation=o=>{if(!!1){let s=this.staticLocations.get(o);if(s)return s}let n=!1,r=a((s={})=>{if(s.href){let F=Lt(s.href,{});s={...s,to:ce(this.rewrite,new URL(F.pathname,this.origin)).pathname,search:this.options.parseSearch(F.search),hash:F.hash.slice(1)}}let c=o._fromLocation||this._pendingLocation||this.latestLocation,l,u=a(()=>(n=!0,c),"current"),f=a(()=>l??=this.matchRoutesLightweight(u()),"currentMatch"),d=s.to?`${s.to}`:".",h=ee(d[0]==="/"?"":s.unsafeRelative==="path"?u().pathname:s.from??f()[1],d,this.options.trailingSlash,this.resolvePathCache),p=this.routesByPath[H(h)],m=h.includes("$"),g;if(p)g=p._branch??=Fe(p);else if(m)g=[];else{let[F,N,D]=this.getMatchedRoutes(h);g=F,this.options.notFoundRoute&&(!D||D.path!=="/"&&N["**"])&&(g=[...g,this.options.notFoundRoute])}let S=m?p?._interpolation??Et(!1,{fullPath:h},0):void 0,y;for(let F of g){let N=F.options.params?.stringify??F.options.stringifyParams;if(N){let D=f()[3];if(y??=We(s.params,D),!Tt(y))break;y===D&&(y=Object.assign(Mt(),y));try{Object.assign(y,N(y))}catch{}}}y??=We(s.params,kr(s.params,S)?f()[3]:je);let R=o.leaveParams?h:$t(bt(S?oe(h,S,y,this.pathParamsDecoder):h)),b=Ir(g,o._includeValidateSearch),w=a(()=>{let F=f()[2];if(o._includeValidateSearch&&this.options.search?.strict){let N={};g.forEach(D=>{if(D.options.validateSearch)try{Object.assign(N,le(D.options.validateSearch,{...N,...F}))}catch{}}),F=N}return F},"fromSearch"),C=b.length?Or(b,w(),s):s.search===!0?w():typeof s.search=="function"?s.search(w()):s.search||je,_=this.options.stringifySearch(C),v=s.hash===!0?u().hash:typeof s.hash=="function"?s.hash(u().hash):s.hash||void 0,x=v?`#${v}`:"",P=s.state?s.state===!0?u().state:typeof s.state=="function"?s.state(u().state):s.state:je,L=`${R}${_}${x}`,k,E,O=!1;if(this.rewrite){let F=new URL(L,this.origin),N=F.origin,D=Te(this.rewrite,F);k=Ue(F),ze(D,N)?(E=D.href,O=!0):E=$t(Ue(D))}else k=No(L),E=k;return{publicHref:E,href:k,pathname:R,search:C,searchStr:_,state:P,hash:v??"",external:O,unmaskOnReload:s.unmaskOnReload}},"build"),i=r(o);if(o.mask)i.maskedLocation=r({from:o.from,...o.mask});else if(this.options.routeMasks){let s=Jo(i.pathname,this.processedTree);if(s){let c=Object.assign(Mt(),s.rawParams),{from:l,params:u,...f}=s.route,d=We(u,c);i.maskedLocation=r({from:o.from,...f,params:d})}}return!!1&&!n&&o._fromLocation&&this.staticLocations.set(o,i),i},this.commitLocation=async({viewTransition:o,ignoreBlocker:n,...r})=>{if(!1)return;let i=r.maskedLocation??r;if(i.external&&!!1)return an(this,i.publicHref,{replace:r.replace,ignoreBlocker:n});let s,c=H(this.latestLocation.href)===H(r.href)&&J(sn(r.state),sn(this.latestLocation.state)),l=this._commitPromise,u,f=new Promise(d=>{u=d});if(f.resolve=()=>{u(),l?.resolve()},this._commitPromise=f,c)this.load();else{let{maskedLocation:d,hashScrollIntoView:h,...p}=r;d&&(p={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state={...p.state,__hashScrollIntoViewOptions:h??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=o,s=r.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:n}),this.history.subscribers.size||this.load({action:{type:s}})}return this._scroll.n=r.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:o,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:s,...c}={})=>{if(!1)return Promise.resolve();let l=this.buildLocation({...c,_includeValidateSearch:!0});this._pendingLocation=l;let u=this.commitLocation({...l,viewTransition:i,replace:o,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:s});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:o,reloadDocument:n,href:r,publicHref:i,...s})=>{if(!1)return;let c=r?it(r):void 0;if(c||n){if(o!==void 0||!r){let u=this.buildLocation({to:o,...s}),f=u.maskedLocation??u;r??=f.publicHref,i??=f.publicHref}return an(this,!c&&i?i:r,s)}return this.buildAndCommitLocation({...s,href:r,to:o,_isNavigate:!0})},this.load=async o=>{if(!1)return(void 0)(this,o);this.updateLatestLocation(),o?.action&&(this._scroll.h=o.action.type==="PUSH"||o.action.type==="REPLACE"),await dn(this,o)},this.startViewTransition=o=>{let n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&!!1&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&window.CSS?.supports?.("selector(:active-view-transition-type(a))")){let i=this.latestLocation,s=this.stores.resolvedLocation.get(),c=typeof n.types=="function"?n.types(vt(i,s)):n.types;if(c===!1)return o();r={update:o,types:c}}else r=o;return document.startViewTransition(r).updateCallbackDone}return o()},this.invalidate=o=>{let n=this._committed,r=o?.filter,i=this._preloads,s=new Set,c=a(f=>{(!r||r(f))&&s.add(f.id)},"consider");n.forEach(c),this._cache.forEach(c),i?.forEach(f=>f.forEach(c)),this._tx?.[3].forEach(c);let l=[];for(let[f,d]of i??[])d.some(h=>s.has(h.id))&&(i.delete(f),l.push(f));let u=a(f=>{if(s.has(f.id)){let d=this.routesById[f.routeId],h={...f,invalid:!0,...(o?.forcePending||f.status==="error"||f.status==="notFound")&&rn(d)?{status:"pending",error:void 0}:void 0};return f._flight=void 0,h}return f},"invalidate");this._committed=n.map(u);for(let[f,d]of this._cache)s.has(f)&&(d.invalid=!0,o?.forcePending&&(d.status="pending"));for(let f of s){let d=this._flights?.get(f);this._flights?.delete(f),d&&!d[2]&&l.push(d[1])}for(let f of l)f.abort();return this.shouldViewTransition=!1,this.load({sync:o?.sync})},this.resolveRedirect=o=>{let n=o.options,r=o.headers.get("Location")||n.href;if(!r){let s=this.buildLocation(n);r=(s.maskedLocation??s).publicHref||"/"}let i;if(ke.test(r)||(i=it(r))&&!this.protocolAllowlist.has(i))throw new Error("Redirect blocked: unsafe protocol");if(i==="http:"||i==="https:"){let s=new URL(r);s.pathname.startsWith("//")?r=s.href:ze(s,this.origin)||(r=Ue(s),i=void 0)}return i&&(n.reloadDocument=!0),n.href=r,o.headers.set("Location",r),o},this.clearCache=o=>{let n=this._cache,r=this._preloads,i=o?.filter,s=[],c=[];for(let[u,f]of n)(!i||i(f))&&(c.push(u),s.push(f));let l=[];for(let[u,f]of r??[])(!i||f.some(i))&&(l.push(u),s.push(...f));for(let u of c)n.delete(u);for(let u of l)r.delete(u);for(let u of s){let f=u._flight;u._flight=void 0,f&&!--f[2]&&(this._flights?.get(u.id)===f&&this._flights.delete(u.id),l.push(f[1]))}for(let u of l)u.abort()},this.loadRouteChunk=St,this.preloadRoute=o=>hn(this,o),this.matchRoute=(o,n)=>{let r={...o,to:o.to?ee(o.from||"",o.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:o.params||{},leaveParams:!0},i=this.buildLocation(r),s=this.stores.status.get()==="pending";if(n?.pending&&!s)return!1;let c=n?.pending??!s?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=Yo(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,c.pathname,this.processedTree);return!l||o.params&&!J(l.rawParams,o.params,!0)?!1:n?.includeSearch??!0?J(c.search,i.search,!0)?l.rawParams:!1:l.rawParams},this.getStoreConfig=e,t.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=To(t.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Uo,parseSearch:t.parseSearch??zo,protocolAllowlist:t.protocolAllowlist??Le}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(t){Object.assign(this,t),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let e=this.options.notFoundRoute;e&&(e.init(99999999999),this.routesById[e.id]!==e&&(e._interpolation=Et(!1,e,0)),this.routesById[e.id]=e)}matchRoutesInternal(t,e){let[o,n,r]=this.getMatchedRoutes(t.pathname),i=o,s=!1;(r?r.path!=="/"&&n["**"]:H(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:s=!0);let c=s?Nr(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,f=a((h,p)=>{let m=u[p];return m?.routeId===h.id?m:h===this.options.notFoundRoute?u.find(g=>g.routeId===h.id):void 0},"previousAt"),d;for(let h=0;h<i.length;h++){let p=i[h],m=l[h-1],g,S,y;{let O=m?.search??t.search,F=m?._strictSearch??void 0;try{let N=le(p.options.validateSearch,{...O})??void 0;g={...O,...N},S={...F,...N}}catch(N){let D=N;if(N instanceof Bt||(D=new Bt(N.message,{cause:N})),e?.throwOnError)throw D;g=O,S={},y=D}}let R="",b="";try{R=p.options.loaderDeps?.({search:g})??"",b=R&&JSON.stringify(R)||""}catch(O){if(e?.throwOnError)throw O;y??=O}let w=Mt(),C=p._interpolation?oe(p.fullPath,p._interpolation,n,this.pathParamsDecoder,w):p.fullPath,_=p.id+C+b,v=f(p,h),x=this._cache.get(_)??(v?.id===_?v:void 0);d=x?._strictParams??Object.assign(w,d);let P;if(!x)try{cn(p,d)}catch(O){if(q(O)||se(O)?P=O:P=new fn(O.message,{cause:O}),e?.throwOnError)throw P}let L=v?"stay":"enter",k;if(x)k={...x,cause:L,search:v?gt(v.search,g):gt(x.search,g),_strictSearch:S,searchError:y};else{let O=rn(p)?"pending":"success";k={id:_,ssr:p.options.ssr,index:h,routeId:p.id,params:v?.params??d,_strictParams:d,pathname:C,updatedAt:Date.now(),search:v?gt(v.search,g):g,_strictSearch:S,searchError:y,status:O,isFetching:!1,error:void 0,paramsError:P,context:{},abortController:e?._controller??new AbortController,cause:L,loaderDeps:v?tt(v.loaderDeps,R):R,invalid:!1,preload:!1,staticData:p.options.staticData||{},fullPath:p.fullPath}}let E=c===p.id;k._notFound&&!E&&(k.error=void 0),k._notFound=E,l[h]=k}for(let h=0;h<l.length;h++){let p=l[h];p.params=p.cause==="stay"?gt(p.params,d):d,e?._controller&&(p.context={})}return l}matchRoutesLightweight(t){let e=et(this.stores.ids.get()),o=e?this.stores.byRoute.get(e).get():void 0,n=o?.id,r=this.lightweightCache.get(t);if(r&&r[0]===n)return r[1];let[i,s]=this.getMatchedRoutes(t.pathname),c=et(i),l={...t.search};for(let h of i)try{Object.assign(l,le(h.options.validateSearch,l))}catch{}let u=o&&o.routeId===c.id&&o.pathname===t.pathname,f;if(u)f=o.params;else{let h=s;for(let p of i)try{cn(p,h)}catch{}f=h}let d=[i,c.fullPath,l,f];return this.lightweightCache.set(t,[n,d]),d}};async function an(t,e,{replace:o,ignoreBlocker:n}){if(!Dt(e,t.protocolAllowlist)){if(!n){let r=t.history._getBlockers();for(let i of r)if(i?.blockerFn&&await i.blockerFn({currentLocation:t.history.location,nextLocation:t.history.location,action:o?"REPLACE":"PUSH"}))return}t.history._ignoreNextBeforeUnload?.(e),o?window.location.replace(e):window.location.href=e}}a(an,"documentNavigation");var Bt=class extends Error{static{a(this,"SearchParamError")}},fn=class extends Error{static{a(this,"PathParamError")}};function le(t,e){if(t==null)return{};if("~standard"in t){let o=t["~standard"].validate(e);if(o instanceof Promise)throw new Bt("Async validation not supported");if(o.issues)throw new Bt(JSON.stringify(o.issues,void 0,2),{cause:o});return o.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}a(le,"validateSearch");function We(t,e){if(t===void 0||t===!0)return e;let o=Object.create(null);return t===!1||t===null?o:typeof t=="function"?(Object.assign(o,e),Object.assign(o,t(o))):Object.assign(o,e,t)}a(We,"resolveNextParams");function kr(t,e){return typeof t=="function"?!0:!e||t===!1||t===null?!1:t===void 0||t===!0||e.some(o=>typeof o!="string"&&!Zt.call(t,o[1]))}a(kr,"needsInheritedParams");var je=Object.freeze({});function Ir(t,e){let o=[];for(let n=0;n<t.length;n++){let r=t[n].options;if("search"in r)r.search?.middlewares&&o.push(...r.search.middlewares);else if(r.preSearchFilters||r.postSearchFilters){let s=a(({search:c,next:l})=>{let u=l(r.preSearchFilters?r.preSearchFilters.reduce((f,d)=>d(f),c):c);return r.postSearchFilters?r.postSearchFilters.reduce((f,d)=>d(f),u):u},"legacyMiddleware");o.push(s)}let i=r.validateSearch;if(e&&i){let s=a(({search:c,next:l,meta:u})=>{let f=l(c);try{let d=le(i,f);if(u&&d)for(let h in d)h in f||(u.defaulted||=new Map).set(h,d[h]);return{...f,...d}}catch{}return f},"validate");o.push(s)}}return o}a(Ir,"getSearchMiddlewares");function Or(t,e,o){let n=a((r,i,s)=>{if(r>=t.length){if(!o.search)return{};if(o.search===!0)return i;let l=mt(o.search,i);return s&&(s.explicit=l),l}let c=a((l,u)=>{if(u){let f=s||{};return{search:n(r+1,l,f),meta:f}}return n(r+1,l,s)},"next");return t[r]({search:i,next:c,meta:s})},"applyNext");return n(0,e)}a(Or,"applySearchMiddleware");function Nr(t,e){if(t!=="root"){let o;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.options.notFoundComponent)return r.id;o||=r.children&&r.id}if(o)return o}return Y}a(Nr,"findGlobalNotFoundRouteId");function cn(t,e){let o=t.options.params?.parse??t.options.parseParams;o&&Object.assign(e,o(e))}a(cn,"extractStrictParams");function qe(t,e){return t.options[e]?.preload?.()}a(qe,"preloadComponent");function Fr(t,e){let o=qe(t,"component"),n=qe(t,"pendingComponent");return e&&(n?n=n.then(e):e()),o&&n?Promise.all([o,n]).then(()=>{}):o??n}a(Fr,"loadComponents");function St(t,e,o){let n=a(()=>e===!1?void 0:e?qe(t,e):Fr(t,o),"afterLazy"),r=t._lazy;if(r)return r===!0?n():r.then(n);if(!t.lazyFn)return n();let i=t.lazyFn().then(s=>{{let{id:c,...l}=s.options;Object.assign(t.options,l),t._lazy=!0}},s=>{throw t._lazy=void 0,s});return t._lazy=i,i.then(n)}a(St,"loadRouteChunk");function fe(t){let e=t.findIndex(o=>o.status!=="success"||o._notFound)+1;return e&&e<t.length?t.slice(0,e):t}a(fe,"_getRenderedMatches");function Ye(t,e,o){let n=t._tx;return e&&n?.[2]===o&&!n[3].some(r=>r.routeId===e)}a(Ye,"_isRouteDeparting");var rt=0,lt=1,de=2,z=3,ht=[4];function zt(t){return typeof t[0]=="number"}a(zt,"isControl");function _t(t,e){return e.aborted?Promise.race([Promise.reject(e),t]):new Promise((o,n)=>{let r=a(()=>n(e),"abort");e.addEventListener("abort",r,{once:!0}),Promise.resolve(t).then(o,n).then(()=>e.removeEventListener("abort",r))})}a(_t,"waitFor");function wt(t,e){return t.routesById[e.routeId]}a(wt,"getRoute");function Ut(t,e,o){return se(t)?[z,t]:q(t)?(t.routeId||=o,[de,t]):e?(typeof t?.then=="function"&&(t=new Error("A Promise was thrown",{cause:t})),[lt,t]):[rt,t]}a(Ut,"normalize");function Xe(t,e){let o=Ut(e,!0,t.id);if(o[0]!==lt)return o;try{t.options.onError?.(o[1])}catch(n){o=Ut(n,!0,t.id)}return o}a(Xe,"normalizeError");function Ht(t,e,o,n,r){return r[0].signal.aborted?ht:to(t,e,o,Xe(o,n),r)}a(Ht,"normalizeLaneError");async function Tr(t,e,o,n,r,i){let[s,c]=e,l=o[0].signal,u=!!o[3];for(let f=o[6]??0;f<n;f++){let d=c[f],h=wt(t,d);d.abortController=o[0];let p=c[f-1]?.context??t.options.context??{},m={params:d.params,location:s,navigate:a(R=>t.navigate({...R,_fromLocation:s}),"navigate"),buildLocation:t.buildLocation,cause:u?"preload":d.cause,abortController:o[0],preload:u,matches:c,routeId:h.id};try{let R=d._ctx||=h.options.context?h.options.context({...m,deps:d.loaderDeps,context:p})||{}:void 0;d.context={...p,...R}}catch(R){return ct(t,d),[f,Ht(t,e,h,R,o)]}if(l.aborted)return[f,ht];let g=d.paramsError??d.searchError;if(g!==void 0)return ct(t,d),[f,Ht(t,e,h,g,o)];let S=h.options.beforeLoad;if(!S)continue;let y=d.status;f>=i&&(d.status="pending",o[7]?.());try{Wt(t,d,"beforeLoad",o[0]);let R=S({...m,search:d.search,context:d.context,...t.options.additionalContext}),b=await(typeof R?.then=="function"?_t(R,l):R);if(l.aborted)return[f,ht];let w=to(t,e,h,Ut(b,!1,h.id),o);if(w[0]!==rt)return ct(t,d),[f,w];d.context={...d.context,...b}}catch(R){return ct(t,d),[f,Ht(t,e,h,R,o)]}finally{d.status=y,Wt(t,d,!1,o[0])}}r()}a(Tr,"contextualize");function Ze(t,e,o){if(!(!o||--o[2])){if(t._flights?.get(e.id)===o){let n=t._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(e)&&n[3].some(r=>r.id===e.id)&&n[3].some(r=>r.isFetching==="beforeLoad"))return;t._flights.delete(e.id)}return o[1]}}a(Ze,"releaseOwnedFlight");function ct(t,e){let o=e._flight;e._flight=void 0,Ze(t,e,o)?.abort()}a(ct,"releaseFlight");function U(t,e,o,n){let r=[];for(let i of e)if(!o?.includes(i)){let s=i._flight;if(i._flight=void 0,n&&s?.[2]===1&&t._flights?.get(i.id)===s&&o?.some(c=>c.id===i.id))s[2]=0;else{let c=Ze(t,i,s);c&&r.push(c)}}for(let i of r)i.abort()}a(U,"transferMatchResources");function Qe(t){for(let e of t){let o=e._flight;o&&o[2]++}}a(Qe,"acquireMatchResources");function Wt(t,e,o,n){if(e.isFetching=o,n&&t._tx?.[0]!==n)return;let r=t.stores.byRoute.get(e.routeId),i=r?.get();i?.id===e.id&&r.set({...i,isFetching:o})}a(Wt,"setFetching");function Sn(t,e,o,n,r,i,s){let c=e[0];return{params:o.params,location:c,navigate:a(l=>t.navigate({...l,_fromLocation:c}),"navigate"),cause:s?"preload":o.cause,abortController:r,preload:s,deps:o.loaderDeps,parentMatchPromise:i,context:o.context,route:n,...t.options.additionalContext}}a(Sn,"getLoaderContext");async function pn(t,e,o,n,r,i,s){let c=s[0],l=c.signal;if(l.aborted)return ht;if(!r)return[rt,void 0];let u=o._flight;Wt(t,o,"loader",c);try{if(!u){let f=new AbortController;u=[Promise.resolve().then(()=>r(Sn(t,e,o,n,f,i,!!s[3]))).then(d=>Ut(d,!1,n.id),d=>Ut(d,!0,n.id)).then(d=>(d[0]!==rt&&t._flights?.get(o.id)===u&&(t._flights.delete(o.id),u[2]||f.abort()),d[0]===lt&&u[2]?Xe(n,d[1]):d)),f,1],(t._flights??=new Map).set(o.id,u)}return o._flight=u,o.abortController=u[1],to(t,e,n,await _t(u[0],l),s)}catch(f){if(f!==l||!l.aborted)throw f;return ct(t,o),ht}finally{Wt(t,o,!1,c)}}a(pn,"loadResource");function mn(t,e,o){e[0]!==z&&(t.status="success",t.error=void 0,e[0]===rt?(t.loaderData=e[1],t.invalid=!1,t.updatedAt=Date.now(),t.preload=o):t.invalid=!0)}a(mn,"settleInto");function Mr(t,e,o){let n=t._cache.get(e.id);if(n!==o||t._committed.some(i=>i.id===e.id&&i._flight===e._flight))return;let r={...e,_notFound:void 0,context:{}};r._flight&&r._flight[2]++,t._cache.set(e.id,r),n&&ct(t,n)}a(Mr,"cacheLoaderMatch");function gn(t,e){return e[0]===lt||e[0]===de?{...t,status:e[0]===lt?"error":"notFound",error:e[1],_flight:void 0}:t}a(gn,"getParentSnapshot");function Dr(t,e,o,n,r,i,s){let c=e[1][o],l=wt(t,c),u=!!i[3],f=t._cache.get(c.id),d,h=!1,p;try{if(c.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(Sn(t,e,c,l,i[0],r,u))),i[0].signal.aborted&&(p=ht)),!p)if(c.status!=="success")h=!0;else{let E=u||c.preload?l.options.preloadStaleTime??t.options.defaultPreloadStaleTime??3e4:l.options.staleTime??t.options.defaultStaleTime??0;h=!!(c.invalid||d||d===void 0&&Date.now()-c.updatedAt>=E&&(i[5]||c.cause==="enter"||i[2].some(O=>O.routeId===c.routeId&&O.id!==c.id)))}}catch(E){c.invalid=!0,ct(t,c),p=Ht(t,e,l,E,i)}let m=l.options.loader,g=typeof m=="function",S=g?m:m?.handler,y=!u||l.options.preload!==!1,R=y&&m?t._flights?.get(c.id):void 0;R===c._flight||p?R=void 0:R&&!h&&!u&&d===void 0?h=!0:h||(R=void 0);let b=!!(m&&h&&c.status==="success"&&!u&&!i[4]&&((g?void 0:m.staleReloadMode)??t.options.defaultStaleReloadMode)!=="blocking"),w=h&&y,C=w&&!b&&(c.status!=="success"||!!m),_=o>=s?i[7]:void 0,v=l.lazyFn&&l._lazy!==!0?_:void 0;if(w&&!m&&(c.invalid=!1,c.updatedAt=Date.now()),R&&R[2]++,C){let E=c._flight;c._flight=R,Ze(t,c,E)?.abort(),o>=s&&(c.status="pending"),_?.()}w||(c.isFetching=!1);let x=!p&&C?pn(t,e,c,l,S,r,i).then(E=>(mn(c,E,u),E[0]===rt&&(m&&!i[0].signal.aborted&&Mr(t,c,f),o>=s&&(c.status="pending")),E)):Promise.resolve(p??[rt,c.loaderData]),P=(async()=>{try{let O=St(l,void 0,v);O&&await _t(O,i[0].signal)}catch(O){if(!e[1].some((F,N)=>N<=o&&(F.status==="error"||F.status==="notFound"||F._notFound)))return[o,Ht(t,e,l,O,i)]}let E=await x;C&&E[0]===rt&&c.status==="pending"&&!i[0].signal.aborted&&(c.status="success",_?.())})();if(n.push([o,x,P]),!b)return x.then(E=>gn(c,E));let L={...c,status:"pending",preload:!1,_flight:R};c.invalid=!1,c.isFetching="loader";let k=pn(t,e,L,l,S,r,i).then(E=>(c.isFetching=!1,mn(L,E,!1),E));return(e[2]??=[]).push([o,k,P,L]),k.then(E=>gn(L,E))}a(Dr,"createLoaderTask");async function Ge(t,e,o,n,r=0){let i=o?.[1][1],s=i?.routeId?e.findIndex(c=>c.routeId===i.routeId):o?.[0]??e.length-1;s<0&&(s=0);for(let c=s;c>=0;c--){let l=wt(t,e[c]);try{let u=St(l,!1);u&&await _t(u,n)}catch(u){if(u===n&&n.aborted)throw u}if(l.options.notFoundComponent)return c}return i?.routeId?s:r}a(Ge,"getNotFoundBoundary");function Rt(t,e){e[2]&&(U(t,e[2].map(o=>o[3])),e[2]=void 0)}a(Rt,"discardBackground");async function yn(t,e,o,n){let r;try{await Promise.all(t.map(i=>i[1].then(async s=>{let c=i[0];if(!(n&&c>=await n)){if(s[0]>=z)throw[c,s];!r&&s[0]!==rt&&(r=[c,s],await Promise.all((o??[]).map(l=>{if(!(l[0]<=c))return l[1].then(u=>{if(u[0]===z)throw[l[0],u]})})))}})))}catch(i){return i}return e??r}a(yn,"settleTasks");function to(t,e,o,n,r,i){for(;n[0]===z;){let s=n[1],c=s.options;try{if((c.href||s.headers.has("Location"))&&(t.resolveRedirect(s),c.reloadDocument)||(c.reloadDocument?r[3]:r[1]>=20))return n;let l=t.buildLocation({...c,_fromLocation:e[0],_includeValidateSearch:!0}),u=l.maskedLocation??l;if(u.external){let f=s.clone();return f.options={...c},f.headers.set("Location",u.publicHref),t.resolveRedirect(f),r[3]?[z,f]:[z,f,u]}return[z,s,l]}catch(l){n=i?[lt,l]:Xe(o,l),i=!0}}return n}a(to,"materializeRedirect");async function Rn(t,e,o,n,r,i){let s=e[1],c=await r,l=!1,u=s.findIndex(p=>p._notFound),f=a(p=>p[1][0]===de?Ge(t,s,p,n.signal):p[0],"boundaryOf"),d=u<0?s.length:u;if((c?.[1][0]??0)>=z)d=0;else if(c){d=c[2]??=await f(c);for(let p of o){if(p[0]>=d)break;let m=await p[1];if(m[0]!==rt&&m[0]<z&&!("loaderData"in s[p[0]])){c=[p[0],m],d=c[2]=await f(c);break}}}for(let p of o){if(p[0]>=d)break;let m=await p[2];if(m){c=m;break}}if((c?.[1][0]??0)>=z){let p=c[1];if(p[0]!==z||p[1].options.reloadDocument||p[2])return Rt(t,e),p;l=!0,c=[0,[lt,new Error("Too many redirects")]]}let h=c?c[2]??await f(c):u;if(h>=0){let p=c?.[1],m=p?.[0],g=s[h],S=p?.[1],y=a(()=>{p&&(g._notFound=void 0,m===lt?g.status="error":(S.routeId=g.routeId,g.routeId===t.routeTree.id?(g.status="success",g._notFound=!0):g.status="notFound"),g.error=S,g.isFetching=!1)},"install");y(),p||i?.();let R=wt(t,g);try{await _t(p?Promise.resolve().then(()=>St(R,m===lt?"errorComponent":"notFoundComponent")):Promise.all([St(R),St(R,"notFoundComponent")]),n.signal)}catch(b){if(b===n.signal&&n.signal.aborted)return Rt(t,e),ht}p?l&&(n.abort(),await Promise.all([...o.map(b=>b[1]),...o.map(b=>b[2]),...(e[2]??[]).map(b=>b[1])]),Rt(t,e),U(t,s),y()):g.status="success"}return e}a(Rn,"reduceLane");async function _n(t,e,o,n=0,r=e[1].length){let i=e[1];for(let s=n;s<r;s++){let c=i[s],l=wt(t,c).options;if(l.head||l.scripts)try{let u={ssr:t.options.ssr,matches:i,match:c,params:c.params,loaderData:c.loaderData},[f,d]=await _t(Promise.all([l.head?.(u),l.scripts?.(u)]),o);c.meta=f?.meta,c.links=f?.links,c.headScripts=f?.scripts,c.styles=f?.styles,c.scripts=d}catch(u){if(u===o&&o.aborted)break;console.error(u)}if(c.status!=="success"||c._notFound)break}return e}a(_n,"projectLane");async function wn(t,e,o,n){let r=[e,o],i=n[0].signal,s;try{let c=t.stores.matches.get(),l=o.findIndex(y=>y._notFound);if(t.options.notFoundMode!=="root"&&l>=0){let y=await Ge(t,o,void 0,i,l);o[l]._notFound=void 0,o[y]._notFound=!0,l=y}let u=l<0?o.length:l+1,f=0;for(;f<u&&f!==l;){let y=o[f],R=n[2][f],b=c[f];if(R?.id!==y.id||R.status!=="success"||y.preload||b?.id!==y.id||b.status!=="success"||(f++,R._notFound||b._notFound))break}let d=[],h=n[6]??0,p=h?Promise.resolve(o[h-1]):void 0,m=a(()=>{for(let y=h;y<u&&!i.aborted;y++)p=Dr(t,r,y,d,p,n,f)},"planSuccessfulLane"),g=await Tr(t,r,n,u,m,f);if(g){if(n[4]=!0,u=g[0],g[1][0]===de){let y=await Ge(t,o,g,i);g[2]=y,u=Math.min(u,y+1)}else g[1][0]>=z&&(u=0);m()}if(!i.aborted&&!n[3]){let y=[];for(let[R,b]of t._flights??[])b[2]||(t._flights.delete(R),y.push(b[1]));for(let R of y)R.abort()}let S=Rn(t,r,d,n[0],yn(d,g,r[2]),n[7]);r[2]?.length&&(r[3]=yn(r[2],void 0,void 0,S.then(y=>zt(y)?0:fe(o).length,()=>0))),s=await S}catch(c){if(Rt(t,r),c===i&&i.aborted)return ht;throw c}return zt(s)?s:_n(t,s,i,n[6]===o.length?n[6]:0)}a(wn,"executeClientLane");function Je(t,e){if(t._tx!==e)return;let o=e[3],n=t.stores.matches.get(),r=t._pending;for(let i=0;i<o.length;i++){let s=o[i],c=s.status==="success"&&!s._notFound,l=n[i]?.id===s.id&&n[i]?.status==="pending";if(c&&!l)continue;let u=wt(t,s),f=c||s.invalid?0:u.options.pendingMs??t.options.defaultPendingMs,d=u.options.pendingComponent??t.options.defaultPendingComponent;if(!d||typeof f!="number"||f===1/0){r&&(r[0]=e,r[2]=0,r[4]=!0);return}let h=u.options.pendingMinMs??t.options.defaultPendingMinMs??0,p=!1;if(r?.[1]===s.id?(p=r[0]!==e,r[0]=e):(clearTimeout(r?.[3]),t._pending=r=void 0),r||(t._pending=r=[e,s.id,l?Date.now()+h:e[4]+f,void 0,l||void 0,d]),r[4]&&!p&&r[5]===d)return;if(r[5]=d,!r[4]){clearTimeout(r[3]);let S=r[2]-Date.now();if(S>0){r[3]=setTimeout(()=>Je(t,e),S);return}r[2]=0}let m=o.map(S=>({...S,_flight:void 0}));m[i].status="pending";let g=r[4]=t.startTransition(()=>t.stores.setMatches(m),m).then(S=>(S&&t._pending===r&&r[4]===g&&!r[2]&&(r[2]=Date.now()+h),S));return}}a(Je,"offerPending");function Vt(t,e){let o=t._pending;(t._tx===e||!t._tx?.[3].some(n=>n.id===o?.[1]))&&(clearTimeout(o?.[3]),t._pending=void 0)}a(Vt,"finishPending");async function vn(t,e){let o=t._pending;if(!o)return;clearTimeout(o[3]);let n=o[2]-Date.now();if(!o[4]||n<=0||!fe(e[3]).some(i=>i.id===o[1]))return;let r;try{await _t(new Promise(i=>{r=setTimeout(i,n)}),e[0].signal)}catch{}clearTimeout(r)}a(vn,"awaitPendingMinimum");function xn(t,e){t._committed=e,t.stores.setMatches(e)}a(xn,"publishMatches");function Ar(t,e,o,n){let r=t._committed,i=t._lifecycleEnd,s=t._cache;for(let f of o)f.preload=!1,n&&(f._assetEnd=void 0);let c=fe(o).length,l=new Map;{let f=Date.now(),d=new Set;for(let h=0;h<o.length;h++){let p=o[h];(h<c||p.status==="success")&&d.add(p.id)}for(let h of[...r,...s.values()]){if(h.status!=="success"||d.has(h.id))continue;let p=wt(t,h);!p.options.loader||f-h.updatedAt>=(h.preload?p.options.preloadGcTime??t.options.defaultPreloadGcTime??3e5:p.options.gcTime??t.options.defaultGcTime??3e5)||l.set(h.id,s.get(h.id)===h?h:{...h,_flight:void 0,isFetching:!1,context:{}})}}e[3]=[],t._cache=l;let u=t._lifecycleEnd=ln(o);xn(t,o),U(t,[...s.values(),...r].filter(f=>f._flight&&l.get(f.id)!==f),o),un(t,r,o,i,u,e)}a(Ar,"commitMatches");async function ue(t,e){let o=t._tx;for(;o&&o!==e;)e=o,await o[5],o=t._tx}a(ue,"awaitCurrent");function bn(t,e,o){let n=o[1].options,r=o[2];if(!r)return t.navigate({...n,replace:!0,ignoreBlocker:!0});if(n.reloadDocument)return t.navigate({href:(r.maskedLocation??r).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});r._redirects=e[1]+1,t._pendingLocation=r;let i=t.commitLocation({...r,viewTransition:n.viewTransition,replace:!0,resetScroll:n.resetScroll,hashScrollIntoView:n.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{t._pendingLocation===r&&(t._pendingLocation=void 0)}),i}a(bn,"followRedirect");async function $r(t,e,o,n,r){let i=o.map(l=>({...l}));Qe(i);for(let l of n)ct(t,i[l[0]]),i[l[0]]=l[3];let s=[e[2],i],c;try{c=await Rn(t,s,n,e[0],r)}catch(l){throw U(t,i),l}if(zt(c)){U(t,i),c[0]===z&&t._tx===e&&t._committed===o&&await bn(t,e,c);return}if(await _n(t,c,e[0].signal),t._tx!==e||t._committed!==o){U(t,i);return}for(let l of i){let u=t._cache.get(l.id);u?._flight&&u._flight===l._flight&&(t._cache.delete(l.id),ct(t,u))}xn(t,i),U(t,o,i)}a($r,"runBackground");async function Br(t,e,o,n,r,i){let s=await wn(t,e[2],e[3],[e[0],e[1],t._committed,void 0,r,o,i,n]);if(zt(s)){let d=s[0]===z&&t._tx===e;if((!d||s[1].options.reloadDocument)&&Vt(t,e),U(t,e[3]),e[3]=[],!d)return;if(t._tx!==e){Vt(t,e);return}await bn(t,e,s);return}let c=s[1];if(t._tx===e&&await vn(t,e),t._tx!==e){Vt(t,e),U(t,c),Rt(t,s);return}let l=e[2],u=vt(l,t.stores.resolvedLocation.get()),f=s[2];await t.startViewTransition(async()=>{if(t._tx===e&&await vn(t,e),t._tx!==e){Vt(t,e),U(t,c),Rt(t,s);return}let d=a(()=>{Vt(t,e),Ar(t,e,c,i),t._tx===e&&(t.emit({type:"onLoad",...u}),t._tx===e&&t.emit({type:"onBeforeRouteMount",...u}))},"commit"),h=await t.startTransition(d,c);if(t._tx!==e){Rt(t,s);return}f?.length&&$r(t,e,c,f,s[3]).catch(console.error),t.batch(()=>{t.stores.resolvedLocation.set(l),t.stores.status.set("idle"),t._tx===e&&t.emit({type:"onResolved",...u}),h&&t._tx===e&&t.emit({type:"onRendered",...u})}),t._tx===e&&(t._commitPromise?.resolve(),t._commitPromise=void 0)})}a(Br,"runClientTransaction");async function dn(t,e){let o=!1,n=t._tx,r=t.stores.resolvedLocation.get(),i=r??t.stores.location.get(),s=t.latestLocation,c=t._pendingLocation,l=c?.href===s.href?c._redirects??0:0,u=t._handoff,f=o?void 0:u?.[0](),d=new AbortController,h=t._preflight;if(t._preflight=d,!o&&!f&&u?.[1](),h?.abort(),!d.signal.aborted){let C=vt(s,r);t.emit({type:"onBeforeNavigate",...C}),d.signal.aborted||t.emit({type:"onBeforeLoad",...C})}if(d.signal.aborted){await ue(t,n);return}let p=i.href===s.href,m=d,g=t.matchRoutes(s,{_controller:d});Qe(g);let S=f?u[1](g):void 0;if(S?m=f:f?.abort(),d.signal.aborted){U(t,g),await ue(t,n);return}t._preflight=void 0;let y,R=a(()=>Br(t,w,p,()=>Je(t,w),e?.sync,S),"run"),b=e?.sync?new Promise(C=>y=C):Promise.resolve().then(R),w=[m,l,s,g,Date.now(),b.then(()=>ue(t,w))];if(t._tx=w,n){for(let C of t.stores.matches.get()){if(t._tx!==w)break;C.isFetching&&Wt(t,C,!1)}n[0].abort(),U(t,n[3],w[3],!0)}if(t._tx!==w){U(t,w[3]),w[3]=[],y?.(),await ue(t,w);return}t.batch(()=>{t.stores.status.set("pending"),t.stores.location.set(s)}),(S||!t._committed.length&&g[0]?.status!=="success"&&!g.some(C=>C._notFound))&&Je(t,w),y?.(R()),await w[5]}a(dn,"loadClientRoute");async function hn(t,e){let o=t.buildLocation(e);for(let n=0;;n++){let r=t._committed,i=new AbortController,s,c,l;try{try{s=t.matchRoutes(o,{_controller:i}),Qe(s),c=(t._preloads??=new Map).set(i,s),l=await wn(t,o,s,[i,n,r,!0])}finally{c&&(c=c.delete(i),U(t,s)),i.abort()}if(!zt(l))return l[1];if(!c||l.length<3)return;o=l[2]}catch(u){q(u)||console.error(u);return}}}a(hn,"preloadClientRoute");var eo="Error preloading route! \u261D\uFE0F";var he=class{static{a(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,this._branch=void 0;let o=this.options,n=!o?.path&&!o?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Y:this.parentRoute||ut();let r=n?Y:o?.path;r&&r!=="/"&&(r=Qt(r));let i=o?.id||r,s=n?Y:at((this.parentRoute.id==="__root__"?"":this.parentRoute.id)+"/"+(i??""));r==="__root__"&&(r="/");let c=s==="__root__"?"/":r===void 0?this.parentRoute.fullPath:at(this.parentRoute.fullPath+"/"+r);this._path=r,this._id=s,this._fullPath=c,this._to=H(c)},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=>Wo({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 oo=class extends he{static{a(this,"BaseRootRoute")}constructor(t){super(t)}};var no=T(B(),1);function Cn(t,e){let o=t.stores.location,n=new Set,r,i,s=a(c=>{Ye(t,e,c)||(r=c,n.forEach(l=>l()))},"update");return[()=>r??o.get(),c=>(n.size||(r=o.get(),i=o.subscribe(s).unsubscribe),n.add(c),()=>{n.delete(c),n.size||(i(),r=void 0)})]}a(Cn,"createLinkScope");var pt=no.createContext(void 0),Pn=no.createContext(void 0);var ve=T(B(),1);function En({update:t,notify:e,unwatched:o}){return{link:n,unlink:r,propagate:i,checkDirty:s,shallowPropagate:c};function n(u,f,d){let h=f.depsTail;if(h!==void 0&&h.dep===u)return;let p=h!==void 0?h.nextDep:f.deps;if(p!==void 0&&p.dep===u){p.version=d,f.depsTail=p;return}let m=u.subsTail;if(m!==void 0&&m.version===d&&m.sub===f)return;let g=f.depsTail=u.subsTail={version:d,dep:u,sub:f,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=g),h!==void 0?h.nextDep=g:f.deps=g,m!==void 0?m.nextSub=g:u.subs=g}function r(u,f=u.sub){let d=u.dep,h=u.prevDep,p=u.nextDep,m=u.nextSub,g=u.prevSub;return p!==void 0?p.prevDep=h:f.depsTail=h,h!==void 0?h.nextDep=p:f.deps=p,m!==void 0?m.prevSub=g:d.subsTail=g,g!==void 0?g.nextSub=m:(d.subs=m)===void 0&&o(d),p}function i(u){let f=u.nextSub,d;t:do{let h=u.sub,p=h.flags;if(p&60?p&12?p&4?!(p&48)&&l(u,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 m=h.subs;if(m!==void 0){let g=(u=m).nextSub;g!==void 0&&(d={value:f,prev:d},f=g);continue}}if((u=f)!==void 0){f=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){f=u.nextSub;continue t}break}while(!0)}function s(u,f){let d,h=0,p=!1;t:do{let m=u.dep,g=m.flags;if(f.flags&16)p=!0;else if((g&17)===17){if(t(m)){let S=m.subs;S.nextSub!==void 0&&c(S),p=!0}}else if((g&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=m.deps,f=m,++h;continue}if(!p){let S=u.nextDep;if(S!==void 0){u=S;continue}}for(;h--;){let S=f.subs,y=S.nextSub!==void 0;if(y?(u=d.value,d=d.prev):u=S,p){if(t(f)){y&&c(S),f=u.sub;continue}p=!1}else f.flags&=-33;f=u.sub;let R=u.nextDep;if(R!==void 0){u=R;continue t}}return p}while(!0)}function c(u){do{let f=u.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&e(f))}while((u=u.nextSub)!==void 0)}function l(u,f){let d=f.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}a(En,"createReactiveSystem");function In(t,e,o){let n=typeof t=="object",r=n?t:void 0;return{next:(n?t.next:t)?.bind(r),error:(n?t.error:e)?.bind(r),complete:(n?t.complete:o)?.bind(r)}}a(In,"toObserver");var ro=[],me=0,{link:Ln,unlink:zr,propagate:Ur,checkDirty:On,shallowPropagate:kn}=En({update(t){return t._update()},notify(t){ro[so++]=t,t.flags&=-3},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=17,ge(t))}}),pe=0,so=0,ot,io=0;function ao(t){try{++io,t()}finally{--io||co()}}a(ao,"batch");function ge(t){let e=t.depsTail,o=e!==void 0?e.nextDep:t.deps;for(;o!==void 0;)o=zr(o,t)}a(ge,"purgeDeps");function co(){if(!(io>0)){for(;pe<so;){let t=ro[pe];ro[pe++]=void 0,t.notify()}pe=0,so=0}}a(co,"flush");function ye(t,e){let o=typeof t=="function",n=t,r={_snapshot:o?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:o?0:1,get(){return ot!==void 0&&Ln(r,ot,me),r._snapshot},subscribe(i){let s=In(i),c={current:!1},l=Wr(()=>{r.get(),c.current?(ot=void 0,s.next?.(r._snapshot)):c.current=!0});return{unsubscribe:a(()=>{l.stop()},"unsubscribe")}},_update(i){let s=ot,c=e?.compare??Object.is;if(o)ot=r,++me,r.depsTail=void 0;else if(i===void 0)return!1;o&&(r.flags=5);try{let l=r._snapshot,u=typeof i=="function"?i(l):i===void 0&&o?n(l):i;return l===void 0||!c(l,u)?(r._snapshot=u,!0):!1}finally{ot=s,o&&(r.flags&=-5),ge(r)}}};return o?(r.flags=17,r.get=function(){let i=r.flags;if(i&16||i&32&&On(r.deps,r)){if(r._update()){let s=r.subs;s!==void 0&&kn(s)}}else i&32&&(r.flags=i&-33);return ot!==void 0&&Ln(r,ot,me),r._snapshot}):r.set=function(i){if(r._update(i)){let s=r.subs;s!==void 0&&(Ur(s),kn(s),co())}},r}a(ye,"createAtom");function Wr(t){let e=a(()=>{let n=ot;ot=o,++me,o.depsTail=void 0,o.flags=6;try{return t()}finally{ot=n,o.flags&=-5,ge(o)}},"run"),o={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let n=this.flags;n&16||n&32&&On(this.deps,this)?e():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,ge(this)}};return e(),o}a(Wr,"effect");function jr(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(let[n,r]of t)if(!e.has(n)||!Object.is(r,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();let o=Nn(t);if(o.length!==Nn(e).length)return!1;for(let n=0;n<o.length;n++)if(!Object.prototype.hasOwnProperty.call(e,o[n])||!Object.is(t[o[n]],e[o[n]]))return!1;return!0}a(jr,"shallow");function Nn(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}a(Nn,"getOwnKeys");var lo=T(B(),1),Fn=T(ur(),1);function Kr(t,e){return t===e}a(Kr,"defaultCompare");function W(t,e=n=>n,o){let n=o?.compare??Kr,r=(0,lo.useCallback)(s=>{let{unsubscribe:c}=t.subscribe(s);return c},[t]),i=(0,lo.useCallback)(()=>t.get(),[t]);return(0,Fn.useSyncExternalStoreWithSelector)(r,i,i,e,n)}a(W,"useSelector");var Tn={};function uo(t,e){let o=ve.useRef();return n=>{let r=t?.select?t.select(n):n;return t?.structuralSharing??e.options.defaultStructuralSharing?o.current=tt(o.current,r):r}}a(uo,"useStructuralSharing");function G(t){let e=M(),o=ve.useContext(t.from?Pn:pt),n=t.from??o,r=e.stores.getMatchStore(n);if(!1){let c=r.get();if(!c){(t.shouldThrow??!0)&&ut();return}return t.select?t.select(c):c}let i=uo(t,e),s=W(r,c=>c?i(c):Tn);if(s!==Tn)return s;(t.shouldThrow??!0)&&ut()}a(G,"useMatch");function Se(t){return G({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:a(e=>t.select?t.select(e.search):e.search,"select")})}a(Se,"useSearch");var jt=T(B(),1);var Re=jt.useLayoutEffect;var fo=T(B(),1);function _e(t){let e=M();return fo.useCallback(o=>e.navigate({...o,from:o.from??t?.from}),[t?.from,e])}a(_e,"useNavigate");var kt=T(B(),1),st=T(Q(),1);var xt=class extends kt.Component{static{a(this,"CatchBoundary")}constructor(...t){super(...t),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(t,e){let o=t.getResetKey();return e.error&&e.resetKey!==o?{resetKey:o,error:0}:{resetKey:o}}static getDerivedStateFromError(t){return{error:[t]}}componentDidCatch(t,e){this.props.onCatch?.(t,e)}render(){let t=this.state.error;return t?kt.createElement(this.props.errorComponent??ho,{error:t[0],reset:this.reset}):this.props.children}};function ho({error:t}){let[e,o]=kt.useState(!1);return(0,st.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,st.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,st.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,st.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:a(()=>o(n=>!n),"onClick"),children:e?"Hide Error":"Show Error"})]}),(0,st.jsx)("div",{style:{height:".25rem"}}),e?(0,st.jsx)("div",{children:(0,st.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t?.message?(0,st.jsx)("code",{children:t.message}):null})}):null]})}a(ho,"ErrorComponent");var po=T(B(),1),Dn=T(Q(),1);var Mn=a(()=>!0,"getSnapshot"),qr=a(()=>!1,"getServerSnapshot");function An({children:t,fallback:e=null}){return(0,Dn.jsx)(po.default.Fragment,{children:Gr()?t:e})}a(An,"ClientOnly");function Gr(t=!0){return po.default.useSyncExternalStore(Jr,Mn,t?qr:Mn)}a(Gr,"useHydrated");function Jr(){return()=>{}}a(Jr,"subscribe");function mo(t){return G({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:a(e=>t.select?t.select(e.loaderData):e.loaderData,"select")})}a(mo,"useLoaderData");function go(t){let{select:e,...o}=t;return G({...o,select:a(n=>e?e(n.loaderDeps):n.loaderDeps,"select")})}a(go,"useLoaderDeps");function yo(t){return G({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:a(e=>{let o=t.strict===!1?e.params:e._strictParams;return t.select?t.select(o):o},"select")})}a(yo,"useParams");function vo(t){return G({...t,select:a(e=>t.select?t.select(e.context):e.context,"select")})}a(vo,"useRouteContext");var A=T(B(),1);var Yr=T(Q(),1);function Xr(...t){let e=A.useRef(t),o=e.current;return t.forEach((n,r)=>{J(o[r],n,!1,!0)||(o[r]=n)}),e.current}a(Xr,"useStableValues");function we(t,e){t.preloadRoute(e).catch(o=>{console.warn(o),console.warn(eo)})}a(we,"preloadLink");function $n(t,e){let o=typeof t=="string"&&it(t);if(o)return e.has(o)?t:null}a($n,"resolveExternalLink");function Bn(t,e,o,n){let r=te(t.pathname,n),i=te(e.pathname,n);return(o?.exact?r!==i:!(r.startsWith(i)&&(r.length===i.length||r[i.length]==="/")))||(o?.includeSearch??!0)&&!J(t.search,e.search,!o?.exact,o?.explicitUndefined)?!1:!o?.includeHash||t.hash===e.hash}a(Bn,"resolveIsActive");function Zr(t,e,o){let n=M();if(!1)return es(n,t,e,o);let r=A.useRef(null),i=A.useCallback($=>{if(r.current=$,typeof e=="function")return e($);e&&(e.current=$)},[e]),{activeOptions:s,to:c,preload:l,preloadDelay:u,disabled:f,target:d,onClick:h,onBlur:p,onFocus:m,onMouseEnter:g,onMouseLeave:S,onTouchStart:y}=t,[R,b,w]=Xr(t.search,t.params,s),C=A.useContext(pt),_=(n.stores._linkScopes??={})[C]??=Cn(n,C),[v,x,P]=A.useMemo(()=>{let $=$n(c,n.protocolAllowlist);if($!==void 0){let nt=[$??void 0];return[t,()=>nt]}let K={...t},Gt,Ft,lr,Po=a(()=>{let nt=_[0]();if(nt!==Gt){K._fromLocation=nt;let Eo=n.buildLocation(K),Jt=Un(Eo,n,f),Lo=f||Jt&&!it(Jt)?Bn(nt,Eo,w,n.basepath):void 0;(!Ft||Ft[0]!==Jt||Ft[1]!==Lo)&&(Ft=[Jt,Lo]),Gt=nt}return Ft},"getLinkState");return[K,Po,w?.includeHash&&(()=>{let nt=Po();return nt[1]?lr??=[nt[0],!1]:nt})]},[n,_,t.from,t.hash,t.href,c,R,b,t.state,t.mask,t.unsafeRelative,w,f]),[L,k]=A.useSyncExternalStore(_[1],x,P||x),E=k===void 0&&L,O=f||L===void 0,F=A.useRef(!1),N=t.reloadDocument||E||O?!1:l??n.options.defaultPreload,D=u??n.options.defaultPreloadDelay??0,Nt=A.useCallback($=>{let K=$?.isIntersecting;if(!(K??N==="intent")){K===!1&&xe(r);return}if(!D){we(n,v);return}r.t??=setTimeout(()=>{r.t=void 0,we(n,v)},D)},[n,v,r,N,D]);A.useEffect(()=>{if(!N)return;N==="render"&&!F.current&&(F.current=!0,we(n,v));let $=!0,K;return N==="viewport"&&r.current&&typeof IntersectionObserver=="function"&&(K=new IntersectionObserver(Gt=>{$&&Nt(Gt.pop())},{rootMargin:"100px"}),K.observe(r.current)),()=>{$=!1,K?.disconnect(),xe(r)}},[n,v,N,Nt,r]);let Z=Hn(t,o);if(Z.ref=e?i:r,E)return Z.href=E,Z;let Ee=a($=>{let K=d??$.currentTarget.getAttribute("target");!O&&!($.metaKey||$.altKey||$.ctrlKey||$.shiftKey)&&!$.defaultPrevented&&(!K||K==="_self")&&$.button===0&&($.preventDefault(),xe(r),n.navigate({...t,_fromLocation:v._fromLocation}))},"handleClick"),cr=a(()=>{N==="intent"&&we(n,v)},"handleTouchStart"),Co=a(()=>{N==="intent"&&xe(r)},"handleLeave");return Z.onClick=It(h,Ee),Z.onBlur=It(p,Co),Z.onFocus=It(m,Nt),Z.onMouseEnter=It(g,Nt),Z.onMouseLeave=It(S,Co),Z.onTouchStart=It(y,cr),zn(Z,t,k,L,O,o)}a(Zr,"useLinkProps");var Qr={},ts={className:"active"},Vn=new Set(["to","params","search","hash","state","mask","from","unsafeRelative","reloadDocument","preload","preloadDelay","preloadIntentProximity","hashScrollIntoView","replace","startTransition","resetScroll","viewTransition","ignoreBlocker","activeProps","inactiveProps","activeOptions","_asChild"]);function Hn(t,e){let o={};for(let n in t)Vn.has(n)||n==="type"&&e!==void 0||n==="disabled"&&e==="a"||(o[n]=t[n]);return o}a(Hn,"collectElementProps");function zn(t,e,o,n,r,i){let{activeProps:s,inactiveProps:c,className:l,style:u,target:f}=e,d=mt(o?s:c,{})??(o?ts:Qr);Object.assign(t,d),t.href=n,i!=="a"&&(t.disabled=r),t.target=f;let h=d.style;(u||h)&&(t.style=u&&h?{...u,...h}:u||h);let p=d.className;return(l||p)&&(t.className=l?p?`${l} ${p}`:l:p),r&&(t.role="link",t["aria-disabled"]=!0),o&&(t["data-status"]="active",t["aria-current"]="page"),t}a(zn,"applyLinkState");function es(t,e,o,n){let{to:r,disabled:i,activeOptions:s}=e,c=$n(r,t.protocolAllowlist),l=c===void 0?t.buildLocation(e):void 0,u=l?Un(l,t,i):c??void 0,f=i||!u,d=c??(u&&it(u)?u:void 0),h=Hn(e,n);return h.ref=o,d?(h.href=d,h):zn(h,e,!!l&&!(!i&&!u)&&!s?.includeHash&&Bn(t.stores.location.get(),l,s,t.basepath),u,f,n)}a(es,"getServerLinkProps");var xe=a(t=>{clearTimeout(t.t),t.t=void 0},"cancelPreload"),It=a((t,e)=>t?o=>o.defaultPrevented||(t(o),o.defaultPrevented||e(o)):e,"composeHandlers");function Un(t,e,o){if(o)return;let n=t.maskedLocation??t,r=n.external?n.publicHref:e.history.createHref(n.publicHref)||"/";if(!((n.external||r!==n.publicHref)&&Dt(r,e.protocolAllowlist)))return r}a(Un,"getHrefOption");var So=A.memo(A.forwardRef((t,e)=>{let o=t._asChild||"a",n=Zr(t,e,o),r=typeof t.children=="function"?t.children({isActive:n["data-status"]==="active"}):t.children;return A.createElement(o,n,r)}),os);function os(t,e){let o=0;for(let n in e)if(o++,t[n]!==e[n]&&(!Vn.has(n)||!J(t[n],e[n],!1,!0)))return!1;for(let n in t)o--;return o===0}a(os,"areLinkPropsEqual");var Ro=T(B(),1),_o=T(Q(),1);var Wn=class extends he{static{a(this,"Route")}constructor(t){super(t),this.useMatch=e=>G({...e,from:this.id}),this.useRouteContext=e=>vo({...e,from:this.id}),this.useSearch=e=>Se({...e,from:this.id}),this.useParams=e=>yo({...e,from:this.id}),this.useLoaderDeps=e=>go({...e,from:this.id}),this.useLoaderData=e=>mo({...e,from:this.id}),this.useNavigate=()=>_e({from:this.fullPath}),this.Link=Ro.default.forwardRef((e,o)=>(0,_o.jsx)(So,{ref:o,from:this.fullPath,...e}))}};function ns(t){return new Wn(t)}a(ns,"createRoute");var jn=class extends oo{static{a(this,"RootRoute")}constructor(t){super(t),this.useMatch=e=>G({...e,from:this.id}),this.useRouteContext=e=>vo({...e,from:this.id}),this.useSearch=e=>Se({...e,from:this.id}),this.useParams=e=>yo({...e,from:this.id}),this.useLoaderDeps=e=>go({...e,from:this.id}),this.useLoaderData=e=>mo({...e,from:this.id}),this.useNavigate=()=>_e({from:this.fullPath}),this.Link=Ro.default.forwardRef((e,o)=>(0,_o.jsx)(So,{ref:o,from:this.fullPath,...e}))}};function rs(t){return new jn(t)}a(rs,"createRootRoute");var vc=T(B(),1);var be=T(Q(),1);function Kn(t){let e=M();if(!1){let n=`not-found-${e.stores.location.get().pathname}-${e.stores.status.get()}`;return(0,be.jsx)(xt,{getResetKey:a(()=>n,"getResetKey"),onCatch:a((r,i)=>{if(q(r))t.onCatch?.(r,i);else throw r},"onCatch"),errorComponent:a(({error:r})=>{if(q(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}let o=`not-found-${W(e.stores.location,n=>n.pathname)}-${W(e.stores.status)}`;return(0,be.jsx)(xt,{getResetKey:a(()=>o,"getResetKey"),onCatch:a((n,r)=>{if(q(n))t.onCatch?.(n,r);else throw n},"onCatch"),errorComponent:a(({error:n})=>{if(q(n))return t.fallback?.(n);throw n},"errorComponent"),children:t.children})}a(Kn,"CatchNotFound");function qn(){return(0,be.jsx)("p",{children:"Not Found"})}a(qn,"DefaultGlobalNotFound");var Gn=T(Q(),1);function Jn({children:t}){let e=M();return null}a(Jn,"ScriptOnce");var Pc=T(B(),1),Ce=T(Q(),1);function wo(t,e,o){return e.options.notFoundComponent?(0,Ce.jsx)(e.options.notFoundComponent,{...o}):t.options.defaultNotFoundComponent?(0,Ce.jsx)(t.options.defaultNotFoundComponent,{...o}):(0,Ce.jsx)(qn,{})}a(wo,"renderRouteNotFound");var Xn=T(Q(),1);function Yn(t){return null}a(Yn,"getScrollRestorationScriptForRouter");function Zn(){let t=M(),e=Yn(t);return e?(0,Xn.jsx)(Jn,{children:e}):null}a(Zn,"ScrollRestoration");var j=T(B(),1);var V=T(Q(),1);function Kt(t,e){let o=e?.options.pendingComponent??t.options.defaultPendingComponent;return o?(0,V.jsx)(o,{}):null}a(Kt,"renderPending");var ss=a((t,e)=>t[0]===e[0]&&t[1]===e[1],"outletMatchSelectionEqual"),tr=a((t,e,o)=>!e.isRoot||e.options.shellComponent||e.options.wrapInSuspense||o===!1||o==="data-only"||!t.ssr,"canWrapInSuspense"),Pe=j.memo(a(function({routeId:e}){let o=M();if(!1)return Qn(o,o.stores.byRoute.get(e).get());let n=o.stores.getMatchStore(e);return Qn(o,W(n))},"MatchImpl"));function Qn(t,e){let o=t.routesById[e.routeId],n=Kt(t,o),r=o.options.errorComponent??t.options.defaultErrorComponent,i=o.options.onCatch??t.options.defaultOnCatch,s=o.isRoot?o.options.notFoundComponent??t.options.notFoundRoute?.options.component:o.options.notFoundComponent,c=e.ssr===!1||e.ssr==="data-only",l=tr(t,o,e.ssr)&&(o.options.wrapInSuspense??n??(o.options.errorComponent?.preload||c)),u=(0,V.jsx)(is,{match:e});c&&(u=(0,V.jsx)(An,{fallback:n,children:u})),s&&(u=(0,V.jsx)(Kn,{fallback:a(h=>{if(h.routeId??=e.routeId,h.routeId!==e.routeId)throw h;return j.createElement(s,h)},"fallback"),children:u})),r&&(u=(0,V.jsx)(xt,{getResetKey:a(()=>e,"getResetKey"),errorComponent:r,onCatch:a((h,p)=>{if(q(h))throw h.routeId??=e.routeId,h;i?.(h,p)},"onCatch"),children:u})),l&&(u=(0,V.jsx)(j.Suspense,{fallback:n,children:u}));let f=null,d=o.isRoot&&o.options.shellComponent;return d?(0,V.jsx)(pt.Provider,{value:e.routeId,children:(0,V.jsxs)(d,{children:[u,f]})}):(0,V.jsxs)(pt.Provider,{value:e.routeId,children:[u,f]})}a(Qn,"matchView");var is=j.memo(a(function({match:e}){let o=M(),n=e.routeId,r=o.routesById[n],i=j.useMemo(()=>{let c=(r.options.remountDeps??o.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return c?JSON.stringify(c):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,o.options.defaultRemountDeps]),s=j.useMemo(()=>{let c=r.options.component??o.options.defaultComponent;return c?(0,V.jsx)(c,{},i):(0,V.jsx)(er,{})},[i,r.options.component,o.options.defaultComponent]);if(e.status==="pending"){if(o.ssr&&!tr(o,r,e.ssr))return s;if(o._tx)throw o._tx[5];return Kt(o,r)}if(e.status==="notFound")return wo(o,r,e.error);if(e.status==="error"){if(!1){let c=(r.options.errorComponent??o.options.defaultErrorComponent)||ho;return(0,V.jsx)(c,{error:e.error,reset:void 0,info:{componentStack:""}})}throw e.error}return s},"MatchInnerImpl")),er=j.memo(a(function(){let e=M(),o=j.useContext(pt),n,r,i;if(!1){let c=e.stores.matches.get(),l=c.findIndex(f=>f.routeId===o),u=c[l];n=!!u._notFound,r=u.error,i=c[l+1]?.routeId}else{let c=e.stores.getMatchStore(o);[n,r]=W(c,l=>[!!l._notFound,l.error],{compare:ss}),i=W(e.stores.ids,l=>l[l.indexOf(o)+1])}if(n)return wo(e,e.routesById[o],r);if(!i)return null;let s=(0,V.jsx)(Pe,{routeId:i});return o===Y?(0,V.jsx)(j.Suspense,{fallback:Kt(e),children:s}):s},"OutletImpl"));var xo=T(B(),1);function bo(t,e){let o=t[1];t.length=0,o?.(e)}a(bo,"settleOwner");function or({t}){let e=M(),o=e._rendered??=[],n=void 0;return e.startTransition=(r,i)=>new Promise(s=>{bo(o,!1),o.push(i,s),t(e),xo.startTransition(r)}),Re(()=>{let r=e.history.subscribe(e.load);if(n?.current)return r;n&&(n.current=!0),e.updateLatestLocation();let i=e.latestLocation,s=e.buildLocation({to:i.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(H(i.publicHref)!==H(s.publicHref))return e.commitLocation({...s,replace:!0,ignoreBlocker:!0}),r;let c=e.stores.resolvedLocation.get();return c?.href===i.href&&c.state.__TSR_key===i.state.__TSR_key?o.push(e.stores.matches.get(),l=>{l&&e.emit({type:"onRendered",...vt(c,c)})}):e._tx||e.load({sync:!0}).catch(console.error),r},[e,e.history]),null}a(or,"Transitioner");var Ot=T(B(),1);var X=T(Q(),1);function rr(){let t=M(),e=t.routesById[Y],o=Kt(t,e),n=(0,X.jsxs)(X.Fragment,{children:[!!1&&(0,X.jsx)(or,{t:Ot.useState()[1]}),t.ssr?(0,X.jsx)(nr,{}):(0,X.jsx)(Ot.Suspense,{fallback:o,children:(0,X.jsx)(nr,{})})]});return t.options.InnerWrap?(0,X.jsx)(t.options.InnerWrap,{children:n}):n}a(rr,"Matches");function nr(){let t=M(),e=t._rendered,o=W(t.stores.matches,s=>e[0]??s),n=o[0],r=n?.routeId;Re(()=>{e[0]===o&&bo(e,!0)},[e,o]);let i=r?(0,X.jsx)(Pe,{routeId:r}):null;return t.options.disableGlobalCatchBoundary?i:(0,X.jsx)(xt,{getResetKey:a(()=>n,"getResetKey"),onCatch:void 0,children:i})}a(nr,"MatchesInner");var sr=a(t=>({createMutableStore:ye,createReadonlyStore:ye,batch:ao}),"getStoreFactory");var as=a(t=>new ir(t),"createRouter"),ir=class extends Ke{static{a(this,"Router")}constructor(t){super(t,sr)}};var Sl=T(B(),1),qt=T(Q(),1);function ar({router:t,children:e,...o}){Tt(o)&&t.update({...t.options,...o,context:{...t.options.context,...o.context}});let n=(0,qt.jsx)(Yt.Provider,{value:t,children:e});return t.options.Wrap?(0,qt.jsx)(t.options.Wrap,{children:n}):n}a(ar,"RouterContextProvider");function cs({router:t,...e}){return(0,qt.jsx)(ar,{router:t,...e,children:(0,qt.jsx)(rr,{})})}a(cs,"RouterProvider");function ls(t){let e=M({warn:t?.router===void 0}),o=t?.router||e;if(!1){let n=o.stores.__store.get();return t?.select?t.select(n):n}return W(o.stores.__store,uo(t,o))}a(ls,"useRouterState");export{Ve as a,Lr as b,M as c,ao as d,ye as e,jr as f,W as g,Se as h,_e as i,ns as j,rs as k,er as l,as as m,cs as n,ls as o};
@@ -0,0 +1 @@
1
+ import{a as c}from"./chunk-ADABTCDI.js";import{b as e}from"./chunk-5PEAXTYQ.js";var t=e(r=>{"use strict";var u=c().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(_){return u.H.useMemoCache(_)}});var i=e((n,s)=>{"use strict";s.exports=t()});export{i as a};
@@ -0,0 +1 @@
1
+ import{a as i,b as a}from"./chunk-5PEAXTYQ.js";var x=a(u=>{"use strict";var m=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),V=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),J=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),K=Symbol.for("react.view_transition"),j=Symbol.iterator;function F(t){return t===null||typeof t!="object"?null:(t=j&&t[j]||t["@@iterator"],typeof t=="function"?t:null)}i(F,"getIteratorFn");var N={isMounted:i(function(){return!1},"isMounted"),enqueueForceUpdate:i(function(){},"enqueueForceUpdate"),enqueueReplaceState:i(function(){},"enqueueReplaceState"),enqueueSetState:i(function(){},"enqueueSetState")},g=Object.assign,$={};function E(t,e,n){this.props=t,this.context=e,this.refs=$,this.updater=n||N}i(E,"Component");E.prototype.isReactComponent={};E.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};E.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function h(){}i(h,"ComponentDummy");h.prototype=E.prototype;function C(t,e,n){this.props=t,this.context=e,this.refs=$,this.updater=n||N}i(C,"PureComponent");var d=C.prototype=new h;d.constructor=C;g(d,E.prototype);d.isPureReactComponent=!0;var w=Array.isArray;function R(){}i(R,"noop");var f={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function A(t,e,n){var r=n.ref;return{$$typeof:m,type:t,key:e,ref:r!==void 0?r:null,props:n}}i(A,"ReactElement");function tt(t,e){return A(t.type,e,t.props)}i(tt,"cloneAndReplaceKey");function S(t){return typeof t=="object"&&t!==null&&t.$$typeof===m}i(S,"isValidElement");function et(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}i(et,"escape");var P=/\/+/g;function T(t,e){return typeof t=="object"&&t!==null&&t.key!=null?et(""+t.key):e.toString(36)}i(T,"getElementKey");function nt(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(R,R):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}i(nt,"resolveThenable");function _(t,e,n,r,o){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var c=!1;if(t===null)c=!0;else switch(s){case"bigint":case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case m:case z:c=!0;break;case H:return c=t._init,_(c(t._payload),e,n,r,o)}}if(c)return o=o(t),c=r===""?"."+T(t,0):r,w(o)?(n="",c!=null&&(n=c.replace(P,"$&/")+"/"),_(o,e,n,"",function(q){return q})):o!=null&&(S(o)&&(o=tt(o,n+(o.key==null||t&&t.key===o.key?"":(""+o.key).replace(P,"$&/")+"/")+c)),e.push(o)),1;c=0;var l=r===""?".":r+":";if(w(t))for(var p=0;p<t.length;p++)r=t[p],s=l+T(r,p),c+=_(r,e,n,s,o);else if(p=F(t),typeof p=="function")for(t=p.call(t),p=0;!(r=t.next()).done;)r=r.value,s=l+T(r,p++),c+=_(r,e,n,s,o);else if(s==="object"){if(typeof t.then=="function")return _(nt(t),e,n,r,o);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return c}i(_,"mapIntoArray");function y(t,e,n){if(t==null)return t;var r=[],o=0;return _(t,r,"","",function(s){return e.call(n,s,o++)}),r}i(y,"mapChildren");function rt(t){if(t._status===-1){var e=t._result,n=e();n.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r,n.status===void 0&&(n.status="fulfilled",n.value=r))},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r,n.status===void 0&&(n.status="rejected",n.reason=r))}),t._status===-1&&(t._status=0,t._result=n)}if(t._status===1)return t._result.default;throw t._result}i(rt,"lazyInitializer");var O=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function I(t){var e=f.T,n={};n.types=e!==null?e.types:null,f.T=n;try{var r=t(),o=f.S;o!==null&&o(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(R,O)}catch(s){O(s)}finally{e!==null&&n.types!==null&&(e.types=n.types),f.T=e}}i(I,"startTransition");function k(t){var e=f.T;if(e!==null){var n=e.types;n===null?e.types=[t]:n.indexOf(t)===-1&&n.push(t)}else I(k.bind(null,t))}i(k,"addTransitionType");var ut={map:y,forEach:i(function(t,e,n){y(t,function(){e.apply(this,arguments)},n)},"forEach"),count:i(function(t){var e=0;return y(t,function(){e++}),e},"count"),toArray:i(function(t){return y(t,function(e){return e})||[]},"toArray"),only:i(function(t){if(!S(t))throw Error("React.Children.only expected to receive a single React element child.");return t},"only")};u.Activity=b;u.Children=ut;u.Component=E;u.Fragment=G;u.Profiler=B;u.PureComponent=C;u.StrictMode=W;u.Suspense=Z;u.ViewTransition=K;u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f;u.__COMPILER_RUNTIME={__proto__:null,c:i(function(t){return f.H.useMemoCache(t)},"c")};u.addTransitionType=k;u.cache=function(t){return function(){return t.apply(null,arguments)}};u.cacheSignal=function(){return null};u.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=g({},t.props),o=t.key;if(e!=null)for(s in e.key!==void 0&&(o=""+e.key),e)!Y.call(e,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&e.ref===void 0||(r[s]=e[s]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var c=Array(s),l=0;l<s;l++)c[l]=arguments[l+2];r.children=c}return A(t.type,o,r)};u.createContext=function(t){return t={$$typeof:V,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:Q,_context:t},t};u.createElement=function(t,e,n){var r,o={},s=null;if(e!=null)for(r in e.key!==void 0&&(s=""+e.key),e)Y.call(e,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(o[r]=e[r]);var c=arguments.length-2;if(c===1)o.children=n;else if(1<c){for(var l=Array(c),p=0;p<c;p++)l[p]=arguments[p+2];o.children=l}if(t&&t.defaultProps)for(r in c=t.defaultProps,c)o[r]===void 0&&(o[r]=c[r]);return A(t,s,o)};u.createRef=function(){return{current:null}};u.forwardRef=function(t){return{$$typeof:X,render:t}};u.isValidElement=S;u.lazy=function(t){return{$$typeof:H,_payload:{_status:-1,_result:t},_init:rt}};u.memo=function(t,e){return{$$typeof:J,type:t,compare:e===void 0?null:e}};u.startTransition=I;u.unstable_useCacheRefresh=function(){return f.H.useCacheRefresh()};u.use=function(t){return f.H.use(t)};u.useActionState=function(t,e,n){return f.H.useActionState(t,e,n)};u.useCallback=function(t,e){return f.H.useCallback(t,e)};u.useContext=function(t){return f.H.useContext(t)};u.useDebugValue=function(){};u.useDeferredValue=function(t,e){return f.H.useDeferredValue(t,e)};u.useEffect=function(t,e){return f.H.useEffect(t,e)};u.useEffectEvent=function(t){return f.H.useEffectEvent(t)};u.useId=function(){return f.H.useId()};u.useImperativeHandle=function(t,e,n){return f.H.useImperativeHandle(t,e,n)};u.useInsertionEffect=function(t,e){return f.H.useInsertionEffect(t,e)};u.useLayoutEffect=function(t,e){return f.H.useLayoutEffect(t,e)};u.useMemo=function(t,e){return f.H.useMemo(t,e)};u.useOptimistic=function(t,e){return f.H.useOptimistic(t,e)};u.useReducer=function(t,e,n){return f.H.useReducer(t,e,n)};u.useRef=function(t){return f.H.useRef(t)};u.useState=function(t){return f.H.useState(t)};u.useSyncExternalStore=function(t,e,n){return f.H.useSyncExternalStore(t,e,n)};u.useTransition=function(){return f.H.useTransition()};u.version="19.3.1"});var ot=a((lt,M)=>{"use strict";M.exports=x()});var U=a(v=>{"use strict";var st=Symbol.for("react.transitional.element"),it=Symbol.for("react.fragment");function L(t,e,n){var r=null;if(n!==void 0&&(r=""+n),e.key!==void 0&&(r=""+e.key),"key"in e){n={};for(var o in e)o!=="key"&&(n[o]=e[o])}else n=e;return e=n.ref,{$$typeof:st,type:t,key:r,ref:e!==void 0?e:null,props:n}}i(L,"jsxProd");v.Fragment=it;v.jsx=L;v.jsxs=L});var ft=a((at,D)=>{"use strict";D.exports=U()});export{ot as a,ft as b};
@@ -0,0 +1 @@
1
+ import{a as S}from"./chunk-HMMALUXM.js";import{a as q,b as A,c as M,d as w,e as C,f as E}from"./chunk-ZJIYJZ6F.js";import{a as L}from"./chunk-XV2XEUUB.js";import{B as g,j as v,r as N,s as j}from"./chunk-2ZJJH4YN.js";import"./chunk-PDBW6GTJ.js";import{a as I}from"./chunk-A6TVTNKO.js";import{a as H,b as R}from"./chunk-ADABTCDI.js";import{a as u,d as x}from"./chunk-5PEAXTYQ.js";var Q=x(I(),1),d=x(H(),1);var a=x(R(),1);var T={volume:"Request volume per function",latency:"Latency p50 / p95 per function",hotShards:"Hot shards"},O=Object.keys(T),P={error:null,loading:!0,rows:null},$=u(s=>Object.keys(s[0]??{}),"B"),U=u(s=>{let e=(0,Q.c)(22),{state:y,title:o}=s,l=g(),{error:t,loading:r,rows:n}=y,c;if(e[0]!==t||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==o){let b=n===null?[]:$(n),i;e[6]!==l||e[7]!==o?(i=l(o),e[6]=l,e[7]=o,e[8]=i):i=e[8];let p;e[9]!==i?(p=(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:i})}),e[9]=i,e[10]=p):p=e[10];let m;e[11]!==r||e[12]!==l?(m=r&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"analytics-loading",children:l("Loading\u2026")}),e[11]=r,e[12]=l,e[13]=m):m=e[13];let h;e[14]!==t||e[15]!==r?(h=!r&&t!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"analytics-error",role:"alert",children:t}),e[14]=t,e[15]=r,e[16]=h):h=e[16];let f;e[17]!==t||e[18]!==r||e[19]!==n||e[20]!==l?(f=!r&&t===null&&n!==null&&n.length===0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"analytics-empty-rows",children:l("No data points yet.")}),e[17]=t,e[18]=r,e[19]=n,e[20]=l,e[21]=f):f=e[21],c=(0,a.jsxs)(L,{className:"gap-0 py-0","data-testid":`analytics-panel-${o}`,children:[p,m,h,f,!r&&t===null&&n!==null&&n.length>0&&(0,a.jsxs)(q,{children:[(0,a.jsx)(A,{children:(0,a.jsx)(w,{children:b.map(W)})}),(0,a.jsx)(M,{children:n.map((V,B)=>(0,a.jsx)(w,{children:b.map(k=>(0,a.jsx)(E,{className:"font-mono text-xs",children:N(V[k])},k))},B))})]})]}),e[0]=t,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c}else c=e[5];return c},"V"),G=u(({runQuery:s}={})=>{let e=g(),[y,o]=(0,d.useState)({}),l=(0,d.useCallback)(async t=>{if(s!==void 0)for(let r of O){if(t.cancelled)return;o(n=>({...n,[r]:P}));try{let{rows:n}=await s(r);t.cancelled||o(c=>({...c,[r]:{error:null,loading:!1,rows:n}}))}catch(n){t.cancelled||o(c=>({...c,[r]:{error:v(n),loading:!1,rows:null}}))}}},[s]);return(0,d.useEffect)(()=>{let t={cancelled:!1};return j(l(t)),()=>{t.cancelled=!0}},[l]),s===void 0?(0,a.jsx)(S,{description:e("Analytics usage panels read through your worker, never from the browser. Pass studio.analyticsSqlQuery, a runner that calls an admin-only action running functionUsageQuery(panel) through ctx.analyticsSql, to enable these panels."),icon:(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"})}),testId:"analytics-not-configured",title:e("Analytics usage panels are not wired up.")}):(0,a.jsx)("div",{className:"flex flex-col gap-4","data-testid":"lunora-analytics-panel",children:O.map(t=>(0,a.jsx)(U,{state:y[t]??P,title:T[t]},t))})},"X");function W(s){return(0,a.jsx)(C,{children:s},s)}u(W,"$");export{G as AnalyticsPanel};
@@ -0,0 +1 @@
1
+ import{b as p,c as l}from"./chunk-4KPATTV6.js";import{a as h}from"./chunk-ADABTCDI.js";import{a as t,d as g}from"./chunk-5PEAXTYQ.js";var u=g(h(),1);var a={console:"`",palette:"k"},c="lunora-studio-shortcuts",r=new Set,w=t(o=>{let n=typeof o?.console=="string"?o.console.toLowerCase():void 0,s=typeof o?.palette=="string"?o.palette.toLowerCase():void 0;return n?.length===1&&s?.length===1&&n!==s?{console:n,palette:s}:a},"p"),e=a,m=t(()=>{e=w(p(c)[0]);for(let o of r)o()},"S");m();var y=t(o=>(r.add(o),()=>{r.delete(o)}),"g"),i=t(()=>e,"a"),S=t(()=>(0,u.useSyncExternalStore)(y,i,i),"w"),L=t((o,n)=>{if(n.length!==1)return;let s=n.toLowerCase(),f=o==="console"?"palette":"console";e=e[f]===s?{...e,[o]:s,[f]:e[o]}:{...e,[o]:s},l(c,[e]);for(let d of r)d()},"y"),v=t(()=>{e=a,l(c,[e]);for(let o of r)o()},"C");export{S as a,L as b,v as c};
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-WXZ334CL.js";import{a as S}from"./chunk-A6TVTNKO.js";import{a as P,b as G}from"./chunk-ADABTCDI.js";import{a as m,d as w}from"./chunk-5PEAXTYQ.js";var M=w(S(),1),v=w(P(),1);var N=w(G(),1);var z=m(r=>{let t=(0,M.c)(18),{count:a,offset:e,onOffsetChange:f,pageSize:o,prefix:s,total:n}=r;if(n===void 0)return null;let c=Math.max(0,Math.floor((n-1)/o)*o),p=e+a<n,x=e>0,i;t[0]!==e||t[1]!==f||t[2]!==o?(i=m(()=>{f(e+o)},"r"),t[0]=e,t[1]=f,t[2]=o,t[3]=i):i=t[3];let l;t[4]!==c||t[5]!==e||t[6]!==f||t[7]!==o?(l=m(()=>{f(Math.max(0,Math.min(e-o,c)))},"l"),t[4]=c,t[5]=e,t[6]=f,t[7]=o,t[8]=l):l=t[8];let h=a===0?0:e+a,g=a===0?0:e+1,u;return t[9]!==s||t[10]!==p||t[11]!==x||t[12]!==i||t[13]!==l||t[14]!==h||t[15]!==g||t[16]!==n?(u=(0,N.jsx)(d,{hasNext:p,hasPrevious:x,onNext:i,onPrevious:l,prefix:s,rangeEnd:h,rangeStart:g,total:n}),t[9]=s,t[10]=p,t[11]=x,t[12]=i,t[13]=l,t[14]=h,t[15]=g,t[16]=n,t[17]=u):u=t[17],u},"G"),A=m(r=>{let t=(0,M.c)(7),a;t[0]!==r?(a={offset:0,owner:r},t[0]=r,t[1]=a):a=t[1];let[e,f]=(0,v.useState)(a);e.owner!==r&&f({offset:0,owner:r});let o=e.owner===r?e.offset:0,s;t[2]!==r?(s=m(c=>{f({offset:c,owner:r})},"a"),t[2]=r,t[3]=s):s=t[3];let n;return t[4]!==o||t[5]!==s?(n=[o,s],t[4]=o,t[5]=s,t[6]=n):n=t[6],n},"N");export{z as a,A as b};
@@ -0,0 +1,5 @@
1
+ import{b as w}from"./chunk-BHUWAGFN.js";import{a as $}from"./chunk-JZN3MNJX.js";import{a as I,b as S,c as A,d as l,e as c,f as d}from"./chunk-ZJIYJZ6F.js";import{b as v}from"./chunk-NFI2TNKU.js";import{a as T,e as k}from"./chunk-XV2XEUUB.js";import{B as N,x as y}from"./chunk-2ZJJH4YN.js";import{a as W,b as j}from"./chunk-ADABTCDI.js";import{a,d as b}from"./chunk-5PEAXTYQ.js";var E=b(W(),1);var r=b(j(),1);var O={ERROR:"error",INFO:"info",WARN:"warning"},U=a(s=>{let n=typeof s.metadata.table=="string"?s.metadata.table:void 0;return{description:`${s.detail} ${s.remediation}`,entity:n,issueType:s.title,key:s.cacheKey,level:O[s.level],...s.suppressed===void 0?{}:{suppressed:{file:s.suppressed.file,line:s.suppressed.line,reason:s.suppressed.reason}}}},"P"),B=["error","warning","info"],D={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},H=a((s,n)=>({error:s("Errors"),info:s("Info"),warning:s("Warnings")})[n],"H"),L=a((s,n,i)=>({error:s("{count} errors",{count:i}),info:s("{count} suggestions",{count:i}),warning:s("{count} warnings",{count:i})})[n],"I"),z=a((s,n)=>({error:s("No errors detected"),info:s("No suggestions"),warning:s("No warnings detected")})[n],"W"),F=a(s=>{let n={error:0,info:0,warning:0};for(let i of s??[])n[i.level]+=1;return n},"j"),X=a(({error:s=null,errorSource:n,rows:i,shardKey:m,testId:o,toolbar:f})=>{let t=N(),p=v(),g=p!==void 0&&!p.unavailable,[u,R]=(0,E.useState)("error"),C=F(i),h=(i??[]).filter(e=>e.suppressed!==void 0).length,x=(i??[]).filter(e=>e.level===u),K=a(e=>{R(e.currentTarget.dataset.level)},"y");return(0,r.jsxs)("div",{className:"flex flex-col gap-3","data-testid":o,children:[(0,r.jsxs)("div",{className:"flex border-b border-border",role:"tablist",children:[B.map(e=>(0,r.jsxs)("button",{"aria-selected":u===e,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":e,"data-testid":`${o}-tab-${e}`,onClick:K,role:"tab",type:"button",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:y("size-2 rounded-sm",D[e])}),H(t,e)]}),(0,r.jsx)("span",{className:"ps-4 text-xs text-muted-foreground",children:L(t,e,C[e])})]},e)),h>0&&(0,r.jsx)("span",{className:"ms-auto self-center px-4 text-xs text-muted-foreground","data-testid":`${o}-suppressed-count`,children:t("{count} suppressed",{count:h})})]}),f!==void 0&&(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:f}),s!==null&&(0,r.jsx)($,{error:n??s,shardKey:m,testId:`${o}-error`}),(0,r.jsx)(T,{className:"overflow-hidden py-0",children:(0,r.jsx)(k,{className:"px-0",children:(0,r.jsxs)(I,{children:[(0,r.jsx)(S,{children:(0,r.jsxs)(l,{children:[(0,r.jsx)(c,{children:t("Issue type")}),(0,r.jsx)(c,{children:t("Entity/item")}),(0,r.jsx)(c,{children:t("Description")})]})}),(0,r.jsx)(A,{children:x.length===0?(0,r.jsx)(l,{children:(0,r.jsxs)(d,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${o}-empty`,children:[(0,r.jsx)("span",{className:"block text-sm font-medium text-foreground",children:z(t,u)}),(0,r.jsx)("span",{className:"block text-sm",children:t("Nothing to report for this deployment.")})]})}):x.map(e=>(0,r.jsxs)(l,{children:[(0,r.jsxs)(d,{className:"font-medium text-foreground",children:[e.issueType,e.suppressed!==void 0&&(0,r.jsx)(w,{className:"ms-2","data-testid":"advisor-suppressed-badge",title:e.suppressed.reason,variant:"outline",children:t("Suppressed")})]}),(0,r.jsx)(d,{className:"font-mono text-xs text-muted-foreground",children:e.entity??"\u2014"}),(0,r.jsxs)(d,{className:"text-muted-foreground",children:[(0,r.jsx)("span",{children:e.description}),e.suppressed!==void 0&&(0,r.jsx)("span",{className:"mt-1 block text-xs","data-testid":"advisor-suppressed-reason",children:t("Suppressed at {location}: {reason}",{location:`${e.suppressed.file}:${String(e.suppressed.line)}`,reason:e.suppressed.reason})}),(e.action!==void 0||g)&&(0,r.jsxs)("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.action,g&&(0,r.jsx)("button",{className:"text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"advisor-ask-assistant",onClick:a(()=>{p.openAssistant({ask:t(`The Lunora advisor reported: {finding}.
2
+
3
+ {description}
4
+
5
+ What does this mean for my app, and how should I fix it?`,{description:e.description,finding:e.entity===void 0?e.issueType:t("{issueType} on {entity}",{entity:e.entity,issueType:e.issueType})}),shardKey:m,suggestions:[t("How do I verify this is fixed?")],title:e.issueType})},"onClick"),type:"button",children:t("Ask the assistant")})]})]})]},e.key))})]})})})]})},"Q");export{U as a,X as b};
@@ -0,0 +1 @@
1
+ import{a as we,b as Ge}from"./chunk-QHVUXMRV.js";import{i as je,k as He}from"./chunk-2NUCBQFU.js";import{a as Ee,b as Pe,c as Ne,d as De,e as Be,g as Me,h as Fe}from"./chunk-2D4WBSDO.js";import{I as Se,J as Ve,K as Le,L as Te,M as Oe,N as _e,b as U,l as Ae}from"./chunk-4SY2N2RS.js";import{b as ve,c as Re}from"./chunk-SCTYLLJT.js";import{b as Ce,v as M}from"./chunk-OZID3UYF.js";import{b as ke,d as ge,e as ye,i as Ie,j as H}from"./chunk-L27FKJTG.js";import{x as he}from"./chunk-2ZJJH4YN.js";import{a as Et}from"./chunk-A6TVTNKO.js";import{a as A,b as xe}from"./chunk-ADABTCDI.js";import{a as i,c as It,d as C}from"./chunk-5PEAXTYQ.js";var Qe=C(Et(),1);var V={};It(V,{Indicator:()=>$e,Root:()=>Ye});var l=C(A(),1);function Ue(o){if(!o)return null;for(let e of o.elements){let r=e.tagName;if(r==="BUTTON"||r==="INPUT"){let a=e;if(a.type==="submit")return a}}return null}i(Ue,"getDefaultFormSubmitter");var qe="data-checked",We="data-unchecked";function q(o){return{checked(e){return o.indeterminate?{}:e?{[qe]:""}:{[We]:""}},...Ee}}i(q,"getCheckboxStateAttributesMapping");var ze=C(A(),1);function Ke(o,e,r,a=!0,s){let[f,p]=ze.useState(),P=U(s?`${s}-label`:void 0),b=o??e??f;return M(()=>{let x=o||e||!a?void 0:Nt(r.current,P);f!==x&&p(x)}),b}i(Ke,"useAriaLabelledBy");function Nt(o,e){let r=Dt(o);if(r)return!r.id&&e&&(r.id=e),r.id||void 0}i(Nt,"getAriaLabelledBy");function Dt(o){if(!o)return;let e=o.parentElement;if(e&&e.tagName==="LABEL")return e;let r=o.id;if(r){let s=o.nextElementSibling;if(s&&s.htmlFor===r)return s}let a=o.labels;return a&&a[0]}i(Dt,"findAssociatedLabel");var W=C(A(),1);var Bt=W.createContext(void 0);function Je(){return W.useContext(Bt)}i(Je,"useCheckboxGroupContext");var z=C(A(),1);var ie=z.createContext(void 0);function Xe(){let o=z.useContext(ie);if(o===void 0)throw new Error(ge(14));return o}i(Xe,"useCheckboxRootContext");var S=C(xe(),1);var At="data-parent",Ye=l.forwardRef(i(function(e,r){let{checked:a,className:s,defaultChecked:f=!1,"aria-labelledby":p,disabled:P=!1,form:b,id:x,indeterminate:N=!1,inputRef:X,name:L,onCheckedChange:F,parent:u=!1,readOnly:y=!1,render:ae,required:I=!1,uncheckedValue:T,value:O,nativeButton:_=!1,style:Mt,...Ze}=e,{clearErrors:et}=Ne(),{disabled:tt,name:ot,setDirty:rt,setFilled:se,setFocused:de,setTouched:nt,state:ce,validationMode:it,validityData:at,validation:st}=Pe(),dt=Me(),{labelId:ct,registerControlId:ut,getDescriptionProps:ue}=De(),n=Je(),k=n?.allValues===void 0?void 0:n.parent,w=k!==void 0,c=tt||dt.disabled||n?.disabled||P,E=ot??L,d=O??E,le=U(),lt=n?.registerControlId!==ut,Y=Be({id:x||void 0,enabled:lt}),ft=_?Y:le,$={};w&&(u?$=k.getParentProps():d!==void 0&&($=k.getChildProps(d)));let{checked:fe=a,indeterminate:pt=N,onCheckedChange:mt,...bt}=$,Q=n?.value,G=l.useRef(null),{getButtonProps:xt,buttonRef:ht}=Re({disabled:c,native:_}),D=n?.validation??st,[m,Ct]=Le({controlled:d!==void 0&&Q!==void 0&&!u?Q.includes(d):fe,default:f,name:"Checkbox",state:"checked"}),Z=w?!!fe:m,B=w&&pt||N;Fe(G,le,m,void 0,!n&&!c,L);let ee=k?.registerChildId,g=l.useRef(null),pe=D.registerInput,me=n?d:void 0,kt=l.useCallback(t=>pe(t,{controlRef:G,value:me}),[pe,me]),gt=ye(X,g,u?void 0:kt),vt=Ke(p,ct,g,!_,Y);M(()=>{g.current&&(g.current.indeterminate=B),n||se(m)},[m,B,n,se]),Te(m,()=>{n||(et(E),rt(m!==at.initialValue),D.change(m))});let Rt=ke({checked:m,disabled:c,form:b,name:u?void 0:E,id:_?void 0:Y,required:I,ref:gt,style:E?Ge:we,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(t){if(t.nativeEvent.defaultPrevented)return;if(y){t.preventDefault();return}let h=t.currentTarget.checked,v=_e(Oe.none,t.nativeEvent);if(F?.(h,v),!v.isCanceled&&(mt?.(h,v),!v.isCanceled&&(Ct(h),d!==void 0&&n!==void 0&&!u&&!w))){let R=h?[...n.value,d]:n.value.filter(j=>j!==d);n.setValue(R,v)}},onClick(t){t.stopPropagation()},onFocus(){G.current?.focus()}},O!==void 0?{value:(n?m&&O:O)||""}:Ie,ue,t=>D.getValidationProps(c,t));l.useEffect(()=>{if(!k||d===void 0)return;let t=k.disabledStatesRef.current;return t.set(d,c),()=>{t.delete(d)}},[k,c,d]);let te=l.useMemo(()=>({...ce,checked:Z,disabled:c,readOnly:y,required:I,indeterminate:B}),[ce,Z,c,y,I,B]),yt=q(te),be=H("span",e,{state:te,ref:[ht,G,r],props:[{id:ft,role:"checkbox","aria-checked":B?"mixed":Z,"aria-readonly":y||void 0,"aria-required":I||void 0,"aria-labelledby":vt,[At]:u?"":void 0,onFocus(){c||de(!0)},onBlur(){let t=g.current;t&&(nt(!0),de(!1),it==="onBlur"&&D.commit(n?Q:t.checked))},onKeyDown(t){if(t.key!=="Enter"||(t.preventBaseUIHandler(),t.defaultPrevented))return;let h=g.current?.form??null,v=t.currentTarget,R=t.nativeEvent,j=t.preventDefault,re=R.preventDefault,ne=!1;t.preventDefault=()=>{ne=!0,j.call(t)},R.preventDefault=()=>{ne=!0,re.call(R)},re.call(R),Ce(v).queueMicrotask(()=>{t.preventDefault=j,R.preventDefault=re,ne||Ue(h)?.click()})},onClick(t){if(y||c)return;t.preventDefault();let h=g.current;h&&ve(h,t)}},Ze,bt,xt,ue,t=>D.getValidationProps(c,t)],stateAttributesMapping:yt}),oe=be.props.id;return M(()=>{if(!(!ee||u||d===void 0||oe===void 0))return ee(d,oe)},[ee,u,d,oe]),(0,S.jsxs)(ie.Provider,{value:te,children:[be,!m&&!n&&E&&!u&&T!==void 0&&(0,S.jsx)("input",{type:"hidden",form:b,name:E,value:T,disabled:c}),(0,S.jsx)("input",{...Rt,suppressHydrationWarning:!0})]})},"CheckboxRoot"));var K=C(A(),1);var $e=K.forwardRef(i(function(e,r){let{render:a,className:s,style:f,keepMounted:p=!1,...P}=e,b=Xe(),x=b.checked||b.indeterminate,{mounted:N,transitionStatus:X,setMounted:L}=Ve(x),F=K.useRef(null),u={...b,transitionStatus:X};Se({batch:!0,enabled:!x,open:x,ref:F,onComplete(){x||L(!1)}});let ae={...q(b),...Ae},I=p||N,T=H("span",e,{ref:[r,F],state:u,stateAttributesMapping:ae,props:P});return I?T:null},"CheckboxIndicator"));var J=C(xe(),1);function Fo(o){let e=(0,Qe.c)(9),r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let s;e[3]!==r?(s=he("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",r),e[3]=r,e[4]=s):s=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,J.jsx)(V.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,J.jsx)(He,{icon:je,strokeWidth:2})}),e[5]=f):f=e[5];let p;return e[6]!==a||e[7]!==s?(p=(0,J.jsx)(V.Root,{"data-slot":"checkbox",className:s,...a,children:f}),e[6]=a,e[7]=s,e[8]=p):p=e[8],p}i(Fo,"v");export{Fo as a};
@@ -0,0 +1 @@
1
+ import{a as C}from"./chunk-CBTPJPCZ.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as $}from"./chunk-HMMALUXM.js";import{b as v}from"./chunk-BHUWAGFN.js";import"./chunk-L27FKJTG.js";import{a as j}from"./chunk-JZN3MNJX.js";import"./chunk-EYSF4DHD.js";import{a as I,b as _,c as q,d as p,e as o,f as i}from"./chunk-ZJIYJZ6F.js";import"./chunk-ELPLRD4S.js";import"./chunk-NFI2TNKU.js";import"./chunk-EOFWXI3T.js";import{a as g}from"./chunk-LYVYUTQY.js";import{c as h}from"./chunk-LRUYEVHH.js";import{a as K,e as S}from"./chunk-XV2XEUUB.js";import"./chunk-QFN62JQJ.js";import"./chunk-ZPQBVYNN.js";import{B as T,w as F}from"./chunk-2ZJJH4YN.js";import"./chunk-PDBW6GTJ.js";import{a as oe}from"./chunk-A6TVTNKO.js";import{a as ne,b as ie}from"./chunk-ADABTCDI.js";import{a as d,d as k}from"./chunk-5PEAXTYQ.js";var Q=k(oe(),1),G=k(ne(),1);var e=k(ie(),1);var H="agent_threads",de="agent_messages",L="agent_run_queue",J=100,N=250,le={},ce={filters:[],limit:J,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:H},c=d((s,t)=>{let a=s[t];return typeof a=="string"?a:void 0},"c"),B=d((s,t)=>{let a=s[t];return typeof a=="number"?a:void 0},"E"),O=d(s=>{let{usage:t}=s;if(t===null||typeof t!="object")return;let{totalTokens:a}=t;return typeof a=="number"?a:void 0},"H"),me=d(s=>{let{toolCalls:t}=s;return Array.isArray(t)?t.map(a=>a!==null&&typeof a=="object"?a.name:void 0).filter(a=>typeof a=="string"):[]},"de"),ue=d(s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},"le"),he=d(s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},"ie"),ge=d(s=>{let t=(0,Q.c)(3),{fetched:a}=s,m=T(),l;return t[0]!==a||t[1]!==m?(l=a<=N?null:(0,e.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"agents-messages-truncated",children:m("Showing the latest {count} messages; older ones are not shown.",{count:N})}),t[0]=a,t[1]=m,t[2]=l):l=t[2],l},"ce"),Te=d(({initialShardKey:s=""})=>{let t=T(),[a,m]=(0,G.useState)(void 0),{data:l}=h(g.listTables,le,{live:!0,shardKey:s}),V=l!==void 0,f=Array.isArray(l)&&l.some(r=>r.name===H),W=Array.isArray(l)&&l.some(r=>r.name===L),{data:E,error:X,errorSource:Y,liveError:Z}=h(g.readTablePage,ce,{enabled:f,live:!0,shardKey:s}),ee={filters:[{column:"threadKey",operator:"eq",value:a??""}],limit:N+1,offset:0,orderBy:{column:"seq",direction:"desc"},skipCount:!0,table:de},{data:P}=h(g.readTablePage,{limit:J,offset:0,orderBy:{column:"position",direction:"asc"},skipCount:!0,table:L},{enabled:W,live:!0,shardKey:s}),{data:U,error:te,errorSource:ae}=h(g.readTablePage,ee,{enabled:f&&a!==void 0,live:!0,shardKey:s}),b=Array.isArray(E?.rows)?E.rows:[],re=Array.isArray(P?.rows)?P.rows:[],z=d(r=>re.filter(n=>c(n,"threadKey")===r).length,"C"),M=Array.isArray(U?.rows)?U.rows:[],R=M.slice(0,N).toReversed(),D=b.find(r=>c(r,"key")===a),x;return V&&!f?x=(0,e.jsx)($,{description:t("No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents."),testId:"agents-unconfigured",title:t("No agents configured")}):f&&b.length===0?x=(0,e.jsx)($,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):x=(0,e.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,e.jsx)(K,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(I,{"data-testid":"agents-threads-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(o,{children:t("Agent")}),(0,e.jsx)(o,{children:t("Key")}),(0,e.jsx)(o,{children:t("Status")}),(0,e.jsx)(o,{children:t("Queued")}),(0,e.jsx)(o,{children:t("Messages")}),(0,e.jsx)(o,{children:t("Tokens")}),(0,e.jsx)(o,{children:t("Updated")}),(0,e.jsx)(o,{"aria-label":t("Actions")})]})}),(0,e.jsx)(q,{children:b.map(r=>{let n=c(r,"key")??"",u=c(r,"status"),y=O(r);return(0,e.jsxs)(p,{"data-active":n===a?"":void 0,"data-testid":`agents-thread-${n}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:c(r,"agent")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:n}),(0,e.jsx)(i,{children:(0,e.jsx)(v,{"data-testid":`agents-thread-status-${n}`,variant:ue(u),children:u??"\u2014"})}),(0,e.jsx)(i,{className:"tabular-nums",children:z(n)===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,e.jsx)(v,{"data-testid":`agents-thread-queued-${n}`,variant:"warning",children:z(n)})}),(0,e.jsx)(i,{className:"tabular-nums",children:B(r,"messageCount")??"\u2014"}),(0,e.jsx)(i,{className:"tabular-nums text-muted-foreground",children:y??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:F(B(r,"updatedAt"),"\u2014")}),(0,e.jsx)(i,{className:"text-right",children:(0,e.jsx)(C,{"data-testid":`agents-thread-open-${n}`,onClick:d(()=>{m(n)},"onClick"),size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},n)})})]})})}),te!==null&&(0,e.jsx)(j,{error:ae,shardKey:s,testId:"agents-messages-error"}),a!==void 0&&(0,e.jsx)(K,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:(0,e.jsxs)(S,{className:"flex flex-col gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t("Timeline")," \xB7 ",a,D!==void 0&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",t("Usage"),": ",O(D)??0," ",t("Tokens")]})]}),(0,e.jsx)(C,{"data-testid":"agents-thread-detail-close",onClick:d(()=>{m(void 0)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),(0,e.jsx)(ge,{fetched:M.length}),R.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):(0,e.jsxs)(I,{"data-testid":"agents-messages-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(o,{children:t("Role")}),(0,e.jsx)(o,{children:t("Content")}),(0,e.jsx)(o,{children:t("Tool")}),(0,e.jsx)(o,{children:t("Approval")})]})}),(0,e.jsx)(q,{children:R.map((r,n)=>{let u=c(r,"role")??"\u2014",y=me(r),se=c(r,"toolName"),w=c(r,"status"),A=B(r,"seq")??n;return(0,e.jsxs)(p,{"data-testid":`agents-message-${String(A)}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:u}),(0,e.jsx)(i,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:c(r,"content")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:se??(y.length>0?y.join(", "):"\u2014")}),(0,e.jsx)(i,{className:"align-top",children:w===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"}):(0,e.jsx)(v,{"data-testid":`agents-message-approval-${String(A)}`,variant:he(w),children:w})})]},c(r,"messageKey")??`${u}:${String(A)}`)})})]})]})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[X!==null&&(0,e.jsx)(j,{error:Y,shardKey:s,testId:"agents-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.")}),Z!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),x]})},"Ee");export{Te as default};
@@ -0,0 +1 @@
1
+ import{a as Ze}from"./chunk-CFQQHZYU.js";import{a as Me,b as Re}from"./chunk-JNWK5MJC.js";import{a as ke}from"./chunk-MNN3YCKF.js";import"./chunk-CP3LCFFM.js";import"./chunk-Y2YLTUMD.js";import"./chunk-CQDENTSP.js";import"./chunk-LMCBMC2V.js";import"./chunk-QF743FSL.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import{a as Ye}from"./chunk-2KTN53PK.js";import{a as Xe}from"./chunk-YLC2ZYCL.js";import{b as We}from"./chunk-EDL46BPM.js";import"./chunk-4KPATTV6.js";import{i as Ue}from"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import{i as Ae}from"./chunk-2D4WBSDO.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as be}from"./chunk-CBTPJPCZ.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as Qe}from"./chunk-HMMALUXM.js";import{b as je}from"./chunk-BHUWAGFN.js";import"./chunk-L27FKJTG.js";import{a as $e}from"./chunk-LYVYUTQY.js";import{a as qe,b as Ge,c as Ke,d as Pe,e as Le}from"./chunk-XV2XEUUB.js";import{n as Je}from"./chunk-QFN62JQJ.js";import"./chunk-ZPQBVYNN.js";import{B as Oe,h as ze,i as Ee,j as Fe,s as pe,x as De}from"./chunk-2ZJJH4YN.js";import"./chunk-PDBW6GTJ.js";import{a as st}from"./chunk-A6TVTNKO.js";import{a as nt,b as rt}from"./chunk-ADABTCDI.js";import{a as r,d as Be}from"./chunk-5PEAXTYQ.js";var we=Be(st(),1);var x=Be(nt(),1);var t=Be(rt(),1);var ot=ze($e.listTables),it=ze($e.listTableIndexes),dt=ze($e.readTablePage),ct=ze($e.describeTables),mt={},He=[],ut=r(s=>{let e=(0,we.c)(74),{initialShardKey:u,initialTable:n}=s,l=Je(),[a,m]=(0,x.useState)("graph"),{queryShardKey:c,setShardKey:d,shardKey:b}=Ye(u),[o,h]=(0,x.useState)(""),[i,y]=(0,x.useState)(null),[g,$]=(0,x.useState)(null),S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S={},e[0]=S):S=e[0];let[K,N]=(0,x.useState)(S),O;e[1]===Symbol.for("react.memo_cache_sentinel")?(O={},e[1]=O):O=e[1];let[E,P]=(0,x.useState)(O),[T,C]=(0,x.useState)(null),z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={},e[2]=z):z=e[2];let[F,fe]=(0,x.useState)(z),te;e[3]===Symbol.for("react.memo_cache_sentinel")?(te={},e[3]=te):te=e[3];let[_,j]=(0,x.useState)(te),[k,xe]=(0,x.useState)(null),[L,ce]=(0,x.useState)(null),le;e[4]===Symbol.for("react.memo_cache_sentinel")?(le={},e[4]=le):le=e[4];let[W,Ce]=(0,x.useState)(le),[X,me]=(0,x.useState)(null),ve=(0,x.useRef)(0),M;e[5]!==l?(M=r(async p=>{ve.current=ve.current+1;let v=ve.current;$(null);try{let w=await l.query(ot,{},Ee(p));if(v!==ve.current)return;We(p),y(w),N({}),P({}),C(null),fe(A=>Object.fromEntries(Object.entries(A).filter(I=>{let[ge]=I;return ge!==p}))),j(A=>Object.fromEntries(Object.entries(A).filter(I=>{let[ge]=I;return ge!==p})))}catch(w){let A=w;if(v!==ve.current)return;y(null),$(Fe(A))}},"D"),e[5]=l,e[6]=M):M=e[6];let B=M,ae;e[7]!==l?(ae=r(async()=>{ce(null);try{xe(await l.listGlobalTables())}catch(p){let v=p;xe(null),ce(Fe(v))}},"se"),e[7]=l,e[8]=ae):ae=e[8];let ue=ae,D,ne;e[9]!==c||e[10]!==B||e[11]!==ue?(D=r(()=>{pe(B(c)),pe(ue())},"R"),ne=[B,ue,c],e[9]=c,e[10]=B,e[11]=ue,e[12]=D,e[13]=ne):(D=e[12],ne=e[13]),(0,x.useEffect)(D,ne);let R;e[14]!==l||e[15]!==K||e[16]!==T||e[17]!==c?(R=r(async p=>{if(T===p){C(null);return}C(p);let v=`${c}:${p}`;if(K[v]!==void 0)return;let[w,A]=await Promise.allSettled([l.query(dt,{limit:1,offset:0,table:p},Ee(c)),l.query(it,{table:p},Ee(c))]);w.status==="fulfilled"?N(I=>({...I,[v]:w.value.columns})):$(Fe(w.reason)),A.status==="fulfilled"&&P(I=>({...I,[v]:A.value.indexes}))},"K"),e[14]=l,e[15]=K,e[16]=T,e[17]=c,e[18]=R):R=e[18];let se=R,re;e[19]!==l||e[20]!==W||e[21]!==X?(re=r(async p=>{if(X===p){me(null);return}if(me(p),W[p]===void 0)try{let v=await l.readGlobalTablePage({limit:1,offset:0,table:p});Ce(w=>({...w,[p]:v.columns}))}catch(v){ce(Fe(v))}},"oe"),e[19]=l,e[20]=W,e[21]=X,e[22]=re):re=e[22];let he=re,Y=(0,x.useRef)(void 0),Z,V;e[23]!==n||e[24]!==i||e[25]!==se?(Z=r(()=>{n===void 0||i===null||Y.current===n||i.some(p=>p.name===n)&&(Y.current=n,pe(se(n)))},"Q"),V=[n,i,se],e[23]=n,e[24]=i,e[25]=se,e[26]=Z,e[27]=V):(Z=e[26],V=e[27]),(0,x.useEffect)(Z,V);let oe;e[28]!==l?(oe=r(async(p,v,w)=>{let[A,I]=await Promise.all([Promise.allSettled([l.query(ct,{tables:[...v,...w]},Ee(p))]),Promise.all(w.map(async Q=>{let Se=await Promise.allSettled([l.readGlobalTablePage({limit:1,offset:0,table:Q})]),Ve=Se[0].status==="fulfilled"?Se[0].value:void 0;return{columns:Ve?.columns??[],refs:Ve?.refs??{},table:Q}}))]),ge=A[0].status==="fulfilled"?A[0].value?.columnsByTable??{}:{},_e=A[0].status==="rejected",Ie=new Map(I.map(ht)),G=[...v,...w].map(Q=>{let Se=ge[Q]??[];return[Q,Se.length>0?Se:Ie.get(Q)??[]]});fe(Q=>({...Q,[p]:Object.fromEntries(G)})),j(Q=>({...Q,[p]:_e}))},"ie"),e[28]=l,e[29]=oe):oe=e[29];let U=oe,ie,J;e[30]!==L||e[31]!==k||e[32]!==U||e[33]!==c||e[34]!==F||e[35]!==i||e[36]!==a?(ie=r(()=>{a!=="graph"||i===null||k===null&&L===null||F[c]!==void 0||pe(U(c,i.map(gt),(k??[]).map(pt)))},"re"),J=[a,i,k,L,c,F,U],e[30]=L,e[31]=k,e[32]=U,e[33]=c,e[34]=F,e[35]=i,e[36]=a,e[37]=ie,e[38]=J):(ie=e[37],J=e[38]),(0,x.useEffect)(ie,J);let q=F[c]??mt,H;if(e[39]!==q||e[40]!==k||e[41]!==i){let p;e[43]!==q?(p=r(I=>({columns:q[I.name]??He,name:I.name,tier:"shard"}),"h"),e[43]=q,e[44]=p):p=e[44];let v=(i??[]).map(p),w;e[45]!==q?(w=r(I=>({columns:q[I.name]??He,name:I.name,tier:"global"}),"N"),e[45]=q,e[46]=w):w=e[46];let A=(k??[]).map(w);H=[...v,...A],e[39]=q,e[40]=k,e[41]=i,e[42]=H}else H=e[42];let f=H,ee;if(e[47]!==o||e[48]!==i){let p=o.trim().toLowerCase();ee=(i??[]).filter(v=>v.name.toLowerCase().includes(p)),e[47]=o,e[48]=i,e[49]=ee}else ee=e[49];let de=ee,ye;if(e[50]!==k||e[51]!==o){let p=o.trim().toLowerCase();ye=(k??[]).filter(v=>v.name.toLowerCase().includes(p)),e[50]=k,e[51]=o,e[52]=ye}else ye=e[52];let Te=ye,Ne;return e[53]!==K||e[54]!==f||e[55]!==g||e[56]!==T||e[57]!==Te||e[58]!==de||e[59]!==W||e[60]!==L||e[61]!==X||e[62]!==k||e[63]!==E||e[64]!==B||e[65]!==d||e[66]!==_||e[67]!==b||e[68]!==o||e[69]!==i||e[70]!==se||e[71]!==he||e[72]!==a?(Ne={columns:K,diagramTables:f,error:g,expanded:T,filteredGlobalTables:Te,filteredTables:de,globalColumns:W,globalError:L,globalExpanded:X,globalTables:k,indexes:E,refresh:B,setShardKey:d,setTableFilter:h,setView:m,shardColumnsError:_,shardKey:b,tableFilter:o,tables:i,toggle:se,toggleGlobal:he,view:a},e[53]=K,e[54]=f,e[55]=g,e[56]=T,e[57]=Te,e[58]=de,e[59]=W,e[60]=L,e[61]=X,e[62]=k,e[63]=E,e[64]=B,e[65]=d,e[66]=_,e[67]=b,e[68]=o,e[69]=i,e[70]=se,e[71]=he,e[72]=a,e[73]=Ne):Ne=e[73],Ne},"mt");function ht(s){let{columns:e,refs:u,table:n}=s;return[n,e.map(l=>{let a=u[l];return a===void 0?{name:l,optional:!1,type:""}:{name:l,optional:!1,ref:a,type:"id"}})]}r(ht,"ut");function gt(s){return s.name}r(gt,"ft");function pt(s){return s.name}r(pt,"ht");var bt="/__lunora/schema-edit",ft=r(async s=>{let e=await fetch(bt,{body:JSON.stringify(s),headers:{"Content-Type":"application/json"},method:"POST"}),u=await e.json();return u.needsMigration===!0?{kind:"needs-migration",message:u.message??"This edit needs a migration."}:e.ok&&u.tables!==void 0?{diagnostics:u.diagnostics??[],kind:"ok",tables:u.tables}:{kind:"error",message:u.error??`schema edit failed (${String(e.status)})`}},"gt"),xt=r(s=>{let e=(0,we.c)(32),{hasTables:u,mode:n,onAddColumn:l,onAddIndex:a,onAddTable:m,onDestructive:c}=s,d=Oe(),b=n==="addTable"?"default":"outline",o;e[0]!==d?(o=d("Add table"),e[0]=d,e[1]=o):o=e[1];let h;e[2]!==m||e[3]!==b||e[4]!==o?(h=(0,t.jsx)(be,{"data-testid":"sc-editor-add-table",onClick:m,size:"xs",type:"button",variant:b,children:o}),e[2]=m,e[3]=b,e[4]=o,e[5]=h):h=e[5];let i=!u,y=n==="addColumn"?"default":"outline",g;e[6]!==d?(g=d("Add column"),e[6]=d,e[7]=g):g=e[7];let $;e[8]!==l||e[9]!==i||e[10]!==y||e[11]!==g?($=(0,t.jsx)(be,{"data-testid":"sc-editor-add-column",disabled:i,onClick:l,size:"xs",type:"button",variant:y,children:g}),e[8]=l,e[9]=i,e[10]=y,e[11]=g,e[12]=$):$=e[12];let S=!u,K=n==="addIndex"?"default":"outline",N;e[13]!==d?(N=d("Add index"),e[13]=d,e[14]=N):N=e[14];let O;e[15]!==a||e[16]!==N||e[17]!==S||e[18]!==K?(O=(0,t.jsx)(be,{"data-testid":"sc-editor-add-index",disabled:S,onClick:a,size:"xs",type:"button",variant:K,children:N}),e[15]=a,e[16]=N,e[17]=S,e[18]=K,e[19]=O):O=e[19];let E=!u,P=n==="destructive"?"default":"ghost",T;e[20]!==d?(T=d("Rename / drop / change type\u2026"),e[20]=d,e[21]=T):T=e[21];let C;e[22]!==c||e[23]!==E||e[24]!==P||e[25]!==T?(C=(0,t.jsx)(be,{"data-testid":"sc-editor-destructive",disabled:E,onClick:c,size:"xs",type:"button",variant:P,children:T}),e[22]=c,e[23]=E,e[24]=P,e[25]=T,e[26]=C):C=e[26];let z;return e[27]!==O||e[28]!==C||e[29]!==h||e[30]!==$?(z=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[h,$,O,C]}),e[27]=O,e[28]=C,e[29]=h,e[30]=$,e[31]=z):z=e[31],z},"bt"),vt=r(s=>{let e=(0,we.c)(28),{onOpenMigrations:u,result:n}=s,l=Oe();if(n===null){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(t.Fragment,{}),e[0]=o):o=e[0],o}if(n.kind==="error"){let o;return e[1]!==n.message?(o=(0,t.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"sc-editor-error",role:"alert",children:n.message}),e[1]=n.message,e[2]=o):o=e[2],o}if(n.kind==="needs-migration"){let o;e[3]!==n.message||e[4]!==l?(o=n.message===""?l("This edit changes stored data and must go through a migration. Review the migration before applying."):n.message,e[3]=n.message,e[4]=l,e[5]=o):o=e[5];let h;e[6]!==o?(h=(0,t.jsx)("p",{className:"text-sm text-warning",role:"alert",children:o}),e[6]=o,e[7]=h):h=e[7];let i;e[8]!==l?(i=l("Open Migrations"),e[8]=l,e[9]=i):i=e[9];let y;e[10]!==u||e[11]!==i?(y=(0,t.jsx)(be,{className:"self-start","data-testid":"sc-editor-open-migrations",onClick:u,size:"xs",type:"button",variant:"outline",children:i}),e[10]=u,e[11]=i,e[12]=y):y=e[12];let g;return e[13]!==h||e[14]!==y?(g=(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2","data-testid":"sc-editor-needs-migration",children:[h,y]}),e[13]=h,e[14]=y,e[15]=g):g=e[15],g}if(n.diagnostics.length===0){let o;return e[16]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(t.Fragment,{}),e[16]=o):o=e[16],o}let a;e[17]!==l?(a=l("Codegen reported diagnostics:"),e[17]=l,e[18]=a):a=e[18];let m;e[19]!==a?(m=(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:a}),e[19]=a,e[20]=m):m=e[20];let c;e[21]!==n.diagnostics?(c=n.diagnostics.map(yt),e[21]=n.diagnostics,e[22]=c):c=e[22];let d;e[23]!==c?(d=(0,t.jsx)("ul",{className:"flex flex-col gap-0.5",children:c}),e[23]=c,e[24]=d):d=e[24];let b;return e[25]!==m||e[26]!==d?(b=(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"sc-editor-diagnostics",children:[m,d]}),e[25]=m,e[26]=d,e[27]=b):b=e[27],b},"xt");function yt(s){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:s},s)}r(yt,"vt");var Nt=[{label:"string",validator:"v.string()"},{label:"number",validator:"v.number()"},{label:"boolean",validator:"v.boolean()"},{label:"bigint",validator:"v.bigint()"},{label:"bytes",validator:"v.bytes()"},{label:"any",validator:"v.any()"}],Ct="v.string()",Tt=r(s=>s.split(",").map(e=>e.trim()).filter(e=>e!==""),"Nt"),wt=r(s=>{let e=(0,we.c)(83),{onApplied:u,tableNames:n}=s,l=Oe(),a=Ue(),[m,c]=(0,x.useState)(null),[d,b]=(0,x.useState)(!1),[o,h]=(0,x.useState)(null),[i,y]=(0,x.useState)(""),[g,$]=(0,x.useState)(""),[S,K]=(0,x.useState)(Ct),[N,O]=(0,x.useState)(n[0]??""),[E,P]=(0,x.useState)(""),[T,C]=(0,x.useState)(""),[z,F]=(0,x.useState)(!1),fe;e[0]===Symbol.for("react.memo_cache_sentinel")?(fe=r(()=>{c(null),y(""),$(""),P(""),C(""),F(!1)},"pe"),e[0]=fe):fe=e[0];let te=fe,_;e[1]!==u?(_=r(async G=>{b(!0),h(null);try{let Q=await ft(G);h(Q),Q.kind==="ok"&&(u(Q.tables),te())}catch(Q){let Se=Q;h({kind:"error",message:Se instanceof Error?Se.message:String(Se)})}b(!1)},"E"),e[1]=u,e[2]=_):_=e[2];let j=_,k;e[3]!==j||e[4]!==i?(k=r(()=>{pe(j({kind:"addTable",table:i.trim()}))},"w"),e[3]=j,e[4]=i,e[5]=k):k=e[5];let xe=k,L;e[6]!==g||e[7]!==j||e[8]!==N||e[9]!==S?(L=r(()=>{pe(j({column:g.trim(),kind:"addOptionalColumn",table:N,validator:S}))},"B"),e[6]=g,e[7]=j,e[8]=N,e[9]=S,e[10]=L):L=e[10];let ce=L,le;e[11]!==T||e[12]!==E||e[13]!==j||e[14]!==N||e[15]!==z?(le=r(()=>{pe(j({fields:Tt(T),kind:"addIndex",name:E.trim(),table:N,unique:z}))},"le"),e[11]=T,e[12]=E,e[13]=j,e[14]=N,e[15]=z,e[16]=le):le=e[16];let W=le,Ce;e[17]===Symbol.for("react.memo_cache_sentinel")?(Ce=r(()=>{h(null),c("addTable")},"Ne"),e[17]=Ce):Ce=e[17];let X=Ce,me;e[18]===Symbol.for("react.memo_cache_sentinel")?(me=r(()=>{h(null),c("addColumn")},"me"),e[18]=me):me=e[18];let ve=me,M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M=r(()=>{h(null),c("addIndex")},"D"),e[19]=M):M=e[19];let B=M,ae;e[20]!==l?(ae=r(()=>{c("destructive"),h({kind:"needs-migration",message:l("This edit changes stored data and must go through a migration. Review the migration before applying.")})},"se"),e[20]=l,e[21]=ae):ae=e[21];let ue=ae,D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=r(G=>{y(G.target.value)},"R"),e[22]=D):D=e[22];let ne=D,R;e[23]===Symbol.for("react.memo_cache_sentinel")?(R=r(G=>{$(G.target.value)},"K"),e[23]=R):R=e[23];let se=R,re;e[24]===Symbol.for("react.memo_cache_sentinel")?(re=r(G=>{K(G.target.value)},"oe"),e[24]=re):re=e[24];let he=re,Y;e[25]===Symbol.for("react.memo_cache_sentinel")?(Y=r(G=>{O(G.target.value)},"X"),e[25]=Y):Y=e[25];let Z=Y,V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=r(G=>{P(G.target.value)},"U"),e[26]=V):V=e[26];let oe=V,U;e[27]===Symbol.for("react.memo_cache_sentinel")?(U=r(G=>{C(G.target.value)},"V"),e[27]=U):U=e[27];let ie=U,J;e[28]===Symbol.for("react.memo_cache_sentinel")?(J=r(G=>{F(G.target.checked)},"Y"),e[28]=J):J=e[28];let q=J,H;e[29]!==a?(H=r(()=>{pe(a({to:"/migrations"}))},"Z"),e[29]=a,e[30]=H):H=e[30];let f=H,ee;e[31]!==l?(ee=l("Edit schema"),e[31]=l,e[32]=ee):ee=e[32];let de;e[33]!==ee?(de=(0,t.jsx)(Ke,{children:ee}),e[33]=ee,e[34]=de):de=e[34];let ye;e[35]!==l?(ye=l("Adds a table, column, or index to lunora/schema.ts and reruns codegen."),e[35]=l,e[36]=ye):ye=e[36];let Te;e[37]!==ye?(Te=(0,t.jsx)(Pe,{children:ye}),e[37]=ye,e[38]=Te):Te=e[38];let Ne;e[39]!==de||e[40]!==Te?(Ne=(0,t.jsxs)(Ge,{children:[de,Te]}),e[39]=de,e[40]=Te,e[41]=Ne):Ne=e[41];let p=n.length>0,v;e[42]!==m||e[43]!==ue||e[44]!==p?(v=(0,t.jsx)(xt,{hasTables:p,mode:m,onAddColumn:ve,onAddIndex:B,onAddTable:X,onDestructive:ue}),e[42]=m,e[43]=ue,e[44]=p,e[45]=v):v=e[45];let w;e[46]!==d||e[47]!==m||e[48]!==xe||e[49]!==l||e[50]!==i?(w=m==="addTable"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-table-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(ke,{htmlFor:"sc-editor-table-name",children:l("Table name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-table-name",id:"sc-editor-table-name",onChange:ne,value:i})]}),(0,t.jsx)(be,{"data-testid":"sc-editor-table-apply",disabled:d||i.trim()==="",onClick:xe,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(be,{onClick:te,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[46]=d,e[47]=m,e[48]=xe,e[49]=l,e[50]=i,e[51]=w):w=e[51];let A;e[52]!==d||e[53]!==g||e[54]!==m||e[55]!==ce||e[56]!==l||e[57]!==n||e[58]!==N||e[59]!==S?(A=m==="addColumn"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-column-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(ke,{htmlFor:"sc-editor-column-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-table",id:"sc-editor-column-table",onChange:Z,value:N,children:n.map(St)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(ke,{htmlFor:"sc-editor-column-name",children:l("Column name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-column-name",id:"sc-editor-column-name",onChange:se,value:g})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(ke,{htmlFor:"sc-editor-column-type",children:l("Column type")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-type",id:"sc-editor-column-type",onChange:he,value:S,children:Nt.map(kt)})]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l("Optional")}),(0,t.jsx)(be,{"data-testid":"sc-editor-column-apply",disabled:d||g.trim()===""||N==="",onClick:ce,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(be,{onClick:te,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[52]=d,e[53]=g,e[54]=m,e[55]=ce,e[56]=l,e[57]=n,e[58]=N,e[59]=S,e[60]=A):A=e[60];let I;e[61]!==d||e[62]!==T||e[63]!==E||e[64]!==m||e[65]!==W||e[66]!==l||e[67]!==n||e[68]!==N||e[69]!==z?(I=m==="addIndex"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-index-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(ke,{htmlFor:"sc-editor-index-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-index-table",id:"sc-editor-index-table",onChange:Z,value:N,children:n.map(_t)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(ke,{htmlFor:"sc-editor-index-name",children:l("Index name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-index-name",id:"sc-editor-index-name",onChange:oe,value:E})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(ke,{htmlFor:"sc-editor-index-fields",children:l("Index fields (comma-separated)")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-index-fields",id:"sc-editor-index-fields",onChange:ie,value:T})]}),(0,t.jsxs)(ke,{className:"flex items-center gap-1 text-xs",htmlFor:"sc-editor-index-unique",children:[(0,t.jsx)("input",{checked:z,"data-testid":"sc-editor-index-unique",id:"sc-editor-index-unique",onChange:q,type:"checkbox"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:l("Unique")})]}),(0,t.jsx)(be,{"data-testid":"sc-editor-index-apply",disabled:d||E.trim()===""||T.trim()==="",onClick:W,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(be,{onClick:te,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[61]=d,e[62]=T,e[63]=E,e[64]=m,e[65]=W,e[66]=l,e[67]=n,e[68]=N,e[69]=z,e[70]=I):I=e[70];let ge;e[71]!==f||e[72]!==o?(ge=(0,t.jsx)(vt,{onOpenMigrations:f,result:o}),e[71]=f,e[72]=o,e[73]=ge):ge=e[73];let _e;e[74]!==v||e[75]!==w||e[76]!==A||e[77]!==I||e[78]!==ge?(_e=(0,t.jsxs)(Le,{children:[v,w,A,I,ge]}),e[74]=v,e[75]=w,e[76]=A,e[77]=I,e[78]=ge,e[79]=_e):_e=e[79];let Ie;return e[80]!==Ne||e[81]!==_e?(Ie=(0,t.jsxs)(qe,{"data-testid":"sc-editor",size:"sm",children:[Ne,_e]}),e[80]=Ne,e[81]=_e,e[82]=Ie):Ie=e[82],Ie},"Tt");function St(s){return(0,t.jsx)("option",{value:s,children:s},s)}r(St,"St");function kt(s){return(0,t.jsx)("option",{value:s.validator,children:s.label},s.validator)}r(kt,"wt");function _t(s){return(0,t.jsx)("option",{value:s,children:s},s)}r(_t,"_t");var et=[],It=r(s=>{let e=(0,we.c)(5),{open:u}=s,n=u&&"rotate-90",l;e[0]!==n?(l=De("size-3.5 shrink-0 text-muted-foreground transition-transform duration-150",n),e[0]=n,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[2]=a):a=e[2];let m;return e[3]!==l?(m=(0,t.jsx)("svg",{"aria-hidden":"true",className:l,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:a}),e[3]=l,e[4]=m):m=e[4],m},"Et"),tt=r(s=>{let e=(0,we.c)(20),{children:u,expanded:n,name:l,onToggle:a,rowCount:m,rowTestId:c,toggleTestId:d}=s,b;e[0]!==n?(b=(0,t.jsx)(It,{open:n}),e[0]=n,e[1]=b):b=e[1];let o;e[2]!==l?(o=(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l,children:l}),e[2]=l,e[3]=o):o=e[3];let h;e[4]!==m?(h=(0,t.jsxs)("span",{className:"ms-auto shrink-0 text-xs text-muted-foreground tabular-nums",children:["(",m,")"]}),e[4]=m,e[5]=h):h=e[5];let i;e[6]!==n||e[7]!==a||e[8]!==b||e[9]!==o||e[10]!==h||e[11]!==d?(i=(0,t.jsxs)("button",{"aria-expanded":n,className:"flex w-full items-center gap-2 px-3 py-2 text-start transition-colors hover:bg-muted/50 aria-expanded:bg-muted/40","data-testid":d,onClick:a,type:"button",children:[b,o," ",h]}),e[6]=n,e[7]=a,e[8]=b,e[9]=o,e[10]=h,e[11]=d,e[12]=i):i=e[12];let y;e[13]!==u||e[14]!==n?(y=n&&(0,t.jsx)("div",{className:"px-3 pb-3 ps-8",children:u}),e[13]=u,e[14]=n,e[15]=y):y=e[15];let g;return e[16]!==c||e[17]!==i||e[18]!==y?(g=(0,t.jsxs)("li",{className:"border-t border-border/60 first:border-t-0","data-testid":c,children:[i,y]}),e[16]=c,e[17]=i,e[18]=y,e[19]=g):g=e[19],g},"Je"),lt=r(s=>{let e=(0,we.c)(5),{columns:u,testId:n}=s,l;e[0]!==u?(l=u.map(zt),e[0]=u,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==n?(a=(0,t.jsx)("ul",{className:"flex flex-wrap gap-1.5 pt-1","data-testid":n,children:l}),e[2]=l,e[3]=n,e[4]=a):a=e[4],a},"We"),At=r(s=>{let e=(0,we.c)(10),{heading:u,indexes:n,testId:l}=s,a;e[0]!==u?(a=(0,t.jsx)("p",{className:"mb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:u}),e[0]=u,e[1]=a):a=e[1];let m;e[2]!==n?(m=n.map(Et),e[2]=n,e[3]=m):m=e[3];let c;e[4]!==m||e[5]!==l?(c=(0,t.jsx)("ul",{className:"flex flex-col gap-1","data-testid":l,children:m}),e[4]=m,e[5]=l,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==c?(d=(0,t.jsxs)("div",{className:"pt-3",children:[a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9],d},"It"),at=r(s=>De("border-b-2 px-3 py-2 font-mono text-[11px] tracking-widest uppercase outline-none transition-colors",s?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"Xe"),Xt=r(s=>{let e=(0,we.c)(85),{initialShardKey:u,initialTable:n,schemaEditable:l}=s,a=Oe(),m;e[0]!==u||e[1]!==n?(m={initialShardKey:u,initialTable:n},e[0]=u,e[1]=n,e[2]=m):m=e[2];let{columns:c,diagramTables:d,error:b,expanded:o,filteredGlobalTables:h,filteredTables:i,globalColumns:y,globalError:g,globalExpanded:$,globalTables:S,indexes:K,refresh:N,setShardKey:O,setTableFilter:E,setView:P,shardColumnsError:T,shardKey:C,tableFilter:z,tables:F,toggle:fe,toggleGlobal:te,view:_}=ut(m),j;e[3]!==P?(j=r(()=>{P("list")},"M"),e[3]=P,e[4]=j):j=e[4];let k=j,xe;e[5]!==P?(xe=r(()=>{P("graph")},"ge"),e[5]=P,e[6]=xe):xe=e[6];let L=xe,ce;e[7]!==E?(ce=r(f=>{E(f.target.value)},"ce"),e[7]=E,e[8]=ce):ce=e[8];let le=ce,W;e[9]!==N||e[10]!==C?(W=r(f=>{pe(N(C))},"J"),e[9]=N,e[10]=C,e[11]=W):W=e[11];let Ce=W,X;e[12]!==F?(X=F??[],e[12]=F,e[13]=X):X=e[13];let me;e[14]!==X?(me=X.map(Ft),e[14]=X,e[15]=me):me=e[15];let ve=me,M;e[16]!==O||e[17]!==C?(M=(0,t.jsx)(Xe,{onChange:O,testId:"sc-shard-input",value:C}),e[16]=O,e[17]=C,e[18]=M):M=e[18];let B;e[19]!==a?(B=a("Schema view"),e[19]=a,e[20]=B):B=e[20];let ae=_==="graph",ue=_==="graph",D;e[21]!==ue?(D=at(ue),e[21]=ue,e[22]=D):D=e[22];let ne;e[23]!==a?(ne=a("Graph"),e[23]=a,e[24]=ne):ne=e[24];let R;e[25]!==L||e[26]!==ae||e[27]!==D||e[28]!==ne?(R=(0,t.jsx)("button",{"aria-selected":ae,className:D,"data-testid":"sc-view-graph",onClick:L,role:"tab",type:"button",children:ne}),e[25]=L,e[26]=ae,e[27]=D,e[28]=ne,e[29]=R):R=e[29];let se=_==="list",re=_==="list",he;e[30]!==re?(he=at(re),e[30]=re,e[31]=he):he=e[31];let Y;e[32]!==a?(Y=a("Table list"),e[32]=a,e[33]=Y):Y=e[33];let Z;e[34]!==k||e[35]!==se||e[36]!==he||e[37]!==Y?(Z=(0,t.jsx)("button",{"aria-selected":se,className:he,"data-testid":"sc-view-list",onClick:k,role:"tab",type:"button",children:Y}),e[34]=k,e[35]=se,e[36]=he,e[37]=Y,e[38]=Z):Z=e[38];let V;e[39]!==R||e[40]!==Z||e[41]!==B?(V=(0,t.jsxs)("div",{"aria-label":B,className:"flex items-center gap-1","data-testid":"sc-view-toggle",role:"tablist",children:[R,Z]}),e[39]=R,e[40]=Z,e[41]=B,e[42]=V):V=e[42];let oe;e[43]!==V||e[44]!==M?(oe=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[M,V]}),e[43]=V,e[44]=M,e[45]=oe):oe=e[45];let U;e[46]!==Ce||e[47]!==l||e[48]!==ve?(U=l===!0&&(0,t.jsx)(wt,{onApplied:Ce,tableNames:ve}),e[46]=Ce,e[47]=l,e[48]=ve,e[49]=U):U=e[49];let ie;e[50]!==le||e[51]!==a||e[52]!==z||e[53]!==_?(ie=_==="list"&&(0,t.jsx)(Ae,{"aria-label":a("Filter tables"),className:"h-8 max-w-xs","data-testid":"sc-filter",onChange:le,placeholder:a("Filter tables"),value:z}),e[50]=le,e[51]=a,e[52]=z,e[53]=_,e[54]=ie):ie=e[54];let J;e[55]!==d||e[56]!==b||e[57]!==g||e[58]!==T||e[59]!==C||e[60]!==_?(J=_==="graph"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"sc-graph-view",children:[b!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:b}),g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:g}),(0,t.jsx)(Ze,{columnsError:T[C]===!0,tables:d,testIdPrefix:"sc-graph"})]}),e[55]=d,e[56]=b,e[57]=g,e[58]=T,e[59]=C,e[60]=_,e[61]=J):J=e[61];let q;e[62]!==c||e[63]!==b||e[64]!==o||e[65]!==h||e[66]!==i||e[67]!==y||e[68]!==g||e[69]!==$||e[70]!==S||e[71]!==K||e[72]!==C||e[73]!==a||e[74]!==F||e[75]!==fe||e[76]!==te||e[77]!==_?(q=_==="list"&&(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)(qe,{"data-testid":"sc-shard-section",size:"sm",children:[(0,t.jsxs)(Ge,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Re,{tier:"shard"}),(0,t.jsx)(Ke,{children:a("Shard tables")}),F!==null&&(0,t.jsx)(je,{className:"ms-auto tabular-nums",variant:"outline",children:i.length})]}),(0,t.jsx)(Pe,{children:Me.shard.hint})]}),(0,t.jsxs)(Le,{children:[b!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:b}),F!==null&&F.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-empty",children:a("No tables in this shard.")}),F!==null&&F.length>0&&i.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-no-match",children:a("No tables match your filter.")}),i.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-table-list",children:i.map(f=>{let ee=`${C}:${f.name}`,de=K[ee]??[];return(0,t.jsxs)(tt,{expanded:o===f.name,name:f.name,onToggle:r(()=>{pe(fe(f.name))},"onToggle"),rowCount:f.rowCount,rowTestId:`sc-table-${f.name}`,toggleTestId:`sc-toggle-${f.name}`,children:[(0,t.jsx)(lt,{columns:c[ee]??et,testId:`sc-columns-${f.name}`}),de.length>0&&(0,t.jsx)(At,{heading:a("Indexes"),indexes:de,testId:`sc-indexes-${f.name}`})]},f.name)})})]})]}),(0,t.jsxs)(qe,{"data-testid":"sc-global-section",size:"sm",children:[(0,t.jsxs)(Ge,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Re,{tier:"global"}),(0,t.jsx)(Ke,{children:a("Global tables (D1)")}),S!==null&&(0,t.jsx)(je,{className:"ms-auto tabular-nums",variant:"outline",children:h.length})]}),(0,t.jsx)(Pe,{children:Me.global.hint})]}),(0,t.jsxs)(Le,{children:[g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:g}),S!==null&&S.length===0&&(0,t.jsx)(Qe,{description:Me.global.hint,testId:"sc-global-empty",title:a("No global tables.")}),S!==null&&S.length>0&&h.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-global-no-match",children:a("No tables match your filter.")}),h.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-global-table-list",children:h.map(f=>(0,t.jsx)(tt,{expanded:$===f.name,name:f.name,onToggle:r(()=>{pe(te(f.name))},"onToggle"),rowCount:f.rowCount,rowTestId:`sc-global-table-${f.name}`,toggleTestId:`sc-global-toggle-${f.name}`,children:(0,t.jsx)(lt,{columns:y[f.name]??et,testId:`sc-global-columns-${f.name}`})},f.name))})]})]})]}),e[62]=c,e[63]=b,e[64]=o,e[65]=h,e[66]=i,e[67]=y,e[68]=g,e[69]=$,e[70]=S,e[71]=K,e[72]=C,e[73]=a,e[74]=F,e[75]=fe,e[76]=te,e[77]=_,e[78]=q):q=e[78];let H;return e[79]!==oe||e[80]!==U||e[81]!==ie||e[82]!==J||e[83]!==q?(H=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schema",children:[oe,U,ie,J,q]}),e[79]=oe,e[80]=U,e[81]=ie,e[82]=J,e[83]=q,e[84]=H):H=e[84],H},"Qt");function zt(s){return(0,t.jsx)("li",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:s},s)}r(zt,"kt");function Et(s){return(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,t.jsx)("span",{className:"font-mono",children:s.name}),(0,t.jsx)(je,{variant:"outline",children:s.type}),s.unique===!0&&(0,t.jsx)(je,{variant:"secondary",children:"unique"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:s.fields.join(", ")})]},`${s.type}:${s.name}`)}r(Et,"At");function Ft(s){return s.name}r(Ft,"$t");export{Xt as SchemaViewer};
@@ -0,0 +1 @@
1
+ import{b as i,j as a}from"./chunk-L27FKJTG.js";import{a as o}from"./chunk-ZPQBVYNN.js";import{x as n}from"./chunk-2ZJJH4YN.js";import{a as r}from"./chunk-5PEAXTYQ.js";function s(e){return a(e.defaultTagName??"div",e,e)}r(s,"useRender");var g=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function x({className:e,variant:t="default",render:d,...u}){return s({defaultTagName:"span",props:i({className:n(g({variant:t}),e)},u),render:d,state:{slot:"badge",variant:t}})}r(x,"f");export{s as a,x as b};
@@ -0,0 +1,4 @@
1
+ import{c as Ue}from"./chunk-R6NJ4ER6.js";import{a as ke}from"./chunk-ATBPQT7F.js";import{e as _e}from"./chunk-LOEVTOKP.js";import"./chunk-UL5XVKGR.js";import"./chunk-CQDENTSP.js";import"./chunk-LMCBMC2V.js";import"./chunk-QF743FSL.js";import{a as De}from"./chunk-ERUKFS3I.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import{a as Ee}from"./chunk-YLC2ZYCL.js";import"./chunk-EDL46BPM.js";import{a as $e}from"./chunk-W5BTAOHO.js";import"./chunk-4KPATTV6.js";import"./chunk-N7FOBAV3.js";import{i as Ke}from"./chunk-2D4WBSDO.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as ee}from"./chunk-CBTPJPCZ.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as ve}from"./chunk-HMMALUXM.js";import{b as ae}from"./chunk-BHUWAGFN.js";import"./chunk-L27FKJTG.js";import{a as Le,b as Ie,c as Re,d as de,e as te,f as X}from"./chunk-ZJIYJZ6F.js";import{a as xe}from"./chunk-LYVYUTQY.js";import{a as Fe,e as Oe}from"./chunk-XV2XEUUB.js";import{n as ze}from"./chunk-QFN62JQJ.js";import"./chunk-ZPQBVYNN.js";import{B as Te,h as pe,i as be,j as le,o as ye,s as Z,v as je}from"./chunk-2ZJJH4YN.js";import"./chunk-PDBW6GTJ.js";import{a as yt}from"./chunk-A6TVTNKO.js";import{a as bt,b as xt}from"./chunk-ADABTCDI.js";import{a as h,d as ge}from"./chunk-5PEAXTYQ.js";var B=ge(yt(),1),z=ge(bt(),1);var o=ge(xt(),1);var Ae=h((d,e,t)=>{let{onCopy:r,onDelete:l,onDownload:n,onToggleSelect:c}=t,i=h(()=>{r(d.key)},"c"),s=h(()=>{n(d.key)},"o"),u=h(()=>{l(d.key)},"f"),m=h(()=>{c(d.key)},"h");return{copy:i,download:s,name:d.key.slice(e.length),remove:u,toggle:m}},"Re"),We=h(d=>{let e=(0,B.c)(31),{busy:t,buttonClassName:r,copied:l,objectKey:n,onCopy:c,onDelete:i,onDownload:s,t:u}=d,m=`storage-copy-${n}`,f;e[0]!==l||e[1]!==u?(f=u(l?"Copied":"Copy URL"),e[0]=l,e[1]=u,e[2]=f):f=e[2];let g;e[3]!==t||e[4]!==r||e[5]!==c||e[6]!==m||e[7]!==f?(g=(0,o.jsx)(ee,{className:r,"data-testid":m,disabled:t,onClick:c,size:"sm",type:"button",variant:"ghost",children:f}),e[3]=t,e[4]=r,e[5]=c,e[6]=m,e[7]=f,e[8]=g):g=e[8];let w=`storage-download-${n}`,a;e[9]!==u?(a=u("Download"),e[9]=u,e[10]=a):a=e[10];let k;e[11]!==t||e[12]!==r||e[13]!==s||e[14]!==w||e[15]!==a?(k=(0,o.jsx)(ee,{className:r,"data-testid":w,disabled:t,onClick:s,size:"sm",type:"button",variant:"ghost",children:a}),e[11]=t,e[12]=r,e[13]=s,e[14]=w,e[15]=a,e[16]=k):k=e[16];let S;e[17]!==u?(S=u("Delete object?"),e[17]=u,e[18]=S):S=e[18];let x=`storage-delete-${n}`,b;e[19]!==u?(b=u("Delete"),e[19]=u,e[20]=b):b=e[20];let y;e[21]!==t||e[22]!==i||e[23]!==S||e[24]!==x||e[25]!==b?(y=(0,o.jsx)($e,{confirmLabel:S,disabled:t,onConfirm:i,testId:x,children:b}),e[21]=t,e[22]=i,e[23]=S,e[24]=x,e[25]=b,e[26]=y):y=e[26];let v;return e[27]!==y||e[28]!==g||e[29]!==k?(v=(0,o.jsxs)(o.Fragment,{children:[g,k,y]}),e[27]=y,e[28]=g,e[29]=k,e[30]=v):v=e[30],v},"ze"),He=h(d=>{let e=(0,B.c)(14),{objectKey:t,references:r,t:l}=d;if(r===void 0)return null;if(r.length===0){let m=`storage-orphan-${t}`,f;e[0]!==l?(f=l("Orphan"),e[0]=l,e[1]=f):f=e[1];let g;return e[2]!==m||e[3]!==f?(g=(0,o.jsx)(ae,{"data-testid":m,variant:"warning",children:f}),e[2]=m,e[3]=f,e[4]=g):g=e[4],g}let n;e[5]!==r?(n=r.map(vt).join(`
2
+ `),e[5]=r,e[6]=n):n=e[6];let c=n,i=`storage-refs-${t}`,s;e[7]!==r.length||e[8]!==l?(s=r.length===1?l("1 record"):l("{count} records",{count:r.length}),e[7]=r.length,e[8]=l,e[9]=s):s=e[9];let u;return e[10]!==c||e[11]!==i||e[12]!==s?(u=(0,o.jsx)(ae,{"data-testid":i,title:c,variant:"secondary",children:s}),e[10]=c,e[11]=i,e[12]=s,e[13]=u):u=e[13],u},"De"),Ze=h(d=>{let e=(0,B.c)(7),{objectKey:t,onToggle:r,selected:l,t:n}=d,c;e[0]!==n?(c=n("Select row"),e[0]=n,e[1]=c):c=e[1];let i=`storage-select-${t}`,s;return e[2]!==r||e[3]!==l||e[4]!==c||e[5]!==i?(s=(0,o.jsx)(ke,{"aria-label":c,checked:l,"data-testid":i,onCheckedChange:r}),e[2]=r,e[3]=l,e[4]=c,e[5]=i,e[6]=s):s=e[6],s},"je");function vt(d){return`${d.table}\xB7${d.id}`}h(vt,"kt");var kt=h(d=>{let e=(0,B.c)(10),{colSpan:t,name:r,onEnter:l}=d,n;e[0]!==r||e[1]!==l?(n=h(()=>{l(r)},"l"),e[0]=r,e[1]=l,e[2]=n):n=e[2];let c=n,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})}),e[3]=i):i=e[3];let s;e[4]!==c||e[5]!==r?(s=(0,o.jsxs)("button",{className:"inline-flex items-center gap-2 font-mono text-xs outline-none hover:text-foreground focus-visible:text-foreground","data-testid":"fb-folder",onClick:c,type:"button",children:[i,r]}),e[4]=c,e[5]=r,e[6]=s):s=e[6];let u;return e[7]!==t||e[8]!==s?(u=(0,o.jsx)(de,{children:(0,o.jsx)(X,{colSpan:t,children:s})}),e[7]=t,e[8]=s,e[9]=u):u=e[9],u},"St"),wt=h(d=>{let e=(0,B.c)(37),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,selected:s,showReferences:u,t:m}=d,f;e[0]!==l||e[1]!==n||e[2]!==c?(f=Ae(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=f):f=e[3];let{copy:g,download:w,name:a,remove:k,toggle:S}=f,x;e[4]!==n.key||e[5]!==s||e[6]!==m||e[7]!==S?(x=(0,o.jsx)(X,{className:"w-8",children:(0,o.jsx)(Ze,{objectKey:n.key,onToggle:S,selected:s,t:m})}),e[4]=n.key,e[5]=s,e[6]=m,e[7]=S,e[8]=x):x=e[8];let b;e[9]!==a?(b=(0,o.jsx)(X,{className:"font-mono text-xs",children:a}),e[9]=a,e[10]=b):b=e[10];let y;e[11]!==n.size?(y=ye(n.size),e[11]=n.size,e[12]=y):y=e[12];let v;e[13]!==y?(v=(0,o.jsx)(X,{className:"tabular-nums text-muted-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let j=n.httpMetadata?.contentType??"",N;e[15]!==j?(N=(0,o.jsx)(X,{children:j}),e[15]=j,e[16]=N):N=e[16];let C;e[17]!==n.key||e[18]!==i||e[19]!==u||e[20]!==m?(C=u&&(0,o.jsx)(X,{children:(0,o.jsx)(He,{objectKey:n.key,references:i,t:m})}),e[17]=n.key,e[18]=i,e[19]=u,e[20]=m,e[21]=C):C=e[21];let T=r===n.key,D;e[22]!==t||e[23]!==g||e[24]!==w||e[25]!==n.key||e[26]!==k||e[27]!==m||e[28]!==T?(D=(0,o.jsx)(X,{className:"text-right",children:(0,o.jsx)("span",{className:"inline-flex items-center gap-1",children:(0,o.jsx)(We,{busy:t,copied:T,objectKey:n.key,onCopy:g,onDelete:k,onDownload:w,t:m})})}),e[22]=t,e[23]=g,e[24]=w,e[25]=n.key,e[26]=k,e[27]=m,e[28]=T,e[29]=D):D=e[29];let F;return e[30]!==D||e[31]!==x||e[32]!==b||e[33]!==v||e[34]!==N||e[35]!==C?(F=(0,o.jsxs)(de,{"data-testid":"fb-row",children:[x,b,v,N,C,D]}),e[30]=D,e[31]=x,e[32]=b,e[33]=v,e[34]=N,e[35]=C,e[36]=F):F=e[36],F},"wt"),St=h(d=>{let e=(0,B.c)(65),{allSelected:t,busy:r,copiedKey:l,files:n,folders:c,handlers:i,onEnterFolder:s,prefix:u,references:m,selected:f,showReferences:g,someSelected:w,t:a,toggleSelectAll:k}=d,S;e[0]!==a?(S=a("Select all rows"),e[0]=a,e[1]=S):S=e[1];let x;e[2]!==t||e[3]!==w||e[4]!==S||e[5]!==k?(x=(0,o.jsx)(te,{className:"w-8",children:(0,o.jsx)(ke,{"aria-label":S,checked:t,"data-testid":"storage-select-all",indeterminate:w,onCheckedChange:k})}),e[2]=t,e[3]=w,e[4]=S,e[5]=k,e[6]=x):x=e[6];let b;e[7]!==a?(b=a("key"),e[7]=a,e[8]=b):b=e[8];let y;e[9]!==b?(y=(0,o.jsx)(te,{children:b}),e[9]=b,e[10]=y):y=e[10];let v;e[11]!==a?(v=a("size"),e[11]=a,e[12]=v):v=e[12];let j;e[13]!==v?(j=(0,o.jsx)(te,{children:v}),e[13]=v,e[14]=j):j=e[14];let N;e[15]!==a?(N=a("content-type"),e[15]=a,e[16]=N):N=e[16];let C;e[17]!==N?(C=(0,o.jsx)(te,{children:N}),e[17]=N,e[18]=C):C=e[18];let T;e[19]!==g||e[20]!==a?(T=g&&(0,o.jsx)(te,{children:a("used by")}),e[19]=g,e[20]=a,e[21]=T):T=e[21];let D;e[22]!==a?(D=a("Actions"),e[22]=a,e[23]=D):D=e[23];let F;e[24]!==D?(F=(0,o.jsx)(te,{"aria-label":D}),e[24]=D,e[25]=F):F=e[25];let $;e[26]!==F||e[27]!==x||e[28]!==y||e[29]!==j||e[30]!==C||e[31]!==T?($=(0,o.jsx)(Ie,{children:(0,o.jsxs)(de,{children:[x,y,j,C,T,F]})}),e[26]=F,e[27]=x,e[28]=y,e[29]=j,e[30]=C,e[31]=T,e[32]=$):$=e[32];let O;if(e[33]!==c||e[34]!==s||e[35]!==g){let E;e[37]!==s||e[38]!==g?(E=h(I=>(0,o.jsx)(kt,{colSpan:g?6:5,name:I,onEnter:s},I),"D"),e[37]=s,e[38]=g,e[39]=E):E=e[39],O=c.map(E),e[33]=c,e[34]=s,e[35]=g,e[36]=O}else O=e[36];let R;if(e[40]!==r||e[41]!==l||e[42]!==n||e[43]!==i||e[44]!==u||e[45]!==m||e[46]!==f||e[47]!==g||e[48]!==a){let E;e[50]!==r||e[51]!==l||e[52]!==i||e[53]!==u||e[54]!==m||e[55]!==f||e[56]!==g||e[57]!==a?(E=h(I=>(0,o.jsx)(wt,{busy:r,copiedKey:l,handlers:i,object:I,prefix:u,references:m[I.key],selected:f.has(I.key),showReferences:g,t:a},I.key),"D"),e[50]=r,e[51]=l,e[52]=i,e[53]=u,e[54]=m,e[55]=f,e[56]=g,e[57]=a,e[58]=E):E=e[58],R=n.map(E),e[40]=r,e[41]=l,e[42]=n,e[43]=i,e[44]=u,e[45]=m,e[46]=f,e[47]=g,e[48]=a,e[49]=R}else R=e[49];let L;e[59]!==O||e[60]!==R?(L=(0,o.jsxs)(Re,{children:[O,R]}),e[59]=O,e[60]=R,e[61]=L):L=e[61];let _;return e[62]!==$||e[63]!==L?(_=(0,o.jsx)(Fe,{className:"overflow-hidden py-0",children:(0,o.jsx)(Oe,{className:"px-0",children:(0,o.jsxs)(Le,{"data-testid":"fb-table",children:[$,L]})})}),e[62]=$,e[63]=L,e[64]=_):_=e[64],_},"Ct"),Nt=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],Ct=3600,Me=h((d,e)=>{if(e==="size")return d.size;if(e==="type")return d.httpMetadata?.contentType??"";if(e==="date"){if(d.uploaded===void 0)return 0;let t=new Date(d.uploaded).getTime();return Number.isNaN(t)?0:t}return e.startsWith("tag:")?d.customMetadata?.[e.slice(4)]??"":d.key},"we"),jt=h((d,e,t)=>{let r=t==="desc"?-1:1;return d.toSorted((l,n)=>{let c=Me(l,e),i=Me(n,e);return(typeof c=="number"&&typeof i=="number"?c-i:String(c).localeCompare(String(i)))*r})},"Et"),zt=h((d,e)=>{let t=new Set,r=[];for(let l of d){let n=l.key.slice(e.length),c=n.indexOf("/");c===-1?r.push(l):t.add(n.slice(0,c+1))}return{files:r,folders:[...t].toSorted((l,n)=>l.localeCompare(n))}},"_t"),Dt=h(d=>{let e=(0,B.c)(59),{bucket:t,buckets:r,busy:l,draftPrefix:n,expiry:c,fileInputRef:i,onBucketChange:s,onExpiryChange:u,onFileChange:m,onList:f,onPrefixChange:g,onUploadClick:w,t:a}=d,k;e[0]!==g?(k=h(A=>{g(A.target.value)},"v"),e[0]=g,e[1]=k):k=e[1];let S=k,x;e[2]!==s?(x=h(A=>{s(A.target.value)},"y"),e[2]=s,e[3]=x):x=e[3];let b=x,y;e[4]!==u?(y=h(A=>{u(Number.parseInt(A.target.value,10))},"b"),e[4]=u,e[5]=y):y=e[5];let v=y,j;e[6]!==t||e[7]!==r||e[8]!==b||e[9]!==a?(j=r.length>0&&(0,o.jsx)("select",{"aria-label":a("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:b,value:t,children:r.map($t)}),e[6]=t,e[7]=r,e[8]=b,e[9]=a,e[10]=j):j=e[10];let N;e[11]!==a?(N=a("Key prefix"),e[11]=a,e[12]=N):N=e[12];let C;e[13]!==a?(C=a("key prefix (optional)"),e[13]=a,e[14]=C):C=e[14];let T;e[15]!==n||e[16]!==S||e[17]!==N||e[18]!==C?(T=(0,o.jsx)(Ke,{"aria-label":N,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:S,placeholder:C,value:n}),e[15]=n,e[16]=S,e[17]=N,e[18]=C,e[19]=T):T=e[19];let D;e[20]!==a?(D=a("List"),e[20]=a,e[21]=D):D=e[21];let F;e[22]!==l||e[23]!==f||e[24]!==D?(F=(0,o.jsx)(ee,{"data-testid":"fb-list",disabled:l,onClick:f,size:"sm",type:"button",children:D}),e[22]=l,e[23]=f,e[24]=D,e[25]=F):F=e[25];let $;e[26]!==l||e[27]!==a?($=a(l?"Uploading\u2026":"Upload"),e[26]=l,e[27]=a,e[28]=$):$=e[28];let O;e[29]!==l||e[30]!==w||e[31]!==$?(O=(0,o.jsx)(ee,{"data-testid":"storage-upload",disabled:l,onClick:w,size:"sm",type:"button",variant:"outline",children:$}),e[29]=l,e[30]=w,e[31]=$,e[32]=O):O=e[32];let R;e[33]!==i||e[34]!==m?(R=(0,o.jsx)("input",{className:"hidden","data-testid":"storage-file-input",onChange:m,ref:i,type:"file"}),e[33]=i,e[34]=m,e[35]=R):R=e[35];let L;e[36]!==a?(L=a("Link expiry"),e[36]=a,e[37]=L):L=e[37];let _;e[38]!==a?(_=Nt.map(A=>(0,o.jsx)("option",{value:A.seconds,children:a(A.label)},A.seconds)),e[38]=a,e[39]=_):_=e[39];let E;e[40]!==c||e[41]!==v||e[42]!==_?(E=(0,o.jsx)("select",{className:"h-8 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":"storage-expiry",id:"storage-expiry",onChange:v,value:c,children:_}),e[40]=c,e[41]=v,e[42]=_,e[43]=E):E=e[43];let I;e[44]!==L||e[45]!==E?(I=(0,o.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[L,E]}),e[44]=L,e[45]=E,e[46]=I):I=e[46];let M;e[47]!==a?(M=a("Open in Cloudflare"),e[47]=a,e[48]=M):M=e[48];let P;e[49]!==M?(P=(0,o.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:Ue,rel:"noreferrer",target:"_blank",children:M}),e[49]=M,e[50]=P):P=e[50];let W;return e[51]!==O||e[52]!==R||e[53]!==I||e[54]!==P||e[55]!==j||e[56]!==T||e[57]!==F?(W=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[j,T,F,O,R,I,P]}),e[51]=O,e[52]=R,e[53]=I,e[54]=P,e[55]=j,e[56]=T,e[57]=F,e[58]=W):W=e[58],W},"$t"),Tt=h(d=>{let e=(0,B.c)(66),{onSortKeyChange:t,onThumbSizeChange:r,showGrid:l,showList:n,sortDirection:c,sortKey:i,t:s,tagKeys:u,thumbSize:m,toggleSortDirection:f,view:g}=d,w;e[0]!==t?(w=h(q=>{t(q.target.value)},"k"),e[0]=t,e[1]=w):w=e[1];let a=w,k;e[2]!==r?(k=h(q=>{r(Number.parseInt(q.target.value,10))},"v"),e[2]=r,e[3]=k):k=e[3];let S=k,x=g==="list",b;e[4]!==s?(b=s("List"),e[4]=s,e[5]=b):b=e[5];let y;e[6]!==n||e[7]!==x||e[8]!==b?(y=(0,o.jsx)("button",{"aria-pressed":x,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:n,type:"button",children:b}),e[6]=n,e[7]=x,e[8]=b,e[9]=y):y=e[9];let v=g==="grid",j;e[10]!==s?(j=s("Grid"),e[10]=s,e[11]=j):j=e[11];let N;e[12]!==l||e[13]!==v||e[14]!==j?(N=(0,o.jsx)("button",{"aria-pressed":v,className:"border-s border-border px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-grid",onClick:l,type:"button",children:j}),e[12]=l,e[13]=v,e[14]=j,e[15]=N):N=e[15];let C;e[16]!==y||e[17]!==N?(C=(0,o.jsxs)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[y,N]}),e[16]=y,e[17]=N,e[18]=C):C=e[18];let T;e[19]!==s?(T=s("Sort"),e[19]=s,e[20]=T):T=e[20];let D;e[21]!==s?(D=s("Name"),e[21]=s,e[22]=D):D=e[22];let F;e[23]!==D?(F=(0,o.jsx)("option",{value:"name",children:D}),e[23]=D,e[24]=F):F=e[24];let $;e[25]!==s?($=s("size"),e[25]=s,e[26]=$):$=e[26];let O;e[27]!==$?(O=(0,o.jsx)("option",{value:"size",children:$}),e[27]=$,e[28]=O):O=e[28];let R;e[29]!==s?(R=s("Type"),e[29]=s,e[30]=R):R=e[30];let L;e[31]!==R?(L=(0,o.jsx)("option",{value:"type",children:R}),e[31]=R,e[32]=L):L=e[32];let _;e[33]!==s?(_=s("Modified"),e[33]=s,e[34]=_):_=e[34];let E;e[35]!==_?(E=(0,o.jsx)("option",{value:"date",children:_}),e[35]=_,e[36]=E):E=e[36];let I;e[37]!==u?(I=u.map(Kt),e[37]=u,e[38]=I):I=e[38];let M;e[39]!==a||e[40]!==i||e[41]!==F||e[42]!==O||e[43]!==L||e[44]!==E||e[45]!==I?(M=(0,o.jsxs)("select",{className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-sort",id:"fb-sort",onChange:a,value:i,children:[F,O,L,E,I]}),e[39]=a,e[40]=i,e[41]=F,e[42]=O,e[43]=L,e[44]=E,e[45]=I,e[46]=M):M=e[46];let P;e[47]!==T||e[48]!==M?(P=(0,o.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[T,M]}),e[47]=T,e[48]=M,e[49]=P):P=e[49];let W;e[50]!==s?(W=s("Toggle sort direction"),e[50]=s,e[51]=W):W=e[51];let A=c==="asc"?"\u2191":"\u2193",H;e[52]!==W||e[53]!==A||e[54]!==f?(H=(0,o.jsx)("button",{"aria-label":W,className:"flex size-8 items-center justify-center rounded-md border border-border tabular-nums outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"fb-sort-dir",onClick:f,type:"button",children:A}),e[52]=W,e[53]=A,e[54]=f,e[55]=H):H=e[55];let V;e[56]!==S||e[57]!==s||e[58]!==m||e[59]!==g?(V=g==="grid"&&(0,o.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[s("Thumbnail size"),(0,o.jsx)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:S,step:8,type:"range",value:m})]}),e[56]=S,e[57]=s,e[58]=m,e[59]=g,e[60]=V):V=e[60];let re;return e[61]!==P||e[62]!==H||e[63]!==V||e[64]!==C?(re=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[C,P,H,V]}),e[61]=P,e[62]=H,e[63]=V,e[64]=C,e[65]=re):re=e[65],re},"Ft");function $t(d){return(0,o.jsx)("option",{value:d,children:d},d)}h($t,"Rt");function Kt(d){return(0,o.jsx)("option",{value:`tag:${d}`,children:d},d)}h(Kt,"zt");var Ft=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,Ot=h(d=>(d.httpMetadata?.contentType??"").startsWith("image/")||Ft.test(d.key),"jt"),Et=h(()=>{let d=(0,B.c)(1),e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-8 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"})}),d[0]=e):e=d[0],e},"Kt"),Lt=h(d=>{let e=(0,B.c)(13),{object:t,resolveUrl:r}=d,[l,n]=(0,z.useState)(null),[c,i]=(0,z.useState)(!1),s;e[0]!==t?(s=Ot(t),e[0]=t,e[1]=s):s=e[1];let u=s,m,f;e[2]!==u||e[3]!==t.key||e[4]!==r?(m=h(()=>{if(!u)return;let k={cancelled:!1};return Z((async()=>{try{let S=await r(t.key);k.cancelled||n(S)}catch{k.cancelled||i(!0)}})()),()=>{k.cancelled=!0}},"h"),f=[u,t.key,r],e[2]=u,e[3]=t.key,e[4]=r,e[5]=m,e[6]=f):(m=e[5],f=e[6]),(0,z.useEffect)(m,f);let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=h(()=>{i(!0)},"m"),e[7]=g):g=e[7];let w=g,a;return e[8]!==c||e[9]!==u||e[10]!==t.key||e[11]!==l?(a=(0,o.jsx)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:u&&l!==null&&!c?(0,o.jsx)("img",{alt:t.key,className:"size-full object-cover",loading:"lazy",onError:w,src:l}):(0,o.jsx)(Et,{})}),e[8]=c,e[9]=u,e[10]=t.key,e[11]=l,e[12]=a):a=e[12],a},"Bt"),It=h(d=>{let e=(0,B.c)(42),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,resolveUrl:s,selected:u,showReferences:m,t:f}=d,g;e[0]!==l||e[1]!==n||e[2]!==c?(g=Ae(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=g):g=e[3];let{copy:w,download:a,name:k,remove:S,toggle:x}=g,b;e[4]!==n||e[5]!==s?(b=(0,o.jsx)(Lt,{object:n,resolveUrl:s}),e[4]=n,e[5]=s,e[6]=b):b=e[6];let y;e[7]!==n.key||e[8]!==u||e[9]!==f||e[10]!==x?(y=(0,o.jsx)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,o.jsx)(Ze,{objectKey:n.key,onToggle:x,selected:u,t:f})}),e[7]=n.key,e[8]=u,e[9]=f,e[10]=x,e[11]=y):y=e[11];let v;e[12]!==b||e[13]!==y?(v=(0,o.jsxs)("div",{className:"relative",children:[b,y]}),e[12]=b,e[13]=y,e[14]=v):v=e[14];let j;e[15]!==k?(j=(0,o.jsx)("p",{className:"truncate font-mono text-xs",title:k,children:k}),e[15]=k,e[16]=j):j=e[16];let N;e[17]!==n.size?(N=ye(n.size),e[17]=n.size,e[18]=N):N=e[18];let C;e[19]!==N?(C=(0,o.jsx)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:N}),e[19]=N,e[20]=C):C=e[20];let T;e[21]!==n.key||e[22]!==i||e[23]!==m||e[24]!==f?(T=m&&(0,o.jsx)("div",{className:"mt-1",children:(0,o.jsx)(He,{objectKey:n.key,references:i,t:f})}),e[21]=n.key,e[22]=i,e[23]=m,e[24]=f,e[25]=T):T=e[25];let D;e[26]!==j||e[27]!==C||e[28]!==T?(D=(0,o.jsxs)("div",{className:"min-w-0",children:[j,C,T]}),e[26]=j,e[27]=C,e[28]=T,e[29]=D):D=e[29];let F=r===n.key,$;e[30]!==t||e[31]!==w||e[32]!==a||e[33]!==n.key||e[34]!==S||e[35]!==f||e[36]!==F?($=(0,o.jsx)("div",{className:"flex items-center gap-1",children:(0,o.jsx)(We,{busy:t,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:n.key,onCopy:w,onDelete:S,onDownload:a,t:f})}),e[30]=t,e[31]=w,e[32]=a,e[33]=n.key,e[34]=S,e[35]=f,e[36]=F,e[37]=$):$=e[37];let O;return e[38]!==$||e[39]!==v||e[40]!==D?(O=(0,o.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[v,D,$]}),e[38]=$,e[39]=v,e[40]=D,e[41]=O):O=e[41],O},"Lt"),Rt=h(d=>{let e=(0,B.c)(9),{name:t,onEnter:r}=d,l;e[0]!==t||e[1]!==r?(l=h(()=>{r(t)},"n"),e[0]=t,e[1]=r,e[2]=l):l=e[2];let n=l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,o.jsx)("span",{className:"flex aspect-square w-full items-center justify-center rounded-md border border-border bg-muted/30 transition-colors hover:bg-accent",children:(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-10 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})})}),e[3]=c):c=e[3];let i;e[4]!==t?(i=(0,o.jsx)("span",{className:"truncate font-mono text-xs",title:t,children:t}),e[4]=t,e[5]=i):i=e[5];let s;return e[6]!==n||e[7]!==i?(s=(0,o.jsxs)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:n,type:"button",children:[c,i]}),e[6]=n,e[7]=i,e[8]=s):s=e[8],s},"It"),_t=h(d=>{let e=(0,B.c)(34),{busy:t,copiedKey:r,files:l,folders:n,handlers:c,onEnterFolder:i,prefix:s,references:u,resolveUrl:m,selected:f,showReferences:g,size:w,t:a}=d,k;e[0]!==w?(k=w.toString(),e[0]=w,e[1]=k):k=e[1];let S=`repeat(auto-fill, minmax(${k}px, 1fr))`,x;e[2]!==S?(x={gridTemplateColumns:S},e[2]=S,e[3]=x):x=e[3];let b=x,y;if(e[4]!==n||e[5]!==i){let N;e[7]!==i?(N=h(C=>(0,o.jsx)(Rt,{name:C,onEnter:i},C),"w"),e[7]=i,e[8]=N):N=e[8],y=n.map(N),e[4]=n,e[5]=i,e[6]=y}else y=e[6];let v;if(e[9]!==t||e[10]!==r||e[11]!==l||e[12]!==c||e[13]!==s||e[14]!==u||e[15]!==m||e[16]!==f||e[17]!==g||e[18]!==a){let N;e[20]!==t||e[21]!==r||e[22]!==c||e[23]!==s||e[24]!==u||e[25]!==m||e[26]!==f||e[27]!==g||e[28]!==a?(N=h(C=>(0,o.jsx)(It,{busy:t,copiedKey:r,handlers:c,object:C,prefix:s,references:u[C.key],resolveUrl:m,selected:f.has(C.key),showReferences:g,t:a},C.key),"w"),e[20]=t,e[21]=r,e[22]=c,e[23]=s,e[24]=u,e[25]=m,e[26]=f,e[27]=g,e[28]=a,e[29]=N):N=e[29],v=l.map(N),e[9]=t,e[10]=r,e[11]=l,e[12]=c,e[13]=s,e[14]=u,e[15]=m,e[16]=f,e[17]=g,e[18]=a,e[19]=v}else v=e[19];let j;return e[30]!==b||e[31]!==y||e[32]!==v?(j=(0,o.jsxs)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[y,v]}),e[30]=b,e[31]=y,e[32]=v,e[33]=j):j=e[33],j},"Ot"),Ut=h(d=>{let e=(0,B.c)(23),{reference:t,t:r}=d,l=`fb-dangling-${t.table}-${t.id}-${t.column}`,n=`${t.table}\xB7${t.id}`,c;e[0]!==n?(c=(0,o.jsx)(ae,{variant:"secondary",children:n}),e[0]=n,e[1]=c):c=e[1];let i;e[2]!==t.column?(i=(0,o.jsx)("span",{className:"text-muted-foreground",children:t.column}),e[2]=t.column,e[3]=i):i=e[3];let s;e[4]!==r?(s=r("\u2192"),e[4]=r,e[5]=s):s=e[5];let u;e[6]!==s?(u=(0,o.jsx)("span",{className:"text-muted-foreground/60",children:s}),e[6]=s,e[7]=u):u=e[7];let m;e[8]!==t.key?(m=(0,o.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:t.key}),e[8]=t.key,e[9]=m):m=e[9];let f;e[10]!==c||e[11]!==i||e[12]!==u||e[13]!==m?(f=(0,o.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[c,i,u,m]}),e[10]=c,e[11]=i,e[12]=u,e[13]=m,e[14]=f):f=e[14];let g;e[15]!==r?(g=r("Missing object"),e[15]=r,e[16]=g):g=e[16];let w;e[17]!==g?(w=(0,o.jsx)(ae,{className:"border-destructive/40 text-destructive",variant:"outline",children:g}),e[17]=g,e[18]=w):w=e[18];let a;return e[19]!==l||e[20]!==w||e[21]!==f?(a=(0,o.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2 text-xs","data-testid":l,children:[f,w]}),e[19]=l,e[20]=w,e[21]=f,e[22]=a):a=e[22],a},"At"),Mt=h(d=>{let e=(0,B.c)(42),{busy:t,onCheck:r,references:l,t:n,truncated:c}=d,i;e[0]!==n?(i=n("Integrity"),e[0]=n,e[1]=i):i=e[1];let s;e[2]!==i?(s=(0,o.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[2]=i,e[3]=s):s=e[3];let u;e[4]!==n?(u=n("Orphaned objects"),e[4]=n,e[5]=u):u=e[5];let m;e[6]!==u?(m=(0,o.jsx)("span",{className:"text-sm font-medium text-foreground",children:u}),e[6]=u,e[7]=m):m=e[7];let f;e[8]!==n?(f=n("Find records whose file reference points at an object the bucket no longer has."),e[8]=n,e[9]=f):f=e[9];let g;e[10]!==f?(g=(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),e[10]=f,e[11]=g):g=e[11];let w;e[12]!==s||e[13]!==m||e[14]!==g?(w=(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[s,m,g]}),e[12]=s,e[13]=m,e[14]=g,e[15]=w):w=e[15];let a;e[16]!==t||e[17]!==n?(a=n(t?"Checking\u2026":"Check for orphans"),e[16]=t,e[17]=n,e[18]=a):a=e[18];let k;e[19]!==t||e[20]!==r||e[21]!==a?(k=(0,o.jsx)(ee,{"data-testid":"fb-orphans-check",disabled:t,onClick:r,size:"sm",type:"button",variant:"outline",children:a}),e[19]=t,e[20]=r,e[21]=a,e[22]=k):k=e[22];let S;e[23]!==w||e[24]!==k?(S=(0,o.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w,k]}),e[23]=w,e[24]=k,e[25]=S):S=e[25];let x;e[26]!==l||e[27]!==n||e[28]!==c?(x=c&&(0,o.jsx)("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:l===void 0||l.length===0?n("The bucket is larger than the scan's key limit, so dangling references could not be checked."):n("Showing the first {count} dangling references \u2014 the scan was truncated.",{count:l.length})}),e[26]=l,e[27]=n,e[28]=c,e[29]=x):x=e[29];let b;e[30]!==l?.length||e[31]!==n||e[32]!==c?(b=l?.length===0&&!c&&(0,o.jsx)(ve,{description:n("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:n("No dangling references.")}),e[30]=l?.length,e[31]=n,e[32]=c,e[33]=b):b=e[33];let y;e[34]!==l||e[35]!==n?(y=l!==void 0&&l.length>0&&(0,o.jsx)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:l.map(j=>(0,o.jsx)(Ut,{reference:j,t:n},`${j.table}\xB7${j.id}\xB7${j.column}`))}),e[34]=l,e[35]=n,e[36]=y):y=e[36];let v;return e[37]!==S||e[38]!==x||e[39]!==b||e[40]!==y?(v=(0,o.jsxs)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[S,x,b,y]}),e[37]=S,e[38]=x,e[39]=b,e[40]=y,e[41]=v):v=e[41],v},"Ut"),Bt=h(function(d,e){let t=(0,B.c)(18),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=new Set,t[0]=r):r=t[0];let[l,n]=(0,z.useState)(r),c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=h(x=>{n(b=>{let y=new Set(b);return y.has(x)?y.delete(x):y.add(x),y})},"a"),t[1]=c):c=t[1];let i=c,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=h(()=>{n(new Set)},"o"),t[2]=s):s=t[2];let u=s,m,f,g;if(t[3]!==d||t[4]!==e||t[5]!==l){let x;t[9]!==e?(x=h(b=>e(b),"y"),t[9]=e,t[10]=x):x=t[10],f=d.map(x),m=f.length>0&&f.every(b=>l.has(b)),g=!m&&f.some(b=>l.has(b)),t[3]=d,t[4]=e,t[5]=l,t[6]=m,t[7]=f,t[8]=g}else m=t[6],f=t[7],g=t[8];let w=g,a;t[11]!==f?(a=h(()=>{n(x=>f.every(b=>x.has(b))?new Set:new Set(f))},"i"),t[11]=f,t[12]=a):a=t[12];let k=a,S;return t[13]!==m||t[14]!==l||t[15]!==w||t[16]!==k?(S={allSelected:m,clear:u,selected:l,someSelected:w,toggle:i,toggleAll:k},t[13]=m,t[14]=l,t[15]=w,t[16]=k,t[17]=S):S=t[17],S},"Mt"),Pt=pe(xe.storageReferences),At=pe(xe.storageOrphans),Be=1e4,Wt=1e3,Ht=h(async d=>{let e=[],t,r=!0,l=!1;for(;r&&e.length<Be;){let n=await d.list({cursor:t,limit:Wt}),c=Be-e.length;for(let i of n.objects.slice(0,c))e.push(i.key);l||=n.objects.length>c,t=n.cursor,r=t!==void 0}return{liveKeys:e,truncated:l||r}},"qt"),Zt=3600,qt=h((d,e)=>{if(!("document"in globalThis))return;let t=globalThis.document.createElement("a");t.href=d,t.download=e,t.rel="noopener",globalThis.document.body.append(t),t.click(),t.remove()},"Vt"),Gt=h(d=>d.key,"Zt"),Vt=h(({initialPrefix:d,pageSize:e})=>{let t=ze(),[r,l]=(0,z.useState)(d??""),[n,c]=(0,z.useState)(d??""),[i,s]=(0,z.useState)(Ct),[u,m]=(0,z.useState)("list"),[f,g]=(0,z.useState)(128),[w,a]=(0,z.useState)("name"),[k,S]=(0,z.useState)("asc"),[x,b]=(0,z.useState)(void 0),[y,v]=(0,z.useState)(void 0),[j,N]=(0,z.useState)(!1),[C,T]=(0,z.useState)(void 0),[D,F]=(0,z.useState)(void 0),[$,O]=(0,z.useState)(""),[R,L]=(0,z.useState)({}),[_,E]=(0,z.useState)(!1),[I,M]=(0,z.useState)(void 0),[P,W]=(0,z.useState)(!1),[A,H]=(0,z.useState)(!1),[V,re]=(0,z.useState)([]),[q,we]=(0,z.useState)(""),ne=(0,z.useRef)(0),Q=(0,z.useRef)(0),ce=(0,z.useRef)(0);(0,z.useEffect)(()=>{let p={cancelled:!1};return Z((async()=>{try{let K=await t.listStorageBuckets();if(!p.cancelled){re(K);let[U]=K;U!==void 0&&we(J=>J===""?U:J)}}catch{}})()),()=>{p.cancelled=!0}},[t]);let G=(0,z.useMemo)(()=>({list:h(p=>t.listStorageObjects({...p,bucket:q}),"list"),remove:h(p=>t.deleteStorageObject(p,{bucket:q}),"remove"),signedUrl:h((p,K)=>t.signedStorageUrl(p,{...K,bucket:q}),"signedUrl"),upload:h(p=>t.uploadStorageObject({...p,bucket:q}),"upload")}),[q,t]),Y=(0,z.useCallback)(async(p,K,U,J=!1)=>{ne.current+=1;let me=ne.current;v(void 0),N(!0);try{let oe=await G.list({cursor:K,limit:e,prefix:p});if(me!==ne.current)return;b(Ce=>U&&Ce!==void 0?[...Ce,...oe.objects]:oe.objects),F(oe.cursor)}catch(oe){if(me!==ne.current)return;if(U||b(void 0),v(le(oe)),J)throw oe}finally{me===ne.current&&N(!1)}},[e,G]);(0,z.useEffect)(()=>{Z(Y(d??"",void 0,!1))},[Y,d]);let qe=(x?.length??0)<=e;De(()=>Y(r,void 0,!1,!0),qe);let{files:ue,folders:Ge}=zt(x??[],r),Ve=(0,z.useMemo)(()=>{let p=new Set;for(let K of ue)for(let U of Object.keys(K.customMetadata??{}))p.add(U);return[...p].toSorted((K,U)=>K.localeCompare(U))},[ue]),ie=jt(ue,w,k),fe=(0,z.useMemo)(()=>[...new Set(ie.map(p=>p.key))].toSorted((p,K)=>p.localeCompare(K)).join(`
3
+ `),[ie]);(0,z.useEffect)(()=>{let p=fe===""?[]:fe.split(`
4
+ `);if(p.length===0){L({});return}let K={current:!0};return Z((async()=>{try{let U=await t.query(Pt,{keys:p},be($));K.current&&(L(U.references??{}),E(Object.keys(U.storageColumns??{}).length>0))}catch{K.current&&(L({}),E(!1))}})()),()=>{K.current=!1}},[t,fe,$]);let{allSelected:Qe,clear:se,selected:Se,someSelected:Xe,toggle:Ye,toggleAll:Je}=Bt(ie,Gt),et=h(()=>{l(n),se(),Z(Y(n,void 0,!1))},"Me"),tt=h(()=>{Z(Y(r,D,!0))},"Ge"),Ne=h(p=>{l(p),c(p),se(),Z(Y(p,void 0,!1))},"ve"),rt=h(p=>{Ne(`${r}${p}`)},"He"),nt=h(p=>G.signedUrl(p,{expiresInSeconds:Zt}),"Pe"),ot=h(()=>{m("list")},"qe"),lt=h(()=>{m("grid")},"We"),st=h(p=>{a(p)},"Ve"),at=h(()=>{S(p=>p==="asc"?"desc":"asc")},"Ze"),ct=h(p=>{g(p)},"Xe"),it=h(p=>{s(p)},"Ye"),he=h(p=>{let K=ce.current;v(void 0),N(!0),Z((async()=>{try{await p(),K===ce.current&&await Y(r,void 0,!1)}catch(U){v(le(U))}K===ce.current&&N(!1)})())},"me"),dt=h(()=>{he(async()=>{for(let p of Se)await G.remove(p);se()})},"Je"),ut=h(p=>{v(void 0),Z((async()=>{try{let K=await G.signedUrl(p,{expiresInSeconds:i});je(K)&&T(p)}catch(K){v(le(K))}})())},"Qe"),ft=h(p=>{v(void 0),Z((async()=>{try{let K=await G.signedUrl(p,{expiresInSeconds:i}),U=p.slice(p.lastIndexOf("/")+1)||p;qt(K,U)}catch(K){v(le(K))}})())},"et");(0,z.useEffect)(()=>{if(C===void 0)return;let p=globalThis.setTimeout(()=>{T(void 0)},2e3);return()=>{globalThis.clearTimeout(p)}},[C]);let ht=h(p=>{he(async()=>{await G.remove(p)})},"tt"),mt=h(p=>{let K=`${r}${p.name}`;he(async()=>{let U=await p.arrayBuffer();await G.upload({body:U,contentType:p.type===""?void 0:p.type,key:K})})},"st");(0,z.useEffect)(()=>{Q.current+=1,M(void 0),H(!1)},[$]);let gt=h(()=>{Q.current+=1;let p=Q.current;v(void 0),W(!0),Z((async()=>{try{let{liveKeys:K,truncated:U}=await Ht(G);if(U)p===Q.current&&(M(void 0),H(!0));else{let J=await t.query(At,{liveKeys:K},be($));p===Q.current&&(M(J.references??[]),H(J.truncated===!0))}}catch(K){p===Q.current&&(M(void 0),H(!1),v(le(K)))}p===Q.current&&W(!1)})())},"lt"),pt=h(p=>{ne.current+=1,Q.current+=1,ce.current+=1,we(p),l(d??""),c(d??""),b(void 0),M(void 0),H(!1),se()},"nt");return{allSelected:Qe,bucket:q,buckets:V,bulkDelete:dt,busy:j,checkOrphans:gt,clearSelection:se,copiedKey:C,danglingBusy:P,danglingReferences:I,danglingTruncated:A,draftPrefix:n,enterFolder:rt,error:y,expiry:i,files:ie,folders:Ge,hasObjects:x!==void 0&&x.length>0,hasStorageColumns:_,listFirst:et,loaded:x!==void 0,loadMore:tt,navigate:Ne,nextCursor:D,onCopy:ut,onDelete:ht,onDownload:ft,onExpiryChange:it,onFile:mt,onSortKeyChange:st,onThumbSizeChange:ct,prefix:r,referenceShard:$,references:R,resolveUrl:nt,selectBucket:pt,selected:Se,setDraftPrefix:c,setReferenceShard:O,showGrid:lt,showList:ot,someSelected:Xe,sortDirection:k,sortKey:w,tagKeys:Ve,thumbSize:f,toggleSelect:Ye,toggleSelectAll:Je,toggleSortDirection:at,view:u}},"Xt"),Qt=100,Pe=h(d=>{let e=(0,B.c)(6),{label:t,onNavigate:r,target:l}=d,n;e[0]!==r||e[1]!==l?(n=h(()=>{r(l)},"l"),e[0]=r,e[1]=l,e[2]=n):n=e[2];let c=n,i;return e[3]!==c||e[4]!==t?(i=(0,o.jsx)("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:c,type:"button",children:t}),e[3]=c,e[4]=t,e[5]=i):i=e[5],i},"Ne"),Xt=h(d=>{let e=(0,B.c)(11),{onNavigate:t,prefix:r,t:l}=d,n;if(e[0]!==t||e[1]!==r||e[2]!==l){let c=r.split("/").filter(Yt),i;e[4]!==l?(i=l("Folder path"),e[4]=l,e[5]=i):i=e[5];let s;e[6]!==l?(s=l("root"),e[6]=l,e[7]=s):s=e[7];let u;e[8]!==t||e[9]!==s?(u=(0,o.jsx)(Pe,{label:s,onNavigate:t,target:""}),e[8]=t,e[9]=s,e[10]=u):u=e[10],n=(0,o.jsxs)("nav",{"aria-label":i,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[u,c.map((m,f)=>(0,o.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,o.jsx)("span",{className:"text-muted-foreground/50",children:"/"}),(0,o.jsx)(Pe,{label:m,onNavigate:t,target:`${c.slice(0,f+1).join("/")}/`})]},`${m}-${f.toString()}`))]}),e[0]=t,e[1]=r,e[2]=l,e[3]=n}else n=e[3];return n},"Jt"),gr=h(({initialPrefix:d,pageSize:e=Qt})=>{let t=Te(),r=Vt({initialPrefix:d,pageSize:e}),l=(0,z.useRef)(null),{onCopy:n,onDelete:c,onDownload:i,onFile:s,toggleSelect:u}=r,m={onCopy:n,onDelete:c,onDownload:i,onToggleSelect:u},f=h(()=>{l.current?.click()},"u"),g=h(a=>{let k=a.target,S=k.files?.[0];k.value="",S&&s(S)},"m"),w=r.loaded&&!r.hasObjects;return(0,o.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[(0,o.jsx)(Dt,{bucket:r.bucket,buckets:r.buckets,busy:r.busy,draftPrefix:r.draftPrefix,expiry:r.expiry,fileInputRef:l,onBucketChange:r.selectBucket,onExpiryChange:r.onExpiryChange,onFileChange:g,onList:r.listFirst,onPrefixChange:r.setDraftPrefix,onUploadClick:f,t}),r.loaded&&(0,o.jsx)(Xt,{onNavigate:r.navigate,prefix:r.prefix,t}),r.hasObjects&&(0,o.jsx)(Tt,{onSortKeyChange:r.onSortKeyChange,onThumbSizeChange:r.onThumbSizeChange,showGrid:r.showGrid,showList:r.showList,sortDirection:r.sortDirection,sortKey:r.sortKey,t,tagKeys:r.tagKeys,thumbSize:r.thumbSize,toggleSortDirection:r.toggleSortDirection,view:r.view}),r.hasStorageColumns&&(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[(0,o.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:t("References shard")}),(0,o.jsx)(Ee,{id:"fb-reference-shard-input",onChange:r.setReferenceShard,testId:"fb-reference-shard-input",value:r.referenceShard}),(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:t("Which shard's records are checked for references to these files. Empty = root shard.")})]}),r.hasStorageColumns&&(0,o.jsx)(Mt,{busy:r.danglingBusy,onCheck:r.checkOrphans,references:r.danglingReferences,t,truncated:r.danglingTruncated}),r.selected.size>0&&(0,o.jsx)(_e,{count:r.selected.size,editable:!0,onClear:r.clearSelection,onDelete:r.bulkDelete}),r.error!==void 0&&(0,o.jsx)("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:r.error}),w&&(0,o.jsx)(ve,{description:t("Objects you upload to your R2 buckets will appear here."),icon:(0,o.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,o.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"}),(0,o.jsx)("path",{d:"M12 11v5m-2.5-2.5h5"})]}),testId:"fb-empty",title:t("No objects.")}),r.hasObjects&&r.view==="list"&&(0,o.jsx)(St,{allSelected:r.allSelected,busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:m,onEnterFolder:r.enterFolder,prefix:r.prefix,references:r.references,selected:r.selected,showReferences:r.hasStorageColumns,someSelected:r.someSelected,t,toggleSelectAll:r.toggleSelectAll}),r.hasObjects&&r.view==="grid"&&(0,o.jsx)(_t,{busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:m,onEnterFolder:r.enterFolder,prefix:r.prefix,references:r.references,resolveUrl:r.resolveUrl,selected:r.selected,showReferences:r.hasStorageColumns,size:r.thumbSize,t}),r.nextCursor!==void 0&&(0,o.jsx)("div",{children:(0,o.jsx)(ee,{"data-testid":"fb-next",disabled:r.busy,onClick:r.loadMore,size:"sm",type:"button",variant:"outline",children:t("Load more")})})]})},"xs");function Yt(d){return d!==""}h(Yt,"Qt");export{gr as FileBrowser};